@paraspell/sdk 1.1.14 → 1.1.15
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 +21 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +21 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5265,10 +5265,30 @@ var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
|
5265
5265
|
return _createClass(NodeNotSupportedError);
|
|
5266
5266
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
5267
5267
|
|
|
5268
|
+
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
5269
|
+
_inherits(IncompatibleNodesError, _Error);
|
|
5270
|
+
var _super = _createSuper(IncompatibleNodesError);
|
|
5271
|
+
function IncompatibleNodesError() {
|
|
5272
|
+
var _this;
|
|
5273
|
+
_classCallCheck(this, IncompatibleNodesError);
|
|
5274
|
+
_this = _super.call(this, 'Transactions between nodes on different relaychains are not yet possible.');
|
|
5275
|
+
_this.name = 'IncompatibleNodes';
|
|
5276
|
+
return _this;
|
|
5277
|
+
}
|
|
5278
|
+
return _createClass(IncompatibleNodesError);
|
|
5279
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
5280
|
+
|
|
5268
5281
|
// Contains basic call formatting for different XCM Palletss
|
|
5269
5282
|
var sendCommon = function sendCommon(api, origin, currencySymbolOrId, amount, to, destination) {
|
|
5270
5283
|
var serializedApiCallEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
5271
5284
|
var asset = getAssetBySymbolOrId(origin, currencySymbolOrId.toString());
|
|
5285
|
+
if (destination) {
|
|
5286
|
+
var originRelayChainSymbol = getRelayChainSymbol(origin);
|
|
5287
|
+
var destinationRelayChainSymbol = getRelayChainSymbol(destination);
|
|
5288
|
+
if (originRelayChainSymbol !== destinationRelayChainSymbol) {
|
|
5289
|
+
throw new IncompatibleNodesError();
|
|
5290
|
+
}
|
|
5291
|
+
}
|
|
5272
5292
|
if (!asset) {
|
|
5273
5293
|
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency or currencyId ").concat(currencySymbolOrId, "."));
|
|
5274
5294
|
}
|
|
@@ -6282,6 +6302,7 @@ var getSupportedPallets = function getSupportedPallets(node) {
|
|
|
6282
6302
|
};
|
|
6283
6303
|
|
|
6284
6304
|
exports.Builder = Builder;
|
|
6305
|
+
exports.IncompatibleNodesError = IncompatibleNodesError;
|
|
6285
6306
|
exports.InvalidCurrencyError = InvalidCurrencyError;
|
|
6286
6307
|
exports.NODE_NAMES = NODE_NAMES;
|
|
6287
6308
|
exports.NoXCMSupportImplementedError = NoXCMSupportImplementedError;
|
package/dist/index.d.ts
CHANGED
|
@@ -339,4 +339,8 @@ declare class ScenarioNotSupportedError extends Error {
|
|
|
339
339
|
constructor(node: TNode, scenario: TScenario);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
|
|
342
|
+
declare class IncompatibleNodesError extends Error {
|
|
343
|
+
constructor();
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export { Bool, Builder, Extrinsic, ExtrinsicFunction, IPolkadotXCMTransfer, IXTokensTransfer, IncompatibleNodesError, InvalidCurrencyError, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, TAssetDetails, TAssetJsonMap, TNativeAssetDetails, TNode, TNodeAssets, TPallet, TPalletJsonMap, TPalletMap, TRelayChainType, TScenario, TSerializedApiCall, UpdateFunction, Version, XTokensTransferInput, index as assets, index$1 as closeChannels, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getNodeEndpointOption, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$2 as openChannels, index$4 as xcmPallet, index$3 as xyk };
|
package/dist/index.mjs
CHANGED
|
@@ -5263,10 +5263,30 @@ var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
|
5263
5263
|
return _createClass(NodeNotSupportedError);
|
|
5264
5264
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
5265
5265
|
|
|
5266
|
+
var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
5267
|
+
_inherits(IncompatibleNodesError, _Error);
|
|
5268
|
+
var _super = _createSuper(IncompatibleNodesError);
|
|
5269
|
+
function IncompatibleNodesError() {
|
|
5270
|
+
var _this;
|
|
5271
|
+
_classCallCheck(this, IncompatibleNodesError);
|
|
5272
|
+
_this = _super.call(this, 'Transactions between nodes on different relaychains are not yet possible.');
|
|
5273
|
+
_this.name = 'IncompatibleNodes';
|
|
5274
|
+
return _this;
|
|
5275
|
+
}
|
|
5276
|
+
return _createClass(IncompatibleNodesError);
|
|
5277
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
5278
|
+
|
|
5266
5279
|
// Contains basic call formatting for different XCM Palletss
|
|
5267
5280
|
var sendCommon = function sendCommon(api, origin, currencySymbolOrId, amount, to, destination) {
|
|
5268
5281
|
var serializedApiCallEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
5269
5282
|
var asset = getAssetBySymbolOrId(origin, currencySymbolOrId.toString());
|
|
5283
|
+
if (destination) {
|
|
5284
|
+
var originRelayChainSymbol = getRelayChainSymbol(origin);
|
|
5285
|
+
var destinationRelayChainSymbol = getRelayChainSymbol(destination);
|
|
5286
|
+
if (originRelayChainSymbol !== destinationRelayChainSymbol) {
|
|
5287
|
+
throw new IncompatibleNodesError();
|
|
5288
|
+
}
|
|
5289
|
+
}
|
|
5270
5290
|
if (!asset) {
|
|
5271
5291
|
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency or currencyId ").concat(currencySymbolOrId, "."));
|
|
5272
5292
|
}
|
|
@@ -6279,4 +6299,4 @@ var getSupportedPallets = function getSupportedPallets(node) {
|
|
|
6279
6299
|
return palletsMap[node].supportedPallets;
|
|
6280
6300
|
};
|
|
6281
6301
|
|
|
6282
|
-
export { Builder, InvalidCurrencyError, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$4 as assets, index as closeChannels, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getNodeEndpointOption, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$1 as openChannels, index$3 as xcmPallet, index$2 as xyk };
|
|
6302
|
+
export { Builder, IncompatibleNodesError, InvalidCurrencyError, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$4 as assets, index as closeChannels, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getNodeEndpointOption, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$1 as openChannels, index$3 as xcmPallet, index$2 as xyk };
|