@paraspell/sdk 5.5.0 → 5.6.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
@@ -1,7 +1,8 @@
1
1
  import { ApiPromise } from '@polkadot/api';
2
2
  import { SubmittableExtrinsic } from '@polkadot/api/types';
3
3
 
4
- interface TMultiAsset {
4
+ type TMultiAsset = TMultiAssetV3 | TMultiAssetV4;
5
+ interface TMultiAssetV3 {
5
6
  id: {
6
7
  Concrete: TMultiLocation;
7
8
  };
@@ -9,6 +10,12 @@ interface TMultiAsset {
9
10
  Fungible: TAmount;
10
11
  };
11
12
  }
13
+ interface TMultiAssetV4 {
14
+ id: TMultiLocation;
15
+ fun: {
16
+ Fungible: TAmount;
17
+ };
18
+ }
12
19
 
13
20
  type Extrinsic = SubmittableExtrinsic<'promise'>;
14
21
  interface PolkadotXCMTransferInput {
@@ -87,6 +94,7 @@ interface TSendBaseOptions {
87
94
  paraIdTo?: number;
88
95
  feeAsset?: TCurrency;
89
96
  destApiForKeepAlive?: ApiPromise;
97
+ version?: Version;
90
98
  }
91
99
  interface TSendOptions extends TSendBaseOptions {
92
100
  api?: ApiPromise;
@@ -110,6 +118,7 @@ interface TRelayToParaBaseOptions {
110
118
  address: TAddress;
111
119
  paraIdTo?: number;
112
120
  destApiForKeepAlive?: ApiPromise;
121
+ version?: Version;
113
122
  }
114
123
  interface TRelayToParaOptions extends TRelayToParaBaseOptions {
115
124
  api?: ApiPromise;
@@ -205,7 +214,7 @@ interface JunctionGlobalConsensus {
205
214
  type TJunction = JunctionParachain | JunctionAccountId32 | JunctionAccountIndex64 | JunctionAccountKey20 | JunctionPalletInstance | JunctionGeneralIndex | JunctionGeneralKey | JunctionOnlyChild | JunctionPlurality | JunctionGlobalConsensus;
206
215
  interface Junctions {
207
216
  Here?: null;
208
- X1?: TJunction;
217
+ X1?: TJunction | [TJunction];
209
218
  X2?: [TJunction, TJunction];
210
219
  X3?: [TJunction, TJunction, TJunction];
211
220
  X4?: [TJunction, TJunction, TJunction, TJunction];
@@ -239,7 +248,7 @@ interface Junctions {
239
248
  }
240
249
  interface TMultiLocation {
241
250
  parents: StringOrNumber;
242
- interior: Junctions;
251
+ interior: Junctions | 'Here';
243
252
  }
244
253
  type TMultiLocationHeader = {
245
254
  [key in Version]?: TMultiLocation;
@@ -257,16 +266,17 @@ declare abstract class ParachainNode {
257
266
  get node(): TNode;
258
267
  get version(): Version;
259
268
  get assetCheckEnabled(): boolean;
269
+ protected canUseXTokens(_: TSendInternalOptions): boolean;
260
270
  transfer(options: TSendInternalOptions): Extrinsic | TSerializedApiCall;
261
271
  transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
262
272
  getProvider(): string;
263
273
  createApiInstance(): Promise<ApiPromise>;
264
274
  createCurrencySpec(amount: string, scenario: TScenario, version: Version, _?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): any;
265
- createPolkadotXcmHeader(scenario: TScenario, destination?: TDestination, paraId?: number): any;
275
+ createPolkadotXcmHeader(scenario: TScenario, version: Version, destination?: TDestination, paraId?: number): any;
266
276
  }
267
277
 
268
- declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio"];
269
- declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Polkadot", "Kusama"];
278
+ declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio"];
279
+ declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Polkadot", "Kusama"];
270
280
  declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm", "XTransfer"];
271
281
 
272
282
  type TNode = (typeof NODE_NAMES)[number];
@@ -473,6 +483,7 @@ interface FinalBuilderAsync {
473
483
  }
474
484
  interface UseKeepAliveFinalBuilder {
475
485
  useKeepAlive: (destApi: ApiPromise) => UseKeepAliveFinalBuilder;
486
+ xcmVersion: (version: Version) => UseKeepAliveFinalBuilder;
476
487
  build: () => Promise<Extrinsic | never>;
477
488
  buildSerializedApiCall: () => Promise<TSerializedApiCall>;
478
489
  }
@@ -515,7 +526,7 @@ declare class NoXCMSupportImplementedError extends Error {
515
526
  }
516
527
 
517
528
  declare class ScenarioNotSupportedError extends Error {
518
- constructor(node: TNode, scenario: TScenario);
529
+ constructor(node: TNode, scenario: TScenario, message?: string);
519
530
  }
520
531
 
521
532
  declare class IncompatibleNodesError extends Error {
@@ -524,4 +535,4 @@ declare class IncompatibleNodesError extends Error {
524
535
 
525
536
  declare const getExistentialDeposit: (node: TNodeWithRelayChains) => string | null;
526
537
 
527
- export { Builder, type CheckKeepAliveOptions, type Extrinsic, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionType, NODES_WITH_RELAY_CHAINS, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAssetDetails, type TAssetJsonMap, type TCloseChannelInternalOptions, type TCloseChannelOptions, type TCurrency, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TDestination, type TEdJsonMap, type TJunction, type TMultiAsset, type TMultiLocation, type TMultiLocationHeader, type TNativeAssetDetails, type TNode, type TNodeAssets, type TNodeToAssetModuleMap, type TNodeWithRelayChains, type TOpenChannelInternalOptions, type TOpenChannelOptions, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaCommonOptions, type TRelayToParaInternalOptions, type TRelayToParaOptions, type TScenario, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSendOptionsCommon, type TSerializedApiCall, type TVersionClaimAssets, Version, type XTokensTransferInput, type XTransferTransferInput, index as assets, index$1 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, index$2 as openChannels, index$3 as xcmPallet };
538
+ export { Builder, type CheckKeepAliveOptions, type Extrinsic, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionType, type Junctions, NODES_WITH_RELAY_CHAINS, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAssetDetails, type TAssetJsonMap, type TCloseChannelInternalOptions, type TCloseChannelOptions, type TCurrency, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TDestination, type TEdJsonMap, type TJunction, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiLocation, type TMultiLocationHeader, type TNativeAssetDetails, type TNode, type TNodeAssets, type TNodeToAssetModuleMap, type TNodeWithRelayChains, type TOpenChannelInternalOptions, type TOpenChannelOptions, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaCommonOptions, type TRelayToParaInternalOptions, type TRelayToParaOptions, type TScenario, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSendOptionsCommon, type TSerializedApiCall, type TVersionClaimAssets, Version, type XTokensTransferInput, type XTransferTransferInput, index as assets, index$1 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, index$2 as openChannels, index$3 as xcmPallet };