@paraspell/sdk-core 8.3.1 → 8.4.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/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ type WithApi<TBase, TApi, TRes> = TBase & {
6
6
  };
7
7
  type TApiOrUrl<TApi> = TApi | string | string[];
8
8
 
9
+ declare const ETH_CHAIN_ID: bigint;
10
+ declare const ETHEREUM_JUNCTION: TJunction;
9
11
  /**
10
12
  * Supported nodes excluding relay chains and Ethereum.
11
13
  */
@@ -33,9 +35,9 @@ declare abstract class ParachainNode<TApi, TRes> {
33
35
  private readonly _type;
34
36
  private readonly _version;
35
37
  protected _assetCheckEnabled: boolean;
36
- constructor(node: TNodePolkadotKusama, info: string, type: TRelayChainType, version: Version);
38
+ constructor(node: TNodePolkadotKusama, info: string, type: TEcosystemType, version: Version);
37
39
  get info(): string;
38
- get type(): TRelayChainType;
40
+ get type(): TEcosystemType;
39
41
  get node(): TNodePolkadotKusama;
40
42
  get version(): Version;
41
43
  get assetCheckEnabled(): boolean;
@@ -46,6 +48,7 @@ declare abstract class ParachainNode<TApi, TRes> {
46
48
  createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
47
49
  createPolkadotXcmHeader(scenario: TScenario, version: Version, destination: TDestination, paraId?: number): TMultiLocationHeader;
48
50
  getNativeAssetSymbol(): string;
51
+ protected transferToEthereum<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
49
52
  }
50
53
 
51
54
  declare class Acala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
@@ -111,6 +114,7 @@ declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> impl
111
114
  VToken2?: undefined;
112
115
  };
113
116
  transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
117
+ transferToAssetHub<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
114
118
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
115
119
  protected canUseXTokens({ asset, destination }: TSendInternalOptions<TApi, TRes>): boolean;
116
120
  }
@@ -133,7 +137,6 @@ declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> im
133
137
  declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
134
138
  private static NATIVE_ASSET_ID;
135
139
  constructor();
136
- transferToEthereum<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
137
140
  transferToAssetHub<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
138
141
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
139
142
  transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
@@ -909,7 +912,7 @@ type TNodePolkadotKusama = Exclude<TNode, 'Ethereum'>;
909
912
  type TNodeWithRelayChains = (typeof NODES_WITH_RELAY_CHAINS)[number];
910
913
  type TNodeDotKsmWithRelayChains = Exclude<TNodeWithRelayChains, 'Ethereum'>;
911
914
 
912
- type TRelayChainType = 'polkadot' | 'kusama';
915
+ type TEcosystemType = 'polkadot' | 'kusama' | 'ethereum';
913
916
  type TRelayChainSymbol = 'DOT' | 'KSM';
914
917
 
915
918
  type TEdJsonMap = Record<TNodeDotKsmWithRelayChains, string | null>;
@@ -1001,7 +1004,7 @@ type TEvmBuilderOptionsBase = {
1001
1004
  /**
1002
1005
  * The destination node on Polkadot network.
1003
1006
  */
1004
- to: TNodeDotKsmWithRelayChains;
1007
+ to: TNodeWithRelayChains;
1005
1008
  /**
1006
1009
  * The currency to transfer. Symbol or ID.
1007
1010
  */
@@ -1010,6 +1013,10 @@ type TEvmBuilderOptionsBase = {
1010
1013
  * The Polkadot destination address.
1011
1014
  */
1012
1015
  address: string;
1016
+ /**
1017
+ * The AssetHub address
1018
+ */
1019
+ ahAddress?: string;
1013
1020
  /**
1014
1021
  * The Ethereum signer.
1015
1022
  */
@@ -1411,7 +1418,7 @@ declare const getAssetDecimals: (node: TNodeWithRelayChains, symbol: string) =>
1411
1418
  * @param paraId - The parachain ID.
1412
1419
  * @returns The node name if found; otherwise, null.
1413
1420
  */
1414
- declare const getTNode: (paraId: number, ecosystem: TRelayChainType) => TNodeDotKsmWithRelayChains | null;
1421
+ declare const getTNode: (paraId: number, ecosystem: TEcosystemType) => TNodeWithRelayChains | null;
1415
1422
 
1416
1423
  declare const getAssetBalanceInternal: <TApi, TRes>({ address, node, currency, api }: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
1417
1424
  declare const getAssetBalance: <TApi, TRes>(options: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
@@ -1628,6 +1635,10 @@ declare const isOverrideMultiLocationSpecifier: (multiLocationSpecifier: TMultiL
1628
1635
 
1629
1636
  declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
1630
1637
 
1638
+ declare const calculateFee: <TApi, TRes>(ahApi: IPolkadotApi<TApi, TRes>) => Promise<string>;
1639
+
1640
+ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, isDestination?: boolean) => void;
1641
+
1631
1642
  /**
1632
1643
  * Determines the relay chain for a given node.
1633
1644
  *
@@ -1751,6 +1762,6 @@ declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
1751
1762
  * @param node - The node for which to get the paraId.
1752
1763
  * @returns The parachain ID of the node.
1753
1764
  */
1754
- declare const getParaId: (node: TNodeDotKsmWithRelayChains) => number;
1765
+ declare const getParaId: (node: TNodeWithRelayChains) => number;
1755
1766
 
1756
- export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara };
1767
+ export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEcosystemType, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, calculateFee, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara, validateAddress };