Skip to content

Commit

Permalink
update subbridge config
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleydon committed Jan 10, 2025
1 parent 312db56 commit 982860b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 344 deletions.
3 changes: 3 additions & 0 deletions apps/subbridge/components/BridgeHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ const BridgeHistory: FC<BoxProps> = (props) => {
{data.map((transfer) => {
const txHash = transfer.deposit?.txHash
const fromChain = CHAINS[transfer.fromDomain.name]
if (fromChain == null) {
return null
}
const toDomainName = transfer.toDomain?.name
const toChain = toDomainName ? CHAINS[toDomainName] : null
const explorerURL = fromChain.explorerURL
Expand Down
203 changes: 4 additions & 199 deletions apps/subbridge/config/asset.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import getGeneralKey from '@/lib/getGeneralKey'
import acaIcon from '@phala/ui/icons/asset/aca.png'
import astrIcon from '@phala/ui/icons/asset/astr.png'
import ausdIcon from '@phala/ui/icons/asset/ausd.png'
import bncIcon from '@phala/ui/icons/asset/bnc.png'
import bsxIcon from '@phala/ui/icons/asset/bsx.png'
import glmrIcon from '@phala/ui/icons/asset/glmr.png'
import karIcon from '@phala/ui/icons/asset/kar.png'
import kmaIcon from '@phala/ui/icons/asset/kma.png'
import movrIcon from '@phala/ui/icons/asset/movr.png'
import phaIcon from '@phala/ui/icons/asset/pha.png'
import sdnIcon from '@phala/ui/icons/asset/sdn.png'
import turIcon from '@phala/ui/icons/asset/tur.png'
import Decimal from 'decimal.js'
import {
CHAINS,
Expand All @@ -21,20 +13,7 @@ import {

export const nativeLocation = {parents: 0, interior: 'Here'}

export type AssetId =
| 'pha'
| 'movr'
| 'aca'
| 'kar'
| 'bnc'
| 'ausd'
| 'bsx'
| 'tur'
| 'kma'
| 'glmr'
| 'sdn'
| 'astr'
| 'gpha'
export type AssetId = 'pha' | 'aca' | 'astr' | 'glmr' | 'gpha'

export interface Asset {
id: AssetId
Expand Down Expand Up @@ -69,40 +48,25 @@ export const ASSETS: Readonly<Record<AssetId, Asset>> = {
icon: phaIcon,
xc20Address: {
moonbeam: '0xffffffff63d24ecc8eb8a7b5d0803e900f7b6ced',
moonriver: '0xffffffff8e6b63d9e447b6d4c45bda8af9dc9603',
},
erc20TokenContractAddress: {
ethereum: '0x6c5bA91642F10282b576d91922Ae6448C9d52f4E',
moonbeam: '0xFFFfFfFf63d24eCc8eB8a7b5D0803e900F7b6cED',
moonriver: '0xffFfFFff8E6b63d9e447B6d4C45BDA8AF9dc9603',
},
decimals: {ethereum: 18, goerli: 18, default: 12},
destChainTransactionFee: {
phala: new Decimal('0.092696'),
'bifrost-kusama': new Decimal('0.0256'),
acala: new Decimal('0.0512'),
karura: new Decimal('0.0512'),
moonbeam: new Decimal('0.158722600511'),
moonriver: new Decimal('0.05868512'),
turing: new Decimal('0.256'),
calamari: new Decimal('0.9523809524'),
shiden: new Decimal('0.024464'),
astar: new Decimal('0.000912'),
},
existentialDeposit: {
phala: new Decimal('0.01'),
acala: new Decimal('0.01'),
karura: new Decimal('0.04'),
'bifrost-kusama': new Decimal('0.04'),
},
polkadotAssetId: {
calamari: 13,
shiden: '18446744073709551623',
astar: '18446744073709551622',
turing: 7,
acala: {ForeignAsset: 9},
karura: {Token: 'PHA'},
'bifrost-kusama': {Token: 'PHA'},
},
reservedAddress: {
ethereum: '0xC832588193cd5ED2185daDA4A531e0B26eC5B830',
Expand All @@ -127,25 +91,7 @@ export const ASSETS: Readonly<Record<AssetId, Asset>> = {
destChainTransactionFee: {},
existentialDeposit: {},
},
movr: {
id: 'movr',
symbol: 'MOVR',
icon: movrIcon,
decimals: {default: 18},
xc20Address: {moonriver: '0x0000000000000000000000000000000000000802'},
destChainTransactionFee: {
moonriver: new Decimal('0.00008'),
},
existentialDeposit: {},
location: {
kusama: {
parents: 1,
interior: {
X2: [{Parachain: CHAINS.moonriver.paraId}, {PalletInstance: 10}],
},
},
},
},

aca: {
id: 'aca',
symbol: 'ACA',
Expand Down Expand Up @@ -173,136 +119,7 @@ export const ASSETS: Readonly<Record<AssetId, Asset>> = {
},
},
},
kar: {
id: 'kar',
symbol: 'KAR',
icon: karIcon,
decimals: {default: 12},
destChainTransactionFee: {
karura: new Decimal('0.0064'),
},
existentialDeposit: {
karura: new Decimal('0.01'),
},
location: {
kusama: {
parents: 1,
interior: {
X2: [
{Parachain: CHAINS.karura.paraId},
{GeneralKey: getGeneralKey('0x0080')},
],
},
},
},
},
bnc: {
id: 'bnc',
symbol: 'BNC',
icon: bncIcon,
decimals: {default: 12},
destChainTransactionFee: {
'bifrost-kusama': new Decimal('0.0051'),
},
existentialDeposit: {
'bifrost-kusama': new Decimal('0.01'),
},
location: {
bifrost: {
parents: 0,
interior: {X1: {GeneralKey: getGeneralKey('0x0001')}},
},
kusama: {
parents: 1,
interior: {
X2: [
{Parachain: CHAINS['bifrost-kusama'].paraId},
{GeneralKey: getGeneralKey('0x0001')},
],
},
},
},
},
ausd: {
id: 'ausd',
symbol: 'aUSD',
icon: ausdIcon,
decimals: {default: 12},
polkadotAssetId: {
acala: {Token: 'AUSD'},
karura: {Token: 'KUSD'},
},
destChainTransactionFee: {
karura: new Decimal('0.003481902463'),
},
existentialDeposit: {
karura: new Decimal('0.01'),
},
location: {
kusama: {
parents: 1,
interior: {
X2: [
{Parachain: CHAINS.karura.paraId},
{GeneralKey: getGeneralKey('0x0081')},
],
},
},
},
},
bsx: {
id: 'bsx',
symbol: 'BSX',
icon: bsxIcon,
decimals: {default: 12},
polkadotAssetId: {
basilisk: 0,
},
destChainTransactionFee: {
basilisk: new Decimal('22'),
},
existentialDeposit: {},
location: {
kusama: {
parents: 1,
interior: {
X2: [{Parachain: CHAINS.basilisk.paraId}, {GeneralIndex: 0}],
},
},
},
},
tur: {
id: 'tur',
symbol: 'TUR',
icon: turIcon,
decimals: {default: 10},
polkadotAssetId: {
turing: 0,
},
destChainTransactionFee: {
turing: new Decimal('0.1664'),
},
existentialDeposit: {},
location: {
kusama: {parents: 1, interior: {X1: {Parachain: CHAINS.turing.paraId}}},
},
},
kma: {
id: 'kma',
symbol: 'KMA',
icon: kmaIcon,
decimals: {default: 12},
polkadotAssetId: {
calamari: 1,
},
destChainTransactionFee: {
calamari: new Decimal('0.000004'),
},
existentialDeposit: {},
location: {
kusama: {parents: 1, interior: {X1: {Parachain: CHAINS.calamari.paraId}}},
},
},

glmr: {
id: 'glmr',
symbol: 'GLMR',
Expand All @@ -326,19 +143,7 @@ export const ASSETS: Readonly<Record<AssetId, Asset>> = {
},
},
},
sdn: {
id: 'sdn',
symbol: 'SDN',
icon: sdnIcon,
decimals: {default: 18},
destChainTransactionFee: {
shiden: new Decimal('0.004635101624603116'),
},
existentialDeposit: {},
location: {
kusama: {parents: 1, interior: {X1: {Parachain: CHAINS.shiden.paraId}}},
},
},

astr: {
id: 'astr',
symbol: 'ASTR',
Expand Down
Loading

0 comments on commit 982860b

Please sign in to comment.