-
Notifications
You must be signed in to change notification settings - Fork 4
5. Construction API Reference
Reference: https://www.rosetta-api.org/docs/ConstructionApi.html
https://www.rosetta-api.org/docs/ConstructionApi.html#constructioncombine
Helium specific notes:
Object | Type | Description |
---|---|---|
unsigned_transaction |
string | Unsigned transaction encoded as a base64 string. Derived from /construction/payloads. |
signing_payload |
SigningPayload | Transaction protobuf encoded as a hex string. Derived from /construction/payloads. |
public_key |
PublicKey | Account public key encoded as a hex string. |
signataure > hex_bytes
|
string | Resulting signature after the signing_payload has been signed (encoded as a hex string). This must be derived separately outside of Rosetta since Rosetta does NOT handle private keys. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"unsigned_transaction": "...",
"signatures": [
{
"signing_payload": {
"address": "...",
"hex_bytes": "..."
},
"public_key": {
"hex_bytes": "...",
"curve_type": "edwards25519"
},
"signature_type": "ed25519",
"hex_bytes": "..."
}
]
}
Helium specific notes:
Object | Type | Description |
---|---|---|
signed_transaction |
string | Signed transaction encoded as a base64 string. Should be directly passed to /construction/submit |
{
"signed_transaction": "..."
}
https://www.rosetta-api.org/docs/ConstructionApi.html#constructionderive
Helium specific notes:
Object | Type | Description |
---|---|---|
public_key |
string | Raw public key converted to a hex string. Cannot contain bytes for Helium specific properties like netType or keyType. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"public_key": {
"hex_bytes": "...",
"curve_type": "edwards25519"
}
}
{
"address": "...",
"account_identifier": {
"address": "..."
}
}
https://www.rosetta-api.org/docs/ConstructionApi.html#constructionhash
Helium specific notes:
Object | Type | Description |
---|---|---|
signed_transaction |
string | Signed transaction encoded as a base64 string. Derived from /construction/combine. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"signed_transaction": "..."
}
Helium specific notes:
Object | Type | Description |
---|---|---|
hash |
string | base64url encoded hash of the transaction. This is the main identifier for transactions on the Helium blockchain. |
{
"transaction_identifier": {
"hash": "..."
}
}
https://www.rosetta-api.org/docs/ConstructionApi.html#constructionmetadata
Helium specific notes:
Object | Type | Description |
---|---|---|
options |
object | Contains specific metadata requests generated from /combine/preprocess. If you'd like to create your own options object, see transaction specific documentation for metadata here. (TBD) Example below is for a payment_v2 transaction. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"options": {
"helium_metadata": {
"payer": "...",
"payments": [
{
"amount": 10000000,
"payee": "..."
}
]
},
"requested_metadata": {
"get_nonce_for": {
"address": "..."
}
},
"transaction_type": "payment_v2"
}
}
Helium specific notes:
Object | Type | Description |
---|---|---|
metadata |
object | Required helium metadata to complete transaction construction during submission to /construction/payloads. Usually always includes chain_vars and account nonce which are required for all transactions. Retains the original options object from /combine/preprocess so we are able to confirm intent. |
{
"metadata": {
"chain_vars": {
"allowPaymentV2Memos": true,
"allowZeroAmount": false,
"alphaDecay": 0.0035,
"assertLocTxnVersion": 2,
"batchSize": 400,
...
},
"get_nonce_for": {
"nonce": 139
},
"options": {
"requested_metadata": {
"get_nonce_for": {
"address": "..."
}
},
"helium_metadata": {
"payer": "...",
"payments": [
{
"amount": 10000000,
"payee": "..."
}
]
},
"transaction_type": "payment_v2"
}
}
}
https://www.rosetta-api.org/docs/ConstructionApi.html#constructionparse
Helium specific notes:
Object | Type | Description |
---|---|---|
signed |
boolean | Denotes whether or not the string represents a signed transaction. |
transaction |
string | Raw base64 transaction string to be parsed. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"signed": false,
"transaction": "..."
}
Helium specific notes:
Object | Type | Description |
---|---|---|
operations |
[]Operation | The transaction represented as an array of Operation objects. See Helium Operation reference (TBD) for how operations denote intent. Below is an example for a payment_v2 transaction with a single payment. |
{
"operations": [
{
"operation_identifier": {
"index": 0
},
"type": "debit_op",
"status": "SUCCESS",
"account": {
"address": "..."
},
"amount": {
"value": "-10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"debit_category": "payment"
}
},
{
"operation_identifier": {
"index": 1
},
"type": "credit_op",
"status": "SUCCESS",
"account": {
"address": "..."
},
"amount": {
"value": "10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
},
{
"operation_identifier": {
"index": 2
},
"type": "debit_op",
"status": "SUCCESS",
"account": {
"address": "..."
},
"amount": {
"value": "0",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"dc_fee": 35000,
"implicit_burn": false
}
}
]
}
https://www.rosetta-api.org/docs/ConstructionApi.html#constructionpayloads
Helium specific notes:
Object | Type | Description |
---|---|---|
operations |
[]Operation | An array of Operations that denote the intent to create a specific Helium transaction. See Helium Operation reference (TBD) for how operations denote intent. Below is an example for a payment_v2 transaction with a single payment. |
metadata |
object | Required helium metadata to complete transaction construction generated from /construction/metadata. Usually always includes chain_vars and account nonce which are required for all transactions. Retains the original options object from /combine/preprocess so we are able to confirm intent. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"operations": [
{
"operation_identifier": {
"index": 0
},
"type": "debit_op",
"account": {
"address": "..."
},
"amount": {
"value": "-10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
},
{
"operation_identifier": {
"index": 1
},
"type": "credit_op",
"account": {
"address": "..."
},
"amount": {
"value": "10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
}
],
"metadata": {
"chain_vars": {
"allowPaymentV2Memos": true,
"allowZeroAmount": false,
"alphaDecay": 0.0035,
"assertLocTxnVersion": 2,
"batchSize": 400,
"betaDecay": 0.002,
...
},
"get_nonce_for": {
"nonce": 2
},
"options": {
"requested_metadata": {
"get_nonce_for": {
"address": "..."
}
},
"helium_metadata": {
"payer": "...",
"payments": [
{
"amount": 10000000,
"payee": "..."
}
]
},
"transaction_type": "payment_v2"
}
}
}
Helium specific notes:
Object | Type | Description |
---|---|---|
unsigned_transaction |
string | Unsigned transaction encoded as a base64 string. To be passed to /construction/combine. |
signing_payload |
SigningPayload | Transaction protobuf encoded as a hex string, ready to be signed. To be passed to /construction/combine once the signature is derived. The signature must be derived separately outside of Rosetta since Rosetta does NOT handle private keys. |
{
"unsigned_transaction": "...",
"payloads": [
{
"hex_bytes": "..."
}
]
}
https://www.rosetta-api.org/docs/ConstructionApi.html#constructionpreprocess
Helium specific notes:
Object | Type | Description |
---|---|---|
operations |
[]Operation | An array of Operations that denote the intent to create a specific Helium transaction. See Helium Operation reference (TBD) for how operations denote intent. Below is an example for a payment_v2 transaction with a single payment. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"operations": [
{
"operation_identifier": {
"index": 0
},
"type": "debit_op",
"account": {
"address": "..."
},
"amount": {
"value": "-10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
},
{
"operation_identifier": {
"index": 1
},
"type": "credit_op",
"account": {
"address": "..."
},
"amount": {
"value": "10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
}
],
"metadata": {}
}
Helium specific notes:
Object | Type | Description |
---|---|---|
options |
object | Contains specific metadata requests to be passed to /construction/metadata to retrieve the necessary information to construct a transaction. Example below is for a payment_v2 transaction. |
{
"options": {
"helium_metadata": {
"payer": "...",
"payments": [
{
"amount": 10000000,
"payee": "..."
}
]
},
"requested_metadata": {
"get_nonce_for": {
"address": "..."
}
},
"transaction_type": "payment_v2"
}
}
https://www.rosetta-api.org/docs/ConstructionApi.html#constructionsubmit
Helium specific notes:
Object | Type | Description |
---|---|---|
signed_transaction |
string | Signed transaction encoded as a base64 string. Derived from /construction/combine. |
{
"network_identifier": {
"blockchain": "Helium",
"network": "Mainnet"
},
"signed_transaction": "..."
}
Helium specific notes:
Object | Type | Description |
---|---|---|
hash |
string | base64url encoded hash of the submitted transaction. This is the main identifier for transactions on the Helium blockchain. |
{
"transaction_identifier": {
"hash": "..."
}
}