From a2a18893dd7c75c0f6a35a498281152d68962c87 Mon Sep 17 00:00:00 2001 From: mmaurello <93129175+mmaurello@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:22:31 -0400 Subject: [PATCH] WIFD (Dog wif dots) integration with Moonbeam (#318) * WIFD integration with Moonbeam * add changeset --- .changeset/cyan-impalas-run.md | 5 +++++ packages/config/src/assets.ts | 6 +++++ packages/config/src/chains.ts | 10 +++++++++ packages/config/src/configs/moonbeam.ts | 16 ++++++++++++++ .../config/src/configs/polkadotAssetHub.ts | 22 ++++++++++++++++++- 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .changeset/cyan-impalas-run.md diff --git a/.changeset/cyan-impalas-run.md b/.changeset/cyan-impalas-run.md new file mode 100644 index 00000000..d68219ed --- /dev/null +++ b/.changeset/cyan-impalas-run.md @@ -0,0 +1,5 @@ +--- +'@moonbeam-network/xcm-config': patch +--- + +WIFD integration with Moonbeam diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index 2e11872e..3ba6356f 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -360,6 +360,11 @@ export const vmovr = new Asset({ originSymbol: 'vMOVR', }); +export const wifd = new Asset({ + key: 'wifd', + originSymbol: 'WIFD', +}); + export const xrt = new Asset({ key: 'xrt', originSymbol: 'XRT', @@ -448,6 +453,7 @@ export const assetsList: Asset[] = [ wbtc, weth, wftm, + wifd, xrt, ztg, ]; diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 9dd0a939..3b6fd553 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -76,6 +76,7 @@ import { vmovr, wbtc, weth, + wifd, xrt, ztg, } from './assets'; @@ -1104,6 +1105,10 @@ export const moonbeam = new EvmParachain({ asset: apillon, id: '184218609779515850660274730699350567246', }, + { + asset: wifd, + id: '61295607754960722617854661686514597014', + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: @@ -1729,6 +1734,11 @@ export const polkadotAssetHub = new Parachain({ id: 1024, palletInstance: 50, }, + { + asset: wifd, + id: 17, + palletInstance: 50, + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index 1f0d765e..55df6795 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -38,6 +38,7 @@ import { vmanta, wbtc, weth, + wifd, ztg, } from '../assets'; import { @@ -492,6 +493,21 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: wifd, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transferMultiCurrencies(), + destination: polkadotAssetHub, + destinationFee: { + amount: 0.2, + asset: usdt, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: apillon, balance: BalanceBuilder().substrate().assets().account(), diff --git a/packages/config/src/configs/polkadotAssetHub.ts b/packages/config/src/configs/polkadotAssetHub.ts index 373bf78e..e1232812 100644 --- a/packages/config/src/configs/polkadotAssetHub.ts +++ b/packages/config/src/configs/polkadotAssetHub.ts @@ -4,7 +4,7 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { apillon, ded, dot, pink, stink, usdc, usdt } from '../assets'; +import { apillon, ded, dot, pink, stink, usdc, usdt, wifd } from '../assets'; import { moonbeam, polkadotAssetHub } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -113,6 +113,26 @@ export const polkadotAssetHubConfig = new ChainConfig({ }, min: AssetMinBuilder().assets().asset(), }), + new AssetConfig({ + asset: wifd, + balance: BalanceBuilder().substrate().assets().account(), + destination: moonbeam, + destinationFee: { + amount: 0.03, + asset: usdt, + balance: BalanceBuilder().substrate().assets().account(), + }, + extrinsic: ExtrinsicBuilder() + .polkadotXcm() + .limitedReserveTransferAssets() + .X2(), + fee: { + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + xcmDeliveryFeeAmount, + }, + min: AssetMinBuilder().assets().asset(), + }), new AssetConfig({ asset: apillon, balance: BalanceBuilder().substrate().assets().account(),