-
Notifications
You must be signed in to change notification settings - Fork 4
3. Transaction Reference
syuan100 edited this page Jul 29, 2021
·
4 revisions
Follow the guide below to create Helium transactions from Rosetta Operations.
Transaction |
---|
payment_v2 |
Order | Op Name | Notes |
---|---|---|
1 | DebitOp |
|
2 | CreditOp |
|
1n | DebitOp |
Repeat sets of DebitOp and CreditOps as desired to make multiple payments. |
2n | CreditOp |
See above. |
Note: A final DebitOp representing a fee is not necessary for Helium since transaction fees are automatically set for every transaction type and cannot be modified by the user.
Example: Payment of 0.1 HNT
"operations": [
{
"operation_identifier": {
"index": 0
},
"type": "debit_op",
"account": {
"address": "{{sending_address}}"
},
"amount": {
"value": "-10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"debit_category": "payment"
}
},
{
"operation_identifier": {
"index": 1
},
"type": "credit_op",
"account": {
"address": "{{receiving_address}}"
},
"amount": {
"value": "10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
}
]
Follow the guide below to decode Rosetta Operations into Helium transactions.
Transaction |
---|
payment_v1 |
payment_v2 |
Order | Op Name | Notes |
---|---|---|
1 | DebitOp |
|
2 | CreditOp |
|
3 | DebitOp |
Dangling DebitOp represents the fee for the transaction. |
Note: If fees are denoted in HNT, it means that an implicit burn has taken place and the DC transaction fee was calculated and deducted in HNT.
Example: Payment of 0.1 HNT
"operations": [
{
"operation_identifier": {
"index": 0
},
"type": "debit_op",
"account": {
"address": "{{sending_address}}"
},
"amount": {
"value": "-10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"debit_category": "payment"
}
},
{
"operation_identifier": {
"index": 1
},
"type": "credit_op",
"account": {
"address": "{{receiving_address}}"
},
"amount": {
"value": "10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
},
{
"operation_identifier": {
"index": 2
},
"type": "debit_op",
"status": "SUCCESS",
"account": {
"address": "{{sending_address}}"
},
"amount": {
"value": "-2812136",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"implicit_burn": true
}
}
]
Order | Op Name | Notes |
---|---|---|
1 | DebitOp |
|
2 | CreditOp |
|
1n | DebitOp |
Repeat sets of DebitOp and CreditOps as desired to make multiple payments. |
2n | CreditOp |
See above. |
*Final | DebitOp |
Dangling DebitOp represents the fee for the transaction. |
Note: If fees are denoted in HNT, it means that an implicit burn has taken place and the DC transaction fee was calculated and deducted in HNT.
Example: Payment to two different addresses of 0.1 HNT each
"operations": [
{
"operation_identifier": {
"index": 0
},
"type": "debit_op",
"account": {
"address": "{{sending_address}}"
},
"amount": {
"value": "-10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"debit_category": "payment"
}
},
{
"operation_identifier": {
"index": 1
},
"type": "credit_op",
"account": {
"address": "{{receiving_address_1}}"
},
"amount": {
"value": "10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
},
{
"operation_identifier": {
"index": 2
},
"type": "debit_op",
"account": {
"address": "{{sending_address}}"
},
"amount": {
"value": "-10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"debit_category": "payment"
}
},
{
"operation_identifier": {
"index": 3
},
"type": "credit_op",
"account": {
"address": "{{receiving_address_2}}"
},
"amount": {
"value": "10000000",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"credit_category": "payment"
}
},
{
"operation_identifier": {
"index": 4
},
"type": "debit_op",
"status": "SUCCESS",
"account": {
"address": "{{sending_address}}"
},
"amount": {
"value": "-2812136",
"currency": {
"symbol": "HNT",
"decimals": 8
}
},
"metadata": {
"implicit_burn": true
}
}
]