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