/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:
Transaction Operations Description Native same-shard transfer Gas
,NativeTransfer
All 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, theNativeTransfer
operationstatus
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 transfer Gas
,NativeCrossShardTransfer
All 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 creation Gas
,ContractCreation
All 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 theContractCreation
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.Staking Gas
,CreateValidator
,EditValidator
,Delegate
,CollectRewards
,Undelegate
These 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 thanGas
) contains the staking details of the operation (i.e: validator address/information). TheUndelegate
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). ADelegate
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 Payout UndelegationPayout
This is a special transaction that resulted in one or more previous undelegate staking transactions for an account. It incurs no gas fees. Genesis Genesis
This is a special transaction for the genesis block. It incurs no gas fees. Pre-Staking Rewards PreStakingBlockReward
This 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 Type Description undelegation
These 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.genesis
These transactions only appear on block 0. They indicate the initial native funds of the Harmony network. reward
These 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
{"transaction":{"transaction_identifier":{"hash":"0x133a3ac6d8a9f0ffb377d4c8bb805dbfbafe876eb3a2cd72142bafb23ea93a4f"},"operations":[{"operation_identifier":{"index":0},"type":"Gas","status":"success","account":{"address":"one1ru5znrwvrqg3caysp8pfugx4t9uj4wyz99pv0f","metadata":{"hex_address":"0x1f28298Dcc18111c749009C29E20d559792aB882"}},"amount":{"value":"-2100000000000000","currency":{"symbol":"ONE","decimals":18}}},{"operation_identifier":{"index":1},"related_operations":[{"index":0}],"type":"NativeTransfer","status":"success","account":{"address":"one1ru5znrwvrqg3caysp8pfugx4t9uj4wyz99pv0f","metadata":{"hex_address":"0x1f28298Dcc18111c749009C29E20d559792aB882"}},"amount":{"value":"-2423","currency":{"symbol":"ONE","decimals":18}}},{"operation_identifier":{"index":2},"related_operations":[{"index":1}],"type":"NativeTransfer","status":"success","account":{"address":"one18nxqvxhvq0vy9a4ql2tzfz7uauwh6q2sauhjeh","metadata":{"hex_address":"0x3cCC061AEC03D842F6a0fa96248bDceF1d7d0150"}},"amount":{"value":"2423","currency":{"symbol":"ONE","decimals":18}}}]}}