From 2790340bb8ea0edda13765875d91a3a5d993a072 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:09:19 +0100 Subject: [PATCH 1/5] Bump elliptic from 6.5.7 to 6.6.1 (#390) * Bump elliptic from 6.5.7 to 6.6.1 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.7 to 6.6.1. - [Commits](https://github.com/indutny/elliptic/compare/v6.5.7...v6.6.1) --- updated-dependencies: - dependency-name: elliptic dependency-type: indirect ... Signed-off-by: dependabot[bot] * add changeset --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard Kenigs --- .changeset/silent-starfishes-peel.md | 9 +++++++++ package-lock.json | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/silent-starfishes-peel.md diff --git a/.changeset/silent-starfishes-peel.md b/.changeset/silent-starfishes-peel.md new file mode 100644 index 00000000..ea2536ca --- /dev/null +++ b/.changeset/silent-starfishes-peel.md @@ -0,0 +1,9 @@ +--- +'@moonbeam-network/xcm-builder': patch +'@moonbeam-network/xcm-config': patch +'@moonbeam-network/xcm-sdk': patch +'@moonbeam-network/xcm-types': patch +'@moonbeam-network/xcm-utils': patch +--- + +Fix vulnerability diff --git a/package-lock.json b/package-lock.json index ecbb4439..559b9e4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9888,9 +9888,9 @@ "peer": true }, "node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", "license": "MIT", "dependencies": { "bn.js": "^4.11.9", From 1546937e5636cb6e225a06a8e41c6e6593413c42 Mon Sep 17 00:00:00 2001 From: Richard Kenigs <18597956+Rihyx@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:40:36 +0100 Subject: [PATCH 2/5] Fix cross spawn (#393) * add cross-spawn to overrides * add cross-spawn to overrides to fix vulnerability --- .changeset/twelve-donuts-sort.md | 9 ++++ package-lock.json | 79 ++------------------------------ package.json | 3 ++ 3 files changed, 15 insertions(+), 76 deletions(-) create mode 100644 .changeset/twelve-donuts-sort.md diff --git a/.changeset/twelve-donuts-sort.md b/.changeset/twelve-donuts-sort.md new file mode 100644 index 00000000..f2c02a48 --- /dev/null +++ b/.changeset/twelve-donuts-sort.md @@ -0,0 +1,9 @@ +--- +'@moonbeam-network/xcm-builder': patch +'@moonbeam-network/xcm-config': patch +'@moonbeam-network/xcm-sdk': patch +'@moonbeam-network/xcm-types': patch +'@moonbeam-network/xcm-utils': patch +--- + +fix cross-spawn vulnerability diff --git a/package-lock.json b/package-lock.json index 559b9e4b..f89c04a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9562,9 +9562,9 @@ "peer": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", + "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -16987,13 +16987,6 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true, - "license": "ISC" - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -17721,52 +17714,6 @@ "signal-exit": "^3.0.2" } }, - "node_modules/spawndamnit/node_modules/cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "node_modules/spawndamnit/node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "license": "ISC", - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/spawndamnit/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/spawndamnit/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/spawndamnit/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -17774,26 +17721,6 @@ "dev": true, "license": "ISC" }, - "node_modules/spawndamnit/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/spawndamnit/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true, - "license": "ISC" - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", diff --git a/package.json b/package.json index 6e502fc6..072de5b9 100644 --- a/package.json +++ b/package.json @@ -74,5 +74,8 @@ "lint-staged": { "*.{js,ts}": "eslint --cache --fix --max-warnings=0", "*.{json,md}": "prettier --write" + }, + "overrides": { + "cross-spawn":"^7.0.5" } } From b4e9992c417d647f9dd1ba295d543106361ca86d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:43:22 +0100 Subject: [PATCH 3/5] Version Packages (#391) Co-authored-by: github-actions[bot] --- .changeset/silent-starfishes-peel.md | 9 -------- .changeset/twelve-donuts-sort.md | 9 -------- examples/sdk-simple/package.json | 6 ++--- package-lock.json | 34 ++++++++++++++-------------- packages/builder/CHANGELOG.md | 12 ++++++++++ packages/builder/package.json | 6 ++--- packages/config/CHANGELOG.md | 12 ++++++++++ packages/config/package.json | 6 ++--- packages/sdk/CHANGELOG.md | 14 ++++++++++++ packages/sdk/package.json | 10 ++++---- packages/types/CHANGELOG.md | 11 +++++++++ packages/types/package.json | 4 ++-- packages/utils/CHANGELOG.md | 8 +++++++ packages/utils/package.json | 2 +- 14 files changed, 91 insertions(+), 52 deletions(-) delete mode 100644 .changeset/silent-starfishes-peel.md delete mode 100644 .changeset/twelve-donuts-sort.md diff --git a/.changeset/silent-starfishes-peel.md b/.changeset/silent-starfishes-peel.md deleted file mode 100644 index ea2536ca..00000000 --- a/.changeset/silent-starfishes-peel.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@moonbeam-network/xcm-builder': patch -'@moonbeam-network/xcm-config': patch -'@moonbeam-network/xcm-sdk': patch -'@moonbeam-network/xcm-types': patch -'@moonbeam-network/xcm-utils': patch ---- - -Fix vulnerability diff --git a/.changeset/twelve-donuts-sort.md b/.changeset/twelve-donuts-sort.md deleted file mode 100644 index f2c02a48..00000000 --- a/.changeset/twelve-donuts-sort.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@moonbeam-network/xcm-builder': patch -'@moonbeam-network/xcm-config': patch -'@moonbeam-network/xcm-sdk': patch -'@moonbeam-network/xcm-types': patch -'@moonbeam-network/xcm-utils': patch ---- - -fix cross-spawn vulnerability diff --git a/examples/sdk-simple/package.json b/examples/sdk-simple/package.json index bb1e6bec..a5ef7600 100644 --- a/examples/sdk-simple/package.json +++ b/examples/sdk-simple/package.json @@ -12,9 +12,9 @@ "author": "", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-config": "2.7.4", - "@moonbeam-network/xcm-sdk": "2.7.4", - "@moonbeam-network/xcm-utils": "2.2.2" + "@moonbeam-network/xcm-config": "2.7.5", + "@moonbeam-network/xcm-sdk": "2.7.5", + "@moonbeam-network/xcm-utils": "2.2.3" }, "devDependencies": { "bun": "^1.1.31" diff --git a/package-lock.json b/package-lock.json index f89c04a0..736c530a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,9 +50,9 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-config": "2.7.4", - "@moonbeam-network/xcm-sdk": "2.7.4", - "@moonbeam-network/xcm-utils": "2.2.2" + "@moonbeam-network/xcm-config": "2.7.5", + "@moonbeam-network/xcm-sdk": "2.7.5", + "@moonbeam-network/xcm-utils": "2.2.3" }, "devDependencies": { "bun": "^1.1.31" @@ -20141,11 +20141,11 @@ }, "packages/builder": { "name": "@moonbeam-network/xcm-builder", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-types": "2.5.2", - "@moonbeam-network/xcm-utils": "2.2.2", + "@moonbeam-network/xcm-types": "2.5.3", + "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1" }, "peerDependencies": { @@ -20158,11 +20158,11 @@ }, "packages/config": { "name": "@moonbeam-network/xcm-config", - "version": "2.7.4", + "version": "2.7.5", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.4", - "@moonbeam-network/xcm-types": "2.5.2" + "@moonbeam-network/xcm-builder": "2.5.5", + "@moonbeam-network/xcm-types": "2.5.3" }, "peerDependencies": { "@polkadot/types": "^12.4.2", @@ -20172,13 +20172,13 @@ }, "packages/sdk": { "name": "@moonbeam-network/xcm-sdk", - "version": "2.7.4", + "version": "2.7.5", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.4", - "@moonbeam-network/xcm-config": "2.7.4", - "@moonbeam-network/xcm-types": "2.5.2", - "@moonbeam-network/xcm-utils": "2.2.2", + "@moonbeam-network/xcm-builder": "2.5.5", + "@moonbeam-network/xcm-config": "2.7.5", + "@moonbeam-network/xcm-types": "2.5.3", + "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1" }, "peerDependencies": { @@ -20192,10 +20192,10 @@ }, "packages/types": { "name": "@moonbeam-network/xcm-types", - "version": "2.5.2", + "version": "2.5.3", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-utils": "2.2.2", + "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1" }, "peerDependencies": { @@ -20204,7 +20204,7 @@ }, "packages/utils": { "name": "@moonbeam-network/xcm-utils", - "version": "2.2.2", + "version": "2.2.3", "license": "MIT", "dependencies": { "big.js": "^6.2.1", diff --git a/packages/builder/CHANGELOG.md b/packages/builder/CHANGELOG.md index bbbe3026..c9abba84 100644 --- a/packages/builder/CHANGELOG.md +++ b/packages/builder/CHANGELOG.md @@ -1,5 +1,17 @@ # @moonbeam-network/xcm-builder +## 2.5.5 + +### Patch Changes + +- [#390](https://github.com/moonbeam-foundation/xcm-sdk/pull/390) [`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072) Thanks [@dependabot](https://github.com/apps/dependabot)! - Fix vulnerability + +- [#393](https://github.com/moonbeam-foundation/xcm-sdk/pull/393) [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42) Thanks [@Rihyx](https://github.com/Rihyx)! - fix cross-spawn vulnerability + +- Updated dependencies [[`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072), [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42)]: + - @moonbeam-network/xcm-types@2.5.3 + - @moonbeam-network/xcm-utils@2.2.3 + ## 2.5.4 ### Patch Changes diff --git a/packages/builder/package.json b/packages/builder/package.json index d6b29070..cc7699e8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-builder", - "version": "2.5.4", + "version": "2.5.5", "description": "Moonbeam XCM builder", "scripts": { "build": "tsup", @@ -49,8 +49,8 @@ "types": "./build/index.d.ts", "main": "./build/index.cjs", "dependencies": { - "@moonbeam-network/xcm-types": "2.5.2", - "@moonbeam-network/xcm-utils": "2.2.2", + "@moonbeam-network/xcm-types": "2.5.3", + "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1" }, "peerDependencies": { diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index 0ccfbe2f..9aaa7a83 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,17 @@ # @moonbeam-network/xcm-config +## 2.7.5 + +### Patch Changes + +- [#390](https://github.com/moonbeam-foundation/xcm-sdk/pull/390) [`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072) Thanks [@dependabot](https://github.com/apps/dependabot)! - Fix vulnerability + +- [#393](https://github.com/moonbeam-foundation/xcm-sdk/pull/393) [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42) Thanks [@Rihyx](https://github.com/Rihyx)! - fix cross-spawn vulnerability + +- Updated dependencies [[`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072), [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42)]: + - @moonbeam-network/xcm-builder@2.5.5 + - @moonbeam-network/xcm-types@2.5.3 + ## 2.7.4 ### Patch Changes diff --git a/packages/config/package.json b/packages/config/package.json index 0e4ba698..0041f133 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-config", - "version": "2.7.4", + "version": "2.7.5", "description": "All necessary configuration to transfer assets from Moonbeam, Moonriver, Moonbase to other parachains and back", "scripts": { "build": "tsup", @@ -49,8 +49,8 @@ "types": "./build/index.d.ts", "main": "./build/index.cjs", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.4", - "@moonbeam-network/xcm-types": "2.5.2" + "@moonbeam-network/xcm-builder": "2.5.5", + "@moonbeam-network/xcm-types": "2.5.3" }, "peerDependencies": { "@polkadot/types": "^12.4.2", diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 9841d32f..4229b5c1 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,19 @@ # @moonbeam-network/xcm-sdk +## 2.7.5 + +### Patch Changes + +- [#390](https://github.com/moonbeam-foundation/xcm-sdk/pull/390) [`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072) Thanks [@dependabot](https://github.com/apps/dependabot)! - Fix vulnerability + +- [#393](https://github.com/moonbeam-foundation/xcm-sdk/pull/393) [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42) Thanks [@Rihyx](https://github.com/Rihyx)! - fix cross-spawn vulnerability + +- Updated dependencies [[`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072), [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42)]: + - @moonbeam-network/xcm-builder@2.5.5 + - @moonbeam-network/xcm-config@2.7.5 + - @moonbeam-network/xcm-types@2.5.3 + - @moonbeam-network/xcm-utils@2.2.3 + ## 2.7.4 ### Patch Changes diff --git a/packages/sdk/package.json b/packages/sdk/package.json index e9cfc46f..2a7764f8 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-sdk", - "version": "2.7.4", + "version": "2.7.5", "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", @@ -51,10 +51,10 @@ "types": "./build/index.d.ts", "main": "./build/index.cjs", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.4", - "@moonbeam-network/xcm-config": "2.7.4", - "@moonbeam-network/xcm-types": "2.5.2", - "@moonbeam-network/xcm-utils": "2.2.2", + "@moonbeam-network/xcm-builder": "2.5.5", + "@moonbeam-network/xcm-config": "2.7.5", + "@moonbeam-network/xcm-types": "2.5.3", + "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1" }, "peerDependencies": { diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 53e84712..895d0b89 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,16 @@ # @moonbeam-network/xcm-types +## 2.5.3 + +### Patch Changes + +- [#390](https://github.com/moonbeam-foundation/xcm-sdk/pull/390) [`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072) Thanks [@dependabot](https://github.com/apps/dependabot)! - Fix vulnerability + +- [#393](https://github.com/moonbeam-foundation/xcm-sdk/pull/393) [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42) Thanks [@Rihyx](https://github.com/Rihyx)! - fix cross-spawn vulnerability + +- Updated dependencies [[`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072), [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42)]: + - @moonbeam-network/xcm-utils@2.2.3 + ## 2.5.2 ### Patch Changes diff --git a/packages/types/package.json b/packages/types/package.json index 6a775e19..fa9c800d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-types", - "version": "2.5.2", + "version": "2.5.3", "description": "Moonbeam XCM Types", "scripts": { "build": "tsup", @@ -48,7 +48,7 @@ "types": "./build/index.d.ts", "main": "./build/index.cjs", "dependencies": { - "@moonbeam-network/xcm-utils": "2.2.2", + "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1" }, "peerDependencies": { diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 6b3ba5d2..aa11519f 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,13 @@ # @moonbeam-network/xcm-utils +## 2.2.3 + +### Patch Changes + +- [#390](https://github.com/moonbeam-foundation/xcm-sdk/pull/390) [`2790340`](https://github.com/moonbeam-foundation/xcm-sdk/commit/2790340bb8ea0edda13765875d91a3a5d993a072) Thanks [@dependabot](https://github.com/apps/dependabot)! - Fix vulnerability + +- [#393](https://github.com/moonbeam-foundation/xcm-sdk/pull/393) [`1546937`](https://github.com/moonbeam-foundation/xcm-sdk/commit/1546937e5636cb6e225a06a8e41c6e6593413c42) Thanks [@Rihyx](https://github.com/Rihyx)! - fix cross-spawn vulnerability + ## 2.2.2 ### Patch Changes diff --git a/packages/utils/package.json b/packages/utils/package.json index 49434c8f..923b6251 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-utils", - "version": "2.2.2", + "version": "2.2.3", "description": "Moonbeam XCM utilities", "scripts": { "build": "tsup", From 5d3e8b470fb9c5640ba3d27c6140e2ff09fc897d Mon Sep 17 00:00:00 2001 From: mmaurello <93129175+mmaurello@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:06:25 +0100 Subject: [PATCH 4/5] Foreign assets - Snowbridge Assets integration (#383) * add foreignAssets balance checking * add assets configurations * add extrinsic builders for foreign assets * add wsethe and wbtce configurations * add changeset * add tests to new functions * update acceptance snaps --- .changeset/moody-snakes-exercise.md | 6 + .../builder/fixtures/builderParamsMock.ts | 11 ++ .../src/asset-min/AssetMinBuilder.test.ts | 23 ++++ .../builder/src/asset-min/AssetMinBuilder.ts | 35 ++++++ .../AssetMinBuilder.test.ts.snap | 32 ++++++ .../src/balance/BalanceBuilder.test.ts | 25 +++++ .../builder/src/balance/BalanceBuilder.ts | 29 +++++ .../__snapshots__/BalanceBuilder.test.ts.snap | 33 ++++++ .../__snapshots__/polkadotXcm.test.ts.snap | 103 ++++++++++++++++++ .../pallets/polkadotXcm/polkadotXcm.test.ts | 18 +++ .../pallets/polkadotXcm/polkadotXcm.ts | 84 +++++++++++++- packages/config/src/assets.ts | 18 +++ packages/config/src/chains.ts | 33 ++++++ packages/config/src/configs/moonbeam.ts | 48 ++++++++ .../config/src/configs/polkadotAssetHub.ts | 80 +++++++++++++- .../acceptance/__snapshots__/sdk.test.ts.snap | 21 ++++ 16 files changed, 597 insertions(+), 2 deletions(-) create mode 100644 .changeset/moody-snakes-exercise.md diff --git a/.changeset/moody-snakes-exercise.md b/.changeset/moody-snakes-exercise.md new file mode 100644 index 00000000..25d26aa5 --- /dev/null +++ b/.changeset/moody-snakes-exercise.md @@ -0,0 +1,6 @@ +--- +'@moonbeam-network/xcm-builder': minor +'@moonbeam-network/xcm-config': patch +--- + +Add foreign assets configuration and Snowbridge assets tranfers between Asset Hub and Moonbeam diff --git a/packages/builder/fixtures/builderParamsMock.ts b/packages/builder/fixtures/builderParamsMock.ts index 63cdeab4..d90db2e3 100644 --- a/packages/builder/fixtures/builderParamsMock.ts +++ b/packages/builder/fixtures/builderParamsMock.ts @@ -80,3 +80,14 @@ export const buildParachainParamsMock: ExtrinsicConfigBuilderPrams = { palletInstance: 10, source: alphanetAssetHubMock, }; + +export const buildParamsMockEth: ExtrinsicConfigBuilderPrams = { + address: '0xeF46c7649270C912704fB09B75097f6E32208b85', + amount: 99_000_000_000n, + asset: '0xeF46c7649270C912704fB09B75097f6E32208b85', + destination: moonbaseAlphaMock, + fee: 5_000_000_000n, + feeAsset: 'WETH.e', + palletInstance: 10, + source: alphanetAssetHubMock, +}; diff --git a/packages/builder/src/asset-min/AssetMinBuilder.test.ts b/packages/builder/src/asset-min/AssetMinBuilder.test.ts index 93c261a5..e6904596 100644 --- a/packages/builder/src/asset-min/AssetMinBuilder.test.ts +++ b/packages/builder/src/asset-min/AssetMinBuilder.test.ts @@ -78,4 +78,27 @@ describe('assetMinBuilder', () => { }); }); }); + + describe('foreignAssets', () => { + describe('asset', () => { + const config = AssetMinBuilder() + .foreignAssets() + .asset() + .build({ asset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' }); + + it('should be correct config', () => { + expect(config).toMatchSnapshot(); + }); + + it('should transform correctly', async () => { + await expect( + config.transform({ + unwrapOrDefault: () => ({ + minBalance: balanceOf(999), + }), + }), + ).resolves.toMatchSnapshot(); + }); + }); + }); }); diff --git a/packages/builder/src/asset-min/AssetMinBuilder.ts b/packages/builder/src/asset-min/AssetMinBuilder.ts index fa2c814a..24b65552 100644 --- a/packages/builder/src/asset-min/AssetMinBuilder.ts +++ b/packages/builder/src/asset-min/AssetMinBuilder.ts @@ -3,6 +3,7 @@ import { Option } from '@polkadot/types'; import { PalletAssetsAssetDetails } from '@polkadot/types/lookup'; +import { getExtrinsicAccount } from '../extrinsic/ExtrinsicBuilder.utils'; import { SubstrateQueryConfig } from '../types/substrate/SubstrateQueryConfig'; import { AssetMinConfigBuilder } from './AssetMinBuilder.interfaces'; @@ -10,6 +11,7 @@ export function AssetMinBuilder() { return { assetRegistry, assets, + foreignAssets, }; } @@ -57,3 +59,36 @@ function assets() { }), }; } + +function foreignAssets() { + return { + asset: (): AssetMinConfigBuilder => ({ + build: ({ asset }) => { + const multilocation = { + parents: 2, + interior: { + X2: [ + { + globalconsensus: { + ethereum: { + chainId: 1, + }, + }, + }, + getExtrinsicAccount(asset as string), + ], + }, + }; + return new SubstrateQueryConfig({ + module: 'foreignAssets', + func: 'asset', + args: [multilocation], + transform: async ( + response: Option, + ): Promise => + response.unwrapOrDefault().minBalance.toBigInt(), + }); + }, + }), + }; +} diff --git a/packages/builder/src/asset-min/__snapshots__/AssetMinBuilder.test.ts.snap b/packages/builder/src/asset-min/__snapshots__/AssetMinBuilder.test.ts.snap index adbc79f6..41839f0a 100644 --- a/packages/builder/src/asset-min/__snapshots__/AssetMinBuilder.test.ts.snap +++ b/packages/builder/src/asset-min/__snapshots__/AssetMinBuilder.test.ts.snap @@ -42,6 +42,38 @@ SubstrateQueryConfig { exports[`assetMinBuilder > assets > asset > should transform correctly 1`] = `999n`; +exports[`assetMinBuilder > foreignAssets > asset > should be correct config 1`] = ` +SubstrateQueryConfig { + "args": [ + { + "interior": { + "X2": [ + { + "globalconsensus": { + "ethereum": { + "chainId": 1, + }, + }, + }, + { + "AccountKey20": { + "key": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + }, + }, + ], + }, + "parents": 2, + }, + ], + "func": "asset", + "module": "foreignAssets", + "transform": [Function], + "type": "Substrate", +} +`; + +exports[`assetMinBuilder > foreignAssets > asset > should transform correctly 1`] = `999n`; + exports[`assetMinBuilder assetRegistry assetMetadatas should be correct config 1`] = ` SubstrateQueryConfig { "args": [ diff --git a/packages/builder/src/balance/BalanceBuilder.test.ts b/packages/builder/src/balance/BalanceBuilder.test.ts index 556dcc63..d901021c 100644 --- a/packages/builder/src/balance/BalanceBuilder.test.ts +++ b/packages/builder/src/balance/BalanceBuilder.test.ts @@ -47,6 +47,31 @@ describe('balanceBuilder', () => { }); }); + describe('foreignAssets', () => { + describe('account', () => { + const config = BalanceBuilder() + .substrate() + .foreignAssets() + .account() + .build({ + address: account, + asset: `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2`, + }) as SubstrateQueryConfig; + + it('should be correct config', () => { + expect(config).toMatchSnapshot(); + }); + + it('should transform correctly', async () => { + await expect( + config.transform({ + unwrapOrDefault: () => ({ balance: balanceOf(999) }), + }), + ).resolves.toMatchSnapshot(); + }); + }); + }); + describe('system', () => { describe('account', () => { const config = BalanceBuilder() diff --git a/packages/builder/src/balance/BalanceBuilder.ts b/packages/builder/src/balance/BalanceBuilder.ts index 7675165d..68bf2987 100644 --- a/packages/builder/src/balance/BalanceBuilder.ts +++ b/packages/builder/src/balance/BalanceBuilder.ts @@ -10,6 +10,7 @@ import { import { isString } from '@polkadot/util'; import { evmToAddress } from '@polkadot/util-crypto'; import { ContractConfig } from '../contract'; +import { getExtrinsicAccount } from '../extrinsic/ExtrinsicBuilder.utils'; import { SubstrateQueryConfig } from '../types/substrate/SubstrateQueryConfig'; import { BalanceConfigBuilder, @@ -34,6 +35,7 @@ export function evm() { export function substrate() { return { assets, + foreignAssets, system, tokens, }; @@ -72,6 +74,33 @@ function assets() { }; } +function foreignAssets() { + return { + account: (): BalanceConfigBuilder => ({ + build: ({ address, asset }) => { + const multilocation = { + parents: 2, + interior: { + X2: [ + { GlobalConsensus: { ethereum: { chainId: 1 } } }, + getExtrinsicAccount(asset as string), + ], + }, + }; + + return new SubstrateQueryConfig({ + module: 'foreignAssets', + func: 'account', + args: [multilocation, address], + transform: async ( + response: Option, + ): Promise => response.unwrapOrDefault().balance.toBigInt(), + }); + }, + }), + }; +} + function system() { return { account: (): BalanceConfigBuilder => ({ diff --git a/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap b/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap index 2369c5e0..f322e223 100644 --- a/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap +++ b/packages/builder/src/balance/__snapshots__/BalanceBuilder.test.ts.snap @@ -15,6 +15,39 @@ SubstrateQueryConfig { exports[`balanceBuilder > assets > account > should transform correctly 1`] = `999n`; +exports[`balanceBuilder > foreignAssets > account > should be correct config 1`] = ` +SubstrateQueryConfig { + "args": [ + { + "interior": { + "X2": [ + { + "GlobalConsensus": { + "ethereum": { + "chainId": 1, + }, + }, + }, + { + "AccountKey20": { + "key": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + }, + }, + ], + }, + "parents": 2, + }, + "", + ], + "func": "account", + "module": "foreignAssets", + "transform": [Function], + "type": "Substrate", +} +`; + +exports[`balanceBuilder > foreignAssets > account > should transform correctly 1`] = `999n`; + exports[`balanceBuilder > system > account > should be correct config 1`] = ` SubstrateQueryConfig { "args": [ diff --git a/packages/builder/src/extrinsic/pallets/polkadotXcm/__snapshots__/polkadotXcm.test.ts.snap b/packages/builder/src/extrinsic/pallets/polkadotXcm/__snapshots__/polkadotXcm.test.ts.snap index 64049ba7..e7fe0738 100644 --- a/packages/builder/src/extrinsic/pallets/polkadotXcm/__snapshots__/polkadotXcm.test.ts.snap +++ b/packages/builder/src/extrinsic/pallets/polkadotXcm/__snapshots__/polkadotXcm.test.ts.snap @@ -462,6 +462,109 @@ exports[`polkadotXcm > limitedReserveWithdrawAssets > x2 > should get correct ar ] `; +exports[`polkadotXcm > transferAssetsUsingTypeAndThen > x2 > should be correct config 1`] = ` +ExtrinsicConfig { + "func": "transferAssetsUsingTypeAndThen", + "getArgs": [Function], + "module": "polkadotXcm", + "type": "Substrate", +} +`; + +exports[`polkadotXcm > transferAssetsUsingTypeAndThen > x2 > should get correct arguments 1`] = ` +[ + { + "V4": { + "interior": { + "X1": [ + { + "Parachain": 1000, + }, + ], + }, + "parents": 1, + }, + }, + { + "V4": [ + { + "fun": { + "fungible": 99000000000n, + }, + "id": { + "interior": { + "X2": [ + { + "globalConsensus": { + "Ethereum": { + "ChainId": 1, + }, + }, + }, + { + "AccountKey20": { + "key": "0xeF46c7649270C912704fB09B75097f6E32208b85", + }, + }, + ], + }, + "parents": 2, + }, + }, + ], + }, + "LocalReserve", + { + "V4": { + "interior": { + "X2": [ + { + "globalConsensus": { + "Ethereum": { + "ChainId": 1, + }, + }, + }, + { + "AccountKey20": { + "key": "0xeF46c7649270C912704fB09B75097f6E32208b85", + }, + }, + ], + }, + "parents": 2, + }, + }, + "LocalReserve", + { + "V4": [ + { + "DepositAsset": { + "assets": { + "Wild": { + "AllCounted": 1, + }, + }, + "beneficiary": { + "interior": { + "X1": [ + { + "AccountKey20": { + "key": "0xeF46c7649270C912704fB09B75097f6E32208b85", + }, + }, + ], + }, + "parents": 0, + }, + }, + }, + ], + }, + "Unlimited", +] +`; + exports[`polkadotXcm limitedReserveTransferAssets here should be correct config 1`] = ` ExtrinsicConfig { "func": "limitedReserveTransferAssets", diff --git a/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.test.ts b/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.test.ts index 64823acd..4baa0fbf 100644 --- a/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.test.ts +++ b/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.test.ts @@ -4,6 +4,7 @@ import { describe, expect, it } from 'vitest'; import { buildParachainParamsMock, buildParamsMock, + buildParamsMockEth, buildParamsSameAssetMock, } from '../../../../fixtures'; import { polkadotXcm } from './polkadotXcm'; @@ -119,4 +120,21 @@ describe('polkadotXcm', () => { }); }); }); + + describe('transferAssetsUsingTypeAndThen', () => { + describe('x2', () => { + const extrinsic = polkadotXcm() + .transferAssetsUsingTypeAndThen() + .globalConcensusEthereum() + .build(buildParamsMockEth); + + it('should be correct config', () => { + expect(extrinsic).toMatchSnapshot(); + }); + + it('should get correct arguments', () => { + expect(extrinsic.getArgs()).toMatchSnapshot(); + }); + }); + }); }); diff --git a/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.ts b/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.ts index a4146e6d..8143c980 100644 --- a/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.ts +++ b/packages/builder/src/extrinsic/pallets/polkadotXcm/polkadotXcm.ts @@ -1,5 +1,9 @@ /* eslint-disable sort-keys */ -import { ExtrinsicConfigBuilder } from '../../ExtrinsicBuilder.interfaces'; +import { + ExtrinsicConfigBuilder, + XcmVersion, +} from '../../ExtrinsicBuilder.interfaces'; +import { getExtrinsicAccount } from '../../ExtrinsicBuilder.utils'; import { ExtrinsicConfig } from '../../ExtrinsicConfig'; import { getPolkadotXcmExtrinsicArgs, @@ -213,5 +217,83 @@ export function polkadotXcm() { }), }; }, + transferAssetsUsingTypeAndThen: () => { + const func = 'transferAssetsUsingTypeAndThen'; + return { + // TODO we could pass a parameter globalConcensus in the chain asset + // but we can do it in V3 + globalConcensusEthereum: (): ExtrinsicConfigBuilder => ({ + build: ({ destination, address, amount, asset }) => { + const version = XcmVersion.v4; + return new ExtrinsicConfig({ + module: pallet, + func, + + getArgs: () => [ + { + [version]: { + parents: 1, + interior: { + X1: [ + { + Parachain: destination.parachainId, + }, + ], + }, + }, + }, + { + [version]: [ + { + id: { + parents: 2, + interior: { + X2: [ + { globalConsensus: { Ethereum: { ChainId: 1 } } }, + getExtrinsicAccount(asset as string), + ], + }, + }, + fun: { fungible: amount }, + }, + ], + }, + 'LocalReserve', + { + [version]: { + parents: 2, + interior: { + X2: [ + { globalConsensus: { Ethereum: { ChainId: 1 } } }, + getExtrinsicAccount(asset as string), + ], + }, + }, + }, + 'LocalReserve', + { + [version]: [ + { + DepositAsset: { + assets: { + Wild: { AllCounted: 1 }, + }, + beneficiary: { + parents: 0, + interior: { + X1: [getExtrinsicAccount(address)], + }, + }, + }, + }, + ], + }, + 'Unlimited', + ], + }); + }, + }), + }; + }, }; } diff --git a/packages/config/src/assets.ts b/packages/config/src/assets.ts index 27687606..4f7495ad 100644 --- a/packages/config/src/assets.ts +++ b/packages/config/src/assets.ts @@ -385,6 +385,21 @@ export const ftmwh = new Asset({ originSymbol: 'FTM.wh', }); +export const wbtce = new Asset({ + key: 'wbtce', + originSymbol: 'WBTC.e', +}); + +export const wstethe = new Asset({ + key: 'wstethe', + originSymbol: 'wstETH.e', +}); + +export const wethe = new Asset({ + key: 'wethe', + originSymbol: 'WETH.e', +}); + export const assetsList: Asset[] = [ aca, alan, @@ -457,9 +472,12 @@ export const assetsList: Asset[] = [ vmanta, vmovr, wbtc, + wbtce, weth, + wethe, wftm, wifd, + wstethe, xrt, ztg, ]; diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 6635d3d0..ed9851a6 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -75,8 +75,11 @@ import { vmanta, vmovr, wbtc, + wbtce, weth, + wethe, wifd, + wstethe, xrt, ztg, } from './assets'; @@ -1106,6 +1109,18 @@ export const moonbeam = new EvmParachain({ asset: wifd, id: '61295607754960722617854661686514597014', }, + { + asset: wbtce, + id: '36282181791341254438422467838694599751', + }, + { + asset: wethe, + id: '178794693648360392906933130845919698647', + }, + { + asset: wstethe, + id: '124105859028862849477017063633156007283', + }, ], ecosystem: Ecosystem.Polkadot, genesisHash: @@ -1719,6 +1734,24 @@ export const polkadotAssetHub = new Parachain({ id: 17, palletInstance: 50, }, + { + address: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', + asset: wbtce, + decimals: 8, + id: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', + }, + { + address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + asset: wethe, + decimals: 18, + id: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + }, + { + address: '0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0', + asset: wstethe, + decimals: 18, + id: '0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0', + }, ], checkSovereignAccountBalances: true, ecosystem: Ecosystem.Polkadot, diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index bb24a3d6..d721cc8d 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -37,8 +37,11 @@ import { vglmr, vmanta, wbtc, + wbtce, weth, + wethe, wifd, + wstethe, ztg, } from '../assets'; import { @@ -951,6 +954,51 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().evm().erc20(), }, }), + new AssetConfig({ + asset: wethe, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: polkadotAssetHub, + destinationFee: { + amount: 0.0000035, + asset: wethe, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: wbtce, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: polkadotAssetHub, + destinationFee: { + amount: 0.0000004, + asset: wbtce, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: wstethe, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: polkadotAssetHub, + destinationFee: { + amount: 0.000006, + asset: wstethe, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), ], chain: moonbeam, }); diff --git a/packages/config/src/configs/polkadotAssetHub.ts b/packages/config/src/configs/polkadotAssetHub.ts index 2d47b8c1..cc79ef69 100644 --- a/packages/config/src/configs/polkadotAssetHub.ts +++ b/packages/config/src/configs/polkadotAssetHub.ts @@ -4,7 +4,19 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { apillon, ded, dot, pink, stink, usdc, usdt, wifd } from '../assets'; +import { + apillon, + ded, + dot, + pink, + stink, + usdc, + usdt, + wbtce, + wethe, + wifd, + wstethe, +} from '../assets'; import { moonbeam, polkadotAssetHub } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -189,6 +201,72 @@ export const polkadotAssetHubConfig = new ChainConfig({ }, min: AssetMinBuilder().assets().asset(), }), + new AssetConfig({ + asset: wethe, + balance: BalanceBuilder().substrate().foreignAssets().account(), + destination: moonbeam, + destinationFee: { + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + }), + asset: wethe, + balance: BalanceBuilder().substrate().assets().account(), + }, + extrinsic: ExtrinsicBuilder() + .polkadotXcm() + .transferAssetsUsingTypeAndThen() + .globalConcensusEthereum(), + fee: { + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + xcmDeliveryFeeAmount, + }, + min: AssetMinBuilder().foreignAssets().asset(), + }), + new AssetConfig({ + asset: wbtce, + balance: BalanceBuilder().substrate().foreignAssets().account(), + destination: moonbeam, + destinationFee: { + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + }), + asset: wbtce, + balance: BalanceBuilder().substrate().assets().account(), + }, + extrinsic: ExtrinsicBuilder() + .polkadotXcm() + .transferAssetsUsingTypeAndThen() + .globalConcensusEthereum(), + fee: { + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + xcmDeliveryFeeAmount, + }, + min: AssetMinBuilder().foreignAssets().asset(), + }), + new AssetConfig({ + asset: wstethe, + balance: BalanceBuilder().substrate().foreignAssets().account(), + destination: moonbeam, + destinationFee: { + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + }), + asset: wstethe, + balance: BalanceBuilder().substrate().assets().account(), + }, + extrinsic: ExtrinsicBuilder() + .polkadotXcm() + .transferAssetsUsingTypeAndThen() + .globalConcensusEthereum(), + fee: { + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + xcmDeliveryFeeAmount, + }, + min: AssetMinBuilder().foreignAssets().asset(), + }), ], chain: polkadotAssetHub, }); diff --git a/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap b/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap index 95b3a0e8..121e47b5 100644 --- a/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap +++ b/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap @@ -315,6 +315,27 @@ exports[`sdk > getParachainBalances > on 'Moonbase Beta' for address: '0x4E82143 exports[`sdk > getParachainBalances > on 'Moonbeam' for address: '0x4E82143Af671Cc8201Bc7efCBbCED3A69e8…' > should get expected balances 1`] = ` [ + r { + "amount": 0n, + "decimals": 18, + "key": "wstethe", + "originSymbol": "wstETH.e", + "symbol": "wstETH.e", + }, + r { + "amount": 0n, + "decimals": 8, + "key": "wbtce", + "originSymbol": "WBTC.e", + "symbol": "WBTC.e", + }, + r { + "amount": 0n, + "decimals": 18, + "key": "wethe", + "originSymbol": "WETH.e", + "symbol": "WETH.e", + }, r { "amount": 0n, "decimals": 6, From 3fc89feb67ca26814ab63e50add477ed9ccd96ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:16:22 +0100 Subject: [PATCH 5/5] Version Packages (#399) Co-authored-by: github-actions[bot] --- .changeset/moody-snakes-exercise.md | 6 ------ examples/sdk-simple/package.json | 4 ++-- package-lock.json | 16 ++++++++-------- packages/builder/CHANGELOG.md | 6 ++++++ packages/builder/package.json | 2 +- packages/config/CHANGELOG.md | 9 +++++++++ packages/config/package.json | 4 ++-- packages/sdk/CHANGELOG.md | 8 ++++++++ packages/sdk/package.json | 6 +++--- 9 files changed, 39 insertions(+), 22 deletions(-) delete mode 100644 .changeset/moody-snakes-exercise.md diff --git a/.changeset/moody-snakes-exercise.md b/.changeset/moody-snakes-exercise.md deleted file mode 100644 index 25d26aa5..00000000 --- a/.changeset/moody-snakes-exercise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@moonbeam-network/xcm-builder': minor -'@moonbeam-network/xcm-config': patch ---- - -Add foreign assets configuration and Snowbridge assets tranfers between Asset Hub and Moonbeam diff --git a/examples/sdk-simple/package.json b/examples/sdk-simple/package.json index a5ef7600..ff0ea9c3 100644 --- a/examples/sdk-simple/package.json +++ b/examples/sdk-simple/package.json @@ -12,8 +12,8 @@ "author": "", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-config": "2.7.5", - "@moonbeam-network/xcm-sdk": "2.7.5", + "@moonbeam-network/xcm-config": "2.7.6", + "@moonbeam-network/xcm-sdk": "2.7.6", "@moonbeam-network/xcm-utils": "2.2.3" }, "devDependencies": { diff --git a/package-lock.json b/package-lock.json index 736c530a..6c78b0b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,8 +50,8 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-config": "2.7.5", - "@moonbeam-network/xcm-sdk": "2.7.5", + "@moonbeam-network/xcm-config": "2.7.6", + "@moonbeam-network/xcm-sdk": "2.7.6", "@moonbeam-network/xcm-utils": "2.2.3" }, "devDependencies": { @@ -20141,7 +20141,7 @@ }, "packages/builder": { "name": "@moonbeam-network/xcm-builder", - "version": "2.5.5", + "version": "2.6.0", "license": "MIT", "dependencies": { "@moonbeam-network/xcm-types": "2.5.3", @@ -20158,10 +20158,10 @@ }, "packages/config": { "name": "@moonbeam-network/xcm-config", - "version": "2.7.5", + "version": "2.7.6", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.5", + "@moonbeam-network/xcm-builder": "2.6.0", "@moonbeam-network/xcm-types": "2.5.3" }, "peerDependencies": { @@ -20172,11 +20172,11 @@ }, "packages/sdk": { "name": "@moonbeam-network/xcm-sdk", - "version": "2.7.5", + "version": "2.7.6", "license": "MIT", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.5", - "@moonbeam-network/xcm-config": "2.7.5", + "@moonbeam-network/xcm-builder": "2.6.0", + "@moonbeam-network/xcm-config": "2.7.6", "@moonbeam-network/xcm-types": "2.5.3", "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1" diff --git a/packages/builder/CHANGELOG.md b/packages/builder/CHANGELOG.md index c9abba84..42d4a0c1 100644 --- a/packages/builder/CHANGELOG.md +++ b/packages/builder/CHANGELOG.md @@ -1,5 +1,11 @@ # @moonbeam-network/xcm-builder +## 2.6.0 + +### Minor Changes + +- [#383](https://github.com/moonbeam-foundation/xcm-sdk/pull/383) [`5d3e8b4`](https://github.com/moonbeam-foundation/xcm-sdk/commit/5d3e8b470fb9c5640ba3d27c6140e2ff09fc897d) Thanks [@mmaurello](https://github.com/mmaurello)! - Add foreign assets configuration and Snowbridge assets tranfers between Asset Hub and Moonbeam + ## 2.5.5 ### Patch Changes diff --git a/packages/builder/package.json b/packages/builder/package.json index cc7699e8..18e0a153 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-builder", - "version": "2.5.5", + "version": "2.6.0", "description": "Moonbeam XCM builder", "scripts": { "build": "tsup", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index 9aaa7a83..57c97030 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,14 @@ # @moonbeam-network/xcm-config +## 2.7.6 + +### Patch Changes + +- [#383](https://github.com/moonbeam-foundation/xcm-sdk/pull/383) [`5d3e8b4`](https://github.com/moonbeam-foundation/xcm-sdk/commit/5d3e8b470fb9c5640ba3d27c6140e2ff09fc897d) Thanks [@mmaurello](https://github.com/mmaurello)! - Add foreign assets configuration and Snowbridge assets tranfers between Asset Hub and Moonbeam + +- Updated dependencies [[`5d3e8b4`](https://github.com/moonbeam-foundation/xcm-sdk/commit/5d3e8b470fb9c5640ba3d27c6140e2ff09fc897d)]: + - @moonbeam-network/xcm-builder@2.6.0 + ## 2.7.5 ### Patch Changes diff --git a/packages/config/package.json b/packages/config/package.json index 0041f133..4d1e7781 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-config", - "version": "2.7.5", + "version": "2.7.6", "description": "All necessary configuration to transfer assets from Moonbeam, Moonriver, Moonbase to other parachains and back", "scripts": { "build": "tsup", @@ -49,7 +49,7 @@ "types": "./build/index.d.ts", "main": "./build/index.cjs", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.5", + "@moonbeam-network/xcm-builder": "2.6.0", "@moonbeam-network/xcm-types": "2.5.3" }, "peerDependencies": { diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 4229b5c1..3cbb7c45 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,13 @@ # @moonbeam-network/xcm-sdk +## 2.7.6 + +### Patch Changes + +- Updated dependencies [[`5d3e8b4`](https://github.com/moonbeam-foundation/xcm-sdk/commit/5d3e8b470fb9c5640ba3d27c6140e2ff09fc897d)]: + - @moonbeam-network/xcm-builder@2.6.0 + - @moonbeam-network/xcm-config@2.7.6 + ## 2.7.5 ### Patch Changes diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 2a7764f8..5654d9f1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@moonbeam-network/xcm-sdk", - "version": "2.7.5", + "version": "2.7.6", "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", @@ -51,8 +51,8 @@ "types": "./build/index.d.ts", "main": "./build/index.cjs", "dependencies": { - "@moonbeam-network/xcm-builder": "2.5.5", - "@moonbeam-network/xcm-config": "2.7.5", + "@moonbeam-network/xcm-builder": "2.6.0", + "@moonbeam-network/xcm-config": "2.7.6", "@moonbeam-network/xcm-types": "2.5.3", "@moonbeam-network/xcm-utils": "2.2.3", "big.js": "^6.2.1"