@paraspell/sdk 6.1.0 → 6.2.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 +2 -1
- package/dist/index.cjs +4780 -4185
- package/dist/index.d.ts +790 -320
- package/dist/index.mjs +4779 -4184
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,238 @@ import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
|
3
3
|
import { Signer, AbstractProvider } from 'ethers';
|
|
4
4
|
import * as _polkadot_apps_config_endpoints_types from '@polkadot/apps-config/endpoints/types';
|
|
5
5
|
|
|
6
|
+
declare abstract class ParachainNode<TApi extends TApiType = ApiPromise> {
|
|
7
|
+
private readonly _node;
|
|
8
|
+
private readonly _name;
|
|
9
|
+
private readonly _type;
|
|
10
|
+
private readonly _version;
|
|
11
|
+
protected _assetCheckEnabled: boolean;
|
|
12
|
+
constructor(node: TNode, name: string, type: TRelayChainType, version: Version);
|
|
13
|
+
get name(): string;
|
|
14
|
+
get type(): TRelayChainType;
|
|
15
|
+
get node(): TNode;
|
|
16
|
+
get version(): Version;
|
|
17
|
+
get assetCheckEnabled(): boolean;
|
|
18
|
+
protected canUseXTokens(_: TSendInternalOptions): boolean;
|
|
19
|
+
transfer(options: TSendInternalOptions): TTransferReturn;
|
|
20
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
21
|
+
getProvider(): string;
|
|
22
|
+
createApiInstance(): Promise<TApi>;
|
|
23
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
24
|
+
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination?: TDestination, paraId?: number): TMultiLocationHeader;
|
|
25
|
+
getNativeAssetSymbol(): string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class Acala extends ParachainNode implements IXTokensTransfer {
|
|
29
|
+
constructor();
|
|
30
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
31
|
+
getProvider(): string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class Unique extends ParachainNode implements IXTokensTransfer {
|
|
35
|
+
constructor();
|
|
36
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class Crust extends ParachainNode implements IXTokensTransfer {
|
|
40
|
+
constructor();
|
|
41
|
+
getCurrencySelection({ currency, currencyID }: XTokensTransferInput): TReserveAsset;
|
|
42
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class BifrostPolkadot extends ParachainNode implements IXTokensTransfer {
|
|
46
|
+
constructor();
|
|
47
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class Bitgreen extends ParachainNode {
|
|
51
|
+
constructor();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class Centrifuge extends ParachainNode implements IXTokensTransfer {
|
|
55
|
+
constructor();
|
|
56
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare class ComposableFinance extends ParachainNode implements IXTokensTransfer {
|
|
60
|
+
constructor();
|
|
61
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class Hydration extends ParachainNode implements IXTokensTransfer {
|
|
65
|
+
constructor();
|
|
66
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare class Interlay extends ParachainNode implements IXTokensTransfer {
|
|
70
|
+
constructor();
|
|
71
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class Litentry extends ParachainNode implements IXTokensTransfer {
|
|
75
|
+
constructor();
|
|
76
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare class Moonbeam extends ParachainNode implements IXTokensTransfer {
|
|
80
|
+
constructor();
|
|
81
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
82
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
83
|
+
getProvider(): string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare class Parallel extends ParachainNode implements IXTokensTransfer {
|
|
87
|
+
constructor();
|
|
88
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare class Altair extends ParachainNode implements IXTokensTransfer {
|
|
92
|
+
constructor();
|
|
93
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare class Amplitude extends ParachainNode implements IXTokensTransfer {
|
|
97
|
+
constructor();
|
|
98
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class Bajun extends ParachainNode implements IXTokensTransfer {
|
|
102
|
+
constructor();
|
|
103
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
104
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare class Basilisk extends ParachainNode implements IXTokensTransfer {
|
|
108
|
+
constructor();
|
|
109
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
110
|
+
getProvider(): string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare class BifrostKusama extends ParachainNode implements IXTokensTransfer {
|
|
114
|
+
constructor();
|
|
115
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class Pioneer extends ParachainNode implements IXTokensTransfer {
|
|
119
|
+
constructor();
|
|
120
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare class Turing extends ParachainNode implements IXTokensTransfer {
|
|
124
|
+
constructor();
|
|
125
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare class Picasso extends ParachainNode implements IXTokensTransfer {
|
|
129
|
+
constructor();
|
|
130
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
declare class ParallelHeiko extends ParachainNode implements IXTokensTransfer {
|
|
134
|
+
constructor();
|
|
135
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare class Moonriver extends ParachainNode implements IXTokensTransfer {
|
|
139
|
+
constructor();
|
|
140
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
141
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare class Litmus extends ParachainNode implements IXTokensTransfer {
|
|
145
|
+
constructor();
|
|
146
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
147
|
+
getProvider(): string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare class Kintsugi extends ParachainNode implements IXTokensTransfer {
|
|
151
|
+
constructor();
|
|
152
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare class Calamari extends ParachainNode implements IXTokensTransfer {
|
|
156
|
+
constructor();
|
|
157
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare class CrustShadow extends ParachainNode implements IXTokensTransfer {
|
|
161
|
+
constructor();
|
|
162
|
+
getCurrencySelection({ currency, currencyID }: XTokensTransferInput): TReserveAsset;
|
|
163
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare class Imbue extends ParachainNode implements IXTokensTransfer {
|
|
167
|
+
constructor();
|
|
168
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
declare class Integritee extends ParachainNode implements IXTokensTransfer {
|
|
172
|
+
constructor();
|
|
173
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
174
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare class InvArchTinker extends ParachainNode implements IXTokensTransfer {
|
|
178
|
+
constructor();
|
|
179
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare class Karura extends ParachainNode implements IXTokensTransfer {
|
|
183
|
+
constructor();
|
|
184
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
185
|
+
getProvider(): string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
declare class AssetHubPolkadot extends ParachainNode implements IPolkadotXCMTransfer {
|
|
189
|
+
constructor();
|
|
190
|
+
handleBridgeTransfer(input: PolkadotXCMTransferInput, targetChain: 'Polkadot' | 'Kusama'): TTransferReturn;
|
|
191
|
+
handleEthBridgeTransfer(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
192
|
+
handleMythosTransfer(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
193
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
194
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
195
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
declare class AssetHubKusama extends ParachainNode implements IPolkadotXCMTransfer {
|
|
199
|
+
constructor();
|
|
200
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
201
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
202
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare class CoretimeKusama extends ParachainNode implements IPolkadotXCMTransfer {
|
|
206
|
+
constructor();
|
|
207
|
+
_assetCheckEnabled: boolean;
|
|
208
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
209
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare class CoretimePolkadot extends ParachainNode implements IPolkadotXCMTransfer {
|
|
213
|
+
constructor();
|
|
214
|
+
_assetCheckEnabled: boolean;
|
|
215
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
216
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
217
|
+
getProvider(): string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
declare class Encointer extends ParachainNode implements IPolkadotXCMTransfer {
|
|
221
|
+
constructor();
|
|
222
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
223
|
+
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
declare class Robonomics extends ParachainNode implements IPolkadotXCMTransfer {
|
|
227
|
+
constructor();
|
|
228
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare class Astar extends ParachainNode implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
232
|
+
constructor();
|
|
233
|
+
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
234
|
+
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
235
|
+
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions): boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
6
238
|
type TMultiAsset = TMultiAssetV3 | TMultiAssetV4;
|
|
7
239
|
interface TMultiAssetV3 {
|
|
8
240
|
id: {
|
|
@@ -75,11 +307,20 @@ type TOtherReserveAsset = {
|
|
|
75
307
|
};
|
|
76
308
|
type TSelfReserveAsset = 'SelfReserve';
|
|
77
309
|
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
78
|
-
type TXTokensCurrencySelection = TCurrencySelectionHeader | TForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | string | undefined;
|
|
310
|
+
type TXTokensCurrencySelection = TCurrencySelectionHeader | TCurrencySelectionHeaderArr | TForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | string | undefined;
|
|
311
|
+
|
|
312
|
+
interface IPolkadotApi<TApi extends TApiType, TRes extends TResType> {
|
|
313
|
+
init(api: TApi): void;
|
|
314
|
+
createAccountId(address: string): HexString$1;
|
|
315
|
+
call(serializedCall: TSerializedApiCall): TRes;
|
|
316
|
+
}
|
|
79
317
|
|
|
318
|
+
type TApiType = ApiPromise;
|
|
319
|
+
type TResType = Extrinsic;
|
|
320
|
+
type HexString$1 = `0x${string}`;
|
|
80
321
|
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
81
|
-
type PolkadotXCMTransferInput = {
|
|
82
|
-
api:
|
|
322
|
+
type PolkadotXCMTransferInput<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = {
|
|
323
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
83
324
|
header: TMultiLocationHeader;
|
|
84
325
|
addressSelection: TMultiLocationHeader;
|
|
85
326
|
amount: string;
|
|
@@ -94,8 +335,8 @@ type PolkadotXCMTransferInput = {
|
|
|
94
335
|
overridedCurrency?: TMultiLocation | TMultiAsset[];
|
|
95
336
|
serializedApiCallEnabled?: boolean;
|
|
96
337
|
};
|
|
97
|
-
type XTokensTransferInput = {
|
|
98
|
-
api:
|
|
338
|
+
type XTokensTransferInput<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = {
|
|
339
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
99
340
|
currency: string | undefined;
|
|
100
341
|
currencyID: string | undefined;
|
|
101
342
|
amount: string;
|
|
@@ -109,8 +350,8 @@ type XTokensTransferInput = {
|
|
|
109
350
|
feeAsset?: TCurrency;
|
|
110
351
|
serializedApiCallEnabled?: boolean;
|
|
111
352
|
};
|
|
112
|
-
type XTransferTransferInput = {
|
|
113
|
-
api:
|
|
353
|
+
type XTransferTransferInput<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = {
|
|
354
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
114
355
|
currency: string | undefined;
|
|
115
356
|
currencyID: string | undefined;
|
|
116
357
|
amount: string;
|
|
@@ -121,22 +362,28 @@ type XTransferTransferInput = {
|
|
|
121
362
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
122
363
|
serializedApiCallEnabled?: boolean;
|
|
123
364
|
};
|
|
124
|
-
type IPolkadotXCMTransfer = {
|
|
125
|
-
transferPolkadotXCM: (input: PolkadotXCMTransferInput) => TTransferReturn;
|
|
365
|
+
type IPolkadotXCMTransfer<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = {
|
|
366
|
+
transferPolkadotXCM: (input: PolkadotXCMTransferInput<TApi, TRes>) => TTransferReturn;
|
|
126
367
|
};
|
|
127
|
-
type IXTokensTransfer = {
|
|
128
|
-
transferXTokens: (input: XTokensTransferInput) => TTransferReturn;
|
|
368
|
+
type IXTokensTransfer<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = {
|
|
369
|
+
transferXTokens: (input: XTokensTransferInput<TApi, TRes>) => TTransferReturn;
|
|
129
370
|
};
|
|
130
|
-
type IXTransferTransfer = {
|
|
131
|
-
transferXTransfer: (input: XTransferTransferInput) => TTransferReturn;
|
|
371
|
+
type IXTransferTransfer<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = {
|
|
372
|
+
transferXTransfer: (input: XTransferTransferInput<TApi, TRes>) => TTransferReturn;
|
|
132
373
|
};
|
|
133
374
|
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
375
|
+
/**
|
|
376
|
+
* The XCM version.
|
|
377
|
+
*/
|
|
134
378
|
declare enum Version {
|
|
135
379
|
V1 = "V1",
|
|
136
380
|
V2 = "V2",
|
|
137
381
|
V3 = "V3",
|
|
138
382
|
V4 = "V4"
|
|
139
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* The supported XCM versions for asset claims.
|
|
386
|
+
*/
|
|
140
387
|
type TVersionClaimAssets = Version.V3 | Version.V2;
|
|
141
388
|
declare enum Parents {
|
|
142
389
|
ZERO = 0,
|
|
@@ -146,47 +393,104 @@ declare enum Parents {
|
|
|
146
393
|
type TAmount = string | number | bigint;
|
|
147
394
|
type TAddress = string | TMultiLocation;
|
|
148
395
|
type TDestination = TNode | TMultiLocation;
|
|
149
|
-
type TSendBaseOptions = {
|
|
396
|
+
type TSendBaseOptions<TApi> = {
|
|
397
|
+
/**
|
|
398
|
+
* The destination address. A SS58 or H160 format.
|
|
399
|
+
*/
|
|
150
400
|
address: TAddress;
|
|
401
|
+
/**
|
|
402
|
+
* The destination node or multi-location
|
|
403
|
+
*/
|
|
151
404
|
destination?: TDestination;
|
|
405
|
+
/**
|
|
406
|
+
* The optional destination parachain ID
|
|
407
|
+
*/
|
|
152
408
|
paraIdTo?: number;
|
|
409
|
+
/**
|
|
410
|
+
* The optional overrided fee asset
|
|
411
|
+
*/
|
|
153
412
|
feeAsset?: TCurrency;
|
|
154
|
-
|
|
413
|
+
/**
|
|
414
|
+
* The optional destination API instance required for keep-alive
|
|
415
|
+
*/
|
|
416
|
+
destApiForKeepAlive?: TApi;
|
|
417
|
+
/**
|
|
418
|
+
* The optional overrided XCM version
|
|
419
|
+
*/
|
|
155
420
|
version?: Version;
|
|
156
421
|
};
|
|
157
|
-
|
|
158
|
-
|
|
422
|
+
/**
|
|
423
|
+
* Options for transferring from a parachain to another parachain or relay chain
|
|
424
|
+
*/
|
|
425
|
+
type TSendOptions<TApi extends TApiType = ApiPromise> = TSendBaseOptions<TApi> & {
|
|
426
|
+
/**
|
|
427
|
+
* The Polkadot API instance
|
|
428
|
+
*/
|
|
429
|
+
api?: TApi;
|
|
430
|
+
/**
|
|
431
|
+
* The origin node
|
|
432
|
+
*/
|
|
159
433
|
origin: TNode;
|
|
434
|
+
/**
|
|
435
|
+
* The currency to transfer. Either ID, symbol, multi-location, or multi-asset
|
|
436
|
+
*/
|
|
160
437
|
currency: TCurrencyInput;
|
|
438
|
+
/**
|
|
439
|
+
* The amount to transfer. Can be a number, string, or bigint
|
|
440
|
+
*/
|
|
161
441
|
amount: TAmount | null;
|
|
162
442
|
};
|
|
163
|
-
type TSendOptionsCommon = TSendOptions & {
|
|
443
|
+
type TSendOptionsCommon<TApi extends TApiType = ApiPromise> = TSendOptions<TApi> & {
|
|
164
444
|
serializedApiCallEnabled?: boolean;
|
|
165
445
|
};
|
|
166
|
-
type TSendInternalOptions = TSendBaseOptions & {
|
|
167
|
-
api:
|
|
446
|
+
type TSendInternalOptions<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = TSendBaseOptions<TApi> & {
|
|
447
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
168
448
|
currencySymbol: string | undefined;
|
|
169
449
|
currencyId: string | undefined;
|
|
170
450
|
amount: string;
|
|
171
451
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
172
452
|
serializedApiCallEnabled?: boolean;
|
|
173
453
|
};
|
|
174
|
-
type TRelayToParaBaseOptions = {
|
|
454
|
+
type TRelayToParaBaseOptions<TApi> = {
|
|
455
|
+
/**
|
|
456
|
+
* The destination node or multi-location
|
|
457
|
+
*/
|
|
175
458
|
destination: TDestination;
|
|
459
|
+
/**
|
|
460
|
+
* The destination address. A SS58 or H160 format.
|
|
461
|
+
*/
|
|
176
462
|
address: TAddress;
|
|
463
|
+
/**
|
|
464
|
+
* The optional destination parachain ID
|
|
465
|
+
*/
|
|
177
466
|
paraIdTo?: number;
|
|
178
|
-
|
|
467
|
+
/**
|
|
468
|
+
* The optional destination API instance required for keep-alive
|
|
469
|
+
*/
|
|
470
|
+
destApiForKeepAlive?: TApi;
|
|
471
|
+
/**
|
|
472
|
+
* The optional overrided XCM version
|
|
473
|
+
*/
|
|
179
474
|
version?: Version;
|
|
180
475
|
};
|
|
181
|
-
|
|
182
|
-
|
|
476
|
+
/**
|
|
477
|
+
* Options for transferring from a relay chain to a parachain
|
|
478
|
+
*/
|
|
479
|
+
type TRelayToParaOptions<TApi> = TRelayToParaBaseOptions<TApi> & {
|
|
480
|
+
/**
|
|
481
|
+
* The Polkadot API instance
|
|
482
|
+
*/
|
|
483
|
+
api?: TApi;
|
|
484
|
+
/**
|
|
485
|
+
* The amount to transfer
|
|
486
|
+
*/
|
|
183
487
|
amount: TAmount;
|
|
184
488
|
};
|
|
185
|
-
type TRelayToParaInternalOptions = TRelayToParaBaseOptions & {
|
|
186
|
-
api:
|
|
489
|
+
type TRelayToParaInternalOptions<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> = TRelayToParaBaseOptions<TApi> & {
|
|
490
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
187
491
|
amount: string;
|
|
188
492
|
};
|
|
189
|
-
type TRelayToParaCommonOptions = TRelayToParaOptions & {
|
|
493
|
+
type TRelayToParaCommonOptions<TApi> = TRelayToParaOptions<TApi> & {
|
|
190
494
|
serializedApiCallEnabled?: boolean;
|
|
191
495
|
};
|
|
192
496
|
type TTransferReturn = Extrinsic | TSerializedApiCall;
|
|
@@ -211,7 +515,7 @@ type TDestWeight = {
|
|
|
211
515
|
type XTransferModule = 'xTransfer';
|
|
212
516
|
type XTransferSection = 'transfer';
|
|
213
517
|
type XTokensModule = 'xTokens';
|
|
214
|
-
type XTokensSection = 'transfer' | 'transferMultiasset';
|
|
518
|
+
type XTokensSection = 'transfer' | 'transferMultiasset' | 'transferMultiassets';
|
|
215
519
|
type PolkadotXcmModule = 'polkadotXcm';
|
|
216
520
|
type PolkadotXcmSection = 'limitedTeleportAssets' | 'limitedReserveTransferAssets' | 'reserveTransferAssets' | 'reserveWithdrawAssets' | 'transferAssets';
|
|
217
521
|
|
|
@@ -220,9 +524,10 @@ type NetworkId = string | null;
|
|
|
220
524
|
type BodyId = string | null;
|
|
221
525
|
type BodyPart = string | null;
|
|
222
526
|
type StringOrNumber = string | number;
|
|
527
|
+
type StringOrNumberOrBigInt = StringOrNumber | bigint;
|
|
223
528
|
type HexString = string;
|
|
224
529
|
interface JunctionParachain {
|
|
225
|
-
Parachain:
|
|
530
|
+
Parachain: StringOrNumberOrBigInt | undefined;
|
|
226
531
|
}
|
|
227
532
|
interface JunctionAccountId32 {
|
|
228
533
|
AccountId32: {
|
|
@@ -233,7 +538,7 @@ interface JunctionAccountId32 {
|
|
|
233
538
|
interface JunctionAccountIndex64 {
|
|
234
539
|
AccountIndex64: {
|
|
235
540
|
network: NetworkId;
|
|
236
|
-
index:
|
|
541
|
+
index: StringOrNumberOrBigInt;
|
|
237
542
|
};
|
|
238
543
|
}
|
|
239
544
|
interface JunctionAccountKey20 {
|
|
@@ -243,14 +548,14 @@ interface JunctionAccountKey20 {
|
|
|
243
548
|
};
|
|
244
549
|
}
|
|
245
550
|
interface JunctionPalletInstance {
|
|
246
|
-
PalletInstance:
|
|
551
|
+
PalletInstance: StringOrNumberOrBigInt;
|
|
247
552
|
}
|
|
248
553
|
interface JunctionGeneralIndex {
|
|
249
|
-
GeneralIndex:
|
|
554
|
+
GeneralIndex: StringOrNumberOrBigInt;
|
|
250
555
|
}
|
|
251
556
|
interface JunctionGeneralKey {
|
|
252
557
|
GeneralKey: {
|
|
253
|
-
length:
|
|
558
|
+
length: StringOrNumberOrBigInt;
|
|
254
559
|
data: HexString;
|
|
255
560
|
};
|
|
256
561
|
}
|
|
@@ -309,238 +614,6 @@ type TMultiLocationHeader = {
|
|
|
309
614
|
[key in Version]?: TMultiLocation;
|
|
310
615
|
};
|
|
311
616
|
|
|
312
|
-
declare abstract class ParachainNode {
|
|
313
|
-
private readonly _node;
|
|
314
|
-
private readonly _name;
|
|
315
|
-
private readonly _type;
|
|
316
|
-
private readonly _version;
|
|
317
|
-
protected _assetCheckEnabled: boolean;
|
|
318
|
-
constructor(node: TNode, name: string, type: TRelayChainType, version: Version);
|
|
319
|
-
get name(): string;
|
|
320
|
-
get type(): TRelayChainType;
|
|
321
|
-
get node(): TNode;
|
|
322
|
-
get version(): Version;
|
|
323
|
-
get assetCheckEnabled(): boolean;
|
|
324
|
-
protected canUseXTokens(_: TSendInternalOptions): boolean;
|
|
325
|
-
transfer(options: TSendInternalOptions): TTransferReturn;
|
|
326
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
327
|
-
getProvider(): string;
|
|
328
|
-
createApiInstance(): Promise<ApiPromise>;
|
|
329
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
330
|
-
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination?: TDestination, paraId?: number): TMultiLocationHeader;
|
|
331
|
-
getNativeAssetSymbol(): string;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
declare class Acala extends ParachainNode implements IXTokensTransfer {
|
|
335
|
-
constructor();
|
|
336
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
337
|
-
getProvider(): string;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
declare class Unique extends ParachainNode implements IXTokensTransfer {
|
|
341
|
-
constructor();
|
|
342
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
declare class Crust extends ParachainNode implements IXTokensTransfer {
|
|
346
|
-
constructor();
|
|
347
|
-
getCurrencySelection({ currency, currencyID }: XTokensTransferInput): TReserveAsset;
|
|
348
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
declare class BifrostPolkadot extends ParachainNode implements IXTokensTransfer {
|
|
352
|
-
constructor();
|
|
353
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
declare class Bitgreen extends ParachainNode {
|
|
357
|
-
constructor();
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
declare class Centrifuge extends ParachainNode implements IXTokensTransfer {
|
|
361
|
-
constructor();
|
|
362
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
declare class ComposableFinance extends ParachainNode implements IXTokensTransfer {
|
|
366
|
-
constructor();
|
|
367
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
declare class Hydration extends ParachainNode implements IXTokensTransfer {
|
|
371
|
-
constructor();
|
|
372
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
declare class Interlay extends ParachainNode implements IXTokensTransfer {
|
|
376
|
-
constructor();
|
|
377
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
declare class Litentry extends ParachainNode implements IXTokensTransfer {
|
|
381
|
-
constructor();
|
|
382
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
declare class Moonbeam extends ParachainNode implements IXTokensTransfer {
|
|
386
|
-
constructor();
|
|
387
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
388
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
389
|
-
getProvider(): string;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
declare class Parallel extends ParachainNode implements IXTokensTransfer {
|
|
393
|
-
constructor();
|
|
394
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
declare class Altair extends ParachainNode implements IXTokensTransfer {
|
|
398
|
-
constructor();
|
|
399
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
declare class Amplitude extends ParachainNode implements IXTokensTransfer {
|
|
403
|
-
constructor();
|
|
404
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
declare class Bajun extends ParachainNode implements IXTokensTransfer {
|
|
408
|
-
constructor();
|
|
409
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
410
|
-
transferRelayToPara(): TSerializedApiCall;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
declare class Basilisk extends ParachainNode implements IXTokensTransfer {
|
|
414
|
-
constructor();
|
|
415
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
416
|
-
getProvider(): string;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
declare class BifrostKusama extends ParachainNode implements IXTokensTransfer {
|
|
420
|
-
constructor();
|
|
421
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
declare class Pioneer extends ParachainNode implements IXTokensTransfer {
|
|
425
|
-
constructor();
|
|
426
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
declare class Turing extends ParachainNode implements IXTokensTransfer {
|
|
430
|
-
constructor();
|
|
431
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
declare class Picasso extends ParachainNode implements IXTokensTransfer {
|
|
435
|
-
constructor();
|
|
436
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
declare class ParallelHeiko extends ParachainNode implements IXTokensTransfer {
|
|
440
|
-
constructor();
|
|
441
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
declare class Moonriver extends ParachainNode implements IXTokensTransfer {
|
|
445
|
-
constructor();
|
|
446
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
447
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
declare class Litmus extends ParachainNode implements IXTokensTransfer {
|
|
451
|
-
constructor();
|
|
452
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
453
|
-
getProvider(): string;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
declare class Kintsugi extends ParachainNode implements IXTokensTransfer {
|
|
457
|
-
constructor();
|
|
458
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
declare class Calamari extends ParachainNode implements IXTokensTransfer {
|
|
462
|
-
constructor();
|
|
463
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
declare class CrustShadow extends ParachainNode implements IXTokensTransfer {
|
|
467
|
-
constructor();
|
|
468
|
-
getCurrencySelection({ currency, currencyID }: XTokensTransferInput): TReserveAsset;
|
|
469
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
declare class Imbue extends ParachainNode implements IXTokensTransfer {
|
|
473
|
-
constructor();
|
|
474
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
declare class Integritee extends ParachainNode implements IXTokensTransfer {
|
|
478
|
-
constructor();
|
|
479
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
480
|
-
transferRelayToPara(): TSerializedApiCall;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
declare class InvArchTinker extends ParachainNode implements IXTokensTransfer {
|
|
484
|
-
constructor();
|
|
485
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
declare class Karura extends ParachainNode implements IXTokensTransfer {
|
|
489
|
-
constructor();
|
|
490
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
491
|
-
getProvider(): string;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
declare class AssetHubPolkadot extends ParachainNode implements IPolkadotXCMTransfer {
|
|
495
|
-
constructor();
|
|
496
|
-
handleBridgeTransfer(input: PolkadotXCMTransferInput, targetChain: 'Polkadot' | 'Kusama'): TTransferReturn;
|
|
497
|
-
handleEthBridgeTransfer(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
498
|
-
handleMythosTransfer(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
499
|
-
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
500
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
501
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
declare class AssetHubKusama extends ParachainNode implements IPolkadotXCMTransfer {
|
|
505
|
-
constructor();
|
|
506
|
-
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
507
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
508
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
declare class CoretimeKusama extends ParachainNode implements IPolkadotXCMTransfer {
|
|
512
|
-
constructor();
|
|
513
|
-
_assetCheckEnabled: boolean;
|
|
514
|
-
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
515
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
declare class CoretimePolkadot extends ParachainNode implements IPolkadotXCMTransfer {
|
|
519
|
-
constructor();
|
|
520
|
-
_assetCheckEnabled: boolean;
|
|
521
|
-
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
522
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
523
|
-
getProvider(): string;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
declare class Encointer extends ParachainNode implements IPolkadotXCMTransfer {
|
|
527
|
-
constructor();
|
|
528
|
-
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
529
|
-
transferRelayToPara(options: TRelayToParaInternalOptions): TSerializedApiCall;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
declare class Robonomics extends ParachainNode implements IPolkadotXCMTransfer {
|
|
533
|
-
constructor();
|
|
534
|
-
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
declare class Astar extends ParachainNode implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
538
|
-
constructor();
|
|
539
|
-
transferPolkadotXCM(input: PolkadotXCMTransferInput): TTransferReturn;
|
|
540
|
-
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
541
|
-
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions): boolean;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
617
|
declare class Darwinia extends ParachainNode implements IXTokensTransfer {
|
|
545
618
|
constructor();
|
|
546
619
|
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
@@ -669,9 +742,21 @@ declare class Polimec extends ParachainNode {
|
|
|
669
742
|
constructor();
|
|
670
743
|
}
|
|
671
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Supported nodes excluding relay chains and Ethereum.
|
|
747
|
+
*/
|
|
672
748
|
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", "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", "Polimec"];
|
|
749
|
+
/**
|
|
750
|
+
* Supported nodes including Ethereum.
|
|
751
|
+
*/
|
|
673
752
|
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", "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", "Polimec", "Ethereum"];
|
|
753
|
+
/**
|
|
754
|
+
* Supported nodes including relay chains and Ethereum.
|
|
755
|
+
*/
|
|
674
756
|
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", "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", "Polimec", "Ethereum", "Polkadot", "Kusama"];
|
|
757
|
+
/**
|
|
758
|
+
* Supported nodes including relay chains and excluding Ethereum.
|
|
759
|
+
*/
|
|
675
760
|
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", "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", "Polimec", "Polkadot", "Kusama"];
|
|
676
761
|
declare const nodes: {
|
|
677
762
|
AssetHubPolkadot: AssetHubPolkadot;
|
|
@@ -734,6 +819,9 @@ declare const nodes: {
|
|
|
734
819
|
Peaq: Peaq;
|
|
735
820
|
Polimec: Polimec;
|
|
736
821
|
};
|
|
822
|
+
/**
|
|
823
|
+
* Supported XCM pallets.
|
|
824
|
+
*/
|
|
737
825
|
declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm", "XTransfer"];
|
|
738
826
|
|
|
739
827
|
type TNode = (typeof NODE_NAMES)[number];
|
|
@@ -774,11 +862,29 @@ type TPalletJsonMap = Record<TNodePolkadotKusama, TPalletMap>;
|
|
|
774
862
|
|
|
775
863
|
type TEdJsonMap = Record<TNodeDotKsmWithRelayChains, string | null>;
|
|
776
864
|
|
|
865
|
+
/**
|
|
866
|
+
* The options for the Ethereum to Polkadot transfer builder.
|
|
867
|
+
*/
|
|
777
868
|
type TEvmBuilderOptions = {
|
|
869
|
+
/**
|
|
870
|
+
* The destination node on Polkadot network.
|
|
871
|
+
*/
|
|
778
872
|
to: TNodePolkadotKusama;
|
|
873
|
+
/**
|
|
874
|
+
* The amount to transfer.
|
|
875
|
+
*/
|
|
779
876
|
amount: string;
|
|
877
|
+
/**
|
|
878
|
+
* The currency to transfer. Symbol or ID.
|
|
879
|
+
*/
|
|
780
880
|
currency: TCurrencyCore;
|
|
881
|
+
/**
|
|
882
|
+
* The Polkadot destination address.
|
|
883
|
+
*/
|
|
781
884
|
address: string;
|
|
885
|
+
/**
|
|
886
|
+
* The Ethereum signer.
|
|
887
|
+
*/
|
|
782
888
|
signer: Signer;
|
|
783
889
|
};
|
|
784
890
|
type TSerializeEthTransferOptions = Omit<TEvmBuilderOptions, 'signer'> & {
|
|
@@ -795,11 +901,28 @@ type OptionalProperties<T> = {
|
|
|
795
901
|
[P in keyof T]?: T[P] | undefined;
|
|
796
902
|
};
|
|
797
903
|
type TOptionalEvmBuilderOptions = OptionalProperties<TEvmBuilderOptions>;
|
|
904
|
+
/**
|
|
905
|
+
* The options for the batch builder.
|
|
906
|
+
*/
|
|
798
907
|
declare enum BatchMode {
|
|
908
|
+
/**
|
|
909
|
+
* Does not commit if one of the calls in the batch fails.
|
|
910
|
+
*/
|
|
799
911
|
BATCH_ALL = "BATCH_ALL",
|
|
912
|
+
/**
|
|
913
|
+
* Commits each successful call regardless if a call fails.
|
|
914
|
+
*/
|
|
800
915
|
BATCH = "BATCH"
|
|
801
916
|
}
|
|
917
|
+
/**
|
|
918
|
+
* The options for the batch builder.
|
|
919
|
+
*/
|
|
802
920
|
type TBatchOptions = {
|
|
921
|
+
/**
|
|
922
|
+
* The batch mode. Can be either:
|
|
923
|
+
* `BATCH_ALL` - does not commit if one of the calls in the batch fails.
|
|
924
|
+
* `BATCH` - commits each successful call regardless if a call fails.
|
|
925
|
+
*/
|
|
803
926
|
mode: BatchMode;
|
|
804
927
|
};
|
|
805
928
|
|
|
@@ -831,12 +954,28 @@ interface TTransferInfo {
|
|
|
831
954
|
existentialDeposit: bigint;
|
|
832
955
|
};
|
|
833
956
|
}
|
|
957
|
+
type TOriginFeeDetails = {
|
|
958
|
+
sufficientForXCM: boolean;
|
|
959
|
+
xcmFee: bigint;
|
|
960
|
+
};
|
|
834
961
|
|
|
835
|
-
declare const sendSerializedApiCall: (options: TSendOptions) => Promise<TSerializedApiCall>;
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
962
|
+
declare const sendSerializedApiCall: <TApi extends TApiType = ApiPromise>(options: TSendOptions<TApi>) => Promise<TSerializedApiCall>;
|
|
963
|
+
/**
|
|
964
|
+
* Transfers assets from parachain to another parachain or relay chain.
|
|
965
|
+
* @param options - The transfer options.
|
|
966
|
+
* @returns An extrinsic to be signed and sent.
|
|
967
|
+
*/
|
|
968
|
+
declare const send: <TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic>(options: TSendOptions<TApi>) => Promise<TRes>;
|
|
969
|
+
declare const transferRelayToParaCommon: <TApi extends TApiType>(options: TRelayToParaCommonOptions<TApi>) => Promise<TTransferReturn>;
|
|
970
|
+
/**
|
|
971
|
+
* Transfers assets from relay chain to parachain.
|
|
972
|
+
*
|
|
973
|
+
* @param options - The transfer options.
|
|
974
|
+
*
|
|
975
|
+
* @returns An extrinsic to be signed and sent.
|
|
976
|
+
*/
|
|
977
|
+
declare const transferRelayToPara: <TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic>(options: TRelayToParaOptions<TApi>) => Promise<TRes>;
|
|
978
|
+
declare const transferRelayToParaSerializedApiCall: <TApi extends TApiType = ApiPromise>(options: TRelayToParaOptions<TApi>) => Promise<TSerializedApiCall>;
|
|
840
979
|
|
|
841
980
|
declare const buildEthTransferOptions: ({ currency, to, address, destAddress, amount }: TSerializeEthTransferOptions) => Promise<TSerializedEthTransfer>;
|
|
842
981
|
|
|
@@ -850,28 +989,146 @@ declare namespace index$1 {
|
|
|
850
989
|
export { index$1_buildEthTransferOptions as buildEthTransferOptions, index$1_send as send, index$1_sendSerializedApiCall as sendSerializedApiCall, index$1_transferRelayToPara as transferRelayToPara, index$1_transferRelayToParaCommon as transferRelayToParaCommon, index$1_transferRelayToParaSerializedApiCall as transferRelayToParaSerializedApiCall };
|
|
851
990
|
}
|
|
852
991
|
|
|
992
|
+
/**
|
|
993
|
+
* Retrieves the assets object for a given node containing the native and foreign assets.
|
|
994
|
+
*
|
|
995
|
+
* @param node - The node for which to retrieve the assets object.
|
|
996
|
+
* @returns The assets object associated with the given node.
|
|
997
|
+
*/
|
|
853
998
|
declare const getAssetsObject: (node: TNodeWithRelayChains) => TNodeAssets;
|
|
999
|
+
/**
|
|
1000
|
+
* Retrieves the asset ID for a given symbol on a specified node.
|
|
1001
|
+
*
|
|
1002
|
+
* @param node - The node to search for the asset.
|
|
1003
|
+
* @param symbol - The symbol of the asset.
|
|
1004
|
+
* @returns The asset ID if found; otherwise, null.
|
|
1005
|
+
*/
|
|
854
1006
|
declare const getAssetId: (node: TNode, symbol: string) => string | null;
|
|
1007
|
+
/**
|
|
1008
|
+
* Retrieves the relay chain asset symbol for a specified node.
|
|
1009
|
+
*
|
|
1010
|
+
* @param node - The node for which to get the relay chain symbol.
|
|
1011
|
+
* @returns The relay chain asset symbol.
|
|
1012
|
+
*/
|
|
855
1013
|
declare const getRelayChainSymbol: (node: TNodeWithRelayChains) => TRelayChainSymbol;
|
|
1014
|
+
/**
|
|
1015
|
+
* Retrieves the list of native assets for a specified node.
|
|
1016
|
+
*
|
|
1017
|
+
* @param node - The node for which to get native assets.
|
|
1018
|
+
* @returns An array of native asset details.
|
|
1019
|
+
*/
|
|
856
1020
|
declare const getNativeAssets: (node: TNode) => TNativeAssetDetails[];
|
|
1021
|
+
/**
|
|
1022
|
+
* Retrieves the list of other (non-native) assets for a specified node.
|
|
1023
|
+
*
|
|
1024
|
+
* @param node - The node for which to get other assets.
|
|
1025
|
+
* @returns An array of other asset details.
|
|
1026
|
+
*/
|
|
857
1027
|
declare const getOtherAssets: (node: TNode) => TAssetDetails[];
|
|
1028
|
+
/**
|
|
1029
|
+
* Retrieves the complete list of assets for a specified node, including relay chain asset, native, and other assets.
|
|
1030
|
+
*
|
|
1031
|
+
* @param node - The node for which to get the assets.
|
|
1032
|
+
* @returns An array of objects of all assets associated with the node.
|
|
1033
|
+
*/
|
|
858
1034
|
declare const getAssets: (node: TNodeWithRelayChains) => TAsset[];
|
|
1035
|
+
/**
|
|
1036
|
+
* Retrieves the symbols of all assets (relay chain, native, and other assets) for a specified node.
|
|
1037
|
+
*
|
|
1038
|
+
* @param node - The node for which to get asset symbols.
|
|
1039
|
+
* @returns An array of asset symbols.
|
|
1040
|
+
*/
|
|
859
1041
|
declare const getAllAssetsSymbols: (node: TNodeWithRelayChains) => string[];
|
|
1042
|
+
/**
|
|
1043
|
+
* Retrieves the symbol of the native asset for a specified node.
|
|
1044
|
+
*
|
|
1045
|
+
* @param node - The node for which to get the native asset symbol.
|
|
1046
|
+
* @returns The symbol of the native asset.
|
|
1047
|
+
*/
|
|
860
1048
|
declare const getNativeAssetSymbol: (node: TNodeWithRelayChains) => string;
|
|
1049
|
+
/**
|
|
1050
|
+
* Determines whether a specified node supports an asset with the given symbol.
|
|
1051
|
+
*
|
|
1052
|
+
* @param node - The node to check for asset support.
|
|
1053
|
+
* @param symbol - The symbol of the asset to check.
|
|
1054
|
+
* @returns True if the asset is supported; otherwise, false.
|
|
1055
|
+
*/
|
|
861
1056
|
declare const hasSupportForAsset: (node: TNode, symbol: string) => boolean;
|
|
862
|
-
|
|
1057
|
+
/**
|
|
1058
|
+
* Retrieves the number of decimals for an asset with the given symbol on a specified node.
|
|
1059
|
+
*
|
|
1060
|
+
* @param node - The node where the asset is located.
|
|
1061
|
+
* @param symbol - The symbol of the asset.
|
|
1062
|
+
* @returns The number of decimals if the asset is found; otherwise, null.
|
|
1063
|
+
*/
|
|
863
1064
|
declare const getAssetDecimals: (node: TNodeWithRelayChains, symbol: string) => number | null;
|
|
1065
|
+
/**
|
|
1066
|
+
* Retrieves the parachain ID for a specified node.
|
|
1067
|
+
*
|
|
1068
|
+
* @param node - The node for which to get the paraId.
|
|
1069
|
+
* @returns The parachain ID of the node.
|
|
1070
|
+
*/
|
|
864
1071
|
declare const getParaId: (node: TNode) => number;
|
|
1072
|
+
/**
|
|
1073
|
+
* Retrieves the node name corresponding to a specified parachain ID.
|
|
1074
|
+
*
|
|
1075
|
+
* @param paraId - The parachain ID.
|
|
1076
|
+
* @returns The node name if found; otherwise, null.
|
|
1077
|
+
*/
|
|
865
1078
|
declare const getTNode: (paraId: number) => TNode | null;
|
|
866
1079
|
|
|
1080
|
+
/**
|
|
1081
|
+
* Retrieves the existential deposit value for a given node.
|
|
1082
|
+
*
|
|
1083
|
+
* @param node - The node for which to get the existential deposit.
|
|
1084
|
+
* @returns The existential deposit as a string if available; otherwise, null.
|
|
1085
|
+
*/
|
|
867
1086
|
declare const getExistentialDeposit: (node: TNodeDotKsmWithRelayChains) => string | null;
|
|
868
1087
|
|
|
1088
|
+
/**
|
|
1089
|
+
* Retrieves the native balance for a given account on a specified node.
|
|
1090
|
+
*
|
|
1091
|
+
* @param address - The address of the account.
|
|
1092
|
+
* @param node - The node on which to query the balance.
|
|
1093
|
+
* @param api - Optional API instance; if not provided, one will be created.
|
|
1094
|
+
* @returns The native balance as a bigint.
|
|
1095
|
+
*/
|
|
869
1096
|
declare const getBalanceNative: (address: string, node: TNodeWithRelayChains, api?: ApiPromise) => Promise<bigint>;
|
|
870
1097
|
|
|
1098
|
+
/**
|
|
1099
|
+
* Retrieves the balance of a foreign asset for a given account on a specified node.
|
|
1100
|
+
*
|
|
1101
|
+
* @param address - The address of the account.
|
|
1102
|
+
* @param node - The node on which to query the balance.
|
|
1103
|
+
* @param symbolOrId - The symbol or ID of the currency to query.
|
|
1104
|
+
* @param api - Optional API instance; if not provided, one will be created.
|
|
1105
|
+
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
1106
|
+
* @throws Error if the pallet is unsupported.
|
|
1107
|
+
*/
|
|
871
1108
|
declare const getBalanceForeign: (address: string, node: TNodePolkadotKusama, symbolOrId: TCurrencyCore, api?: ApiPromise) => Promise<bigint | null>;
|
|
872
1109
|
|
|
1110
|
+
/**
|
|
1111
|
+
* Retrieves detailed transfer information for a cross-chain transfer.
|
|
1112
|
+
*
|
|
1113
|
+
* @param origin - The origin node of the transfer.
|
|
1114
|
+
* @param destination - The destination node of the transfer.
|
|
1115
|
+
* @param accountOrigin - The account address on the origin node.
|
|
1116
|
+
* @param accountDestination - The account address on the destination node.
|
|
1117
|
+
* @param currency - The currency to be transferred.
|
|
1118
|
+
* @param amount - The amount to be transferred.
|
|
1119
|
+
* @returns A Promise that resolves to the transfer information.
|
|
1120
|
+
*/
|
|
873
1121
|
declare const getTransferInfo: (origin: TNodeDotKsmWithRelayChains, destination: TNodeDotKsmWithRelayChains, accountOrigin: string, accountDestination: string, currency: TCurrencyCore, amount: string) => Promise<TTransferInfo>;
|
|
874
1122
|
|
|
1123
|
+
/**
|
|
1124
|
+
* Retrieves the list of assets that are supported for transfers between two specified nodes.
|
|
1125
|
+
*
|
|
1126
|
+
* @param origin - The origin node.
|
|
1127
|
+
* @param destination - The destination node.
|
|
1128
|
+
* @returns An array of assets supported between the origin and destination nodes.
|
|
1129
|
+
*/
|
|
1130
|
+
declare const getSupportedAssets: (origin: TNodeWithRelayChains, destination: TNodeWithRelayChains) => TAsset[];
|
|
1131
|
+
|
|
875
1132
|
declare const index_getAllAssetsSymbols: typeof getAllAssetsSymbols;
|
|
876
1133
|
declare const index_getAssetDecimals: typeof getAssetDecimals;
|
|
877
1134
|
declare const index_getAssetId: typeof getAssetId;
|
|
@@ -893,129 +1150,342 @@ declare namespace index {
|
|
|
893
1150
|
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_getExistentialDeposit as getExistentialDeposit, 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 };
|
|
894
1151
|
}
|
|
895
1152
|
|
|
1153
|
+
/**
|
|
1154
|
+
* Retrieves the default pallet for a specified node.
|
|
1155
|
+
*
|
|
1156
|
+
* @param node - The node for which to get the default pallet.
|
|
1157
|
+
* @returns The default pallet associated with the node.
|
|
1158
|
+
*/
|
|
896
1159
|
declare const getDefaultPallet: (node: TNodePolkadotKusama) => TPallet;
|
|
1160
|
+
/**
|
|
1161
|
+
* Retrieves the list of supported pallets for a specified node.
|
|
1162
|
+
*
|
|
1163
|
+
* @param node - The node for which to get supported pallets.
|
|
1164
|
+
* @returns An array of pallets supported by the node.
|
|
1165
|
+
*/
|
|
897
1166
|
declare const getSupportedPallets: (node: TNodePolkadotKusama) => TPallet[];
|
|
898
1167
|
|
|
899
|
-
type TOptions = TSendOptions | TRelayToParaOptions
|
|
900
|
-
type TTransaction = {
|
|
901
|
-
func: (options: TOptions) => Promise<
|
|
902
|
-
options: TOptions
|
|
1168
|
+
type TOptions<TApi extends TApiType> = TSendOptions<TApi> | TRelayToParaOptions<TApi>;
|
|
1169
|
+
type TTransaction<TApi extends TApiType, TRes extends TResType> = {
|
|
1170
|
+
func: (options: TOptions<TApi>) => Promise<TRes>;
|
|
1171
|
+
options: TOptions<TApi>;
|
|
903
1172
|
};
|
|
904
|
-
declare class BatchTransactionManager {
|
|
1173
|
+
declare class BatchTransactionManager<TApi extends TApiType, TRes extends TResType> {
|
|
905
1174
|
private transactions;
|
|
906
|
-
addTransaction(transaction: TTransaction): void;
|
|
1175
|
+
addTransaction(transaction: TTransaction<TApi, TRes>): void;
|
|
907
1176
|
isEmpty(): boolean;
|
|
908
|
-
buildBatch(api:
|
|
1177
|
+
buildBatch(api: TApi | undefined, from: TNode | undefined, to: TDestination | undefined, options?: TBatchOptions): Promise<TRes>;
|
|
909
1178
|
}
|
|
910
1179
|
|
|
911
|
-
interface IAddToBatchBuilder {
|
|
912
|
-
addToBatch(): GeneralBuilder
|
|
1180
|
+
interface IAddToBatchBuilder<TApi extends TApiType> {
|
|
1181
|
+
addToBatch(): GeneralBuilder<TApi>;
|
|
913
1182
|
}
|
|
914
1183
|
|
|
915
|
-
|
|
1184
|
+
/**
|
|
1185
|
+
* A builder class for constructing a Para-to-Para and Para-to-Relay transactions.
|
|
1186
|
+
*/
|
|
1187
|
+
declare class ToGeneralBuilder<TApi extends TApiType, TRes extends TResType> {
|
|
916
1188
|
private batchManager;
|
|
917
1189
|
private readonly api?;
|
|
918
1190
|
private readonly from;
|
|
919
1191
|
private readonly to;
|
|
920
1192
|
private readonly paraIdTo?;
|
|
921
|
-
constructor(api:
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1193
|
+
constructor(api: TApi | undefined, from: TNode, to: TDestination, batchManager: BatchTransactionManager<TApi, TRes>, paraIdTo?: number);
|
|
1194
|
+
/**
|
|
1195
|
+
* Specifies the currency to be used in the transaction. Symbol, ID, multi-location or multi-asset.
|
|
1196
|
+
*
|
|
1197
|
+
* @param currency - The currency to be transferred.
|
|
1198
|
+
* @returns An instance of Builder
|
|
1199
|
+
*/
|
|
1200
|
+
currency(currency: TCurrencyInput): AmountOrFeeAssetBuilder<TApi>;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* A builder class for constructing a Para-to-Para and Para-to-Relay transactions.
|
|
1204
|
+
*/
|
|
1205
|
+
declare class FromGeneralBuilder<TApi extends TApiType, TRes extends TResType> {
|
|
925
1206
|
private batchManager;
|
|
926
1207
|
private readonly api?;
|
|
927
1208
|
private readonly from;
|
|
928
1209
|
private _feeAsset?;
|
|
929
|
-
constructor(api:
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1210
|
+
constructor(api: TApi | undefined, from: TNode, batchManager: BatchTransactionManager<TApi, TRes>);
|
|
1211
|
+
/**
|
|
1212
|
+
* Specifies the destination node for the transaction.
|
|
1213
|
+
*
|
|
1214
|
+
* @param node - The destination node.
|
|
1215
|
+
* @param paraIdTo - Optional parachain ID of the destination node.
|
|
1216
|
+
* @returns An instance of Builder
|
|
1217
|
+
*/
|
|
1218
|
+
to(node: TDestination, paraIdTo?: number): ToGeneralBuilder<TApi, TRes>;
|
|
1219
|
+
/**
|
|
1220
|
+
* Specifies the fee asset to be used for the transaction.
|
|
1221
|
+
*
|
|
1222
|
+
* @param feeAsset - The currency to be used as the fee asset.
|
|
1223
|
+
* @returns An instance of Builder
|
|
1224
|
+
*/
|
|
1225
|
+
feeAsset(feeAsset: TCurrency): AmountBuilder<TApi>;
|
|
1226
|
+
/**
|
|
1227
|
+
* Specifies the amount for the transaction.
|
|
1228
|
+
*
|
|
1229
|
+
* @param amount - The amount to be transferred.
|
|
1230
|
+
* @returns An instance of Builder
|
|
1231
|
+
*/
|
|
1232
|
+
amount(amount: TAmount | null): AddressBuilder<TApi>;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
1236
|
+
*/
|
|
1237
|
+
declare class GeneralBuilder<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> {
|
|
935
1238
|
private readonly batchManager;
|
|
936
1239
|
private readonly api?;
|
|
937
1240
|
private readonly _from?;
|
|
938
1241
|
private readonly _to?;
|
|
939
|
-
constructor(batchManager: BatchTransactionManager, api?:
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1242
|
+
constructor(batchManager: BatchTransactionManager<TApi, TRes>, api?: TApi | undefined, _from?: TNode | undefined, _to?: TDestination | undefined);
|
|
1243
|
+
/**
|
|
1244
|
+
* Specifies the origin node for the transaction.
|
|
1245
|
+
*
|
|
1246
|
+
* @param node - The node from which the transaction originates.
|
|
1247
|
+
* @returns An instance of Builder
|
|
1248
|
+
*/
|
|
1249
|
+
from(node: TNode): FromGeneralBuilder<TApi, TRes>;
|
|
1250
|
+
/**
|
|
1251
|
+
* Specifies the destination node for the transaction.
|
|
1252
|
+
*
|
|
1253
|
+
* @param node - The node to which the transaction is sent.
|
|
1254
|
+
* @param paraIdTo - (Optional) The parachain ID of the destination node.
|
|
1255
|
+
* @returns An instance of Builder
|
|
1256
|
+
*/
|
|
1257
|
+
to(node: TDestination, paraIdTo?: number): AmountBuilder<TApi>;
|
|
1258
|
+
/**
|
|
1259
|
+
* Initiates the process to claim assets from a specified node.
|
|
1260
|
+
*
|
|
1261
|
+
* @param node - The node from which to claim assets.
|
|
1262
|
+
* @returns An instance of Builder
|
|
1263
|
+
*/
|
|
1264
|
+
claimFrom(node: TNodeWithRelayChains): FungibleBuilder<TRes>;
|
|
1265
|
+
/**
|
|
1266
|
+
* Builds and returns the batched transaction based on the configured parameters.
|
|
1267
|
+
*
|
|
1268
|
+
* @param options - (Optional) Options to customize the batch transaction.
|
|
1269
|
+
* @returns A Extrinsic representing the batched transactions.
|
|
1270
|
+
*/
|
|
1271
|
+
buildBatch(options?: TBatchOptions): Promise<TRes>;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Creates a new Builder instance.
|
|
1275
|
+
*
|
|
1276
|
+
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
1277
|
+
* @returns A new Builder instance.
|
|
1278
|
+
*/
|
|
1279
|
+
declare const Builder: <TApi extends TApiType, TRes extends TResType = Extrinsic>(api?: TApi) => GeneralBuilder<TApi, TRes>;
|
|
1280
|
+
interface FinalBuilder<TRes> {
|
|
1281
|
+
build: () => Promise<TRes>;
|
|
948
1282
|
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
949
1283
|
}
|
|
950
|
-
interface UseKeepAliveFinalBuilder extends IAddToBatchBuilder {
|
|
951
|
-
useKeepAlive: (destApi:
|
|
1284
|
+
interface UseKeepAliveFinalBuilder<TApi extends TApiType = ApiPromise, TRes extends TResType = Extrinsic> extends IAddToBatchBuilder<TApi> {
|
|
1285
|
+
useKeepAlive: (destApi: TApi) => this;
|
|
952
1286
|
xcmVersion: (version: Version) => this;
|
|
953
|
-
build: () => Promise<
|
|
1287
|
+
build: () => Promise<TRes>;
|
|
954
1288
|
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
955
1289
|
}
|
|
956
|
-
interface AddressBuilder {
|
|
957
|
-
address: (address: TAddress) => UseKeepAliveFinalBuilder
|
|
1290
|
+
interface AddressBuilder<TApi extends TApiType> {
|
|
1291
|
+
address: (address: TAddress) => UseKeepAliveFinalBuilder<TApi>;
|
|
958
1292
|
}
|
|
959
|
-
interface AmountBuilder {
|
|
960
|
-
amount: (amount: TAmount | null) => AddressBuilder
|
|
1293
|
+
interface AmountBuilder<TApi extends TApiType> {
|
|
1294
|
+
amount: (amount: TAmount | null) => AddressBuilder<TApi>;
|
|
961
1295
|
}
|
|
962
|
-
interface AmountOrFeeAssetBuilder {
|
|
963
|
-
amount: (amount: TAmount | null) => AddressBuilder
|
|
964
|
-
feeAsset: (feeAsset: TCurrency) => AmountBuilder
|
|
1296
|
+
interface AmountOrFeeAssetBuilder<TApi extends TApiType> {
|
|
1297
|
+
amount: (amount: TAmount | null) => AddressBuilder<TApi>;
|
|
1298
|
+
feeAsset: (feeAsset: TCurrency) => AmountBuilder<TApi>;
|
|
965
1299
|
}
|
|
966
|
-
interface FungibleBuilder {
|
|
967
|
-
fungible: (multiAssets: TMultiAsset[]) => AccountBuilder
|
|
1300
|
+
interface FungibleBuilder<TRes> {
|
|
1301
|
+
fungible: (multiAssets: TMultiAsset[]) => AccountBuilder<TRes>;
|
|
968
1302
|
}
|
|
969
|
-
interface AccountBuilder {
|
|
970
|
-
account: (address: TAddress) => VersionBuilder
|
|
1303
|
+
interface AccountBuilder<TRes> {
|
|
1304
|
+
account: (address: TAddress) => VersionBuilder<TRes>;
|
|
971
1305
|
}
|
|
972
|
-
interface VersionBuilder extends
|
|
973
|
-
xcmVersion: (version: TVersionClaimAssets) =>
|
|
1306
|
+
interface VersionBuilder<TRes> extends FinalBuilder<TRes> {
|
|
1307
|
+
xcmVersion: (version: TVersionClaimAssets) => FinalBuilder<TRes>;
|
|
974
1308
|
}
|
|
975
1309
|
|
|
1310
|
+
/**
|
|
1311
|
+
* Builder class for constructing transfers from Ethereum to Polkadot.
|
|
1312
|
+
*/
|
|
976
1313
|
declare class EvmBuilderClass {
|
|
977
1314
|
private readonly _options;
|
|
978
1315
|
private readonly _provider;
|
|
979
1316
|
constructor(provider: AbstractProvider);
|
|
1317
|
+
/**
|
|
1318
|
+
* Specifies the destination node on Polkadot.
|
|
1319
|
+
*
|
|
1320
|
+
* @param node - The Polkadot node to which the transfer will be made.
|
|
1321
|
+
* @returns An instance of EvmBuilder
|
|
1322
|
+
*/
|
|
980
1323
|
to(node: TNodePolkadotKusama): this;
|
|
1324
|
+
/**
|
|
1325
|
+
* Specifies the amount to transfer.
|
|
1326
|
+
*
|
|
1327
|
+
* @param amount - The amount to transfer, as a string.
|
|
1328
|
+
* @returns An instance of EvmBuilder
|
|
1329
|
+
*/
|
|
981
1330
|
amount(amount: string): this;
|
|
1331
|
+
/**
|
|
1332
|
+
* Specifies the currency to transfer.
|
|
1333
|
+
*
|
|
1334
|
+
* @param currency - The currency to be transferred.
|
|
1335
|
+
* @returns An instance of EvmBuilder
|
|
1336
|
+
*/
|
|
982
1337
|
currency(currency: TCurrencyCore): this;
|
|
1338
|
+
/**
|
|
1339
|
+
* Specifies the recipient address on Polkadot.
|
|
1340
|
+
*
|
|
1341
|
+
* @param address - The Polkadot address to receive the transfer.
|
|
1342
|
+
* @returns An instance of EvmBuilder
|
|
1343
|
+
*/
|
|
983
1344
|
address(address: string): this;
|
|
1345
|
+
/**
|
|
1346
|
+
* Specifies the signer for the Ethereum transaction.
|
|
1347
|
+
*
|
|
1348
|
+
* @param signer - The Ethereum signer to authorize the transfer.
|
|
1349
|
+
* @returns An instance of EvmBuilder
|
|
1350
|
+
*/
|
|
984
1351
|
signer(signer: Signer): this;
|
|
1352
|
+
/**
|
|
1353
|
+
* Builds and executes the transfer from Ethereum to Polkadot.
|
|
1354
|
+
*
|
|
1355
|
+
* @throws Error if any required parameters are missing.
|
|
1356
|
+
*/
|
|
985
1357
|
build(): Promise<void>;
|
|
986
1358
|
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Creates a new EvmBuilder instance for constructing Ethereum to Polkadot transfers.
|
|
1361
|
+
*
|
|
1362
|
+
* @param provider - The Ethereum provider to use for the transfer.
|
|
1363
|
+
* @returns An instance of EvmBuilder class
|
|
1364
|
+
*/
|
|
987
1365
|
declare const EvmBuilder: (provider: AbstractProvider) => EvmBuilderClass;
|
|
988
1366
|
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1367
|
+
/**
|
|
1368
|
+
* Retrieves the WS provider URL for a specified node.
|
|
1369
|
+
*
|
|
1370
|
+
* @param node - The node for which to get the WS provider URL.
|
|
1371
|
+
* @returns The WS provider URL as a string.
|
|
1372
|
+
*/
|
|
992
1373
|
declare const getNodeProvider: (node: TNodeWithRelayChains) => string;
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* Retrieves all WS provider URLs for a specified Polkadot or Kusama node.
|
|
1377
|
+
*
|
|
1378
|
+
* @param node - The Polkadot or Kusama node.
|
|
1379
|
+
* @returns An array of WS provider URLs.
|
|
1380
|
+
* @throws Error if the node does not have any providers.
|
|
1381
|
+
*/
|
|
1382
|
+
declare const getAllNodeProviders: (node: TNodePolkadotKusama) => string[];
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* Retrieves the node instance for a given node.
|
|
1386
|
+
*
|
|
1387
|
+
* @param node - The node identifier.
|
|
1388
|
+
* @returns The node instance
|
|
1389
|
+
*/
|
|
1390
|
+
declare const getNode: <T extends TNode>(node: T) => (typeof nodes)[T];
|
|
1391
|
+
|
|
993
1392
|
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<ApiPromise>;
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* Retrieves the endpoint option for a given Polkadot or Kusama node.
|
|
1396
|
+
*
|
|
1397
|
+
* @param node - The Polkadot or Kusama node for which to get the endpoint option.
|
|
1398
|
+
* @returns The endpoint option object if found; otherwise, undefined.
|
|
1399
|
+
*/
|
|
1400
|
+
declare const getNodeEndpointOption: (node: TNodePolkadotKusama) => _polkadot_apps_config_endpoints_types.EndpointOption | undefined;
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* Determines the relay chain for a given node.
|
|
1404
|
+
*
|
|
1405
|
+
* @param node - The node for which to determine the relay chain.
|
|
1406
|
+
* @returns 'Kusama' if the node's relay chain symbol is 'KSM'; otherwise, 'Polkadot'.
|
|
1407
|
+
*/
|
|
994
1408
|
declare const determineRelayChain: (node: TNodeWithRelayChains) => TNodeDotKsmWithRelayChains;
|
|
1409
|
+
/**
|
|
1410
|
+
* Determines whether a given node is a relay chain (Polkadot or Kusama).
|
|
1411
|
+
*
|
|
1412
|
+
* @param node - The node to check.
|
|
1413
|
+
* @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
|
|
1414
|
+
*/
|
|
995
1415
|
declare const isRelayChain: (node: TNodeWithRelayChains) => boolean;
|
|
996
1416
|
|
|
1417
|
+
/**
|
|
1418
|
+
* Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
|
|
1419
|
+
*/
|
|
997
1420
|
declare class InvalidCurrencyError extends Error {
|
|
1421
|
+
/**
|
|
1422
|
+
* Constructs a new InvalidCurrencyError.
|
|
1423
|
+
*
|
|
1424
|
+
* @param message - The error message.
|
|
1425
|
+
*/
|
|
998
1426
|
constructor(message: string);
|
|
999
1427
|
}
|
|
1000
1428
|
|
|
1429
|
+
/**
|
|
1430
|
+
* Used to inform user, that Parachain they wish to use is not supported yet
|
|
1431
|
+
*/
|
|
1001
1432
|
declare class NodeNotSupportedError extends Error {
|
|
1433
|
+
/**
|
|
1434
|
+
* Constructs a new NodeNotSupportedError.
|
|
1435
|
+
*
|
|
1436
|
+
* @param message - Optional custom error message.
|
|
1437
|
+
*/
|
|
1002
1438
|
constructor(message?: string);
|
|
1003
1439
|
}
|
|
1004
1440
|
|
|
1441
|
+
/**
|
|
1442
|
+
* Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
1443
|
+
*/
|
|
1005
1444
|
declare class NoXCMSupportImplementedError extends Error {
|
|
1445
|
+
/**
|
|
1446
|
+
* Constructs a new NoXCMSupportImplementedError.
|
|
1447
|
+
*
|
|
1448
|
+
* @param node - The node for which XCM support is not implemented.
|
|
1449
|
+
*/
|
|
1006
1450
|
constructor(node: TNode);
|
|
1007
1451
|
}
|
|
1008
1452
|
|
|
1453
|
+
/**
|
|
1454
|
+
* Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
|
|
1455
|
+
*/
|
|
1009
1456
|
declare class ScenarioNotSupportedError extends Error {
|
|
1457
|
+
/**
|
|
1458
|
+
* Constructs a new ScenarioNotSupportedError.
|
|
1459
|
+
*
|
|
1460
|
+
* @param node - The node where the scenario is not supported.
|
|
1461
|
+
* @param scenario - The scenario that is not supported.
|
|
1462
|
+
* @param message - Optional custom error message.
|
|
1463
|
+
*/
|
|
1010
1464
|
constructor(node: TNode, scenario: TScenario, message?: string);
|
|
1011
1465
|
}
|
|
1012
1466
|
|
|
1467
|
+
/**
|
|
1468
|
+
* Error thrown when nodes from different relay chains are incompatible.
|
|
1469
|
+
*/
|
|
1013
1470
|
declare class IncompatibleNodesError extends Error {
|
|
1471
|
+
/**
|
|
1472
|
+
* Constructs a new IncompatibleNodesError.
|
|
1473
|
+
*
|
|
1474
|
+
* @param message - Optional custom error message.
|
|
1475
|
+
*/
|
|
1014
1476
|
constructor(message?: string);
|
|
1015
1477
|
}
|
|
1016
1478
|
|
|
1479
|
+
/**
|
|
1480
|
+
* Error thrown when multiple assets with the same symbol are found.
|
|
1481
|
+
*/
|
|
1017
1482
|
declare class DuplicateAssetError extends Error {
|
|
1483
|
+
/**
|
|
1484
|
+
* Constructs a new DuplicateAssetError.
|
|
1485
|
+
*
|
|
1486
|
+
* @param symbol - The symbol of the asset causing the duplication error.
|
|
1487
|
+
*/
|
|
1018
1488
|
constructor(symbol: string);
|
|
1019
1489
|
}
|
|
1020
1490
|
|
|
1021
|
-
export { BatchMode, Builder, type CheckKeepAliveOptions, DuplicateAssetError, EvmBuilder, type Extrinsic, GeneralBuilder, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionParachain, type JunctionType, type Junctions, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, type PolkadotXcmModule, type PolkadotXcmSection, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAsset, type TAssetDetails, type TAssetJsonMap, type TBatchOptions, type TCurrency, type TCurrencyCore, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TDestWeight, 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 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 TTransferInfo, type TTransferReturn, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXcmAsset, type TZeitgeistAsset, type UseKeepAliveFinalBuilder, Version, type XTokensModule, type XTokensSection, type XTokensTransferInput, type XTransferModule, type XTransferSection, type XTransferTransferInput, index as assets, buildEthTransferOptions, createApiInstanceForNode, determineRelayChain, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index$1 as xcmPallet };
|
|
1491
|
+
export { BatchMode, Builder, type CheckKeepAliveOptions, DuplicateAssetError, EvmBuilder, type Extrinsic, GeneralBuilder, type HexString$1 as HexString, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionParachain, type JunctionType, type Junctions, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, type PolkadotXcmModule, type PolkadotXcmSection, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiType, type TAsset, type TAssetDetails, type TAssetJsonMap, type TBatchOptions, type TCurrency, type TCurrencyCore, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TDestWeight, 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 TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaCommonOptions, type TRelayToParaInternalOptions, type TRelayToParaOptions, type TResType, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSendOptionsCommon, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TTransferInfo, type TTransferReturn, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXcmAsset, type TZeitgeistAsset, type UseKeepAliveFinalBuilder, Version, type XTokensModule, type XTokensSection, type XTokensTransferInput, type XTransferModule, type XTransferSection, type XTransferTransferInput, index as assets, buildEthTransferOptions, createApiInstanceForNode, determineRelayChain, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index$1 as xcmPallet };
|