Class

Wallet

Wallet()

Constructor

# new Wallet()

View Source methods/wallet/wallet.ts, line 2

Methods

# abandonTransaction(params) → {Promise.<null>}

Mark in-wallet transaction as abandoned.

This will mark this transaction and all its in-wallet descendants as abandoned which will allow for their inputs to be respent. It can be used to replace "stuck" or evicted transactions.

It only works on transactions which are not included in a block and are not currently in the mempool.

It has no effect on transactions which are already conflicted or abandoned.

Parameters:
Name Type Description
params
txid string

The transaction id.

View Source methods/wallet/wallet.ts, line 864

Promise.<null>

# abortRescan() → {Promise.<boolean>}

Stops current wallet rescan triggered e.g. by an importprivkey call.

View Source methods/wallet/wallet.ts, line 870

Promise.<boolean>

# addMultisigAddress(params) → {Promise.<AddMultisigAddressResponse>}

Add a nrequired-to-sign multisignature address to the wallet.

Each key is a Raven address or hex-encoded public key.

If 'account' is specified (DEPRECATED), assign address to that account.

Parameters:
Name Type Attributes Description
params
nrequired number

The number of required signatures out of the n keys or addresses.

keys Array

A json array of raven addresses or hex-encoded public keys

account string <optional>

DEPRECATED. An account to assign the addresses to.

View Source methods/wallet/wallet.ts, line 884

Promise.<AddMultisigAddressResponse>

# addWitnessAddress(params, address) → {Promise.<AddWitnessAddressResponse>}

Add a witness address for a script (with pubkey or redeemscript known).

It returns the witness script.

Parameters:
Name Type Description
params
address string

An address known to the wallet

View Source methods/wallet/wallet.ts, line 894

The value of the new address (P2SH of witness script).

Promise.<AddWitnessAddressResponse>

# backupWallet(params) → {Promise.<null>}

Safely copies current wallet file to destination, which can be a directory or a path with filename.

Parameters:
Name Type Description
params
destination string

The destination directory or file

View Source methods/wallet/wallet.ts, line 902

Promise.<null>

# bumpFee(params) → {Promise.<(null|BumpFeeResponse)>}

Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.

An opt-in RBF transaction with the given txid must be in the wallet.

The command will pay the additional fee by decreasing (or perhaps removing) its change output.

If the change output is not big enough to cover the increased fee, the command will currently fail instead of adding new inputs to compensate. (A future implementation could improve this.)

The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.

By default, the new fee will be calculated automatically using estimatefee.

The user can specify a confirmation target for estimatefee.

Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.

At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee returned by getnetworkinfo) to enter the node's mempool.

Parameters:
Name Type Attributes Description
params
txid string

The txid to be bumped

options BumpFeeOptions <optional>
Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 928

Promise.<(null|BumpFeeResponse)>

# dumpPrivKey(params) → {Promise.<DumpPrivKeyResponse>}

Reveals the private key corresponding to 'address'.

Then the importprivkey can be used with this output.

Parameters:
Name Type Description
params
address string

The raven address for the private key

View Source methods/wallet/wallet.ts, line 938

The private key

Promise.<DumpPrivKeyResponse>

# dumpWallet(params) → {Promise.<DumpWalletResponse>}

Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.

Parameters:
Name Type Description
params
filename string

The filename with path (either absolute or relative to ravend)

View Source methods/wallet/wallet.ts, line 946

The filename with full absolute path

Promise.<DumpWalletResponse>

# encryptWallet(params) → {Promise.<string>}

Encrypts the wallet with 'passphrase'. This is for first time encryption.

After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls.

Use the walletpassphrase call for this, and then walletlock call.

If the wallet is already encrypted, use the walletpassphrasechange call.

Note that this will shutdown the server.

Parameters:
Name Type Description
params
passphrase string

The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.

View Source methods/wallet/wallet.ts, line 962

Wallet encrypted; Raven server stopping, restart to run with encrypted wallet. The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.

Promise.<string>

# fundRawTransaction(params) → {Promise.<FundRawTransactionResponse>}

Add inputs to a transaction until it has enough in value to meet its out value.

This will not modify existing inputs, and will add at most one change output to the outputs.

No existing outputs will be modified unless "subtractFeeFromOutputs" is specified.

Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.

The inputs added will not be signed, use signrawtransaction for that.

Note that all existing inputs must have their previous output transaction be in the wallet.

Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importaddress or addmultisigaddress (to calculate fees).

You can see whether this is the case by checking the "solvable" field in the listunspent output.

Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only

Parameters:
Name Type Attributes Description
params
hexstring string

The hex string of the raw transaction

options FundRawTransactionOptions <optional>

View Source methods/wallet/wallet.ts, line 838

Promise.<FundRawTransactionResponse>

# generate(params) → {Promise.<Array.<string>>}

Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.

Parameters:
Name Type Attributes Description
params
nblocks number

How many blocks are generated immediately.\n"

maxtries number <optional>

How many iterations to try (default = 1000000).\n"

View Source methods/wallet/wallet.ts, line 1448

Hashes of blocks generated

Promise.<Array.<string>>

# getAccount(params) → {Promise.<GetAccountResponse>}

DEPRECATED. Returns the account associated with the given address.

Parameters:
Name Type Description
params
address string

The raven address for account lookup.

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 980

The account address

Promise.<GetAccountResponse>

# getAccountAddress(params) → {Promise.<GetAccountAddressResponse>}

DEPRECATED. Returns the current Raven address for receiving payments to this account.

Parameters:
Name Type Description
params
account string

The account name for the address. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 971

The account raven address

Promise.<GetAccountAddressResponse>

# getAddressesByAccount(params) → {Promise.<GetAddressesByAccountResponse>}

DEPRECATED. Returns the list of addresses for the given account.

Parameters:
Name Type Description
params
account string

The account name.

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 989

A raven address associated with the given account

# getBalance(params) → {Promise.<GetBalanceResponse>}

If account is not specified, returns the server's total available balance.

If account is specified (DEPRECATED), returns the balance in the account.

Note that the account "" is not the same as leaving the parameter out.

The server total may be different to the balance in the default "" account.

Parameters:
Name Type Attributes Default Description
params
account string <optional>

DEPRECATED. The account string may be given as a specific account name to find the balance associated with wallet keys in a named account, or as the empty string ("") to find the balance associated with wallet keys not in any named account, or as "*" to find the balance associated with all wallet keys regardless of account. When this option is specified, it calculates the balance in a different way than when it is not specified, and which can count spends twice when there are conflicting pending transactions (such as those created by the bumpfee command), temporarily resulting in low or even negative balances. In general, account balance calculation is not considered reliable and has resulted in confusing outcomes, so it is recommended to avoid passing this argument.

minconf number <optional>
1

Only include transactions confirmed at least this many times.

include_watchonly boolean <optional>
false

Also include balance in watch-only addresses (see 'importaddress')

View Source methods/wallet/wallet.ts, line 1016

The total amount in " + CURRENCY_UNIT + " received for this account.

Promise.<GetBalanceResponse>

# getMasterKeyInfo() → {Promise.<GetMasterKeyInfoResponse>}

Fetches and displays the master private key and the master public key.

View Source methods/wallet/wallet.ts, line 1022

Promise.<GetMasterKeyInfoResponse>

# getMyWords() → {Promise.<GetMyWordsResponse>}

Returns the 12 words and passphrase used by BIP39 to generate the wallets private keys.

Only returns value if wallet was created by the 12 words import/generation.

View Source methods/wallet/wallet.ts, line 1030

Promise.<GetMyWordsResponse>

# getNewAddress(params) → {Promise.<GetNewAddressResponse>}

eturns a new Raven address for receiving payments.

If 'account' is specified (DEPRECATED), it is added to the address book so payments received with the address will be credited to 'account'.

Parameters:
Name Type Attributes Description
params
account string <optional>

DEPRECATED. The account name for the address to be linked to. If not provided, the default account "" is used. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.

View Source methods/wallet/wallet.ts, line 1040

The new raven address

Promise.<GetNewAddressResponse>

# getRawChangeAddress() → {Promise.<GetRawChangeAddressResponse>}

Returns a new Raven address, for receiving change.

This is for use with raw transactions, NOT normal use.

View Source methods/wallet/wallet.ts, line 1048

The address

Promise.<GetRawChangeAddressResponse>

# getReceivedByAccount(params) → {Promise.<GetReceivedByAccountResponse>}

DEPRECATED. Returns the total amount received by addresses with in transactions with at least [minconf] confirmations.

Parameters:
Name Type Attributes Default Description
params
account string

The selected account, may be the default account using "".

minconf number <optional>
1

Default = 1. Only include transactions confirmed at least this many times.

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 1058

The total amount in " + CURRENCY_UNIT + " received for this account.

# getReceivedByAddress(params) → {Promise.<GetReceivedByAddressResponse>}

Returns the total amount received by the given address in transactions with at least minconf confirmations.

Parameters:
Name Type Attributes Default Description
params
address string

The raven address for transactions.

minconf number <optional>
1

Default = 1. Only include transactions confirmed at least this many times.

View Source methods/wallet/wallet.ts, line 1067

The total amount in " + CURRENCY_UNIT + " received at this address.

# getTransaction(params) → {Promise.<GetTransactionResponse>}

Get detailed information about in-wallet transaction

Parameters:
Name Type Attributes Default Description
params
txid string

The transaction id

include_watchonly boolean <optional>
false

Default = false. Whether to include watch-only addresses in balance calculation and details[]

View Source methods/wallet/wallet.ts, line 1076

Promise.<GetTransactionResponse>

# getUnconfirmedBalance() → {Promise.<(null|any)>}

Returns the server's total unconfirmed balance

View Source methods/wallet/wallet.ts, line 1082

Promise.<(null|any)>

# getWalletInfo() → {Promise.<GetWalletInfoResponse>}

Returns an object containing various wallet state info.

View Source methods/wallet/wallet.ts, line 1088

Promise.<GetWalletInfoResponse>

# importAddress(params) → {Promise.<null>}

Adds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend.

Note: This call can take minutes to complete if rescan is true.

If you have the full public key, you should call importpubkey instead of this.

Note: If you import a non-standard raw script in hex form, outputs sending to it will be treated as change, and not show up in many RPCs.

Parameters:
Name Type Attributes Default Description
params
script string

The hex-encoded script (or address)

label string <optional>
''

An optional label

rescan boolean <optional>
true

Rescan the wallet for transactions

p2sh boolean <optional>
false

Add the P2SH version of the script as well

View Source methods/wallet/wallet.ts, line 1153

Promise.<null>
Examples
// Import a script with rescan
client.wallet.importAddress({ script: 'myscript' })
// Import using a label without rescan
client.wallet.importAddress({ script: 'myscript', label: 'testing', rescan: false })

# importMulti(params) → {Promise.<Array.<ImportMultiResponse>>}

Import addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options).

Parameters:
Name Type Attributes Description
params
requests Array

Data to be imported

options ImportMultiOptions <optional>

View Source methods/wallet/wallet.ts, line 1097

Response is an array with the same size as the input that has the execution result

Promise.<Array.<ImportMultiResponse>>

# importPrivKey(params) → {Promise.<null>}

Adds a private key (as returned by dumpprivkey) to your wallet.

Note: This call can take minutes to complete if rescan is true.

Parameters:
Name Type Attributes Default Description
params
privkey string

The private key (see dumpprivkey)

label string <optional>
''

An optional label

rescan boolean <optional>
true

Rescan the wallet for transactions

View Source methods/wallet/wallet.ts, line 1121

Promise.<null>
Examples
// Import the private key with rescan
    client.wallet.importPrivKey({ privkey: 'mykey' })
// Import using a label and without rescan
    client.wallet.importPrivKey({ privkey: 'mykey', rescan: false })
// Import using default blank label and without rescan
    client.wallet.importPrivKey({ privkey: 'mykey', label: '', rescan: false })
// As a JSON-RPC call
    client.wallet.importPrivKey({ privkey: 'mykey', label: 'testing', rescan: false })

# importPrunedFunds(params) → {Promise.<null>}

Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.

Parameters:
Name Type Description
params
rawtransaction string

A raw transaction in hex funding an already-existing address in wallet

txoutproof string

The hex output from gettxoutproof that contains the transaction

View Source methods/wallet/wallet.ts, line 1162

Promise.<null>

# importPubKey(params) → {Promise.<null>}

Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend.

Note: This call can take minutes to complete if rescan is true.

Parameters:
Name Type Attributes Default Description
params
pubkey string

The hex-encoded public key

label string <optional>
''

An optional label

rescan boolean <optional>
true

Rescan the wallet for transactions

View Source methods/wallet/wallet.ts, line 1174

Promise.<null>

# importWallet(params) → {Promise.<null>}

Imports keys from a wallet dump file (see dumpwallet).

Parameters:
Name Type Description
params
filename string

The wallet file

View Source methods/wallet/wallet.ts, line 1129

Promise.<null>

# keypoolRefill(params) → {Promise.<null>}

Fills the keypool.

Parameters:
Name Type Attributes Default Description
params
newsize number <optional>
100

The new keypool size

View Source methods/wallet/wallet.ts, line 1182

Promise.<null>

# listAccounts(params) → {Promise.<ListAccountsResponse>}

DEPRECATED. Returns Object that has account names as keys, account balances as values.

Parameters:
Name Type Attributes Default Description
params
minconf number <optional>
1

Only include transactions with at least this many confirmations

include_watchonly boolean <optional>
false

Include balances in watch-only addresses (see 'importaddress')

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 1192

Promise.<ListAccountsResponse>

# listAddressGroupings() → {Promise.<Array.<Array.<Array.<ListAddressGroupingsResponse>>>>}

Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions

View Source methods/wallet/wallet.ts, line 1198

Promise.<Array.<Array.<Array.<ListAddressGroupingsResponse>>>>

# listLockUnspent() → {Promise.<Array.<ListLockUnspentResponse>>}

Returns list of temporarily unspendable outputs.

See the lockunspent call to lock and unlock transactions for spending.

View Source methods/wallet/wallet.ts, line 1206

Promise.<Array.<ListLockUnspentResponse>>

# listReceivedByAccount(params) → {Promise.<Array.<ListReceivedByAccountResponse>>}

DEPRECATED. List balances by account.

Parameters:
Name Type Attributes Default Description
params
minconf number <optional>
1

The minimum number of confirmations before payments are included.

include_empty boolean <optional>
false

Whether to include accounts that haven't received any payments.

include_watchonly boolean <optional>
false

Whether to include watch-only addresses (see 'importaddress').

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 1217

Promise.<Array.<ListReceivedByAccountResponse>>

# listReceivedByAddress(params) → {Promise.<Array.<ListReceivedByAddressResponse>>}

List balances by receiving address.

Parameters:
Name Type Attributes Default Description
params
minconf number <optional>
1

The minimum number of confirmations before payments are included.

include_empty boolean <optional>
false

Whether to include addresses that haven't received any payments.

include_watchonly boolean <optional>
false

Whether to include watch-only addresses (see 'importaddress').

View Source methods/wallet/wallet.ts, line 1227

Promise.<Array.<ListReceivedByAddressResponse>>

# listSinceBlock(params) → {Promise.<ListSinceBlockResponse>}

Get all transactions in blocks since block [blockhash], or all transactions if omitted.

If "blockhash" is no longer a part of the main chain, transactions from the fork point onward are included.

Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the "removed" array.

Parameters:
Name Type Attributes Default Description
params
blockhash string <optional>

The block hash to list transactions since

target_confirmations number <optional>
1

Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value

include_watchonly boolean <optional>
false

Include transactions to watch-only addresses (see 'importaddress')

include_removed boolean <optional>
true

Show transactions that were removed due to a reorg in the "removed" array (not guaranteed to work on pruned nodes)

View Source methods/wallet/wallet.ts, line 1242

Promise.<ListSinceBlockResponse>

# listTransactions(params) → {Promise.<Array.<ListTransactionsResponse>>}

Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.

Parameters:
Name Type Attributes Default Description
params
account string <optional>

DEPRECATED. The account name. Should be "*".

count number <optional>
10

The number of transactions to return

skip number <optional>
0

The number of transactions to skip

include_watchonly boolean <optional>
false

Include transactions to watch-only addresses (see 'importaddress')

View Source methods/wallet/wallet.ts, line 1253

Promise.<Array.<ListTransactionsResponse>>

# listUnspent(params) → {Promise.<Array.<ListUnspentResponse>>}

Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations.

Optionally filter to only include txouts paid to specified addresses.

Parameters:
Name Type Attributes Default Description
params
minconf number <optional>
1

The minimum confirmations to filter

maxconf number <optional>
9999999

The maximum confirmations to filter

addresses Array

An array of raven addresses to filter

include_unsafe boolean <optional>
true

Include outputs that are not safe to spend. See description of "safe" attribute below.

query_options ListUnspentQueryOptions <optional>
true

JSON with query options

View Source methods/wallet/wallet.ts, line 1267

Promise.<Array.<ListUnspentResponse>>

# listWallets() → {Promise.<Array.<string>>}

Returns a list of currently loaded wallets.

For full information on the wallet, use getWalletInfo

View Source methods/wallet/wallet.ts, line 1275

Array of wallet names

Promise.<Array.<string>>

# lockUnspent(params) → {Promise.<boolean>}

Updates list of temporarily unspendable outputs.

Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.

If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.

A locked transaction output will not be chosen by automatic coin selection, when spending ravens.

Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list is always cleared (by virtue of process exit) when a node stops or fails.

Parameters:
Name Type Description
params
unlock boolean

Whether to unlock (true) or lock (false) the specified transactions

transactions Array

An array of objects. Each object the txid (string) vout (numeric)

View Source methods/wallet/wallet.ts, line 1292

Whether the command was successful or not

Promise.<boolean>

# moveCmd(params) → {Promise.<boolean>}

DEPRECATED. Move a specified amount from one account in your wallet to another.

Parameters:
Name Type Attributes Description
params
fromaccount string

The name of the account to move funds from. May be the default account using "".

toaccount string

The name of the account to move funds to. May be the default account using "".

amount number

Quantity of " + CURRENCY_UNIT + " to move between accounts.

dummy number <optional>

Ignored. Remains for backward compatibility.

comment string <optional>

An optional comment, stored in the wallet only.

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 1305

True if successful.

Promise.<boolean>

# removePrunedFunds(params) → {Promise.<null>}

Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.

Parameters:
Name Type Description
params
txid string

The hex-encoded id of the transaction you are deleting

View Source methods/wallet/wallet.ts, line 1430

Promise.<null>

# rescanBlockchain(params) → {Promise.<RescanBlockchainResponse>}

Rescan the local blockchain for wallet related transactions.

Parameters:
Name Type Attributes Description
params
start_height number <optional>

Block height where the rescan should start

stop_height number <optional>

The last block height that should be scanned

View Source methods/wallet/wallet.ts, line 1439

Promise.<RescanBlockchainResponse>

# resendWalletTransactions() → {Promise.<Array.<string>>}

Immediately re-broadcast unconfirmed wallet transactions to all peers.

Intended only for testing; the wallet code periodically re-broadcasts automatically.

Returns an RPC error if -walletbroadcast is set to false.

Returns array of transaction ids that were re-broadcast.

View Source methods/wallet/wallet.ts, line 850

Transaction ID

Promise.<Array.<string>>

# sendFrom(params) → {Promise.<string>}

DEPRECATED (use sendtoaddress). Sent an amount from an account to a raven address.

Parameters:
Name Type Attributes Default Description
params
fromaccount string

The name of the account to send funds from. May be the default account using "". Specifying an account does not influence coin selection, but it does associate the newly created transaction with the account, so the account's balance computation and transaction history can reflect the spend.

toaddress string

The raven address to send funds to.

amount string | number

The amount in " + CURRENCY_UNIT + " (transaction fee is added on top).

minconf number <optional>
1

Only use funds with at least this many confirmations.

comment string <optional>

A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.

comment_to string <optional>

An optional comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, it is just kept in your wallet.

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 1319

The transaction id.

Promise.<string>

# sendFromAddress(params) → {Promise.<string>}

Send an amount from a specific address to a given address. All rvn change will get sent back to the from_address

Parameters:
Name Type Attributes Default Description
params
from_address string

The raven address to send from.

to_address string

The raven address to send to.

amount string | number

The amount in " + CURRENCY_UNIT + " to send. eg 0.1

comment string <optional>

A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.

comment_to string <optional>

A comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, just kept in your wallet.

subtractfeefromamount boolean <optional>
false

(boolean, optional, default=false) The fee will be deducted from the amount being sent. The recipient will receive less ravens than you enter in the amount field.

conf_target number <optional>

Confirmation target (in blocks)

estimate_mode string <optional>
UNSET

Default = UNSET. The fee estimate mode, must be one of: UNSET, ECONOMICAL, CONSERVATIVE

View Source methods/wallet/wallet.ts, line 1362

The transaction id.

Promise.<string>

# sendMany(params) → {Promise.<string>}

Send multiple times. Amounts are double-precision floating point numbers.

Parameters:
Name Type Attributes Default Description
params
fromaccount string

DEPRECATED. The account to send the funds from. Should be "" for the default account

amounts string

A json object with addresses and amounts. "address":amount (numeric or string) The raven address is the key, the numeric amount (can be string) in " + CURRENCY_UNIT + " is the value

minconf number <optional>
1

Default = 1. Only use the balance confirmed at least this many times.

comment string <optional>

A comment

subtractfeefrom Array <optional>

A json array with addresses. The fee will be equally deducted from the amount of each selected address. Those recipients will receive less ravens than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee. Subtract fee from listed addresses.

conf_target number <optional>

Confirmation target (in blocks)

estimate_mode string <optional>
UNSET

Default = UNSET. The fee estimate mode, must be one of: "UNSET", "ECONOMICAL", "CONSERVATIVE"

View Source methods/wallet/wallet.ts, line 1333

The transaction id for the send. Only 1 transaction is created regardless of the number of addresses.

Promise.<string>

# sendToAddress(params) → {Promise.<string>}

Send an amount to a given address.

Parameters:
Name Type Attributes Default Description
params
address string

The raven address to send to.

amount string | number

The amount in " + CURRENCY_UNIT + " to send. eg 0.1

comment string <optional>

A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.

comment_to string <optional>

A comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, just kept in your wallet.

subtractfeefromamount boolean <optional>
false

Default = false. The fee will be deducted from the amount being sent. The recipient will receive less ravens than you enter in the amount field.

conf_target number <optional>

Confirmation target (in blocks)

estimate_mode string

Default = UNSET. The fee estimate mode, must be one of: "UNSET", "ECONOMICAL", "CONSERVATIVE"

View Source methods/wallet/wallet.ts, line 1347

The transaction id.

Promise.<string>

# setAccount(params) → {Promise.<null>}

DEPRECATED. Sets the account associated with the given address.

Parameters:
Name Type Description
params
address string

The raven address to be associated with an account.

account string

The account to assign the address to.

Deprecated:
  • Yes

View Source methods/wallet/wallet.ts, line 1372

Promise.<null>

# setTxFee(params) → {Promise.<boolean>}

Set the transaction fee per kB. Overwrites the paytxfee parameter.

Parameters:
Name Type Description
params
amount string | number

The transaction fee in " + CURRENCY_UNIT + "/kB

View Source methods/wallet/wallet.ts, line 1380

Returns true if successful

Promise.<boolean>

# signMessage(params) → {Promise.<string>}

Sign a message with the private key of an address

Parameters:
Name Type Description
params
address string

The raven address to use for the private key.

message string

The message to create a signature of.

View Source methods/wallet/wallet.ts, line 1389

The signature of the message encoded in base 64

Promise.<string>

# walletLock() → {Promise.<null>}

Removes the wallet encryption key from memory, locking the wallet.

After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked.

View Source methods/wallet/wallet.ts, line 1397

Promise.<null>

# walletPassphrase(params) → {Promise.<null>}

Stores the wallet decryption key in memory for 'timeout' seconds.

This is needed prior to performing transactions related to private keys such as sending ravens

Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock time that overrides the old one.

Parameters:
Name Type Description
params
passphrase string

The wallet passphrase

timeout number

The time to keep the decryption key in seconds.

View Source methods/wallet/wallet.ts, line 1422

Promise.<null>
Example
// Unlock the wallet for 60 seconds
client.wallet.walletPassphrase({ passphrase: 'my pass phrase', timeout: 60 })

# walletPassphraseChange(params) → {Promise.<null>}

Changes the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.

Parameters:
Name Type Description
params
oldpassphrase string

The current passphrase

newpassphrase string

The new passphrase

View Source methods/wallet/wallet.ts, line 1406

Promise.<null>