import { ethers } from 'ethers' import { BaseProject } from './base' export const swanChain = { id: 254, name: 'SwanChain', nativeCurrency: { name: 'sETH', symbol: 'sETH', decimals: 18, }, rpcUrls: { default: { http: ['https://mainnet-rpc-02.swanchain.org'] }, }, blockExplorers: { default: { name: 'swan chain', url: 'https://mainnet-explorer.swanchain.io', }, }, } export const swanTestnetChain = { id: 20241133, name: 'SwanChain_testnet', nativeCurrency: { name: 'sETH', symbol: 'sETH', decimals: 18, }, rpcUrls: { default: { http: ['https://rpc-proxima.swanchain.io'] }, }, blockExplorers: { default: { name: 'swan proxima', url: 'https://proxima-explorer.swanchain.io', }, }, testnet: true, } export const swanContract = { core: '0x2695139B24887B91d4707dBe438EdCAA1F190EFc', delegationPool: '0x4B95d5a42e9b82caFd009BbFe92301866B0951a3', pToken: '0x00313eAC7eDC05412749bd65422B0Cb1fd4632E1', miningToken: '0xBb4eC1b56cB624863298740Fd264ef2f910d5564', dataHelper: '0x12B7859BF6FaA171361393CF71dd7c0F5171855A', } export const swanTestnetContract = { core: '0x3221692610f82268525154c84B1F2eC6fFEe20F0', delegationPool: '0xae23361975FB0288F601BC7dFf7BCb6e95240b83', pToken: '0xba8FD0d434F17e4d14E52994194A9E34c4A2E931', miningToken: '0x705C25BD254E6Bc1DC5A7e26B84230E9d7192c6a', dataHelper: '0xB550709b8717F63b5EECe0C7CF488303c665d57b', } export class SwanProject extends BaseProject { name = 'Swan' thawingEnabled = false miningToken = { name: 'SWAN', symbol: 'SWAN', decimals: 18, isNative: false, icon: 'https://d135ugxgwtnu1c.cloudfront.net/swan-b3bab497.svg', } pToken = { name: 'pSWAN', symbol: 'pSWAN', decimals: 18, icon: 'https://d135ugxgwtnu1c.cloudfront.net/swan-b3bab497.svg', } chainConfig = swanChain contracts: { core: string delegationPool: string pToken: string miningToken: string dataHelper: string } metadata = { guideLink: 'https://docs.parasail.network/delegation-guides/guide-for-swan-users', website: 'https://www.swanchain.io', description: 'SwanChain is the first AI Super Chain dedicated to decentralized AI computing and development. Leveraging OP Super chain technology, Swan Chain integrates Web3 and AI by providing a comprehensive ecosystem that spans computing, storage, and AI applications.', about: 'SwanChain is the first AI Super Chain dedicated to decentralized AI computing and development. Leveraging OP Super chain technology, Swan Chain integrates Web3 and AI by providing a comprehensive ecosystem that spans computing, storage, and AI applications.', withdrawTips: 'The amount of tokens available for immediate withdrawal. Larger withdrawals need to wait for the reserve to be replenished by new deposits or operator repayments', } constructor({ isTestnet, provider, contracts = {}, }: { isTestnet: boolean provider?: ethers.providers.JsonRpcProvider contracts?: { core?: string delegationPool?: string pToken?: string miningToken?: string dataHelper?: string } }) { super(provider) this.chainConfig = isTestnet ? swanTestnetChain : swanChain this.contracts = isTestnet ? { ...swanTestnetContract, ...contracts } : { ...swanContract, ...contracts } this.isTestnet = isTestnet } getAssetsInfo = async () => { const data = await fetch( this.isTestnet ? 'https://test.parasail.network/api/staking-projects?project=SWAN' : 'https://www.parasail.network/api/staking-projects?project=SWAN' ) const json = await data.json() return { apy: json.apy, lockedAssets: json.tvl / json.price, } } }