@moonbeam-network/xcm-builder 1.0.0-dev.206 → 1.0.0-dev.207

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.mjs CHANGED
@@ -3033,32 +3033,29 @@ function buildSendExtrinsic({
3033
3033
  if (!transact) {
3034
3034
  throw new Error("Transact params are required");
3035
3035
  }
3036
- const version = getExtrinsicArgumentVersion(sourceApi.tx.polkadotXcm.send);
3037
3036
  return sourceApi.tx.polkadotXcm.send(
3038
3037
  {
3039
- [version]: normalizeX1(version, {
3038
+ // TODO apply XCM versioning
3039
+ V3: {
3040
3040
  parents: 1,
3041
- interior: {
3042
- X1: { Parachain: moonChain.parachainId }
3043
- }
3044
- })
3041
+ interior: { X1: { Parachain: moonChain.parachainId } }
3042
+ }
3045
3043
  },
3046
3044
  {
3047
- [version]: [
3045
+ V3: [
3048
3046
  {
3049
3047
  WithdrawAsset: [
3050
3048
  {
3051
- id: normalizeConcrete(
3052
- version,
3053
- normalizeX1(version, {
3049
+ id: {
3050
+ Concrete: {
3054
3051
  parents: 0,
3055
3052
  interior: {
3056
3053
  X1: {
3057
3054
  PalletInstance: moonAsset.getAssetPalletInstance()
3058
3055
  }
3059
3056
  }
3060
- })
3061
- ),
3057
+ }
3058
+ },
3062
3059
  fun: { Fungible: BUY_EXECUTION_FEE }
3063
3060
  }
3064
3061
  ]
@@ -3066,17 +3063,16 @@ function buildSendExtrinsic({
3066
3063
  {
3067
3064
  BuyExecution: {
3068
3065
  fees: {
3069
- id: normalizeConcrete(
3070
- version,
3071
- normalizeX1(version, {
3066
+ id: {
3067
+ Concrete: {
3072
3068
  parents: 0,
3073
3069
  interior: {
3074
3070
  X1: {
3075
3071
  PalletInstance: moonAsset.getAssetPalletInstance()
3076
3072
  }
3077
3073
  }
3078
- })
3079
- ),
3074
+ }
3075
+ },
3080
3076
  fun: { Fungible: BUY_EXECUTION_FEE }
3081
3077
  },
3082
3078
  weightLimit: "Unlimited"
@@ -3100,14 +3096,12 @@ function buildSendExtrinsic({
3100
3096
  {
3101
3097
  DepositAsset: {
3102
3098
  assets: { Wild: { AllCounted: 1 } },
3103
- beneficiary: normalizeX1(version, {
3099
+ beneficiary: {
3104
3100
  parents: 0,
3105
3101
  interior: {
3106
- X1: {
3107
- AccountKey20: { key: computedOriginAccount }
3108
- }
3102
+ X1: { AccountKey20: { key: computedOriginAccount } }
3109
3103
  }
3110
- })
3104
+ }
3111
3105
  }
3112
3106
  }
3113
3107
  ]
@@ -3983,10 +3977,9 @@ function getPayload({
3983
3977
  `Destination ${destination.name} is not a Parachain or EvmParachain`
3984
3978
  );
3985
3979
  }
3986
- const isEvmDestination = EvmParachain4.is(destination);
3987
- const version = getExtrinsicArgumentVersion(moonApi.tx.polkadotXcm.send);
3980
+ const isPeaqEvm = destination.key === "peaq-evm-Alphanet" || destination.key === "peaq-evm";
3988
3981
  const multilocation = moonApi.createType("XcmVersionedLocation", {
3989
- [version]: {
3982
+ V3: {
3990
3983
  parents: 1,
3991
3984
  interior: {
3992
3985
  X2: [
@@ -3994,7 +3987,7 @@ function getPayload({
3994
3987
  Parachain: destination.parachainId
3995
3988
  },
3996
3989
  getExtrinsicAccount(
3997
- isEvmDestination ? evmToAddress4(destinationAddress) : destinationAddress
3990
+ isPeaqEvm ? evmToAddress4(destinationAddress) : destinationAddress
3998
3991
  )
3999
3992
  ]
4000
3993
  }