@paraspell/sdk-core 10.3.1 → 10.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
@@ -71,6 +71,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes> = {
71
71
  overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
72
72
  scenario: TScenario;
73
73
  asset: WithAmount<TAsset>;
74
+ currency: TCurrencyInputWithAmount;
74
75
  feeAsset?: TAsset;
75
76
  destination: TDestination;
76
77
  paraIdTo?: number;
@@ -188,7 +189,7 @@ type WithRequiredSenderAddress<TBase> = Omit<TBase, 'senderAddress'> & {
188
189
  senderAddress: string;
189
190
  };
190
191
  type TSendBaseOptionsWithSenderAddress = WithRequiredSenderAddress<TSendBaseOptions>;
191
- type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'currency' | 'feeAsset'> & {
192
+ type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'feeAsset'> & {
192
193
  api: IPolkadotApi<TApi, TRes>;
193
194
  asset: WithAmount<TAsset>;
194
195
  feeAsset?: TAsset;
@@ -229,7 +230,7 @@ type TRelayToParaBaseOptions = {
229
230
  method?: string;
230
231
  };
231
232
  type TRelayToParaOverrides = {
232
- section: TXcmPalletSection;
233
+ method: TXcmPalletMethod;
233
234
  includeFee: boolean;
234
235
  };
235
236
  /**
@@ -238,17 +239,17 @@ type TRelayToParaOverrides = {
238
239
  type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions, TApi, TRes>;
239
240
  type TSerializedApiCall = {
240
241
  module: TPallet | 'Utility';
241
- section: string;
242
+ method: string;
242
243
  parameters: Record<string, unknown>;
243
244
  };
244
245
  type TDestWeight = {
245
246
  ref_time: bigint;
246
247
  proof_size: bigint;
247
248
  };
248
- type TXTransferSection = 'transfer';
249
- type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
250
- type TPolkadotXcmSection = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets';
251
- type TXcmPalletSection = 'limited_teleport_assets' | 'reserve_transfer_assets' | 'limited_reserve_transfer_assets';
249
+ type TXTransferMethod = 'transfer';
250
+ type TXTokensMethod = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
251
+ type TPolkadotXcmMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets';
252
+ type TXcmPalletMethod = 'limited_teleport_assets' | 'reserve_transfer_assets' | 'limited_reserve_transfer_assets';
252
253
  type TWeight = {
253
254
  refTime: bigint;
254
255
  proofSize: bigint;
@@ -289,7 +290,7 @@ type TGetBalanceNativeOptionsBase = {
289
290
  /**
290
291
  * The node on which to query the balance.
291
292
  */
292
- node: TNodeDotKsmWithRelayChains;
293
+ node: TNodeWithRelayChains;
293
294
  /**
294
295
  * The native currency to query.
295
296
  */
@@ -306,7 +307,7 @@ type TGetBalanceForeignOptionsBase = {
306
307
  /**
307
308
  * The node on which to query the balance.
308
309
  */
309
- node: TNodePolkadotKusama;
310
+ node: TNode;
310
311
  /**
311
312
  * The currency to query.
312
313
  */
@@ -324,7 +325,7 @@ type TGetAssetBalanceOptionsBase = {
324
325
  /**
325
326
  * The node on which to query the balance.
326
327
  */
327
- node: TNodeDotKsmWithRelayChains;
328
+ node: TNodeWithRelayChains;
328
329
  /**
329
330
  * The currency to query.
330
331
  */
@@ -586,7 +587,10 @@ type TDryRunNodeResultInternal = TDryRunNodeSuccess | TDryRunNodeFailure;
586
587
  type TDryRunNodeResult = (TDryRunNodeSuccess & {
587
588
  currency: string;
588
589
  }) | TDryRunNodeFailure;
590
+ type TDryRunChain = 'origin' | 'destination' | 'assetHub' | 'bridgeHub';
589
591
  type TDryRunResult = {
592
+ failureReason?: string;
593
+ failureChain?: TDryRunChain;
590
594
  origin: TDryRunNodeResult;
591
595
  destination?: TDryRunNodeResult;
592
596
  assetHub?: TDryRunNodeResult;
@@ -845,7 +849,7 @@ type TGetXcmFeeBaseOptions<TRes> = {
845
849
  */
846
850
  senderAddress: string;
847
851
  address: string;
848
- currency: TCurrencyInputWithAmount;
852
+ currency: WithAmount<TCurrencyCore>;
849
853
  feeAsset?: TCurrencyInput;
850
854
  disableFallback: boolean;
851
855
  };
@@ -871,7 +875,7 @@ type TGetFeeForDestNodeBaseOptions = {
871
875
  destination: TNodeWithRelayChains;
872
876
  senderAddress: string;
873
877
  address: string;
874
- currency: TCurrencyInputWithAmount;
878
+ currency: WithAmount<TCurrencyCore>;
875
879
  forwardedXcms: any;
876
880
  asset: TAsset;
877
881
  originFee: bigint;
@@ -888,14 +892,21 @@ type TXcmFeeDetail = {
888
892
  fee: bigint;
889
893
  currency: string;
890
894
  feeType: TFeeType;
895
+ weight?: TWeight;
896
+ sufficient?: boolean;
891
897
  dryRunError?: string;
892
898
  } | {
893
899
  fee?: bigint;
894
900
  currency?: string;
895
901
  feeType?: TFeeType;
902
+ weight?: TWeight;
903
+ sufficient?: boolean;
896
904
  dryRunError: string;
897
905
  };
906
+ type TXcmFeeChain = 'origin' | 'destination' | 'assetHub' | 'bridgeHub';
898
907
  type TGetXcmFeeResult = {
908
+ failureReason?: string;
909
+ failureChain?: TXcmFeeChain;
899
910
  origin: TXcmFeeDetail;
900
911
  destination: TXcmFeeDetail;
901
912
  assetHub?: TXcmFeeDetail;
@@ -904,6 +915,7 @@ type TGetXcmFeeResult = {
904
915
  type TGetXcmFeeEstimateDetail = {
905
916
  fee: bigint;
906
917
  currency: string;
918
+ sufficient?: boolean;
907
919
  };
908
920
  type TGetXcmFeeEstimateResult = {
909
921
  origin: TGetXcmFeeEstimateDetail;
@@ -1212,13 +1224,11 @@ declare abstract class ParachainNode<TApi, TRes> {
1212
1224
  private readonly _info;
1213
1225
  private readonly _type;
1214
1226
  private readonly _version;
1215
- protected _assetCheckEnabled: boolean;
1216
1227
  constructor(node: TNodePolkadotKusama, info: string, type: TEcosystemType, version: Version);
1217
1228
  get info(): string;
1218
1229
  get type(): TEcosystemType;
1219
1230
  get node(): TNodePolkadotKusama;
1220
1231
  get version(): Version;
1221
- get assetCheckEnabled(): boolean;
1222
1232
  protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
1223
1233
  transfer(options: TSendInternalOptions<TApi, TRes>): Promise<TRes>;
1224
1234
  getRelayToParaOverrides(): TRelayToParaOverrides;
@@ -1290,7 +1300,7 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
1290
1300
  handleMythosTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
1291
1301
  handleBifrostEthTransfer: <TApi_1, TRes_1>(input: TPolkadotXCMTransferOptions<TApi_1, TRes_1>, useDOTAsFeeAsset?: boolean) => TRes_1;
1292
1302
  patchInput<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TPolkadotXCMTransferOptions<TApi, TRes>;
1293
- private getSection;
1303
+ private getMethod;
1294
1304
  private handleExecuteTransfer;
1295
1305
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1296
1306
  getRelayToParaOverrides(): TRelayToParaOverrides;
@@ -1385,14 +1395,12 @@ declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> impl
1385
1395
 
1386
1396
  declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
1387
1397
  constructor();
1388
- _assetCheckEnabled: boolean;
1389
1398
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1390
1399
  getRelayToParaOverrides(): TRelayToParaOverrides;
1391
1400
  }
1392
1401
 
1393
1402
  declare class BridgeHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
1394
1403
  constructor();
1395
- _assetCheckEnabled: boolean;
1396
1404
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1397
1405
  getRelayToParaOverrides(): TRelayToParaOverrides;
1398
1406
  }
@@ -1418,14 +1426,12 @@ declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> im
1418
1426
 
1419
1427
  declare class CoretimeKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
1420
1428
  constructor();
1421
- _assetCheckEnabled: boolean;
1422
1429
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1423
1430
  getRelayToParaOverrides(): TRelayToParaOverrides;
1424
1431
  }
1425
1432
 
1426
1433
  declare class CoretimePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
1427
1434
  constructor();
1428
- _assetCheckEnabled: boolean;
1429
1435
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1430
1436
  getRelayToParaOverrides(): TRelayToParaOverrides;
1431
1437
  }
@@ -1566,6 +1572,7 @@ declare class Moonriver<TApi, TRes> extends ParachainNode<TApi, TRes> implements
1566
1572
 
1567
1573
  declare class Mythos<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
1568
1574
  constructor();
1575
+ private createTx;
1569
1576
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1570
1577
  transferRelayToPara(): TSerializedApiCall;
1571
1578
  }
@@ -1785,6 +1792,7 @@ declare const transferRelayToPara: <TApi, TRes>(options: TRelayToParaOptions<TAp
1785
1792
 
1786
1793
  declare const createApiInstanceForNode: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, node: TNodeDotKsmWithRelayChains) => Promise<TApi>;
1787
1794
 
1795
+ declare const createBeneficiary: <TApi, TRes>(options: TCreateBeneficiaryOptions<TApi, TRes>) => _paraspell_sdk_common.TMultiLocation;
1788
1796
  declare const createVersionedBeneficiary: <TApi, TRes>(options: TCreateBeneficiaryOptions<TApi, TRes>) => OneKey<Version, _paraspell_sdk_common.TMultiLocation>;
1789
1797
 
1790
1798
  declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
@@ -1834,5 +1842,5 @@ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, i
1834
1842
  */
1835
1843
  declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
1836
1844
 
1837
- export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, replaceBigInt, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
1838
- export type { IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TCreateBeneficiaryOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunNodeFailure, TDryRunNodeResult, TDryRunNodeResultInternal, TDryRunNodeSuccess, TDryRunOptions, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEdJsonMap, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmNodeFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestNodeBaseOptions, TGetFeeForDestNodeOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodeConfig, TNodeConfigMap, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmSection, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TRelaychain, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TVersionClaimAssets, TWeight, TXTokensCurrencySelection, TXTokensSection, TXTokensTransferOptions, TXTransferSection, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmForeignAsset, TXcmPalletSection, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
1845
+ export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiary, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, replaceBigInt, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
1846
+ export type { IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TCreateBeneficiaryOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunNodeFailure, TDryRunNodeResult, TDryRunNodeResultInternal, TDryRunNodeSuccess, TDryRunOptions, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEdJsonMap, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmNodeFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestNodeBaseOptions, TGetFeeForDestNodeOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodeConfig, TNodeConfigMap, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TRelaychain, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TVersionClaimAssets, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };