From 1583df530f12fe3f473ed38fad384535430667c6 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Tue, 31 Oct 2023 17:08:45 +0100 Subject: [PATCH 1/3] USDT wormhole integration and remove Subsocial Alphanet --- packages/config/src/assets.ts | 6 ++++ packages/config/src/chains.ts | 23 +++++++-------- packages/config/src/configs/hydraDX.ts | 17 ++++++++++- packages/config/src/configs/index.ts | 2 -- packages/config/src/configs/moonbaseAlpha.ts | 17 ----------- packages/config/src/configs/moonbeam.ts | 16 ++++++++++ .../config/src/configs/subsocialAlphanet.ts | 29 ------------------- 7 files changed, 48 insertions(+), 62 deletions(-) delete mode 100644 packages/config/src/configs/subsocialAlphanet.ts diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index be9d0812..c0affc3e 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -230,6 +230,11 @@ export const usdt = new Asset({ originSymbol: 'USDT', }); +export const usdtwh = new Asset({ + key: 'usdtwh', + originSymbol: 'USDT.Wh', +}); + export const wbtc = new Asset({ key: 'wbtc', originSymbol: 'WBTC', @@ -326,6 +331,7 @@ export const assetsList: Asset[] = [ unit, usdc, usdt, + usdtwh, vbnc, vdot, vfil, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 6c719bc5..15f4c624 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -51,6 +51,7 @@ import { unit, usdc, usdt, + usdtwh, vbnc, vdot, vfil, @@ -436,6 +437,10 @@ export const hydraDX = new Parachain({ asset: usdc, id: 21, }, + { + asset: usdtwh, + id: 23, + }, { asset: wbtc, id: 19, @@ -859,6 +864,11 @@ export const moonbeam = new EvmParachain({ id: '0x931715FEE2d06333043d11F658C8CE934aC61D0c', metadataId: 0, // no metadata for ERC20 tokens }, + { + asset: usdtwh, + id: '0xc30E9cA94CF52f3Bf5692aaCF81353a27052c46f', + metadataId: 0, + }, { asset: usdt, id: '311091173110107856861649819128533077277', @@ -1279,18 +1289,6 @@ export const turingAlphanet = new Parachain({ ws: 'wss://turing-moonbase.rpc.oak.tech/', }); -export const subsocialAlphanet = new Parachain({ - ecosystem: Ecosystem.AlphanetRelay, - genesisHash: - '0x01f15f9d48ea279640cb35267bfd33a88bb4c21ebb00b129e9bc2d2236aaafdb', - isTestChain: true, - key: 'subsocial-alphanet', - name: 'Subsocial Alphanet', - parachainId: 2100, - ss58Format: 42, - ws: 'wss://alphasoon.f3joule.space', -}); - export const uniqueAlpha = new Parachain({ assetsData: [ { @@ -1350,7 +1348,6 @@ export const chainsList: AnyChain[] = [ kusamaAssetHub, alphanetAssetHub, polkadotAssetHub, - subsocialAlphanet, turing, turingAlphanet, uniqueAlpha, diff --git a/packages/config/src/configs/hydraDX.ts b/packages/config/src/configs/hydraDX.ts index de5583f6..c801deb4 100644 --- a/packages/config/src/configs/hydraDX.ts +++ b/packages/config/src/configs/hydraDX.ts @@ -3,7 +3,7 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { dai, glmr, hdx, usdc, wbtc, weth } from '../assets'; +import { dai, glmr, hdx, usdc, usdtwh, wbtc, weth } from '../assets'; import { hydraDX, moonbeam } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -62,6 +62,21 @@ export const hydraDxConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: usdtwh, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.04, + asset: glmr, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(), + fee: { + asset: hdx, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: wbtc, balance: BalanceBuilder().substrate().tokens().accounts(), diff --git a/packages/config/src/configs/index.ts b/packages/config/src/configs/index.ts index 90853821..699dfdd5 100644 --- a/packages/config/src/configs/index.ts +++ b/packages/config/src/configs/index.ts @@ -40,7 +40,6 @@ import { polkadotConfig } from './polkadot'; import { polkadotAssetHubConfig } from './polkadotAssetHub'; import { robonomicsConfig } from './robonomics'; import { shidenConfig } from './shiden'; -import { subsocialAlphanetConfig } from './subsocialAlphanet'; import { turingConfig } from './turing'; import { turingAlphanetConfig } from './turingAlphanet'; import { uniqueAlphaConfig } from './uniqueAlpha'; @@ -86,7 +85,6 @@ export const chainsConfigList: ChainConfig[] = [ alphanetAssetHubConfig, kusamaAssetHubConfig, polkadotAssetHubConfig, - subsocialAlphanetConfig, turingConfig, turingAlphanetConfig, uniqueAlphaConfig, diff --git a/packages/config/src/configs/moonbaseAlpha.ts b/packages/config/src/configs/moonbaseAlpha.ts index 4483648e..ee4d7478 100644 --- a/packages/config/src/configs/moonbaseAlpha.ts +++ b/packages/config/src/configs/moonbaseAlpha.ts @@ -9,7 +9,6 @@ import { otp, paring, pica, - soon, tt1, tur, unit, @@ -24,7 +23,6 @@ import { moonbaseBeta, originTrailAlphanet, picassoAlphanet, - subsocialAlphanet, turingAlphanet, } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; @@ -211,21 +209,6 @@ export const moonbaseAlphaConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), - new AssetConfig({ - asset: soon, - balance: BalanceBuilder().substrate().assets().account(), - contract: ContractBuilder().Xtokens().transfer(), - destination: subsocialAlphanet, - destinationFee: { - amount: 0.4, - asset: soon, - balance: BalanceBuilder().substrate().assets().account(), - }, - fee: { - asset: dev, - balance: BalanceBuilder().substrate().system().account(), - }, - }), new AssetConfig({ asset: tt1, balance: BalanceBuilder().substrate().assets().account(), diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index 58b0649d..a5ff522c 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -21,6 +21,7 @@ import { ring, usdc, usdt, + usdtwh, vdot, vfil, vglmr, @@ -422,6 +423,21 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: usdtwh, + balance: BalanceBuilder().evm().erc20(), + contract: ContractBuilder().Xtokens().transfer(), + destination: hydraDX, + destinationFee: { + amount: 0.004, + asset: usdtwh, + balance: BalanceBuilder().evm().erc20(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: vdot, balance: BalanceBuilder().evm().erc20(), diff --git a/packages/config/src/configs/subsocialAlphanet.ts b/packages/config/src/configs/subsocialAlphanet.ts deleted file mode 100644 index 84de6e89..00000000 --- a/packages/config/src/configs/subsocialAlphanet.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { - BalanceBuilder, - ExtrinsicBuilder, - FeeBuilder, -} from '@moonbeam-network/xcm-builder'; -import { soon } from '../assets'; -import { moonbaseAlpha, subsocialAlphanet } from '../chains'; -import { AssetConfig } from '../types/AssetConfig'; -import { ChainConfig } from '../types/ChainConfig'; - -export const subsocialAlphanetConfig = new ChainConfig({ - assets: [ - new AssetConfig({ - asset: soon, - balance: BalanceBuilder().substrate().system().account(), - destination: moonbaseAlpha, - destinationFee: { - amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(), - asset: soon, - balance: BalanceBuilder().substrate().system().account(), - }, - extrinsic: ExtrinsicBuilder() - .polkadotXcm() - .limitedReserveTransferAssets() - .here(), - }), - ], - chain: subsocialAlphanet, -}); From 1f1e81f216ef0ec6ca8809d4b98aa46d3a8d8290 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Tue, 31 Oct 2023 17:10:09 +0100 Subject: [PATCH 2/3] change usdc variable name --- packages/config/src/assets.ts | 4 ++-- packages/config/src/chains.ts | 6 +++--- packages/config/src/configs/hydraDX.ts | 4 ++-- packages/config/src/configs/moonbeam.ts | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index c0affc3e..d7d41f3d 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -220,7 +220,7 @@ export const unit = new Asset({ originSymbol: 'Unit', }); -export const usdc = new Asset({ +export const usdcwh = new Asset({ key: 'usdcwh', originSymbol: 'USDC.Wh', }); @@ -329,7 +329,7 @@ export const assetsList: Asset[] = [ tt1, tur, unit, - usdc, + usdcwh, usdt, usdtwh, vbnc, diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 15f4c624..9384ed9a 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -49,7 +49,7 @@ import { tt1, tur, unit, - usdc, + usdcwh, usdt, usdtwh, vbnc, @@ -434,7 +434,7 @@ export const hydraDX = new Parachain({ id: 18, }, { - asset: usdc, + asset: usdcwh, id: 21, }, { @@ -860,7 +860,7 @@ export const moonbeam = new EvmParachain({ id: '125699734534028342599692732320197985871', }, { - asset: usdc, + asset: usdcwh, id: '0x931715FEE2d06333043d11F658C8CE934aC61D0c', metadataId: 0, // no metadata for ERC20 tokens }, diff --git a/packages/config/src/configs/hydraDX.ts b/packages/config/src/configs/hydraDX.ts index c801deb4..aa74f427 100644 --- a/packages/config/src/configs/hydraDX.ts +++ b/packages/config/src/configs/hydraDX.ts @@ -3,7 +3,7 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { dai, glmr, hdx, usdc, usdtwh, wbtc, weth } from '../assets'; +import { dai, glmr, hdx, usdcwh, usdtwh, wbtc, weth } from '../assets'; import { hydraDX, moonbeam } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -48,7 +48,7 @@ export const hydraDxConfig = new ChainConfig({ }, }), new AssetConfig({ - asset: usdc, + asset: usdcwh, balance: BalanceBuilder().substrate().tokens().accounts(), destination: moonbeam, destinationFee: { diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index a5ff522c..b643b180 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -19,7 +19,7 @@ import { para, pha, ring, - usdc, + usdcwh, usdt, usdtwh, vdot, @@ -409,13 +409,13 @@ export const moonbeamConfig = new ChainConfig({ }, }), new AssetConfig({ - asset: usdc, + asset: usdcwh, balance: BalanceBuilder().evm().erc20(), contract: ContractBuilder().Xtokens().transfer(), destination: hydraDX, destinationFee: { amount: 0.004, - asset: usdc, + asset: usdcwh, balance: BalanceBuilder().evm().erc20(), }, fee: { From 2214e3c1962a6aac3f4fb0eadb1f99a2e2ad5b5e Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Tue, 31 Oct 2023 17:13:43 +0100 Subject: [PATCH 3/3] add changeset --- .changeset/slimy-lies-exercise.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/slimy-lies-exercise.md diff --git a/.changeset/slimy-lies-exercise.md b/.changeset/slimy-lies-exercise.md new file mode 100644 index 00000000..db9cb136 --- /dev/null +++ b/.changeset/slimy-lies-exercise.md @@ -0,0 +1,6 @@ +--- +'@moonbeam-network/xcm-config': patch +'@moonbeam-network/xcm-sdk': patch +--- + +USDT Wormhole integration