diff --git a/docs/transactions/transaction/build_unsigned_transaction.md b/docs/transactions/transaction/build_unsigned_transaction.md index 9f4e8e9d3..94c527c25 100644 --- a/docs/transactions/transaction/build_unsigned_transaction.md +++ b/docs/transactions/transaction/build_unsigned_transaction.md @@ -1,10 +1,14 @@ --- description: >- - Build a transaction to confirm its contents before submitting it to the - network. + Build a unsigned transaction for use with the offline transaction signer --- -# Build Transaction +# Build Unsigned Transaction + account_id: String, + recipient_public_address: Option, + value_pmob: Option, + fee: Option, + tombstone_block: Option, ## Parameters @@ -16,12 +20,8 @@ description: >- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `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 | +| `tombstone_block` | The block after which this transaction expires | If not provided, uses `cur_height` + 10 | | ## Example @@ -29,12 +29,11 @@ description: >- {% tab title="Request Body" %} ``` { - "method": "build_transaction", + "method": "build_unsigned_transaction", "params": { "account_id": "a8c9c7acb96cf4ad9154eec9384c09f2c75a340b441924847fe5f60a41805bde", "recipient_public_address": "CaE5bdbQxLG2BqAYAz84mhND79iBSs13ycQqN8oZKZtHdr6KNr1DzoX93c6LQWYHEi5b7YLiJXcTRzqhDFB563Kr1uxD6iwERFbw7KLWA6", "value_pmob": "42000000000000", - "log_tx_proposal": false }, "jsonrpc": "2.0", "id": 1 @@ -42,202 +41,12 @@ description: >- ``` {% endtab %} -{% tab title="Response" %} -``` -{ - "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": [ - [...] - ] - } - } -} -``` -{% endtab %} -{% endtabs %} - {% hint style="info" %} 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", + "method": "build_unsigned_transaction", "params": { "account_id": "a8c9c7acb96cf4ad9154eec9384c09f2c75a340b441924847fe5f60a41805bde", "recipient_public_address": "CaE5bdbQxLG2BqAYAz84mhND79iBSs13ycQqN8oZKZtHdr6KNr1DzoX93c6LQWYHEi5b7YLiJXcTRzqhDFB563Kr1uxD6iwERFbw7KLWA6", @@ -248,3 +57,232 @@ Since the `tx_proposal`JSON object is quite large, you may wish to write the res } ``` {% endhint %} + +{% tab title="Response" %} +``` +{ + "method": "build_unsigned_transaction", + "result": { + "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5", + "unsigned_tx": { + "inputs_and_real_indices_and_subaddress_indices": [ + [ + { + "ring": [ + { + "amount": { + "commitment": { + "point": [ + 110, + 67, + 108, + 179, + 54, + 239, + 253, + 171, + 25, + 26, + 42, + 36, + 161, + 47, + 182, + 162, + 238, + 150, + 19, + 239, + 135, + 105, + 35, + 199, + 135, + 39, + 241, + 153, + 28, + 47, + 238, + 34 + ] + }, + "masked_value": 13622244978257257768 + }, + "target_key": [ + 244, + 70, + 136, + 223, + 79, + 40, + 46, + 133, + 26, + 58, + 228, + 199, + 51, + 186, + 193, + 201, + 129, + 44, + 96, + 80, + 91, + 41, + 103, + 74, + 9, + 240, + 9, + 160, + 33, + 251, + 13, + 86 + ], + "public_key": [ + 202, + 221, + 20, + 237, + 139, + 55, + 248, + 142, + 20, + 163, + 56, + 0, + 203, + 217, + 174, + 194, + 249, + 51, + 180, + 242, + 161, + 82, + 223, + 204, + 72, + 3, + 62, + 149, + 66, + 222, + 117, + 106 + ], + "e_fog_hint": { + "bytes": [ + 110, + 125, + 227, + 82, + 218, + 223, + 95, + 65, + 209, + 228, + 38, + 49, + 180, + 30, + 18, + 49, + 58, + 67, + 91, + 98, + 221, + 188, + 168, + 9, + 11, + 66, + 158, + 35, + 115, + 162, + 5, + 22, + 132, + 130, + 172, + 91, + 159, + 113, + 119, + 242, + 178, + 138, + 201, + 130, + 130, + 199, + 191, + 105, + 231, + 220, + 247, + 41, + 98, + 55, + 110, + 66, + 36, + 92, + 129, + 122, + 27, + 4, + 197, + 19, + 129, + 63, + 29, + 172, + 110, + 35, + 188, + 80, + 155, + 166, + 150, + 57, + 186, + 20, + 204, + 69, + 238, + 45, + 1, + 0 + ] + }, + "e_memo": null + }, + ... + ], + "outlays": [ + [ + "2zXcnQgVixbzzicVCq6mYeiQrFJBcnkDJ2oNYN3dUU5sEJ9DJheKXZseAwkkuCKdhW3KWVjmb4owwHsA3DuhAWaZUQcEjixsjbVvAGUHJ2P", + 50000000000 + ] + ], + "fee": 400000000, + "tombstone_block_index": 692515 + }, + "fog_resolver": {} + }, + "jsonrpc": "2.0", + "id": 1 +} +``` +{% endtab %} +{% endtabs %} diff --git a/docs/view-only-accounts/account/import_view_only_account.md b/docs/view-only-accounts/account/import_view_only_account.md index 11d1e8f88..ab9fd90f0 100644 --- a/docs/view-only-accounts/account/import_view_only_account.md +++ b/docs/view-only-accounts/account/import_view_only_account.md @@ -1,7 +1,7 @@ --- description: >- Create a view-only account by importing the private key from an existing - account + account. Note: a single wallet cannot have both the regular and view-only versions of an account. --- # Import @@ -20,42 +20,39 @@ description: >- { "method": "import_view_only_account", "params": { - "package": { - "object": "view_only_account_import_package", - "account": { - "object": "view_only_account", - "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5", - "name": "ts-test-2", - "first_block_index": "0", - "next_block_index": "0", - "main_subaddress_index": "0", - "change_subaddress_index": "1", - "next_subaddress_index": "2" - }, - "secrets": { - "object": "view_only_account_secrets", - "view_private_key": "0a20f6fdc6e12fc60c39fe10be71a0ad7b2e6aaae98d56d59c6a71e3f4043b628b0c", - "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5" - }, - "subaddresses": [ - { - "object": "view_only_subaddress", - "public_address": "6MZ9Na9yC6upiE5BSe9gNsBX5zjwjuCASGNGmfvU8cCyWqo6xePySAU84zaMmSi3Zjrt2AKKXPcsy4J1CDmXmoZtFFo9QQ7cgpbUg8opX1y", - "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5", - "comment": "Main", - "subaddress_index": "0", - "public_spend_key": "0a208650eb2c525a41bcd88ce47dcf8f657bbe0882461ccace1afbc856e22e929348" - }, - { - "object": "view_only_subaddress", - "public_address": "6QYeh2h5WegDWGqFYgennj8vjaFzaFTmMZo5M84Ntcsnc69mLSdxrReKditxwLedBSktXznUrC4L3Q57vwiFzfHTXB2EgWQU8LHMB4UjBrj", - "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5", - "comment": "Change", - "subaddress_index": "1", - "public_spend_key": "0a20ee1adb69b3d6cb3173f712790ff1fe89a1312d678c82cb8e8c940ef9c9e8ed4c" - } - ] - } + "account": { + "object": "view_only_account", + "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5", + "name": "ts-test-2", + "first_block_index": "0", + "next_block_index": "0", + "main_subaddress_index": "0", + "change_subaddress_index": "1", + "next_subaddress_index": "2" + }, + "secrets": { + "object": "view_only_account_secrets", + "view_private_key": "0a20f6fdc6e12fc60c39fe10be71a0ad7b2e6aaae98d56d59c6a71e3f4043b628b0c", + "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5" + }, + "subaddresses": [ + { + "object": "view_only_subaddress", + "public_address": "6MZ9Na9yC6upiE5BSe9gNsBX5zjwjuCASGNGmfvU8cCyWqo6xePySAU84zaMmSi3Zjrt2AKKXPcsy4J1CDmXmoZtFFo9QQ7cgpbUg8opX1y", + "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5", + "comment": "Main", + "subaddress_index": "0", + "public_spend_key": "0a208650eb2c525a41bcd88ce47dcf8f657bbe0882461ccace1afbc856e22e929348" + }, + { + "object": "view_only_subaddress", + "public_address": "6QYeh2h5WegDWGqFYgennj8vjaFzaFTmMZo5M84Ntcsnc69mLSdxrReKditxwLedBSktXznUrC4L3Q57vwiFzfHTXB2EgWQU8LHMB4UjBrj", + "account_id": "f85920dd83f69d8850799e28240e3d395f0ad46dec2561b71f4614dd90a3edb5", + "comment": "Change", + "subaddress_index": "1", + "public_spend_key": "0a20ee1adb69b3d6cb3173f712790ff1fe89a1312d678c82cb8e8c940ef9c9e8ed4c" + } + ] }, "jsonrpc": "2.0", "api_version": "2",