@paraspell/sdk 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -13
- package/dist/index.cjs +671 -292
- package/dist/index.d.ts +103 -57
- package/dist/index.mjs +671 -293
- package/dist/papi/index.cjs +670 -295
- package/dist/papi/index.d.ts +92 -46
- package/dist/papi/index.mjs +670 -296
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { ApiPromise } from '@polkadot/api';
|
|
2
1
|
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
2
|
+
import * as _polkadot_api from '@polkadot/api';
|
|
3
|
+
import { ApiPromise } from '@polkadot/api';
|
|
3
4
|
import { Signer, AbstractProvider } from 'ethers';
|
|
4
5
|
import * as _polkadot_apps_config_endpoints_types from '@polkadot/apps-config/endpoints/types';
|
|
5
6
|
|
|
7
|
+
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
8
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
9
|
+
};
|
|
10
|
+
type TApiOrUrl<TApi> = TApi | string;
|
|
11
|
+
|
|
6
12
|
interface IPolkadotApi<TApi, TRes> {
|
|
7
|
-
setApi(api?: TApi): void;
|
|
13
|
+
setApi(api?: TApiOrUrl<TApi>): void;
|
|
8
14
|
getApi(): TApi;
|
|
9
15
|
init(node: TNodeWithRelayChains): Promise<void>;
|
|
10
16
|
createApiInstance: (wsUrl: string) => Promise<TApi>;
|
|
@@ -17,7 +23,9 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
17
23
|
getAssetHubForeignBalance(address: string, multiLocation: TMultiLocation): Promise<bigint>;
|
|
18
24
|
getBalanceForeignXTokens(address: string, asset: TAsset): Promise<bigint>;
|
|
19
25
|
getBalanceForeignAssetsAccount(address: string, assetId: bigint | number): Promise<bigint>;
|
|
26
|
+
getFromStorage(key: string): Promise<string>;
|
|
20
27
|
clone(): IPolkadotApi<TApi, TRes>;
|
|
28
|
+
createApiForNode(node: TNodeWithRelayChains): Promise<IPolkadotApi<TApi, TRes>>;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
declare abstract class ParachainNode<TApi, TRes> {
|
|
@@ -33,11 +41,11 @@ declare abstract class ParachainNode<TApi, TRes> {
|
|
|
33
41
|
get version(): Version;
|
|
34
42
|
get assetCheckEnabled(): boolean;
|
|
35
43
|
protected canUseXTokens(_: TSendInternalOptions<TApi, TRes>): boolean;
|
|
36
|
-
transfer(options: TSendInternalOptions<TApi, TRes>): TTransferReturn<TRes
|
|
44
|
+
transfer(options: TSendInternalOptions<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
37
45
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
38
46
|
getProvider(): string;
|
|
39
47
|
createApiInstance(api: IPolkadotApi<TApi, TRes>): Promise<TApi>;
|
|
40
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version,
|
|
48
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
41
49
|
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination?: TDestination, paraId?: number): TMultiLocationHeader;
|
|
42
50
|
getNativeAssetSymbol(): string;
|
|
43
51
|
}
|
|
@@ -59,10 +67,12 @@ declare class Crust<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
59
67
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
60
68
|
}
|
|
61
69
|
|
|
62
|
-
declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
70
|
+
declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
63
71
|
constructor();
|
|
64
72
|
private getCurrencySelection;
|
|
65
73
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
74
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
75
|
+
protected canUseXTokens({ currencySymbol, destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
declare class Bitgreen<TApi, TRes> extends ParachainNode<TApi, TRes> {
|
|
@@ -79,9 +89,11 @@ declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> im
|
|
|
79
89
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
80
90
|
}
|
|
81
91
|
|
|
82
|
-
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
92
|
+
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
83
93
|
constructor();
|
|
94
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
84
95
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
96
|
+
protected canUseXTokens({ destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
declare class Interlay<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -203,14 +215,14 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
|
|
|
203
215
|
handleBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>, targetChain: 'Polkadot' | 'Kusama'): TTransferReturn<TRes>;
|
|
204
216
|
handleEthBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
205
217
|
handleMythosTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
206
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
218
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
207
219
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
208
220
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
209
221
|
}
|
|
210
222
|
|
|
211
223
|
declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
212
224
|
constructor();
|
|
213
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
225
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
214
226
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
215
227
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
216
228
|
}
|
|
@@ -218,48 +230,48 @@ declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> imple
|
|
|
218
230
|
declare class CoretimeKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
219
231
|
constructor();
|
|
220
232
|
_assetCheckEnabled: boolean;
|
|
221
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
233
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
222
234
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
223
235
|
}
|
|
224
236
|
|
|
225
237
|
declare class CoretimePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
226
238
|
constructor();
|
|
227
239
|
_assetCheckEnabled: boolean;
|
|
228
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
240
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
229
241
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
230
242
|
}
|
|
231
243
|
|
|
232
244
|
declare class Encointer<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
233
245
|
constructor();
|
|
234
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
246
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
235
247
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
236
248
|
}
|
|
237
249
|
|
|
238
250
|
declare class RobonomicsKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
239
251
|
constructor();
|
|
240
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
252
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
241
253
|
}
|
|
242
254
|
|
|
243
255
|
declare class RobonomicsPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
244
256
|
constructor();
|
|
245
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
257
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
246
258
|
}
|
|
247
259
|
|
|
248
260
|
declare class PeoplePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
249
261
|
constructor();
|
|
250
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
262
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
251
263
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
252
264
|
}
|
|
253
265
|
|
|
254
266
|
declare class PeopleKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
255
267
|
constructor();
|
|
256
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
268
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
257
269
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
258
270
|
}
|
|
259
271
|
|
|
260
272
|
declare class Astar<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
261
273
|
constructor();
|
|
262
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
274
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
263
275
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
264
276
|
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
265
277
|
}
|
|
@@ -358,10 +370,6 @@ interface TPalletMap {
|
|
|
358
370
|
}
|
|
359
371
|
type TPalletJsonMap = Record<TNodePolkadotKusama, TPalletMap>;
|
|
360
372
|
|
|
361
|
-
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
362
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
363
|
-
};
|
|
364
|
-
|
|
365
373
|
type HexString$1 = `0x${string}`;
|
|
366
374
|
type PolkadotXCMTransferInput<TApi, TRes> = {
|
|
367
375
|
api: IPolkadotApi<TApi, TRes>;
|
|
@@ -378,6 +386,8 @@ type PolkadotXCMTransferInput<TApi, TRes> = {
|
|
|
378
386
|
feeAsset?: TCurrency;
|
|
379
387
|
overridedCurrency?: TMultiLocation | TMultiAsset[];
|
|
380
388
|
serializedApiCallEnabled?: boolean;
|
|
389
|
+
version?: Version;
|
|
390
|
+
ahAddress?: string;
|
|
381
391
|
};
|
|
382
392
|
type XTokensTransferInput<TApi, TRes> = {
|
|
383
393
|
api: IPolkadotApi<TApi, TRes>;
|
|
@@ -407,7 +417,7 @@ type XTransferTransferInput<TApi, TRes> = {
|
|
|
407
417
|
serializedApiCallEnabled?: boolean;
|
|
408
418
|
};
|
|
409
419
|
type IPolkadotXCMTransfer = {
|
|
410
|
-
transferPolkadotXCM: <TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>) => TTransferReturn<TRes
|
|
420
|
+
transferPolkadotXCM: <TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>) => Promise<TTransferReturn<TRes>>;
|
|
411
421
|
};
|
|
412
422
|
type IXTokensTransfer = {
|
|
413
423
|
transferXTokens: <TApi, TRes>(input: XTokensTransferInput<TApi, TRes>) => TTransferReturn<TRes>;
|
|
@@ -442,6 +452,10 @@ type TSendBaseOptions<TApi, TRes> = {
|
|
|
442
452
|
* The destination address. A SS58 or H160 format.
|
|
443
453
|
*/
|
|
444
454
|
address: TAddress;
|
|
455
|
+
/**
|
|
456
|
+
* The optional AssetHub address used when transfering to Ethereum
|
|
457
|
+
*/
|
|
458
|
+
ahAddress?: string;
|
|
445
459
|
/**
|
|
446
460
|
* The destination node or multi-location
|
|
447
461
|
*/
|
|
@@ -651,7 +665,7 @@ declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
651
665
|
|
|
652
666
|
declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
653
667
|
constructor();
|
|
654
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
668
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
655
669
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
656
670
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
657
671
|
}
|
|
@@ -664,7 +678,7 @@ declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IX
|
|
|
664
678
|
|
|
665
679
|
declare class Shiden<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
666
680
|
constructor();
|
|
667
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
681
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
668
682
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
669
683
|
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
670
684
|
}
|
|
@@ -682,7 +696,7 @@ declare class Nodle<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
682
696
|
|
|
683
697
|
declare class NeuroWeb<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
684
698
|
constructor();
|
|
685
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
699
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
686
700
|
}
|
|
687
701
|
|
|
688
702
|
declare class Pendulum<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -703,7 +717,7 @@ declare class Zeitgeist<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
703
717
|
|
|
704
718
|
declare class Collectives<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
705
719
|
constructor();
|
|
706
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
720
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
707
721
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
708
722
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
709
723
|
}
|
|
@@ -720,12 +734,12 @@ declare class Phala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
720
734
|
|
|
721
735
|
declare class Subsocial<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
722
736
|
constructor();
|
|
723
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
737
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
724
738
|
}
|
|
725
739
|
|
|
726
740
|
declare class KiltSpiritnet<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
727
741
|
constructor();
|
|
728
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
742
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
729
743
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
730
744
|
getProvider(): string;
|
|
731
745
|
}
|
|
@@ -738,14 +752,14 @@ declare class Curio<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
738
752
|
declare class BridgeHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
739
753
|
constructor();
|
|
740
754
|
_assetCheckEnabled: boolean;
|
|
741
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
755
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
742
756
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
743
757
|
}
|
|
744
758
|
|
|
745
759
|
declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
746
760
|
constructor();
|
|
747
761
|
_assetCheckEnabled: boolean;
|
|
748
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
762
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
749
763
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
750
764
|
}
|
|
751
765
|
|
|
@@ -755,7 +769,7 @@ declare class Ethereum<TApi, TRes> extends ParachainNode<TApi, TRes> {
|
|
|
755
769
|
|
|
756
770
|
declare class Mythos<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
757
771
|
constructor();
|
|
758
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
772
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
759
773
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
760
774
|
}
|
|
761
775
|
|
|
@@ -991,6 +1005,8 @@ type TGetTransferInfoOptionsBase = {
|
|
|
991
1005
|
};
|
|
992
1006
|
type TGetTransferInfoOptions<TApi, TRes> = WithApi<TGetTransferInfoOptionsBase, TApi, TRes>;
|
|
993
1007
|
|
|
1008
|
+
type TPjsApi = ApiPromise;
|
|
1009
|
+
type TPjsApiOrUrl = TApiOrUrl<TPjsApi>;
|
|
994
1010
|
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
995
1011
|
|
|
996
1012
|
declare const buildEthTransferOptions: ({ currency, to, address, destAddress, amount }: TSerializeEthTransferOptions) => Promise<TSerializedEthTransfer>;
|
|
@@ -1002,26 +1018,26 @@ declare const buildEthTransferOptions: ({ currency, to, address, destAddress, am
|
|
|
1002
1018
|
*
|
|
1003
1019
|
* @returns An extrinsic to be signed and sent.
|
|
1004
1020
|
*/
|
|
1005
|
-
declare const transferRelayToPara: (options: Omit<TRelayToParaOptions<
|
|
1006
|
-
api:
|
|
1007
|
-
destApiForKeepAlive:
|
|
1021
|
+
declare const transferRelayToPara: (options: Omit<TRelayToParaOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1022
|
+
api: TPjsApiOrUrl;
|
|
1023
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1008
1024
|
}) => Promise<Extrinsic>;
|
|
1009
|
-
declare const transferRelayToParaSerializedApiCall: (options: Omit<TRelayToParaOptions<
|
|
1010
|
-
api:
|
|
1011
|
-
destApiForKeepAlive:
|
|
1025
|
+
declare const transferRelayToParaSerializedApiCall: (options: Omit<TRelayToParaOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1026
|
+
api: TPjsApiOrUrl;
|
|
1027
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1012
1028
|
}) => Promise<TSerializedApiCall>;
|
|
1013
1029
|
/**
|
|
1014
1030
|
* Transfers assets from parachain to another parachain or relay chain.
|
|
1015
1031
|
* @param options - The transfer options.
|
|
1016
1032
|
* @returns An extrinsic to be signed and sent.
|
|
1017
1033
|
*/
|
|
1018
|
-
declare const send: (options: Omit<TSendOptions<
|
|
1019
|
-
api:
|
|
1020
|
-
destApiForKeepAlive:
|
|
1034
|
+
declare const send: (options: Omit<TSendOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1035
|
+
api: TPjsApiOrUrl;
|
|
1036
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1021
1037
|
}) => Promise<Extrinsic>;
|
|
1022
|
-
declare const sendSerializedApiCall: (options: Omit<TSendOptions<
|
|
1023
|
-
api:
|
|
1024
|
-
destApiForKeepAlive:
|
|
1038
|
+
declare const sendSerializedApiCall: (options: Omit<TSendOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1039
|
+
api: TPjsApiOrUrl;
|
|
1040
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1025
1041
|
}) => Promise<TSerializedApiCall>;
|
|
1026
1042
|
|
|
1027
1043
|
declare const transfer_buildEthTransferOptions: typeof buildEthTransferOptions;
|
|
@@ -1085,6 +1101,32 @@ type TGetAssetBalanceOptionsBase = {
|
|
|
1085
1101
|
*/
|
|
1086
1102
|
currency: TCurrencyCore;
|
|
1087
1103
|
};
|
|
1104
|
+
type TGetOriginFeeDetailsOptionsBase = {
|
|
1105
|
+
/**
|
|
1106
|
+
* The origin node.
|
|
1107
|
+
*/
|
|
1108
|
+
origin: TNodeDotKsmWithRelayChains;
|
|
1109
|
+
/**
|
|
1110
|
+
* The destination node.
|
|
1111
|
+
*/
|
|
1112
|
+
destination: TNodeDotKsmWithRelayChains;
|
|
1113
|
+
/**
|
|
1114
|
+
* The currency to transfer.
|
|
1115
|
+
*/
|
|
1116
|
+
currency: TCurrencyCore;
|
|
1117
|
+
/**
|
|
1118
|
+
* The amount to transfer.
|
|
1119
|
+
*/
|
|
1120
|
+
amount: string;
|
|
1121
|
+
/**
|
|
1122
|
+
* The account to transfer from.
|
|
1123
|
+
*/
|
|
1124
|
+
account: string;
|
|
1125
|
+
/**
|
|
1126
|
+
* The fee margin percentage.
|
|
1127
|
+
*/
|
|
1128
|
+
feeMarginPercentage?: number;
|
|
1129
|
+
};
|
|
1088
1130
|
|
|
1089
1131
|
/**
|
|
1090
1132
|
* Retrieves the assets object for a given node containing the native and foreign assets.
|
|
@@ -1197,7 +1239,7 @@ declare const getSupportedAssets: (origin: TNodeWithRelayChains, destination: TN
|
|
|
1197
1239
|
* @returns The native balance as a bigint.
|
|
1198
1240
|
*/
|
|
1199
1241
|
declare const getBalanceNative: (options: TGetBalanceNativeOptionsBase & {
|
|
1200
|
-
api?:
|
|
1242
|
+
api?: TPjsApiOrUrl;
|
|
1201
1243
|
}) => Promise<bigint>;
|
|
1202
1244
|
/**
|
|
1203
1245
|
* Retrieves the balance of a foreign asset for a given account on a specified node.
|
|
@@ -1205,7 +1247,7 @@ declare const getBalanceNative: (options: TGetBalanceNativeOptionsBase & {
|
|
|
1205
1247
|
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
1206
1248
|
*/
|
|
1207
1249
|
declare const getBalanceForeign: (options: TGetBalanceForeignOptionsBase & {
|
|
1208
|
-
api?:
|
|
1250
|
+
api?: TPjsApiOrUrl;
|
|
1209
1251
|
}) => Promise<bigint>;
|
|
1210
1252
|
/**
|
|
1211
1253
|
* Retrieves detailed transfer information for a cross-chain transfer.
|
|
@@ -1213,7 +1255,7 @@ declare const getBalanceForeign: (options: TGetBalanceForeignOptionsBase & {
|
|
|
1213
1255
|
* @returns A Promise that resolves to the transfer information.
|
|
1214
1256
|
*/
|
|
1215
1257
|
declare const getTransferInfo: (options: TGetTransferInfoOptionsBase & {
|
|
1216
|
-
api?:
|
|
1258
|
+
api?: TPjsApiOrUrl;
|
|
1217
1259
|
}) => Promise<TTransferInfo>;
|
|
1218
1260
|
/**
|
|
1219
1261
|
* Retrieves the asset balance for a given account on a specified node.
|
|
@@ -1221,7 +1263,7 @@ declare const getTransferInfo: (options: TGetTransferInfoOptionsBase & {
|
|
|
1221
1263
|
* @returns The asset balance as a bigint.
|
|
1222
1264
|
*/
|
|
1223
1265
|
declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
|
|
1224
|
-
api?:
|
|
1266
|
+
api?: TPjsApiOrUrl;
|
|
1225
1267
|
}) => Promise<bigint>;
|
|
1226
1268
|
/**
|
|
1227
1269
|
* Claims assets from a parachain.
|
|
@@ -1229,8 +1271,11 @@ declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
|
|
|
1229
1271
|
* @returns An extrinsic representing the claim transaction.
|
|
1230
1272
|
*/
|
|
1231
1273
|
declare const claimAssets: (options: TAssetClaimOptionsBase & {
|
|
1232
|
-
api?:
|
|
1233
|
-
}) => Promise<
|
|
1274
|
+
api?: TPjsApiOrUrl;
|
|
1275
|
+
}) => Promise<TSerializedApiCall | Extrinsic>;
|
|
1276
|
+
declare const getOriginFeeDetails: (options: TGetOriginFeeDetailsOptionsBase & {
|
|
1277
|
+
api?: TPjsApiOrUrl;
|
|
1278
|
+
}) => Promise<TOriginFeeDetails>;
|
|
1234
1279
|
|
|
1235
1280
|
declare const assets_claimAssets: typeof claimAssets;
|
|
1236
1281
|
declare const assets_getAllAssetsSymbols: typeof getAllAssetsSymbols;
|
|
@@ -1244,6 +1289,7 @@ declare const assets_getBalanceNative: typeof getBalanceNative;
|
|
|
1244
1289
|
declare const assets_getExistentialDeposit: typeof getExistentialDeposit;
|
|
1245
1290
|
declare const assets_getNativeAssetSymbol: typeof getNativeAssetSymbol;
|
|
1246
1291
|
declare const assets_getNativeAssets: typeof getNativeAssets;
|
|
1292
|
+
declare const assets_getOriginFeeDetails: typeof getOriginFeeDetails;
|
|
1247
1293
|
declare const assets_getOtherAssets: typeof getOtherAssets;
|
|
1248
1294
|
declare const assets_getParaId: typeof getParaId;
|
|
1249
1295
|
declare const assets_getRelayChainSymbol: typeof getRelayChainSymbol;
|
|
@@ -1252,7 +1298,7 @@ declare const assets_getTNode: typeof getTNode;
|
|
|
1252
1298
|
declare const assets_getTransferInfo: typeof getTransferInfo;
|
|
1253
1299
|
declare const assets_hasSupportForAsset: typeof hasSupportForAsset;
|
|
1254
1300
|
declare namespace assets {
|
|
1255
|
-
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_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 };
|
|
1301
|
+
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 };
|
|
1256
1302
|
}
|
|
1257
1303
|
|
|
1258
1304
|
/**
|
|
@@ -1386,7 +1432,7 @@ interface UseKeepAliveFinalBuilder$1<TApi, TRes> extends IAddToBatchBuilder<TApi
|
|
|
1386
1432
|
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
1387
1433
|
}
|
|
1388
1434
|
interface AddressBuilder<TApi, TRes> {
|
|
1389
|
-
address: (address: TAddress) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
|
|
1435
|
+
address: (address: TAddress, ahAddress?: string) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
|
|
1390
1436
|
}
|
|
1391
1437
|
interface AmountBuilder<TApi, TRes> {
|
|
1392
1438
|
amount: (amount: TAmount | null) => AddressBuilder<TApi, TRes>;
|
|
@@ -1468,17 +1514,17 @@ declare const EvmBuilder: (provider: AbstractProvider) => EvmBuilderClass;
|
|
|
1468
1514
|
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
1469
1515
|
* @returns A new Builder instance.
|
|
1470
1516
|
*/
|
|
1471
|
-
declare const Builder: (api?:
|
|
1472
|
-
type UseKeepAliveFinalBuilder = UseKeepAliveFinalBuilder$1<
|
|
1517
|
+
declare const Builder: (api?: TPjsApiOrUrl) => GeneralBuilder$1<_polkadot_api.ApiPromise, Extrinsic>;
|
|
1518
|
+
type UseKeepAliveFinalBuilder = UseKeepAliveFinalBuilder$1<TPjsApi, Extrinsic>;
|
|
1473
1519
|
declare const GeneralBuilder: {
|
|
1474
|
-
new (batchManager: BatchTransactionManager<ApiPromise, Extrinsic>, api: IPolkadotApi<ApiPromise, Extrinsic>, _from?: TNode | undefined, _to?: TDestination | undefined): GeneralBuilder$1<ApiPromise, Extrinsic>;
|
|
1520
|
+
new (batchManager: BatchTransactionManager<_polkadot_api.ApiPromise, Extrinsic>, api: IPolkadotApi<_polkadot_api.ApiPromise, Extrinsic>, _from?: TNode | undefined, _to?: TDestination | undefined): GeneralBuilder$1<_polkadot_api.ApiPromise, Extrinsic>;
|
|
1475
1521
|
};
|
|
1476
1522
|
|
|
1477
|
-
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<ApiPromise>;
|
|
1523
|
+
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
|
|
1478
1524
|
declare const createPolkadotJsApiCall: <TArgs extends Record<string, unknown>, TResult>(apiCall: (options: TArgs & {
|
|
1479
|
-
api: IPolkadotApi<
|
|
1525
|
+
api: IPolkadotApi<TPjsApi, Extrinsic>;
|
|
1480
1526
|
}) => Promise<TResult>) => (options: TArgs & {
|
|
1481
|
-
api?:
|
|
1527
|
+
api?: TPjsApiOrUrl;
|
|
1482
1528
|
}) => Promise<TResult>;
|
|
1483
1529
|
|
|
1484
1530
|
/**
|
|
@@ -1615,4 +1661,4 @@ declare class DuplicateAssetIdError extends Error {
|
|
|
1615
1661
|
constructor(id: string);
|
|
1616
1662
|
}
|
|
1617
1663
|
|
|
1618
|
-
export { BatchMode, Builder, type CheckKeepAliveOptions, DuplicateAssetError, DuplicateAssetIdError, EvmBuilder, type Extrinsic, GeneralBuilder, type HexString$1 as HexString, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionParachain, type JunctionType, type Junctions, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, type 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 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, createPolkadotJsApiCall, determineRelayChain, getAllAssetsSymbols, getAllNodeProviders, getAssetBalance, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaSerializedApiCall, transfer as xcmPallet };
|
|
1664
|
+
export { BatchMode, Builder, type CheckKeepAliveOptions, DuplicateAssetError, DuplicateAssetIdError, EvmBuilder, type Extrinsic, GeneralBuilder, type HexString$1 as HexString, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionParachain, type JunctionType, type Junctions, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, type 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 TPjsApi, type TPjsApiOrUrl, 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, createPolkadotJsApiCall, 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, transferRelayToParaSerializedApiCall, transfer as xcmPallet };
|