@paraspell/sdk 5.8.0 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/dist/index.cjs +1481 -525
- package/dist/index.d.ts +542 -68
- package/dist/index.mjs +1475 -527
- package/package.json +13 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiPromise } from '@polkadot/api';
|
|
2
2
|
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
3
|
-
import {
|
|
3
|
+
import { Signer, AbstractProvider } from 'ethers';
|
|
4
4
|
import * as _polkadot_apps_config_endpoints_types from '@polkadot/apps-config/endpoints/types';
|
|
5
5
|
|
|
6
6
|
type TMultiAsset = TMultiAssetV3 | TMultiAssetV4;
|
|
@@ -35,21 +35,52 @@ interface TCurrencySelection {
|
|
|
35
35
|
Fungible: string;
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
type TCurrencySelectionV4 = {
|
|
39
|
+
id: TMultiLocation;
|
|
40
|
+
fun: {
|
|
41
|
+
Fungible: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
38
44
|
type TCurrencySelectionHeader = {
|
|
39
|
-
[key in Version]?: TCurrencySelection;
|
|
45
|
+
[key in Version]?: TCurrencySelection | TCurrencySelectionV4;
|
|
40
46
|
};
|
|
41
47
|
type TCurrencySelectionHeaderArr = {
|
|
42
|
-
[key in Version]?: [TCurrencySelection];
|
|
48
|
+
[key in Version]?: [TCurrencySelection | TCurrencySelectionV4];
|
|
49
|
+
};
|
|
50
|
+
type TForeignAsset = {
|
|
51
|
+
ForeignAsset: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
type TForeignAssetId = {
|
|
54
|
+
ForeignAssetId: string | undefined;
|
|
55
|
+
};
|
|
56
|
+
type TForeignOrTokenAsset = TForeignAsset | {
|
|
57
|
+
Token: string | undefined;
|
|
43
58
|
};
|
|
59
|
+
type TForeignOrNativeAsset = TForeignAsset | 'Native';
|
|
60
|
+
type TXcmAsset = {
|
|
61
|
+
XCM: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
type TMantaAsset = {
|
|
64
|
+
MantaCurrency: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
type TNativeTokenAsset = 'NativeToken';
|
|
67
|
+
type TNodleAsset = 'NodleNative';
|
|
68
|
+
type TZeitgeistAsset = 'Ztg';
|
|
69
|
+
type TOtherReserveAsset = {
|
|
70
|
+
OtherReserve: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
type TSelfReserveAsset = 'SelfReserve';
|
|
73
|
+
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
74
|
+
type TXTokensCurrencySelection = TCurrencySelectionHeader | TForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | string | undefined;
|
|
44
75
|
|
|
45
76
|
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
46
|
-
|
|
77
|
+
type PolkadotXCMTransferInput = {
|
|
47
78
|
api: ApiPromise;
|
|
48
|
-
header:
|
|
49
|
-
addressSelection:
|
|
79
|
+
header: TMultiLocationHeader;
|
|
80
|
+
addressSelection: TMultiLocationHeader;
|
|
50
81
|
amount: string;
|
|
51
82
|
address: TAddress;
|
|
52
|
-
currencySelection:
|
|
83
|
+
currencySelection: TCurrencySelectionHeaderArr;
|
|
53
84
|
scenario: TScenario;
|
|
54
85
|
currencySymbol: string | undefined;
|
|
55
86
|
currencyId: string | undefined;
|
|
@@ -58,13 +89,13 @@ interface PolkadotXCMTransferInput {
|
|
|
58
89
|
feeAsset?: TCurrency;
|
|
59
90
|
overridedCurrency?: TMultiLocation | TMultiAsset[];
|
|
60
91
|
serializedApiCallEnabled?: boolean;
|
|
61
|
-
}
|
|
62
|
-
|
|
92
|
+
};
|
|
93
|
+
type XTokensTransferInput = {
|
|
63
94
|
api: ApiPromise;
|
|
64
95
|
currency: string | undefined;
|
|
65
96
|
currencyID: string | undefined;
|
|
66
97
|
amount: string;
|
|
67
|
-
addressSelection:
|
|
98
|
+
addressSelection: TMultiLocationHeader;
|
|
68
99
|
fees: number;
|
|
69
100
|
scenario: TScenario;
|
|
70
101
|
origin: TNode;
|
|
@@ -73,8 +104,8 @@ interface XTokensTransferInput {
|
|
|
73
104
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
74
105
|
feeAsset?: TCurrency;
|
|
75
106
|
serializedApiCallEnabled?: boolean;
|
|
76
|
-
}
|
|
77
|
-
|
|
107
|
+
};
|
|
108
|
+
type XTransferTransferInput = {
|
|
78
109
|
api: ApiPromise;
|
|
79
110
|
currency: string | undefined;
|
|
80
111
|
currencyID: string | undefined;
|
|
@@ -85,16 +116,16 @@ interface XTransferTransferInput {
|
|
|
85
116
|
destination?: TDestination;
|
|
86
117
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
87
118
|
serializedApiCallEnabled?: boolean;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
transferPolkadotXCM: (input: PolkadotXCMTransferInput) =>
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
transferXTokens: (input: XTokensTransferInput) =>
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
transferXTransfer: (input: XTransferTransferInput) =>
|
|
97
|
-
}
|
|
119
|
+
};
|
|
120
|
+
type IPolkadotXCMTransfer = {
|
|
121
|
+
transferPolkadotXCM: (input: PolkadotXCMTransferInput) => TTransferReturn;
|
|
122
|
+
};
|
|
123
|
+
type IXTokensTransfer = {
|
|
124
|
+
transferXTokens: (input: XTokensTransferInput) => TTransferReturn;
|
|
125
|
+
};
|
|
126
|
+
type IXTransferTransfer = {
|
|
127
|
+
transferXTransfer: (input: XTransferTransferInput) => TTransferReturn;
|
|
128
|
+
};
|
|
98
129
|
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
99
130
|
declare enum Version {
|
|
100
131
|
V1 = "V1",
|
|
@@ -111,55 +142,56 @@ declare enum Parents {
|
|
|
111
142
|
type TAmount = string | number | bigint;
|
|
112
143
|
type TAddress = string | TMultiLocation;
|
|
113
144
|
type TDestination = TNode | TMultiLocation;
|
|
114
|
-
|
|
145
|
+
type TSendBaseOptions = {
|
|
115
146
|
address: TAddress;
|
|
116
147
|
destination?: TDestination;
|
|
117
148
|
paraIdTo?: number;
|
|
118
149
|
feeAsset?: TCurrency;
|
|
119
150
|
destApiForKeepAlive?: ApiPromise;
|
|
120
151
|
version?: Version;
|
|
121
|
-
}
|
|
122
|
-
|
|
152
|
+
};
|
|
153
|
+
type TSendOptions = TSendBaseOptions & {
|
|
123
154
|
api?: ApiPromise;
|
|
124
155
|
origin: TNode;
|
|
125
156
|
currency: TCurrencyInput;
|
|
126
157
|
amount: TAmount | null;
|
|
127
|
-
}
|
|
128
|
-
|
|
158
|
+
};
|
|
159
|
+
type TSendOptionsCommon = TSendOptions & {
|
|
129
160
|
serializedApiCallEnabled?: boolean;
|
|
130
|
-
}
|
|
131
|
-
|
|
161
|
+
};
|
|
162
|
+
type TSendInternalOptions = TSendBaseOptions & {
|
|
132
163
|
api: ApiPromise;
|
|
133
164
|
currencySymbol: string | undefined;
|
|
134
165
|
currencyId: string | undefined;
|
|
135
166
|
amount: string;
|
|
136
167
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
137
168
|
serializedApiCallEnabled?: boolean;
|
|
138
|
-
}
|
|
139
|
-
|
|
169
|
+
};
|
|
170
|
+
type TRelayToParaBaseOptions = {
|
|
140
171
|
destination: TDestination;
|
|
141
172
|
address: TAddress;
|
|
142
173
|
paraIdTo?: number;
|
|
143
174
|
destApiForKeepAlive?: ApiPromise;
|
|
144
175
|
version?: Version;
|
|
145
|
-
}
|
|
146
|
-
|
|
176
|
+
};
|
|
177
|
+
type TRelayToParaOptions = TRelayToParaBaseOptions & {
|
|
147
178
|
api?: ApiPromise;
|
|
148
179
|
amount: TAmount;
|
|
149
|
-
}
|
|
150
|
-
|
|
180
|
+
};
|
|
181
|
+
type TRelayToParaInternalOptions = TRelayToParaBaseOptions & {
|
|
151
182
|
api: ApiPromise;
|
|
152
183
|
amount: string;
|
|
153
|
-
}
|
|
154
|
-
|
|
184
|
+
};
|
|
185
|
+
type TRelayToParaCommonOptions = TRelayToParaOptions & {
|
|
155
186
|
serializedApiCallEnabled?: boolean;
|
|
156
|
-
}
|
|
157
|
-
|
|
187
|
+
};
|
|
188
|
+
type TTransferReturn = Extrinsic | TSerializedApiCall;
|
|
189
|
+
type TSerializedApiCall = {
|
|
158
190
|
module: string;
|
|
159
191
|
section: string;
|
|
160
192
|
parameters: any[];
|
|
161
|
-
}
|
|
162
|
-
|
|
193
|
+
};
|
|
194
|
+
type CheckKeepAliveOptions = {
|
|
163
195
|
originApi: ApiPromise;
|
|
164
196
|
address: string;
|
|
165
197
|
amount: string;
|
|
@@ -167,7 +199,7 @@ interface CheckKeepAliveOptions {
|
|
|
167
199
|
destApi?: ApiPromise;
|
|
168
200
|
currencySymbol?: string;
|
|
169
201
|
destNode?: TNodePolkadotKusama;
|
|
170
|
-
}
|
|
202
|
+
};
|
|
171
203
|
|
|
172
204
|
type JunctionType = 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality' | 'GlobalConsensus';
|
|
173
205
|
type NetworkId = string | null;
|
|
@@ -276,18 +308,402 @@ declare abstract class ParachainNode {
|
|
|
276
308
|
get version(): Version;
|
|
277
309
|
get assetCheckEnabled(): boolean;
|
|
278
310
|
protected canUseXTokens(_: TSendInternalOptions): boolean;
|
|
279
|
-
transfer(options: TSendInternalOptions):
|
|
311
|
+
transfer(options: TSendInternalOptions): TTransferReturn;
|
|
280
312
|
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
281
313
|
getProvider(): string;
|
|
282
314
|
createApiInstance(): Promise<ApiPromise>;
|
|
283
315
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
284
316
|
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination?: TDestination, paraId?: number): TMultiLocationHeader;
|
|
317
|
+
getNativeAssetSymbol(): string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
declare class Acala extends ParachainNode implements IXTokensTransfer {
|
|
321
|
+
constructor();
|
|
322
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
323
|
+
getProvider(): string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare class Unique extends ParachainNode implements IXTokensTransfer {
|
|
327
|
+
constructor();
|
|
328
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare class Crust extends ParachainNode implements IXTokensTransfer {
|
|
332
|
+
constructor();
|
|
333
|
+
getCurrencySelection({ currency, currencyID }: XTokensTransferInput): TReserveAsset;
|
|
334
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare class BifrostPolkadot extends ParachainNode implements IXTokensTransfer {
|
|
338
|
+
constructor();
|
|
339
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
declare class Bitgreen extends ParachainNode {
|
|
343
|
+
constructor();
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
declare class Centrifuge extends ParachainNode implements IXTokensTransfer {
|
|
347
|
+
constructor();
|
|
348
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
declare class ComposableFinance extends ParachainNode implements IXTokensTransfer {
|
|
352
|
+
constructor();
|
|
353
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
declare class Hydration extends ParachainNode implements IXTokensTransfer {
|
|
357
|
+
constructor();
|
|
358
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
declare class Interlay extends ParachainNode implements IXTokensTransfer {
|
|
362
|
+
constructor();
|
|
363
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
declare class Litentry extends ParachainNode implements IXTokensTransfer {
|
|
367
|
+
constructor();
|
|
368
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
declare class Moonbeam extends ParachainNode implements IXTokensTransfer {
|
|
372
|
+
constructor();
|
|
373
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
374
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
375
|
+
getProvider(): string;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
declare class Parallel extends ParachainNode implements IXTokensTransfer {
|
|
379
|
+
constructor();
|
|
380
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
declare class Altair extends ParachainNode implements IXTokensTransfer {
|
|
384
|
+
constructor();
|
|
385
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
declare class Amplitude extends ParachainNode implements IXTokensTransfer {
|
|
389
|
+
constructor();
|
|
390
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
declare class Bajun extends ParachainNode implements IXTokensTransfer {
|
|
394
|
+
constructor();
|
|
395
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
396
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare class Basilisk extends ParachainNode implements IXTokensTransfer {
|
|
400
|
+
constructor();
|
|
401
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
declare class BifrostKusama extends ParachainNode implements IXTokensTransfer {
|
|
405
|
+
constructor();
|
|
406
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare class Pioneer extends ParachainNode implements IXTokensTransfer {
|
|
410
|
+
constructor();
|
|
411
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
declare class Turing extends ParachainNode implements IXTokensTransfer {
|
|
415
|
+
constructor();
|
|
416
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
declare class Picasso extends ParachainNode implements IXTokensTransfer {
|
|
420
|
+
constructor();
|
|
421
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare class ParallelHeiko extends ParachainNode implements IXTokensTransfer {
|
|
425
|
+
constructor();
|
|
426
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
declare class Moonriver extends ParachainNode implements IXTokensTransfer {
|
|
430
|
+
constructor();
|
|
431
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
432
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
declare class Litmus extends ParachainNode implements IXTokensTransfer {
|
|
436
|
+
constructor();
|
|
437
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
declare class Kintsugi extends ParachainNode implements IXTokensTransfer {
|
|
441
|
+
constructor();
|
|
442
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
declare class Calamari extends ParachainNode implements IXTokensTransfer {
|
|
446
|
+
constructor();
|
|
447
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
declare class CrustShadow extends ParachainNode implements IXTokensTransfer {
|
|
451
|
+
constructor();
|
|
452
|
+
getCurrencySelection({ currency, currencyID }: XTokensTransferInput): TReserveAsset;
|
|
453
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
declare class Imbue extends ParachainNode implements IXTokensTransfer {
|
|
457
|
+
constructor();
|
|
458
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare class Integritee extends ParachainNode implements IXTokensTransfer {
|
|
462
|
+
constructor();
|
|
463
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
464
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare class InvArchTinker extends ParachainNode implements IXTokensTransfer {
|
|
468
|
+
constructor();
|
|
469
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
declare class Karura extends ParachainNode implements IXTokensTransfer {
|
|
473
|
+
constructor();
|
|
474
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
475
|
+
getProvider(): string;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
declare class AssetHubPolkadot extends ParachainNode implements IPolkadotXCMTransfer {
|
|
479
|
+
constructor();
|
|
480
|
+
handleBridgeTransfer(input: PolkadotXCMTransferInput, targetChain: 'Polkadot' | 'Kusama'): TTransferReturn;
|
|
481
|
+
handleEthBridgeTransfer(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
482
|
+
handleMythosTransfer(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
483
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
484
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
485
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
declare class AssetHubKusama extends ParachainNode implements IPolkadotXCMTransfer {
|
|
489
|
+
constructor();
|
|
490
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
491
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
492
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
declare class CoretimeKusama extends ParachainNode implements IPolkadotXCMTransfer {
|
|
496
|
+
constructor();
|
|
497
|
+
_assetCheckEnabled: boolean;
|
|
498
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
499
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
declare class Encointer extends ParachainNode implements IPolkadotXCMTransfer {
|
|
503
|
+
constructor();
|
|
504
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
505
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
declare class Robonomics extends ParachainNode implements IPolkadotXCMTransfer {
|
|
509
|
+
constructor();
|
|
510
|
+
private static readonly FEE;
|
|
511
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
declare class Astar extends ParachainNode implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
515
|
+
constructor();
|
|
516
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
517
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
518
|
+
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions): boolean;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
declare class Darwinia extends ParachainNode implements IXTokensTransfer {
|
|
522
|
+
constructor();
|
|
523
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
524
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
525
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation): TCurrencySelectionHeaderArr;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
declare class Crab extends ParachainNode implements IPolkadotXCMTransfer {
|
|
529
|
+
constructor();
|
|
530
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
531
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
532
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
declare class Quartz extends ParachainNode implements IXTokensTransfer {
|
|
536
|
+
constructor();
|
|
537
|
+
_assetCheckEnabled: boolean;
|
|
538
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
declare class Shiden extends ParachainNode implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
542
|
+
constructor();
|
|
543
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
544
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
545
|
+
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions): boolean;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
declare class Manta extends ParachainNode implements IXTokensTransfer {
|
|
549
|
+
constructor();
|
|
550
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
declare class Nodle extends ParachainNode implements IXTokensTransfer {
|
|
554
|
+
constructor();
|
|
555
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
556
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
declare class NeuroWeb extends ParachainNode implements IPolkadotXCMTransfer {
|
|
560
|
+
constructor();
|
|
561
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
declare class Pendulum extends ParachainNode implements IXTokensTransfer {
|
|
565
|
+
constructor();
|
|
566
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
567
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
declare class Polkadex extends ParachainNode implements IXTokensTransfer {
|
|
571
|
+
constructor();
|
|
572
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
declare class Zeitgeist extends ParachainNode implements IXTokensTransfer {
|
|
576
|
+
constructor();
|
|
577
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
declare class Collectives extends ParachainNode implements IPolkadotXCMTransfer {
|
|
581
|
+
constructor();
|
|
582
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
583
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
584
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
declare class Khala extends ParachainNode implements IXTransferTransfer {
|
|
588
|
+
constructor();
|
|
589
|
+
transferXTransfer(input: XTransferTransferInput): TTransferReturn;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
declare class Phala extends ParachainNode implements IXTransferTransfer {
|
|
593
|
+
constructor();
|
|
594
|
+
transferXTransfer(input: XTransferTransferInput): TTransferReturn;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
declare class Subsocial extends ParachainNode {
|
|
598
|
+
constructor();
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
declare class KiltSpiritnet extends ParachainNode implements IPolkadotXCMTransfer {
|
|
602
|
+
constructor();
|
|
603
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
604
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
declare class Curio extends ParachainNode implements IXTokensTransfer {
|
|
608
|
+
constructor();
|
|
609
|
+
private getCurrencySelection;
|
|
610
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
declare class BridgeHubPolkadot extends ParachainNode implements IPolkadotXCMTransfer {
|
|
614
|
+
constructor();
|
|
615
|
+
_assetCheckEnabled: boolean;
|
|
616
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
617
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
declare class BridgeHubKusama extends ParachainNode implements IPolkadotXCMTransfer {
|
|
621
|
+
constructor();
|
|
622
|
+
_assetCheckEnabled: boolean;
|
|
623
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
624
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
declare class Ethereum extends ParachainNode {
|
|
628
|
+
constructor();
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
declare class Mythos extends ParachainNode implements IPolkadotXCMTransfer {
|
|
632
|
+
constructor();
|
|
633
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
634
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
declare class Peaq extends ParachainNode implements IXTokensTransfer {
|
|
638
|
+
constructor();
|
|
639
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
640
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
641
|
+
getProvider(): string;
|
|
285
642
|
}
|
|
286
643
|
|
|
287
644
|
declare const NODE_NAMES_DOT_KSM: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq"];
|
|
288
645
|
declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Ethereum"];
|
|
289
646
|
declare const NODES_WITH_RELAY_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "BridgeHubPolkadot", "BridgeHubKusama", "Centrifuge", "ComposableFinance", "Darwinia", "Hydration", "Interlay", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Ethereum", "Polkadot", "Kusama"];
|
|
290
647
|
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", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Unique", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Polkadex", "Zeitgeist", "Collectives", "Khala", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polkadot", "Kusama"];
|
|
648
|
+
declare const nodes: {
|
|
649
|
+
AssetHubPolkadot: AssetHubPolkadot;
|
|
650
|
+
Acala: Acala;
|
|
651
|
+
Astar: Astar;
|
|
652
|
+
Unique: Unique;
|
|
653
|
+
Crust: Crust;
|
|
654
|
+
BifrostPolkadot: BifrostPolkadot;
|
|
655
|
+
BridgeHubPolkadot: BridgeHubPolkadot;
|
|
656
|
+
BridgeHubKusama: BridgeHubKusama;
|
|
657
|
+
Bitgreen: Bitgreen;
|
|
658
|
+
Centrifuge: Centrifuge;
|
|
659
|
+
ComposableFinance: ComposableFinance;
|
|
660
|
+
Darwinia: Darwinia;
|
|
661
|
+
Hydration: Hydration;
|
|
662
|
+
Interlay: Interlay;
|
|
663
|
+
Litentry: Litentry;
|
|
664
|
+
Moonbeam: Moonbeam;
|
|
665
|
+
Parallel: Parallel;
|
|
666
|
+
AssetHubKusama: AssetHubKusama;
|
|
667
|
+
CoretimeKusama: CoretimeKusama;
|
|
668
|
+
Encointer: Encointer;
|
|
669
|
+
Altair: Altair;
|
|
670
|
+
Amplitude: Amplitude;
|
|
671
|
+
Bajun: Bajun;
|
|
672
|
+
Basilisk: Basilisk;
|
|
673
|
+
BifrostKusama: BifrostKusama;
|
|
674
|
+
Pioneer: Pioneer;
|
|
675
|
+
Calamari: Calamari;
|
|
676
|
+
CrustShadow: CrustShadow;
|
|
677
|
+
Crab: Crab;
|
|
678
|
+
Imbue: Imbue;
|
|
679
|
+
Integritee: Integritee;
|
|
680
|
+
InvArchTinker: InvArchTinker;
|
|
681
|
+
Karura: Karura;
|
|
682
|
+
Kintsugi: Kintsugi;
|
|
683
|
+
Litmus: Litmus;
|
|
684
|
+
Moonriver: Moonriver;
|
|
685
|
+
ParallelHeiko: ParallelHeiko;
|
|
686
|
+
Picasso: Picasso;
|
|
687
|
+
Quartz: Quartz;
|
|
688
|
+
Robonomics: Robonomics;
|
|
689
|
+
Shiden: Shiden;
|
|
690
|
+
Turing: Turing;
|
|
691
|
+
Manta: Manta;
|
|
692
|
+
Nodle: Nodle;
|
|
693
|
+
NeuroWeb: NeuroWeb;
|
|
694
|
+
Pendulum: Pendulum;
|
|
695
|
+
Polkadex: Polkadex;
|
|
696
|
+
Zeitgeist: Zeitgeist;
|
|
697
|
+
Collectives: Collectives;
|
|
698
|
+
Khala: Khala;
|
|
699
|
+
Phala: Phala;
|
|
700
|
+
Subsocial: Subsocial;
|
|
701
|
+
KiltSpiritnet: KiltSpiritnet;
|
|
702
|
+
Curio: Curio;
|
|
703
|
+
Ethereum: Ethereum;
|
|
704
|
+
Mythos: Mythos;
|
|
705
|
+
Peaq: Peaq;
|
|
706
|
+
};
|
|
291
707
|
declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm", "XTransfer"];
|
|
292
708
|
|
|
293
709
|
type TNode = (typeof NODE_NAMES)[number];
|
|
@@ -298,24 +714,25 @@ type TNodeDotKsmWithRelayChains = Exclude<TNodeWithRelayChains, 'Ethereum'>;
|
|
|
298
714
|
type TRelayChainType = 'polkadot' | 'kusama';
|
|
299
715
|
type TRelayChainSymbol = 'DOT' | 'KSM';
|
|
300
716
|
|
|
301
|
-
|
|
717
|
+
type TAsset = TNativeAssetDetails | TAssetDetails;
|
|
718
|
+
type TAssetDetails = {
|
|
302
719
|
assetId: string;
|
|
303
720
|
symbol?: string;
|
|
304
721
|
decimals?: number;
|
|
305
|
-
}
|
|
306
|
-
|
|
722
|
+
};
|
|
723
|
+
type TNativeAssetDetails = {
|
|
307
724
|
assetId?: string;
|
|
308
725
|
symbol: string;
|
|
309
726
|
decimals: number;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
paraId
|
|
727
|
+
};
|
|
728
|
+
type TNodeAssets = {
|
|
729
|
+
paraId?: number;
|
|
313
730
|
relayChainAssetSymbol: TRelayChainSymbol;
|
|
314
731
|
nativeAssetSymbol: string;
|
|
315
732
|
nativeAssets: TNativeAssetDetails[];
|
|
316
733
|
otherAssets: TAssetDetails[];
|
|
317
|
-
}
|
|
318
|
-
type TAssetJsonMap = Record<
|
|
734
|
+
};
|
|
735
|
+
type TAssetJsonMap = Record<TNodeWithRelayChains, TNodeAssets>;
|
|
319
736
|
|
|
320
737
|
type TPallet = (typeof SUPPORTED_PALLETS)[number];
|
|
321
738
|
interface TPalletMap {
|
|
@@ -346,19 +763,50 @@ interface TOpenChannelInternalOptions extends TOpenChannelOptions {
|
|
|
346
763
|
|
|
347
764
|
type TEdJsonMap = Record<TNodeDotKsmWithRelayChains, string | null>;
|
|
348
765
|
|
|
766
|
+
type TEvmBuilderOptions = {
|
|
767
|
+
to: TNodePolkadotKusama;
|
|
768
|
+
amount: string;
|
|
769
|
+
currency: string;
|
|
770
|
+
address: string;
|
|
771
|
+
signer: Signer;
|
|
772
|
+
};
|
|
773
|
+
type TSerializeEthTransferOptions = Omit<TEvmBuilderOptions, 'signer'> & {
|
|
774
|
+
destAddress: string;
|
|
775
|
+
};
|
|
776
|
+
type TSerializedEthTransfer = {
|
|
777
|
+
token: string;
|
|
778
|
+
destinationParaId: number;
|
|
779
|
+
destinationFee: bigint;
|
|
780
|
+
amount: bigint;
|
|
781
|
+
};
|
|
782
|
+
type OptionalProperties<T> = {
|
|
783
|
+
[P in keyof T]?: T[P] | undefined;
|
|
784
|
+
};
|
|
785
|
+
type TOptionalEvmBuilderOptions = OptionalProperties<TEvmBuilderOptions>;
|
|
786
|
+
declare enum BatchMode {
|
|
787
|
+
BATCH_ALL = "BATCH_ALL",
|
|
788
|
+
BATCH = "BATCH"
|
|
789
|
+
}
|
|
790
|
+
type TBatchOptions = {
|
|
791
|
+
mode: BatchMode;
|
|
792
|
+
};
|
|
793
|
+
|
|
349
794
|
declare const sendSerializedApiCall: (options: TSendOptions) => Promise<TSerializedApiCall>;
|
|
350
795
|
declare const send: (options: TSendOptions) => Promise<Extrinsic>;
|
|
351
|
-
declare const transferRelayToParaCommon: (options: TRelayToParaCommonOptions) => Promise<
|
|
796
|
+
declare const transferRelayToParaCommon: (options: TRelayToParaCommonOptions) => Promise<TTransferReturn>;
|
|
352
797
|
declare const transferRelayToPara: (options: TRelayToParaOptions) => Promise<Extrinsic>;
|
|
353
798
|
declare const transferRelayToParaSerializedApiCall: (options: TRelayToParaOptions) => Promise<TSerializedApiCall>;
|
|
354
799
|
|
|
800
|
+
declare const buildEthTransferOptions: ({ currency, to, address, destAddress, amount }: TSerializeEthTransferOptions) => Promise<TSerializedEthTransfer>;
|
|
801
|
+
|
|
802
|
+
declare const index$3_buildEthTransferOptions: typeof buildEthTransferOptions;
|
|
355
803
|
declare const index$3_send: typeof send;
|
|
356
804
|
declare const index$3_sendSerializedApiCall: typeof sendSerializedApiCall;
|
|
357
805
|
declare const index$3_transferRelayToPara: typeof transferRelayToPara;
|
|
358
806
|
declare const index$3_transferRelayToParaCommon: typeof transferRelayToParaCommon;
|
|
359
807
|
declare const index$3_transferRelayToParaSerializedApiCall: typeof transferRelayToParaSerializedApiCall;
|
|
360
808
|
declare namespace index$3 {
|
|
361
|
-
export { index$3_send as send, index$3_sendSerializedApiCall as sendSerializedApiCall, index$3_transferRelayToPara as transferRelayToPara, index$3_transferRelayToParaCommon as transferRelayToParaCommon, index$3_transferRelayToParaSerializedApiCall as transferRelayToParaSerializedApiCall };
|
|
809
|
+
export { index$3_buildEthTransferOptions as buildEthTransferOptions, index$3_send as send, index$3_sendSerializedApiCall as sendSerializedApiCall, index$3_transferRelayToPara as transferRelayToPara, index$3_transferRelayToParaCommon as transferRelayToParaCommon, index$3_transferRelayToParaSerializedApiCall as transferRelayToParaSerializedApiCall };
|
|
362
810
|
}
|
|
363
811
|
|
|
364
812
|
declare const openChannel: (options: TOpenChannelOptions) => Extrinsic;
|
|
@@ -379,15 +827,17 @@ declare namespace index$1 {
|
|
|
379
827
|
export { index$1_closeChannel as closeChannel, index$1_closeChannelSerializedApiCall as closeChannelSerializedApiCall };
|
|
380
828
|
}
|
|
381
829
|
|
|
382
|
-
declare const getAssetsObject: (node:
|
|
830
|
+
declare const getAssetsObject: (node: TNodeWithRelayChains) => TNodeAssets;
|
|
383
831
|
declare const getAssetId: (node: TNode, symbol: string) => string | null;
|
|
384
|
-
declare const getRelayChainSymbol: (node:
|
|
832
|
+
declare const getRelayChainSymbol: (node: TNodeWithRelayChains) => TRelayChainSymbol;
|
|
385
833
|
declare const getNativeAssets: (node: TNode) => TNativeAssetDetails[];
|
|
386
834
|
declare const getOtherAssets: (node: TNode) => TAssetDetails[];
|
|
387
|
-
declare const
|
|
835
|
+
declare const getAssets: (node: TNodeWithRelayChains) => TAsset[];
|
|
836
|
+
declare const getAllAssetsSymbols: (node: TNodeWithRelayChains) => string[];
|
|
388
837
|
declare const getNativeAssetSymbol: (node: TNodeWithRelayChains) => string;
|
|
389
838
|
declare const hasSupportForAsset: (node: TNode, symbol: string) => boolean;
|
|
390
|
-
declare const
|
|
839
|
+
declare const getSupportedAssets: (origin: TNodeWithRelayChains, destination: TNodeWithRelayChains) => TAsset[];
|
|
840
|
+
declare const getAssetDecimals: (node: TNodeWithRelayChains, symbol: string) => number | null;
|
|
391
841
|
declare const getParaId: (node: TNode) => number;
|
|
392
842
|
declare const getTNode: (paraId: number) => TNode | null;
|
|
393
843
|
|
|
@@ -428,6 +878,7 @@ declare const getTransferInfo: (origin: TNodeDotKsmWithRelayChains, destination:
|
|
|
428
878
|
declare const index_getAllAssetsSymbols: typeof getAllAssetsSymbols;
|
|
429
879
|
declare const index_getAssetDecimals: typeof getAssetDecimals;
|
|
430
880
|
declare const index_getAssetId: typeof getAssetId;
|
|
881
|
+
declare const index_getAssets: typeof getAssets;
|
|
431
882
|
declare const index_getAssetsObject: typeof getAssetsObject;
|
|
432
883
|
declare const index_getBalanceForeign: typeof getBalanceForeign;
|
|
433
884
|
declare const index_getBalanceNative: typeof getBalanceNative;
|
|
@@ -436,11 +887,12 @@ declare const index_getNativeAssets: typeof getNativeAssets;
|
|
|
436
887
|
declare const index_getOtherAssets: typeof getOtherAssets;
|
|
437
888
|
declare const index_getParaId: typeof getParaId;
|
|
438
889
|
declare const index_getRelayChainSymbol: typeof getRelayChainSymbol;
|
|
890
|
+
declare const index_getSupportedAssets: typeof getSupportedAssets;
|
|
439
891
|
declare const index_getTNode: typeof getTNode;
|
|
440
892
|
declare const index_getTransferInfo: typeof getTransferInfo;
|
|
441
893
|
declare const index_hasSupportForAsset: typeof hasSupportForAsset;
|
|
442
894
|
declare namespace index {
|
|
443
|
-
export { index_getAllAssetsSymbols as getAllAssetsSymbols, index_getAssetDecimals as getAssetDecimals, index_getAssetId as getAssetId, index_getAssetsObject as getAssetsObject, index_getBalanceForeign as getBalanceForeign, index_getBalanceNative as getBalanceNative, index_getNativeAssetSymbol as getNativeAssetSymbol, index_getNativeAssets as getNativeAssets, index_getOtherAssets as getOtherAssets, index_getParaId as getParaId, index_getRelayChainSymbol as getRelayChainSymbol, index_getTNode as getTNode, index_getTransferInfo as getTransferInfo, index_hasSupportForAsset as hasSupportForAsset };
|
|
895
|
+
export { index_getAllAssetsSymbols as getAllAssetsSymbols, index_getAssetDecimals as getAssetDecimals, index_getAssetId as getAssetId, index_getAssets as getAssets, index_getAssetsObject as getAssetsObject, index_getBalanceForeign as getBalanceForeign, index_getBalanceNative as getBalanceNative, index_getNativeAssetSymbol as getNativeAssetSymbol, index_getNativeAssets as getNativeAssets, index_getOtherAssets as getOtherAssets, index_getParaId as getParaId, index_getRelayChainSymbol as getRelayChainSymbol, index_getSupportedAssets as getSupportedAssets, index_getTNode as getTNode, index_getTransferInfo as getTransferInfo, index_hasSupportForAsset as hasSupportForAsset };
|
|
444
896
|
}
|
|
445
897
|
|
|
446
898
|
declare const getDefaultPallet: (node: TNodePolkadotKusama) => TPallet;
|
|
@@ -487,31 +939,53 @@ declare class OpenChannelBuilder implements MaxSizeOpenChannelBuilder, MaxMessag
|
|
|
487
939
|
buildSerializedApiCall(): TSerializedApiCall;
|
|
488
940
|
}
|
|
489
941
|
|
|
942
|
+
type TOptions = TSendOptions | TRelayToParaOptions;
|
|
943
|
+
type TTransaction = {
|
|
944
|
+
func: (options: TOptions) => Promise<Extrinsic>;
|
|
945
|
+
options: TOptions;
|
|
946
|
+
};
|
|
947
|
+
declare class BatchTransactionManager {
|
|
948
|
+
private transactions;
|
|
949
|
+
addTransaction(transaction: TTransaction): void;
|
|
950
|
+
isEmpty(): boolean;
|
|
951
|
+
buildBatch(api: ApiPromise | undefined, from: TNode | undefined, to: TDestination | undefined, options?: TBatchOptions): Promise<Extrinsic>;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
interface IAddToBatchBuilder {
|
|
955
|
+
addToBatch(): GeneralBuilder;
|
|
956
|
+
}
|
|
957
|
+
|
|
490
958
|
declare class ToGeneralBuilder {
|
|
959
|
+
private batchManager;
|
|
491
960
|
private readonly api?;
|
|
492
961
|
private readonly from;
|
|
493
962
|
private readonly to;
|
|
494
963
|
private readonly paraIdTo?;
|
|
495
|
-
constructor(api: ApiPromise | undefined, from: TNode, to: TDestination, paraIdTo?: number);
|
|
964
|
+
constructor(api: ApiPromise | undefined, from: TNode, to: TDestination, batchManager: BatchTransactionManager, paraIdTo?: number);
|
|
496
965
|
currency(currency: TCurrencyInput): AmountOrFeeAssetBuilder;
|
|
497
966
|
openChannel(): MaxSizeOpenChannelBuilder;
|
|
498
967
|
}
|
|
499
968
|
declare class FromGeneralBuilder {
|
|
969
|
+
private batchManager;
|
|
500
970
|
private readonly api?;
|
|
501
971
|
private readonly from;
|
|
502
972
|
private _feeAsset?;
|
|
503
|
-
constructor(api: ApiPromise | undefined, from: TNode);
|
|
973
|
+
constructor(api: ApiPromise | undefined, from: TNode, batchManager: BatchTransactionManager);
|
|
504
974
|
to(node: TDestination, paraIdTo?: number): ToGeneralBuilder;
|
|
505
975
|
feeAsset(feeAsset: TCurrency): AmountBuilder;
|
|
506
976
|
amount(amount: TAmount | null): AddressBuilder;
|
|
507
977
|
closeChannel(): InboundCloseChannelBuilder;
|
|
508
978
|
}
|
|
509
979
|
declare class GeneralBuilder {
|
|
980
|
+
private readonly batchManager;
|
|
510
981
|
private readonly api?;
|
|
511
|
-
|
|
982
|
+
private readonly _from?;
|
|
983
|
+
private readonly _to?;
|
|
984
|
+
constructor(batchManager: BatchTransactionManager, api?: ApiPromise | undefined, _from?: TNode | undefined, _to?: TDestination | undefined);
|
|
512
985
|
from(node: TNode): FromGeneralBuilder;
|
|
513
986
|
to(node: TDestination, paraIdTo?: number): AmountBuilder;
|
|
514
987
|
claimFrom(node: TNodeWithRelayChains): FungibleBuilder;
|
|
988
|
+
buildBatch(options?: TBatchOptions): Promise<Extrinsic>;
|
|
515
989
|
}
|
|
516
990
|
declare const Builder: (api?: ApiPromise) => GeneralBuilder;
|
|
517
991
|
interface FinalBuilder {
|
|
@@ -522,9 +996,9 @@ interface FinalBuilderAsync {
|
|
|
522
996
|
build: () => Promise<Extrinsic>;
|
|
523
997
|
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
524
998
|
}
|
|
525
|
-
interface UseKeepAliveFinalBuilder {
|
|
526
|
-
useKeepAlive: (destApi: ApiPromise) =>
|
|
527
|
-
xcmVersion: (version: Version) =>
|
|
999
|
+
interface UseKeepAliveFinalBuilder extends IAddToBatchBuilder {
|
|
1000
|
+
useKeepAlive: (destApi: ApiPromise) => this;
|
|
1001
|
+
xcmVersion: (version: Version) => this;
|
|
528
1002
|
build: () => Promise<Extrinsic>;
|
|
529
1003
|
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
530
1004
|
}
|
|
@@ -561,10 +1035,10 @@ declare class EvmBuilderClass {
|
|
|
561
1035
|
}
|
|
562
1036
|
declare const EvmBuilder: (provider: AbstractProvider) => EvmBuilderClass;
|
|
563
1037
|
|
|
564
|
-
declare const getNode: (node:
|
|
1038
|
+
declare const getNode: <T extends TNode>(node: T) => (typeof nodes)[T];
|
|
565
1039
|
declare const getNodeEndpointOption: (node: TNodePolkadotKusama) => _polkadot_apps_config_endpoints_types.EndpointOption | undefined;
|
|
566
1040
|
declare const getAllNodeProviders: (node: TNodePolkadotKusama) => string[];
|
|
567
|
-
declare const getNodeProvider: (node:
|
|
1041
|
+
declare const getNodeProvider: (node: TNodeWithRelayChains) => string;
|
|
568
1042
|
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<ApiPromise>;
|
|
569
1043
|
|
|
570
1044
|
declare class InvalidCurrencyError extends Error {
|
|
@@ -584,7 +1058,7 @@ declare class ScenarioNotSupportedError extends Error {
|
|
|
584
1058
|
}
|
|
585
1059
|
|
|
586
1060
|
declare class IncompatibleNodesError extends Error {
|
|
587
|
-
constructor();
|
|
1061
|
+
constructor(message?: string);
|
|
588
1062
|
}
|
|
589
1063
|
|
|
590
1064
|
declare class DuplicateAssetError extends Error {
|
|
@@ -593,4 +1067,4 @@ declare class DuplicateAssetError extends Error {
|
|
|
593
1067
|
|
|
594
1068
|
declare const getExistentialDeposit: (node: TNodeDotKsmWithRelayChains) => string | null;
|
|
595
1069
|
|
|
596
|
-
export { Builder, type CheckKeepAliveOptions, CloseChannelBuilder, DuplicateAssetError, EvmBuilder, type Extrinsic, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, type InboundCloseChannelBuilder, IncompatibleNodesError, InvalidCurrencyError, type JunctionType, type Junctions, type MaxMessageSizeOpenChannelBuilder, type MaxSizeOpenChannelBuilder, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, OpenChannelBuilder, type OutboundCloseChannelBuilder, Parents, type PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAssetDetails, type TAssetJsonMap, type TCloseChannelInternalOptions, type TCloseChannelOptions, type TCurrency, type TCurrencyCore, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySpecifier, type TDestination, type TEdJsonMap, type TJunction, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiLocation, type TMultiLocationHeader, type TNativeAssetDetails, type TNode, type TNodeAssets, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TOpenChannelInternalOptions, type TOpenChannelOptions, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaCommonOptions, type TRelayToParaInternalOptions, type TRelayToParaOptions, type TScenario, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSendOptionsCommon, type TSerializedApiCall, type TVersionClaimAssets, Version, type XTokensTransferInput, type XTransferTransferInput, index as assets, index$1 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, index$2 as openChannels, index$3 as xcmPallet };
|
|
1070
|
+
export { BatchMode, Builder, type CheckKeepAliveOptions, CloseChannelBuilder, DuplicateAssetError, EvmBuilder, type Extrinsic, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, type InboundCloseChannelBuilder, IncompatibleNodesError, InvalidCurrencyError, type JunctionType, type Junctions, type MaxMessageSizeOpenChannelBuilder, type MaxSizeOpenChannelBuilder, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, OpenChannelBuilder, type OutboundCloseChannelBuilder, Parents, type PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAsset, type TAssetDetails, type TAssetJsonMap, type TBatchOptions, type TCloseChannelInternalOptions, type TCloseChannelOptions, type TCurrency, type TCurrencyCore, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySpecifier, type TDestination, type TEdJsonMap, type TEvmBuilderOptions, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TJunction, type TMantaAsset, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiLocation, type TMultiLocationHeader, type TNativeAssetDetails, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOpenChannelInternalOptions, type TOpenChannelOptions, type TOptionalEvmBuilderOptions, type TOtherReserveAsset, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaCommonOptions, type TRelayToParaInternalOptions, type TRelayToParaOptions, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSendOptionsCommon, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TTransferReturn, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXcmAsset, type TZeitgeistAsset, Version, type XTokensTransferInput, type XTransferTransferInput, index as assets, buildEthTransferOptions, index$1 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, index$2 as openChannels, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index$3 as xcmPallet };
|