diff --git a/doc/api/api.md b/doc/api/api.md index b7621f19b..0f3f3f729 100644 --- a/doc/api/api.md +++ b/doc/api/api.md @@ -5,7 +5,8 @@ This document contains the documentation for the 3 Grin REST APIs. These endpoin ## Node API This endpoint is used to query a node about various information on the blockchain, networks and peers. By default, this REST API will listen on `localhost:13413`. This API is started as the same time as the Grin node. -To learn about what specific calls can be made read the [node API doc](node_api.md). +This endpoint requires, by default, Basic Authentication. The username is `grin` and the password can be found in the `.api_secret` file. +To learn about what specific calls can be made read the [node API doc](node_api.md).` ## Wallet APIs @@ -17,4 +18,5 @@ To learn about what specific calls can be made read the [wallet foreign API doc] ### Wallet Owner API The wallet owner API is an endpoint to manage the user wallet: broadcast transaction, sign transaction, see the current balance... This REST API can be started with the `grin wallet owner_api` command and will listen on `localhost:13420`. This endpoint must **never** be exposed to the outside world. +This endpoint requires, by default, Basic Authentication. The username is `grin` and the password can be found in the `.api_secret` file. To learn about what specific calls can be made read the [wallet owner API doc](wallet_owner_api.md). diff --git a/doc/api/node_api.md b/doc/api/node_api.md index 3b01faac6..09e44f4db 100644 --- a/doc/api/node_api.md +++ b/doc/api/node_api.md @@ -92,11 +92,12 @@ Optionally return results as "compact blocks" by passing `?compact` query. | - block_height | number | Block height at which the output is found | | - merkle_proof | string | Merkle proof | | kernels | []object | Transaction Kernels (a proof that a transaction sums to zero) | - | - features | string | Rank of the user | - | - fee | number | Hashrate of the user | - | - lock_height | number | Rank of the user | - | - excess | string | Hashrate of the user | - | - excess_sig | string | Rank of the user | + | - features | object | Options for a kernel's structure or use | + | - bits | number | Representation of the features in bits | + | - fee | number | Fee originally included in the transaction this proof is for | + | - lock_height | number | The max lock_height of all inputs to this transaction | + | - excess | []number | Remainder of the sum of all transaction commitments | + | - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | * **Error Response:** @@ -732,11 +733,12 @@ UTXO traversal. Retrieves last utxos since a start index until a max. | - block_height | number | Block height at which the output is found | | - merkle_proof | string | Merkle proof | | kernels | []object | Transaction Kernels (a proof that a transaction sums to zero) | - | - features | string | Rank of the user | - | - fee | number | Hashrate of the user | - | - lock_height | number | Rank of the user | - | - excess | string | Hashrate of the user | - | - excess_sig | string | Rank of the user | + | - features | object | Options for a kernel's structure or use | + | - bits | number | Representation of the features in bits | + | - fee | number | Fee originally included in the transaction this proof is for | + | - lock_height | number | The max lock_height of all inputs to this transaction | + | - excess | []number | Remainder of the sum of all transaction commitments | + | - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | * **Error Response:** diff --git a/doc/api/wallet_foreign_api.md b/doc/api/wallet_foreign_api.md index e69de29bb..f37a90cb5 100644 --- a/doc/api/wallet_foreign_api.md +++ b/doc/api/wallet_foreign_api.md @@ -0,0 +1,188 @@ +# Wallet Foreign API Documentation + +## Table of Contents + +1. [Wallet Foreign Endpoint](#wallet-foreign-endpoint) + 1. [POST Build Coinbase](#post-build-coinbase) + 1. [POST Receive Tx](#post-receive-tx) + +## Wallet Foreign Endpoint + +### POST Build Coinbase + +Creates a coinbase output for the given height and block fees + +* **URL** + + /v1/wallet/foreign/build_coinbase + +* **Method:** + + `POST` + +* **URL Params** + + None + +* **Data Params** + + ```json + { + "fees": x, + "height":y, + } + ``` + + **Required:** + `fees=[number]` + `height=[number]` + +* **Success Response:** + + * **Code:** 200 + * **Content:** + + | Field | Type | Description | + |:-------|:---------|:---------------| + | output | string | Output | + | kernel | string | Kernel | + | key_id | string | Key identifier | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + var coinbase_data = { + fees: 0, + height: 123456 + } + $.ajax({ + url: "/v1/wallet/foreign/build_coinbase", + dataType: "json", + type : "POST", + success : function(r) { + console.log(r); + }, + data: JSON.stringify(coinbase_data) + }); + ``` + +### POST Receive Tx + +Receives a transaction, modifying the slate accordingly (which can then be sent back to sender for posting) + +* **URL** + + /v1/wallet/foreign/receive_tx + +* **Method:** + + `POST` + +* **URL Params** + + None + +* **Data Params** + + **Required:** A transaction slate in JSON. + + | Field | Type | Description | + |:----------------------|:---------|:--------------------------------------------------------------------------| + | num_participants | number | The number of participants intended to take part in this transaction | + | id | number | Unique transaction ID, selected by sender | + | tx | object | The core transaction data (inputs, outputs, kernels and kernel offset) | + | - offset | []number | The kernel "offset" k2, excess is k1G after splitting the key k = k1 + k2 | + | - body | object | The transaction body - inputs/outputs/kernels | + | - - inputs | []object | List of inputs spent by the transaction | + | - - - features | object | The features of the output being spent | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The commit referencing the output being spent | + | - - outputs | []object | List of outputs the transaction produces | + | - - - features | object | Options for an output's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The homomorphic commitment representing the output amount | + | - - - proof | []number | A proof that the commitment is in the right range | + | - - kernels | []object | List of kernels that make up this transaction (usually a single kernel) | + | - - - features | object | Options for a kernel's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - fee | number | Fee originally included in the transaction this proof is for | + | - - - lock_height | number | The max lock_height of all inputs to this transaction | + | - - - excess | []number | Remainder of the sum of all transaction commitments | + | - - - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | + | amount | number | Base amount (excluding fee) | + | fee | number | Fee amount | + | height | number | Block height for the transaction | + | lock_height | number | Lock height | + | participant_data | object | Participant data | + | - id | number | Id of participant in the transaction. (For now, 0=sender, 1=rec) | + | - public_blind_excess | []number | Public key corresponding to private blinding factor | + | - public_nonce | []number | Public key corresponding to private nonce | + | - part_sig | []number | Public partial signature | + + *Note on participant data*: each participant in the transaction will insert their public data here. For now, 0 is sender and 1 is receiver, though this will change for multi-party transactions. + +* **Success Response:** + + * **Code:** 200 + * **Content:** A new transaction slate in JSON. + + | Field | Type | Description | + |:----------------------|:---------|:--------------------------------------------------------------------------| + | num_participants | number | The number of participants intended to take part in this transaction | + | id | number | Unique transaction ID, selected by sender | + | tx | object | The core transaction data (inputs, outputs, kernels and kernel offset) | + | - offset | []number | The kernel "offset" k2, excess is k1G after splitting the key k = k1 + k2 | + | - body | object | The transaction body - inputs/outputs/kernels | + | - - inputs | []object | List of inputs spent by the transaction | + | - - - features | object | The features of the output being spent | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The commit referencing the output being spent | + | - - outputs | []object | List of outputs the transaction produces | + | - - - features | object | Options for an output's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The homomorphic commitment representing the output amount | + | - - - proof | []number | A proof that the commitment is in the right range | + | - - kernels | []object | List of kernels that make up this transaction (usually a single kernel) | + | - - - features | object | Options for a kernel's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - fee | number | Fee originally included in the transaction this proof is for | + | - - - lock_height | number | The max lock_height of all inputs to this transaction | + | - - - excess | []number | Remainder of the sum of all transaction commitments | + | - - - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | + | amount | number | Base amount (excluding fee) | + | fee | number | Fee amount | + | height | number | Block height for the transaction | + | lock_height | number | Lock height | + | participant_data | object | Participant data | + | - id | number | Id of participant in the transaction. (For now, 0=sender, 1=rec) | + | - public_blind_excess | []number | Public key corresponding to private blinding factor | + | - public_nonce | []number | Public key corresponding to private nonce | + | - part_sig | []number | Public partial signature | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + var coinbase_data = { + fees: 0, + height: 123456 + } + $.ajax({ + url: "/v1/wallet/foreign/build_coinbase", + dataType: "json", + type : "POST", + success : function(r) { + console.log(r); + }, + data: { + file: tx.json + }, + }); + ``` \ No newline at end of file diff --git a/doc/api/wallet_owner_api.md b/doc/api/wallet_owner_api.md index e69de29bb..1273e7902 100644 --- a/doc/api/wallet_owner_api.md +++ b/doc/api/wallet_owner_api.md @@ -0,0 +1,617 @@ +# Wallet Owner API Documentation + +## Table of Contents + +1. [Wallet Owner Endpoint](#wallet-owner-endpoint) + 1. [GET Retrieve Outputs](#get-retrieve-outputs) + 1. [GET Retrieve Summary Info](#get-retrieve-summary-info) + 1. [GET Node Height](#get-node-height) + 1. [GET Retrieve Txs](#get-retrieve-txs) + 1. [GET Dump Stored Tx](#get-dump-stored-tx) + 1. [POST Issue Send Tx](#post-issue-send-tx) + 1. [POST Finalize Tx](#post-finalize-tx) + 1. [POST Cancel Tx](#post-cancel-tx) + 1. [POST Issue Burn Tx](#post-issue-burn-tx) + +## Wallet Owner Endpoint + +### GET Retrieve Outputs + +Attempt to update and retrieve outputs. + +* **URL** + + /v1/wallet/owner/retrieve_outputs + or + /v1/wallet/owner/retrieve_outputs?refresh&show_spent&tx_id=x&tx_id=y + +* **Method:** + + `GET` + +* **URL Params** + + **Optional:** + + `refresh` to refresh from node + `show_spent` to show spent outputs + `tx_id=[number]` to retrieve only the specified output + +* **Data Params** + + None + +* **Success Response:** + + * **Code:** 200 + * **Content:** Array of + + | Field | Type | Description | + |:---------------------|:---------|:---------------------------------------------------------------| + | | bool | Whether it was refreshed from node | + | - | []object | Array | + | - - | []object | Array of Output Data | + | - - - | object | Output Data | + | - - - - root_key_id | string | Root key_id that the key for this output is derived from | + | - - - - key_id | string | Derived key for this output | + | - - - - n_child | number | How many derivations down from the root key | + | - - - - value | number | Value of the output, necessary to rebuild the commitment | + | - - - - status | string | Current status of the output | + | - - - - height | number | Height of the output | + | - - - - lock_height | number | Height we are locked until | + | - - - - is_coinbase | bool | Is this a coinbase output? Is it subject to coinbase locktime? | + | - - - - tx_log_entry | number | Optional corresponding internal entry in tx entry log | + | - - - | []number | Pedersen Commitment | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + $.ajax({ + url: "/v1/wallet/owner/retrieve_outputs?refresh&id=3", + dataType: "json", + type : "GET", + success : function(r) { + console.log(r); + } + }); + ``` + +### GET Retrieve Summary Info + + Retrieve summary info for wallet. + +* **URL** + + /v1/wallet/owner/retrieve_summary_info + /v1/wallet/owner/retrieve_summary_info?refresh + +* **Method:** + + `GET` + +* **URL Params** + + **Optional:** + + `refresh` to refresh from node + +* **Data Params** + + None + +* **Success Response:** + + * **Code:** 200 + * **Content:** Array of + + | Field | Type | Description | + |:----------------------------------|:---------|:----------------------------------------| + | | bool | Whether it was refreshed from node | + | - | object | Wallet information | + | - - last_confirmed_height | number | Height from which info was taken | + | - - total | number | Total amount in the wallet | + | - - amount_awaiting_confirmation | number | Amount awaiting confirmation | + | - - amount_immature | number | Coinbases waiting for lock height | + | - - amount_currently_spendable | number | Amount currently spendable | + | - - amount_locked | number | Amount locked via previous transactions | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + $.ajax({ + url: "/v1/wallet/owner/retrieve_summary_info", + dataType: "json", + type : "GET", + success : function(r) { + console.log(r); + } + }); + ``` + +### GET Node Height + +Retrieve current height from node. + +* **URL** + + /v1/wallet/owner/node_height + +* **Method:** + + `GET` + +* **URL Params** + + None + +* **Data Params** + + None + +* **Success Response:** + + * **Code:** 200 + * **Content:** Array of + + | Field | Type | Description | + |:-------|:---------|:-------------------------------------------| + | | number | Node height | + | | bool | Wether the update from node was successful | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + $.ajax({ + url: "/v1/wallet/owner/node_height", + dataType: "json", + type : "GET", + success : function(r) { + console.log(r); + } + }); + ``` + +### GET Retrieve Txs + +Attempt to update outputs and retrieve transactions. +Return whether the outputs were validated against a node and an array of TxLogEntry. + +* **URL** + + /v1/wallet/owner/retrieve_txs + or + /v1/wallet/owner/retrieve_txs?refresh?id=x + +* **Method:** + + `GET` + +* **URL Params** + + **Optional:** + + `refresh` to refresh from node + `tx_id=[number]` to retrieve only the specified output + +* **Data Params** + + None + +* **Success Response:** + + * **Code:** 200 + * **Content:** Array of + + | Field | Type | Description | + |:----------------------|:---------|:----------------------------------------------------------------------------| + | | bool | Whether it was refreshed from node | + | - | []object | Array of transactions | + | - - | object | TxLogEntry | + | - - - id | number | Local id for this transaction (distinct from a slate transaction id) | + | - - - tx_slate_id | string | Slate transaction this entry is associated with, if any | + | - - - tx_type | string | Transaction type | + | - - - creation_ts | string | Time this tx entry was created | + | - - - confirmation_ts | string | Time this tx was confirmed (by this wallet) | + | - - - confirmed | bool | Whether the inputs+outputs involved in this transaction have been confirmed | + | - - - num_inputs | number | number of inputs involved in TX | + | - - - num_outputs | number | number of outputs involved in TX | + | - - - amount_credited | number | Amount credited via this transaction | + | - - - amount_debited | number | Amount debited via this transaction | + | - - - fee | number | Fee | + | - - - tx_hex | string | The transaction json itself, stored for reference or resending | + + *Note on transaction type*: transaction type can be either `ConfirmedCoinbase`, `TxReceived`, `TxSent`, `TxReceivedCancelled` and `TxSentCancelled`. + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + $.ajax({ + url: "/v1/wallet/foreign/retrieve_txs", + dataType: "json", + type : "GET", + success : function(r) { + console.log(r); + } + }); + ``` + +### GET Dump Stored Tx + +Retrieves a given transaction. + +* **URL** + + /v1/wallet/owner/dump_stored_tx?id=x + +* **Method:** + + `GET` + +* **URL Params** + + **Required:** + `id=[number]` + +* **Data Params** + + None + +* **Success Response:** + + * **Code:** 200 + * **Content:** A deserialized transaction. + + | Field | Type | Description | + |:----------------------|:---------|:--------------------------------------------------------------------------| + | | object | The core transaction data (inputs, outputs, kernels and kernel offset) | + | - offset | []number | The kernel "offset" k2, excess is k1G after splitting the key k = k1 + k2 | + | - body | object | The transaction body - inputs/outputs/kernels | + | - - inputs | []object | List of inputs spent by the transaction | + | - - - features | object | The features of the output being spent | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The commit referencing the output being spent | + | - - outputs | []object | List of outputs the transaction produces | + | - - - features | object | Options for an output's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The homomorphic commitment representing the output amount | + | - - - proof | []number | A proof that the commitment is in the right range | + | - - kernels | []object | List of kernels that make up this transaction (usually a single kernel) | + | - - - features | object | Options for a kernel's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - fee | number | Fee originally included in the transaction this proof is for | + | - - - lock_height | number | The max lock_height of all inputs to this transaction | + | - - - excess | []number | Remainder of the sum of all transaction commitments | + | - - - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + $.ajax({ + url: "/v1/wallet/owner/dump_stored_tx?id=13", + dataType: "json", + type : "GET", + success : function(r) { + console.log(r); + } + }); + ``` + +### POST Issue Send Tx + +Send a transaction either directly by http or file (then display the slate) + +* **URL** + + /v1/wallet/owner/issue_send_tx + +* **Method:** + + `POST` + +* **URL Params** + + None + +* **Data Params** + + **Required:** + + | Field | Type | Description | + |:------------------------------|:---------|:-------------------------------------| + | amount | number | Amount to send | + | minimum_confirmations | number | Minimum confirmations | + | method | string | Payment method | + | dest | string | Destination url | + | max_outputs | number | Max number of outputs | + | num_change_outputs | number | Number of change outputs to generate | + | selection_strategy_is_use_all | bool | Whether to use all outputs (combine) | + | fluff | bool | Dandelion control | + +* **Success Response:** + + * **Code:** 200 + * **Content:** A new transaction slate in JSON. + + | Field | Type | Description | + |:----------------------|:---------|:--------------------------------------------------------------------------| + | num_participants | number | The number of participants intended to take part in this transaction | + | id | number | Unique transaction ID, selected by sender | + | tx | object | The core transaction data (inputs, outputs, kernels and kernel offset) | + | - offset | []number | The kernel "offset" k2, excess is k1G after splitting the key k = k1 + k2 | + | - body | object | The transaction body - inputs/outputs/kernels | + | - - inputs | []object | List of inputs spent by the transaction | + | - - - features | object | The features of the output being spent | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The commit referencing the output being spent | + | - - outputs | []object | List of outputs the transaction produces | + | - - - features | object | Options for an output's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The homomorphic commitment representing the output amount | + | - - - proof | []number | A proof that the commitment is in the right range | + | - - kernels | []object | List of kernels that make up this transaction (usually a single kernel) | + | - - - features | object | Options for a kernel's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - fee | number | Fee originally included in the transaction this proof is for | + | - - - lock_height | number | The max lock_height of all inputs to this transaction | + | - - - excess | []number | Remainder of the sum of all transaction commitments | + | - - - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | + | amount | number | Base amount (excluding fee) | + | fee | number | Fee amount | + | height | number | Block height for the transaction | + | lock_height | number | Lock height | + | participant_data | object | Participant data | + | - id | number | Id of participant in the transaction. (For now, 0=sender, 1=rec) | + | - public_blind_excess | []number | Public key corresponding to private blinding factor | + | - public_nonce | []number | Public key corresponding to private nonce | + | - part_sig | []number | Public partial signature | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + var coinbase_data = { + fees: 0, + height: 123456 + } + $.ajax({ + url: "/v1/wallet/owner/issue_send_tx", + dataType: "json", + type : "POST", + success : function(r) { + console.log(r); + }, + data: { + file: tx_args.json + }, + }); + ``` + +### POST Finalize Tx + +Sender finalization of the transaction. Takes the slate returned by the sender as well as the private file generate on the first send step. +Builds the complete transaction and sends it to a grin node for propagation. + +* **URL** + + /v1/wallet/owner/finalize_tx + +* **Method:** + + `POST` + +* **URL Params** + + None + +* **Data Params** + + **Required:** A transaction slate in JSON. + + | Field | Type | Description | + |:----------------------|:---------|:--------------------------------------------------------------------------| + | num_participants | number | The number of participants intended to take part in this transaction | + | id | number | Unique transaction ID, selected by sender | + | tx | object | The core transaction data (inputs, outputs, kernels and kernel offset) | + | - offset | []number | The kernel "offset" k2, excess is k1G after splitting the key k = k1 + k2 | + | - body | object | The transaction body - inputs/outputs/kernels | + | - - inputs | []object | List of inputs spent by the transaction | + | - - - features | object | The features of the output being spent | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The commit referencing the output being spent | + | - - outputs | []object | List of outputs the transaction produces | + | - - - features | object | Options for an output's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The homomorphic commitment representing the output amount | + | - - - proof | []number | A proof that the commitment is in the right range | + | - - kernels | []object | List of kernels that make up this transaction (usually a single kernel) | + | - - - features | object | Options for a kernel's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - fee | number | Fee originally included in the transaction this proof is for | + | - - - lock_height | number | The max lock_height of all inputs to this transaction | + | - - - excess | []number | Remainder of the sum of all transaction commitments | + | - - - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | + | amount | number | Base amount (excluding fee) | + | fee | number | Fee amount | + | height | number | Block height for the transaction | + | lock_height | number | Lock height | + | participant_data | object | Participant data | + | - id | number | Id of participant in the transaction. (For now, 0=sender, 1=rec) | + | - public_blind_excess | []number | Public key corresponding to private blinding factor | + | - public_nonce | []number | Public key corresponding to private nonce | + | - part_sig | []number | Public partial signature | + +* **Success Response:** + + * **Code:** 200 + * **Content:** A new transaction slate in JSON. + + | Field | Type | Description | + |:----------------------|:---------|:--------------------------------------------------------------------------| + | num_participants | number | The number of participants intended to take part in this transaction | + | id | number | Unique transaction ID, selected by sender | + | tx | object | The core transaction data (inputs, outputs, kernels and kernel offset) | + | - offset | []number | The kernel "offset" k2, excess is k1G after splitting the key k = k1 + k2 | + | - body | object | The transaction body - inputs/outputs/kernels | + | - - inputs | []object | List of inputs spent by the transaction | + | - - - features | object | The features of the output being spent | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The commit referencing the output being spent | + | - - outputs | []object | List of outputs the transaction produces | + | - - - features | object | Options for an output's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - commit | []number | The homomorphic commitment representing the output amount | + | - - - proof | []number | A proof that the commitment is in the right range | + | - - kernels | []object | List of kernels that make up this transaction (usually a single kernel) | + | - - - features | object | Options for a kernel's structure or use | + | - - - - bits | number | Representation of the features in bits | + | - - - fee | number | Fee originally included in the transaction this proof is for | + | - - - lock_height | number | The max lock_height of all inputs to this transaction | + | - - - excess | []number | Remainder of the sum of all transaction commitments | + | - - - excess_sig | []number | The signature proving the excess is a valid public key (signs the tx fee) | + | amount | number | Base amount (excluding fee) | + | fee | number | Fee amount | + | height | number | Block height for the transaction | + | lock_height | number | Lock height | + | participant_data | object | Participant data | + | - id | number | Id of participant in the transaction. (For now, 0=sender, 1=rec) | + | - public_blind_excess | []number | Public key corresponding to private blinding factor | + | - public_nonce | []number | Public key corresponding to private nonce | + | - part_sig | []number | Public partial signature | + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + var coinbase_data = { + fees: 0, + height: 123456 + } + $.ajax({ + url: "/v1/wallet/owner/finalize_tx", + dataType: "json", + type : "POST", + success : function(r) { + console.log(r); + }, + data: { + file: tx.json + }, + }); + ``` + +### POST Cancel Tx + +Roll back a transaction and all associated outputs with a given transaction id This means delete all change outputs, (or recipient output if you're recipient), and unlock all locked outputs associated with the transaction used when a transaction is created but never posted. + +* **URL** + + /v1/wallet/owner/cancel_tx?id=x + +* **Method:** + + `POST` + +* **URL Params** + + **Required:** + `id=[number]` + +* **Data Params** + + None + +* **Success Response:** + + * **Code:** 200 + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + var coinbase_data = { + fees: 0, + height: 123456 + } + $.ajax({ + url: "/v1/wallet/owner/cancel_tx?id=3", + dataType: "json", + type : "POST", + success : function(r) { + console.log(r); + } + }); + ``` + +### POST Issue Burn Tx + +Issue a burn TX. + +* **URL** + + /v1/wallet/owner/issue_burn_tx + +* **Method:** + + `POST` + +* **URL Params** + + None + +* **Data Params** + + None + +* **Success Response:** + + * **Code:** 200 + +* **Error Response:** + + * **Code:** 400 + +* **Sample Call:** + + ```javascript + var coinbase_data = { + fees: 0, + height: 123456 + } + $.ajax({ + url: "/v1/wallet/owner/issue_burn_tx", + dataType: "json", + type : "POST", + success : function(r) { + console.log(r); + } + }); + ```