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