/** * @module JSON-RPC */ import { AbiProvider, AuthorityProvider, AuthorityProviderArgs, BinaryAbi } from './eosjs-api-interfaces'; import { GetAbiResult, GetBlockHeaderStateResult, GetBlockResult, GetCodeResult, GetInfoResult, GetRawCodeAndAbiResult, PushTransactionArgs, SendTransaction2Args } from './eosjs-rpc-interfaces'; /** Make RPC calls */ export declare class JsonRpc implements AuthorityProvider, AbiProvider { endpoint: string; fetchBuiltin: (input?: Request | string, init?: RequestInit) => Promise; /** * @param endpoint * @param args * * `fetch`: * * browsers: leave `null` or `undefined` * * node: provide an implementation */ constructor(endpoint: string, args?: { fetch?: (input?: string | Request, init?: RequestInit) => Promise; }); /** Post `body` to `endpoint + path`. Throws detailed error information in `RpcError` when available. */ fetch(path: string, body: any): Promise; /** Raw call to `/v1/chain/get_abi` */ get_abi(accountName: string): Promise; /** Raw call to `/v1/chain/get_account` */ get_account(accountName: string): Promise; /** Raw call to `/v1/chain/get_block_header_state` */ get_block_header_state(blockNumOrId: number | string): Promise; /** Raw call to `/v1/chain/get_block` */ get_block(blockNumOrId: number | string): Promise; /** Raw call to `/v1/chain/get_code` */ get_code(accountName: string): Promise; /** Raw call to `/v1/chain/get_currency_balance` */ get_currency_balance(code: string, account: string, symbol?: string): Promise; /** Raw call to `/v1/chain/get_currency_stats` */ get_currency_stats(code: string, symbol: string): Promise; /** Raw call to `/v1/chain/get_info` */ get_info(): Promise; /** Raw call to `/v1/chain/get_producer_schedule` */ get_producer_schedule(): Promise; /** Raw call to `/v1/chain/get_producers` */ get_producers(json?: boolean, lowerBound?: string, limit?: number): Promise; /** Raw call to `/v1/chain/get_raw_code_and_abi` */ get_raw_code_and_abi(accountName: string): Promise; /** calls `/v1/chain/get_raw_code_and_abi` and pulls out unneeded raw wasm code */ getRawAbi(accountName: string): Promise; /** Raw call to `/v1/chain/get_scheduled_transactions` */ get_scheduled_transactions(json?: boolean, lowerBound?: string, limit?: number): Promise; /** Raw call to `/v1/chain/get_table_rows` */ get_table_rows({ json, code, scope, table, table_key, lower_bound, upper_bound, index_position, key_type, limit, reverse, show_payer, }: any): Promise; /** Raw call to `/v1/chain/get_table_by_scope` */ get_table_by_scope({ code, table, lower_bound, upper_bound, limit, }: any): Promise; /** Get subset of `availableKeys` needed to meet authorities in `transaction`. Implements `AuthorityProvider` */ getRequiredKeys(args: AuthorityProviderArgs): Promise; /** Push a serialized transaction (replaced by send_transaction, but returned format has changed) */ push_transaction({ signatures, serializedTransaction, serializedContextFreeData, }: PushTransactionArgs): Promise; /** Send a serialized transaction */ send_transaction({ signatures, serializedTransaction, serializedContextFreeData, }: PushTransactionArgs): Promise; /** Send a serialized transaction2 */ send_transaction2({ return_failure_trace, retry_trx, retry_trx_num_blocks, transaction: { signatures, serializedTransaction, serializedContextFreeData }, }: SendTransaction2Args): Promise; /** Send readonly transaction */ send_readonly_transaction({ signatures, serializedTransaction, serializedContextFreeData, }: PushTransactionArgs): Promise; /** Raw call to `/v1/db_size/get` */ db_size_get(): Promise; /** Raw call to `/v1/history/get_actions` */ history_get_actions(accountName: string, pos?: number, offset?: number): Promise; /** Raw call to `/v1/history/get_transaction` */ history_get_transaction(id: string, blockNumHint?: number): Promise; /** Raw call to `/v1/history/get_key_accounts` */ history_get_key_accounts(publicKey: string): Promise; /** Raw call to `/v1/history/get_controlled_accounts` */ history_get_controlled_accounts(controllingAccount: string): Promise; }