@paraspell/sdk 7.0.1 → 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 +437 -181
- package/dist/index.d.ts +71 -57
- package/dist/index.mjs +437 -181
- package/dist/papi/index.cjs +435 -181
- package/dist/papi/index.d.ts +60 -46
- package/dist/papi/index.mjs +435 -181
- 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
|
}
|
|
@@ -63,7 +71,7 @@ declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> impl
|
|
|
63
71
|
constructor();
|
|
64
72
|
private getCurrencySelection;
|
|
65
73
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
66
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
74
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
67
75
|
protected canUseXTokens({ currencySymbol, destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
68
76
|
}
|
|
69
77
|
|
|
@@ -81,9 +89,11 @@ declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> im
|
|
|
81
89
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
82
90
|
}
|
|
83
91
|
|
|
84
|
-
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
92
|
+
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
85
93
|
constructor();
|
|
94
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
86
95
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
96
|
+
protected canUseXTokens({ destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
declare class Interlay<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -205,14 +215,14 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
|
|
|
205
215
|
handleBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>, targetChain: 'Polkadot' | 'Kusama'): TTransferReturn<TRes>;
|
|
206
216
|
handleEthBridgeTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
207
217
|
handleMythosTransfer<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
208
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
218
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
209
219
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
210
220
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
211
221
|
}
|
|
212
222
|
|
|
213
223
|
declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
214
224
|
constructor();
|
|
215
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
225
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
216
226
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
217
227
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
218
228
|
}
|
|
@@ -220,48 +230,48 @@ declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> imple
|
|
|
220
230
|
declare class CoretimeKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
221
231
|
constructor();
|
|
222
232
|
_assetCheckEnabled: boolean;
|
|
223
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
233
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
224
234
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
225
235
|
}
|
|
226
236
|
|
|
227
237
|
declare class CoretimePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
228
238
|
constructor();
|
|
229
239
|
_assetCheckEnabled: boolean;
|
|
230
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
240
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
231
241
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
232
242
|
}
|
|
233
243
|
|
|
234
244
|
declare class Encointer<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
235
245
|
constructor();
|
|
236
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
246
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
237
247
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
238
248
|
}
|
|
239
249
|
|
|
240
250
|
declare class RobonomicsKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
241
251
|
constructor();
|
|
242
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
252
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
243
253
|
}
|
|
244
254
|
|
|
245
255
|
declare class RobonomicsPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
246
256
|
constructor();
|
|
247
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
257
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
248
258
|
}
|
|
249
259
|
|
|
250
260
|
declare class PeoplePolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
251
261
|
constructor();
|
|
252
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
262
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
253
263
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
254
264
|
}
|
|
255
265
|
|
|
256
266
|
declare class PeopleKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
257
267
|
constructor();
|
|
258
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
268
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
259
269
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
260
270
|
}
|
|
261
271
|
|
|
262
272
|
declare class Astar<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
263
273
|
constructor();
|
|
264
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
274
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
265
275
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
266
276
|
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
267
277
|
}
|
|
@@ -360,10 +370,6 @@ interface TPalletMap {
|
|
|
360
370
|
}
|
|
361
371
|
type TPalletJsonMap = Record<TNodePolkadotKusama, TPalletMap>;
|
|
362
372
|
|
|
363
|
-
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
364
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
365
|
-
};
|
|
366
|
-
|
|
367
373
|
type HexString$1 = `0x${string}`;
|
|
368
374
|
type PolkadotXCMTransferInput<TApi, TRes> = {
|
|
369
375
|
api: IPolkadotApi<TApi, TRes>;
|
|
@@ -380,6 +386,8 @@ type PolkadotXCMTransferInput<TApi, TRes> = {
|
|
|
380
386
|
feeAsset?: TCurrency;
|
|
381
387
|
overridedCurrency?: TMultiLocation | TMultiAsset[];
|
|
382
388
|
serializedApiCallEnabled?: boolean;
|
|
389
|
+
version?: Version;
|
|
390
|
+
ahAddress?: string;
|
|
383
391
|
};
|
|
384
392
|
type XTokensTransferInput<TApi, TRes> = {
|
|
385
393
|
api: IPolkadotApi<TApi, TRes>;
|
|
@@ -409,7 +417,7 @@ type XTransferTransferInput<TApi, TRes> = {
|
|
|
409
417
|
serializedApiCallEnabled?: boolean;
|
|
410
418
|
};
|
|
411
419
|
type IPolkadotXCMTransfer = {
|
|
412
|
-
transferPolkadotXCM: <TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>) => TTransferReturn<TRes
|
|
420
|
+
transferPolkadotXCM: <TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>) => Promise<TTransferReturn<TRes>>;
|
|
413
421
|
};
|
|
414
422
|
type IXTokensTransfer = {
|
|
415
423
|
transferXTokens: <TApi, TRes>(input: XTokensTransferInput<TApi, TRes>) => TTransferReturn<TRes>;
|
|
@@ -444,6 +452,10 @@ type TSendBaseOptions<TApi, TRes> = {
|
|
|
444
452
|
* The destination address. A SS58 or H160 format.
|
|
445
453
|
*/
|
|
446
454
|
address: TAddress;
|
|
455
|
+
/**
|
|
456
|
+
* The optional AssetHub address used when transfering to Ethereum
|
|
457
|
+
*/
|
|
458
|
+
ahAddress?: string;
|
|
447
459
|
/**
|
|
448
460
|
* The destination node or multi-location
|
|
449
461
|
*/
|
|
@@ -653,7 +665,7 @@ declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
653
665
|
|
|
654
666
|
declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
655
667
|
constructor();
|
|
656
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
668
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
657
669
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
658
670
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
659
671
|
}
|
|
@@ -666,7 +678,7 @@ declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IX
|
|
|
666
678
|
|
|
667
679
|
declare class Shiden<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer, IXTokensTransfer {
|
|
668
680
|
constructor();
|
|
669
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
681
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
670
682
|
transferXTokens<TApi, TRes>(input: XTokensTransferInput<TApi, TRes>): TTransferReturn<TRes>;
|
|
671
683
|
protected canUseXTokens({ currencySymbol, currencyId }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
672
684
|
}
|
|
@@ -684,7 +696,7 @@ declare class Nodle<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
684
696
|
|
|
685
697
|
declare class NeuroWeb<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
686
698
|
constructor();
|
|
687
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
699
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
688
700
|
}
|
|
689
701
|
|
|
690
702
|
declare class Pendulum<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -705,7 +717,7 @@ declare class Zeitgeist<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
705
717
|
|
|
706
718
|
declare class Collectives<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
707
719
|
constructor();
|
|
708
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
720
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
709
721
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
710
722
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, currencyId?: string): TCurrencySelectionHeaderArr;
|
|
711
723
|
}
|
|
@@ -722,12 +734,12 @@ declare class Phala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
722
734
|
|
|
723
735
|
declare class Subsocial<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
724
736
|
constructor();
|
|
725
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
737
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
726
738
|
}
|
|
727
739
|
|
|
728
740
|
declare class KiltSpiritnet<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
729
741
|
constructor();
|
|
730
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
742
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
731
743
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
732
744
|
getProvider(): string;
|
|
733
745
|
}
|
|
@@ -740,14 +752,14 @@ declare class Curio<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
740
752
|
declare class BridgeHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
741
753
|
constructor();
|
|
742
754
|
_assetCheckEnabled: boolean;
|
|
743
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
755
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
744
756
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
745
757
|
}
|
|
746
758
|
|
|
747
759
|
declare class BridgeHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
748
760
|
constructor();
|
|
749
761
|
_assetCheckEnabled: boolean;
|
|
750
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
762
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
751
763
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCallV2;
|
|
752
764
|
}
|
|
753
765
|
|
|
@@ -757,7 +769,7 @@ declare class Ethereum<TApi, TRes> extends ParachainNode<TApi, TRes> {
|
|
|
757
769
|
|
|
758
770
|
declare class Mythos<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
759
771
|
constructor();
|
|
760
|
-
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): TTransferReturn<TRes
|
|
772
|
+
transferPolkadotXCM<TApi, TRes>(input: PolkadotXCMTransferInput<TApi, TRes>): Promise<TTransferReturn<TRes>>;
|
|
761
773
|
transferRelayToPara(): TSerializedApiCallV2;
|
|
762
774
|
}
|
|
763
775
|
|
|
@@ -993,6 +1005,8 @@ type TGetTransferInfoOptionsBase = {
|
|
|
993
1005
|
};
|
|
994
1006
|
type TGetTransferInfoOptions<TApi, TRes> = WithApi<TGetTransferInfoOptionsBase, TApi, TRes>;
|
|
995
1007
|
|
|
1008
|
+
type TPjsApi = ApiPromise;
|
|
1009
|
+
type TPjsApiOrUrl = TApiOrUrl<TPjsApi>;
|
|
996
1010
|
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
997
1011
|
|
|
998
1012
|
declare const buildEthTransferOptions: ({ currency, to, address, destAddress, amount }: TSerializeEthTransferOptions) => Promise<TSerializedEthTransfer>;
|
|
@@ -1004,26 +1018,26 @@ declare const buildEthTransferOptions: ({ currency, to, address, destAddress, am
|
|
|
1004
1018
|
*
|
|
1005
1019
|
* @returns An extrinsic to be signed and sent.
|
|
1006
1020
|
*/
|
|
1007
|
-
declare const transferRelayToPara: (options: Omit<TRelayToParaOptions<
|
|
1008
|
-
api:
|
|
1009
|
-
destApiForKeepAlive:
|
|
1021
|
+
declare const transferRelayToPara: (options: Omit<TRelayToParaOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1022
|
+
api: TPjsApiOrUrl;
|
|
1023
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1010
1024
|
}) => Promise<Extrinsic>;
|
|
1011
|
-
declare const transferRelayToParaSerializedApiCall: (options: Omit<TRelayToParaOptions<
|
|
1012
|
-
api:
|
|
1013
|
-
destApiForKeepAlive:
|
|
1025
|
+
declare const transferRelayToParaSerializedApiCall: (options: Omit<TRelayToParaOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1026
|
+
api: TPjsApiOrUrl;
|
|
1027
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1014
1028
|
}) => Promise<TSerializedApiCall>;
|
|
1015
1029
|
/**
|
|
1016
1030
|
* Transfers assets from parachain to another parachain or relay chain.
|
|
1017
1031
|
* @param options - The transfer options.
|
|
1018
1032
|
* @returns An extrinsic to be signed and sent.
|
|
1019
1033
|
*/
|
|
1020
|
-
declare const send: (options: Omit<TSendOptions<
|
|
1021
|
-
api:
|
|
1022
|
-
destApiForKeepAlive:
|
|
1034
|
+
declare const send: (options: Omit<TSendOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1035
|
+
api: TPjsApiOrUrl;
|
|
1036
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1023
1037
|
}) => Promise<Extrinsic>;
|
|
1024
|
-
declare const sendSerializedApiCall: (options: Omit<TSendOptions<
|
|
1025
|
-
api:
|
|
1026
|
-
destApiForKeepAlive:
|
|
1038
|
+
declare const sendSerializedApiCall: (options: Omit<TSendOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
1039
|
+
api: TPjsApiOrUrl;
|
|
1040
|
+
destApiForKeepAlive: TPjsApiOrUrl;
|
|
1027
1041
|
}) => Promise<TSerializedApiCall>;
|
|
1028
1042
|
|
|
1029
1043
|
declare const transfer_buildEthTransferOptions: typeof buildEthTransferOptions;
|
|
@@ -1225,7 +1239,7 @@ declare const getSupportedAssets: (origin: TNodeWithRelayChains, destination: TN
|
|
|
1225
1239
|
* @returns The native balance as a bigint.
|
|
1226
1240
|
*/
|
|
1227
1241
|
declare const getBalanceNative: (options: TGetBalanceNativeOptionsBase & {
|
|
1228
|
-
api?:
|
|
1242
|
+
api?: TPjsApiOrUrl;
|
|
1229
1243
|
}) => Promise<bigint>;
|
|
1230
1244
|
/**
|
|
1231
1245
|
* Retrieves the balance of a foreign asset for a given account on a specified node.
|
|
@@ -1233,7 +1247,7 @@ declare const getBalanceNative: (options: TGetBalanceNativeOptionsBase & {
|
|
|
1233
1247
|
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
1234
1248
|
*/
|
|
1235
1249
|
declare const getBalanceForeign: (options: TGetBalanceForeignOptionsBase & {
|
|
1236
|
-
api?:
|
|
1250
|
+
api?: TPjsApiOrUrl;
|
|
1237
1251
|
}) => Promise<bigint>;
|
|
1238
1252
|
/**
|
|
1239
1253
|
* Retrieves detailed transfer information for a cross-chain transfer.
|
|
@@ -1241,7 +1255,7 @@ declare const getBalanceForeign: (options: TGetBalanceForeignOptionsBase & {
|
|
|
1241
1255
|
* @returns A Promise that resolves to the transfer information.
|
|
1242
1256
|
*/
|
|
1243
1257
|
declare const getTransferInfo: (options: TGetTransferInfoOptionsBase & {
|
|
1244
|
-
api?:
|
|
1258
|
+
api?: TPjsApiOrUrl;
|
|
1245
1259
|
}) => Promise<TTransferInfo>;
|
|
1246
1260
|
/**
|
|
1247
1261
|
* Retrieves the asset balance for a given account on a specified node.
|
|
@@ -1249,7 +1263,7 @@ declare const getTransferInfo: (options: TGetTransferInfoOptionsBase & {
|
|
|
1249
1263
|
* @returns The asset balance as a bigint.
|
|
1250
1264
|
*/
|
|
1251
1265
|
declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
|
|
1252
|
-
api?:
|
|
1266
|
+
api?: TPjsApiOrUrl;
|
|
1253
1267
|
}) => Promise<bigint>;
|
|
1254
1268
|
/**
|
|
1255
1269
|
* Claims assets from a parachain.
|
|
@@ -1257,10 +1271,10 @@ declare const getAssetBalance: (options: TGetAssetBalanceOptionsBase & {
|
|
|
1257
1271
|
* @returns An extrinsic representing the claim transaction.
|
|
1258
1272
|
*/
|
|
1259
1273
|
declare const claimAssets: (options: TAssetClaimOptionsBase & {
|
|
1260
|
-
api?:
|
|
1261
|
-
}) => Promise<
|
|
1274
|
+
api?: TPjsApiOrUrl;
|
|
1275
|
+
}) => Promise<TSerializedApiCall | Extrinsic>;
|
|
1262
1276
|
declare const getOriginFeeDetails: (options: TGetOriginFeeDetailsOptionsBase & {
|
|
1263
|
-
api?:
|
|
1277
|
+
api?: TPjsApiOrUrl;
|
|
1264
1278
|
}) => Promise<TOriginFeeDetails>;
|
|
1265
1279
|
|
|
1266
1280
|
declare const assets_claimAssets: typeof claimAssets;
|
|
@@ -1418,7 +1432,7 @@ interface UseKeepAliveFinalBuilder$1<TApi, TRes> extends IAddToBatchBuilder<TApi
|
|
|
1418
1432
|
buildSerializedApiCall: () => Promise<TSerializedApiCall>;
|
|
1419
1433
|
}
|
|
1420
1434
|
interface AddressBuilder<TApi, TRes> {
|
|
1421
|
-
address: (address: TAddress) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
|
|
1435
|
+
address: (address: TAddress, ahAddress?: string) => UseKeepAliveFinalBuilder$1<TApi, TRes>;
|
|
1422
1436
|
}
|
|
1423
1437
|
interface AmountBuilder<TApi, TRes> {
|
|
1424
1438
|
amount: (amount: TAmount | null) => AddressBuilder<TApi, TRes>;
|
|
@@ -1500,17 +1514,17 @@ declare const EvmBuilder: (provider: AbstractProvider) => EvmBuilderClass;
|
|
|
1500
1514
|
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
1501
1515
|
* @returns A new Builder instance.
|
|
1502
1516
|
*/
|
|
1503
|
-
declare const Builder: (api?:
|
|
1504
|
-
type UseKeepAliveFinalBuilder = UseKeepAliveFinalBuilder$1<
|
|
1517
|
+
declare const Builder: (api?: TPjsApiOrUrl) => GeneralBuilder$1<_polkadot_api.ApiPromise, Extrinsic>;
|
|
1518
|
+
type UseKeepAliveFinalBuilder = UseKeepAliveFinalBuilder$1<TPjsApi, Extrinsic>;
|
|
1505
1519
|
declare const GeneralBuilder: {
|
|
1506
|
-
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>;
|
|
1507
1521
|
};
|
|
1508
1522
|
|
|
1509
|
-
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<ApiPromise>;
|
|
1523
|
+
declare const createApiInstanceForNode: (node: TNodeWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
|
|
1510
1524
|
declare const createPolkadotJsApiCall: <TArgs extends Record<string, unknown>, TResult>(apiCall: (options: TArgs & {
|
|
1511
|
-
api: IPolkadotApi<
|
|
1525
|
+
api: IPolkadotApi<TPjsApi, Extrinsic>;
|
|
1512
1526
|
}) => Promise<TResult>) => (options: TArgs & {
|
|
1513
|
-
api?:
|
|
1527
|
+
api?: TPjsApiOrUrl;
|
|
1514
1528
|
}) => Promise<TResult>;
|
|
1515
1529
|
|
|
1516
1530
|
/**
|
|
@@ -1647,4 +1661,4 @@ declare class DuplicateAssetIdError extends Error {
|
|
|
1647
1661
|
constructor(id: string);
|
|
1648
1662
|
}
|
|
1649
1663
|
|
|
1650
|
-
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, getOriginFeeDetails, 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 };
|