/block/transaction

POST https://rosetta.s0.b.hmny.io/block/transaction

Overview

This endpoint gets a transaction in a block by its Transaction Identifier and Block Identifier.

Reference Rosetta Documentation

Harmony Specific Documentation

Transaction Operations

Each type of transaction on Harmony executes a certain set of operations (from /network/options). This relationship is mapped below:

TransactionOperationsDescription
Native same-shard transferGas, NativeTransferAll transactions incur gas fees. Both types of operations always appear together in a transaction. The amounts of the related NativeTransfer operations always sum to 0. If a transaction executed code in the EVM, the NativeTransfer operation status will indicate if it was successful or not. The metadata of these transactions will include the EVM logs (if any) as well as raw data of the transaction.
Native cross-shard transferGas, NativeCrossShardTransferAll transaction submissions (on the 'from' shard) incur gas fees. Cross-shard payouts (on the 'to' shard) will not incur gas. The metadata of these transactions will include the to & from shard ID as well as the related transaction identifier on the opposing shard.
Contract creationGas, ContractCreationAll transactions incur gas fees. Both types of operations always appear together in a transaction. The amounts of the related ContractCreation operations always sum to 0. The status of the ContractCreation operation will indicate if the contract was successfully deployed. The metadata of these transactions will include the contract account identifier, EVM logs (if any), and the raw data of the transaction.
StakingGas, CreateValidator, EditValidator, Delegate, CollectRewards, UndelegateThese transactions are only possible on the beacon shard (shard 0). All transactions incur gas fees. All operations that are not Gas are mutually exclusive in a transaction. The metadata of each operation (other than Gas) contains the staking details of the operation (i.e: validator address/information). The Undelegate operation always has 0 native tokens for the amount since the undelegation payout is done at a separate future block due to the locking period (the pending undelegate amount is stored in the metadata). A Delegate operation's amount need not be the exact amount delegated to the validator due to the re-delegation mechanism (which pulls funds from locked pending undelegations first).
Undelegation PayoutUndelegationPayoutThis is a special transaction that resulted in one or more previous undelegate staking transactions for an account. It incurs no gas fees.
GenesisGenesisThis is a special transaction for the genesis block. It incurs no gas fees.
Pre-Staking RewardsPreStakingBlockRewardThis is a special transaction for the pre-staking epoch. It incurs no gas fees.

Special Transactions

Some internal workings of the chain are expressed as special transactions since it changes the native token balance of accounts in the network. They are considered special since they cannot be directly created by a user, instead, they are the effects of previous transactions or derived from genesis settings.

All special transactions have the following identifier format to guarantee uniqueness: <block_hash>_<address>_<special_tx_type>. For example, here is a pre-staking block reward transaction identifier: 0x996be9b22c329f7b4e2f9a794414d9f6eec49ad40d28730ee085c8a9291ae91a_one14e5ffwdejnt7njgq54d9w8gltwrggdusyw7y5p_reward.

All of the special transaction types:

Special Tx TypeDescription
undelegationThese transactions appear on the last block of every epoch since the staking mechanism was enabled.
They indicate the final amount of native tokens credited to an account due to a previously submitted staking undelegation transaction.
genesisThese transactions only appear on block 0. They indicate the initial native funds of the Harmony network.
rewardThese transactions appear on block 2, up to the block before staking is enabled.
They indicate the block rewards (in native tokens) before the staking mechanism was enabled.

Request Body

{"network_identifier"=>{"blockchain"=>"Harmony", "network"=>"Testnet", "sub_network_identifier"=>{"network"=>"shard 0", "metadata"=>{"is_beacon"=>true}}}, "transaction_identifier"=>{"hash"=>"0x398c63f6958547bf65f7055175fb9428a9c644de205c8fc19e8deadc41104201"}, "block_identifier"=>{"index"=>2241386, "hash"=>"0x0376f64e703a25d41b4af91da402183f3b8cc9ab8b8c3f781377d99dd2c67555"}}

RESPONSES

status: OK

{&quot;transaction&quot;:{&quot;transaction_identifier&quot;:{&quot;hash&quot;:&quot;0x133a3ac6d8a9f0ffb377d4c8bb805dbfbafe876eb3a2cd72142bafb23ea93a4f&quot;},&quot;operations&quot;:[{&quot;operation_identifier&quot;:{&quot;index&quot;:0},&quot;type&quot;:&quot;Gas&quot;,&quot;status&quot;:&quot;success&quot;,&quot;account&quot;:{&quot;address&quot;:&quot;one1ru5znrwvrqg3caysp8pfugx4t9uj4wyz99pv0f&quot;,&quot;metadata&quot;:{&quot;hex_address&quot;:&quot;0x1f28298Dcc18111c749009C29E20d559792aB882&quot;}},&quot;amount&quot;:{&quot;value&quot;:&quot;-2100000000000000&quot;,&quot;currency&quot;:{&quot;symbol&quot;:&quot;ONE&quot;,&quot;decimals&quot;:18}}},{&quot;operation_identifier&quot;:{&quot;index&quot;:1},&quot;related_operations&quot;:[{&quot;index&quot;:0}],&quot;type&quot;:&quot;NativeTransfer&quot;,&quot;status&quot;:&quot;success&quot;,&quot;account&quot;:{&quot;address&quot;:&quot;one1ru5znrwvrqg3caysp8pfugx4t9uj4wyz99pv0f&quot;,&quot;metadata&quot;:{&quot;hex_address&quot;:&quot;0x1f28298Dcc18111c749009C29E20d559792aB882&quot;}},&quot;amount&quot;:{&quot;value&quot;:&quot;-2423&quot;,&quot;currency&quot;:{&quot;symbol&quot;:&quot;ONE&quot;,&quot;decimals&quot;:18}}},{&quot;operation_identifier&quot;:{&quot;index&quot;:2},&quot;related_operations&quot;:[{&quot;index&quot;:1}],&quot;type&quot;:&quot;NativeTransfer&quot;,&quot;status&quot;:&quot;success&quot;,&quot;account&quot;:{&quot;address&quot;:&quot;one18nxqvxhvq0vy9a4ql2tzfz7uauwh6q2sauhjeh&quot;,&quot;metadata&quot;:{&quot;hex_address&quot;:&quot;0x3cCC061AEC03D842F6a0fa96248bDceF1d7d0150&quot;}},&quot;amount&quot;:{&quot;value&quot;:&quot;2423&quot;,&quot;currency&quot;:{&quot;symbol&quot;:&quot;ONE&quot;,&quot;decimals&quot;:18}}}]}}