Skip to content

Commit

Permalink
Apillon integration with Moonbeam (#285)
Browse files Browse the repository at this point in the history
* apillon NCTR integration

* add changeset

* remove TODO
  • Loading branch information
mmaurello authored Jun 25, 2024
1 parent 54bbb6d commit 3d203d4
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gentle-scissors-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moonbeam-network/xcm-config': patch
---

Apillon NCTR integration with Moonbeam
6 changes: 6 additions & 0 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export const ampe = new Asset({
originSymbol: 'AMPE',
});

export const apillon = new Asset({
key: 'apillon',
originSymbol: 'NCTR',
});

export const astr = new Asset({
key: 'astr',
originSymbol: 'ASTR',
Expand Down Expand Up @@ -412,6 +417,7 @@ export const assetsList: Asset[] = [
manta,
mgx,
movr,
apillon,
nodl,
neuro,
otp,
Expand Down
10 changes: 10 additions & 0 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
agng,
alan,
ampe,
apillon,
aseed,
astr,
atom,
Expand Down Expand Up @@ -1067,6 +1068,10 @@ export const moonbeam = new EvmParachain({
asset: stink,
id: '112679793397406599376365943185137098326',
},
{
asset: apillon,
id: '184218609779515850660274730699350567246',
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -1695,6 +1700,11 @@ export const polkadotAssetHub = new Parachain({
id: 42069,
palletInstance: 50,
},
{
asset: apillon,
id: 1024,
palletInstance: 50,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down
16 changes: 16 additions & 0 deletions packages/config/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BalanceBuilder, ContractBuilder } from '@moonbeam-network/xcm-builder';
import {
aca,
apillon,
aseed,
astr,
bnc,
Expand Down Expand Up @@ -535,6 +536,21 @@ export const moonbeamConfig = new ChainConfig({
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: apillon,
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: hdx,
balance: BalanceBuilder().substrate().assets().account(),
Expand Down
22 changes: 21 additions & 1 deletion packages/config/src/configs/polkadotAssetHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ExtrinsicBuilder,
FeeBuilder,
} from '@moonbeam-network/xcm-builder';
import { ded, dot, pink, stink, usdc, usdt } from '../assets';
import { apillon, ded, dot, pink, stink, usdc, usdt } from '../assets';
import { moonbeam, polkadotAssetHub } from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';
Expand Down Expand Up @@ -113,6 +113,26 @@ export const polkadotAssetHubConfig = new ChainConfig({
},
min: AssetMinBuilder().assets().asset(),
}),
new AssetConfig({
asset: apillon,
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(),
}),
],
chain: polkadotAssetHub,
});

0 comments on commit 3d203d4

Please sign in to comment.