Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USDT Wormhole integration #155

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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({
mmaurello marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -324,8 +329,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 @@ -433,9 +434,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 @@ -855,10 +860,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 @@ -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: [
{
Expand Down Expand Up @@ -1350,7 +1348,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 @@ -86,7 +85,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 @@ -408,13 +409,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.

Loading