@paraspell/sdk-core 11.2.0 → 11.2.2
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.cjs +1176 -1301
- package/dist/index.d.ts +257 -256
- package/dist/index.mjs +1177 -1302
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -262,257 +262,6 @@ type TAssetClaimInternalOptions<TApi, TRes> = TAssetClaimOptions<TApi, TRes> & {
|
|
|
262
262
|
assets: TAsset<bigint>[];
|
|
263
263
|
};
|
|
264
264
|
|
|
265
|
-
/**
|
|
266
|
-
* Builder class for constructing asset claim transactions.
|
|
267
|
-
*/
|
|
268
|
-
declare class AssetClaimBuilder<TApi, TRes, T extends Partial<TAssetClaimOptionsBase> = object> {
|
|
269
|
-
readonly api: IPolkadotApi<TApi, TRes>;
|
|
270
|
-
readonly _options: T;
|
|
271
|
-
constructor(api: IPolkadotApi<TApi, TRes>, options?: T);
|
|
272
|
-
/**
|
|
273
|
-
* Specifies the assets to be claimed.
|
|
274
|
-
*
|
|
275
|
-
* @param assets - An array of assets to claim in a multi-asset format.
|
|
276
|
-
* @returns An instance of Builder
|
|
277
|
-
*/
|
|
278
|
-
currency(currency: TAssetClaimOptionsBase['currency']): AssetClaimBuilder<TApi, TRes, T & {
|
|
279
|
-
currency: TAssetClaimOptionsBase['currency'];
|
|
280
|
-
}>;
|
|
281
|
-
/**
|
|
282
|
-
* Specifies the account address on which the assets will be claimed.
|
|
283
|
-
*
|
|
284
|
-
* @param address - The destination account address.
|
|
285
|
-
* @returns An instance of Builder
|
|
286
|
-
*/
|
|
287
|
-
address(address: TAddress): AssetClaimBuilder<TApi, TRes, T & {
|
|
288
|
-
address: TAddress;
|
|
289
|
-
}>;
|
|
290
|
-
/**
|
|
291
|
-
* Sets the XCM version to be used for the asset claim.
|
|
292
|
-
*
|
|
293
|
-
* @param version - The XCM version.
|
|
294
|
-
* @returns An instance of Builder
|
|
295
|
-
*/
|
|
296
|
-
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, T & {
|
|
297
|
-
version: Version;
|
|
298
|
-
}>;
|
|
299
|
-
/**
|
|
300
|
-
* Builds and returns the asset claim extrinsic.
|
|
301
|
-
*
|
|
302
|
-
* @returns A Promise that resolves to the asset claim extrinsic.
|
|
303
|
-
*/
|
|
304
|
-
build(this: AssetClaimBuilder<TApi, TRes, TAssetClaimOptionsBase>): Promise<TRes>;
|
|
305
|
-
/**
|
|
306
|
-
* Returns the API instance used by the builder.
|
|
307
|
-
*
|
|
308
|
-
* @returns The API instance.
|
|
309
|
-
*/
|
|
310
|
-
getApi(): TApi;
|
|
311
|
-
/**
|
|
312
|
-
* Disconnects the API.
|
|
313
|
-
*
|
|
314
|
-
* @returns A Promise that resolves when the API is disconnected.
|
|
315
|
-
*/
|
|
316
|
-
disconnect(): Promise<void>;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
declare class BatchTransactionManager<TApi, TRes> {
|
|
320
|
-
transactionOptions: TSendOptions<TApi, TRes>[];
|
|
321
|
-
addTransaction(options: TSendOptions<TApi, TRes>): void;
|
|
322
|
-
isEmpty(): boolean;
|
|
323
|
-
buildBatch(api: IPolkadotApi<TApi, TRes>, from: TSubstrateChain, options?: TBatchOptions): Promise<TRes>;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
328
|
-
*/
|
|
329
|
-
declare class GeneralBuilder<TApi, TRes, T extends Partial<TSendBaseOptions> = object> {
|
|
330
|
-
readonly batchManager: BatchTransactionManager<TApi, TRes>;
|
|
331
|
-
readonly api: IPolkadotApi<TApi, TRes>;
|
|
332
|
-
readonly _options: T;
|
|
333
|
-
constructor(api: IPolkadotApi<TApi, TRes>, batchManager: BatchTransactionManager<TApi, TRes>, options?: T);
|
|
334
|
-
/**
|
|
335
|
-
* Specifies the origin chain for the transaction.
|
|
336
|
-
*
|
|
337
|
-
* @param chain - The chain from which the transaction originates.
|
|
338
|
-
* @returns An instance of Builder
|
|
339
|
-
*/
|
|
340
|
-
from(chain: TSubstrateChain): GeneralBuilder<TApi, TRes, T & {
|
|
341
|
-
from: TSubstrateChain;
|
|
342
|
-
}>;
|
|
343
|
-
/**
|
|
344
|
-
* Specifies the destination chain for the transaction.
|
|
345
|
-
*
|
|
346
|
-
* @param chain - The chain to which the transaction is sent.
|
|
347
|
-
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
348
|
-
* @returns An instance of Builder
|
|
349
|
-
*/
|
|
350
|
-
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, T & {
|
|
351
|
-
to: TDestination;
|
|
352
|
-
}>;
|
|
353
|
-
/**
|
|
354
|
-
* Initiates the process to claim assets from a specified chain.
|
|
355
|
-
*
|
|
356
|
-
* @param chain - The chain from which to claim assets.
|
|
357
|
-
* @returns An instance of Builder
|
|
358
|
-
*/
|
|
359
|
-
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, {
|
|
360
|
-
chain: TSubstrateChain;
|
|
361
|
-
}>;
|
|
362
|
-
/**
|
|
363
|
-
* Specifies the currency to be used in the transaction. Symbol, ID, location or multi-asset.
|
|
364
|
-
*
|
|
365
|
-
* @param currency - The currency to be transferred.
|
|
366
|
-
* @returns An instance of Builder
|
|
367
|
-
*/
|
|
368
|
-
currency(currency: TCurrencyInputWithAmount): GeneralBuilder<TApi, TRes, T & {
|
|
369
|
-
currency: TCurrencyInputWithAmount;
|
|
370
|
-
}>;
|
|
371
|
-
/**
|
|
372
|
-
* Sets the recipient address.
|
|
373
|
-
*
|
|
374
|
-
* @param address - The destination address.
|
|
375
|
-
* @returns An instance of Builder
|
|
376
|
-
*/
|
|
377
|
-
address(address: TAddress): GeneralBuilder<TApi, TRes, T & {
|
|
378
|
-
address: TAddress;
|
|
379
|
-
}>;
|
|
380
|
-
/**
|
|
381
|
-
* Sets the sender address.
|
|
382
|
-
*
|
|
383
|
-
* @param address - The sender address.
|
|
384
|
-
* @returns
|
|
385
|
-
*/
|
|
386
|
-
senderAddress(address: string): GeneralBuilder<TApi, TRes, T & {
|
|
387
|
-
senderAddress: string;
|
|
388
|
-
}>;
|
|
389
|
-
/**
|
|
390
|
-
* Sets the asset hub address. This is used for transfers that go through the Asset Hub and originate from an EVM chain.
|
|
391
|
-
*
|
|
392
|
-
* @param address - The address to be used.
|
|
393
|
-
* @returns An instance of Builder
|
|
394
|
-
*/
|
|
395
|
-
ahAddress(address: string | undefined): GeneralBuilder<TApi, TRes, T & {
|
|
396
|
-
ahAddress: string | undefined;
|
|
397
|
-
}>;
|
|
398
|
-
/**
|
|
399
|
-
* Sets the XCM version to be used for the transfer.
|
|
400
|
-
*
|
|
401
|
-
* @param version - The XCM version.
|
|
402
|
-
* @returns An instance of Builder
|
|
403
|
-
*/
|
|
404
|
-
xcmVersion(version: Version): GeneralBuilder<TApi, TRes, T & {
|
|
405
|
-
version: Version;
|
|
406
|
-
}>;
|
|
407
|
-
/**
|
|
408
|
-
* Sets a custom pallet for the transaction.
|
|
409
|
-
*
|
|
410
|
-
* @param palletName - The name of the custom pallet to be used.
|
|
411
|
-
* @returns An instance of the Builder.
|
|
412
|
-
*/
|
|
413
|
-
customPallet(pallet: string, method: string): GeneralBuilder<TApi, TRes, T & {
|
|
414
|
-
pallet: string;
|
|
415
|
-
method: string;
|
|
416
|
-
}>;
|
|
417
|
-
/**
|
|
418
|
-
* Optional fee asset for the transaction.
|
|
419
|
-
*
|
|
420
|
-
* @param currency - The currency to be used for the fee.
|
|
421
|
-
* @returns An instance of the Builder
|
|
422
|
-
*/
|
|
423
|
-
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, T & {
|
|
424
|
-
feeAsset: TCurrencyInput | undefined;
|
|
425
|
-
}>;
|
|
426
|
-
/**
|
|
427
|
-
* Adds the transfer transaction to the batch.
|
|
428
|
-
*
|
|
429
|
-
* @returns An instance of Builder
|
|
430
|
-
*/
|
|
431
|
-
addToBatch(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): GeneralBuilder<TApi, TRes, T & {
|
|
432
|
-
from: TSubstrateChain;
|
|
433
|
-
}>;
|
|
434
|
-
/**
|
|
435
|
-
* Builds and returns the batched transaction based on the configured parameters.
|
|
436
|
-
*
|
|
437
|
-
* @param options - (Optional) Options to customize the batch transaction.
|
|
438
|
-
* @returns A Extrinsic representing the batched transactions.
|
|
439
|
-
*/
|
|
440
|
-
buildBatch(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>, options?: TBatchOptions): Promise<TRes>;
|
|
441
|
-
/**
|
|
442
|
-
* Builds and returns the transfer extrinsic.
|
|
443
|
-
*
|
|
444
|
-
* @returns A Promise that resolves to the transfer extrinsic.
|
|
445
|
-
*/
|
|
446
|
-
build(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): Promise<TRes>;
|
|
447
|
-
dryRun(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TDryRunResult>;
|
|
448
|
-
/**
|
|
449
|
-
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
450
|
-
*
|
|
451
|
-
* @returns An origin and destination fee.
|
|
452
|
-
*/
|
|
453
|
-
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, options?: TGetXcmFeeBuilderOptions & {
|
|
454
|
-
disableFallback: TDisableFallback;
|
|
455
|
-
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
456
|
-
/**
|
|
457
|
-
* Returns the origin XCM fee for the transfer using dryRun or paymentInfo function.
|
|
458
|
-
*
|
|
459
|
-
* @returns An origin fee.
|
|
460
|
-
*/
|
|
461
|
-
getOriginXcmFee(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TXcmFeeDetail & {
|
|
462
|
-
forwardedXcms?: any;
|
|
463
|
-
destParaId?: number;
|
|
464
|
-
}>;
|
|
465
|
-
/**
|
|
466
|
-
* Estimates the origin and destination XCM fee using paymentInfo function.
|
|
467
|
-
*
|
|
468
|
-
* @returns An origin and destination fee estimate.
|
|
469
|
-
*/
|
|
470
|
-
getXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateResult>;
|
|
471
|
-
/**
|
|
472
|
-
* Estimates the origin XCM fee using paymentInfo function.
|
|
473
|
-
*
|
|
474
|
-
* @returns An origin fee estimate.
|
|
475
|
-
*/
|
|
476
|
-
getOriginXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateDetail>;
|
|
477
|
-
/**
|
|
478
|
-
* Returns the max transferable amount for the transfer
|
|
479
|
-
*
|
|
480
|
-
* @returns The max transferable amount.
|
|
481
|
-
*/
|
|
482
|
-
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<bigint>;
|
|
483
|
-
/**
|
|
484
|
-
* Returns the max transferable amount for the transfer
|
|
485
|
-
*
|
|
486
|
-
* @returns The max transferable amount.
|
|
487
|
-
*/
|
|
488
|
-
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<boolean>;
|
|
489
|
-
/**
|
|
490
|
-
* Returns the transfer info for the transfer
|
|
491
|
-
*
|
|
492
|
-
* @returns The transfer info.
|
|
493
|
-
*/
|
|
494
|
-
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TTransferInfo>;
|
|
495
|
-
/**
|
|
496
|
-
* Returns the API instance used by the builder.
|
|
497
|
-
*
|
|
498
|
-
* @returns The API instance.
|
|
499
|
-
*/
|
|
500
|
-
getApi(): TApi;
|
|
501
|
-
/**
|
|
502
|
-
* Disconnects the API.
|
|
503
|
-
*
|
|
504
|
-
* @returns A Promise that resolves when the API is disconnected.
|
|
505
|
-
*/
|
|
506
|
-
disconnect(): Promise<void>;
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Creates a new Builder instance.
|
|
510
|
-
*
|
|
511
|
-
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
512
|
-
* @returns A new Builder instance.
|
|
513
|
-
*/
|
|
514
|
-
declare const Builder: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => GeneralBuilder<TApi, TRes, object>;
|
|
515
|
-
|
|
516
265
|
type TBalanceResponse = {
|
|
517
266
|
free?: string;
|
|
518
267
|
balance?: string;
|
|
@@ -633,7 +382,7 @@ type TGetMaxForeignTransferableAmountOptionsBase = {
|
|
|
633
382
|
currency: TCurrencyCore;
|
|
634
383
|
};
|
|
635
384
|
type TGetMaxForeignTransferableAmountOptions<TApi, TRes> = WithApi<TGetMaxForeignTransferableAmountOptionsBase, TApi, TRes>;
|
|
636
|
-
type TGetTransferableAmountOptionsBase<
|
|
385
|
+
type TGetTransferableAmountOptionsBase<TRes> = {
|
|
637
386
|
/**
|
|
638
387
|
* The sender address of the account.
|
|
639
388
|
*/
|
|
@@ -651,12 +400,12 @@ type TGetTransferableAmountOptionsBase<TApi, TRes> = {
|
|
|
651
400
|
*/
|
|
652
401
|
currency: WithAmount<TCurrencyCore>;
|
|
653
402
|
/**
|
|
654
|
-
* The transaction
|
|
403
|
+
* The transaction instance
|
|
655
404
|
*/
|
|
656
|
-
|
|
405
|
+
tx: TRes;
|
|
657
406
|
feeAsset?: TCurrencyInput;
|
|
658
407
|
};
|
|
659
|
-
type TGetTransferableAmountOptions<TApi, TRes> = WithApi<TGetTransferableAmountOptionsBase<
|
|
408
|
+
type TGetTransferableAmountOptions<TApi, TRes> = WithApi<TGetTransferableAmountOptionsBase<TRes>, TApi, TRes>;
|
|
660
409
|
type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
661
410
|
/**
|
|
662
411
|
* The origin chain.
|
|
@@ -829,6 +578,7 @@ type TDryRunBaseOptions<TRes> = {
|
|
|
829
578
|
currencyTo: TCurrencyCore;
|
|
830
579
|
exchangeChain: TParachain;
|
|
831
580
|
};
|
|
581
|
+
useRootOrigin?: boolean;
|
|
832
582
|
};
|
|
833
583
|
type TDryRunOptions<TApi, TRes> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes>;
|
|
834
584
|
type TDryRunCallBaseOptions<TRes> = {
|
|
@@ -1216,6 +966,257 @@ type TTypeAndThenFees = {
|
|
|
1216
966
|
destFee: bigint;
|
|
1217
967
|
};
|
|
1218
968
|
|
|
969
|
+
/**
|
|
970
|
+
* Builder class for constructing asset claim transactions.
|
|
971
|
+
*/
|
|
972
|
+
declare class AssetClaimBuilder<TApi, TRes, T extends Partial<TAssetClaimOptionsBase> = object> {
|
|
973
|
+
readonly api: IPolkadotApi<TApi, TRes>;
|
|
974
|
+
readonly _options: T;
|
|
975
|
+
constructor(api: IPolkadotApi<TApi, TRes>, options?: T);
|
|
976
|
+
/**
|
|
977
|
+
* Specifies the assets to be claimed.
|
|
978
|
+
*
|
|
979
|
+
* @param assets - An array of assets to claim in a multi-asset format.
|
|
980
|
+
* @returns An instance of Builder
|
|
981
|
+
*/
|
|
982
|
+
currency(currency: TAssetClaimOptionsBase['currency']): AssetClaimBuilder<TApi, TRes, T & {
|
|
983
|
+
currency: TAssetClaimOptionsBase['currency'];
|
|
984
|
+
}>;
|
|
985
|
+
/**
|
|
986
|
+
* Specifies the account address on which the assets will be claimed.
|
|
987
|
+
*
|
|
988
|
+
* @param address - The destination account address.
|
|
989
|
+
* @returns An instance of Builder
|
|
990
|
+
*/
|
|
991
|
+
address(address: TAddress): AssetClaimBuilder<TApi, TRes, T & {
|
|
992
|
+
address: TAddress;
|
|
993
|
+
}>;
|
|
994
|
+
/**
|
|
995
|
+
* Sets the XCM version to be used for the asset claim.
|
|
996
|
+
*
|
|
997
|
+
* @param version - The XCM version.
|
|
998
|
+
* @returns An instance of Builder
|
|
999
|
+
*/
|
|
1000
|
+
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, T & {
|
|
1001
|
+
version: Version;
|
|
1002
|
+
}>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Builds and returns the asset claim extrinsic.
|
|
1005
|
+
*
|
|
1006
|
+
* @returns A Promise that resolves to the asset claim extrinsic.
|
|
1007
|
+
*/
|
|
1008
|
+
build(this: AssetClaimBuilder<TApi, TRes, TAssetClaimOptionsBase>): Promise<TRes>;
|
|
1009
|
+
/**
|
|
1010
|
+
* Returns the API instance used by the builder.
|
|
1011
|
+
*
|
|
1012
|
+
* @returns The API instance.
|
|
1013
|
+
*/
|
|
1014
|
+
getApi(): TApi;
|
|
1015
|
+
/**
|
|
1016
|
+
* Disconnects the API.
|
|
1017
|
+
*
|
|
1018
|
+
* @returns A Promise that resolves when the API is disconnected.
|
|
1019
|
+
*/
|
|
1020
|
+
disconnect(): Promise<void>;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
declare class BatchTransactionManager<TApi, TRes> {
|
|
1024
|
+
transactionOptions: TSendOptions<TApi, TRes>[];
|
|
1025
|
+
addTransaction(options: TSendOptions<TApi, TRes>): void;
|
|
1026
|
+
isEmpty(): boolean;
|
|
1027
|
+
buildBatch(api: IPolkadotApi<TApi, TRes>, from: TSubstrateChain, options?: TBatchOptions): Promise<TRes>;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
1032
|
+
*/
|
|
1033
|
+
declare class GeneralBuilder<TApi, TRes, T extends Partial<TSendBaseOptions> = object> {
|
|
1034
|
+
readonly batchManager: BatchTransactionManager<TApi, TRes>;
|
|
1035
|
+
readonly api: IPolkadotApi<TApi, TRes>;
|
|
1036
|
+
readonly _options: T;
|
|
1037
|
+
constructor(api: IPolkadotApi<TApi, TRes>, batchManager: BatchTransactionManager<TApi, TRes>, options?: T);
|
|
1038
|
+
/**
|
|
1039
|
+
* Specifies the origin chain for the transaction.
|
|
1040
|
+
*
|
|
1041
|
+
* @param chain - The chain from which the transaction originates.
|
|
1042
|
+
* @returns An instance of Builder
|
|
1043
|
+
*/
|
|
1044
|
+
from(chain: TSubstrateChain): GeneralBuilder<TApi, TRes, T & {
|
|
1045
|
+
from: TSubstrateChain;
|
|
1046
|
+
}>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Specifies the destination chain for the transaction.
|
|
1049
|
+
*
|
|
1050
|
+
* @param chain - The chain to which the transaction is sent.
|
|
1051
|
+
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
1052
|
+
* @returns An instance of Builder
|
|
1053
|
+
*/
|
|
1054
|
+
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, T & {
|
|
1055
|
+
to: TDestination;
|
|
1056
|
+
}>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Initiates the process to claim assets from a specified chain.
|
|
1059
|
+
*
|
|
1060
|
+
* @param chain - The chain from which to claim assets.
|
|
1061
|
+
* @returns An instance of Builder
|
|
1062
|
+
*/
|
|
1063
|
+
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, {
|
|
1064
|
+
chain: TSubstrateChain;
|
|
1065
|
+
}>;
|
|
1066
|
+
/**
|
|
1067
|
+
* Specifies the currency to be used in the transaction. Symbol, ID, location or multi-asset.
|
|
1068
|
+
*
|
|
1069
|
+
* @param currency - The currency to be transferred.
|
|
1070
|
+
* @returns An instance of Builder
|
|
1071
|
+
*/
|
|
1072
|
+
currency(currency: TCurrencyInputWithAmount): GeneralBuilder<TApi, TRes, T & {
|
|
1073
|
+
currency: TCurrencyInputWithAmount;
|
|
1074
|
+
}>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Sets the recipient address.
|
|
1077
|
+
*
|
|
1078
|
+
* @param address - The destination address.
|
|
1079
|
+
* @returns An instance of Builder
|
|
1080
|
+
*/
|
|
1081
|
+
address(address: TAddress): GeneralBuilder<TApi, TRes, T & {
|
|
1082
|
+
address: TAddress;
|
|
1083
|
+
}>;
|
|
1084
|
+
/**
|
|
1085
|
+
* Sets the sender address.
|
|
1086
|
+
*
|
|
1087
|
+
* @param address - The sender address.
|
|
1088
|
+
* @returns
|
|
1089
|
+
*/
|
|
1090
|
+
senderAddress(address: string): GeneralBuilder<TApi, TRes, T & {
|
|
1091
|
+
senderAddress: string;
|
|
1092
|
+
}>;
|
|
1093
|
+
/**
|
|
1094
|
+
* Sets the asset hub address. This is used for transfers that go through the Asset Hub and originate from an EVM chain.
|
|
1095
|
+
*
|
|
1096
|
+
* @param address - The address to be used.
|
|
1097
|
+
* @returns An instance of Builder
|
|
1098
|
+
*/
|
|
1099
|
+
ahAddress(address: string | undefined): GeneralBuilder<TApi, TRes, T & {
|
|
1100
|
+
ahAddress: string | undefined;
|
|
1101
|
+
}>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Sets the XCM version to be used for the transfer.
|
|
1104
|
+
*
|
|
1105
|
+
* @param version - The XCM version.
|
|
1106
|
+
* @returns An instance of Builder
|
|
1107
|
+
*/
|
|
1108
|
+
xcmVersion(version: Version): GeneralBuilder<TApi, TRes, T & {
|
|
1109
|
+
version: Version;
|
|
1110
|
+
}>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Sets a custom pallet for the transaction.
|
|
1113
|
+
*
|
|
1114
|
+
* @param palletName - The name of the custom pallet to be used.
|
|
1115
|
+
* @returns An instance of the Builder.
|
|
1116
|
+
*/
|
|
1117
|
+
customPallet(pallet: string, method: string): GeneralBuilder<TApi, TRes, T & {
|
|
1118
|
+
pallet: string;
|
|
1119
|
+
method: string;
|
|
1120
|
+
}>;
|
|
1121
|
+
/**
|
|
1122
|
+
* Optional fee asset for the transaction.
|
|
1123
|
+
*
|
|
1124
|
+
* @param currency - The currency to be used for the fee.
|
|
1125
|
+
* @returns An instance of the Builder
|
|
1126
|
+
*/
|
|
1127
|
+
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, T & {
|
|
1128
|
+
feeAsset: TCurrencyInput | undefined;
|
|
1129
|
+
}>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Adds the transfer transaction to the batch.
|
|
1132
|
+
*
|
|
1133
|
+
* @returns An instance of Builder
|
|
1134
|
+
*/
|
|
1135
|
+
addToBatch(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): GeneralBuilder<TApi, TRes, T & {
|
|
1136
|
+
from: TSubstrateChain;
|
|
1137
|
+
}>;
|
|
1138
|
+
/**
|
|
1139
|
+
* Builds and returns the batched transaction based on the configured parameters.
|
|
1140
|
+
*
|
|
1141
|
+
* @param options - (Optional) Options to customize the batch transaction.
|
|
1142
|
+
* @returns A Extrinsic representing the batched transactions.
|
|
1143
|
+
*/
|
|
1144
|
+
buildBatch(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>, options?: TBatchOptions): Promise<TRes>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Builds and returns the transfer extrinsic.
|
|
1147
|
+
*
|
|
1148
|
+
* @returns A Promise that resolves to the transfer extrinsic.
|
|
1149
|
+
*/
|
|
1150
|
+
build(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): Promise<TRes>;
|
|
1151
|
+
dryRun(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TDryRunResult>;
|
|
1152
|
+
/**
|
|
1153
|
+
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
1154
|
+
*
|
|
1155
|
+
* @returns An origin and destination fee.
|
|
1156
|
+
*/
|
|
1157
|
+
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, options?: TGetXcmFeeBuilderOptions & {
|
|
1158
|
+
disableFallback: TDisableFallback;
|
|
1159
|
+
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
1160
|
+
/**
|
|
1161
|
+
* Returns the origin XCM fee for the transfer using dryRun or paymentInfo function.
|
|
1162
|
+
*
|
|
1163
|
+
* @returns An origin fee.
|
|
1164
|
+
*/
|
|
1165
|
+
getOriginXcmFee(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TXcmFeeDetail & {
|
|
1166
|
+
forwardedXcms?: any;
|
|
1167
|
+
destParaId?: number;
|
|
1168
|
+
}>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Estimates the origin and destination XCM fee using paymentInfo function.
|
|
1171
|
+
*
|
|
1172
|
+
* @returns An origin and destination fee estimate.
|
|
1173
|
+
*/
|
|
1174
|
+
getXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateResult>;
|
|
1175
|
+
/**
|
|
1176
|
+
* Estimates the origin XCM fee using paymentInfo function.
|
|
1177
|
+
*
|
|
1178
|
+
* @returns An origin fee estimate.
|
|
1179
|
+
*/
|
|
1180
|
+
getOriginXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateDetail>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Returns the max transferable amount for the transfer
|
|
1183
|
+
*
|
|
1184
|
+
* @returns The max transferable amount.
|
|
1185
|
+
*/
|
|
1186
|
+
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<bigint>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Returns the max transferable amount for the transfer
|
|
1189
|
+
*
|
|
1190
|
+
* @returns The max transferable amount.
|
|
1191
|
+
*/
|
|
1192
|
+
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<boolean>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Returns the transfer info for the transfer
|
|
1195
|
+
*
|
|
1196
|
+
* @returns The transfer info.
|
|
1197
|
+
*/
|
|
1198
|
+
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TTransferInfo>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Returns the API instance used by the builder.
|
|
1201
|
+
*
|
|
1202
|
+
* @returns The API instance.
|
|
1203
|
+
*/
|
|
1204
|
+
getApi(): TApi;
|
|
1205
|
+
/**
|
|
1206
|
+
* Disconnects the API.
|
|
1207
|
+
*
|
|
1208
|
+
* @returns A Promise that resolves when the API is disconnected.
|
|
1209
|
+
*/
|
|
1210
|
+
disconnect(): Promise<void>;
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Creates a new Builder instance.
|
|
1214
|
+
*
|
|
1215
|
+
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
1216
|
+
* @returns A new Builder instance.
|
|
1217
|
+
*/
|
|
1218
|
+
declare const Builder: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => GeneralBuilder<TApi, TRes, object>;
|
|
1219
|
+
|
|
1219
1220
|
type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
1220
1221
|
/**
|
|
1221
1222
|
* The transaction to calculate the fee for
|
|
@@ -2034,7 +2035,7 @@ declare const getBalanceNative: <TApi, TRes>(options: TGetBalanceNativeOptions<T
|
|
|
2034
2035
|
declare const getOriginFeeDetailsInternal: <TApi, TRes>({ api, account, accountDestination, ahAddress, currency, origin, destination, feeMarginPercentage }: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
|
|
2035
2036
|
declare const getOriginFeeDetails: <TApi, TRes>(options: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
|
|
2036
2037
|
|
|
2037
|
-
declare const getTransferableAmountInternal: <TApi, TRes>({ api, senderAddress, origin: chain, destination, currency,
|
|
2038
|
+
declare const getTransferableAmountInternal: <TApi, TRes>({ api, senderAddress, origin: chain, destination, currency, tx, feeAsset }: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
2038
2039
|
declare const getTransferableAmount: <TApi, TRes>(options: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
2039
2040
|
|
|
2040
2041
|
declare const getTransferInfo: <TApi, TRes>({ api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
|