Public
Documentation Settings

Bytecoin daemons - v3.5.0 (Beryl)

AUTHORIZATIONBasic Auth
Username

<username>

Password

<password>

walletd

!NB! Documentation under construction !NB!

Introduction

The Bytecoin Wallet Daemon (walletd, Bytecoin RPC Wallet) is designed to manage a user's account while operating together with a Bytecoin Node Daemon. To start the walletd you must pass a path to a wallet file as a command-line parameter which identifies the context the service will work within.

Service Location

By default, the Bytecoin Wallet Daemon is only bound to 127.0.0.1 (localhost) interface, so it can only be reached from the same computer it runs on. To bind it to all interfaces, use --walletd-bind-address=0.0.0.0:8070 command line argument (note that specifying port is mandatory).

To make a JSON PRC request to the walletd you should make an HTTP POST request to an entry point:

Plain Text
http://<ip>:<port>/json_rpc

where:

  • <ip> is the IPv4 address of the walletd service. If the service is on a local machine, use 127.0.0.1 instead of localhost.
  • <port> is TCP port of walletd. By default the service is bound to 8070.

Curl Template

Plain Text
curl -s -u <user>:<pass> -X POST http://<ip>:<port>/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "<id>", "method": "<method>", "params": {<params>}}'

Methods

Address and key management

#MethodDescription
1.create_addressesAdds addresses into the wallet file.
2.get_addressesReturns a list of addresses extracted from the wallet file.
3.get_view_key_pairReturns a view key pair shared by addresses.
4.get_wallet_infoReturns basic information about the wallet.
5.get_wallet_recordsReturns records found in the wallet.
6.set_address_labelSets a label to an address in the wallet.

Balance and history of transfers

#MethodDescription
7.create_sendproofCreates sendproof that money has been sent to an address.
8.get_balanceReturns balance for a single address or all addresses.
9.get_statusReturns combined status of walletd and bytecoind.
10.get_transactionReturns transaction (only if it has transfer(s) to/from any address) by hash.
11.get_transfersAllows iterating through history of transfers to/from addresses.
12.get_unspentsReturns balance split into outputs.

Sending money

#MethodDescription
13.create_transactionBuilds a transaction by specifying transfers you want to make and returns it for inspection.
14.send_transactionSends previously created transaction to the network.

AUTHORIZATIONBasic Auth
This folder is using Basic Auth from collectionBytecoin daemons - v3.5.0 (Beryl)

POSTcreate_addresses

http://127.0.0.1:8070/json_rpc

About

Either adds new or imports existing addresses (with corresponding spend keys) into a wallet file. To generate a new random key pair (and address, of course), you append an empty string to a secret_spend_keys array. To import an existing address, you append its secret spend key to a secret_spend_keys array.

If you import existing addresses created some time ago, specify creation_timestamp so the walletd can rescan the blockchain starting from that point of time, looking for transactions to/from those addresses. If no creation_timestamp is included, or if it is set to 0, walletd will rescan the whole blockchain from the beginning.

Adding an existing secret spend key is not an error, it will just return a corresponding address together with that key.

This method returns arrays of both addresses and secret spend keys, where each address corresponds to each secret key.

Before this method returns, it performs fdatasync on the wallet file, so if you add lots of addresses, it makes sense to batch them instead of calling this method individually per address.

Input (params)

FieldTypeMandatoryDefault valueDescription
secret_spend_keys[]stringYes-Array of secret spend keys.
creation_timestampuint32No0Min of creation timestamps of spend keys.

Output

FieldTypeDescription
secret_spend_keys[]stringArray of created secret spend keys.
addresses[]stringArray of created addresses.
AUTHORIZATIONBasic Auth
This request is using Basic Auth from collectionBytecoin daemons - v3.5.0 (Beryl)
HEADERS
Content-Type

application/json

Bodyraw
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "create_addresses",
  "params": {
  	"secret_spend_keys": [""]
  }
}

POSTget_addresses

http://127.0.0.1:8070/json_rpc

!NB! Method is marked as deprecated, use get_wallet_records instead.

About

Returns an array of all addresses stored in a wallet file. If view_only flag is true, there are no secret spend keys in the file, so the walletd is allowed to spend money from any address.

Input (params)

FieldTypeMandatoryDefault valueDescription
need_secret_spend_keysBoolNofalseSend true if need secret spend keys.
from_addressuint32No0Position of address in the wallet starting from 0.
max_countuint32No???Max number of addresses to show.

Output

FieldTypeDescription
addresses[]stringArray of addresses.
view_onlyboolFlag indicating if wallet is view-only.
AUTHORIZATIONBasic Auth
Username

<username>

Password

<password>

HEADERS
Content-Type

application/json

Bodyraw
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_addresses",
  "params": {
  	"need_secret_spend_keys": false,
  	"from_address": 0,
  	"max_count": 2
  }
}
Loading