forked from seredat/karbowanec
-
Notifications
You must be signed in to change notification settings - Fork 15
Simplewallet JSON RPC API
Marconi Soldate edited this page Jan 7, 2018
·
1 revision
To start wallet JSON RPC API server you should specify a port on which server binds (additionally to standard wallet's arguments). You can choose any free port. To do that execute the following command from the command line:
simplewallet --wallet-file=example_wallet.bin --pass=12345 '''--rpc-bind-port=8314'''
http://95.46.98.64:8314/json_rpc
http://localhost:8314/json_rpc
- Available commands ##
- getbalance
- transfer
- store
- get_payments
- get_transfers
- get_height
- reset
- getbalance ###
URL:
/json_rpc
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"jsonrpc" : {
"type" : "string"
},
"method" : {
"type" : "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"locked_amount" : {
"type" : "integer"
},
"available_balance" : {
"type" : "integer"
}
}
}
- transfer ###
Please note: fee param is a mandatory and should not be less than 0.01 BCN
URL:
/json_rpc
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"jsonrpc" : {
"type" : "string"
},
"method" : {
"type" : "string"
},
"destinations" : {
"type" : "array",
"items" : {
"amount" : {
"type" : "integer"
},
"address" : {
"type" : "string"
}
},
"minItems" : 1
},
"payment_id": {
"type" : "string"
}
"fee" : {
"type" : "integer"
},
"mixin" : {
"type" : "integer"
},
"unlock_time" : {
"type" : "integer"
"description" : "Unix timestamp"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"tx_hash" : {
"type" : "string"
}
}
}
- store ###
URL:
/json_rpc
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"jsonrpc" : {
"type" : "string"
},
"method" : {
"type" : "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {}
}
- get_payments ###
URL:
/json_rpc
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"jsonrpc" : {
"type" : "string"
},
"method" : {
"type" : "string"
},
"payment_id" : {
"type" : "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"payments" : {
"type" : "array",
"items" : {
"amount" : {
"type" : "integer"
},
"block_height" : {
"type" : "integer"
},
"tx_hash" : {
"type" : "string"
},
"unlock_time" : {
"type" : "integer"
}
}
}
}
}
- get_transfers ###
URL:
/json_rpc
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"jsonrpc" : {
"type" : "string"
},
"method" : {
"type" : "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"result" : {
"type" : "transfers"
"transfers" : {
"type" : "array",
"items" : {
"address" : {
"type" : "string"
},
"amount" : {
"type" : "integer"
},
"blockIndex" : {
"type" : "integer"
},
"fee" : {
"type" : "integer"
},
"output" : {
"type" : "boolean"
},
"paymentId" : {
"type" : "string"
},
"time" : {
"type" : "integer"
},
"transactionHash" : {
"type" : "string"
},
"unlockTime" : {
"type" : "integer"
},
}
}
}
}
}
- get_height ###
URL:
/json_rpc
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"jsonrpc" : {
"type" : "string"
},
"method" : {
"type" : "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"height" : {
"type" : "integer"
}
}
}
- reset ###
URL:
/json_rpc
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {
"jsonrpc" : {
"type" : "string"
},
"method" : {
"type" : "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nióbio wallet api",
"description": "Schema for transfer method in Nióbio wallet",
"type": "object",
"properties" : {}
}
- Examples ##
- getbalance ###
- Examples ##
{
"jsonrpc": "2.0",
"method": "getbalance",
"params": {}
}
- transfer ###
{
"jsonrpc":"2.0",
"method":"transfer",
"params":{
"destinations":[
{
"amount":11111,
"address":"NfXkT5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt"
},
{
"amount":22222,
"address":"NfXkT5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt"
}
],
"payment_id":"",
"fee":1000000,
"mixin":0,
"unlock_time":0
}
}
- store ###
{
"jsonrpc": "2.0",
"method": "store",
"params": {}
}
- get_payments ###
{
"jsonrpc":"2.0",
"method":"get_payments",
"params":{
"payment_id": "78cc4b76a48bd50ab955ac61a0c04e4a82079fbcf27298f87b39c76aefccbcc9"
}
}
- get_transfers ###
{
"jsonrpc": "2.0",
"method": "get_transfers",
"params": {}
}
- get_height ###
{
"jsonrpc": "2.0",
"method": "get_height",
"params": {}
}
- reset ###
{
"jsonrpc": "2.0",
"method": "reset",
"params": {}
}