@paraspell/sdk-core 14.2.0 → 14.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 +11 -2
- package/package.json +4 -4
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';
|
|
@@ -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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.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
|
"@noble/hashes": "^2.2.0",
|
|
26
26
|
"@scure/base": "^2.2.0",
|
|
27
27
|
"viem": "^2.55.10",
|
|
28
|
-
"@paraspell/
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/assets": "14.2.
|
|
28
|
+
"@paraspell/sdk-common": "14.2.1",
|
|
29
|
+
"@paraspell/pallets": "14.2.1",
|
|
30
|
+
"@paraspell/assets": "14.2.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|