@paraspell/sdk 7.2.10 → 8.0.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.
@@ -1,1759 +0,0 @@
1
- import { Signer, AbstractProvider } from 'ethers';
2
- import * as polkadot_api from 'polkadot-api';
3
- import { PolkadotClient, UnsafeTransaction } from 'polkadot-api';
4
-
5
- type WithApi<TBase, TApi, TRes> = TBase & {
6
- api: IPolkadotApi<TApi, TRes>;
7
- };
8
- type TApiOrUrl<TApi> = TApi | string;
9
-
10
- interface IPolkadotApi<TApi, TRes> {
11
- setApi(api?: TApiOrUrl<TApi>): void;
12
- getApi(): TApi;
13
- getApiOrUrl(): TApiOrUrl<TApi> | undefined;
14
- init(node: TNodeWithRelayChains): Promise<void>;
15
- createApiInstance: (wsUrl: string) => Promise<TApi>;
16
- createAccountId(address: string): THexString$1;
17
- callTxMethod(serializedCall: TSerializedApiCall): TRes;
18
- calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
19
- getBalanceNative(address: string): Promise<bigint>;
20
- getBalanceNativeAcala(address: string, symbol: string): Promise<bigint>;
21
- getBalanceForeignPolkadotXcm(address: string, id?: string): Promise<bigint>;
22
- getMythosForeignBalance(address: string): Promise<bigint>;
23
- getAssetHubForeignBalance(address: string, multiLocation: TMultiLocation): Promise<bigint>;
24
- getForeignAssetsByIdBalance(address: string, assetId: string): Promise<bigint>;
25
- getBalanceForeignXTokens(node: TNodePolkadotKusama, address: string, asset: TAsset): Promise<bigint>;
26
- getBalanceForeignBifrost(address: string, asset: TAsset): Promise<bigint>;
27
- getBalanceForeignAssetsAccount(address: string, assetId: bigint | number): Promise<bigint>;
28
- getFromStorage(key: string): Promise<string>;
29
- clone(): IPolkadotApi<TApi, TRes>;
30
- createApiForNode(node: TNodeWithRelayChains): Promise<IPolkadotApi<TApi, TRes>>;
31
- setDisconnectAllowed(allowed: boolean): void;
32
- getDisconnectAllowed(): boolean;
33
- disconnect(): Promise<void>;
34
- }
35
-
36
- declare abstract class ParachainNode<TApi, TRes> {
37
- private readonly _node;
38
- private readonly _info;
39
- private readonly _type;
40
- private readonly _version;
41
- protected _assetCheckEnabled: boolean;
42
- constructor(node: TNodePolkadotKusama, info: string, type: TRelayChainType, version: Version);
43
- get info(): string;
44
- get type(): TRelayChainType;
45
- get node(): TNodePolkadotKusama;
46
- get version(): Version;
47
- get assetCheckEnabled(): boolean;
48
- protected canUseXTokens(_: TSendInternalOptions<TApi, TRes>): boolean;
49
- transfer(options: TSendInternalOptions<TApi, TRes>): Promise<TRes>;
50
- getRelayToParaOverrides(): TRelayToParaOverrides;
51
- transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCall;
52
- getProvider(): string;
53
- createApiInstance(api: IPolkadotApi<TApi, TRes>): Promise<TApi>;
54
- createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
55
- createPolkadotXcmHeader(scenario: TScenario, version: Version, destination?: TDestination, paraId?: number): TMultiLocationHeader;
56
- getNativeAssetSymbol(): string;
57
- }
58
-
59
- declare class Acala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
60
- constructor();
61
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
62
- getProvider(): string;
63
- }
64
-
65
- declare class Unique<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
66
- constructor();
67
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
68
- }
69
-
70
- declare class Crust<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
71
- constructor();
72
- private getCurrencySelection;
73
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
74
- }
75
-
76
- declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
77
- constructor();
78
- getCurrencySelection(asset: TAsset): {
79
- Native: string;
80
- VToken?: undefined;
81
- Token?: undefined;
82
- VSToken2?: undefined;
83
- VToken2?: undefined;
84
- Token2?: undefined;
85
- } | {
86
- VToken: string;
87
- Native?: undefined;
88
- Token?: undefined;
89
- VSToken2?: undefined;
90
- VToken2?: undefined;
91
- Token2?: undefined;
92
- } | {
93
- Token: string;
94
- Native?: undefined;
95
- VToken?: undefined;
96
- VSToken2?: undefined;
97
- VToken2?: undefined;
98
- Token2?: undefined;
99
- } | {
100
- VSToken2: number;
101
- Native?: undefined;
102
- VToken?: undefined;
103
- Token?: undefined;
104
- VToken2?: undefined;
105
- Token2?: undefined;
106
- } | {
107
- VToken2: number;
108
- Native?: undefined;
109
- VToken?: undefined;
110
- Token?: undefined;
111
- VSToken2?: undefined;
112
- Token2?: undefined;
113
- } | {
114
- Token2: number;
115
- Native?: undefined;
116
- VToken?: undefined;
117
- Token?: undefined;
118
- VSToken2?: undefined;
119
- VToken2?: undefined;
120
- };
121
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
122
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
123
- protected canUseXTokens({ asset, destination }: TSendInternalOptions<TApi, TRes>): boolean;
124
- getProvider(): string;
125
- }
126
-
127
- declare class Bitgreen<TApi, TRes> extends ParachainNode<TApi, TRes> {
128
- constructor();
129
- }
130
-
131
- declare class Centrifuge<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
132
- constructor();
133
- private getCurrencySelection;
134
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
135
- getProvider(): string;
136
- }
137
-
138
- declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
139
- constructor();
140
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
141
- }
142
-
143
- declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
144
- private static NATIVE_ASSET_ID;
145
- constructor();
146
- transferToEthereum<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
147
- transferToAssetHub<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
148
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
149
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
150
- protected canUseXTokens({ destination, asset }: TSendInternalOptions<TApi, TRes>): boolean;
151
- getProvider(): string;
152
- }
153
-
154
- declare class Interlay<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
155
- constructor();
156
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
157
- }
158
-
159
- declare class Litentry<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
160
- constructor();
161
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
162
- }
163
-
164
- declare class Moonbeam<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
165
- constructor();
166
- private getJunctions;
167
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
168
- getRelayToParaOverrides(): TRelayToParaOverrides;
169
- getProvider(): string;
170
- }
171
-
172
- declare class Parallel<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
173
- constructor();
174
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
175
- }
176
-
177
- declare class Altair<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
178
- constructor();
179
- private getCurrencySelection;
180
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
181
- }
182
-
183
- declare class Amplitude<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
184
- constructor();
185
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
186
- }
187
-
188
- declare class Bajun<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
189
- constructor();
190
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
191
- transferRelayToPara(): TSerializedApiCall;
192
- }
193
-
194
- declare class Basilisk<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
195
- constructor();
196
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
197
- getProvider(): string;
198
- }
199
-
200
- declare class BifrostKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
201
- constructor();
202
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
203
- getProvider(): string;
204
- }
205
-
206
- declare class Turing<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
207
- constructor();
208
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
209
- }
210
-
211
- declare class Picasso<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
212
- constructor();
213
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
214
- }
215
-
216
- declare class ParallelHeiko<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
217
- constructor();
218
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
219
- }
220
-
221
- declare class Moonriver<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
222
- constructor();
223
- private getJunctions;
224
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
225
- getRelayToParaOverrides(): TRelayToParaOverrides;
226
- getProvider(): string;
227
- }
228
-
229
- declare class Kintsugi<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
230
- constructor();
231
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
232
- }
233
-
234
- declare class Calamari<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
235
- constructor();
236
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
237
- }
238
-
239
- declare class CrustShadow<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
240
- constructor();
241
- private getCurrencySelection;
242
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
243
- }
244
-
245
- declare class Imbue<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
246
- constructor();
247
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
248
- }
249
-
250
- declare class InvArchTinker<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
251
- constructor();
252
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
253
- }
254
-
255
- declare class Karura<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
256
- constructor();
257
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
258
- getProvider(): string;
259
- }
260
-
261
- declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
262
- constructor();
263
- handleBridgeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>, targetChain: 'Polkadot' | 'Kusama'): TRes;
264
- handleEthBridgeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
265
- handleMythosTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
266
- handleBifrostEthTransfer: <TApi_1, TRes_1>(input: TPolkadotXCMTransferOptions<TApi_1, TRes_1>) => TRes_1;
267
- patchInput<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TPolkadotXCMTransferOptions<TApi, TRes>;
268
- private getSection;
269
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
270
- getRelayToParaOverrides(): TRelayToParaOverrides;
271
- createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
272
- getProvider(): string;
273
- }
274
-
275
- declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
276
- constructor();
277
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
278
- getRelayToParaOverrides(): TRelayToParaOverrides;
279
- createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
280
- }
281
-
282
- declare class CoretimeKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
283
- constructor();
284
- _assetCheckEnabled: boolean;
285
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
286
- getRelayToParaOverrides(): TRelayToParaOverrides;
287
- }
288
-
289
- declare class CoretimePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
290
- constructor();
291
- _assetCheckEnabled: boolean;
292
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
293
- getRelayToParaOverrides(): TRelayToParaOverrides;
294
- }
295
-
296
- declare class Encointer<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
297
- constructor();
298
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
299
- getRelayToParaOverrides(): TRelayToParaOverrides;
300
- }
301
-
302
- declare class RobonomicsKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
303
- constructor();
304
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
305
- }
306
-
307
- declare class RobonomicsPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
308
- constructor();
309
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
310
- }
311
-
312
- declare class PeoplePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
313
- constructor();
314
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
315
- getRelayToParaOverrides(): TRelayToParaOverrides;
316
- getProvider(): string;
317
- }
318
-
319
- declare class PeopleKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
320
- constructor();
321
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
322
- getRelayToParaOverrides(): TRelayToParaOverrides;
323
- }
324
-
325
- declare class Astar<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
326
- constructor();
327
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
328
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
329
- protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
330
- }
331
-
332
- type TMultiAsset = TMultiAssetV3 | TMultiAssetV4;
333
- interface TMultiAssetV3 {
334
- id: {
335
- Concrete: TMultiLocation;
336
- };
337
- fun: {
338
- Fungible: TAmount;
339
- };
340
- }
341
- interface TMultiAssetV4 {
342
- id: TMultiLocation;
343
- fun: {
344
- Fungible: TAmount;
345
- };
346
- }
347
-
348
- type TCurrency = string | number | bigint;
349
- type TSymbolSpecifier = {
350
- type: 'Native' | 'Foreign' | 'ForeignAbstract';
351
- value: string;
352
- };
353
- type TOverrideMultiLocationSpecifier = {
354
- type: 'Override';
355
- value: TMultiLocation;
356
- };
357
- type TCurrencySymbolValue = string | TSymbolSpecifier;
358
- type TCurrencySymbol = {
359
- symbol: TCurrencySymbolValue;
360
- };
361
- type TCurrencyCore = TCurrencySymbol | {
362
- id: TCurrency;
363
- } | {
364
- multilocation: TMultiLocationValue;
365
- };
366
- type TCurrencyCoreV1 = {
367
- symbol: string;
368
- } | {
369
- id: TCurrency;
370
- };
371
- type TMultiLocationValue = string | TMultiLocation | TJunction[];
372
- type TMultiLocationValueWithOverride = TMultiLocationValue | TOverrideMultiLocationSpecifier;
373
- type TCurrencyInput = TCurrencySymbol | {
374
- id: TCurrency;
375
- } | {
376
- multilocation: TMultiLocationValueWithOverride;
377
- } | {
378
- multiasset: TMultiAsset[];
379
- };
380
- interface TCurrencySelection {
381
- id: {
382
- Concrete: TMultiLocation;
383
- };
384
- fun: {
385
- Fungible: string;
386
- };
387
- }
388
- type TCurrencySelectionV4 = {
389
- id: TMultiLocation;
390
- fun: {
391
- Fungible: string;
392
- };
393
- };
394
- type TCurrencySelectionHeader = {
395
- [key in Version]?: TCurrencySelection | TCurrencySelectionV4;
396
- };
397
- type TCurrencySelectionHeaderArr = {
398
- [key in Version]?: [TCurrencySelection | TCurrencySelectionV4];
399
- };
400
- type TXcmForeignAsset = {
401
- ForeignAsset: string | number | bigint | undefined;
402
- };
403
- type TForeignAssetId = {
404
- ForeignAssetId: bigint | undefined;
405
- };
406
- type TForeignOrTokenAsset = TXcmForeignAsset | {
407
- Token: string | undefined;
408
- };
409
- type TForeignOrNativeAsset = TXcmForeignAsset | 'Native';
410
- type TXcmAsset = {
411
- XCM: number | undefined;
412
- };
413
- type TMantaAsset = {
414
- MantaCurrency: bigint | undefined;
415
- };
416
- type TNativeTokenAsset = 'NativeToken';
417
- type TNodleAsset = 'NodleNative';
418
- type TZeitgeistAsset = 'Ztg';
419
- type TOtherReserveAsset = {
420
- OtherReserve: string | bigint | undefined;
421
- };
422
- type TSelfReserveAsset = 'SelfReserve';
423
- type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
424
- type TBifrostToken = {
425
- Native: string;
426
- } | {
427
- VToken: string;
428
- } | {
429
- Token: string;
430
- } | {
431
- VSToken2: number;
432
- } | {
433
- VToken2: number;
434
- } | {
435
- Token2: number;
436
- };
437
- type TXTokensCurrencySelection = TCurrencySelectionHeader | TCurrencySelectionHeaderArr | TXcmForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | TBifrostToken | string | bigint | number | undefined;
438
-
439
- type TPallet = (typeof SUPPORTED_PALLETS)[number];
440
- interface TPalletMap {
441
- defaultPallet: TPallet;
442
- supportedPallets: TPallet[];
443
- }
444
- type TPalletJsonMap = Record<TNodePolkadotKusama, TPalletMap>;
445
-
446
- type AtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
447
- [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
448
- }[Keys];
449
- type TBaseAsset = {
450
- symbol: string;
451
- decimals?: number;
452
- manuallyAdded?: boolean;
453
- alias?: string;
454
- existentialDeposit?: string;
455
- };
456
- type TNativeAsset = TBaseAsset;
457
- type TForeignAsset = TBaseAsset & AtLeastOne<{
458
- assetId?: string;
459
- multiLocation?: object;
460
- xcmInterior?: object[];
461
- }>;
462
- type TAsset = TNativeAsset | TForeignAsset;
463
- type TNodeAssets = {
464
- relayChainAssetSymbol: TRelayChainSymbol;
465
- nativeAssetSymbol: string;
466
- isEVM: boolean;
467
- nativeAssets: TNativeAsset[];
468
- otherAssets: TForeignAsset[];
469
- };
470
- type TAssetJsonMap = Record<TNodeWithRelayChains, TNodeAssets>;
471
-
472
- type THexString$1 = `0x${string}`;
473
- type TPolkadotXCMTransferOptions<TApi, TRes> = {
474
- api: IPolkadotApi<TApi, TRes>;
475
- header: TMultiLocationHeader;
476
- addressSelection: TMultiLocationHeader;
477
- amount: string;
478
- address: TAddress;
479
- currencySelection: TCurrencySelectionHeaderArr;
480
- scenario: TScenario;
481
- asset: TAsset;
482
- destination?: TDestination;
483
- paraIdTo?: number;
484
- feeAsset?: TCurrency;
485
- overridedCurrency?: TMultiLocation | TMultiAsset[];
486
- version?: Version;
487
- ahAddress?: string;
488
- };
489
- type TXTokensTransferOptions<TApi, TRes> = {
490
- api: IPolkadotApi<TApi, TRes>;
491
- asset: TAsset;
492
- amount: string;
493
- addressSelection: TMultiLocationHeader;
494
- fees: number;
495
- scenario: TScenario;
496
- origin: TNodePolkadotKusama;
497
- destination?: TDestination;
498
- paraIdTo?: number;
499
- overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
500
- feeAsset?: TCurrency;
501
- };
502
- type TXTransferTransferOptions<TApi, TRes> = {
503
- api: IPolkadotApi<TApi, TRes>;
504
- asset: TAsset;
505
- amount: string;
506
- recipientAddress: TAddress;
507
- origin: TNodePolkadotKusama;
508
- paraId?: number;
509
- destination?: TDestination;
510
- overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
511
- };
512
- interface IPolkadotXCMTransfer {
513
- transferPolkadotXCM: <TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TRes>;
514
- }
515
- interface IXTokensTransfer {
516
- transferXTokens: <TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>) => TRes;
517
- }
518
- interface IXTransferTransfer {
519
- transferXTransfer: <TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>) => TRes;
520
- }
521
- type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
522
- /**
523
- * The XCM version.
524
- */
525
- declare enum Version {
526
- V1 = "V1",
527
- V2 = "V2",
528
- V3 = "V3",
529
- V4 = "V4"
530
- }
531
- /**
532
- * The supported XCM versions for asset claims.
533
- */
534
- type TVersionClaimAssets = Version.V3 | Version.V2;
535
- declare enum Parents {
536
- ZERO = 0,
537
- ONE = 1,
538
- TWO = 2
539
- }
540
- type TAmount = string | number | bigint;
541
- type TAddress = string | TMultiLocation;
542
- type TDestination = TNode | TMultiLocation;
543
- type TRelayToParaDestination = TNodePolkadotKusama | TMultiLocation;
544
- type TSendBaseOptions<TApi, TRes> = {
545
- /**
546
- * The destination address. A SS58 or H160 format.
547
- */
548
- address: TAddress;
549
- /**
550
- * The optional AssetHub address used when transfering to Ethereum
551
- */
552
- ahAddress?: string;
553
- /**
554
- * The destination node or multi-location
555
- */
556
- destination?: TDestination;
557
- /**
558
- * The optional destination parachain ID
559
- */
560
- paraIdTo?: number;
561
- /**
562
- * The optional overrided fee asset
563
- */
564
- feeAsset?: TCurrency;
565
- /**
566
- * The optional destination API instance required for keep-alive
567
- */
568
- destApiForKeepAlive: IPolkadotApi<TApi, TRes>;
569
- /**
570
- * The optional overrided XCM version
571
- */
572
- version?: Version;
573
- };
574
- /**
575
- * Options for transferring from a parachain to another parachain or relay chain
576
- */
577
- type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions<TApi, TRes>, TApi, TRes> & {
578
- /**
579
- * The origin node
580
- */
581
- origin: TNodePolkadotKusama;
582
- /**
583
- * The currency to transfer. Either ID, symbol, multi-location, or multi-asset
584
- */
585
- currency: TCurrencyInput;
586
- /**
587
- * The amount to transfer. Can be a number, string, or bigint
588
- */
589
- amount: TAmount | null;
590
- };
591
- type TSendInternalOptions<TApi, TRes> = TSendBaseOptions<TApi, TRes> & {
592
- api: IPolkadotApi<TApi, TRes>;
593
- asset: TAsset;
594
- amount: string;
595
- overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
596
- };
597
- type TRelayToParaBaseOptions<TApi, TRes> = {
598
- /**
599
- * The destination node or multi-location
600
- */
601
- destination: TRelayToParaDestination;
602
- /**
603
- * The destination address. A SS58 or H160 format.
604
- */
605
- address: TAddress;
606
- /**
607
- * The optional destination parachain ID
608
- */
609
- paraIdTo?: number;
610
- /**
611
- * The optional destination API instance required for keep-alive
612
- */
613
- destApiForKeepAlive: IPolkadotApi<TApi, TRes>;
614
- /**
615
- * The optional overrided XCM version
616
- */
617
- version?: Version;
618
- /**
619
- * The amount to transfer
620
- */
621
- amount: TAmount;
622
- };
623
- type TRelayToParaOverrides = {
624
- section: TXcmPalletSection;
625
- includeFee: boolean;
626
- };
627
- /**
628
- * Options for transferring from a relay chain to a parachain
629
- */
630
- type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions<TApi, TRes>, TApi, TRes>;
631
- type TSerializedApiCall = {
632
- module: TPallet | 'Utility';
633
- section: string;
634
- parameters: Record<string, unknown>;
635
- };
636
- type TCheckKeepAliveOptions<TApi, TRes> = {
637
- originApi: IPolkadotApi<TApi, TRes>;
638
- address: string;
639
- amount: string;
640
- originNode?: TNodePolkadotKusama;
641
- destApi: IPolkadotApi<TApi, TRes>;
642
- asset: TAsset;
643
- destNode?: TNodePolkadotKusama;
644
- };
645
- type TDestWeight = {
646
- refTime: string;
647
- proofSize: string;
648
- };
649
- type TXTransferSection = 'transfer';
650
- type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
651
- type TPolkadotXcmSection = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets';
652
- type TXcmPalletSection = 'limited_teleport_assets' | 'reserve_transfer_assets' | 'limited_reserve_transfer_assets';
653
-
654
- type TJunctionType = 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality' | 'GlobalConsensus';
655
- type TNetworkId = string | null;
656
- type TBodyId = string | null;
657
- type TBodyPart = string | null;
658
- type TStringOrNumber = string | number;
659
- type TStringOrNumberOrBigInt = TStringOrNumber | bigint;
660
- type THexString = string;
661
- type TJunctionParachain = {
662
- Parachain: TStringOrNumberOrBigInt | undefined;
663
- };
664
- type TJunctionAccountId32 = {
665
- AccountId32: {
666
- network?: TNetworkId;
667
- id: THexString;
668
- };
669
- };
670
- type TJunctionAccountIndex64 = {
671
- AccountIndex64: {
672
- network: TNetworkId;
673
- index: TStringOrNumberOrBigInt;
674
- };
675
- };
676
- type TJunctionAccountKey20 = {
677
- AccountKey20: {
678
- network?: TNetworkId;
679
- key: THexString;
680
- };
681
- };
682
- type TJunctionPalletInstance = {
683
- PalletInstance: TStringOrNumberOrBigInt;
684
- };
685
- type TJunctionGeneralIndex = {
686
- GeneralIndex: TStringOrNumberOrBigInt;
687
- };
688
- type TJunctionGeneralKey = {
689
- GeneralKey: {
690
- length: TStringOrNumberOrBigInt;
691
- data: THexString;
692
- };
693
- };
694
- type TJunctionOnlyChild = {
695
- OnlyChild: string;
696
- };
697
- type TJunctionPlurality = {
698
- Plurality: {
699
- id: TBodyId;
700
- part: TBodyPart;
701
- };
702
- };
703
- type TJunctionGlobalConsensus = {
704
- GlobalConsensus: TNetworkId | object;
705
- };
706
- type TJunction = TJunctionParachain | TJunctionAccountId32 | TJunctionAccountIndex64 | TJunctionAccountKey20 | TJunctionPalletInstance | TJunctionGeneralIndex | TJunctionGeneralKey | TJunctionOnlyChild | TJunctionPlurality | TJunctionGlobalConsensus;
707
- interface TJunctions {
708
- Here?: null;
709
- X1?: TJunction | [TJunction];
710
- X2?: [TJunction, TJunction];
711
- X3?: [TJunction, TJunction, TJunction];
712
- X4?: [TJunction, TJunction, TJunction, TJunction];
713
- X5?: [TJunction, TJunction, TJunction, TJunction, TJunction];
714
- X6?: [TJunction, TJunction, TJunction, TJunction, TJunction, TJunction];
715
- X7?: [TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction];
716
- X8?: [TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction];
717
- }
718
- interface TMultiLocation {
719
- parents: TStringOrNumber;
720
- interior: TJunctions | 'Here';
721
- }
722
- type TMultiLocationHeader = {
723
- [key in Version]?: TMultiLocation;
724
- };
725
-
726
- declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
727
- constructor();
728
- private getCurrencySelection;
729
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
730
- transferRelayToPara(): TSerializedApiCall;
731
- createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation): TCurrencySelectionHeaderArr;
732
- getProvider(): string;
733
- }
734
-
735
- declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
736
- constructor();
737
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
738
- transferRelayToPara(): TSerializedApiCall;
739
- createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset): TCurrencySelectionHeaderArr;
740
- }
741
-
742
- declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
743
- constructor();
744
- _assetCheckEnabled: boolean;
745
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
746
- }
747
-
748
- declare class Shiden<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
749
- constructor();
750
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
751
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
752
- protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
753
- }
754
-
755
- declare class Manta<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
756
- constructor();
757
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
758
- }
759
-
760
- declare class Nodle<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
761
- constructor();
762
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
763
- transferRelayToPara(): TSerializedApiCall;
764
- }
765
-
766
- declare class NeuroWeb<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
767
- constructor();
768
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
769
- }
770
-
771
- declare class Pendulum<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
772
- constructor();
773
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
774
- transferRelayToPara(): TSerializedApiCall;
775
- }
776
-
777
- declare class Zeitgeist<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
778
- constructor();
779
- private getCurrencySelection;
780
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
781
- }
782
-
783
- declare class Collectives<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
784
- constructor();
785
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
786
- getRelayToParaOverrides(): TRelayToParaOverrides;
787
- createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset): TCurrencySelectionHeaderArr;
788
- }
789
-
790
- declare class Khala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTransferTransfer {
791
- constructor();
792
- transferXTransfer<TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>): TRes;
793
- }
794
-
795
- declare class Phala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTransferTransfer {
796
- constructor();
797
- transferXTransfer<TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>): TRes;
798
- }
799
-
800
- declare class Subsocial<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
801
- constructor();
802
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
803
- }
804
-
805
- declare class KiltSpiritnet<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
806
- constructor();
807
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
808
- transferRelayToPara(): TSerializedApiCall;
809
- getProvider(): string;
810
- }
811
-
812
- declare class Curio<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
813
- constructor();
814
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
815
- }
816
-
817
- declare class BridgeHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
818
- constructor();
819
- _assetCheckEnabled: boolean;
820
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
821
- getRelayToParaOverrides(): TRelayToParaOverrides;
822
- }
823
-
824
- declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
825
- constructor();
826
- _assetCheckEnabled: boolean;
827
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
828
- getRelayToParaOverrides(): TRelayToParaOverrides;
829
- }
830
-
831
- declare class Mythos<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
832
- constructor();
833
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
834
- transferRelayToPara(): TSerializedApiCall;
835
- }
836
-
837
- declare class Peaq<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
838
- constructor();
839
- transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
840
- transferRelayToPara(): TSerializedApiCall;
841
- getProvider(): string;
842
- }
843
-
844
- declare class Polimec<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
845
- constructor();
846
- private getAssetMultiLocation;
847
- transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
848
- transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCall;
849
- getProvider(): string;
850
- }
851
-
852
- /**
853
- * Supported nodes excluding relay chains and Ethereum.
854
- */
855
- declare const NODE_NAMES_DOT_KSM: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec"];
856
- /**
857
- * Supported nodes including Ethereum.
858
- */
859
- declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "Ethereum"];
860
- /**
861
- * Supported nodes including relay chains and Ethereum.
862
- */
863
- declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "Ethereum", "Polkadot", "Kusama"];
864
- /**
865
- * Supported nodes including relay chains and excluding Ethereum.
866
- */
867
- declare const NODES_WITH_RELAY_CHAINS_DOT_KSM: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "CoretimePolkadot", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Calamari", "CrustShadow", "Crab", "Imbue", "InvArchTinker", "Karura", "Kintsugi", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "RobonomicsKusama", "RobonomicsPolkadot", "PeoplePolkadot", "PeopleKusama", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "Polkadot", "Kusama"];
868
- declare const nodes: <TApi, TRes>() => {
869
- AssetHubPolkadot: AssetHubPolkadot<TApi, TRes>;
870
- Acala: Acala<TApi, TRes>;
871
- Astar: Astar<TApi, TRes>;
872
- Unique: Unique<TApi, TRes>;
873
- Crust: Crust<TApi, TRes>;
874
- BifrostPolkadot: BifrostPolkadot<TApi, TRes>;
875
- BridgeHubPolkadot: BridgeHubPolkadot<TApi, TRes>;
876
- BridgeHubKusama: BridgeHubKusama<TApi, TRes>;
877
- Bitgreen: Bitgreen<TApi, TRes>;
878
- Centrifuge: Centrifuge<TApi, TRes>;
879
- ComposableFinance: ComposableFinance<TApi, TRes>;
880
- Darwinia: Darwinia<TApi, TRes>;
881
- Hydration: Hydration<TApi, TRes>;
882
- Interlay: Interlay<TApi, TRes>;
883
- Litentry: Litentry<TApi, TRes>;
884
- Moonbeam: Moonbeam<TApi, TRes>;
885
- Parallel: Parallel<TApi, TRes>;
886
- AssetHubKusama: AssetHubKusama<TApi, TRes>;
887
- CoretimeKusama: CoretimeKusama<TApi, TRes>;
888
- CoretimePolkadot: CoretimePolkadot<TApi, TRes>;
889
- Encointer: Encointer<TApi, TRes>;
890
- Altair: Altair<TApi, TRes>;
891
- Amplitude: Amplitude<TApi, TRes>;
892
- Bajun: Bajun<TApi, TRes>;
893
- Basilisk: Basilisk<TApi, TRes>;
894
- BifrostKusama: BifrostKusama<TApi, TRes>;
895
- Calamari: Calamari<TApi, TRes>;
896
- CrustShadow: CrustShadow<TApi, TRes>;
897
- Crab: Crab<TApi, TRes>;
898
- Imbue: Imbue<TApi, TRes>;
899
- InvArchTinker: InvArchTinker<TApi, TRes>;
900
- Karura: Karura<TApi, TRes>;
901
- Kintsugi: Kintsugi<TApi, TRes>;
902
- Moonriver: Moonriver<TApi, TRes>;
903
- ParallelHeiko: ParallelHeiko<TApi, TRes>;
904
- Picasso: Picasso<TApi, TRes>;
905
- Quartz: Quartz<TApi, TRes>;
906
- RobonomicsKusama: RobonomicsKusama<TApi, TRes>;
907
- RobonomicsPolkadot: RobonomicsPolkadot<TApi, TRes>;
908
- PeoplePolkadot: PeoplePolkadot<TApi, TRes>;
909
- PeopleKusama: PeopleKusama<TApi, TRes>;
910
- Shiden: Shiden<TApi, TRes>;
911
- Turing: Turing<TApi, TRes>;
912
- Manta: Manta<TApi, TRes>;
913
- Nodle: Nodle<TApi, TRes>;
914
- NeuroWeb: NeuroWeb<TApi, TRes>;
915
- Pendulum: Pendulum<TApi, TRes>;
916
- Zeitgeist: Zeitgeist<TApi, TRes>;
917
- Collectives: Collectives<TApi, TRes>;
918
- Khala: Khala<TApi, TRes>;
919
- Phala: Phala<TApi, TRes>;
920
- Subsocial: Subsocial<TApi, TRes>;
921
- KiltSpiritnet: KiltSpiritnet<TApi, TRes>;
922
- Curio: Curio<TApi, TRes>;
923
- Mythos: Mythos<TApi, TRes>;
924
- Peaq: Peaq<TApi, TRes>;
925
- Polimec: Polimec<TApi, TRes>;
926
- };
927
- /**
928
- * Supported XCM pallets.
929
- */
930
- declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm", "XTransfer", "XcmPallet"];
931
-
932
- type TNode = (typeof NODE_NAMES)[number];
933
- type TNodePolkadotKusama = Exclude<TNode, 'Ethereum'>;
934
- type TNodeWithRelayChains = (typeof NODES_WITH_RELAY_CHAINS)[number];
935
- type TNodeDotKsmWithRelayChains = Exclude<TNodeWithRelayChains, 'Ethereum'>;
936
-
937
- type TRelayChainType = 'polkadot' | 'kusama';
938
- type TRelayChainSymbol = 'DOT' | 'KSM';
939
-
940
- type TEdJsonMap = Record<TNodeDotKsmWithRelayChains, string | null>;
941
-
942
- /**
943
- * The options for the Ethereum to Polkadot transfer builder.
944
- */
945
- type TEvmBuilderOptions = {
946
- /**
947
- * The destination node on Polkadot network.
948
- */
949
- to: TNodePolkadotKusama;
950
- /**
951
- * The amount to transfer.
952
- */
953
- amount: string;
954
- /**
955
- * The currency to transfer. Symbol or ID.
956
- */
957
- currency: TCurrencyCoreV1;
958
- /**
959
- * The Polkadot destination address.
960
- */
961
- address: string;
962
- /**
963
- * The Ethereum signer.
964
- */
965
- signer: Signer;
966
- };
967
- type TSerializeEthTransferOptions = Omit<TEvmBuilderOptions, 'signer'> & {
968
- destAddress: string;
969
- };
970
- type TSerializedEthTransfer = {
971
- token: string;
972
- destinationParaId: number;
973
- destinationFee: bigint;
974
- amount: bigint;
975
- fee: bigint;
976
- };
977
- type OptionalProperties<T> = {
978
- [P in keyof T]?: T[P] | undefined;
979
- };
980
- type TOptionalEvmBuilderOptions = OptionalProperties<TEvmBuilderOptions>;
981
- /**
982
- * The options for the batch builder.
983
- */
984
- declare enum BatchMode {
985
- /**
986
- * Does not commit if one of the calls in the batch fails.
987
- */
988
- BATCH_ALL = "BATCH_ALL",
989
- /**
990
- * Commits each successful call regardless if a call fails.
991
- */
992
- BATCH = "BATCH"
993
- }
994
- /**
995
- * The options for the batch builder.
996
- */
997
- type TBatchOptions = {
998
- /**
999
- * The batch mode. Can be either:
1000
- * `BATCH_ALL` - does not commit if one of the calls in the batch fails.
1001
- * `BATCH` - commits each successful call regardless if a call fails.
1002
- */
1003
- mode: BatchMode;
1004
- };
1005
-
1006
- type TTransferInfo = {
1007
- chain: {
1008
- origin: TNodeWithRelayChains;
1009
- destination: TNodeWithRelayChains;
1010
- ecosystem: string;
1011
- };
1012
- currencyBalanceOrigin: {
1013
- balance: bigint;
1014
- currency: string;
1015
- };
1016
- originFeeBalance: {
1017
- balance: bigint;
1018
- expectedBalanceAfterXCMFee: bigint;
1019
- xcmFee: {
1020
- sufficientForXCM: boolean;
1021
- xcmFee: bigint;
1022
- };
1023
- existentialDeposit: bigint;
1024
- asset: string;
1025
- minNativeTransferableAmount: bigint;
1026
- maxNativeTransferableAmount: bigint;
1027
- };
1028
- destinationFeeBalance: {
1029
- balance: bigint;
1030
- currency: string;
1031
- existentialDeposit: bigint;
1032
- };
1033
- };
1034
- type TOriginFeeDetails = {
1035
- sufficientForXCM: boolean;
1036
- xcmFee: bigint;
1037
- };
1038
- type TGetTransferInfoOptionsBase = {
1039
- origin: TNodeDotKsmWithRelayChains;
1040
- destination: TNodeDotKsmWithRelayChains;
1041
- accountOrigin: string;
1042
- accountDestination: string;
1043
- currency: TCurrencyCore;
1044
- amount: string;
1045
- };
1046
- type TGetTransferInfoOptions<TApi, TRes> = WithApi<TGetTransferInfoOptionsBase, TApi, TRes>;
1047
-
1048
- type TProviderEntry = {
1049
- name: string;
1050
- endpoint: string;
1051
- };
1052
- type TNodeConfig = {
1053
- name: string;
1054
- info: string;
1055
- paraId: number;
1056
- providers: TProviderEntry[];
1057
- };
1058
- type TNodeConfigMap = Record<TNodeDotKsmWithRelayChains, TNodeConfig>;
1059
-
1060
- declare const send: <TApi, TRes>(options: TSendOptions<TApi, TRes>) => Promise<TRes>;
1061
-
1062
- declare const transferRelayToPara: <TApi, TRes>(options: TRelayToParaOptions<TApi, TRes>) => Promise<TRes>;
1063
-
1064
- declare const buildEthTransferOptions: ({ currency, to, address, destAddress, amount }: TSerializeEthTransferOptions) => Promise<TSerializedEthTransfer>;
1065
-
1066
- declare const index_buildEthTransferOptions: typeof buildEthTransferOptions;
1067
- declare const index_send: typeof send;
1068
- declare const index_transferRelayToPara: typeof transferRelayToPara;
1069
- declare namespace index {
1070
- export { index_buildEthTransferOptions as buildEthTransferOptions, index_send as send, index_transferRelayToPara as transferRelayToPara };
1071
- }
1072
-
1073
- type TAssetClaimOptionsBase = {
1074
- node: TNodeWithRelayChains;
1075
- multiAssets: TMultiAsset[];
1076
- address: TAddress;
1077
- version?: TVersionClaimAssets;
1078
- };
1079
-
1080
- type TPapiApi = PolkadotClient;
1081
- type TPapiApiOrUrl = TApiOrUrl<PolkadotClient>;
1082
- type TPapiTransaction = UnsafeTransaction<any, string, string, any>;
1083
-
1084
- /**
1085
- * Retrieves the native asset balance for a given account on a specified node.
1086
- */
1087
- type TGetBalanceNativeOptionsBase = {
1088
- /**
1089
- * The address of the account.
1090
- */
1091
- address: string;
1092
- /**
1093
- * The node on which to query the balance.
1094
- */
1095
- node: TNodeDotKsmWithRelayChains;
1096
- /**
1097
- * The native currency to query.
1098
- */
1099
- currency?: {
1100
- symbol: string;
1101
- };
1102
- };
1103
- /**
1104
- * Retrieves the balance of a foreign asset for a given account on a specified node.
1105
- */
1106
- type TGetBalanceForeignOptionsBase = {
1107
- address: string;
1108
- /**
1109
- * The node on which to query the balance.
1110
- */
1111
- node: TNodePolkadotKusama;
1112
- /**
1113
- * The currency to query.
1114
- */
1115
- currency: TCurrencyCore;
1116
- };
1117
- /**
1118
- * Retrieves the asset balance for a given account on a specified node.
1119
- */
1120
- type TGetAssetBalanceOptionsBase = {
1121
- /**
1122
- * The address of the account.
1123
- */
1124
- address: string;
1125
- /**
1126
- * The node on which to query the balance.
1127
- */
1128
- node: TNodeDotKsmWithRelayChains;
1129
- /**
1130
- * The currency to query.
1131
- */
1132
- currency: TCurrencyCore;
1133
- };
1134
- type TGetOriginFeeDetailsOptionsBase = {
1135
- /**
1136
- * The origin node.
1137
- */
1138
- origin: TNodeDotKsmWithRelayChains;
1139
- /**
1140
- * The destination node.
1141
- */
1142
- destination: TNodeDotKsmWithRelayChains;
1143
- /**
1144
- * The currency to transfer.
1145
- */
1146
- currency: TCurrencyCore;
1147
- /**
1148
- * The amount to transfer.
1149
- */
1150
- amount: string;
1151
- /**
1152
- * The origin account.
1153
- */
1154
- account: string;
1155
- /**
1156
- * The destination account.
1157
- */
1158
- accountDestination: string;
1159
- /**
1160
- * The fee margin percentage.
1161
- */
1162
- feeMarginPercentage?: number;
1163
- };
1164
- type TGetMaxNativeTransferableAmountOptionsBase = {
1165
- /**
1166
- * The address of the account.
1167
- */
1168
- address: string;
1169
- /**
1170
- * The node on which to query the balance.
1171
- */
1172
- node: TNodeDotKsmWithRelayChains;
1173
- /**
1174
- * The currency to query.
1175
- */
1176
- currency?: {
1177
- symbol: string;
1178
- };
1179
- };
1180
- type TGetMaxForeignTransferableAmountOptionsBase = {
1181
- /**
1182
- * The address of the account.
1183
- */
1184
- address: string;
1185
- /**
1186
- * The node on which to query the balance.
1187
- */
1188
- node: TNodePolkadotKusama;
1189
- /**
1190
- * The currency to query.
1191
- */
1192
- currency: TCurrencyCore;
1193
- };
1194
- type TGetTransferableAmountOptionsBase = {
1195
- /**
1196
- * The address of the account.
1197
- */
1198
- address: string;
1199
- /**
1200
- * The node on which to query the balance.
1201
- */
1202
- node: TNodeDotKsmWithRelayChains;
1203
- /**
1204
- * The currency to query.
1205
- */
1206
- currency: TCurrencyCore;
1207
- };
1208
-
1209
- /**
1210
- * Retrieves the existential deposit value for a given node.
1211
- *
1212
- * @param node - The node for which to get the existential deposit.
1213
- * @returns The existential deposit as a string if available; otherwise, null.
1214
- */
1215
- declare const getExistentialDeposit: (node: TNodeWithRelayChains, currency?: TCurrencyCore) => string | null;
1216
-
1217
- /**
1218
- * Retrieves the assets object for a given node containing the native and foreign assets.
1219
- *
1220
- * @param node - The node for which to retrieve the assets object.
1221
- * @returns The assets object associated with the given node.
1222
- */
1223
- declare const getAssetsObject: (node: TNodeWithRelayChains) => TNodeAssets;
1224
- declare const isNodeEvm: (node: TNodeWithRelayChains) => boolean;
1225
- /**
1226
- * Retrieves the asset ID for a given symbol on a specified node.
1227
- *
1228
- * @param node - The node to search for the asset.
1229
- * @param symbol - The symbol of the asset.
1230
- * @returns The asset ID if found; otherwise, null.
1231
- */
1232
- declare const getAssetId: (node: TNode, symbol: string) => string | null;
1233
- /**
1234
- * Retrieves the relay chain asset symbol for a specified node.
1235
- *
1236
- * @param node - The node for which to get the relay chain symbol.
1237
- * @returns The relay chain asset symbol.
1238
- */
1239
- declare const getRelayChainSymbol: (node: TNodeWithRelayChains) => TRelayChainSymbol;
1240
- /**
1241
- * Retrieves the list of native assets for a specified node.
1242
- *
1243
- * @param node - The node for which to get native assets.
1244
- * @returns An array of native asset details.
1245
- */
1246
- declare const getNativeAssets: (node: TNode) => TNativeAsset[];
1247
- /**
1248
- * Retrieves the list of other (non-native) assets for a specified node.
1249
- *
1250
- * @param node - The node for which to get other assets.
1251
- * @returns An array of other asset details.
1252
- */
1253
- declare const getOtherAssets: (node: TNode) => TForeignAsset[];
1254
- /**
1255
- * Retrieves the complete list of assets for a specified node, including relay chain asset, native, and other assets.
1256
- *
1257
- * @param node - The node for which to get the assets.
1258
- * @returns An array of objects of all assets associated with the node.
1259
- */
1260
- declare const getAssets: (node: TNodeWithRelayChains) => TAsset[];
1261
- /**
1262
- * Retrieves the symbols of all assets (relay chain, native, and other assets) for a specified node.
1263
- *
1264
- * @param node - The node for which to get asset symbols.
1265
- * @returns An array of asset symbols.
1266
- */
1267
- declare const getAllAssetsSymbols: (node: TNodeWithRelayChains) => string[];
1268
- /**
1269
- * Retrieves the symbol of the native asset for a specified node.
1270
- *
1271
- * @param node - The node for which to get the native asset symbol.
1272
- * @returns The symbol of the native asset.
1273
- */
1274
- declare const getNativeAssetSymbol: (node: TNodeWithRelayChains) => string;
1275
- /**
1276
- * Determines whether a specified node supports an asset with the given symbol.
1277
- *
1278
- * @param node - The node to check for asset support.
1279
- * @param symbol - The symbol of the asset to check.
1280
- * @returns True if the asset is supported; otherwise, false.
1281
- */
1282
- declare const hasSupportForAsset: (node: TNode, symbol: string) => boolean;
1283
- /**
1284
- * Retrieves the number of decimals for an asset with the given symbol on a specified node.
1285
- *
1286
- * @param node - The node where the asset is located.
1287
- * @param symbol - The symbol of the asset.
1288
- * @returns The number of decimals if the asset is found; otherwise, null.
1289
- */
1290
- declare const getAssetDecimals: (node: TNodeWithRelayChains, symbol: string) => number | null;
1291
- /**
1292
- * Retrieves the node name corresponding to a specified parachain ID.
1293
- *
1294
- * @param paraId - The parachain ID.
1295
- * @returns The node name if found; otherwise, null.
1296
- */
1297
- declare const getTNode: (paraId: number, ecosystem: TRelayChainType) => TNodeDotKsmWithRelayChains | null;
1298
-
1299
- declare const Native: (symbol: string) => TSymbolSpecifier;
1300
- declare const Foreign: (symbol: string) => TSymbolSpecifier;
1301
- declare const ForeignAbstract: (symbol: string) => TSymbolSpecifier;
1302
-
1303
- declare const Override: (multiLocation: TMultiLocation) => TOverrideMultiLocationSpecifier;
1304
-
1305
- /**
1306
- * Retrieves the list of assets that are supported for transfers between two specified nodes.
1307
- *
1308
- * @param origin - The origin node.
1309
- * @param destination - The destination node.
1310
- * @returns An array of assets supported between the origin and destination nodes.
1311
- */
1312
- declare const getSupportedAssets: (origin: TNodeWithRelayChains, destination: TNodeWithRelayChains) => TAsset[];
1313
-
1314
- /**
1315
- * Retrieves the native balance for a given account on a specified node.
1316
- *
1317
- * @returns The native balance as a bigint.
1318
- */
1319
- declare const getBalanceNative: (options: TGetBalanceNativeOptionsBase & {
1320
- api?: TPapiApiOrUrl;
1321
- }) => Promise<bigint>;
1322
- /**
1323
- * Retrieves the balance of a foreign asset for a given account on a specified node.
1324
- *
1325
- * @returns The balance of the foreign asset as a bigint, or null if not found.
1326
- */
1327
- declare const getBalanceForeign: (options: TGetBalanceForeignOptionsBase & {
1328
- api?: TPapiApiOrUrl;
1329
- }) => Promise<bigint>;
1330
- /**
1331
- * Retrieves detailed transfer information for a cross-chain transfer.
1332
- *
1333
- * @returns A Promise that resolves to the transfer information.
1334
- */
1335
- declare const getTransferInfo: (options: TGetTransferInfoOptionsBase & {
1336
- api?: TPapiApiOrUrl;
1337
- }) => Promise<TTransferInfo>;
1338
- /**
1339
- * Retrieves the asset balance for a given account on a specified node.
1340
- *
1341
- * @returns The asset balance as a bigint.
1342
- */
1343
- declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
1344
- api?: TPapiApiOrUrl;
1345
- }) => Promise<bigint>;
1346
- /**
1347
- * Claims assets from a parachain.
1348
- *
1349
- * @returns An extrinsic representing the claim transaction.
1350
- */
1351
- declare const claimAssets: (options: TAssetClaimOptionsBase & {
1352
- api?: TPapiApiOrUrl;
1353
- }) => Promise<TPapiTransaction>;
1354
- declare const getOriginFeeDetails: (options: TGetOriginFeeDetailsOptionsBase & {
1355
- api?: TPapiApiOrUrl;
1356
- }) => Promise<TOriginFeeDetails>;
1357
- declare const getMaxNativeTransferableAmount: (options: TGetMaxNativeTransferableAmountOptionsBase & {
1358
- api?: TPapiApiOrUrl;
1359
- }) => Promise<bigint>;
1360
- declare const getMaxForeignTransferableAmount: (options: TGetMaxForeignTransferableAmountOptionsBase & {
1361
- api?: TPapiApiOrUrl;
1362
- }) => Promise<bigint>;
1363
- declare const getTransferableAmount: (options: TGetTransferableAmountOptionsBase & {
1364
- api?: TPapiApiOrUrl;
1365
- }) => Promise<bigint>;
1366
-
1367
- declare const assets_Foreign: typeof Foreign;
1368
- declare const assets_ForeignAbstract: typeof ForeignAbstract;
1369
- declare const assets_Native: typeof Native;
1370
- declare const assets_Override: typeof Override;
1371
- declare const assets_claimAssets: typeof claimAssets;
1372
- declare const assets_getAllAssetsSymbols: typeof getAllAssetsSymbols;
1373
- declare const assets_getAssetBalance: typeof getAssetBalance;
1374
- declare const assets_getAssetDecimals: typeof getAssetDecimals;
1375
- declare const assets_getAssetId: typeof getAssetId;
1376
- declare const assets_getAssets: typeof getAssets;
1377
- declare const assets_getAssetsObject: typeof getAssetsObject;
1378
- declare const assets_getBalanceForeign: typeof getBalanceForeign;
1379
- declare const assets_getBalanceNative: typeof getBalanceNative;
1380
- declare const assets_getExistentialDeposit: typeof getExistentialDeposit;
1381
- declare const assets_getMaxForeignTransferableAmount: typeof getMaxForeignTransferableAmount;
1382
- declare const assets_getMaxNativeTransferableAmount: typeof getMaxNativeTransferableAmount;
1383
- declare const assets_getNativeAssetSymbol: typeof getNativeAssetSymbol;
1384
- declare const assets_getNativeAssets: typeof getNativeAssets;
1385
- declare const assets_getOriginFeeDetails: typeof getOriginFeeDetails;
1386
- declare const assets_getOtherAssets: typeof getOtherAssets;
1387
- declare const assets_getRelayChainSymbol: typeof getRelayChainSymbol;
1388
- declare const assets_getSupportedAssets: typeof getSupportedAssets;
1389
- declare const assets_getTNode: typeof getTNode;
1390
- declare const assets_getTransferInfo: typeof getTransferInfo;
1391
- declare const assets_getTransferableAmount: typeof getTransferableAmount;
1392
- declare const assets_hasSupportForAsset: typeof hasSupportForAsset;
1393
- declare const assets_isNodeEvm: typeof isNodeEvm;
1394
- declare namespace assets {
1395
- export { assets_Foreign as Foreign, assets_ForeignAbstract as ForeignAbstract, assets_Native as Native, assets_Override as Override, assets_claimAssets as claimAssets, assets_getAllAssetsSymbols as getAllAssetsSymbols, assets_getAssetBalance as getAssetBalance, assets_getAssetDecimals as getAssetDecimals, assets_getAssetId as getAssetId, assets_getAssets as getAssets, assets_getAssetsObject as getAssetsObject, assets_getBalanceForeign as getBalanceForeign, assets_getBalanceNative as getBalanceNative, assets_getExistentialDeposit as getExistentialDeposit, assets_getMaxForeignTransferableAmount as getMaxForeignTransferableAmount, assets_getMaxNativeTransferableAmount as getMaxNativeTransferableAmount, assets_getNativeAssetSymbol as getNativeAssetSymbol, assets_getNativeAssets as getNativeAssets, assets_getOriginFeeDetails as getOriginFeeDetails, assets_getOtherAssets as getOtherAssets, assets_getRelayChainSymbol as getRelayChainSymbol, assets_getSupportedAssets as getSupportedAssets, assets_getTNode as getTNode, assets_getTransferInfo as getTransferInfo, assets_getTransferableAmount as getTransferableAmount, assets_hasSupportForAsset as hasSupportForAsset, assets_isNodeEvm as isNodeEvm };
1396
- }
1397
-
1398
- /**
1399
- * Retrieves the default pallet for a specified node.
1400
- *
1401
- * @param node - The node for which to get the default pallet.
1402
- * @returns The default pallet associated with the node.
1403
- */
1404
- declare const getDefaultPallet: (node: TNodePolkadotKusama) => TPallet;
1405
- /**
1406
- * Retrieves the list of supported pallets for a specified node.
1407
- *
1408
- * @param node - The node for which to get supported pallets.
1409
- * @returns An array of pallets supported by the node.
1410
- */
1411
- declare const getSupportedPallets: (node: TNodePolkadotKusama) => TPallet[];
1412
-
1413
- type TOptions<TApi, TRes> = TSendOptions<TApi, TRes> | TRelayToParaOptions<TApi, TRes>;
1414
- type TTransaction<TApi, TRes> = {
1415
- func: (options: TOptions<TApi, TRes>) => Promise<TRes>;
1416
- options: TOptions<TApi, TRes>;
1417
- };
1418
- declare class BatchTransactionManager<TApi, TRes> {
1419
- private transactions;
1420
- addTransaction(transaction: TTransaction<TApi, TRes>): void;
1421
- isEmpty(): boolean;
1422
- buildBatch(api: IPolkadotApi<TApi, TRes>, from: TNode | undefined, to: TDestination | undefined, options?: TBatchOptions): Promise<TRes>;
1423
- }
1424
-
1425
- interface IAddToBatchBuilder<TApi, TRes> {
1426
- addToBatch(): GeneralBuilder$1<TApi, TRes>;
1427
- }
1428
-
1429
- /**
1430
- * A builder class for constructing a Para-to-Para and Para-to-Relay transactions.
1431
- */
1432
- declare class ToGeneralBuilder<TApi, TRes> {
1433
- private batchManager;
1434
- private readonly api;
1435
- private readonly from;
1436
- private readonly to;
1437
- private readonly paraIdTo?;
1438
- constructor(api: IPolkadotApi<TApi, TRes>, from: TNodePolkadotKusama, to: TDestination, batchManager: BatchTransactionManager<TApi, TRes>, paraIdTo?: number);
1439
- /**
1440
- * Specifies the currency to be used in the transaction. Symbol, ID, multi-location or multi-asset.
1441
- *
1442
- * @param currency - The currency to be transferred.
1443
- * @returns An instance of Builder
1444
- */
1445
- currency(currency: TCurrencyInput): AmountOrFeeAssetBuilder<TApi, TRes>;
1446
- }
1447
- /**
1448
- * A builder class for constructing a Para-to-Para and Para-to-Relay transactions.
1449
- */
1450
- declare class FromGeneralBuilder<TApi, TRes> {
1451
- private batchManager;
1452
- private readonly api;
1453
- private readonly from;
1454
- private _feeAsset?;
1455
- constructor(api: IPolkadotApi<TApi, TRes>, from: TNodePolkadotKusama, batchManager: BatchTransactionManager<TApi, TRes>);
1456
- /**
1457
- * Specifies the destination node for the transaction.
1458
- *
1459
- * @param node - The destination node.
1460
- * @param paraIdTo - Optional parachain ID of the destination node.
1461
- * @returns An instance of Builder
1462
- */
1463
- to(node: TDestination, paraIdTo?: number): ToGeneralBuilder<TApi, TRes>;
1464
- /**
1465
- * Specifies the fee asset to be used for the transaction.
1466
- *
1467
- * @param feeAsset - The currency to be used as the fee asset.
1468
- * @returns An instance of Builder
1469
- */
1470
- feeAsset(feeAsset: TCurrency): AmountBuilder<TApi, TRes>;
1471
- /**
1472
- * Specifies the amount for the transaction.
1473
- *
1474
- * @param amount - The amount to be transferred.
1475
- * @returns An instance of Builder
1476
- */
1477
- amount(amount: TAmount | null): AddressBuilder<TApi, TRes>;
1478
- }
1479
- /**
1480
- * A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
1481
- */
1482
- declare class GeneralBuilder$1<TApi, TRes> {
1483
- private readonly batchManager;
1484
- private readonly api;
1485
- private readonly _from?;
1486
- private readonly _to?;
1487
- constructor(batchManager: BatchTransactionManager<TApi, TRes>, api: IPolkadotApi<TApi, TRes>, _from?: TNode | undefined, _to?: TDestination | undefined);
1488
- /**
1489
- * Specifies the origin node for the transaction.
1490
- *
1491
- * @param node - The node from which the transaction originates.
1492
- * @returns An instance of Builder
1493
- */
1494
- from(node: TNodePolkadotKusama): FromGeneralBuilder<TApi, TRes>;
1495
- /**
1496
- * Specifies the destination node for the transaction.
1497
- *
1498
- * @param node - The node to which the transaction is sent.
1499
- * @param paraIdTo - (Optional) The parachain ID of the destination node.
1500
- * @returns An instance of Builder
1501
- */
1502
- to(node: TDestination, paraIdTo?: number): AmountBuilder<TApi, TRes>;
1503
- /**
1504
- * Initiates the process to claim assets from a specified node.
1505
- *
1506
- * @param node - The node from which to claim assets.
1507
- * @returns An instance of Builder
1508
- */
1509
- claimFrom(node: TNodeWithRelayChains): FungibleBuilder<TRes>;
1510
- /**
1511
- * Builds and returns the batched transaction based on the configured parameters.
1512
- *
1513
- * @param options - (Optional) Options to customize the batch transaction.
1514
- * @returns A Extrinsic representing the batched transactions.
1515
- */
1516
- buildBatch(options?: TBatchOptions): Promise<TRes>;
1517
- }
1518
- interface FinalBuilder<TRes> {
1519
- build: () => Promise<TRes>;
1520
- }
1521
- interface UseKeepAliveFinalBuilder$1<TApi, TRes> extends IAddToBatchBuilder<TApi, TRes> {
1522
- useKeepAlive: (destApi: TApi) => this;
1523
- xcmVersion: (version: Version) => this;
1524
- build: () => Promise<TRes>;
1525
- }
1526
- interface AddressBuilder<TApi, TRes> {
1527
- address: (address: TAddress, ahAddress?: string) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
1528
- }
1529
- interface AmountBuilder<TApi, TRes> {
1530
- amount: (amount: TAmount | null) => AddressBuilder<TApi, TRes>;
1531
- }
1532
- interface AmountOrFeeAssetBuilder<TApi, TRes> {
1533
- amount: (amount: TAmount | null) => AddressBuilder<TApi, TRes>;
1534
- feeAsset: (feeAsset: TCurrency) => AmountBuilder<TApi, TRes>;
1535
- }
1536
- interface FungibleBuilder<TRes> {
1537
- fungible: (multiAssets: TMultiAsset[]) => AccountBuilder<TRes>;
1538
- }
1539
- interface AccountBuilder<TRes> {
1540
- account: (address: TAddress) => VersionBuilder<TRes>;
1541
- }
1542
- interface VersionBuilder<TRes> extends FinalBuilder<TRes> {
1543
- xcmVersion: (version: TVersionClaimAssets) => FinalBuilder<TRes>;
1544
- }
1545
-
1546
- /**
1547
- * Builder class for constructing transfers from Ethereum to Polkadot.
1548
- */
1549
- declare class EvmBuilderClass {
1550
- private readonly _options;
1551
- private readonly _provider;
1552
- constructor(provider: AbstractProvider);
1553
- /**
1554
- * Specifies the destination node on Polkadot.
1555
- *
1556
- * @param node - The Polkadot node to which the transfer will be made.
1557
- * @returns An instance of EvmBuilder
1558
- */
1559
- to(node: TNodePolkadotKusama): this;
1560
- /**
1561
- * Specifies the amount to transfer.
1562
- *
1563
- * @param amount - The amount to transfer, as a string.
1564
- * @returns An instance of EvmBuilder
1565
- */
1566
- amount(amount: string): this;
1567
- /**
1568
- * Specifies the currency to transfer.
1569
- *
1570
- * @param currency - The currency to be transferred.
1571
- * @returns An instance of EvmBuilder
1572
- */
1573
- currency(currency: TCurrencyCoreV1): this;
1574
- /**
1575
- * Specifies the recipient address on Polkadot.
1576
- *
1577
- * @param address - The Polkadot address to receive the transfer.
1578
- * @returns An instance of EvmBuilder
1579
- */
1580
- address(address: string): this;
1581
- /**
1582
- * Specifies the signer for the Ethereum transaction.
1583
- *
1584
- * @param signer - The Ethereum signer to authorize the transfer.
1585
- * @returns An instance of EvmBuilder
1586
- */
1587
- signer(signer: Signer): this;
1588
- /**
1589
- * Builds and executes the transfer from Ethereum to Polkadot.
1590
- *
1591
- * @throws Error if any required parameters are missing.
1592
- */
1593
- build(): Promise<void>;
1594
- }
1595
- /**
1596
- * Creates a new EvmBuilder instance for constructing Ethereum to Polkadot transfers.
1597
- *
1598
- * @param provider - The Ethereum provider to use for the transfer.
1599
- * @returns An instance of EvmBuilder class
1600
- */
1601
- declare const EvmBuilder: (provider: AbstractProvider) => EvmBuilderClass;
1602
-
1603
- /**
1604
- * Creates a new Builder instance.
1605
- *
1606
- * @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
1607
- * @returns A new Builder instance.
1608
- */
1609
- declare const Builder: (api?: TPapiApiOrUrl) => GeneralBuilder$1<polkadot_api.PolkadotClient, TPapiTransaction>;
1610
- type UseKeepAliveFinalBuilder = UseKeepAliveFinalBuilder$1<TPapiApi, TPapiTransaction>;
1611
- declare const GeneralBuilder: {
1612
- new (batchManager: BatchTransactionManager<polkadot_api.PolkadotClient, TPapiTransaction>, api: IPolkadotApi<polkadot_api.PolkadotClient, TPapiTransaction>, _from?: TNode | undefined, _to?: TDestination | undefined): GeneralBuilder$1<polkadot_api.PolkadotClient, TPapiTransaction>;
1613
- };
1614
-
1615
- declare const isForeignAsset: (asset: TAsset) => asset is TForeignAsset;
1616
-
1617
- declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<polkadot_api.PolkadotClient>;
1618
- declare const createPapiApiCall: <TArgs extends Record<string, unknown>, TResult>(apiCall: (options: TArgs & {
1619
- api: IPolkadotApi<TPapiApi, TPapiTransaction>;
1620
- }) => Promise<TResult>) => (options: TArgs & {
1621
- api?: TPapiApiOrUrl;
1622
- }) => Promise<TResult>;
1623
-
1624
- /**
1625
- * Retrieves the node instance for a given node.
1626
- *
1627
- * @param node - The node identifier.
1628
- * @returns The node instance
1629
- */
1630
- declare const getNode: <TApi, TRes, T extends keyof ReturnType<typeof nodes>>(node: T) => ReturnType<typeof nodes<TApi, TRes>>[T];
1631
-
1632
- /**
1633
- * Determines the relay chain for a given node.
1634
- *
1635
- * @param node - The node for which to determine the relay chain.
1636
- * @returns 'Kusama' if the node's relay chain symbol is 'KSM'; otherwise, 'Polkadot'.
1637
- */
1638
- declare const determineRelayChain: (node: TNodeWithRelayChains) => TNodeDotKsmWithRelayChains;
1639
- /**
1640
- * Determines whether a given node is a relay chain (Polkadot or Kusama).
1641
- *
1642
- * @param node - The node to check.
1643
- * @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
1644
- */
1645
- declare const isRelayChain: (node: TNodeWithRelayChains) => node is "Polkadot" | "Kusama";
1646
-
1647
- /**
1648
- * Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
1649
- */
1650
- declare class InvalidCurrencyError extends Error {
1651
- /**
1652
- * Constructs a new InvalidCurrencyError.
1653
- *
1654
- * @param message - The error message.
1655
- */
1656
- constructor(message: string);
1657
- }
1658
-
1659
- /**
1660
- * Used to inform user, that Parachain they wish to use is not supported yet
1661
- */
1662
- declare class NodeNotSupportedError extends Error {
1663
- /**
1664
- * Constructs a new NodeNotSupportedError.
1665
- *
1666
- * @param message - Optional custom error message.
1667
- */
1668
- constructor(message?: string);
1669
- }
1670
-
1671
- /**
1672
- * Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
1673
- */
1674
- declare class NoXCMSupportImplementedError extends Error {
1675
- /**
1676
- * Constructs a new NoXCMSupportImplementedError.
1677
- *
1678
- * @param node - The node for which XCM support is not implemented.
1679
- */
1680
- constructor(node: TNode);
1681
- }
1682
-
1683
- /**
1684
- * Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
1685
- */
1686
- declare class ScenarioNotSupportedError extends Error {
1687
- /**
1688
- * Constructs a new ScenarioNotSupportedError.
1689
- *
1690
- * @param node - The node where the scenario is not supported.
1691
- * @param scenario - The scenario that is not supported.
1692
- * @param message - Optional custom error message.
1693
- */
1694
- constructor(node: TNode, scenario: TScenario, message?: string);
1695
- }
1696
-
1697
- /**
1698
- * Error thrown when nodes from different relay chains are incompatible.
1699
- */
1700
- declare class IncompatibleNodesError extends Error {
1701
- /**
1702
- * Constructs a new IncompatibleNodesError.
1703
- *
1704
- * @param message - Optional custom error message.
1705
- */
1706
- constructor(message?: string);
1707
- }
1708
-
1709
- /**
1710
- * Error thrown when multiple assets with the same symbol are found.
1711
- */
1712
- declare class DuplicateAssetError extends Error {
1713
- /**
1714
- * Constructs a new DuplicateAssetError.
1715
- *
1716
- * @param symbol - The symbol of the asset causing the duplication error.
1717
- */
1718
- constructor(msg: string);
1719
- }
1720
-
1721
- /**
1722
- * Error thrown when multiple assets with the same symbol are found.
1723
- */
1724
- declare class DuplicateAssetIdError extends Error {
1725
- /**
1726
- * Constructs a new DuplicateAssetError.
1727
- *
1728
- * @param symbol - The symbol of the asset causing the duplication error.
1729
- */
1730
- constructor(id: string);
1731
- }
1732
-
1733
- /**
1734
- * Error thrown when an invalid address is provided.
1735
- */
1736
- declare class InvalidAddressError extends Error {
1737
- /**
1738
- * Constructs a new InvalidAddressError.
1739
- *
1740
- * @param message - The error message.
1741
- */
1742
- constructor(message: string);
1743
- }
1744
-
1745
- declare const getNodeConfig: (node: TNodeDotKsmWithRelayChains) => TNodeConfig;
1746
-
1747
- declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
1748
-
1749
- declare const getNodeProvider: (node: TNodeDotKsmWithRelayChains) => string;
1750
-
1751
- /**
1752
- * Retrieves the parachain ID for a specified node.
1753
- *
1754
- * @param node - The node for which to get the paraId.
1755
- * @returns The parachain ID of the node.
1756
- */
1757
- declare const getParaId: (node: TNodeDotKsmWithRelayChains) => number;
1758
-
1759
- export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, EvmBuilder, Foreign, ForeignAbstract, GeneralBuilder, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAsset, type TAssetJsonMap, type TBatchOptions, type TBifrostToken, type TCheckKeepAliveOptions, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TEdJsonMap, type TEvmBuilderOptions, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type THexString$1 as THexString, type TJunction, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletJsonMap, type TPalletMap, type TPapiApi, type TPapiApiOrUrl, type TPapiTransaction, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, type UseKeepAliveFinalBuilder, Version, assets, buildEthTransferOptions, claimAssets, createApiInstanceForNode, createPapiApiCall, determineRelayChain, getAllAssetsSymbols, getAssetBalance, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProvider, getNodeProviders, getOriginFeeDetails, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isRelayChain, send, transferRelayToPara, index as xcmPallet };