ICP amount of the transaction record is 0, it can be found in rosetta api but not in the dashboard

I did a ckETH transaction in ICPSWAP.
From the dashboard, it looks like I enabled an APPROVE transaction first, then an ICP → ckETH transaction.
However, in the rosetta api it shows that I transferred a transaction with an ICP amount of 0 before making ICP → ckETH transaction.
In other words, there is no record of an Approve transaction in the rosetta api, but rather a transaction with an ICP of 0 instead of an Approve transaction.
I know this is a harmless issue, but am curious as to why exactly this would cause the rosetta api and dashboard to display differently?
And the hash of the two transactions doesn’t match, this is the dashboard hash:

cf9b288bd0101eb0fb603468a25bf0ef7541c95732ed57906988f8a49b617fdf

And this is rosetta hash:

cab120759a05ff8615b5c6263c29f31c45cac670e0ef640d8711904ff7de664c

But rosetta hash can’t query the data in dashboard, it can only be queried through api node, here is the data return value of rosetta

{
  "block_identifier": {
    "index": 12802495,
    "hash": "b00df8bdd22505cd7b9b44059b16e055c4faaeed315a72908c741bce5f5841aa"
  },
  "transaction": {
    "metadata": {
      "block_height": 12802495,
      "memo": 0,
      "timestamp": 1720668189304666600
    },
    "operations": [
      {
        "account": {
          "address": "0d21ad80532098e7ee1f47c5a3cc3e11ab69aa4b637516b56bccbad1a8d7ee27"
        },
        "amount": {
          "currency": {
            "symbol": "ICP",
            "decimals": 8
          },
          "value": "0"
        },
        "operation_identifier": {
          "index": 0
        },
        "status": "COMPLETED",
        "type": "TRANSACTION"
      },
      {
        "account": {
          "address": "df0104537832781dc8ed6f68298bb68edf788e2d03a81c47332f3981caa6646d"
        },
        "amount": {
          "currency": {
            "symbol": "ICP",
            "decimals": 8
          },
          "value": "0"
        },
        "operation_identifier": {
          "index": 1
        },
        "status": "COMPLETED",
        "type": "TRANSACTION"
      },
      {
        "account": {
          "address": "0d21ad80532098e7ee1f47c5a3cc3e11ab69aa4b637516b56bccbad1a8d7ee27"
        },
        "amount": {
          "value": "-10000",
          "currency": {
            "symbol": "ICP",
            "decimals": 8
          }
        },
        "operation_identifier": {
          "index": 2
        },
        "status": "COMPLETED",
        "type": "FEE"
      }
    ],
    "transaction_identifier": {
      "hash": "cab120759a05ff8615b5c6263c29f31c45cac670e0ef640d8711904ff7de664c"
    }
  }
}


Hi @e274426380, what version of Rosetta are you using?

If https://rosetta-api.internetcomputer.org, that is an old version of Rosetta that has been deprecated.

See here: Deprecation of Rosetta API instance

Yes, it is true that an older version of rosetta is used

Thanks for the reply, I actually checked the swagger api but there are some issues.
The max transaction limit in /Transactions/get_transactions_v2 is 100, which means I need to write a special paging method for that, which is a bit of a pain, but acceptable.
What I don’t understand is what before and after are, the description is: Pull all transactions before the given cursor.
My personal confusion is why there are so many mandatory parameters for this interface, couldn’t it be like the icrc1 standard where the minimum parameters are just account id and max_results.

The ICP Dashboard is not yet using that endpoint, and I have also noticed and reported the problems on the Swagger page for that endpoint. I’d recommend that for now, you use Transactions/get_transactions instead.

I tried the default parameter of Transactions/get_transactions and his return value is

{
  “total": 0,
  “blocks": []
}
access-control-allow-methods: GET,OPTIONS 
 access-control-allow-origin: * 
 cf-cache-status: DYNAMIC 
 cf-ray: 8ba2dfc4fa6580c3-NRT 
 content-length: 23 
 content-type: application/json 
 date: Wed,28 Aug 2024 08:19:02 GMT 
 server: cloudflare 
 vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers 
 x-content-type-options: nosniff 
 x-frame-options: DENY

Is this normal?
I tested again after removing the max_block_index from the default parameter as I understand it, and the result is still the same as above.

Most recent 100 transactions:
https://ledger-api.internetcomputer.org/transactions?limit=100&offset=0&sort_by=-block_height

Next 100, using the greatest block_height from the first response as the max_block_index to lock the data as you paginate:
https://ledger-api.internetcomputer.org/transactions?max_block_index=13651976&limit=100&offset=100&sort_by=-block_height

Next 100:
https://ledger-api.internetcomputer.org/transactions?max_block_index=13651976&limit=100&offset=200&sort_by=-block_height

And so on.

But when I try to check the transaction history of an account, I don’t get the return value.
For example, I set from_account to my account and no return value is found.
If from_account and to_account are both set to null there is a return value

To get the transaction history of an ICP account, you can use this endpoint:
https://ledger-api.internetcomputer.org/swagger-ui/#/Accounts/get_account_transactions

API is right here.
I originally thought it was in transactions.
Thanks for the answer, I’ll try to deprecate the rosetta api and use swagger afterward

1 Like