Hierarchy

  • RPCBase
  • Wallet
  • Mining
  • Developer
  • Network
  • Voting
    • GridcoinRPC

Constructors

Properties

Methods

addKey addMultisigAddress addNode addPoll addRedeemScript advertiseBeacon advertiseBeaconV3 archiveLog askForOutstandingBlocks auditSnapshotAccrual auditSnapshotAccruals backupWallet beaconAudit beaconAuth beaconConvergence beaconReport beaconStatus burn call changeSettings checkWallet claimHtlc clearBanned consolidateMsUnspent consolidateUnspent convergenceReport createHtlc createMrcRequest createRawTransaction currentContractAverage currentTime debug decodeRawTransaction decodeScript deleteCScraperManifest dumpContracts dumpPrivKey dumpWallet encryptWallet explainMagnitude exportStats getAccount getAccountAddress getAddedNodeInfo getAddressesByAccount getAutoGreylist getBalance getBalanceDetail getBestBlockhash getBlock getBlockByMinTime getBlockByNumber getBlockCount getBlockHash getBlockStats getBlockchainInfo getBlocksBatch getBurnReport getCheckpoint getConnectionCount getDifficulty getInfo getLastStake getMiningInfo getMpart getMrcInfo getNetTotals getNetworkInfo getNewAddress getNewPubkey getNodeAddresses getPeerInfo getPollResults getRawMemPool getRawTransaction getRawWalletTransaction getReceivedByAccount getReceivedByAddress getRecentBlocks getStakingInfo getTransaction getUnconfirmedBalance getVotingClaim getWalletInfo importPrivKey importWallet inspectAccrualSnapshot keyPoolRefill lifetime listAccounts listAddressGroupings listAlerts listBanned listMandatorySideStakes listManifests listPolls listProjects listProtocolEntries listReceivedByAddress listResearcherAccounts listScrapers listSettings listSideStakes listSinceBlock listStakes listTransactions listUnspent logging magnitude maintainBackups makeKeyPair network networkTime parseAccrualSnapshotFile parseLegacySb pendingBeaconReport ping projects rainByMagnitude readData refundHtlc reorganize repairWallet resendTx reserveBalance resetCPIDs revokeBeacon saveScraperFileManifest scanForUnspent scrapeReport sendAlert sendAlert2 sendBlock sendFrom sendMany sendRawTransaction sendScraperFileManifest sendToAddress setAccount setBan setHdSeed setTXfee showBlock signMessage signRawTransaction stop superBlocks superblockAge superblockAverage testNewSb testPollNotification upgradeWallet validateAddress validatePubkey verifyMessage versionReport voteById voteDetails walletDiagnose walletLock walletPassPhrase walletPassPhraseChange writeData

Constructors

  • Creates an instance of GridcoinRPC

    Memberof

    GridcoinRPC

    Parameters

    • config: IParameters
    • Optional rpc: IJsonRPC

      Dependency injection for the client class

    Returns GridcoinRPC

Properties

client: IJsonRPC

Methods

  • Send a transaction that contains an administrative contract.

    Description

    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 To whitelist a project: addkey add project projectname url To de-whitelist a project: addkey delete project projectname 1 Key examples: addkey add project milkyway@home http://milkyway.cs.rpi.edu/milkyway/@ addkey delete project milkyway@home 1 GRC will only memorize the last value it finds for a key in the highest block. @todo: check return values as I am guessing here

    Returns

    Memberof

    Developer

    Parameters

    • action: "add" | "delete"
    • keyType: string
    • keyName: string
    • keyValue: string | number | boolean

    Returns Promise<{
        contract: Contract;
        txid: string;
    }>

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

    Description

    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.

    Example

    grcRPC.addmultisigaddress(2, ['SBqubTKufqwpupnZsvzC3kSv9MCLrFXEUz', 'mhE9F4Cixhx9Dn8cB4Uf2EXLMCJR7muAFZ']);
    

    Returns

    Memberof

    Wallet

    Parameters

    • nrequired: number

      The minimum (m) number of signatures required to spend this m-of-n multisig script.

    • keys: string[]

      A public key against which signatures will be checked.

    • Optional account: string

      The account name in which the address should be stored. Leave blank for the default account.

    Returns Promise<string>

  • Attempts add or remove node from the addnode list or try a connection to node once

    RPC command will always return { result: 'ok' }

    Returns

    Memberof

    Network

    Parameters

    • node: string
    • command: addNodeCommand

    Returns Promise<{
        result: "ok";
    }>

  • 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.

    Returns

    Memberof

    Voting

    Parameters

    • type: string

      Type of poll (e.g. 'survey', 'project', etc.)

    • title: string

      Title for the poll

    • days: number

      Number of days that the poll will run

    • question: string

      Prompt that voters shall answer

    • answers: string[]

      Answers for voters to choose from. Separate with semicolons.

    • weightType: WeightType

      Weighing method for the poll: 1 = Balance, 2 = Magnitude + Balance

    • responseType: ResponseType

      1 = yes/no/abstain, 2 = single-choice, 3 = multiple-choice

    • url: string

      Discussion web page URL for the poll

    • Optional requiredFields: string

      Required additional fields as "name1=value1;name2=value2"

    Returns Promise<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.

    Returns

    Memberof

    Wallet

    Parameters

    • redeemScript: string
    • Optional account: string

    Returns Promise<string>

  • Sends out a beacon (only applicable to solo mining).

    Requires the wallet to be fully unlocked

    Returns

    Memberof

    Mining

    Parameters

    • Optional force: boolean

      If 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

    Returns Promise<AdvertiseBeacon>

  • 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 , , and elements. The field should have the format: "{account_id} {beacon_public_key_hex}" (the project generates this when you enter the beacon public key from beaconauth).

    Requires wallet to be fully unlocked.

    Returns

    Memberof

    Mining

    Parameters

    • ownershipProofXml: string

      The XML block returned by the BOINC project

    • Optional force: boolean

      If true, send even when an active or pending beacon exists

    Returns Promise<AdvertiseBeaconV3Result>

  • Immediately archives the specified log. Currently valid values are debug and scraper.

    Returns

    Memberof

    Developer

    Parameters

    • log: "debug" | "scraper"

    Returns Promise<boolean>

  • Requests network for outstanding blocks

    Returns

    Memberof

    Network

    Returns Promise<{
        sent: boolean;
    }>

  • Report accrual snapshot deltas for the specified CPID.

    Returns

    Memberof

    Developer

    Parameters

    • cpid: string
    • detailed: false

    Returns Promise<AuditSnapshot>

  • Report accrual snapshot deltas for the specified CPID.

    Returns

    Memberof

    Developer

    Parameters

    • cpid: string
    • detailed: true

    Returns Promise<AuditSnapshotDetailed>

  • Report accrual audit for entire population of CPIDs.

    Returns

    Memberof

    Developer

    Parameters

    • Optional mismatchedOnly: boolean

    Returns Promise<AuditSnapshotAccurals>

  • 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

    See

    https://gridcoin.us/wiki/config-file

    Returns

    Memberof

    Wallet

    Returns Promise<BackupWallet>

  • Audit beacons on the network.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • 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.

    Returns

    Memberof

    Mining

    Returns Promise<BeaconAuthResult>

  • Displays verified and pending beacons from the scraper or subscriber viewpoint.

    Description

    There are three output sections:

    • verified_beacons_from_scraper_global: Comes directly from the scraper global map for verified beacons. This is for scraper monitoring of an individual scraper and will be empty if not run on an actual scraper nod
    • verified_beacons_from_latest_convergence: From the latest convergence formed from all of the scrapers. This list is what will be activated in the next superblock.
    • pending_beacons_from_GetConsensusBeaconList: This is a list of pending beacons. Note that it is subject to a one hour ladder, so it will lag the information from the pendingbeaconreport rpc call.

    Returns

    Memberof

    Mining

    Returns Promise<BeaconConvergence>

  • Returns a JSON list of all valid beacons on the network (as of where the wallet is synced to).

    Returns

    Memberof

    Mining

    Parameters

    • Optional activeOnly: boolean

      Boolean specifying whether only active beacons should be returned. Defaults to false which also includes expired beacons.

    Returns Promise<BeaconReport[]>

  • Displays information about your beacon or the beacon for cpid.

    Returns

    Memberof

    Mining

    Parameters

    • Optional cpid: string

    Returns Promise<BeaconStatusCollection>

  • 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

    Returns

    Memberof

    Wallet

    Parameters

    • amount: number

      Amount to be burned down

    • Optional hexString: string

    Returns Promise<string>

  • Protected

    Send command to the rpc server, get response Transform response field to the camelcase

    Returns

    Throws

    Memberof

    RPCBase

    Type Parameters

    • T

    Parameters

    Returns Promise<T>

  • Modify a Gridcoin setting at runtime.

    Returns

    Memberof

    Developer

    Parameters

    • name: string

      Setting name

    • value: string

      New setting value

    Returns Promise<unknown>

  • 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)

    Returns

    Memberof

    Wallet

    Returns Promise<WalletSuccessStatus | WalletFailStatus>

  • Claim an HTLC output using the preimage.

    Returns

    Memberof

    Wallet

    Parameters

    • htlcTxid: string

      Transaction ID of the HTLC funding tx

    • vout: number

      Output index of the HTLC

    • preimageHex: string

      The preimage (hex encoded)

    • destinationAddr: string

      Address to send claimed funds to

    Returns Promise<ClaimHtlcResult>

  • Clear all banned IPs.

    Returns

    Memberof

    Network

    Returns Promise<void>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • address: string

      Multi-signature address

    • blockStart: number

      Block number to start search from

    • blockEnd: number

      Block number to end search on

    • Optional maxGrc: number

      Highest utxo value to include in search results in halfords (0 is default)

    • Optional maxInputs: number

      Maximum inputs desired (overridden if calculated max is less)

    Returns Promise<ConsolidateMsUnspentResult>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • address: string

      The Gridcoin address target for consolidation

    • Optional utxoSize: number

      Target consolidation output size

    • Optional maxInputs: number

      Maximum number of inputs (clamped to system max)

    • Optional sweepAll: boolean

      If true, use all addresses as input sources

    • Optional sweepChange: boolean

      If true, consolidate change. Forced true if sweepAll is true

    Returns Promise<ConsolidateUnspentResult>

  • Convergence report from the scraper.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • receiverAddr: string

      Address of the receiver (claim path)

    • senderAddr: string

      Address of the sender (refund path)

    • hashHex: string

      SHA256 hash of the preimage (64 hex chars)

    • timeout: number

      Absolute locktime for refund path

    • Optional amount: number

      Amount in GRC to fund the HTLC

    Returns Promise<CreateHtlcResult>

  • Creates an MRC (Manual Research Claim) request. Requires an unlocked wallet.

    Returns

    Memberof

    Mining

    Parameters

    • Optional dryRun: boolean

      If true, calculate the reward and fee but do not send the contract. Defaults to false.

    • Optional force: boolean

      If true, create even if it results in a reward loss or ban. Only works on testnet.

    • Optional fee: number

      Custom fee to use instead of the calculated fee. Must not be lower than the calculated fee.

    Returns Promise<MrcRequestResult>

  • 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.

    Example

    [
    {
    "txid":"id", (string, required) The transaction id
    "vout":n (numeric, required) The output number
    }
    ,...
    ]

    Example

    {
    * "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

    Parameters

    • transactions: RawTransaction[]

      A json array of json objects

    • outputs: Output

      a json object with outputs

    Returns Promise<{
        transaction: string;
    }>

  • Displays information on your current contract average with regards to superblock contract

    Returns

    Memberof

    Developer

    Returns Promise<ContractAverage>

  • Displays UTC Unix time as well as date and time in UTC

    Returns

    Memberof

    Network

    Returns Promise<CurrentTime>

  • Enable or disable VERBOSE logging category (aka old debug) on the fly

    Deprecated

    See

    logging

    Returns

    Memberof

    Developer

    Parameters

    • enable: boolean

    Returns Promise<{
        Logging category VERBOSE (aka old debug) : boolean;
    }>

  • Return a JSON object representing the serialized, hex-encoded transaction

    Returns

    Memberof

    Wallet

    Parameters

    • rawTransaction: string

      hex string

    Returns Promise<Transaction>

  • Decode a hex-encoded script

    Returns

    Memberof

    Wallet

    Parameters

    • script: string

      hex string

    Returns Promise<Script>

  • Delete a scraper manifest.

    Returns

    Memberof

    Developer

    Parameters

    • manifestHash: string

      Hash of the manifest to delete

    Returns Promise<unknown>

  • Dump all contracts from the blockchain.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • Reveals the private key corresponding to the given address. Requires the wallet to be fully unlocked.

    Returns

    Memberof

    Wallet

    Parameters

    • address: string

      Address of requested key

    • Optional dumpHex: boolean

      If true, also dump private and public key as hex strings

    Returns Promise<string | {
        privateKey: string;
        privateKeyHex: string;
        publicKeyHex: string;
    }>

  • Dumps all wallet keys in a human-readable format into the specified file. If a path is not specified in the filename, the data directory is used.

    Returns

    Memberof

    Wallet

    Parameters

    • filename: string

      Filename to dump wallet to

    Returns Promise<null>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • passphrase: string

      The passphrase to encrypt the wallet with

    Returns Promise<string>

  • Shows what your magnitude is per project. On success returns JSON containing every project and the magnitude recorded on the network from your CPID.

    Returns

    Memberof

    Mining

    Parameters

    • Optional cpid: string

      Optional CPID to explain magnitude for

    Returns Promise<ProjectMagnitude>

  • Export statistics.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • Returns the account associated with the given address.

    Deprecated

    Returns

    • an account name

    Memberof

    Wallet

    Parameters

    • gridcoinAddress: string

    Returns Promise<string>

  • Returns the current Gridcoin address for receiving payments to this account.

    Description

    If account does not exist, it will be created along with an associated new address that will be returned.

    Deprecated

    Returns

    • GRC address

    Memberof

    Wallet

    Parameters

    • account: string

      an account name

    Returns Promise<string>

  • 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

    Returns

    Memberof

    Network

    Parameters

    • dns: boolean
    • node: string

    Returns Promise<{
        addednode: string;
    }>

  • Returns the list of addresses for the given account.

    Deprecated

    Returns

    • a list of addresses

    Memberof

    Wallet

    Parameters

    • account: string

      the account name

    Returns Promise<string[]>

  • Display the automatically greylisted projects based on Zero Credit Days (ZCD) and Whitelist Activity Score (WAS).

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • Get current balance

    Description

    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.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional account: string = '*'

      The selected account, or "*" for entire wallet. It may be the default account using

    • Optional minConf: number = 1

      Only include transactions confirmed at least this many times.

    • Optional includeWatchOnly: boolean = false

      Also include balance in watchonly addresses (@see importAddress)

    Returns Promise<number>

  • Lists outputs similar to listtransactions that compose the entire balance

    Returns

    Memberof

    Wallet

    Parameters

    • Optional minConf: number = 1

      Only include transactions confirmed at least this many times

    • Optional includeWatchOnly: boolean = false

      Also include balance in watchonly addresses (@see importAddress)

    Returns Promise<BalanceDetail>

  • Returns the hash of the best block in the longest block chain

    Returns

    Memberof

    Network

    Returns Promise<string>

  • Returns information about the block with the given hash.

    Returns

    Memberof

    Network

    Type Parameters

    • Type extends boolean

    Parameters

    • hash: string
    • Optional txinfo: Type

      optional to print more detailed tx info

    Returns Promise<Type extends true ? BlockWithTX : Block>

  • Returns details of the block at or just after the given timestamp.

    Returns

    Memberof

    Network

    Type Parameters

    • Type extends boolean

    Parameters

    • timestamp: number

      Unix timestamp

    • Optional txinfo: Type

      optional to print more detailed tx info

    Returns Promise<Type extends true ? BlockWithTX : Block>

  • Returns details of a block with given block-number

    Returns

    Memberof

    Network

    Type Parameters

    • Type extends boolean

    Parameters

    • number: number
    • txinfo: Type

      optional to print more detailed tx info

    Returns Promise<Type extends true ? BlockWithTX : Block>

  • Returns the number of blocks in the longest block chain

    Returns

    Memberof

    Network

    Returns Promise<number>

  • Returns hash of block in best-block-chain at index

    Returns

    Memberof

    Network

    Parameters

    • index: number

    Returns Promise<string>

  • Show stats on what wallets and cpids staked recent blocks

    Description

    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.

    Returns

    Memberof

    Developer

    Parameters

    • mode: 0 | 1
    • Optional startHeight: number
    • Optional endHeight: number

    Returns Promise<BlockStats>

  • Displays data on current blockchain

    Returns

    Memberof

    Network

    Returns Promise<BlockchainInfo>

  • Returns a JSON array with details of the requested blocks starting with the given block-number or hash. Limited to 1000 blocks.

    Returns

    Memberof

    Network

    Type Parameters

    • Type extends boolean

    Parameters

    • startingBlock: string | number

      Block number or hash for the start of the batch

    • numberOfBlocks: number

      Number of blocks to return (max 1000)

    • Optional txinfo: Type

      optional to print more detailed tx info

    Returns Promise<Type extends true ? BlocksBatchDetailed : BlocksBatch<Block>>

  • Scan for and aggregate network-wide amounts for provably-destroyed outputs.

    Returns

    Memberof

    Network

    Returns Promise<BurnReport>

  • Show info of synchronized checkpoint.

    Returns

    Memberof

    Network

    Returns Promise<Checkpoint>

  • Returns the number of connections to other node

    Returns

    Memberof

    Network

    Returns Promise<number>

  • Returns the difficulty as a multiple of the minimum difficulty

    Returns

    Memberof

    Network

    Returns Promise<BlockchainDifficulty>

  • Returns an object containing various state info.

    Returns

    Memberof

    Network

    Returns Promise<Info>

  • Fetch information about this wallet's last staked block.

    Returns

    Memberof

    Mining

    Returns Promise<Stake>

  • Lists Information on the current block, mining settings, and network difficulty.

    Description

    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

    Deprecated

    Use getStakingInfo() instead — getmininginfo is an alias in the daemon

    Returns

    Memberof

    Mining

    Returns Promise<MiningInfo>

  • Get a scraper convergence part by content hash.

    Returns

    Memberof

    Developer

    Parameters

    • hash: string

      The content hash of the part

    Returns Promise<unknown>

  • Display MRC (Manual Research Claim) information.

    Returns

    Memberof

    Mining

    Parameters

    • Optional detailed: boolean

      Output MRC details. Defaults to false.

    • Optional cpid: string

      CPID to query. Defaults to current wallet CPID. Use "*" for all CPIDs (network wide).

    • Optional lowHeight: number

      Low height for scope. Defaults to V12 block height.

    • Optional highHeight: number

      High height for scope. Defaults to current block.

    Returns Promise<MrcInfo>

  • Returns information about network traffic, including bytes in, bytes out and current time

    Returns

    Memberof

    Network

    Returns Promise<NetTotals>

  • Displays network related information

    Returns

    Memberof

    Network

    Returns Promise<NetworkInfo>

  • Returns a new Gridcoin address for receiving payments.

    Description

    If [account] is specified, it is added to the address book so payments received with the address will be credited to account.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional account: string

    Returns Promise<string>

  • Returns new public key for coinbase generation.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional account: string

    Returns Promise<string>

  • Return known addresses which can potentially be used to find new nodes in the network.

    Returns

    Memberof

    Network

    Parameters

    • Optional count: number

      How many addresses to return

    Returns Promise<NodeAddress[]>

  • Returns data about each connected network node.

    Returns

    Memberof

    Network

    Returns Promise<Peer[]>

  • Display the results for the specified poll

    Returns

    Memberof

    Voting

    Parameters

    • voteIdOrTitle: string

      Title or ID of the poll.

    Returns Promise<PollResults[]>

  • Returns all transaction ids in memory pool

    Returns

    Memberof

    Network

    Returns Promise<string[]>

  • returns an Object with information about txid

    Returns

    Memberof

    Wallet

    Type Parameters

    • Type extends boolean

    Parameters

    • txid: string
    • verbose: Type

    Returns Promise<Type extends true ? DetailedRawTransaction : string>

  • Get a string that is serialized, hex-encoded data for txid from the wallet.

    Returns

    Memberof

    Wallet

    Parameters

    • txid: string

    Returns Promise<string>

  • 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.

    Returns

    • the number of coins received

    Deprecated

    Memberof

    Wallet

    Parameters

    • account: string

      the account name

    • Optional minconf: number = 1

      the minimum number of confirmations

    Returns Promise<number>

  • Returns the amount received by gridcoinaddress in transactions with at least minconf confirmations.

    Description

    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.

    Returns

    • the number of coins received

    Memberof

    Wallet

    Parameters

    • gridcoinAddress: string

      the address

    • Optional minconf: number = 1

      the minimum number of confirmations

    Returns Promise<number>

  • Show recent blocks with optional detail.

    Returns

    Memberof

    Developer

    Parameters

    • Optional count: number

      Number of recent blocks to show

    • Optional detail: boolean

      Show detailed information

    Returns Promise<unknown>

  • Returns an object containing staking-related information.

    Returns

    Memberof

    Mining

    Returns Promise<MiningInfo>

  • Get detailed information about in-wallet transaction txid

    Returns

    Memberof

    Wallet

    Parameters

    • txid: string

      The transaction id

    • Optional includeWatchOnly: boolean = false

      Whether to include watchonly addresses in balance calculation and details

    Returns Promise<Transaction>

  • returns the unconfirmed balance in the wallet

    Returns

    Memberof

    Wallet

    Returns Promise<number>

  • Display the claim for the specified poll or vote.

    Returns

    Memberof

    Voting

    Parameters

    • pollIdOrVoteId: string

      Transaction hash of the poll or vote.

    Returns Promise<VotingClaim>

  • Returns useful information about current wallet state.

    Returns

    Memberof

    Wallet

    Returns Promise<WalletInfo>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • privKey: string

      The private key (see dumpprivkey)

    • Optional label: string

      Label for the imported address

    • Optional rescan: boolean

      Whether to rescan the blockchain (default true)

    Returns Promise<null>

  • Imports keys from a wallet dump file (see dumpwallet). If a path is not specified in the filename, the data directory is used.

    Returns

    Memberof

    Wallet

    Parameters

    • filename: string

      Filename of the wallet to import

    Returns Promise<null>

  • Inspect an accrual snapshot.

    Returns

    Memberof

    Developer

    Parameters

    • Optional height: number

      Block height of the snapshot

    Returns Promise<unknown>

  • Fills the keypool.

    Returns

    Memberof

    Wallet

    Parameters

    • newSize: number

    Returns Promise<null>

  • Displays research rewards for the lifetime of a CPID

    Returns

    Memberof

    Mining

    Parameters

    • cpid: string

    Returns Promise<Lifetime>

  • Returns UniValue that has account names as keys, account balances as values.

    Deprecated

    Returns

    • The property name is the account name, and the value is the total balance for the account

    Memberof

    Wallet

    Parameters

    • Optional minConf: number = 1

      Only include transactions with at least this many confirmations

    • Optional includeWatchOnly: boolean = false

      Include balances in watchonly addresses (@see importaddress)

    Returns Promise<{
        [key: string]: number;
    }>

  • 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

    Returns

    Memberof

    Wallet

    Returns Promise<[string, number][][]>

  • Display active alerts on the network.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • List all banned IPs/subnets.

    Returns

    Memberof

    Network

    Returns Promise<Banned>

  • List mandatory side stake allocations.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • Show list of known ScraperManifest objects.

    Returns

    Memberof

    Developer

    Parameters

    • details: false

      to show details of manifests

    • Optional manifestHash: string

      hash of specific manifest (Not provided returns all.)

    Returns Promise<Manifests>

  • Show list of known ScraperManifest objects.

    Returns

    Memberof

    Developer

    Parameters

    • details: true

      to show details of manifests

    • Optional manifestHash: string

      hash of specific manifest (Not provided returns all.)

    Returns Promise<ManifestsDetailed>

  • Lists poll details

    Returns

    Memberof

    Voting

    Parameters

    • Optional showFinished: boolean

      If true, show finished polls as well.

    Returns Promise<Poll[]>

  • Displays information about whitelisted projects.

    Returns

    Memberof

    Developer

    Returns Promise<Projects>

  • List protocol entries in the protocol registry.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • List balances by receiving address.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional minConf: number = 1

      The minimum number of confirmations before payments are included.

    • Optional includeEmpty: boolean = false

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

    • Optional includeWatchOnly: boolean = false

      Whether to include watchonly addresses (see 'importaddress').

    Returns Promise<Receivement[]>

  • List researcher accounts in the accrual system and their current accruals.

    Returns

    Memberof

    Developer

    Returns Promise<ResearcherAccounts>

  • List active scrapers on the network.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • List current Gridcoin settings.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • List side stake allocations.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • Get all transactions in blocks since block blockhash, or all transactions if omitted

    Returns

    Memberof

    GridcoinRPC

    Parameters

    • Optional blockHash: string

      The block hash to list transactions since

    • Optional targetConfirmations: number

      The confirmations required, must be 1 or more

    • Optional includeWatchonly: boolean

      Include transactions to watchonly addresses (@see importaddress)

    Returns Promise<ListSinceBlock>

  • Returns count most recent stakes.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional count: number = 10

    Returns Promise<StakeListing[]>

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

    Returns

    Memberof

    Wallet

    Parameters

    • Optional account: string = '*'

      The account name. If not included, it will list all transactions for all accounts.

    • Optional count: number = 10

      The number of transactions to return

    • Optional from: number = 0

      The number of transactions to skip

    • Optional includeWatchonly: boolean = false

      Include transactions to watchonly addresses (@see importaddress) If is set true, it will list sent transactions as well

    Returns Promise<TransactionShort[]>

  • 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}

    Returns

    Memberof

    Wallet

    Parameters

    • Optional minConf: number
    • Optional maxConf: number
    • Rest ...addresses: string[]

    Returns Promise<TransactionUnspent[]>

  • 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.

    Example

    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.

    Returns

    Memberof

    Developer

    Parameters

    • Optional enable: "" | "all" | keyof LoggingCategories
    • Optional disable: "all" | keyof LoggingCategories

    Returns Promise<LoggingCategories>

  • Displays information for the magnitude of the specified CPID in the network

    Returns

    Memberof

    Mining

    Parameters

    • cpid: string

    Returns Promise<Magnitude>

  • Maintain 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.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional retentionByNumber: number

      Number of files to retain

    • Optional retentionByDays: number

      Number of days to retain

    Returns Promise<MaintainBackupsResult>

  • Make a public/private key pair.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional prefix: string

      is optional preferred prefix for the public key

    Returns Promise<KeysPair>

  • Display information about the network health

    Returns

    Memberof

    Developer

    Returns Promise<NetworkHealth>

  • Displays current network time

    Returns

    Memberof

    Network

    Returns Promise<{
        networkTime: number;
    }>

  • Parse an accrual snapshot from a file.

    Returns

    Memberof

    Developer

    Parameters

    • filename: string

      Path to the snapshot file

    Returns Promise<unknown>

  • Parse a legacy superblock.

    Returns

    Memberof

    Developer

    Parameters

    • superblock: string

      The legacy superblock data

    Returns Promise<unknown>

  • Displays pending beacons directly from the beacon registry.

    Returns

    Memberof

    Mining

    Returns Promise<Beacon[]>

  • 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.

    Returns

    Memberof

    Network

    Returns Promise<null>

  • Show the status of locally attached BOINC projects.

    Returns

    Memberof

    Developer

    Returns Promise<LocalProject[]>

  • rain coins by magnitude on network

    Returns

    Memberof

    Wallet

    Parameters

    • project: string

      Required: If a project is specified, rain will be limited to that project. Use * for network-wide.

    • amount: number

      Required: Specify amount of coins to be rained in double precision float

    • Optional message: string

      Optional: Provide a message rained to all rainees

    Returns Promise<RainByMagnitude>

  • Read data from the Gridcoin config/data store.

    Returns

    Memberof

    Developer

    Parameters

    • key: string

      The key to read

    Returns Promise<unknown>

  • Refund an HTLC output after the timeout has passed.

    Returns

    Memberof

    Wallet

    Parameters

    • htlcTxid: string

      Transaction ID of the HTLC funding tx

    • vout: number

      Output index of the HTLC

    • destinationAddr: string

      Address to send refunded funds to

    Returns Promise<RefundHtlcResult>

  • Reorganize the blockchain to a specified height. This is a dangerous admin-only operation.

    Returns

    Memberof

    Developer

    Parameters

    • height: number

      The block height to reorganize to

    Returns Promise<unknown>

  • Repair wallet if checkwallet reports any problem.

    Returns

    Memberof

    Wallet

    Returns Promise<WalletSuccessStatus | WalletFailStatus>

  • Resend any failed or unsent transactions. Requires unlocked wallet

    Returns

    Memberof

    Wallet

    Returns Promise<null>

  • 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

    Returns

    Memberof

    Wallet

    Parameters

    • Optional reserve: boolean

      is true or false to turn balance reserve on or off.

    • Optional amount: number

      is a real and rounded to cent

    Returns Promise<Reserve>

  • Reloads cpids

    Returns

    Memberof

    Mining

    Returns Promise<{
        reset: 1;
    }>

  • Advertise a beacon (Requires wallet to be fully unlocked)

    Returns

    Memberof

    Mining

    Parameters

    • cpid: string

      CPID associated with the beacon to revoke.

    Returns Promise<BeaconRevoke>

  • Save a scraper file manifest.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • 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

    Returns

    Memberof

    Wallet

    Parameters

    • address: string

      Multi-signature address

    • blockStart: number

      Block number to start search from

    • blockEnd: number

      Block number to end search on

    • Optional exports: boolean

      Exports to a file in backup-dir/rpc in format of multisigaddress-datetime.type

    • Optional type: string

      Export to a file with file type (xml, txt or json -- Required if export true)

    Returns Promise<[UTXO[], UnspentReport]>

  • Report containing various statistics about the scraper.

    Returns

    Memberof

    Developer

    Returns Promise<ScrapeReport>

  • Send an alert to the network. Admin-only.

    Returns

    Memberof

    Developer

    Parameters

    • privateKey: string

      Admin private key

    • alertKey: string

      Alert key

    • minVer: number

      Minimum version

    • maxVer: number

      Maximum version

    • priority: number

      Alert priority

    • comment: string

      Alert comment

    • statusBar: string

      Status bar message

    Returns Promise<unknown>

  • Send an alert (v2) to the network. Admin-only.

    Returns

    Memberof

    Developer

    Parameters

    • privateKey: string

      Admin private key

    • alertKey: string

      Alert key

    • minVer: number

      Minimum version

    • maxVer: number

      Maximum version

    • priority: number

      Alert priority

    • comment: string

      Alert comment

    • statusBar: string

      Status bar message

    Returns Promise<unknown>

  • Send a block to the network.

    Returns

    Memberof

    Developer

    Parameters

    • blockData: string

      Hex-encoded block data

    Returns Promise<unknown>

  • Sends amount of Gridcoin from account to gridcoinaddress.

    Returns

    Memberof

    Wallet

    Parameters

    • account: string

      Account FROM

    • address: string

      Address TO

    • amount: number

      Amount to send

    • Optional minConf: number

      is the minimum number of confirmations for a UTXO to be used.

    • Optional comment: string

      is a personal comment about what the transaction is for (doesn’t go into the transaction, it is only stored locally).

    • Optional commentTo: string

      is also a personal comment about who you are sending to (also only local).

    • Optional message: string

      is a message/comment that is sent publicly on the transaction.

    Returns Promise<string>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • account: string

      Account FROM

    • recipients: {
          [key: string]: number;
      }

      { Address1: amount1, Address2: amount2, ... }

      • [key: string]: number
    • Optional minConf: number = 1

      is the minimum number of confirmations for a UTXO to be used.

    • Optional comment: string

      is a personal comment about what the transaction is for (doesn’t go into the transaction, it is only stored locally).

    Returns Promise<string>

  • Submits raw transaction (serialized, hex-encoded) to local node and network

    Returns

    Memberof

    Wallet

    Parameters

    • rawTransaction: string

      raw transaction (serialized, hex-encoded)

    Returns Promise<string>

  • Send a scraper file manifest to the network.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • Sends amount of Gridcoin to gridcoinaddress.

    Returns

    Memberof

    Wallet

    Parameters

    • address: string

      Recipient address

    • amount: number

      is a real and is rounded to the nearest 0.000001

    • Optional comment: string

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

    • Optional commentTo: string

      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

    • Optional message: string

      Optional message to add to the receiver.

    Returns Promise<string>

  • 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.

    Deprecated

    Returns

    Memberof

    Wallet

    Parameters

    • address: string
    • account: string

    Returns Promise<null>

  • add or remove an IP/Subnet from the banned list.

    Returns

    Memberof

    Network

    Parameters

    • subnet: string

      The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)

    • command: "add" | "remove"

      'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list

    • Optional banTime: number

      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)

    • Optional absolute: number | false

      Defaults to false. If set, the bantime must be an absolute timestamp in seconds since epoch (Jan 1 1970 GMT).

    Returns Promise<null>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional newKeyPool: boolean

      Whether to flush old unused addresses and regenerate the keypool

    • Optional seed: string

      The WIF private key to use as the new HD seed; if not provided a random seed will be used

    Returns Promise<null>

  • Set the transaction fee per kilobyte paid by transactions created by this wallet.

    Returns

    Memberof

    Wallet

    Parameters

    • amount: number

      TX fee, rounds to 0.00000001 GRC

    Returns Promise<boolean>

  • Returns all information about the block at index

    Returns

    Memberof

    Network

    Parameters

    • index: number

      Block number

    Returns Promise<Block>

  • 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)

    Returns

    • Base64 signature

    Memberof

    Wallet

    Parameters

    • address: string
    • message: string

    Returns Promise<string>

  • Sign inputs for raw transaction (serialized, hex-encoded).

    Returns

    Memberof

    Wallet

    Parameters

    • rawTransaction: string

      raw transaction (serialized, hex-encoded)

    • transactionDependencies: TransactionDependencies[]

      is an array of previous transaction outputs that this transaction depends on but may not yet be in the blockchain.

    • privateKeys: string[]

      is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction

    • sigHashType: SigHashType

      is a string that is one of six values; ALL, NONE, SINGLE or ALL|ANYONECANPAY, NONE|ANYONECANPAY, SINGLE|ANYONECANPAY.

    Returns Promise<TransactionSigned>

  • Stop Gridcoin server.

    Returns

    Memberof

    Network

    Returns Promise<string>

  • Display data on recent superblocks

    Returns

    Memberof

    Mining

    Parameters

    • Optional lookback: number

      number of superblocks to show (default 14)

    • Optional displayContract: boolean

      display superblock contract (default false)

    • Optional cpid: string

      Shows magnitude for a cpid for recent superblocks

    Returns Promise<Superblock[]>

  • Display information regarding superblock age

    Returns

    Memberof

    Mining

    Returns Promise<SuperblockAge>

  • Displays average information for current superblock

    Returns

    Memberof

    Developer

    Returns Promise<SuperblockAverage>

  • Test building a new superblock from current convergence data.

    Returns

    Memberof

    Developer

    Returns Promise<unknown>

  • Test the poll notification system.

    Returns

    Memberof

    Voting

    Parameters

    • pollTxid: string

      Transaction id of the poll to test notification

    Returns Promise<string>

  • 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.

    Returns

    Memberof

    Wallet

    Parameters

    • Optional version: number

      The version number to upgrade to. Default is the latest wallet version.

    Returns Promise<string>

  • Return information about gridcoinaddress.

    Description

    The validateaddress RPC accepts a block verifies it is a valid addition to the block chain and broadcasts it to the network.

    Returns

    Memberof

    GridcoinRPC

    Parameters

    • gridcoinAddress: string

    Returns Promise<AddressValidation>

  • Return information about gridcoinpubkey.

    Returns

    Memberof

    GridcoinRPC

    Parameters

    • gridcoinPubkey: string

    Returns Promise<PubKeyValidation>

  • Verify a signed message.

    Description

    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.

    Returns

    Memberof

    GridcoinRPC

    See

    signmessage

    Parameters

    • gridcoinAddress: string

      The gridcoin address to use for the signature.

    • signature: string

      The signature provided by the signer in base 64 encoding.

    • message: string

      The message that was signed.

    Returns Promise<boolean>

  • Display the software versions of nodes that recently staked.

    Returns

    Memberof

    Developer

    Parameters

    • Optional lookBack: number

      Number of blocks to tally from the chain head

    • Optional full: boolean

      Classify by commit suffix (default: false)

    Returns Promise<Version[]>

  • Cast a vote for a poll.

    Returns

    Memberof

    Voting

    Parameters

    • pollId: string

      ID of the poll to vote for.

    • Rest ...choices: number[]

      Numeric IDs of the choices to vote for.

    Returns Promise<VoteResult>

  • Display the vote details for the specified poll

    Returns

    Memberof

    Voting

    Parameters

    • voteIdOrTitle: string

      Title or ID of the poll

    Returns Promise<Vote[]>

  • Runs several tests to diagnose issues in the wallet.

    Returns

    Memberof

    Wallet

    Returns Promise<Record<string, unknown>>

  • Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call

    See

    walletPassPhrase again before being able to call any methods which require the wallet to be unlocked.

    Returns

    Memberof

    Wallet

    Returns Promise<null>

  • Stores the wallet decryption key in memory for timeout seconds. if stakingonly is true sending functions are disabled.

    Returns

    Memberof

    Wallet

    Parameters

    • passphrase: string
    • timeout: number
    • isStakingOnly: boolean

    Returns Promise<null>

  • Changes the wallet passphrase from oldpassphrase to newpassphrase

    Returns

    Memberof

    Wallet

    Parameters

    • oldPassphrase: string
    • newPassphrase: string

    Returns Promise<null>

  • Write data to the Gridcoin config/data store.

    Returns

    Memberof

    Developer

    Parameters

    • key: string

      The key to write

    • value: string

      The value to write

    Returns Promise<unknown>

Generated using TypeDoc