@paraspell/sdk 3.0.5 → 3.0.7

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,72 +1,79 @@
1
1
  import { ApiPromise } from '@polkadot/api';
2
2
  import { SubmittableExtrinsic } from '@polkadot/api/types';
3
- import * as _polkadot_apps_config_endpoints_types from '@polkadot/apps-config/endpoints/types';
4
3
 
5
4
  declare abstract class ParachainNode {
6
- private _node;
7
- private _name;
8
- private _type;
9
- private _version;
5
+ private readonly _node;
6
+ private readonly _name;
7
+ private readonly _type;
8
+ private readonly _version;
9
+ protected _assetCheckEnabled: boolean;
10
10
  constructor(node: TNode, name: string, type: TRelayChainType, version: Version);
11
11
  get name(): string;
12
12
  get type(): TRelayChainType;
13
- get node(): "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";
13
+ get node(): TNode;
14
14
  get version(): Version;
15
- transfer(api: ApiPromise, currencySymbol: string | undefined, currencyId: string | undefined, amount: any, to: string, destination?: TNode, serializedApiCallEnabled?: boolean): Extrinsic | TSerializedApiCall;
15
+ get assetCheckEnabled(): boolean;
16
+ transfer(api: ApiPromise, currencySymbol: string | undefined, currencyId: string | undefined, amount: string, to: string, destination?: TNode, serializedApiCallEnabled?: boolean): Extrinsic | TSerializedApiCall;
17
+ transferRelayToPara(options: TTransferRelayToParaOptions): TSerializedApiCall;
18
+ getProvider(): string;
19
+ createApiInstance(): Promise<ApiPromise>;
16
20
  }
17
21
 
18
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"];
19
24
  declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm"];
20
25
 
21
26
  type UpdateFunction = (name: string, index: number) => string;
22
27
  type Extrinsic = SubmittableExtrinsic<'promise'>;
23
28
  type ExtrinsicFunction<T> = (arg: T) => Extrinsic;
24
29
  type TRelayChainType = 'polkadot' | 'kusama';
30
+ type TRelayChainSymbol = 'DOT' | 'KSM';
25
31
  type TNode = (typeof NODE_NAMES)[number];
26
- type TAssetDetails = {
32
+ type TNodeWithRelayChains = (typeof NODES_WITH_RELAY_CHAINS)[number];
33
+ interface TAssetDetails {
27
34
  assetId: string;
28
35
  symbol?: string;
29
36
  decimals?: number;
30
- };
31
- type TNativeAssetDetails = {
37
+ }
38
+ interface TNativeAssetDetails {
32
39
  assetId?: string;
33
40
  symbol: string;
34
41
  decimals: number;
35
- };
36
- type TNodeAssets = {
42
+ }
43
+ interface TNodeAssets {
37
44
  paraId: number;
38
- relayChainAssetSymbol: 'KSM' | 'DOT';
45
+ relayChainAssetSymbol: TRelayChainSymbol;
39
46
  nativeAssets: TNativeAssetDetails[];
40
47
  otherAssets: TAssetDetails[];
41
- };
48
+ }
42
49
  type TAssetJsonMap = Record<TNode, TNodeAssets>;
43
50
  type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
44
51
  type Bool = 'Yes' | 'No';
45
52
  type TPallet = (typeof SUPPORTED_PALLETS)[number];
46
- type TPalletMap = {
53
+ interface TPalletMap {
47
54
  defaultPallet: TPallet;
48
55
  supportedPallets: TPallet[];
49
- };
56
+ }
50
57
  type TPalletJsonMap = Record<TNode, TPalletMap>;
51
- type TSerializedApiCall = {
58
+ interface TSerializedApiCall {
52
59
  module: string;
53
60
  section: string;
54
61
  parameters: any[];
55
- };
56
- type XTokensTransferInput = {
62
+ }
63
+ interface XTokensTransferInput {
57
64
  api: ApiPromise;
58
65
  currency: string | undefined;
59
66
  currencyID: string | undefined;
60
- amount: any;
67
+ amount: string;
61
68
  addressSelection: any;
62
69
  fees: number;
63
70
  scenario: TScenario;
64
71
  serializedApiCallEnabled?: boolean;
65
- };
72
+ }
66
73
  interface IXTokensTransfer {
67
- transferXTokens(input: XTokensTransferInput): Extrinsic | TSerializedApiCall;
74
+ transferXTokens: (input: XTokensTransferInput) => Extrinsic | TSerializedApiCall;
68
75
  }
69
- type PolkadotXCMTransferInput = {
76
+ interface PolkadotXCMTransferInput {
70
77
  api: ApiPromise;
71
78
  header: any;
72
79
  addressSelection: any;
@@ -74,20 +81,26 @@ type PolkadotXCMTransferInput = {
74
81
  scenario: TScenario;
75
82
  currencySymbol: string | undefined;
76
83
  serializedApiCallEnabled?: boolean;
77
- };
84
+ }
85
+ interface TTransferRelayToParaOptions {
86
+ api: ApiPromise;
87
+ destination: TNode;
88
+ address: string;
89
+ amount: string;
90
+ }
78
91
  interface IPolkadotXCMTransfer {
79
- transferPolkadotXCM(input: PolkadotXCMTransferInput): Extrinsic | TSerializedApiCall;
92
+ transferPolkadotXCM: (input: PolkadotXCMTransferInput) => Extrinsic | TSerializedApiCall;
80
93
  }
81
94
  declare enum Version {
82
95
  V1 = "V1",
83
96
  V3 = "V3"
84
97
  }
85
98
 
86
- declare const sendSerializedApiCall: (api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: any, to: string, destination?: TNode) => TSerializedApiCall;
87
- declare function send(api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: any, to: string, destination?: TNode): Extrinsic;
88
- declare const transferRelayToParaCommon: (api: ApiPromise, destination: TNode, amount: any, to: string, serializedApiCallEnabled?: boolean) => Extrinsic | TSerializedApiCall | never;
89
- declare function transferRelayToPara(api: ApiPromise, destination: TNode, amount: any, to: string): Extrinsic | never;
90
- declare const transferRelayToParaSerializedApiCall: (api: ApiPromise, destination: TNode, amount: any, to: string) => TSerializedApiCall;
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;
91
104
 
92
105
  declare const index$4_send: typeof send;
93
106
  declare const index$4_sendSerializedApiCall: typeof sendSerializedApiCall;
@@ -95,13 +108,7 @@ declare const index$4_transferRelayToPara: typeof transferRelayToPara;
95
108
  declare const index$4_transferRelayToParaCommon: typeof transferRelayToParaCommon;
96
109
  declare const index$4_transferRelayToParaSerializedApiCall: typeof transferRelayToParaSerializedApiCall;
97
110
  declare namespace index$4 {
98
- export {
99
- index$4_send as send,
100
- index$4_sendSerializedApiCall as sendSerializedApiCall,
101
- index$4_transferRelayToPara as transferRelayToPara,
102
- index$4_transferRelayToParaCommon as transferRelayToParaCommon,
103
- index$4_transferRelayToParaSerializedApiCall as transferRelayToParaSerializedApiCall,
104
- };
111
+ export { index$4_send as send, index$4_sendSerializedApiCall as sendSerializedApiCall, index$4_transferRelayToPara as transferRelayToPara, index$4_transferRelayToParaCommon as transferRelayToParaCommon, index$4_transferRelayToParaSerializedApiCall as transferRelayToParaSerializedApiCall };
105
112
  }
106
113
 
107
114
  declare function addLiquidity(api: ApiPromise, assetA: number, assetB: number, amountA: any, amountBMaxLimit: any): Extrinsic;
@@ -116,13 +123,7 @@ declare const index$3_createPool: typeof createPool;
116
123
  declare const index$3_removeLiquidity: typeof removeLiquidity;
117
124
  declare const index$3_sell: typeof sell;
118
125
  declare namespace index$3 {
119
- export {
120
- index$3_addLiquidity as addLiquidity,
121
- index$3_buy as buy,
122
- index$3_createPool as createPool,
123
- index$3_removeLiquidity as removeLiquidity,
124
- index$3_sell as sell,
125
- };
126
+ export { index$3_addLiquidity as addLiquidity, index$3_buy as buy, index$3_createPool as createPool, index$3_removeLiquidity as removeLiquidity, index$3_sell as sell };
126
127
  }
127
128
 
128
129
  declare function openChannel(api: ApiPromise, origin: TNode, destination: TNode, maxSize: number, maxMessageSize: number): Extrinsic;
@@ -131,10 +132,7 @@ declare function openChannelSerializedApiCall(api: ApiPromise, origin: TNode, de
131
132
  declare const index$2_openChannel: typeof openChannel;
132
133
  declare const index$2_openChannelSerializedApiCall: typeof openChannelSerializedApiCall;
133
134
  declare namespace index$2 {
134
- export {
135
- index$2_openChannel as openChannel,
136
- index$2_openChannelSerializedApiCall as openChannelSerializedApiCall,
137
- };
135
+ export { index$2_openChannel as openChannel, index$2_openChannelSerializedApiCall as openChannelSerializedApiCall };
138
136
  }
139
137
 
140
138
  declare function closeChannel(api: ApiPromise, origin: TNode, inbound: number, outbound: number): Extrinsic;
@@ -143,22 +141,19 @@ declare function closeChannelSerializedApiCall(api: ApiPromise, origin: TNode, i
143
141
  declare const index$1_closeChannel: typeof closeChannel;
144
142
  declare const index$1_closeChannelSerializedApiCall: typeof closeChannelSerializedApiCall;
145
143
  declare namespace index$1 {
146
- export {
147
- index$1_closeChannel as closeChannel,
148
- index$1_closeChannelSerializedApiCall as closeChannelSerializedApiCall,
149
- };
144
+ export { index$1_closeChannel as closeChannel, index$1_closeChannelSerializedApiCall as closeChannelSerializedApiCall };
150
145
  }
151
146
 
152
- declare function getAssetsObject(node: TNode): TNodeAssets;
153
- declare function getAssetId(node: TNode, symbol: string): string | null;
154
- declare function getRelayChainSymbol(node: TNode): "DOT" | "KSM";
155
- declare function getNativeAssets(node: TNode): TNativeAssetDetails[];
156
- declare function getOtherAssets(node: TNode): TAssetDetails[];
157
- declare function getAllAssetsSymbols(node: TNode): (string | undefined)[];
158
- declare function hasSupportForAsset(node: TNode, symbol: string): boolean;
159
- declare function getAssetDecimals(node: TNode, symbol: string): number | null | undefined;
160
- declare function getParaId(node: TNode): number;
161
- declare function getTNode(nodeID: number): "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" | undefined;
147
+ declare const getAssetsObject: (node: TNode) => TNodeAssets;
148
+ declare const getAssetId: (node: TNode, symbol: string) => string | null;
149
+ declare const getRelayChainSymbol: (node: TNode) => TRelayChainSymbol;
150
+ declare const getNativeAssets: (node: TNode) => TNativeAssetDetails[];
151
+ declare const getOtherAssets: (node: TNode) => TAssetDetails[];
152
+ declare const getAllAssetsSymbols: (node: TNode) => string[];
153
+ declare const hasSupportForAsset: (node: TNode, symbol: string) => boolean;
154
+ declare const getAssetDecimals: (node: TNode, symbol: string) => number | null;
155
+ declare const getParaId: (node: TNode) => number;
156
+ declare const getTNode: (nodeID: number) => TNode | null;
162
157
 
163
158
  declare const index_getAllAssetsSymbols: typeof getAllAssetsSymbols;
164
159
  declare const index_getAssetDecimals: typeof getAssetDecimals;
@@ -171,135 +166,124 @@ declare const index_getRelayChainSymbol: typeof getRelayChainSymbol;
171
166
  declare const index_getTNode: typeof getTNode;
172
167
  declare const index_hasSupportForAsset: typeof hasSupportForAsset;
173
168
  declare namespace index {
174
- export {
175
- index_getAllAssetsSymbols as getAllAssetsSymbols,
176
- index_getAssetDecimals as getAssetDecimals,
177
- index_getAssetId as getAssetId,
178
- index_getAssetsObject as getAssetsObject,
179
- index_getNativeAssets as getNativeAssets,
180
- index_getOtherAssets as getOtherAssets,
181
- index_getParaId as getParaId,
182
- index_getRelayChainSymbol as getRelayChainSymbol,
183
- index_getTNode as getTNode,
184
- index_hasSupportForAsset as hasSupportForAsset,
185
- };
169
+ export { index_getAllAssetsSymbols as getAllAssetsSymbols, index_getAssetDecimals as getAssetDecimals, index_getAssetId as getAssetId, index_getAssetsObject as getAssetsObject, index_getNativeAssets as getNativeAssets, index_getOtherAssets as getOtherAssets, index_getParaId as getParaId, index_getRelayChainSymbol as getRelayChainSymbol, index_getTNode as getTNode, index_hasSupportForAsset as hasSupportForAsset };
186
170
  }
187
171
 
188
- interface FinalCreatePoolBuilder {
189
- build(): Extrinsic;
172
+ interface FinalAddLiquidityBuilder {
173
+ build: () => Extrinsic;
190
174
  }
191
- interface AmountBCreatePoolBuilder {
192
- amountB(amountB: number): FinalCreatePoolBuilder;
175
+ interface AmountBMaxLimitAddLiquidityBuilder {
176
+ amountBMaxLimit: (amountBMaxLimit: number) => FinalAddLiquidityBuilder;
193
177
  }
194
- interface AssetBCreatePoolBuilder {
195
- assetB(assetB: number): AmountBCreatePoolBuilder;
178
+ interface AmountAAddLiquidityBuilder {
179
+ amountA: (amountA: number) => AmountBMaxLimitAddLiquidityBuilder;
196
180
  }
197
- interface AmountACreatePoolBuilder {
198
- amountA(amountA: number): AssetBCreatePoolBuilder;
181
+ interface AssetBAddLiquidityBuilder {
182
+ assetB: (assetB: number) => AmountAAddLiquidityBuilder;
199
183
  }
200
- interface AssetACreatePoolBuilder {
201
- assetA(assetA: number): AmountACreatePoolBuilder;
184
+ interface AssetAAddLiquidityBuilder {
185
+ assetA: (assetA: number) => AssetBAddLiquidityBuilder;
202
186
  }
203
187
 
204
- interface FinalSellBuilder {
205
- build(): Extrinsic;
188
+ interface FinalBuyBuilder {
189
+ build: () => Extrinsic;
206
190
  }
207
- interface DiscountSellBuilder {
208
- discount(discount: Bool): FinalSellBuilder;
191
+ interface DiscountBuyBuilder {
192
+ discount: (discount: Bool) => FinalBuyBuilder;
209
193
  }
210
- interface MaxLimitSellBuilder {
211
- maxLimit(maxLimit: number): DiscountSellBuilder;
194
+ interface MaxLimitBuyBuilder {
195
+ maxLimit: (maxLimit: number) => DiscountBuyBuilder;
212
196
  }
213
- interface AmountSellBuilder {
214
- amount(amount: number): MaxLimitSellBuilder;
197
+ interface AmountBuyBuilder {
198
+ amount: (amount: number) => MaxLimitBuyBuilder;
215
199
  }
216
- interface AssetOutSellBuilder {
217
- assetOut(assetOut: number): AmountSellBuilder;
200
+ interface AssetInBuyBuilder {
201
+ assetIn: (assetIn: number) => AmountBuyBuilder;
218
202
  }
219
- interface AssetInSellBuilder {
220
- assetIn(assetIn: number): AssetOutSellBuilder;
203
+ interface AssetOutBuyBuilder {
204
+ assetOut: (assetOut: number) => AssetInBuyBuilder;
221
205
  }
222
206
 
223
- interface FinalBuyBuilder {
224
- build(): Extrinsic;
207
+ interface OutboundCloseChannelBuilder {
208
+ outbound: (inbound: number) => FinalBuilder;
225
209
  }
226
- interface DiscountBuyBuilder {
227
- discount(discount: Bool): FinalBuyBuilder;
210
+ interface InboundCloseChannelBuilder {
211
+ inbound: (inbound: number) => OutboundCloseChannelBuilder;
228
212
  }
229
- interface MaxLimitBuyBuilder {
230
- maxLimit(maxLimit: number): DiscountBuyBuilder;
213
+
214
+ interface FinalCreatePoolBuilder {
215
+ build: () => Extrinsic;
231
216
  }
232
- interface AmountBuyBuilder {
233
- amount(amount: number): MaxLimitBuyBuilder;
217
+ interface AmountBCreatePoolBuilder {
218
+ amountB: (amountB: number) => FinalCreatePoolBuilder;
234
219
  }
235
- interface AssetInBuyBuilder {
236
- assetIn(assetIn: number): AmountBuyBuilder;
220
+ interface AssetBCreatePoolBuilder {
221
+ assetB: (assetB: number) => AmountBCreatePoolBuilder;
237
222
  }
238
- interface AssetOutBuyBuilder {
239
- assetOut(assetOut: number): AssetInBuyBuilder;
223
+ interface AmountACreatePoolBuilder {
224
+ amountA: (amountA: number) => AssetBCreatePoolBuilder;
225
+ }
226
+ interface AssetACreatePoolBuilder {
227
+ assetA: (assetA: number) => AmountACreatePoolBuilder;
228
+ }
229
+
230
+ interface MaxMessageSizeOpenChannelBuilder {
231
+ maxMessageSize: (size: number) => FinalBuilder;
232
+ }
233
+ interface MaxSizeOpenChannelBuilder {
234
+ maxSize: (size: number) => MaxMessageSizeOpenChannelBuilder;
240
235
  }
241
236
 
242
237
  interface FinalRemoveLiquidityBuilder {
243
- build(): Extrinsic;
238
+ build: () => Extrinsic;
244
239
  }
245
240
  interface LiquidityAmountRemoveLiquidityBuilder {
246
- liquidityAmount(liquidityAmount: number): FinalRemoveLiquidityBuilder;
241
+ liquidityAmount: (liquidityAmount: number) => FinalRemoveLiquidityBuilder;
247
242
  }
248
243
  interface AssetBRemoveLiquidityBuilder {
249
- assetB(assetB: number): LiquidityAmountRemoveLiquidityBuilder;
244
+ assetB: (assetB: number) => LiquidityAmountRemoveLiquidityBuilder;
250
245
  }
251
246
  interface AssetARemoveLiquidityBuilder {
252
- assetA(assetA: number): AssetBRemoveLiquidityBuilder;
247
+ assetA: (assetA: number) => AssetBRemoveLiquidityBuilder;
253
248
  }
254
249
 
255
- interface FinalAddLiquidityBuilder {
256
- build(): Extrinsic;
257
- }
258
- interface AmountBMaxLimitAddLiquidityBuilder {
259
- amountBMaxLimit(amountBMaxLimit: number): FinalAddLiquidityBuilder;
260
- }
261
- interface AmountAAddLiquidityBuilder {
262
- amountA(amountA: number): AmountBMaxLimitAddLiquidityBuilder;
263
- }
264
- interface AssetBAddLiquidityBuilder {
265
- assetB(assetB: number): AmountAAddLiquidityBuilder;
250
+ interface FinalSellBuilder {
251
+ build: () => Extrinsic;
266
252
  }
267
- interface AssetAAddLiquidityBuilder {
268
- assetA(assetA: number): AssetBAddLiquidityBuilder;
253
+ interface DiscountSellBuilder {
254
+ discount: (discount: Bool) => FinalSellBuilder;
269
255
  }
270
-
271
- interface OutboundCloseChannelBuilder {
272
- outbound(inbound: number): FinalBuilder;
256
+ interface MaxLimitSellBuilder {
257
+ maxLimit: (maxLimit: number) => DiscountSellBuilder;
273
258
  }
274
- interface InboundCloseChannelBuilder {
275
- inbound(inbound: number): OutboundCloseChannelBuilder;
259
+ interface AmountSellBuilder {
260
+ amount: (amount: number) => MaxLimitSellBuilder;
276
261
  }
277
-
278
- interface MaxMessageSizeOpenChannelBuilder {
279
- maxMessageSize(size: number): FinalBuilder;
262
+ interface AssetOutSellBuilder {
263
+ assetOut: (assetOut: number) => AmountSellBuilder;
280
264
  }
281
- interface MaxSizeOpenChannelBuilder {
282
- maxSize(size: number): MaxMessageSizeOpenChannelBuilder;
265
+ interface AssetInSellBuilder {
266
+ assetIn: (assetIn: number) => AssetOutSellBuilder;
283
267
  }
284
268
 
285
269
  declare class ToGeneralBuilder {
286
- private api;
287
- private from;
288
- private to;
270
+ private readonly api;
271
+ private readonly from;
272
+ private readonly to;
289
273
  constructor(api: ApiPromise, from: TNode, to: TNode);
290
274
  currency(currency: string | number | bigint): AmountBuilder;
291
275
  openChannel(): MaxSizeOpenChannelBuilder;
292
276
  }
293
277
  declare class FromGeneralBuilder {
294
- private api;
295
- private from;
278
+ private readonly api;
279
+ private readonly from;
296
280
  constructor(api: ApiPromise, from: TNode);
297
281
  to(node: TNode): ToGeneralBuilder;
298
- amount(amount: any): AddressBuilder;
282
+ amount(amount: string | number | bigint): AddressBuilder;
299
283
  closeChannel(): InboundCloseChannelBuilder;
300
284
  }
301
285
  declare class GeneralBuilder {
302
- private api;
286
+ private readonly api;
303
287
  constructor(api: ApiPromise);
304
288
  from(node: TNode): FromGeneralBuilder;
305
289
  to(node: TNode): AmountBuilder;
@@ -309,50 +293,33 @@ declare class GeneralBuilder {
309
293
  sell(): AssetInSellBuilder;
310
294
  createPool(): AssetACreatePoolBuilder;
311
295
  }
312
- declare function Builder(api: ApiPromise): GeneralBuilder;
296
+ declare const Builder: (api: ApiPromise) => GeneralBuilder;
313
297
  interface FinalBuilder {
314
- build(): Extrinsic | never;
315
- buildSerializedApiCall(): TSerializedApiCall;
298
+ build: () => Extrinsic | never;
299
+ buildSerializedApiCall: () => TSerializedApiCall;
316
300
  }
317
301
  interface AddressBuilder {
318
- address(address: string): FinalBuilder;
302
+ address: (address: string) => FinalBuilder;
319
303
  }
320
304
  interface AmountBuilder {
321
- amount(amount: any): AddressBuilder;
305
+ amount: (amount: string | number | bigint) => AddressBuilder;
322
306
  }
323
307
 
324
308
  declare const getDefaultPallet: (node: TNode) => TPallet;
325
309
  declare const getSupportedPallets: (node: TNode) => TPallet[];
326
310
 
327
311
  declare const getNode: (node: TNode) => ParachainNode;
328
- declare const getNodeEndpointOption: (node: TNode) => _polkadot_apps_config_endpoints_types.EndpointOption | {
329
- info: string;
330
- paraId: number;
331
- providers: {
332
- 'Imbue Network 0': string;
333
- Dwellir?: undefined;
334
- OnFinality?: undefined;
335
- RadiumBlock?: undefined;
336
- };
337
- } | {
338
- info: string;
339
- paraId: number;
340
- providers: {
341
- Dwellir: string;
342
- OnFinality: string;
343
- RadiumBlock: string;
344
- 'Imbue Network 0'?: undefined;
345
- };
346
- } | undefined;
347
- declare const getAllNodeProviders: (node: TNode) => any[];
348
- declare const getNodeProvider: (node: TNode) => any;
312
+ declare const getNodeEndpointOption: (node: TNode) => any;
313
+ declare const getAllNodeProviders: (node: TNode) => string[];
314
+ declare const getNodeProvider: (node: TNode) => string;
315
+ declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<ApiPromise>;
349
316
 
350
317
  declare class InvalidCurrencyError extends Error {
351
318
  constructor(message: string);
352
319
  }
353
320
 
354
321
  declare class NodeNotSupportedError extends Error {
355
- constructor(message: string);
322
+ constructor(message?: string);
356
323
  }
357
324
 
358
325
  declare class NoXCMSupportImplementedError extends Error {
@@ -367,4 +334,4 @@ declare class IncompatibleNodesError extends Error {
367
334
  constructor();
368
335
  }
369
336
 
370
- export { Bool, Builder, Extrinsic, ExtrinsicFunction, IPolkadotXCMTransfer, IXTokensTransfer, IncompatibleNodesError, InvalidCurrencyError, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, TAssetDetails, TAssetJsonMap, TNativeAssetDetails, TNode, TNodeAssets, TPallet, TPalletJsonMap, TPalletMap, TRelayChainType, TScenario, TSerializedApiCall, UpdateFunction, Version, XTokensTransferInput, index as assets, index$1 as closeChannels, 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 };
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 };