Skip to content

Commit

Permalink
add assets configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Oct 31, 2024
1 parent 730950c commit 6b7c0f5
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,16 @@ export const wbtce = new Asset({
originSymbol: 'WBTC.e',
});

export const wstethe = new Asset({
key: 'wstethe',
originSymbol: 'wstETH.e',
});

export const wethe = new Asset({
key: 'wethe',
originSymbol: 'WETH.e',
});

export const assetsList: Asset[] = [
aca,
alan,
Expand Down Expand Up @@ -464,8 +474,10 @@ export const assetsList: Asset[] = [
wbtc,
wbtce,
weth,
wethe,
wftm,
wifd,
wstethe,
xrt,
ztg,
];
Expand Down
24 changes: 24 additions & 0 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ import {
wbtc,
wbtce,
weth,
wethe,
wifd,
wstethe,
xrt,
ztg,
} from './assets';
Expand Down Expand Up @@ -1107,6 +1109,18 @@ export const moonbeam = new EvmParachain({
asset: wifd,
id: '61295607754960722617854661686514597014',
},
{
asset: wbtce,
id: '36282181791341254438422467838694599751',
},
{
asset: wethe,
id: '178794693648360392906933130845919698647',
},
{
asset: wstethe,
id: '124105859028862849477017063633156007283',
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -1725,6 +1739,16 @@ export const polkadotAssetHub = new Parachain({
asset: wbtce,
globalConcensusId: { ethereum: { chainId: 1 } },
},
{
address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
asset: wethe,
globalConcensusId: { ethereum: { chainId: 1 } },
},
{
address: '0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0',
asset: wstethe,
globalConcensusId: { ethereum: { chainId: 1 } },
},
],
checkSovereignAccountBalances: true,
ecosystem: Ecosystem.Polkadot,
Expand Down
12 changes: 12 additions & 0 deletions packages/config/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
vglmr,
vmanta,
wbtc,
wbtce,
weth,
wifd,
ztg,
Expand Down Expand Up @@ -951,6 +952,17 @@ export const moonbeamConfig = new ChainConfig({
balance: BalanceBuilder().evm().erc20(),
},
}),
new AssetConfig({
asset: wbtce,
balance: BalanceBuilder().substrate().assets().account(),
contract: ContractBuilder().Xtokens().transfer(),
destination: polkadotAssetHub,
destinationFee: {
amount: 0.02, // TODO
asset: usdt, // TODO
balance: BalanceBuilder().substrate().assets().account(),
},
}),
],
chain: moonbeam,
});
36 changes: 35 additions & 1 deletion packages/config/src/configs/polkadotAssetHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ import {
ExtrinsicBuilder,
FeeBuilder,
} from '@moonbeam-network/xcm-builder';
import { apillon, ded, dot, pink, stink, usdc, usdt, wifd } from '../assets';
import {
apillon,
ded,
dot,
pink,
stink,
usdc,
usdt,
wbtce,
wifd,
} from '../assets';
import { moonbeam, polkadotAssetHub } from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';
Expand Down Expand Up @@ -189,6 +199,30 @@ export const polkadotAssetHubConfig = new ChainConfig({
},
min: AssetMinBuilder().assets().asset(),
}),
new AssetConfig({
asset: wbtce,
balance: BalanceBuilder().substrate().foreignAssets().account(),
destination: moonbeam,
destinationFee: {
amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({
isAssetReserveChain: false,
shouldTransferAssetPrecedeAsset: true,
}),
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
},
// TODO
extrinsic: ExtrinsicBuilder()
.polkadotXcm()
.limitedReserveTransferAssets()
.X2(),
fee: {
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
min: AssetMinBuilder().assets().asset(),
}),
],
chain: polkadotAssetHub,
});

0 comments on commit 6b7c0f5

Please sign in to comment.