Config
Details about Mystiko configuration and related interfaces.
Data Structure
- MystikoConfig
- CircuitConfig
- ChainConfig
- BridgeConfig
- DepositContractConfig
- PoolContractConfig
- ContractConfig
Get
Get MystikoConfig
.
import mystiko from '@mystikonetwork/browser';
const mystikoConfig = mystiko.config;
RawMystikoConfig
data structure is as follows:
Property | Type | Description |
---|---|---|
version | string | Mystiko version. |
chains | RawChainConfig[] | Chain configs. |
bridges | Array<RawBridgeConfigType> | Bridge configs. |
gitRevision | string | Git revision. |
circuits | RawCircuitConfig[] | Circuit configs. |
indexer | RawIndexerConfig | Indexer config. |
sequencer | RawSequencerConfig | Sequencer config. |
packer | RawPackerConfig | Packer config. |
screening | RawScreeningConfig | Screening config. |
countryBlacklist | string[] | Country blacklist config. |
RawCircuitConfig
RawCircuitConfig
data structure is as follows:
Property | Type | Description |
---|---|---|
name | string | Circuit name. |
type | CircuitType | Circuit type. |
isDefault | boolean | Is default circuit. |
programFile | string[] | Program files. |
programFileChecksum | string | Program files checksum. |
abiFile | string[] | ABI files. |
abiFileChecksum | string | ABI files checksum |
provingKeyFile | string[] | Proving key files. |
provingKeyFileChecksum | string[] | Proving key files checksum. |
verifyingKeyFile | string[] | Verifying key files. |
verifyingKeyFileChecksum | string | Verifying key files checksum. |
getDefaultCircuitConfig
Get default circuit config by circuit type.
import mystiko from '@mystikonetwork/browser';
import { CircuitType } from '@mystikonetwork/config';
const circuitConfig = mystiko.config?.getDefaultCircuitConfig(CircuitType.ROLLUP1);
List of supported CircuitType
:
enum CircuitType {
ROLLUP1 = "rollup1",
ROLLUP2 = "rollup2",
ROLLUP4 = "rollup4",
ROLLUP8 = "rollup8",
ROLLUP16 = "rollup16",
ROLLUP32 = "rollup32",
ROLLUP64 = "rollup64",
ROLLUP128 = "rollup128",
ROLLUP256 = "rollup256",
ROLLUP512 = "rollup512",
ROLLUP1024 = "rollup1024",
TRANSACTION1x0 = "transaction1x0",
TRANSACTION1x1 = "transaction1x1",
TRANSACTION1x2 = "transaction1x2",
TRANSACTION2x0 = "transaction2x0",
TRANSACTION2x1 = "transaction2x1",
TRANSACTION2x2 = "transaction2x2"
}
getCircuitConfigByName
Get circuit config by circuit name.
import mystiko from '@mystikonetwork/browser';
const circuitConfig = mystiko.config?.getCircuitConfigByName('zokrates-1.0-rollup1');
RawChainConfig
RawChainConfig
data structure is as follows:
Property | Type | Description |
---|---|---|
chainId | number | Chain id. |
name | string | Chain name. |
assetSymbol | string | Native asset symbol. |
assetSymbolAlias | string | Asset symbol alias. |
assetDecimals | number | Native asset decimals. |
explorerUrl | string | Explorer URL. |
explorerApiUrl | string | Explorer API URL. |
explorerPrefix | string | Explorer prefix. |
providerQuorumPercentage | number | Provider quorum percentage. |
signerEndpoint | string | Signer endpoint. |
eventDelayBlocks | number | Event delay blocks. |
eventFilterSize | number | Event filter size. |
indexerFilterSize | number | Event filter size. |
sequencerFetchSize | number | Sequencer fetch size. |
safeConfirmations | number | safe confirm block count. |
providerType | ProviderType | Provider type. |
depositContracts | RawDepositContractConfig[] | Deposit contract configs map, key is deposit contract address. |
poolContracts | RawPoolContractConfig[] | Pool contract configs map, key is pool contract address. |
recommendedAmounts | string[] | Recommended amounts. |
providers | RawProviderConfig[] | Provider configs. |
granularities | number[] | Granularities. |
getChainConfig
Get chain config by chain id.
import mystiko from '@mystikonetwork/browser';
const chainConfig = mystiko.config?.getChainConfig(number(97));
getPeerChainConfigs
Get peer chains by chain id.
import mystiko from '@mystikonetwork/browser';
const chainConfigs = mystiko.config?.getPeerChainConfigs(number(11155111));
getAssetSymbols
Get asset symbols by chain id and peer chain id.
import mystiko from '@mystikonetwork/browser';
const assetSymbols = mystiko.config?.getAssetSymbols(number(97), number(11155111));
getBridges
Get bridge type by chain id, peer chain id and asset symbol.
import mystiko from '@mystikonetwork/browser';
const bridges = mystiko.config?.getBridges(number(97), number(11155111), 'MTT');
getBridgeConfig
Get bridge config by bridge type.
import mystiko from '@mystikonetwork/browser';
import { BridgeType } from '@mystikonetwork/config';
const bridgeConfig = mystiko.config?.getBridgeConfig(BridgeType.TBRIDGE);
List of supported BridgeType
:
enum BridgeType {
LOOP = "loop",
POLY = "poly",
TBRIDGE = "tbridge",
CELER = "celer",
LAYER_ZERO = "layerZero",
AXELAR = "axelar",
WORMHOLE = "wormhole"
}
RawDepositContractConfig
RawDepositContractConfig
data structure is as follows:
Property | Type | Description |
---|---|---|
version | number | Deposit Contract Version. |
name | string | Contract name. |
address | string | Contract address. |
poolAddress | string | Pool contract address. |
disabledAt | number | Block height that contract had been disabled. |
eventFilterSize | number | event filter size. |
indexerFilterSize | number | indexer filter size. |
startBlock | number | Start block. |
minAmount | string | Minimum amount. |
maxAmount | string | Maximum amount. |
bridgeType | BridgeType | Bridge type. |
type | ContractType | Contract type. |
minBridgeFee | string | Minimum bridge fee. |
minExecutorFee | string | Minimum executor fee. |
serviceFee | number | Service fee. |
serviceFeeDivider | number | Service fee divider. |
peerChainId | number | Peer chain id. |
peerContractAddress | string | Peer contract address. |
bridgeFeeAssetAddress | string | bridge fee asset address. |
executorFeeAssetAddress | string | executor fee asset address. |
getDepositContractConfig
Get deposit contract config by chain id, peer chain id, asset symbol and bridge type.
import mystiko from '@mystikonetwork/browser';
import { BridgeType } from '@mystikonetwork/config';
const depositContractConfig = mystiko.config?.getDepositContractConfig(
number(11155111),
number(97),
'MTT',
BridgeType.TBRIDGE,
);
getDepositContractConfigByAddress
Get deposit contract config by chain id and deposit contract address.
import mystiko from '@mystikonetwork/browser';
const depositContractConfig = mystiko.config?.getDepositContractConfigByAddress(
number(11155111),
'0x643DD956aC516808538BF979b8440AbcebC3bcdA',
);
PoolContractConfig
PoolContractConfig
data structure is as follows:
Property | Type | Description |
---|---|---|
version | number | Pool Contract Version. |
name | string | Contract name. |
address | string | Contract address. |
disabledAt | number | Block height that contract had been disabled. |
eventFilterSize | number | event filter size. |
indexerFilterSize | number | indexer filter size. |
startBlock | number | Start block. |
poolName | string | Pool name. |
minRollupFee | string | Minimum rollup fee. |
type | ContractType | Contract type. |
bridgeType | BridgeType | Bridge type. |
assetAddress | string | Asset address. |
circuits | string[] | Circuits. |
getPoolContractConfig
Get pool contract config by chain id, asset symbol, bridge type and version.
import mystiko from '@mystikonetwork/browser';
import { BridgeType } from '@mystikonetwork/config';
const poolContractConfig = mystiko.config?.getPoolContractConfig(number(11155111), 'MTT', BridgeType.TBRIDGE, 6);
getPoolContractConfigs
Get pool contracts by chain id, asset symbol and bridge type.
import mystiko from '@mystikonetwork/browser';
import { BridgeType } from '@mystikonetwork/config';
const poolContractConfig = mystiko.config?.getPoolContractConfigs(number(11155111), 'MTT', BridgeType.TBRIDGE);
getPoolContractConfigByAddress
Get pool contract config by chain id and pool contract address.
import mystiko from '@mystikonetwork/browser';
const poolContractConfig = mystiko.config?.getPoolContractConfigByAddress(
number(11155111),
'0xAE77941b3bd4d2293E13A9a69E64A0ACFf5bBC55',
);
getTransactionUrl
Get transaction url by chain id and transaction hash.
import mystiko from '@mystikonetwork/browser';
const txWithUrl = mystiko.config?.getTransactionUrl(number(11155111), '0x1803ef0489ec2bda0abb7f564fa795959c0d1f4db7651236e34f879b317c074a');