본문으로 건너뛰기

JsonRpc

EOSIO Javascript / Exports / JsonRpc

Class: JsonRpc

Make RPC calls

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new JsonRpc(endpoint, args?)

Parameters

NameTypeDescription
endpointstring
argsObject fetch: browsers: leave null or undefined * node: provide an implementation
args.fetch?(input?: string | Request, init?: RequestInit) => Promise<Response>-

Defined in

src/eosjs-jsonrpc.ts:31

Properties

endpoint

endpoint: string

Defined in

src/eosjs-jsonrpc.ts:21


fetchBuiltin

fetchBuiltin: (input?: string | Request, init?: RequestInit) => Promise<Response>

Type declaration

▸ (input?, init?): Promise<Response>

Parameters
NameType
input?string | Request
init?RequestInit
Returns

Promise<Response>

Defined in

src/eosjs-jsonrpc.ts:22

Methods

db_size_get

db_size_get(): Promise<any>

Raw call to /v1/db_size/get

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:239


fetch

fetch(path, body): Promise<any>

Post body to endpoint + path. Throws detailed error information in RpcError when available.

Parameters

NameType
pathstring
bodyany

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:43


getRawAbi

getRawAbi(accountName): Promise<BinaryAbi>

calls /v1/chain/get_raw_code_and_abi and pulls out unneeded raw wasm code

Parameters

NameType
accountNamestring

Returns

Promise<BinaryAbi>

Implementation of

AbiProvider.getRawAbi

Defined in

src/eosjs-jsonrpc.ts:123


getRequiredKeys

getRequiredKeys(args): Promise<string[]>

Get subset of availableKeys needed to meet authorities in transaction. Implements AuthorityProvider

Parameters

NameType
argsAuthorityProviderArgs

Returns

Promise<string[]>

Implementation of

AuthorityProvider.getRequiredKeys

Defined in

src/eosjs-jsonrpc.ts:185


get_abi

get_abi(accountName): Promise<GetAbiResult>

Raw call to /v1/chain/get_abi

Parameters

NameType
accountNamestring

Returns

Promise<GetAbiResult>

Defined in

src/eosjs-jsonrpc.ts:67


get_account

get_account(accountName): Promise<any>

Raw call to /v1/chain/get_account

Parameters

NameType
accountNamestring

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:72


get_block

get_block(blockNumOrId): Promise<GetBlockResult>

Raw call to /v1/chain/get_block

Parameters

NameType
blockNumOrIdstring | number

Returns

Promise<GetBlockResult>

Defined in

src/eosjs-jsonrpc.ts:82


get_block_header_state

get_block_header_state(blockNumOrId): Promise<GetBlockHeaderStateResult>

Raw call to /v1/chain/get_block_header_state

Parameters

NameType
blockNumOrIdstring | number

Returns

Promise<GetBlockHeaderStateResult>

Defined in

src/eosjs-jsonrpc.ts:77


get_code

get_code(accountName): Promise<GetCodeResult>

Raw call to /v1/chain/get_code

Parameters

NameType
accountNamestring

Returns

Promise<GetCodeResult>

Defined in

src/eosjs-jsonrpc.ts:87


get_currency_balance

get_currency_balance(code, account, symbol?): Promise<any>

Raw call to /v1/chain/get_currency_balance

Parameters

NameTypeDefault value
codestringundefined
accountstringundefined
symbolstringnull

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:92


get_currency_stats

get_currency_stats(code, symbol): Promise<any>

Raw call to /v1/chain/get_currency_stats

Parameters

NameType
codestring
symbolstring

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:97


get_info

get_info(): Promise<GetInfoResult>

Raw call to /v1/chain/get_info

Returns

Promise<GetInfoResult>

Defined in

src/eosjs-jsonrpc.ts:102


get_producer_schedule

get_producer_schedule(): Promise<any>

Raw call to /v1/chain/get_producer_schedule

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:107


get_producers

get_producers(json?, lowerBound?, limit?): Promise<any>

Raw call to /v1/chain/get_producers

Parameters

NameTypeDefault value
jsonbooleantrue
lowerBoundstring''
limitnumber50

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:112


get_raw_code_and_abi

get_raw_code_and_abi(accountName): Promise<GetRawCodeAndAbiResult>

Raw call to /v1/chain/get_raw_code_and_abi

Parameters

NameType
accountNamestring

Returns

Promise<GetRawCodeAndAbiResult>

Defined in

src/eosjs-jsonrpc.ts:117


get_scheduled_transactions

get_scheduled_transactions(json?, lowerBound?, limit?): Promise<any>

Raw call to /v1/chain/get_scheduled_transactions

Parameters

NameTypeDefault value
jsonbooleantrue
lowerBoundstring''
limitnumber50

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:130


get_table_by_scope

get_table_by_scope(__namedParameters): Promise<any>

Raw call to /v1/chain/get_table_by_scope

Parameters

NameType
__namedParametersany

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:167


get_table_rows

get_table_rows(__namedParameters): Promise<any>

Raw call to /v1/chain/get_table_rows

Parameters

NameType
__namedParametersany

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:135


history_get_actions

history_get_actions(accountName, pos?, offset?): Promise<any>

Raw call to /v1/history/get_actions

Parameters

NameTypeDefault value
accountNamestringundefined
posnumbernull
offsetnumbernull

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:242


history_get_controlled_accounts

history_get_controlled_accounts(controllingAccount): Promise<any>

Raw call to /v1/history/get_controlled_accounts

Parameters

NameType
controllingAccountstring

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:257


history_get_key_accounts

history_get_key_accounts(publicKey): Promise<any>

Raw call to /v1/history/get_key_accounts

Parameters

NameType
publicKeystring

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:252


history_get_transaction

history_get_transaction(id, blockNumHint?): Promise<any>

Raw call to /v1/history/get_transaction

Parameters

NameTypeDefault value
idstringundefined
blockNumHintnumbernull

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:247


push_transaction

push_transaction(__namedParameters): Promise<any>

Push a serialized transaction (replaced by send_transaction, but returned format has changed)

Parameters

NameType
__namedParametersPushTransactionArgs

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:193


send_transaction

send_transaction(__namedParameters): Promise<any>

Send a serialized transaction

Parameters

NameType
__namedParametersPushTransactionArgs

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:205


send_transaction2

send_transaction2(__namedParameters): Promise<any>

Send a serialized transaction2

Parameters

NameType
__namedParametersSendTransaction2Args

Returns

Promise<any>

Defined in

src/eosjs-jsonrpc.ts:217