@paraspell/sdk 7.2.2 → 7.2.4
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/dist/index.cjs +1694 -1313
- package/dist/index.d.ts +217 -217
- package/dist/index.mjs +1693 -1312
- package/dist/papi/index.cjs +1698 -1302
- package/dist/papi/index.d.ts +191 -186
- package/dist/papi/index.mjs +1697 -1300
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,35 +3,6 @@ import * as _polkadot_api from '@polkadot/api';
|
|
|
3
3
|
import { ApiPromise } from '@polkadot/api';
|
|
4
4
|
import { Signer, AbstractProvider } from 'ethers';
|
|
5
5
|
|
|
6
|
-
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
7
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
8
|
-
};
|
|
9
|
-
type TApiOrUrl<TApi> = TApi | string;
|
|
10
|
-
|
|
11
|
-
interface IPolkadotApi<TApi, TRes> {
|
|
12
|
-
setApi(api?: TApiOrUrl<TApi>): void;
|
|
13
|
-
getApi(): TApi;
|
|
14
|
-
init(node: TNodeWithRelayChains): Promise<void>;
|
|
15
|
-
createApiInstance: (wsUrl: string) => Promise<TApi>;
|
|
16
|
-
createAccountId(address: string): HexString$1;
|
|
17
|
-
callTxMethod(serializedCall: TSerializedApiCallV2): TRes;
|
|
18
|
-
calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
|
|
19
|
-
getBalanceNative(address: string): Promise<bigint>;
|
|
20
|
-
getBalanceForeignPolkadotXcm(address: string, id?: string): Promise<bigint>;
|
|
21
|
-
getMythosForeignBalance(address: string): Promise<bigint>;
|
|
22
|
-
getAssetHubForeignBalance(address: string, multiLocation: TMultiLocation): Promise<bigint>;
|
|
23
|
-
getForeignAssetsByIdBalance(address: string, assetId: string): Promise<bigint>;
|
|
24
|
-
getBalanceForeignXTokens(address: string, asset: TAsset): Promise<bigint>;
|
|
25
|
-
getBalanceForeignBifrost(address: string, asset: TAsset): Promise<bigint>;
|
|
26
|
-
getBalanceForeignAssetsAccount(address: string, assetId: bigint | number): Promise<bigint>;
|
|
27
|
-
getFromStorage(key: string): Promise<string>;
|
|
28
|
-
clone(): IPolkadotApi<TApi, TRes>;
|
|
29
|
-
createApiForNode(node: TNodeWithRelayChains): Promise<IPolkadotApi<TApi, TRes>>;
|
|
30
|
-
setDisconnectAllowed(allowed: boolean): void;
|
|
31
|
-
getDisconnectAllowed(): boolean;
|
|
32
|
-
disconnect(): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
6
|
declare abstract class ParachainNode<TApi, TRes> {
|
|
36
7
|
private readonly _node;
|
|
37
8
|
private readonly _info;
|
|
@@ -45,8 +16,9 @@ declare abstract class ParachainNode<TApi, TRes> {
|
|
|
45
16
|
get version(): Version;
|
|
46
17
|
get assetCheckEnabled(): boolean;
|
|
47
18
|
protected canUseXTokens(_: TSendInternalOptions<TApi, TRes>): boolean;
|
|
48
|
-
transfer(options: TSendInternalOptions<TApi, TRes>): Promise<
|
|
49
|
-
|
|
19
|
+
transfer(options: TSendInternalOptions<TApi, TRes>): Promise<TRes>;
|
|
20
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
21
|
+
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCall;
|
|
50
22
|
getProvider(): string;
|
|
51
23
|
createApiInstance(api: IPolkadotApi<TApi, TRes>): Promise<TApi>;
|
|
52
24
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
@@ -56,19 +28,19 @@ declare abstract class ParachainNode<TApi, TRes> {
|
|
|
56
28
|
|
|
57
29
|
declare class Acala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
58
30
|
constructor();
|
|
59
|
-
transferXTokens<TApi, TRes>(input:
|
|
31
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
60
32
|
getProvider(): string;
|
|
61
33
|
}
|
|
62
34
|
|
|
63
35
|
declare class Unique<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
64
36
|
constructor();
|
|
65
|
-
transferXTokens<TApi, TRes>(input:
|
|
37
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
66
38
|
}
|
|
67
39
|
|
|
68
40
|
declare class Crust<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
69
41
|
constructor();
|
|
70
42
|
private getCurrencySelection;
|
|
71
|
-
transferXTokens<TApi, TRes>(input:
|
|
43
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
72
44
|
}
|
|
73
45
|
|
|
74
46
|
declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
@@ -116,8 +88,8 @@ declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> impl
|
|
|
116
88
|
VSToken2?: undefined;
|
|
117
89
|
VToken2?: undefined;
|
|
118
90
|
};
|
|
119
|
-
transferXTokens<TApi, TRes>(input:
|
|
120
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
91
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
92
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
121
93
|
protected canUseXTokens({ asset, destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
122
94
|
getProvider(): string;
|
|
123
95
|
}
|
|
@@ -129,209 +101,210 @@ declare class Bitgreen<TApi, TRes> extends ParachainNode<TApi, TRes> {
|
|
|
129
101
|
declare class Centrifuge<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
130
102
|
constructor();
|
|
131
103
|
private getCurrencySelection;
|
|
132
|
-
transferXTokens<TApi, TRes>(input:
|
|
104
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
133
105
|
}
|
|
134
106
|
|
|
135
107
|
declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
136
108
|
constructor();
|
|
137
|
-
transferXTokens<TApi, TRes>(input:
|
|
109
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
138
110
|
}
|
|
139
111
|
|
|
140
112
|
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
141
113
|
private static NATIVE_ASSET_ID;
|
|
142
114
|
constructor();
|
|
143
|
-
transferToEthereum<TApi, TRes>(input:
|
|
144
|
-
transferToAssetHub<TApi, TRes>(input:
|
|
145
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
146
|
-
transferXTokens<TApi, TRes>(input:
|
|
115
|
+
transferToEthereum<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
116
|
+
transferToAssetHub<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
|
|
117
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
118
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
147
119
|
protected canUseXTokens({ destination, asset }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
148
120
|
getProvider(): string;
|
|
149
121
|
}
|
|
150
122
|
|
|
151
123
|
declare class Interlay<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
152
124
|
constructor();
|
|
153
|
-
transferXTokens<TApi, TRes>(input:
|
|
125
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
154
126
|
}
|
|
155
127
|
|
|
156
128
|
declare class Litentry<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
157
129
|
constructor();
|
|
158
|
-
transferXTokens<TApi, TRes>(input:
|
|
130
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
159
131
|
}
|
|
160
132
|
|
|
161
|
-
declare class Moonbeam<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
133
|
+
declare class Moonbeam<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
162
134
|
constructor();
|
|
163
|
-
private
|
|
164
|
-
|
|
165
|
-
|
|
135
|
+
private getJunctions;
|
|
136
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
137
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
166
138
|
getProvider(): string;
|
|
167
139
|
}
|
|
168
140
|
|
|
169
141
|
declare class Parallel<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
170
142
|
constructor();
|
|
171
|
-
transferXTokens<TApi, TRes>(input:
|
|
143
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
172
144
|
}
|
|
173
145
|
|
|
174
146
|
declare class Altair<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
175
147
|
constructor();
|
|
176
148
|
private getCurrencySelection;
|
|
177
|
-
transferXTokens<TApi, TRes>(input:
|
|
149
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
178
150
|
}
|
|
179
151
|
|
|
180
152
|
declare class Amplitude<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
181
153
|
constructor();
|
|
182
|
-
transferXTokens<TApi, TRes>(input:
|
|
154
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
183
155
|
}
|
|
184
156
|
|
|
185
157
|
declare class Bajun<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
186
158
|
constructor();
|
|
187
|
-
transferXTokens<TApi, TRes>(input:
|
|
188
|
-
transferRelayToPara():
|
|
159
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
160
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
189
161
|
}
|
|
190
162
|
|
|
191
163
|
declare class Basilisk<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
192
164
|
constructor();
|
|
193
|
-
transferXTokens<TApi, TRes>(input:
|
|
165
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
194
166
|
getProvider(): string;
|
|
195
167
|
}
|
|
196
168
|
|
|
197
169
|
declare class BifrostKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
198
170
|
constructor();
|
|
199
|
-
transferXTokens<TApi, TRes>(input:
|
|
171
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
200
172
|
getProvider(): string;
|
|
201
173
|
}
|
|
202
174
|
|
|
203
175
|
declare class Pioneer<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
204
176
|
constructor();
|
|
205
|
-
transferXTokens<TApi, TRes>(input:
|
|
177
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
206
178
|
}
|
|
207
179
|
|
|
208
180
|
declare class Turing<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
209
181
|
constructor();
|
|
210
|
-
transferXTokens<TApi, TRes>(input:
|
|
182
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
211
183
|
}
|
|
212
184
|
|
|
213
185
|
declare class Picasso<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
214
186
|
constructor();
|
|
215
|
-
transferXTokens<TApi, TRes>(input:
|
|
187
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
216
188
|
}
|
|
217
189
|
|
|
218
190
|
declare class ParallelHeiko<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
219
191
|
constructor();
|
|
220
|
-
transferXTokens<TApi, TRes>(input:
|
|
192
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
221
193
|
}
|
|
222
194
|
|
|
223
|
-
declare class Moonriver<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
195
|
+
declare class Moonriver<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
224
196
|
constructor();
|
|
225
|
-
private
|
|
226
|
-
|
|
227
|
-
|
|
197
|
+
private getJunctions;
|
|
198
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
199
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
228
200
|
getProvider(): string;
|
|
229
201
|
}
|
|
230
202
|
|
|
231
203
|
declare class Kintsugi<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
232
204
|
constructor();
|
|
233
|
-
transferXTokens<TApi, TRes>(input:
|
|
205
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
234
206
|
}
|
|
235
207
|
|
|
236
208
|
declare class Calamari<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
237
209
|
constructor();
|
|
238
|
-
transferXTokens<TApi, TRes>(input:
|
|
210
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
239
211
|
}
|
|
240
212
|
|
|
241
213
|
declare class CrustShadow<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
242
214
|
constructor();
|
|
243
215
|
private getCurrencySelection;
|
|
244
|
-
transferXTokens<TApi, TRes>(input:
|
|
216
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
245
217
|
}
|
|
246
218
|
|
|
247
219
|
declare class Imbue<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
248
220
|
constructor();
|
|
249
|
-
transferXTokens<TApi, TRes>(input:
|
|
221
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
250
222
|
}
|
|
251
223
|
|
|
252
224
|
declare class Integritee<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
253
225
|
constructor();
|
|
254
|
-
transferXTokens<TApi, TRes>(input:
|
|
255
|
-
transferRelayToPara():
|
|
226
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
227
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
256
228
|
}
|
|
257
229
|
|
|
258
230
|
declare class InvArchTinker<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
259
231
|
constructor();
|
|
260
|
-
transferXTokens<TApi, TRes>(input:
|
|
232
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
261
233
|
}
|
|
262
234
|
|
|
263
235
|
declare class Karura<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
264
236
|
constructor();
|
|
265
|
-
transferXTokens<TApi, TRes>(input:
|
|
237
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
266
238
|
getProvider(): string;
|
|
267
239
|
}
|
|
268
240
|
|
|
269
241
|
declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
270
242
|
constructor();
|
|
271
|
-
handleBridgeTransfer<TApi, TRes>(input:
|
|
272
|
-
handleEthBridgeTransfer<TApi, TRes>(input:
|
|
273
|
-
handleMythosTransfer<TApi, TRes>(input:
|
|
274
|
-
handleBifrostEthTransfer: <TApi_1, TRes_1>(input:
|
|
275
|
-
patchInput<TApi, TRes>(input:
|
|
243
|
+
handleBridgeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>, targetChain: 'Polkadot' | 'Kusama'): TRes;
|
|
244
|
+
handleEthBridgeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
|
|
245
|
+
handleMythosTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
|
|
246
|
+
handleBifrostEthTransfer: <TApi_1, TRes_1>(input: TPolkadotXCMTransferOptions<TApi_1, TRes_1>) => TRes_1;
|
|
247
|
+
patchInput<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TPolkadotXCMTransferOptions<TApi, TRes>;
|
|
276
248
|
private getSection;
|
|
277
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
278
|
-
|
|
249
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
250
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
279
251
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
252
|
+
getProvider(): string;
|
|
280
253
|
}
|
|
281
254
|
|
|
282
255
|
declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
283
256
|
constructor();
|
|
284
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
285
|
-
|
|
257
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
258
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
286
259
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
287
260
|
}
|
|
288
261
|
|
|
289
262
|
declare class CoretimeKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
290
263
|
constructor();
|
|
291
264
|
_assetCheckEnabled: boolean;
|
|
292
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
293
|
-
|
|
265
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
266
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
294
267
|
}
|
|
295
268
|
|
|
296
269
|
declare class CoretimePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
297
270
|
constructor();
|
|
298
271
|
_assetCheckEnabled: boolean;
|
|
299
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
300
|
-
|
|
272
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
273
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
301
274
|
}
|
|
302
275
|
|
|
303
276
|
declare class Encointer<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
304
277
|
constructor();
|
|
305
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
306
|
-
|
|
278
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
279
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
307
280
|
}
|
|
308
281
|
|
|
309
282
|
declare class RobonomicsKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
310
283
|
constructor();
|
|
311
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
284
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
312
285
|
}
|
|
313
286
|
|
|
314
287
|
declare class RobonomicsPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
315
288
|
constructor();
|
|
316
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
289
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
317
290
|
}
|
|
318
291
|
|
|
319
292
|
declare class PeoplePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
320
293
|
constructor();
|
|
321
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
322
|
-
|
|
294
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
295
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
323
296
|
}
|
|
324
297
|
|
|
325
298
|
declare class PeopleKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
326
299
|
constructor();
|
|
327
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
328
|
-
|
|
300
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
301
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
329
302
|
}
|
|
330
303
|
|
|
331
304
|
declare class Astar<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
332
305
|
constructor();
|
|
333
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
334
|
-
transferXTokens<TApi, TRes>(input:
|
|
306
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
307
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
335
308
|
protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
336
309
|
}
|
|
337
310
|
|
|
@@ -470,13 +443,14 @@ type TAsset = TNativeAsset | TForeignAsset;
|
|
|
470
443
|
type TNodeAssets = {
|
|
471
444
|
relayChainAssetSymbol: TRelayChainSymbol;
|
|
472
445
|
nativeAssetSymbol: string;
|
|
446
|
+
isEVM: boolean;
|
|
473
447
|
nativeAssets: TNativeAsset[];
|
|
474
448
|
otherAssets: TForeignAsset[];
|
|
475
449
|
};
|
|
476
450
|
type TAssetJsonMap = Record<TNodeWithRelayChains, TNodeAssets>;
|
|
477
451
|
|
|
478
|
-
type
|
|
479
|
-
type
|
|
452
|
+
type THexString$1 = `0x${string}`;
|
|
453
|
+
type TPolkadotXCMTransferOptions<TApi, TRes> = {
|
|
480
454
|
api: IPolkadotApi<TApi, TRes>;
|
|
481
455
|
header: TMultiLocationHeader;
|
|
482
456
|
addressSelection: TMultiLocationHeader;
|
|
@@ -489,11 +463,10 @@ type PolkadotXCMTransferInput<TApi, TRes> = {
|
|
|
489
463
|
paraIdTo?: number;
|
|
490
464
|
feeAsset?: TCurrency;
|
|
491
465
|
overridedCurrency?: TMultiLocation | TMultiAsset[];
|
|
492
|
-
serializedApiCallEnabled?: boolean;
|
|
493
466
|
version?: Version;
|
|
494
467
|
ahAddress?: string;
|
|
495
468
|
};
|
|
496
|
-
type
|
|
469
|
+
type TXTokensTransferOptions<TApi, TRes> = {
|
|
497
470
|
api: IPolkadotApi<TApi, TRes>;
|
|
498
471
|
asset: TAsset;
|
|
499
472
|
amount: string;
|
|
@@ -505,9 +478,8 @@ type XTokensTransferInput<TApi, TRes> = {
|
|
|
505
478
|
paraIdTo?: number;
|
|
506
479
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
507
480
|
feeAsset?: TCurrency;
|
|
508
|
-
serializedApiCallEnabled?: boolean;
|
|
509
481
|
};
|
|
510
|
-
type
|
|
482
|
+
type TXTransferTransferOptions<TApi, TRes> = {
|
|
511
483
|
api: IPolkadotApi<TApi, TRes>;
|
|
512
484
|
asset: TAsset;
|
|
513
485
|
amount: string;
|
|
@@ -516,17 +488,16 @@ type XTransferTransferInput<TApi, TRes> = {
|
|
|
516
488
|
paraId?: number;
|
|
517
489
|
destination?: TDestination;
|
|
518
490
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
519
|
-
serializedApiCallEnabled?: boolean;
|
|
520
|
-
};
|
|
521
|
-
type IPolkadotXCMTransfer = {
|
|
522
|
-
transferPolkadotXCM: <TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>) => Promise<TTransferReturn<TRes>>;
|
|
523
|
-
};
|
|
524
|
-
type IXTokensTransfer = {
|
|
525
|
-
transferXTokens: <TApi, TRes>(input: XTokensTransferInput<TApi, TRes>) => TTransferReturn<TRes>;
|
|
526
|
-
};
|
|
527
|
-
type IXTransferTransfer = {
|
|
528
|
-
transferXTransfer: <TApi, TRes>(input: XTransferTransferInput<TApi, TRes>) => TTransferReturn<TRes>;
|
|
529
491
|
};
|
|
492
|
+
interface IPolkadotXCMTransfer {
|
|
493
|
+
transferPolkadotXCM: <TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TRes>;
|
|
494
|
+
}
|
|
495
|
+
interface IXTokensTransfer {
|
|
496
|
+
transferXTokens: <TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>) => TRes;
|
|
497
|
+
}
|
|
498
|
+
interface IXTransferTransfer {
|
|
499
|
+
transferXTransfer: <TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>) => TRes;
|
|
500
|
+
}
|
|
530
501
|
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
531
502
|
/**
|
|
532
503
|
* The XCM version.
|
|
@@ -602,7 +573,6 @@ type TSendInternalOptions<TApi, TRes> = TSendBaseOptions<TApi, TRes> & {
|
|
|
602
573
|
asset: TAsset;
|
|
603
574
|
amount: string;
|
|
604
575
|
overridedCurrencyMultiLocation?: TMultiLocation | TMultiAsset[];
|
|
605
|
-
serializedApiCallEnabled?: boolean;
|
|
606
576
|
};
|
|
607
577
|
type TRelayToParaBaseOptions<TApi, TRes> = {
|
|
608
578
|
/**
|
|
@@ -630,22 +600,20 @@ type TRelayToParaBaseOptions<TApi, TRes> = {
|
|
|
630
600
|
*/
|
|
631
601
|
amount: TAmount;
|
|
632
602
|
};
|
|
603
|
+
type TRelayToParaOverrides = {
|
|
604
|
+
section: TXcmPalletSection;
|
|
605
|
+
includeFee: boolean;
|
|
606
|
+
};
|
|
633
607
|
/**
|
|
634
608
|
* Options for transferring from a relay chain to a parachain
|
|
635
609
|
*/
|
|
636
610
|
type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions<TApi, TRes>, TApi, TRes>;
|
|
637
|
-
type TTransferReturn<TRes> = TRes | TSerializedApiCall;
|
|
638
611
|
type TSerializedApiCall = {
|
|
639
|
-
module: string;
|
|
640
|
-
section: string;
|
|
641
|
-
parameters: unknown[];
|
|
642
|
-
};
|
|
643
|
-
type TSerializedApiCallV2 = {
|
|
644
612
|
module: TPallet | 'Utility';
|
|
645
613
|
section: string;
|
|
646
614
|
parameters: Record<string, unknown>;
|
|
647
615
|
};
|
|
648
|
-
type
|
|
616
|
+
type TCheckKeepAliveOptions<TApi, TRes> = {
|
|
649
617
|
originApi: IPolkadotApi<TApi, TRes>;
|
|
650
618
|
address: string;
|
|
651
619
|
amount: string;
|
|
@@ -658,64 +626,65 @@ type TDestWeight = {
|
|
|
658
626
|
refTime: string;
|
|
659
627
|
proofSize: string;
|
|
660
628
|
};
|
|
661
|
-
type
|
|
662
|
-
type
|
|
663
|
-
type
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
type
|
|
667
|
-
type
|
|
668
|
-
type
|
|
669
|
-
type
|
|
670
|
-
type
|
|
671
|
-
type
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
629
|
+
type TXTransferSection = 'transfer';
|
|
630
|
+
type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
631
|
+
type TPolkadotXcmSection = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets';
|
|
632
|
+
type TXcmPalletSection = 'limited_teleport_assets' | 'reserve_transfer_assets' | 'limited_reserve_transfer_assets';
|
|
633
|
+
|
|
634
|
+
type TJunctionType = 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality' | 'GlobalConsensus';
|
|
635
|
+
type TNetworkId = string | null;
|
|
636
|
+
type TBodyId = string | null;
|
|
637
|
+
type TBodyPart = string | null;
|
|
638
|
+
type TStringOrNumber = string | number;
|
|
639
|
+
type TStringOrNumberOrBigInt = TStringOrNumber | bigint;
|
|
640
|
+
type THexString = string;
|
|
641
|
+
type TJunctionParachain = {
|
|
642
|
+
Parachain: TStringOrNumberOrBigInt | undefined;
|
|
643
|
+
};
|
|
644
|
+
type TJunctionAccountId32 = {
|
|
676
645
|
AccountId32: {
|
|
677
|
-
network?:
|
|
678
|
-
id:
|
|
646
|
+
network?: TNetworkId;
|
|
647
|
+
id: THexString;
|
|
679
648
|
};
|
|
680
|
-
}
|
|
681
|
-
|
|
649
|
+
};
|
|
650
|
+
type TJunctionAccountIndex64 = {
|
|
682
651
|
AccountIndex64: {
|
|
683
|
-
network:
|
|
684
|
-
index:
|
|
652
|
+
network: TNetworkId;
|
|
653
|
+
index: TStringOrNumberOrBigInt;
|
|
685
654
|
};
|
|
686
|
-
}
|
|
687
|
-
|
|
655
|
+
};
|
|
656
|
+
type TJunctionAccountKey20 = {
|
|
688
657
|
AccountKey20: {
|
|
689
|
-
network?:
|
|
690
|
-
key:
|
|
658
|
+
network?: TNetworkId;
|
|
659
|
+
key: THexString;
|
|
691
660
|
};
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
PalletInstance:
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
GeneralIndex:
|
|
698
|
-
}
|
|
699
|
-
|
|
661
|
+
};
|
|
662
|
+
type TJunctionPalletInstance = {
|
|
663
|
+
PalletInstance: TStringOrNumberOrBigInt;
|
|
664
|
+
};
|
|
665
|
+
type TJunctionGeneralIndex = {
|
|
666
|
+
GeneralIndex: TStringOrNumberOrBigInt;
|
|
667
|
+
};
|
|
668
|
+
type TJunctionGeneralKey = {
|
|
700
669
|
GeneralKey: {
|
|
701
|
-
length:
|
|
702
|
-
data:
|
|
670
|
+
length: TStringOrNumberOrBigInt;
|
|
671
|
+
data: THexString;
|
|
703
672
|
};
|
|
704
|
-
}
|
|
705
|
-
|
|
673
|
+
};
|
|
674
|
+
type TJunctionOnlyChild = {
|
|
706
675
|
OnlyChild: string;
|
|
707
|
-
}
|
|
708
|
-
|
|
676
|
+
};
|
|
677
|
+
type TJunctionPlurality = {
|
|
709
678
|
Plurality: {
|
|
710
|
-
id:
|
|
711
|
-
part:
|
|
679
|
+
id: TBodyId;
|
|
680
|
+
part: TBodyPart;
|
|
712
681
|
};
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
GlobalConsensus:
|
|
716
|
-
}
|
|
717
|
-
type TJunction =
|
|
718
|
-
interface
|
|
682
|
+
};
|
|
683
|
+
type TJunctionGlobalConsensus = {
|
|
684
|
+
GlobalConsensus: TNetworkId | object;
|
|
685
|
+
};
|
|
686
|
+
type TJunction = TJunctionParachain | TJunctionAccountId32 | TJunctionAccountIndex64 | TJunctionAccountKey20 | TJunctionPalletInstance | TJunctionGeneralIndex | TJunctionGeneralKey | TJunctionOnlyChild | TJunctionPlurality | TJunctionGlobalConsensus;
|
|
687
|
+
interface TJunctions {
|
|
719
688
|
Here?: null;
|
|
720
689
|
X1?: TJunction | [TJunction];
|
|
721
690
|
X2?: [TJunction, TJunction];
|
|
@@ -727,8 +696,8 @@ interface Junctions {
|
|
|
727
696
|
X8?: [TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction, TJunction];
|
|
728
697
|
}
|
|
729
698
|
interface TMultiLocation {
|
|
730
|
-
parents:
|
|
731
|
-
interior:
|
|
699
|
+
parents: TStringOrNumber;
|
|
700
|
+
interior: TJunctions | 'Here';
|
|
732
701
|
}
|
|
733
702
|
type TMultiLocationHeader = {
|
|
734
703
|
[key in Version]?: TMultiLocation;
|
|
@@ -737,132 +706,132 @@ type TMultiLocationHeader = {
|
|
|
737
706
|
declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
738
707
|
constructor();
|
|
739
708
|
private getCurrencySelection;
|
|
740
|
-
transferXTokens<TApi, TRes>(input:
|
|
741
|
-
transferRelayToPara():
|
|
709
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
710
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
742
711
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation): TCurrencySelectionHeaderArr;
|
|
743
712
|
getProvider(): string;
|
|
744
713
|
}
|
|
745
714
|
|
|
746
715
|
declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
747
716
|
constructor();
|
|
748
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
749
|
-
transferRelayToPara():
|
|
717
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
718
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
750
719
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset): TCurrencySelectionHeaderArr;
|
|
751
720
|
}
|
|
752
721
|
|
|
753
722
|
declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
754
723
|
constructor();
|
|
755
724
|
_assetCheckEnabled: boolean;
|
|
756
|
-
transferXTokens<TApi, TRes>(input:
|
|
725
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
757
726
|
}
|
|
758
727
|
|
|
759
728
|
declare class Shiden<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
760
729
|
constructor();
|
|
761
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
762
|
-
transferXTokens<TApi, TRes>(input:
|
|
730
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
731
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
763
732
|
protected canUseXTokens({ asset }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
764
733
|
}
|
|
765
734
|
|
|
766
735
|
declare class Manta<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
767
736
|
constructor();
|
|
768
|
-
transferXTokens<TApi, TRes>(input:
|
|
737
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
769
738
|
}
|
|
770
739
|
|
|
771
740
|
declare class Nodle<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
772
741
|
constructor();
|
|
773
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
774
|
-
transferRelayToPara():
|
|
742
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
743
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
775
744
|
}
|
|
776
745
|
|
|
777
746
|
declare class NeuroWeb<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
778
747
|
constructor();
|
|
779
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
748
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
780
749
|
}
|
|
781
750
|
|
|
782
751
|
declare class Pendulum<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
783
752
|
constructor();
|
|
784
|
-
transferXTokens<TApi, TRes>(input:
|
|
785
|
-
transferRelayToPara():
|
|
753
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
754
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
786
755
|
}
|
|
787
756
|
|
|
788
757
|
declare class Polkadex<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
789
758
|
constructor();
|
|
790
|
-
transferXTokens<TApi, TRes>(input:
|
|
759
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
791
760
|
getProvider(): string;
|
|
792
761
|
}
|
|
793
762
|
|
|
794
763
|
declare class Zeitgeist<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
795
764
|
constructor();
|
|
796
765
|
private getCurrencySelection;
|
|
797
|
-
transferXTokens<TApi, TRes>(input:
|
|
766
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
798
767
|
}
|
|
799
768
|
|
|
800
769
|
declare class Collectives<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
801
770
|
constructor();
|
|
802
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
803
|
-
|
|
771
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
772
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
804
773
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset): TCurrencySelectionHeaderArr;
|
|
805
774
|
}
|
|
806
775
|
|
|
807
776
|
declare class Khala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTransferTransfer {
|
|
808
777
|
constructor();
|
|
809
|
-
transferXTransfer<TApi, TRes>(input:
|
|
778
|
+
transferXTransfer<TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>): TRes;
|
|
810
779
|
}
|
|
811
780
|
|
|
812
781
|
declare class Phala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTransferTransfer {
|
|
813
782
|
constructor();
|
|
814
|
-
transferXTransfer<TApi, TRes>(input:
|
|
783
|
+
transferXTransfer<TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>): TRes;
|
|
815
784
|
}
|
|
816
785
|
|
|
817
786
|
declare class Subsocial<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
818
787
|
constructor();
|
|
819
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
788
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
820
789
|
}
|
|
821
790
|
|
|
822
791
|
declare class KiltSpiritnet<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
823
792
|
constructor();
|
|
824
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
825
|
-
transferRelayToPara():
|
|
793
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
794
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
826
795
|
getProvider(): string;
|
|
827
796
|
}
|
|
828
797
|
|
|
829
798
|
declare class Curio<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
830
799
|
constructor();
|
|
831
|
-
transferXTokens<TApi, TRes>(input:
|
|
800
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
832
801
|
}
|
|
833
802
|
|
|
834
803
|
declare class BridgeHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
835
804
|
constructor();
|
|
836
805
|
_assetCheckEnabled: boolean;
|
|
837
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
838
|
-
|
|
806
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
807
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
839
808
|
}
|
|
840
809
|
|
|
841
810
|
declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
842
811
|
constructor();
|
|
843
812
|
_assetCheckEnabled: boolean;
|
|
844
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
845
|
-
|
|
813
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
814
|
+
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
846
815
|
}
|
|
847
816
|
|
|
848
817
|
declare class Mythos<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
849
818
|
constructor();
|
|
850
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
851
|
-
transferRelayToPara():
|
|
819
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
820
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
852
821
|
}
|
|
853
822
|
|
|
854
823
|
declare class Peaq<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
855
824
|
constructor();
|
|
856
|
-
transferXTokens<TApi, TRes>(input:
|
|
857
|
-
transferRelayToPara():
|
|
825
|
+
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
826
|
+
transferRelayToPara(): TSerializedApiCall;
|
|
858
827
|
getProvider(): string;
|
|
859
828
|
}
|
|
860
829
|
|
|
861
830
|
declare class Polimec<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
862
831
|
constructor();
|
|
863
832
|
private getAssetMultiLocation;
|
|
864
|
-
transferPolkadotXCM<TApi, TRes>(input:
|
|
865
|
-
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>):
|
|
833
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
834
|
+
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCall;
|
|
866
835
|
getProvider(): string;
|
|
867
836
|
}
|
|
868
837
|
|
|
@@ -1077,6 +1046,36 @@ type TNodeConfig = {
|
|
|
1077
1046
|
};
|
|
1078
1047
|
type TNodeConfigMap = Record<TNodeDotKsmWithRelayChains, TNodeConfig>;
|
|
1079
1048
|
|
|
1049
|
+
interface IPolkadotApi<TApi, TRes> {
|
|
1050
|
+
setApi(api?: TApiOrUrl<TApi>): void;
|
|
1051
|
+
getApi(): TApi;
|
|
1052
|
+
getApiOrUrl(): TApiOrUrl<TApi> | undefined;
|
|
1053
|
+
init(node: TNodeWithRelayChains): Promise<void>;
|
|
1054
|
+
createApiInstance: (wsUrl: string) => Promise<TApi>;
|
|
1055
|
+
createAccountId(address: string): THexString$1;
|
|
1056
|
+
callTxMethod(serializedCall: TSerializedApiCall): TRes;
|
|
1057
|
+
calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
|
|
1058
|
+
getBalanceNative(address: string): Promise<bigint>;
|
|
1059
|
+
getBalanceForeignPolkadotXcm(address: string, id?: string): Promise<bigint>;
|
|
1060
|
+
getMythosForeignBalance(address: string): Promise<bigint>;
|
|
1061
|
+
getAssetHubForeignBalance(address: string, multiLocation: TMultiLocation): Promise<bigint>;
|
|
1062
|
+
getForeignAssetsByIdBalance(address: string, assetId: string): Promise<bigint>;
|
|
1063
|
+
getBalanceForeignXTokens(address: string, asset: TAsset): Promise<bigint>;
|
|
1064
|
+
getBalanceForeignBifrost(address: string, asset: TAsset): Promise<bigint>;
|
|
1065
|
+
getBalanceForeignAssetsAccount(address: string, assetId: bigint | number): Promise<bigint>;
|
|
1066
|
+
getFromStorage(key: string): Promise<string>;
|
|
1067
|
+
clone(): IPolkadotApi<TApi, TRes>;
|
|
1068
|
+
createApiForNode(node: TNodeWithRelayChains): Promise<IPolkadotApi<TApi, TRes>>;
|
|
1069
|
+
setDisconnectAllowed(allowed: boolean): void;
|
|
1070
|
+
getDisconnectAllowed(): boolean;
|
|
1071
|
+
disconnect(): Promise<void>;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
1075
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
1076
|
+
};
|
|
1077
|
+
type TApiOrUrl<TApi> = TApi | string;
|
|
1078
|
+
|
|
1080
1079
|
type TPjsApi = ApiPromise;
|
|
1081
1080
|
type TPjsApiOrUrl = TApiOrUrl<TPjsApi>;
|
|
1082
1081
|
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
@@ -1094,10 +1093,6 @@ declare const transferRelayToPara: (options: Omit<TRelayToParaOptions<TPjsApi, E
|
|
|
1094
1093
|
api: TPjsApiOrUrl;
|
|
1095
1094
|
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1096
1095
|
}) => Promise<Extrinsic>;
|
|
1097
|
-
declare const transferRelayToParaSerializedApiCall: (options: Omit<TRelayToParaOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1098
|
-
api: TPjsApiOrUrl;
|
|
1099
|
-
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1100
|
-
}) => Promise<TSerializedApiCall>;
|
|
1101
1096
|
/**
|
|
1102
1097
|
* Transfers assets from parachain to another parachain or relay chain.
|
|
1103
1098
|
* @param options - The transfer options.
|
|
@@ -1107,18 +1102,12 @@ declare const send: (options: Omit<TSendOptions<TPjsApi, Extrinsic>, "api" | "de
|
|
|
1107
1102
|
api: TPjsApiOrUrl;
|
|
1108
1103
|
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1109
1104
|
}) => Promise<Extrinsic>;
|
|
1110
|
-
declare const sendSerializedApiCall: (options: Omit<TSendOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1111
|
-
api: TPjsApiOrUrl;
|
|
1112
|
-
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1113
|
-
}) => Promise<TSerializedApiCall>;
|
|
1114
1105
|
|
|
1115
1106
|
declare const transfer_buildEthTransferOptions: typeof buildEthTransferOptions;
|
|
1116
1107
|
declare const transfer_send: typeof send;
|
|
1117
|
-
declare const transfer_sendSerializedApiCall: typeof sendSerializedApiCall;
|
|
1118
1108
|
declare const transfer_transferRelayToPara: typeof transferRelayToPara;
|
|
1119
|
-
declare const transfer_transferRelayToParaSerializedApiCall: typeof transferRelayToParaSerializedApiCall;
|
|
1120
1109
|
declare namespace transfer {
|
|
1121
|
-
export { transfer_buildEthTransferOptions as buildEthTransferOptions, transfer_send as send,
|
|
1110
|
+
export { transfer_buildEthTransferOptions as buildEthTransferOptions, transfer_send as send, transfer_transferRelayToPara as transferRelayToPara };
|
|
1122
1111
|
}
|
|
1123
1112
|
|
|
1124
1113
|
type TAssetClaimOptionsBase = {
|
|
@@ -1126,7 +1115,6 @@ type TAssetClaimOptionsBase = {
|
|
|
1126
1115
|
multiAssets: TMultiAsset[];
|
|
1127
1116
|
address: TAddress;
|
|
1128
1117
|
version?: TVersionClaimAssets;
|
|
1129
|
-
serializedApiCallEnabled?: boolean;
|
|
1130
1118
|
};
|
|
1131
1119
|
|
|
1132
1120
|
/**
|
|
@@ -1211,6 +1199,7 @@ type TGetOriginFeeDetailsOptionsBase = {
|
|
|
1211
1199
|
* @returns The assets object associated with the given node.
|
|
1212
1200
|
*/
|
|
1213
1201
|
declare const getAssetsObject: (node: TNodeWithRelayChains) => TNodeAssets;
|
|
1202
|
+
declare const isNodeEvm: (node: TNodeWithRelayChains) => boolean;
|
|
1214
1203
|
/**
|
|
1215
1204
|
* Retrieves the asset ID for a given symbol on a specified node.
|
|
1216
1205
|
*
|
|
@@ -1347,7 +1336,7 @@ declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
|
|
|
1347
1336
|
*/
|
|
1348
1337
|
declare const claimAssets: (options: TAssetClaimOptionsBase & {
|
|
1349
1338
|
api?: TPjsApiOrUrl;
|
|
1350
|
-
}) => Promise<
|
|
1339
|
+
}) => Promise<Extrinsic>;
|
|
1351
1340
|
declare const getOriginFeeDetails: (options: TGetOriginFeeDetailsOptionsBase & {
|
|
1352
1341
|
api?: TPjsApiOrUrl;
|
|
1353
1342
|
}) => Promise<TOriginFeeDetails>;
|
|
@@ -1375,8 +1364,9 @@ declare const assets_getSupportedAssets: typeof getSupportedAssets;
|
|
|
1375
1364
|
declare const assets_getTNode: typeof getTNode;
|
|
1376
1365
|
declare const assets_getTransferInfo: typeof getTransferInfo;
|
|
1377
1366
|
declare const assets_hasSupportForAsset: typeof hasSupportForAsset;
|
|
1367
|
+
declare const assets_isNodeEvm: typeof isNodeEvm;
|
|
1378
1368
|
declare namespace assets {
|
|
1379
|
-
export { assets_Foreign as Foreign, assets_ForeignAbstract as ForeignAbstract, assets_Native as Native, assets_Override as Override, 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_getRelayChainSymbol as getRelayChainSymbol, assets_getSupportedAssets as getSupportedAssets, assets_getTNode as getTNode, assets_getTransferInfo as getTransferInfo, assets_hasSupportForAsset as hasSupportForAsset };
|
|
1369
|
+
export { assets_Foreign as Foreign, assets_ForeignAbstract as ForeignAbstract, assets_Native as Native, assets_Override as Override, 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_getRelayChainSymbol as getRelayChainSymbol, assets_getSupportedAssets as getSupportedAssets, assets_getTNode as getTNode, assets_getTransferInfo as getTransferInfo, assets_hasSupportForAsset as hasSupportForAsset, assets_isNodeEvm as isNodeEvm };
|
|
1380
1370
|
}
|
|
1381
1371
|
|
|
1382
1372
|
/**
|
|
@@ -1501,13 +1491,11 @@ declare class GeneralBuilder$1<TApi, TRes> {
|
|
|
1501
1491
|
}
|
|
1502
1492
|
interface FinalBuilder<TRes> {
|
|
1503
1493
|
build: () => Promise<TRes>;
|
|
1504
|
-
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
1505
1494
|
}
|
|
1506
1495
|
interface UseKeepAliveFinalBuilder$1<TApi, TRes> extends IAddToBatchBuilder<TApi, TRes> {
|
|
1507
1496
|
useKeepAlive: (destApi: TApi) => this;
|
|
1508
1497
|
xcmVersion: (version: Version) => this;
|
|
1509
1498
|
build: () => Promise<TRes>;
|
|
1510
|
-
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
1511
1499
|
}
|
|
1512
1500
|
interface AddressBuilder<TApi, TRes> {
|
|
1513
1501
|
address: (address: TAddress, ahAddress?: string) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
|
|
@@ -1716,6 +1704,18 @@ declare class DuplicateAssetIdError extends Error {
|
|
|
1716
1704
|
constructor(id: string);
|
|
1717
1705
|
}
|
|
1718
1706
|
|
|
1707
|
+
/**
|
|
1708
|
+
* Error thrown when an invalid address is provided.
|
|
1709
|
+
*/
|
|
1710
|
+
declare class InvalidAddressError extends Error {
|
|
1711
|
+
/**
|
|
1712
|
+
* Constructs a new InvalidAddressError.
|
|
1713
|
+
*
|
|
1714
|
+
* @param message - The error message.
|
|
1715
|
+
*/
|
|
1716
|
+
constructor(message: string);
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
1719
|
declare const getNodeConfig: (node: TNodeDotKsmWithRelayChains) => TNodeConfig;
|
|
1720
1720
|
|
|
1721
1721
|
declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
|
|
@@ -1730,4 +1730,4 @@ declare const getNodeProvider: (node: TNodeDotKsmWithRelayChains) => string;
|
|
|
1730
1730
|
*/
|
|
1731
1731
|
declare const getParaId: (node: TNodeDotKsmWithRelayChains) => number;
|
|
1732
1732
|
|
|
1733
|
-
export { BatchMode, Builder,
|
|
1733
|
+
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, EvmBuilder, type Extrinsic, Foreign, ForeignAbstract, GeneralBuilder, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TAsset, type TAssetJsonMap, type TBatchOptions, type TBifrostToken, type TCheckKeepAliveOptions, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TEdJsonMap, type TEvmBuilderOptions, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type THexString$1 as THexString, type TJunction, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletJsonMap, type TPalletMap, type TPjsApi, type TPjsApiOrUrl, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, type UseKeepAliveFinalBuilder, Version, assets, buildEthTransferOptions, claimAssets, createApiInstanceForNode, createPolkadotJsApiCall, determineRelayChain, getAllAssetsSymbols, getAssetBalance, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProvider, getNodeProviders, getOriginFeeDetails, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isForeignAsset, isNodeEvm, isRelayChain, send, transferRelayToPara, transfer as xcmPallet };
|