Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#29: Query pending transactions and return status #36

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mvandeberg
Copy link
Member

Resolves #29

Brief description

The transaction route now returns pending transactions and includes irreversibility status.

Checklist

  • I have built this pull request locally
  • I have ran the unit tests locally
  • I have manually tested this pull request
  • I have reviewed my pull request
  • I have added any relevant tests

Demonstration

Pending:

❯ curl http://localhost:3003/v1/transaction/0x1220c1452550eef00362dedf37e3812dc80d707efa0577f994b383ed3c5981bad023\?return_receipt=false | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   684    0   684    0     0   2874      0 --:--:-- --:--:-- --:--:--  2886
{
  "transaction": {
    "id": "0x1220c1452550eef00362dedf37e3812dc80d707efa0577f994b383ed3c5981bad023",
    "header": {
      "chain_id": "EiBncD4pKRIQWco_WRqo5Q-xnXR7JuO3PtZv983mKdKHSQ==",
      "rc_limit": "49964405674911",
      "nonce": "KAs=",
      "operation_merkle_root": "EiDrTJR7nmweQG5fqNzHuTyuy1k6-SkMnL3ZNHO1wxAfGg==",
      "payer": "147ABaHVxtpoSpfpZ8yry7eaFAjV87trGR"
    },
    "operations": [
      {
        "call_contract": {
          "contract_id": "1HnCM6v2bLg8Qhw6BKCVhGPeoTamJbkbFi",
          "entry_point": "transfer",
          "args": {
            "from": "147ABaHVxtpoSpfpZ8yry7eaFAjV87trGR",
            "to": "1PTDs8vJx7zKoRG1npVfEfTVGWWXSDWj83",
            "value": "100000000"
          }
        }
      }
    ],
    "signatures": [
      "H5AAyfTvI3-XNj0x7_tUAaBFFep4FaCU6cafLbrVzYmkOmbwo__9g7qa4hzxeatcSOhk_iGF19lAyUdW9cfVYnU="
    ]
  },
  "irreversible": false
}

Included:

{
  "transaction": {
    "id": "0x1220c1452550eef00362dedf37e3812dc80d707efa0577f994b383ed3c5981bad023",
    "header": {
      "chain_id": "EiBncD4pKRIQWco_WRqo5Q-xnXR7JuO3PtZv983mKdKHSQ==",
      "rc_limit": "49964405674911",
      "nonce": "KAs=",
      "operation_merkle_root": "EiDrTJR7nmweQG5fqNzHuTyuy1k6-SkMnL3ZNHO1wxAfGg==",
      "payer": "147ABaHVxtpoSpfpZ8yry7eaFAjV87trGR"
    },
    "operations": [
      {
        "call_contract": {
          "contract_id": "1HnCM6v2bLg8Qhw6BKCVhGPeoTamJbkbFi",
          "entry_point": "transfer",
          "args": {
            "from": "147ABaHVxtpoSpfpZ8yry7eaFAjV87trGR",
            "to": "1PTDs8vJx7zKoRG1npVfEfTVGWWXSDWj83",
            "value": "100000000"
          }
        }
      }
    ],
    "signatures": [
      "H5AAyfTvI3-XNj0x7_tUAaBFFep4FaCU6cafLbrVzYmkOmbwo__9g7qa4hzxeatcSOhk_iGF19lAyUdW9cfVYnU="
    ],
    "timestamp": "1737755510880"
  },
  "containing_blocks": [
    "0x12200c544e634b504bdc647534a6c846014faddf65ae48ecf1a7824ba5cff098ec7a"
  ],
  "irreversible": false
}

Irreversible:

{
  "transaction": {
    "id": "0x1220c1452550eef00362dedf37e3812dc80d707efa0577f994b383ed3c5981bad023",
    "header": {
      "chain_id": "EiBncD4pKRIQWco_WRqo5Q-xnXR7JuO3PtZv983mKdKHSQ==",
      "rc_limit": "49964405674911",
      "nonce": "KAs=",
      "operation_merkle_root": "EiDrTJR7nmweQG5fqNzHuTyuy1k6-SkMnL3ZNHO1wxAfGg==",
      "payer": "147ABaHVxtpoSpfpZ8yry7eaFAjV87trGR"
    },
    "operations": [
      {
        "call_contract": {
          "contract_id": "1HnCM6v2bLg8Qhw6BKCVhGPeoTamJbkbFi",
          "entry_point": "transfer",
          "args": {
            "from": "147ABaHVxtpoSpfpZ8yry7eaFAjV87trGR",
            "to": "1PTDs8vJx7zKoRG1npVfEfTVGWWXSDWj83",
            "value": "100000000"
          }
        }
      }
    ],
    "signatures": [
      "H5AAyfTvI3-XNj0x7_tUAaBFFep4FaCU6cafLbrVzYmkOmbwo__9g7qa4hzxeatcSOhk_iGF19lAyUdW9cfVYnU="
    ],
    "timestamp": "1737755510880"
  },
  "containing_blocks": [
    "0x12200c544e634b504bdc647534a6c846014faddf65ae48ecf1a7824ba5cff098ec7a"
  ],
  "irreversible": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Transaction status
1 participant