Skip to content

Commit

Permalink
Merge branch 'main' of github.com:PureStake/xcm-sdk into mjm/zeitgeis…
Browse files Browse the repository at this point in the history
…t-moonbeam
  • Loading branch information
mmaurello committed Nov 2, 2023
2 parents d4ebf02 + a6f48df commit 8c3b434
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 71 deletions.
6 changes: 6 additions & 0 deletions .changeset/slimy-lies-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@moonbeam-network/xcm-config': patch
'@moonbeam-network/xcm-sdk': patch
---

USDT Wormhole integration
10 changes: 8 additions & 2 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Expand All @@ -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',
Expand Down Expand Up @@ -329,8 +334,9 @@ export const assetsList: Asset[] = [
tt1,
tur,
unit,
usdc,
usdcwh,
usdt,
usdtwh,
vbnc,
vdot,
vfil,
Expand Down
29 changes: 13 additions & 16 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ import {
tt1,
tur,
unit,
usdc,
usdcwh,
usdt,
usdtwh,
vbnc,
vdot,
vfil,
Expand Down Expand Up @@ -434,9 +435,13 @@ export const hydraDX = new Parachain({
id: 18,
},
{
asset: usdc,
asset: usdcwh,
id: 21,
},
{
asset: usdtwh,
id: 23,
},
{
asset: wbtc,
id: 19,
Expand Down Expand Up @@ -856,10 +861,15 @@ export const moonbeam = new EvmParachain({
id: '125699734534028342599692732320197985871',
},
{
asset: usdc,
asset: usdcwh,
id: '0x931715FEE2d06333043d11F658C8CE934aC61D0c',
metadataId: 0, // no metadata for ERC20 tokens
},
{
asset: usdtwh,
id: '0xc30E9cA94CF52f3Bf5692aaCF81353a27052c46f',
metadataId: 0,
},
{
asset: usdt,
id: '311091173110107856861649819128533077277',
Expand Down Expand Up @@ -1284,18 +1294,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: [
{
Expand Down Expand Up @@ -1371,7 +1369,6 @@ export const chainsList: AnyChain[] = [
kusamaAssetHub,
alphanetAssetHub,
polkadotAssetHub,
subsocialAlphanet,
turing,
turingAlphanet,
uniqueAlpha,
Expand Down
19 changes: 17 additions & 2 deletions packages/config/src/configs/hydraDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, usdcwh, usdtwh, wbtc, weth } from '../assets';
import { hydraDX, moonbeam } from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';
Expand Down Expand Up @@ -48,7 +48,22 @@ export const hydraDxConfig = new ChainConfig({
},
}),
new AssetConfig({
asset: usdc,
asset: usdcwh,
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: usdtwh,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: moonbeam,
destinationFee: {
Expand Down
2 changes: 0 additions & 2 deletions packages/config/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -87,7 +86,6 @@ export const chainsConfigList: ChainConfig[] = [
alphanetAssetHubConfig,
kusamaAssetHubConfig,
polkadotAssetHubConfig,
subsocialAlphanetConfig,
turingConfig,
turingAlphanetConfig,
uniqueAlphaConfig,
Expand Down
17 changes: 0 additions & 17 deletions packages/config/src/configs/moonbaseAlpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
otp,
paring,
pica,
soon,
tt1,
tur,
unit,
Expand All @@ -24,7 +23,6 @@ import {
moonbaseBeta,
originTrailAlphanet,
picassoAlphanet,
subsocialAlphanet,
turingAlphanet,
} from '../chains';
import { AssetConfig } from '../types/AssetConfig';
Expand Down Expand Up @@ -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(),
Expand Down
22 changes: 19 additions & 3 deletions packages/config/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import {
para,
pha,
ring,
usdc,
usdcwh,
usdt,
usdtwh,
vdot,
vfil,
vglmr,
Expand Down Expand Up @@ -410,13 +411,28 @@ 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: {
asset: glmr,
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: {
Expand Down
29 changes: 0 additions & 29 deletions packages/config/src/configs/subsocialAlphanet.ts

This file was deleted.

0 comments on commit 8c3b434

Please sign in to comment.