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. Provide an empty string for answers when choosing "yes/no/abstain" for responsetype.
Voting
Title for the poll
Number of days that the poll will run
Prompt that voters shall answer
Answers for voters to choose from.
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
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
Report accrual snapshot deltas for the specified CPID.
Developer
Report accrual snapshot deltas for the specified CPID.
Developer
Creates a backup of the private keys and creates a keys.dat files (also includes the date in the filename). The data in the file is formatted like this: Address: ADDRESS, Secret: PRIVATE KEY. File location and "result": true will be given if it successes, otherwise it will show an error message. Requires the wallet to be fully unlocked
Wallet
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
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
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
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 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: numberLists Information on the current block, mining settings, and network difficulty.
Documentation of Stake Miner and "getmininginfo" explanation. https://github.com/gridcoin/Gridcoin-Research/blob/master/doc/stake-miner.txt
GridcoinRPC
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
Report votes for specified superblock.
Network
mode: 0=text, 1,2=json
block hash or last= currently active, now= ongoing sb votes.
Report votes for specified superblock.
Network
mode: 0=text, 1,2=json
block hash or last= currently active, now= ongoing sb votes.
Report votes for specified superblock.
Network
mode: 0=text, 1,2=json
block hash or last= currently active, now= ongoing sb votes.
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
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)
@todo: implement writedata
Optional
manifestHash: stringShow 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 LoggingCategoriesRequests 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
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)
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).
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
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