@paraspell/sdk 13.2.0 → 13.2.1
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 +19 -23
- package/package.json +2 -4
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,6 @@ import { entropyToMiniSecret, mnemonicToEntropy, DEV_PHRASE } from '@polkadot-la
|
|
|
8
8
|
import { AccountId, Binary, getSs58AddressInfo } from 'polkadot-api';
|
|
9
9
|
import { getPolkadotSigner } from 'polkadot-api/signer';
|
|
10
10
|
import { blake2b } from '@noble/hashes/blake2.js';
|
|
11
|
-
import { XcmVersionedLocation, XcmV5Junctions } from '@polkadot-api/descriptors';
|
|
12
11
|
import { toHex } from 'polkadot-api/utils';
|
|
13
12
|
import { createWsClient } from 'polkadot-api/ws';
|
|
14
13
|
import { isAddress, isHex } from 'viem';
|
|
@@ -729,7 +728,6 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
729
728
|
_classCallCheck(this, PapiApi);
|
|
730
729
|
_this = _callSuper(this, PapiApi, arguments);
|
|
731
730
|
_this.type = 'PAPI';
|
|
732
|
-
_this._typedApi = null;
|
|
733
731
|
_this._untypedApi = null;
|
|
734
732
|
return _this;
|
|
735
733
|
}
|
|
@@ -769,12 +767,6 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
769
767
|
}
|
|
770
768
|
return init;
|
|
771
769
|
}()
|
|
772
|
-
}, {
|
|
773
|
-
key: "typedApi",
|
|
774
|
-
get: function get() {
|
|
775
|
-
if (!this._typedApi) this._typedApi = this.api.getUnsafeApi();
|
|
776
|
-
return this._typedApi;
|
|
777
|
-
}
|
|
778
770
|
}, {
|
|
779
771
|
key: "untypedApi",
|
|
780
772
|
get: function get() {
|
|
@@ -878,11 +870,16 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
878
870
|
while (1) switch (_context3.n) {
|
|
879
871
|
case 0:
|
|
880
872
|
transformedObj = _transform(obj);
|
|
881
|
-
tx = this.
|
|
882
|
-
dest:
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
873
|
+
tx = this.untypedApi.tx.PolkadotXcm.send({
|
|
874
|
+
dest: {
|
|
875
|
+
type: version,
|
|
876
|
+
value: {
|
|
877
|
+
parents: Parents.ZERO,
|
|
878
|
+
interior: {
|
|
879
|
+
type: 'Here'
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
},
|
|
886
883
|
message: transformedObj
|
|
887
884
|
});
|
|
888
885
|
removeFirst5Bytes = function removeFirst5Bytes(hexString) {
|
|
@@ -1007,7 +1004,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1007
1004
|
transformedFromMl = _transform(fromMl);
|
|
1008
1005
|
transformedToMl = _transform(toMl);
|
|
1009
1006
|
_context6.n = 1;
|
|
1010
|
-
return this.
|
|
1007
|
+
return this.untypedApi.apis.AssetConversionApi.quote_price_exact_tokens_for_tokens(transformedFromMl, transformedToMl, amountIn, includeFee);
|
|
1011
1008
|
case 1:
|
|
1012
1009
|
response = _context6.v;
|
|
1013
1010
|
return _context6.a(2, response ? BigInt(response) : undefined);
|
|
@@ -1335,16 +1332,15 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1335
1332
|
key: "getXcmWeight",
|
|
1336
1333
|
value: function () {
|
|
1337
1334
|
var _getXcmWeight = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(xcm) {
|
|
1338
|
-
var
|
|
1335
|
+
var weightRes, success, value, ref_time, proof_size;
|
|
1339
1336
|
return _regenerator().w(function (_context1) {
|
|
1340
1337
|
while (1) switch (_context1.n) {
|
|
1341
1338
|
case 0:
|
|
1342
1339
|
_context1.n = 1;
|
|
1343
|
-
return this.
|
|
1340
|
+
return this.untypedApi.apis.XcmPaymentApi.query_xcm_weight(!xcm.type ? _transform(xcm) : xcm);
|
|
1344
1341
|
case 1:
|
|
1345
|
-
|
|
1346
|
-
success =
|
|
1347
|
-
value = _yield$this$typedApi$.value;
|
|
1342
|
+
weightRes = _context1.v;
|
|
1343
|
+
success = weightRes.success, value = weightRes.value;
|
|
1348
1344
|
if (success) {
|
|
1349
1345
|
_context1.n = 2;
|
|
1350
1346
|
break;
|
|
@@ -1481,7 +1477,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1481
1477
|
while (1) switch (_context11.n) {
|
|
1482
1478
|
case 0:
|
|
1483
1479
|
_context11.n = 1;
|
|
1484
|
-
return _this4.
|
|
1480
|
+
return _this4.untypedApi.apis.XcmPaymentApi.query_xcm_weight(transformedXcm);
|
|
1485
1481
|
case 1:
|
|
1486
1482
|
weightRes = _context11.v;
|
|
1487
1483
|
if (weightRes.success) {
|
|
@@ -1520,7 +1516,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1520
1516
|
versionedAssetId = addXcmVersionHeader(assetId, version);
|
|
1521
1517
|
transformedAssetLoc = _transform(versionedAssetId);
|
|
1522
1518
|
_context12.n = 4;
|
|
1523
|
-
return this.
|
|
1519
|
+
return this.untypedApi.apis.XcmPaymentApi.query_weight_to_asset_fee(weight, transformedAssetLoc);
|
|
1524
1520
|
case 4:
|
|
1525
1521
|
execFeeRes = _context12.v;
|
|
1526
1522
|
execFee = typeof (execFeeRes === null || execFeeRes === void 0 ? void 0 : execFeeRes.value) === 'bigint' ? execFeeRes.value : 0n;
|
|
@@ -1558,7 +1554,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1558
1554
|
while (1) switch (_context13.n) {
|
|
1559
1555
|
case 0:
|
|
1560
1556
|
_context13.n = 1;
|
|
1561
|
-
return this.
|
|
1557
|
+
return this.untypedApi.apis.XcmPaymentApi.query_weight_to_asset_fee(weightValue, {
|
|
1562
1558
|
type: version,
|
|
1563
1559
|
value: _transform(RELAY_LOCATION)
|
|
1564
1560
|
});
|
|
@@ -1614,7 +1610,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1614
1610
|
case 1:
|
|
1615
1611
|
transformedOriginLocation = _transform(originLocation);
|
|
1616
1612
|
_context14.n = 2;
|
|
1617
|
-
return this.
|
|
1613
|
+
return this.untypedApi.apis.DryRunApi.dry_run_xcm(transformedOriginLocation, xcm);
|
|
1618
1614
|
case 2:
|
|
1619
1615
|
result = _context14.v;
|
|
1620
1616
|
isSuccess = result.success && result.value.execution_result.type === 'Complete';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "13.2.
|
|
3
|
+
"version": "13.2.1",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,11 +24,10 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@noble/hashes": "^2.0.1",
|
|
27
|
-
"@polkadot-api/descriptors": "file:.papi/descriptors",
|
|
28
27
|
"@polkadot-labs/hdkd": "^0.0.27",
|
|
29
28
|
"@polkadot-labs/hdkd-helpers": "^0.0.28",
|
|
30
29
|
"viem": "^2.47.6",
|
|
31
|
-
"@paraspell/sdk-core": "13.2.
|
|
30
|
+
"@paraspell/sdk-core": "13.2.1"
|
|
32
31
|
},
|
|
33
32
|
"peerDependencies": {
|
|
34
33
|
"polkadot-api": ">= 2 < 3"
|
|
@@ -54,7 +53,6 @@
|
|
|
54
53
|
"scripts": {
|
|
55
54
|
"compile": "tsc --noEmit",
|
|
56
55
|
"build": "rollup -c",
|
|
57
|
-
"postinstall": "papi",
|
|
58
56
|
"lint:check": "eslint src",
|
|
59
57
|
"lint": "eslint --fix src",
|
|
60
58
|
"format:check": "prettier --check src",
|