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