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.
Get account info.
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 coin
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.
Lock outpoints.
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).
Unlock outpoints.
Remove all pending transactions older than a specified age.
Link to this section Functions
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.
change_passphrase(wallet_id, old_passphrase, new_passphrase)
Change wallet passphrase. Encrypt if unencrypted.
create_account(wallet_id, name, type, passphrase)
Create account with specified account name.
Examples
Bcash.create_account(1, "main", "pubkeyhash", "mystrongpassword")
create_transaction(wallet_id, outputs, passphrase)
Create and template a transaction (useful for multisig). Does not broadcast or add to wallet.
create_wallet(wallet_id, passphrase)
create_wallet(String.t(), String.t()) ::
{:ok, Map.t()} | {:error, HTTPoison.Error.t()} | {:error, :invalid_arguments}
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.
derive_nested_address(wallet_id, account)
Derive new nested p2sh receiving address for account.
estimate_fee()
generate_address(wallet_id, account)
Derive new receiving address for account.
generate_change_address(wallet_id, account)
Derive new change address for account.
get_account(wallet_id, account)
Get account info.
get_accounts(wallet_id)
List all account names (array indices map directly to bip44 account indices) associated with a specific wallet id.
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.
get_coins_by_address(address)
Get coin objects array by address.
get_locked_outputs(wallet_id)
Get all locked outpoints.
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.
get_wallet(wallet_id)
Gets information about a wallet.
get_wallet_coin(wallet_id, hash, index)
Get wallet coin
get_wallet_transaction_history(wallet_id)
Get wallet TX history. Returns array of tx details.
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.
list_all_coins(wallet_id)
List all wallet coins available.
lock_output(wallet_id, hash, index, passphrase)
Lock outpoints.
lock_wallet(wallet_id)
reset_authentication_token(wallet_id, passphrase)
Derive a new wallet token, required for access of this particular wallet.
send_transaction(wallet_id, outputs, passphrase)
Sign and broadcast a transaction from the given wallet to the specified outputs.
sign_transaction(wallet_id, hex, passphrase)
Sign a templated transaction (useful for multisig).
unlock_output(wallet_id, hash, index, passphrase)
Unlock outpoints.
unlock_wallet(wallet_id, passphrase, timeout)
zap_transactions(wallet_id, account, age)
Remove all pending transactions older than a specified age.