gold v0.16.3 Gold

Opinionated interface to Bitcoin core JSON-RPC API. Currently in MVP mode: architecture is ready and stable, doesn’t fully implement all of the RPC commands yet.

Link to this section Summary

Functions

Converts a float BTC amount to an Decimal

Call generic RPC command

Mine block immediately. Blocks are mined before RPC call returns

Mine block immediately. Blocks are mined before RPC call returns. Raises an exception on failure

Returns the account associated with the given address

Returns the account associated with the given address, raising an exception on failure

Returns wallet’s total available balance, raising an exception on failure

Returns server’s total available balance, raising an exception on failure

https://bitcoin.org/en/developer-reference#getblock

https://bitcoin.org/en/developer-reference#getblockchaininfo”

https://bitcoin.org/en/developer-reference#getblockchaininfo”

https://bitcoin.org/en/developer-reference#getblockcount

The header hash of a block at the given height in the local best block chain

https://bitcoin.org/en/developer-reference#getinfo”

https://bitcoin.org/en/developer-reference#getinfo”

https://bitcoin.org/en/developer-reference#getmemoryinfo”

https://bitcoin.org/en/developer-reference#getmemoryinfo”

https://bitcoin.org/en/developer-reference#getmempoolinfo”

https://bitcoin.org/en/developer-reference#getmempoolinfo”

https://bitcoin.org/en/developer-reference#getmininginfo”

https://bitcoin.org/en/developer-reference#getmininginfo”

https://bitcoin.org/en/developer-reference#getnetworkinfo”

https://bitcoin.org/en/developer-reference#getnetworkinfo”

Returns a new bitcoin address for receiving payments

Returns a new bitcoin address for receiving payments, raising an exception on failure

https://bitcoin.org/en/developer-reference#getpeerinfo”

https://bitcoin.org/en/developer-reference#getpeerinfo”

https://bitcoin.org/en/developer-reference#getrawtransaction

Get detailed information about in-wallet transaction

Get detailed information about in-wallet transaction, raising an exception on failure

https://bitcoin.org/en/developer-reference#gettxout

https://bitcoin.org/en/developer-reference#gettxoutsetinfo”

https://bitcoin.org/en/developer-reference#gettxoutsetinfo”

https://bitcoin.org/en/developer-reference#getwalletinfo”

https://bitcoin.org/en/developer-reference#getwalletinfo”

Add an address or pubkey script to the wallet without the associated private key

Add an address or pubkey script to the wallet without the associated private key, raising an exception on failure

Returns all transactions affecting the wallet which have occurred since a particular block

Returns all transactions affecting the wallet which have occurred since a particular block

Returns most recent transactions in wallet

Returns most recent transactions in wallet, raising an exception on failure

Send an amount to a given address

Send an amount to a given address, raising an exception on failure

Called when an application is started

Link to this section Functions

Link to this function btc_to_decimal(btc)

Converts a float BTC amount to an Decimal.

Link to this function call(name, method)

Call generic RPC command

Link to this function generate(name, amount)

Mine block immediately. Blocks are mined before RPC call returns.

Link to this function generate!(name, amount)

Mine block immediately. Blocks are mined before RPC call returns. Raises an exception on failure.

Link to this function getaccount(name, address)

Returns the account associated with the given address.

Link to this function getaccount!(name, address)

Returns the account associated with the given address, raising an exception on failure.

Link to this function getbalance(name, account \\ nil)

Returns wallet’s total available balance, raising an exception on failure.

Link to this function getbalance!(name, account \\ nil)

Returns server’s total available balance, raising an exception on failure.

Link to this function getblock(name, hash)

https://bitcoin.org/en/developer-reference#getblock

Link to this function getblock!(name, hash)
Link to this function getblockchaininfo(name)

https://bitcoin.org/en/developer-reference#getblockchaininfo”

Link to this function getblockchaininfo!(name)

https://bitcoin.org/en/developer-reference#getblockchaininfo”

Link to this function getblockcount(name)

https://bitcoin.org/en/developer-reference#getblockcount

Link to this function getblockcount!(name)
Link to this function getblockhash(name, index)

The header hash of a block at the given height in the local best block chain

https://bitcoin.org/en/developer-reference#getblockhash

Link to this function getblockhash!(name, index)

https://bitcoin.org/en/developer-reference#getinfo”

https://bitcoin.org/en/developer-reference#getinfo”

Link to this function getmemoryinfo(name)

https://bitcoin.org/en/developer-reference#getmemoryinfo”

Link to this function getmemoryinfo!(name)

https://bitcoin.org/en/developer-reference#getmemoryinfo”

Link to this function getmempoolinfo(name)

https://bitcoin.org/en/developer-reference#getmempoolinfo”

Link to this function getmempoolinfo!(name)

https://bitcoin.org/en/developer-reference#getmempoolinfo”

Link to this function getmininginfo(name)

https://bitcoin.org/en/developer-reference#getmininginfo”

Link to this function getmininginfo!(name)

https://bitcoin.org/en/developer-reference#getmininginfo”

Link to this function getnetworkinfo(name)

https://bitcoin.org/en/developer-reference#getnetworkinfo”

Link to this function getnetworkinfo!(name)

https://bitcoin.org/en/developer-reference#getnetworkinfo”

Link to this function getnewaddress(name, account \\ "")

Returns a new bitcoin address for receiving payments.

Link to this function getnewaddress!(name, account \\ "")

Returns a new bitcoin address for receiving payments, raising an exception on failure.

Link to this function getpeerinfo(name)

https://bitcoin.org/en/developer-reference#getpeerinfo”

Link to this function getpeerinfo!(name)

https://bitcoin.org/en/developer-reference#getpeerinfo”

Link to this function getrawtransaction(name, txid, verbose \\ 1)

https://bitcoin.org/en/developer-reference#getrawtransaction

Link to this function getrawtransaction!(name, txid, verbose \\ 1)
Link to this function gettransaction(name, txid)

Get detailed information about in-wallet transaction.

Link to this function gettransaction!(name, txid)

Get detailed information about in-wallet transaction, raising an exception on failure.

Link to this function gettxout(name, txid, n \\ 1)

https://bitcoin.org/en/developer-reference#gettxout

Link to this function gettxout!(name, txid, n \\ 1)
Link to this function gettxoutsetinfo(name)

https://bitcoin.org/en/developer-reference#gettxoutsetinfo”

Link to this function gettxoutsetinfo!(name)

https://bitcoin.org/en/developer-reference#gettxoutsetinfo”

Link to this function getwalletinfo(name)

https://bitcoin.org/en/developer-reference#getwalletinfo”

Link to this function getwalletinfo!(name)

https://bitcoin.org/en/developer-reference#getwalletinfo”

Link to this function importaddress(name, address, account \\ "", rescan \\ true)

Add an address or pubkey script to the wallet without the associated private key.

Link to this function importaddress!(name, address, account \\ "", rescan \\ true)

Add an address or pubkey script to the wallet without the associated private key, raising an exception on failure.

Link to this function listsinceblock(name, header_hash, target_confirmations, watchonly)

Returns all transactions affecting the wallet which have occurred since a particular block

Link to this function listsinceblock!(name, header_hash, target_confirmations, watchonly)

Returns all transactions affecting the wallet which have occurred since a particular block

Link to this function listtransactions(name, account \\ "*", limit \\ 10, offset \\ 0)

Returns most recent transactions in wallet.

Link to this function listtransactions!(name, account \\ "*", limit \\ 10, offset \\ 0)

Returns most recent transactions in wallet, raising an exception on failure.

Link to this function sendtoaddress(name, address, amount)

Send an amount to a given address.

Link to this function sendtoaddress!(name, address, amount)

Send an amount to a given address, raising an exception on failure.

Link to this function start(type, args)

Called when an application is started.

This function is called when an application is started using Application.start/2 (and functions on top of that, such as Application.ensure_started/2). This function should start the top-level process of the application (which should be the top supervisor of the application’s supervision tree if the application follows the OTP design principles around supervision).

start_type defines how the application is started:

  • :normal - used if the startup is a normal startup or if the application is distributed and is started on the current node because of a failover from another node and the application specification key :start_phases is :undefined.
  • {:takeover, node} - used if the application is distributed and is started on the current node because of a failover on the node node.
  • {:failover, node} - used if the application is distributed and is started on the current node because of a failover on node node, and the application specification key :start_phases is not :undefined.

start_args are the arguments passed to the application in the :mod specification key (e.g., mod: {MyApp, [:my_args]}).

This function should either return {:ok, pid} or {:ok, pid, state} if startup is successful. pid should be the PID of the top supervisor. state can be an arbitrary term, and if omitted will default to []; if the application is later stopped, state is passed to the stop/1 callback (see the documentation for the c:stop/1 callback for more information).

use Application provides no default implementation for the start/2 callback.

Callback implementation for Application.start/2.