@moonbeam-network/xcm-builder 1.0.0-dev.228 → 1.0.0-dev.229

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
@@ -384,7 +384,9 @@ declare function polkadotXcm$1(): {
384
384
  };
385
385
  transferAssetsToEcosystem: () => {
386
386
  X1: () => ExtrinsicConfigBuilder;
387
+ X2: () => ExtrinsicConfigBuilder;
387
388
  X3: () => ExtrinsicConfigBuilder;
389
+ X4: () => ExtrinsicConfigBuilder;
388
390
  };
389
391
  };
390
392
 
package/build/index.mjs CHANGED
@@ -2199,6 +2199,75 @@ function polkadotXcm() {
2199
2199
  });
2200
2200
  }
2201
2201
  }),
2202
+ X2: () => ({
2203
+ build: (params) => {
2204
+ return new ExtrinsicConfig({
2205
+ module: pallet2,
2206
+ func,
2207
+ getArgs: (extrinsicFunction) => {
2208
+ const version = getExtrinsicArgumentVersion(extrinsicFunction);
2209
+ return [
2210
+ // dest
2211
+ {
2212
+ [version]: normalizeX1(version, {
2213
+ parents: 2,
2214
+ interior: {
2215
+ X2: [
2216
+ {
2217
+ GlobalConsensus: {
2218
+ ByGenesis: params.destination.relayGenesisHash
2219
+ }
2220
+ },
2221
+ {
2222
+ Parachain: params.destination.parachainId
2223
+ }
2224
+ ]
2225
+ }
2226
+ })
2227
+ },
2228
+ // beneficiary
2229
+ {
2230
+ [version]: normalizeX1(version, {
2231
+ parents: 0,
2232
+ interior: {
2233
+ X1: getExtrinsicAccount(params.destinationAddress)
2234
+ }
2235
+ })
2236
+ },
2237
+ // assets
2238
+ {
2239
+ [version]: [
2240
+ {
2241
+ id: normalizeConcrete(version, {
2242
+ parents: 2,
2243
+ interior: {
2244
+ X2: [
2245
+ {
2246
+ PalletInstance: params.asset.getAssetPalletInstance()
2247
+ },
2248
+ {
2249
+ AccountKey20: {
2250
+ key: params.asset.address
2251
+ }
2252
+ }
2253
+ ]
2254
+ }
2255
+ }),
2256
+ fun: {
2257
+ Fungible: params.asset.amount
2258
+ }
2259
+ }
2260
+ ]
2261
+ },
2262
+ // feeAssetItem
2263
+ 0,
2264
+ // weightLimit
2265
+ "Unlimited"
2266
+ ];
2267
+ }
2268
+ });
2269
+ }
2270
+ }),
2202
2271
  X3: () => ({
2203
2272
  build: (params) => {
2204
2273
  const assetInDestination = params.destination.getChainAsset(
@@ -2273,6 +2342,112 @@ function polkadotXcm() {
2273
2342
  }
2274
2343
  });
2275
2344
  }
2345
+ }),
2346
+ X4: () => ({
2347
+ build: (params) => {
2348
+ return new ExtrinsicConfig({
2349
+ module: pallet2,
2350
+ func,
2351
+ getArgs: (extrinsicFunction) => {
2352
+ const version = getExtrinsicArgumentVersion(extrinsicFunction);
2353
+ const feeAssetInDestination = params.destination.getChainAsset(
2354
+ params.fee
2355
+ );
2356
+ const assetInDestination = params.destination.getChainAsset(
2357
+ params.asset
2358
+ );
2359
+ return [
2360
+ // dest
2361
+ {
2362
+ [version]: normalizeX1(version, {
2363
+ parents: 2,
2364
+ interior: {
2365
+ X2: [
2366
+ {
2367
+ GlobalConsensus: {
2368
+ ByGenesis: params.destination.relayGenesisHash
2369
+ }
2370
+ },
2371
+ {
2372
+ Parachain: params.destination.parachainId
2373
+ }
2374
+ ]
2375
+ }
2376
+ })
2377
+ },
2378
+ // beneficiary
2379
+ {
2380
+ [version]: normalizeX1(version, {
2381
+ parents: 0,
2382
+ interior: {
2383
+ X1: getExtrinsicAccount(params.destinationAddress)
2384
+ }
2385
+ })
2386
+ },
2387
+ // assets
2388
+ {
2389
+ [version]: [
2390
+ {
2391
+ id: normalizeConcrete(version, {
2392
+ parents: 2,
2393
+ interior: {
2394
+ X3: [
2395
+ {
2396
+ GlobalConsensus: {
2397
+ ByGenesis: params.destination.relayGenesisHash
2398
+ }
2399
+ },
2400
+ {
2401
+ Parachain: params.destination.parachainId
2402
+ },
2403
+ {
2404
+ PalletInstance: feeAssetInDestination.getAssetPalletInstance()
2405
+ }
2406
+ ]
2407
+ }
2408
+ }),
2409
+ fun: {
2410
+ Fungible: params.asset.amount
2411
+ }
2412
+ },
2413
+ {
2414
+ id: normalizeConcrete(version, {
2415
+ parents: 2,
2416
+ interior: {
2417
+ X4: [
2418
+ {
2419
+ GlobalConsensus: {
2420
+ ByGenesis: params.destination.relayGenesisHash
2421
+ }
2422
+ },
2423
+ {
2424
+ Parachain: params.destination.parachainId
2425
+ },
2426
+ {
2427
+ PalletInstance: assetInDestination.getAssetPalletInstance()
2428
+ },
2429
+ {
2430
+ AccountKey20: {
2431
+ key: assetInDestination.address
2432
+ }
2433
+ }
2434
+ ]
2435
+ }
2436
+ }),
2437
+ fun: {
2438
+ Fungible: params.asset.amount
2439
+ }
2440
+ }
2441
+ ]
2442
+ },
2443
+ // feeAssetItem
2444
+ 0,
2445
+ // weightLimit
2446
+ "Unlimited"
2447
+ ];
2448
+ }
2449
+ });
2450
+ }
2276
2451
  })
2277
2452
  };
2278
2453
  }