@paraspell/sdk-core 12.5.1 → 12.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 +1964 -1874
- package/dist/index.mjs +2625 -2208
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as _paraspell_sdk_common from '@paraspell/sdk-common';
|
|
2
|
-
import { TChain, TSubstrateChain, TLocation,
|
|
2
|
+
import { TChain, TSubstrateChain, Version, TLocation, TRelaychain, TParachain, TExternalChain, TJunction, Parents, TJunctions } from '@paraspell/sdk-common';
|
|
3
3
|
export * from '@paraspell/sdk-common';
|
|
4
|
-
import
|
|
4
|
+
import * as _paraspell_assets from '@paraspell/assets';
|
|
5
|
+
import { TAssetInfo, WithAmount, TAsset, TCurrencyInputWithAmount, TCurrencyInput, TAssetWithFee, WithComplexAmount, TCurrencyCore, TAmount, TAssetWithLocation, TAssetInfoWithId } from '@paraspell/assets';
|
|
5
6
|
export * from '@paraspell/assets';
|
|
6
7
|
import { TPallet, TAssetsPallet } from '@paraspell/pallets';
|
|
7
8
|
export * from '@paraspell/pallets';
|
|
8
9
|
import { WalletClient, formatUnits as formatUnits$1, parseUnits as parseUnits$1 } from 'viem';
|
|
9
10
|
|
|
10
|
-
type WithApi<TBase, TApi, TRes> = TBase & {
|
|
11
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
11
|
+
type WithApi<TBase, TApi, TRes, TSigner> = TBase & {
|
|
12
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
12
13
|
};
|
|
13
14
|
type TUrl = string | string[];
|
|
14
15
|
type TApiOrUrl<TApi> = TApi | TUrl;
|
|
@@ -35,7 +36,7 @@ type ClientCache<T> = {
|
|
|
35
36
|
revive: (k: TClientKey, ttl: number) => void;
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
interface IPolkadotApi<TApi, TRes> {
|
|
39
|
+
interface IPolkadotApi<TApi, TRes, TSigner> {
|
|
39
40
|
getConfig(): TBuilderOptions<TApiOrUrl<TApi>> | undefined;
|
|
40
41
|
getApi(): TApi;
|
|
41
42
|
init(chain: TChain, clientTtlMs?: number): Promise<void>;
|
|
@@ -43,25 +44,29 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
43
44
|
accountToHex(address: string, isPrefixed?: boolean): string;
|
|
44
45
|
accountToUint8a(address: string): Uint8Array;
|
|
45
46
|
deserializeExtrinsics(serialized: TSerializedExtrinsics): TRes;
|
|
47
|
+
txFromHex(hex: string): Promise<TRes>;
|
|
46
48
|
queryState<T>(serialized: TSerializedStateQuery): Promise<T>;
|
|
47
49
|
queryRuntimeApi<T>(serialized: TSerializedRuntimeApiQuery): Promise<T>;
|
|
48
50
|
callBatchMethod(calls: TRes[], mode: BatchMode): TRes;
|
|
49
51
|
callDispatchAsMethod(call: TRes, address: string): TRes;
|
|
50
|
-
objectToHex(obj: unknown, typeName: string): Promise<string>;
|
|
52
|
+
objectToHex(obj: unknown, typeName: string, version: Version): Promise<string>;
|
|
51
53
|
hexToUint8a(hex: string): Uint8Array;
|
|
52
54
|
stringToUint8a(str: string): Uint8Array;
|
|
53
55
|
getMethod(tx: TRes): string;
|
|
54
56
|
getTypeThenAssetCount(tx: TRes): number | undefined;
|
|
55
57
|
hasMethod(pallet: TPallet, method: string): Promise<boolean>;
|
|
56
|
-
|
|
58
|
+
getPaymentInfo(tx: TRes, address: string): Promise<{
|
|
59
|
+
partialFee: bigint;
|
|
60
|
+
weight: TWeight;
|
|
61
|
+
}>;
|
|
57
62
|
quoteAhPrice(fromMl: TLocation, toMl: TLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
|
|
58
63
|
getXcmWeight(xcm: any): Promise<TWeight>;
|
|
59
|
-
getXcmPaymentApiFee(chain: TSubstrateChain, localXcm: any, forwardedXcm: any, asset: TAssetInfo, transformXcm: boolean): Promise<bigint>;
|
|
64
|
+
getXcmPaymentApiFee(chain: TSubstrateChain, localXcm: any, forwardedXcm: any, asset: TAssetInfo, version: Version, transformXcm: boolean): Promise<bigint>;
|
|
60
65
|
getEvmStorage(contract: string, slot: string): Promise<string>;
|
|
61
66
|
getFromRpc(module: string, method: string, key: string): Promise<string>;
|
|
62
67
|
blake2AsHex(data: Uint8Array): string;
|
|
63
|
-
clone(): IPolkadotApi<TApi, TRes>;
|
|
64
|
-
createApiForChain(chain: TSubstrateChain): Promise<IPolkadotApi<TApi, TRes>>;
|
|
68
|
+
clone(): IPolkadotApi<TApi, TRes, TSigner>;
|
|
69
|
+
createApiForChain(chain: TSubstrateChain): Promise<IPolkadotApi<TApi, TRes, TSigner>>;
|
|
65
70
|
getDryRunCall(options: TDryRunCallBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
66
71
|
getDryRunXcm(options: TDryRunXcmBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
67
72
|
getBridgeStatus(): Promise<TBridgeStatus>;
|
|
@@ -70,2048 +75,2106 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
70
75
|
disconnect(force?: boolean): Promise<void>;
|
|
71
76
|
validateSubstrateAddress(address: string): boolean;
|
|
72
77
|
deriveAddress(path: string): string;
|
|
73
|
-
|
|
78
|
+
deriveAddress(sender: TSender<TSigner>): string;
|
|
79
|
+
signAndSubmit(tx: TRes, sender: TSender<TSigner>): Promise<string>;
|
|
74
80
|
}
|
|
75
81
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
asset:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
destination: TDestination;
|
|
105
|
-
paraIdTo?: number;
|
|
106
|
-
version: Version;
|
|
107
|
-
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
108
|
-
pallet?: string;
|
|
109
|
-
method?: string;
|
|
110
|
-
useMultiAssetTransfer?: boolean;
|
|
111
|
-
};
|
|
112
|
-
type TXTransferTransferOptions<TApi, TRes> = {
|
|
113
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
114
|
-
asset: WithAmount<TAssetInfo>;
|
|
115
|
-
recipientAddress: TAddress;
|
|
116
|
-
origin: TSubstrateChain;
|
|
117
|
-
paraIdTo?: number;
|
|
118
|
-
destination: TDestination;
|
|
119
|
-
overriddenAsset?: TLocation | TAsset[];
|
|
120
|
-
pallet?: string;
|
|
121
|
-
method?: string;
|
|
122
|
-
};
|
|
123
|
-
interface IPolkadotXCMTransfer {
|
|
124
|
-
transferPolkadotXCM: <TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TRes>;
|
|
82
|
+
declare abstract class Chain<TApi, TRes, TSigner> {
|
|
83
|
+
private readonly _chain;
|
|
84
|
+
private readonly _info;
|
|
85
|
+
private readonly _ecosystem;
|
|
86
|
+
private readonly _version;
|
|
87
|
+
constructor(chain: TSubstrateChain, info: string, ecosystem: TRelaychain, version: Version);
|
|
88
|
+
get info(): string;
|
|
89
|
+
get ecosystem(): TRelaychain;
|
|
90
|
+
get chain(): TSubstrateChain;
|
|
91
|
+
get version(): Version;
|
|
92
|
+
transfer(sendOptions: TSendInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
93
|
+
isRelayToParaEnabled(): boolean;
|
|
94
|
+
throwIfCantReceive(destChain: TChain | undefined): void;
|
|
95
|
+
throwIfTempDisabled(options: TSendInternalOptions<TApi, TRes, TSigner>, destChain?: TChain): void;
|
|
96
|
+
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
97
|
+
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
98
|
+
canReceiveFrom(_origin: TChain): boolean;
|
|
99
|
+
shouldUseNativeAssetTeleport({ assetInfo: asset, to }: TSendInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
100
|
+
createAsset(asset: WithAmount<TAssetInfo>, version: Version): TAsset;
|
|
101
|
+
getNativeAssetSymbol(): string;
|
|
102
|
+
transferLocal(options: TSendInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
103
|
+
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
104
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
105
|
+
protected transferToEthereum<TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, useOnlyDepositInstruction?: boolean): Promise<TRes>;
|
|
106
|
+
getBalanceNative(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
107
|
+
getCustomCurrencyId(_asset: TAssetInfo): unknown;
|
|
108
|
+
getBalanceForeign<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
109
|
+
getBalance(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
125
110
|
}
|
|
126
|
-
|
|
127
|
-
|
|
111
|
+
|
|
112
|
+
declare class Acala<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
113
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
114
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
115
|
+
isRelayToParaEnabled(): boolean;
|
|
116
|
+
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
117
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
118
|
+
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
119
|
+
getBalance(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
128
120
|
}
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
|
|
122
|
+
declare class Ajuna<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
123
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
124
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
125
|
+
isRelayToParaEnabled(): boolean;
|
|
126
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
131
127
|
}
|
|
132
|
-
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
133
|
-
type TAddress = string | TLocation;
|
|
134
|
-
type TDestination = TChain | TLocation;
|
|
135
|
-
type TSendBaseOptions = {
|
|
136
|
-
/**
|
|
137
|
-
* The origin chain
|
|
138
|
-
*/
|
|
139
|
-
from: TSubstrateChain;
|
|
140
|
-
/**
|
|
141
|
-
* The destination address. A SS58 or H160 format.
|
|
142
|
-
*/
|
|
143
|
-
address: TAddress;
|
|
144
|
-
/**
|
|
145
|
-
* The optional sender address. A SS58 or H160 format.
|
|
146
|
-
*/
|
|
147
|
-
senderAddress?: string;
|
|
148
|
-
/**
|
|
149
|
-
* The optional asset hub address. A SS58 format only.
|
|
150
|
-
*/
|
|
151
|
-
ahAddress?: string;
|
|
152
|
-
/**
|
|
153
|
-
* The destination chain or XCM location
|
|
154
|
-
*/
|
|
155
|
-
to: TDestination;
|
|
156
|
-
/**
|
|
157
|
-
* The currency to transfer. Either ID, symbol, location, or multi-asset
|
|
158
|
-
*/
|
|
159
|
-
currency: TCurrencyInputWithAmount;
|
|
160
|
-
/**
|
|
161
|
-
* The optional fee asset. Either ID, symbol, or location
|
|
162
|
-
*/
|
|
163
|
-
feeAsset?: TCurrencyInput;
|
|
164
|
-
/**
|
|
165
|
-
* The optional destination parachain ID
|
|
166
|
-
*/
|
|
167
|
-
paraIdTo?: number;
|
|
168
|
-
/**
|
|
169
|
-
* The optional overrided XCM version
|
|
170
|
-
*/
|
|
171
|
-
version?: Version;
|
|
172
|
-
/**
|
|
173
|
-
* The optional pallet override
|
|
174
|
-
*/
|
|
175
|
-
pallet?: string;
|
|
176
|
-
/**
|
|
177
|
-
* The optional pallet method override
|
|
178
|
-
*/
|
|
179
|
-
method?: string;
|
|
180
|
-
};
|
|
181
|
-
/**
|
|
182
|
-
* Options for transferring from a parachain to another parachain or relay chain
|
|
183
|
-
*/
|
|
184
|
-
type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions, TApi, TRes> & {
|
|
185
|
-
isAmountAll: boolean;
|
|
186
|
-
};
|
|
187
|
-
type WithRequiredSenderAddress<TBase> = Omit<TBase, 'senderAddress'> & {
|
|
188
|
-
/**
|
|
189
|
-
* The sender address. A SS58 or H160 format.
|
|
190
|
-
*/
|
|
191
|
-
senderAddress: string;
|
|
192
|
-
};
|
|
193
|
-
type TSendBaseOptionsWithSenderAddress = WithRequiredSenderAddress<TSendBaseOptions>;
|
|
194
|
-
type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'feeAsset' | 'version'> & {
|
|
195
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
196
|
-
assetInfo: WithAmount<TAssetInfo>;
|
|
197
|
-
feeAsset?: TAssetInfo;
|
|
198
|
-
feeCurrency?: TCurrencyInput;
|
|
199
|
-
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
200
|
-
version: Version;
|
|
201
|
-
isAmountAll: boolean;
|
|
202
|
-
};
|
|
203
|
-
type TSerializedExtrinsics = {
|
|
204
|
-
module: TPallet;
|
|
205
|
-
method: string;
|
|
206
|
-
params: Record<string, unknown>;
|
|
207
|
-
};
|
|
208
|
-
type TSerializedStateQuery = {
|
|
209
|
-
module: TAssetsPallet;
|
|
210
|
-
method: string;
|
|
211
|
-
params: unknown[];
|
|
212
|
-
};
|
|
213
|
-
type TSerializedRuntimeApiQuery = {
|
|
214
|
-
module: string;
|
|
215
|
-
method: string;
|
|
216
|
-
params: unknown[];
|
|
217
|
-
};
|
|
218
|
-
type TDestWeight = {
|
|
219
|
-
ref_time: bigint;
|
|
220
|
-
proof_size: bigint;
|
|
221
|
-
};
|
|
222
|
-
type TXTransferMethod = 'transfer';
|
|
223
|
-
type TXTokensMethod = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
224
|
-
type TPolkadotXcmMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
225
|
-
type TXcmPalletMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
226
|
-
type TWeight = {
|
|
227
|
-
refTime: bigint;
|
|
228
|
-
proofSize: bigint;
|
|
229
|
-
};
|
|
230
|
-
type TCreateBeneficiaryOptions<TApi, TRes> = {
|
|
231
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
232
|
-
address: TAddress;
|
|
233
|
-
version: Version;
|
|
234
|
-
};
|
|
235
|
-
type TCreateBeneficiaryXTokensOptions<TApi, TRes> = {
|
|
236
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
237
|
-
origin: TSubstrateChain;
|
|
238
|
-
destination: TDestination;
|
|
239
|
-
address: TAddress;
|
|
240
|
-
version: Version;
|
|
241
|
-
paraId?: number;
|
|
242
|
-
};
|
|
243
|
-
type TBridgeStatus = 'Normal' | 'Halted';
|
|
244
|
-
type TTransferLocalOptions<TApi, TRes> = Omit<TSendInternalOptions<TApi, TRes>, 'address'> & {
|
|
245
|
-
address: string;
|
|
246
|
-
balance: bigint;
|
|
247
|
-
};
|
|
248
|
-
type TTransferFeeEstimates = {
|
|
249
|
-
originFee: bigint;
|
|
250
|
-
reserveFee: bigint;
|
|
251
|
-
};
|
|
252
|
-
type TCreateBaseTransferXcmOptions = {
|
|
253
|
-
chain: TSubstrateChain;
|
|
254
|
-
destChain: TChain;
|
|
255
|
-
assetInfo: WithAmount<TAssetInfo>;
|
|
256
|
-
feeAssetInfo?: TAssetInfo;
|
|
257
|
-
fees: TTransferFeeEstimates;
|
|
258
|
-
recipientAddress: string;
|
|
259
|
-
version: Version;
|
|
260
|
-
paraIdTo?: number;
|
|
261
|
-
};
|
|
262
|
-
type TCreateTransferXcmOptions<TApi, TRes> = WithApi<TCreateBaseTransferXcmOptions, TApi, TRes>;
|
|
263
|
-
type TCreateBaseSwapXcmOptions = {
|
|
264
|
-
chain?: TSubstrateChain;
|
|
265
|
-
exchangeChain: TParachain;
|
|
266
|
-
destChain?: TChain;
|
|
267
|
-
assetInfoFrom: WithAmount<TAssetInfo>;
|
|
268
|
-
assetInfoTo: WithAmount<TAssetInfo>;
|
|
269
|
-
currencyTo: TCurrencyInput;
|
|
270
|
-
senderAddress: string;
|
|
271
|
-
recipientAddress: string;
|
|
272
|
-
calculateMinAmountOut: (amountIn: bigint, assetTo?: TAssetInfo) => Promise<bigint>;
|
|
273
|
-
};
|
|
274
|
-
type TCreateSwapXcmOptions<TApi, TRes> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes>;
|
|
275
|
-
type TSwapFeeEstimates = {
|
|
276
|
-
originReserveFee: bigint;
|
|
277
|
-
exchangeFee: bigint;
|
|
278
|
-
destReserveFee: bigint;
|
|
279
|
-
};
|
|
280
|
-
type TCreateSwapXcmInternalOptions<TApi, TRes> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes> & {
|
|
281
|
-
version: Version;
|
|
282
|
-
fees: TSwapFeeEstimates;
|
|
283
|
-
paraIdTo?: number;
|
|
284
|
-
};
|
|
285
128
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
address: TAddress;
|
|
290
|
-
version?: Version;
|
|
291
|
-
};
|
|
292
|
-
type TAssetClaimOptions<TApi, TRes> = WithApi<TAssetClaimOptionsBase, TApi, TRes>;
|
|
293
|
-
type TAssetClaimInternalOptions<TApi, TRes> = TAssetClaimOptions<TApi, TRes> & {
|
|
294
|
-
version: Version;
|
|
295
|
-
assets: TAsset<bigint>[];
|
|
296
|
-
};
|
|
129
|
+
declare class AjunaPaseo<TApi, TRes, TSigner> extends Ajuna<TApi, TRes, TSigner> {
|
|
130
|
+
constructor();
|
|
131
|
+
}
|
|
297
132
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
protected palletName: TAssetsPallet;
|
|
304
|
-
constructor(palletName: TAssetsPallet);
|
|
305
|
-
abstract mint<TApi, TRes>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain, api: IPolkadotApi<TApi, TRes>): Promise<TSetBalanceRes>;
|
|
306
|
-
abstract getBalance<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
133
|
+
declare class Altair<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
134
|
+
constructor();
|
|
135
|
+
getCustomCurrencyId(asset: TAssetInfo): TForeignOrNativeAsset;
|
|
136
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
137
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
307
138
|
}
|
|
308
139
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
readonly _options: T;
|
|
315
|
-
constructor(api: IPolkadotApi<TApi, TRes>, options?: T);
|
|
316
|
-
/**
|
|
317
|
-
* Specifies the assets to be claimed.
|
|
318
|
-
*
|
|
319
|
-
* @param assets - An array of assets to claim in a multi-asset format.
|
|
320
|
-
* @returns An instance of Builder
|
|
321
|
-
*/
|
|
322
|
-
currency(currency: TAssetClaimOptionsBase['currency']): AssetClaimBuilder<TApi, TRes, T & {
|
|
323
|
-
currency: TAssetClaimOptionsBase['currency'];
|
|
324
|
-
}>;
|
|
325
|
-
/**
|
|
326
|
-
* Sets the sender address.
|
|
327
|
-
*
|
|
328
|
-
* @param address - The sender address.
|
|
329
|
-
* @returns
|
|
330
|
-
*/
|
|
331
|
-
senderAddress(addressOrPath: string): AssetClaimBuilder<TApi, TRes, T & {
|
|
332
|
-
senderAddress: string;
|
|
333
|
-
}>;
|
|
334
|
-
/**
|
|
335
|
-
* Specifies the account address on which the assets will be claimed.
|
|
336
|
-
*
|
|
337
|
-
* @param address - The destination account address.
|
|
338
|
-
* @returns An instance of Builder
|
|
339
|
-
*/
|
|
340
|
-
address(address: TAddress): AssetClaimBuilder<TApi, TRes, T & {
|
|
341
|
-
address: TAddress;
|
|
342
|
-
}>;
|
|
343
|
-
/**
|
|
344
|
-
* Sets the XCM version to be used for the asset claim.
|
|
345
|
-
*
|
|
346
|
-
* @param version - The XCM version.
|
|
347
|
-
* @returns An instance of Builder
|
|
348
|
-
*/
|
|
349
|
-
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, T & {
|
|
350
|
-
version: Version;
|
|
351
|
-
}>;
|
|
352
|
-
/**
|
|
353
|
-
* Builds and returns the asset claim extrinsic.
|
|
354
|
-
*
|
|
355
|
-
* @returns A Promise that resolves to the asset claim extrinsic.
|
|
356
|
-
*/
|
|
357
|
-
build(this: AssetClaimBuilder<TApi, TRes, TAssetClaimOptionsBase>): Promise<TRes>;
|
|
358
|
-
signAndSubmit(this: AssetClaimBuilder<TApi, TRes, TAssetClaimOptionsBase & TBuilderInternalOptions>): Promise<string>;
|
|
359
|
-
/**
|
|
360
|
-
* Returns the API instance used by the builder.
|
|
361
|
-
*
|
|
362
|
-
* @returns The API instance.
|
|
363
|
-
*/
|
|
364
|
-
getApi(): TApi;
|
|
365
|
-
/**
|
|
366
|
-
* Disconnects the API.
|
|
367
|
-
*
|
|
368
|
-
* @returns A Promise that resolves when the API is disconnected.
|
|
369
|
-
*/
|
|
370
|
-
disconnect(): Promise<void>;
|
|
140
|
+
declare class AssetHubKusama<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
141
|
+
constructor();
|
|
142
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
143
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
144
|
+
getBalanceForeign<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
371
145
|
}
|
|
372
146
|
|
|
373
|
-
declare class
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
147
|
+
declare class AssetHubPolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
148
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
149
|
+
handleEthBridgeNativeTransfer<TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
150
|
+
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
151
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
152
|
+
getBalanceForeign<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
378
153
|
}
|
|
379
154
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
*/
|
|
383
|
-
declare class GeneralBuilder<TApi, TRes, T extends Partial<TSendBaseOptions & TBuilderInternalOptions> = object> {
|
|
384
|
-
readonly batchManager: BatchTransactionManager<TApi, TRes>;
|
|
385
|
-
readonly api: IPolkadotApi<TApi, TRes>;
|
|
386
|
-
readonly _options: T;
|
|
387
|
-
constructor(api: IPolkadotApi<TApi, TRes>, batchManager: BatchTransactionManager<TApi, TRes>, options?: T);
|
|
388
|
-
/**
|
|
389
|
-
* Specifies the origin chain for the transaction.
|
|
390
|
-
*
|
|
391
|
-
* @param chain - The chain from which the transaction originates.
|
|
392
|
-
* @returns An instance of Builder
|
|
393
|
-
*/
|
|
394
|
-
from(chain: TSubstrateChain): GeneralBuilder<TApi, TRes, T & {
|
|
395
|
-
from: TSubstrateChain;
|
|
396
|
-
}>;
|
|
397
|
-
/**
|
|
398
|
-
* Specifies the destination chain for the transaction.
|
|
399
|
-
*
|
|
400
|
-
* @param chain - The chain to which the transaction is sent.
|
|
401
|
-
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
402
|
-
* @returns An instance of Builder
|
|
403
|
-
*/
|
|
404
|
-
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, T & {
|
|
405
|
-
to: TDestination;
|
|
406
|
-
}>;
|
|
407
|
-
/**
|
|
408
|
-
* Initiates the process to claim assets from a specified chain.
|
|
409
|
-
*
|
|
410
|
-
* @param chain - The chain from which to claim assets.
|
|
411
|
-
* @returns An instance of Builder
|
|
412
|
-
*/
|
|
413
|
-
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, {
|
|
414
|
-
chain: TSubstrateChain;
|
|
415
|
-
}>;
|
|
416
|
-
/**
|
|
417
|
-
* Specifies the currency to be used in the transaction. Symbol, ID, location or multi-asset.
|
|
418
|
-
*
|
|
419
|
-
* @param currency - The currency to be transferred.
|
|
420
|
-
* @returns An instance of Builder
|
|
421
|
-
*/
|
|
422
|
-
currency(currency: TCurrencyInputWithAmount): GeneralBuilder<TApi, TRes, T & {
|
|
423
|
-
currency: TCurrencyInputWithAmount;
|
|
424
|
-
}>;
|
|
425
|
-
/**
|
|
426
|
-
* Sets the recipient address.
|
|
427
|
-
*
|
|
428
|
-
* @param address - The destination address.
|
|
429
|
-
* @returns An instance of Builder
|
|
430
|
-
*/
|
|
431
|
-
address(address: TAddress): GeneralBuilder<TApi, TRes, T & {
|
|
432
|
-
address: TAddress;
|
|
433
|
-
}>;
|
|
434
|
-
/**
|
|
435
|
-
* Sets the sender address.
|
|
436
|
-
*
|
|
437
|
-
* @param address - The sender address.
|
|
438
|
-
* @returns
|
|
439
|
-
*/
|
|
440
|
-
senderAddress(addressOrPath: string): GeneralBuilder<TApi, TRes, T & {
|
|
441
|
-
senderAddress: string;
|
|
442
|
-
}>;
|
|
443
|
-
/**
|
|
444
|
-
* Sets the asset hub address. This is used for transfers that go through the Asset Hub and originate from an EVM chain.
|
|
445
|
-
*
|
|
446
|
-
* @param address - The address to be used.
|
|
447
|
-
* @returns An instance of Builder
|
|
448
|
-
*/
|
|
449
|
-
ahAddress(address: string | undefined): GeneralBuilder<TApi, TRes, T & {
|
|
450
|
-
ahAddress: string | undefined;
|
|
451
|
-
}>;
|
|
452
|
-
/**
|
|
453
|
-
* Sets the XCM version to be used for the transfer.
|
|
454
|
-
*
|
|
455
|
-
* @param version - The XCM version.
|
|
456
|
-
* @returns An instance of Builder
|
|
457
|
-
*/
|
|
458
|
-
xcmVersion(version: Version): GeneralBuilder<TApi, TRes, T & {
|
|
459
|
-
version: Version;
|
|
460
|
-
}>;
|
|
461
|
-
/**
|
|
462
|
-
* Sets a custom pallet for the transaction.
|
|
463
|
-
*
|
|
464
|
-
* @param palletName - The name of the custom pallet to be used.
|
|
465
|
-
* @returns An instance of the Builder.
|
|
466
|
-
*/
|
|
467
|
-
customPallet(pallet: string, method: string): GeneralBuilder<TApi, TRes, T & {
|
|
468
|
-
pallet: string;
|
|
469
|
-
method: string;
|
|
470
|
-
}>;
|
|
471
|
-
/**
|
|
472
|
-
* Optional fee asset for the transaction.
|
|
473
|
-
*
|
|
474
|
-
* @param currency - The currency to be used for the fee.
|
|
475
|
-
* @returns An instance of the Builder
|
|
476
|
-
*/
|
|
477
|
-
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, T & {
|
|
478
|
-
feeAsset: TCurrencyInput | undefined;
|
|
479
|
-
}>;
|
|
480
|
-
/**
|
|
481
|
-
* Adds the transfer transaction to the batch.
|
|
482
|
-
*
|
|
483
|
-
* @returns An instance of Builder
|
|
484
|
-
*/
|
|
485
|
-
addToBatch(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): GeneralBuilder<TApi, TRes, T & {
|
|
486
|
-
from: TSubstrateChain;
|
|
487
|
-
}>;
|
|
488
|
-
/**
|
|
489
|
-
* Builds and returns the batched transaction based on the configured parameters.
|
|
490
|
-
*
|
|
491
|
-
* @param options - (Optional) Options to customize the batch transaction.
|
|
492
|
-
* @returns A Extrinsic representing the batched transactions.
|
|
493
|
-
*/
|
|
494
|
-
buildBatch(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>, options?: TBatchOptions): Promise<TRes>;
|
|
495
|
-
protected buildInternal<TOptions extends TSendBaseOptions>(this: GeneralBuilder<TApi, TRes, TOptions>): Promise<TBuildInternalRes<TApi, TRes, TOptions>>;
|
|
496
|
-
private prepareNormalizedOptions;
|
|
497
|
-
/**
|
|
498
|
-
* Builds and returns the transfer extrinsic.
|
|
499
|
-
*
|
|
500
|
-
* @returns A Promise that resolves to the transfer extrinsic.
|
|
501
|
-
*/
|
|
502
|
-
build(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): Promise<TRes>;
|
|
503
|
-
private buildCommon;
|
|
504
|
-
private maybePerformXcmFormatCheck;
|
|
505
|
-
dryRun(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TDryRunResult>;
|
|
506
|
-
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
507
|
-
protected createTxFactory<TOptions extends TSendBaseOptions>(this: GeneralBuilder<TApi, TRes, TOptions>): TTxFactory<TRes>;
|
|
508
|
-
/**
|
|
509
|
-
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
510
|
-
*
|
|
511
|
-
* @returns An origin and destination fee.
|
|
512
|
-
*/
|
|
513
|
-
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, options?: TGetXcmFeeBuilderOptions & {
|
|
514
|
-
disableFallback: TDisableFallback;
|
|
515
|
-
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
516
|
-
/**
|
|
517
|
-
* Returns the origin XCM fee for the transfer using dryRun or paymentInfo function.
|
|
518
|
-
*
|
|
519
|
-
* @returns An origin fee.
|
|
520
|
-
*/
|
|
521
|
-
getOriginXcmFee(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TXcmFeeDetail & {
|
|
522
|
-
forwardedXcms?: unknown;
|
|
523
|
-
destParaId?: number;
|
|
524
|
-
}>;
|
|
525
|
-
/**
|
|
526
|
-
* Estimates the origin and destination XCM fee using the `paymentInfo` function.
|
|
527
|
-
*
|
|
528
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
529
|
-
* Please use `builder.getXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
530
|
-
* Will be removed in v13.
|
|
531
|
-
* For more details, see the documentation:
|
|
532
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
533
|
-
*
|
|
534
|
-
* @returns An origin and destination fee estimate.
|
|
535
|
-
*/
|
|
536
|
-
getXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateResult>;
|
|
537
|
-
/**
|
|
538
|
-
* Estimates the origin XCM fee using paymentInfo function.
|
|
539
|
-
*
|
|
540
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
541
|
-
* Please use `builder.getOriginXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
542
|
-
* Will be removed in v13.
|
|
543
|
-
* For more details, see the documentation:
|
|
544
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
545
|
-
*
|
|
546
|
-
* @returns An origin fee estimate.
|
|
547
|
-
*/
|
|
548
|
-
getOriginXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateDetail>;
|
|
549
|
-
/**
|
|
550
|
-
* Returns the max transferable amount for the transfer
|
|
551
|
-
*
|
|
552
|
-
* @returns The max transferable amount.
|
|
553
|
-
*/
|
|
554
|
-
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<bigint>;
|
|
555
|
-
/**
|
|
556
|
-
* Returns the min transferable amount for the transfer
|
|
557
|
-
*
|
|
558
|
-
* @returns The min transferable amount.
|
|
559
|
-
*/
|
|
560
|
-
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<bigint>;
|
|
561
|
-
/**
|
|
562
|
-
* Returns the max transferable amount for the transfer
|
|
563
|
-
*
|
|
564
|
-
* @returns The max transferable amount.
|
|
565
|
-
*/
|
|
566
|
-
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<boolean>;
|
|
567
|
-
/**
|
|
568
|
-
* Returns the transfer info for the transfer
|
|
569
|
-
*
|
|
570
|
-
* @returns The transfer info.
|
|
571
|
-
*/
|
|
572
|
-
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TTransferInfo>;
|
|
573
|
-
/**
|
|
574
|
-
* Returns the receivable amount on the destination after the transfer
|
|
575
|
-
*
|
|
576
|
-
* @returns The computed receivable amount.
|
|
577
|
-
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
578
|
-
*/
|
|
579
|
-
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<bigint>;
|
|
580
|
-
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress & TBuilderInternalOptions>): Promise<string>;
|
|
581
|
-
/**
|
|
582
|
-
* Returns the API instance used by the builder.
|
|
583
|
-
*
|
|
584
|
-
* @returns The API instance.
|
|
585
|
-
*/
|
|
586
|
-
getApi(): TApi;
|
|
587
|
-
/**
|
|
588
|
-
* Disconnects the API.
|
|
589
|
-
*
|
|
590
|
-
* @returns A Promise that resolves when the API is disconnected.
|
|
591
|
-
*/
|
|
592
|
-
disconnect(): Promise<void>;
|
|
155
|
+
declare class AssetHubPaseo<TApi, TRes, TSigner> extends AssetHubPolkadot<TApi, TRes, TSigner> {
|
|
156
|
+
constructor();
|
|
593
157
|
}
|
|
594
|
-
/**
|
|
595
|
-
* Creates a new Builder instance.
|
|
596
|
-
*
|
|
597
|
-
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
598
|
-
* @returns A new Builder instance.
|
|
599
|
-
*/
|
|
600
|
-
declare const Builder: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => GeneralBuilder<TApi, TRes, object>;
|
|
601
158
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
chain
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
159
|
+
declare class AssetHubWestend<TApi, TRes, TSigner> extends AssetHubPolkadot<TApi, TRes, TSigner> {
|
|
160
|
+
constructor();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
declare class Astar<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
164
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
165
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
166
|
+
isRelayToParaEnabled(): boolean;
|
|
167
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare class Hydration<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
171
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
172
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
173
|
+
transferMoonbeamWhAsset<TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
174
|
+
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
175
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare class Basilisk<TApi, TRes, TSigner> extends Hydration<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
179
|
+
constructor();
|
|
180
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare class BifrostPolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
184
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
185
|
+
getCustomCurrencyId(asset: TAssetInfo): {
|
|
186
|
+
Native: string;
|
|
187
|
+
VToken?: undefined;
|
|
188
|
+
Token?: undefined;
|
|
189
|
+
VSToken2?: undefined;
|
|
190
|
+
VToken2?: undefined;
|
|
191
|
+
Token2?: undefined;
|
|
192
|
+
} | {
|
|
193
|
+
VToken: string;
|
|
194
|
+
Native?: undefined;
|
|
195
|
+
Token?: undefined;
|
|
196
|
+
VSToken2?: undefined;
|
|
197
|
+
VToken2?: undefined;
|
|
198
|
+
Token2?: undefined;
|
|
199
|
+
} | {
|
|
200
|
+
Token: string;
|
|
201
|
+
Native?: undefined;
|
|
202
|
+
VToken?: undefined;
|
|
203
|
+
VSToken2?: undefined;
|
|
204
|
+
VToken2?: undefined;
|
|
205
|
+
Token2?: undefined;
|
|
206
|
+
} | {
|
|
207
|
+
VSToken2: number;
|
|
208
|
+
Native?: undefined;
|
|
209
|
+
VToken?: undefined;
|
|
210
|
+
Token?: undefined;
|
|
211
|
+
VToken2?: undefined;
|
|
212
|
+
Token2?: undefined;
|
|
213
|
+
} | {
|
|
214
|
+
VToken2: number;
|
|
215
|
+
Native?: undefined;
|
|
216
|
+
VToken?: undefined;
|
|
217
|
+
Token?: undefined;
|
|
218
|
+
VSToken2?: undefined;
|
|
219
|
+
Token2?: undefined;
|
|
220
|
+
} | {
|
|
221
|
+
Token2: number;
|
|
222
|
+
Native?: undefined;
|
|
223
|
+
VToken?: undefined;
|
|
224
|
+
Token?: undefined;
|
|
225
|
+
VSToken2?: undefined;
|
|
226
|
+
VToken2?: undefined;
|
|
227
|
+
};
|
|
228
|
+
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
229
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
declare class BifrostKusama<TApi, TRes, TSigner> extends BifrostPolkadot<TApi, TRes, TSigner> {
|
|
233
|
+
constructor();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
declare class BifrostPaseo<TApi, TRes, TSigner> extends BifrostPolkadot<TApi, TRes, TSigner> {
|
|
237
|
+
constructor();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
declare class BridgeHubKusama<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
241
|
+
constructor();
|
|
242
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
declare class BridgeHubPolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
246
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
247
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
declare class BridgeHubPaseo<TApi, TRes, TSigner> extends BridgeHubPolkadot<TApi, TRes, TSigner> {
|
|
251
|
+
constructor();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare class BridgeHubWestend<TApi, TRes, TSigner> extends BridgeHubPolkadot<TApi, TRes, TSigner> {
|
|
255
|
+
constructor();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
declare class Centrifuge<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
259
|
+
constructor();
|
|
260
|
+
getCustomCurrencyId(asset: TAssetInfo): "Native" | {
|
|
261
|
+
ForeignAsset: number;
|
|
262
|
+
};
|
|
263
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
264
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
declare class Collectives<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
268
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
269
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
declare class CollectivesWestend<TApi, TRes, TSigner> extends Collectives<TApi, TRes, TSigner> {
|
|
273
|
+
constructor();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
declare class CoretimeKusama<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
277
|
+
constructor();
|
|
278
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare class CoretimePolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
282
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
283
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
284
|
+
canReceiveFrom(origin: TChain): boolean;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
declare class CoretimePaseo<TApi, TRes, TSigner> extends CoretimePolkadot<TApi, TRes, TSigner> {
|
|
288
|
+
constructor();
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare class CoretimeWestend<TApi, TRes, TSigner> extends CoretimePolkadot<TApi, TRes, TSigner> {
|
|
292
|
+
constructor();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
declare class Crab<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
296
|
+
constructor();
|
|
297
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
298
|
+
isRelayToParaEnabled(): boolean;
|
|
299
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare class Crust<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
303
|
+
constructor();
|
|
304
|
+
private getCurrencySelection;
|
|
305
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
306
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
declare class CrustShadow<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
310
|
+
constructor();
|
|
311
|
+
private getCurrencySelection;
|
|
312
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
313
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare class Curio<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
317
|
+
constructor();
|
|
318
|
+
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
319
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
320
|
+
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
321
|
+
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
declare class Darwinia<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
325
|
+
constructor();
|
|
326
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
327
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
declare class Encointer<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
331
|
+
constructor();
|
|
332
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
declare class EnergyWebX<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
336
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
337
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
338
|
+
isRelayToParaEnabled(): boolean;
|
|
339
|
+
getBalanceForeign<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
declare class EnergyWebXPaseo<TApi, TRes, TSigner> extends EnergyWebX<TApi, TRes, TSigner> {
|
|
343
|
+
constructor();
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
declare class Heima<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
347
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
348
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
declare class HeimaPaseo<TApi, TRes, TSigner> extends Heima<TApi, TRes, TSigner> {
|
|
352
|
+
constructor();
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
declare class HydrationPaseo<TApi, TRes, TSigner> extends Hydration<TApi, TRes, TSigner> {
|
|
356
|
+
constructor();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
declare class Interlay<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
360
|
+
constructor();
|
|
361
|
+
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
362
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
363
|
+
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
364
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
365
|
+
getBalanceNative(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
declare class Jamton<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
369
|
+
constructor();
|
|
370
|
+
getCustomCurrencyId(asset: TAssetInfo): {
|
|
371
|
+
Native: number;
|
|
372
|
+
ForeignAsset?: undefined;
|
|
373
|
+
} | {
|
|
374
|
+
ForeignAsset: number;
|
|
375
|
+
Native?: undefined;
|
|
376
|
+
};
|
|
377
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
declare class Karura<TApi, TRes, TSigner> extends Acala<TApi, TRes, TSigner> {
|
|
381
|
+
constructor();
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
declare class KiltSpiritnet<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
385
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
386
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
387
|
+
isRelayToParaEnabled(): boolean;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
declare class KiltPaseo<TApi, TRes, TSigner> extends KiltSpiritnet<TApi, TRes, TSigner> {
|
|
391
|
+
constructor();
|
|
392
|
+
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
393
|
+
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
declare class Kintsugi<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
397
|
+
constructor();
|
|
398
|
+
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
399
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
400
|
+
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
401
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
402
|
+
getBalanceNative(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
declare class Polkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
406
|
+
constructor(chain?: TSubstrateChain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
407
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
declare class Kusama<TApi, TRes, TSigner> extends Polkadot<TApi, TRes, TSigner> {
|
|
411
|
+
constructor();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
declare class Laos<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
415
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
416
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
417
|
+
isRelayToParaEnabled(): boolean;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
declare class LaosPaseo<TApi, TRes, TSigner> extends Laos<TApi, TRes, TSigner> {
|
|
421
|
+
constructor();
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare class Manta<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
425
|
+
static readonly NATIVE_ASSET_ID = 1n;
|
|
426
|
+
constructor();
|
|
427
|
+
private getAssetId;
|
|
428
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
429
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
declare class Moonbeam<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
433
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
434
|
+
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
435
|
+
transferLocalNonNativeAsset(_options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
436
|
+
getBalanceForeign<TApi, TRes, TSigner>(_api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
declare class Moonriver<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
440
|
+
constructor();
|
|
441
|
+
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
442
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
declare class Mythos<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
446
|
+
constructor();
|
|
447
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
448
|
+
isRelayToParaEnabled(): boolean;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
declare class NeuroWeb<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
452
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
453
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
454
|
+
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
455
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare class NeuroWebPaseo<TApi, TRes, TSigner> extends NeuroWeb<TApi, TRes, TSigner> {
|
|
459
|
+
constructor();
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
declare class Nodle<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
463
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
464
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
465
|
+
isRelayToParaEnabled(): boolean;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
declare class Paseo<TApi, TRes, TSigner> extends Polkadot<TApi, TRes, TSigner> {
|
|
469
|
+
constructor();
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
declare class PeoplePolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
473
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
474
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare class PAssetHub<TApi, TRes, TSigner> extends PeoplePolkadot<TApi, TRes, TSigner> {
|
|
478
|
+
constructor();
|
|
479
|
+
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
480
|
+
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
declare class Peaq<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
484
|
+
constructor();
|
|
485
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
486
|
+
isRelayToParaEnabled(): boolean;
|
|
487
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
declare class Pendulum<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
491
|
+
constructor();
|
|
492
|
+
getCustomCurrencyId(asset: TAssetInfo): TXcmAsset;
|
|
493
|
+
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
declare class Penpal<TApi, TRes, TSigner> extends Moonbeam<TApi, TRes, TSigner> {
|
|
497
|
+
constructor();
|
|
498
|
+
getBalanceForeign<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
declare class PeopleKusama<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
502
|
+
constructor();
|
|
503
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare class PeoplePaseo<TApi, TRes, TSigner> extends PeoplePolkadot<TApi, TRes, TSigner> {
|
|
507
|
+
constructor();
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
declare class PeopleWestend<TApi, TRes, TSigner> extends PeoplePolkadot<TApi, TRes, TSigner> {
|
|
511
|
+
constructor();
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
declare class Phala<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTransferTransfer<TApi, TRes, TSigner> {
|
|
515
|
+
constructor();
|
|
516
|
+
transferXTransfer(input: TXTransferTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
517
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
declare class Quartz<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
521
|
+
constructor();
|
|
522
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
523
|
+
isSendingTempDisabled(): boolean;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
declare class RobonomicsPolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
527
|
+
constructor();
|
|
528
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
529
|
+
isReceivingTempDisabled(scenario: TScenario): boolean;
|
|
530
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
declare class Shiden<TApi, TRes, TSigner> extends Astar<TApi, TRes, TSigner> {
|
|
534
|
+
constructor();
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
declare class Unique<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
538
|
+
constructor();
|
|
539
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
540
|
+
transferLocalNonNativeAsset(_options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
541
|
+
getBalanceForeign<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
declare class Westend<TApi, TRes, TSigner> extends Polkadot<TApi, TRes, TSigner> {
|
|
545
|
+
constructor();
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
declare class Xode<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
549
|
+
constructor();
|
|
550
|
+
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
551
|
+
canReceiveFrom(origin: TChain): boolean;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
declare class Zeitgeist<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
555
|
+
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
556
|
+
getCustomCurrencyId(asset: TAssetInfo): TZeitgeistAsset | TXcmForeignAsset;
|
|
557
|
+
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
558
|
+
canReceiveFrom(origin: TChain): boolean;
|
|
559
|
+
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare class ZeitgeistPaseo<TApi, TRes, TSigner> extends Zeitgeist<TApi, TRes, TSigner> {
|
|
563
|
+
constructor();
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare const chains: <TApi, TRes, TSigner>() => {
|
|
567
|
+
Polkadot: Polkadot<TApi, TRes, TSigner>;
|
|
568
|
+
AssetHubPolkadot: AssetHubPolkadot<TApi, TRes, TSigner>;
|
|
569
|
+
Acala: Acala<TApi, TRes, TSigner>;
|
|
570
|
+
Ajuna: Ajuna<TApi, TRes, TSigner>;
|
|
571
|
+
Astar: Astar<TApi, TRes, TSigner>;
|
|
572
|
+
Unique: Unique<TApi, TRes, TSigner>;
|
|
573
|
+
Crust: Crust<TApi, TRes, TSigner>;
|
|
574
|
+
BifrostPolkadot: BifrostPolkadot<TApi, TRes, TSigner>;
|
|
575
|
+
BridgeHubPolkadot: BridgeHubPolkadot<TApi, TRes, TSigner>;
|
|
576
|
+
Centrifuge: Centrifuge<TApi, TRes, TSigner>;
|
|
577
|
+
Darwinia: Darwinia<TApi, TRes, TSigner>;
|
|
578
|
+
EnergyWebX: EnergyWebX<TApi, TRes, TSigner>;
|
|
579
|
+
Hydration: Hydration<TApi, TRes, TSigner>;
|
|
580
|
+
Interlay: Interlay<TApi, TRes, TSigner>;
|
|
581
|
+
Heima: Heima<TApi, TRes, TSigner>;
|
|
582
|
+
Jamton: Jamton<TApi, TRes, TSigner>;
|
|
583
|
+
Moonbeam: Moonbeam<TApi, TRes, TSigner>;
|
|
584
|
+
CoretimePolkadot: CoretimePolkadot<TApi, TRes, TSigner>;
|
|
585
|
+
RobonomicsPolkadot: RobonomicsPolkadot<TApi, TRes, TSigner>;
|
|
586
|
+
PeoplePolkadot: PeoplePolkadot<TApi, TRes, TSigner>;
|
|
587
|
+
Manta: Manta<TApi, TRes, TSigner>;
|
|
588
|
+
Nodle: Nodle<TApi, TRes, TSigner>;
|
|
589
|
+
NeuroWeb: NeuroWeb<TApi, TRes, TSigner>;
|
|
590
|
+
Pendulum: Pendulum<TApi, TRes, TSigner>;
|
|
591
|
+
Collectives: Collectives<TApi, TRes, TSigner>;
|
|
592
|
+
Phala: Phala<TApi, TRes, TSigner>;
|
|
593
|
+
KiltSpiritnet: KiltSpiritnet<TApi, TRes, TSigner>;
|
|
594
|
+
Curio: Curio<TApi, TRes, TSigner>;
|
|
595
|
+
Mythos: Mythos<TApi, TRes, TSigner>;
|
|
596
|
+
Peaq: Peaq<TApi, TRes, TSigner>;
|
|
597
|
+
Xode: Xode<TApi, TRes, TSigner>;
|
|
598
|
+
Kusama: Kusama<TApi, TRes, TSigner>;
|
|
599
|
+
AssetHubKusama: AssetHubKusama<TApi, TRes, TSigner>;
|
|
600
|
+
BridgeHubKusama: BridgeHubKusama<TApi, TRes, TSigner>;
|
|
601
|
+
CoretimeKusama: CoretimeKusama<TApi, TRes, TSigner>;
|
|
602
|
+
Encointer: Encointer<TApi, TRes, TSigner>;
|
|
603
|
+
Altair: Altair<TApi, TRes, TSigner>;
|
|
604
|
+
Basilisk: Basilisk<TApi, TRes, TSigner>;
|
|
605
|
+
BifrostKusama: BifrostKusama<TApi, TRes, TSigner>;
|
|
606
|
+
CrustShadow: CrustShadow<TApi, TRes, TSigner>;
|
|
607
|
+
Crab: Crab<TApi, TRes, TSigner>;
|
|
608
|
+
Karura: Karura<TApi, TRes, TSigner>;
|
|
609
|
+
Kintsugi: Kintsugi<TApi, TRes, TSigner>;
|
|
610
|
+
Moonriver: Moonriver<TApi, TRes, TSigner>;
|
|
611
|
+
Laos: Laos<TApi, TRes, TSigner>;
|
|
612
|
+
Quartz: Quartz<TApi, TRes, TSigner>;
|
|
613
|
+
PeopleKusama: PeopleKusama<TApi, TRes, TSigner>;
|
|
614
|
+
Shiden: Shiden<TApi, TRes, TSigner>;
|
|
615
|
+
Zeitgeist: Zeitgeist<TApi, TRes, TSigner>;
|
|
616
|
+
Westend: Westend<TApi, TRes, TSigner>;
|
|
617
|
+
AssetHubWestend: AssetHubWestend<TApi, TRes, TSigner>;
|
|
618
|
+
BridgeHubWestend: BridgeHubWestend<TApi, TRes, TSigner>;
|
|
619
|
+
CollectivesWestend: CollectivesWestend<TApi, TRes, TSigner>;
|
|
620
|
+
CoretimeWestend: CoretimeWestend<TApi, TRes, TSigner>;
|
|
621
|
+
PeopleWestend: PeopleWestend<TApi, TRes, TSigner>;
|
|
622
|
+
Penpal: Penpal<TApi, TRes, TSigner>;
|
|
623
|
+
Paseo: Paseo<TApi, TRes, TSigner>;
|
|
624
|
+
AssetHubPaseo: AssetHubPaseo<TApi, TRes, TSigner>;
|
|
625
|
+
BridgeHubPaseo: BridgeHubPaseo<TApi, TRes, TSigner>;
|
|
626
|
+
CoretimePaseo: CoretimePaseo<TApi, TRes, TSigner>;
|
|
627
|
+
EnergyWebXPaseo: EnergyWebXPaseo<TApi, TRes, TSigner>;
|
|
628
|
+
KiltPaseo: KiltPaseo<TApi, TRes, TSigner>;
|
|
629
|
+
PAssetHub: PAssetHub<TApi, TRes, TSigner>;
|
|
630
|
+
PeoplePaseo: PeoplePaseo<TApi, TRes, TSigner>;
|
|
631
|
+
AjunaPaseo: AjunaPaseo<TApi, TRes, TSigner>;
|
|
632
|
+
BifrostPaseo: BifrostPaseo<TApi, TRes, TSigner>;
|
|
633
|
+
HeimaPaseo: HeimaPaseo<TApi, TRes, TSigner>;
|
|
634
|
+
HydrationPaseo: HydrationPaseo<TApi, TRes, TSigner>;
|
|
635
|
+
LaosPaseo: LaosPaseo<TApi, TRes, TSigner>;
|
|
636
|
+
NeuroWebPaseo: NeuroWebPaseo<TApi, TRes, TSigner>;
|
|
637
|
+
ZeitgeistPaseo: ZeitgeistPaseo<TApi, TRes, TSigner>;
|
|
696
638
|
};
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
639
|
+
|
|
640
|
+
declare const ETH_MAINNET_CHAIN_ID: bigint;
|
|
641
|
+
declare const ETH_TESTNET_CHAIN_ID: bigint;
|
|
642
|
+
declare const RELAY_LOCATION: TLocation;
|
|
643
|
+
declare const TX_CLIENT_TIMEOUT_MS: number;
|
|
644
|
+
declare const DRY_RUN_CLIENT_TIMEOUT_MS: number;
|
|
645
|
+
declare const TRANSACT_ORIGINS: readonly ["Native", "SovereignAccount", "Superuser", "Xcm"];
|
|
646
|
+
|
|
647
|
+
type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
648
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
649
|
+
chain: TSubstrateChain;
|
|
650
|
+
beneficiaryLocation: TLocation;
|
|
651
|
+
address: TAddress;
|
|
652
|
+
asset: TAsset;
|
|
653
|
+
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
654
|
+
scenario: TScenario;
|
|
655
|
+
assetInfo: WithAmount<TAssetInfo>;
|
|
704
656
|
currency: TCurrencyInputWithAmount;
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
657
|
+
feeAssetInfo?: TAssetInfo;
|
|
658
|
+
feeCurrency?: TCurrencyInput;
|
|
659
|
+
destination: TDestination;
|
|
660
|
+
destChain?: TChain;
|
|
661
|
+
paraIdTo?: number;
|
|
662
|
+
version: Version;
|
|
663
|
+
senderAddress?: string;
|
|
664
|
+
ahAddress?: string;
|
|
665
|
+
pallet?: string;
|
|
666
|
+
method?: string;
|
|
667
|
+
transactOptions?: TTransactOptions<TRes>;
|
|
716
668
|
};
|
|
717
|
-
type
|
|
718
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
669
|
+
type TXTokensTransferOptions<TApi, TRes, TSigner> = {
|
|
670
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
671
|
+
asset: WithAmount<TAssetInfo>;
|
|
672
|
+
address: TAddress;
|
|
673
|
+
scenario: TScenario;
|
|
719
674
|
origin: TSubstrateChain;
|
|
720
|
-
destination:
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
extractNextHopData: (hopResult: THopResult) => {
|
|
728
|
-
forwardedXcms: any;
|
|
729
|
-
destParaId: number | undefined;
|
|
730
|
-
};
|
|
731
|
-
};
|
|
732
|
-
type HopTraversalResult<THopResult> = {
|
|
733
|
-
hops: Array<{
|
|
734
|
-
chain: TSubstrateChain;
|
|
735
|
-
result: THopResult;
|
|
736
|
-
}>;
|
|
737
|
-
destination?: THopResult;
|
|
738
|
-
lastProcessedChain?: TSubstrateChain;
|
|
675
|
+
destination: TDestination;
|
|
676
|
+
paraIdTo?: number;
|
|
677
|
+
version: Version;
|
|
678
|
+
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
679
|
+
pallet?: string;
|
|
680
|
+
method?: string;
|
|
681
|
+
useMultiAssetTransfer?: boolean;
|
|
739
682
|
};
|
|
740
|
-
type
|
|
741
|
-
|
|
742
|
-
|
|
683
|
+
type TXTransferTransferOptions<TApi, TRes, TSigner> = {
|
|
684
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
685
|
+
asset: WithAmount<TAssetInfo>;
|
|
686
|
+
recipientAddress: TAddress;
|
|
687
|
+
origin: TSubstrateChain;
|
|
688
|
+
paraIdTo?: number;
|
|
689
|
+
destination: TDestination;
|
|
690
|
+
overriddenAsset?: TLocation | TAsset[];
|
|
691
|
+
pallet?: string;
|
|
692
|
+
method?: string;
|
|
743
693
|
};
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
NotCrossChainTransfer = "NotCrossChainTransfer",
|
|
747
|
-
InvalidDest = "InvalidDest",
|
|
748
|
-
NotCrossChainTransferableCurrency = "NotCrossChainTransferableCurrency",
|
|
749
|
-
UnweighableMessage = "UnweighableMessage",
|
|
750
|
-
XcmExecutionFailed = "XcmExecutionFailed",
|
|
751
|
-
CannotReanchor = "CannotReanchor",
|
|
752
|
-
InvalidAncestry = "InvalidAncestry",
|
|
753
|
-
InvalidAsset = "InvalidAsset",
|
|
754
|
-
DestinationNotInvertible = "DestinationNotInvertible",
|
|
755
|
-
BadVersion = "BadVersion",
|
|
756
|
-
DistinctReserveForAssetAndFee = "DistinctReserveForAssetAndFee",
|
|
757
|
-
ZeroFee = "ZeroFee",
|
|
758
|
-
ZeroAmount = "ZeroAmount",
|
|
759
|
-
TooManyAssetsBeingSent = "TooManyAssetsBeingSent",
|
|
760
|
-
AssetIndexNonExistent = "AssetIndexNonExistent",
|
|
761
|
-
FeeNotEnough = "FeeNotEnough",
|
|
762
|
-
NotSupportedLocation = "NotSupportedLocation",
|
|
763
|
-
MinXcmFeeNotDefined = "MinXcmFeeNotDefined",
|
|
764
|
-
RateLimited = "RateLimited"
|
|
694
|
+
interface IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
695
|
+
transferPolkadotXCM: (input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
765
696
|
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
SendFailure = "SendFailure",
|
|
769
|
-
Filtered = "Filtered",
|
|
770
|
-
UnweighableMessage = "UnweighableMessage",
|
|
771
|
-
DestinationNotInvertible = "DestinationNotInvertible",
|
|
772
|
-
Empty = "Empty",
|
|
773
|
-
CannotReanchor = "CannotReanchor",
|
|
774
|
-
TooManyAssets = "TooManyAssets",
|
|
775
|
-
InvalidOrigin = "InvalidOrigin",
|
|
776
|
-
BadVersion = "BadVersion",
|
|
777
|
-
BadLocation = "BadLocation",
|
|
778
|
-
NoSubscription = "NoSubscription",
|
|
779
|
-
AlreadySubscribed = "AlreadySubscribed",
|
|
780
|
-
CannotCheckOutTeleport = "CannotCheckOutTeleport",
|
|
781
|
-
LowBalance = "LowBalance",
|
|
782
|
-
TooManyLocks = "TooManyLocks",
|
|
783
|
-
AccountNotSovereign = "AccountNotSovereign",
|
|
784
|
-
FeesNotMet = "FeesNotMet",
|
|
785
|
-
LockNotFound = "LockNotFound",
|
|
786
|
-
InUse = "InUse",
|
|
787
|
-
REMOVED = "REMOVED",
|
|
788
|
-
InvalidAssetUnknownReserve = "InvalidAssetUnknownReserve",
|
|
789
|
-
InvalidAssetUnsupportedReserve = "InvalidAssetUnsupportedReserve",
|
|
790
|
-
TooManyReserves = "TooManyReserves",
|
|
791
|
-
LocalExecutionIncomplete = "LocalExecutionIncomplete",
|
|
792
|
-
TooManyAuthorizedAliases = "TooManyAuthorizedAliases",
|
|
793
|
-
ExpiresInPast = "ExpiresInPast",
|
|
794
|
-
AliasNotFound = "AliasNotFound",
|
|
795
|
-
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
697
|
+
interface IXTokensTransfer<TApi, TRes, TSigner> {
|
|
698
|
+
transferXTokens: (input: TXTokensTransferOptions<TApi, TRes, TSigner>) => TRes;
|
|
796
699
|
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
Unimplemented = "Unimplemented",
|
|
800
|
-
UntrustedReserveLocation = "UntrustedReserveLocation",
|
|
801
|
-
UntrustedTeleportLocation = "UntrustedTeleportLocation",
|
|
802
|
-
LocationFull = "LocationFull",
|
|
803
|
-
LocationNotInvertible = "LocationNotInvertible",
|
|
804
|
-
BadOrigin = "BadOrigin",
|
|
805
|
-
InvalidLocation = "InvalidLocation",
|
|
806
|
-
AssetNotFound = "AssetNotFound",
|
|
807
|
-
FailedToTransactAsset = "FailedToTransactAsset",
|
|
808
|
-
NotWithdrawable = "NotWithdrawable",
|
|
809
|
-
LocationCannotHold = "LocationCannotHold",
|
|
810
|
-
ExceedsMaxMessageSize = "ExceedsMaxMessageSize",
|
|
811
|
-
DestinationUnsupported = "DestinationUnsupported",
|
|
812
|
-
Transport = "Transport",
|
|
813
|
-
Unroutable = "Unroutable",
|
|
814
|
-
UnknownClaim = "UnknownClaim",
|
|
815
|
-
FailedToDecode = "FailedToDecode",
|
|
816
|
-
MaxWeightInvalid = "MaxWeightInvalid",
|
|
817
|
-
NotHoldingFees = "NotHoldingFees",
|
|
818
|
-
TooExpensive = "TooExpensive",
|
|
819
|
-
Trap = "Trap",
|
|
820
|
-
ExpectationFalse = "ExpectationFalse",
|
|
821
|
-
PalletNotFound = "PalletNotFound",
|
|
822
|
-
NameMismatch = "NameMismatch",
|
|
823
|
-
VersionIncompatible = "VersionIncompatible",
|
|
824
|
-
HoldingWouldOverflow = "HoldingWouldOverflow",
|
|
825
|
-
ExportError = "ExportError",
|
|
826
|
-
ReanchorFailed = "ReanchorFailed",
|
|
827
|
-
NoDeal = "NoDeal",
|
|
828
|
-
FeesNotMet = "FeesNotMet",
|
|
829
|
-
LockError = "LockError",
|
|
830
|
-
NoPermission = "NoPermission",
|
|
831
|
-
Unanchored = "Unanchored",
|
|
832
|
-
NotDepositable = "NotDepositable",
|
|
833
|
-
TooManyAssets = "TooManyAssets",
|
|
834
|
-
UnhandledXcmVersion = "UnhandledXcmVersion",
|
|
835
|
-
WeightLimitReached = "WeightLimitReached",
|
|
836
|
-
Barrier = "Barrier",
|
|
837
|
-
WeightNotComputable = "WeightNotComputable",
|
|
838
|
-
ExceedsStackLimit = "ExceedsStackLimit"
|
|
700
|
+
interface IXTransferTransfer<TApi, TRes, TSigner> {
|
|
701
|
+
transferXTransfer: (input: TXTransferTransferOptions<TApi, TRes, TSigner>) => TRes;
|
|
839
702
|
}
|
|
840
|
-
type
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
type TDryRunError = {
|
|
845
|
-
failureReason: string;
|
|
846
|
-
failureSubReason?: string;
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
type TXcmFeeSwapConfig = TSwapConfig & {
|
|
850
|
-
amountOut: bigint;
|
|
851
|
-
};
|
|
852
|
-
type TTxFactory<TRes> = (amount?: string, relative?: boolean) => Promise<TRes>;
|
|
853
|
-
type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
703
|
+
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
704
|
+
type TAddress = string | TLocation;
|
|
705
|
+
type TDestination = TChain | TLocation;
|
|
706
|
+
type TSendBaseOptions<TRes> = {
|
|
854
707
|
/**
|
|
855
|
-
* The
|
|
708
|
+
* The origin chain
|
|
856
709
|
*/
|
|
857
|
-
|
|
710
|
+
from: TSubstrateChain;
|
|
858
711
|
/**
|
|
859
|
-
* The
|
|
712
|
+
* The destination address. A SS58 or H160 format.
|
|
860
713
|
*/
|
|
861
|
-
|
|
714
|
+
address: TAddress;
|
|
862
715
|
/**
|
|
863
|
-
* The
|
|
716
|
+
* The optional sender address. A SS58 or H160 format.
|
|
864
717
|
*/
|
|
865
|
-
|
|
718
|
+
senderAddress?: string;
|
|
866
719
|
/**
|
|
867
|
-
* The
|
|
720
|
+
* The optional asset hub address. A SS58 format only.
|
|
721
|
+
*/
|
|
722
|
+
ahAddress?: string;
|
|
723
|
+
/**
|
|
724
|
+
* The destination chain or XCM location
|
|
725
|
+
*/
|
|
726
|
+
to: TDestination;
|
|
727
|
+
/**
|
|
728
|
+
* The currency to transfer. Either ID, symbol, location, or multi-asset
|
|
729
|
+
*/
|
|
730
|
+
currency: TCurrencyInputWithAmount;
|
|
731
|
+
/**
|
|
732
|
+
* The optional fee asset. Either ID, symbol, or location
|
|
868
733
|
*/
|
|
869
|
-
senderAddress: string;
|
|
870
|
-
address: string;
|
|
871
|
-
currency: WithAmount<TCurrencyCore>;
|
|
872
734
|
feeAsset?: TCurrencyInput;
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
735
|
+
/**
|
|
736
|
+
* The optional destination parachain ID
|
|
737
|
+
*/
|
|
738
|
+
paraIdTo?: number;
|
|
739
|
+
/**
|
|
740
|
+
* The optional overrided XCM version
|
|
741
|
+
*/
|
|
742
|
+
version?: Version;
|
|
743
|
+
/**
|
|
744
|
+
* The optional pallet override
|
|
745
|
+
*/
|
|
746
|
+
pallet?: string;
|
|
747
|
+
/**
|
|
748
|
+
* Whether to keep the account alive after the transfer.
|
|
749
|
+
*/
|
|
750
|
+
keepAlive?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* The optional pallet method override
|
|
753
|
+
*/
|
|
754
|
+
method?: string;
|
|
755
|
+
/**
|
|
756
|
+
* Hex of the encoded transaction call to apply on the destination chain
|
|
757
|
+
*/
|
|
758
|
+
transactOptions?: TTransactOptions<TRes>;
|
|
881
759
|
};
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
760
|
+
/**
|
|
761
|
+
* Options for transferring from a parachain to another parachain or relay chain
|
|
762
|
+
*/
|
|
763
|
+
type TSendOptions<TApi, TRes, TSigner> = WithApi<TSendBaseOptions<TRes>, TApi, TRes, TSigner> & {
|
|
764
|
+
isAmountAll: boolean;
|
|
886
765
|
};
|
|
887
|
-
type
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
766
|
+
type WithRequiredSenderAddress<TBase> = Omit<TBase, 'senderAddress'> & {
|
|
767
|
+
/**
|
|
768
|
+
* The sender address. A SS58 or H160 format.
|
|
769
|
+
*/
|
|
891
770
|
senderAddress: string;
|
|
892
|
-
currency: WithAmount<TCurrencyCore>;
|
|
893
|
-
feeAsset?: TCurrencyInput;
|
|
894
|
-
disableFallback: boolean;
|
|
895
|
-
useRootOrigin?: boolean;
|
|
896
771
|
};
|
|
897
|
-
type
|
|
898
|
-
type
|
|
899
|
-
|
|
772
|
+
type TSendBaseOptionsWithSenderAddress<TRes> = WithRequiredSenderAddress<TSendBaseOptions<TRes>>;
|
|
773
|
+
type TSendInternalOptions<TApi, TRes, TSigner> = Omit<TSendBaseOptions<TRes>, 'from' | 'feeAsset' | 'version'> & {
|
|
774
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
775
|
+
assetInfo: WithAmount<TAssetInfo>;
|
|
776
|
+
feeAsset?: TAssetInfo;
|
|
777
|
+
feeCurrency?: TCurrencyInput;
|
|
778
|
+
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
779
|
+
version: Version;
|
|
780
|
+
isAmountAll: boolean;
|
|
900
781
|
};
|
|
901
|
-
type
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
skipReverseFeeCalculation?: boolean;
|
|
782
|
+
type TTransactOrigin = (typeof TRANSACT_ORIGINS)[number];
|
|
783
|
+
type TTransactOptions<TRes, TWeightType = bigint> = {
|
|
784
|
+
call: string | TRes;
|
|
785
|
+
originKind?: TTransactOrigin;
|
|
786
|
+
maxWeight?: TWeight<TWeightType>;
|
|
787
|
+
};
|
|
788
|
+
type TSerializedExtrinsics = {
|
|
789
|
+
module: TPallet;
|
|
790
|
+
method: string;
|
|
791
|
+
params: Record<string, unknown>;
|
|
792
|
+
};
|
|
793
|
+
type TSerializedStateQuery = {
|
|
794
|
+
module: TAssetsPallet;
|
|
795
|
+
method: string;
|
|
796
|
+
params: unknown[];
|
|
917
797
|
};
|
|
918
|
-
type
|
|
919
|
-
|
|
920
|
-
|
|
798
|
+
type TSerializedRuntimeApiQuery = {
|
|
799
|
+
module: string;
|
|
800
|
+
method: string;
|
|
801
|
+
params: unknown[];
|
|
921
802
|
};
|
|
922
|
-
type
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
weight?: TWeight;
|
|
926
|
-
sufficient?: boolean;
|
|
803
|
+
type TDestWeight = {
|
|
804
|
+
ref_time: bigint;
|
|
805
|
+
proof_size: bigint;
|
|
927
806
|
};
|
|
928
|
-
type
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
807
|
+
type TXTransferMethod = 'transfer';
|
|
808
|
+
type TXTokensMethod = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
809
|
+
type TPolkadotXcmMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
810
|
+
type TXcmPalletMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
811
|
+
type TWeight<TWeightType = bigint> = {
|
|
812
|
+
refTime: TWeightType;
|
|
813
|
+
proofSize: TWeightType;
|
|
933
814
|
};
|
|
934
|
-
type
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
dryRunError: string;
|
|
939
|
-
dryRunSubError?: string;
|
|
815
|
+
type TCreateBeneficiaryOptions<TApi, TRes, TSigner> = {
|
|
816
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
817
|
+
address: TAddress;
|
|
818
|
+
version: Version;
|
|
940
819
|
};
|
|
941
|
-
type
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
forwardedXcms?: any;
|
|
949
|
-
destParaId?: number;
|
|
950
|
-
asset: TAssetInfo;
|
|
820
|
+
type TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner> = {
|
|
821
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
822
|
+
origin: TSubstrateChain;
|
|
823
|
+
destination: TDestination;
|
|
824
|
+
address: TAddress;
|
|
825
|
+
version: Version;
|
|
826
|
+
paraId?: number;
|
|
951
827
|
};
|
|
952
|
-
type
|
|
953
|
-
type
|
|
954
|
-
|
|
955
|
-
|
|
828
|
+
type TBridgeStatus = 'Normal' | 'Halted';
|
|
829
|
+
type TTransferLocalOptions<TApi, TRes, TSigner> = Omit<TSendInternalOptions<TApi, TRes, TSigner>, 'address'> & {
|
|
830
|
+
address: string;
|
|
831
|
+
balance: bigint;
|
|
956
832
|
};
|
|
957
|
-
type
|
|
958
|
-
|
|
959
|
-
|
|
833
|
+
type TTransferFeeEstimates = {
|
|
834
|
+
originFee: bigint;
|
|
835
|
+
reserveFee: bigint;
|
|
960
836
|
};
|
|
961
|
-
type
|
|
962
|
-
chain:
|
|
963
|
-
|
|
837
|
+
type TCreateBaseTransferXcmOptions<TRes> = {
|
|
838
|
+
chain: TSubstrateChain;
|
|
839
|
+
destChain: TChain;
|
|
840
|
+
assetInfo: WithAmount<TAssetInfo>;
|
|
841
|
+
feeAssetInfo?: TAssetInfo;
|
|
842
|
+
fees: TTransferFeeEstimates;
|
|
843
|
+
recipientAddress: string;
|
|
844
|
+
version: Version;
|
|
845
|
+
paraIdTo?: number;
|
|
846
|
+
transactOptions?: TTransactOptions<TRes>;
|
|
964
847
|
};
|
|
965
|
-
type
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
848
|
+
type TCreateTransferXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseTransferXcmOptions<TRes>, TApi, TRes, TSigner>;
|
|
849
|
+
type TCreateBaseSwapXcmOptions = {
|
|
850
|
+
chain?: TSubstrateChain;
|
|
851
|
+
exchangeChain: TParachain;
|
|
852
|
+
destChain?: TChain;
|
|
853
|
+
assetInfoFrom: WithAmount<TAssetInfo>;
|
|
854
|
+
assetInfoTo: WithAmount<TAssetInfo>;
|
|
855
|
+
currencyTo: TCurrencyInput;
|
|
856
|
+
senderAddress: string;
|
|
857
|
+
recipientAddress: string;
|
|
858
|
+
calculateMinAmountOut: (amountIn: bigint, assetTo?: TAssetInfo) => Promise<bigint>;
|
|
971
859
|
};
|
|
972
|
-
type
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
860
|
+
type TCreateSwapXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes, TSigner>;
|
|
861
|
+
type TSwapFeeEstimates = {
|
|
862
|
+
originReserveFee: bigint;
|
|
863
|
+
exchangeFee: bigint;
|
|
864
|
+
destReserveFee: bigint;
|
|
976
865
|
};
|
|
977
|
-
type
|
|
978
|
-
|
|
979
|
-
|
|
866
|
+
type TCreateSwapXcmInternalOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes, TSigner> & {
|
|
867
|
+
version: Version;
|
|
868
|
+
fees: TSwapFeeEstimates;
|
|
869
|
+
paraIdTo?: number;
|
|
980
870
|
};
|
|
981
871
|
|
|
982
|
-
type
|
|
872
|
+
type TAssetClaimOptionsBase = {
|
|
873
|
+
chain: TSubstrateChain;
|
|
874
|
+
currency: WithComplexAmount<TCurrencyCore> | TAsset<TAmount>[] | WithComplexAmount<TCurrencyCore>[];
|
|
875
|
+
address: TAddress;
|
|
876
|
+
version?: Version;
|
|
877
|
+
};
|
|
878
|
+
type TAssetClaimOptions<TApi, TRes, TSigner> = WithApi<TAssetClaimOptionsBase, TApi, TRes, TSigner>;
|
|
879
|
+
type TAssetClaimInternalOptions<TApi, TRes, TSigner> = TAssetClaimOptions<TApi, TRes, TSigner> & {
|
|
880
|
+
version: Version;
|
|
881
|
+
assets: TAsset<bigint>[];
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
type TSetBalanceRes = {
|
|
885
|
+
assetStatusTx?: TSerializedExtrinsics;
|
|
886
|
+
balanceTx: TSerializedExtrinsics;
|
|
887
|
+
};
|
|
888
|
+
declare abstract class BaseAssetsPallet {
|
|
889
|
+
protected palletName: TAssetsPallet;
|
|
890
|
+
constructor(palletName: TAssetsPallet);
|
|
891
|
+
abstract mint<TApi, TRes, TSigner>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain, api: IPolkadotApi<TApi, TRes, TSigner>): Promise<TSetBalanceRes>;
|
|
892
|
+
abstract getBalance<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Builder class for constructing asset claim transactions.
|
|
897
|
+
*/
|
|
898
|
+
declare class AssetClaimBuilder<TApi, TRes, TSigner, T extends Partial<TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>> = object> {
|
|
899
|
+
readonly api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
900
|
+
readonly _options: T;
|
|
901
|
+
constructor(api: IPolkadotApi<TApi, TRes, TSigner>, options?: T);
|
|
902
|
+
/**
|
|
903
|
+
* Specifies the assets to be claimed.
|
|
904
|
+
*
|
|
905
|
+
* @param assets - An array of assets to claim in a multi-asset format.
|
|
906
|
+
* @returns An instance of Builder
|
|
907
|
+
*/
|
|
908
|
+
currency(currency: TAssetClaimOptionsBase['currency']): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
909
|
+
currency: TAssetClaimOptionsBase['currency'];
|
|
910
|
+
}>;
|
|
911
|
+
/**
|
|
912
|
+
* Sets the sender address.
|
|
913
|
+
*
|
|
914
|
+
* @param address - The sender address.
|
|
915
|
+
* @returns
|
|
916
|
+
*/
|
|
917
|
+
senderAddress(sender: TSender<TSigner>): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
918
|
+
senderAddress: string;
|
|
919
|
+
}>;
|
|
920
|
+
/**
|
|
921
|
+
* Specifies the account address on which the assets will be claimed.
|
|
922
|
+
*
|
|
923
|
+
* @param address - The destination account address.
|
|
924
|
+
* @returns An instance of Builder
|
|
925
|
+
*/
|
|
926
|
+
address(address: TAddress): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
927
|
+
address: TAddress;
|
|
928
|
+
}>;
|
|
929
|
+
/**
|
|
930
|
+
* Sets the XCM version to be used for the asset claim.
|
|
931
|
+
*
|
|
932
|
+
* @param version - The XCM version.
|
|
933
|
+
* @returns An instance of Builder
|
|
934
|
+
*/
|
|
935
|
+
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
936
|
+
version: Version;
|
|
937
|
+
}>;
|
|
938
|
+
/**
|
|
939
|
+
* Builds and returns the asset claim extrinsic.
|
|
940
|
+
*
|
|
941
|
+
* @returns A Promise that resolves to the asset claim extrinsic.
|
|
942
|
+
*/
|
|
943
|
+
build(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase>): Promise<TRes>;
|
|
944
|
+
signAndSubmit(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
945
|
+
/**
|
|
946
|
+
* Returns the API instance used by the builder.
|
|
947
|
+
*
|
|
948
|
+
* @returns The API instance.
|
|
949
|
+
*/
|
|
950
|
+
getApi(): TApi;
|
|
951
|
+
/**
|
|
952
|
+
* Disconnects the API.
|
|
953
|
+
*
|
|
954
|
+
* @returns A Promise that resolves when the API is disconnected.
|
|
955
|
+
*/
|
|
956
|
+
disconnect(): Promise<void>;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
960
|
+
transactionOptions: TBatchedSendOptions<TApi, TRes, TSigner>[];
|
|
961
|
+
addTransaction(options: TBatchedSendOptions<TApi, TRes, TSigner>): void;
|
|
962
|
+
isEmpty(): boolean;
|
|
963
|
+
buildBatch(api: IPolkadotApi<TApi, TRes, TSigner>, from: TSubstrateChain, options?: TBatchOptions): Promise<TRes>;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
968
|
+
*/
|
|
969
|
+
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOptions<TRes> & TBuilderInternalOptions<TSigner>> = object> {
|
|
970
|
+
readonly batchManager: BatchTransactionManager<TApi, TRes, TSigner>;
|
|
971
|
+
readonly api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
972
|
+
readonly _options: T;
|
|
973
|
+
constructor(api: IPolkadotApi<TApi, TRes, TSigner>, batchManager: BatchTransactionManager<TApi, TRes, TSigner>, options?: T);
|
|
974
|
+
/**
|
|
975
|
+
* Specifies the origin chain for the transaction.
|
|
976
|
+
*
|
|
977
|
+
* @param chain - The chain from which the transaction originates.
|
|
978
|
+
* @returns An instance of Builder
|
|
979
|
+
*/
|
|
980
|
+
from(chain: TSubstrateChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
981
|
+
from: TSubstrateChain;
|
|
982
|
+
}>;
|
|
983
|
+
/**
|
|
984
|
+
* Specifies the destination chain for the transaction.
|
|
985
|
+
*
|
|
986
|
+
* @param chain - The chain to which the transaction is sent.
|
|
987
|
+
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
988
|
+
* @returns An instance of Builder
|
|
989
|
+
*/
|
|
990
|
+
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
991
|
+
to: TDestination;
|
|
992
|
+
}>;
|
|
993
|
+
/**
|
|
994
|
+
* Initiates the process to claim assets from a specified chain.
|
|
995
|
+
*
|
|
996
|
+
* @param chain - The chain from which to claim assets.
|
|
997
|
+
* @returns An instance of Builder
|
|
998
|
+
*/
|
|
999
|
+
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, TSigner, {
|
|
1000
|
+
chain: TSubstrateChain;
|
|
1001
|
+
}>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Specifies the currency to be used in the transaction. Symbol, ID, location or multi-asset.
|
|
1004
|
+
*
|
|
1005
|
+
* @param currency - The currency to be transferred.
|
|
1006
|
+
* @returns An instance of Builder
|
|
1007
|
+
*/
|
|
1008
|
+
currency(currency: TCurrencyInputWithAmount): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1009
|
+
currency: TCurrencyInputWithAmount;
|
|
1010
|
+
}>;
|
|
1011
|
+
/**
|
|
1012
|
+
* Sets the recipient address.
|
|
1013
|
+
*
|
|
1014
|
+
* @param address - The destination address.
|
|
1015
|
+
* @returns An instance of Builder
|
|
1016
|
+
*/
|
|
1017
|
+
address(address: TAddress): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1018
|
+
address: TAddress;
|
|
1019
|
+
}>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Sets the sender address.
|
|
1022
|
+
*
|
|
1023
|
+
* @param address - The sender address.
|
|
1024
|
+
* @returns
|
|
1025
|
+
*/
|
|
1026
|
+
senderAddress(sender: TSender<TSigner>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1027
|
+
senderAddress: string;
|
|
1028
|
+
}>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Sets the asset hub address. This is used for transfers that go through the Asset Hub and originate from an EVM chain.
|
|
1031
|
+
*
|
|
1032
|
+
* @param address - The address to be used.
|
|
1033
|
+
* @returns An instance of Builder
|
|
1034
|
+
*/
|
|
1035
|
+
ahAddress(address: string | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1036
|
+
ahAddress: string | undefined;
|
|
1037
|
+
}>;
|
|
1038
|
+
/**
|
|
1039
|
+
* Sets the XCM version to be used for the transfer.
|
|
1040
|
+
*
|
|
1041
|
+
* @param version - The XCM version.
|
|
1042
|
+
* @returns An instance of Builder
|
|
1043
|
+
*/
|
|
1044
|
+
xcmVersion(version: Version): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1045
|
+
version: Version;
|
|
1046
|
+
}>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Whether to keep the account alive after the transfer.
|
|
1049
|
+
*
|
|
1050
|
+
* @param value - A boolean indicating whether to keep the account alive.
|
|
1051
|
+
* @returns An instance of Builder
|
|
1052
|
+
*/
|
|
1053
|
+
keepAlive(keepAlive: boolean): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1054
|
+
keepAlive: boolean;
|
|
1055
|
+
}>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Sets a custom pallet for the transaction.
|
|
1058
|
+
*
|
|
1059
|
+
* @param palletName - The name of the custom pallet to be used.
|
|
1060
|
+
* @returns An instance of the Builder.
|
|
1061
|
+
*/
|
|
1062
|
+
customPallet(pallet: string, method: string): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1063
|
+
pallet: string;
|
|
1064
|
+
method: string;
|
|
1065
|
+
}>;
|
|
983
1066
|
/**
|
|
984
|
-
*
|
|
1067
|
+
* Optional fee asset for the transaction.
|
|
1068
|
+
*
|
|
1069
|
+
* @param currency - The currency to be used for the fee.
|
|
1070
|
+
* @returns An instance of the Builder
|
|
985
1071
|
*/
|
|
986
|
-
|
|
1072
|
+
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1073
|
+
feeAsset: TCurrencyInput | undefined;
|
|
1074
|
+
}>;
|
|
987
1075
|
/**
|
|
988
|
-
*
|
|
1076
|
+
* Sets the hex of the encoded transaction call to apply on the destination chain
|
|
1077
|
+
*
|
|
1078
|
+
* @param hex - The encoded call hex or extrinsics.
|
|
1079
|
+
* @param originKind - (Optional) The means of expressing the message origin as a dispatch origin.
|
|
1080
|
+
* @param maxWeight - (Optional) The weight of the call. If not provided, the weight will be estimated.
|
|
1081
|
+
* @returns An instance of the Builder.
|
|
989
1082
|
*/
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1083
|
+
transact(call: string | TRes, originKind?: TTransactOrigin, maxWeight?: TWeight): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1084
|
+
transactOptions: {
|
|
1085
|
+
call: string | TRes;
|
|
1086
|
+
originKind: "Native" | "SovereignAccount" | "Superuser" | "Xcm" | undefined;
|
|
1087
|
+
maxWeight: TWeight | undefined;
|
|
1088
|
+
};
|
|
1089
|
+
}>;
|
|
996
1090
|
/**
|
|
997
|
-
*
|
|
1091
|
+
* Adds the transfer transaction to the batch.
|
|
1092
|
+
*
|
|
1093
|
+
* @returns An instance of Builder
|
|
998
1094
|
*/
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
* Retrieves the currency balance for a given account on a specified chain.
|
|
1003
|
-
*/
|
|
1004
|
-
type TGetBalanceOptionsBase = TGetBalanceCommonOptions & {
|
|
1095
|
+
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptions<TRes>>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1096
|
+
from: TSubstrateChain;
|
|
1097
|
+
}>;
|
|
1005
1098
|
/**
|
|
1006
|
-
*
|
|
1099
|
+
* Builds and returns the batched transaction based on the configured parameters.
|
|
1100
|
+
*
|
|
1101
|
+
* @param options - (Optional) Options to customize the batch transaction.
|
|
1102
|
+
* @returns A Extrinsic representing the batched transactions.
|
|
1007
1103
|
*/
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
type TGetAssetBalanceOptions<TApi, TRes> = WithApi<TGetAssetBalanceOptionsBase, TApi, TRes>;
|
|
1012
|
-
type TGetTransferableAmountOptionsBase<TRes> = {
|
|
1104
|
+
buildBatch(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptions<TRes>>, options?: TBatchOptions): Promise<TRes>;
|
|
1105
|
+
protected buildInternal<TOptions extends TSendBaseOptions<TRes>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): Promise<TBuildInternalRes<TApi, TRes, TSigner, TOptions>>;
|
|
1106
|
+
private prepareNormalizedOptions;
|
|
1013
1107
|
/**
|
|
1014
|
-
*
|
|
1108
|
+
* Builds and returns the transfer extrinsic.
|
|
1109
|
+
*
|
|
1110
|
+
* @returns A Promise that resolves to the transfer extrinsic.
|
|
1015
1111
|
*/
|
|
1016
|
-
|
|
1112
|
+
build(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptions<TRes>>): Promise<TRes>;
|
|
1113
|
+
private buildCommon;
|
|
1114
|
+
private maybePerformXcmFormatCheck;
|
|
1115
|
+
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<TDryRunResult>;
|
|
1116
|
+
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
1117
|
+
protected createTxFactory<TOptions extends TSendBaseOptions<TRes>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): TTxFactory<TRes>;
|
|
1017
1118
|
/**
|
|
1018
|
-
*
|
|
1119
|
+
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
1120
|
+
*
|
|
1121
|
+
* @returns An origin and destination fee.
|
|
1019
1122
|
*/
|
|
1020
|
-
|
|
1123
|
+
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>, options?: TGetXcmFeeBuilderOptions & {
|
|
1124
|
+
disableFallback: TDisableFallback;
|
|
1125
|
+
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
1021
1126
|
/**
|
|
1022
|
-
*
|
|
1127
|
+
* Returns the origin XCM fee for the transfer using dryRun or paymentInfo function.
|
|
1128
|
+
*
|
|
1129
|
+
* @returns An origin fee.
|
|
1023
1130
|
*/
|
|
1024
|
-
|
|
1131
|
+
getOriginXcmFee(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TXcmFeeDetail & {
|
|
1132
|
+
forwardedXcms?: unknown;
|
|
1133
|
+
destParaId?: number;
|
|
1134
|
+
}>;
|
|
1025
1135
|
/**
|
|
1026
|
-
*
|
|
1136
|
+
* Estimates the origin and destination XCM fee using the `paymentInfo` function.
|
|
1137
|
+
*
|
|
1138
|
+
* @deprecated This function is deprecated and will be removed in a future version.
|
|
1139
|
+
* Please use `builder.getXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
1140
|
+
* Will be removed in v13.
|
|
1141
|
+
* For more details, see the documentation:
|
|
1142
|
+
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
1143
|
+
*
|
|
1144
|
+
* @returns An origin and destination fee estimate.
|
|
1027
1145
|
*/
|
|
1028
|
-
|
|
1146
|
+
getXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<TGetXcmFeeEstimateResult>;
|
|
1029
1147
|
/**
|
|
1030
|
-
*
|
|
1148
|
+
* Estimates the origin XCM fee using paymentInfo function.
|
|
1149
|
+
*
|
|
1150
|
+
* @deprecated This function is deprecated and will be removed in a future version.
|
|
1151
|
+
* Please use `builder.getOriginXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
1152
|
+
* Will be removed in v13.
|
|
1153
|
+
* For more details, see the documentation:
|
|
1154
|
+
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
1155
|
+
*
|
|
1156
|
+
* @returns An origin fee estimate.
|
|
1031
1157
|
*/
|
|
1032
|
-
|
|
1033
|
-
feeAsset?: TCurrencyInput;
|
|
1034
|
-
};
|
|
1035
|
-
type TGetTransferableAmountOptions<TApi, TRes> = WithApi<TGetTransferableAmountOptionsBase<TRes>, TApi, TRes>;
|
|
1036
|
-
type TGetMinTransferableAmountOptions<TApi, TRes> = WithApi<TGetTransferableAmountOptionsBase<TRes> & {
|
|
1037
|
-
address: string;
|
|
1038
|
-
builder: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>;
|
|
1039
|
-
}, TApi, TRes>;
|
|
1040
|
-
type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
1158
|
+
getOriginXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<TGetXcmFeeEstimateDetail>;
|
|
1041
1159
|
/**
|
|
1042
|
-
*
|
|
1160
|
+
* Returns the max transferable amount for the transfer
|
|
1161
|
+
*
|
|
1162
|
+
* @returns The max transferable amount.
|
|
1043
1163
|
*/
|
|
1044
|
-
|
|
1164
|
+
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<bigint>;
|
|
1045
1165
|
/**
|
|
1046
|
-
*
|
|
1166
|
+
* Returns the min transferable amount for the transfer
|
|
1167
|
+
*
|
|
1168
|
+
* @returns The min transferable amount.
|
|
1047
1169
|
*/
|
|
1048
|
-
|
|
1170
|
+
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<bigint>;
|
|
1049
1171
|
/**
|
|
1050
|
-
*
|
|
1172
|
+
* Returns the max transferable amount for the transfer
|
|
1173
|
+
*
|
|
1174
|
+
* @returns The max transferable amount.
|
|
1051
1175
|
*/
|
|
1052
|
-
|
|
1176
|
+
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<boolean>;
|
|
1053
1177
|
/**
|
|
1054
|
-
*
|
|
1178
|
+
* Returns the transfer info for the transfer
|
|
1179
|
+
*
|
|
1180
|
+
* @returns The transfer info.
|
|
1055
1181
|
*/
|
|
1056
|
-
|
|
1182
|
+
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<TTransferInfo>;
|
|
1057
1183
|
/**
|
|
1058
|
-
*
|
|
1184
|
+
* Returns the receivable amount on the destination after the transfer
|
|
1185
|
+
*
|
|
1186
|
+
* @returns The computed receivable amount.
|
|
1187
|
+
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
1059
1188
|
*/
|
|
1060
|
-
|
|
1189
|
+
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>): Promise<bigint>;
|
|
1190
|
+
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes> & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
1061
1191
|
/**
|
|
1062
|
-
*
|
|
1192
|
+
* Returns the API instance used by the builder.
|
|
1193
|
+
*
|
|
1194
|
+
* @returns The API instance.
|
|
1063
1195
|
*/
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1196
|
+
getApi(): TApi;
|
|
1197
|
+
/**
|
|
1198
|
+
* Disconnects the API.
|
|
1199
|
+
*
|
|
1200
|
+
* @returns A Promise that resolves when the API is disconnected.
|
|
1201
|
+
*/
|
|
1202
|
+
disconnect(): Promise<void>;
|
|
1203
|
+
}
|
|
1070
1204
|
/**
|
|
1071
|
-
*
|
|
1205
|
+
* Creates a new Builder instance.
|
|
1206
|
+
*
|
|
1207
|
+
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
1208
|
+
* @returns A new Builder instance.
|
|
1072
1209
|
*/
|
|
1073
|
-
|
|
1210
|
+
declare const Builder: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>) => GeneralBuilder<TApi, TRes, TSigner, object>;
|
|
1211
|
+
|
|
1212
|
+
type TSwapConfig = {
|
|
1213
|
+
currencyTo: TCurrencyCore;
|
|
1214
|
+
exchangeChain: TParachain;
|
|
1215
|
+
};
|
|
1216
|
+
type TDryRunBaseOptions<TRes> = {
|
|
1217
|
+
tx: TRes;
|
|
1218
|
+
origin: TSubstrateChain;
|
|
1219
|
+
destination: TChain;
|
|
1220
|
+
senderAddress: string;
|
|
1221
|
+
address: string;
|
|
1222
|
+
currency: TCurrencyInputWithAmount;
|
|
1223
|
+
version?: Version;
|
|
1224
|
+
feeAsset?: TCurrencyInput;
|
|
1225
|
+
swapConfig?: TSwapConfig;
|
|
1226
|
+
useRootOrigin?: boolean;
|
|
1227
|
+
bypassOptions?: TBypassOptions;
|
|
1228
|
+
};
|
|
1229
|
+
type TDryRunOptions<TApi, TRes, TSigner> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1230
|
+
type TDryRunCallBaseOptions<TRes> = {
|
|
1074
1231
|
/**
|
|
1075
|
-
* The
|
|
1232
|
+
* The transaction to dry-run
|
|
1076
1233
|
*/
|
|
1077
|
-
|
|
1234
|
+
tx: TRes;
|
|
1078
1235
|
/**
|
|
1079
|
-
* The
|
|
1236
|
+
* The chain to dry-run on
|
|
1080
1237
|
*/
|
|
1081
|
-
|
|
1238
|
+
chain: TSubstrateChain;
|
|
1082
1239
|
/**
|
|
1083
|
-
* The
|
|
1240
|
+
* The destination chain
|
|
1084
1241
|
*/
|
|
1085
|
-
|
|
1242
|
+
destination: TDestination;
|
|
1086
1243
|
/**
|
|
1087
|
-
* The
|
|
1244
|
+
* The address to dry-run with (senderAddress)
|
|
1088
1245
|
*/
|
|
1089
1246
|
address: string;
|
|
1090
1247
|
/**
|
|
1091
|
-
*
|
|
1248
|
+
* Whether to use the root origin
|
|
1092
1249
|
*/
|
|
1093
|
-
|
|
1250
|
+
useRootOrigin?: boolean;
|
|
1094
1251
|
/**
|
|
1095
|
-
*
|
|
1252
|
+
* XCM version to use for the dry-run parameters
|
|
1096
1253
|
*/
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
destAddress: string;
|
|
1102
|
-
};
|
|
1103
|
-
type TSerializedEthTransfer = {
|
|
1104
|
-
token: string;
|
|
1105
|
-
destinationParaId: number;
|
|
1106
|
-
destinationFee: bigint;
|
|
1107
|
-
amount: bigint;
|
|
1108
|
-
fee: bigint;
|
|
1254
|
+
version: Version;
|
|
1255
|
+
asset: WithAmount<TAssetInfo>;
|
|
1256
|
+
bypassOptions?: TBypassOptions;
|
|
1257
|
+
feeAsset?: TAssetInfo;
|
|
1109
1258
|
};
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1259
|
+
type TDryRunBypassOptions<TApi, TRes, TSigner> = WithApi<Omit<TDryRunCallBaseOptions<TRes>, 'useRootOrigin' | 'destination'>, TApi, TRes, TSigner>;
|
|
1260
|
+
type TDryRunCallOptions<TApi, TRes, TSigner> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1261
|
+
type TDryRunXcmBaseOptions<TRes> = {
|
|
1262
|
+
originLocation: any;
|
|
1114
1263
|
/**
|
|
1115
|
-
*
|
|
1264
|
+
* The XCM instructions
|
|
1116
1265
|
*/
|
|
1117
|
-
|
|
1266
|
+
xcm: any;
|
|
1267
|
+
/** The transaction to dry-run */
|
|
1268
|
+
tx: TRes;
|
|
1118
1269
|
/**
|
|
1119
|
-
*
|
|
1270
|
+
* The chain to dry-run on
|
|
1120
1271
|
*/
|
|
1121
|
-
|
|
1122
|
-
}
|
|
1123
|
-
/**
|
|
1124
|
-
* The options for the batch builder.
|
|
1125
|
-
*/
|
|
1126
|
-
type TBatchOptions = {
|
|
1272
|
+
chain: TSubstrateChain;
|
|
1127
1273
|
/**
|
|
1128
|
-
* The
|
|
1129
|
-
* `BATCH_ALL` - does not commit if one of the calls in the batch fails.
|
|
1130
|
-
* `BATCH` - commits each successful call regardless if a call fails.
|
|
1274
|
+
* The origin chain
|
|
1131
1275
|
*/
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
type TBuilderConfig<TApi> = Partial<{
|
|
1139
|
-
apiOverrides: Partial<Record<TChain, TApi>>;
|
|
1140
|
-
development: boolean;
|
|
1141
|
-
abstractDecimals: boolean;
|
|
1142
|
-
xcmFormatCheck: boolean;
|
|
1143
|
-
}>;
|
|
1144
|
-
type TCreateTxsOptions<TApi, TRes> = Pick<TSendOptions<TApi, TRes>, 'api' | 'from' | 'to' | 'currency'>;
|
|
1145
|
-
type TBatchedSendOptions<TApi, TRes> = Omit<TSendOptions<TApi, TRes>, 'isAmountAll'> & {
|
|
1146
|
-
builder: GeneralBuilder<TApi, TRes, TSendBaseOptions>;
|
|
1147
|
-
};
|
|
1148
|
-
type TBuildInternalRes<TApi, TRes, TOptions extends TSendBaseOptions = TSendBaseOptions> = {
|
|
1149
|
-
tx: TRes;
|
|
1150
|
-
options: TSendOptions<TApi, TRes> & TOptions;
|
|
1276
|
+
origin: TSubstrateChain;
|
|
1277
|
+
asset: TAssetInfo;
|
|
1278
|
+
version: Version;
|
|
1279
|
+
feeAsset?: TAssetInfo;
|
|
1280
|
+
amount: bigint;
|
|
1281
|
+
originFee: bigint;
|
|
1151
1282
|
};
|
|
1152
|
-
type
|
|
1153
|
-
|
|
1283
|
+
type TDryRunXcmOptions<TApi, TRes, TSigner> = WithApi<TDryRunXcmBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1284
|
+
type TDryRunResBase = {
|
|
1285
|
+
asset: TAssetInfo;
|
|
1154
1286
|
};
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1287
|
+
type TDryRunChainSuccess = TDryRunResBase & {
|
|
1288
|
+
success: true;
|
|
1289
|
+
fee: bigint;
|
|
1290
|
+
weight?: TWeight;
|
|
1291
|
+
forwardedXcms: any;
|
|
1292
|
+
destParaId?: number;
|
|
1159
1293
|
};
|
|
1160
|
-
type
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
providers: TProviderEntry[];
|
|
1294
|
+
type TDryRunChainFailure = TDryRunResBase & {
|
|
1295
|
+
success: false;
|
|
1296
|
+
failureReason: string;
|
|
1297
|
+
failureSubReason?: string;
|
|
1165
1298
|
};
|
|
1166
|
-
type
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
[Q in keyof O]: O[Q];
|
|
1171
|
-
} : never;
|
|
1172
|
-
}[K];
|
|
1173
|
-
type TXcmVersioned<T> = OneKey<Version, T>;
|
|
1174
|
-
type TXcmForeignAsset = {
|
|
1175
|
-
ForeignAsset: string | number | bigint | undefined;
|
|
1299
|
+
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
1300
|
+
type THopInfo = {
|
|
1301
|
+
chain: TChain;
|
|
1302
|
+
result: TDryRunChainResult;
|
|
1176
1303
|
};
|
|
1177
|
-
type
|
|
1178
|
-
|
|
1304
|
+
type TChainEndpoint = 'origin' | 'destination' | TChain;
|
|
1305
|
+
type TDryRunResult = {
|
|
1306
|
+
failureReason?: string;
|
|
1307
|
+
failureSubReason?: string;
|
|
1308
|
+
failureChain?: TChainEndpoint;
|
|
1309
|
+
origin: TDryRunChainResult;
|
|
1310
|
+
destination?: TDryRunChainResult;
|
|
1311
|
+
hops: THopInfo[];
|
|
1179
1312
|
};
|
|
1180
|
-
type
|
|
1181
|
-
|
|
1313
|
+
type TResolveHopParams<TApi, TRes, TSigner> = {
|
|
1314
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
1315
|
+
tx: TRes;
|
|
1316
|
+
originChain: TSubstrateChain;
|
|
1317
|
+
currentChain: TSubstrateChain;
|
|
1318
|
+
destination: TDestination;
|
|
1319
|
+
asset: TAssetInfo;
|
|
1320
|
+
currency: TCurrencyInputWithAmount;
|
|
1321
|
+
swapConfig?: TSwapConfig;
|
|
1322
|
+
hasPassedExchange: boolean;
|
|
1182
1323
|
};
|
|
1183
|
-
type
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1324
|
+
type HopProcessParams<TApi, TRes, TSigner> = {
|
|
1325
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
1326
|
+
currentChain: TSubstrateChain;
|
|
1327
|
+
currentOrigin: TSubstrateChain;
|
|
1328
|
+
currentAsset: TAssetInfo;
|
|
1329
|
+
forwardedXcms: any;
|
|
1330
|
+
hasPassedExchange: boolean;
|
|
1331
|
+
isDestination: boolean;
|
|
1188
1332
|
};
|
|
1189
|
-
type
|
|
1190
|
-
|
|
1333
|
+
type HopTraversalConfig<TApi, TRes, TSigner, THopResult> = {
|
|
1334
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
1335
|
+
origin: TSubstrateChain;
|
|
1336
|
+
destination: TChain;
|
|
1337
|
+
currency: TCurrencyCore;
|
|
1338
|
+
initialForwardedXcms: any;
|
|
1339
|
+
initialDestParaId: number | undefined;
|
|
1340
|
+
swapConfig?: TSwapConfig;
|
|
1341
|
+
processHop: (params: HopProcessParams<TApi, TRes, TSigner>) => Promise<THopResult>;
|
|
1342
|
+
shouldContinue: (hopResult: THopResult) => boolean;
|
|
1343
|
+
extractNextHopData: (hopResult: THopResult) => {
|
|
1344
|
+
forwardedXcms: any;
|
|
1345
|
+
destParaId: number | undefined;
|
|
1346
|
+
};
|
|
1191
1347
|
};
|
|
1192
|
-
type
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1348
|
+
type HopTraversalResult<THopResult> = {
|
|
1349
|
+
hops: Array<{
|
|
1350
|
+
chain: TSubstrateChain;
|
|
1351
|
+
result: THopResult;
|
|
1352
|
+
}>;
|
|
1353
|
+
destination?: THopResult;
|
|
1354
|
+
lastProcessedChain?: TSubstrateChain;
|
|
1197
1355
|
};
|
|
1198
|
-
type
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
Native: string | number;
|
|
1202
|
-
} | {
|
|
1203
|
-
VToken: string;
|
|
1204
|
-
} | {
|
|
1205
|
-
Token: string;
|
|
1206
|
-
} | {
|
|
1207
|
-
VSToken2: number;
|
|
1208
|
-
} | {
|
|
1209
|
-
VToken2: number;
|
|
1210
|
-
} | {
|
|
1211
|
-
Token2: number;
|
|
1356
|
+
type TBypassOptions = {
|
|
1357
|
+
mintFeeAssets?: boolean;
|
|
1358
|
+
sentAssetMintMode?: 'preview' | 'bypass';
|
|
1212
1359
|
};
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
*/
|
|
1235
|
-
constructor();
|
|
1360
|
+
declare enum XTokensError {
|
|
1361
|
+
AssetHasNoReserve = "AssetHasNoReserve",
|
|
1362
|
+
NotCrossChainTransfer = "NotCrossChainTransfer",
|
|
1363
|
+
InvalidDest = "InvalidDest",
|
|
1364
|
+
NotCrossChainTransferableCurrency = "NotCrossChainTransferableCurrency",
|
|
1365
|
+
UnweighableMessage = "UnweighableMessage",
|
|
1366
|
+
XcmExecutionFailed = "XcmExecutionFailed",
|
|
1367
|
+
CannotReanchor = "CannotReanchor",
|
|
1368
|
+
InvalidAncestry = "InvalidAncestry",
|
|
1369
|
+
InvalidAsset = "InvalidAsset",
|
|
1370
|
+
DestinationNotInvertible = "DestinationNotInvertible",
|
|
1371
|
+
BadVersion = "BadVersion",
|
|
1372
|
+
DistinctReserveForAssetAndFee = "DistinctReserveForAssetAndFee",
|
|
1373
|
+
ZeroFee = "ZeroFee",
|
|
1374
|
+
ZeroAmount = "ZeroAmount",
|
|
1375
|
+
TooManyAssetsBeingSent = "TooManyAssetsBeingSent",
|
|
1376
|
+
AssetIndexNonExistent = "AssetIndexNonExistent",
|
|
1377
|
+
FeeNotEnough = "FeeNotEnough",
|
|
1378
|
+
NotSupportedLocation = "NotSupportedLocation",
|
|
1379
|
+
MinXcmFeeNotDefined = "MinXcmFeeNotDefined",
|
|
1380
|
+
RateLimited = "RateLimited"
|
|
1236
1381
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1382
|
+
declare enum PolkadotXcmError {
|
|
1383
|
+
Unreachable = "Unreachable",
|
|
1384
|
+
SendFailure = "SendFailure",
|
|
1385
|
+
Filtered = "Filtered",
|
|
1386
|
+
UnweighableMessage = "UnweighableMessage",
|
|
1387
|
+
DestinationNotInvertible = "DestinationNotInvertible",
|
|
1388
|
+
Empty = "Empty",
|
|
1389
|
+
CannotReanchor = "CannotReanchor",
|
|
1390
|
+
TooManyAssets = "TooManyAssets",
|
|
1391
|
+
InvalidOrigin = "InvalidOrigin",
|
|
1392
|
+
BadVersion = "BadVersion",
|
|
1393
|
+
BadLocation = "BadLocation",
|
|
1394
|
+
NoSubscription = "NoSubscription",
|
|
1395
|
+
AlreadySubscribed = "AlreadySubscribed",
|
|
1396
|
+
CannotCheckOutTeleport = "CannotCheckOutTeleport",
|
|
1397
|
+
LowBalance = "LowBalance",
|
|
1398
|
+
TooManyLocks = "TooManyLocks",
|
|
1399
|
+
AccountNotSovereign = "AccountNotSovereign",
|
|
1400
|
+
FeesNotMet = "FeesNotMet",
|
|
1401
|
+
LockNotFound = "LockNotFound",
|
|
1402
|
+
InUse = "InUse",
|
|
1403
|
+
REMOVED = "REMOVED",
|
|
1404
|
+
InvalidAssetUnknownReserve = "InvalidAssetUnknownReserve",
|
|
1405
|
+
InvalidAssetUnsupportedReserve = "InvalidAssetUnsupportedReserve",
|
|
1406
|
+
TooManyReserves = "TooManyReserves",
|
|
1407
|
+
LocalExecutionIncomplete = "LocalExecutionIncomplete",
|
|
1408
|
+
TooManyAuthorizedAliases = "TooManyAuthorizedAliases",
|
|
1409
|
+
ExpiresInPast = "ExpiresInPast",
|
|
1410
|
+
AliasNotFound = "AliasNotFound",
|
|
1411
|
+
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
1251
1412
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1413
|
+
declare enum PolkadotXcmExecutionError {
|
|
1414
|
+
Overflow = "Overflow",
|
|
1415
|
+
Unimplemented = "Unimplemented",
|
|
1416
|
+
UntrustedReserveLocation = "UntrustedReserveLocation",
|
|
1417
|
+
UntrustedTeleportLocation = "UntrustedTeleportLocation",
|
|
1418
|
+
LocationFull = "LocationFull",
|
|
1419
|
+
LocationNotInvertible = "LocationNotInvertible",
|
|
1420
|
+
BadOrigin = "BadOrigin",
|
|
1421
|
+
InvalidLocation = "InvalidLocation",
|
|
1422
|
+
AssetNotFound = "AssetNotFound",
|
|
1423
|
+
FailedToTransactAsset = "FailedToTransactAsset",
|
|
1424
|
+
NotWithdrawable = "NotWithdrawable",
|
|
1425
|
+
LocationCannotHold = "LocationCannotHold",
|
|
1426
|
+
ExceedsMaxMessageSize = "ExceedsMaxMessageSize",
|
|
1427
|
+
DestinationUnsupported = "DestinationUnsupported",
|
|
1428
|
+
Transport = "Transport",
|
|
1429
|
+
Unroutable = "Unroutable",
|
|
1430
|
+
UnknownClaim = "UnknownClaim",
|
|
1431
|
+
FailedToDecode = "FailedToDecode",
|
|
1432
|
+
MaxWeightInvalid = "MaxWeightInvalid",
|
|
1433
|
+
NotHoldingFees = "NotHoldingFees",
|
|
1434
|
+
TooExpensive = "TooExpensive",
|
|
1435
|
+
Trap = "Trap",
|
|
1436
|
+
ExpectationFalse = "ExpectationFalse",
|
|
1437
|
+
PalletNotFound = "PalletNotFound",
|
|
1438
|
+
NameMismatch = "NameMismatch",
|
|
1439
|
+
VersionIncompatible = "VersionIncompatible",
|
|
1440
|
+
HoldingWouldOverflow = "HoldingWouldOverflow",
|
|
1441
|
+
ExportError = "ExportError",
|
|
1442
|
+
ReanchorFailed = "ReanchorFailed",
|
|
1443
|
+
NoDeal = "NoDeal",
|
|
1444
|
+
FeesNotMet = "FeesNotMet",
|
|
1445
|
+
LockError = "LockError",
|
|
1446
|
+
NoPermission = "NoPermission",
|
|
1447
|
+
Unanchored = "Unanchored",
|
|
1448
|
+
NotDepositable = "NotDepositable",
|
|
1449
|
+
TooManyAssets = "TooManyAssets",
|
|
1450
|
+
UnhandledXcmVersion = "UnhandledXcmVersion",
|
|
1451
|
+
WeightLimitReached = "WeightLimitReached",
|
|
1452
|
+
Barrier = "Barrier",
|
|
1453
|
+
WeightNotComputable = "WeightNotComputable",
|
|
1454
|
+
ExceedsStackLimit = "ExceedsStackLimit"
|
|
1258
1455
|
}
|
|
1456
|
+
type TModuleError = {
|
|
1457
|
+
index: string;
|
|
1458
|
+
error: string;
|
|
1459
|
+
};
|
|
1460
|
+
type TDryRunError = {
|
|
1461
|
+
failureReason: string;
|
|
1462
|
+
failureSubReason?: string;
|
|
1463
|
+
};
|
|
1259
1464
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1465
|
+
type TXcmFeeSwapConfig = TSwapConfig & {
|
|
1466
|
+
amountOut: bigint;
|
|
1467
|
+
};
|
|
1468
|
+
type TTxFactory<TRes> = (amount?: string, relative?: boolean) => Promise<TRes>;
|
|
1469
|
+
type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
1264
1470
|
/**
|
|
1265
|
-
*
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
*/
|
|
1269
|
-
constructor(message: string);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
/**
|
|
1273
|
-
* Error development mode is on and no API override is provided for a specific chain.
|
|
1274
|
-
*/
|
|
1275
|
-
declare class MissingChainApiError extends Error {
|
|
1471
|
+
* The transaction factory
|
|
1472
|
+
*/
|
|
1473
|
+
buildTx: TTxFactory<TRes>;
|
|
1276
1474
|
/**
|
|
1277
|
-
*
|
|
1278
|
-
*
|
|
1279
|
-
* @param chain - The chain for which the API is missing.
|
|
1475
|
+
* The origin chain
|
|
1280
1476
|
*/
|
|
1281
|
-
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
/**
|
|
1285
|
-
* Error thrown when a required parameter is missing.
|
|
1286
|
-
*/
|
|
1287
|
-
declare class MissingParameterError extends Error {
|
|
1288
|
-
constructor(parameter: string | string[], message?: string);
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
/**
|
|
1292
|
-
* Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
1293
|
-
*/
|
|
1294
|
-
declare class NoXCMSupportImplementedError extends Error {
|
|
1477
|
+
origin: TSubstrateChain;
|
|
1295
1478
|
/**
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
1298
|
-
* @param chain - The chain for which XCM support is not implemented.
|
|
1479
|
+
* The destination chain
|
|
1299
1480
|
*/
|
|
1300
|
-
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
/**
|
|
1304
|
-
* Error thrown when numeric input is invalid or cannot be parsed.
|
|
1305
|
-
*/
|
|
1306
|
-
declare class NumberFormatError extends Error {
|
|
1307
|
-
constructor(message?: string);
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
/**
|
|
1311
|
-
* Error thrown when asset or currency overrides are invalid or conflicting.
|
|
1312
|
-
*/
|
|
1313
|
-
declare class OverrideConflictError extends Error {
|
|
1314
|
-
constructor(message: string);
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
/**
|
|
1318
|
-
* Error thrown when no provider or RPC endpoint is available for the requested chain.
|
|
1319
|
-
*/
|
|
1320
|
-
declare class ProviderUnavailableError extends Error {
|
|
1321
|
-
constructor(message: string);
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
* Error thrown when routing or path resolution fails.
|
|
1326
|
-
*/
|
|
1327
|
-
declare class RoutingResolutionError extends Error {
|
|
1328
|
-
constructor(message: string);
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
/**
|
|
1332
|
-
* Error thrown when a required runtime API is not available on the target chain.
|
|
1333
|
-
*/
|
|
1334
|
-
declare class RuntimeApiUnavailableError extends Error {
|
|
1335
|
-
constructor(chain: string, apiName: string);
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
type TScenarioNotSupportedContext = {
|
|
1339
|
-
chain: TChain;
|
|
1340
|
-
scenario: TScenario;
|
|
1341
|
-
};
|
|
1342
|
-
/**
|
|
1343
|
-
* Error thrown when a scenario, route, or chain capability is not supported.
|
|
1344
|
-
*/
|
|
1345
|
-
declare class ScenarioNotSupportedError extends Error {
|
|
1346
|
-
constructor(message: string);
|
|
1347
|
-
constructor({ chain, scenario }: TScenarioNotSupportedContext);
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
declare class TransferToAhNotSupported extends Error {
|
|
1351
|
-
constructor(message?: string);
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
declare class TypeAndThenUnavailableError extends Error {
|
|
1355
|
-
constructor(message: string);
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
/**
|
|
1359
|
-
* UnableToComputeError is thrown when a computation cannot be performed.
|
|
1360
|
-
*/
|
|
1361
|
-
declare class UnableToComputeError extends Error {
|
|
1481
|
+
destination: TChain;
|
|
1362
1482
|
/**
|
|
1363
|
-
*
|
|
1364
|
-
*
|
|
1365
|
-
* @param message - Required error message.
|
|
1483
|
+
* The sender address
|
|
1366
1484
|
*/
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
type THopTransferInfo = {
|
|
1378
|
-
chain: TChain;
|
|
1379
|
-
result: {
|
|
1380
|
-
xcmFee: TXcmFeeBase;
|
|
1381
|
-
asset: TAssetInfo;
|
|
1382
|
-
};
|
|
1383
|
-
};
|
|
1384
|
-
type TXcmFeeBase = {
|
|
1385
|
-
fee: bigint;
|
|
1386
|
-
asset: TAssetInfo;
|
|
1485
|
+
senderAddress: string;
|
|
1486
|
+
address: string;
|
|
1487
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1488
|
+
version?: Version;
|
|
1489
|
+
feeAsset?: TCurrencyInput;
|
|
1490
|
+
disableFallback: TDisableFallback;
|
|
1491
|
+
swapConfig?: TXcmFeeSwapConfig;
|
|
1492
|
+
skipReverseFeeCalculation?: boolean;
|
|
1387
1493
|
};
|
|
1388
|
-
type
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
ecosystem: string;
|
|
1393
|
-
};
|
|
1394
|
-
origin: {
|
|
1395
|
-
selectedCurrency: {
|
|
1396
|
-
sufficient: boolean;
|
|
1397
|
-
balance: bigint;
|
|
1398
|
-
balanceAfter: bigint;
|
|
1399
|
-
asset: TAssetInfo;
|
|
1400
|
-
};
|
|
1401
|
-
xcmFee: TXcmFeeBase & {
|
|
1402
|
-
sufficient: boolean;
|
|
1403
|
-
balance: bigint;
|
|
1404
|
-
balanceAfter: bigint;
|
|
1405
|
-
};
|
|
1406
|
-
};
|
|
1407
|
-
hops: THopTransferInfo[];
|
|
1408
|
-
destination: {
|
|
1409
|
-
receivedCurrency: {
|
|
1410
|
-
sufficient: boolean | UnableToComputeError;
|
|
1411
|
-
receivedAmount: bigint | UnableToComputeError;
|
|
1412
|
-
balance: bigint;
|
|
1413
|
-
balanceAfter: bigint | UnableToComputeError;
|
|
1414
|
-
asset: TAssetInfo;
|
|
1415
|
-
};
|
|
1416
|
-
xcmFee: TXcmFeeBase & {
|
|
1417
|
-
balanceAfter: bigint | UnableToComputeError;
|
|
1418
|
-
};
|
|
1419
|
-
};
|
|
1494
|
+
type TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback extends boolean = boolean> = WithApi<TGetXcmFeeBaseOptions<TRes, TDisableFallback>, TApi, TRes, TSigner>;
|
|
1495
|
+
type TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback extends boolean = boolean> = Omit<TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>, 'buildTx'> & {
|
|
1496
|
+
tx: TRes;
|
|
1497
|
+
useRootOrigin: boolean;
|
|
1420
1498
|
};
|
|
1421
|
-
type
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
originChain: TSubstrateChain;
|
|
1426
|
-
currency: TCurrencyCore;
|
|
1427
|
-
asset: TAssetInfo;
|
|
1428
|
-
senderAddress: string;
|
|
1429
|
-
ahAddress?: string;
|
|
1499
|
+
type TGetXcmFeeEstimateOptions<TApi, TRes, TSigner> = Omit<TGetXcmFeeInternalOptions<TApi, TRes, TSigner>, 'disableFallback' | 'useRootOrigin' | 'buildTx' | 'version'>;
|
|
1500
|
+
type TGetOriginXcmFeeEstimateOptions<TApi, TRes, TSigner> = Omit<TGetXcmFeeInternalOptions<TApi, TRes, TSigner>, 'disableFallback' | 'address' | 'useRootOrigin' | 'buildTx' | 'version'>;
|
|
1501
|
+
type TGetXcmFeeBuilderOptions = {
|
|
1502
|
+
disableFallback: boolean;
|
|
1430
1503
|
};
|
|
1431
|
-
type
|
|
1432
|
-
|
|
1504
|
+
type TGetOriginXcmFeeBaseOptions<TRes> = {
|
|
1505
|
+
buildTx: TTxFactory<TRes>;
|
|
1433
1506
|
origin: TSubstrateChain;
|
|
1434
1507
|
destination: TChain;
|
|
1435
|
-
|
|
1508
|
+
senderAddress: string;
|
|
1436
1509
|
currency: WithAmount<TCurrencyCore>;
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
bridgeFee?: bigint;
|
|
1510
|
+
version?: Version;
|
|
1511
|
+
feeAsset?: TCurrencyInput;
|
|
1512
|
+
disableFallback: boolean;
|
|
1513
|
+
useRootOrigin?: boolean;
|
|
1442
1514
|
};
|
|
1443
|
-
type
|
|
1444
|
-
|
|
1445
|
-
|
|
1515
|
+
type TGetOriginXcmFeeOptions<TApi, TRes, TSigner> = WithApi<TGetOriginXcmFeeBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1516
|
+
type TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner> = Omit<TGetOriginXcmFeeOptions<TApi, TRes, TSigner>, 'buildTx'> & {
|
|
1517
|
+
tx: TRes;
|
|
1446
1518
|
};
|
|
1447
|
-
type
|
|
1448
|
-
|
|
1519
|
+
type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
1520
|
+
prevChain: TSubstrateChain;
|
|
1449
1521
|
origin: TSubstrateChain;
|
|
1450
1522
|
destination: TChain;
|
|
1451
1523
|
senderAddress: string;
|
|
1452
|
-
ahAddress?: string;
|
|
1453
1524
|
address: string;
|
|
1454
1525
|
currency: WithAmount<TCurrencyCore>;
|
|
1455
|
-
|
|
1526
|
+
forwardedXcms: any;
|
|
1527
|
+
tx: TRes;
|
|
1528
|
+
asset: TAssetInfo;
|
|
1529
|
+
version: Version;
|
|
1530
|
+
originFee: bigint;
|
|
1531
|
+
feeAsset?: TCurrencyInput;
|
|
1532
|
+
disableFallback: boolean;
|
|
1533
|
+
hasPassedExchange?: boolean;
|
|
1534
|
+
swapConfig?: TXcmFeeSwapConfig;
|
|
1535
|
+
skipReverseFeeCalculation?: boolean;
|
|
1456
1536
|
};
|
|
1457
|
-
type
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
1461
|
-
chain: T;
|
|
1537
|
+
type TGetFeeForDestChainOptions<TApi, TRes, TSigner> = WithApi<TGetFeeForDestChainBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1538
|
+
type TGetReverseTxFeeOptions<TApi, TRes, TSigner> = Omit<TGetFeeForDestChainOptions<TApi, TRes, TSigner>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevChain' | 'version'> & {
|
|
1539
|
+
destination: TSubstrateChain;
|
|
1462
1540
|
};
|
|
1463
|
-
type
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1541
|
+
type TFeeType = 'dryRun' | 'paymentInfo' | 'noFeeRequired';
|
|
1542
|
+
type TXcmFeeBase$1 = {
|
|
1543
|
+
asset: TAssetInfo;
|
|
1544
|
+
weight?: TWeight;
|
|
1545
|
+
sufficient?: boolean;
|
|
1546
|
+
};
|
|
1547
|
+
type TXcmFeeDetailSuccess = TXcmFeeBase$1 & {
|
|
1548
|
+
fee: bigint;
|
|
1549
|
+
feeType: TFeeType;
|
|
1550
|
+
dryRunError?: string;
|
|
1551
|
+
dryRunSubError?: string;
|
|
1552
|
+
};
|
|
1553
|
+
type TXcmFeeDetailWithFallback = TXcmFeeDetailSuccess;
|
|
1554
|
+
type TXcmFeeDetailError = TXcmFeeBase$1 & {
|
|
1555
|
+
fee?: bigint;
|
|
1556
|
+
feeType?: TFeeType;
|
|
1557
|
+
dryRunError: string;
|
|
1558
|
+
dryRunSubError?: string;
|
|
1559
|
+
};
|
|
1560
|
+
type TXcmFeeDetail = TXcmFeeDetailSuccess | TXcmFeeDetailError;
|
|
1561
|
+
type TXcmFeeHopResult = {
|
|
1562
|
+
fee?: bigint;
|
|
1563
|
+
feeType?: TFeeType;
|
|
1564
|
+
sufficient?: boolean;
|
|
1565
|
+
dryRunError?: string;
|
|
1566
|
+
dryRunSubError?: string;
|
|
1567
|
+
forwardedXcms?: any;
|
|
1568
|
+
destParaId?: number;
|
|
1569
|
+
asset: TAssetInfo;
|
|
1570
|
+
};
|
|
1571
|
+
type TConditionalXcmFeeDetail<TDisableFallback extends boolean> = TDisableFallback extends false ? TXcmFeeDetailWithFallback : TXcmFeeDetail;
|
|
1572
|
+
type TDestXcmFeeDetail<TDisableFallback extends boolean> = TConditionalXcmFeeDetail<TDisableFallback> & {
|
|
1573
|
+
forwardedXcms?: any;
|
|
1574
|
+
destParaId?: number;
|
|
1575
|
+
};
|
|
1576
|
+
type TConditionalXcmFeeHopInfo<TDisableFallback extends boolean> = {
|
|
1577
|
+
chain: TChain;
|
|
1578
|
+
result: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1579
|
+
};
|
|
1580
|
+
type TXcmFeeHopInfo = {
|
|
1581
|
+
chain: TChain;
|
|
1582
|
+
result: TXcmFeeDetail;
|
|
1583
|
+
};
|
|
1584
|
+
type TGetXcmFeeResult<TDisableFallback extends boolean = boolean> = {
|
|
1585
|
+
failureReason?: string;
|
|
1586
|
+
failureChain?: TChainEndpoint;
|
|
1587
|
+
origin: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1588
|
+
destination: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1589
|
+
hops: TConditionalXcmFeeHopInfo<TDisableFallback>[];
|
|
1590
|
+
};
|
|
1591
|
+
type TGetXcmFeeEstimateDetail = {
|
|
1592
|
+
fee: bigint;
|
|
1593
|
+
asset: TAssetInfo;
|
|
1594
|
+
sufficient?: boolean;
|
|
1473
1595
|
};
|
|
1474
|
-
type
|
|
1475
|
-
|
|
1476
|
-
|
|
1596
|
+
type TGetXcmFeeEstimateResult = {
|
|
1597
|
+
origin: TGetXcmFeeEstimateDetail;
|
|
1598
|
+
destination: TGetXcmFeeEstimateDetail;
|
|
1477
1599
|
};
|
|
1478
|
-
type
|
|
1479
|
-
|
|
1480
|
-
|
|
1600
|
+
type TPaymentInfo = {
|
|
1601
|
+
partialFee: bigint;
|
|
1602
|
+
weight: TWeight;
|
|
1481
1603
|
};
|
|
1482
1604
|
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1605
|
+
type TGetBalanceCommonOptions = {
|
|
1606
|
+
/**
|
|
1607
|
+
* The address of the account.
|
|
1608
|
+
*/
|
|
1609
|
+
address: string;
|
|
1610
|
+
/**
|
|
1611
|
+
* The chain on which to query the balance.
|
|
1612
|
+
*/
|
|
1613
|
+
chain: TChain;
|
|
1487
1614
|
};
|
|
1488
|
-
|
|
1489
|
-
declare const createClientCache: <T>(maxSize: number, pingClient: (client: T) => Promise<void>, onEviction?: (key: TClientKey, value: TClientEntry<T>) => void, extensionMs?: number) => ClientCache<T>;
|
|
1490
|
-
|
|
1491
|
-
declare const blake2b256: (msg: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
1492
|
-
declare const blake2b512: (msg: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
1493
|
-
declare const deriveAccountId: (raw: Uint8Array) => Uint8Array;
|
|
1494
|
-
declare const encodeSs58: (payload: Uint8Array, network: number) => string;
|
|
1495
|
-
declare const convertSs58: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, chain: TSubstrateChain) => string;
|
|
1496
|
-
|
|
1497
|
-
declare const getAssetBalanceInternal: <TApi, TRes>({ api, address, chain, asset }: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
1498
|
-
declare const getBalanceInternal: <TApi, TRes>(options: TGetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
1499
|
-
declare const getBalance: <TApi, TRes>(options: TGetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
1500
|
-
|
|
1501
|
-
declare const getEthErc20Balance: (chain: TExternalChain, asset: TAssetInfo, address: string) => Promise<bigint>;
|
|
1502
|
-
|
|
1503
|
-
declare const getMoonbeamErc20Balance: (chain: TSubstrateChain, assetId: string, address: string) => Promise<bigint>;
|
|
1504
|
-
|
|
1505
|
-
declare const getChainConfig: (chain: TSubstrateChain) => TChainConfig;
|
|
1506
|
-
|
|
1507
|
-
declare const getChainProviders: (chain: TSubstrateChain) => string[];
|
|
1508
|
-
|
|
1509
|
-
/**
|
|
1510
|
-
* Retrieves the parachain ID for a specified chain.
|
|
1511
|
-
*
|
|
1512
|
-
* @param chain - The chain for which to get the paraId.
|
|
1513
|
-
* @returns The parachain ID of the chain.
|
|
1514
|
-
*/
|
|
1515
|
-
declare const getParaId: (chain: TChain) => number;
|
|
1516
|
-
|
|
1517
1615
|
/**
|
|
1518
|
-
* Retrieves the
|
|
1519
|
-
*
|
|
1520
|
-
* @param paraId - The parachain ID.
|
|
1521
|
-
* @returns The chain name if found; otherwise, null.
|
|
1616
|
+
* Retrieves the asset balance for a given account on a specified chain.
|
|
1522
1617
|
*/
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1593
|
-
handleEthBridgeNativeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1594
|
-
transferPolkadotXCM<TApi, TRes>(options: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1595
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1596
|
-
getBalanceForeign<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
declare class AssetHubPaseo<TApi, TRes> extends AssetHubPolkadot<TApi, TRes> {
|
|
1600
|
-
constructor();
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
declare class AssetHubWestend<TApi, TRes> extends AssetHubPolkadot<TApi, TRes> {
|
|
1604
|
-
constructor();
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
declare class Astar<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1608
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1609
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1610
|
-
isRelayToParaEnabled(): boolean;
|
|
1611
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
declare class Hydration<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1615
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1616
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1617
|
-
transferMoonbeamWhAsset<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1618
|
-
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes>): Promise<TRes>;
|
|
1619
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
declare class Basilisk<TApi, TRes> extends Hydration<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1623
|
-
constructor();
|
|
1624
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
declare class BifrostPolkadot<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1628
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1629
|
-
getCustomCurrencyId(asset: TAssetInfo): {
|
|
1630
|
-
Native: string;
|
|
1631
|
-
VToken?: undefined;
|
|
1632
|
-
Token?: undefined;
|
|
1633
|
-
VSToken2?: undefined;
|
|
1634
|
-
VToken2?: undefined;
|
|
1635
|
-
Token2?: undefined;
|
|
1636
|
-
} | {
|
|
1637
|
-
VToken: string;
|
|
1638
|
-
Native?: undefined;
|
|
1639
|
-
Token?: undefined;
|
|
1640
|
-
VSToken2?: undefined;
|
|
1641
|
-
VToken2?: undefined;
|
|
1642
|
-
Token2?: undefined;
|
|
1643
|
-
} | {
|
|
1644
|
-
Token: string;
|
|
1645
|
-
Native?: undefined;
|
|
1646
|
-
VToken?: undefined;
|
|
1647
|
-
VSToken2?: undefined;
|
|
1648
|
-
VToken2?: undefined;
|
|
1649
|
-
Token2?: undefined;
|
|
1650
|
-
} | {
|
|
1651
|
-
VSToken2: number;
|
|
1652
|
-
Native?: undefined;
|
|
1653
|
-
VToken?: undefined;
|
|
1654
|
-
Token?: undefined;
|
|
1655
|
-
VToken2?: undefined;
|
|
1656
|
-
Token2?: undefined;
|
|
1657
|
-
} | {
|
|
1658
|
-
VToken2: number;
|
|
1659
|
-
Native?: undefined;
|
|
1660
|
-
VToken?: undefined;
|
|
1661
|
-
Token?: undefined;
|
|
1662
|
-
VSToken2?: undefined;
|
|
1663
|
-
Token2?: undefined;
|
|
1664
|
-
} | {
|
|
1665
|
-
Token2: number;
|
|
1666
|
-
Native?: undefined;
|
|
1667
|
-
VToken?: undefined;
|
|
1668
|
-
Token?: undefined;
|
|
1669
|
-
VSToken2?: undefined;
|
|
1670
|
-
VToken2?: undefined;
|
|
1671
|
-
};
|
|
1672
|
-
transferPolkadotXCM<TApi, TRes>(options: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1673
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
declare class BifrostKusama<TApi, TRes> extends BifrostPolkadot<TApi, TRes> {
|
|
1677
|
-
constructor();
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
declare class BifrostPaseo<TApi, TRes> extends BifrostPolkadot<TApi, TRes> {
|
|
1681
|
-
constructor();
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
declare class BridgeHubKusama<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1685
|
-
constructor();
|
|
1686
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
declare class BridgeHubPolkadot<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1690
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1691
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
declare class BridgeHubPaseo<TApi, TRes> extends BridgeHubPolkadot<TApi, TRes> {
|
|
1695
|
-
constructor();
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
declare class BridgeHubWestend<TApi, TRes> extends BridgeHubPolkadot<TApi, TRes> {
|
|
1699
|
-
constructor();
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
declare class Centrifuge<TApi, TRes> extends Chain<TApi, TRes> implements IXTokensTransfer {
|
|
1703
|
-
constructor();
|
|
1704
|
-
getCustomCurrencyId(asset: TAssetInfo): "Native" | {
|
|
1705
|
-
ForeignAsset: number;
|
|
1706
|
-
};
|
|
1707
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1708
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
declare class Collectives<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1712
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1713
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
declare class CollectivesWestend<TApi, TRes> extends Collectives<TApi, TRes> {
|
|
1717
|
-
constructor();
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
declare class CoretimeKusama<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1721
|
-
constructor();
|
|
1722
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
declare class CoretimePolkadot<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1726
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1727
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1728
|
-
canReceiveFrom(origin: TChain): boolean;
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
declare class CoretimePaseo<TApi, TRes> extends CoretimePolkadot<TApi, TRes> {
|
|
1732
|
-
constructor();
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
declare class CoretimeWestend<TApi, TRes> extends CoretimePolkadot<TApi, TRes> {
|
|
1736
|
-
constructor();
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
|
-
declare class Crab<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1740
|
-
constructor();
|
|
1741
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1742
|
-
isRelayToParaEnabled(): boolean;
|
|
1743
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
declare class Crust<TApi, TRes> extends Chain<TApi, TRes> implements IXTokensTransfer {
|
|
1747
|
-
constructor();
|
|
1748
|
-
private getCurrencySelection;
|
|
1749
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1750
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
declare class CrustShadow<TApi, TRes> extends Chain<TApi, TRes> implements IXTokensTransfer {
|
|
1754
|
-
constructor();
|
|
1755
|
-
private getCurrencySelection;
|
|
1756
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1757
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
declare class Curio<TApi, TRes> extends Chain<TApi, TRes> implements IXTokensTransfer {
|
|
1761
|
-
constructor();
|
|
1762
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
1763
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1764
|
-
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1765
|
-
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
declare class Darwinia<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1769
|
-
constructor();
|
|
1770
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1771
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
declare class Encointer<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1775
|
-
constructor();
|
|
1776
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
declare class EnergyWebX<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1780
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1781
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1782
|
-
isRelayToParaEnabled(): boolean;
|
|
1783
|
-
getBalanceForeign<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
declare class EnergyWebXPaseo<TApi, TRes> extends EnergyWebX<TApi, TRes> {
|
|
1787
|
-
constructor();
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
declare class Heima<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1791
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1792
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
declare class HeimaPaseo<TApi, TRes> extends Heima<TApi, TRes> {
|
|
1796
|
-
constructor();
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
declare class HydrationPaseo<TApi, TRes> extends Hydration<TApi, TRes> {
|
|
1800
|
-
constructor();
|
|
1801
|
-
}
|
|
1802
|
-
|
|
1803
|
-
declare class Interlay<TApi, TRes> extends Chain<TApi, TRes> implements IXTokensTransfer {
|
|
1804
|
-
constructor();
|
|
1805
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
1806
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1807
|
-
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes>): Promise<TRes>;
|
|
1808
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1809
|
-
getBalanceNative(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
1810
|
-
}
|
|
1811
|
-
|
|
1812
|
-
declare class Jamton<TApi, TRes> extends Chain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1813
|
-
constructor();
|
|
1814
|
-
getCustomCurrencyId(asset: TAssetInfo): {
|
|
1815
|
-
Native: number;
|
|
1816
|
-
ForeignAsset?: undefined;
|
|
1817
|
-
} | {
|
|
1818
|
-
ForeignAsset: number;
|
|
1819
|
-
Native?: undefined;
|
|
1820
|
-
};
|
|
1821
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1822
|
-
}
|
|
1618
|
+
type TGetAssetBalanceOptionsBase = TGetBalanceCommonOptions & {
|
|
1619
|
+
/**
|
|
1620
|
+
* The resolved asset to query balance for.
|
|
1621
|
+
*/
|
|
1622
|
+
asset: TAssetInfo;
|
|
1623
|
+
};
|
|
1624
|
+
/**
|
|
1625
|
+
* Retrieves the currency balance for a given account on a specified chain.
|
|
1626
|
+
*/
|
|
1627
|
+
type TGetBalanceOptionsBase = TGetBalanceCommonOptions & {
|
|
1628
|
+
/**
|
|
1629
|
+
* The currency to query.
|
|
1630
|
+
*/
|
|
1631
|
+
currency?: TCurrencyCore;
|
|
1632
|
+
};
|
|
1633
|
+
type TGetBalanceOptions<TApi, TRes, TSigner> = WithApi<TGetBalanceOptionsBase, TApi, TRes, TSigner>;
|
|
1634
|
+
type TGetAssetBalanceOptions<TApi, TRes, TSigner> = WithApi<TGetAssetBalanceOptionsBase, TApi, TRes, TSigner>;
|
|
1635
|
+
type TGetTransferableAmountOptionsBase<TRes> = {
|
|
1636
|
+
/**
|
|
1637
|
+
* The sender address of the account.
|
|
1638
|
+
*/
|
|
1639
|
+
senderAddress: string;
|
|
1640
|
+
/**
|
|
1641
|
+
* The chain on which to query the balance.
|
|
1642
|
+
*/
|
|
1643
|
+
origin: TSubstrateChain;
|
|
1644
|
+
/**
|
|
1645
|
+
* The destination chain.
|
|
1646
|
+
*/
|
|
1647
|
+
destination: TChain;
|
|
1648
|
+
/**
|
|
1649
|
+
* The currency to query.
|
|
1650
|
+
*/
|
|
1651
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1652
|
+
version: Version | undefined;
|
|
1653
|
+
buildTx: TTxFactory<TRes>;
|
|
1654
|
+
feeAsset?: TCurrencyInput;
|
|
1655
|
+
};
|
|
1656
|
+
type TGetTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1657
|
+
type TGetMinTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes> & {
|
|
1658
|
+
address: string;
|
|
1659
|
+
builder: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TRes>>;
|
|
1660
|
+
}, TApi, TRes, TSigner>;
|
|
1661
|
+
type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
1662
|
+
/**
|
|
1663
|
+
* The origin chain.
|
|
1664
|
+
*/
|
|
1665
|
+
origin: TSubstrateChain;
|
|
1666
|
+
/**
|
|
1667
|
+
* The destination chain.
|
|
1668
|
+
*/
|
|
1669
|
+
destination: TChain;
|
|
1670
|
+
/**
|
|
1671
|
+
* The address of the account.
|
|
1672
|
+
*/
|
|
1673
|
+
address: string;
|
|
1674
|
+
/**
|
|
1675
|
+
* The account of the sender.
|
|
1676
|
+
*/
|
|
1677
|
+
senderAddress: string;
|
|
1678
|
+
/**
|
|
1679
|
+
* The currency to query.
|
|
1680
|
+
*/
|
|
1681
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1682
|
+
version: Version | undefined;
|
|
1683
|
+
buildTx: TTxFactory<TRes>;
|
|
1684
|
+
feeAsset?: TCurrencyInput;
|
|
1685
|
+
};
|
|
1686
|
+
type TVerifyEdOnDestinationOptions<TApi, TRes, TSigner> = WithApi<TVerifyEdOnDestinationOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1823
1687
|
|
|
1824
|
-
|
|
1825
|
-
|
|
1688
|
+
type TEvmChainFrom = Extract<TChain, 'Ethereum' | 'Moonbeam' | 'Moonriver' | 'Darwinia'>;
|
|
1689
|
+
/**
|
|
1690
|
+
* The options for the Ethereum to Polkadot transfer builder.
|
|
1691
|
+
*/
|
|
1692
|
+
type TEvmBuilderOptionsBase = {
|
|
1693
|
+
/**
|
|
1694
|
+
* The source chain. Can be either 'Ethereum', 'Moonbeam', 'Moonriver', or 'Darwinia'.
|
|
1695
|
+
*/
|
|
1696
|
+
from: TEvmChainFrom;
|
|
1697
|
+
/**
|
|
1698
|
+
* The destination chain on Polkadot network.
|
|
1699
|
+
*/
|
|
1700
|
+
to: TChain;
|
|
1701
|
+
/**
|
|
1702
|
+
* The currency to transfer. Symbol or ID.
|
|
1703
|
+
*/
|
|
1704
|
+
currency: TCurrencyInputWithAmount;
|
|
1705
|
+
/**
|
|
1706
|
+
* The Polkadot destination address.
|
|
1707
|
+
*/
|
|
1708
|
+
address: string;
|
|
1709
|
+
/**
|
|
1710
|
+
* The AssetHub address
|
|
1711
|
+
*/
|
|
1712
|
+
ahAddress?: string;
|
|
1713
|
+
/**
|
|
1714
|
+
* The Ethereum signer.
|
|
1715
|
+
*/
|
|
1716
|
+
signer: WalletClient;
|
|
1717
|
+
};
|
|
1718
|
+
type TEvmBuilderOptions<TApi, TRes, TSigner> = WithApi<TEvmBuilderOptionsBase, TApi, TRes, TSigner>;
|
|
1719
|
+
type TSerializeEthTransferOptions = Omit<TEvmBuilderOptionsBase, 'signer'> & {
|
|
1720
|
+
destAddress: string;
|
|
1721
|
+
};
|
|
1722
|
+
type TSerializedEthTransfer = {
|
|
1723
|
+
token: string;
|
|
1724
|
+
destinationParaId: number;
|
|
1725
|
+
destinationFee: bigint;
|
|
1726
|
+
amount: bigint;
|
|
1727
|
+
fee: bigint;
|
|
1728
|
+
};
|
|
1729
|
+
/**
|
|
1730
|
+
* The options for the batch builder.
|
|
1731
|
+
*/
|
|
1732
|
+
declare enum BatchMode {
|
|
1733
|
+
/**
|
|
1734
|
+
* Does not commit if one of the calls in the batch fails.
|
|
1735
|
+
*/
|
|
1736
|
+
BATCH_ALL = "BATCH_ALL",
|
|
1737
|
+
/**
|
|
1738
|
+
* Commits each successful call regardless if a call fails.
|
|
1739
|
+
*/
|
|
1740
|
+
BATCH = "BATCH"
|
|
1826
1741
|
}
|
|
1742
|
+
/**
|
|
1743
|
+
* The options for the batch builder.
|
|
1744
|
+
*/
|
|
1745
|
+
type TBatchOptions = {
|
|
1746
|
+
/**
|
|
1747
|
+
* The batch mode. Can be either:
|
|
1748
|
+
* `BATCH_ALL` - does not commit if one of the calls in the batch fails.
|
|
1749
|
+
* `BATCH` - commits each successful call regardless if a call fails.
|
|
1750
|
+
*/
|
|
1751
|
+
mode: BatchMode;
|
|
1752
|
+
};
|
|
1753
|
+
type TDryRunPreviewOptions = {
|
|
1754
|
+
mintFeeAssets?: boolean;
|
|
1755
|
+
};
|
|
1756
|
+
type TBuilderOptions<TApi> = TApi | TBuilderConfig<TApi>;
|
|
1757
|
+
type TBuilderConfig<TApi> = Partial<{
|
|
1758
|
+
apiOverrides: Partial<Record<TChain, TApi>>;
|
|
1759
|
+
development: boolean;
|
|
1760
|
+
abstractDecimals: boolean;
|
|
1761
|
+
xcmFormatCheck: boolean;
|
|
1762
|
+
}>;
|
|
1763
|
+
type TCreateTxsOptions<TApi, TRes, TSigner> = Pick<TSendOptions<TApi, TRes, TSigner>, 'api' | 'from' | 'to' | 'currency'>;
|
|
1764
|
+
type TBatchedSendOptions<TApi, TRes, TSigner> = Omit<TSendOptions<TApi, TRes, TSigner>, 'isAmountAll'> & {
|
|
1765
|
+
builder: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptions<TRes>>;
|
|
1766
|
+
};
|
|
1767
|
+
type TBuildInternalRes<TApi, TRes, TSigner, TOptions extends TSendBaseOptions<TRes> = TSendBaseOptions<TRes>> = {
|
|
1768
|
+
tx: TRes;
|
|
1769
|
+
options: TSendOptions<TApi, TRes, TSigner> & TOptions;
|
|
1770
|
+
};
|
|
1771
|
+
type TSender<TSigner> = string | TSigner;
|
|
1772
|
+
type TBuilderInternalOptions<TSigner> = {
|
|
1773
|
+
sender?: TSender<TSigner>;
|
|
1774
|
+
};
|
|
1827
1775
|
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1776
|
+
type TProviderEntry = {
|
|
1777
|
+
name: string;
|
|
1778
|
+
endpoint: string;
|
|
1779
|
+
};
|
|
1780
|
+
type TChainConfig = {
|
|
1781
|
+
name: string;
|
|
1782
|
+
info: string;
|
|
1783
|
+
paraId: number;
|
|
1784
|
+
providers: TProviderEntry[];
|
|
1785
|
+
};
|
|
1786
|
+
type TChainConfigMap = Record<TSubstrateChain, TChainConfig>;
|
|
1833
1787
|
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
}
|
|
1788
|
+
type OneKey<K extends string, V = unknown> = {
|
|
1789
|
+
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
1790
|
+
[Q in keyof O]: O[Q];
|
|
1791
|
+
} : never;
|
|
1792
|
+
}[K];
|
|
1793
|
+
type TXcmVersioned<T> = OneKey<Version, T>;
|
|
1794
|
+
type TXcmForeignAsset = {
|
|
1795
|
+
ForeignAsset: string | number | bigint | undefined;
|
|
1796
|
+
};
|
|
1797
|
+
type TForeignAssetId = {
|
|
1798
|
+
ForeignAssetId: bigint | undefined;
|
|
1799
|
+
};
|
|
1800
|
+
type TForeignOrTokenAsset = TXcmForeignAsset | {
|
|
1801
|
+
Token: string | undefined;
|
|
1802
|
+
};
|
|
1803
|
+
type TForeignOrNativeAsset = TXcmForeignAsset | 'Native';
|
|
1804
|
+
type TXcmAsset = {
|
|
1805
|
+
XCM: number | undefined;
|
|
1806
|
+
} | {
|
|
1807
|
+
Native: null;
|
|
1808
|
+
};
|
|
1809
|
+
type TMantaAsset = {
|
|
1810
|
+
MantaCurrency: bigint | undefined;
|
|
1811
|
+
};
|
|
1812
|
+
type TNativeTokenAsset = 'NativeToken';
|
|
1813
|
+
type TNodleAsset = 'NodleNative';
|
|
1814
|
+
type TZeitgeistAsset = 'Ztg';
|
|
1815
|
+
type TOtherReserveAsset = {
|
|
1816
|
+
OtherReserve: string | bigint | undefined;
|
|
1817
|
+
};
|
|
1818
|
+
type TSelfReserveAsset = 'SelfReserve';
|
|
1819
|
+
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
1820
|
+
type TBifrostToken = {
|
|
1821
|
+
Native: string | number;
|
|
1822
|
+
} | {
|
|
1823
|
+
VToken: string;
|
|
1824
|
+
} | {
|
|
1825
|
+
Token: string;
|
|
1826
|
+
} | {
|
|
1827
|
+
VSToken2: number;
|
|
1828
|
+
} | {
|
|
1829
|
+
VToken2: number;
|
|
1830
|
+
} | {
|
|
1831
|
+
Token2: number;
|
|
1832
|
+
};
|
|
1833
|
+
type TXTokensCurrencySelection = TXcmVersioned<TLocation | TAsset | TAsset[]> | TXcmForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | TBifrostToken | string | bigint | number | undefined;
|
|
1839
1834
|
|
|
1840
|
-
declare class
|
|
1841
|
-
constructor();
|
|
1842
|
-
getCustomCurrencyId(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
1843
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1844
|
-
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes>): Promise<TRes>;
|
|
1845
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1846
|
-
getBalanceNative(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
1835
|
+
declare class AmountTooLowError extends Error {
|
|
1836
|
+
constructor(message?: string);
|
|
1847
1837
|
}
|
|
1848
1838
|
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1839
|
+
/**
|
|
1840
|
+
* Error thrown when a batch operation is invalid or cannot be executed.
|
|
1841
|
+
*/
|
|
1842
|
+
declare class BatchValidationError extends Error {
|
|
1843
|
+
constructor(message: string);
|
|
1852
1844
|
}
|
|
1853
1845
|
|
|
1854
|
-
|
|
1846
|
+
/**
|
|
1847
|
+
* Error thrown when the Ethereum bridge is halted.
|
|
1848
|
+
*/
|
|
1849
|
+
declare class BridgeHaltedError extends Error {
|
|
1850
|
+
/**
|
|
1851
|
+
* Constructs a new BridgeHaltedError.
|
|
1852
|
+
*
|
|
1853
|
+
* @param message - Optional custom error message.
|
|
1854
|
+
*/
|
|
1855
1855
|
constructor();
|
|
1856
1856
|
}
|
|
1857
1857
|
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1858
|
+
/**
|
|
1859
|
+
* Error thrown when the Dry Run fails.
|
|
1860
|
+
*/
|
|
1861
|
+
declare class DryRunFailedError extends Error {
|
|
1862
|
+
readonly reason: string;
|
|
1863
|
+
readonly dryRunType?: TChainEndpoint;
|
|
1864
|
+
/**
|
|
1865
|
+
* Constructs a new DryRunFailedError.
|
|
1866
|
+
*
|
|
1867
|
+
* @param reason - The reason why the dry run failed.
|
|
1868
|
+
* @param dryRunType - Optional. Specifies if the error is related to the 'origin' or 'destination' dry run.
|
|
1869
|
+
*/
|
|
1870
|
+
constructor(reason: string, dryRunType?: TChainEndpoint);
|
|
1862
1871
|
}
|
|
1863
1872
|
|
|
1864
|
-
|
|
1865
|
-
|
|
1873
|
+
/**
|
|
1874
|
+
* Error thrown when a feature or route is temporarily disabled via configuration or governance.
|
|
1875
|
+
*/
|
|
1876
|
+
declare class FeatureTemporarilyDisabledError extends Error {
|
|
1877
|
+
constructor(message: string);
|
|
1866
1878
|
}
|
|
1867
1879
|
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1880
|
+
/**
|
|
1881
|
+
* Error thrown when an invalid address is provided.
|
|
1882
|
+
*/
|
|
1883
|
+
declare class InvalidAddressError extends Error {
|
|
1884
|
+
/**
|
|
1885
|
+
* Constructs a new InvalidAddressError.
|
|
1886
|
+
*
|
|
1887
|
+
* @param message - The error message.
|
|
1888
|
+
*/
|
|
1889
|
+
constructor(message: string);
|
|
1874
1890
|
}
|
|
1875
1891
|
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1892
|
+
/**
|
|
1893
|
+
* Error development mode is on and no API override is provided for a specific chain.
|
|
1894
|
+
*/
|
|
1895
|
+
declare class MissingChainApiError extends Error {
|
|
1896
|
+
/**
|
|
1897
|
+
* Constructs a new MissingChainApiError.
|
|
1898
|
+
*
|
|
1899
|
+
* @param chain - The chain for which the API is missing.
|
|
1900
|
+
*/
|
|
1901
|
+
constructor(chain: TChain);
|
|
1881
1902
|
}
|
|
1882
1903
|
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1904
|
+
/**
|
|
1905
|
+
* Error thrown when a required parameter is missing.
|
|
1906
|
+
*/
|
|
1907
|
+
declare class MissingParameterError extends Error {
|
|
1908
|
+
constructor(parameter: string | string[], message?: string);
|
|
1887
1909
|
}
|
|
1888
1910
|
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1911
|
+
/**
|
|
1912
|
+
* Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
1913
|
+
*/
|
|
1914
|
+
declare class NoXCMSupportImplementedError extends Error {
|
|
1915
|
+
/**
|
|
1916
|
+
* Constructs a new NoXCMSupportImplementedError.
|
|
1917
|
+
*
|
|
1918
|
+
* @param chain - The chain for which XCM support is not implemented.
|
|
1919
|
+
*/
|
|
1920
|
+
constructor(chain: TChain);
|
|
1893
1921
|
}
|
|
1894
1922
|
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1923
|
+
/**
|
|
1924
|
+
* Error thrown when numeric input is invalid or cannot be parsed.
|
|
1925
|
+
*/
|
|
1926
|
+
declare class NumberFormatError extends Error {
|
|
1927
|
+
constructor(message?: string);
|
|
1900
1928
|
}
|
|
1901
1929
|
|
|
1902
|
-
|
|
1903
|
-
|
|
1930
|
+
/**
|
|
1931
|
+
* Error thrown when asset or currency overrides are invalid or conflicting.
|
|
1932
|
+
*/
|
|
1933
|
+
declare class OverrideConflictError extends Error {
|
|
1934
|
+
constructor(message: string);
|
|
1904
1935
|
}
|
|
1905
1936
|
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1937
|
+
/**
|
|
1938
|
+
* Error thrown when no provider or RPC endpoint is available for the requested chain.
|
|
1939
|
+
*/
|
|
1940
|
+
declare class ProviderUnavailableError extends Error {
|
|
1941
|
+
constructor(message: string);
|
|
1910
1942
|
}
|
|
1911
1943
|
|
|
1912
|
-
|
|
1913
|
-
|
|
1944
|
+
/**
|
|
1945
|
+
* Error thrown when routing or path resolution fails.
|
|
1946
|
+
*/
|
|
1947
|
+
declare class RoutingResolutionError extends Error {
|
|
1948
|
+
constructor(message: string);
|
|
1914
1949
|
}
|
|
1915
1950
|
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1951
|
+
/**
|
|
1952
|
+
* Error thrown when a required runtime API is not available on the target chain.
|
|
1953
|
+
*/
|
|
1954
|
+
declare class RuntimeApiUnavailableError extends Error {
|
|
1955
|
+
constructor(chain: string, apiName: string);
|
|
1919
1956
|
}
|
|
1920
1957
|
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1958
|
+
type TScenarioNotSupportedContext = {
|
|
1959
|
+
chain: TChain;
|
|
1960
|
+
scenario: TScenario;
|
|
1961
|
+
};
|
|
1962
|
+
/**
|
|
1963
|
+
* Error thrown when a scenario, route, or chain capability is not supported.
|
|
1964
|
+
*/
|
|
1965
|
+
declare class ScenarioNotSupportedError extends Error {
|
|
1966
|
+
constructor(message: string);
|
|
1967
|
+
constructor({ chain, scenario }: TScenarioNotSupportedContext);
|
|
1925
1968
|
}
|
|
1926
1969
|
|
|
1927
|
-
declare class
|
|
1928
|
-
constructor();
|
|
1929
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1930
|
-
isRelayToParaEnabled(): boolean;
|
|
1931
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1970
|
+
declare class TransferToAhNotSupported extends Error {
|
|
1971
|
+
constructor(message?: string);
|
|
1932
1972
|
}
|
|
1933
1973
|
|
|
1934
|
-
declare class
|
|
1935
|
-
constructor();
|
|
1936
|
-
getCustomCurrencyId(asset: TAssetInfo): TXcmAsset;
|
|
1937
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1974
|
+
declare class TypeAndThenUnavailableError extends Error {
|
|
1975
|
+
constructor(message: string);
|
|
1938
1976
|
}
|
|
1939
1977
|
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1978
|
+
/**
|
|
1979
|
+
* UnableToComputeError is thrown when a computation cannot be performed.
|
|
1980
|
+
*/
|
|
1981
|
+
declare class UnableToComputeError extends Error {
|
|
1982
|
+
/**
|
|
1983
|
+
* Constructs a new UnableToComputeError.
|
|
1984
|
+
*
|
|
1985
|
+
* @param message - Required error message.
|
|
1986
|
+
*/
|
|
1987
|
+
constructor(message: string);
|
|
1943
1988
|
}
|
|
1944
1989
|
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1990
|
+
/**
|
|
1991
|
+
* Error thrown when an operation or parameter combination is not supported.
|
|
1992
|
+
*/
|
|
1993
|
+
declare class UnsupportedOperationError extends Error {
|
|
1994
|
+
constructor(message: string);
|
|
1948
1995
|
}
|
|
1949
1996
|
|
|
1950
|
-
|
|
1951
|
-
|
|
1997
|
+
/**
|
|
1998
|
+
* Thrown when a validation check fails.
|
|
1999
|
+
*/
|
|
2000
|
+
declare class ValidationError extends Error {
|
|
2001
|
+
constructor(message: string);
|
|
1952
2002
|
}
|
|
1953
2003
|
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
2004
|
+
type THopTransferInfo = {
|
|
2005
|
+
chain: TChain;
|
|
2006
|
+
result: {
|
|
2007
|
+
xcmFee: TXcmFeeBase;
|
|
2008
|
+
asset: TAssetInfo;
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
type TXcmFeeBase = {
|
|
2012
|
+
fee: bigint;
|
|
2013
|
+
asset: TAssetInfo;
|
|
2014
|
+
};
|
|
2015
|
+
type TTransferInfo = {
|
|
2016
|
+
chain: {
|
|
2017
|
+
origin: TChain;
|
|
2018
|
+
destination: TChain;
|
|
2019
|
+
ecosystem: string;
|
|
2020
|
+
};
|
|
2021
|
+
origin: {
|
|
2022
|
+
selectedCurrency: {
|
|
2023
|
+
sufficient: boolean;
|
|
2024
|
+
balance: bigint;
|
|
2025
|
+
balanceAfter: bigint;
|
|
2026
|
+
asset: TAssetInfo;
|
|
2027
|
+
};
|
|
2028
|
+
xcmFee: TXcmFeeBase & {
|
|
2029
|
+
sufficient: boolean;
|
|
2030
|
+
balance: bigint;
|
|
2031
|
+
balanceAfter: bigint;
|
|
2032
|
+
};
|
|
2033
|
+
};
|
|
2034
|
+
hops: THopTransferInfo[];
|
|
2035
|
+
destination: {
|
|
2036
|
+
receivedCurrency: {
|
|
2037
|
+
sufficient: boolean | UnableToComputeError;
|
|
2038
|
+
receivedAmount: bigint | UnableToComputeError;
|
|
2039
|
+
balance: bigint;
|
|
2040
|
+
balanceAfter: bigint | UnableToComputeError;
|
|
2041
|
+
asset: TAssetInfo;
|
|
2042
|
+
};
|
|
2043
|
+
xcmFee: TXcmFeeBase & {
|
|
2044
|
+
balanceAfter: bigint | UnableToComputeError;
|
|
2045
|
+
};
|
|
2046
|
+
};
|
|
2047
|
+
};
|
|
2048
|
+
type BuildHopInfoOptions<TApi, TRes, TSigner> = {
|
|
2049
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
2050
|
+
chain: TSubstrateChain;
|
|
2051
|
+
fee: bigint;
|
|
2052
|
+
originChain: TSubstrateChain;
|
|
2053
|
+
currency: TCurrencyCore;
|
|
2054
|
+
asset: TAssetInfo;
|
|
2055
|
+
senderAddress: string;
|
|
2056
|
+
ahAddress?: string;
|
|
2057
|
+
};
|
|
2058
|
+
type TBuildDestInfoOptions<TApi, TRes, TSigner> = {
|
|
2059
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
2060
|
+
origin: TSubstrateChain;
|
|
2061
|
+
destination: TChain;
|
|
2062
|
+
address: string;
|
|
2063
|
+
currency: WithAmount<TCurrencyCore>;
|
|
2064
|
+
originFee: bigint;
|
|
2065
|
+
isFeeAssetAh: boolean;
|
|
2066
|
+
destFeeDetail: TXcmFeeDetail;
|
|
2067
|
+
totalHopFee: bigint;
|
|
2068
|
+
bridgeFee?: bigint;
|
|
2069
|
+
};
|
|
2070
|
+
type TOriginFeeDetails = {
|
|
2071
|
+
sufficientForXCM: boolean;
|
|
2072
|
+
xcmFee: bigint;
|
|
2073
|
+
};
|
|
2074
|
+
type TGetTransferInfoOptionsBase<TRes> = {
|
|
2075
|
+
buildTx: TTxFactory<TRes>;
|
|
2076
|
+
origin: TSubstrateChain;
|
|
2077
|
+
destination: TChain;
|
|
2078
|
+
senderAddress: string;
|
|
2079
|
+
ahAddress?: string;
|
|
2080
|
+
address: string;
|
|
2081
|
+
currency: WithAmount<TCurrencyCore>;
|
|
2082
|
+
version: Version | undefined;
|
|
2083
|
+
feeAsset?: TCurrencyCore;
|
|
2084
|
+
};
|
|
2085
|
+
type TGetTransferInfoOptions<TApi, TRes, TSigner> = WithApi<TGetTransferInfoOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1957
2086
|
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2087
|
+
type TChainWithApi<TApi, TRes, TSigner, T = TSubstrateChain> = {
|
|
2088
|
+
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
2089
|
+
chain: T;
|
|
2090
|
+
};
|
|
2091
|
+
type TTypeAndThenCallContext<TApi, TRes, TSigner> = {
|
|
2092
|
+
origin: TChainWithApi<TApi, TRes, TSigner>;
|
|
2093
|
+
dest: TChainWithApi<TApi, TRes, TSigner>;
|
|
2094
|
+
reserve: TChainWithApi<TApi, TRes, TSigner, TChain>;
|
|
2095
|
+
isSubBridge: boolean;
|
|
2096
|
+
isSnowbridge: boolean;
|
|
2097
|
+
isRelayAsset: boolean;
|
|
2098
|
+
assetInfo: WithAmount<TAssetWithLocation>;
|
|
2099
|
+
systemAsset: TAssetInfo;
|
|
2100
|
+
options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>;
|
|
2101
|
+
};
|
|
2102
|
+
type TTypeAndThenFees = {
|
|
2103
|
+
hopFees: bigint;
|
|
2104
|
+
destFee: bigint;
|
|
2105
|
+
};
|
|
2106
|
+
type TTypeAndThenOverrides = {
|
|
2107
|
+
reserveChain?: TSubstrateChain;
|
|
2108
|
+
noFeeAsset?: boolean;
|
|
2109
|
+
};
|
|
1963
2110
|
|
|
1964
|
-
declare
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
}
|
|
2111
|
+
declare const keyFromWs: (ws: TUrl) => TClientKey;
|
|
2112
|
+
declare const createClientPoolHelpers: <TClient>(clientPool: ClientCache<TClient>, createClient: (ws: TUrl, useLegacy: boolean) => TClient | Promise<TClient>) => {
|
|
2113
|
+
leaseClient: (ws: TUrl, ttlMs: number, useLegacy: boolean) => Promise<TClient>;
|
|
2114
|
+
releaseClient: (ws: TUrl) => void;
|
|
2115
|
+
};
|
|
1969
2116
|
|
|
1970
|
-
declare
|
|
1971
|
-
constructor();
|
|
1972
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1973
|
-
isReceivingTempDisabled(scenario: TScenario): boolean;
|
|
1974
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1975
|
-
}
|
|
2117
|
+
declare const createClientCache: <T>(maxSize: number, pingClient: (client: T) => Promise<void>, onEviction?: (key: TClientKey, value: TClientEntry<T>) => void, extensionMs?: number) => ClientCache<T>;
|
|
1976
2118
|
|
|
1977
|
-
declare
|
|
1978
|
-
|
|
1979
|
-
|
|
2119
|
+
declare const blake2b256: (msg: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
2120
|
+
declare const blake2b512: (msg: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
2121
|
+
declare const deriveAccountId: (raw: Uint8Array) => Uint8Array;
|
|
2122
|
+
declare const encodeSs58: (payload: Uint8Array, network: number) => string;
|
|
2123
|
+
declare const convertSs58: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, chain: TSubstrateChain) => string;
|
|
1980
2124
|
|
|
1981
|
-
declare
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
transferLocalNonNativeAsset(_options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1985
|
-
getBalanceForeign<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
1986
|
-
}
|
|
2125
|
+
declare const getAssetBalanceInternal: <TApi, TRes, TSigner>({ api, address, chain, asset }: TGetAssetBalanceOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2126
|
+
declare const getBalanceInternal: <TApi, TRes, TSigner>(options: TGetBalanceOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2127
|
+
declare const getBalance: <TApi, TRes, TSigner>(options: TGetBalanceOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
1987
2128
|
|
|
1988
|
-
declare
|
|
1989
|
-
constructor();
|
|
1990
|
-
}
|
|
2129
|
+
declare const getEthErc20Balance: (chain: TExternalChain, asset: TAssetInfo, address: string) => Promise<bigint>;
|
|
1991
2130
|
|
|
1992
|
-
declare
|
|
1993
|
-
constructor();
|
|
1994
|
-
transferPolkadotXCM<TApi, TRes>(options: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1995
|
-
canReceiveFrom(origin: TChain): boolean;
|
|
1996
|
-
}
|
|
2131
|
+
declare const getMoonbeamErc20Balance: (chain: TSubstrateChain, assetId: string, address: string) => Promise<bigint>;
|
|
1997
2132
|
|
|
1998
|
-
declare
|
|
1999
|
-
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
2000
|
-
getCustomCurrencyId(asset: TAssetInfo): TZeitgeistAsset | TXcmForeignAsset;
|
|
2001
|
-
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
2002
|
-
canReceiveFrom(origin: TChain): boolean;
|
|
2003
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
2004
|
-
}
|
|
2133
|
+
declare const getChainConfig: (chain: TSubstrateChain) => TChainConfig;
|
|
2005
2134
|
|
|
2006
|
-
declare
|
|
2007
|
-
constructor();
|
|
2008
|
-
}
|
|
2135
|
+
declare const getChainProviders: (chain: TSubstrateChain) => string[];
|
|
2009
2136
|
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
Crust: Crust<TApi, TRes>;
|
|
2018
|
-
BifrostPolkadot: BifrostPolkadot<TApi, TRes>;
|
|
2019
|
-
BridgeHubPolkadot: BridgeHubPolkadot<TApi, TRes>;
|
|
2020
|
-
Centrifuge: Centrifuge<TApi, TRes>;
|
|
2021
|
-
Darwinia: Darwinia<TApi, TRes>;
|
|
2022
|
-
EnergyWebX: EnergyWebX<TApi, TRes>;
|
|
2023
|
-
Hydration: Hydration<TApi, TRes>;
|
|
2024
|
-
Interlay: Interlay<TApi, TRes>;
|
|
2025
|
-
Heima: Heima<TApi, TRes>;
|
|
2026
|
-
Jamton: Jamton<TApi, TRes>;
|
|
2027
|
-
Moonbeam: Moonbeam<TApi, TRes>;
|
|
2028
|
-
CoretimePolkadot: CoretimePolkadot<TApi, TRes>;
|
|
2029
|
-
RobonomicsPolkadot: RobonomicsPolkadot<TApi, TRes>;
|
|
2030
|
-
PeoplePolkadot: PeoplePolkadot<TApi, TRes>;
|
|
2031
|
-
Manta: Manta<TApi, TRes>;
|
|
2032
|
-
Nodle: Nodle<TApi, TRes>;
|
|
2033
|
-
NeuroWeb: NeuroWeb<TApi, TRes>;
|
|
2034
|
-
Pendulum: Pendulum<TApi, TRes>;
|
|
2035
|
-
Collectives: Collectives<TApi, TRes>;
|
|
2036
|
-
Phala: Phala<TApi, TRes>;
|
|
2037
|
-
KiltSpiritnet: KiltSpiritnet<TApi, TRes>;
|
|
2038
|
-
Curio: Curio<TApi, TRes>;
|
|
2039
|
-
Mythos: Mythos<TApi, TRes>;
|
|
2040
|
-
Peaq: Peaq<TApi, TRes>;
|
|
2041
|
-
Xode: Xode<TApi, TRes>;
|
|
2042
|
-
Kusama: Kusama<TApi, TRes>;
|
|
2043
|
-
AssetHubKusama: AssetHubKusama<TApi, TRes>;
|
|
2044
|
-
BridgeHubKusama: BridgeHubKusama<TApi, TRes>;
|
|
2045
|
-
CoretimeKusama: CoretimeKusama<TApi, TRes>;
|
|
2046
|
-
Encointer: Encointer<TApi, TRes>;
|
|
2047
|
-
Altair: Altair<TApi, TRes>;
|
|
2048
|
-
Basilisk: Basilisk<TApi, TRes>;
|
|
2049
|
-
BifrostKusama: BifrostKusama<TApi, TRes>;
|
|
2050
|
-
CrustShadow: CrustShadow<TApi, TRes>;
|
|
2051
|
-
Crab: Crab<TApi, TRes>;
|
|
2052
|
-
Karura: Karura<TApi, TRes>;
|
|
2053
|
-
Kintsugi: Kintsugi<TApi, TRes>;
|
|
2054
|
-
Moonriver: Moonriver<TApi, TRes>;
|
|
2055
|
-
Laos: Laos<TApi, TRes>;
|
|
2056
|
-
Quartz: Quartz<TApi, TRes>;
|
|
2057
|
-
PeopleKusama: PeopleKusama<TApi, TRes>;
|
|
2058
|
-
Shiden: Shiden<TApi, TRes>;
|
|
2059
|
-
Zeitgeist: Zeitgeist<TApi, TRes>;
|
|
2060
|
-
Westend: Westend<TApi, TRes>;
|
|
2061
|
-
AssetHubWestend: AssetHubWestend<TApi, TRes>;
|
|
2062
|
-
BridgeHubWestend: BridgeHubWestend<TApi, TRes>;
|
|
2063
|
-
CollectivesWestend: CollectivesWestend<TApi, TRes>;
|
|
2064
|
-
CoretimeWestend: CoretimeWestend<TApi, TRes>;
|
|
2065
|
-
PeopleWestend: PeopleWestend<TApi, TRes>;
|
|
2066
|
-
Penpal: Penpal<TApi, TRes>;
|
|
2067
|
-
Paseo: Paseo<TApi, TRes>;
|
|
2068
|
-
AssetHubPaseo: AssetHubPaseo<TApi, TRes>;
|
|
2069
|
-
BridgeHubPaseo: BridgeHubPaseo<TApi, TRes>;
|
|
2070
|
-
CoretimePaseo: CoretimePaseo<TApi, TRes>;
|
|
2071
|
-
EnergyWebXPaseo: EnergyWebXPaseo<TApi, TRes>;
|
|
2072
|
-
KiltPaseo: KiltPaseo<TApi, TRes>;
|
|
2073
|
-
PAssetHub: PAssetHub<TApi, TRes>;
|
|
2074
|
-
PeoplePaseo: PeoplePaseo<TApi, TRes>;
|
|
2075
|
-
AjunaPaseo: AjunaPaseo<TApi, TRes>;
|
|
2076
|
-
BifrostPaseo: BifrostPaseo<TApi, TRes>;
|
|
2077
|
-
HeimaPaseo: HeimaPaseo<TApi, TRes>;
|
|
2078
|
-
HydrationPaseo: HydrationPaseo<TApi, TRes>;
|
|
2079
|
-
LaosPaseo: LaosPaseo<TApi, TRes>;
|
|
2080
|
-
NeuroWebPaseo: NeuroWebPaseo<TApi, TRes>;
|
|
2081
|
-
ZeitgeistPaseo: ZeitgeistPaseo<TApi, TRes>;
|
|
2082
|
-
};
|
|
2137
|
+
/**
|
|
2138
|
+
* Retrieves the parachain ID for a specified chain.
|
|
2139
|
+
*
|
|
2140
|
+
* @param chain - The chain for which to get the paraId.
|
|
2141
|
+
* @returns The parachain ID of the chain.
|
|
2142
|
+
*/
|
|
2143
|
+
declare const getParaId: (chain: TChain) => number;
|
|
2083
2144
|
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2145
|
+
/**
|
|
2146
|
+
* Retrieves the chain name corresponding to a specified parachain ID.
|
|
2147
|
+
*
|
|
2148
|
+
* @param paraId - The parachain ID.
|
|
2149
|
+
* @returns The chain name if found; otherwise, null.
|
|
2150
|
+
*/
|
|
2151
|
+
declare const getTChain: (paraId: number, ecosystem: TRelaychain | TExternalChain) => TChain | null;
|
|
2089
2152
|
|
|
2090
|
-
declare const claimAssets: <TApi, TRes>(options: TAssetClaimOptions<TApi, TRes>) => Promise<TRes>;
|
|
2153
|
+
declare const claimAssets: <TApi, TRes, TSigner>(options: TAssetClaimOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2091
2154
|
|
|
2092
|
-
declare const dryRun: <TApi, TRes>(options: TDryRunOptions<TApi, TRes>) => Promise<TDryRunResult>;
|
|
2155
|
+
declare const dryRun: <TApi, TRes, TSigner>(options: TDryRunOptions<TApi, TRes, TSigner>) => Promise<TDryRunResult>;
|
|
2093
2156
|
|
|
2094
|
-
declare const dryRunInternal: <TApi, TRes>(options: TDryRunOptions<TApi, TRes>) => Promise<TDryRunResult>;
|
|
2157
|
+
declare const dryRunInternal: <TApi, TRes, TSigner>(options: TDryRunOptions<TApi, TRes, TSigner>) => Promise<TDryRunResult>;
|
|
2095
2158
|
|
|
2096
|
-
declare const dryRunOrigin: <TApi, TRes>(options: TDryRunCallOptions<TApi, TRes>) => Promise<TDryRunChainResult>;
|
|
2159
|
+
declare const dryRunOrigin: <TApi, TRes, TSigner>(options: TDryRunCallOptions<TApi, TRes, TSigner>) => Promise<TDryRunChainResult>;
|
|
2097
2160
|
|
|
2098
2161
|
declare const getFailureInfo: (result: TDryRunResult) => Pick<TDryRunResult, "failureReason" | "failureSubReason" | "failureChain">;
|
|
2099
2162
|
|
|
2100
|
-
declare const traverseXcmHops: <TApi, TRes, THopResult>(config: HopTraversalConfig<TApi, TRes, THopResult>) => Promise<HopTraversalResult<THopResult>>;
|
|
2101
|
-
declare const addEthereumBridgeFees: <TApi, TRes, TResult extends {
|
|
2163
|
+
declare const traverseXcmHops: <TApi, TRes, TSigner, THopResult>(config: HopTraversalConfig<TApi, TRes, TSigner, THopResult>) => Promise<HopTraversalResult<THopResult>>;
|
|
2164
|
+
declare const addEthereumBridgeFees: <TApi, TRes, TSigner, TResult extends {
|
|
2102
2165
|
fee?: bigint;
|
|
2103
|
-
}>(api: IPolkadotApi<TApi, TRes>, bridgeHubResult: TResult | undefined, destination: TChain, assetHubChain: TSubstrateChain) => Promise<TResult | undefined>;
|
|
2166
|
+
}>(api: IPolkadotApi<TApi, TRes, TSigner>, bridgeHubResult: TResult | undefined, destination: TChain, assetHubChain: TSubstrateChain) => Promise<TResult | undefined>;
|
|
2104
2167
|
|
|
2105
2168
|
declare const calcPreviewMintAmount: (balance: bigint, desired: bigint) => bigint | null;
|
|
2106
|
-
declare const wrapTxBypass: <TApi, TRes>(dryRunOptions: TDryRunBypassOptions<TApi, TRes>, options?: TBypassOptions) => Promise<TRes>;
|
|
2169
|
+
declare const wrapTxBypass: <TApi, TRes, TSigner>(dryRunOptions: TDryRunBypassOptions<TApi, TRes, TSigner>, options?: TBypassOptions) => Promise<TRes>;
|
|
2107
2170
|
|
|
2108
|
-
declare const getParaEthTransferFees: <TApi, TRes>(ahApi: IPolkadotApi<TApi, TRes>, shouldDisconnect?: boolean) => Promise<[bigint, bigint]>;
|
|
2171
|
+
declare const getParaEthTransferFees: <TApi, TRes, TSigner>(ahApi: IPolkadotApi<TApi, TRes, TSigner>, shouldDisconnect?: boolean) => Promise<[bigint, bigint]>;
|
|
2109
2172
|
|
|
2110
|
-
declare const transferMoonbeamEvm: <TApi, TRes>({ api, from, to, signer, address, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
|
|
2173
|
+
declare const transferMoonbeamEvm: <TApi, TRes, TSigner>({ api, from, to, signer, address, currency }: TEvmBuilderOptions<TApi, TRes, TSigner>) => Promise<string>;
|
|
2111
2174
|
|
|
2112
|
-
declare const transferMoonbeamToEth: <TApi, TRes>(from: TSubstrateChain, { api, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<`0x${string}`>;
|
|
2175
|
+
declare const transferMoonbeamToEth: <TApi, TRes, TSigner>(from: TSubstrateChain, { api, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes, TSigner>) => Promise<`0x${string}`>;
|
|
2113
2176
|
|
|
2114
|
-
declare const getOriginXcmFee: <TApi, TRes>(options: TGetOriginXcmFeeOptions<TApi, TRes>) => Promise<TXcmFeeDetail & {
|
|
2177
|
+
declare const getOriginXcmFee: <TApi, TRes, TSigner>(options: TGetOriginXcmFeeOptions<TApi, TRes, TSigner>) => Promise<TXcmFeeDetail & {
|
|
2115
2178
|
forwardedXcms?: unknown;
|
|
2116
2179
|
destParaId?: number;
|
|
2117
2180
|
}>;
|
|
@@ -2123,15 +2186,15 @@ declare const getOriginXcmFee: <TApi, TRes>(options: TGetOriginXcmFeeOptions<TAp
|
|
|
2123
2186
|
* For more details, see the documentation:
|
|
2124
2187
|
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
2125
2188
|
*/
|
|
2126
|
-
declare const getOriginXcmFeeEstimate: <TApi, TRes>({ api, tx, origin, destination, currency, senderAddress, feeAsset }: TGetOriginXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateDetail>;
|
|
2189
|
+
declare const getOriginXcmFeeEstimate: <TApi, TRes, TSigner>({ api, tx, origin, destination, currency, senderAddress, feeAsset }: TGetOriginXcmFeeEstimateOptions<TApi, TRes, TSigner>) => Promise<TGetXcmFeeEstimateDetail>;
|
|
2127
2190
|
|
|
2128
|
-
declare const getOriginXcmFeeInternal: <TApi, TRes>({ api, tx, origin, destination, senderAddress, disableFallback, feeAsset, currency, useRootOrigin }: TGetOriginXcmFeeInternalOptions<TApi, TRes>) => Promise<TXcmFeeDetail & {
|
|
2191
|
+
declare const getOriginXcmFeeInternal: <TApi, TRes, TSigner>({ api, tx, origin, destination, senderAddress, disableFallback, feeAsset, currency, version, useRootOrigin }: TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner>) => Promise<TXcmFeeDetail & {
|
|
2129
2192
|
forwardedXcms?: any;
|
|
2130
2193
|
destParaId?: number;
|
|
2131
2194
|
}>;
|
|
2132
2195
|
|
|
2133
|
-
declare const getXcmFeeInternal: <TApi, TRes, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2134
|
-
declare const getXcmFee: <TApi, TRes, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2196
|
+
declare const getXcmFeeInternal: <TApi, TRes, TSigner, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2197
|
+
declare const getXcmFee: <TApi, TRes, TSigner, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2135
2198
|
|
|
2136
2199
|
/**
|
|
2137
2200
|
* @deprecated This function is deprecated and will be removed in a future version.
|
|
@@ -2140,49 +2203,71 @@ declare const getXcmFee: <TApi, TRes, TDisableFallback extends boolean>(options:
|
|
|
2140
2203
|
* For more details, see the documentation:
|
|
2141
2204
|
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
2142
2205
|
*/
|
|
2143
|
-
declare const getXcmFeeEstimate: <TApi, TRes>(options: TGetXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateResult>;
|
|
2144
|
-
|
|
2145
|
-
declare const getXcmFeeOnce: <TApi, TRes, TDisableFallback extends boolean>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation }: TGetXcmFeeInternalOptions<TApi, TRes, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2146
|
-
|
|
2147
|
-
declare const getBridgeStatus: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => Promise<TBridgeStatus>;
|
|
2148
|
-
|
|
2149
|
-
declare const
|
|
2206
|
+
declare const getXcmFeeEstimate: <TApi, TRes, TSigner>(options: TGetXcmFeeEstimateOptions<TApi, TRes, TSigner>) => Promise<TGetXcmFeeEstimateResult>;
|
|
2207
|
+
|
|
2208
|
+
declare const getXcmFeeOnce: <TApi, TRes, TSigner, TDisableFallback extends boolean>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset, version, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation }: TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2209
|
+
|
|
2210
|
+
declare const getBridgeStatus: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>) => Promise<TBridgeStatus>;
|
|
2211
|
+
|
|
2212
|
+
declare const resolveSendParams: <TApi, TRes, TSigner>(options: TSendOptions<TApi, TRes, TSigner>) => {
|
|
2213
|
+
resolvedFeeAsset: TAssetInfo | undefined;
|
|
2214
|
+
resolvedVersion: _paraspell_sdk_common.Version;
|
|
2215
|
+
overriddenAsset: _paraspell_sdk_common.TLocation | _paraspell_assets.TAssetWithFee[] | undefined;
|
|
2216
|
+
normalizedAsset: {
|
|
2217
|
+
amount: bigint;
|
|
2218
|
+
decimals: number;
|
|
2219
|
+
symbol: string;
|
|
2220
|
+
isNative?: boolean;
|
|
2221
|
+
assetId?: string;
|
|
2222
|
+
location?: _paraspell_sdk_common.TLocation;
|
|
2223
|
+
existentialDeposit?: string;
|
|
2224
|
+
isFeeAsset?: boolean;
|
|
2225
|
+
alias?: string;
|
|
2226
|
+
};
|
|
2227
|
+
};
|
|
2228
|
+
declare const send: <TApi, TRes, TSigner>(options: TSendOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2150
2229
|
|
|
2151
|
-
declare const getTransferInfo: <TApi, TRes>({ api, buildTx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
|
|
2230
|
+
declare const getTransferInfo: <TApi, TRes, TSigner>({ api, buildTx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset, version }: TGetTransferInfoOptions<TApi, TRes, TSigner>) => Promise<TTransferInfo>;
|
|
2152
2231
|
|
|
2153
|
-
declare const getMinTransferableAmountInternal: <TApi, TRes>({ api, origin, senderAddress, address, origin: chain, destination, currency, feeAsset, buildTx, builder }: TGetMinTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
2154
|
-
declare const getMinTransferableAmount: <TApi, TRes>(options: TGetMinTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
2232
|
+
declare const getMinTransferableAmountInternal: <TApi, TRes, TSigner>({ api, origin, senderAddress, address, origin: chain, destination, currency, feeAsset, buildTx, builder, version }: TGetMinTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2233
|
+
declare const getMinTransferableAmount: <TApi, TRes, TSigner>(options: TGetMinTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2155
2234
|
|
|
2156
|
-
declare const getTransferableAmountInternal: <TApi, TRes>({ api, senderAddress, origin: chain, destination, currency, buildTx, feeAsset }: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
2157
|
-
declare const getTransferableAmount: <TApi, TRes>(options: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
2235
|
+
declare const getTransferableAmountInternal: <TApi, TRes, TSigner>({ api, senderAddress, origin: chain, destination, currency, buildTx, feeAsset, version }: TGetTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2236
|
+
declare const getTransferableAmount: <TApi, TRes, TSigner>(options: TGetTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2158
2237
|
|
|
2159
|
-
declare const constructTypeAndThenCall: <TApi, TRes>(context: TTypeAndThenCallContext<TApi, TRes>, fees?: TTypeAndThenFees | null) => Promise<TSerializedExtrinsics>;
|
|
2238
|
+
declare const constructTypeAndThenCall: <TApi, TRes, TSigner>(context: TTypeAndThenCallContext<TApi, TRes, TSigner>, fees?: TTypeAndThenFees | null) => Promise<TSerializedExtrinsics>;
|
|
2160
2239
|
/**
|
|
2161
2240
|
* Creates a type and then call for transferring assets using XCM. Works only for DOT and snowbridge assets so far.
|
|
2162
2241
|
*/
|
|
2163
|
-
declare const createTypeAndThenCall: <TApi, TRes>(options: TPolkadotXCMTransferOptions<TApi, TRes>, overrides?: TTypeAndThenOverrides) => Promise<TSerializedExtrinsics>;
|
|
2242
|
+
declare const createTypeAndThenCall: <TApi, TRes, TSigner>(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, overrides?: TTypeAndThenOverrides) => Promise<TSerializedExtrinsics>;
|
|
2164
2243
|
|
|
2165
2244
|
/**
|
|
2166
2245
|
* Creates a type-and-then call but auto-selects the asset reserve between AssetHub and the Relay chain
|
|
2167
2246
|
* by dry-running both variants and preferring the one that succeeds. If both fail, returns the
|
|
2168
2247
|
* AssetHub variant. Supports only relaychain assets.
|
|
2169
2248
|
*/
|
|
2170
|
-
declare const createTypeThenAutoReserve: <TApi, TRes>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TSerializedExtrinsics>;
|
|
2249
|
+
declare const createTypeThenAutoReserve: <TApi, TRes, TSigner>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TSerializedExtrinsics>;
|
|
2171
2250
|
|
|
2172
2251
|
declare const validateCurrency: (currency: TCurrencyInput, feeAsset?: TCurrencyInput) => void;
|
|
2173
2252
|
declare const validateDestination: (origin: TSubstrateChain, destination: TDestination) => void;
|
|
2174
2253
|
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput) => void;
|
|
2254
|
+
declare const validateTransact: <TApi, TRes, TSigner>({ api, from, to, senderAddress, address, transactOptions }: TSendOptions<TApi, TRes, TSigner>) => ValidationError | undefined;
|
|
2175
2255
|
|
|
2176
|
-
declare const verifyEdOnDestination: <TApi, TRes>(options: TVerifyEdOnDestinationOptions<TApi, TRes>) => Promise<boolean>;
|
|
2256
|
+
declare const verifyEdOnDestination: <TApi, TRes, TSigner>(options: TVerifyEdOnDestinationOptions<TApi, TRes, TSigner>) => Promise<boolean>;
|
|
2177
2257
|
|
|
2178
|
-
declare const
|
|
2258
|
+
declare const compareAddresses: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, addr1: string, addr2: string) => boolean;
|
|
2259
|
+
|
|
2260
|
+
declare const validateAddress: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2261
|
+
|
|
2262
|
+
declare const validateDestinationAddress: <TApi, TRes, TSigner>(address: TAddress, destination: TDestination, api: IPolkadotApi<TApi, TRes, TSigner>) => void;
|
|
2179
2263
|
|
|
2180
2264
|
declare const assertToIsString: (to: TDestination, overrideMsg?: string) => asserts to is Exclude<TDestination, TLocation>;
|
|
2181
2265
|
declare const assertAddressIsString: (address: TAddress) => asserts address is Exclude<TAddress, TLocation>;
|
|
2182
2266
|
declare const assertSenderAddress: (address: string | undefined) => asserts address is string;
|
|
2183
2267
|
declare const assertHasLocation: (asset: TAssetInfo) => asserts asset is TAssetWithLocation;
|
|
2184
2268
|
declare const assertHasId: (asset: TAssetInfo) => asserts asset is TAssetInfoWithId;
|
|
2185
|
-
declare const
|
|
2269
|
+
declare const assertSender: <TSigner>(sender?: TSender<TSigner>) => asserts sender is TSender<TSigner>;
|
|
2270
|
+
declare const isSenderSigner: <TSigner>(sender: TSender<TSigner>) => sender is TSigner;
|
|
2186
2271
|
|
|
2187
2272
|
declare const createId: (version: Version, location: TLocation) => TLocation | {
|
|
2188
2273
|
Concrete: TLocation;
|
|
@@ -2197,15 +2282,15 @@ declare const maybeOverrideAsset: (version: Version, amount: bigint, asset: TAss
|
|
|
2197
2282
|
|
|
2198
2283
|
declare const sortAssets: (assets: TAsset[]) => TAsset[];
|
|
2199
2284
|
|
|
2200
|
-
declare const computeOverridenAmount: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, increaseAmount: string, relative?: boolean) => number | bigint;
|
|
2201
|
-
declare const overrideTxAmount: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, builder: GeneralBuilder<TApi, TRes, TSendBaseOptions
|
|
2202
|
-
declare const createTx: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, builder: GeneralBuilder<TApi, TRes, TSendBaseOptions
|
|
2285
|
+
declare const computeOverridenAmount: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, increaseAmount: string, relative?: boolean) => number | bigint;
|
|
2286
|
+
declare const overrideTxAmount: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, builder: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptions<TRes>>, amount: string, relative?: boolean) => Promise<TRes>;
|
|
2287
|
+
declare const createTx: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, builder: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptions<TRes>>, amount?: string, relative?: boolean) => Promise<TRes>;
|
|
2203
2288
|
|
|
2204
2289
|
declare const isConfig: <TApi>(value: any) => value is TBuilderConfig<TApi>;
|
|
2205
2290
|
|
|
2206
2291
|
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation) => TSubstrateChain;
|
|
2207
2292
|
|
|
2208
|
-
declare const getChainVersion: <TApi, TRes>(chain: TChain) => Version;
|
|
2293
|
+
declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
2209
2294
|
|
|
2210
2295
|
/**
|
|
2211
2296
|
* Gets the relay chain (Polkadot, Kusama, Westend, or Paseo) of a given chain.
|
|
@@ -2215,7 +2300,7 @@ declare const getChainVersion: <TApi, TRes>(chain: TChain) => Version;
|
|
|
2215
2300
|
*/
|
|
2216
2301
|
declare const getRelayChainOf: (chain: TSubstrateChain) => TRelaychain;
|
|
2217
2302
|
|
|
2218
|
-
declare const createChainClient: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, chain: TSubstrateChain) => Promise<TApi>;
|
|
2303
|
+
declare const createChainClient: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain) => Promise<TApi>;
|
|
2219
2304
|
|
|
2220
2305
|
declare const computeFeeFromDryRun: (dryRun: any, chain: TSubstrateChain, executionFee: bigint, isFeeAsset?: boolean) => bigint;
|
|
2221
2306
|
|
|
@@ -2232,12 +2317,12 @@ declare const padValueBy: (amount: bigint, percent: number) => bigint;
|
|
|
2232
2317
|
* @param chain - The chain identifier.
|
|
2233
2318
|
* @returns The chain instance
|
|
2234
2319
|
*/
|
|
2235
|
-
declare const getChain: <TApi, TRes, T extends keyof ReturnType<typeof chains>>(chain: T) => ReturnType<typeof chains<TApi, TRes>>[T];
|
|
2320
|
+
declare const getChain: <TApi, TRes, TSigner, T extends keyof ReturnType<typeof chains>>(chain: T) => ReturnType<typeof chains<TApi, TRes, TSigner>>[T];
|
|
2236
2321
|
|
|
2237
2322
|
declare const getEvmPrivateKeyHex: (path: string) => "0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133" | "0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b" | "0x0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b" | "0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68" | "0x7dce9bc8babb68fec1409be38c8e1a52650206a7ed90ff956ae8a6d15eeaaef4" | "0xb9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df" | undefined;
|
|
2238
2323
|
|
|
2239
|
-
declare const createBeneficiaryLocXTokens: <TApi, TRes>({ api, address: recipientAddress, origin, destination, version, paraId }: TCreateBeneficiaryXTokensOptions<TApi, TRes>) => TLocation;
|
|
2240
|
-
declare const createBeneficiaryLocation: <TApi, TRes>({ api, address, version }: TCreateBeneficiaryOptions<TApi, TRes>) => TLocation;
|
|
2324
|
+
declare const createBeneficiaryLocXTokens: <TApi, TRes, TSigner>({ api, address: recipientAddress, origin, destination, version, paraId }: TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2325
|
+
declare const createBeneficiaryLocation: <TApi, TRes, TSigner>({ api, address, version }: TCreateBeneficiaryOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2241
2326
|
|
|
2242
2327
|
declare const createDestination: (version: Version, origin: TSubstrateChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TLocation;
|
|
2243
2328
|
declare const createVersionedDestination: (version: Version, origin: TSubstrateChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TXcmVersioned<TLocation>;
|
|
@@ -2265,7 +2350,7 @@ declare const resolveDestChain: (originChain: TSubstrateChain, paraId: number |
|
|
|
2265
2350
|
|
|
2266
2351
|
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
2267
2352
|
|
|
2268
|
-
declare const abstractDecimals: <TApi, TRes>(amount: TAmount, decimals: number | undefined, api: IPolkadotApi<TApi, TRes>) => bigint;
|
|
2353
|
+
declare const abstractDecimals: <TApi, TRes, TSigner>(amount: TAmount, decimals: number | undefined, api: IPolkadotApi<TApi, TRes, TSigner>) => bigint;
|
|
2269
2354
|
declare const applyDecimalAbstraction: (amount: TAmount, decimals: number | undefined, shouldAbstract: boolean) => bigint;
|
|
2270
2355
|
|
|
2271
2356
|
declare const createAssetsFilter: (asset: TAsset, version: Version) => {
|
|
@@ -2279,21 +2364,23 @@ declare const createAssetsFilter: (asset: TAsset, version: Version) => {
|
|
|
2279
2364
|
};
|
|
2280
2365
|
};
|
|
2281
2366
|
|
|
2282
|
-
declare const createBaseExecuteXcm: (options: TCreateBaseTransferXcmOptions & {
|
|
2367
|
+
declare const createBaseExecuteXcm: <TRes>(options: TCreateBaseTransferXcmOptions<TRes> & {
|
|
2283
2368
|
suffixXcm?: unknown[];
|
|
2284
2369
|
}) => unknown[];
|
|
2285
2370
|
|
|
2286
2371
|
declare const createExecuteCall: (chain: TSubstrateChain, xcm: TXcmVersioned<any>, maxWeight: TWeight) => TSerializedExtrinsics;
|
|
2287
2372
|
|
|
2288
|
-
declare const createExecuteExchangeXcm: <TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>, origin: TSubstrateChain, weight: TWeight, originExecutionFee: bigint, destExecutionFee: bigint) => TRes;
|
|
2373
|
+
declare const createExecuteExchangeXcm: <TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, origin: TSubstrateChain, weight: TWeight, originExecutionFee: bigint, destExecutionFee: bigint) => TRes;
|
|
2289
2374
|
|
|
2290
|
-
declare const createDirectExecuteXcm: <TApi, TRes>(options: TCreateTransferXcmOptions<TApi, TRes>) => OneKey<_paraspell_sdk_common.Version, unknown[]
|
|
2375
|
+
declare const createDirectExecuteXcm: <TApi, TRes, TSigner>(options: TCreateTransferXcmOptions<TApi, TRes, TSigner>) => Promise<OneKey<_paraspell_sdk_common.Version, unknown[]>>;
|
|
2291
2376
|
|
|
2292
|
-
declare const handleExecuteTransfer: <TApi, TRes>(
|
|
2377
|
+
declare const handleExecuteTransfer: <TApi, TRes, TSigner>(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TSerializedExtrinsics>;
|
|
2293
2378
|
|
|
2294
|
-
declare const handleSwapExecuteTransfer: <TApi, TRes>(options: TCreateSwapXcmOptions<TApi, TRes>) => Promise<TRes>;
|
|
2379
|
+
declare const handleSwapExecuteTransfer: <TApi, TRes, TSigner>(options: TCreateSwapXcmOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2295
2380
|
|
|
2296
|
-
declare const
|
|
2381
|
+
declare const getLocalTransferAmount: <TApi, TRes, TSigner>({ assetInfo, balance, isAmountAll, keepAlive }: TTransferLocalOptions<TApi, TRes, TSigner>, fee?: bigint) => bigint;
|
|
2382
|
+
|
|
2383
|
+
declare const handleToAhTeleport: <TApi, TRes, TSigner>(origin: TParachain, input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, defaultTx: TRes) => Promise<TRes>;
|
|
2297
2384
|
|
|
2298
2385
|
declare const throwUnsupportedCurrency: (currency: TCurrencyInput, chain: string, { isDestination }?: {
|
|
2299
2386
|
isDestination: boolean;
|
|
@@ -2302,7 +2389,10 @@ declare const throwUnsupportedCurrency: (currency: TCurrencyInput, chain: string
|
|
|
2302
2389
|
declare const parseUnits: typeof parseUnits$1;
|
|
2303
2390
|
declare const formatUnits: typeof formatUnits$1;
|
|
2304
2391
|
|
|
2305
|
-
declare const
|
|
2392
|
+
declare const addXcmVersionHeader: <T, V extends Version>(obj: T, version: V) => OneKey<V, T>;
|
|
2393
|
+
declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersion: Version, destMaxVersion?: Version) => Version;
|
|
2394
|
+
declare const pickCompatibleXcmVersion: (origin: TSubstrateChain, destination: TDestination, override?: Version) => Version;
|
|
2395
|
+
declare const pickRouterCompatibleXcmVersion: (origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2306
2396
|
|
|
2307
|
-
export { AmountTooLowError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString,
|
|
2308
|
-
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainEndpoint, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedEthTransfer, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|
|
2397
|
+
export { AmountTooLowError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertSender, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, constructTypeAndThenCall, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmPrivateKeyHex, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, resolveDestChain, resolveModuleError, resolveParaId, resolveSendParams, reverseTransformLocation, selectXcmVersion, send, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2398
|
+
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainEndpoint, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSender, TSerializeEthTransferOptions, TSerializedEthTransfer, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TSwapConfig, TSwapFeeEstimates, TTransactOptions, TTransactOrigin, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|