/construction/payloads

POST https://rosetta.s0.b.hmny.io/construction/payloads

Overview

This endpoint is offline.

This endpoint is called with an array of operations and the response from /construction/metadata. It returns an unsigned transaction blob and a collection of payloads that must be signed by particular AccountIdentifiers using a certain SignatureType.

Reference Rosetta Documentation

Harmony Specific Documentation

Operations & Metadata

The operations here share the same constraints as the operations given to the /construction/preprocess endpoint. The metadata is assumed to be unchanged from the /construction/metadata endpoint. It may be useful to know that the operations & metadata is all that is needed to construct a valid transaction on the Harmony network.

Unsigned Transactions

This implementation makes no guarantee that the unsiged_transaction string will remain legable/formatted the way it is now. It is possible that the unsiged_transaction becomes a hex-encoded byte string in a future patch or minor update.

Signature Type

Harmony only supports the ecdsa_recovery signature type. This is not the same as the ecdsa signature type.

Request Body

{"network_identifier"=>{"blockchain"=>"Harmony", "network"=>"Testnet", "sub_network_identifier"=>{"network"=>"shard 0", "metadata"=>{"is_beacon"=>true}}}, "operations"=>[{"operation_identifier"=>{"index"=>0}, "type"=>"NativeTransfer", "status"=>"", "account"=>{"address"=>"one13lx3exmpfc446vsguc5d0mtgha2ff7h5uz85pk", "metadata"=>{"hex_address"=>"0x8fCD1C9B614E2b5D3208E628d7eD68bF5494faF4"}}, "amount"=>{"value"=>"-3347819199729047095735837923", "currency"=>{"symbol"=>"ONE", "decimals"=>18}}}, {"operation_identifier"=>{"index"=>1}, "related_operations"=>[{"index"=>0}], "type"=>"NativeTransfer", "status"=>"", "account"=>{"address"=>"one13lx3exmpfc446vsguc5d0mtgha2ff7h5uz85pk", "metadata"=>{"hex_address"=>"0x8fCD1C9B614E2b5D3208E628d7eD68bF5494faF4"}}, "amount"=>{"value"=>"3347819199729047095735837923", "currency"=>{"symbol"=>"ONE", "decimals"=>18}}}], "metadata"=>{"contract_code"=>"0x", "evm_error_message"=>"", "evm_return"=>"0x", "gas_limit"=>21000, "gas_price"=>2000000000, "nonce"=>0, "transaction_metadata"=>{"to_shard"=>0, "from_shard"=>0}}, "public_keys"=>[{"hex_bytes"=>"03f91adb1671a2430484441b591bdad19358458e938ba291bf9e717031b6c3330d", "curve_type"=>"secp256k1"}]}

RESPONSES

status: OK

{"unsigned_transaction":"{\"rlp_bytes\":\"8YCEdzWUAIJSCICAlI/NHJthTitdMgjmKNftaL9UlPr0jArRQEp4xFT22Xlk44CAgIA=\",\"is_staking\":false,\"contract_code\":\"0x\",\"from\":{\"address\":\"one13lx3exmpfc446vsguc5d0mtgha2ff7h5uz85pk\",\"metadata\":{\"hex_address\":\"0x8fCD1C9B614E2b5D3208E628d7eD68bF5494faF4\"}}}","payloads":[{"address":"one13lx3exmpfc446vsguc5d0mtgha2ff7h5uz85pk","hex_bytes":"c66fc277ffe2acb60c11774823b7378f5a3f2509f5cbf25cd7d8c4095b27ac04","account_identifier":{"address":"one13lx3exmpfc446vsguc5d0mtgha2ff7h5uz85pk","metadata":{"hex_address":"0x8fCD1C9B614E2b5D3208E628d7eD68bF5494faF4"}},"signature_type":"ecdsa_recovery"}]}