@paraspell/sdk 3.0.10 → 3.0.11

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,15 @@ 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;
20
21
  }
21
22
 
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"];
23
+ 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"];
24
+ 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
25
  declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm"];
25
26
 
26
27
  type UpdateFunction = (name: string, index: number) => string;
@@ -87,6 +88,7 @@ interface TTransferRelayToParaOptions {
87
88
  destination: TNode;
88
89
  address: string;
89
90
  amount: string;
91
+ paraIdTo?: number;
90
92
  }
91
93
  interface IPolkadotXCMTransfer {
92
94
  transferPolkadotXCM: (input: PolkadotXCMTransferInput) => Extrinsic | TSerializedApiCall;
@@ -95,12 +97,16 @@ declare enum Version {
95
97
  V1 = "V1",
96
98
  V3 = "V3"
97
99
  }
100
+ declare enum Parents {
101
+ ONE = 1,
102
+ ZERO = 0
103
+ }
98
104
 
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;
105
+ declare const sendSerializedApiCall: (api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: string | number | bigint, to: string, destination?: TNode, paraIdTo?: number) => TSerializedApiCall;
106
+ declare function send(api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: string | number | bigint, to: string, destination?: TNode, paraIdTo?: number): Extrinsic;
107
+ declare const transferRelayToParaCommon: (api: ApiPromise, destination: TNode, amount: string, address: string, paraIdTo?: number, serializedApiCallEnabled?: boolean) => Extrinsic | TSerializedApiCall | never;
108
+ declare function transferRelayToPara(api: ApiPromise, destination: TNode, amount: string | number | bigint, to: string, paraIdTo?: number): Extrinsic | never;
109
+ declare const transferRelayToParaSerializedApiCall: (api: ApiPromise, destination: TNode, amount: string | number | bigint, to: string, paraIdTo?: number) => TSerializedApiCall;
104
110
 
105
111
  declare const index$4_send: typeof send;
106
112
  declare const index$4_sendSerializedApiCall: typeof sendSerializedApiCall;
@@ -153,7 +159,7 @@ declare const getAllAssetsSymbols: (node: TNode) => string[];
153
159
  declare const hasSupportForAsset: (node: TNode, symbol: string) => boolean;
154
160
  declare const getAssetDecimals: (node: TNode, symbol: string) => number | null;
155
161
  declare const getParaId: (node: TNode) => number;
156
- declare const getTNode: (nodeID: number) => TNode | null;
162
+ declare const getTNode: (paraId: number) => TNode | null;
157
163
 
158
164
  declare const index_getAllAssetsSymbols: typeof getAllAssetsSymbols;
159
165
  declare const index_getAssetDecimals: typeof getAssetDecimals;
@@ -270,7 +276,8 @@ declare class ToGeneralBuilder {
270
276
  private readonly api;
271
277
  private readonly from;
272
278
  private readonly to;
273
- constructor(api: ApiPromise, from: TNode, to: TNode);
279
+ private readonly paraIdTo?;
280
+ constructor(api: ApiPromise, from: TNode, to: TNode, paraIdTo?: number);
274
281
  currency(currency: string | number | bigint): AmountBuilder;
275
282
  openChannel(): MaxSizeOpenChannelBuilder;
276
283
  }
@@ -278,7 +285,7 @@ declare class FromGeneralBuilder {
278
285
  private readonly api;
279
286
  private readonly from;
280
287
  constructor(api: ApiPromise, from: TNode);
281
- to(node: TNode): ToGeneralBuilder;
288
+ to(node: TNode, paraIdTo?: number): ToGeneralBuilder;
282
289
  amount(amount: string | number | bigint): AddressBuilder;
283
290
  closeChannel(): InboundCloseChannelBuilder;
284
291
  }
@@ -286,7 +293,7 @@ declare class GeneralBuilder {
286
293
  private readonly api;
287
294
  constructor(api: ApiPromise);
288
295
  from(node: TNode): FromGeneralBuilder;
289
- to(node: TNode): AmountBuilder;
296
+ to(node: TNode, paraIdTo?: number): AmountBuilder;
290
297
  addLiquidity(): AssetAAddLiquidityBuilder;
291
298
  removeLiquidity(): AssetARemoveLiquidityBuilder;
292
299
  buy(): AssetOutBuyBuilder;
@@ -334,4 +341,4 @@ declare class IncompatibleNodesError extends Error {
334
341
  constructor();
335
342
  }
336
343
 
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 };
344
+ export { type Bool, Builder, type Extrinsic, type ExtrinsicFunction, type IPolkadotXCMTransfer, type IXTokensTransfer, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, 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 };