import { Transaction, Signer, SignerJson } from "../../tx"; import { Query, CliPlugin, GetPeersResult, GetRawMemPoolResult, GetRawTransactionResult, InvokeResult, GetVersionResult, GetContractStateResult, FindStorageResult } from "../Query"; import { BlockJson, BlockHeaderJson, Validator } from "../../types"; import { RpcDispatcher, RpcDispatcherMixin } from "./RpcDispatcher"; import { HexString } from "../../u"; import { NativeContractState } from ".."; import { StackItem, StackItemJson } from "../../sc"; export declare function NeoServerRpcMixin(base: TBase): { new (...args: any[]): { /** * Query returning the Iterator value from session and Iterator id returned by invokefunction or invokescript. * @param sessionId - Cache id. It is session returned by invokefunction or invokescript. * @param iteratorId - Iterator data id. It is the id of stack returned by invokefunction or invokescript . * @param count - The number of values returned. It cannot exceed the value of the MaxIteratorResultItems field in config.json of the RpcServer plug-in. * The result is the first count of data traversed in the Iterator, and follow-up requests will continue traversing from count + 1 . */ traverseIterator(sessionId: string, iteratorId: string, count: number): Promise; /** * Get the latest block hash. */ getBestBlockHash(): Promise; /** * Gets the block at a given height or hash. * @param indexOrHash - height or hash of desired block; * @param verbose - 0 for serialized block in hex, 1 for json format, defaults to 0 * @returns string or block object according to verbose */ getBlock(indexOrHash: number | string, verbose?: 0 | false): Promise; getBlock(indexOrHash: number | string, verbose: 1 | true): Promise; /** * Gets the block hash at a given height. */ getBlockHash(index: number): Promise; /** * Get the current block height. */ getBlockCount(): Promise; /** * Get the corresponding block header information according to the specified script hash. * @param indexOrHash - height or hash of desired block * @param verbose - 0 for serialized block in hex, 1 for json format, defaults to 0 * @returns verbose = 0, blocker header hex string; verbose = 1, block header info in json */ getBlockHeader(indexOrHash: number | string, verbose?: 0): Promise; getBlockHeader(indexOrHash: number | string, verbose: 1): Promise; /** * Get the list of public keys in the committee. */ getCommittee(): Promise; /** * Gets the state of the contract at the given scriptHash. */ getContractState(scriptHash: string): Promise; getNativeContracts(): Promise; /** * This Query returns the transaction hashes of the transactions confirmed or unconfirmed. * @param shouldGetUnverified - shouldGetUnverified Optional. Default is 0. * shouldGetUnverified = 0, get confirmed transaction hashes * shouldGetUnverified = 1, get current block height and confirmed and unconfirmed tx hash */ getRawMemPool(shouldGetUnverified?: 0 | false): Promise; getRawMemPool(shouldGetUnverified: 1 | true): Promise; /** * Gets a transaction based on its hash. * @param txid - transaction id * @param verbose - 0, will query transaction in hex string; 1 will query for transaction object. defaults to 0 * @returns transaction hex or object */ getRawTransaction(txid: string, verbose?: 0 | false): Promise; getRawTransaction(txid: string, verbose: 1 | true): Promise; /** * Gets the corresponding value of a key in the storage of a contract address. */ getStorage(scriptHash: string, key: string): Promise; /** * Finds all values with a given prefix key in the storage of a contract address. * * @param scriptHash - contract script hash * @param searchPrefix - prefix to search for, can be empty string to return all keys in storage * @param start - start index, the page size is limited to 50 items, if more than 50 values exist on the * storage, you can use the return of the previous call to get next items. The default value is 0 * @returns a json object with the contract storage keys and values */ findStorage(scriptHash: string, searchPrefix: string, start?: number): Promise; /** * Gets the block index in which the transaction is found. * @param txid - hash of the specific transaction. */ getTransactionHeight(txid: string): Promise; /** * Gets the number of peers this node is connected to. */ getConnectionCount(): Promise; /** * Gets the list of validators available for voting. */ getNextBlockValidators(): Promise; /** * Gets a list of all peers that this node has discovered. */ getPeers(): Promise; /** * Gets the version of the NEO node along with various other metadata. */ getVersion(): Promise; /** * Sends a serialized transaction to the network. * @returns transaction id */ sendRawTransaction(transaction: Transaction | string | HexString): Promise; /** * Submits a serialized block to the network. * @returns block hash if success */ submitBlock(block: string): Promise; /** * Get the amount of unclaimed GAS for a NEO address. This is returned as the raw value. To get the display value, divide this by 100000000. */ getUnclaimedGas(addr: string): Promise; /** * Submits a verification script to run under a contract. * @param scriptHash - contract to test * @param args - arguments to pass * @param signers - Signers to be included in transaction */ invokeContractVerify(scriptHash: string, args: unknown[], signers?: (Signer | SignerJson)[]): Promise; /** * Submits a contract method call with parameters for the node to run. This method is a local invoke, results are not reflected on the blockchain. */ invokeFunction(scriptHash: string, operation: string, params?: unknown[], signers?: (Signer | SignerJson)[]): Promise>; /** * Submits a script for the node to run. This method is a local invoke, results are not reflected on the blockchain. * * @param script - base64-encoded hexstring. * @param signers - signatures accompanying this execution. */ invokeScript(script: string | HexString, signers?: (Signer | SignerJson)[]): Promise; /** * Returns the gas fee for a transaction. * Transaction needs to have: * - All the intended signers * - Empty witnesses corresponding to the signers * - Non-zero script * * @param tx - transaction to calculate fee for * @returns GAS fee as an stringified integer */ calculateNetworkFee(tx: Transaction | HexString | string): Promise; /** * Returns a list of plugins loaded by the node. */ listPlugins(): Promise; /** * Checks if the provided address is a valid NEO address. */ validateAddress(addr: string): Promise; url: string; execute(query: Query, config?: import("./RpcDispatcher").RpcConfig): Promise; executeAll(batchQuery: import("..").BatchQuery, config?: import("./RpcDispatcher").RpcConfig): Promise; executeAll(batchQuery: Query[], config?: import("./RpcDispatcher").RpcConfig): Promise; }; } & TBase; declare const NeoServerRpcClient_base: { new (...args: any[]): { /** * Query returning the Iterator value from session and Iterator id returned by invokefunction or invokescript. * @param sessionId - Cache id. It is session returned by invokefunction or invokescript. * @param iteratorId - Iterator data id. It is the id of stack returned by invokefunction or invokescript . * @param count - The number of values returned. It cannot exceed the value of the MaxIteratorResultItems field in config.json of the RpcServer plug-in. * The result is the first count of data traversed in the Iterator, and follow-up requests will continue traversing from count + 1 . */ traverseIterator(sessionId: string, iteratorId: string, count: number): Promise; /** * Get the latest block hash. */ getBestBlockHash(): Promise; /** * Gets the block at a given height or hash. * @param indexOrHash - height or hash of desired block; * @param verbose - 0 for serialized block in hex, 1 for json format, defaults to 0 * @returns string or block object according to verbose */ getBlock(indexOrHash: number | string, verbose?: 0 | false): Promise; getBlock(indexOrHash: number | string, verbose: 1 | true): Promise; /** * Gets the block hash at a given height. */ getBlockHash(index: number): Promise; /** * Get the current block height. */ getBlockCount(): Promise; /** * Get the corresponding block header information according to the specified script hash. * @param indexOrHash - height or hash of desired block * @param verbose - 0 for serialized block in hex, 1 for json format, defaults to 0 * @returns verbose = 0, blocker header hex string; verbose = 1, block header info in json */ getBlockHeader(indexOrHash: number | string, verbose?: 0): Promise; getBlockHeader(indexOrHash: number | string, verbose: 1): Promise; /** * Get the list of public keys in the committee. */ getCommittee(): Promise; /** * Gets the state of the contract at the given scriptHash. */ getContractState(scriptHash: string): Promise; getNativeContracts(): Promise; /** * This Query returns the transaction hashes of the transactions confirmed or unconfirmed. * @param shouldGetUnverified - shouldGetUnverified Optional. Default is 0. * shouldGetUnverified = 0, get confirmed transaction hashes * shouldGetUnverified = 1, get current block height and confirmed and unconfirmed tx hash */ getRawMemPool(shouldGetUnverified?: 0 | false): Promise; getRawMemPool(shouldGetUnverified: 1 | true): Promise; /** * Gets a transaction based on its hash. * @param txid - transaction id * @param verbose - 0, will query transaction in hex string; 1 will query for transaction object. defaults to 0 * @returns transaction hex or object */ getRawTransaction(txid: string, verbose?: 0 | false): Promise; getRawTransaction(txid: string, verbose: 1 | true): Promise; /** * Gets the corresponding value of a key in the storage of a contract address. */ getStorage(scriptHash: string, key: string): Promise; /** * Finds all values with a given prefix key in the storage of a contract address. * * @param scriptHash - contract script hash * @param searchPrefix - prefix to search for, can be empty string to return all keys in storage * @param start - start index, the page size is limited to 50 items, if more than 50 values exist on the * storage, you can use the return of the previous call to get next items. The default value is 0 * @returns a json object with the contract storage keys and values */ findStorage(scriptHash: string, searchPrefix: string, start?: number): Promise; /** * Gets the block index in which the transaction is found. * @param txid - hash of the specific transaction. */ getTransactionHeight(txid: string): Promise; /** * Gets the number of peers this node is connected to. */ getConnectionCount(): Promise; /** * Gets the list of validators available for voting. */ getNextBlockValidators(): Promise; /** * Gets a list of all peers that this node has discovered. */ getPeers(): Promise; /** * Gets the version of the NEO node along with various other metadata. */ getVersion(): Promise; /** * Sends a serialized transaction to the network. * @returns transaction id */ sendRawTransaction(transaction: Transaction | string | HexString): Promise; /** * Submits a serialized block to the network. * @returns block hash if success */ submitBlock(block: string): Promise; /** * Get the amount of unclaimed GAS for a NEO address. This is returned as the raw value. To get the display value, divide this by 100000000. */ getUnclaimedGas(addr: string): Promise; /** * Submits a verification script to run under a contract. * @param scriptHash - contract to test * @param args - arguments to pass * @param signers - Signers to be included in transaction */ invokeContractVerify(scriptHash: string, args: unknown[], signers?: (Signer | SignerJson)[]): Promise; /** * Submits a contract method call with parameters for the node to run. This method is a local invoke, results are not reflected on the blockchain. */ invokeFunction(scriptHash: string, operation: string, params?: unknown[], signers?: (Signer | SignerJson)[]): Promise>; /** * Submits a script for the node to run. This method is a local invoke, results are not reflected on the blockchain. * * @param script - base64-encoded hexstring. * @param signers - signatures accompanying this execution. */ invokeScript(script: string | HexString, signers?: (Signer | SignerJson)[]): Promise; /** * Returns the gas fee for a transaction. * Transaction needs to have: * - All the intended signers * - Empty witnesses corresponding to the signers * - Non-zero script * * @param tx - transaction to calculate fee for * @returns GAS fee as an stringified integer */ calculateNetworkFee(tx: Transaction | HexString | string): Promise; /** * Returns a list of plugins loaded by the node. */ listPlugins(): Promise; /** * Checks if the provided address is a valid NEO address. */ validateAddress(addr: string): Promise; url: string; execute(query: Query, config?: import("./RpcDispatcher").RpcConfig): Promise; executeAll(batchQuery: import("..").BatchQuery, config?: import("./RpcDispatcher").RpcConfig): Promise; executeAll(batchQuery: Query[], config?: import("./RpcDispatcher").RpcConfig): Promise; }; } & typeof RpcDispatcher; /** * RPC Client model to query a NEO node. Contains built-in methods to query using RPC calls. */ export declare class NeoServerRpcClient extends NeoServerRpcClient_base { get [Symbol.toStringTag](): string; } export {}; //# sourceMappingURL=NeoServerRpcClient.d.ts.map