@paraspell/sdk-core 10.2.0 → 10.3.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.
Files changed (4) hide show
  1. package/dist/index.cjs +1620 -2017
  2. package/dist/index.d.ts +32 -49
  3. package/dist/index.mjs +1618 -2013
  4. package/package.json +13 -14
package/dist/index.d.ts CHANGED
@@ -6,8 +6,7 @@ import { TMultiAsset, TCurrencyInputWithAmount, TCurrencyInput, WithAmount, TAss
6
6
  export * from '@paraspell/assets';
7
7
  import { TPallet } from '@paraspell/pallets';
8
8
  export * from '@paraspell/pallets';
9
- import { Signer, AbstractProvider, Contract } from 'ethers';
10
- import { WalletClient, GetContractReturnType, Abi } from 'viem';
9
+ import { WalletClient } from 'viem';
11
10
 
12
11
  type WithApi<TBase, TApi, TRes> = TBase & {
13
12
  api: IPolkadotApi<TApi, TRes>;
@@ -90,6 +89,7 @@ type TXTokensTransferOptions<TApi, TRes> = {
90
89
  origin: TNodePolkadotKusama;
91
90
  destination: TDestination;
92
91
  paraIdTo?: number;
92
+ version: Version;
93
93
  overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
94
94
  pallet?: string;
95
95
  method?: string;
@@ -120,9 +120,9 @@ type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
120
120
  * The XCM version.
121
121
  */
122
122
  declare enum Version {
123
- V1 = "V1",
124
123
  V3 = "V3",
125
- V4 = "V4"
124
+ V4 = "V4",
125
+ V5 = "V5"
126
126
  }
127
127
  /**
128
128
  * The supported XCM versions for asset claims.
@@ -475,11 +475,9 @@ type TEvmBuilderOptionsBase = {
475
475
  /**
476
476
  * The Ethereum signer.
477
477
  */
478
- signer: Signer | WalletClient;
479
- };
480
- type TEvmBuilderOptions<TApi, TRes> = WithApi<TEvmBuilderOptionsBase, TApi, TRes> & {
481
- provider?: AbstractProvider;
478
+ signer: WalletClient;
482
479
  };
480
+ type TEvmBuilderOptions<TApi, TRes> = WithApi<TEvmBuilderOptionsBase, TApi, TRes>;
483
481
  type TSerializeEthTransferOptions = Omit<TEvmBuilderOptionsBase, 'signer'> & {
484
482
  destAddress: string;
485
483
  };
@@ -1269,17 +1267,17 @@ declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> imple
1269
1267
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1270
1268
  getRelayToParaOverrides(): TRelayToParaOverrides;
1271
1269
  createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, isOverridenAsset?: boolean): {
1272
- V1: _paraspell_assets.TMultiAsset[];
1273
- V3?: undefined;
1274
- V4?: undefined;
1275
- } | {
1276
1270
  V3: _paraspell_assets.TMultiAsset[];
1277
- V1?: undefined;
1278
1271
  V4?: undefined;
1272
+ V5?: undefined;
1279
1273
  } | {
1280
1274
  V4: _paraspell_assets.TMultiAsset[];
1281
- V1?: undefined;
1282
1275
  V3?: undefined;
1276
+ V5?: undefined;
1277
+ } | {
1278
+ V5: _paraspell_assets.TMultiAsset[];
1279
+ V3?: undefined;
1280
+ V4?: undefined;
1283
1281
  };
1284
1282
  transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1285
1283
  }
@@ -1297,17 +1295,17 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
1297
1295
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1298
1296
  getRelayToParaOverrides(): TRelayToParaOverrides;
1299
1297
  createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, asset?: TAsset, isOverriddenAsset?: boolean): {
1300
- V1: _paraspell_assets.TMultiAsset[];
1301
- V3?: undefined;
1302
- V4?: undefined;
1303
- } | {
1304
1298
  V3: _paraspell_assets.TMultiAsset[];
1305
- V1?: undefined;
1306
1299
  V4?: undefined;
1300
+ V5?: undefined;
1307
1301
  } | {
1308
1302
  V4: _paraspell_assets.TMultiAsset[];
1309
- V1?: undefined;
1310
1303
  V3?: undefined;
1304
+ V5?: undefined;
1305
+ } | {
1306
+ V5: _paraspell_assets.TMultiAsset[];
1307
+ V3?: undefined;
1308
+ V4?: undefined;
1311
1309
  };
1312
1310
  transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1313
1311
  }
@@ -1385,10 +1383,6 @@ declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> impl
1385
1383
  transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1386
1384
  }
1387
1385
 
1388
- declare class Bitgreen<TApi, TRes> extends ParachainNode<TApi, TRes> {
1389
- constructor();
1390
- }
1391
-
1392
1386
  declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
1393
1387
  constructor();
1394
1388
  _assetCheckEnabled: boolean;
@@ -1441,17 +1435,17 @@ declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPol
1441
1435
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1442
1436
  transferRelayToPara(): TSerializedApiCall;
1443
1437
  createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset): {
1444
- V1: _paraspell_assets.TMultiAsset[];
1445
- V3?: undefined;
1446
- V4?: undefined;
1447
- } | {
1448
1438
  V3: _paraspell_assets.TMultiAsset[];
1449
- V1?: undefined;
1450
1439
  V4?: undefined;
1440
+ V5?: undefined;
1451
1441
  } | {
1452
1442
  V4: _paraspell_assets.TMultiAsset[];
1453
- V1?: undefined;
1454
1443
  V3?: undefined;
1444
+ V5?: undefined;
1445
+ } | {
1446
+ V5: _paraspell_assets.TMultiAsset[];
1447
+ V3?: undefined;
1448
+ V4?: undefined;
1455
1449
  };
1456
1450
  transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1457
1451
  }
@@ -1479,17 +1473,17 @@ declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements
1479
1473
  constructor();
1480
1474
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1481
1475
  createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset): {
1482
- V1: _paraspell_assets.TMultiAsset[];
1483
- V3?: undefined;
1484
- V4?: undefined;
1485
- } | {
1486
1476
  V3: _paraspell_assets.TMultiAsset[];
1487
- V1?: undefined;
1488
1477
  V4?: undefined;
1478
+ V5?: undefined;
1489
1479
  } | {
1490
1480
  V4: _paraspell_assets.TMultiAsset[];
1491
- V1?: undefined;
1492
1481
  V3?: undefined;
1482
+ V5?: undefined;
1483
+ } | {
1484
+ V5: _paraspell_assets.TMultiAsset[];
1485
+ V3?: undefined;
1486
+ V4?: undefined;
1493
1487
  };
1494
1488
  transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1495
1489
  }
@@ -1656,12 +1650,6 @@ declare class Subsocial<TApi, TRes> extends ParachainNode<TApi, TRes> implements
1656
1650
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1657
1651
  }
1658
1652
 
1659
- declare class Turing<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
1660
- constructor();
1661
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
1662
- transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1663
- }
1664
-
1665
1653
  declare class Unique<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
1666
1654
  private static NATIVE_ASSET_ID;
1667
1655
  constructor();
@@ -1686,7 +1674,6 @@ declare const nodes: <TApi, TRes>() => {
1686
1674
  BifrostPolkadot: BifrostPolkadot<TApi, TRes>;
1687
1675
  BridgeHubPolkadot: BridgeHubPolkadot<TApi, TRes>;
1688
1676
  BridgeHubKusama: BridgeHubKusama<TApi, TRes>;
1689
- Bitgreen: Bitgreen<TApi, TRes>;
1690
1677
  Centrifuge: Centrifuge<TApi, TRes>;
1691
1678
  ComposableFinance: ComposableFinance<TApi, TRes>;
1692
1679
  Darwinia: Darwinia<TApi, TRes>;
@@ -1713,7 +1700,6 @@ declare const nodes: <TApi, TRes>() => {
1713
1700
  PeoplePolkadot: PeoplePolkadot<TApi, TRes>;
1714
1701
  PeopleKusama: PeopleKusama<TApi, TRes>;
1715
1702
  Shiden: Shiden<TApi, TRes>;
1716
- Turing: Turing<TApi, TRes>;
1717
1703
  Manta: Manta<TApi, TRes>;
1718
1704
  Nodle: Nodle<TApi, TRes>;
1719
1705
  NeuroWeb: NeuroWeb<TApi, TRes>;
@@ -1778,10 +1764,7 @@ declare const getParaEthTransferFees: <TApi, TRes>(ahApi: IPolkadotApi<TApi, TRe
1778
1764
 
1779
1765
  declare const transferMoonbeamEvm: <TApi, TRes>({ api, from, to, signer, address, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
1780
1766
 
1781
- declare const transferMoonbeamToEth: <TApi, TRes>({ api, from, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
1782
-
1783
- declare const isEthersSigner: (signer: Signer | WalletClient) => signer is Signer;
1784
- declare const isEthersContract: (contract: Contract | GetContractReturnType<Abi | readonly unknown[]>) => contract is Contract;
1767
+ declare const transferMoonbeamToEth: <TApi, TRes>({ api, from, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<`0x${string}`>;
1785
1768
 
1786
1769
  declare const getOriginXcmFee: <TApi, TRes>({ api, tx, origin, destination, senderAddress, disableFallback, feeAsset, currency }: TGetOriginXcmFeeOptions<TApi, TRes>) => Promise<TXcmFeeDetail & {
1787
1770
  forwardedXcms?: any;
@@ -1851,5 +1834,5 @@ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, i
1851
1834
  */
1852
1835
  declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
1853
1836
 
1854
- 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, isEthersContract, isEthersSigner, replaceBigInt, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
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 };
1855
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 };