eosjs 文档(JSON-RPC)

JSON-RPC

  • JsonRpc
函数
  • arrayToHex

函数

arrayToHex

arrayToHex(data: Uint8Array): string

定义于eosjs-jsonrpc.ts:11

参数:

名称类型
dataUint8Array

返回:string

JsonRpc

实现接口
  • AuthorityProvider
  • AbiProvider

构造函数

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

定义于eosjs-jsonrpc.ts:22

参数:

endpoint:string
Default value args:object

  • fetch

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

返回: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
(可选的)initRequestInit

返回: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

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

参数:

名称类型
pathstring
bodyany

返回:Promise<any>

getRawAbi
getRawAbi(accountName: string): Promise<BinaryAbi>

定义于eosjs-jsonrpc.ts:129

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

参数:

名称类型
accountNamestring

返回:Promise<BinaryAbi>

getRequiredKeys
getRequiredKeys(args: AuthorityProviderArgs): Promise<string[]>

定义于eosjs-jsonrpc.ts:164

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

参数:

名称类型
argsAuthorityProviderArgs

返回:Promise<string[]>

get_abi
get_abi(account_name: string): Promise<GetAbiResult>

定义于eosjs-jsonrpc.ts:67

原始调用/v1/chain/get_abi

参数:

名称类型
account_namestring

返回:Promise<GetAbiResult>

get_account
get_account(account_name: string): Promise<any>

定义于eosjs-jsonrpc.ts:73

原始调用/v1/chain/get_account

参数:

名称类型
account_namestring

返回: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_namestring

返回: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

参数:

名称类型默认值
codestring-
accountstring-
Default value symbolstringnull

返回:Promise<any>

get_currency_stats
get_currency_stats(code: string, symbol: string): Promise<any>

定义于eosjs-jsonrpc.ts:101

原始调用/v1/chain/get_currency_stats

参数:

名称类型
codestring
symbolstring

返回: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 jsonbooleantrue
Default value lower_boundstring""
Default value limitnumber50

返回: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_namestring

返回:Promise<GetRawCodeAndAbiResult>

get_table_rows
get_table_rows(__namedParameters: object): Promise<any>

定义于eosjs-jsonrpc.ts:136

原始调用/v1/chain/get_table_rows

参数:

__namedParameters:object

名称类型默认值
codeany-
index_positionany1
jsonanytrue
key_typeany""
limitany10
lower_boundany""
scopeany-
tableany-
table_keyany""
upper_boundany""

返回: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_namestring-
Default value posnumbernull
Default value offsetnumbernull

返回: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_accountstring

返回: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_keystring

返回:Promise<any>

history_get_transaction
history_get_transaction(id: string, block_num_hint?: number): Promise<any>

定义于eosjs-jsonrpc.ts:192

原始调用/v1/history/get_transaction

参数:

名称类型默认值
idUint8Array-
Default value block_num_hintnumbernull

返回:Promise<any>

push_transaction
push_transaction(__namedParameters: object): Promise<any>

定义于eosjs-jsonrpc.ts:172

推送序列化交易。

参数:

__namedParameters:object

名称类型
serializedTransactionUint8Array
signaturesstring[]

返回:Promise<any>


上一篇:JS-Sig
下一篇:Numeric
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值