Make RPC calls
Hierarchy
JsonRpc
Implements
Constructors
constructor
⊕ new JsonRpc(endpoint: string
, args?: object
): JsonRpc
Defined in eosjs-jsonrpc.ts:22
Parameters:
endpoint: string
Default value
args: object
fetch
:- browsers: leave
null
orundefined
- node: provide an implementation
- browsers: leave
Name | Type |
---|---|
Optional fetch |
function |
Returns: JsonRpc
Properties
endpoint
● endpoint: string
Defined in eosjs-jsonrpc.ts:21
fetchBuiltin
● fetchBuiltin: function
Defined in eosjs-jsonrpc.ts:22
Type declaration
▸(input?: Request
| string
, init?: RequestInit
): Promise
<Response
>
Parameters:
Name | Type |
---|---|
Optional input |
Request | string |
Optional init |
RequestInit |
Returns: Promise
<Response
>
Methods
db_size_get
▸ db_size_get(): Promise
<any
>
Defined in eosjs-jsonrpc.ts:182
Raw call to /v1/db_size/get
Returns: Promise
<any
>
fetch
▸ fetch(path: string
, body: any
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:42
Post body
to endpoint + path
. Throws detailed error information in RpcError
when available.
Parameters:
Name | Type |
---|---|
path | string |
body | any |
Returns: Promise
<any
>
getRawAbi
▸ getRawAbi(accountName: string
): Promise
<BinaryAbi>
Defined in eosjs-jsonrpc.ts:129
calls /v1/chain/get_raw_code_and_abi
and pulls out unneeded raw wasm code
Parameters:
Name | Type |
---|---|
accountName | string |
Returns: Promise
<BinaryAbi>
getRequiredKeys
▸ getRequiredKeys(args: AuthorityProviderArgs): Promise
<string
[]>
Defined in eosjs-jsonrpc.ts:164
Get subset of availableKeys
needed to meet authorities in transaction
. Implements AuthorityProvider
Parameters:
Name | Type |
---|---|
args | AuthorityProviderArgs |
Returns: Promise
<string
[]>
get_abi
▸ get_abi(account_name: string
): Promise
<GetAbiResult>
Defined in eosjs-jsonrpc.ts:67
Raw call to /v1/chain/get_abi
Parameters:
Name | Type |
---|---|
account_name | string |
Returns: Promise
<GetAbiResult>
get_account
▸ get_account(account_name: string
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:73
Raw call to /v1/chain/get_account
Parameters:
Name | Type |
---|---|
account_name | string |
Returns: Promise
<any
>
get_block
▸ get_block(block_num_or_id: number
| string
): Promise
<GetBlockResult>
Defined in eosjs-jsonrpc.ts:85
Raw call to /v1/chain/get_block
Parameters:
Name | Type |
---|---|
block_num_or_id | number | string |
Returns: Promise
<GetBlockResult>
get_block_header_state
▸ get_block_header_state(block_num_or_id: number
| string
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:79
Raw call to /v1/chain/get_block_header_state
Parameters:
Name | Type |
---|---|
block_num_or_id | number | string |
Returns: Promise
<any
>
get_code
▸ get_code(account_name: string
): Promise
<GetCodeResult>
Defined in eosjs-jsonrpc.ts:91
Raw call to /v1/chain/get_code
Parameters:
Name | Type |
---|---|
account_name | string |
Returns: Promise
<GetCodeResult>
get_currency_balance
▸ get_currency_balance(code: string
, account: string
, symbol?: string
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:96
Raw call to /v1/chain/get_currency_balance
Parameters:
Name | Type | Default value |
---|---|---|
code | string |
- |
account | string |
- |
Default value symbol |
string |
null |
Returns: Promise
<any
>
get_currency_stats
▸ get_currency_stats(code: string
, symbol: string
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:101
Raw call to /v1/chain/get_currency_stats
Parameters:
Name | Type |
---|---|
code | string |
symbol | string |
Returns: Promise
<any
>
get_info
▸ get_info(): Promise
<GetInfoResult>
Defined in eosjs-jsonrpc.ts:106
Raw call to /v1/chain/get_info
Returns: Promise
<GetInfoResult>
get_producer_schedule
▸ get_producer_schedule(): Promise
<any
>
Defined in eosjs-jsonrpc.ts:111
Raw call to /v1/chain/get_producer_schedule
Returns: Promise
<any
>
get_producers
▸ get_producers(json?: boolean
, lower_bound?: string
, limit?: number
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:117
Raw call to /v1/chain/get_producers
Parameters:
Name | Type | Default value |
---|---|---|
Default value json |
boolean |
true |
Default value lower_bound |
string |
"" |
Default value limit |
number |
50 |
Returns: Promise
<any
>
get_raw_code_and_abi
▸ get_raw_code_and_abi(account_name: string
): Promise
<GetRawCodeAndAbiResult>
Defined in eosjs-jsonrpc.ts:123
Raw call to /v1/chain/get_raw_code_and_abi
Parameters:
Name | Type |
---|---|
account_name | string |
Returns: Promise
<GetRawCodeAndAbiResult>
get_table_rows
▸ get_table_rows(__namedParameters: object
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:136
Raw call to /v1/chain/get_table_rows
Parameters:
__namedParameters: object
Name | Type | Default value |
---|---|---|
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 |
"" |
Returns: Promise
<any
>
history_get_actions
▸ history_get_actions(account_name: string
, pos?: number
, offset?: number
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:186
Raw call to /v1/history/get_actions
Parameters:
Name | Type | Default value |
---|---|---|
account_name | string |
- |
Default value pos |
number |
null |
Default value offset |
number |
null |
Returns: Promise
<any
>
history_get_controlled_accounts
▸ history_get_controlled_accounts(controlling_account: string
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:204
Raw call to /v1/history/get_controlled_accounts
Parameters:
Name | Type |
---|---|
controlling_account | string |
Returns: Promise
<any
>
history_get_key_accounts
▸ history_get_key_accounts(public_key: string
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:198
Raw call to /v1/history/get_key_accounts
Parameters:
Name | Type |
---|---|
public_key | string |
Returns: Promise
<any
>
history_get_transaction
▸ history_get_transaction(id: string
, block_num_hint?: number
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:192
Raw call to /v1/history/get_transaction
Parameters:
Name | Type | Default value |
---|---|---|
id | string |
- |
Default value block_num_hint |
number |
null |
Returns: Promise
<any
>
push_transaction
▸ push_transaction(__namedParameters: object
): Promise
<any
>
Defined in eosjs-jsonrpc.ts:172
Push a serialized transaction
Parameters:
__namedParameters: object
Name | Type |
---|---|
serializedTransaction | Uint8Array |
signatures | string [] |
Returns: Promise
<any
>