Skip to content

Commit

Permalink
Merge branch 'main' into v3-next
Browse files Browse the repository at this point in the history
  • Loading branch information
ekenigs committed Sep 11, 2024
2 parents 52a7b50 + 5b9f548 commit 4644b6d
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 9 deletions.
6 changes: 6 additions & 0 deletions packages/builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @moonbeam-network/xcm-builder

## 2.4.7

### Patch Changes

- [#345](https://github.com/moonbeam-foundation/xcm-sdk/pull/345) [`6fe69b2`](https://github.com/moonbeam-foundation/xcm-sdk/commit/6fe69b230b4d44c717d9ec7ff73bbc6282b1385e) Thanks [@mmaurello](https://github.com/mmaurello)! - Add transferAssetsUsingTypeAndThen function to xcmPallet and implement it to relay chains

## 2.4.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/xcm-builder",
"version": "2.4.6",
"version": "2.4.7",
"description": "Moonbeam XCM builder",
"scripts": {
"build": "tsup",
Expand Down
79 changes: 76 additions & 3 deletions packages/builder/src/extrinsic/pallets/xcmPallet/xcmPallet.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ExtrinsicConfig } from '../../../types/substrate/ExtrinsicConfig';
import type {
ExtrinsicConfigBuilder,
Parents,
import {
type ExtrinsicConfigBuilder,
type Parents,
XcmVersion,
} from '../../ExtrinsicBuilder.interfaces';
import { getExtrinsicAccount } from '../../ExtrinsicBuilder.utils';
import { getPolkadotXcmExtrinsicArgs } from '../polkadotXcm/polkadotXcm.util';

const pallet = 'xcmPallet';
Expand Down Expand Up @@ -41,5 +43,76 @@ export function xcmPallet() {
}),
};
},
transferAssetsUsingTypeAndThen: () => {
const func = 'transferAssetsUsingTypeAndThen';

return {
here: (): ExtrinsicConfigBuilder => ({
build: (params) =>
new ExtrinsicConfig({
module: pallet,
func,
getArgs: () => {
const version = XcmVersion.v4;
return [
{
[version]: {
parents: 0,
interior: {
X1: [
{
Parachain: params.destination.parachainId,
},
],
},
},
},
{
[version]: [
{
id: {
parents: 0,
interior: 'Here',
},
fun: {
Fungible: params.asset.amount,
},
},
],
},
'LocalReserve',
{
[version]: {
parents: 0,
interior: 'Here',
},
},
'LocalReserve',
{
[version]: [
{
DepositAsset: {
assets: {
Wild: { AllCounted: 1 },
},
beneficiary: {
parents: 0,
interior: {
X1: [
getExtrinsicAccount(params.destinationAddress),
],
},
},
},
},
],
},
'Unlimited',
];
},
}),
}),
};
},
};
}
9 changes: 9 additions & 0 deletions packages/config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @moonbeam-network/xcm-config

## 2.5.12

### Patch Changes

- [#345](https://github.com/moonbeam-foundation/xcm-sdk/pull/345) [`6fe69b2`](https://github.com/moonbeam-foundation/xcm-sdk/commit/6fe69b230b4d44c717d9ec7ff73bbc6282b1385e) Thanks [@mmaurello](https://github.com/mmaurello)! - Add transferAssetsUsingTypeAndThen function to xcmPallet and implement it to relay chains

- Updated dependencies [[`6fe69b2`](https://github.com/moonbeam-foundation/xcm-sdk/commit/6fe69b230b4d44c717d9ec7ff73bbc6282b1385e)]:
- @moonbeam-network/xcm-builder@2.4.7

## 2.5.11

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/xcm-config",
"version": "2.5.11",
"version": "2.5.12",
"description": "All necessary configuration to transfer assets from Moonbeam, Moonriver, Moonbase to other parachains and back",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/xcm-configs/alphanetRelay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const alphanetRelayRoutes = new ChainRoutes({
},
extrinsic: ExtrinsicBuilder()
.xcmPallet()
.limitedReserveTransferAssets(0)
.transferAssetsUsingTypeAndThen()
.here(),
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/xcm-configs/kusama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const kusamaRoutes = new ChainRoutes({
},
extrinsic: ExtrinsicBuilder()
.xcmPallet()
.limitedReserveTransferAssets(0)
.transferAssetsUsingTypeAndThen()
.here(),
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/xcm-configs/polkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const polkadotRoutes = new ChainRoutes({
},
extrinsic: ExtrinsicBuilder()
.xcmPallet()
.limitedReserveTransferAssets(0)
.transferAssetsUsingTypeAndThen()
.here(),
},
],
Expand Down
8 changes: 8 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @moonbeam-network/xcm-sdk

## 2.5.13

### Patch Changes

- Updated dependencies [[`6fe69b2`](https://github.com/moonbeam-foundation/xcm-sdk/commit/6fe69b230b4d44c717d9ec7ff73bbc6282b1385e)]:
- @moonbeam-network/xcm-builder@2.4.7
- @moonbeam-network/xcm-config@2.5.12

## 2.5.12

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/xcm-sdk",
"version": "2.5.12",
"version": "2.5.13",
"description": "The Moonbeam XCM SDK enables developers to easily deposit and withdraw assets to Moonbeam/Moonriver from the relay chain and other parachains in the Polkadot/Kusama ecosystem",
"scripts": {
"build": "tsup",
Expand Down

0 comments on commit 4644b6d

Please sign in to comment.