Create a nano contract of a blueprint.
POST/wallet/nano-contracts/create
Create a nano contract of a blueprint.
Request
Header Parameters
Define the key of the corresponding wallet it will be executed the request.
- application/json
Body
required
Data to create the nano contract.
Array [
]
Array [
- MOD1
- MOD2
- MOD3
- MOD4
]
Blueprint ID of the new nano contract.
Address caller that will sign the nano contract creation 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
Create the nano contract
- 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": "initialize",
"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."
}