web3-ronin-provider

web3-ronin-providerDocs


web3-ronin-provider / SkynetRESTProvider

Class: SkynetRESTProvider

This class implements the Skynet REST API.

To create a SkynetRESTProvider quickly, call createSkynetRESTProvider with the API key.
To customize headers, call the SkynetRESTProvider constructor with a tailored ConnectionInfo parameter.

Extends

Constructors

new SkynetRESTProvider()

new SkynetRESTProvider(connection): SkynetRESTProvider

Creates an instance of CustomSkynetProvider. Used by SkynetWeb3Provider and SkynetRESTProvider.

Parameters

connection: ConnectionInfo

The URL to use, headers, etc

Returns

SkynetRESTProvider

Throws

EEmptyHeaders when headers are present, but empty

Throws

EEmptyUrl when URL is empty

Throws

ENoApiKey when X-API-KEY is absent

Throws

ENoHeaders when headers are absent

Inherited from

CustomSkynetProvider.constructor

Defined in

src/web3-roninCustomSkynetProvider.ts:22

Accounts

get_Account_Activities()

get_Account_Activities(account_addr, body): Promise<get_Account_Activities_Response>

Get account activities on Ronin chain

Get an account’s activities on the Ronin chain (Transfers, Approvals, Mint, Burn, Marketplace, Deposit, Staking, Add/Remove Liquidity).

Parameters

account_addr: string

body: get_Account_Activities_Request_Body

Returns

Promise<get_Account_Activities_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:157


get_account_info_by_address()

get_account_info_by_address(account_addr): Promise<get_account_info_by_address_Response>

Get account info by address

Get an account’s information by its address.

Parameters

account_addr: string

Returns

Promise<get_account_info_by_address_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:174


search_wealthiest_accounts()

search_wealthiest_accounts(limit?, offset?): Promise<search_wealthiest_accounts_Response>

Search wealthiest accounts

Get the wealthiest accounts.

Parameters

limit?: number

offset?: string

Returns

Promise<search_wealthiest_accounts_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:192

Block

get_the_finalized_block_number()

get_the_finalized_block_number(): Promise<get_the_finalized_block_number_Response>

Get the finalized block number

Returns the most recent block that has been confirmed as final and that cannot be reverted, even by a reorg.

Returns

Promise<get_the_finalized_block_number_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:234


get_the_latest_block_number()

get_the_latest_block_number(): Promise<get_the_finalized_block_number_Response>

Get the latest block number

Returns the most recent block that has been added to the chain, but that can still be reverted by a reorg.

Returns

Promise<get_the_finalized_block_number_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:250

Blocks

get_blocks()

get_blocks(params?): Promise<get_blocks_Response>

Get blocks

If block_hash is present, always search by block_hash first. The block_number value must be positive. If there is no block_hash or block_number present, the API searches for all blocks. The limit and offset parameters are used to paginate results.

Parameters

params?: get_blocks_Param

optional query parameters

Returns

Promise<get_blocks_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:210

Contracts

get_contract_by_address()

get_contract_by_address(contractAddr): Promise<get_contract_by_address_Response>

Get contract by address

Get a contract by its address.

Parameters

contractAddr: string

Returns

Promise<get_contract_by_address_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:267

NFTs

get_multiple_NFTs()

get_multiple_NFTs(query): Promise<get_multiple_NFTs_Response>

Get multiple NFTs

Get multiple NFTs that matched the specified IDs.

Parameters

query: get_multiple_NFTs_Query

Returns

Promise<get_multiple_NFTs_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:302


get_summary_for_individual_NFT()

get_summary_for_individual_NFT(contractAddr, tokenId): Promise<get_summary_for_individual_NFT_Response>

Get summary for individual NFT

Get summarized information for an individual NFT.

Parameters

contractAddr: string

tokenId: number

Returns

Promise<get_summary_for_individual_NFT_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:285


get_summary_for_multiple_NFTs()

get_summary_for_multiple_NFTs(query): Promise<get_summary_for_multiple_NFTs_Response>

Get summary for multiple NFTs

Get summarized information for multiple NFTs.

Parameters

query: get_summary_for_multiple_NFTs_Query

Returns

Promise<get_summary_for_multiple_NFTs_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:353


search_for_matched_NFTs()

search_for_matched_NFTs(query): Promise<search_for_matched_NFTs_Response>

Search for matched NFTs

Search for NFTs that matched the specified search parameters.

Parameters

query: search_for_matched_NFTs_Query

Returns

Promise<search_for_matched_NFTs_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:336


search_for_NFTs_by_metadata_attributes()

search_for_NFTs_by_metadata_attributes(query): Promise<search_for_NFTs_by_metadata_attributes_Response>

DSearch for NFTs by metadata attributes

Search for NFTs that match the specified metadata attributes.

Parameters

query: search_for_NFTs_by_metadata_attributes_Query

Returns

Promise<search_for_NFTs_by_metadata_attributes_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:319

Other

connection

protected readonly connection: ConnectionInfo

Inherited from

CustomSkynetProvider.connection

Defined in

src/web3-roninCustomSkynetProvider.ts:10


concatUrl()

protected concatUrl(url, urlSuffix): string

Parameters

url: string

urlSuffix: string

Returns

string

Inherited from

CustomSkynetProvider.concatUrl

Defined in

src/web3-roninCustomSkynetProvider.ts:48


getRonin()

protected getRonin(urlSuffix, config?): Promise<AxiosResponse<any, any>>

Sends HTTP GET message to the service provider

Parameters

urlSuffix: string

config?: AxiosRequestConfig<any>

Returns

Promise<AxiosResponse<any, any>>

Async

Throws

EErrorCodeMessage

Overrides

CustomSkynetProvider.getRonin

Defined in

src/web3-RoninSkynetRESTProvider.ts:91


getRoninLimitCursor()

protected getRoninLimitCursor(url, limit?, cursor?): Promise<any>

Places a call to the service, with optional limits and cursor

Parameters

url: string

limit?: number

how many items can be return in a single response, maximum 200

cursor?: string

the current pointer of the result set, to iterate to the next part of the results, it’s returned by the previous call (nextCursor field), you get it and pass to the next call, present nextCursor means there will be more results to scroll, empty nextCursor means it reaches to the end of results

Returns

Promise<any>

Async

Inherited from

CustomSkynetProvider.getRoninLimitCursor

Defined in

src/web3-roninCustomSkynetProvider.ts:103


isErrorResponse()

protected isErrorResponse(e): boolean

Parameters

e: unknown

Returns

boolean

Inherited from

CustomSkynetProvider.isErrorResponse

Defined in

src/web3-roninCustomSkynetProvider.ts:44


postRonin()

protected postRonin(urlSuffix, data): Promise<AxiosResponse<any, any>>

Sends HTTP POST message to the service provider

Parameters

urlSuffix: string

data: any

Returns

Promise<AxiosResponse<any, any>>

Async

Throws

EErrorCodeMessage

Overrides

CustomSkynetProvider.postRonin

Defined in

src/web3-RoninSkynetRESTProvider.ts:122


search_token_transfers()

search_token_transfers(): Promise<void>

Returns

Promise<void>

Defined in

src/web3-RoninSkynetRESTProvider.ts:596


update_url()

protected update_url(url, limit?, offset?): string

Updates the url to include limit and cursors, if they’re provided.

Parameters

url: string

limit?: number

how many items can be return in a single response, maximum 200

offset?: string | number

Returns

string

Updated url if limit and cursors provided, otherwise, returns the parameter url.

Overrides

CustomSkynetProvider.update_url

Defined in

src/web3-RoninSkynetRESTProvider.ts:69


update_url_with_Params()

protected update_url_with_Params(url, params): string

Parameters

url: string

params: string | URLSearchParams

Returns

string

Inherited from

CustomSkynetProvider.update_url_with_Params

Defined in

src/web3-roninCustomSkynetProvider.ts:81

Supplies

get_circulating_RON_supply()

get_circulating_RON_supply(from?, to?): Promise<get_circulating_RON_supply_Response>

Get circulating RON supply

Get ronin circulating supply for RON. When getting by date range, both param from and to must be present, from and to must follow date format YYYY-MM-DD, for example ‘2023-10-29’. Max difference allowed between from and to 100 days.

Parameters

from?: string

YYYY-MM-DD

to?: string

YYYY-MM-DD

Returns

Promise<get_circulating_RON_supply_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:425


get_circulating_token_supply()

get_circulating_token_supply(symbol): Promise<get_circulating_token_supply_Response>

Get circulating token supply

Get the circulating supply for a token.

Parameters

symbol: string

Returns

Promise<get_circulating_token_supply_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:370


get_total_RON_supply()

get_total_RON_supply(): Promise<get_total_RON_supply_Response>

Get total RON supply

Get the total supply for RON.

Returns

Promise<get_total_RON_supply_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:467


get_total_token_supply()

get_total_token_supply(symbol): Promise<get_total_token_supply_Response>

Get total token supply

Get the total supply for the specified token.

Parameters

symbol: string

Returns

Promise<get_total_token_supply_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:407


query_RON_supply()

query_RON_supply(supply_type): Promise<number>

Query RON supply

Get the total supply or circulating supply for RON.

Parameters

supply_type: query_token_supply_Query

Returns

Promise<number>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:448


query_token_supply()

query_token_supply(symbol, supply_type): Promise<get_circulating_token_supply_Response>

Query token supply

Get the total supply or circulating supply for the specified token.

Parameters

symbol: string

supply_type: query_token_supply_Query

Returns

Promise<get_circulating_token_supply_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:388

Token balances

get_summary_of_token_balances()

get_summary_of_token_balances(query): Promise<get_summary_of_token_balances_Response>

Get summary of token balances

Get the summary of token balances for the specified owner address.

Parameters

query: get_summary_of_token_balances_Query

Returns

Promise<get_summary_of_token_balances_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:570


search_token_balances()

search_token_balances(query): Promise<search_token_balances_Response>

Search token balances

Search token balances.

Parameters

query: search_token_balances_Query

Returns

Promise<search_token_balances_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:553

Token transfers

list_token_transfers_by_timestamp()

list_token_transfers_by_timestamp(limit?, offset?): Promise<list_token_transfers_by_timestamp_Response>

List token transfers by timestamp

List token transfers ordered by timestamp.

Parameters

limit?: number

offset?: number

Returns

Promise<list_token_transfers_by_timestamp_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:588


list_token_transfers_by_transaction_hash()

list_token_transfers_by_transaction_hash(transaction_hashes): Promise<list_token_transfers_by_transaction_hash_Response>

List token transfers by transaction hash

List token transfers ordered by transaction hash.

Parameters

transaction_hashes: string[]

Returns

Promise<list_token_transfers_by_transaction_hash_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:613

Tokens

get_overview_for_tokens()

get_overview_for_tokens(contractAddresses): Promise<get_overview_for_tokens_Response>

Get overview for tokens

Get an overview for tokens that matched the specified contract addresses.

Parameters

contractAddresses: string[]

Returns

Promise<get_overview_for_tokens_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:518


get_token_by_address()

get_token_by_address(contractAddr): Promise<get_token_by_address_Response>

Get token by address

Get a token by its address.

Parameters

contractAddr: string

Returns

Promise<get_token_by_address_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:484


get_token_top_holders()

get_token_top_holders(contractAddr): Promise<get_token_top_holders_Response>

Get token’s top holders

Get the top holders of the specified token.

Parameters

contractAddr: string

Returns

Promise<get_token_top_holders_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:501


search_tokens()

search_tokens(query): Promise<search_tokens_Response>

Search tokens

Search tokens.

Parameters

query: search_tokens_Query

Returns

Promise<search_tokens_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:535

Transactions

get_daily_count_of_transactions()

get_daily_count_of_transactions(): Promise<get_daily_count_of_transactions_Response>

Get daily count of transactions

Get the daily count of transactions.

Returns

Promise<get_daily_count_of_transactions_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:684


get_multiple_transactions_by_hashes()

get_multiple_transactions_by_hashes(hashes): Promise<get_multiple_transactions_by_hashes_Response>

Get multiple transactions by hashes

Returns the details of multiple transactions by their hashes.

Parameters

hashes: string[]

Returns

Promise<get_multiple_transactions_by_hashes_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:665


get_transaction_by_hash()

get_transaction_by_hash(hash): Promise<get_transaction_by_hash_Response>

Get transaction by hash

Returns the details of an individual transaction by its hash.

Parameters

hash: string

Returns

Promise<get_transaction_by_hash_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:648


list_transactions()

list_transactions(limit?, offset?): Promise<list_transactions_Response>

List transactions

List transactions.

Parameters

limit?: number

offset?: number

Returns

Promise<list_transactions_Response>

Async

Defined in

src/web3-RoninSkynetRESTProvider.ts:631