@moonbeam-network/xcm-config 0.0.1-dev.23 → 0.0.1-dev.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -24,6 +24,7 @@ declare enum AssetSymbol {
24
24
  KSM = 'KSM',
25
25
  KUSD = 'KUSD',
26
26
  LIT = 'LIT',
27
+ MGX = 'MGX',
27
28
  MOVR = 'MOVR',
28
29
  NEER = 'NEER',
29
30
  PARA = 'PARA',
@@ -38,7 +39,7 @@ declare enum AssetSymbol {
38
39
  XRT = 'XRT',
39
40
  }
40
41
 
41
- declare type AssetId = number | bigint | string;
42
+ type AssetId = number | bigint | string;
42
43
  interface Asset<Symbols extends AssetSymbol = AssetSymbol> {
43
44
  id: string;
44
45
  /**
@@ -51,6 +52,7 @@ interface Asset<Symbols extends AssetSymbol = AssetSymbol> {
51
52
  */
52
53
  erc20Id: string;
53
54
  foreignIds?: Partial<Record<ChainKey, AssetId>>;
55
+ currencyId?: number;
54
56
  originSymbol: Symbols;
55
57
  isNative?: boolean;
56
58
  isLocalAsset?: boolean;
@@ -115,6 +117,7 @@ declare enum ChainKey {
115
117
  Kusama = 'Kusama',
116
118
  LitentryAlphanet = 'LitentryAlphanet',
117
119
  Litmus = 'Litmus',
120
+ MangataAlphanet = 'MangataAlphanet',
118
121
  MoonbaseBeta = 'MoonbaseBeta',
119
122
  Parallel = 'Parallel',
120
123
  ParallelHeiko = 'ParallelHeiko',
@@ -151,7 +154,7 @@ declare enum BalanceCurrencyTypes {
151
154
  FungibleToken = 'FungibleToken',
152
155
  }
153
156
 
154
- declare type BalanceConfig<Symbols extends AssetSymbol = AssetSymbol> =
157
+ type BalanceConfig<Symbols extends AssetSymbol = AssetSymbol> =
155
158
  | SystemBalanceConfig
156
159
  | AssetsBalanceConfig
157
160
  | OrmlTokensBalanceConfig
@@ -194,9 +197,7 @@ interface TokensBalanceConfig<Symbols extends AssetSymbol = AssetSymbol> {
194
197
  getParams: (account: string) => [string, TokensBalanceParamAsset<Symbols>];
195
198
  calc: (data: TokensPalletAccountData) => bigint;
196
199
  }
197
- declare type TokensBalanceParamAsset<
198
- Symbols extends AssetSymbol = AssetSymbol,
199
- > =
200
+ type TokensBalanceParamAsset<Symbols extends AssetSymbol = AssetSymbol> =
200
201
  | {
201
202
  [BalanceCurrencyTypes.Token]: Symbols | AssetSymbol.KUSD;
202
203
  }
@@ -211,10 +212,9 @@ declare type TokensBalanceParamAsset<
211
212
  }
212
213
  | {
213
214
  [BalanceCurrencyTypes.Token2]: AssetId;
214
- };
215
- declare type MinBalanceConfig =
216
- | MinBalanceAssetsConfig
217
- | MinBalanceAssetRegistryConfig;
215
+ }
216
+ | AssetId;
217
+ type MinBalanceConfig = MinBalanceAssetsConfig | MinBalanceAssetRegistryConfig;
218
218
  interface MinBalanceAssetsConfig {
219
219
  pallet: BalancePallet.Assets;
220
220
  function: BalanceFunction.Asset;
@@ -245,6 +245,7 @@ declare function createBalanceBuilder<
245
245
  ormlTokens: typeof ormlTokens;
246
246
  system: typeof system;
247
247
  tokens: () => {
248
+ tokensBase: typeof tokensBase;
248
249
  foreignAsset: (asset: AssetId | Symbols) => TokensBalanceConfig<Symbols>;
249
250
  fungibleToken: (asset: AssetId) => TokensBalanceConfig<Symbols>;
250
251
  miningResource: (asset: AssetId) => TokensBalanceConfig<Symbols>;
@@ -262,8 +263,11 @@ declare function minCurrencyMetadata(
262
263
  ): MinBalanceAssetRegistryConfig;
263
264
  declare function ormlTokens(asset: AssetId): OrmlTokensBalanceConfig;
264
265
  declare function system(): SystemBalanceConfig;
266
+ declare function tokensBase<Symbols extends AssetSymbol = AssetSymbol>(
267
+ asset: TokensBalanceParamAsset<Symbols>,
268
+ ): TokensBalanceConfig<Symbols>;
265
269
 
266
- declare type Parents = 0 | 1;
270
+ type Parents = 0 | 1;
267
271
  interface XcmExtrinsicGetParams {
268
272
  account: string;
269
273
  amount: bigint;
@@ -292,7 +296,7 @@ interface PolkadotXcmPallet {
292
296
  successEvent: PolkadotXcmExtrinsicSuccessEvent;
293
297
  getParams: (params: XcmExtrinsicGetParams) => PolkadotXcmPalletParams;
294
298
  }
295
- declare type PolkadotXcmPalletParamsV1 = [
299
+ type PolkadotXcmPalletParamsV1 = [
296
300
  /**
297
301
  * destination
298
302
  */
@@ -340,7 +344,7 @@ declare type PolkadotXcmPalletParamsV1 = [
340
344
  Limited: number;
341
345
  },
342
346
  ];
343
- declare type PolkadotXcmPalletParamsV2 = [
347
+ type PolkadotXcmPalletParamsV2 = [
344
348
  /**
345
349
  * destination
346
350
  */
@@ -386,10 +390,10 @@ declare type PolkadotXcmPalletParamsV2 = [
386
390
  */
387
391
  'Unlimited',
388
392
  ];
389
- declare type PolkadotXcmPalletParams =
393
+ type PolkadotXcmPalletParams =
390
394
  | PolkadotXcmPalletParamsV1
391
395
  | PolkadotXcmPalletParamsV2;
392
- declare type PolkadotXcmAssetParam =
396
+ type PolkadotXcmAssetParam =
393
397
  | PolkadotXcmAssetParamV0
394
398
  | PolkadotXcmAssetParamV1
395
399
  | PolkadotXcmAssetParamV2;
@@ -556,20 +560,19 @@ declare enum XTokensExtrinsicCurrencyTypes {
556
560
  Token2 = 'Token2',
557
561
  }
558
562
 
559
- declare type XTokensPallet<Symbols extends AssetSymbol = AssetSymbol> =
563
+ type XTokensPallet<Symbols extends AssetSymbol = AssetSymbol> =
560
564
  | XTokensTransferExtrinsic<Symbols>
561
565
  | XTokensTransferMultiAssetExtrinsic<Symbols>
562
566
  | XTokensTransferMultiCurrenciesExtrinsic<Symbols>;
563
- declare type XTokensTransferExtrinsic<
564
- Symbols extends AssetSymbol = AssetSymbol,
565
- > = XTokensBaseExtrinsic<XTokensExtrinsic.Transfer, Symbols>;
566
- declare type XTokensTransferMultiAssetExtrinsic<
567
+ type XTokensTransferExtrinsic<Symbols extends AssetSymbol = AssetSymbol> =
568
+ XTokensBaseExtrinsic<XTokensExtrinsic.Transfer, Symbols>;
569
+ type XTokensTransferMultiAssetExtrinsic<
567
570
  Symbols extends AssetSymbol = AssetSymbol,
568
571
  > = XTokensBaseExtrinsic<XTokensExtrinsic.TransferMultiAsset, Symbols>;
569
- declare type XTokensTransferMultiCurrenciesExtrinsic<
572
+ type XTokensTransferMultiCurrenciesExtrinsic<
570
573
  Symbols extends AssetSymbol = AssetSymbol,
571
574
  > = XTokensBaseExtrinsic<XTokensExtrinsic.TransferMultiCurrencies, Symbols>;
572
- declare type XTokensWeightLimit =
575
+ type XTokensWeightLimit =
573
576
  | number
574
577
  | {
575
578
  Limited: number;
@@ -590,47 +593,46 @@ interface XTokensParamsByExtrinsic<Symbols extends AssetSymbol = AssetSymbol> {
590
593
  [XTokensExtrinsic.TransferMultiAsset]: XTokensTransferMultiAssetExtrinsicParams<Symbols>;
591
594
  [XTokensExtrinsic.TransferMultiCurrencies]: XTokensTransferMultiCurrenciesExtrinsicParams<Symbols>;
592
595
  }
593
- declare type XTokensTransferExtrinsicParams<
594
- Symbols extends AssetSymbol = AssetSymbol,
595
- > = [
596
- /**
597
- * asset
598
- */
599
- XTokensTransferExtrinsicParamsAsset<Symbols>,
600
- /**
601
- * amount
602
- */
603
- bigint,
604
- /**
605
- * destination
606
- */
607
- {
608
- V1: {
609
- parents: 1;
610
- interior: {
611
- X2: [
612
- {
613
- Parachain: number;
614
- },
615
- {
616
- AccountKey20: {
617
- network: 'Any';
618
- /**
619
- * account
620
- */
621
- key: string;
622
- };
623
- },
624
- ];
596
+ type XTokensTransferExtrinsicParams<Symbols extends AssetSymbol = AssetSymbol> =
597
+ [
598
+ /**
599
+ * asset
600
+ */
601
+ XTokensTransferExtrinsicParamsAsset<Symbols>,
602
+ /**
603
+ * amount
604
+ */
605
+ bigint,
606
+ /**
607
+ * destination
608
+ */
609
+ {
610
+ V1: {
611
+ parents: 1;
612
+ interior: {
613
+ X2: [
614
+ {
615
+ Parachain: number;
616
+ },
617
+ {
618
+ AccountKey20: {
619
+ network: 'Any';
620
+ /**
621
+ * account
622
+ */
623
+ key: string;
624
+ };
625
+ },
626
+ ];
627
+ };
625
628
  };
626
- };
627
- },
628
- /**
629
- * weight
630
- */
631
- XTokensWeightLimit,
632
- ];
633
- declare type XTokensTransferMultiAssetExtrinsicParams<
629
+ },
630
+ /**
631
+ * weight
632
+ */
633
+ XTokensWeightLimit,
634
+ ];
635
+ type XTokensTransferMultiAssetExtrinsicParams<
634
636
  Symbols extends AssetSymbol = AssetSymbol,
635
637
  > = [
636
638
  /**
@@ -687,7 +689,7 @@ declare type XTokensTransferMultiAssetExtrinsicParams<
687
689
  */
688
690
  XTokensWeightLimit,
689
691
  ];
690
- declare type XTokensTransferMultiCurrenciesExtrinsicParams<
692
+ type XTokensTransferMultiCurrenciesExtrinsicParams<
691
693
  Symbols extends AssetSymbol = AssetSymbol,
692
694
  > = [
693
695
  [
@@ -736,7 +738,7 @@ declare type XTokensTransferMultiCurrenciesExtrinsicParams<
736
738
  */
737
739
  XTokensWeightLimit,
738
740
  ];
739
- declare type XTokensTransferExtrinsicParamsAsset<
741
+ type XTokensTransferExtrinsicParamsAsset<
740
742
  Symbols extends AssetSymbol = AssetSymbol,
741
743
  > =
742
744
  | {
@@ -823,7 +825,7 @@ interface XTransferPallet {
823
825
  successEvent: XTransferExtrinsicSuccessEvent;
824
826
  getParams: (params: XcmExtrinsicGetParams) => XTransferPalletParams;
825
827
  }
826
- declare type XTransferPalletParams = [
828
+ type XTransferPalletParams = [
827
829
  /**
828
830
  * asset
829
831
  */
@@ -866,7 +868,7 @@ interface XTransferConcreteParam {
866
868
  parents: Parents;
867
869
  interior: XTransferInteriorParam;
868
870
  }
869
- declare type XTransferInteriorParam =
871
+ type XTransferInteriorParam =
870
872
  | 'Here'
871
873
  | {
872
874
  X2: [
@@ -987,7 +989,7 @@ declare function createExtrinsicBuilder<
987
989
  };
988
990
  };
989
991
 
990
- declare type ExtrinsicConfig<Symbols extends AssetSymbol = AssetSymbol> =
992
+ type ExtrinsicConfig<Symbols extends AssetSymbol = AssetSymbol> =
991
993
  | PolkadotXcmPallet
992
994
  | XcmPallet
993
995
  | XTokensPallet<Symbols>
@@ -1038,7 +1040,7 @@ interface DestinationMultilocationV1 {
1038
1040
  };
1039
1041
  toPrecompileMultilocation: () => PrecompileDestinationMultilocationV1;
1040
1042
  }
1041
- declare type PrecompileDestinationMultilocationV1 = [Parents, [string]];
1043
+ type PrecompileDestinationMultilocationV1 = [Parents, [string]];
1042
1044
  interface GetterAccountMultilocationV1 {
1043
1045
  get: (account: string) => AccountMultilocationV1;
1044
1046
  }
@@ -1128,7 +1130,7 @@ interface PrecompileXcmTransactThroughSignedMultilocationParams {
1128
1130
  */
1129
1131
  overallWeight: bigint;
1130
1132
  }
1131
- declare type XcmTransactThroughSignedParams = [
1133
+ type XcmTransactThroughSignedParams = [
1132
1134
  {
1133
1135
  V1: {
1134
1136
  parents: 1;
@@ -1188,7 +1190,7 @@ declare function createTransactBuilder<
1188
1190
  };
1189
1191
  };
1190
1192
 
1191
- declare type WithdrawConfig<Symbols extends AssetSymbol = AssetSymbol> =
1193
+ type WithdrawConfig<Symbols extends AssetSymbol = AssetSymbol> =
1192
1194
  WithdrawXTokensConfig<Symbols>;
1193
1195
  interface WithdrawXTokensConfig<
1194
1196
  Symbols extends AssetSymbol = AssetSymbol,
@@ -1202,7 +1204,7 @@ interface WithdrawXTokensConfig<
1202
1204
  weight: number;
1203
1205
  getParams: (account: string) => WithdrawXTokensParams;
1204
1206
  }
1205
- declare type WithdrawXTokensParams = [
1207
+ type WithdrawXTokensParams = [
1206
1208
  /**
1207
1209
  * 1 - if transaction is going through a relay chain
1208
1210
  */
@@ -1310,15 +1312,15 @@ interface WithdrawConfigBuilder<
1310
1312
  config: WithdrawConfig<Symbols>;
1311
1313
  };
1312
1314
  }
1313
- declare type AssetsMap<Symbols extends AssetSymbol = AssetSymbol> = Record<
1315
+ type AssetsMap<Symbols extends AssetSymbol = AssetSymbol> = Record<
1314
1316
  Symbols,
1315
1317
  Asset<Symbols>
1316
1318
  >;
1317
- declare type ChainsMap<ChainKeys extends ChainKey = ChainKey> = Record<
1319
+ type ChainsMap<ChainKeys extends ChainKey = ChainKey> = Record<
1318
1320
  ChainKeys,
1319
1321
  Chain<ChainKeys>
1320
1322
  >;
1321
- declare type ChainXcmConfigs<
1323
+ type ChainXcmConfigs<
1322
1324
  Symbols extends AssetSymbol = AssetSymbol,
1323
1325
  ChainKeys extends ChainKey = ChainKey,
1324
1326
  > = Partial<Record<AssetSymbol, XcmConfig<Symbols, ChainKeys>>>;
@@ -1331,7 +1333,7 @@ interface XcmConfig<
1331
1333
  deposit: Partial<Record<ChainKeys, DepositConfig<Symbols>>>;
1332
1334
  withdraw: Partial<Record<ChainKeys, WithdrawConfig<Symbols>>>;
1333
1335
  }
1334
- declare type ChainTransactConfigs<
1336
+ type ChainTransactConfigs<
1335
1337
  Symbols extends AssetSymbol = AssetSymbol,
1336
1338
  ChainKeys extends ChainKey = ChainKey,
1337
1339
  > = Partial<Record<ChainKeys, TransactConfig<Symbols, ChainKeys>>>;
@@ -1410,12 +1412,14 @@ declare const moonbase: XcmConfigBuilder<
1410
1412
  | AssetSymbol.BIT
1411
1413
  | AssetSymbol.DEV
1412
1414
  | AssetSymbol.LIT
1415
+ | AssetSymbol.MGX
1413
1416
  | AssetSymbol.NEER
1414
1417
  | AssetSymbol.TT1
1415
1418
  | AssetSymbol.UNIT,
1416
1419
  | ChainKey.AlphanetRelay
1417
1420
  | ChainKey.BitCountryPioneer
1418
1421
  | ChainKey.LitentryAlphanet
1422
+ | ChainKey.MangataAlphanet
1419
1423
  | ChainKey.MoonbaseBeta
1420
1424
  | ChainKey.StatemineAlphanet
1421
1425
  | ChainKey.UniqueAlpha
@@ -1487,6 +1491,7 @@ declare const MOONBASE_ASSETS: readonly [
1487
1491
  AssetSymbol.BIT,
1488
1492
  AssetSymbol.DEV,
1489
1493
  AssetSymbol.LIT,
1494
+ AssetSymbol.MGX,
1490
1495
  AssetSymbol.NEER,
1491
1496
  AssetSymbol.TT1,
1492
1497
  AssetSymbol.UNIT,
@@ -1497,24 +1502,19 @@ declare const MOONBASE_CHAINS: readonly [
1497
1502
  ChainKey.AlphanetRelay,
1498
1503
  ChainKey.LitentryAlphanet,
1499
1504
  ChainKey.BitCountryPioneer,
1505
+ ChainKey.MangataAlphanet,
1500
1506
  ChainKey.MoonbaseBeta,
1501
1507
  ChainKey.StatemineAlphanet,
1502
1508
  ChainKey.UniqueAlpha,
1503
1509
  ];
1504
1510
  declare const MOONBASE_CHAINS_MAP: ChainsMap<MoonbaseChains>;
1505
1511
 
1506
- declare type MoonbaseAssets = typeof MOONBASE_ASSETS[number];
1507
- declare type MoonbaseChains = typeof MOONBASE_CHAINS[number];
1508
- declare type MoonbaseXcmConfig = XcmConfig<MoonbaseAssets, MoonbaseChains>;
1509
- declare type MoonbaseXcmConfigs = ChainXcmConfigs<
1510
- MoonbaseAssets,
1511
- MoonbaseChains
1512
- >;
1513
- declare type MoonbaseTransactConfig = TransactConfig<
1514
- MoonbaseAssets,
1515
- MoonbaseChains
1516
- >;
1517
- declare type MoonbaseTransactConfigs = ChainTransactConfigs<
1512
+ type MoonbaseAssets = (typeof MOONBASE_ASSETS)[number];
1513
+ type MoonbaseChains = (typeof MOONBASE_CHAINS)[number];
1514
+ type MoonbaseXcmConfig = XcmConfig<MoonbaseAssets, MoonbaseChains>;
1515
+ type MoonbaseXcmConfigs = ChainXcmConfigs<MoonbaseAssets, MoonbaseChains>;
1516
+ type MoonbaseTransactConfig = TransactConfig<MoonbaseAssets, MoonbaseChains>;
1517
+ type MoonbaseTransactConfigs = ChainTransactConfigs<
1518
1518
  MoonbaseAssets,
1519
1519
  MoonbaseChains
1520
1520
  >;
@@ -1552,13 +1552,10 @@ declare const MOONBEAM_CHAINS: readonly [
1552
1552
  ];
1553
1553
  declare const MOONBEAM_CHAINS_MAP: ChainsMap<MoonbeamChains>;
1554
1554
 
1555
- declare type MoonbeamAssets = typeof MOONBEAM_ASSETS[number];
1556
- declare type MoonbeamChains = typeof MOONBEAM_CHAINS[number];
1557
- declare type MoonbeamXcmConfig = XcmConfig<MoonbeamAssets, MoonbeamChains>;
1558
- declare type MoonbeamXcmConfigs = ChainXcmConfigs<
1559
- MoonbeamAssets,
1560
- MoonbeamChains
1561
- >;
1555
+ type MoonbeamAssets = (typeof MOONBEAM_ASSETS)[number];
1556
+ type MoonbeamChains = (typeof MOONBEAM_CHAINS)[number];
1557
+ type MoonbeamXcmConfig = XcmConfig<MoonbeamAssets, MoonbeamChains>;
1558
+ type MoonbeamXcmConfigs = ChainXcmConfigs<MoonbeamAssets, MoonbeamChains>;
1562
1559
 
1563
1560
  declare const MOONBEAM_CONFIGS: MoonbeamXcmConfigs;
1564
1561
 
@@ -1602,13 +1599,10 @@ declare const MOONRIVER_CHAINS: readonly [
1602
1599
  ];
1603
1600
  declare const MOONRIVER_CHAINS_MAP: ChainsMap<MoonriverChains>;
1604
1601
 
1605
- declare type MoonriverAssets = typeof MOONRIVER_ASSETS[number];
1606
- declare type MoonriverChains = typeof MOONRIVER_CHAINS[number];
1607
- declare type MoonriverXcmConfig = XcmConfig<MoonriverAssets, MoonriverChains>;
1608
- declare type MoonriverXcmConfigs = ChainXcmConfigs<
1609
- MoonriverAssets,
1610
- MoonriverChains
1611
- >;
1602
+ type MoonriverAssets = (typeof MOONRIVER_ASSETS)[number];
1603
+ type MoonriverChains = (typeof MOONRIVER_CHAINS)[number];
1604
+ type MoonriverXcmConfig = XcmConfig<MoonriverAssets, MoonriverChains>;
1605
+ type MoonriverXcmConfigs = ChainXcmConfigs<MoonriverAssets, MoonriverChains>;
1612
1606
 
1613
1607
  declare const MOONRIVER_CONFIGS: MoonriverXcmConfigs;
1614
1608