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