@paraspell/sdk-core 8.11.0 → 8.11.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.cjs +54 -29
- package/dist/index.d.ts +21 -0
- package/dist/index.mjs +54 -29
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -3346,8 +3346,8 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
3346
3346
|
key: "getRelayToParaOverrides",
|
|
3347
3347
|
value: function getRelayToParaOverrides() {
|
|
3348
3348
|
return {
|
|
3349
|
-
section: '
|
|
3350
|
-
includeFee:
|
|
3349
|
+
section: 'limited_reserve_transfer_assets',
|
|
3350
|
+
includeFee: true
|
|
3351
3351
|
};
|
|
3352
3352
|
}
|
|
3353
3353
|
}, {
|
|
@@ -4529,8 +4529,7 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
|
|
|
4529
4529
|
return _createClass(Astar, [{
|
|
4530
4530
|
key: "transferPolkadotXCM",
|
|
4531
4531
|
value: function transferPolkadotXCM(input) {
|
|
4532
|
-
|
|
4533
|
-
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserve_transfer_assets'));
|
|
4532
|
+
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_reserve_transfer_assets', 'Unlimited'));
|
|
4534
4533
|
}
|
|
4535
4534
|
}, {
|
|
4536
4535
|
key: "transferXTokens",
|
|
@@ -5129,11 +5128,28 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5129
5128
|
return _createClass(Darwinia, [{
|
|
5130
5129
|
key: "transferPolkadotXCM",
|
|
5131
5130
|
value: function transferPolkadotXCM(input) {
|
|
5132
|
-
var scenario = input.scenario
|
|
5133
|
-
|
|
5131
|
+
var scenario = input.scenario,
|
|
5132
|
+
asset = input.asset;
|
|
5133
|
+
if (scenario === 'ParaToPara' && asset.symbol !== this.getNativeAssetSymbol()) {
|
|
5134
5134
|
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
5135
5135
|
}
|
|
5136
|
-
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, '
|
|
5136
|
+
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_reserve_transfer_assets', 'Unlimited'));
|
|
5137
|
+
}
|
|
5138
|
+
}, {
|
|
5139
|
+
key: "createCurrencySpec",
|
|
5140
|
+
value: function createCurrencySpec(amount, scenario, version, _asset) {
|
|
5141
|
+
if (scenario === 'ParaToPara') {
|
|
5142
|
+
return createVersionedMultiAssets(version, amount, {
|
|
5143
|
+
parents: sdkCommon.Parents.ZERO,
|
|
5144
|
+
interior: {
|
|
5145
|
+
X1: {
|
|
5146
|
+
PalletInstance: 5
|
|
5147
|
+
}
|
|
5148
|
+
}
|
|
5149
|
+
});
|
|
5150
|
+
} else {
|
|
5151
|
+
return _superPropGet(Darwinia, "createCurrencySpec", this, 3)([amount, scenario, version]);
|
|
5152
|
+
}
|
|
5137
5153
|
}
|
|
5138
5154
|
}, {
|
|
5139
5155
|
key: "transferLocalNonNativeAsset",
|
|
@@ -5653,16 +5669,18 @@ var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5653
5669
|
var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
5654
5670
|
function KiltSpiritnet() {
|
|
5655
5671
|
_classCallCheck(this, KiltSpiritnet);
|
|
5656
|
-
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot', exports.Version.
|
|
5672
|
+
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot', exports.Version.V3]);
|
|
5657
5673
|
}
|
|
5658
5674
|
_inherits(KiltSpiritnet, _ParachainNode);
|
|
5659
5675
|
return _createClass(KiltSpiritnet, [{
|
|
5660
5676
|
key: "transferPolkadotXCM",
|
|
5661
5677
|
value: function transferPolkadotXCM(input) {
|
|
5662
|
-
|
|
5663
|
-
|
|
5678
|
+
var scenario = input.scenario,
|
|
5679
|
+
asset = input.asset;
|
|
5680
|
+
if (scenario === 'ParaToPara' && asset.symbol !== this.getNativeAssetSymbol()) {
|
|
5681
|
+
throw new ScenarioNotSupportedError(this.node, scenario, 'KiltSpiritnet only supports native asset ParaToPara transfers');
|
|
5664
5682
|
}
|
|
5665
|
-
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, '
|
|
5683
|
+
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_reserve_transfer_assets', 'Unlimited'));
|
|
5666
5684
|
}
|
|
5667
5685
|
}, {
|
|
5668
5686
|
key: "transferRelayToPara",
|
|
@@ -7976,8 +7994,8 @@ var getBalanceNative = /*#__PURE__*/function () {
|
|
|
7976
7994
|
|
|
7977
7995
|
var getAssetBalanceInternal = /*#__PURE__*/function () {
|
|
7978
7996
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
7979
|
-
var _yield$getBalanceFore;
|
|
7980
|
-
var address, node, currency, api, isNativeSymbol;
|
|
7997
|
+
var _findAsset, _yield$getBalanceFore;
|
|
7998
|
+
var address, node, currency, api, asset, isNativeSymbol;
|
|
7981
7999
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7982
8000
|
while (1) switch (_context.prev = _context.next) {
|
|
7983
8001
|
case 0:
|
|
@@ -7985,52 +8003,59 @@ var getAssetBalanceInternal = /*#__PURE__*/function () {
|
|
|
7985
8003
|
_context.next = 3;
|
|
7986
8004
|
return api.init(node);
|
|
7987
8005
|
case 3:
|
|
7988
|
-
|
|
8006
|
+
asset = (_findAsset = assets.findAsset(node, currency, null)) !== null && _findAsset !== void 0 ? _findAsset : node === 'AssetHubPolkadot' ? assets.findAsset('Ethereum', currency, null) : null;
|
|
8007
|
+
if (asset) {
|
|
8008
|
+
_context.next = 6;
|
|
8009
|
+
break;
|
|
8010
|
+
}
|
|
8011
|
+
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(currency), " not found on ").concat(node));
|
|
8012
|
+
case 6:
|
|
8013
|
+
isNativeSymbol = asset.symbol === assets.getNativeAssetSymbol(node);
|
|
7989
8014
|
if (!(isNativeSymbol && node !== 'Interlay' && node !== 'Kintsugi')) {
|
|
7990
|
-
_context.next =
|
|
8015
|
+
_context.next = 13;
|
|
7991
8016
|
break;
|
|
7992
8017
|
}
|
|
7993
|
-
_context.next =
|
|
8018
|
+
_context.next = 10;
|
|
7994
8019
|
return getBalanceNativeInternal({
|
|
7995
8020
|
address: address,
|
|
7996
8021
|
node: node,
|
|
7997
8022
|
api: api
|
|
7998
8023
|
});
|
|
7999
|
-
case
|
|
8024
|
+
case 10:
|
|
8000
8025
|
_context.t0 = _context.sent;
|
|
8001
|
-
_context.next =
|
|
8026
|
+
_context.next = 25;
|
|
8002
8027
|
break;
|
|
8003
|
-
case
|
|
8004
|
-
_context.next =
|
|
8028
|
+
case 13:
|
|
8029
|
+
_context.next = 15;
|
|
8005
8030
|
return getBalanceForeignInternal({
|
|
8006
8031
|
address: address,
|
|
8007
8032
|
node: node,
|
|
8008
8033
|
api: api,
|
|
8009
8034
|
currency: currency
|
|
8010
8035
|
});
|
|
8011
|
-
case
|
|
8036
|
+
case 15:
|
|
8012
8037
|
_context.t2 = _yield$getBalanceFore = _context.sent;
|
|
8013
8038
|
_context.t1 = _context.t2 !== null;
|
|
8014
8039
|
if (!_context.t1) {
|
|
8015
|
-
_context.next =
|
|
8040
|
+
_context.next = 19;
|
|
8016
8041
|
break;
|
|
8017
8042
|
}
|
|
8018
8043
|
_context.t1 = _yield$getBalanceFore !== void 0;
|
|
8019
|
-
case
|
|
8044
|
+
case 19:
|
|
8020
8045
|
if (!_context.t1) {
|
|
8021
|
-
_context.next =
|
|
8046
|
+
_context.next = 23;
|
|
8022
8047
|
break;
|
|
8023
8048
|
}
|
|
8024
8049
|
_context.t3 = _yield$getBalanceFore;
|
|
8025
|
-
_context.next =
|
|
8050
|
+
_context.next = 24;
|
|
8026
8051
|
break;
|
|
8027
|
-
case
|
|
8052
|
+
case 23:
|
|
8028
8053
|
_context.t3 = 0n;
|
|
8029
|
-
case
|
|
8054
|
+
case 24:
|
|
8030
8055
|
_context.t0 = _context.t3;
|
|
8031
|
-
case
|
|
8056
|
+
case 25:
|
|
8032
8057
|
return _context.abrupt("return", _context.t0);
|
|
8033
|
-
case
|
|
8058
|
+
case 26:
|
|
8034
8059
|
case "end":
|
|
8035
8060
|
return _context.stop();
|
|
8036
8061
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1113,6 +1113,27 @@ declare class Curio<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
1113
1113
|
declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1114
1114
|
constructor();
|
|
1115
1115
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1116
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset): {
|
|
1117
|
+
V1: _paraspell_assets.TMultiAsset[];
|
|
1118
|
+
V2?: undefined;
|
|
1119
|
+
V3?: undefined;
|
|
1120
|
+
V4?: undefined;
|
|
1121
|
+
} | {
|
|
1122
|
+
V2: _paraspell_assets.TMultiAsset[];
|
|
1123
|
+
V1?: undefined;
|
|
1124
|
+
V3?: undefined;
|
|
1125
|
+
V4?: undefined;
|
|
1126
|
+
} | {
|
|
1127
|
+
V3: _paraspell_assets.TMultiAsset[];
|
|
1128
|
+
V1?: undefined;
|
|
1129
|
+
V2?: undefined;
|
|
1130
|
+
V4?: undefined;
|
|
1131
|
+
} | {
|
|
1132
|
+
V4: _paraspell_assets.TMultiAsset[];
|
|
1133
|
+
V1?: undefined;
|
|
1134
|
+
V2?: undefined;
|
|
1135
|
+
V3?: undefined;
|
|
1136
|
+
};
|
|
1116
1137
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1117
1138
|
}
|
|
1118
1139
|
|
package/dist/index.mjs
CHANGED
|
@@ -3347,8 +3347,8 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
3347
3347
|
key: "getRelayToParaOverrides",
|
|
3348
3348
|
value: function getRelayToParaOverrides() {
|
|
3349
3349
|
return {
|
|
3350
|
-
section: '
|
|
3351
|
-
includeFee:
|
|
3350
|
+
section: 'limited_reserve_transfer_assets',
|
|
3351
|
+
includeFee: true
|
|
3352
3352
|
};
|
|
3353
3353
|
}
|
|
3354
3354
|
}, {
|
|
@@ -4530,8 +4530,7 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
|
|
|
4530
4530
|
return _createClass(Astar, [{
|
|
4531
4531
|
key: "transferPolkadotXCM",
|
|
4532
4532
|
value: function transferPolkadotXCM(input) {
|
|
4533
|
-
|
|
4534
|
-
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserve_transfer_assets'));
|
|
4533
|
+
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_reserve_transfer_assets', 'Unlimited'));
|
|
4535
4534
|
}
|
|
4536
4535
|
}, {
|
|
4537
4536
|
key: "transferXTokens",
|
|
@@ -5130,11 +5129,28 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5130
5129
|
return _createClass(Darwinia, [{
|
|
5131
5130
|
key: "transferPolkadotXCM",
|
|
5132
5131
|
value: function transferPolkadotXCM(input) {
|
|
5133
|
-
var scenario = input.scenario
|
|
5134
|
-
|
|
5132
|
+
var scenario = input.scenario,
|
|
5133
|
+
asset = input.asset;
|
|
5134
|
+
if (scenario === 'ParaToPara' && asset.symbol !== this.getNativeAssetSymbol()) {
|
|
5135
5135
|
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
5136
5136
|
}
|
|
5137
|
-
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, '
|
|
5137
|
+
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_reserve_transfer_assets', 'Unlimited'));
|
|
5138
|
+
}
|
|
5139
|
+
}, {
|
|
5140
|
+
key: "createCurrencySpec",
|
|
5141
|
+
value: function createCurrencySpec(amount, scenario, version, _asset) {
|
|
5142
|
+
if (scenario === 'ParaToPara') {
|
|
5143
|
+
return createVersionedMultiAssets(version, amount, {
|
|
5144
|
+
parents: Parents.ZERO,
|
|
5145
|
+
interior: {
|
|
5146
|
+
X1: {
|
|
5147
|
+
PalletInstance: 5
|
|
5148
|
+
}
|
|
5149
|
+
}
|
|
5150
|
+
});
|
|
5151
|
+
} else {
|
|
5152
|
+
return _superPropGet(Darwinia, "createCurrencySpec", this, 3)([amount, scenario, version]);
|
|
5153
|
+
}
|
|
5138
5154
|
}
|
|
5139
5155
|
}, {
|
|
5140
5156
|
key: "transferLocalNonNativeAsset",
|
|
@@ -5654,16 +5670,18 @@ var Karura = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5654
5670
|
var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
|
|
5655
5671
|
function KiltSpiritnet() {
|
|
5656
5672
|
_classCallCheck(this, KiltSpiritnet);
|
|
5657
|
-
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot', Version.
|
|
5673
|
+
return _callSuper(this, KiltSpiritnet, ['KiltSpiritnet', 'kilt', 'polkadot', Version.V3]);
|
|
5658
5674
|
}
|
|
5659
5675
|
_inherits(KiltSpiritnet, _ParachainNode);
|
|
5660
5676
|
return _createClass(KiltSpiritnet, [{
|
|
5661
5677
|
key: "transferPolkadotXCM",
|
|
5662
5678
|
value: function transferPolkadotXCM(input) {
|
|
5663
|
-
|
|
5664
|
-
|
|
5679
|
+
var scenario = input.scenario,
|
|
5680
|
+
asset = input.asset;
|
|
5681
|
+
if (scenario === 'ParaToPara' && asset.symbol !== this.getNativeAssetSymbol()) {
|
|
5682
|
+
throw new ScenarioNotSupportedError(this.node, scenario, 'KiltSpiritnet only supports native asset ParaToPara transfers');
|
|
5665
5683
|
}
|
|
5666
|
-
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, '
|
|
5684
|
+
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_reserve_transfer_assets', 'Unlimited'));
|
|
5667
5685
|
}
|
|
5668
5686
|
}, {
|
|
5669
5687
|
key: "transferRelayToPara",
|
|
@@ -7977,8 +7995,8 @@ var getBalanceNative = /*#__PURE__*/function () {
|
|
|
7977
7995
|
|
|
7978
7996
|
var getAssetBalanceInternal = /*#__PURE__*/function () {
|
|
7979
7997
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
7980
|
-
var _yield$getBalanceFore;
|
|
7981
|
-
var address, node, currency, api, isNativeSymbol;
|
|
7998
|
+
var _findAsset, _yield$getBalanceFore;
|
|
7999
|
+
var address, node, currency, api, asset, isNativeSymbol;
|
|
7982
8000
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7983
8001
|
while (1) switch (_context.prev = _context.next) {
|
|
7984
8002
|
case 0:
|
|
@@ -7986,52 +8004,59 @@ var getAssetBalanceInternal = /*#__PURE__*/function () {
|
|
|
7986
8004
|
_context.next = 3;
|
|
7987
8005
|
return api.init(node);
|
|
7988
8006
|
case 3:
|
|
7989
|
-
|
|
8007
|
+
asset = (_findAsset = findAsset(node, currency, null)) !== null && _findAsset !== void 0 ? _findAsset : node === 'AssetHubPolkadot' ? findAsset('Ethereum', currency, null) : null;
|
|
8008
|
+
if (asset) {
|
|
8009
|
+
_context.next = 6;
|
|
8010
|
+
break;
|
|
8011
|
+
}
|
|
8012
|
+
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency), " not found on ").concat(node));
|
|
8013
|
+
case 6:
|
|
8014
|
+
isNativeSymbol = asset.symbol === getNativeAssetSymbol(node);
|
|
7990
8015
|
if (!(isNativeSymbol && node !== 'Interlay' && node !== 'Kintsugi')) {
|
|
7991
|
-
_context.next =
|
|
8016
|
+
_context.next = 13;
|
|
7992
8017
|
break;
|
|
7993
8018
|
}
|
|
7994
|
-
_context.next =
|
|
8019
|
+
_context.next = 10;
|
|
7995
8020
|
return getBalanceNativeInternal({
|
|
7996
8021
|
address: address,
|
|
7997
8022
|
node: node,
|
|
7998
8023
|
api: api
|
|
7999
8024
|
});
|
|
8000
|
-
case
|
|
8025
|
+
case 10:
|
|
8001
8026
|
_context.t0 = _context.sent;
|
|
8002
|
-
_context.next =
|
|
8027
|
+
_context.next = 25;
|
|
8003
8028
|
break;
|
|
8004
|
-
case
|
|
8005
|
-
_context.next =
|
|
8029
|
+
case 13:
|
|
8030
|
+
_context.next = 15;
|
|
8006
8031
|
return getBalanceForeignInternal({
|
|
8007
8032
|
address: address,
|
|
8008
8033
|
node: node,
|
|
8009
8034
|
api: api,
|
|
8010
8035
|
currency: currency
|
|
8011
8036
|
});
|
|
8012
|
-
case
|
|
8037
|
+
case 15:
|
|
8013
8038
|
_context.t2 = _yield$getBalanceFore = _context.sent;
|
|
8014
8039
|
_context.t1 = _context.t2 !== null;
|
|
8015
8040
|
if (!_context.t1) {
|
|
8016
|
-
_context.next =
|
|
8041
|
+
_context.next = 19;
|
|
8017
8042
|
break;
|
|
8018
8043
|
}
|
|
8019
8044
|
_context.t1 = _yield$getBalanceFore !== void 0;
|
|
8020
|
-
case
|
|
8045
|
+
case 19:
|
|
8021
8046
|
if (!_context.t1) {
|
|
8022
|
-
_context.next =
|
|
8047
|
+
_context.next = 23;
|
|
8023
8048
|
break;
|
|
8024
8049
|
}
|
|
8025
8050
|
_context.t3 = _yield$getBalanceFore;
|
|
8026
|
-
_context.next =
|
|
8051
|
+
_context.next = 24;
|
|
8027
8052
|
break;
|
|
8028
|
-
case
|
|
8053
|
+
case 23:
|
|
8029
8054
|
_context.t3 = 0n;
|
|
8030
|
-
case
|
|
8055
|
+
case 24:
|
|
8031
8056
|
_context.t0 = _context.t3;
|
|
8032
|
-
case
|
|
8057
|
+
case 25:
|
|
8033
8058
|
return _context.abrupt("return", _context.t0);
|
|
8034
|
-
case
|
|
8059
|
+
case 26:
|
|
8035
8060
|
case "end":
|
|
8036
8061
|
return _context.stop();
|
|
8037
8062
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.1",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"ethers": "^6.13.5",
|
|
27
27
|
"viem": "^2.23.15",
|
|
28
|
-
"@paraspell/assets": "8.11.
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/
|
|
28
|
+
"@paraspell/assets": "8.11.1",
|
|
29
|
+
"@paraspell/sdk-common": "8.11.1",
|
|
30
|
+
"@paraspell/pallets": "8.11.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-syntax-import-attributes": "^7.26.0",
|