@paraspell/evm-snowbridge 13.11.0 → 14.0.0
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/dist/index.mjs +15 -21
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getParaId, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, RoutingResolutionError, assertHasId, DEFAULT_TTL_MS, findAssetInfoOrThrow, abstractDecimals,
|
|
1
|
+
import { getParaId, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, RoutingResolutionError, assertHasId, DEFAULT_TTL_MS, findAssetInfoOrThrow, abstractDecimals, UnsupportedOperationError, MissingParameterError, assertEvmAddress, registerEvmSnowbridgeExtension } from '@paraspell/sdk-core';
|
|
2
2
|
import { toPolkadotV2, SnowbridgeApi } from '@snowbridge/api';
|
|
3
3
|
import { ViemEthereumProvider } from '@snowbridge/provider-viem';
|
|
4
4
|
import { bridgeInfoFor } from '@snowbridge/registry';
|
|
@@ -244,12 +244,6 @@ var buildSnowbridgeTransfer = /*#__PURE__*/function () {
|
|
|
244
244
|
}
|
|
245
245
|
throw new UnsupportedOperationError('Multi-assets are not yet supported for Snowbridge transfers');
|
|
246
246
|
case 1:
|
|
247
|
-
if (!('location' in currency && isOverrideLocationSpecifier(currency.location))) {
|
|
248
|
-
_context.n = 2;
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
throw new UnsupportedOperationError('Override location is not supported for Snowbridge transfers');
|
|
252
|
-
case 2:
|
|
253
247
|
ethAsset = findAssetInfoOrThrow('Ethereum', currency, to);
|
|
254
248
|
amount = abstractDecimals(currency.amount, ethAsset.decimals, api);
|
|
255
249
|
info = bridgeInfoFor('polkadot_mainnet');
|
|
@@ -261,18 +255,18 @@ var buildSnowbridgeTransfer = /*#__PURE__*/function () {
|
|
|
261
255
|
ethereumProvider: new ViemEthereumProvider()
|
|
262
256
|
});
|
|
263
257
|
if (!(client !== null && client !== void 0)) {
|
|
264
|
-
_context.n =
|
|
258
|
+
_context.n = 2;
|
|
265
259
|
break;
|
|
266
260
|
}
|
|
267
261
|
_t = client;
|
|
268
|
-
_context.n = 5;
|
|
269
|
-
break;
|
|
270
|
-
case 3:
|
|
271
262
|
_context.n = 4;
|
|
263
|
+
break;
|
|
264
|
+
case 2:
|
|
265
|
+
_context.n = 3;
|
|
272
266
|
return leaseClient(ETHEREUM_WS_URLS, DEFAULT_TTL_MS);
|
|
273
|
-
case
|
|
267
|
+
case 3:
|
|
274
268
|
_t = _context.v;
|
|
275
|
-
case
|
|
269
|
+
case 4:
|
|
276
270
|
publicClient = _t;
|
|
277
271
|
snowbridgeApi.context.setEthProvider(environment.ethChainId, publicClient);
|
|
278
272
|
destParaId = getParaId(to);
|
|
@@ -284,22 +278,22 @@ var buildSnowbridgeTransfer = /*#__PURE__*/function () {
|
|
|
284
278
|
kind: 'polkadot',
|
|
285
279
|
id: destParaId
|
|
286
280
|
});
|
|
287
|
-
_context.n =
|
|
281
|
+
_context.n = 5;
|
|
288
282
|
return sender.fee(ethAsset.assetId);
|
|
289
|
-
case
|
|
283
|
+
case 5:
|
|
290
284
|
fee = _context.v;
|
|
291
|
-
_context.n =
|
|
285
|
+
_context.n = 6;
|
|
292
286
|
return sender.tx(senderAddress, recipient, ethAsset.assetId, amount, fee);
|
|
293
|
-
case
|
|
287
|
+
case 6:
|
|
294
288
|
transfer = _context.v;
|
|
295
|
-
_context.n =
|
|
289
|
+
_context.n = 7;
|
|
296
290
|
return sender.validate(transfer);
|
|
297
|
-
case
|
|
291
|
+
case 7:
|
|
298
292
|
validated = _context.v;
|
|
299
293
|
if (!validated.logs.find(function (l) {
|
|
300
294
|
return l.kind === toPolkadotV2.ValidationKind.Error;
|
|
301
295
|
})) {
|
|
302
|
-
_context.n =
|
|
296
|
+
_context.n = 8;
|
|
303
297
|
break;
|
|
304
298
|
}
|
|
305
299
|
throw new RoutingResolutionError("Validation failed with following errors: \n\n ".concat(validated.logs.filter(function (l) {
|
|
@@ -307,7 +301,7 @@ var buildSnowbridgeTransfer = /*#__PURE__*/function () {
|
|
|
307
301
|
}).map(function (l) {
|
|
308
302
|
return l.message;
|
|
309
303
|
}).join('\n\n')));
|
|
310
|
-
case
|
|
304
|
+
case 8:
|
|
311
305
|
_transfer$tx = transfer.tx, txTo = _transfer$tx.to, data = _transfer$tx.data, value = _transfer$tx.value;
|
|
312
306
|
tx = {
|
|
313
307
|
type: 'eip1559',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/evm-snowbridge",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "Optional Snowbridge extension for @paraspell/sdk enabling Ethereum -> Polkadot transfers.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@snowbridge/provider-viem": "^1.1.6",
|
|
30
30
|
"@snowbridge/registry": "^1.1.6",
|
|
31
31
|
"viem": "^2.53.1",
|
|
32
|
-
"@paraspell/sdk-core": "
|
|
32
|
+
"@paraspell/sdk-core": "14.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|