RPC Reference
Remote Procedure Call (RPC) is a powerful technology that enables the execution of commands across a network, allowing software components to communicate with each other. In the context of Stohn Coin, the RPC interface provides developers with the ability to query and interact with the Stohn Coin network programmatically. This means you can issue commands to perform various actions, such as creating transactions, managing wallets, and retrieving blockchain information, all through simple code. This RPC reference page serves as your guide to utilizing the RPC commands for Stohn Coin, offering detailed information on each available command and how to use them effectively in your applications. Whether you're developing new software or integrating with existing systems, this resource aims to empower you with the tools needed for seamless interaction with the Stohn Coin ecosystem.
- abandon transaction
abandontransaction "txid"
Mark in-wallet transaction <txid> 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 abandoned.
Examples
stohncoin-cli abandontransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- abort rescan
abortrescan
Stops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.
Note: Use “getwalletinfo” to query the scanning progress.
Examples
Import a private key:
stohncoin-cli importprivkey "mykey"
Abort the running wallet rescan:
stohncoin-cli abortrescan
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "abortrescan", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- add multisig address
addmultisigaddress nrequired ["key",...] ( "label" "address_type" )
Add an nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup.
Each key is a Stohncoin address or hex-encoded public key.
This functionality is only intended for use with non-watchonly addresses.
See importaddress for watchonly p2sh address support.
If ‘label’ is specified, assign address to that label.
Argument #1 - nrequired
Type: numeric, required
The number of required signatures out of the n keys or addresses.
Argument #2 - keys
Type: json array, required
The stohncoin addresses or hex-encoded public keys
[ "key", (string) stohncoin address or hex-encoded public key ... ]
Argument #4 - address_type
Type: string, optional, default=set by -addresstype
The address type to use. Options are “legacy”, “p2sh-segwit”, and “bech32”.
Result
{ (json object) "address" : "str", (string) The value of the new multisig address "redeemScript" : "hex", (string) The string value of the hex-encoded redemption script "descriptor" : "str" (string) The descriptor for this multisig }
Examples
Add a multisig address from 2 addresses:
stohncoin-cli addmultisigaddress 2 "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- add node
addnode "node" "command"
Attempts to add or remove a node from the addnode list.
Or try a connection to a node once.
Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be full nodes/support SegWit as other outbound peers are (though such peers will not be synced from).
- analyzepsbt
analyzepsbt "psbt"
Analyzes and provides information about the current status of a PSBT and its inputs
Result
{ (json object) "inputs" : [ (json array) { (json object) "has_utxo" : true|false, (boolean) Whether a UTXO is provided "is_final" : true|false, (boolean) Whether the input is finalized "missing" : { (json object, optional) Things that are missing that are required to complete this input "pubkeys" : [ (json array, optional) "hex", (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing ... ], "signatures" : [ (json array, optional) "hex", (string) Public key ID, hash160 of the public key, of a public key whose signature is missing ... ], "redeemscript" : "hex", (string, optional) Hash160 of the redeemScript that is missing "witnessscript" : "hex" (string, optional) SHA256 of the witnessScript that is missing }, "next" : "str" (string, optional) Role of the next person that this input needs to go to }, ... ], "estimated_vsize" : n, (numeric, optional) Estimated vsize of the final signed transaction "estimated_feerate" : n, (numeric, optional) Estimated feerate of the final signed transaction in SOH/kB. Shown only if all UTXO slots in the PSBT have been filled "fee" : n, (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled "next" : "str", (string) Role of the next person that this psbt needs to go to "error" : "str" (string, optional) Error message (if there is one) }
- backup wallet
backupwallet "destination"
Safely copies current wallet file to destination, which can be a directory or a path with filename.
- bumpfee
bumpfee "txid" ( options )
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 reducing change outputs or adding inputs when necessary.
It may add a new change output if one does not already exist.
All inputs in the original transaction will be included in the replacement transaction.
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 the estimatesmartfee RPC.
The user can specify a confirmation target for estimatesmartfee.
Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
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.
* WARNING: before version 0.21, fee_rate was in SOH/kvB. As of 0.21, fee_rate is in sat/vB. *
Argument #2 - options
Type: json object, optional
{ "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB instead of relying on the built-in fee estimator. Must be at least 1.000 sat/vB higher than the current transaction fee rate. WARNING: before version 0.21, fee_rate was in SOH/kvB. As of 0.21, fee_rate is in sat/vB. "replaceable": bool, (boolean, optional, default=true) Whether the new transaction should still be marked bip-125 replaceable. If true, the sequence numbers in the transaction will be left unchanged from the original. If false, any input sequence numbers in the original transaction that were less than 0xfffffffe will be increased to 0xfffffffe so the new transaction will not be explicitly bip-125 replaceable (though it may still be replaceable in practice, for example if it has unconfirmed ancestors which are replaceable). "estimate_mode": "str", (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative" }
Result
{ (json object) "psbt" : "str", (string) The base64-encoded unsigned PSBT of the new transaction. Only returned when wallet private keys are disabled. (DEPRECATED) "txid" : "hex", (string) The id of the new transaction. Only returned when wallet private keys are enabled. "origfee" : n, (numeric) The fee of the replaced transaction. "fee" : n, (numeric) The fee of the new transaction. "errors" : [ (json array) Errors encountered during processing (may be empty). "str", (string) ... ] }
- clearbanned
- combinepsbt
- combinerawtransaction
combinerawtransaction ["hexstring",...]
Combine multiple partially signed transactions into one transaction.
The combined transaction may be another partially signed transaction or a fully signed transaction.
- converttopsbt
converttopsbt "hexstring" ( permitsigdata iswitness )
Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction createpsbt and walletcreatefundedpsbt should be used for new applications.
Argument #2 - permitsigdata
Type: boolean, optional, default=false
- If true, any signatures in the input will be discarded and conversion
will continue. If false, RPC will fail if any signatures are present.
Argument #3 - iswitness
Type: boolean, optional, default=depends on heuristic tests
- Whether the transaction hex is a serialized witness transaction.
If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller.
- createmultisig
createmultisig nrequired ["key",...] ( "address_type" )
Creates a multi-signature address with n signature of m keys required.
It returns a json object with the address and redeemScript.
Argument #1 - nrequired
Type: numeric, required
The number of required signatures out of the n keys.
Argument #2 - keys
Type: json array, required
The hex-encoded public keys.
[ "key", (string) The hex-encoded public key ... ]
Argument #3 - address_type
Type: string, optional, default=legacy
The address type to use. Options are “legacy”, “p2sh-segwit”, and “bech32”.
Result
{ (json object) "address" : "str", (string) The value of the new multisig address. "redeemScript" : "hex", (string) The string value of the hex-encoded redemption script. "descriptor" : "str" (string) The descriptor for this multisig }
Examples
Create a multisig address from 2 public keys:
stohncoin-cli createmultisig 2 "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createmultisig", "params": [2, "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- createpsbt
createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable )
Creates a transaction in the Partially Signed Transaction format.
Implements the Creator role.
Argument #1 - inputs
Type: json array, required
The json objects
[ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number }, ... ]
Argument #2 - outputs
Type: json array, required
- The outputs (key-value pairs), where none of the keys are duplicated.
That is, each address can only appear once and there can only be one ‘data’ object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter.
[ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the stohncoin address, the value (float or string) is the amount in SOH }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
Argument #3 - locktime
Type: numeric, optional, default=0
Raw locktime. Non-0 value also locktime-activates inputs
- createrawtransaction
createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable )
Create a transaction spending the given inputs and creating new outputs.
Outputs can be addresses or data.
Returns hex-encoded raw transaction.
Note that the transaction’s inputs are not signed, and it is not stored in the wallet or transmitted to the network.
Argument #1 - inputs
Type: json array, required
The inputs
[ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number }, ... ]
Argument #2 - outputs
Type: json array, required
- The outputs (key-value pairs), where none of the keys are duplicated.
That is, each address can only appear once and there can only be one ‘data’ object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter.
[ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the stohncoin address, the value (float or string) is the amount in SOH }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
Argument #3 - locktime
Type: numeric, optional, default=0
Raw locktime. Non-0 value also locktime-activates inputs
Argument #4 - replaceable
Type: boolean, optional, default=false
- Marks this transaction as BIP125-replaceable.
Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.
Examples
stohncoin-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"address\":0.01}]"
stohncoin-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"data\":\"00010203\"}]"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"data\":\"00010203\"}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- creatwallet
createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup )
Creates and loads a new wallet.
Argument #1 - wallet_name
Type: string, required
The name for the new wallet. If this is a path, the wallet will be created at the path location.
Argument #2 - disable_private_keys
Type: boolean, optional, default=false
Disable the possibility of private keys (only watchonlys are possible in this mode).
Argument #3 - blank
Type: boolean, optional, default=false
Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using sethdseed.
Argument #5 - avoid_reuse
Type: boolean, optional, default=false
Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind.
Argument #6 - descriptors
Type: boolean, optional, default=false
Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation
Argument #7 - load_on_startup
Type: boolean, optional, default=null
Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
- decodepbst
decodepsbt "psbt"
Return a JSON object representing the serialized, base64-encoded partially signed Stohncoin transaction.
Result
{ (json object) "tx" : { (json object) The decoded network-serialized unsigned transaction. ... The layout is the same as the output of decoderawtransaction. }, "unknown" : { (json object) The unknown global fields "key" : "hex", (string) (key-value pair) An unknown key-value pair ... }, "inputs" : [ (json array) { (json object) "non_witness_utxo" : { (json object, optional) Decoded network transaction for non-witness UTXOs ... }, "witness_utxo" : { (json object, optional) Transaction output for witness UTXOs "amount" : n, (numeric) The value in SOH "scriptPubKey" : { (json object) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str", (string) The type, eg 'pubkeyhash' "address" : "str" (string) Stohncoin address if there is one } }, "partial_signatures" : { (json object, optional) "pubkey" : "str", (string) The public key and signature that corresponds to it. ... }, "sighash" : "str", (string, optional) The sighash type to be used "redeem_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "witness_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "bip32_derivs" : [ (json array, optional) { (json object, optional) The public key with the derivation path as the value. "master_fingerprint" : "str", (string) The fingerprint of the master key "path" : "str" (string) The path }, ... ], "final_scriptsig" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "str" (string) The hex }, "final_scriptwitness" : [ (json array) "hex", (string) hex-encoded witness data (if any) ... ], "unknown" : { (json object) The unknown global fields "key" : "hex", (string) (key-value pair) An unknown key-value pair ... } }, ... ], "outputs" : [ (json array) { (json object) "redeem_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "witness_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "bip32_derivs" : [ (json array, optional) { (json object) "pubkey" : "str", (string) The public key this path corresponds to "master_fingerprint" : "str", (string) The fingerprint of the master key "path" : "str" (string) The path }, ... ], "unknown" : { (json object) The unknown global fields "key" : "hex", (string) (key-value pair) An unknown key-value pair ... } }, ... ], "fee" : n (numeric, optional) The transaction fee paid if all UTXOs slots in the PSBT have been filled. }
- decoderawtransaction
decoderawtransaction "hexstring" ( iswitness )
Return a JSON object representing the serialized, hex-encoded transaction.
Argument #2 - iswitness
Type: boolean, optional, default=depends on heuristic tests
- Whether the transaction hex is a serialized witness transaction.
If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller.
Result
{ (json object) "txid" : "hex", (string) The transaction id "hash" : "hex", (string) The transaction hash (differs from txid for witness transactions) "size" : n, (numeric) The transaction size "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) "weight" : n, (numeric) The transaction's weight (between vsize*4 - 3 and vsize*4) "version" : n, (numeric) The version "locktime" : xxx, (numeric) The lock time "vin" : [ (json array) { (json object) "txid" : "hex", (string) The transaction id "vout" : n, (numeric) The output number "scriptSig" : { (json object) The script "asm" : "str", (string) asm "hex" : "hex" (string) hex }, "txinwitness" : [ (json array) "hex", (string) hex-encoded witness data (if any) ... ], "sequence" : n (numeric) The script sequence number }, ... ], "vout" : [ (json array) { (json object) "value" : n, (numeric) The value in SOH "n" : n, (numeric) index "scriptPubKey" : { (json object) "asm" : "str", (string) the asm "hex" : "hex", (string) the hex "reqSigs" : n, (numeric) The required sigs "type" : "str", (string) The type, eg 'pubkeyhash' "addresses" : [ (json array) "str", (string) stohncoin address ... ] } }, ... ] }
- decodescript
decodescript "hexstring"
Decode a hex-encoded script.
Result
{ (json object) "asm" : "str", (string) Script public key "type" : "str", (string) The output type (e.g. nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown) "reqSigs" : n, (numeric) The required signatures "addresses" : [ (json array) "str", (string) stohncoin address ... ], "p2sh" : "str", (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH) "segwit" : { (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness) "asm" : "str", (string) String representation of the script public key "hex" : "hex", (string) Hex string of the script public key "type" : "str", (string) The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash) "reqSigs" : n, (numeric) The required signatures (always 1) "addresses" : [ (json array) (always length 1) "str", (string) segwit address ... ], "p2sh-segwit" : "str" (string) address of the P2SH script wrapping this witness redeem script } }
- deriveaddresses
deriveaddresses "descriptor" ( range )
Derives one or more addresses corresponding to an output descriptor.
Examples of output descriptors are:
pkh(<pubkey>) P2PKH outputs for the given pubkey wpkh(<pubkey>) Native segwit P2PKH outputs for the given pubkey sh(multi(<n>,<pubkey>,<pubkey>,…)) P2SH-multisig outputs for the given threshold and pubkeys raw(<hex script>) Outputs whose scriptPubKey equals the specified hex scripts
In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by “/”, where “h” represents a hardened child key.
For more information on output descriptors, see the documentation in the doc/descriptors.md file.
- disconnectnode
disconnectnode ( "address" nodeid )
Immediately disconnects from the specified peer node.
Strictly one out of ‘address’ and ‘nodeid’ can be provided to identify the node.
To disconnect by nodeid, either set ‘address’ to the empty string, or call using the named ‘nodeid’ argument only.
Argument #1 - address
Type: string, optional, default=fallback to nodeid
The IP address/port of the node
Argument #2 - nodeid
Type: numeric, optional, default=fallback to address
The node ID (see getpeerinfo for node IDs)
Examples
stohncoin-cli disconnectnode "192.168.0.6:8333"
stohncoin-cli disconnectnode "" 1
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "disconnectnode", "params": ["192.168.0.6:8333"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "disconnectnode", "params": ["", 1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- dumpprivkey
dumpprivkey "address"
Reveals the private key corresponding to ‘address’.
Then the importprivkey can be used with this output
- dumpwallet
dumpwallet "filename"
Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.
Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet.
Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile).
- encryptwallet
encryptwallet "passphrase"
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.
Argument #1 - passphrase
Type: string, required
The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.
Examples
Encrypt your wallet:
stohncoin-cli encryptwallet "my pass phrase"
Now set the passphrase to use the wallet, such as for signing or sending stohncoin:
stohncoin-cli walletpassphrase "my pass phrase"
Now we can do something like sign:
stohncoin-cli signmessage "address" "test message"
Now lock the wallet again by removing the passphrase:
stohncoin-cli walletlock
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "encryptwallet", "params": ["my pass phrase"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- estimatesmartfee
estimatesmartfee conf_target ( "estimate_mode" )
Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid. Uses virtual transaction size as defined in BIP 141 (witness data is discounted).
Argument #2 - estimate_mode
Type: string, optional, default=CONSERVATIVE
- The fee estimate mode.
Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. Must be one of: “UNSET” “ECONOMICAL” “CONSERVATIVE”
Result
{ (json object) "feerate" : n, (numeric, optional) estimate fee rate in SOH/kB (only present if no errors were encountered) "errors" : [ (json array, optional) Errors encountered during processing (if there are any) "str", (string) error ... ], "blocks" : n (numeric) block number where estimate was found The request target will be clamped between 2 and the highest target fee estimation is able to return based on how long it has been running. An error is returned if not enough transactions and blocks have been observed to make an estimate for any number of blocks. }
- finalizepbst
finalizepsbt "psbt" ( extract )
Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be created which has the final_scriptSig and final_scriptWitness fields filled for inputs that are complete.
Implements the Finalizer and Extractor roles.
Argument #2 - extract
Type: boolean, optional, default=true
- If true and the transaction is complete,
extract and return the complete transaction in normal network serialization instead of the PSBT.
- fundrawtransaction
fundrawtransaction "hexstring" ( options iswitness )
If the transaction has no inputs, they will be automatically selected to meet its out value.
It 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 signrawtransactionwithkey
or signrawtransactionwithwallet 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
Argument #2 - options
Type: json object, optional
- for backward compatibility: passing in a true instead of an object will result in {“includeWatching”:true}
“replaceable”: bool, (boolean, optional, default=wallet default) Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees “conf_target”: n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks “estimate_mode”: “str”, (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive): “unset” “economical” “conservative” }
{ "add_inputs": bool, (boolean, optional, default=true) For a transaction with existing inputs, automatically include more if they are not enough. "changeAddress": "str", (string, optional, default=pool address) The stohncoin address to receive the change "changePosition": n, (numeric, optional, default=random) The index of the change output "change_type": "str", (string, optional, default=set by -changetype) The output type to use. Only valid if changeAddress is not specified. Options are "legacy", "p2sh-segwit", and "bech32". "includeWatching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only. Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported, e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field. "lockUnspents": bool, (boolean, optional, default=false) Lock selected unspent outputs "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB. "feeRate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in SOH/kvB. "subtractFeeFromOutputs": [ (json array, optional, default=empty array) The integers. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less stohncoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. vout_index, (numeric) The zero-based output index, before a change output is added. ... ],
Argument #3 - iswitness
Type: boolean, optional, default=depends on heuristic tests
- Whether the transaction hex is a serialized witness transaction.
If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller.
Result
{ (json object) "hex" : "hex", (string) The resulting raw transaction (hex-encoded string) "fee" : n, (numeric) Fee in SOH the resulting transaction pays "changepos" : n (numeric) The position of the added change output, or -1 }
Examples
Create a transaction with no inputs:
stohncoin-cli createrawtransaction "[]" "{\"myaddress\":0.01}"
Add sufficient unsigned inputs to meet the output value:
stohncoin-cli fundrawtransaction "rawtransactionhex"
Sign the transaction:
stohncoin-cli signrawtransactionwithwallet "fundedtransactionhex"
Send the transaction:
stohncoin-cli sendrawtransaction "signedtransactionhex"
- generateblock
generateblock "output" ["rawtx/txid",...]
Mine a block with a set of ordered transactions immediately to a specified address or descriptor (before the RPC call returns)
Argument #1 - output
Type: string, required
The address or descriptor to send the newly generated stohncoin to.
Argument #2 - transactions
Type: json array, required
- An array of hex strings which are either txids or raw transactions.
Txids must reference transactions currently in the mempool. All transactions must be valid and in valid order, otherwise the block will be rejected.
[ "rawtx/txid", (string) ... ]
- generatetoaddress
generatetoaddress nblocks "address" ( maxtries )
Mine blocks immediately to a specified address (before the RPC call returns)
- generatetodescriptor
- getaddednodeinfo
getaddednodeinfo ( "node" )
Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)
Argument #1 - node
Type: string, optional, default=all nodes
If provided, return information about this specific node, otherwise all nodes are returned.
Result
[ (json array) { (json object) "addednode" : "str", (string) The node IP address or name (as provided to addnode) "connected" : true|false, (boolean) If connected "addresses" : [ (json array) Only when connected = true { (json object) "address" : "str", (string) The stohncoin server IP and port we're connected to "connected" : "str" (string) connection, inbound or outbound }, ... ] }, ... ]
- getaddressbylabel
getaddressesbylabel "label"
Returns the list of addresses assigned the specified label.
- getaddressinfo
getaddressinfo "address"
Return information about the given stohncoin address.
Some of the information will only be present if the address is in the active wallet.
Result
{ (json object) "address" : "str", (string) The stohncoin address validated. "scriptPubKey" : "hex", (string) The hex-encoded scriptPubKey generated by the address. "ismine" : true|false, (boolean) If the address is yours. "iswatchonly" : true|false, (boolean) If the address is watchonly. "solvable" : true|false, (boolean) If we know how to spend coins sent to this address, ignoring the possible lack of private keys. "desc" : "str", (string, optional) A descriptor for spending coins sent to this address (only when solvable). "isscript" : true|false, (boolean) If the key is a script. "ischange" : true|false, (boolean) If the address was used for change output. "iswitness" : true|false, (boolean) If the address is a witness address. "witness_version" : n, (numeric, optional) The version number of the witness program. "witness_program" : "hex", (string, optional) The hex value of the witness program. "script" : "str", (string, optional) The output script type. Only if isscript is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, witness_v0_scripthash, witness_unknown. "hex" : "hex", (string, optional) The redeemscript for the p2sh address. "pubkeys" : [ (json array, optional) Array of pubkeys associated with the known redeemscript (only if script is multisig). "str", (string) ... ], "sigsrequired" : n, (numeric, optional) The number of signatures required to spend multisig output (only if script is multisig). "pubkey" : "hex", (string, optional) The hex value of the raw public key for single-key addresses (possibly embedded in P2SH or P2WSH). "embedded" : { (json object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known. ... Includes all getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath, hdseedid) and relation to the wallet (ismine, iswatchonly). }, "iscompressed" : true|false, (boolean, optional) If the pubkey is compressed. "timestamp" : xxx, (numeric, optional) The creation time of the key, if available, expressed in UNIX epoch time. "hdkeypath" : "str", (string, optional) The HD keypath, if the key is HD and available. "hdseedid" : "hex", (string, optional) The Hash160 of the HD seed. "hdmasterfingerprint" : "hex", (string, optional) The fingerprint of the master key. "labels" : [ (json array) Array of labels associated with the address. Currently limited to one label but returned as an array to keep the API stable if multiple labels are enabled in the future. "str", (string) Label name (defaults to ""). ... ] }
- getbalance
getbalance ( "dummy" minconf include_watchonly avoid_reuse )
Returns the total available balance.
The available balance is what the wallet considers currently spendable, and is thus affected by options which limit spendability such as -spendzeroconfchange.
Argument #1 - dummy
Type: string, optional
Remains for backward compatibility. Must be excluded or set to “*”.
Argument #2 - minconf
Type: numeric, optional, default=0
Only include transactions confirmed at least this many times.
Argument #3 - include_watchonly
Type: boolean, optional, default=true for watch-only wallets, otherwise false
Also include balance in watch-only addresses (see ‘importaddress’)
Argument #4 - avoid_reuse
Type: boolean, optional, default=true
(only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction.
Examples
The total amount in the wallet with 0 or more confirmations:
stohncoin-cli getbalance
The total amount in the wallet with at least 6 confirmations:
stohncoin-cli getbalance "*" 6
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbalance", "params": ["*", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- getbalances
getbalances
Returns an object with all balances in SOH.
Result
{ (json object) "mine" : { (json object) balances from outputs that the wallet can sign "trusted" : n, (numeric) trusted balance (outputs created by the wallet or confirmed outputs) "untrusted_pending" : n, (numeric) untrusted pending balance (outputs created by others that are in the mempool) "immature" : n, (numeric) balance from immature coinbase outputs "used" : n (numeric) (only present if avoid_reuse is set) balance from coins sent to addresses that were previously spent from (potentially privacy violating) }, "watchonly" : { (json object) watchonly balances (not present if wallet does not watch anything) "trusted" : n, (numeric) trusted balance (outputs created by the wallet or confirmed outputs) "untrusted_pending" : n, (numeric) untrusted pending balance (outputs created by others that are in the mempool) "immature" : n (numeric) balance from immature coinbase outputs } }
- getbestblockhash
getbestblockhash
Returns the hash of the best (tip) block in the most-work fully-validated chain.
- getblock
getblock "blockhash" ( verbosity )
If verbosity is 0, returns a string that is serialized, hex-encoded data for block ‘hash’.
If verbosity is 1, returns an Object with information about block ‘hash’.
If verbosity is 2, returns an Object with information about block ‘hash’ and information about each transaction.
Argument #2 - verbosity
Type: numeric, optional, default=1
0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data
Result (for verbosity = 0)
Name
Type
Description
hex
string
A string that is serialized, hex-encoded data for block ‘hash’
Result (for verbosity = 1)
{ (json object) "hash" : "hex", (string) the block hash (same as provided) "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain "size" : n, (numeric) The block size "strippedsize" : n, (numeric) The block size excluding witness data "weight" : n, (numeric) The block weight as defined in BIP 141 "height" : n, (numeric) The block height or index "version" : n, (numeric) The block version "versionHex" : "hex", (string) The block version formatted in hexadecimal "merkleroot" : "hex", (string) The merkle root "tx" : [ (json array) The transaction ids "hex", (string) The transaction id ... ], "time" : xxx, (numeric) The block time expressed in UNIX epoch time "mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time "nonce" : n, (numeric) The nonce "bits" : "hex", (string) The bits "difficulty" : n, (numeric) The difficulty "chainwork" : "hex", (string) Expected number of hashes required to produce the chain up to this block (in hex) "nTx" : n, (numeric) The number of transactions in the block "previousblockhash" : "hex", (string) The hash of the previous block "nextblockhash" : "hex" (string) The hash of the next block }
Result (for verbosity = 2)
{ (json object) ..., Same output as verbosity = 1 "tx" : [ (json array) { (json object) ... The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result }, ... ] }
Examples
stohncoin-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- getblockchaininfo
getblockchaininfo
Returns an object containing various state info regarding blockchain processing.
Result
{ (json object) "chain" : "str", (string) current network name (main, test, regtest) "blocks" : n, (numeric) the height of the most-work fully-validated chain. The genesis block has height 0 "headers" : n, (numeric) the current number of headers we have validated "bestblockhash" : "str", (string) the hash of the currently best block "difficulty" : n, (numeric) the current difficulty "mediantime" : n, (numeric) median time for the current best block "verificationprogress" : n, (numeric) estimate of verification progress [0..1] "initialblockdownload" : true|false, (boolean) (debug information) estimate of whether this node is in Initial Block Download mode "chainwork" : "hex", (string) total amount of work in active chain, in hexadecimal "size_on_disk" : n, (numeric) the estimated size of the block and undo files on disk "pruned" : true|false, (boolean) if the blocks are subject to pruning "pruneheight" : n, (numeric) lowest-height complete block stored (only present if pruning is enabled) "automatic_pruning" : true|false, (boolean) whether automatic pruning is enabled (only present if pruning is enabled) "prune_target_size" : n, (numeric) the target size used by pruning (only present if automatic pruning is enabled) "softforks" : { (json object) status of softforks "xxxx" : { (json object) name of the softfork "type" : "str", (string) one of "buried", "bip9" "bip9" : { (json object) status of bip9 softforks (only for "bip9" type) "status" : "str", (string) one of "defined", "started", "locked_in", "active", "failed" "bit" : n, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status) "start_time" : xxx, (numeric) the minimum median time past of a block at which the bit gains its meaning "timeout" : xxx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in "since" : n, (numeric) height of the first block to which the status applies "statistics" : { (json object) numeric statistics about BIP9 signalling for a softfork (only for "started" status) "period" : n, (numeric) the length in blocks of the BIP9 signalling period "threshold" : n, (numeric) the number of blocks with the version bit set required to activate the feature "elapsed" : n, (numeric) the number of blocks elapsed since the beginning of the current period "count" : n, (numeric) the number of blocks with the version bit set in the current period "possible" : true|false (boolean) returns false if there are not enough blocks left in this period to pass activation threshold } }, "height" : n, (numeric) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status) "active" : true|false (boolean) true if the rules are enforced for the mempool and the next block }, ... }, "warnings" : "str" (string) any network and blockchain warnings }
- getblockcount
getblockcount
Returns the height of the most-work fully-validated chain.
The genesis block has height 0.
- getblockfilter
getblockfilter "blockhash" ( "filtertype" )
Retrieve a BIP 157 content filter for a particular block.
Result
{ (json object) "filter" : "hex", (string) the hex-encoded filter data "header" : "hex" (string) the hex-encoded filter header }
Examples
stohncoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- getblockhash
getblockhash height
Returns hash of block in best-block-chain at height provided.
- getblockheader
getblockheader "blockhash" ( verbose )
If verbose is false, returns a string that is serialized, hex-encoded data for blockheader ‘hash’.
If verbose is true, returns an Object with information about blockheader ‘hash’.
Argument #2 - verbose
Type: boolean, optional, default=true
true for a json object, false for the hex-encoded data
Result (for verbose = true)
{ (json object) "hash" : "hex", (string) the block hash (same as provided) "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain "height" : n, (numeric) The block height or index "version" : n, (numeric) The block version "versionHex" : "hex", (string) The block version formatted in hexadecimal "merkleroot" : "hex", (string) The merkle root "time" : xxx, (numeric) The block time expressed in UNIX epoch time "mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time "nonce" : n, (numeric) The nonce "bits" : "hex", (string) The bits "difficulty" : n, (numeric) The difficulty "chainwork" : "hex", (string) Expected number of hashes required to produce the current chain "nTx" : n, (numeric) The number of transactions in the block "previousblockhash" : "hex", (string) The hash of the previous block "nextblockhash" : "hex" (string) The hash of the next block }
Result (for verbose=false)
Name
Type
Description
hex
string
A string that is serialized, hex-encoded data for block ‘hash’
Examples
stohncoin-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- getblockstats
getblockstats hash_or_height ( stats )
Compute per block statistics for a given window. All amounts are in satoshis.
It won’t work for some heights with pruning.
Argument #1 - hash_or_height
Type: string or numeric, required
The block hash or height of the target block
Argument #2 - stats
Type: json array, optional, default=all values
Values to plot (see result below)
[ "height", (string) Selected statistic "time", (string) Selected statistic ... ]
Result
{ (json object) "avgfee" : n, (numeric) Average fee in the block "avgfeerate" : n, (numeric) Average feerate (in satoshis per virtual byte) "avgtxsize" : n, (numeric) Average transaction size "blockhash" : "hex", (string) The block hash (to check for potential reorgs) "feerate_percentiles" : [ (json array) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte) n, (numeric) The 10th percentile feerate n, (numeric) The 25th percentile feerate n, (numeric) The 50th percentile feerate n, (numeric) The 75th percentile feerate n (numeric) The 90th percentile feerate ], "height" : n, (numeric) The height of the block "ins" : n, (numeric) The number of inputs (excluding coinbase) "maxfee" : n, (numeric) Maximum fee in the block "maxfeerate" : n, (numeric) Maximum feerate (in satoshis per virtual byte) "maxtxsize" : n, (numeric) Maximum transaction size "medianfee" : n, (numeric) Truncated median fee in the block "mediantime" : n, (numeric) The block median time past "mediantxsize" : n, (numeric) Truncated median transaction size "minfee" : n, (numeric) Minimum fee in the block "minfeerate" : n, (numeric) Minimum feerate (in satoshis per virtual byte) "mintxsize" : n, (numeric) Minimum transaction size "outs" : n, (numeric) The number of outputs "subsidy" : n, (numeric) The block subsidy "swtotal_size" : n, (numeric) Total size of all segwit transactions "swtotal_weight" : n, (numeric) Total weight of all segwit transactions "swtxs" : n, (numeric) The number of segwit transactions "time" : n, (numeric) The block time "total_out" : n, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee]) "total_size" : n, (numeric) Total size of all non-coinbase transactions "total_weight" : n, (numeric) Total weight of all non-coinbase transactions "totalfee" : n, (numeric) The fee total "txs" : n, (numeric) The number of transactions (including coinbase) "utxo_increase" : n, (numeric) The increase/decrease in the number of unspent outputs "utxo_size_inc" : n (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar) }
Examples
stohncoin-cli getblockstats '"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]'
stohncoin-cli getblockstats 1000 '["minfeerate","avgfeerate"]'
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockstats", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockstats", "params": [1000, ["minfeerate","avgfeerate"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- getblocktemplate
getblocktemplate ( "template_request" )
If the request parameters include a ‘mode’ key, that is used to explicitly select between the default ‘template’ request or a ‘proposal’.
It returns data needed to construct a block to work on.
For full specification, see BIPs 22, 23, 9, and 145:
Argument #1 - template_request
Type: json object, optional, default={}
- Format of the template
“rules”: [ (json array, required) A list of strings “segwit”, (string, required) (literal) indicates client side segwit support “str”, (string) other client side supported softfork deployment … ], }
{ "mode": "str", (string, optional) This must be set to "template", "proposal" (see BIP 23), or omitted "capabilities": [ (json array, optional) A list of strings "str", (string) client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid' ... ],
Result
{ (json object) "version" : n, (numeric) The preferred block version "rules" : [ (json array) specific block rules that are to be enforced "str", (string) name of a rule the client must understand to some extent; see BIP 9 for format ... ], "vbavailable" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments "rulename" : n, (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule ... }, "vbrequired" : n, (numeric) bit mask of versionbits the server requires set in submissions "previousblockhash" : "str", (string) The hash of current highest block "transactions" : [ (json array) contents of non-coinbase transactions that should be included in the next block { (json object) "data" : "hex", (string) transaction data encoded in hexadecimal (byte-for-byte) "txid" : "hex", (string) transaction id encoded in little-endian hexadecimal "hash" : "hex", (string) hash encoded in little-endian hexadecimal (including witness data) "depends" : [ (json array) array of numbers n, (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is ... ], "fee" : n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one "sigops" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero "weight" : n (numeric) total transaction weight, as counted for purposes of block limits }, ... ], "coinbaseaux" : { (json object) data that should be included in the coinbase's scriptSig content "key" : "hex", (string) values must be in the coinbase (keys may be ignored) ... }, "coinbasevalue" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis) "longpollid" : "str", (string) an id to include with a request to longpoll on an update to this template "target" : "str", (string) The hash target "mintime" : xxx, (numeric) The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time "mutable" : [ (json array) list of ways the block template may be changed "str", (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock' ... ], "noncerange" : "hex", (string) A range of valid nonces "sigoplimit" : n, (numeric) limit of sigops in blocks "sizelimit" : n, (numeric) limit of block size "weightlimit" : n, (numeric) limit of block weight "curtime" : xxx, (numeric) current timestamp in UNIX epoch time "bits" : "str", (string) compressed target of next block "height" : n, (numeric) The height of the next block "default_witness_commitment" : "str" (string, optional) a valid witness commitment for the unmodified block template }
- getchaintips
getchaintips
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
Result
[ (json array) { (json object) "height" : n, (numeric) height of the chain tip "hash" : "hex", (string) block hash of the tip "branchlen" : n, (numeric) zero for main chain, otherwise length of branch connecting the tip to the main chain "status" : "str" (string) status of the chain, "active" for the main chain Possible values for status: 1. "invalid" This branch contains at least one invalid block 2. "headers-only" Not all blocks for this branch are available, but the headers are valid 3. "valid-headers" All blocks are available for this branch, but they were never fully validated 4. "valid-fork" This branch is not part of the active chain, but is fully validated 5. "active" This is the tip of the active main chain, which is certainly valid }, ... ]
- getchaintxstats
getchaintxstats ( nblocks "blockhash" )
Compute statistics about the total number and rate of transactions in the chain.
Argument #1 - nblocks
Type: numeric, optional, default=one month
Size of the window in number of blocks
Argument #2 - blockhash
Type: string, optional, default=chain tip
The hash of the block that ends the window.
Result
{ (json object) "time" : xxx, (numeric) The timestamp for the final block in the window, expressed in UNIX epoch time "txcount" : n, (numeric) The total number of transactions in the chain up to that point "window_final_block_hash" : "hex", (string) The hash of the final block in the window "window_final_block_height" : n, (numeric) The height of the final block in the window. "window_block_count" : n, (numeric) Size of the window in number of blocks "window_tx_count" : n, (numeric) The number of transactions in the window. Only returned if "window_block_count" is > 0 "window_interval" : n, (numeric) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0 "txrate" : n (numeric) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0 }
- getconnectioncount
getconnectioncount
Returns the number of connections to other nodes.
- getdescriptorinfo
getdescriptorinfo "descriptor"
Analyses a descriptor.
Result
{ (json object) "descriptor" : "str", (string) The descriptor in canonical form, without private keys "checksum" : "str", (string) The checksum for the input descriptor "isrange" : true|false, (boolean) Whether the descriptor is ranged "issolvable" : true|false, (boolean) Whether the descriptor is solvable "hasprivatekeys" : true|false (boolean) Whether the input descriptor contained at least one private key }
- getdifficulty
- getindexinfo
getindexinfo ( "index_name" )
Returns the status of one or all available indices currently running in the node.
Result
{ (json object) "name" : { (json object) The name of the index "synced" : true|false, (boolean) Whether the index is synced or not "best_block_height" : n (numeric) The block height to which the index is synced } }
Examples
stohncoin-cli getindexinfo
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getindexinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
stohncoin-cli getindexinfo txindex
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getindexinfo", "params": [txindex]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- getmemoryinfo
getmemoryinfo ( "mode" )
Returns an object containing information about memory usage.
Argument #1 - mode
Type: string, optional, default=”stats”
- determines what kind of information is returned.
“stats” returns general statistics about memory usage in the daemon.
“mallocinfo” returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+).
Result (mode “stats”)
{ (json object) "locked" : { (json object) Information about locked memory manager "used" : n, (numeric) Number of bytes used "free" : n, (numeric) Number of bytes available in current arenas "total" : n, (numeric) Total number of bytes managed "locked" : n, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk. "chunks_used" : n, (numeric) Number allocated chunks "chunks_free" : n (numeric) Number unused chunks } }
- getmempoolancestors
getmempoolancestors "txid" ( verbose )
If txid is in the mempool, returns all in-mempool ancestors.
Argument #2 - verbose
Type: boolean, optional, default=false
True for a json object, false for array of transaction ids
Result (for verbose = false)
[ (json array) "hex", (string) The transaction id of an in-mempool ancestor transaction ... ]
Result (for verbose = true)
{ (json object) "transactionid" : { (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in SOH (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in SOH "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in SOH "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in SOH "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in SOH }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) }, ... }
- getmempooldescendants
getmempooldescendants "txid" ( verbose )
If txid is in the mempool, returns all in-mempool descendants.
Argument #2 - verbose
Type: boolean, optional, default=false
True for a json object, false for array of transaction ids
Result (for verbose = false)
[ (json array) "hex", (string) The transaction id of an in-mempool descendant transaction ... ]
Result (for verbose = true)
{ (json object) "transactionid" : { (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in SOH (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in SOH "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in SOH "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in SOH "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in SOH }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) }, ... }
- getmempoolentry
getmempoolentry "txid"
Returns mempool data for given transaction
Result
{ (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in SOH (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in SOH "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in SOH "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in SOH "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in SOH }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) }
- getmempoolinfo
getmempoolinfo
Returns details on the active state of the TX memory pool.
Result
{ (json object) "loaded" : true|false, (boolean) True if the mempool is fully loaded "size" : n, (numeric) Current tx count "bytes" : n, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted "usage" : n, (numeric) Total memory usage for the mempool "maxmempool" : n, (numeric) Maximum memory usage for the mempool "mempoolminfee" : n, (numeric) Minimum fee rate in SOH/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee "minrelaytxfee" : n, (numeric) Current minimum relay fee for transactions "unbroadcastcount" : n (numeric) Current number of transactions that haven't passed initial broadcast yet }
- getnettotals
getnettotals
Returns information about network traffic, including bytes in, bytes out, and current time.
Result
{ (json object) "totalbytesrecv" : n, (numeric) Total bytes received "totalbytessent" : n, (numeric) Total bytes sent "timemillis" : xxx, (numeric) Current UNIX epoch time in milliseconds "uploadtarget" : { (json object) "timeframe" : n, (numeric) Length of the measuring timeframe in seconds "target" : n, (numeric) Target in bytes "target_reached" : true|false, (boolean) True if target is reached "serve_historical_blocks" : true|false, (boolean) True if serving historical blocks "bytes_left_in_cycle" : n, (numeric) Bytes left in current time cycle "time_left_in_cycle" : n (numeric) Seconds left in current time cycle } }
- getnetworkhashps
getnetworkhashps ( nblocks height )
Returns the estimated network hashes per second based on the last n blocks.
Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.
Pass in [height] to estimate the network speed at the time when a certain block was found.
Argument #1 - nblocks
Type: numeric, optional, default=120
The number of blocks, or -1 for blocks since last difficulty change.
- getnetworkinfo
getnetworkinfo
Returns an object containing various state info regarding P2P networking.
Result
{ (json object) "version" : n, (numeric) the server version "subversion" : "str", (string) the server subversion string "protocolversion" : n, (numeric) the protocol version "localservices" : "hex", (string) the services we offer to the network "localservicesnames" : [ (json array) the services we offer to the network, in human-readable form "str", (string) the service name ... ], "localrelay" : true|false, (boolean) true if transaction relay is requested from peers "timeoffset" : n, (numeric) the time offset "connections" : n, (numeric) the total number of connections "connections_in" : n, (numeric) the number of inbound connections "connections_out" : n, (numeric) the number of outbound connections "networkactive" : true|false, (boolean) whether p2p networking is enabled "networks" : [ (json array) information per network { (json object) "name" : "str", (string) network (ipv4, ipv6 or onion) "limited" : true|false, (boolean) is the network limited using -onlynet? "reachable" : true|false, (boolean) is the network reachable? "proxy" : "str", (string) ("host:port") the proxy that is used for this network, or empty if none "proxy_randomize_credentials" : true|false (boolean) Whether randomized credentials are used }, ... ], "relayfee" : n, (numeric) minimum relay fee for transactions in SOH/kB "incrementalfee" : n, (numeric) minimum fee increment for mempool limiting or BIP 125 replacement in SOH/kB "localaddresses" : [ (json array) list of local addresses { (json object) "address" : "str", (string) network address "port" : n, (numeric) network port "score" : n (numeric) relative score }, ... ], "warnings" : "str" (string) any network and blockchain warnings }
- getnodeaddresses
getnodeaddresses ( count )
Return known addresses which can potentially be used to find new nodes in the network
Argument #1 - count
Type: numeric, optional, default=1
The maximum number of addresses to return. Specify 0 to return all known addresses.
- getpeerinfo
getpeerinfo
Returns data about each connected network node as a json array of objects.
Result
[ (json array) { (json object) "id" : n, (numeric) Peer index "addr" : "str", (string) (host:port) The IP address and port of the peer "addrbind" : "str", (string) (ip:port) Bind address of the connection to the peer "addrlocal" : "str", (string) (ip:port) Local address as reported by the peer "network" : "str", (string) Network (ipv4, ipv6, or onion) the peer connected through "mapped_as" : n, (numeric) The AS in the BGP route to the peer used for diversifying peer selection (only available if the asmap config flag is set) "services" : "hex", (string) The services offered "servicesnames" : [ (json array) the services offered, in human-readable form "str", (string) the service name if it is recognised ... ], "relaytxes" : true|false, (boolean) Whether peer has asked us to relay transactions to it "lastsend" : xxx, (numeric) The UNIX epoch time of the last send "lastrecv" : xxx, (numeric) The UNIX epoch time of the last receive "last_transaction" : xxx, (numeric) The UNIX epoch time of the last valid transaction received from this peer "last_block" : xxx, (numeric) The UNIX epoch time of the last block received from this peer "bytessent" : n, (numeric) The total bytes sent "bytesrecv" : n, (numeric) The total bytes received "conntime" : xxx, (numeric) The UNIX epoch time of the connection "timeoffset" : n, (numeric) The time offset in seconds "pingtime" : n, (numeric) ping time (if available) "minping" : n, (numeric) minimum observed ping time (if any at all) "pingwait" : n, (numeric) ping wait (if non-zero) "version" : n, (numeric) The peer version, such as 70001 "subver" : "str", (string) The string version "inbound" : true|false, (boolean) Inbound (true) or Outbound (false) "addnode" : true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection (DEPRECATED, returned only if the config option -deprecatedrpc=getpeerinfo_addnode is passed) "connection_type" : "str", (string) Type of connection: outbound-full-relay (default automatic connections), block-relay-only (does not relay transactions or addresses), inbound (initiated by the peer), manual (added via addnode RPC or -addnode/-connect configuration options), addr-fetch (short-lived automatic connection for soliciting addresses), feeler (short-lived automatic connection for testing addresses). Please note this output is unlikely to be stable in upcoming releases as we iterate to best capture connection behaviors. "startingheight" : n, (numeric) The starting height (block) of the peer "banscore" : n, (numeric) The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed) "synced_headers" : n, (numeric) The last header we have in common with this peer "synced_blocks" : n, (numeric) The last block we have in common with this peer "inflight" : [ (json array) n, (numeric) The heights of blocks we're currently asking from this peer ... ], "whitelisted" : true|false, (boolean, optional) Whether the peer is whitelisted with default permissions (DEPRECATED, returned only if config option -deprecatedrpc=whitelisted is passed) "permissions" : [ (json array) Any special permissions that have been granted to this peer "str", (string) bloomfilter (allow requesting BIP37 filtered blocks and transactions), noban (do not ban for misbehavior; implies download), forcerelay (relay transactions that are already in the mempool; implies relay), relay (relay even in -blocksonly mode, and unlimited transaction announcements), mempool (allow requesting BIP35 mempool contents), download (allow getheaders during IBD, no disconnect after maxuploadtarget limit), addr (responses to GETADDR avoid hitting the cache and contain random records with the most up-to-date info). ... ], "minfeefilter" : n, (numeric) The minimum fee rate for transactions this peer accepts "bytessent_per_msg" : { (json object) "msg" : n, (numeric) The total bytes sent aggregated by message type When a message type is not listed in this json object, the bytes sent are 0. Only known message types can appear as keys in the object. ... }, "bytesrecv_per_msg" : { (json object) "msg" : n (numeric) The total bytes received aggregated by message type When a message type is not listed in this json object, the bytes received are 0. Only known message types can appear as keys in the object and all bytes received of unknown message types are listed under '*other*'. } }, ... ]
- getrawchangeaddress
getrawchangeaddress ( "address_type" )
Returns a new Stohncoin address, for receiving change.
This is for use with raw transactions, NOT normal use.
- getrawmempool
getrawmempool ( verbose mempool_sequence )
Returns all transaction ids in memory pool as a json array of string transaction ids.
Hint: use getmempoolentry to fetch a specific transaction from the mempool.
Argument #1 - verbose
Type: boolean, optional, default=false
True for a json object, false for array of transaction ids
Argument #2 - mempool_sequence
Type: boolean, optional, default=false
If verbose=false, returns a json object with transaction list and mempool sequence number attached.
Result (for verbose = true)
{ (json object) "transactionid" : { (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in SOH (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in SOH "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in SOH "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in SOH "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in SOH }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) }, ... }
- getrawtransaction
getrawtransaction "txid" ( verbose "blockhash" )
Return the raw transaction data.
By default this function only works for mempool transactions. When called with a blockhash argument, getrawtransaction will return the transaction if the specified block is available and the transaction is found in that block. When called without a blockhash argument, getrawtransaction will return the transaction if it is in the mempool, or if -txindex is enabled and the transaction is in a block in the blockchain.
Hint: Use gettransaction for wallet transactions.
If verbose is ‘true’, returns an Object with information about ‘txid’.
If verbose is ‘false’ or omitted, returns a string that is serialized, hex-encoded data for ‘txid’.
Argument #2 - verbose
Type: boolean, optional, default=false
If false, return a string, otherwise return a json object
Result (if verbose is not set or set to false)
Name
Type
Description
str
string
The serialized, hex-encoded data for ‘txid’
Result (if verbose is set to true)
{ (json object) "in_active_chain" : true|false, (boolean) Whether specified block is in the active chain or not (only present with explicit "blockhash" argument) "hex" : "hex", (string) The serialized, hex-encoded data for 'txid' "txid" : "hex", (string) The transaction id (same as provided) "hash" : "hex", (string) The transaction hash (differs from txid for witness transactions) "size" : n, (numeric) The serialized transaction size "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) "weight" : n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4) "version" : n, (numeric) The version "locktime" : xxx, (numeric) The lock time "vin" : [ (json array) { (json object) "txid" : "hex", (string) The transaction id "vout" : n, (numeric) The output number "scriptSig" : { (json object) The script "asm" : "str", (string) asm "hex" : "hex" (string) hex }, "sequence" : n, (numeric) The script sequence number "txinwitness" : [ (json array) "hex", (string) hex-encoded witness data (if any) ... ] }, ... ], "vout" : [ (json array) { (json object) "value" : n, (numeric) The value in SOH "n" : n, (numeric) index "scriptPubKey" : { (json object) "asm" : "str", (string) the asm "hex" : "str", (string) the hex "reqSigs" : n, (numeric) The required sigs "type" : "str", (string) The type, eg 'pubkeyhash' "addresses" : [ (json array) "str", (string) stohncoin address ... ] } }, ... ], "blockhash" : "hex", (string) the block hash "confirmations" : n, (numeric) The confirmations "blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time "time" : n (numeric) Same as "blocktime" }
Examples
stohncoin-cli getrawtransaction "mytxid"
stohncoin-cli getrawtransaction "mytxid" true
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getrawtransaction", "params": ["mytxid", true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
stohncoin-cli getrawtransaction "mytxid" false "myblockhash"
stohncoin-cli getrawtransaction "mytxid" true "myblockhash"
- getreceivedbyaddress
getreceivedbyaddress "address" ( minconf )
Returns the total amount received by the given address in transactions with at least minconf confirmations.
Argument #2 - minconf
Type: numeric, optional, default=1
Only include transactions confirmed at least this many times.
Examples
The amount from transactions with at least 1 confirmation:
stohncoin-cli getreceivedbyaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl"
The amount including unconfirmed transactions, zero confirmations:
stohncoin-cli getreceivedbyaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 0
The amount with at least 6 confirmations:
stohncoin-cli getreceivedbyaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 6
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getreceivedbyaddress", "params": ["bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- getrpcinfo
getrpcinfo
Returns details of the RPC server.
Result
{ (json object) "active_commands" : [ (json array) All active commands { (json object) Information about an active command "method" : "str", (string) The name of the RPC command "duration" : n (numeric) The running time in microseconds }, ... ], "logpath" : "str" (string) The complete file path to the debug log }
- gettransaction
gettransaction "txid" ( include_watchonly verbose )
Get detailed information about in-wallet transaction <txid>
Argument #2 - include_watchonly
Type: boolean, optional, default=true for watch-only wallets, otherwise false
Whether to include watch-only addresses in balance calculation and details[]
Argument #3 - verbose
Type: boolean, optional, default=false
Whether to include a decoded field containing the decoded transaction (equivalent to RPC decoderawtransaction)
Result
{ (json object) "amount" : n, (numeric) The amount in SOH "fee" : n, (numeric) The amount of the fee in SOH. This is negative and only available for the 'send' category of transactions. "confirmations" : n, (numeric) The number of confirmations for the transaction. Negative confirmations means the transaction conflicted that many blocks ago. "generated" : true|false, (boolean) Only present if transaction only input is a coinbase one. "trusted" : true|false, (boolean) Only present if we consider transaction to be trusted and so safe to spend from. "blockhash" : "hex", (string) The block hash containing the transaction. "blockheight" : n, (numeric) The block height containing the transaction. "blockindex" : n, (numeric) The index of the transaction in the block that includes it. "blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time. "txid" : "hex", (string) The transaction id. "walletconflicts" : [ (json array) Conflicting transaction ids. "hex", (string) The transaction id. ... ], "time" : xxx, (numeric) The transaction time expressed in UNIX epoch time. "timereceived" : xxx, (numeric) The time received expressed in UNIX epoch time. "comment" : "str", (string) If a comment is associated with the transaction, only present if not empty. "bip125-replaceable" : "str", (string) ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee); may be unknown for unconfirmed transactions not in the mempool "details" : [ (json array) { (json object) "involvesWatchonly" : true|false, (boolean) Only returns true if imported addresses were involved in transaction. "address" : "str", (string) The stohncoin address involved in the transaction. "category" : "str", (string) The transaction category. "send" Transactions sent. "receive" Non-coinbase transactions received. "generate" Coinbase transactions received with more than 100 confirmations. "immature" Coinbase transactions received with 100 or fewer confirmations. "orphan" Orphaned coinbase transactions received. "amount" : n, (numeric) The amount in SOH "label" : "str", (string) A comment for the address/transaction, if any "vout" : n, (numeric) the vout value "fee" : n, (numeric) The amount of the fee in SOH. This is negative and only available for the 'send' category of transactions. "abandoned" : true|false (boolean) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions. }, ... ], "hex" : "hex", (string) Raw data for transaction "decoded" : { (json object) Optional, the decoded transaction (only present when `verbose` is passed) ... Equivalent to the RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed. } }
Examples
stohncoin-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"
stohncoin-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" true
stohncoin-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" false true
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "gettransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- gettxout
gettxout "txid" n ( include_mempool )
Returns details about an unspent transaction output.
Argument #3 - include_mempool
Type: boolean, optional, default=true
Whether to include the mempool. Note that an unspent output that is spent in the mempool won’t appear.
Result
{ (json object) "bestblock" : "hex", (string) The hash of the block at the tip of the chain "confirmations" : n, (numeric) The number of confirmations "value" : n, (numeric) The transaction value in SOH "scriptPubKey" : { (json object) "asm" : "hex", (string) "hex" : "hex", (string) "reqSigs" : n, (numeric) Number of required signatures "type" : "hex", (string) The type, eg pubkeyhash "addresses" : [ (json array) array of stohncoin addresses "str", (string) stohncoin address ... ] }, "coinbase" : true|false (boolean) Coinbase or not }
Examples
Get unspent transactions:
stohncoin-cli listunspent
View the details:
stohncoin-cli gettxout "txid" 1
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "gettxout", "params": ["txid", 1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- gettxoutproof
gettxoutproof ["txid",...] ( "blockhash" )
Returns a hex-encoded proof that “txid” was included in a block.
NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash).
Argument #1 - txids
Type: json array, required
The txids to filter
[ "txid", (string) A transaction hash ... ]
- gettxoutsetinfo
gettxoutsetinfo ( "hash_type" )
Returns statistics about the unspent transaction output set.
Note this call may take some time.
Argument #1 - hash_type
Type: string, optional, default=hash_serialized_2
Which UTXO set hash should be calculated. Options: ‘hash_serialized_2’ (the legacy algorithm), ‘none’.
Result
{ (json object) "height" : n, (numeric) The current block height (index) "bestblock" : "hex", (string) The hash of the block at the tip of the chain "transactions" : n, (numeric) The number of transactions with unspent outputs "txouts" : n, (numeric) The number of unspent transaction outputs "bogosize" : n, (numeric) A meaningless metric for UTXO set size "hash_serialized_2" : "hex", (string) The serialized hash (only present if 'hash_serialized_2' hash_type is chosen) "disk_size" : n, (numeric) The estimated size of the chainstate on disk "total_amount" : n (numeric) The total amount }
- getunconfirmedbalance
- getwalletinfo
getwalletinfo
Returns an object containing various wallet state info.
Result
{ (json object) "walletname" : "str", (string) the wallet name "walletversion" : n, (numeric) the wallet version "format" : "str", (string) the database format (bdb or sqlite) "balance" : n, (numeric) DEPRECATED. Identical to getbalances().mine.trusted "unconfirmed_balance" : n, (numeric) DEPRECATED. Identical to getbalances().mine.untrusted_pending "immature_balance" : n, (numeric) DEPRECATED. Identical to getbalances().mine.immature "txcount" : n, (numeric) the total number of transactions in the wallet "keypoololdest" : xxx, (numeric) the UNIX epoch time of the oldest pre-generated key in the key pool. Legacy wallets only. "keypoolsize" : n, (numeric) how many new keys are pre-generated (only counts external keys) "keypoolsize_hd_internal" : n, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used) "unlocked_until" : xxx, (numeric, optional) the UNIX epoch time until which the wallet is unlocked for transfers, or 0 if the wallet is locked (only present for passphrase-encrypted wallets) "paytxfee" : n, (numeric) the transaction fee configuration, set in SOH/kvB "hdseedid" : "hex", (string, optional) the Hash160 of the HD seed (only present when HD is enabled) "private_keys_enabled" : true|false, (boolean) false if privatekeys are disabled for this wallet (enforced watch-only wallet) "avoid_reuse" : true|false, (boolean) whether this wallet tracks clean/dirty coins in terms of reuse "scanning" : { (json object) current scanning details, or false if no scan is in progress "duration" : n, (numeric) elapsed seconds since scan start "progress" : n (numeric) scanning progress percentage [0.0, 1.0] }, "descriptors" : true|false (boolean) whether this wallet uses descriptors for scriptPubKey management }
- importwallet
importwallet
importwallet "filename"
Imports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys.
Note: Use “getwalletinfo” to query the scanning progress.
Examples
Dump the wallet:
stohncoin-cli dumpwallet "test"
Import the wallet:
stohncoin-cli importwallet "test"
Import using the json rpc call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "importwallet", "params": ["test"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- help
- importaddress
importaddress
importaddress "address" ( "label" rescan p2sh )
Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.
Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.
If you have the full public key, you should call importpubkey instead of this.
Hint: use importmulti to import more than one address.
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.
Note: Use “getwalletinfo” to query the scanning progress.
Argument #4 - p2sh
Type: boolean, optional, default=false
Add the P2SH version of the script as well
Examples
Import an address with rescan:
stohncoin-cli importaddress "myaddress"
Import using a label without rescan:
stohncoin-cli importaddress "myaddress" "testing" false
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "importaddress", "params": ["myaddress", "testing", false]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- importdescriptors
importdescriptors
importdescriptors "requests"
Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.
Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls may report that the imported keys, addresses or scripts exist but related transactions are still missing.
Argument #1 - requests
Type: json array, required
Data to be imported
[ { (json object) "desc": "str", (string, required) Descriptor to import. "active": bool, (boolean, optional, default=false) Set this descriptor to be the active descriptor for the corresponding output type/externality "range": n or [n,n], (numeric or array) If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import "next_index": n, (numeric) If a ranged descriptor is set to active, this specifies the next index to generate addresses from "timestamp": timestamp | "now", (integer / string, required) Time from which to start rescanning the blockchain for this descriptor, in UNIX epoch time Use the string "now" to substitute the current synced blockchain time. "now" can be specified to bypass scanning, for outputs which are known to never have been used, and 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp of all descriptors being imported will be scanned. "internal": bool, (boolean, optional, default=false) Whether matching outputs should be treated as not incoming payments (e.g. change) "label": "str", (string, optional, default='') Label to assign to the address, only allowed with internal=false }, ... ]
Result
[ (json array) Response is an array with the same size as the input that has the execution result { (json object) "success" : true|false, (boolean) "warnings" : [ (json array, optional) "str", (string) ... ], "error" : { (json object, optional) ... JSONRPC error } }, ... ]
Examples
stohncoin-cli importdescriptors '[{ "desc": "<my descriptor>", "timestamp":1455191478, "internal": true }, { "desc": "<my desccriptor 2>", "label": "example 2", "timestamp": 1455191480 }]'
stohncoin-cli importdescriptors '[{ "desc": "<my descriptor>", "timestamp":1455191478, "active": true, "range": [0,100], "label": "<my bech32 wallet>" }]'
- importmulti
importmulti
importmulti "requests" ( "options" )
Import addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.
If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The ‘watchonly’ option must be set to true in this case or a warning will be returned.
Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to false, or a warning will be returned.
Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported keys, addresses or scripts exist but related transactions are still missing.
Note: Use “getwalletinfo” to query the scanning progress.
Argument #1 - requests
Type: json array, required
- Data to be imported
“range”: n or [n,n], (numeric or array) If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import “internal”: bool, (boolean, optional, default=false) Stating whether matching outputs should be treated as not incoming payments (also known as change) “watchonly”: bool, (boolean, optional, default=false) Stating whether matching outputs should be considered watchonly. “label”: “str”, (string, optional, default=’’) Label to assign to the address, only allowed with internal=false “keypool”: bool, (boolean, optional, default=false) Stating whether imported public keys should be added to the keypool for when users request new addresses. Only allowed when wallet private keys are disabled }, … ]
[ { (json object) "desc": "str", (string) Descriptor to import. If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys "scriptPubKey": "<script>" | { "address":"<address>" }, (string / json, required) Type of scriptPubKey (string for script, json for address). Should not be provided if using a descriptor "timestamp": timestamp | "now", (integer / string, required) Creation time of the key expressed in UNIX epoch time, or the string "now" to substitute the current synced blockchain time. The timestamp of the oldest key will determine how far back blockchain rescans need to begin for missing wallet transactions. "now" can be specified to bypass scanning, for keys which are known to never have been used, and 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest key creation time of all keys being imported by the importmulti call will be scanned. "redeemscript": "str", (string) Allowed only if the scriptPubKey is a P2SH or P2SH-P2WSH address/scriptPubKey "witnessscript": "str", (string) Allowed only if the scriptPubKey is a P2SH-P2WSH or P2WSH address/scriptPubKey "pubkeys": [ (json array, optional, default=empty array) Array of strings giving pubkeys to import. They must occur in P2PKH or P2WPKH scripts. They are not required when the private key is also provided (see the "keys" argument). "pubKey", (string) ... ], "keys": [ (json array, optional, default=empty array) Array of strings giving private keys to import. The corresponding public keys must occur in the output or redeemscript. "key", (string) ... ],
Argument #2 - options
Type: json object, optional
{ "rescan": bool, (boolean, optional, default=true) Stating if should rescan the blockchain after all imports }
Result
[ (json array) Response is an array with the same size as the input that has the execution result { (json object) "success" : true|false, (boolean) "warnings" : [ (json array, optional) "str", (string) ... ], "error" : { (json object, optional) ... JSONRPC error } }, ... ]
Examples
stohncoin-cli importmulti '[{ "scriptPubKey": { "address": "<my address>" }, "timestamp":1455191478 }, { "scriptPubKey": { "address": "<my 2nd address>" }, "label": "example 2", "timestamp": 1455191480 }]'
stohncoin-cli importmulti '[{ "scriptPubKey": { "address": "<my address>" }, "timestamp":1455191478 }]' '{ "rescan": false}'
- importprivkey
importprivkey
importprivkey "privkey" ( "label" rescan )
Adds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup.
Hint: use importmulti to import more than one private key.
Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.
Note: Use “getwalletinfo” to query the scanning progress.
Argument #2 - label
Type: string, optional, default=current label if address exists, otherwise “”
An optional label
Examples
Dump a private key:
stohncoin-cli dumpprivkey "myaddress"
Import the private key with rescan:
stohncoin-cli importprivkey "mykey"
Import using a label and without rescan:
stohncoin-cli importprivkey "mykey" "testing" false
Import using default blank label and without rescan:
stohncoin-cli importprivkey "mykey" "" false
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "importprivkey", "params": ["mykey", "testing", false]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- importprunedfunds
importprunedfunds
importprunedfunds "rawtransaction" "txoutproof"
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.
Argument #1 - rawtransaction
Type: string, required
A raw transaction in hex funding an already-existing address in wallet
- importpubkey
importpubkey
importpubkey "pubkey" ( "label" rescan )
Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.
Hint: use importmulti to import more than one public key.
Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls may report that the imported pubkey exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.
Note: Use “getwalletinfo” to query the scanning progress.
Examples
Import a public key with rescan:
stohncoin-cli importpubkey "mypubkey"
Import using a label without rescan:
stohncoin-cli importpubkey "mypubkey" "testing" false
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "importpubkey", "params": ["mypubkey", "testing", false]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- joinpbsts
joinpsbts ["psbt",...]
Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs No input in any of the PSBTs can be in more than one of the PSBTs.
- keypoolrefill
keypoolrefill ( newsize )
Fills the keypool.
Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
- listaddressgroupings
listaddressgroupings
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
- listbanned
listbanned
List all manually banned IPs/Subnets.
- listlabels
listlabels ( "purpose" )
Returns the list of all labels, or labels that are assigned to addresses with a specific purpose.
Argument #1 - purpose
Type: string, optional
Address purpose to list labels for (‘send’,’receive’). An empty string is the same as not providing this argument.
Examples
List all labels:
stohncoin-cli listlabels
List labels that have receiving addresses:
stohncoin-cli listlabels receive
List labels that have sending addresses:
stohncoin-cli listlabels send
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listlabels", "params": [receive]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- listlockunspent
listlockunspent
Returns list of temporarily unspendable outputs.
See the lockunspent call to lock and unlock transactions for spending.
Result
[ (json array) { (json object) "txid" : "hex", (string) The transaction id locked "vout" : n (numeric) The vout value }, ... ]
Examples
List the unspent transactions:
stohncoin-cli listunspent
Lock an unspent transaction:
stohncoin-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
List the locked transactions:
stohncoin-cli listlockunspent
Unlock the transaction again:
stohncoin-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listlockunspent", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- listreceivedbyaddress
listreceivedbyaddress
listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" )
List balances by receiving address.
Argument #1 - minconf
Type: numeric, optional, default=1
The minimum number of confirmations before payments are included.
Argument #2 - include_empty
Type: boolean, optional, default=false
Whether to include addresses that haven’t received any payments.
Argument #3 - include_watchonly
Type: boolean, optional, default=true for watch-only wallets, otherwise false
Whether to include watch-only addresses (see ‘importaddress’)
Argument #4 - address_filter
Type: string, optional
If present, only return information on this address.
Result
[ (json array) { (json object) "involvesWatchonly" : true|false, (boolean) Only returns true if imported addresses were involved in transaction "address" : "str", (string) The receiving address "amount" : n, (numeric) The total amount in SOH received by the address "confirmations" : n, (numeric) The number of confirmations of the most recent transaction included "label" : "str", (string) The label of the receiving address. The default label is "" "txids" : [ (json array) "hex", (string) The ids of transactions received with the address ... ] }, ... ]
Examples
stohncoin-cli listreceivedbyaddress
stohncoin-cli listreceivedbyaddress 6 true
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listreceivedbyaddress", "params": [6, true, true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listreceivedbyaddress", "params": [6, true, true, "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- listreceivedbylabel
listreceivedbylabel ( minconf include_empty include_watchonly )
List received transactions by label.
Argument #1 - minconf
Type: numeric, optional, default=1
The minimum number of confirmations before payments are included.
Argument #2 - include_empty
Type: boolean, optional, default=false
Whether to include labels that haven’t received any payments.
Argument #3 - include_watchonly
Type: boolean, optional, default=true for watch-only wallets, otherwise false
Whether to include watch-only addresses (see ‘importaddress’)
Result
[ (json array) { (json object) "involvesWatchonly" : true|false, (boolean) Only returns true if imported addresses were involved in transaction "amount" : n, (numeric) The total amount received by addresses with this label "confirmations" : n, (numeric) The number of confirmations of the most recent transaction included "label" : "str" (string) The label of the receiving address. The default label is "" }, ... ]
- listsinceblock
listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )
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.
Argument #1 - blockhash
Type: string, optional
If set, the block hash to list transactions since, otherwise list all transactions.
Argument #2 - target_confirmations
Type: numeric, optional, default=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
Argument #3 - include_watchonly
Type: boolean, optional, default=true for watch-only wallets, otherwise false
Include transactions to watch-only addresses (see ‘importaddress’)
Argument #4 - include_removed
Type: boolean, optional, default=true
- Show transactions that were removed due to a reorg in the “removed” array
(not guaranteed to work on pruned nodes)
Result
{ (json object) "transactions" : [ (json array) { (json object) "involvesWatchonly" : true|false, (boolean) Only returns true if imported addresses were involved in transaction. "address" : "str", (string) The stohncoin address of the transaction. "category" : "str", (string) The transaction category. "send" Transactions sent. "receive" Non-coinbase transactions received. "generate" Coinbase transactions received with more than 100 confirmations. "immature" Coinbase transactions received with 100 or fewer confirmations. "orphan" Orphaned coinbase transactions received. "amount" : n, (numeric) The amount in SOH. This is negative for the 'send' category, and is positive for all other categories "vout" : n, (numeric) the vout value "fee" : n, (numeric) The amount of the fee in SOH. This is negative and only available for the 'send' category of transactions. "confirmations" : n, (numeric) The number of confirmations for the transaction. Negative confirmations means the transaction conflicted that many blocks ago. "generated" : true|false, (boolean) Only present if transaction only input is a coinbase one. "trusted" : true|false, (boolean) Only present if we consider transaction to be trusted and so safe to spend from. "blockhash" : "hex", (string) The block hash containing the transaction. "blockheight" : n, (numeric) The block height containing the transaction. "blockindex" : n, (numeric) The index of the transaction in the block that includes it. "blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time. "txid" : "hex", (string) The transaction id. "walletconflicts" : [ (json array) Conflicting transaction ids. "hex", (string) The transaction id. ... ], "time" : xxx, (numeric) The transaction time expressed in UNIX epoch time. "timereceived" : xxx, (numeric) The time received expressed in UNIX epoch time. "comment" : "str", (string) If a comment is associated with the transaction, only present if not empty. "bip125-replaceable" : "str", (string) ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee); may be unknown for unconfirmed transactions not in the mempool "abandoned" : true|false, (boolean) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions. "label" : "str", (string) A comment for the address/transaction, if any "to" : "str" (string) If a comment to is associated with the transaction. }, ... ], "removed" : [ (json array) <structure is the same as "transactions" above, only present if include_removed=true> Note: transactions that were re-added in the active chain will appear as-is in this array, and may thus have a positive confirmation count. ... ], "lastblock" : "hex" (string) The hash of the block (target_confirmations-1) from the best block on the main chain, or the genesis hash if the referenced block does not exist yet. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones }
Examples
stohncoin-cli listsinceblock
stohncoin-cli listsinceblock "000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad" 6
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listsinceblock", "params": ["000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- listtransactions
listtransactions
listtransactions ( "label" count skip include_watchonly )
If a label name is provided, this will return only incoming transactions paying to addresses with the specified label.
Returns up to ‘count’ most recent transactions skipping the first ‘from’ transactions.
Argument #1 - label
Type: string, optional
- If set, should be a valid label name to return only incoming transactions
with the specified label, or “*” to disable filtering and return all transactions.
Argument #4 - include_watchonly
Type: boolean, optional, default=true for watch-only wallets, otherwise false
Include transactions to watch-only addresses (see ‘importaddress’)
Result
[ (json array) { (json object) "involvesWatchonly" : true|false, (boolean) Only returns true if imported addresses were involved in transaction. "address" : "str", (string) The stohncoin address of the transaction. "category" : "str", (string) The transaction category. "send" Transactions sent. "receive" Non-coinbase transactions received. "generate" Coinbase transactions received with more than 100 confirmations. "immature" Coinbase transactions received with 100 or fewer confirmations. "orphan" Orphaned coinbase transactions received. "amount" : n, (numeric) The amount in SOH. This is negative for the 'send' category, and is positive for all other categories "label" : "str", (string) A comment for the address/transaction, if any "vout" : n, (numeric) the vout value "fee" : n, (numeric) The amount of the fee in SOH. This is negative and only available for the 'send' category of transactions. "confirmations" : n, (numeric) The number of confirmations for the transaction. Negative confirmations means the transaction conflicted that many blocks ago. "generated" : true|false, (boolean) Only present if transaction only input is a coinbase one. "trusted" : true|false, (boolean) Only present if we consider transaction to be trusted and so safe to spend from. "blockhash" : "hex", (string) The block hash containing the transaction. "blockheight" : n, (numeric) The block height containing the transaction. "blockindex" : n, (numeric) The index of the transaction in the block that includes it. "blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time. "txid" : "hex", (string) The transaction id. "walletconflicts" : [ (json array) Conflicting transaction ids. "hex", (string) The transaction id. ... ], "time" : xxx, (numeric) The transaction time expressed in UNIX epoch time. "timereceived" : xxx, (numeric) The time received expressed in UNIX epoch time. "comment" : "str", (string) If a comment is associated with the transaction, only present if not empty. "bip125-replaceable" : "str", (string) ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee); may be unknown for unconfirmed transactions not in the mempool "abandoned" : true|false (boolean) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions. }, ... ]
Examples
List the most recent 10 transactions in the systems:
stohncoin-cli listtransactions
List transactions 100 to 120:
stohncoin-cli listtransactions "*" 20 100
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listtransactions", "params": ["*", 20, 100]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- listunspent
listunspent ( minconf maxconf ["address",...] include_unsafe query_options )
Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations.
Optionally filter to only include txouts paid to specified addresses.
Argument #3 - addresses
Type: json array, optional, default=empty array
The stohncoin addresses to filter
[ "address", (string) stohncoin address ... ]
Argument #4 - include_unsafe
Type: boolean, optional, default=true
- Include outputs that are not safe to spend
See description of “safe” attribute below.
Argument #5 - query_options
Type: json object, optional
JSON with query options
{ "minimumAmount": amount, (numeric or string, optional, default=0) Minimum value of each UTXO in SOH "maximumAmount": amount, (numeric or string, optional, default=unlimited) Maximum value of each UTXO in SOH "maximumCount": n, (numeric, optional, default=unlimited) Maximum number of UTXOs "minimumSumAmount": amount, (numeric or string, optional, default=unlimited) Minimum sum value of all UTXOs in SOH }
Result
[ (json array) { (json object) "txid" : "hex", (string) the transaction id "vout" : n, (numeric) the vout value "address" : "str", (string) the stohncoin address "label" : "str", (string) The associated label, or "" for the default label "scriptPubKey" : "str", (string) the script key "amount" : n, (numeric) the transaction output amount in SOH "confirmations" : n, (numeric) The number of confirmations "redeemScript" : "hex", (string) The redeemScript if scriptPubKey is P2SH "witnessScript" : "str", (string) witnessScript if the scriptPubKey is P2WSH or P2SH-P2WSH "spendable" : true|false, (boolean) Whether we have the private keys to spend this output "solvable" : true|false, (boolean) Whether we know how to spend this output, ignoring the lack of keys "reused" : true|false, (boolean) (only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from) "desc" : "str", (string) (only when solvable) A descriptor for spending this output "safe" : true|false (boolean) Whether this output is considered safe to spend. Unconfirmed transactions from outside keys and unconfirmed replacement transactions are considered unsafe and are not eligible for spending by fundrawtransaction and sendtoaddress. }, ... ]
Examples
stohncoin-cli listunspent
stohncoin-cli listunspent 6 9999999 "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listunspent", "params": [6, 9999999 "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
stohncoin-cli listunspent 6 9999999 '[]' true '{ "minimumAmount": 0.005 }'
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listunspent", "params": [6, 9999999, [] , true, { "minimumAmount": 0.005 } ]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- listwalletdir
- listwallets
listwallets
Returns a list of currently loaded wallets.
For full information on the wallet, use “getwalletinfo”
- loadwallet
loadwallet "filename" ( load_on_startup )
Loads a wallet from a wallet file or directory.
Note that all wallet command-line options used when starting stohncoind will be applied to the new wallet (eg -rescan, etc).
Argument #2 - load_on_startup
Type: boolean, optional, default=null
Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
- lockunspent
lockunspent unlock ( [{"txid":"hex","vout":n},...] )
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 stohncoins.
Manually selected coins are automatically unlocked.
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.
Also see the listunspent call
Argument #1 - unlock
Type: boolean, required
Whether to unlock (true) or lock (false) the specified transactions
Argument #2 - transactions
Type: json array, optional, default=empty array
The transaction outputs and within each, the txid (string) vout (numeric).
[ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number }, ... ]
Examples
List the unspent transactions:
stohncoin-cli listunspent
Lock an unspent transaction:
stohncoin-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
List the locked transactions:
stohncoin-cli listlockunspent
Unlock the transaction again:
stohncoin-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- logging
logging ( ["include_category",...] ["exclude_category",...] )
Gets and sets the logging configuration.
When called without an argument, returns the list of categories with status that are currently being debug logged or not.
When called with arguments, adds or removes categories from debug logging and return the lists above.
The arguments are evaluated in order “include”, “exclude”.
If an item is both included and excluded, it will thus end up being excluded.
The valid logging categories are: net, tor, mempool, http, bench, zmq, walletdb, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, validation In addition, the following are available as category names with special meanings:
“all”, “1” : represent all logging categories.
“none”, “0” : even if other logging categories are specified, ignore all of them.
Argument #1 - include
Type: json array, optional
The categories to add to debug logging
[ "include_category", (string) the valid logging category ... ]
Argument #2 - exclude
Type: json array, optional
The categories to remove from debug logging
[ "exclude_category", (string) the valid logging category ... ]
- ping
ping
Requests that a ping be sent to all other nodes, to measure ping time.
Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.
Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
- preciousblock
preciousblock "blockhash"
Treats a block as if it were received before others with the same work.
A later preciousblock call can override the effect of an earlier one.
The effects of preciousblock are not retained across restarts.
- prioritisetransaction
prioritisetransaction "txid" ( dummy ) fee_delta
Accepts the transaction into mined blocks at a higher (or lower) priority
Argument #2 - dummy
Type: numeric, optional
- API-Compatibility for previous API. Must be zero or null.
DEPRECATED. For forward compatibility use named arguments and omit this parameter.
Argument #3 - fee_delta
Type: numeric, required
- The fee value (in satoshis) to add (or subtract, if negative).
Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX. The fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as it would have paid a higher (or lower) fee.
- pruneblockchain
- psbtbumpfee
psbtbumpfee "txid" ( options )
Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.
Returns a PSBT instead of creating and signing a new transaction.
An opt-in RBF transaction with the given txid must be in the wallet.
The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
It may add a new change output if one does not already exist.
All inputs in the original transaction will be included in the replacement transaction.
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 the estimatesmartfee RPC.
The user can specify a confirmation target for estimatesmartfee.
Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
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.
* WARNING: before version 0.21, fee_rate was in SOH/kvB. As of 0.21, fee_rate is in sat/vB. *
Argument #2 - options
Type: json object, optional
{ "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB instead of relying on the built-in fee estimator. Must be at least 1.000 sat/vB higher than the current transaction fee rate. WARNING: before version 0.21, fee_rate was in SOH/kvB. As of 0.21, fee_rate is in sat/vB. "replaceable": bool, (boolean, optional, default=true) Whether the new transaction should still be marked bip-125 replaceable. If true, the sequence numbers in the transaction will be left unchanged from the original. If false, any input sequence numbers in the original transaction that were less than 0xfffffffe will be increased to 0xfffffffe so the new transaction will not be explicitly bip-125 replaceable (though it may still be replaceable in practice, for example if it has unconfirmed ancestors which are replaceable). "estimate_mode": "str", (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative" }
Result
{ (json object) "psbt" : "str", (string) The base64-encoded unsigned PSBT of the new transaction. "origfee" : n, (numeric) The fee of the replaced transaction. "fee" : n, (numeric) The fee of the new transaction. "errors" : [ (json array) Errors encountered during processing (may be empty). "str", (string) ... ] }
- removeprunedfunds
removeprunedfunds "txid"
Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.
Examples
stohncoin-cli removeprunedfunds "a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "removeprunedfunds", "params": ["a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- rescanblockchain
rescanblockchain ( start_height stop_height )
Rescan the local blockchain for wallet related transactions.
Note: Use “getwalletinfo” to query the scanning progress.
Argument #1 - start_height
Type: numeric, optional, default=0
block height where the rescan should start
Argument #2 - stop_height
Type: numeric, optional
the last block height that should be scanned. If none is provided it will rescan up to the tip at return time of this call.
Result
{ (json object) "start_height" : n, (numeric) The block height where the rescan started (the requested height or 0) "stop_height" : n (numeric) The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background. }
- savemempool
savemempool
Dumps the mempool to disk. It will fail until the previous dump is fully loaded.
- scantxoutset
scantxoutset "action" ( [scanobjects,...] )
EXPERIMENTAL warning: this call may be removed or changed in future releases.
Scans the unspent transaction output set for entries that match certain output descriptors.
Examples of output descriptors are:
addr(<address>) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK) raw(<hex script>) Outputs whose scriptPubKey equals the specified hex scripts combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey pkh(<pubkey>) P2PKH outputs for the given pubkey sh(multi(<n>,<pubkey>,<pubkey>,…)) P2SH-multisig outputs for the given threshold and pubkeys
In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by “/”, and optionally ending in “/*” (unhardened), or “/*’” or “/*h” (hardened) to specify all unhardened or hardened child keys.
In the latter case, a range needs to be specified by below if different from 1000.
For more information on output descriptors, see the documentation in the doc/descriptors.md file.
Argument #1 - action
Type: string, required
- The action to execute
“start” for starting a scan “abort” for aborting the current scan (returns true when abort was successful) “status” for progress report (in %) of the current scan
Argument #2 - scanobjects
Type: json array
- Array of scan objects. Required for “start” action
Every scan object is either a string descriptor or an object:
[ "descriptor", (string) An output descriptor { (json object) An object with output descriptor and metadata "desc": "str", (string, required) An output descriptor "range": n or [n,n], (numeric or array, optional, default=1000) The range of HD chain indexes to explore (either end or [begin,end]) }, ... ]
Result
{ (json object) "success" : true|false, (boolean) Whether the scan was completed "txouts" : n, (numeric) The number of unspent transaction outputs scanned "height" : n, (numeric) The current block height (index) "bestblock" : "hex", (string) The hash of the block at the tip of the chain "unspents" : [ (json array) { (json object) "txid" : "hex", (string) The transaction id "vout" : n, (numeric) The vout value "scriptPubKey" : "hex", (string) The script key "desc" : "str", (string) A specialized descriptor for the matched scriptPubKey "amount" : n, (numeric) The total amount in SOH of the unspent output "height" : n (numeric) Height of the unspent transaction output }, ... ], "total_amount" : n (numeric) The total amount of all found unspent outputs in SOH }
- send
send [{"address":amount},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options )
EXPERIMENTAL warning: this call may be changed in future releases.
Send a transaction.
Argument #1 - outputs
Type: json array, required
- The outputs (key-value pairs), where none of the keys are duplicated.
That is, each address can only appear once and there can only be one ‘data’ object. For convenience, a dictionary, which holds the key-value pairs directly, is also accepted.
[ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the stohncoin address, the value (float or string) is the amount in SOH }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
Argument #2 - conf_target
Type: numeric, optional, default=wallet -txconfirmtarget
Confirmation target in blocks
Argument #3 - estimate_mode
Type: string, optional, default=unset
- The fee estimate mode, must be one of (case insensitive):
“unset” “economical” “conservative”
Argument #4 - fee_rate
Type: numeric or string, optional, default=not set, fall back to wallet fee estimation
Specify a fee rate in sat/vB.
Argument #5 - options
Type: json object, optional
- “locktime”: n, (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs
“lock_unspents”: bool, (boolean, optional, default=false) Lock selected unspent outputs “psbt”: bool, (boolean, optional, default=automatic) Always return a PSBT, implies add_to_wallet=false. “subtract_fee_from_outputs”: [ (json array, optional, default=empty array) Outputs to subtract the fee from, specified as integer indices. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less stohncoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. vout_index, (numeric) The zero-based output index, before a change output is added. … ], “replaceable”: bool, (boolean, optional, default=wallet default) Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees }
{ "add_inputs": bool, (boolean, optional, default=false) If inputs are specified, automatically include more if they are not enough. "add_to_wallet": bool, (boolean, optional, default=true) When false, returns a serialized transaction which will not be added to the wallet or broadcast "change_address": "hex", (string, optional, default=pool address) The stohncoin address to receive the change "change_position": n, (numeric, optional, default=random) The index of the change output "change_type": "str", (string, optional, default=set by -changetype) The output type to use. Only valid if change_address is not specified. Options are "legacy", "p2sh-segwit", and "bech32". "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks "estimate_mode": "str", (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive): "unset" "economical" "conservative" "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB. "include_watching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only. Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported, e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field. "inputs": [ (json array, optional, default=empty array) Specify inputs instead of adding them automatically. A JSON array of JSON objects "txid", (string, required) The transaction id vout, (numeric, required) The output number sequence, (numeric, required) The sequence number ... ],
Result
{ (json object) "complete" : true|false, (boolean) If the transaction has a complete set of signatures "txid" : "hex", (string) The transaction id for the send. Only 1 transaction is created regardless of the number of addresses. "hex" : "hex", (string) If add_to_wallet is false, the hex-encoded raw transaction with signature(s) "psbt" : "str" (string) If more signatures are needed, or if add_to_wallet is false, the base64-encoded (partially) signed transaction }
Examples
Send 0.1 SOH with a confirmation target of 6 blocks in economical fee estimate mode:
stohncoin-cli send '{"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl": 0.1}' 6 economical
Send 0.2 SOH with a fee rate of 1.1 sat/vB using positional arguments:
stohncoin-cli send '{"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl": 0.2}' null "unset" 1.1
Send 0.2 SOH with a fee rate of 1 sat/vB using the options argument:
stohncoin-cli send '{"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl": 0.2}' null "unset" null '{"fee_rate": 1}'
Send 0.3 SOH with a fee rate of 25 sat/vB using named arguments:
stohncoin-cli -named send outputs='{"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl": 0.3}' fee_rate=25
Create a transaction that should confirm the next block, with a specific input, and return result without adding to wallet or broadcasting to the network:
stohncoin-cli send '{"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl": 0.1}' 1 economical '{"add_to_wallet": false, "inputs": [{"txid":"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0", "vout":1}]}'
- sendmany
sendmany "" {"address":amount} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" fee_rate verbose )
Send multiple times. Amounts are double-precision floating point numbers.
Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Argument #2 - amounts
Type: json object, required
The addresses and amounts
{ "address": amount, (numeric or string, required) The stohncoin address is the key, the numeric amount (can be string) in SOH is the value }
Argument #5 - subtractfeefrom
Type: json array, optional
- The addresses.
The fee will be equally deducted from the amount of each selected address. Those recipients will receive less stohncoins than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee.
[ "address", (string) Subtract fee from this address ... ]
Argument #6 - replaceable
Type: boolean, optional, default=wallet default
Allow this transaction to be replaced by a transaction with higher fees via BIP 125
Argument #7 - conf_target
Type: numeric, optional, default=wallet -txconfirmtarget
Confirmation target in blocks
Argument #8 - estimate_mode
Type: string, optional, default=unset
- The fee estimate mode, must be one of (case insensitive):
“unset” “economical” “conservative”
Argument #9 - fee_rate
Type: numeric or string, optional, default=not set, fall back to wallet fee estimation
Specify a fee rate in sat/vB.
Result (if verbose is not set or set to false)
Name
Type
Description
hex
string
The transaction id for the send. Only 1 transaction is created regardless of
Result (if verbose is set to true)
{ (json object) "txid" : "hex", (string) The transaction id for the send. Only 1 transaction is created regardless of the number of addresses. "fee reason" : "str" (string) The transaction fee reason. }
Examples
Send two amounts to two different addresses::
stohncoin-cli sendmany "" "{\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\":0.01,\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\":0.02}"
Send two amounts to two different addresses setting the confirmation and comment::
stohncoin-cli sendmany "" "{\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\":0.01,\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\":0.02}" 6 "testing"
Send two amounts to two different addresses, subtract fee from amount::
stohncoin-cli sendmany "" "{\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\":0.01,\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\":0.02}" 1 "" "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "sendmany", "params": ["", {"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl":0.01,"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3":0.02}, 6, "testing"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- sendrawtransaction
sendrawtransaction "hexstring" ( maxfeerate )
Submit a raw transaction (serialized, hex-encoded) to local node and network.
Note that the transaction will be sent unconditionally to all peers, so using this for manual rebroadcast may degrade privacy by leaking the transaction’s origin, as nodes will normally not rebroadcast non-wallet transactions already in their mempool.
Also see createrawtransaction and signrawtransactionwithkey calls.
Argument #2 - maxfeerate
Type: numeric or string, optional, default=0.10
- Reject transactions whose fee rate is higher than the specified value, expressed in SOH/kB.
Set to 0 to accept any fee rate.
Examples
Create a transaction:
stohncoin-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}"
Sign the transaction, and get back the hex:
stohncoin-cli signrawtransactionwithwallet "myhex"
Send the transaction (signed hex):
stohncoin-cli sendrawtransaction "signedhex"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "sendrawtransaction", "params": ["signedhex"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- sendtoaddress
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" avoid_reuse fee_rate verbose )
Send an amount to a given address.
Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Argument #3 - comment
Type: string, optional
- A comment used to store what the transaction is for.
This is not part of the transaction, just kept in your wallet.
Argument #4 - comment_to
Type: 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.
Argument #5 - subtractfeefromamount
Type: boolean, optional, default=false
- The fee will be deducted from the amount being sent.
The recipient will receive less stohncoins than you enter in the amount field.
Argument #6 - replaceable
Type: boolean, optional, default=wallet default
Allow this transaction to be replaced by a transaction with higher fees via BIP 125
Argument #7 - conf_target
Type: numeric, optional, default=wallet -txconfirmtarget
Confirmation target in blocks
Argument #8 - estimate_mode
Type: string, optional, default=unset
- The fee estimate mode, must be one of (case insensitive):
“unset” “economical” “conservative”
Argument #9 - avoid_reuse
Type: boolean, optional, default=true
- (only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered
dirty if they have previously been used in a transaction.
Result (if verbose is set to true)
{ (json object) "txid" : "hex", (string) The transaction id. "fee reason" : "str" (string) The transaction fee reason. }
Examples
Send 0.1 SOH:
stohncoin-cli sendtoaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 0.1
Send 0.1 SOH with a confirmation target of 6 blocks in economical fee estimate mode using positional arguments:
stohncoin-cli sendtoaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 0.1 "donation" "sean's outpost" false true 6 economical
Send 0.1 SOH with a fee rate of 1.1 sat/vB, subtract fee from amount, BIP125-replaceable, using positional arguments:
stohncoin-cli sendtoaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 0.1 "drinks" "room77" true true null "unset" null 1.1
Send 0.2 SOH with a confirmation target of 6 blocks in economical fee estimate mode using named arguments:
stohncoin-cli -named sendtoaddress address="bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" amount=0.2 conf_target=6 estimate_mode="economical"
Send 0.5 SOH with a fee rate of 25 sat/vB using named arguments:
stohncoin-cli -named sendtoaddress address="bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" amount=0.5 fee_rate=25
stohncoin-cli -named sendtoaddress address="bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" amount=0.5 fee_rate=25 subtractfeefromamount=false replaceable=true avoid_reuse=true comment="2 pizzas" comment_to="jeremy" verbose=true
- setban
setban "subnet" "command" ( bantime absolute )
Attempts to add or remove an IP/Subnet from the banned list.
Argument #1 - subnet
Type: string, required
The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)
Argument #2 - command
Type: string, required
‘add’ to add an IP/Subnet to the list, ‘remove’ to remove an IP/Subnet from the list
Argument #3 - bantime
Type: numeric, optional, default=0
time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)
- sethdseed
sethdseed ( newkeypool "seed" )
Set or generate a new HD wallet seed. Non-HD wallets will not be upgraded to being a HD wallet. Wallets that are already HD will have a new HD seed set so that new keys added to the keypool will be derived from this new seed.
Note that you will need to MAKE A NEW BACKUP of your wallet after setting the HD wallet seed.
Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Argument #1 - newkeypool
Type: boolean, optional, default=true
- Whether to flush old unused addresses, including change addresses, from the keypool and regenerate it.
If true, the next address from getnewaddress and change address from getrawchangeaddress will be from this new seed. If false, addresses (including change addresses if the wallet already had HD Chain Split enabled) from the existing keypool will be used until it has been depleted.
- setlabel
setlabel "address" "label"
Sets the label associated with the given address.
Examples
stohncoin-cli setlabel "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" "tabby"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "setlabel", "params": ["bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", "tabby"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- setnetworkactive
- settxfee
settxfee amount
Set the transaction fee per kB for this wallet. Overrides the global -paytxfee command line parameter.
Can be deactivated by passing 0 as the fee. In that case automatic fee selection will be used by default.
- setwalletflag
setwalletflag "flag" ( value )
Change the state of the given wallet flag for a wallet.
Argument #1 - flag
Type: string, required
The name of the flag to change. Current available flags: avoid_reuse
- signmessage
signmessage "address" "message"
Sign a message with the private key of an address Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Examples
Unlock the wallet for 30 seconds:
stohncoin-cli walletpassphrase "mypassphrase" 30
Create the signature:
stohncoin-cli signmessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "my message"
Verify the signature:
stohncoin-cli verifymessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "signature" "my message"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "signmessage", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "my message"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- signmessagewithprivkey
signmessagewithprivkey "privkey" "message"
Sign a message with the private key of an address
Examples
Create the signature:
stohncoin-cli signmessagewithprivkey "privkey" "my message"
Verify the signature:
stohncoin-cli verifymessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "signature" "my message"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "signmessagewithprivkey", "params": ["privkey", "my message"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- signrawtransactionwithkey
signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
Sign inputs for raw transaction (serialized, hex-encoded).
The second argument is an array of base58-encoded private keys that will be the only keys used to sign the transaction.
The third optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain.
Argument #2 - privkeys
Type: json array, required
The base58-encoded private keys for signing
[ "privatekey", (string) private key in base58-encoding ... ]
Argument #3 - prevtxs
Type: json array, optional
The previous dependent transaction outputs
[ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "scriptPubKey": "hex", (string, required) script key "redeemScript": "hex", (string) (required for P2SH) redeem script "witnessScript": "hex", (string) (required for P2WSH or P2SH-P2WSH) witness script "amount": amount, (numeric or string) (required for Segwit inputs) the amount spent }, ... ]
Argument #4 - sighashtype
Type: string, optional, default=ALL
- The signature hash type. Must be one of:
“ALL” “NONE” “SINGLE” “ALL|ANYONECANPAY” “NONE|ANYONECANPAY” “SINGLE|ANYONECANPAY”
Result
{ (json object) "hex" : "hex", (string) The hex-encoded raw transaction with signature(s) "complete" : true|false, (boolean) If the transaction has a complete set of signatures "errors" : [ (json array, optional) Script verification errors (if there are any) { (json object) "txid" : "hex", (string) The hash of the referenced, previous transaction "vout" : n, (numeric) The index of the output to spent and used as input "scriptSig" : "hex", (string) The hex-encoded signature script "sequence" : n, (numeric) Script sequence number "error" : "str" (string) Verification or signing error related to the input }, ... ] }
- signrawtransactionwithwallet
signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
Sign inputs for raw transaction (serialized, hex-encoded).
The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain.
Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Argument #2 - prevtxs
Type: json array, optional
The previous dependent transaction outputs
[ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "scriptPubKey": "hex", (string, required) script key "redeemScript": "hex", (string) (required for P2SH) redeem script "witnessScript": "hex", (string) (required for P2WSH or P2SH-P2WSH) witness script "amount": amount, (numeric or string) (required for Segwit inputs) the amount spent }, ... ]
Argument #3 - sighashtype
Type: string, optional, default=ALL
- The signature hash type. Must be one of
“ALL” “NONE” “SINGLE” “ALL|ANYONECANPAY” “NONE|ANYONECANPAY” “SINGLE|ANYONECANPAY”
Result
{ (json object) "hex" : "hex", (string) The hex-encoded raw transaction with signature(s) "complete" : true|false, (boolean) If the transaction has a complete set of signatures "errors" : [ (json array, optional) Script verification errors (if there are any) { (json object) "txid" : "hex", (string) The hash of the referenced, previous transaction "vout" : n, (numeric) The index of the output to spent and used as input "scriptSig" : "hex", (string) The hex-encoded signature script "sequence" : n, (numeric) Script sequence number "error" : "str" (string) Verification or signing error related to the input }, ... ] }
- stop
- submitblock
submitblock "hexdata" ( "dummy" )
Attempts to submit new block to network.
See https://en.stohncoin.it/wiki/BIP_0022 for full specification.
Argument #2 - dummy
Type: string, optional, default=ignored
dummy value, for compatibility with BIP22. This value is ignored.
- submitheader
submitheader "hexdata"
Decode the given hexdata as a header and submit it as a candidate chain tip if valid.
Throws when the header is invalid.
- testmempoolaccept
testmempoolaccept ["rawtx",...] ( maxfeerate )
Returns result of mempool acceptance tests indicating if raw transaction (serialized, hex-encoded) would be accepted by mempool.
This checks if the transaction violates the consensus or policy rules.
See sendrawtransaction call.
Argument #1 - rawtxs
Type: json array, required
- An array of hex strings of raw transactions.
Length must be one for now.
[ "rawtx", (string) ... ]
Argument #2 - maxfeerate
Type: numeric or string, optional, default=0.10
Reject transactions whose fee rate is higher than the specified value, expressed in SOH/kB
Result
[ (json array) The result of the mempool acceptance test for each raw transaction in the input array. Length is exactly one for now. { (json object) "txid" : "hex", (string) The transaction hash in hex "allowed" : true|false, (boolean) If the mempool allows this tx to be inserted "vsize" : n, (numeric) Virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted (only present when 'allowed' is true) "fees" : { (json object) Transaction fees (only present if 'allowed' is true) "base" : n (numeric) transaction fee in SOH }, "reject-reason" : "str" (string) Rejection string (only present when 'allowed' is false) }, ... ]
Examples
Create a transaction:
stohncoin-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}"
Sign the transaction, and get back the hex:
stohncoin-cli signrawtransactionwithwallet "myhex"
Test acceptance of the transaction (signed hex):
stohncoin-cli testmempoolaccept '["signedhex"]'
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "testmempoolaccept", "params": [["signedhex"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- unloadwallet
unloadwallet ( "wallet_name" load_on_startup )
Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument.
Specifying the wallet name on a wallet endpoint is invalid.
Argument #1 - wallet_name
Type: string, optional, default=the wallet name from the RPC endpoint
The name of the wallet to unload. Must be provided in the RPC endpoint or this parameter (but not both).
Argument #2 - load_on_startup
Type: boolean, optional, default=null
Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
- upgradewallet
upgradewallet ( version )
Upgrade the wallet. Upgrades to the latest version if no version number is specified.
New keys may be generated and a new wallet backup will need to be made.
Argument #1 - version
Type: numeric, optional, default=169900
The version number to upgrade to. Default is the latest wallet version.
Result
{ (json object) "wallet_name" : "str", (string) Name of wallet this operation was performed on "previous_version" : n, (numeric) Version of wallet before this operation "current_version" : n, (numeric) Version of wallet after this operation "result" : "str", (string, optional) Description of result, if no error "error" : "str" (string, optional) Error message (if there is one) }
- uptime
uptime
Returns the total uptime of the server.
- utxoupdatepsbt
utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] )
Updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set or the mempool.
Argument #2 - descriptors
Type: json array, optional
An array of either strings or objects
[ "", (string) An output descriptor { (json object) An object with an output descriptor and extra information "desc": "str", (string, required) An output descriptor "range": n or [n,n], (numeric or array, optional, default=1000) Up to what index HD chains should be explored (either end or [begin,end]) }, ... ]
- validateaddress
validateaddress "address"
Return information about the given stohncoin address.
Result
{ (json object) "isvalid" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned. "address" : "str", (string) The stohncoin address validated "scriptPubKey" : "hex", (string) The hex-encoded scriptPubKey generated by the address "isscript" : true|false, (boolean) If the key is a script "iswitness" : true|false, (boolean) If the address is a witness address "witness_version" : n, (numeric, optional) The version number of the witness program "witness_program" : "hex" (string, optional) The hex value of the witness program }
Examples
stohncoin-cli validateaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "validateaddress", "params": ["bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- verifychain
verifychain ( checklevel nblocks )
Verifies blockchain database.
Argument #1 - checklevel
Type: numeric, optional, default=3, range=0-4
- How thorough the block verification is:
level 0 reads the blocks from disk
level 1 verifies block validity
level 2 verifies undo data
level 3 checks disconnection of tip blocks
level 4 tries to reconnect the blocks
each level includes the checks of the previous levels
- verifymessage
verifymessage "address" "signature" "message"
Verify a signed message
Argument #2 - signature
Type: string, required
The signature provided by the signer in base 64 encoding (see signmessage).
Examples
Unlock the wallet for 30 seconds:
stohncoin-cli walletpassphrase "mypassphrase" 30
Create the signature:
stohncoin-cli signmessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "my message"
Verify the signature:
stohncoin-cli verifymessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "signature" "my message"
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "verifymessage", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "signature", "my message"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- verifytxoutproof
verifytxoutproof "proof"
Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain
- walletcreatefundedpsbt
walletcreatefundedpsbt ( [{"txid":"hex","vout":n,"sequence":n},...] ) [{"address":amount},{"data":"hex"},...] ( locktime options bip32derivs )
Creates and funds a transaction in the Partially Signed Transaction format.
Implements the Creator and Updater roles.
Argument #1 - inputs
Type: json array, optional
Leave empty to add inputs automatically. See add_inputs option.
[ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'locktime' and 'options.replaceable' arguments) The sequence number }, ... ]
Argument #2 - outputs
Type: json array, required
- The outputs (key-value pairs), where none of the keys are duplicated.
That is, each address can only appear once and there can only be one ‘data’ object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter.
[ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the stohncoin address, the value (float or string) is the amount in SOH }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ]
Argument #3 - locktime
Type: numeric, optional, default=0
Raw locktime. Non-0 value also locktime-activates inputs
Argument #4 - options
Type: json object, optional
- “replaceable”: bool, (boolean, optional, default=wallet default) Marks this transaction as BIP125 replaceable.
Allows this transaction to be replaced by a transaction with higher fees “conf_target”: n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks “estimate_mode”: “str”, (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive): “unset” “economical” “conservative” }
{ "add_inputs": bool, (boolean, optional, default=false) If inputs are specified, automatically include more if they are not enough. "changeAddress": "hex", (string, optional, default=pool address) The stohncoin address to receive the change "changePosition": n, (numeric, optional, default=random) The index of the change output "change_type": "str", (string, optional, default=set by -changetype) The output type to use. Only valid if changeAddress is not specified. Options are "legacy", "p2sh-segwit", and "bech32". "includeWatching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only "lockUnspents": bool, (boolean, optional, default=false) Lock selected unspent outputs "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB. "feeRate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in SOH/kvB. "subtractFeeFromOutputs": [ (json array, optional, default=empty array) The outputs to subtract the fee from. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less stohncoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. vout_index, (numeric) The zero-based output index, before a change output is added. ... ],
Argument #5 - bip32derivs
Type: boolean, optional, default=true
Include BIP 32 derivation paths for public keys if we know them
- walletlock
walletlock
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.
Examples
Set the passphrase for 2 minutes to perform a transaction:
stohncoin-cli walletpassphrase "my pass phrase" 120
Perform a send (requires passphrase set):
stohncoin-cli sendtoaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 1.0
Clear the passphrase since we are done before 2 minutes is up:
stohncoin-cli walletlock
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "walletlock", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- walletpassphrase
walletpassphrase "passphrase" timeout
Stores the wallet decryption key in memory for ‘timeout’ seconds.
This is needed prior to performing transactions related to private keys such as sending stohncoins Note:
Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock time that overrides the old one.
Argument #2 - timeout
Type: numeric, required
The time to keep the decryption key in seconds; capped at 100000000 (~3 years).
Examples
Unlock the wallet for 60 seconds:
stohncoin-cli walletpassphrase "my pass phrase" 60
Lock the wallet again (before 60 seconds):
stohncoin-cli walletlock
As a JSON-RPC call:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "walletpassphrase", "params": ["my pass phrase", 60]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
- walletpassphrasechange
walletpassphrasechange "oldpassphrase" "newpassphrase"
Changes the wallet passphrase from ‘oldpassphrase’ to ‘newpassphrase’.
- walletprocesspsbt
walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs )
Update a PSBT with input information from our wallet and then sign inputs that we can sign for.
Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Argument #3 - sighashtype
Type: string, optional, default=ALL
- The signature hash type to sign with if not specified by the PSBT. Must be one of
“ALL” “NONE” “SINGLE” “ALL|ANYONECANPAY” “NONE|ANYONECANPAY” “SINGLE|ANYONECANPAY”
Argument #4 - bip32derivs
Type: boolean, optional, default=true
Include BIP 32 derivation paths for public keys if we know them