@paraspell/sdk-core 13.0.1 → 13.2.0

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/README.md CHANGED
@@ -13,9 +13,6 @@
13
13
  <a href="https://github.com/paraspell/xcm-sdk/actions">
14
14
  <img alt="build" src="https://github.com/paraspell/xcm-sdk/actions/workflows/release.yml/badge.svg" />
15
15
  </a>
16
- <a href="https://snyk.io/test/github/paraspell/sdk">
17
- <img alt="snyk" src="https://snyk.io/test/github/paraspell/sdk/badge.svg" />
18
- </a>
19
16
  </p>
20
17
  </div>
21
18
 
package/dist/index.d.ts CHANGED
@@ -459,6 +459,7 @@ declare class Pendulum<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> i
459
459
  constructor();
460
460
  getCustomCurrencyId(asset: TAssetInfo): TXcmAsset;
461
461
  transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
462
+ transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
462
463
  }
463
464
 
464
465
  declare class Penpal<TApi, TRes, TSigner> extends Moonbeam<TApi, TRes, TSigner> {
@@ -1078,12 +1079,13 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
1078
1079
  /**
1079
1080
  * Sets a custom pallet for the transaction.
1080
1081
  *
1081
- * @param palletName - The name of the custom pallet to be used.
1082
+ * @param pallet - The name of the custom pallet to be used.
1083
+ * @param method - The name of the method to be used.
1082
1084
  * @returns An instance of the Builder.
1083
1085
  */
1084
- customPallet(pallet: string, method: string): GeneralBuilder<TApi, TRes, TSigner, T & {
1085
- pallet: string;
1086
- method: string;
1086
+ customPallet(pallet: string | undefined, method: string | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
1087
+ pallet: string | undefined;
1088
+ method: string | undefined;
1087
1089
  }>;
1088
1090
  /**
1089
1091
  * Optional fee asset for the transaction.
@@ -1978,6 +1980,13 @@ declare class RoutingResolutionError extends Error {
1978
1980
  constructor(message: string);
1979
1981
  }
1980
1982
 
1983
+ /**
1984
+ * Error thrown when a runtime API call fails
1985
+ */
1986
+ declare class RuntimeApiError extends Error {
1987
+ constructor(message: string);
1988
+ }
1989
+
1981
1990
  /**
1982
1991
  * Error thrown when a required runtime API is not available on the target chain.
1983
1992
  */
@@ -2151,12 +2160,12 @@ type TTypeAndThenOverrides = {
2151
2160
  };
2152
2161
 
2153
2162
  declare const keyFromWs: (ws: TUrl) => TClientKey;
2154
- declare const createClientPoolHelpers: <TClient>(clientPool: ClientCache<TClient>, createClient: (ws: TUrl, useLegacy: boolean) => TClient | Promise<TClient>) => {
2155
- leaseClient: (ws: TUrl, ttlMs: number, useLegacy: boolean) => Promise<TClient>;
2163
+ declare const createClientPoolHelpers: <TClient>(clientPool: ClientCache<TClient>, createClient: (ws: TUrl) => TClient | Promise<TClient>) => {
2164
+ leaseClient: (ws: TUrl, ttlMs: number) => Promise<TClient>;
2156
2165
  releaseClient: (ws: TUrl) => void;
2157
2166
  };
2158
2167
 
2159
- declare const resolveChainApi: <TApi>(config: TBuilderOptions<TApiOrUrl<TApi>> | undefined, chain: TSubstrateChain$1, createApiInstance: (wsUrl: TUrl, chain: TSubstrateChain$1) => Promise<TApi>) => Promise<TApi>;
2168
+ declare const resolveChainApi: <TApi>(config: TBuilderOptions<TApiOrUrl<TApi>> | undefined, chain: TSubstrateChain$1, createApiInstance: (wsUrl: TUrl) => Promise<TApi>) => Promise<TApi>;
2160
2169
 
2161
2170
  declare const createClientCache: <T>(maxSize: number, pingClient: (client: T) => Promise<void>, onEviction?: (key: TClientKey, value: TClientEntry<T>) => void, extensionMs?: number) => ClientCache<T>;
2162
2171
 
@@ -2264,6 +2273,7 @@ declare const getMinTransferableAmount: <TApi, TRes, TSigner>(options: TGetMinTr
2264
2273
  declare const getTransferableAmountInternal: <TApi, TRes, TSigner>({ api, sender, origin: chain, destination, currency, buildTx, feeAsset, version }: TGetTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
2265
2274
  declare const getTransferableAmount: <TApi, TRes, TSigner>(options: TGetTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
2266
2275
 
2276
+ declare const resolveAssetCount: <TApi, TRes, TSigner>(overriddenAsset: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>["overriddenAsset"], isRelayAsset: boolean) => number;
2267
2277
  declare const constructTypeAndThenCall: <TApi, TRes, TSigner>(context: TTypeAndThenCallContext<TApi, TRes, TSigner>, fees?: TTypeAndThenFees | null) => Promise<TSerializedExtrinsics>;
2268
2278
  /**
2269
2279
  * Creates a type and then call for transferring assets using XCM. Works only for DOT and snowbridge assets so far.
@@ -2298,7 +2308,7 @@ declare const assertSenderSource: <TSigner>(sender?: TSender<TSigner>) => assert
2298
2308
  declare const isSenderSigner: <TSigner>(sender: TSender<TSigner>) => sender is TSigner;
2299
2309
  declare const assertSwapSupport: <TApi, TRes, TSigner>(options: TSwapOptions<TApi, TRes, TSigner> | undefined) => void;
2300
2310
 
2301
- declare const createId: (version: Version, location: TLocation) => TLocation | {
2311
+ declare const createAssetId: (version: Version, location: TLocation) => TLocation | {
2302
2312
  Concrete: TLocation;
2303
2313
  };
2304
2314
  declare const createAsset: (version: Version, amount: bigint, location: TLocation) => TAsset;
@@ -2452,5 +2462,5 @@ declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersi
2452
2462
  declare const pickCompatibleXcmVersion: (origin: TSubstrateChain$1, destination: TDestination, override?: Version) => Version;
2453
2463
  declare const pickRouterCompatibleXcmVersion: (origin: TSubstrateChain$1 | undefined, exchangeChain: TSubstrateChain$1, destination: TChain$1 | undefined) => Version;
2454
2464
 
2455
- export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender, assertSenderSource, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createRouterBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithRouter, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmPrivateKeyHex, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerSwapExtension, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
2465
+ export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender, assertSenderSource, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createRouterBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithRouter, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmPrivateKeyHex, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerSwapExtension, resolveAssetCount, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
2456
2466
  export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedTransferOptions, TBifrostToken, TBridgeStatus, TBuildAllInternalRes, TBuildDestInfoOptions, TBuildInternalRes, TBuildInternalResBase, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainEndpoint, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateEthBridgeInstructionsOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TExchangeChain, TExchangeInput, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMantaAsset, TModuleError, TNativeTokenAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSender, TSerializeEthTransferOptions, TSerializedEthTransfer, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSwapConfig, TSwapEvent, TSwapEventType, TSwapExtension, TSwapFeeEstimates, TSwapOptions, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferBaseOptions, TTransferBaseOptionsWithSender, TTransferBaseOptionsWithSwap, TTransferFeeEstimates, TTransferInfo, TTransferInternalOptions, TTransferLocalOptions, TTransferOptions, TTransferOptionsWithSwap, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSender, WithRequiredSwapOptions };