Optional rpc: IJsonRPCDependency injection for the client class
Readonly clientSend a transaction that contains an administrative contract.
Before invoking this command, import the master key used to sign and verify
transactions that contain administrative contracts. The label is optional:
importprivkey private_key_hex master
Send some coins to the master key address if necessary:
sendtoaddress address
Developer
Add a nrequired-to-sign multisignature address to the wallet.
Adds a multisignature address to the wallet. Returns the address addeded. Requires to tell the number of keys needed for a transaction and list of keys (keys are either addresses or a hexadecimal public key). If an account is given, the address will go into that account. Multisignature addresses make it so that you can share a wallet with multiple people and require nrequired people to approve of a transaction. The maximum number keys is 16.
grcRPC.addmultisigaddress(2, ['SBqubTKufqwpupnZsvzC3kSv9MCLrFXEUz', 'mhE9F4Cixhx9Dn8cB4Uf2EXLMCJR7muAFZ']);
Wallet
The minimum (m) number of signatures required to spend this m-of-n multisig script.
A public key against which signatures will be checked.
Optional account: stringThe account name in which the address should be stored. Leave blank for the default account.
Attempts add or remove node from the addnode list or try a connection to node once
RPC command will always return { result: 'ok' }
Network
Add a poll to the network. Requires 100K GRC balance. Costs 50 GRC. Requires the wallet to be fully unlocked.
Provide an empty string for answers when choosing "yes/no/abstain" for responsetype. Certain poll types may require additional fields. You can query required fields by calling the RPC with only the type parameter.
Voting
Type of poll (e.g. 'survey', 'project', etc.)
Title for the poll
Number of days that the poll will run
Prompt that voters shall answer
Answers for voters to choose from. Separate with semicolons.
Weighing method for the poll: 1 = Balance, 2 = Magnitude + Balance
1 = yes/no/abstain, 2 = single-choice, 3 = multiple-choice
Discussion web page URL for the poll
Optional requiredFields: stringRequired additional fields as "name1=value1;name2=value2"
Adds a reedemscript specified in hex to the wallet. Will return the address generated. If account is given, the pay to script hash will go into that account.
Wallet
Optional account: stringSends out a beacon (only applicable to solo mining).
Requires the wallet to be fully unlocked
Mining
Optional force: booleanIf true, generate new beacon keys and send a new beacon even when an active or pending beacon exists for your CPID. This is useful if you lose a wallet with your original beacon keys but not necessary otherwise
Send a v3 beacon with a BOINC account ownership proof.
The ownership proof XML is returned by the BOINC project's proof-of-account-ownership page.
It must contain
Requires wallet to be fully unlocked.
Mining
The XML block returned by the BOINC project
Optional force: booleanIf true, send even when an active or pending beacon exists
Report accrual snapshot deltas for the specified CPID.
Developer
Report accrual snapshot deltas for the specified CPID.
Developer
Creates a backup of the wallet.dat and gridcoinresearch.conf files (it also adds dates in the backup files’ names). Returns if it was successful for each file The files will be created in the walletbackups folder. See the Config Wiki Page to find the location for your operating system of the walletbackups folder and other Gridcoin files
https://gridcoin.us/wiki/config-file
Wallet
Generate a beacon key pair and return the public key hex. Use the public key to obtain a BOINC account ownership proof from a project that supports the ownership proof extension, then call advertiseBeaconV3 with the proof to send the beacon.
Requires wallet to be fully unlocked.
Mining
Displays verified and pending beacons from the scraper or subscriber viewpoint.
There are three output sections:
Mining
Returns a JSON list of all valid beacons on the network (as of where the wallet is synced to).
Mining
Optional activeOnly: booleanBoolean specifying whether only active beacons should be returned. Defaults to false which also includes expired beacons.
Creates a transaction that will send the given amount (rounded to 0.00000001) to no one making the coins disappear permanently. No one can get back the coins spent by this command. If hex string is specified, it will add on to the script used in the transaction.
Requires the wallet to be fully unlocked
Wallet
Amount to be burned down
Optional hexString: stringProtected callProtected
Send command to the rpc server, get response Transform response field to the camelcase
RPCBase
Rest ...parameters: callParameters[]Checks that the wallet is reporting the correct balance and is not missing any transactions. Returns { walletCheckPassed: true } if it finds no issues. On error it will return: { mismatchedSpentCoins: nMismatchSpent, amountInQuestion: nBalanceInQuestion } with nMismatchSpent numbers showing the number of transactions missed (either counted when it shouldn’t be or not counted when it should) and nBalanceInQuestion showing the amount involved in those transactions (absolute value, does not subtract)
Wallet
Claim an HTLC output using the preimage.
Wallet
Transaction ID of the HTLC funding tx
Output index of the HTLC
The preimage (hex encoded)
Address to send claimed funds to
Searches a block range for a multisig address with unspent utxos and consolidates them into a transaction ready for signing to return to the same address in a consolidated amount. Will determine multi-sig type and ensure the transaction does not exceed size limits.
Wallet
Multi-signature address
Block number to start search from
Block number to end search on
Optional maxGrc: numberHighest utxo value to include in search results in halfords (0 is default)
Optional maxInputs: numberMaximum inputs desired (overridden if calculated max is less)
Consolidate UTXOs to/on a given address.
The optional UTXO size parameter will result in consolidating UTXOs to generate the largest output possible less than that size or the total value of the specified maximum number of smallest inputs, whichever is less.
Designed to be run repeatedly; becomes a no-op if UTXOs are fully consolidated. The address MUST exist in your wallet beforehand.
Wallet
The Gridcoin address target for consolidation
Optional utxoSize: numberTarget consolidation output size
Optional maxInputs: numberMaximum number of inputs (clamped to system max)
Optional sweepAll: booleanIf true, use all addresses as input sources
Optional sweepChange: booleanIf true, consolidate change. Forced true if sweepAll is true
Create a Hash Time-Locked Contract.
Returns a JSON object with the P2SH address and redeem script. If amount is provided, funds the HTLC with a transaction. Requires the wallet to be fully unlocked if amount is provided.
Wallet
Address of the receiver (claim path)
Address of the sender (refund path)
SHA256 hash of the preimage (64 hex chars)
Absolute locktime for refund path
Optional amount: numberAmount in GRC to fund the HTLC
Creates an MRC (Manual Research Claim) request. Requires an unlocked wallet.
Mining
Optional dryRun: booleanIf true, calculate the reward and fee but do not send the contract. Defaults to false.
Optional force: booleanIf true, create even if it results in a reward loss or ban. Only works on testnet.
Optional fee: numberCustom fee to use instead of the calculated fee. Must not be lower than the calculated fee.
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.
[
{
"txid":"id", (string, required) The transaction id
"vout":n (numeric, required) The output number
}
,...
]
{
* "address": x.xxx (numeric, required) The key is the bitcoin address, the value is the CURRENCY_UNIT amount
* "data\": "hex", (string, required) The key is "data", the value is hex encoded data
* ...
* }
* @returns {Promise<{ transaction: string }>}
* @memberof Wallet
A json array of json objects
a json object with outputs
Enable or disable VERBOSE logging category (aka old debug) on the fly
logging
Developer
Reveals the private key corresponding to the given address. Requires the wallet to be fully unlocked.
Wallet
Address of requested key
Optional dumpHex: booleanIf true, also dump private and public key as hex strings
Encrypts the wallet with the given passphrase. After encryption, the server will stop and must be restarted to run with the encrypted wallet. The keypool is flushed and a new HD seed is generated. You need to make a new backup after encrypting.
Wallet
The passphrase to encrypt the wallet with
Shows what your magnitude is per project. On success returns JSON containing every project and the magnitude recorded on the network from your CPID.
Mining
Optional cpid: stringOptional CPID to explain magnitude for
Returns the current Gridcoin address for receiving payments to this account.
If account does not exist, it will be created along with an associated new address that will be returned.
Wallet
an account name
Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here) If dns is false, only a list of added nodes will be provided, otherwise connected information will also be available
Network
Get current balance
If account is not specified, returns the server's total available balance If account is specified, returns the balance in the account Note that the account "" is not the same as leaving the parameter out The server total may be different to the balance in the default "" account.
Wallet
Optional account: string = '*'The selected account, or "*" for entire wallet. It may be the default account using
Optional minConf: number = 1Only include transactions confirmed at least this many times.
Optional includeWatchOnly: boolean = falseAlso include balance in watchonly addresses (@see importAddress)
Lists outputs similar to listtransactions that compose the entire balance
Wallet
Optional minConf: number = 1Only include transactions confirmed at least this many times
Optional includeWatchOnly: boolean = falseAlso include balance in watchonly addresses (@see importAddress)
Returns information about the block with the given hash.
Network
Optional txinfo: Typeoptional to print more detailed tx info
Returns details of the block at or just after the given timestamp.
Network
Unix timestamp
Optional txinfo: Typeoptional to print more detailed tx info
Returns details of a block with given block-number
Network
optional to print more detailed tx info
Show stats on what wallets and cpids staked recent blocks
Mode 0: Startheight is the starting height, endheight is the chain head if not specified. Mode 1: Startheight is actually the number of blocks back from endheight or the chain head if not specified.
Developer
Optional startHeight: numberOptional endHeight: numberReturns a JSON array with details of the requested blocks starting with the given block-number or hash. Limited to 1000 blocks.
Network
Block number or hash for the start of the batch
Number of blocks to return (max 1000)
Optional txinfo: Typeoptional to print more detailed tx info
Lists Information on the current block, mining settings, and network difficulty.
Alias for getstakinginfo, kept for backward compatibility. Documentation of Stake Miner and "getmininginfo" explanation. https://github.com/gridcoin/Gridcoin-Research/blob/master/doc/stake-miner.txt
Use getStakingInfo() instead — getmininginfo is an alias in the daemon
Mining
Display MRC (Manual Research Claim) information.
Mining
Optional detailed: booleanOutput MRC details. Defaults to false.
Optional cpid: stringCPID to query. Defaults to current wallet CPID. Use "*" for all CPIDs (network wide).
Optional lowHeight: numberLow height for scope. Defaults to V12 block height.
Optional highHeight: numberHigh height for scope. Defaults to current block.
Returns a new Gridcoin address for receiving payments.
If [account] is specified, it is added to the address book so payments received with the address will be credited to account.
Wallet
Optional account: stringreturns an Object with information about txid
Wallet
Returns the total amount received by addresses with account in transactions with at least minconf confirmations. If account not provided return will include all transactions to all accounts.
Wallet
the account name
Optional minconf: number = 1the minimum number of confirmations
Returns the amount received by gridcoinaddress in transactions with at least minconf confirmations.
It correctly handles the case where someone has sent to the address in multiple transactions. Keep in mind that addresses are only ever used for receiving transactions. Works only for addresses in the local wallet, external addresses will always show 0.
Wallet
the address
Optional minconf: number = 1the minimum number of confirmations
Get detailed information about in-wallet transaction txid
Wallet
The transaction id
Optional includeWatchOnly: boolean = falseWhether to include watchonly addresses in balance calculation and details
Adds a private key (as returned by dumpprivkey) to your wallet. WARNING: If rescan is true, a rescan of the blockchain will occur which could take up to 20 minutes.
Wallet
The private key (see dumpprivkey)
Optional label: stringLabel for the imported address
Optional rescan: booleanWhether to rescan the blockchain (default true)
Returns UniValue that has account names as keys, account balances as values.
Wallet
Optional minConf: number = 1Only include transactions with at least this many confirmations
Optional includeWatchOnly: boolean = falseInclude balances in watchonly addresses (@see importaddress)
Show list of known ScraperManifest objects.
Developer
to show details of manifests
Optional manifestHash: stringhash of specific manifest (Not provided returns all.)
Show list of known ScraperManifest objects.
Developer
to show details of manifests
Optional manifestHash: stringhash of specific manifest (Not provided returns all.)
List balances by receiving address.
Wallet
Optional minConf: number = 1The minimum number of confirmations before payments are included.
Optional includeEmpty: boolean = falseWhether to include addresses that haven't received any payments.
Optional includeWatchOnly: boolean = falseWhether to include watchonly addresses (see 'importaddress').
Get all transactions in blocks since block blockhash, or all transactions if omitted
GridcoinRPC
Optional blockHash: stringThe block hash to list transactions since
Optional targetConfirmations: numberThe confirmations required, must be 1 or more
Optional includeWatchonly: booleanInclude transactions to watchonly addresses (@see importaddress)
Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.
Wallet
Optional account: string = '*'The account name. If not included, it will list all transactions for all accounts.
Optional count: number = 10The number of transactions to return
Optional from: number = 0The number of transactions to skip
Optional includeWatchonly: boolean = falseInclude transactions to watchonly addresses (@see importaddress) If is set true, it will list sent transactions as well
Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations Optionally filtered to only include txouts paid to specified addresses Results are an array of Objects, each of which has {txid, vout, scriptPubKey, amount, confirmations}
Wallet
Optional minConf: numberOptional maxConf: numberRest ...addresses: string[]logging json array category adds json array category removes 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: " + ListLogCategories() + ". In addition, the following are available as category names with special meanings: all or 1: represent all logging categories. none or 0: even if other logging categories are specified, ignore all of them.
logging all net: enables all and disables net.
logging "" all: disables all.
Note that unlike Bitcoin, we don't process JSON arrays correctly as arguments yet for the command line,
so, for the rpc cli, it is limited to one enable and/or one disable category. Using CURL works with the full arrays.
Developer
Optional enable: "" | "all" | keyof LoggingCategoriesOptional disable: "all" | keyof LoggingCategoriesMaintain backup retention. Creates backups and optionally removes old ones. Requires -maintainbackupretention to be set as a startup argument or in the config file.
WARNING: Default values for number and days are 365 each. Both values are clamped to a minimum of 7 to prevent unintended consequences.
Wallet
Optional retentionByNumber: numberNumber of files to retain
Optional retentionByDays: numberNumber of days to retain
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.
Network
rain coins by magnitude on network
Wallet
Required: If a project is specified, rain will be limited to that project. Use * for network-wide.
Required: Specify amount of coins to be rained in double precision float
Optional message: stringOptional: Provide a message rained to all rainees
Refund an HTLC output after the timeout has passed.
Wallet
Transaction ID of the HTLC funding tx
Output index of the HTLC
Address to send refunded funds to
Reserved amount secures a balance in wallet that can be spendable at anytime. However reserve will secure utxo(s) of any size to respect this setting. If no parameters provided current setting is printed
Wallet
Optional reserve: booleanis true or false to turn balance reserve on or off.
Optional amount: numberis a real and rounded to cent
Searches a block range for a specified address with unspent utxos and displays them in a json response with the option of exporting to file
Wallet
Multi-signature address
Block number to start search from
Block number to end search on
Optional exports: booleanExports to a file in backup-dir/rpc in format of multisigaddress-datetime.type
Optional type: stringExport to a file with file type (xml, txt or json -- Required if export true)
Send an alert to the network. Admin-only.
Developer
Admin private key
Alert key
Minimum version
Maximum version
Alert priority
Alert comment
Status bar message
Send an alert (v2) to the network. Admin-only.
Developer
Admin private key
Alert key
Minimum version
Maximum version
Alert priority
Alert comment
Status bar message
Sends amount of Gridcoin from account to gridcoinaddress.
Wallet
Account FROM
Address TO
Amount to send
Optional minConf: numberis the minimum number of confirmations for a UTXO to be used.
Optional comment: stringis a personal comment about what the transaction is for (doesn’t go into the transaction, it is only stored locally).
Optional commentTo: stringis also a personal comment about who you are sending to (also only local).
Optional message: stringis a message/comment that is sent publicly on the transaction.
Send from fromaccount to a list of addresses. Use '' if you don’t want to limit to one account label. Addresses should be listed in JSON format.
Wallet
Account FROM
{ Address1: amount1, Address2: amount2, ... }
Optional minConf: number = 1is the minimum number of confirmations for a UTXO to be used.
Optional comment: stringis a personal comment about what the transaction is for (doesn’t go into the transaction, it is only stored locally).
Sends amount of Gridcoin to gridcoinaddress.
Wallet
Recipient address
is a real and is rounded to the nearest 0.000001
Optional comment: stringa comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.
Optional commentTo: stringa 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
Optional message: stringOptional message to add to the receiver.
Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account.
Wallet
add or remove an IP/Subnet from the banned list.
Network
The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)
'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list
Optional banTime: numbertime 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)
Optional absolute: number | falseDefaults to false. If set, the bantime must be an absolute timestamp in seconds since epoch (Jan 1 1970 GMT).
Set or generate a new HD wallet seed. Non-HD wallets will not be upgraded to HD. 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.
You will need to make a new backup after setting the HD wallet seed.
Wallet
Optional newKeyPool: booleanWhether to flush old unused addresses and regenerate the keypool
Optional seed: stringThe WIF private key to use as the new HD seed; if not provided a random seed will be used
Returns a signed a message using the private key from Gridcoinaddress. Lets you prove that this message came from the owner of an address. You can verify a signed message with the verify message command. (It will not send this message anywhere. You have to do that)
Wallet
Sign inputs for raw transaction (serialized, hex-encoded).
Wallet
raw transaction (serialized, hex-encoded)
is an array of previous transaction outputs that this transaction depends on but may not yet be in the blockchain.
is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction
is a string that is one of six values; ALL, NONE, SINGLE or ALL|ANYONECANPAY, NONE|ANYONECANPAY, SINGLE|ANYONECANPAY.
Display data on recent superblocks
Mining
Optional lookback: numbernumber of superblocks to show (default 14)
Optional displayContract: booleandisplay superblock contract (default false)
Optional cpid: stringShows magnitude for a cpid for recent superblocks
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.
Wallet
Optional version: numberThe version number to upgrade to. Default is the latest wallet version.
Return information about gridcoinaddress.
The validateaddress RPC accepts a block verifies it is a valid addition to the block chain and broadcasts it to the network.
GridcoinRPC
Verify a signed message.
The P2PKH address corresponding to the private key which made the signature. A P2PKH address is a hash of the public key corresponding to the private key which made the signature. When the ECDSA signature is checked, up to four possible ECDSA public keys will be reconstructed from the signature; each key will be hashed and compared against the P2PKH address provided to see if any of them match. If there are no matches, signature validation will fail.
GridcoinRPC
signmessage
The gridcoin address to use for the signature.
The signature provided by the signer in base 64 encoding.
The message that was signed.
Display the software versions of nodes that recently staked.
Developer
Optional lookBack: numberNumber of blocks to tally from the chain head
Optional full: booleanClassify by commit suffix (default: false)
Stores the wallet decryption key in memory for timeout seconds. if stakingonly is true sending functions are disabled.
Wallet
Generated using TypeDoc
Creates an instance of GridcoinRPC
Memberof
GridcoinRPC