# Address Index

The following RPC calls interact with the Tokel blockchain daemon, and are made available through the tokel-cli software.

The Tokel blockchain inherits all Komodo smartchain RPC's, but not all RPC's are enabled. For simplicity, our documentation only shows those commands that are enabled and available for use.

# getaddressbalance

getaddressbalance '{ "addresses" : [ "address" , ... ] }'

The getaddressbalance method returns the confirmed balance for an address, or addresses. It requires addressindex to be enabled.

# Arguments

Name Type Description
"address" (string) the address

# Response

Name Type Description
"balance" (number) the current confirmed balance in satoshis
"received" (number) the total confirmed number of satoshis received (including change)

# 📌 Examples

Command:

./tokel-cli getaddressbalance '{"addresses":["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}'

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressbalance", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

# getaddressdeltas

getaddressdeltas '{ "addresses" : [ "address" , ... ] }'

getaddressdeltas '{ "addresses" : [ "address" , ... ] , "start": start, "end": end, "chainInfo": boolean }'

The getaddressdeltas method returns all confirmed balance changes of an address. The user can optionally limit the response to a given interval of blocks. The method requires addressindex to be enabled.

# Arguments

Name Type Description
"address" (string) the address
"start" (number) the start block height
"end" (number) the end block height
"chainInfo" (boolean) include chain info in results (only applies if start and end specified)

# Response

Name Type Description
"satoshis" (number) the difference in satoshis
"txid" (string) the related transaction id
"index" (number) the related input or output index
"height" (number) the block height
"address" (string) the address

# 📌 Examples

Command:

./tokel-cli getaddressdeltas '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}'

Command:

./tokel-cli getaddressdeltas '{"addresses":["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"],"start":1,"end":200,"chainInfo":true}'

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressdeltas", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressdeltas", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"],"start":1,"end":200,"chainInfo":true}]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

# getaddressmempool

getaddressmempool '{ "addresses" : [ "address" , ... ] }'

The getaddressmempool method returns all mempool deltas for an address, or addresses. The method requires addressindex to be enabled.

# Arguments

Name Type Description
"address" (string) the address

# Response

Name Type Description
"address" (string) the address
"txid" (string) the related txid
"index" (number) the related input or output index
"satoshis" (number) the difference in satoshis
"timestamp" (number) the time the transaction entered the mempool (seconds)
"prevtxid" (string) the previous txid (if spending)
"prevout" (string) the previous transaction output index (if spending)

# 📌 Examples

Command:

./tokel-cli getaddressmempool '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}'

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressmempool", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

# getaddresstxids

getaddresstxids '{ "addresses" : [ "address" , ... ] }'

The getaddresstxids method returns the txids for an address, or addresses. It requires addressindex to be enabled.

# Arguments

Name Type Description
"address" (string) the address
"start" (number) the start block height
"end" (number) the end block height

# Response

Name Type Description
"transaction_id" (string) the transaction id

# 📌 Examples

Command:

tokel-cli getaddresstxids '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb","RQUAkqRiRMqxcNrB29B4duTK4qkqfV9HVJ"]}'

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddresstxids", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

# getaddressutxos

getaddressutxos '{ "addresses" : [ "address" , ... ], "chaininfo" }'

The getaddressutxos method returns all unspent outputs for an address. It requires addressindex to be enabled.

# Arguments

Name Type Description
"address" (string) the address
"chainInfo" (boolean) include chain info with results

# Response

Name Type Description
"address" (string) the address
"txid" (string) the output txid
"height" (number) the block height
"outputIndex" (number) the output index
"script" (string) the script hex encoded
"satoshis" (number) the number of satoshis of the output

# 📌 Examples

Command:

./tokel-cli getaddressutxos '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}'

Command:

./tokel-cli getaddressutxos '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"], "chainInfo": true}'

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressutxos", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressutxos", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"], "chainInfo": true}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

# getsnapshot

getsnapshot top

The getsnapshot method returns a snapshot of addresses and their amounts at the Smart Chain's current height.

The method requires addressindex to be enabled.

# Arguments

Name Type Description
"top" (number, optional) Only return this many addresses, i.e. top N rich list

# Response

Name Type Description
"addresses" (array of jsons) the array containing the address and amount details
"addr" (string) an address
"amount" (number) the amount of coins in the above address
"total" (numeric) the total amount in snapshot
"average" (numeric) the average amount in each address
"utxos" (number) the total number of utxos in snapshot
"total_addresses" (number) the total number of addresses in snapshot,
"start_height" (number) the block height snapshot began
"ending_height" (number) the block height snapshot finished,
"start_time" (number) the unix epoch time snapshot started
"end_time" (number) the unix epoch time snapshot finished

# 📌 Examples

Command:

./tokel-cli getsnapshot 5

You can find the rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsnapshot", "params": ["5"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/