@xswap-link/sdk
Version:
JavaScript SDK for XSwap platform
76 lines (70 loc) • 3.3 kB
text/typescript
import { PublicKey } from "@solana/web3.js";
import { Ecosystem } from "@src/models";
import { constants } from "ethers";
export const SOLANA_NATIVE_TOKEN_ADDRESS = new PublicKey(
"So11111111111111111111111111111111111111112",
);
export const SOLANA_TOKEN_PROGRAM_ID = new PublicKey(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
);
export const SOLANA_TOKEN_2022_PROGRAM_ID = new PublicKey(
"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
);
export const CCIP_ROUTER_PROGRAM_ID = new PublicKey(
"Ccip842gzYHhvdDkSyi2YVCoAWPbYJoApMFzSxQroE9C",
);
export const FEE_QUOTER_PROGRAM_ID = new PublicKey(
"FeeQPGkKDeRV1MgoYfMH6L8o3KeuYjwUZrgn4LRKfjHi",
);
export const LINK_TOKEN_MINT = new PublicKey(
"LinkhB3afbBKb2EQQu7s7umdZceV3wcvAUJhQAfQ23L",
);
export const SYSTEM_PROGRAM_ID = new PublicKey(
"11111111111111111111111111111111",
);
export const PROGRAM_ID = new PublicKey(
"52XvWQKuZHRjnR7qHsEGE532jqgQ3MBiBMgVkBowP1LD",
);
export const RMN_REMOTE_PROGRAM_ID = new PublicKey(
"RmnXLft1mSEwDgMKu2okYuHkiazxntFFcZFrrcXxYg7",
);
export const METADATA_PROGRAM_ID =
"metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";
export const SOLANA_MAINNET_RPC_URL =
"https://orbital-thrilling-water.solana-mainnet.quiknode.pro/6b4a6d73d2cbe0590ce45bad3b375b183acef83f/";
export const JUPITER_V6_PROGRAM_ID = new PublicKey(
"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
);
export const DEPLOYER_ADDRESS = "0x8ebD04b2fbA00418Be00329146837dcE51F02c00";
export const DEFAULT_ECOSYSTEM = Ecosystem.EVM;
export const NUMBER_INPUT_REGEX = /^[0-9]*[.,]?[0-9]*$/;
export const SLIPPAGE_PRESETS: number[] = [0.5, 1.5, 3.0];
export const DELIVERY_TIME = 30 * 1000 * 60;
export const EXPRESS_DELIVERY_TIME = 30 * 1000;
export const EXPRESS_DELIVERY_LIMIT = 1000; // USD
export const BALANCES_CHUNK_SIZE = 500;
export const ROUTE_TIMEOUT_MS = 10000;
export const MINIMUM_DISPLAYED_TOKEN_AMOUNT = 0.0001;
export const DEFAULT_SOURCE_CHAIN_ID = "1";
export const DEFAULT_SOURCE_TOKEN_ADDR = constants.AddressZero;
export const DEFAULT_DESTINATION_CHAIN_ID = "1";
export const DEFAULT_DESTINATION_TOKEN_ADDR =
"0x8fe815417913a93ea99049fc0718ee1647a2a07c"; // XSWAP token
export const CCIP_EXPLORER = "https://ccip.chain.link/";
export const TX_RECEIPT_STATUS_LIFETIME = 60000;
export const DEFAULT_REQUEST_ABORT_MSG = "Request deprecated";
export const FALLBACK_CROSSCHAIN_ESTIMATION_TIME = 30 * 60 * 1000;
export const TOTAL_QUESTS_COUNT = 2;
export const XSWAP_STAKING_CHAIN_ID = "8453";
export const GAS_LIMIT_MULTIPLIER = 1.1;
export const MSG_SENT_EVENT_SIG =
"MessageSent(bytes32,uint64,address,bytes,address,uint256,uint256,address,uint256)";
export const MSG_SENT_EVENT_ABI = [
"event MessageSent(bytes32 indexed messageId, uint64 indexed destinationChainSelector, address indexed sender, bytes data, address token, uint256 tokenAmount, uint256 valueForInstantCcipRecieve, address transferedToken, uint256 transferedTokenAmount)",
];
export const MSG_RECEIVED_EVENT_SIG =
"MessageReceived(bytes32,uint64,address,bytes,address,uint256)";
export const MSG_RECEIVED_EVENT_ABI = [
"event MessageReceived(bytes32 indexed messageId, uint64 indexed sourceChainSelector, address indexed sender, bytes data, address token, uint256 tokenAmount)",
];
export * from "./crosschainEstimationTimes";