@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/papi/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Signer, AbstractProvider } from 'ethers';
|
|
2
|
-
import
|
|
2
|
+
import * as polkadot_api from 'polkadot-api';
|
|
3
|
+
import { PolkadotClient, UnsafeTransaction } from 'polkadot-api';
|
|
3
4
|
import * as _polkadot_apps_config_endpoints_types from '@polkadot/apps-config/endpoints/types';
|
|
4
5
|
|
|
6
|
+
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
7
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
8
|
+
};
|
|
9
|
+
type TApiOrUrl<TApi> = TApi | string;
|
|
10
|
+
|
|
5
11
|
interface IPolkadotApi<TApi, TRes> {
|
|
6
|
-
setApi(api?: TApi): void;
|
|
12
|
+
setApi(api?: TApiOrUrl<TApi>): void;
|
|
7
13
|
getApi(): TApi;
|
|
8
14
|
init(node: TNodeWithRelayChains): Promise<void>;
|
|
9
15
|
createApiInstance: (wsUrl: string) => Promise<TApi>;
|
|
@@ -16,7 +22,9 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
16
22
|
getAssetHubForeignBalance(address: string, multiLocation: TMultiLocation): Promise<bigint>;
|
|
17
23
|
getBalanceForeignXTokens(address: string, asset: TAsset): Promise<bigint>;
|
|
18
24
|
getBalanceForeignAssetsAccount(address: string, assetId: bigint | number): Promise<bigint>;
|
|
25
|
+
getFromStorage(key: string): Promise<string>;
|
|
19
26
|
clone(): IPolkadotApi<TApi, TRes>;
|
|
27
|
+
createApiForNode(node: TNodeWithRelayChains): Promise<IPolkadotApi<TApi, TRes>>;
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
declare abstract class ParachainNode<TApi, TRes> {
|
|
@@ -32,11 +40,11 @@ declare abstract class ParachainNode<TApi, TRes> {
|
|
|
32
40
|
get version(): Version;
|
|
33
41
|
get assetCheckEnabled(): boolean;
|
|
34
42
|
protected canUseXTokens(_: TSendInternalOptions<TApi, TRes>): boolean;
|
|
35
|
-
transfer(options: TSendInternalOptions<TApi, TRes>): TTransferReturn<TRes
|
|
43
|
+
transfer(options: TSendInternalOptions<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
36
44
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
37
45
|
getProvider(): string;
|
|
38
46
|
createApiInstance(api: IPolkadotApi<TApi, TRes>): Promise<TApi>;
|
|
39
|
-
createCurrencySpec(amount: string, scenario: TScenario, version: Version,
|
|
47
|
+
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
40
48
|
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination?: TDestination, paraId?: number): TMultiLocationHeader;
|
|
41
49
|
getNativeAssetSymbol(): string;
|
|
42
50
|
}
|
|
@@ -58,10 +66,12 @@ declare class Crust<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
58
66
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
69
|
+
declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
62
70
|
constructor();
|
|
63
71
|
private getCurrencySelection;
|
|
64
72
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
73
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
74
|
+
protected canUseXTokens({ currencySymbol, destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
declare class Bitgreen<TApi, TRes> extends ParachainNode<TApi, TRes> {
|
|
@@ -78,9 +88,11 @@ declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> im
|
|
|
78
88
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
79
89
|
}
|
|
80
90
|
|
|
81
|
-
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
91
|
+
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
82
92
|
constructor();
|
|
93
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
83
94
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
95
|
+
protected canUseXTokens({ destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
declare class Interlay<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -202,14 +214,14 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
|
|
|
202
214
|
handleBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>, targetChain: 'Polkadot' | 'Kusama'): TTransferReturn<TRes>;
|
|
203
215
|
handleEthBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
204
216
|
handleMythosTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
205
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
217
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
206
218
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
207
219
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
208
220
|
}
|
|
209
221
|
|
|
210
222
|
declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
211
223
|
constructor();
|
|
212
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
224
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
213
225
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
214
226
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
215
227
|
}
|
|
@@ -217,48 +229,48 @@ declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> imple
|
|
|
217
229
|
declare class CoretimeKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
218
230
|
constructor();
|
|
219
231
|
_assetCheckEnabled: boolean;
|
|
220
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
232
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
221
233
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
222
234
|
}
|
|
223
235
|
|
|
224
236
|
declare class CoretimePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
225
237
|
constructor();
|
|
226
238
|
_assetCheckEnabled: boolean;
|
|
227
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
239
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
228
240
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
229
241
|
}
|
|
230
242
|
|
|
231
243
|
declare class Encointer<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
232
244
|
constructor();
|
|
233
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
245
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
234
246
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
235
247
|
}
|
|
236
248
|
|
|
237
249
|
declare class RobonomicsKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
238
250
|
constructor();
|
|
239
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
251
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
240
252
|
}
|
|
241
253
|
|
|
242
254
|
declare class RobonomicsPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
243
255
|
constructor();
|
|
244
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
256
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
245
257
|
}
|
|
246
258
|
|
|
247
259
|
declare class PeoplePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
248
260
|
constructor();
|
|
249
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
261
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
250
262
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
251
263
|
}
|
|
252
264
|
|
|
253
265
|
declare class PeopleKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
254
266
|
constructor();
|
|
255
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
267
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
256
268
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
257
269
|
}
|
|
258
270
|
|
|
259
271
|
declare class Astar<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
260
272
|
constructor();
|
|
261
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
273
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
262
274
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
263
275
|
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
264
276
|
}
|
|
@@ -357,10 +369,6 @@ interface TPalletMap {
|
|
|
357
369
|
}
|
|
358
370
|
type TPalletJsonMap = Record<TNodePolkadotKusama, TPalletMap>;
|
|
359
371
|
|
|
360
|
-
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
361
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
362
|
-
};
|
|
363
|
-
|
|
364
372
|
type HexString$1 = `0x${string}`;
|
|
365
373
|
type PolkadotXCMTransferInput<TApi, TRes> = {
|
|
366
374
|
api: IPolkadotApi<TApi, TRes>;
|
|
@@ -377,6 +385,8 @@ type PolkadotXCMTransferInput<TApi, TRes> = {
|
|
|
377
385
|
feeAsset?: TCurrency;
|
|
378
386
|
overridedCurrency?: TMultiLocation | TMultiAsset[];
|
|
379
387
|
serializedApiCallEnabled?: boolean;
|
|
388
|
+
version?: Version;
|
|
389
|
+
ahAddress?: string;
|
|
380
390
|
};
|
|
381
391
|
type XTokensTransferInput<TApi, TRes> = {
|
|
382
392
|
api: IPolkadotApi<TApi, TRes>;
|
|
@@ -406,7 +416,7 @@ type XTransferTransferInput<TApi, TRes> = {
|
|
|
406
416
|
serializedApiCallEnabled?: boolean;
|
|
407
417
|
};
|
|
408
418
|
type IPolkadotXCMTransfer = {
|
|
409
|
-
transferPolkadotXCM: <TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>) => TTransferReturn<TRes
|
|
419
|
+
transferPolkadotXCM: <TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>) => Promise<TTransferReturn<TRes>>;
|
|
410
420
|
};
|
|
411
421
|
type IXTokensTransfer = {
|
|
412
422
|
transferXTokens: <TApi, TRes>(input: XTokensTransferInput<TApi, TRes>) => TTransferReturn<TRes>;
|
|
@@ -441,6 +451,10 @@ type TSendBaseOptions<TApi, TRes> = {
|
|
|
441
451
|
* The destination address. A SS58 or H160 format.
|
|
442
452
|
*/
|
|
443
453
|
address: TAddress;
|
|
454
|
+
/**
|
|
455
|
+
* The optional AssetHub address used when transfering to Ethereum
|
|
456
|
+
*/
|
|
457
|
+
ahAddress?: string;
|
|
444
458
|
/**
|
|
445
459
|
* The destination node or multi-location
|
|
446
460
|
*/
|
|
@@ -650,7 +664,7 @@ declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
650
664
|
|
|
651
665
|
declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
652
666
|
constructor();
|
|
653
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
667
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
654
668
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
655
669
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
656
670
|
}
|
|
@@ -663,7 +677,7 @@ declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IX
|
|
|
663
677
|
|
|
664
678
|
declare class Shiden<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
665
679
|
constructor();
|
|
666
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
680
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
667
681
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
668
682
|
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
669
683
|
}
|
|
@@ -681,7 +695,7 @@ declare class Nodle<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
681
695
|
|
|
682
696
|
declare class NeuroWeb<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
683
697
|
constructor();
|
|
684
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
698
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
685
699
|
}
|
|
686
700
|
|
|
687
701
|
declare class Pendulum<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -702,7 +716,7 @@ declare class Zeitgeist<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
702
716
|
|
|
703
717
|
declare class Collectives<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
704
718
|
constructor();
|
|
705
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
719
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
706
720
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
707
721
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
708
722
|
}
|
|
@@ -719,12 +733,12 @@ declare class Phala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
719
733
|
|
|
720
734
|
declare class Subsocial<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
721
735
|
constructor();
|
|
722
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
736
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
723
737
|
}
|
|
724
738
|
|
|
725
739
|
declare class KiltSpiritnet<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
726
740
|
constructor();
|
|
727
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
741
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
728
742
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
729
743
|
getProvider(): string;
|
|
730
744
|
}
|
|
@@ -737,14 +751,14 @@ declare class Curio<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
737
751
|
declare class BridgeHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
738
752
|
constructor();
|
|
739
753
|
_assetCheckEnabled: boolean;
|
|
740
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
754
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
741
755
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
742
756
|
}
|
|
743
757
|
|
|
744
758
|
declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
745
759
|
constructor();
|
|
746
760
|
_assetCheckEnabled: boolean;
|
|
747
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
761
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
748
762
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
749
763
|
}
|
|
750
764
|
|
|
@@ -754,7 +768,7 @@ declare class Ethereum<TApi, TRes> extends ParachainNode<TApi, TRes> {
|
|
|
754
768
|
|
|
755
769
|
declare class Mythos<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
756
770
|
constructor();
|
|
757
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
771
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
758
772
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
759
773
|
}
|
|
760
774
|
|
|
@@ -1016,6 +1030,10 @@ type TAssetClaimOptionsBase = {
|
|
|
1016
1030
|
serializedApiCallEnabled?: boolean;
|
|
1017
1031
|
};
|
|
1018
1032
|
|
|
1033
|
+
type TPapiApi = PolkadotClient;
|
|
1034
|
+
type TPapiApiOrUrl = TApiOrUrl<PolkadotClient>;
|
|
1035
|
+
type TPapiTransaction = UnsafeTransaction<any, string, string, any>;
|
|
1036
|
+
|
|
1019
1037
|
/**
|
|
1020
1038
|
* Retrieves the native asset balance for a given account on a specified node.
|
|
1021
1039
|
*/
|
|
@@ -1060,8 +1078,32 @@ type TGetAssetBalanceOptionsBase = {
|
|
|
1060
1078
|
*/
|
|
1061
1079
|
currency: TCurrencyCore;
|
|
1062
1080
|
};
|
|
1063
|
-
|
|
1064
|
-
|
|
1081
|
+
type TGetOriginFeeDetailsOptionsBase = {
|
|
1082
|
+
/**
|
|
1083
|
+
* The origin node.
|
|
1084
|
+
*/
|
|
1085
|
+
origin: TNodeDotKsmWithRelayChains;
|
|
1086
|
+
/**
|
|
1087
|
+
* The destination node.
|
|
1088
|
+
*/
|
|
1089
|
+
destination: TNodeDotKsmWithRelayChains;
|
|
1090
|
+
/**
|
|
1091
|
+
* The currency to transfer.
|
|
1092
|
+
*/
|
|
1093
|
+
currency: TCurrencyCore;
|
|
1094
|
+
/**
|
|
1095
|
+
* The amount to transfer.
|
|
1096
|
+
*/
|
|
1097
|
+
amount: string;
|
|
1098
|
+
/**
|
|
1099
|
+
* The account to transfer from.
|
|
1100
|
+
*/
|
|
1101
|
+
account: string;
|
|
1102
|
+
/**
|
|
1103
|
+
* The fee margin percentage.
|
|
1104
|
+
*/
|
|
1105
|
+
feeMarginPercentage?: number;
|
|
1106
|
+
};
|
|
1065
1107
|
|
|
1066
1108
|
/**
|
|
1067
1109
|
* Retrieves the assets object for a given node containing the native and foreign assets.
|
|
@@ -1174,7 +1216,7 @@ declare const getSupportedAssets: (origin: TNodeWithRelayChains, destination: TN
|
|
|
1174
1216
|
* @returns The native balance as a bigint.
|
|
1175
1217
|
*/
|
|
1176
1218
|
declare const getBalanceNative: (options: TGetBalanceNativeOptionsBase & {
|
|
1177
|
-
api?:
|
|
1219
|
+
api?: TPapiApiOrUrl;
|
|
1178
1220
|
}) => Promise<bigint>;
|
|
1179
1221
|
/**
|
|
1180
1222
|
* Retrieves the balance of a foreign asset for a given account on a specified node.
|
|
@@ -1182,7 +1224,7 @@ declare const getBalanceNative: (options: TGetBalanceNativeOptionsBase & {
|
|
|
1182
1224
|
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
1183
1225
|
*/
|
|
1184
1226
|
declare const getBalanceForeign: (options: TGetBalanceForeignOptionsBase & {
|
|
1185
|
-
api?:
|
|
1227
|
+
api?: TPapiApiOrUrl;
|
|
1186
1228
|
}) => Promise<bigint>;
|
|
1187
1229
|
/**
|
|
1188
1230
|
* Retrieves detailed transfer information for a cross-chain transfer.
|
|
@@ -1190,7 +1232,7 @@ declare const getBalanceForeign: (options: TGetBalanceForeignOptionsBase & {
|
|
|
1190
1232
|
* @returns A Promise that resolves to the transfer information.
|
|
1191
1233
|
*/
|
|
1192
1234
|
declare const getTransferInfo: (options: TGetTransferInfoOptionsBase & {
|
|
1193
|
-
api?:
|
|
1235
|
+
api?: TPapiApiOrUrl;
|
|
1194
1236
|
}) => Promise<TTransferInfo>;
|
|
1195
1237
|
/**
|
|
1196
1238
|
* Retrieves the asset balance for a given account on a specified node.
|
|
@@ -1198,7 +1240,7 @@ declare const getTransferInfo: (options: TGetTransferInfoOptionsBase & {
|
|
|
1198
1240
|
* @returns The asset balance as a bigint.
|
|
1199
1241
|
*/
|
|
1200
1242
|
declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
|
|
1201
|
-
api?:
|
|
1243
|
+
api?: TPapiApiOrUrl;
|
|
1202
1244
|
}) => Promise<bigint>;
|
|
1203
1245
|
/**
|
|
1204
1246
|
* Claims assets from a parachain.
|
|
@@ -1206,8 +1248,11 @@ declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
|
|
|
1206
1248
|
* @returns An extrinsic representing the claim transaction.
|
|
1207
1249
|
*/
|
|
1208
1250
|
declare const claimAssets: (options: TAssetClaimOptionsBase & {
|
|
1209
|
-
api?:
|
|
1251
|
+
api?: TPapiApiOrUrl;
|
|
1210
1252
|
}) => Promise<TSerializedApiCall | TPapiTransaction>;
|
|
1253
|
+
declare const getOriginFeeDetails: (options: TGetOriginFeeDetailsOptionsBase & {
|
|
1254
|
+
api?: TPapiApiOrUrl;
|
|
1255
|
+
}) => Promise<TOriginFeeDetails>;
|
|
1211
1256
|
|
|
1212
1257
|
declare const assets_claimAssets: typeof claimAssets;
|
|
1213
1258
|
declare const assets_getAllAssetsSymbols: typeof getAllAssetsSymbols;
|
|
@@ -1221,6 +1266,7 @@ declare const assets_getBalanceNative: typeof getBalanceNative;
|
|
|
1221
1266
|
declare const assets_getExistentialDeposit: typeof getExistentialDeposit;
|
|
1222
1267
|
declare const assets_getNativeAssetSymbol: typeof getNativeAssetSymbol;
|
|
1223
1268
|
declare const assets_getNativeAssets: typeof getNativeAssets;
|
|
1269
|
+
declare const assets_getOriginFeeDetails: typeof getOriginFeeDetails;
|
|
1224
1270
|
declare const assets_getOtherAssets: typeof getOtherAssets;
|
|
1225
1271
|
declare const assets_getParaId: typeof getParaId;
|
|
1226
1272
|
declare const assets_getRelayChainSymbol: typeof getRelayChainSymbol;
|
|
@@ -1229,7 +1275,7 @@ declare const assets_getTNode: typeof getTNode;
|
|
|
1229
1275
|
declare const assets_getTransferInfo: typeof getTransferInfo;
|
|
1230
1276
|
declare const assets_hasSupportForAsset: typeof hasSupportForAsset;
|
|
1231
1277
|
declare namespace assets {
|
|
1232
|
-
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 };
|
|
1278
|
+
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 };
|
|
1233
1279
|
}
|
|
1234
1280
|
|
|
1235
1281
|
/**
|
|
@@ -1363,7 +1409,7 @@ interface UseKeepAliveFinalBuilder$1<TApi, TRes> extends IAddToBatchBuilder<TApi
|
|
|
1363
1409
|
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
1364
1410
|
}
|
|
1365
1411
|
interface AddressBuilder<TApi, TRes> {
|
|
1366
|
-
address: (address: TAddress) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
|
|
1412
|
+
address: (address: TAddress, ahAddress?: string) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
|
|
1367
1413
|
}
|
|
1368
1414
|
interface AmountBuilder<TApi, TRes> {
|
|
1369
1415
|
amount: (amount: TAmount | null) => AddressBuilder<TApi, TRes>;
|
|
@@ -1445,17 +1491,17 @@ declare const EvmBuilder: (provider: AbstractProvider) => EvmBuilderClass;
|
|
|
1445
1491
|
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
1446
1492
|
* @returns A new Builder instance.
|
|
1447
1493
|
*/
|
|
1448
|
-
declare const Builder: (api?:
|
|
1449
|
-
type UseKeepAliveFinalBuilder = UseKeepAliveFinalBuilder$1<
|
|
1494
|
+
declare const Builder: (api?: TPapiApiOrUrl) => GeneralBuilder$1<polkadot_api.PolkadotClient, TPapiTransaction>;
|
|
1495
|
+
type UseKeepAliveFinalBuilder = UseKeepAliveFinalBuilder$1<TPapiApi, TPapiTransaction>;
|
|
1450
1496
|
declare const GeneralBuilder: {
|
|
1451
|
-
new (batchManager: BatchTransactionManager<PolkadotClient, TPapiTransaction>, api: IPolkadotApi<PolkadotClient, TPapiTransaction>, _from?: TNode | undefined, _to?: TDestination | undefined): GeneralBuilder$1<PolkadotClient, TPapiTransaction>;
|
|
1497
|
+
new (batchManager: BatchTransactionManager<polkadot_api.PolkadotClient, TPapiTransaction>, api: IPolkadotApi<polkadot_api.PolkadotClient, TPapiTransaction>, _from?: TNode | undefined, _to?: TDestination | undefined): GeneralBuilder$1<polkadot_api.PolkadotClient, TPapiTransaction>;
|
|
1452
1498
|
};
|
|
1453
1499
|
|
|
1454
|
-
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<PolkadotClient>;
|
|
1500
|
+
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<polkadot_api.PolkadotClient>;
|
|
1455
1501
|
declare const createPapiApiCall: <TArgs extends Record<string, unknown>, TResult>(apiCall: (options: TArgs & {
|
|
1456
|
-
api: IPolkadotApi<
|
|
1502
|
+
api: IPolkadotApi<TPapiApi, TPapiTransaction>;
|
|
1457
1503
|
}) => Promise<TResult>) => (options: TArgs & {
|
|
1458
|
-
api?:
|
|
1504
|
+
api?: TPapiApiOrUrl;
|
|
1459
1505
|
}) => Promise<TResult>;
|
|
1460
1506
|
|
|
1461
1507
|
/**
|
|
@@ -1592,4 +1638,4 @@ declare class DuplicateAssetIdError extends Error {
|
|
|
1592
1638
|
constructor(id: string);
|
|
1593
1639
|
}
|
|
1594
1640
|
|
|
1595
|
-
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, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index as xcmPallet };
|
|
1641
|
+
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 TPapiApi, type TPapiApiOrUrl, 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 };
|