/// import { Buffer } from 'buffer'; import { type Records } from './record'; import { JSONRpc, type AccountView, type NearProtocolConfig, type AccountBalance, type CodeResult, type BlockId, type Finality, type StateItem, type Empty, type PublicKey, type Network, type AccessKeyView, type AccessKeyList } from './types'; /** * Extends the main provider class in near-api-js, adding more methods for * interacting with an endpoint. */ export declare class JsonRpcProvider extends JSONRpc { /** * Create a JsonRpcProvider from config or rpcAddr * @param config rpc endpoint URL or a configuration that includes one. * @returns JsonRpcProvider */ static from(config: string | { rpcAddr: string; }): JsonRpcProvider; static fromNetwork(network: Network): JsonRpcProvider; private static readonly providers; /** * Download the binary of a given contract. * @param accountId contract account * @returns Buffer of Wasm binary */ viewCode(accountId: string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; /** * Download the binary of a given contract. * @param accountId contract account * @returns Base64 string of Wasm binary */ viewCodeRaw(accountId: string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; viewAccount(accountId: string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; accountExists(accountId: string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; viewAccessKey(accountId: string, publicKey: PublicKey | string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; viewAccessKeys(accountId: string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; protocolConfig(blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; accountBalance(accountId: string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; viewCall(accountId: string, methodName: string, args: Record | Uint8Array, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; /** * Get full response from RPC about result of view method * @param accountId * @param methodName * @param args Base64 encoded string * @param blockQuery * @returns */ viewCallRaw(accountId: string, methodName: string, args: string, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; /** * Download the state of a contract given a prefix of a key. * * @param accountId contract account to lookup * @param prefix string or byte prefix of keys to loodup * @param blockQuery state at what block, defaults to most recent final block * @returns raw RPC response */ viewState(accountId: string, prefix: string | Uint8Array, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise>; /** * Download the state of a contract given a prefix of a key without decoding from base64. * * @param accountId contract account to lookup * @param prefix string or byte prefix of keys to loodup * @param blockQuery state at what block, defaults to most recent final block * @returns raw RPC response */ viewStateRaw(accountId: string, prefix: string | Uint8Array, blockQuery?: { block_id: BlockId; } | { finality: Finality; }): Promise; /** * Updates records without using a transaction. * Note: only avaialable on Sandbox endpoints. * @param records * @returns Promise */ patchStateRecords(records: Records): Promise; /** * Fast forward to a point in the future. The delta block height is supplied to tell the * network to advanced a certain amount of blocks. This comes with the advantage only having * to wait a fraction of the time it takes to produce the same number of blocks. * * Estimate as to how long it takes: if our delta_height crosses `X` epochs, then it would * roughly take `X * 5` milliseconds for the fast forward request to be processed. * * Note: This is not to be confused with speeding up the current in-flight transactions; * the state being forwarded in this case refers to time-related state (the block height, timestamp and epoch). * @param deltaHeight * @returns Promise */ fastForward(deltaHeight: number): Promise; } export declare const TestnetRpc: JsonRpcProvider; export declare const MainnetRpc: JsonRpcProvider; //# sourceMappingURL=jsonrpc.d.ts.map