@paraspell/sdk-core 13.5.0 → 13.7.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/dist/index.d.ts +199 -109
- package/dist/index.mjs +5919 -5441
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import * as _paraspell_sdk_common from '@paraspell/sdk-common';
|
|
|
2
2
|
import { TSubstrateChain, TChain, Version, TRelaychain, TParachain, TLocation, TExternalChain, TJunction, Parents, TJunctions } from '@paraspell/sdk-common';
|
|
3
3
|
export * from '@paraspell/sdk-common';
|
|
4
4
|
import * as _paraspell_assets from '@paraspell/assets';
|
|
5
|
-
import { TAssetInfo, WithAmount, TAsset, TCurrencyInputWithAmount,
|
|
5
|
+
import { TChainAssetsInfo, TAssetInfo, TCurrencyInput, WithAmount, TAsset, TCurrencyInputWithAmount, TCustomAssetInfo, TCustomCtx, TCustomAssetsMap, TCurrencyCore, TAmount, TAssetWithFee, WithComplexAmount, TAssetInfoWithId } from '@paraspell/assets';
|
|
6
6
|
export * from '@paraspell/assets';
|
|
7
|
-
import { TPallet, TAssetsPallet } from '@paraspell/pallets';
|
|
7
|
+
import { TPallet, TPalletEntry, TAssetsPallet, TCustomChainPallets, TCrosschainPallet } from '@paraspell/pallets';
|
|
8
8
|
export * from '@paraspell/pallets';
|
|
9
9
|
import { WalletClient, TransactionSerializableEIP1559, Address, formatUnits as formatUnits$1, parseUnits as parseUnits$1 } from 'viem';
|
|
10
10
|
|
|
@@ -37,11 +37,18 @@ type ClientCache<T> = {
|
|
|
37
37
|
};
|
|
38
38
|
declare const API_TYPES: readonly ["PAPI", "PJS", "DEDOT"];
|
|
39
39
|
type TApiType = (typeof API_TYPES)[number];
|
|
40
|
+
type TRuntimeApi = 'DryRunApi' | 'XcmPaymentApi';
|
|
41
|
+
type TSystemProperties = {
|
|
42
|
+
ss58Format?: number;
|
|
43
|
+
tokenSymbol?: string;
|
|
44
|
+
tokenDecimals?: number;
|
|
45
|
+
};
|
|
40
46
|
|
|
41
|
-
declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
47
|
+
declare abstract class PolkadotApi<TApi, TRes, TSigner, TCustomChain extends string = never> {
|
|
42
48
|
_api?: TApi;
|
|
43
|
-
_chain?: TSubstrateChain;
|
|
49
|
+
_chain?: TSubstrateChain | TCustomChain;
|
|
44
50
|
readonly _config?: TBuilderOptions<TApiOrUrl<TApi>>;
|
|
51
|
+
_customCtx: TFullCustomCtx;
|
|
45
52
|
_ttlMs: number;
|
|
46
53
|
_disconnectAllowed: boolean;
|
|
47
54
|
abstract readonly type: TApiType;
|
|
@@ -50,7 +57,24 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
|
50
57
|
set disconnectAllowed(allowed: boolean);
|
|
51
58
|
get disconnectAllowed(): boolean;
|
|
52
59
|
get config(): TBuilderOptions<TApiOrUrl<TApi>> | undefined;
|
|
53
|
-
|
|
60
|
+
getAssetsObject(chain: TChain): TChainAssetsInfo;
|
|
61
|
+
getAssets(chain: TChain): TAssetInfo[];
|
|
62
|
+
getNativeAssets(chain: TChain): TAssetInfo[];
|
|
63
|
+
getOtherAssets(chain: TChain): TAssetInfo[];
|
|
64
|
+
findAssetInfo(chain: TChain, currency: TCurrencyInput, destination?: TChain | null): TAssetInfo | null;
|
|
65
|
+
findAssetInfoOrThrow(chain: TChain, currency: TCurrencyInput, destination?: TChain | null): TAssetInfo;
|
|
66
|
+
findAssetInfoOnDest(origin: TChain, destination: TChain, currency: TCurrencyInput, originAsset?: TAssetInfo | null): TAssetInfo | null;
|
|
67
|
+
findAssetOnDestOrThrow(origin: TChain, destination: TChain, currency: TCurrencyInput): TAssetInfo;
|
|
68
|
+
findNativeAssetInfo(chain: TChain): TAssetInfo | null;
|
|
69
|
+
findNativeAssetInfoOrThrow(chain: TChain): TAssetInfo;
|
|
70
|
+
isChainEvm(chain: TChain): boolean;
|
|
71
|
+
getNativeAssetSymbol(chain: TChain): string;
|
|
72
|
+
getRelayChainSymbol(chain: TChain): string;
|
|
73
|
+
hasDryRunSupport(chain: TChain): boolean;
|
|
74
|
+
hasXcmPaymentApiSupport(chain: TChain): boolean;
|
|
75
|
+
init(chain: TChain | TCustomChain, clientTtlMs?: number, destination?: TDestination): Promise<void>;
|
|
76
|
+
setCustomCtx(ctx: TFullCustomCtx): void;
|
|
77
|
+
private hydrateCustomChain;
|
|
54
78
|
abstract leaseClient(wsUrl: TUrl, ttlMs: number): Promise<TApi>;
|
|
55
79
|
abstract accountToHex(address: string, isPrefixed?: boolean): string;
|
|
56
80
|
abstract accountToUint8a(address: string): Uint8Array;
|
|
@@ -68,6 +92,9 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
|
68
92
|
abstract getMethod(tx: TRes): string;
|
|
69
93
|
abstract getTypeThenAssetCount(tx: TRes): number | undefined;
|
|
70
94
|
abstract hasMethod(pallet: TPallet, method: string): Promise<boolean>;
|
|
95
|
+
abstract hasRuntimeApi(runtimeApi: TRuntimeApi): Promise<boolean>;
|
|
96
|
+
abstract fetchPalletList(): Promise<TPalletEntry[]>;
|
|
97
|
+
abstract isEvmChain(): Promise<boolean>;
|
|
71
98
|
abstract getPaymentInfo(tx: TRes, address: string): Promise<{
|
|
72
99
|
partialFee: bigint;
|
|
73
100
|
weight: TWeight;
|
|
@@ -77,8 +104,8 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
|
77
104
|
abstract getEvmStorage(contract: string, slot: string): Promise<string>;
|
|
78
105
|
abstract getFromRpc(module: string, method: string, key: string): Promise<string>;
|
|
79
106
|
abstract blake2AsHex(data: Uint8Array): string;
|
|
80
|
-
abstract clone(): PolkadotApi<TApi, TRes, TSigner>;
|
|
81
|
-
abstract createApiForChain(chain: TSubstrateChain): Promise<PolkadotApi<TApi, TRes, TSigner>>;
|
|
107
|
+
abstract clone(): PolkadotApi<TApi, TRes, TSigner, TCustomChain>;
|
|
108
|
+
abstract createApiForChain(chain: TSubstrateChain): Promise<PolkadotApi<TApi, TRes, TSigner, TCustomChain>>;
|
|
82
109
|
abstract getDryRunCall(options: TDryRunCallBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
83
110
|
abstract getDryRunXcm(options: TDryRunXcmBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
84
111
|
abstract getBridgeStatus(): Promise<TBridgeStatus>;
|
|
@@ -88,14 +115,18 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
|
88
115
|
abstract deriveAddress(sender: TSender<TSigner>): string;
|
|
89
116
|
abstract signAndSubmit(tx: TRes, sender: TSender<TSigner>): Promise<string>;
|
|
90
117
|
abstract signAndSubmitFinalized(tx: TRes, sender: TSender<TSigner>): Promise<string>;
|
|
118
|
+
abstract getSystemProperties(): Promise<TSystemProperties>;
|
|
119
|
+
abstract getConstant<T = unknown>(pallet: string, name: string): Promise<T | undefined>;
|
|
120
|
+
private getNativeExistentialDeposit;
|
|
121
|
+
private maybeHydrateCustomChain;
|
|
91
122
|
}
|
|
92
123
|
|
|
93
|
-
declare abstract class Chain<TApi, TRes, TSigner> {
|
|
124
|
+
declare abstract class Chain<TApi, TRes, TSigner, TCustomChain extends string = never> {
|
|
94
125
|
private readonly _chain;
|
|
95
126
|
private readonly _info;
|
|
96
127
|
private readonly _ecosystem;
|
|
97
128
|
private readonly _version;
|
|
98
|
-
constructor(chain: TSubstrateChain, info: string, ecosystem: TRelaychain, version: Version);
|
|
129
|
+
constructor(chain: TSubstrateChain | TCustomChain, info: string, ecosystem: TRelaychain, version: Version);
|
|
99
130
|
get info(): string;
|
|
100
131
|
get ecosystem(): TRelaychain;
|
|
101
132
|
get chain(): TSubstrateChain;
|
|
@@ -106,16 +137,16 @@ declare abstract class Chain<TApi, TRes, TSigner> {
|
|
|
106
137
|
throwIfTempDisabled(options: TTransferInternalOptions<TApi, TRes, TSigner>, destChain?: TChain): void;
|
|
107
138
|
isSendingTempDisabled(_options: TTransferInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
108
139
|
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
109
|
-
canReceiveFrom(_origin: TChain): boolean;
|
|
110
|
-
shouldUseNativeAssetTeleport({ assetInfo: asset, to }: TTransferInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
111
|
-
createAsset(asset: WithAmount<TAssetInfo>, version: Version): TAsset;
|
|
112
|
-
getNativeAssetSymbol(): string;
|
|
140
|
+
canReceiveFrom(_origin: TChain | TCustomChain): boolean;
|
|
141
|
+
shouldUseNativeAssetTeleport({ api, assetInfo: asset, to }: TTransferInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
142
|
+
createAsset(api: PolkadotApi<TApi, TRes, TSigner>, asset: WithAmount<TAssetInfo>, version: Version): TAsset;
|
|
143
|
+
getNativeAssetSymbol(api: PolkadotApi<TApi, TRes, TSigner>): string;
|
|
113
144
|
transferLocal(options: TTransferInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
114
145
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
115
146
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
116
147
|
getBalanceNative(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
117
|
-
getCustomCurrencyId(_asset: TAssetInfo): unknown;
|
|
118
|
-
getBalanceForeign
|
|
148
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, _asset: TAssetInfo): unknown;
|
|
149
|
+
getBalanceForeign(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
119
150
|
getBalance(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
120
151
|
}
|
|
121
152
|
|
|
@@ -125,7 +156,7 @@ declare class Acala<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> impl
|
|
|
125
156
|
isRelayToParaEnabled(): boolean;
|
|
126
157
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
127
158
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
128
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
159
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TForeignOrTokenAsset;
|
|
129
160
|
getBalance(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
130
161
|
}
|
|
131
162
|
|
|
@@ -184,7 +215,7 @@ declare class Basilisk<TApi, TRes, TSigner> extends Hydration<TApi, TRes, TSigne
|
|
|
184
215
|
|
|
185
216
|
declare class BifrostPolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
186
217
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
187
|
-
getCustomCurrencyId(asset: TAssetInfo): {
|
|
218
|
+
getCustomCurrencyId(api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): {
|
|
188
219
|
Native: string;
|
|
189
220
|
VToken?: undefined;
|
|
190
221
|
Token?: undefined;
|
|
@@ -259,7 +290,7 @@ declare class BridgeHubWestend<TApi, TRes, TSigner> extends BridgeHubPolkadot<TA
|
|
|
259
290
|
|
|
260
291
|
declare class Centrifuge<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
261
292
|
constructor();
|
|
262
|
-
getCustomCurrencyId(asset: TAssetInfo): "Native" | {
|
|
293
|
+
getCustomCurrencyId(api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): "Native" | {
|
|
263
294
|
ForeignAsset: number;
|
|
264
295
|
};
|
|
265
296
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -352,7 +383,7 @@ declare class HydrationPaseo<TApi, TRes, TSigner> extends Hydration<TApi, TRes,
|
|
|
352
383
|
|
|
353
384
|
declare class Interlay<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
354
385
|
constructor();
|
|
355
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
386
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TForeignOrTokenAsset;
|
|
356
387
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
357
388
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
358
389
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -361,7 +392,7 @@ declare class Interlay<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> i
|
|
|
361
392
|
|
|
362
393
|
declare class Jamton<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
363
394
|
constructor();
|
|
364
|
-
getCustomCurrencyId(asset: TAssetInfo): {
|
|
395
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): {
|
|
365
396
|
Native: number;
|
|
366
397
|
ForeignAsset?: undefined;
|
|
367
398
|
} | {
|
|
@@ -377,7 +408,7 @@ declare class Karura<TApi, TRes, TSigner> extends Acala<TApi, TRes, TSigner> {
|
|
|
377
408
|
|
|
378
409
|
declare class Kintsugi<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
379
410
|
constructor();
|
|
380
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
411
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TForeignOrTokenAsset;
|
|
381
412
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
382
413
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
383
414
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -393,16 +424,6 @@ declare class Kusama<TApi, TRes, TSigner> extends Polkadot<TApi, TRes, TSigner>
|
|
|
393
424
|
constructor();
|
|
394
425
|
}
|
|
395
426
|
|
|
396
|
-
declare class Laos<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
397
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
398
|
-
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
399
|
-
isRelayToParaEnabled(): boolean;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
declare class LaosPaseo<TApi, TRes, TSigner> extends Laos<TApi, TRes, TSigner> {
|
|
403
|
-
constructor();
|
|
404
|
-
}
|
|
405
|
-
|
|
406
427
|
declare class Moonbeam<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
407
428
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
408
429
|
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
@@ -446,7 +467,7 @@ declare class Peaq<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> imple
|
|
|
446
467
|
|
|
447
468
|
declare class Pendulum<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
448
469
|
constructor();
|
|
449
|
-
getCustomCurrencyId(asset: TAssetInfo): TXcmAsset;
|
|
470
|
+
getCustomCurrencyId(api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TXcmAsset;
|
|
450
471
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
451
472
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
452
473
|
}
|
|
@@ -509,7 +530,7 @@ declare class Xode<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> imple
|
|
|
509
530
|
|
|
510
531
|
declare class Zeitgeist<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
511
532
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
512
|
-
getCustomCurrencyId(asset: TAssetInfo): TZeitgeistAsset | TXcmForeignAsset;
|
|
533
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TZeitgeistAsset | TXcmForeignAsset;
|
|
513
534
|
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
514
535
|
canReceiveFrom(origin: TChain): boolean;
|
|
515
536
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -558,7 +579,6 @@ declare const chains: <TApi, TRes, TSigner>() => {
|
|
|
558
579
|
Karura: Karura<TApi, TRes, TSigner>;
|
|
559
580
|
Kintsugi: Kintsugi<TApi, TRes, TSigner>;
|
|
560
581
|
Moonriver: Moonriver<TApi, TRes, TSigner>;
|
|
561
|
-
Laos: Laos<TApi, TRes, TSigner>;
|
|
562
582
|
Quartz: Quartz<TApi, TRes, TSigner>;
|
|
563
583
|
PeopleKusama: PeopleKusama<TApi, TRes, TSigner>;
|
|
564
584
|
Shiden: Shiden<TApi, TRes, TSigner>;
|
|
@@ -580,7 +600,6 @@ declare const chains: <TApi, TRes, TSigner>() => {
|
|
|
580
600
|
BifrostPaseo: BifrostPaseo<TApi, TRes, TSigner>;
|
|
581
601
|
HeimaPaseo: HeimaPaseo<TApi, TRes, TSigner>;
|
|
582
602
|
HydrationPaseo: HydrationPaseo<TApi, TRes, TSigner>;
|
|
583
|
-
LaosPaseo: LaosPaseo<TApi, TRes, TSigner>;
|
|
584
603
|
NeuroWebPaseo: NeuroWebPaseo<TApi, TRes, TSigner>;
|
|
585
604
|
ZeitgeistPaseo: ZeitgeistPaseo<TApi, TRes, TSigner>;
|
|
586
605
|
};
|
|
@@ -675,7 +694,7 @@ declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
|
675
694
|
/**
|
|
676
695
|
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
677
696
|
*/
|
|
678
|
-
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object> {
|
|
697
|
+
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object, TCustomChain extends string = never> {
|
|
679
698
|
readonly batchManager: BatchTransactionManager<TApi, TRes, TSigner>;
|
|
680
699
|
readonly api: PolkadotApi<TApi, TRes, TSigner>;
|
|
681
700
|
readonly _options: T;
|
|
@@ -686,9 +705,9 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
686
705
|
* @param chain - The chain from which the transaction originates.
|
|
687
706
|
* @returns An instance of Builder
|
|
688
707
|
*/
|
|
689
|
-
from(chain: TChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
708
|
+
from(chain: TChain | TCustomChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
690
709
|
from: TChain;
|
|
691
|
-
}>;
|
|
710
|
+
}, TCustomChain>;
|
|
692
711
|
/**
|
|
693
712
|
* Specifies the destination chain for the transaction.
|
|
694
713
|
*
|
|
@@ -696,9 +715,9 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
696
715
|
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
697
716
|
* @returns An instance of Builder
|
|
698
717
|
*/
|
|
699
|
-
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
718
|
+
to(chain: TDestination | TCustomChain, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
700
719
|
to: TDestination;
|
|
701
|
-
}>;
|
|
720
|
+
}, TCustomChain>;
|
|
702
721
|
/**
|
|
703
722
|
* Initiates the process to claim assets from a specified chain.
|
|
704
723
|
*
|
|
@@ -717,7 +736,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
717
736
|
*/
|
|
718
737
|
currency(currency: TCurrencyInputWithAmount): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
719
738
|
currency: TCurrencyInputWithAmount;
|
|
720
|
-
}>;
|
|
739
|
+
}, TCustomChain>;
|
|
721
740
|
/**
|
|
722
741
|
* Sets the recipient address.
|
|
723
742
|
*
|
|
@@ -726,7 +745,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
726
745
|
*/
|
|
727
746
|
recipient(address: TAddress): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
728
747
|
recipient: TAddress;
|
|
729
|
-
}>;
|
|
748
|
+
}, TCustomChain>;
|
|
730
749
|
/**
|
|
731
750
|
* Sets the sender address or signer.
|
|
732
751
|
*
|
|
@@ -735,7 +754,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
735
754
|
*/
|
|
736
755
|
sender(sender: TSender<TSigner> | WalletClient): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
737
756
|
sender: string;
|
|
738
|
-
}>;
|
|
757
|
+
}, TCustomChain>;
|
|
739
758
|
/**
|
|
740
759
|
* Sets the asset hub address. This is used for transfers that go through the Asset Hub and originate from an EVM chain.
|
|
741
760
|
*
|
|
@@ -744,7 +763,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
744
763
|
*/
|
|
745
764
|
ahAddress(address: string | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
746
765
|
ahAddress: string | undefined;
|
|
747
|
-
}>;
|
|
766
|
+
}, never>;
|
|
748
767
|
/**
|
|
749
768
|
* Sets the XCM version to be used for the transfer.
|
|
750
769
|
*
|
|
@@ -753,7 +772,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
753
772
|
*/
|
|
754
773
|
xcmVersion(version: Version): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
755
774
|
version: Version;
|
|
756
|
-
}>;
|
|
775
|
+
}, never>;
|
|
757
776
|
/**
|
|
758
777
|
* Whether to keep the account alive after the transfer.
|
|
759
778
|
*
|
|
@@ -762,7 +781,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
762
781
|
*/
|
|
763
782
|
keepAlive(keepAlive: boolean): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
764
783
|
keepAlive: boolean;
|
|
765
|
-
}>;
|
|
784
|
+
}, never>;
|
|
766
785
|
/**
|
|
767
786
|
* Sets a custom pallet for the transaction.
|
|
768
787
|
*
|
|
@@ -773,7 +792,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
773
792
|
customPallet(pallet: string | undefined, method: string | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
774
793
|
pallet: string | undefined;
|
|
775
794
|
method: string | undefined;
|
|
776
|
-
}>;
|
|
795
|
+
}, never>;
|
|
777
796
|
/**
|
|
778
797
|
* Optional fee asset for the transaction.
|
|
779
798
|
*
|
|
@@ -782,7 +801,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
782
801
|
*/
|
|
783
802
|
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
784
803
|
feeAsset: TCurrencyInput | undefined;
|
|
785
|
-
}>;
|
|
804
|
+
}, never>;
|
|
786
805
|
/**
|
|
787
806
|
* Sets the hex of the encoded transaction call to apply on the destination chain
|
|
788
807
|
*
|
|
@@ -797,7 +816,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
797
816
|
originKind: "Native" | "SovereignAccount" | "Superuser" | "Xcm" | undefined;
|
|
798
817
|
maxWeight: TWeight | undefined;
|
|
799
818
|
};
|
|
800
|
-
}>;
|
|
819
|
+
}, never>;
|
|
801
820
|
/**
|
|
802
821
|
* Performs a token swap as part of the transfer, using the specified exchange and destination currency.
|
|
803
822
|
*
|
|
@@ -806,54 +825,54 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
806
825
|
*/
|
|
807
826
|
swap(options: TSwapOptions<TApi, TRes, TSigner>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
808
827
|
swapOptions: TSwapOptions<TApi, TRes, TSigner>;
|
|
809
|
-
}>;
|
|
828
|
+
}, TCustomChain>;
|
|
810
829
|
/**
|
|
811
830
|
* Adds the transfer transaction to the batch.
|
|
812
831
|
*
|
|
813
832
|
* @returns An instance of Builder
|
|
814
833
|
*/
|
|
815
|
-
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
834
|
+
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
816
835
|
from: TSubstrateChain;
|
|
817
|
-
}>;
|
|
836
|
+
}, TCustomChain>;
|
|
818
837
|
/**
|
|
819
838
|
* Builds and returns the batched transaction based on the configured parameters.
|
|
820
839
|
*
|
|
821
840
|
* @param options - (Optional) Options to customize the batch transaction.
|
|
822
841
|
* @returns A Extrinsic representing the batched transactions.
|
|
823
842
|
*/
|
|
824
|
-
buildBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
825
|
-
protected buildInternal<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): Promise<TBuildInternalRes<TApi, TRes, TSigner, TOptions>>;
|
|
843
|
+
buildBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, options?: TBatchOptions): Promise<TRes>;
|
|
844
|
+
protected buildInternal<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions, TCustomChain>): Promise<TBuildInternalRes<TApi, TRes, TSigner, TOptions>>;
|
|
826
845
|
private prepareNormalizedOptions;
|
|
827
846
|
/**
|
|
828
847
|
* Builds and returns the transfer extrinsic.
|
|
829
848
|
*
|
|
830
849
|
* @returns A Promise that resolves to the transfer extrinsic.
|
|
831
850
|
*/
|
|
832
|
-
build(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
851
|
+
build(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TRes>;
|
|
833
852
|
/**
|
|
834
853
|
* Builds an unsigned EIP-1559 transaction (viem `TransactionSerializableEIP1559`) for an
|
|
835
854
|
* EVM-compatible origin. `nonce`, `gas`, and fees are populated from the origin chain's RPC.
|
|
836
855
|
*/
|
|
837
|
-
buildEvm(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
856
|
+
buildEvm(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TransactionSerializableEIP1559>;
|
|
838
857
|
/**
|
|
839
858
|
* Builds and returns multiple transfer or swap extrinsics
|
|
840
859
|
*
|
|
841
860
|
* @returns A Promise that resolves to the transfer extrinsic contexts
|
|
842
861
|
*/
|
|
843
|
-
buildAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
862
|
+
buildAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TTransactionContext<TApi, TRes>[]>;
|
|
844
863
|
private validateBatchState;
|
|
845
864
|
private buildCommon;
|
|
846
865
|
private buildCommonAll;
|
|
847
866
|
private maybePerformXcmFormatCheck;
|
|
848
|
-
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
849
|
-
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
850
|
-
protected createTxFactory<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): TTxFactory<TRes>;
|
|
867
|
+
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TDryRunResult>;
|
|
868
|
+
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
869
|
+
protected createTxFactory<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions, TCustomChain>): TTxFactory<TRes>;
|
|
851
870
|
/**
|
|
852
871
|
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
853
872
|
*
|
|
854
873
|
* @returns An origin and destination fee.
|
|
855
874
|
*/
|
|
856
|
-
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
875
|
+
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, options?: TGetXcmFeeBuilderOptions & {
|
|
857
876
|
disableFallback: TDisableFallback;
|
|
858
877
|
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
859
878
|
/**
|
|
@@ -861,7 +880,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
861
880
|
*
|
|
862
881
|
* @returns An origin fee.
|
|
863
882
|
*/
|
|
864
|
-
getOriginXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
883
|
+
getOriginXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, options?: TGetXcmFeeBuilderOptions & {
|
|
865
884
|
disableFallback: TDisableFallback;
|
|
866
885
|
}): Promise<TXcmFeeDetailWithForwardedXcm<TDisableFallback>>;
|
|
867
886
|
/**
|
|
@@ -869,38 +888,38 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
869
888
|
*
|
|
870
889
|
* @returns The max transferable amount.
|
|
871
890
|
*/
|
|
872
|
-
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
891
|
+
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<bigint>;
|
|
873
892
|
/**
|
|
874
893
|
* Returns the min transferable amount for the transfer
|
|
875
894
|
*
|
|
876
895
|
* @returns The min transferable amount.
|
|
877
896
|
*/
|
|
878
|
-
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
897
|
+
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<bigint>;
|
|
879
898
|
/**
|
|
880
899
|
* Returns the max transferable amount for the transfer
|
|
881
900
|
*
|
|
882
901
|
* @returns The max transferable amount.
|
|
883
902
|
*/
|
|
884
|
-
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
903
|
+
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<boolean>;
|
|
885
904
|
/**
|
|
886
905
|
* Returns the transfer info for the transfer
|
|
887
906
|
*
|
|
888
907
|
* @returns The transfer info.
|
|
889
908
|
*/
|
|
890
|
-
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
909
|
+
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TTransferInfo>;
|
|
891
910
|
/**
|
|
892
911
|
* Returns the receivable amount on the destination after the transfer
|
|
893
912
|
*
|
|
894
913
|
* @returns The computed receivable amount.
|
|
895
914
|
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
896
915
|
*/
|
|
897
|
-
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
898
|
-
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSwap<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
916
|
+
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<bigint>;
|
|
917
|
+
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSwap<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<{
|
|
899
918
|
exchange: TExchangeChain;
|
|
900
919
|
amountOut: bigint;
|
|
901
920
|
}>;
|
|
902
|
-
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
903
|
-
signAndSubmitAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
921
|
+
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<string>;
|
|
922
|
+
signAndSubmitAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<string[]>;
|
|
904
923
|
private executeWithEvmSigner;
|
|
905
924
|
private prepareEvmDispatch;
|
|
906
925
|
/**
|
|
@@ -922,7 +941,61 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
922
941
|
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
923
942
|
* @returns A new Builder instance.
|
|
924
943
|
*/
|
|
925
|
-
declare const Builder: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>) => GeneralBuilder<TApi, TRes, TSigner, object>;
|
|
944
|
+
declare const Builder: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>) => GeneralBuilder<TApi, TRes, TSigner, object, TCustomChain>;
|
|
945
|
+
|
|
946
|
+
type TProviderEntry = {
|
|
947
|
+
name: string;
|
|
948
|
+
endpoint: string;
|
|
949
|
+
};
|
|
950
|
+
type TChainConfig = {
|
|
951
|
+
name: string;
|
|
952
|
+
info: string;
|
|
953
|
+
paraId: number;
|
|
954
|
+
providers: TProviderEntry[];
|
|
955
|
+
};
|
|
956
|
+
type TChainConfigMap = Record<TSubstrateChain, TChainConfig>;
|
|
957
|
+
|
|
958
|
+
type TCustomChainPalletsInput = {
|
|
959
|
+
nativeAssets?: TAssetsPallet;
|
|
960
|
+
otherAssets?: TAssetsPallet[];
|
|
961
|
+
};
|
|
962
|
+
type TCustomChainInput = {
|
|
963
|
+
paraId: number;
|
|
964
|
+
ecosystem: TRelaychain;
|
|
965
|
+
providers: TProviderEntry[];
|
|
966
|
+
xcmVersion: Version;
|
|
967
|
+
ss58Prefix?: number;
|
|
968
|
+
nativeAssetSymbol?: string;
|
|
969
|
+
nativeAssetDecimals?: number;
|
|
970
|
+
assets?: TCustomAssetInfo[];
|
|
971
|
+
pallets?: TCustomChainPalletsInput;
|
|
972
|
+
};
|
|
973
|
+
type TCustomChainsMap = Record<string, TCustomChainInput>;
|
|
974
|
+
type TCustomChainEntry = {
|
|
975
|
+
name: string;
|
|
976
|
+
paraId: number;
|
|
977
|
+
ecosystem: TRelaychain;
|
|
978
|
+
providers: TProviderEntry[];
|
|
979
|
+
xcmVersion: Version;
|
|
980
|
+
ss58Prefix?: number;
|
|
981
|
+
nativeAssetSymbol?: string;
|
|
982
|
+
nativeAssetDecimals?: number;
|
|
983
|
+
assets: TAssetInfo[];
|
|
984
|
+
pallets?: TCustomChainPallets;
|
|
985
|
+
};
|
|
986
|
+
type TCustomChainEntryHydrated = TCustomChainEntry & {
|
|
987
|
+
xcmPallet: TCrosschainPallet;
|
|
988
|
+
isEVM: boolean;
|
|
989
|
+
supportsDryRunApi: boolean;
|
|
990
|
+
supportsXcmPaymentApi: boolean;
|
|
991
|
+
nativeExistentialDeposit?: string;
|
|
992
|
+
pallets: TCustomChainPallets;
|
|
993
|
+
};
|
|
994
|
+
type TCustomChainsCtx = Record<string, TCustomChainEntry>;
|
|
995
|
+
type TFullCustomCtx = TCustomCtx & {
|
|
996
|
+
customChains?: TCustomChainsCtx;
|
|
997
|
+
customChainPallets?: Record<string, TCustomChainPallets>;
|
|
998
|
+
};
|
|
926
999
|
|
|
927
1000
|
type TEvmTransferOptionsBase = {
|
|
928
1001
|
from: TChain;
|
|
@@ -967,10 +1040,15 @@ type TDryRunPreviewOptions = {
|
|
|
967
1040
|
type TBuilderOptions<TApi> = TApi | TBuilderConfig<TApi>;
|
|
968
1041
|
type TBuilderConfig<TApi> = Partial<{
|
|
969
1042
|
apiOverrides: Partial<Record<TChain, TApi>>;
|
|
1043
|
+
customAssets: TCustomAssetsMap;
|
|
1044
|
+
customChains: TCustomChainsMap;
|
|
970
1045
|
development: boolean;
|
|
971
1046
|
abstractDecimals: boolean;
|
|
972
1047
|
xcmFormatCheck: boolean;
|
|
973
1048
|
}>;
|
|
1049
|
+
type TCustomChainFrom<TOpts> = TOpts extends {
|
|
1050
|
+
customChains: infer C;
|
|
1051
|
+
} ? Extract<keyof C, string> : never;
|
|
974
1052
|
type TCreateTxsOptions<TApi, TRes, TSigner> = Pick<TTransferOptions<TApi, TRes, TSigner>, 'api' | 'from' | 'to' | 'currency'>;
|
|
975
1053
|
type TBatchedTransferOptions<TApi, TRes, TSigner> = Omit<TSubstrateTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'> & {
|
|
976
1054
|
builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>;
|
|
@@ -1272,6 +1350,21 @@ declare class BridgeHaltedError extends Error {
|
|
|
1272
1350
|
constructor();
|
|
1273
1351
|
}
|
|
1274
1352
|
|
|
1353
|
+
/**
|
|
1354
|
+
* Error thrown when a custom chain name collides with a built-in chain.
|
|
1355
|
+
*/
|
|
1356
|
+
declare class CustomChainConflictError extends Error {
|
|
1357
|
+
constructor(msg: string);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* Error thrown when a custom chain definition is missing required fields or
|
|
1362
|
+
* carries invalid values.
|
|
1363
|
+
*/
|
|
1364
|
+
declare class CustomChainInvalidError extends Error {
|
|
1365
|
+
constructor(msg: string);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1275
1368
|
/**
|
|
1276
1369
|
* Error thrown when the Dry Run fails.
|
|
1277
1370
|
*/
|
|
@@ -1322,13 +1415,13 @@ declare class InvalidAddressError extends Error {
|
|
|
1322
1415
|
/**
|
|
1323
1416
|
* Error development mode is on and no API override is provided for a specific chain.
|
|
1324
1417
|
*/
|
|
1325
|
-
declare class MissingChainApiError extends Error {
|
|
1418
|
+
declare class MissingChainApiError<TCustomChain extends string = never> extends Error {
|
|
1326
1419
|
/**
|
|
1327
1420
|
* Constructs a new MissingChainApiError.
|
|
1328
1421
|
*
|
|
1329
1422
|
* @param chain - The chain for which the API is missing.
|
|
1330
1423
|
*/
|
|
1331
|
-
constructor(chain: TChain);
|
|
1424
|
+
constructor(chain: TChain | TCustomChain);
|
|
1332
1425
|
}
|
|
1333
1426
|
|
|
1334
1427
|
/**
|
|
@@ -1341,13 +1434,13 @@ declare class MissingParameterError extends Error {
|
|
|
1341
1434
|
/**
|
|
1342
1435
|
* Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
1343
1436
|
*/
|
|
1344
|
-
declare class NoXCMSupportImplementedError extends Error {
|
|
1437
|
+
declare class NoXCMSupportImplementedError<TCustomChain extends string = never> extends Error {
|
|
1345
1438
|
/**
|
|
1346
1439
|
* Constructs a new NoXCMSupportImplementedError.
|
|
1347
1440
|
*
|
|
1348
1441
|
* @param chain - The chain for which XCM support is not implemented.
|
|
1349
1442
|
*/
|
|
1350
|
-
constructor(chain: TChain);
|
|
1443
|
+
constructor(chain: TChain | TCustomChain);
|
|
1351
1444
|
}
|
|
1352
1445
|
|
|
1353
1446
|
/**
|
|
@@ -2016,7 +2109,7 @@ type TSetBalanceRes = {
|
|
|
2016
2109
|
declare abstract class BaseAssetsPallet {
|
|
2017
2110
|
protected palletName: TAssetsPallet;
|
|
2018
2111
|
constructor(palletName: TAssetsPallet);
|
|
2019
|
-
abstract mint<TApi, TRes, TSigner>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain
|
|
2112
|
+
abstract mint<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain): Promise<TSetBalanceRes>;
|
|
2020
2113
|
abstract getBalance<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
2021
2114
|
}
|
|
2022
2115
|
|
|
@@ -2103,18 +2196,6 @@ type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
|
2103
2196
|
};
|
|
2104
2197
|
type TVerifyEdOnDestinationOptions<TApi, TRes, TSigner> = WithApi<TVerifyEdOnDestinationOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
2105
2198
|
|
|
2106
|
-
type TProviderEntry = {
|
|
2107
|
-
name: string;
|
|
2108
|
-
endpoint: string;
|
|
2109
|
-
};
|
|
2110
|
-
type TChainConfig = {
|
|
2111
|
-
name: string;
|
|
2112
|
-
info: string;
|
|
2113
|
-
paraId: number;
|
|
2114
|
-
providers: TProviderEntry[];
|
|
2115
|
-
};
|
|
2116
|
-
type TChainConfigMap = Record<TSubstrateChain, TChainConfig>;
|
|
2117
|
-
|
|
2118
2199
|
type OneKey<K extends string, V = unknown> = {
|
|
2119
2200
|
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
2120
2201
|
[Q in keyof O]: O[Q];
|
|
@@ -2205,17 +2286,24 @@ declare const getEthErc20Balance: (chain: TExternalChain, asset: TAssetInfo, add
|
|
|
2205
2286
|
|
|
2206
2287
|
declare const getMoonbeamErc20Balance: (chain: TSubstrateChain, assetId: string, address: string) => Promise<bigint>;
|
|
2207
2288
|
|
|
2289
|
+
declare const getChainConfigImpl: <TCustomChain extends string = never>(chain: TSubstrateChain | TCustomChain, ctx?: TFullCustomCtx) => TChainConfig;
|
|
2208
2290
|
declare const getChainConfig: (chain: TSubstrateChain) => TChainConfig;
|
|
2209
2291
|
|
|
2292
|
+
declare const getChainProvidersImpl: <TCustomChain extends string = never>(chain: TSubstrateChain | TCustomChain, ctx?: TFullCustomCtx) => string[];
|
|
2210
2293
|
declare const getChainProviders: (chain: TSubstrateChain) => string[];
|
|
2211
2294
|
|
|
2295
|
+
declare const getParaIdImpl: <TCustomChain extends string = never>(chain: TChain | TCustomChain, ctx?: TFullCustomCtx) => number;
|
|
2212
2296
|
/**
|
|
2213
2297
|
* Retrieves the parachain ID for a specified chain.
|
|
2214
2298
|
*
|
|
2215
2299
|
* @param chain - The chain for which to get the paraId.
|
|
2216
2300
|
* @returns The parachain ID of the chain.
|
|
2217
2301
|
*/
|
|
2218
|
-
declare const getParaId: (chain: TChain) => number;
|
|
2302
|
+
declare const getParaId: <TCustomChain extends string = never>(chain: TChain | TCustomChain) => number;
|
|
2303
|
+
|
|
2304
|
+
declare const normalizeCustomChains: (map: TCustomChainsMap | undefined) => TCustomChainsCtx;
|
|
2305
|
+
declare const buildCustomChainConfig: (entry: TCustomChainEntry) => TChainConfig;
|
|
2306
|
+
declare const buildCustomChainAssetsInfo: (entry: TCustomChainEntryHydrated) => TChainAssetsInfo;
|
|
2219
2307
|
|
|
2220
2308
|
/**
|
|
2221
2309
|
* Retrieves the chain name corresponding to a specified parachain ID.
|
|
@@ -2358,7 +2446,7 @@ declare const createTypeAndThenCall: <TApi, TRes, TSigner>(options: TPolkadotXCM
|
|
|
2358
2446
|
declare const createTypeThenAutoReserve: <TApi, TRes, TSigner>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TSerializedExtrinsics>;
|
|
2359
2447
|
|
|
2360
2448
|
declare const validateCurrency: (currency: TCurrencyInput, feeAsset?: TCurrencyInput) => void;
|
|
2361
|
-
declare const validateDestination: (origin: TSubstrateChain, destination: TDestination) => void;
|
|
2449
|
+
declare const validateDestination: <TApi, TRes, TSigner>(origin: TSubstrateChain, destination: TDestination, api: PolkadotApi<TApi, TRes, TSigner>) => void;
|
|
2362
2450
|
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput) => void;
|
|
2363
2451
|
declare const validateTransact: <TApi, TRes, TSigner>({ api, from, to, sender, recipient: address, transactOptions }: TSubstrateTransferOptions<TApi, TRes, TSigner>) => ValidationError | undefined;
|
|
2364
2452
|
|
|
@@ -2403,8 +2491,9 @@ declare const createTransferOrSwapAll: <TApi, TRes, TSigner>(options: TSubstrate
|
|
|
2403
2491
|
declare const createTransferOrSwap: <TApi, TRes, TSigner>(options: TSubstrateTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2404
2492
|
|
|
2405
2493
|
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation, resolveExternalReserve?: boolean) => TChain;
|
|
2494
|
+
declare const getAssetReserveChainImpl: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain | TCustomChain, assetLocation: TLocation, resolveExternalReserve?: boolean) => TChain | TCustomChain;
|
|
2406
2495
|
|
|
2407
|
-
declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
2496
|
+
declare const getChainVersion: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TChain) => Version;
|
|
2408
2497
|
|
|
2409
2498
|
/**
|
|
2410
2499
|
* Gets the relay chain (Polkadot, Kusama, Westend, or Paseo) of a given chain.
|
|
@@ -2413,6 +2502,15 @@ declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
|
2413
2502
|
* @returns The corresponding relay chain.
|
|
2414
2503
|
*/
|
|
2415
2504
|
declare const getRelayChainOf: (chain: TSubstrateChain) => TRelaychain;
|
|
2505
|
+
declare const getRelayChainOfImpl: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain | TCustomChain) => TRelaychain;
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* Gets the native asset symbol of the relay chain that the given chain belongs to.
|
|
2509
|
+
*
|
|
2510
|
+
* @param chain - The chain to evaluate.
|
|
2511
|
+
* @returns The native asset symbol of the corresponding relay chain.
|
|
2512
|
+
*/
|
|
2513
|
+
declare const getRelayChainSymbolOf: (chain: TSubstrateChain) => string;
|
|
2416
2514
|
|
|
2417
2515
|
declare const createChainClient: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain) => Promise<TApi>;
|
|
2418
2516
|
|
|
@@ -2445,31 +2543,23 @@ declare const isViemSigner: (value: unknown) => value is WalletClient;
|
|
|
2445
2543
|
declare const createBeneficiaryLocXTokens: <TApi, TRes, TSigner>({ api, recipient, origin, destination, version, paraId }: TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2446
2544
|
declare const createBeneficiaryLocation: <TApi, TRes, TSigner>({ api, address, version }: TCreateBeneficiaryOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2447
2545
|
|
|
2448
|
-
declare const createDestination: (version: Version, origin: TChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TLocation;
|
|
2449
|
-
declare const createVersionedDestination: (version: Version, origin: TSubstrateChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TXcmVersioned<TLocation>;
|
|
2546
|
+
declare const createDestination: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>, version: Version, origin: TChain | TCustomChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TLocation;
|
|
2547
|
+
declare const createVersionedDestination: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, version: Version, origin: TSubstrateChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TXcmVersioned<TLocation>;
|
|
2450
2548
|
|
|
2451
2549
|
declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
|
|
2452
2550
|
|
|
2453
2551
|
declare const getChainLocation: (chain: TChain, destChain: TChain) => TLocation;
|
|
2454
2552
|
|
|
2455
|
-
/**
|
|
2456
|
-
* This function localizes a location by removing the `Parachain` junction
|
|
2457
|
-
* if it exists. The `parents` field is set to `0` either if a `Parachain` was removed
|
|
2458
|
-
* or if the resulting interior is `'Here'` and the chain is a relay chain.
|
|
2459
|
-
*
|
|
2460
|
-
* @param chain - The current chain
|
|
2461
|
-
* @param location - The location to localize
|
|
2462
|
-
* @returns The localized location
|
|
2463
|
-
*/
|
|
2464
2553
|
declare const localizeLocation: (chain: TChain, location: TLocation, origin?: TChain) => TLocation;
|
|
2554
|
+
declare const localizeLocationImpl: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TChain | TCustomChain, location: TLocation, origin?: TChain | TCustomChain) => TLocation;
|
|
2465
2555
|
|
|
2466
2556
|
declare const reverseTransformLocation: (location: TLocation) => TLocation;
|
|
2467
2557
|
|
|
2468
2558
|
declare const normalizeAmount: (amount: bigint) => bigint;
|
|
2469
2559
|
|
|
2470
|
-
declare const resolveDestChain: (originChain: TSubstrateChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "Darwinia" | "EnergyWebX" | "Hydration" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "NeuroWeb" | "Pendulum" | "Mythos" | "Peaq" | "PeoplePolkadot" | "Unique" | "Xode" | "AssetHubKusama" | "BridgeHubKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "
|
|
2560
|
+
declare const resolveDestChain: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>, originChain: TSubstrateChain | TCustomChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "Darwinia" | "EnergyWebX" | "Hydration" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "NeuroWeb" | "Pendulum" | "Mythos" | "Peaq" | "PeoplePolkadot" | "Unique" | "Xode" | "AssetHubKusama" | "BridgeHubKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "Quartz" | "RobonomicsPolkadot" | "PeopleKusama" | "Shiden" | "Zeitgeist" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AjunaPaseo" | "AssetHubPaseo" | "BifrostPaseo" | "BridgeHubPaseo" | "CoretimePaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "NeuroWebPaseo" | "PeoplePaseo" | "ZeitgeistPaseo" | undefined;
|
|
2471
2561
|
|
|
2472
|
-
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
2562
|
+
declare const resolveParaId: <TApi, TRes, TSigner>(paraId: number | undefined, destination: TDestination, api: PolkadotApi<TApi, TRes, TSigner>) => number | undefined;
|
|
2473
2563
|
|
|
2474
2564
|
declare const convertBuilderConfig: <TApi>(config: TBuilderOptions<TApiOrUrl<TApi>> | undefined) => TBuilderConfig<TUrl> | undefined;
|
|
2475
2565
|
declare const createSwapBuilder: <TApi, TRes, TSigner>(options: TTransferOptionsWithSwap<TApi, TRes, TSigner>) => TSwapBuilder<TApi, TRes, TSigner>;
|
|
@@ -2490,7 +2580,7 @@ declare const createAssetsFilter: (asset: TAsset, version: Version) => {
|
|
|
2490
2580
|
};
|
|
2491
2581
|
};
|
|
2492
2582
|
|
|
2493
|
-
declare const createBaseExecuteXcm: <TRes>(options:
|
|
2583
|
+
declare const createBaseExecuteXcm: <TApi, TRes, TSigner>(options: TCreateTransferXcmOptions<TApi, TRes, TSigner> & {
|
|
2494
2584
|
suffixXcm?: unknown[];
|
|
2495
2585
|
}) => unknown[];
|
|
2496
2586
|
|
|
@@ -2517,8 +2607,8 @@ declare const formatUnits: typeof formatUnits$1;
|
|
|
2517
2607
|
|
|
2518
2608
|
declare const addXcmVersionHeader: <T, V extends Version>(obj: T, version: V) => OneKey<V, T>;
|
|
2519
2609
|
declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersion: Version, destMaxVersion?: Version) => Version;
|
|
2520
|
-
declare const pickCompatibleXcmVersion: (origin: TSubstrateChain, destination: TDestination, override?: Version) => Version;
|
|
2521
|
-
declare const pickRouterCompatibleXcmVersion: (origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2610
|
+
declare const pickCompatibleXcmVersion: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, origin: TSubstrateChain, destination: TDestination, override?: Version) => Version;
|
|
2611
|
+
declare const pickRouterCompatibleXcmVersion: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2522
2612
|
|
|
2523
|
-
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2b256, blake2b512, buildDestInfo, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2524
|
-
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedTransferOptions, TBifrostToken, TBridgeStatus, TBuildAllInternalRes, TBuildDestInfoOptions, TBuildEvmTransferOptions, TBuildInternalRes, TBuildInternalResBase, TBuildOriginInfoOptions, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainEndpoint, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateEthBridgeInstructionsOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmExtension, TEvmSnowbridgeExtension, TEvmTransferOptions, TEvmTransferOptionsBase, TExchangeChain, TExchangeInput, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TModuleError, TNativeTokenAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSender, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSubstrateTransferBaseOptions, TSubstrateTransferBaseOptionsWithSender, TSubstrateTransferOptions, TSwapBuilder, TSwapBuilderFactory, TSwapConfig, TSwapEvent, TSwapEventType, TSwapExtension, TSwapFeeEstimates, TSwapOptions, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferBaseOptions, TTransferBaseOptionsWithSender, TTransferBaseOptionsWithSwap, TTransferFeeEstimates, TTransferInfo, TTransferInternalOptions, TTransferLocalOptions, TTransferOptions, TTransferOptionsWithSwap, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeDetailWithForwardedXcm, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSender, WithRequiredSwapOptions };
|
|
2613
|
+
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, CustomChainConflictError, CustomChainInvalidError, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2b256, blake2b512, buildCustomChainAssetsInfo, buildCustomChainConfig, buildDestInfo, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getAssetReserveChainImpl, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainConfigImpl, getChainLocation, getChainProviders, getChainProvidersImpl, getChainVersion, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getParaIdImpl, getRelayChainOf, getRelayChainOfImpl, getRelayChainSymbolOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, localizeLocationImpl, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeCustomChains, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2614
|
+
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedTransferOptions, TBifrostToken, TBridgeStatus, TBuildAllInternalRes, TBuildDestInfoOptions, TBuildEvmTransferOptions, TBuildInternalRes, TBuildInternalResBase, TBuildOriginInfoOptions, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainEndpoint, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateEthBridgeInstructionsOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TCustomChainEntry, TCustomChainEntryHydrated, TCustomChainFrom, TCustomChainInput, TCustomChainPalletsInput, TCustomChainsCtx, TCustomChainsMap, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmExtension, TEvmSnowbridgeExtension, TEvmTransferOptions, TEvmTransferOptionsBase, TExchangeChain, TExchangeInput, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TFullCustomCtx, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TModuleError, TNativeTokenAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TRuntimeApi, TScenario, TSelfReserveAsset, TSender, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSubstrateTransferBaseOptions, TSubstrateTransferBaseOptionsWithSender, TSubstrateTransferOptions, TSwapBuilder, TSwapBuilderFactory, TSwapConfig, TSwapEvent, TSwapEventType, TSwapExtension, TSwapFeeEstimates, TSwapOptions, TSystemProperties, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferBaseOptions, TTransferBaseOptionsWithSender, TTransferBaseOptionsWithSwap, TTransferFeeEstimates, TTransferInfo, TTransferInternalOptions, TTransferLocalOptions, TTransferOptions, TTransferOptionsWithSwap, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeDetailWithForwardedXcm, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSender, WithRequiredSwapOptions };
|