Build Transaction
Build a transaction to confirm its contents before submitting it to the network.
Parameters
account_id
The account on which to perform this action
Account must exist in the wallet
recipient_public_address
The recipient for this transaction
b58-encoded public address bytes
value_pmob
The amount of MOB to send in this transaction
addresses_and_values
An array of public addresses and value tuples
addresses are b58-encoded public addresses, value is in pmob
input_txo_ids
Specific TXOs to use as inputs to this transaction
TXO IDs (obtain from get_txos_for_account
)
fee
The fee amount to submit with this transaction
If not provided, uses MINIMUM_FEE
= .01 MOB
tombstone_block
The block after which this transaction expires
If not provided, uses cur_height
+ 10
max_spendable_value
The maximum amount for an input TXO selected for this transaction
log_tx_proposal
Whether or not to log the tx proposal on build. If this is false, it will not lock the txos in this step and other build and build-and-submit calls may use the same txos, causing one of them to fail if they are both submitted.
If not provided, is false
Example
{
"method": "build_transaction",
"params": {
"account_id": "a8c9c7acb96cf4ad9154eec9384c09f2c75a340b441924847fe5f60a41805bde",
"recipient_public_address": "CaE5bdbQxLG2BqAYAz84mhND79iBSs13ycQqN8oZKZtHdr6KNr1DzoX93c6LQWYHEi5b7YLiJXcTRzqhDFB563Kr1uxD6iwERFbw7KLWA6",
"value_pmob": "42000000000000",
"log_tx_proposal": false
},
"jsonrpc": "2.0",
"id": 1
}
{
"method": "build_transaction",
"result": {
"transaction_log_id": "ab447d73553309ccaf60aedc1eaa67b47f65bee504872e4358682d76df486a87",
"tx_proposal": {
"input_list": [
{
"tx_out": {
"amount": {
"commitment": "629abf4112819dadfa27947e04ce37d279f568350506e4060e310a14131d3f69",
"masked_value": "17560205508454890368"
},
"target_key": "eec9700ee08358842e16d43fe3df6e346c163b7f6007de4fcf3bafc954847174",
"public_key": "3209d365b449b577721430d6e0534f5a188dc4bdcefa02be2eeef45b2925bc1b",
"e_fog_hint": "ae39a969db8ef10daa4f70fa4859829e294ec704b0eb0a15f43ae91bb62bd9ff58ba622e5820b5cdfe28dde6306a6941d538d14c807f9045504619acaafbb684f2040107eb6868c8c99943d02077fa2d090d0100"
},
"subaddress_index": "0",
"key_image": "2a14381de88c3fe2b827f6adaa771f620873009f55cc7743dca676b188508605",
"value": "1",
"attempted_spend_height": "0",
"attempted_spend_tombstone": "0",
"monitor_id": ""
},
{
"tx_out": {
"amount": {
"commitment": "8ccbeaf28bad17ac6c64940aab010fedfdd44fb43c50c594c8fa6e8574b9b147",
"masked_value": "8257145351360856463"
},
"target_key": "2c73db6b914847d124a93691884d2fb181dfcf4d9182686e53c0464cf1c9a711",
"public_key": "ce43370def13a97830cf6e2e73020b5190d673bd75e0692cd18c850030cc3f06",
"e_fog_hint": "6b24ceb038ed5c31bfa8f69c73be59eca46612ba8bfea7f53bc52c97cdf549c419fa5a0b2219b1434848197fdbac7880b3a20d92c59c67ec570c7d60e263b4c7c61164f0517c8f774321435c3ec600593d610100"
},
"subaddress_index": "0",
"key_image": "a66fa1c3c35e2c2a56109a901bffddc1129625e4c4b381389f6be1b5bb3c7056",
"value": "97580449900010990",
"attempted_spend_height": "0",
"attempted_spend_tombstone": "0",
"monitor_id": ""
}
],
"outlay_list": [
{
"value": "42000000000000",
"receiver": {
"view_public_key": "5c04cc0de88725f811625b56844aacd789815d43d6df30354939aafd6e683d1a",
"spend_public_key": "aaf2937c73ef657a529d0f10aaaba394f41bf6f67d8da5ae13284afdb5bc657b",
"fog_report_url": "",
"fog_authority_fingerprint_sig": "",
"fog_report_id": ""
}
}
],
"tx": {
"prefix": {
"inputs": [
{
"ring": [
{
"amount": {
"commitment": "3c90eb914a5fe5eb11fab745c9bebfd988de71fa777521099bd442d0eecb765a",
"masked_value": "5446626203987095523"
},
"target_key": "f23c5dd112e5f453cf896294be705f52ee90e3cd15da5ea29a0ca0be410a592b",
"public_key": "084c6c6861146672eb2929a0dfc9b9087a49b6531964ca1892602a4e4d2b6d59",
"e_fog_hint": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
...
],
"proofs": [
{
"index": "24296",
"highest_index": "335531",
"elements": [
{
"range": {
"from": "24296",
"to": "24296"
},
"hash": "f7217a219665b1dfa3f216191de1c79e7d62f520e83afe256b6b43c64ead7d3f"
},
}
...
]
},
...
]
},
{
"ring": [
{
"amount": {
"commitment": "50b46eef8d223824f87316e6f446d50530929c8a758195005fbe9d41ec7fc227",
"masked_value": "11687342289991185016"
},
"target_key": "241d533daf32ed1523561c96c618808a2db9635075776ef42da32b34e7586058",
"public_key": "24725d8e47e4b03f6cb893369cc7582ea565dbd5e1914a5ecb3f4ed7910c5a03",
"e_fog_hint": "3fba73a6271141aae115148196ad59412b4d703847e0738c460c4d1831c6d44004c4deee4fabf6407c5f801703a31a13f1c70ed18a43a0d0a071b863a529dfbab51634fdf127ba2e7a7d426731ba59dbe3660100"
},
...
],
"proofs": [
{
"index": "173379",
"highest_index": "335531",
"elements": [
{
"range": {
"from": "173379",
"to": "173379"
},
"hash": "bcb26ff5d1104b8c0d7c9aed9b326c824151461257737e0fc4533d1a39e3a876"
},
...
]
},
...
]
}
],
"outputs": [
{
"amount": {
"commitment": "147113bbd5d4fdc5f9266ccdec6d6e6148e8dbc979d7d3bab1a91e99ab256518",
"masked_value": "3431426060591787774"
},
"target_key": "2c6a9c23810e91d8c504dd4fe59f07c2872a8a866c160a58928750eab7328c64",
"public_key": "0049281368c270eb5a7291fb012e95e776a07c1ff4336be1aa6a61abb1868229",
"e_fog_hint": "eb5b104677df5bbc22f70027646a448dcffb61eb31580d50f41cb487a87a9545d507d4c5e13a22f7fe3b2daea3f951b8d9901e73794d24650176faca3251dd904d7cac97ee73f50a84701cb4c297b31cbdf80100"
},
{
"amount": {
"commitment": "78083af2c1682f765c332c1c69af4260a410914962bddb9a30857a36aed75837",
"masked_value": "17824177895224156943"
},
"target_key": "68a193eeb7614e3dec6e980dfab2b14aa9b2c3dcaaf1c52b077fbbf259081d36",
"public_key": "6cdfd36e11042adf904d89bcf9b2eba950ad25f48ed6e877589c40caa1a0d50d",
"e_fog_hint": "c0c9fe3a43e237ad2f4ab055532831b95f82141c69c75bc6e913d0f37633cb224ce162e59240ffab51054b13e451bfeccb5a09fa5bfbd477c5a8e809297a38a0cb5233cc5d875067cbd832947ae48555fbc00100"
}
],
"fee": "10000000000",
"tombstone_block": "0"
},
"signature": {
"ring_signatures": [
{
"c_zero": "27a97dbbcf36257b31a1d64a6d133a5c246748c29e839c0f1661702a07a4960f",
"responses": [
"bc703776fd8b6b1daadf7e4df7ca4cb5df2d6498a55e8ff15a4bceb0e808ca06",
...
],
"key_image": "a66fa1c3c35e2c2a56109a901bffddc1129625e4c4b381389f6be1b5bb3c7056"
},
{
"c_zero": "421cc5527eae6519a8f20871996db99ffd91522ae7ed34e401249e262dfb2702",
"responses": [
"322852fd40d5bbd0113a6e56d8d6692200bcedbc4a7f32d9911fae2e5170c50e",
...
],
"key_image": "2a14381de88c3fe2b827f6adaa771f620873009f55cc7743dca676b188508605"
}
],
"pseudo_output_commitments": [
"1a79f311e74027bdc11fb479ce3a5c8feed6794da40e6ccbe45d3931cb4a3239",
"5c3406600fbf8e93dbf5b7268dfc43273f93396b2d4976b73cb935d5619aed7a"
],
"range_proofs": [
...
]
}
},
"fee": "10000000000",
"outlay_index_to_tx_out_index": [
[
"0",
"0"
]
],
"outlay_confirmation_numbers": [
[...]
]
}
}
}
Since the tx_proposal
JSON object is quite large, you may wish to write the result to a file for use in the submit_transaction
call, such as:
{
"method": "build_transaction",
"params": {
"account_id": "a8c9c7acb96cf4ad9154eec9384c09f2c75a340b441924847fe5f60a41805bde",
"recipient_public_address": "CaE5bdbQxLG2BqAYAz84mhND79iBSs13ycQqN8oZKZtHdr6KNr1DzoX93c6LQWYHEi5b7YLiJXcTRzqhDFB563Kr1uxD6iwERFbw7KLWA6",
"value_pmob": "42000000000000"
},
"jsonrpc": "2.0",
"id": 1
}
Last updated
Was this helpful?