@paraspell/sdk 3.0.10 → 3.1.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
@@ -13,14 +13,16 @@ declare abstract class ParachainNode {
13
13
  get node(): TNode;
14
14
  get version(): Version;
15
15
  get assetCheckEnabled(): boolean;
16
- transfer(api: ApiPromise, currencySymbol: string | undefined, currencyId: string | undefined, amount: string, to: string, destination?: TNode, serializedApiCallEnabled?: boolean): Extrinsic | TSerializedApiCall;
16
+ transfer(api: ApiPromise, currencySymbol: string | undefined, currencyId: string | undefined, amount: string, to: string, destination?: TNode, paraIdTo?: number, serializedApiCallEnabled?: boolean): Extrinsic | TSerializedApiCall;
17
17
  transferRelayToPara(options: TTransferRelayToParaOptions): TSerializedApiCall;
18
18
  getProvider(): string;
19
19
  createApiInstance(): Promise<ApiPromise>;
20
+ createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): any;
21
+ createPolkadotXcmHeader(scenario: TScenario, paraId?: number): any;
20
22
  }
21
23
 
22
- declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "Clover", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Kylin", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Equilibrium", "Unique", "Crust", "Manta", "Genshiro", "Nodle", "OriginTrail", "Pendulum", "Polkadex", "Zeitgeist"];
23
- declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "Clover", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Kylin", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Equilibrium", "Unique", "Crust", "Manta", "Genshiro", "Nodle", "OriginTrail", "Pendulum", "Polkadex", "Zeitgeist", "Polkadot", "Kusama"];
24
+ declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "Clover", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Equilibrium", "Unique", "Crust", "Manta", "Genshiro", "Nodle", "OriginTrail", "Pendulum", "Polkadex", "Zeitgeist"];
25
+ declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "Clover", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Equilibrium", "Unique", "Crust", "Manta", "Genshiro", "Nodle", "OriginTrail", "Pendulum", "Polkadex", "Zeitgeist", "Polkadot", "Kusama"];
24
26
  declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm"];
25
27
 
26
28
  type UpdateFunction = (name: string, index: number) => string;
@@ -87,6 +89,7 @@ interface TTransferRelayToParaOptions {
87
89
  destination: TNode;
88
90
  address: string;
89
91
  amount: string;
92
+ paraIdTo?: number;
90
93
  }
91
94
  interface IPolkadotXCMTransfer {
92
95
  transferPolkadotXCM: (input: PolkadotXCMTransferInput) => Extrinsic | TSerializedApiCall;
@@ -95,12 +98,22 @@ declare enum Version {
95
98
  V1 = "V1",
96
99
  V3 = "V3"
97
100
  }
101
+ declare enum Parents {
102
+ ONE = 1,
103
+ ZERO = 0
104
+ }
105
+ type PolkadotXCMHeader = {
106
+ [K in Version]?: {
107
+ parents: Parents;
108
+ interior: any;
109
+ };
110
+ };
98
111
 
99
- declare const sendSerializedApiCall: (api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: string | number | bigint, to: string, destination?: TNode) => TSerializedApiCall;
100
- declare function send(api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: string | number | bigint, to: string, destination?: TNode): Extrinsic;
101
- declare const transferRelayToParaCommon: (api: ApiPromise, destination: TNode, amount: string, address: string, serializedApiCallEnabled?: boolean) => Extrinsic | TSerializedApiCall | never;
102
- declare function transferRelayToPara(api: ApiPromise, destination: TNode, amount: string | number | bigint, to: string): Extrinsic | never;
103
- declare const transferRelayToParaSerializedApiCall: (api: ApiPromise, destination: TNode, amount: string | number | bigint, to: string) => TSerializedApiCall;
112
+ declare const sendSerializedApiCall: (api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: string | number | bigint, to: string, destination?: TNode, paraIdTo?: number) => TSerializedApiCall;
113
+ declare function send(api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: string | number | bigint, to: string, destination?: TNode, paraIdTo?: number): Extrinsic;
114
+ declare const transferRelayToParaCommon: (api: ApiPromise, destination: TNode, amount: string, address: string, paraIdTo?: number, serializedApiCallEnabled?: boolean) => Extrinsic | TSerializedApiCall | never;
115
+ declare function transferRelayToPara(api: ApiPromise, destination: TNode, amount: string | number | bigint, to: string, paraIdTo?: number): Extrinsic | never;
116
+ declare const transferRelayToParaSerializedApiCall: (api: ApiPromise, destination: TNode, amount: string | number | bigint, to: string, paraIdTo?: number) => TSerializedApiCall;
104
117
 
105
118
  declare const index$4_send: typeof send;
106
119
  declare const index$4_sendSerializedApiCall: typeof sendSerializedApiCall;
@@ -153,7 +166,7 @@ declare const getAllAssetsSymbols: (node: TNode) => string[];
153
166
  declare const hasSupportForAsset: (node: TNode, symbol: string) => boolean;
154
167
  declare const getAssetDecimals: (node: TNode, symbol: string) => number | null;
155
168
  declare const getParaId: (node: TNode) => number;
156
- declare const getTNode: (nodeID: number) => TNode | null;
169
+ declare const getTNode: (paraId: number) => TNode | null;
157
170
 
158
171
  declare const index_getAllAssetsSymbols: typeof getAllAssetsSymbols;
159
172
  declare const index_getAssetDecimals: typeof getAssetDecimals;
@@ -270,7 +283,8 @@ declare class ToGeneralBuilder {
270
283
  private readonly api;
271
284
  private readonly from;
272
285
  private readonly to;
273
- constructor(api: ApiPromise, from: TNode, to: TNode);
286
+ private readonly paraIdTo?;
287
+ constructor(api: ApiPromise, from: TNode, to: TNode, paraIdTo?: number);
274
288
  currency(currency: string | number | bigint): AmountBuilder;
275
289
  openChannel(): MaxSizeOpenChannelBuilder;
276
290
  }
@@ -278,7 +292,7 @@ declare class FromGeneralBuilder {
278
292
  private readonly api;
279
293
  private readonly from;
280
294
  constructor(api: ApiPromise, from: TNode);
281
- to(node: TNode): ToGeneralBuilder;
295
+ to(node: TNode, paraIdTo?: number): ToGeneralBuilder;
282
296
  amount(amount: string | number | bigint): AddressBuilder;
283
297
  closeChannel(): InboundCloseChannelBuilder;
284
298
  }
@@ -286,7 +300,7 @@ declare class GeneralBuilder {
286
300
  private readonly api;
287
301
  constructor(api: ApiPromise);
288
302
  from(node: TNode): FromGeneralBuilder;
289
- to(node: TNode): AmountBuilder;
303
+ to(node: TNode, paraIdTo?: number): AmountBuilder;
290
304
  addLiquidity(): AssetAAddLiquidityBuilder;
291
305
  removeLiquidity(): AssetARemoveLiquidityBuilder;
292
306
  buy(): AssetOutBuyBuilder;
@@ -334,4 +348,4 @@ declare class IncompatibleNodesError extends Error {
334
348
  constructor();
335
349
  }
336
350
 
337
- export { type Bool, Builder, type Extrinsic, type ExtrinsicFunction, type IPolkadotXCMTransfer, type IXTokensTransfer, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, type PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAssetDetails, type TAssetJsonMap, type TNativeAssetDetails, type TNode, type TNodeAssets, type TNodeWithRelayChains, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TScenario, type TSerializedApiCall, type TTransferRelayToParaOptions, type UpdateFunction, Version, type XTokensTransferInput, index as assets, index$1 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$2 as openChannels, index$4 as xcmPallet, index$3 as xyk };
351
+ export { type Bool, Builder, type Extrinsic, type ExtrinsicFunction, type IPolkadotXCMTransfer, type IXTokensTransfer, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMHeader, type PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAssetDetails, type TAssetJsonMap, type TNativeAssetDetails, type TNode, type TNodeAssets, type TNodeWithRelayChains, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TScenario, type TSerializedApiCall, type TTransferRelayToParaOptions, type UpdateFunction, Version, type XTokensTransferInput, index as assets, index$1 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$2 as openChannels, index$4 as xcmPallet, index$3 as xyk };