Execute a nano contract method.
POST/wallet/nano-contracts/execute
Execute a nano contract method.
Request
Header Parameters
Define the key of the corresponding wallet it will be executed the request.
- application/json
Body
required
Data to execute the nano contract method.
Array [
]
Array [
- MOD1
- MOD2
- MOD3
- MOD4
]
ID of the nano contract that will have the method executed.
Method to execute in the nano contract object.
Address caller that will sign the nano contract transaction.
data
object
required
Data of the method for the nano contract.
actions
object[]
List of actions for the initialize method.
Type of action: 'deposit' or 'withdrawal'.
Token of the action.
Amount to deposit or withdrawal.
Required for withdrawal, and it's the address to send the token to. For deposit is optional and it's the address to get the utxo from.
Address to send the change amount. Only used for deposit and it's optional.
args
object[]
List of arguments for the method.
oneOf
string
integer
number
boolean
Responses
- 200
Transaction for the nano contract method.
- application/json
- Schema
- success
- wallet-not-ready
- no-wallet-id
- invalid-wallet-id
Schema
any
Success
{
"success": true,
"count": 100,
"history": {
"hash": "5c02adea056d7b43e83171a0e2d226d564c791d583b32e9a404ef53a2e1b363a",
"nonce": 0,
"timestamp": 1572636346,
"version": 4,
"weight": 1,
"signal_bits": 0,
"parents": [
"1234",
"5678"
],
"inputs": [],
"outputs": [],
"metadata": {
"hash": "5c02adea056d7b43e83171a0e2d226d564c791d583b32e9a404ef53a2e1b363a",
"spent_outputs": [],
"received_by": [],
"children": [],
"conflict_with": [],
"voided_by": [],
"twins": [],
"accumulated_weight": 1,
"score": 0,
"height": 0,
"min_height": 0,
"feature_activation_bit_counts": null,
"first_block": null,
"validation": "full"
},
"tokens": [],
"nc_id": "5c02adea056d7b43e83171a0e2d226d564c791d583b32e9a404ef53a2e1b363a",
"nc_method": "method_name",
"nc_args": "0004313233340001000004654d8749",
"nc_pubkey": "033f5d238afaa9e2218d05dd7fa50eb6f9e55431e6359e04b861cd991ae24dc655"
}
}
Wallet is not ready yet
{
"success": false,
"message": "Wallet is not ready.",
"state": 1
}
No wallet id parameter
{
"success": false,
"message": "Parameter 'wallet-id' is required."
}
Wallet id parameter is invalid
{
"success": false,
"message": "Invalid wallet-id parameter."
}