JS SDK Types

Symbiosis JS SDK Types

Checklist Before Going to Production (Mainnet)

Types

Symbiosis JS SDK defines the following types:

Type
Use

ChainId

Lists identifiers of supported blockchains.

ChainConfig

Defines the network configuration for building cross-chain routes.

OmniPoolConfig

Defines an Octopool containing sTokens. For more information on Octopools, see Symbiosis Octopools

AdvisorConfig and Config

Defines details of the Microservice Advisor. For more information on Advisor, seeSymbiosis & Fees

TokenConstructor

Specifies parameters for creating an instance of the Token class.

PendingRequestState and PendingRequest

Used for reverting stuck cross-chain operations.

ChainId type

The ChainId type lists named constants that represent integer identifiers for supported blockchains.

Example:

ChainConfig type

The ChainConfig type defines the network configuration used to build cross-chain routes.

Example:

Where:

Property
Description

id

The identifier of the blockchain.

rpc

The HTTP RPC endpoint of the blockchain. Used to retrieve information about liquidity pools' reserves for this blockchain.

dexFee

The liquidity provider fee for the selected DEX, expressed as an integer value. For example, 30 represents a fee of 0.3%.

filterBlockOffset

The range of blocks used to retrieve logs from the blockchain. Used for:

  1. Getting a list of stuck transactions.

  2. Checking the status of current cross-chain swap, bridging, or reverting operations.

stables

The list of stablecoins used to build cross-chain routes. This list should include at least one stablecoin of this blockchain and N sToken that connect this blockchain to others.

router

The address of a DEX router for this blockchain. For example, UniSwap for Ethereum.

metaRouter

The address of the Metarouter contract. ------------------ IMPORTANT: The metaRouter contract can only interact with ERC20 tokens approved by the metaRouterGateway contract. Do not approve ERC20 tokens directly for the metaRouter contract. ------------------ For more information, see Symbiosis Routing Contracts

metaRouterGateway

The address of the MetarouterGateway contract.

multicallRouterGateway

The address of the MulticallRouter contract.

bridge

The address of the BridgeV2 contract. ------------------ For more information, see Symbiosis Routing Contracts

synthesis

The address of the Synthesis contract. ------------------ For more information, see Symbiosis Routing Contracts

portal

The address of the Portal contract. ------------------ For more information, see Symbiosis Routing Contracts

fabric

The address of the Fabric contract that stores a list of {sToken <-> Token} pairs.

waitForBlocksCount

The number of blocks for the destination blockchain to wait for a transaction to be mined.

OmniPoolConfig type

The OmniPoolConfig type defines an Octopool.

Example:

AdvisorConfig and Config types

The AdvisorConfig and Config types define details of the Advisor service.

For more information on Advisor, see Symbiosis & Fees

AdvisorConfig type

This type contains the address of the Advisor service.

Config type

This type defines the configuration for the Advisor service.

Property
Description

advisor

The configuration to access the Advisor service.

chains

The list of networks' configurations.

minSwapAmountInUsd

The minimum sum of cross-chain swap in the USD equivalent.

maxSwapAmountInUsd

The maximal sum of cross-chain swap in the USD equivalent.

omniPool

The Octopool config.

TokenConstructor type

The TokenConstructor type defines parameters for creating an instance of the Token class.

Where:

Property
Description

name

The full name of the cryptocurrency.

symbols

The ticker symbol of the cryptocurrency (e.g., BTC, ETH).

address

The cryptocurrency address.

decimals

The number of decimal places supported by the cryptocurrency.

isNative

A flag indicating whether the cryptocurrency is native to the blockchain or is an ERC20 token.

isStable

A flag indicating whether the cryptocurrency is a stablecoin used in cross-chain swaps.

chainFromId

The identifier of the blockchain network where the cryptocurrency (or sToken) originated.

icons

A list of icon URLs or paths associated with the cryptocurrency for UI purposes.

userToken

A flag indicating whether the cryptocurrency was manually added by a user.

Example:

PendingRequestState and PendingRequest types

The PendingRequestState and PendingRequest types are used for reverting stuck cross-chain operations.

For more information, see Symbiosis & Emergencies

Example:

Where:

Property
Description

fromTokenAmount

The amount of tokens of the stuck cross-chain operation.

transactionHash

The hash of the transaction associated with the stuck operation.

state

The current state of the revert operation:

  1. Default: No attempt to revert the operation was made.

  2. Reverted: An attempt to revert the operation was made.

internalId

The internal identifier of the cross-chain operation.

externalId

The external identifier of the cross-chain operation. The identifier is derived from the internalId and calculated together with the destination network id, the destination contract address, and the address that revert this transaction.

type

The type of the operation:

  1. burn: The operation burns sTokens,

  2. synthesize: The operation mints sTokens.

from

The sender's address.

to

The recipient's address.

revertableAddress

The address authorized to perform a revert operation for the stuck transaction.

chainIdFrom

The identifier of the source blockchain.

chainIdTo

The identifier of the destination blockchain.

revertChainId

The identifier of the blockchain where the revert transaction will be sent.

Last updated