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

mintBurnHistory endpoint: add addresses (credentials) to the output #179

Merged

Conversation

ecioppettini
Copy link
Contributor

@ecioppettini ecioppettini commented Mar 22, 2024

context here: PaimaStudios/paima-engine#326

I'm not super convinced about the query yet (it works, but I'm not sure about the distinct), but I want to define the api first.

This adds two fields to the response in the mint burn history endpoint.

The idea is that burns would look like this:

  {
    "assets": {
      "0fc891fb7368d3b7c7b88815c203fda0d6862b0f1d797222672e91fe": {
        "546f6b656e31": "-500"
      }
    },
    "actionSlot": 733071,
    "metadata": "...",
    "txId": "58e4166f029f8da36172db20d9089b5930109584fc4331641a694438a513090d",
    "block": "3bf59edcb5114d492ecd8e41792cd8fd4bf14a8569e80bf93d7141cf9621729c",
    "inputAddresses": {
      "8200581ca44a4b45469f41af5f61fcfe2098e3230b935ee074fcf0f202654c62": [
        {
          "policyId": "0fc891fb7368d3b7c7b88815c203fda0d6862b0f1d797222672e91fe",
          "assetName": "546f6b656e31",
          "amount": "500"
        }
      ]
    },
    "outputAddresses": {}
  }

while mints would look like:

  {
    "assets": {
      "0fc891fb7368d3b7c7b88815c203fda0d6862b0f1d797222672e91fe": {
        "546f6b656e4d6574616461746132": "1",
        "546f6b656e4d6574616461746131": "1"
      }
    },
    "actionSlot": 733097,
    "metadata": "...",
    "txId": "98a9eeb50ee68a2dcb461bbcdf115ee5b395ff797f2904c6ddca7ffb449dc2ec",
    "block": "0425becb95ea75aa7c6e19b7a36046dc9d976ddfc239b30126fabd306a96ecf1",
    "inputAddresses": {},
    "outputAddresses": {
      "8200581c4b2e7295ac876cfdf70e82c1cb8df3ee5cb23d93949e3322230fc447": [
        {
          "policyId": "0fc891fb7368d3b7c7b88815c203fda0d6862b0f1d797222672e91fe",
          "assetName": "546f6b656e4d6574616461746131",
          "amount": "1"
        }
      ],
      "8200581c9f07ae02672368b23c0ea38fe4272e3a8fe5c7a34948121ad2489968": [
        {
          "policyId": "0fc891fb7368d3b7c7b88815c203fda0d6862b0f1d797222672e91fe",
          "assetName": "546f6b656e4d6574616461746132",
          "amount": "1"
        }
      ]
    }
  }

Currently the order in the two mappings is unspecified. I'm not really sure if it matters or not. The amount are included mostly because I think there could be extra non-minting inputs, for example, and that makes it more clear?

@ecioppettini ecioppettini self-assigned this Mar 22, 2024
@SebastienGllmt SebastienGllmt merged commit fa48e1d into main Mar 30, 2024
2 checks passed
@SebastienGllmt SebastienGllmt deleted the enzo/mint-burn-history-add-addresses-to-the-response branch March 30, 2024 19: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