@moonbeam-network/xcm-builder 1.0.0-dev.237 → 1.0.0-dev.239

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
@@ -1,4 +1,4 @@
1
- import { Chain, AnyParachain, AssetAmount, ChainAssetId, ChainAsset, AnyChain, EvmParachain } from '@moonbeam-network/xcm-types';
1
+ import { Chain, AnyParachain, AssetAmount, ChainAssetId, ChainAsset, Ecosystem, AnyChain, EvmParachain } from '@moonbeam-network/xcm-types';
2
2
  import { ApiPromise } from '@polkadot/api';
3
3
  import { FrameSystemAccountInfo, StagingXcmV3MultiLocation } from '@polkadot/types/lookup';
4
4
  import { Struct, u128, Enum } from '@polkadot/types';
@@ -360,6 +360,9 @@ declare function eqBalances(): {
360
360
  transferXcm: () => ExtrinsicConfigBuilder;
361
361
  };
362
362
 
363
+ type ParamsWithGlobalConsensus = {
364
+ globalConsensus?: Ecosystem;
365
+ };
363
366
  declare function polkadotXcm$1(): {
364
367
  limitedReserveTransferAssets: () => {
365
368
  here: () => ExtrinsicConfigBuilder;
@@ -384,9 +387,9 @@ declare function polkadotXcm$1(): {
384
387
  };
385
388
  transferAssetsToEcosystem: () => {
386
389
  X1: () => ExtrinsicConfigBuilder;
387
- X2: () => ExtrinsicConfigBuilder;
390
+ X2: ({ globalConsensus, }?: ParamsWithGlobalConsensus) => ExtrinsicConfigBuilder;
388
391
  X3: () => ExtrinsicConfigBuilder;
389
- X4: () => ExtrinsicConfigBuilder;
392
+ X4: ({ globalConsensus, }?: ParamsWithGlobalConsensus) => ExtrinsicConfigBuilder;
390
393
  };
391
394
  };
392
395
 
package/build/index.mjs CHANGED
@@ -1524,9 +1524,15 @@ function getEcosystemTransferExtrinsicArgs({
1524
1524
  destinationAddress,
1525
1525
  destination,
1526
1526
  func,
1527
+ globalConsensus,
1527
1528
  feeIndex = 0
1528
1529
  }) {
1529
1530
  const version = getExtrinsicArgumentVersion(func);
1531
+ const GlobalConsensus = globalConsensus ? { GlobalConsensus: globalConsensus } : {
1532
+ GlobalConsensus: {
1533
+ ByGenesis: destination.relayGenesisHash
1534
+ }
1535
+ };
1530
1536
  return [
1531
1537
  // dest
1532
1538
  {
@@ -1534,11 +1540,7 @@ function getEcosystemTransferExtrinsicArgs({
1534
1540
  parents: 2,
1535
1541
  interior: {
1536
1542
  X2: [
1537
- {
1538
- GlobalConsensus: {
1539
- ByGenesis: destination.relayGenesisHash
1540
- }
1541
- },
1543
+ GlobalConsensus,
1542
1544
  {
1543
1545
  Parachain: destination.parachainId
1544
1546
  }
@@ -2214,7 +2216,9 @@ function polkadotXcm() {
2214
2216
  });
2215
2217
  }
2216
2218
  }),
2217
- X2: () => ({
2219
+ X2: ({
2220
+ globalConsensus
2221
+ } = {}) => ({
2218
2222
  build: (params) => {
2219
2223
  return new ExtrinsicConfig({
2220
2224
  module: pallet2,
@@ -2243,11 +2247,13 @@ function polkadotXcm() {
2243
2247
  }
2244
2248
  }
2245
2249
  ];
2246
- return getEcosystemTransferExtrinsicArgs({
2250
+ const result = getEcosystemTransferExtrinsicArgs({
2247
2251
  ...params,
2248
2252
  func: extrinsicFunction,
2249
- assets: assets3
2253
+ assets: assets3,
2254
+ globalConsensus
2250
2255
  });
2256
+ return result;
2251
2257
  }
2252
2258
  });
2253
2259
  }
@@ -2296,7 +2302,9 @@ function polkadotXcm() {
2296
2302
  });
2297
2303
  }
2298
2304
  }),
2299
- X4: () => ({
2305
+ X4: ({
2306
+ globalConsensus
2307
+ } = {}) => ({
2300
2308
  build: (params) => {
2301
2309
  return new ExtrinsicConfig({
2302
2310
  module: pallet2,
@@ -2362,11 +2370,21 @@ function polkadotXcm() {
2362
2370
  }
2363
2371
  }
2364
2372
  ];
2365
- return getEcosystemTransferExtrinsicArgs({
2373
+ const result = getEcosystemTransferExtrinsicArgs({
2366
2374
  ...params,
2367
2375
  func: extrinsicFunction,
2368
- assets: assets3
2376
+ assets: assets3,
2377
+ globalConsensus
2369
2378
  });
2379
+ console.log(
2380
+ "\x1B[34m\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2593\u2592\u2592\u2591 polkadotXcm.ts:886 \u2591\u2592\u2592\u2593\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\x1B[0m"
2381
+ );
2382
+ console.log("* result = ");
2383
+ console.log(result);
2384
+ console.log(
2385
+ "\x1B[34m\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\x1B[0m"
2386
+ );
2387
+ return result;
2370
2388
  }
2371
2389
  });
2372
2390
  }