eosjs 文档(JSON-RPC)

JSON-RPC

  • JsonRpc

函数

  • arrayToHex

函数

arrayToHex

arrayToHex(data: Uint8Array): string

定义于eosjs-jsonrpc.ts:11

参数:

名称 类型
data Uint8Array

返回:string

JsonRpc

实现接口

  • AuthorityProvider
  • AbiProvider

构造函数

new JsonRpc(endpoint: string, args?: object): JsonRpc

定义于eosjs-jsonrpc.ts:22

参数:

endpoint:string
Default value args:object

  • fetch

    • 浏览器:保留nullundefined
    • node:提供实现
名称 类型
(可选的)fetch function

返回:JsonRpc

属性

endpoint

  • endpoint:string

定义于eosjs-jsonrpc.ts:21

fetchBuiltin

  • fetchBuiltin:function

定义于eosjs-jsonrpc.ts:22

类型声明
(input?: Request | string, init?: RequestInit): Promise

参数:

名称 类型
(可选的)input Request | string
(可选的)init RequestInit

返回:Promise

方法

db_size_get

db_size_get(): Promise

定义于eosjs-jsonrpc.ts:182

原始调用/v1/db_size/get

返回:Promise

fetch

fetch(path: string, body: any): Promise

定义于eosjs-jsonrpc.ts:42

发布bodyendpoint + path,在可用时在RpcError中抛出详细的错误信息。

参数:

名称 类型
path string
body any

返回:Promise

getRawAbi

getRawAbi(accountName: string): Promise

定义于eosjs-jsonrpc.ts:129

调用/v1/chain/get_raw_code_and_abi并提取不需要的原始wasm代码。

参数:

名称 类型
accountName string

返回:Promise

getRequiredKeys

getRequiredKeys(args: AuthorityProviderArgs): Promise

定义于eosjs-jsonrpc.ts:164

获取满足transaction权限所需的availableKeys子集,实现AuthorityProvider

参数:

名称 类型
args AuthorityProviderArgs

返回:Promise

get_abi

get_abi(account_name: string): Promise

定义于eosjs-jsonrpc.ts:67

原始调用/v1/chain/get_abi

参数:

名称 类型
account_name string

返回:Promise

get_account

get_account(account_name: string): Promise

定义于eosjs-jsonrpc.ts:73

原始调用/v1/chain/get_account

参数:

名称 类型
account_name string

返回:Promise

get_block

get_block(block_num_or_id: number | string): Promise

定义于eosjs-jsonrpc.ts:85

原始调用/v1/chain/get_block

参数:

名称 类型
block_num_or_id number | string

返回:Promise

get_block_header_state

get_block_header_state(block_num_or_id: number | string): Promise

定义于eosjs-jsonrpc.ts:79

原始调用/v1/chain/get_block_header_state

参数:

名称 类型
block_num_or_id number | string

返回:Promise

get_code

get_code(account_name: string): Promise

定义于eosjs-jsonrpc.ts:91

原始调用/v1/chain/get_code

参数:

名称 类型
account_name string

返回:Promise

get_currency_balance

get_currency_balance(code: string, account: string, symbol?: string): Promise

定义于eosjs-jsonrpc.ts:96

原始调用/v1/chain/get_currency_balance

参数:

名称 类型 默认值
code string -
account string -
Default value symbol string null

返回:Promise

get_currency_stats

get_currency_stats(code: string, symbol: string): Promise

定义于eosjs-jsonrpc.ts:101

原始调用/v1/chain/get_currency_stats

参数:

名称 类型
code string
symbol string

返回:Promise

get_info

get_info(): Promise

定义于eosjs-jsonrpc.ts:106

原始调用/v1/chain/get_info

返回:Promise

get_producer_schedule

get_producer_schedule(): Promise

定义于eosjs-jsonrpc.ts:111

原始调用/v1/chain/get_producer_schedule

返回:Promise

get_producers

get_producers(json?: boolean, lower_bound?: string, limit?: number): Promise

定义于eosjs-jsonrpc.ts:117

原始调用/v1/chain/get_producers

参数:

名称 类型 默认值
Default value json boolean true
Default value lower_bound string ""
Default value limit number 50

返回:Promise

get_raw_code_and_abi

get_raw_code_and_abi(account_name: string): Promise

定义于eosjs-jsonrpc.ts:123

原始调用/v1/chain/get_raw_code_and_abi

参数:

名称 类型
account_name string

返回:Promise

get_table_rows

get_table_rows(__namedParameters: object): Promise

定义于eosjs-jsonrpc.ts:136

原始调用/v1/chain/get_table_rows

参数:

__namedParameters:object

名称 类型 默认值
code any -
index_position any 1
json any true
key_type any ""
limit any 10
lower_bound any ""
scope any -
table any -
table_key any ""
upper_bound any ""

返回:Promise

history_get_actions

history_get_actions(account_name: string, pos?: number, offset?: number): Promise

定义于eosjs-jsonrpc.ts:186

原始调用/v1/history/get_actions

参数:

名称 类型 默认值
account_name string -
Default value pos number null
Default value offset number null

返回:Promise

history_get_controlled_accounts

history_get_controlled_accounts(controlling_account: string): Promise

定义于eosjs-jsonrpc.ts:204

原始调用/v1/history/get_controlled_accounts

参数:

名称 类型
controlling_account string

返回:Promise

history_get_key_accounts

history_get_key_accounts(public_key: string): Promise

定义于eosjs-jsonrpc.ts:198

原始调用/v1/history/get_key_accounts

参数:

名称 类型
public_key string

返回:Promise

history_get_transaction

history_get_transaction(id: string, block_num_hint?: number): Promise

定义于eosjs-jsonrpc.ts:192

原始调用/v1/history/get_transaction

参数:

名称 类型 默认值
id Uint8Array -
Default value block_num_hint number null

返回:Promise

push_transaction

push_transaction(__namedParameters: object): Promise

定义于eosjs-jsonrpc.ts:172

推送序列化交易。

参数:

__namedParameters:object

名称 类型
serializedTransaction Uint8Array
signatures string[]

返回:Promise


上一篇:JS-Sig

下一篇:Numeric

你可能感兴趣的:(javascript,eos)