From a2b7c8f411a1cb807752db6157c6adb756f54166 Mon Sep 17 00:00:00 2001 From: Nuno Date: Tue, 12 Nov 2024 18:19:55 +0100 Subject: [PATCH] fix: Lookup AH Local AssetId when transferring to AH (#176) --- app/pnpm-lock.yaml | 70 +++++++++++++++++++------------------- app/src/config/registry.ts | 12 +++---- app/src/utils/paraspell.ts | 32 ++++++++--------- 3 files changed, 56 insertions(+), 58 deletions(-) diff --git a/app/pnpm-lock.yaml b/app/pnpm-lock.yaml index 16ecf88f..dd6e743b 100644 --- a/app/pnpm-lock.yaml +++ b/app/pnpm-lock.yaml @@ -15617,10 +15617,10 @@ snapshots: '@noble/hashes': 1.5.0 '@polkadot/networks': 12.6.2 '@polkadot/util': 12.6.2 - '@polkadot/wasm-crypto': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-crypto': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2))) '@polkadot/wasm-util': 7.4.1(@polkadot/util@12.6.2) '@polkadot/x-bigint': 12.6.2 - '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2)) '@scure/base': 1.1.9 tslib: 2.8.0 @@ -15643,10 +15643,10 @@ snapshots: '@noble/hashes': 1.5.0 '@polkadot/networks': 13.2.2 '@polkadot/util': 13.2.2 - '@polkadot/wasm-crypto': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-crypto': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2))) '@polkadot/wasm-util': 7.4.1(@polkadot/util@13.2.2) '@polkadot/x-bigint': 13.2.2 - '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2)) '@scure/base': 1.1.9 tslib: 2.8.1 @@ -15764,11 +15764,11 @@ snapshots: '@polkadot/util': 10.4.2 '@polkadot/x-randomvalues': 10.4.2 - '@polkadot/wasm-bridge@7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': + '@polkadot/wasm-bridge@7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2)))': dependencies: '@polkadot/util': 12.6.2 '@polkadot/wasm-util': 7.4.1(@polkadot/util@12.6.2) - '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2)) tslib: 2.8.0 '@polkadot/wasm-bridge@7.4.1(@polkadot/util@13.2.1)(@polkadot/x-randomvalues@13.2.1(@polkadot/util@13.2.1)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': @@ -15778,11 +15778,11 @@ snapshots: '@polkadot/x-randomvalues': 13.2.1(@polkadot/util@13.2.1)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) tslib: 2.8.0 - '@polkadot/wasm-bridge@7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': + '@polkadot/wasm-bridge@7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2)))': dependencies: '@polkadot/util': 13.2.2 '@polkadot/wasm-util': 7.4.1(@polkadot/util@13.2.2) - '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2)) tslib: 2.8.0 '@polkadot/wasm-crypto-asmjs@4.6.1(@polkadot/util@6.11.1)': @@ -15829,14 +15829,14 @@ snapshots: '@polkadot/wasm-crypto-wasm': 6.4.1(@polkadot/util@10.4.2) '@polkadot/x-randomvalues': 10.4.2 - '@polkadot/wasm-crypto-init@7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': + '@polkadot/wasm-crypto-init@7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2)))': dependencies: '@polkadot/util': 12.6.2 - '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2))) '@polkadot/wasm-crypto-asmjs': 7.4.1(@polkadot/util@12.6.2) '@polkadot/wasm-crypto-wasm': 7.4.1(@polkadot/util@12.6.2) '@polkadot/wasm-util': 7.4.1(@polkadot/util@12.6.2) - '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2)) tslib: 2.8.0 '@polkadot/wasm-crypto-init@7.4.1(@polkadot/util@13.2.1)(@polkadot/x-randomvalues@13.2.1(@polkadot/util@13.2.1)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': @@ -15849,14 +15849,14 @@ snapshots: '@polkadot/x-randomvalues': 13.2.1(@polkadot/util@13.2.1)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) tslib: 2.8.0 - '@polkadot/wasm-crypto-init@7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': + '@polkadot/wasm-crypto-init@7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2)))': dependencies: '@polkadot/util': 13.2.2 - '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2))) '@polkadot/wasm-crypto-asmjs': 7.4.1(@polkadot/util@13.2.2) '@polkadot/wasm-crypto-wasm': 7.4.1(@polkadot/util@13.2.2) '@polkadot/wasm-util': 7.4.1(@polkadot/util@13.2.2) - '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2)) tslib: 2.8.0 '@polkadot/wasm-crypto-wasm@4.6.1(@polkadot/util@6.11.1)': @@ -15933,15 +15933,15 @@ snapshots: '@polkadot/wasm-util': 6.4.1(@polkadot/util@10.4.2) '@polkadot/x-randomvalues': 10.4.2 - '@polkadot/wasm-crypto@7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': + '@polkadot/wasm-crypto@7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2)))': dependencies: '@polkadot/util': 12.6.2 - '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2))) '@polkadot/wasm-crypto-asmjs': 7.4.1(@polkadot/util@12.6.2) - '@polkadot/wasm-crypto-init': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-crypto-init': 7.4.1(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2))) '@polkadot/wasm-crypto-wasm': 7.4.1(@polkadot/util@12.6.2) '@polkadot/wasm-util': 7.4.1(@polkadot/util@12.6.2) - '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2)) tslib: 2.8.0 '@polkadot/wasm-crypto@7.4.1(@polkadot/util@13.2.1)(@polkadot/x-randomvalues@13.2.1(@polkadot/util@13.2.1)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': @@ -15955,15 +15955,15 @@ snapshots: '@polkadot/x-randomvalues': 13.2.1(@polkadot/util@13.2.1)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) tslib: 2.8.0 - '@polkadot/wasm-crypto@7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)))': + '@polkadot/wasm-crypto@7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2)))': dependencies: '@polkadot/util': 13.2.2 - '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-bridge': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2))) '@polkadot/wasm-crypto-asmjs': 7.4.1(@polkadot/util@13.2.2) - '@polkadot/wasm-crypto-init': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))) + '@polkadot/wasm-crypto-init': 7.4.1(@polkadot/util@13.2.2)(@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2))) '@polkadot/wasm-crypto-wasm': 7.4.1(@polkadot/util@13.2.2) '@polkadot/wasm-util': 7.4.1(@polkadot/util@13.2.2) - '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1)) + '@polkadot/x-randomvalues': 13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2)) tslib: 2.8.0 '@polkadot/wasm-util@6.4.1(@polkadot/util@10.4.2)': @@ -16074,10 +16074,10 @@ snapshots: '@babel/runtime': 7.26.0 '@polkadot/x-global': 10.4.2 - '@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))': + '@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@12.6.2))': dependencies: '@polkadot/util': 12.6.2 - '@polkadot/wasm-util': 7.4.1(@polkadot/util@13.2.1) + '@polkadot/wasm-util': 7.4.1(@polkadot/util@12.6.2) '@polkadot/x-global': 12.6.2 tslib: 2.8.0 @@ -16088,10 +16088,10 @@ snapshots: '@polkadot/x-global': 13.2.1 tslib: 2.8.0 - '@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.1))': + '@polkadot/x-randomvalues@13.2.2(@polkadot/util@13.2.2)(@polkadot/wasm-util@7.4.1(@polkadot/util@13.2.2))': dependencies: '@polkadot/util': 13.2.2 - '@polkadot/wasm-util': 7.4.1(@polkadot/util@13.2.1) + '@polkadot/wasm-util': 7.4.1(@polkadot/util@13.2.2) '@polkadot/x-global': 13.2.2 tslib: 2.8.1 @@ -20867,8 +20867,8 @@ snapshots: '@typescript-eslint/parser': 7.2.0(eslint@8.57.1)(typescript@5.6.3) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.57.1) eslint-plugin-react: 7.37.2(eslint@8.57.1) eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705(eslint@8.57.1) @@ -20891,19 +20891,19 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.3.7(supports-color@8.1.1) enhanced-resolve: 5.17.1 eslint: 8.57.1 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1) fast-glob: 3.3.2 get-tsconfig: 4.8.1 is-bun-module: 1.2.1 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node @@ -20920,14 +20920,14 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1): dependencies: debug: 3.2.7(supports-color@8.1.1) optionalDependencies: '@typescript-eslint/parser': 7.2.0(eslint@8.57.1)(typescript@5.6.3) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1) transitivePeerDependencies: - supports-color @@ -20960,7 +20960,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -20971,7 +20971,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 diff --git a/app/src/config/registry.ts b/app/src/config/registry.ts index 9e16492e..64c5c9b3 100644 --- a/app/src/config/registry.ts +++ b/app/src/config/registry.ts @@ -793,6 +793,12 @@ export const mainnetRegistry: Registry = { sdk: 'ParaSpellApi', tokens: [Mainnet.DOT.id], }, + { + from: Mainnet.Hydration.uid, + to: Mainnet.Moonbeam.uid, + sdk: 'ParaSpellApi', + tokens: [Mainnet.DOT.id, Mainnet.HDX.id], + }, { from: Mainnet.Bifrost.uid, to: Mainnet.RelayChain.uid, @@ -849,12 +855,6 @@ export const mainnetRegistry: Registry = { sdk: 'ParaSpellApi', tokens: [Mainnet.ACA.id, Mainnet.DOT.id], }, - { - from: Mainnet.Hydration.uid, - to: Mainnet.Moonbeam.uid, - sdk: 'ParaSpellApi', - tokens: [Mainnet.DOT.id, Mainnet.HDX.id], - }, { from: Mainnet.Hydration.uid, to: Mainnet.Moonbeam.uid, diff --git a/app/src/utils/paraspell.ts b/app/src/utils/paraspell.ts index cc3ba726..7ccbe7ba 100644 --- a/app/src/utils/paraspell.ts +++ b/app/src/utils/paraspell.ts @@ -60,8 +60,8 @@ export const createTx = async ( ) return await Builder(api) - .from(sourceChainFromId as Exclude) - .to(destinationChainFromId as Exclude) + .from(sourceChainFromId as ParaChain) + .to(destinationChainFromId as ParaChain) .currency(currencyId) .amount(amount) .address(recipient) @@ -69,6 +69,8 @@ export const createTx = async ( } } +type ParaChain = Exclude + export const getTokenSymbol = (sourceChain: TNodeDotKsmWithRelayChains, token: Token) => { // TODO(victor): write some tests const supportedAssets = assets.getAllAssetsSymbols(sourceChain) @@ -94,7 +96,8 @@ export const getRelayNode = (env: Environment): 'polkadot' => { /** * Get the ParaSpell currency id in the form of `TCurrencyCore`. * - * @remarks We prioritize an local asset id if specified in our registry and otherwise default to the paraspell token symbol. AH edge case is handled. + * @remarks We prioritize an local asset id if specified in our registry and otherwise default + * to the paraspell token symbol. AH edge case is handled. * * */ export function getCurrencyId( @@ -104,19 +107,14 @@ export function getCurrencyId( token: Token, destinationChain?: Chain, ): TCurrencyCore { - if (destinationChain && isAssetHub(destinationChain)) { - // When sending a token to AssetHub, - // this currency id must be specified in a way that's known to AssetHub rather than - // providing an identifier relative to the source chain. To quote Dudo's message: - // "So every Parachain with xTokens transfering to AssetHub (If compatible) have to - // enter asset ID on asset hub(the asset id you wish to receive) rather than on source chain" - // TODO(nuno): probably need to pass multilocation when it's AH dest - const relay = getRelayNode(env) - const destinationChainNode = assets.getTNode(destinationChain.chainId, relay) - if (!destinationChainNode) throw new Error('Transfer failed: chain id not found.') - return { symbol: getTokenSymbol(destinationChainNode, token) } - } + // When sending a token to AssetHub, this currency id must be specified in a way that's + // known to AssetHub rather than providing an identifier relative to the source chain. + // Quoting Dudo: + // "So every Parachain with xTokens transfering to AssetHub (If compatible) have to + // enter asset ID on asset hub(the asset id you wish to receive) rather than on source chain" + const lookupChainId = + destinationChain && isAssetHub(destinationChain) ? destinationChain.uid : chainId + const localAssetId = getAssetUid(env, lookupChainId, token.id) - const localAssetId = getAssetUid(env, chainId, token.id) - return localAssetId ?? { symbol: getTokenSymbol(node, token) } // Fallback to token symbol + return localAssetId ?? { symbol: getTokenSymbol(node, token) } }