@paraspell/sdk-core 14.2.0 → 14.2.2
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.d.ts +2 -2
- package/dist/index.mjs +14 -6
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ declare abstract class SubstrateChain<TApi, TRes, TSigner, TCustomChain extends
|
|
|
148
148
|
isRelayToParaEnabled(): boolean;
|
|
149
149
|
throwIfCantReceive(destChain: TChain | undefined): void;
|
|
150
150
|
throwIfTempDisabled(options: TTransferInternalOptions<TApi, TRes, TSigner, TCustomChain>, destChain?: TChain): void;
|
|
151
|
-
isSendingTempDisabled(
|
|
151
|
+
isSendingTempDisabled(_asset: TAssetInfo): boolean;
|
|
152
152
|
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
153
153
|
canReceiveFrom<TCustomChain extends string = never>(_origin: TChain | TCustomChain): boolean;
|
|
154
154
|
shouldUseNativeAssetTeleport({ api, assetInfo: asset, to }: TTransferInternalOptions<TApi, TRes, TSigner, TCustomChain>): boolean;
|
|
@@ -214,7 +214,7 @@ declare class Astar<TApi, TRes, TSigner, TCustomChain extends string = never> ex
|
|
|
214
214
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
215
215
|
protected getMintConfig(): TMintConfig;
|
|
216
216
|
protected shouldUseReserveTransfer(): boolean;
|
|
217
|
-
isSendingTempDisabled(
|
|
217
|
+
isSendingTempDisabled(assetInfo: TAssetInfo): boolean;
|
|
218
218
|
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner, TCustomChain>): Promise<TRes>;
|
|
219
219
|
isRelayToParaEnabled(): boolean;
|
|
220
220
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner, TCustomChain>): TRes;
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2.js';
|
|
2
|
-
import { isChainEvm, getAssetsObject, InvalidCurrencyError, isSymbolMatch, isAssetEqual, isStableCoinAsset, isAdditionalSubstrateBridgeAsset, isBridgedSystemAsset, isSymbolSpecifier, normalizeLocation, getNativeAssetSymbol, getEdFromAssetOrThrow, extractAssetLocation, hasDryRunSupport, normalizeSymbol, Native, getOtherAssets, canonicalizeLocation, getAssetsObjectImpl, getAssetsImpl, getNativeAssetsImpl, getOtherAssetsImpl, findAssetInfoImpl, findAssetInfoOrThrowImpl, findAssetInfoOnDestImpl, findAssetOnDestOrThrowImpl, findNativeAssetInfoImpl, findNativeAssetInfoOrThrowImpl, isChainEvmImpl, getNativeAssetSymbolImpl, getRelayChainSymbolImpl, hasDryRunSupportImpl, hasXcmPaymentApiSupportImpl, getExistentialDepositOrThrowImpl, normalizeCustomAssets } from '@paraspell/assets';
|
|
2
|
+
import { isChainEvm, getAssetsObject, InvalidCurrencyError, isSymbolMatch, isAssetEqual, isStableCoinAsset, isAdditionalSubstrateBridgeAsset, isBridgedSystemAsset, STABLECOIN_IDS, isSymbolSpecifier, normalizeLocation, getNativeAssetSymbol, getEdFromAssetOrThrow, extractAssetLocation, hasDryRunSupport, normalizeSymbol, Native, getOtherAssets, canonicalizeLocation, getAssetsObjectImpl, getAssetsImpl, getNativeAssetsImpl, getOtherAssetsImpl, findAssetInfoImpl, findAssetInfoOrThrowImpl, findAssetInfoOnDestImpl, findAssetOnDestOrThrowImpl, findNativeAssetInfoImpl, findNativeAssetInfoOrThrowImpl, isChainEvmImpl, getNativeAssetSymbolImpl, getRelayChainSymbolImpl, hasDryRunSupportImpl, hasXcmPaymentApiSupportImpl, getExistentialDepositOrThrowImpl, normalizeCustomAssets } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
5
|
import { isAddress, pad, toHex, getAddress, concat, keccak256, isHex, createPublicClient, http, formatUnits as formatUnits$1, parseUnits as parseUnits$1 } from 'viem';
|
|
6
|
-
import { ParaSpellError, isTLocation, replaceBigInt, isExternalChain, CHAINS, Version, isRelayChain, isSubstrateBridge, Parents, deepEqual, isTrustedChain, isCustomChain, isSnowbridge, getJunctionValue, ETHEREUM_BRIDGE_ORIGINS, isBridge,
|
|
6
|
+
import { ParaSpellError, isTLocation, replaceBigInt, isExternalChain, CHAINS, Version, isRelayChain, isSubstrateBridge, Parents, deepEqual, isTrustedChain, isCustomChain, isSnowbridge, getJunctionValue, hasJunction, ETHEREUM_BRIDGE_ORIGINS, isBridge, RELAYCHAINS, DEFAULT_SS58_PREFIX } from '@paraspell/sdk-common';
|
|
7
7
|
export * from '@paraspell/sdk-common';
|
|
8
8
|
import { getXcmPallet, getOtherAssetsPallets, getNativeAssetsPallet, getSupportedPalletsDetails, ASSETS_PALLETS, NATIVE_ASSETS_PALLET_PRIORITY, OTHER_ASSETS_PALLET_PRIORITY, hasPalletImpl, getXcmPalletImpl } from '@paraspell/pallets';
|
|
9
9
|
export * from '@paraspell/pallets';
|
|
@@ -2984,7 +2984,7 @@ var SubstrateChain = /*#__PURE__*/function (_Chain) {
|
|
|
2984
2984
|
}, {
|
|
2985
2985
|
key: "throwIfTempDisabled",
|
|
2986
2986
|
value: function throwIfTempDisabled(options, destChain) {
|
|
2987
|
-
var isSendingDisabled = this.isSendingTempDisabled(options);
|
|
2987
|
+
var isSendingDisabled = this.isSendingTempDisabled(options.assetInfo);
|
|
2988
2988
|
if (isSendingDisabled) {
|
|
2989
2989
|
throw new FeatureTemporarilyDisabledError("Sending ".concat(options.assetInfo.symbol, " from ").concat(this.chain, " is temporarily disabled"));
|
|
2990
2990
|
}
|
|
@@ -2996,7 +2996,7 @@ var SubstrateChain = /*#__PURE__*/function (_Chain) {
|
|
|
2996
2996
|
}
|
|
2997
2997
|
}, {
|
|
2998
2998
|
key: "isSendingTempDisabled",
|
|
2999
|
-
value: function isSendingTempDisabled(
|
|
2999
|
+
value: function isSendingTempDisabled(_asset) {
|
|
3000
3000
|
return false;
|
|
3001
3001
|
}
|
|
3002
3002
|
}, {
|
|
@@ -3416,10 +3416,19 @@ var getEthereumJunction = function getEthereumJunction(api, chain) {
|
|
|
3416
3416
|
};
|
|
3417
3417
|
};
|
|
3418
3418
|
|
|
3419
|
+
var validateSubBridgeRules = function validateSubBridgeRules(origin, destination, asset) {
|
|
3420
|
+
var isBlocked = origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot' && STABLECOIN_IDS.some(function (id) {
|
|
3421
|
+
return hasJunction(asset.location, 'GeneralIndex', id);
|
|
3422
|
+
}) && !hasJunction(asset.location, 'GlobalConsensus');
|
|
3423
|
+
if (isBlocked) {
|
|
3424
|
+
throw new InvalidCurrencyError("The selected asset is not the correct ".concat(asset.symbol, " for the Substrate bridge."));
|
|
3425
|
+
}
|
|
3426
|
+
};
|
|
3419
3427
|
var validateBridgeAsset = function validateBridgeAsset(origin, destination, asset, currency, isBridge, api) {
|
|
3420
3428
|
if (!asset || isTLocation(destination) || isExternalChain(destination) || !isBridge) {
|
|
3421
3429
|
return;
|
|
3422
3430
|
}
|
|
3431
|
+
validateSubBridgeRules(origin, destination, asset);
|
|
3423
3432
|
var nativeAsset = api.findNativeAssetInfoOrThrow(origin);
|
|
3424
3433
|
var isNativeAsset = isAssetEqual(asset, nativeAsset);
|
|
3425
3434
|
var isBridgedStablecoin = isStableCoinAsset(asset);
|
|
@@ -10818,8 +10827,7 @@ var Astar = /*#__PURE__*/function (_SubstrateChain) {
|
|
|
10818
10827
|
}
|
|
10819
10828
|
}, {
|
|
10820
10829
|
key: "isSendingTempDisabled",
|
|
10821
|
-
value: function isSendingTempDisabled(
|
|
10822
|
-
var assetInfo = _ref.assetInfo;
|
|
10830
|
+
value: function isSendingTempDisabled(assetInfo) {
|
|
10823
10831
|
return deepEqual(assetInfo.location, RELAY_LOCATION);
|
|
10824
10832
|
}
|
|
10825
10833
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.2",
|
|
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
|
"@noble/hashes": "^2.2.0",
|
|
26
26
|
"@scure/base": "^2.2.0",
|
|
27
27
|
"viem": "^2.55.10",
|
|
28
|
-
"@paraspell/
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/
|
|
28
|
+
"@paraspell/assets": "14.2.2",
|
|
29
|
+
"@paraspell/pallets": "14.2.2",
|
|
30
|
+
"@paraspell/sdk-common": "14.2.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|