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

refactor(api-http): expose full tx receipt via ?fullReceipt flag #859

Merged
merged 7 commits into from
Feb 13, 2025

Conversation

oXtxNt9U
Copy link
Contributor

Summary

All endpoints returning a TransactionResource can now be instructed to include the full receipt by appending &fullReceipt=true to the query.

Without fuil receipt (default) http://localhost:4003/api/transactions
  {
    "amount": "0",
    "blockId": "a8031e12d06d329ef18f1ecf24922aa6ea95b492b34f44fa4a13d86697d73892",
    "confirmations": 223,
    "data": "0x6dd7d8ea000000000000000000000000fdea015390ac3c128162e0c12c10593e7ffe634b",
    "gasLimit": "200000",
    "gasPrice": "0",
    "id": "2454e8787ff987f7711955a301f6246487b58c29a0c411f256534f1acf806106",
    "nonce": "1",
    "recipient": "0x535B3D7A252fa034Ed71F0C53ec0C6F784cB64E1",
    "senderAddress": "0xfdEA015390aC3c128162E0c12C10593E7FFE634B",
    "senderPublicKey": "028a75b1e28948229e9ebed911ad1748e1e704441a1fe93b6e04c2d879f3e812c5",
    "signature": "8a5317b0bd3c4f5b0aa4802cfc88dc1b2d917c3320eecaf78c1074f8f1934ea56a04e92b4c59dd04b603508c08a6d1b69d038bfd2dbe8a28be154ee7b6341be11c",
    "signatures": null,
    "timestamp": 1739322515700,
    "receipt": {
      "gasUsed": 183633,
      "gasRefunded": 0,
      "success": true
    }
  }
With fuil receipt http://localhost:4003/api/transactions?fullReceipt=true
{
  "amount": "0",
  "blockId": "a8031e12d06d329ef18f1ecf24922aa6ea95b492b34f44fa4a13d86697d73892",
  "confirmations": 246,
  "data": "0x6dd7d8ea000000000000000000000000fdea015390ac3c128162e0c12c10593e7ffe634b",
  "gasLimit": "200000",
  "gasPrice": "0",
  "id": "2454e8787ff987f7711955a301f6246487b58c29a0c411f256534f1acf806106",
  "nonce": "1",
  "recipient": "0x535B3D7A252fa034Ed71F0C53ec0C6F784cB64E1",
  "senderAddress": "0xfdEA015390aC3c128162E0c12C10593E7FFE634B",
  "senderPublicKey": "028a75b1e28948229e9ebed911ad1748e1e704441a1fe93b6e04c2d879f3e812c5",
  "signature": "8a5317b0bd3c4f5b0aa4802cfc88dc1b2d917c3320eecaf78c1074f8f1934ea56a04e92b4c59dd04b603508c08a6d1b69d038bfd2dbe8a28be154ee7b6341be11c",
  "signatures": null,
  "timestamp": 1739322515700,
  "receipt": {
    "gasUsed": 183633,
    "gasRefunded": 0,
    "success": true,
    "output": "0x",
    "logs": [
      {
        "data": "0x000000000000000000000000fdea015390ac3c128162e0c12c10593e7ffe634b000000000000000000000000fdea015390ac3c128162e0c12c10593e7ffe634b",
        "topics": [
          "0xce0c7a2a940807f7dc2ce7a615c2532e915e6c0ac9a08bc4ed9d515a710a53e2"
        ],
        "address": "0x535b3d7a252fa034ed71f0c53ec0c6f784cb64e1"
      }
    ]
  }
}

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@sebastijankuzner sebastijankuzner merged commit 08b60df into develop Feb 13, 2025
9 checks passed
@sebastijankuzner sebastijankuzner deleted the refactor/api-http/tx-receipt branch February 13, 2025 10:08
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.

2 participants