乐趣区

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:stringDefault value args:object

fetch:

浏览器:保留 null 或 undefined

node:提供实现

名称
类型

(可选的)fetch
function

返回:JsonRpc
属性
endpoint
endpoint:string

定义于 eosjs-jsonrpc.ts:21
fetchBuiltin
fetchBuiltin:function

定义于 eosjs-jsonrpc.ts:22
类型声明
(input?: Request | string, init?: RequestInit): Promise<Response>
参数:

名称
类型

(可选的)input

Request | string

(可选的)init
RequestInit

返回:Promise<Response>
方法
db_size_get
db_size_get(): Promise<any>
定义于 eosjs-jsonrpc.ts:182
原始调用 /v1/db_size/get
返回:Promise<any>
fetch
fetch(path: string, body: any): Promise<any>
定义于 eosjs-jsonrpc.ts:42
发布 body 到 endpoint + path,在可用时在 RpcError 中抛出详细的错误信息。
参数:

名称
类型

path
string

body
any

返回:Promise<any>
getRawAbi
getRawAbi(accountName: string): Promise<BinaryAbi>
定义于 eosjs-jsonrpc.ts:129
调用 /v1/chain/get_raw_code_and_abi 并提取不需要的原始 wasm 代码。
参数:

名称
类型

accountName
string

返回:Promise<BinaryAbi>
getRequiredKeys
getRequiredKeys(args: AuthorityProviderArgs): Promise<string[]>
定义于 eosjs-jsonrpc.ts:164
获取满足 transaction 权限所需的 availableKeys 子集,实现 AuthorityProvider。
参数:

名称
类型

args
AuthorityProviderArgs

返回:Promise<string[]>
get_abi
get_abi(account_name: string): Promise<GetAbiResult>
定义于 eosjs-jsonrpc.ts:67
原始调用 /v1/chain/get_abi
参数:

名称
类型

account_name
string

返回:Promise<GetAbiResult>
get_account
get_account(account_name: string): Promise<any>
定义于 eosjs-jsonrpc.ts:73
原始调用 /v1/chain/get_account
参数:

名称
类型

account_name
string

返回:Promise<any>
get_block
get_block(block_num_or_id: number | string): Promise<GetBlockResult>
定义于 eosjs-jsonrpc.ts:85
原始调用 /v1/chain/get_block
参数:

名称
类型

block_num_or_id

number | string

返回:Promise<GetBlockResult>
get_block_header_state
get_block_header_state(block_num_or_id: number | string): Promise<any>
定义于 eosjs-jsonrpc.ts:79
原始调用 /v1/chain/get_block_header_state
参数:

名称
类型

block_num_or_id

number | string

返回:Promise<any>
get_code
get_code(account_name: string): Promise<GetCodeResult>
定义于 eosjs-jsonrpc.ts:91
原始调用 /v1/chain/get_code
参数:

名称
类型

account_name
string

返回:Promise<GetCodeResult>
get_currency_balance
get_currency_balance(code: string, account: string, symbol?: string): Promise<any>
定义于 eosjs-jsonrpc.ts:96
原始调用 /v1/chain/get_currency_balance
参数:

名称
类型
默认值

code
string

account
string

Default value symbol
string
null

返回:Promise<any>
get_currency_stats
get_currency_stats(code: string, symbol: string): Promise<any>
定义于 eosjs-jsonrpc.ts:101
原始调用 /v1/chain/get_currency_stats
参数:

名称
类型

code
string

symbol
string

返回:Promise<any>
get_info
get_info(): Promise<GetInfoResult>
定义于 eosjs-jsonrpc.ts:106
原始调用 /v1/chain/get_info
返回:Promise<GetInfoResult>
get_producer_schedule
get_producer_schedule(): Promise<any>
定义于 eosjs-jsonrpc.ts:111
原始调用 /v1/chain/get_producer_schedule
返回:Promise<any>
get_producers
get_producers(json?: boolean, lower_bound?: string, limit?: number): Promise<any>
定义于 eosjs-jsonrpc.ts:117
原始调用 /v1/chain/get_producers
参数:

名称
类型
默认值

Default value json
boolean
true

Default value lower_bound
string
“”

Default value limit
number
50

返回:Promise<any>
get_raw_code_and_abi
get_raw_code_and_abi(account_name: string): Promise<GetRawCodeAndAbiResult>
定义于 eosjs-jsonrpc.ts:123
原始调用 /v1/chain/get_raw_code_and_abi
参数:

名称
类型

account_name
string

返回:Promise<GetRawCodeAndAbiResult>
get_table_rows
get_table_rows(__namedParameters: object): Promise<any>
定义于 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<any>
history_get_actions
history_get_actions(account_name: string, pos?: number, offset?: number): Promise<any>
定义于 eosjs-jsonrpc.ts:186
原始调用 /v1/history/get_actions
参数:

名称
类型
默认值

account_name
string

Default value pos
number
null

Default value offset
number
null

返回:Promise<any>
history_get_controlled_accounts
history_get_controlled_accounts(controlling_account: string): Promise<any>
定义于 eosjs-jsonrpc.ts:204
原始调用 /v1/history/get_controlled_accounts
参数:

名称
类型

controlling_account
string

返回:Promise<any>
history_get_key_accounts
history_get_key_accounts(public_key: string): Promise<any>
定义于 eosjs-jsonrpc.ts:198
原始调用 /v1/history/get_key_accounts
参数:

名称
类型

public_key
string

返回:Promise<any>
history_get_transaction
history_get_transaction(id: string, block_num_hint?: number): Promise<any>
定义于 eosjs-jsonrpc.ts:192
原始调用 /v1/history/get_transaction
参数:

名称
类型
默认值

id
Uint8Array

Default value block_num_hint
number
null

返回:Promise<any>
push_transaction
push_transaction(__namedParameters: object): Promise<any>
定义于 eosjs-jsonrpc.ts:172
推送序列化交易。
参数:
__namedParameters:object

名称
类型

serializedTransaction
Uint8Array

signatures
string[]

返回:Promise<any>

上一篇:JS-Sig

退出移动版