Make RPC calls
Hierarchy
JsonRpc
Implements
Constructors
constructor
⊕ new JsonRpc(endpoint: string, args?: object): JsonRpc
Defined in eosjs2-jsonrpc.ts:101
Parameters:
| Param | Type | Default value | Description |
|---|---|---|---|
| endpoint | string |
- | |
Default value args |
object |
{} | `fetch`: browsers: leave `null` or `undefined`* node: provide an implementation |
Returns: JsonRpc
Properties
endpoint
● endpoint: string
Defined in eosjs2-jsonrpc.ts:100
fetchBuiltin
● fetchBuiltin: function
Defined in eosjs2-jsonrpc.ts:101
Type declaration
▸(input?: Request | string, init?: RequestInit): Promise<Response>
Parameters:
| Param | Type |
|---|---|
Optional input |
Request | string |
Optional init |
RequestInit |
Returns: Promise<Response>
Methods
db_size_get
▸ db_size_get(): Promise<any>
Defined in eosjs2-jsonrpc.ts:248
Raw call to /v1/db_size/get
Returns: Promise<any>
fetch
▸ fetch(path: string, body: any): Promise<any>
Defined in eosjs2-jsonrpc.ts:121
Post body to endpoint + path. Throws detailed error information in RpcError when available.
Parameters:
| Param | Type |
|---|---|
| path | string |
| body | any |
Returns: Promise<any>
getRequiredKeys
▸ getRequiredKeys(args: AuthorityProviderArgs): Promise<string[]>
Defined in eosjs2-jsonrpc.ts:230
Get subset of availableKeys needed to meet authorities in transaction. Implements AuthorityProvider
Parameters:
| Param | Type |
|---|---|
| args | AuthorityProviderArgs |
Returns: Promise<string[]>
get_abi
▸ get_abi(account_name: string): Promise<GetAbiResult>
Defined in eosjs2-jsonrpc.ts:146
Raw call to /v1/chain/get_abi
Parameters:
| Param | Type |
|---|---|
| account_name | string |
Returns: Promise<GetAbiResult>
get_account
▸ get_account(account_name: string): Promise<any>
Defined in eosjs2-jsonrpc.ts:152
Raw call to /v1/chain/get_account
Parameters:
| Param | Type |
|---|---|
| account_name | string |
Returns: Promise<any>
get_block
▸ get_block(block_num_or_id: number | string): Promise<GetBlockResult>
Defined in eosjs2-jsonrpc.ts:164
Raw call to /v1/chain/get_block
Parameters:
| Param | 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 eosjs2-jsonrpc.ts:158
Raw call to /v1/chain/get_block_header_state
Parameters:
| Param | Type |
|---|---|
| block_num_or_id | number | string |
Returns: Promise<any>
get_code
▸ get_code(account_name: string): Promise<GetCodeResult>
Defined in eosjs2-jsonrpc.ts:170
Raw call to /v1/chain/get_code
Parameters:
| Param | Type |
|---|---|
| account_name | string |
Returns: Promise<GetCodeResult>
get_currency_balance
▸ get_currency_balance(code: string, account: string, symbol?: string): Promise<any>
Defined in eosjs2-jsonrpc.ts:175
Raw call to /v1/chain/get_currency_balance
Parameters:
| Param | 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 eosjs2-jsonrpc.ts:180
Raw call to /v1/chain/get_currency_stats
Parameters:
| Param | Type |
|---|---|
| code | string |
| symbol | string |
Returns: Promise<any>
get_info
▸ get_info(): Promise<GetInfoResult>
Defined in eosjs2-jsonrpc.ts:185
Raw call to /v1/chain/get_info
Returns: Promise<GetInfoResult>
get_producer_schedule
▸ get_producer_schedule(): Promise<any>
Defined in eosjs2-jsonrpc.ts:190
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 eosjs2-jsonrpc.ts:196
Raw call to /v1/chain/get_producers
Parameters:
| Param | 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 eosjs2-jsonrpc.ts:202
Raw call to /v1/chain/get_raw_code_and_abi
Parameters:
| Param | Type |
|---|---|
| account_name | string |
Returns: Promise<GetRawCodeAndAbiResult>
get_table_rows
▸ get_table_rows(__namedParameters: object): Promise<any>
Defined in eosjs2-jsonrpc.ts:207
Raw call to /v1/chain/get_table_rows
Parameters:
| Param | Type |
|---|---|
| __namedParameters | object |
Returns: Promise<any>
history_get_actions
▸ history_get_actions(account_name: string, pos?: number, offset?: number): Promise<any>
Defined in eosjs2-jsonrpc.ts:252
Raw call to /v1/history/get_actions
Parameters:
| Param | 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 eosjs2-jsonrpc.ts:270
Raw call to /v1/history/get_controlled_accounts
Parameters:
| Param | Type |
|---|---|
| controlling_account | string |
Returns: Promise<any>
history_get_key_accounts
▸ history_get_key_accounts(public_key: string): Promise<any>
Defined in eosjs2-jsonrpc.ts:264
Raw call to /v1/history/get_key_accounts
Parameters:
| Param | Type |
|---|---|
| public_key | string |
Returns: Promise<any>
history_get_transaction
▸ history_get_transaction(id: string, block_num_hint?: number): Promise<any>
Defined in eosjs2-jsonrpc.ts:258
Raw call to /v1/history/get_transaction
Parameters:
| Param | 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 eosjs2-jsonrpc.ts:238
Push a serialized transaction
Parameters:
| Param | Type |
|---|---|
| __namedParameters | object |
Returns: Promise<any>