Skip to content

Commit

Permalink
kill nodle and add min balances in destionation for asset hub tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Nov 13, 2024
1 parent 5bd5d44 commit 6ace529
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 106 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"neuro",
"neuroweb",
"nodl",
"nodle",
"npmjs",
"onfinality",
"parachain",
Expand Down
19 changes: 10 additions & 9 deletions packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,25 @@ export function polkadotXcm() {
new ExtrinsicConfig({
module: pallet,
func,
getArgs: (extrinsicFunction) =>
getPolkadotXcmExtrinsicArgs({
getArgs: (extrinsicFunction) => {
const version = getExtrinsicArgumentVersion(extrinsicFunction);

return getPolkadotXcmExtrinsicArgs({
...params,
func: extrinsicFunction,
asset: [
{
id: {
Concrete: {
parents: 1,
interior: 'Here',
},
},
id: normalizeConcrete(version, {
parents: 1,
interior: 'Here',
}),
fun: {
Fungible: params.asset.amount,
},
},
],
}),
});
},
}),
}),
};
Expand Down
24 changes: 14 additions & 10 deletions packages/builder/src/extrinsic/pallets/xcmPallet/xcmPallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import {
type Parents,
XcmVersion,
} from '../../ExtrinsicBuilder.interfaces';
import { getExtrinsicAccount } from '../../ExtrinsicBuilder.utils';
import {
getExtrinsicAccount,
getExtrinsicArgumentVersion,
normalizeConcrete,
} from '../../ExtrinsicBuilder.utils';
import { getPolkadotXcmExtrinsicArgs } from '../polkadotXcm/polkadotXcm.util';

const pallet = 'xcmPallet';
Expand All @@ -20,25 +24,25 @@ export function xcmPallet() {
new ExtrinsicConfig({
module: pallet,
func,
getArgs: (extrinsicFunction) =>
getPolkadotXcmExtrinsicArgs({
getArgs: (extrinsicFunction) => {
const version = getExtrinsicArgumentVersion(extrinsicFunction);
return getPolkadotXcmExtrinsicArgs({
...params,
parents,
func: extrinsicFunction,
asset: [
{
id: {
Concrete: {
parents: 0,
interior: 'Here',
},
},
id: normalizeConcrete(version, {
parents: 0,
interior: 'Here',
}),
fun: {
Fungible: params.asset.amount,
},
},
],
}),
});
},
}),
}),
};
Expand Down
24 changes: 0 additions & 24 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1539,29 +1539,6 @@ export const neuroweb = new Parachain({
],
});

export const nodle = new Parachain({
assets: [
ChainAsset.fromAsset(nodl, {
decimals: 11,
ids: {
id: 'NodleNative',
},
}),
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
'0x97da7ede98d7bad4e36b4d734b6055425a3be036da2a332ea5a7037656427a21',
key: 'nodle',
name: 'Nodle',
nativeAsset: nodl,
parachainId: 2026,
ss58Format: 37,
ws: [
'wss://nodle-rpc.dwellir.com',
'wss://nodle-parachain.api.onfinality.io/public-ws',
],
});

export const originTrailAlphanet = new Parachain({
assets: [
ChainAsset.fromAsset(otp, {
Expand Down Expand Up @@ -2250,7 +2227,6 @@ export const chainsList: AnyChain[] = [
moonbeam,
moonriver,
neuroweb,
nodle,
originTrailAlphanet,
peaqChain,
peaqEvm,
Expand Down
2 changes: 0 additions & 2 deletions packages/config/src/xcm-configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { moonbaseBetaRoutes } from './moonbaseBeta';
import { moonbeamRoutes } from './moonbeam';
import { moonriverRoutes } from './moonriver';
import { neurowebRoutes } from './neuroweb';
import { nodleRoutes } from './nodle';
import { originTrailAlphanetRoutes } from './originTrailAlphanet';
import { peaqRoutes } from './peaq';
import { peaqAlphanetRoutes } from './peaqAlphanet';
Expand Down Expand Up @@ -74,7 +73,6 @@ export const xcmRoutesList: ChainRoutes[] = [
moonbeamRoutes,
moonriverRoutes,
neurowebRoutes,
nodleRoutes,
originTrailAlphanetRoutes,
peaqRoutes,
peaqEvmRoutes,
Expand Down
35 changes: 10 additions & 25 deletions packages/config/src/xcm-configs/moonbeam.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { BalanceBuilder, ContractBuilder } from '@moonbeam-network/xcm-builder';
import {
AssetMinBuilder,
BalanceBuilder,
ContractBuilder,
} from '@moonbeam-network/xcm-builder';
import {
aca,
apillon,
Expand Down Expand Up @@ -52,7 +56,6 @@ import {
mantaParachain,
moonbeam,
neuroweb,
nodle,
peaqChain,
peaqEvm,
pendulum,
Expand Down Expand Up @@ -491,29 +494,6 @@ export const moonbeamRoutes = new ChainRoutes({
},
contract: ContractBuilder().Xtokens().transfer(),
},
{
source: {
asset: nodl,
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
asset: nodl,
balance: BalanceBuilder().substrate().system().account(),
chain: nodle,
fee: {
amount: 0.02,
asset: nodl,
},
},
contract: ContractBuilder().Xtokens().transfer(),
},
{
source: {
asset: neuro,
Expand Down Expand Up @@ -673,6 +653,7 @@ export const moonbeamRoutes = new ChainRoutes({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(), // TODO change when DOT pays for fees
},
min: AssetMinBuilder().assets().asset(),
},
contract: ContractBuilder().Xtokens().transferMultiCurrencies(),
},
Expand Down Expand Up @@ -700,6 +681,7 @@ export const moonbeamRoutes = new ChainRoutes({
// asset: dot,
// balance: BalanceBuilder().substrate().system().account(),
},
min: AssetMinBuilder().assets().asset(),
},
contract: ContractBuilder().Xtokens().transferMultiCurrencies(),
},
Expand All @@ -724,6 +706,7 @@ export const moonbeamRoutes = new ChainRoutes({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(), // TODO change when DOT pays for fees
},
min: AssetMinBuilder().assets().asset(),
},
contract: ContractBuilder().Xtokens().transferMultiCurrencies(),
},
Expand All @@ -748,6 +731,7 @@ export const moonbeamRoutes = new ChainRoutes({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(), // TODO change when DOT pays for fees
},
min: AssetMinBuilder().assets().asset(),
},
contract: ContractBuilder().Xtokens().transferMultiCurrencies(),
},
Expand Down Expand Up @@ -1431,6 +1415,7 @@ export const moonbeamRoutes = new ChainRoutes({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(), // TODO change when DOT pays for fees
},
min: AssetMinBuilder().assets().asset(),
},
contract: ContractBuilder().Xtokens().transferMultiCurrencies(),
},
Expand Down
35 changes: 0 additions & 35 deletions packages/config/src/xcm-configs/nodle.ts

This file was deleted.

0 comments on commit 6ace529

Please sign in to comment.