@paraspell/sdk-core 13.5.0 → 13.6.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 +193 -108
- package/dist/index.mjs +5291 -4908
- 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
|
+
readonly _customCtx: TFullCustomCtx;
|
|
45
52
|
_ttlMs: number;
|
|
46
53
|
_disconnectAllowed: boolean;
|
|
47
54
|
abstract readonly type: TApiType;
|
|
@@ -50,7 +57,22 @@ 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): Promise<void>;
|
|
54
76
|
abstract leaseClient(wsUrl: TUrl, ttlMs: number): Promise<TApi>;
|
|
55
77
|
abstract accountToHex(address: string, isPrefixed?: boolean): string;
|
|
56
78
|
abstract accountToUint8a(address: string): Uint8Array;
|
|
@@ -68,6 +90,9 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
|
68
90
|
abstract getMethod(tx: TRes): string;
|
|
69
91
|
abstract getTypeThenAssetCount(tx: TRes): number | undefined;
|
|
70
92
|
abstract hasMethod(pallet: TPallet, method: string): Promise<boolean>;
|
|
93
|
+
abstract hasRuntimeApi(runtimeApi: TRuntimeApi): Promise<boolean>;
|
|
94
|
+
abstract fetchPalletList(): Promise<TPalletEntry[]>;
|
|
95
|
+
abstract isEvmChain(): Promise<boolean>;
|
|
71
96
|
abstract getPaymentInfo(tx: TRes, address: string): Promise<{
|
|
72
97
|
partialFee: bigint;
|
|
73
98
|
weight: TWeight;
|
|
@@ -77,8 +102,8 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
|
77
102
|
abstract getEvmStorage(contract: string, slot: string): Promise<string>;
|
|
78
103
|
abstract getFromRpc(module: string, method: string, key: string): Promise<string>;
|
|
79
104
|
abstract blake2AsHex(data: Uint8Array): string;
|
|
80
|
-
abstract clone(): PolkadotApi<TApi, TRes, TSigner>;
|
|
81
|
-
abstract createApiForChain(chain: TSubstrateChain): Promise<PolkadotApi<TApi, TRes, TSigner>>;
|
|
105
|
+
abstract clone(): PolkadotApi<TApi, TRes, TSigner, TCustomChain>;
|
|
106
|
+
abstract createApiForChain(chain: TSubstrateChain): Promise<PolkadotApi<TApi, TRes, TSigner, TCustomChain>>;
|
|
82
107
|
abstract getDryRunCall(options: TDryRunCallBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
83
108
|
abstract getDryRunXcm(options: TDryRunXcmBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
84
109
|
abstract getBridgeStatus(): Promise<TBridgeStatus>;
|
|
@@ -88,14 +113,16 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner> {
|
|
|
88
113
|
abstract deriveAddress(sender: TSender<TSigner>): string;
|
|
89
114
|
abstract signAndSubmit(tx: TRes, sender: TSender<TSigner>): Promise<string>;
|
|
90
115
|
abstract signAndSubmitFinalized(tx: TRes, sender: TSender<TSigner>): Promise<string>;
|
|
116
|
+
abstract getSystemProperties(): Promise<TSystemProperties>;
|
|
117
|
+
private maybeHydrateCustomChain;
|
|
91
118
|
}
|
|
92
119
|
|
|
93
|
-
declare abstract class Chain<TApi, TRes, TSigner> {
|
|
120
|
+
declare abstract class Chain<TApi, TRes, TSigner, TCustomChain extends string = never> {
|
|
94
121
|
private readonly _chain;
|
|
95
122
|
private readonly _info;
|
|
96
123
|
private readonly _ecosystem;
|
|
97
124
|
private readonly _version;
|
|
98
|
-
constructor(chain: TSubstrateChain, info: string, ecosystem: TRelaychain, version: Version);
|
|
125
|
+
constructor(chain: TSubstrateChain | TCustomChain, info: string, ecosystem: TRelaychain, version: Version);
|
|
99
126
|
get info(): string;
|
|
100
127
|
get ecosystem(): TRelaychain;
|
|
101
128
|
get chain(): TSubstrateChain;
|
|
@@ -106,16 +133,16 @@ declare abstract class Chain<TApi, TRes, TSigner> {
|
|
|
106
133
|
throwIfTempDisabled(options: TTransferInternalOptions<TApi, TRes, TSigner>, destChain?: TChain): void;
|
|
107
134
|
isSendingTempDisabled(_options: TTransferInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
108
135
|
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;
|
|
136
|
+
canReceiveFrom(_origin: TChain | TCustomChain): boolean;
|
|
137
|
+
shouldUseNativeAssetTeleport({ api, assetInfo: asset, to }: TTransferInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
138
|
+
createAsset(api: PolkadotApi<TApi, TRes, TSigner>, asset: WithAmount<TAssetInfo>, version: Version): TAsset;
|
|
139
|
+
getNativeAssetSymbol(api: PolkadotApi<TApi, TRes, TSigner>): string;
|
|
113
140
|
transferLocal(options: TTransferInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
114
141
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
115
142
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
116
143
|
getBalanceNative(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
117
|
-
getCustomCurrencyId(_asset: TAssetInfo): unknown;
|
|
118
|
-
getBalanceForeign
|
|
144
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, _asset: TAssetInfo): unknown;
|
|
145
|
+
getBalanceForeign(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
119
146
|
getBalance(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
120
147
|
}
|
|
121
148
|
|
|
@@ -125,7 +152,7 @@ declare class Acala<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> impl
|
|
|
125
152
|
isRelayToParaEnabled(): boolean;
|
|
126
153
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
127
154
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
128
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
155
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TForeignOrTokenAsset;
|
|
129
156
|
getBalance(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
130
157
|
}
|
|
131
158
|
|
|
@@ -184,7 +211,7 @@ declare class Basilisk<TApi, TRes, TSigner> extends Hydration<TApi, TRes, TSigne
|
|
|
184
211
|
|
|
185
212
|
declare class BifrostPolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
186
213
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
187
|
-
getCustomCurrencyId(asset: TAssetInfo): {
|
|
214
|
+
getCustomCurrencyId(api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): {
|
|
188
215
|
Native: string;
|
|
189
216
|
VToken?: undefined;
|
|
190
217
|
Token?: undefined;
|
|
@@ -259,7 +286,7 @@ declare class BridgeHubWestend<TApi, TRes, TSigner> extends BridgeHubPolkadot<TA
|
|
|
259
286
|
|
|
260
287
|
declare class Centrifuge<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
261
288
|
constructor();
|
|
262
|
-
getCustomCurrencyId(asset: TAssetInfo): "Native" | {
|
|
289
|
+
getCustomCurrencyId(api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): "Native" | {
|
|
263
290
|
ForeignAsset: number;
|
|
264
291
|
};
|
|
265
292
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -352,7 +379,7 @@ declare class HydrationPaseo<TApi, TRes, TSigner> extends Hydration<TApi, TRes,
|
|
|
352
379
|
|
|
353
380
|
declare class Interlay<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
354
381
|
constructor();
|
|
355
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
382
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TForeignOrTokenAsset;
|
|
356
383
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
357
384
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
358
385
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -361,7 +388,7 @@ declare class Interlay<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> i
|
|
|
361
388
|
|
|
362
389
|
declare class Jamton<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
363
390
|
constructor();
|
|
364
|
-
getCustomCurrencyId(asset: TAssetInfo): {
|
|
391
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): {
|
|
365
392
|
Native: number;
|
|
366
393
|
ForeignAsset?: undefined;
|
|
367
394
|
} | {
|
|
@@ -377,7 +404,7 @@ declare class Karura<TApi, TRes, TSigner> extends Acala<TApi, TRes, TSigner> {
|
|
|
377
404
|
|
|
378
405
|
declare class Kintsugi<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
379
406
|
constructor();
|
|
380
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
407
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TForeignOrTokenAsset;
|
|
381
408
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
382
409
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
383
410
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -393,16 +420,6 @@ declare class Kusama<TApi, TRes, TSigner> extends Polkadot<TApi, TRes, TSigner>
|
|
|
393
420
|
constructor();
|
|
394
421
|
}
|
|
395
422
|
|
|
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
423
|
declare class Moonbeam<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
407
424
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
408
425
|
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
@@ -446,7 +463,7 @@ declare class Peaq<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> imple
|
|
|
446
463
|
|
|
447
464
|
declare class Pendulum<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
448
465
|
constructor();
|
|
449
|
-
getCustomCurrencyId(asset: TAssetInfo): TXcmAsset;
|
|
466
|
+
getCustomCurrencyId(api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TXcmAsset;
|
|
450
467
|
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
451
468
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
452
469
|
}
|
|
@@ -509,7 +526,7 @@ declare class Xode<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> imple
|
|
|
509
526
|
|
|
510
527
|
declare class Zeitgeist<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
511
528
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
512
|
-
getCustomCurrencyId(asset: TAssetInfo): TZeitgeistAsset | TXcmForeignAsset;
|
|
529
|
+
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner>, asset: TAssetInfo): TZeitgeistAsset | TXcmForeignAsset;
|
|
513
530
|
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
514
531
|
canReceiveFrom(origin: TChain): boolean;
|
|
515
532
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
@@ -558,7 +575,6 @@ declare const chains: <TApi, TRes, TSigner>() => {
|
|
|
558
575
|
Karura: Karura<TApi, TRes, TSigner>;
|
|
559
576
|
Kintsugi: Kintsugi<TApi, TRes, TSigner>;
|
|
560
577
|
Moonriver: Moonriver<TApi, TRes, TSigner>;
|
|
561
|
-
Laos: Laos<TApi, TRes, TSigner>;
|
|
562
578
|
Quartz: Quartz<TApi, TRes, TSigner>;
|
|
563
579
|
PeopleKusama: PeopleKusama<TApi, TRes, TSigner>;
|
|
564
580
|
Shiden: Shiden<TApi, TRes, TSigner>;
|
|
@@ -580,7 +596,6 @@ declare const chains: <TApi, TRes, TSigner>() => {
|
|
|
580
596
|
BifrostPaseo: BifrostPaseo<TApi, TRes, TSigner>;
|
|
581
597
|
HeimaPaseo: HeimaPaseo<TApi, TRes, TSigner>;
|
|
582
598
|
HydrationPaseo: HydrationPaseo<TApi, TRes, TSigner>;
|
|
583
|
-
LaosPaseo: LaosPaseo<TApi, TRes, TSigner>;
|
|
584
599
|
NeuroWebPaseo: NeuroWebPaseo<TApi, TRes, TSigner>;
|
|
585
600
|
ZeitgeistPaseo: ZeitgeistPaseo<TApi, TRes, TSigner>;
|
|
586
601
|
};
|
|
@@ -675,7 +690,7 @@ declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
|
675
690
|
/**
|
|
676
691
|
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
677
692
|
*/
|
|
678
|
-
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object> {
|
|
693
|
+
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object, TCustomChain extends string = never> {
|
|
679
694
|
readonly batchManager: BatchTransactionManager<TApi, TRes, TSigner>;
|
|
680
695
|
readonly api: PolkadotApi<TApi, TRes, TSigner>;
|
|
681
696
|
readonly _options: T;
|
|
@@ -686,9 +701,9 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
686
701
|
* @param chain - The chain from which the transaction originates.
|
|
687
702
|
* @returns An instance of Builder
|
|
688
703
|
*/
|
|
689
|
-
from(chain: TChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
704
|
+
from(chain: TChain | TCustomChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
690
705
|
from: TChain;
|
|
691
|
-
}>;
|
|
706
|
+
}, TCustomChain>;
|
|
692
707
|
/**
|
|
693
708
|
* Specifies the destination chain for the transaction.
|
|
694
709
|
*
|
|
@@ -696,9 +711,9 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
696
711
|
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
697
712
|
* @returns An instance of Builder
|
|
698
713
|
*/
|
|
699
|
-
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
714
|
+
to(chain: TDestination | TCustomChain, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
700
715
|
to: TDestination;
|
|
701
|
-
}>;
|
|
716
|
+
}, TCustomChain>;
|
|
702
717
|
/**
|
|
703
718
|
* Initiates the process to claim assets from a specified chain.
|
|
704
719
|
*
|
|
@@ -717,7 +732,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
717
732
|
*/
|
|
718
733
|
currency(currency: TCurrencyInputWithAmount): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
719
734
|
currency: TCurrencyInputWithAmount;
|
|
720
|
-
}>;
|
|
735
|
+
}, TCustomChain>;
|
|
721
736
|
/**
|
|
722
737
|
* Sets the recipient address.
|
|
723
738
|
*
|
|
@@ -726,7 +741,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
726
741
|
*/
|
|
727
742
|
recipient(address: TAddress): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
728
743
|
recipient: TAddress;
|
|
729
|
-
}>;
|
|
744
|
+
}, TCustomChain>;
|
|
730
745
|
/**
|
|
731
746
|
* Sets the sender address or signer.
|
|
732
747
|
*
|
|
@@ -735,7 +750,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
735
750
|
*/
|
|
736
751
|
sender(sender: TSender<TSigner> | WalletClient): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
737
752
|
sender: string;
|
|
738
|
-
}>;
|
|
753
|
+
}, TCustomChain>;
|
|
739
754
|
/**
|
|
740
755
|
* Sets the asset hub address. This is used for transfers that go through the Asset Hub and originate from an EVM chain.
|
|
741
756
|
*
|
|
@@ -744,7 +759,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
744
759
|
*/
|
|
745
760
|
ahAddress(address: string | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
746
761
|
ahAddress: string | undefined;
|
|
747
|
-
}>;
|
|
762
|
+
}, never>;
|
|
748
763
|
/**
|
|
749
764
|
* Sets the XCM version to be used for the transfer.
|
|
750
765
|
*
|
|
@@ -753,7 +768,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
753
768
|
*/
|
|
754
769
|
xcmVersion(version: Version): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
755
770
|
version: Version;
|
|
756
|
-
}>;
|
|
771
|
+
}, never>;
|
|
757
772
|
/**
|
|
758
773
|
* Whether to keep the account alive after the transfer.
|
|
759
774
|
*
|
|
@@ -762,7 +777,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
762
777
|
*/
|
|
763
778
|
keepAlive(keepAlive: boolean): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
764
779
|
keepAlive: boolean;
|
|
765
|
-
}>;
|
|
780
|
+
}, never>;
|
|
766
781
|
/**
|
|
767
782
|
* Sets a custom pallet for the transaction.
|
|
768
783
|
*
|
|
@@ -773,7 +788,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
773
788
|
customPallet(pallet: string | undefined, method: string | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
774
789
|
pallet: string | undefined;
|
|
775
790
|
method: string | undefined;
|
|
776
|
-
}>;
|
|
791
|
+
}, never>;
|
|
777
792
|
/**
|
|
778
793
|
* Optional fee asset for the transaction.
|
|
779
794
|
*
|
|
@@ -782,7 +797,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
782
797
|
*/
|
|
783
798
|
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
784
799
|
feeAsset: TCurrencyInput | undefined;
|
|
785
|
-
}>;
|
|
800
|
+
}, never>;
|
|
786
801
|
/**
|
|
787
802
|
* Sets the hex of the encoded transaction call to apply on the destination chain
|
|
788
803
|
*
|
|
@@ -797,7 +812,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
797
812
|
originKind: "Native" | "SovereignAccount" | "Superuser" | "Xcm" | undefined;
|
|
798
813
|
maxWeight: TWeight | undefined;
|
|
799
814
|
};
|
|
800
|
-
}>;
|
|
815
|
+
}, never>;
|
|
801
816
|
/**
|
|
802
817
|
* Performs a token swap as part of the transfer, using the specified exchange and destination currency.
|
|
803
818
|
*
|
|
@@ -806,54 +821,54 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
806
821
|
*/
|
|
807
822
|
swap(options: TSwapOptions<TApi, TRes, TSigner>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
808
823
|
swapOptions: TSwapOptions<TApi, TRes, TSigner>;
|
|
809
|
-
}>;
|
|
824
|
+
}, TCustomChain>;
|
|
810
825
|
/**
|
|
811
826
|
* Adds the transfer transaction to the batch.
|
|
812
827
|
*
|
|
813
828
|
* @returns An instance of Builder
|
|
814
829
|
*/
|
|
815
|
-
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
830
|
+
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
816
831
|
from: TSubstrateChain;
|
|
817
|
-
}>;
|
|
832
|
+
}, TCustomChain>;
|
|
818
833
|
/**
|
|
819
834
|
* Builds and returns the batched transaction based on the configured parameters.
|
|
820
835
|
*
|
|
821
836
|
* @param options - (Optional) Options to customize the batch transaction.
|
|
822
837
|
* @returns A Extrinsic representing the batched transactions.
|
|
823
838
|
*/
|
|
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>>;
|
|
839
|
+
buildBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, options?: TBatchOptions): Promise<TRes>;
|
|
840
|
+
protected buildInternal<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions, TCustomChain>): Promise<TBuildInternalRes<TApi, TRes, TSigner, TOptions>>;
|
|
826
841
|
private prepareNormalizedOptions;
|
|
827
842
|
/**
|
|
828
843
|
* Builds and returns the transfer extrinsic.
|
|
829
844
|
*
|
|
830
845
|
* @returns A Promise that resolves to the transfer extrinsic.
|
|
831
846
|
*/
|
|
832
|
-
build(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
847
|
+
build(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TRes>;
|
|
833
848
|
/**
|
|
834
849
|
* Builds an unsigned EIP-1559 transaction (viem `TransactionSerializableEIP1559`) for an
|
|
835
850
|
* EVM-compatible origin. `nonce`, `gas`, and fees are populated from the origin chain's RPC.
|
|
836
851
|
*/
|
|
837
|
-
buildEvm(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
852
|
+
buildEvm(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TransactionSerializableEIP1559>;
|
|
838
853
|
/**
|
|
839
854
|
* Builds and returns multiple transfer or swap extrinsics
|
|
840
855
|
*
|
|
841
856
|
* @returns A Promise that resolves to the transfer extrinsic contexts
|
|
842
857
|
*/
|
|
843
|
-
buildAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
858
|
+
buildAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TTransactionContext<TApi, TRes>[]>;
|
|
844
859
|
private validateBatchState;
|
|
845
860
|
private buildCommon;
|
|
846
861
|
private buildCommonAll;
|
|
847
862
|
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>;
|
|
863
|
+
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TDryRunResult>;
|
|
864
|
+
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
865
|
+
protected createTxFactory<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions, TCustomChain>): TTxFactory<TRes>;
|
|
851
866
|
/**
|
|
852
867
|
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
853
868
|
*
|
|
854
869
|
* @returns An origin and destination fee.
|
|
855
870
|
*/
|
|
856
|
-
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
871
|
+
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, options?: TGetXcmFeeBuilderOptions & {
|
|
857
872
|
disableFallback: TDisableFallback;
|
|
858
873
|
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
859
874
|
/**
|
|
@@ -861,7 +876,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
861
876
|
*
|
|
862
877
|
* @returns An origin fee.
|
|
863
878
|
*/
|
|
864
|
-
getOriginXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
879
|
+
getOriginXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, options?: TGetXcmFeeBuilderOptions & {
|
|
865
880
|
disableFallback: TDisableFallback;
|
|
866
881
|
}): Promise<TXcmFeeDetailWithForwardedXcm<TDisableFallback>>;
|
|
867
882
|
/**
|
|
@@ -869,38 +884,38 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
869
884
|
*
|
|
870
885
|
* @returns The max transferable amount.
|
|
871
886
|
*/
|
|
872
|
-
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
887
|
+
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<bigint>;
|
|
873
888
|
/**
|
|
874
889
|
* Returns the min transferable amount for the transfer
|
|
875
890
|
*
|
|
876
891
|
* @returns The min transferable amount.
|
|
877
892
|
*/
|
|
878
|
-
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
893
|
+
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<bigint>;
|
|
879
894
|
/**
|
|
880
895
|
* Returns the max transferable amount for the transfer
|
|
881
896
|
*
|
|
882
897
|
* @returns The max transferable amount.
|
|
883
898
|
*/
|
|
884
|
-
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
899
|
+
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<boolean>;
|
|
885
900
|
/**
|
|
886
901
|
* Returns the transfer info for the transfer
|
|
887
902
|
*
|
|
888
903
|
* @returns The transfer info.
|
|
889
904
|
*/
|
|
890
|
-
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner
|
|
905
|
+
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TTransferInfo>;
|
|
891
906
|
/**
|
|
892
907
|
* Returns the receivable amount on the destination after the transfer
|
|
893
908
|
*
|
|
894
909
|
* @returns The computed receivable amount.
|
|
895
910
|
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
896
911
|
*/
|
|
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
|
|
912
|
+
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<bigint>;
|
|
913
|
+
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSwap<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<{
|
|
899
914
|
exchange: TExchangeChain;
|
|
900
915
|
amountOut: bigint;
|
|
901
916
|
}>;
|
|
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
|
|
917
|
+
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<string>;
|
|
918
|
+
signAndSubmitAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<string[]>;
|
|
904
919
|
private executeWithEvmSigner;
|
|
905
920
|
private prepareEvmDispatch;
|
|
906
921
|
/**
|
|
@@ -922,7 +937,60 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
922
937
|
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
923
938
|
* @returns A new Builder instance.
|
|
924
939
|
*/
|
|
925
|
-
declare const Builder: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>) => GeneralBuilder<TApi, TRes, TSigner, object>;
|
|
940
|
+
declare const Builder: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>) => GeneralBuilder<TApi, TRes, TSigner, object, TCustomChain>;
|
|
941
|
+
|
|
942
|
+
type TProviderEntry = {
|
|
943
|
+
name: string;
|
|
944
|
+
endpoint: string;
|
|
945
|
+
};
|
|
946
|
+
type TChainConfig = {
|
|
947
|
+
name: string;
|
|
948
|
+
info: string;
|
|
949
|
+
paraId: number;
|
|
950
|
+
providers: TProviderEntry[];
|
|
951
|
+
};
|
|
952
|
+
type TChainConfigMap = Record<TSubstrateChain, TChainConfig>;
|
|
953
|
+
|
|
954
|
+
type TCustomChainPalletsInput = {
|
|
955
|
+
nativeAssets?: TAssetsPallet;
|
|
956
|
+
otherAssets?: TAssetsPallet[];
|
|
957
|
+
};
|
|
958
|
+
type TCustomChainInput = {
|
|
959
|
+
paraId: number;
|
|
960
|
+
ecosystem: TRelaychain;
|
|
961
|
+
providers: TProviderEntry[];
|
|
962
|
+
xcmVersion: Version;
|
|
963
|
+
ss58Prefix?: number;
|
|
964
|
+
nativeAssetSymbol?: string;
|
|
965
|
+
nativeAssetDecimals?: number;
|
|
966
|
+
assets?: TCustomAssetInfo[];
|
|
967
|
+
pallets?: TCustomChainPalletsInput;
|
|
968
|
+
};
|
|
969
|
+
type TCustomChainsMap = Record<string, TCustomChainInput>;
|
|
970
|
+
type TCustomChainEntry = {
|
|
971
|
+
name: string;
|
|
972
|
+
paraId: number;
|
|
973
|
+
ecosystem: TRelaychain;
|
|
974
|
+
providers: TProviderEntry[];
|
|
975
|
+
xcmVersion: Version;
|
|
976
|
+
ss58Prefix?: number;
|
|
977
|
+
nativeAssetSymbol?: string;
|
|
978
|
+
nativeAssetDecimals?: number;
|
|
979
|
+
assets: TAssetInfo[];
|
|
980
|
+
pallets?: TCustomChainPallets;
|
|
981
|
+
};
|
|
982
|
+
type TCustomChainEntryHydrated = TCustomChainEntry & {
|
|
983
|
+
xcmPallet: TCrosschainPallet;
|
|
984
|
+
isEVM: boolean;
|
|
985
|
+
supportsDryRunApi: boolean;
|
|
986
|
+
supportsXcmPaymentApi: boolean;
|
|
987
|
+
pallets: TCustomChainPallets;
|
|
988
|
+
};
|
|
989
|
+
type TCustomChainsCtx = Record<string, TCustomChainEntry>;
|
|
990
|
+
type TFullCustomCtx = TCustomCtx & {
|
|
991
|
+
customChains?: TCustomChainsCtx;
|
|
992
|
+
customChainPallets?: Record<string, TCustomChainPallets>;
|
|
993
|
+
};
|
|
926
994
|
|
|
927
995
|
type TEvmTransferOptionsBase = {
|
|
928
996
|
from: TChain;
|
|
@@ -967,10 +1035,15 @@ type TDryRunPreviewOptions = {
|
|
|
967
1035
|
type TBuilderOptions<TApi> = TApi | TBuilderConfig<TApi>;
|
|
968
1036
|
type TBuilderConfig<TApi> = Partial<{
|
|
969
1037
|
apiOverrides: Partial<Record<TChain, TApi>>;
|
|
1038
|
+
customAssets: TCustomAssetsMap;
|
|
1039
|
+
customChains: TCustomChainsMap;
|
|
970
1040
|
development: boolean;
|
|
971
1041
|
abstractDecimals: boolean;
|
|
972
1042
|
xcmFormatCheck: boolean;
|
|
973
1043
|
}>;
|
|
1044
|
+
type TCustomChainFrom<TOpts> = TOpts extends {
|
|
1045
|
+
customChains: infer C;
|
|
1046
|
+
} ? Extract<keyof C, string> : never;
|
|
974
1047
|
type TCreateTxsOptions<TApi, TRes, TSigner> = Pick<TTransferOptions<TApi, TRes, TSigner>, 'api' | 'from' | 'to' | 'currency'>;
|
|
975
1048
|
type TBatchedTransferOptions<TApi, TRes, TSigner> = Omit<TSubstrateTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'> & {
|
|
976
1049
|
builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>;
|
|
@@ -1272,6 +1345,21 @@ declare class BridgeHaltedError extends Error {
|
|
|
1272
1345
|
constructor();
|
|
1273
1346
|
}
|
|
1274
1347
|
|
|
1348
|
+
/**
|
|
1349
|
+
* Error thrown when a custom chain name collides with a built-in chain.
|
|
1350
|
+
*/
|
|
1351
|
+
declare class CustomChainConflictError extends Error {
|
|
1352
|
+
constructor(msg: string);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Error thrown when a custom chain definition is missing required fields or
|
|
1357
|
+
* carries invalid values.
|
|
1358
|
+
*/
|
|
1359
|
+
declare class CustomChainInvalidError extends Error {
|
|
1360
|
+
constructor(msg: string);
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1275
1363
|
/**
|
|
1276
1364
|
* Error thrown when the Dry Run fails.
|
|
1277
1365
|
*/
|
|
@@ -1322,13 +1410,13 @@ declare class InvalidAddressError extends Error {
|
|
|
1322
1410
|
/**
|
|
1323
1411
|
* Error development mode is on and no API override is provided for a specific chain.
|
|
1324
1412
|
*/
|
|
1325
|
-
declare class MissingChainApiError extends Error {
|
|
1413
|
+
declare class MissingChainApiError<TCustomChain extends string = never> extends Error {
|
|
1326
1414
|
/**
|
|
1327
1415
|
* Constructs a new MissingChainApiError.
|
|
1328
1416
|
*
|
|
1329
1417
|
* @param chain - The chain for which the API is missing.
|
|
1330
1418
|
*/
|
|
1331
|
-
constructor(chain: TChain);
|
|
1419
|
+
constructor(chain: TChain | TCustomChain);
|
|
1332
1420
|
}
|
|
1333
1421
|
|
|
1334
1422
|
/**
|
|
@@ -1341,13 +1429,13 @@ declare class MissingParameterError extends Error {
|
|
|
1341
1429
|
/**
|
|
1342
1430
|
* Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
1343
1431
|
*/
|
|
1344
|
-
declare class NoXCMSupportImplementedError extends Error {
|
|
1432
|
+
declare class NoXCMSupportImplementedError<TCustomChain extends string = never> extends Error {
|
|
1345
1433
|
/**
|
|
1346
1434
|
* Constructs a new NoXCMSupportImplementedError.
|
|
1347
1435
|
*
|
|
1348
1436
|
* @param chain - The chain for which XCM support is not implemented.
|
|
1349
1437
|
*/
|
|
1350
|
-
constructor(chain: TChain);
|
|
1438
|
+
constructor(chain: TChain | TCustomChain);
|
|
1351
1439
|
}
|
|
1352
1440
|
|
|
1353
1441
|
/**
|
|
@@ -2016,7 +2104,7 @@ type TSetBalanceRes = {
|
|
|
2016
2104
|
declare abstract class BaseAssetsPallet {
|
|
2017
2105
|
protected palletName: TAssetsPallet;
|
|
2018
2106
|
constructor(palletName: TAssetsPallet);
|
|
2019
|
-
abstract mint<TApi, TRes, TSigner>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain
|
|
2107
|
+
abstract mint<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain): Promise<TSetBalanceRes>;
|
|
2020
2108
|
abstract getBalance<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
2021
2109
|
}
|
|
2022
2110
|
|
|
@@ -2103,18 +2191,6 @@ type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
|
2103
2191
|
};
|
|
2104
2192
|
type TVerifyEdOnDestinationOptions<TApi, TRes, TSigner> = WithApi<TVerifyEdOnDestinationOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
2105
2193
|
|
|
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
2194
|
type OneKey<K extends string, V = unknown> = {
|
|
2119
2195
|
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
2120
2196
|
[Q in keyof O]: O[Q];
|
|
@@ -2205,17 +2281,24 @@ declare const getEthErc20Balance: (chain: TExternalChain, asset: TAssetInfo, add
|
|
|
2205
2281
|
|
|
2206
2282
|
declare const getMoonbeamErc20Balance: (chain: TSubstrateChain, assetId: string, address: string) => Promise<bigint>;
|
|
2207
2283
|
|
|
2284
|
+
declare const getChainConfigImpl: <TCustomChain extends string = never>(chain: TSubstrateChain | TCustomChain, ctx?: TFullCustomCtx) => TChainConfig;
|
|
2208
2285
|
declare const getChainConfig: (chain: TSubstrateChain) => TChainConfig;
|
|
2209
2286
|
|
|
2287
|
+
declare const getChainProvidersImpl: <TCustomChain extends string = never>(chain: TSubstrateChain | TCustomChain, ctx?: TFullCustomCtx) => string[];
|
|
2210
2288
|
declare const getChainProviders: (chain: TSubstrateChain) => string[];
|
|
2211
2289
|
|
|
2290
|
+
declare const getParaIdImpl: <TCustomChain extends string = never>(chain: TChain | TCustomChain, ctx?: TFullCustomCtx) => number;
|
|
2212
2291
|
/**
|
|
2213
2292
|
* Retrieves the parachain ID for a specified chain.
|
|
2214
2293
|
*
|
|
2215
2294
|
* @param chain - The chain for which to get the paraId.
|
|
2216
2295
|
* @returns The parachain ID of the chain.
|
|
2217
2296
|
*/
|
|
2218
|
-
declare const getParaId: (chain: TChain) => number;
|
|
2297
|
+
declare const getParaId: <TCustomChain extends string = never>(chain: TChain | TCustomChain) => number;
|
|
2298
|
+
|
|
2299
|
+
declare const normalizeCustomChains: (map: TCustomChainsMap | undefined) => TCustomChainsCtx;
|
|
2300
|
+
declare const buildCustomChainConfig: (entry: TCustomChainEntry) => TChainConfig;
|
|
2301
|
+
declare const buildCustomChainAssetsInfo: (entry: TCustomChainEntryHydrated) => TChainAssetsInfo;
|
|
2219
2302
|
|
|
2220
2303
|
/**
|
|
2221
2304
|
* Retrieves the chain name corresponding to a specified parachain ID.
|
|
@@ -2358,7 +2441,7 @@ declare const createTypeAndThenCall: <TApi, TRes, TSigner>(options: TPolkadotXCM
|
|
|
2358
2441
|
declare const createTypeThenAutoReserve: <TApi, TRes, TSigner>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TSerializedExtrinsics>;
|
|
2359
2442
|
|
|
2360
2443
|
declare const validateCurrency: (currency: TCurrencyInput, feeAsset?: TCurrencyInput) => void;
|
|
2361
|
-
declare const validateDestination: (origin: TSubstrateChain, destination: TDestination) => void;
|
|
2444
|
+
declare const validateDestination: <TApi, TRes, TSigner>(origin: TSubstrateChain, destination: TDestination, api: PolkadotApi<TApi, TRes, TSigner>) => void;
|
|
2362
2445
|
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput) => void;
|
|
2363
2446
|
declare const validateTransact: <TApi, TRes, TSigner>({ api, from, to, sender, recipient: address, transactOptions }: TSubstrateTransferOptions<TApi, TRes, TSigner>) => ValidationError | undefined;
|
|
2364
2447
|
|
|
@@ -2403,8 +2486,9 @@ declare const createTransferOrSwapAll: <TApi, TRes, TSigner>(options: TSubstrate
|
|
|
2403
2486
|
declare const createTransferOrSwap: <TApi, TRes, TSigner>(options: TSubstrateTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2404
2487
|
|
|
2405
2488
|
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation, resolveExternalReserve?: boolean) => TChain;
|
|
2489
|
+
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
2490
|
|
|
2407
|
-
declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
2491
|
+
declare const getChainVersion: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TChain) => Version;
|
|
2408
2492
|
|
|
2409
2493
|
/**
|
|
2410
2494
|
* Gets the relay chain (Polkadot, Kusama, Westend, or Paseo) of a given chain.
|
|
@@ -2413,6 +2497,15 @@ declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
|
2413
2497
|
* @returns The corresponding relay chain.
|
|
2414
2498
|
*/
|
|
2415
2499
|
declare const getRelayChainOf: (chain: TSubstrateChain) => TRelaychain;
|
|
2500
|
+
declare const getRelayChainOfImpl: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain | TCustomChain) => TRelaychain;
|
|
2501
|
+
|
|
2502
|
+
/**
|
|
2503
|
+
* Gets the native asset symbol of the relay chain that the given chain belongs to.
|
|
2504
|
+
*
|
|
2505
|
+
* @param chain - The chain to evaluate.
|
|
2506
|
+
* @returns The native asset symbol of the corresponding relay chain.
|
|
2507
|
+
*/
|
|
2508
|
+
declare const getRelayChainSymbolOf: (chain: TSubstrateChain) => string;
|
|
2416
2509
|
|
|
2417
2510
|
declare const createChainClient: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain) => Promise<TApi>;
|
|
2418
2511
|
|
|
@@ -2445,29 +2538,21 @@ declare const isViemSigner: (value: unknown) => value is WalletClient;
|
|
|
2445
2538
|
declare const createBeneficiaryLocXTokens: <TApi, TRes, TSigner>({ api, recipient, origin, destination, version, paraId }: TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2446
2539
|
declare const createBeneficiaryLocation: <TApi, TRes, TSigner>({ api, address, version }: TCreateBeneficiaryOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2447
2540
|
|
|
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>;
|
|
2541
|
+
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;
|
|
2542
|
+
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
2543
|
|
|
2451
2544
|
declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
|
|
2452
2545
|
|
|
2453
2546
|
declare const getChainLocation: (chain: TChain, destChain: TChain) => TLocation;
|
|
2454
2547
|
|
|
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
2548
|
declare const localizeLocation: (chain: TChain, location: TLocation, origin?: TChain) => TLocation;
|
|
2549
|
+
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
2550
|
|
|
2466
2551
|
declare const reverseTransformLocation: (location: TLocation) => TLocation;
|
|
2467
2552
|
|
|
2468
2553
|
declare const normalizeAmount: (amount: bigint) => bigint;
|
|
2469
2554
|
|
|
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" | "
|
|
2555
|
+
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
2556
|
|
|
2472
2557
|
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
2473
2558
|
|
|
@@ -2490,7 +2575,7 @@ declare const createAssetsFilter: (asset: TAsset, version: Version) => {
|
|
|
2490
2575
|
};
|
|
2491
2576
|
};
|
|
2492
2577
|
|
|
2493
|
-
declare const createBaseExecuteXcm: <TRes>(options:
|
|
2578
|
+
declare const createBaseExecuteXcm: <TApi, TRes, TSigner>(options: TCreateTransferXcmOptions<TApi, TRes, TSigner> & {
|
|
2494
2579
|
suffixXcm?: unknown[];
|
|
2495
2580
|
}) => unknown[];
|
|
2496
2581
|
|
|
@@ -2517,8 +2602,8 @@ declare const formatUnits: typeof formatUnits$1;
|
|
|
2517
2602
|
|
|
2518
2603
|
declare const addXcmVersionHeader: <T, V extends Version>(obj: T, version: V) => OneKey<V, T>;
|
|
2519
2604
|
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;
|
|
2605
|
+
declare const pickCompatibleXcmVersion: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, origin: TSubstrateChain, destination: TDestination, override?: Version) => Version;
|
|
2606
|
+
declare const pickRouterCompatibleXcmVersion: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2522
2607
|
|
|
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 };
|
|
2608
|
+
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 };
|
|
2609
|
+
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 };
|