Methods
# abandonTransaction(params) → {Promise.<null>}
Mark in-wallet transaction
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. |
Promise.<null>
# abortRescan() → {Promise.<boolean>}
Stops current wallet rescan triggered e.g. by an importprivkey call.
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. |
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 |
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 |
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
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 |
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) |
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. |
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> |
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" |
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
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
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
A raven address associated with the given account
Promise.<GetAddressesByAccountResponse>
# 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') |
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.
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.
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. |
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.
The address
Promise.<GetRawChangeAddressResponse>
# getReceivedByAccount(params) → {Promise.<GetReceivedByAccountResponse>}
DEPRECATED. Returns the total amount received by addresses with
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
The total amount in " + CURRENCY_UNIT + " received for this account.
Promise.<GetReceivedByAccountResponse>
# 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. |
The total amount in " + CURRENCY_UNIT + " received at this address.
Promise.<GetReceivedByAddressResponse>
# 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[] |
Promise.<GetTransactionResponse>
# getUnconfirmedBalance() → {Promise.<(null|any)>}
Returns the server's total unconfirmed balance
Promise.<(null|any)>
# getWalletInfo() → {Promise.<GetWalletInfoResponse>}
Returns an object containing various wallet state info.
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 |
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> |
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 |
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 |
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 |
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 |
Promise.<null>
# keypoolRefill(params) → {Promise.<null>}
Fills the keypool.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
params |
||||
newsize |
number
|
<optional> |
100 | The new keypool size |
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
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
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.
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
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'). |
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) |
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') |
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 |
Promise.<Array.<ListUnspentResponse>>
# listWallets() → {Promise.<Array.<string>>}
Returns a list of currently loaded wallets.
For full information on the wallet, use getWalletInfo
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) |
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
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 |
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 |
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.
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
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 |
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" |
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" |
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
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 |
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. |
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.
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. |
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 |
Promise.<null>