@paraspell/sdk-core 8.6.2 → 8.7.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.d.ts CHANGED
@@ -122,9 +122,6 @@ type TCurrencyCore = TCurrencySymbol | {
122
122
  } | {
123
123
  multilocation: TMultiLocationValue;
124
124
  };
125
- type TCurrencyCoreWithFee = WithAmount<TCurrencyCore> & {
126
- isFeeAsset?: boolean;
127
- };
128
125
  type TMultiAssetWithFee = TMultiAsset & {
129
126
  isFeeAsset?: boolean;
130
127
  };
@@ -135,14 +132,14 @@ type TCurrencyInputWithAmount = WithAmount<TCurrencySymbol | {
135
132
  } | {
136
133
  multilocation: TMultiLocationValueWithOverride;
137
134
  }> | {
138
- multiasset: TMultiAssetWithFee[] | TCurrencyCoreWithFee[];
135
+ multiasset: TMultiAsset[] | WithAmount<TCurrencyCore>[];
139
136
  };
140
137
  type TCurrencyInput = TCurrencySymbol | {
141
138
  id: TCurrency;
142
139
  } | {
143
140
  multilocation: TMultiLocationValueWithOverride;
144
141
  } | {
145
- multiasset: TMultiAssetWithFee[] | TCurrencyCoreWithFee[];
142
+ multiasset: TMultiAsset[] | WithAmount<TCurrencyCore>[];
146
143
  };
147
144
  type WithAmount<TBase> = TBase & {
148
145
  amount: TAmount;
@@ -288,6 +285,7 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
288
285
  handleBifrostEthTransfer: <TApi_1, TRes_1>(input: TPolkadotXCMTransferOptions<TApi_1, TRes_1>) => TRes_1;
289
286
  patchInput<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TPolkadotXCMTransferOptions<TApi, TRes>;
290
287
  private getSection;
288
+ private handleExecuteTransfer;
291
289
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
292
290
  getRelayToParaOverrides(): TRelayToParaOverrides;
293
291
  createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, asset?: TAsset): {
@@ -759,6 +757,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes> = {
759
757
  overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
760
758
  scenario: TScenario;
761
759
  asset: WithAmount<TAsset>;
760
+ feeAsset?: TAsset;
762
761
  destination: TDestination;
763
762
  paraIdTo?: number;
764
763
  version?: Version;
@@ -843,6 +842,10 @@ type TSendBaseOptions = {
843
842
  * The currency to transfer. Either ID, symbol, multi-location, or multi-asset
844
843
  */
845
844
  currency: TCurrencyInputWithAmount;
845
+ /**
846
+ * The optional fee asset. Either ID, symbol, or multi-location
847
+ */
848
+ feeAsset?: TCurrencyInput;
846
849
  /**
847
850
  * The optional destination parachain ID
848
851
  */
@@ -864,9 +867,10 @@ type TSendBaseOptions = {
864
867
  * Options for transferring from a parachain to another parachain or relay chain
865
868
  */
866
869
  type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions, TApi, TRes>;
867
- type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'currency'> & {
870
+ type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'currency' | 'feeAsset'> & {
868
871
  api: IPolkadotApi<TApi, TRes>;
869
872
  asset: WithAmount<TAsset>;
873
+ feeAsset?: TAsset;
870
874
  overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
871
875
  };
872
876
  type TRelayToParaBaseOptions = {
@@ -924,6 +928,10 @@ type TXTransferSection = 'transfer';
924
928
  type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
925
929
  type TPolkadotXcmSection = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets';
926
930
  type TXcmPalletSection = 'limited_teleport_assets' | 'reserve_transfer_assets' | 'limited_reserve_transfer_assets';
931
+ type TWeight = {
932
+ refTime: bigint;
933
+ proofSize: bigint;
934
+ };
927
935
 
928
936
  type TMultiAsset = TMultiAssetV3 | TMultiAssetV4;
929
937
  interface TMultiAssetV3 {
@@ -1185,6 +1193,7 @@ type TDryRunOptions<TApi, TRes> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes>;
1185
1193
  type TDryRunResult = {
1186
1194
  success: true;
1187
1195
  fee: bigint;
1196
+ weight?: TWeight;
1188
1197
  } | {
1189
1198
  success: false;
1190
1199
  failureReason: string;
@@ -1302,6 +1311,7 @@ interface IPolkadotApi<TApi, TRes> {
1302
1311
  hexToUint8a(hex: string): Uint8Array;
1303
1312
  stringToUint8a(str: string): Uint8Array;
1304
1313
  calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
1314
+ quoteAhPrice(fromMl: TMultiLocation, toMl: TMultiLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
1305
1315
  getBalanceNative(address: string): Promise<bigint>;
1306
1316
  getBalanceNativeAcala(address: string, symbol: string): Promise<bigint>;
1307
1317
  getBalanceForeignPolkadotXcm(address: string, id?: string): Promise<bigint>;
@@ -1455,6 +1465,15 @@ declare class GeneralBuilder<TApi, TRes, T extends Partial<TSendBaseOptions> = o
1455
1465
  pallet: string;
1456
1466
  method: string;
1457
1467
  }>;
1468
+ /**
1469
+ * Optional fee asset for the transaction.
1470
+ *
1471
+ * @param currency - The currency to be used for the fee.
1472
+ * @returns An instance of the Builder
1473
+ */
1474
+ feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, T & {
1475
+ feeAsset: TCurrencyInput | undefined;
1476
+ }>;
1458
1477
  /**
1459
1478
  * Adds the transfer transaction to the batch.
1460
1479
  *
@@ -1787,6 +1806,8 @@ declare const send: <TApi, TRes>(options: TSendOptions<TApi, TRes>) => Promise<T
1787
1806
 
1788
1807
  declare const transferRelayToPara: <TApi, TRes>(options: TRelayToParaOptions<TApi, TRes>) => Promise<TRes>;
1789
1808
 
1809
+ declare const isAssetEqual: (asset1: TAsset, asset2: TAsset) => boolean;
1810
+
1790
1811
  declare const isForeignAsset: (asset: TAsset) => asset is TForeignAsset;
1791
1812
 
1792
1813
  declare const isSymbolSpecifier: (currencySymbolValue: TCurrencySymbolValue) => currencySymbolValue is TSymbolSpecifier;
@@ -1819,6 +1840,8 @@ declare const getNode: <TApi, TRes, T extends keyof ReturnType<typeof nodes>>(no
1819
1840
 
1820
1841
  declare const isOverrideMultiLocationSpecifier: (multiLocationSpecifier: TMultiLocationValueWithOverride) => multiLocationSpecifier is TOverrideMultiLocationSpecifier;
1821
1842
 
1843
+ declare const transformMultiLocation: (multiLocation: TMultiLocation) => TMultiLocation;
1844
+
1822
1845
  declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
1823
1846
 
1824
1847
  declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, isDestination?: boolean) => void;
@@ -1838,4 +1861,4 @@ declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
1838
1861
  */
1839
1862
  declare const isRelayChain: (node: TNodeWithRelayChains) => node is "Polkadot" | "Kusama";
1840
1863
 
1841
- export { AssetClaimBuilder, BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, 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, type OneKey, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetClaimOptions, type TAssetClaimOptionsBase, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEcosystemType, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TEvmNodeFrom, 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 TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, 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 TVerifyEdOnDestinationOptions, type TVerifyEdOnDestinationOptionsBase, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TXcmVersioned, 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, getParaEthTransferFees, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasDryRunSupport, hasSupportForAsset, isEthersContract, isEthersSigner, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, validateAddress, verifyEdOnDestination };
1864
+ export { AssetClaimBuilder, BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, 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, type OneKey, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetClaimOptions, type TAssetClaimOptionsBase, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEcosystemType, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TEvmNodeFrom, 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 TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, 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 TVerifyEdOnDestinationOptions, type TVerifyEdOnDestinationOptionsBase, type TVersionClaimAssets, type TWeight, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TXcmVersioned, 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, getParaEthTransferFees, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasDryRunSupport, hasSupportForAsset, isAssetEqual, isEthersContract, isEthersSigner, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };