@akashicpay/sdk
Version:
SDK to interact with the Akashic ecosystem
189 lines • 6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NetworkDictionary = exports.SOL_REGEX = exports.TRX_REGEX = exports.ETH_REGEX = void 0;
const types_1 = require("./types");
const ETH_DECIMAL = 18;
const TRX_DECIMAL = 6;
exports.ETH_REGEX = {
address: /^0x[A-Fa-f\d]{40}$/,
hash: /^0x([A-Fa-f\d]{64})$/,
signedTxn: /0x[a-f\d]*/,
};
exports.TRX_REGEX = {
address: /^T[A-Za-z1-9]{33}$/,
hash: /^[\da-f]{64}$/,
signedTxn: /^[\da-f]{64}$/,
};
exports.SOL_REGEX = {
address: /^[1-9A-HJ-NP-Za-km-z]{32,44}$/,
hash: /^[1-9A-HJ-NP-Za-km-z]{87,88}$/,
signedTxn: /^[1-9A-HJ-NP-Za-km-z]+$/,
};
const SOL_DECIMAL = 9;
exports.NetworkDictionary = {
[types_1.NetworkSymbol.Ethereum_Mainnet]: {
regex: exports.ETH_REGEX,
nativeCoin: {
decimal: ETH_DECIMAL,
symbol: 'ETH',
displayName: 'ETH',
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (ETH)',
contract: '0xdac17f958d2ee523a2206206994597c13d831ec7',
decimal: 6,
},
{
symbol: types_1.TokenSymbol.USDC,
displayName: 'USDC (ETH)',
contract: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
decimal: 6,
},
],
},
[types_1.NetworkSymbol.Ethereum_Sepolia]: {
regex: exports.ETH_REGEX,
nativeCoin: {
decimal: ETH_DECIMAL,
symbol: 'SEP',
displayName: 'Sepolia-ETH',
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (Sepolia-ETH)',
contract: '0xa62be7ec09f56a813f654a9ac1aa6d29d96f604e',
decimal: 6,
},
{
symbol: types_1.TokenSymbol.USDC,
displayName: 'USDC (SEP)',
contract: '0x92ac12b566954e3d0e966cca7c9ddc44ca80ae29',
decimal: 6,
},
],
},
[types_1.NetworkSymbol.Binance_Smart_Chain_Mainnet]: {
regex: exports.ETH_REGEX,
nativeCoin: {
decimal: ETH_DECIMAL,
symbol: types_1.NetworkSymbol.Binance_Smart_Chain_Mainnet,
displayName: types_1.NetworkSymbol.Binance_Smart_Chain_Mainnet,
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (BNB)',
contract: '0x55d398326f99059ff775485246999027b3197955',
decimal: 18,
},
{
symbol: types_1.TokenSymbol.USDC,
displayName: 'USDC (BNB)',
contract: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
decimal: 18,
},
],
},
[types_1.NetworkSymbol.Binance_Smart_Chain_Testnet]: {
regex: exports.ETH_REGEX,
nativeCoin: {
decimal: ETH_DECIMAL,
symbol: types_1.NetworkSymbol.Binance_Smart_Chain_Testnet,
displayName: 'BNB-Test',
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (BNB-Test)',
contract: '0xa62be7ec09f56a813f654a9ac1aa6d29d96f604e',
decimal: 18,
},
{
symbol: types_1.TokenSymbol.USDC,
displayName: 'USDC (BNB-Test)',
contract: '0x9114eb6b5d281ae405c23082cf56043dac280cba',
decimal: 18,
},
],
},
[types_1.NetworkSymbol.Tron]: {
regex: exports.TRX_REGEX,
nativeCoin: {
symbol: 'TRX',
displayName: 'TRX',
decimal: TRX_DECIMAL,
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (TRX)',
contract: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
decimal: 6,
},
],
},
[types_1.NetworkSymbol.Tron_Shasta]: {
regex: exports.TRX_REGEX,
nativeCoin: {
symbol: 'tTRX',
displayName: 'TRX',
decimal: TRX_DECIMAL,
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (Shasta-TRX)',
contract: 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs',
decimal: 6,
},
],
},
[types_1.NetworkSymbol.Solana]: {
regex: exports.SOL_REGEX,
nativeCoin: {
decimal: SOL_DECIMAL,
symbol: 'SOL',
displayName: 'SOL',
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (SOL)',
contract: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
decimal: 6,
},
{
symbol: types_1.TokenSymbol.USDC,
displayName: 'USDC (SOL)',
contract: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
decimal: 6,
},
],
},
[types_1.NetworkSymbol.Solana_Devnet]: {
regex: exports.SOL_REGEX,
nativeCoin: {
decimal: SOL_DECIMAL,
symbol: types_1.NetworkSymbol.Solana_Devnet,
displayName: 'tSOL',
},
tokens: [
{
symbol: types_1.TokenSymbol.USDT,
displayName: 'USDT (tSOL)',
contract: '6krZNyyrvgN1XdvLVZwoAY4UvZxgiYVLtJwLYt43GHym',
decimal: 6,
},
{
symbol: types_1.TokenSymbol.USDC,
displayName: 'USDC (tSOL)',
contract: '7gZkdXQcNzfw4eDJvgN4XuPxBnsf2AyRnjga4XQ7ber8',
decimal: 6,
},
],
},
};
//# sourceMappingURL=l1Network.js.map