bcash v0.1.0 Bcash

Documentation for Bcash.

https://bcoin.io/api-docs/#introduction

Link to this section Summary

Functions

Broadcast a transaction by adding it to the node's mempool. If mempool verification fails, the node will still forcefully advertise and relay the transaction for the next 60 seconds.

Change wallet passphrase. Encrypt if unencrypted.

Create account with specified account name.

Create and template a transaction (useful for multisig). Does not broadcast or add to wallet.

Create a new wallet via the POST /wallet/:wallet_id endpoint in Bcash.

Derive new nested p2sh receiving address for account.

Derive new receiving address for account.

Derive new change address for account.

List all account names (array indices map directly to bip44 account indices) associated with a specific wallet id.

Get wallet or account balance. If no account option is passed, the call defaults to wallet balance (with account index of -1). Balance values for unconfimred and confirmed are expressed in satoshis.

Get coin objects array by address.

Get all locked outpoints.

Get wallet master HD key. This is normally censored in the wallet info route. The provided API key must have admin access.

Gets information about a wallet.

Get wallet TX history. Returns array of tx details.

Import a standard WIF key. An import can be either a private key or a public key for watch-only. (Watch Only wallets will throw an error if trying to import a private key) A rescan will be required to see any transaction history associated with the key.

List all wallet coins available.

Derive a new wallet token, required for access of this particular wallet.

Sign and broadcast a transaction from the given wallet to the specified outputs.

Sign a templated transaction (useful for multisig).

Remove all pending transactions older than a specified age.

Link to this section Functions

Link to this function

broadcast_transaction(tx)

Broadcast a transaction by adding it to the node's mempool. If mempool verification fails, the node will still forcefully advertise and relay the transaction for the next 60 seconds.

Link to this function

change_passphrase(wallet_id, old_passphrase, new_passphrase)

Change wallet passphrase. Encrypt if unencrypted.

Link to this function

create_account(wallet_id, name, type, passphrase)

Create account with specified account name.

Examples

Bcash.create_account(1, "main", "pubkeyhash", "mystrongpassword")
Link to this function

create_transaction(wallet_id, outputs, passphrase)

Create and template a transaction (useful for multisig). Does not broadcast or add to wallet.

Link to this function

create_wallet(wallet_id, passphrase)
create_wallet(String.t(), String.t()) ::
  {:ok, Map.t()} | {:error, HTTPoison.Error.t()} | {:error, :invalid_arguments}

Create a new wallet via the POST /wallet/:wallet_id endpoint in Bcash.

Link to this function

derive_nested_address(wallet_id, account)

Derive new nested p2sh receiving address for account.

Link to this function

generate_address(wallet_id, account)

Derive new receiving address for account.

Link to this function

generate_change_address(wallet_id, account)

Derive new change address for account.

Link to this function

get_account(wallet_id, account)

Get account info.

Link to this function

get_accounts(wallet_id)

List all account names (array indices map directly to bip44 account indices) associated with a specific wallet id.

Link to this function

get_balance(wallet_id)

Get wallet or account balance. If no account option is passed, the call defaults to wallet balance (with account index of -1). Balance values for unconfimred and confirmed are expressed in satoshis.

Link to this function

get_coins_by_address(address)

Get coin objects array by address.

Link to this function

get_locked_outputs(wallet_id)

Get all locked outpoints.

Link to this function

get_master_hd_key(wallet_id)

Get wallet master HD key. This is normally censored in the wallet info route. The provided API key must have admin access.

Link to this function

get_wallet(wallet_id)
get_wallet(String.t()) :: {:ok, Map.t()} | {:error, Map.t()}

Gets information about a wallet.

Link to this function

get_wallet_coin(wallet_id, hash, index)

Get wallet coin

Link to this function

get_wallet_transaction_history(wallet_id)

Get wallet TX history. Returns array of tx details.

Link to this function

import_key(wallet_id, account, private_key)

Import a standard WIF key. An import can be either a private key or a public key for watch-only. (Watch Only wallets will throw an error if trying to import a private key) A rescan will be required to see any transaction history associated with the key.

Link to this function

list_all_coins(wallet_id)

List all wallet coins available.

Link to this function

lock_output(wallet_id, hash, index, passphrase)

Lock outpoints.

Link to this function

lock_wallet(wallet_id)

Link to this function

reset_authentication_token(wallet_id, passphrase)
reset_authentication_token(String.t(), String.t()) ::
  {:ok, Map.t()} | {:error, Map.t()}

Derive a new wallet token, required for access of this particular wallet.

Link to this function

send_transaction(wallet_id, outputs, passphrase)
send_transaction(String.t(), [Map.t()], String.t()) ::
  {:ok, Map.t()} | {:error, Map.t()} | {:error, HTTPoison.Error.t()}

Sign and broadcast a transaction from the given wallet to the specified outputs.

Link to this function

sign_transaction(wallet_id, hex, passphrase)

Sign a templated transaction (useful for multisig).

Link to this function

unlock_output(wallet_id, hash, index, passphrase)

Unlock outpoints.

Link to this function

unlock_wallet(wallet_id, passphrase, timeout)

Link to this function

zap_transactions(wallet_id, account, age)

Remove all pending transactions older than a specified age.