@paraspell/sdk 8.9.9 → 8.9.10
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.cjs +26 -10
- package/dist/index.mjs +26 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -14,6 +14,9 @@ function _arrayLikeToArray(r, a) {
|
|
|
14
14
|
function _arrayWithHoles(r) {
|
|
15
15
|
if (Array.isArray(r)) return r;
|
|
16
16
|
}
|
|
17
|
+
function _arrayWithoutHoles(r) {
|
|
18
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
19
|
+
}
|
|
17
20
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
18
21
|
try {
|
|
19
22
|
var i = n[a](c),
|
|
@@ -109,6 +112,9 @@ function _defineProperty(e, r, t) {
|
|
|
109
112
|
writable: true
|
|
110
113
|
}) : e[r] = t, e;
|
|
111
114
|
}
|
|
115
|
+
function _iterableToArray(r) {
|
|
116
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
117
|
+
}
|
|
112
118
|
function _iterableToArrayLimit(r, l) {
|
|
113
119
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
114
120
|
if (null != t) {
|
|
@@ -136,6 +142,9 @@ function _iterableToArrayLimit(r, l) {
|
|
|
136
142
|
function _nonIterableRest() {
|
|
137
143
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
138
144
|
}
|
|
145
|
+
function _nonIterableSpread() {
|
|
146
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
147
|
+
}
|
|
139
148
|
function ownKeys(e, r) {
|
|
140
149
|
var t = Object.keys(e);
|
|
141
150
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -461,6 +470,9 @@ function _regeneratorRuntime() {
|
|
|
461
470
|
function _slicedToArray(r, e) {
|
|
462
471
|
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
463
472
|
}
|
|
473
|
+
function _toConsumableArray(r) {
|
|
474
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
475
|
+
}
|
|
464
476
|
function _toPrimitive(t, r) {
|
|
465
477
|
if ("object" != typeof t || !t) return t;
|
|
466
478
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1187,7 +1199,8 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1187
1199
|
key: "getDryRun",
|
|
1188
1200
|
value: function () {
|
|
1189
1201
|
var _getDryRun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref3) {
|
|
1190
|
-
var
|
|
1202
|
+
var _this$api$getUnsafeAp;
|
|
1203
|
+
var tx, address, node, supportsDryRunApi, isBifrost, DEFAULT_XCM_VERSION, result, isSuccess, failureReason, executionFee, fee, actualWeight, weight;
|
|
1191
1204
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1192
1205
|
while (1) switch (_context17.prev = _context17.next) {
|
|
1193
1206
|
case 0:
|
|
@@ -1199,19 +1212,22 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1199
1212
|
}
|
|
1200
1213
|
throw new sdkCore.NodeNotSupportedError("DryRunApi is not available on node ".concat(node));
|
|
1201
1214
|
case 4:
|
|
1202
|
-
|
|
1203
|
-
|
|
1215
|
+
// Bifrost requires a third parameter XCM version
|
|
1216
|
+
isBifrost = node === 'BifrostPolkadot' || node === 'BifrostKusama';
|
|
1217
|
+
DEFAULT_XCM_VERSION = 3;
|
|
1218
|
+
_context17.next = 8;
|
|
1219
|
+
return (_this$api$getUnsafeAp = this.api.getUnsafeApi().apis.DryRunApi).dry_run_call.apply(_this$api$getUnsafeAp, [{
|
|
1204
1220
|
type: 'system',
|
|
1205
1221
|
value: {
|
|
1206
1222
|
type: 'Signed',
|
|
1207
1223
|
value: address
|
|
1208
1224
|
}
|
|
1209
|
-
}, tx.decodedCall);
|
|
1210
|
-
case
|
|
1225
|
+
}, tx.decodedCall].concat(_toConsumableArray(isBifrost ? [DEFAULT_XCM_VERSION] : [])));
|
|
1226
|
+
case 8:
|
|
1211
1227
|
result = _context17.sent;
|
|
1212
1228
|
isSuccess = result.success && result.value.execution_result.success;
|
|
1213
1229
|
if (isSuccess) {
|
|
1214
|
-
_context17.next =
|
|
1230
|
+
_context17.next = 13;
|
|
1215
1231
|
break;
|
|
1216
1232
|
}
|
|
1217
1233
|
failureReason = result.value.execution_result.value.error.value.value.type;
|
|
@@ -1219,10 +1235,10 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1219
1235
|
success: false,
|
|
1220
1236
|
failureReason: failureReason
|
|
1221
1237
|
}));
|
|
1222
|
-
case 11:
|
|
1223
|
-
_context17.next = 13;
|
|
1224
|
-
return this.calculateTransactionFee(tx, address);
|
|
1225
1238
|
case 13:
|
|
1239
|
+
_context17.next = 15;
|
|
1240
|
+
return this.calculateTransactionFee(tx, address);
|
|
1241
|
+
case 15:
|
|
1226
1242
|
executionFee = _context17.sent;
|
|
1227
1243
|
fee = sdkCore.computeFeeFromDryRun(result, node, executionFee);
|
|
1228
1244
|
actualWeight = result.value.execution_result.value.actual_weight;
|
|
@@ -1235,7 +1251,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1235
1251
|
fee: fee,
|
|
1236
1252
|
weight: weight
|
|
1237
1253
|
}));
|
|
1238
|
-
case
|
|
1254
|
+
case 20:
|
|
1239
1255
|
case "end":
|
|
1240
1256
|
return _context17.stop();
|
|
1241
1257
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -13,6 +13,9 @@ function _arrayLikeToArray(r, a) {
|
|
|
13
13
|
function _arrayWithHoles(r) {
|
|
14
14
|
if (Array.isArray(r)) return r;
|
|
15
15
|
}
|
|
16
|
+
function _arrayWithoutHoles(r) {
|
|
17
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
18
|
+
}
|
|
16
19
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
17
20
|
try {
|
|
18
21
|
var i = n[a](c),
|
|
@@ -108,6 +111,9 @@ function _defineProperty(e, r, t) {
|
|
|
108
111
|
writable: true
|
|
109
112
|
}) : e[r] = t, e;
|
|
110
113
|
}
|
|
114
|
+
function _iterableToArray(r) {
|
|
115
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
116
|
+
}
|
|
111
117
|
function _iterableToArrayLimit(r, l) {
|
|
112
118
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
113
119
|
if (null != t) {
|
|
@@ -135,6 +141,9 @@ function _iterableToArrayLimit(r, l) {
|
|
|
135
141
|
function _nonIterableRest() {
|
|
136
142
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
137
143
|
}
|
|
144
|
+
function _nonIterableSpread() {
|
|
145
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
146
|
+
}
|
|
138
147
|
function ownKeys(e, r) {
|
|
139
148
|
var t = Object.keys(e);
|
|
140
149
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -460,6 +469,9 @@ function _regeneratorRuntime() {
|
|
|
460
469
|
function _slicedToArray(r, e) {
|
|
461
470
|
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
462
471
|
}
|
|
472
|
+
function _toConsumableArray(r) {
|
|
473
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
474
|
+
}
|
|
463
475
|
function _toPrimitive(t, r) {
|
|
464
476
|
if ("object" != typeof t || !t) return t;
|
|
465
477
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1186,7 +1198,8 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1186
1198
|
key: "getDryRun",
|
|
1187
1199
|
value: function () {
|
|
1188
1200
|
var _getDryRun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref3) {
|
|
1189
|
-
var
|
|
1201
|
+
var _this$api$getUnsafeAp;
|
|
1202
|
+
var tx, address, node, supportsDryRunApi, isBifrost, DEFAULT_XCM_VERSION, result, isSuccess, failureReason, executionFee, fee, actualWeight, weight;
|
|
1190
1203
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1191
1204
|
while (1) switch (_context17.prev = _context17.next) {
|
|
1192
1205
|
case 0:
|
|
@@ -1198,19 +1211,22 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1198
1211
|
}
|
|
1199
1212
|
throw new NodeNotSupportedError("DryRunApi is not available on node ".concat(node));
|
|
1200
1213
|
case 4:
|
|
1201
|
-
|
|
1202
|
-
|
|
1214
|
+
// Bifrost requires a third parameter XCM version
|
|
1215
|
+
isBifrost = node === 'BifrostPolkadot' || node === 'BifrostKusama';
|
|
1216
|
+
DEFAULT_XCM_VERSION = 3;
|
|
1217
|
+
_context17.next = 8;
|
|
1218
|
+
return (_this$api$getUnsafeAp = this.api.getUnsafeApi().apis.DryRunApi).dry_run_call.apply(_this$api$getUnsafeAp, [{
|
|
1203
1219
|
type: 'system',
|
|
1204
1220
|
value: {
|
|
1205
1221
|
type: 'Signed',
|
|
1206
1222
|
value: address
|
|
1207
1223
|
}
|
|
1208
|
-
}, tx.decodedCall);
|
|
1209
|
-
case
|
|
1224
|
+
}, tx.decodedCall].concat(_toConsumableArray(isBifrost ? [DEFAULT_XCM_VERSION] : [])));
|
|
1225
|
+
case 8:
|
|
1210
1226
|
result = _context17.sent;
|
|
1211
1227
|
isSuccess = result.success && result.value.execution_result.success;
|
|
1212
1228
|
if (isSuccess) {
|
|
1213
|
-
_context17.next =
|
|
1229
|
+
_context17.next = 13;
|
|
1214
1230
|
break;
|
|
1215
1231
|
}
|
|
1216
1232
|
failureReason = result.value.execution_result.value.error.value.value.type;
|
|
@@ -1218,10 +1234,10 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1218
1234
|
success: false,
|
|
1219
1235
|
failureReason: failureReason
|
|
1220
1236
|
}));
|
|
1221
|
-
case 11:
|
|
1222
|
-
_context17.next = 13;
|
|
1223
|
-
return this.calculateTransactionFee(tx, address);
|
|
1224
1237
|
case 13:
|
|
1238
|
+
_context17.next = 15;
|
|
1239
|
+
return this.calculateTransactionFee(tx, address);
|
|
1240
|
+
case 15:
|
|
1225
1241
|
executionFee = _context17.sent;
|
|
1226
1242
|
fee = computeFeeFromDryRun(result, node, executionFee);
|
|
1227
1243
|
actualWeight = result.value.execution_result.value.actual_weight;
|
|
@@ -1234,7 +1250,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1234
1250
|
fee: fee,
|
|
1235
1251
|
weight: weight
|
|
1236
1252
|
}));
|
|
1237
|
-
case
|
|
1253
|
+
case 20:
|
|
1238
1254
|
case "end":
|
|
1239
1255
|
return _context17.stop();
|
|
1240
1256
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "8.9.
|
|
3
|
+
"version": "8.9.10",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"ethers": "^6.13.5",
|
|
27
27
|
"viem": "^2.23.15",
|
|
28
28
|
"@noble/hashes": "^1.7.1",
|
|
29
|
-
"@paraspell/sdk-core": "8.9.
|
|
29
|
+
"@paraspell/sdk-core": "8.9.10"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"polkadot-api": ">= 1.9.7 < 2"
|