@paraspell/sdk-core 13.4.0 → 13.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1396 -1347
- package/dist/index.mjs +652 -747
- package/package.json +14 -14
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import * as _paraspell_sdk_common from '@paraspell/sdk-common';
|
|
|
2
2
|
import { TSubstrateChain, TChain, Version, TRelaychain, TParachain, TLocation, TExternalChain, TJunction, Parents, TJunctions } from '@paraspell/sdk-common';
|
|
3
3
|
export * from '@paraspell/sdk-common';
|
|
4
4
|
import * as _paraspell_assets from '@paraspell/assets';
|
|
5
|
-
import { TAssetInfo, WithAmount, TAsset,
|
|
5
|
+
import { TAssetInfo, WithAmount, TAsset, TCurrencyInputWithAmount, TCurrencyInput, TCurrencyCore, TAmount, TAssetWithFee, WithComplexAmount, TAssetInfoWithId } from '@paraspell/assets';
|
|
6
6
|
export * from '@paraspell/assets';
|
|
7
7
|
import { TPallet, TAssetsPallet } from '@paraspell/pallets';
|
|
8
8
|
export * from '@paraspell/pallets';
|
|
9
|
-
import { WalletClient, formatUnits as formatUnits$1, parseUnits as parseUnits$1 } from 'viem';
|
|
9
|
+
import { WalletClient, TransactionSerializableEIP1559, Address, formatUnits as formatUnits$1, parseUnits as parseUnits$1 } from 'viem';
|
|
10
10
|
|
|
11
11
|
type WithApi<TBase, TApi, TRes, TSigner> = TBase & {
|
|
12
12
|
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
@@ -113,7 +113,6 @@ declare abstract class Chain<TApi, TRes, TSigner> {
|
|
|
113
113
|
transferLocal(options: TTransferInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
114
114
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
115
115
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
116
|
-
protected transferToEthereum<TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, useOnlyDepositInstruction?: boolean): Promise<TRes>;
|
|
117
116
|
getBalanceNative(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
118
117
|
getCustomCurrencyId(_asset: TAssetInfo): unknown;
|
|
119
118
|
getBalanceForeign<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
@@ -150,7 +149,6 @@ declare class AssetHubKusama<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSig
|
|
|
150
149
|
|
|
151
150
|
declare class AssetHubPolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
152
151
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
153
|
-
handleEthBridgeNativeTransfer<TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
154
152
|
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
155
153
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
156
154
|
getBalanceForeign<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
@@ -405,14 +403,6 @@ declare class LaosPaseo<TApi, TRes, TSigner> extends Laos<TApi, TRes, TSigner> {
|
|
|
405
403
|
constructor();
|
|
406
404
|
}
|
|
407
405
|
|
|
408
|
-
declare class Manta<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IXTokensTransfer<TApi, TRes, TSigner> {
|
|
409
|
-
static readonly NATIVE_ASSET_ID = 1n;
|
|
410
|
-
constructor();
|
|
411
|
-
private getAssetId;
|
|
412
|
-
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner>): TRes;
|
|
413
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
406
|
declare class Moonbeam<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
417
407
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
418
408
|
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
@@ -550,7 +540,6 @@ declare const chains: <TApi, TRes, TSigner>() => {
|
|
|
550
540
|
CoretimePolkadot: CoretimePolkadot<TApi, TRes, TSigner>;
|
|
551
541
|
PeoplePolkadot: PeoplePolkadot<TApi, TRes, TSigner>;
|
|
552
542
|
RobonomicsPolkadot: RobonomicsPolkadot<TApi, TRes, TSigner>;
|
|
553
|
-
Manta: Manta<TApi, TRes, TSigner>;
|
|
554
543
|
NeuroWeb: NeuroWeb<TApi, TRes, TSigner>;
|
|
555
544
|
Pendulum: Pendulum<TApi, TRes, TSigner>;
|
|
556
545
|
Collectives: Collectives<TApi, TRes, TSigner>;
|
|
@@ -610,834 +599,114 @@ declare const TRANSACT_ORIGINS: readonly ["Native", "SovereignAccount", "Superus
|
|
|
610
599
|
*/
|
|
611
600
|
declare const EXCHANGE_CHAINS: readonly ["AssetHubPolkadot", "AssetHubKusama", "AssetHubPaseo", "AssetHubWestend", "Hydration", "Karura", "Acala", "BifrostKusama", "BifrostPolkadot"];
|
|
612
601
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
currency: TCurrencyInputWithAmount;
|
|
623
|
-
version?: Version;
|
|
624
|
-
feeAsset?: TCurrencyInput;
|
|
625
|
-
swapConfig?: TSwapConfig;
|
|
626
|
-
useRootOrigin?: boolean;
|
|
627
|
-
bypassOptions?: TBypassOptions;
|
|
628
|
-
};
|
|
629
|
-
type TDryRunOptions<TApi, TRes, TSigner> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
630
|
-
type TDryRunCallBaseOptions<TRes> = {
|
|
602
|
+
/**
|
|
603
|
+
* Builder class for constructing asset claim transactions.
|
|
604
|
+
*
|
|
605
|
+
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
606
|
+
*/
|
|
607
|
+
declare class AssetClaimBuilder<TApi, TRes, TSigner, T extends Partial<TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>> = object> {
|
|
608
|
+
readonly api: PolkadotApi<TApi, TRes, TSigner>;
|
|
609
|
+
readonly _options: T;
|
|
610
|
+
constructor(api: PolkadotApi<TApi, TRes, TSigner>, options?: T);
|
|
631
611
|
/**
|
|
632
|
-
*
|
|
612
|
+
* Specifies the assets to be claimed.
|
|
613
|
+
*
|
|
614
|
+
* @param assets - An array of assets to claim in a multi-asset format.
|
|
615
|
+
* @returns An instance of Builder
|
|
633
616
|
*/
|
|
634
|
-
|
|
617
|
+
currency(currency: TAssetClaimOptionsBase['currency']): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
618
|
+
currency: TAssetClaimOptionsBase['currency'];
|
|
619
|
+
}>;
|
|
635
620
|
/**
|
|
636
|
-
*
|
|
621
|
+
* Sets the sender address.
|
|
622
|
+
*
|
|
623
|
+
* @param address - The sender address.
|
|
624
|
+
* @returns
|
|
637
625
|
*/
|
|
638
|
-
|
|
626
|
+
sender(sender: TSender<TSigner>): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
627
|
+
sender: string;
|
|
628
|
+
}>;
|
|
639
629
|
/**
|
|
640
|
-
*
|
|
630
|
+
* Specifies the account address on which the assets will be claimed.
|
|
631
|
+
*
|
|
632
|
+
* @param address - The destination account address.
|
|
633
|
+
* @returns An instance of Builder
|
|
641
634
|
*/
|
|
642
|
-
|
|
635
|
+
address(address: TAddress): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
636
|
+
address: TAddress;
|
|
637
|
+
}>;
|
|
643
638
|
/**
|
|
644
|
-
*
|
|
639
|
+
* Sets the XCM version to be used for the asset claim.
|
|
640
|
+
*
|
|
641
|
+
* @param version - The XCM version.
|
|
642
|
+
* @returns An instance of Builder
|
|
645
643
|
*/
|
|
646
|
-
|
|
644
|
+
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
645
|
+
version: Version;
|
|
646
|
+
}>;
|
|
647
647
|
/**
|
|
648
|
-
*
|
|
648
|
+
* Builds and returns the asset claim extrinsic.
|
|
649
|
+
*
|
|
650
|
+
* @returns A Promise that resolves to the asset claim extrinsic.
|
|
649
651
|
*/
|
|
650
|
-
|
|
652
|
+
build(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase>): Promise<TRes>;
|
|
653
|
+
signAndSubmit(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
651
654
|
/**
|
|
652
|
-
*
|
|
655
|
+
* Returns the API instance used by the builder.
|
|
656
|
+
*
|
|
657
|
+
* @returns The API instance.
|
|
653
658
|
*/
|
|
654
|
-
|
|
655
|
-
asset: WithAmount<TAssetInfo>;
|
|
656
|
-
bypassOptions?: TBypassOptions;
|
|
657
|
-
feeAsset?: TAssetInfo;
|
|
658
|
-
};
|
|
659
|
-
type TDryRunBypassOptions<TApi, TRes, TSigner> = WithApi<Omit<TDryRunCallBaseOptions<TRes>, 'useRootOrigin' | 'destination'>, TApi, TRes, TSigner>;
|
|
660
|
-
type TDryRunCallOptions<TApi, TRes, TSigner> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
661
|
-
type TDryRunXcmBaseOptions<TRes> = {
|
|
662
|
-
originLocation: any;
|
|
659
|
+
getApi(): TApi;
|
|
663
660
|
/**
|
|
664
|
-
*
|
|
661
|
+
* Disconnects the API.
|
|
662
|
+
*
|
|
663
|
+
* @returns A Promise that resolves when the API is disconnected.
|
|
665
664
|
*/
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
665
|
+
disconnect(): Promise<void>;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
669
|
+
transactionOptions: TBatchedTransferOptions<TApi, TRes, TSigner>[];
|
|
670
|
+
addTransaction(options: TBatchedTransferOptions<TApi, TRes, TSigner>): void;
|
|
671
|
+
isEmpty(): boolean;
|
|
672
|
+
buildBatch(api: PolkadotApi<TApi, TRes, TSigner>, from: TSubstrateChain, options?: TBatchOptions): Promise<TRes>;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
677
|
+
*/
|
|
678
|
+
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object> {
|
|
679
|
+
readonly batchManager: BatchTransactionManager<TApi, TRes, TSigner>;
|
|
680
|
+
readonly api: PolkadotApi<TApi, TRes, TSigner>;
|
|
681
|
+
readonly _options: T;
|
|
682
|
+
constructor(api: PolkadotApi<TApi, TRes, TSigner>, batchManager: BatchTransactionManager<TApi, TRes, TSigner>, options?: T);
|
|
669
683
|
/**
|
|
670
|
-
*
|
|
684
|
+
* Specifies the origin chain for the transaction.
|
|
685
|
+
*
|
|
686
|
+
* @param chain - The chain from which the transaction originates.
|
|
687
|
+
* @returns An instance of Builder
|
|
671
688
|
*/
|
|
672
|
-
chain:
|
|
689
|
+
from(chain: TChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
690
|
+
from: TChain;
|
|
691
|
+
}>;
|
|
673
692
|
/**
|
|
674
|
-
*
|
|
693
|
+
* Specifies the destination chain for the transaction.
|
|
694
|
+
*
|
|
695
|
+
* @param chain - The chain to which the transaction is sent.
|
|
696
|
+
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
697
|
+
* @returns An instance of Builder
|
|
675
698
|
*/
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
};
|
|
688
|
-
type TDryRunChainSuccess = TDryRunResBase & {
|
|
689
|
-
success: true;
|
|
690
|
-
fee: bigint;
|
|
691
|
-
weight?: TWeight;
|
|
692
|
-
forwardedXcms: any;
|
|
693
|
-
destParaId?: number;
|
|
694
|
-
};
|
|
695
|
-
type TDryRunChainFailure = TDryRunResBase & {
|
|
696
|
-
success: false;
|
|
697
|
-
failureReason: string;
|
|
698
|
-
failureSubReason?: string;
|
|
699
|
-
};
|
|
700
|
-
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
701
|
-
type THopInfo = {
|
|
702
|
-
chain: TChain;
|
|
703
|
-
result: TDryRunChainResult;
|
|
704
|
-
};
|
|
705
|
-
type TChainEndpoint = 'origin' | 'destination' | TChain;
|
|
706
|
-
type TDryRunResult = {
|
|
707
|
-
failureReason?: string;
|
|
708
|
-
failureSubReason?: string;
|
|
709
|
-
failureChain?: TChainEndpoint;
|
|
710
|
-
origin: TDryRunChainResult;
|
|
711
|
-
destination?: TDryRunChainResult;
|
|
712
|
-
hops: THopInfo[];
|
|
713
|
-
};
|
|
714
|
-
type TResolveHopParams<TApi, TRes, TSigner> = {
|
|
715
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
716
|
-
tx: TRes;
|
|
717
|
-
originChain: TSubstrateChain;
|
|
718
|
-
currentChain: TSubstrateChain;
|
|
719
|
-
destination: TDestination;
|
|
720
|
-
asset: TAssetInfo;
|
|
721
|
-
currency: TCurrencyInputWithAmount;
|
|
722
|
-
swapConfig?: TSwapConfig;
|
|
723
|
-
hasPassedExchange: boolean;
|
|
724
|
-
};
|
|
725
|
-
type HopProcessParams<TApi, TRes, TSigner> = {
|
|
726
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
727
|
-
currentChain: TSubstrateChain;
|
|
728
|
-
currentOrigin: TSubstrateChain;
|
|
729
|
-
currentAsset: TAssetInfo;
|
|
730
|
-
forwardedXcms: any;
|
|
731
|
-
hasPassedExchange: boolean;
|
|
732
|
-
isDestination: boolean;
|
|
733
|
-
};
|
|
734
|
-
type HopTraversalConfig<TApi, TRes, TSigner, THopResult> = {
|
|
735
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
736
|
-
origin: TSubstrateChain;
|
|
737
|
-
destination: TChain;
|
|
738
|
-
currency: TCurrencyCore;
|
|
739
|
-
initialForwardedXcms: any;
|
|
740
|
-
initialDestParaId: number | undefined;
|
|
741
|
-
swapConfig?: TSwapConfig;
|
|
742
|
-
processHop: (params: HopProcessParams<TApi, TRes, TSigner>) => Promise<THopResult>;
|
|
743
|
-
shouldContinue: (hopResult: THopResult) => boolean;
|
|
744
|
-
extractNextHopData: (hopResult: THopResult) => {
|
|
745
|
-
forwardedXcms: any;
|
|
746
|
-
destParaId: number | undefined;
|
|
747
|
-
};
|
|
748
|
-
};
|
|
749
|
-
type HopTraversalResult<THopResult> = {
|
|
750
|
-
hops: Array<{
|
|
751
|
-
chain: TSubstrateChain;
|
|
752
|
-
result: THopResult;
|
|
753
|
-
}>;
|
|
754
|
-
destination?: THopResult;
|
|
755
|
-
lastProcessedChain?: TSubstrateChain;
|
|
756
|
-
};
|
|
757
|
-
type TBypassOptions = {
|
|
758
|
-
mintFeeAssets?: boolean;
|
|
759
|
-
sentAssetMintMode?: 'preview' | 'bypass';
|
|
760
|
-
};
|
|
761
|
-
declare enum XTokensError {
|
|
762
|
-
AssetHasNoReserve = "AssetHasNoReserve",
|
|
763
|
-
NotCrossChainTransfer = "NotCrossChainTransfer",
|
|
764
|
-
InvalidDest = "InvalidDest",
|
|
765
|
-
NotCrossChainTransferableCurrency = "NotCrossChainTransferableCurrency",
|
|
766
|
-
UnweighableMessage = "UnweighableMessage",
|
|
767
|
-
XcmExecutionFailed = "XcmExecutionFailed",
|
|
768
|
-
CannotReanchor = "CannotReanchor",
|
|
769
|
-
InvalidAncestry = "InvalidAncestry",
|
|
770
|
-
InvalidAsset = "InvalidAsset",
|
|
771
|
-
DestinationNotInvertible = "DestinationNotInvertible",
|
|
772
|
-
BadVersion = "BadVersion",
|
|
773
|
-
DistinctReserveForAssetAndFee = "DistinctReserveForAssetAndFee",
|
|
774
|
-
ZeroFee = "ZeroFee",
|
|
775
|
-
ZeroAmount = "ZeroAmount",
|
|
776
|
-
TooManyAssetsBeingSent = "TooManyAssetsBeingSent",
|
|
777
|
-
AssetIndexNonExistent = "AssetIndexNonExistent",
|
|
778
|
-
FeeNotEnough = "FeeNotEnough",
|
|
779
|
-
NotSupportedLocation = "NotSupportedLocation",
|
|
780
|
-
MinXcmFeeNotDefined = "MinXcmFeeNotDefined",
|
|
781
|
-
RateLimited = "RateLimited"
|
|
782
|
-
}
|
|
783
|
-
declare enum PolkadotXcmError {
|
|
784
|
-
Unreachable = "Unreachable",
|
|
785
|
-
SendFailure = "SendFailure",
|
|
786
|
-
Filtered = "Filtered",
|
|
787
|
-
UnweighableMessage = "UnweighableMessage",
|
|
788
|
-
DestinationNotInvertible = "DestinationNotInvertible",
|
|
789
|
-
Empty = "Empty",
|
|
790
|
-
CannotReanchor = "CannotReanchor",
|
|
791
|
-
TooManyAssets = "TooManyAssets",
|
|
792
|
-
InvalidOrigin = "InvalidOrigin",
|
|
793
|
-
BadVersion = "BadVersion",
|
|
794
|
-
BadLocation = "BadLocation",
|
|
795
|
-
NoSubscription = "NoSubscription",
|
|
796
|
-
AlreadySubscribed = "AlreadySubscribed",
|
|
797
|
-
CannotCheckOutTeleport = "CannotCheckOutTeleport",
|
|
798
|
-
LowBalance = "LowBalance",
|
|
799
|
-
TooManyLocks = "TooManyLocks",
|
|
800
|
-
AccountNotSovereign = "AccountNotSovereign",
|
|
801
|
-
FeesNotMet = "FeesNotMet",
|
|
802
|
-
LockNotFound = "LockNotFound",
|
|
803
|
-
InUse = "InUse",
|
|
804
|
-
REMOVED = "REMOVED",
|
|
805
|
-
InvalidAssetUnknownReserve = "InvalidAssetUnknownReserve",
|
|
806
|
-
InvalidAssetUnsupportedReserve = "InvalidAssetUnsupportedReserve",
|
|
807
|
-
TooManyReserves = "TooManyReserves",
|
|
808
|
-
LocalExecutionIncomplete = "LocalExecutionIncomplete",
|
|
809
|
-
TooManyAuthorizedAliases = "TooManyAuthorizedAliases",
|
|
810
|
-
ExpiresInPast = "ExpiresInPast",
|
|
811
|
-
AliasNotFound = "AliasNotFound",
|
|
812
|
-
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
813
|
-
}
|
|
814
|
-
declare enum PolkadotXcmExecutionError {
|
|
815
|
-
Overflow = "Overflow",
|
|
816
|
-
Unimplemented = "Unimplemented",
|
|
817
|
-
UntrustedReserveLocation = "UntrustedReserveLocation",
|
|
818
|
-
UntrustedTeleportLocation = "UntrustedTeleportLocation",
|
|
819
|
-
LocationFull = "LocationFull",
|
|
820
|
-
LocationNotInvertible = "LocationNotInvertible",
|
|
821
|
-
BadOrigin = "BadOrigin",
|
|
822
|
-
InvalidLocation = "InvalidLocation",
|
|
823
|
-
AssetNotFound = "AssetNotFound",
|
|
824
|
-
FailedToTransactAsset = "FailedToTransactAsset",
|
|
825
|
-
NotWithdrawable = "NotWithdrawable",
|
|
826
|
-
LocationCannotHold = "LocationCannotHold",
|
|
827
|
-
ExceedsMaxMessageSize = "ExceedsMaxMessageSize",
|
|
828
|
-
DestinationUnsupported = "DestinationUnsupported",
|
|
829
|
-
Transport = "Transport",
|
|
830
|
-
Unroutable = "Unroutable",
|
|
831
|
-
UnknownClaim = "UnknownClaim",
|
|
832
|
-
FailedToDecode = "FailedToDecode",
|
|
833
|
-
MaxWeightInvalid = "MaxWeightInvalid",
|
|
834
|
-
NotHoldingFees = "NotHoldingFees",
|
|
835
|
-
TooExpensive = "TooExpensive",
|
|
836
|
-
Trap = "Trap",
|
|
837
|
-
ExpectationFalse = "ExpectationFalse",
|
|
838
|
-
PalletNotFound = "PalletNotFound",
|
|
839
|
-
NameMismatch = "NameMismatch",
|
|
840
|
-
VersionIncompatible = "VersionIncompatible",
|
|
841
|
-
HoldingWouldOverflow = "HoldingWouldOverflow",
|
|
842
|
-
ExportError = "ExportError",
|
|
843
|
-
ReanchorFailed = "ReanchorFailed",
|
|
844
|
-
NoDeal = "NoDeal",
|
|
845
|
-
FeesNotMet = "FeesNotMet",
|
|
846
|
-
LockError = "LockError",
|
|
847
|
-
NoPermission = "NoPermission",
|
|
848
|
-
Unanchored = "Unanchored",
|
|
849
|
-
NotDepositable = "NotDepositable",
|
|
850
|
-
TooManyAssets = "TooManyAssets",
|
|
851
|
-
UnhandledXcmVersion = "UnhandledXcmVersion",
|
|
852
|
-
WeightLimitReached = "WeightLimitReached",
|
|
853
|
-
Barrier = "Barrier",
|
|
854
|
-
WeightNotComputable = "WeightNotComputable",
|
|
855
|
-
ExceedsStackLimit = "ExceedsStackLimit"
|
|
856
|
-
}
|
|
857
|
-
type TModuleError = {
|
|
858
|
-
index: string;
|
|
859
|
-
error: string;
|
|
860
|
-
};
|
|
861
|
-
type TDryRunError = {
|
|
862
|
-
failureReason: string;
|
|
863
|
-
failureSubReason?: string;
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
type TXcmFeeSwapConfig = TSwapConfig & {
|
|
867
|
-
amountOut: bigint;
|
|
868
|
-
};
|
|
869
|
-
type TTxFactory<TRes> = (amount?: string, relative?: boolean) => Promise<TRes>;
|
|
870
|
-
type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
871
|
-
/**
|
|
872
|
-
* The transaction factory
|
|
873
|
-
*/
|
|
874
|
-
buildTx: TTxFactory<TRes>;
|
|
875
|
-
/**
|
|
876
|
-
* The origin chain
|
|
877
|
-
*/
|
|
878
|
-
origin: TSubstrateChain;
|
|
879
|
-
/**
|
|
880
|
-
* The destination chain
|
|
881
|
-
*/
|
|
882
|
-
destination: TChain;
|
|
883
|
-
/**
|
|
884
|
-
* The sender address
|
|
885
|
-
*/
|
|
886
|
-
sender: string;
|
|
887
|
-
recipient: string;
|
|
888
|
-
currency: WithAmount<TCurrencyCore>;
|
|
889
|
-
version?: Version;
|
|
890
|
-
feeAsset?: TCurrencyInput;
|
|
891
|
-
disableFallback: TDisableFallback;
|
|
892
|
-
swapConfig?: TXcmFeeSwapConfig;
|
|
893
|
-
skipReverseFeeCalculation?: boolean;
|
|
894
|
-
};
|
|
895
|
-
type TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback extends boolean = boolean> = WithApi<TGetXcmFeeBaseOptions<TRes, TDisableFallback>, TApi, TRes, TSigner>;
|
|
896
|
-
type TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback extends boolean = boolean> = Omit<TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>, 'buildTx'> & {
|
|
897
|
-
tx: TRes;
|
|
898
|
-
useRootOrigin: boolean;
|
|
899
|
-
};
|
|
900
|
-
type TGetXcmFeeBuilderOptions = {
|
|
901
|
-
disableFallback: boolean;
|
|
902
|
-
};
|
|
903
|
-
type TGetOriginXcmFeeBaseOptions<TRes> = {
|
|
904
|
-
buildTx: TTxFactory<TRes>;
|
|
905
|
-
origin: TSubstrateChain;
|
|
906
|
-
destination: TChain;
|
|
907
|
-
sender: string;
|
|
908
|
-
currency: WithAmount<TCurrencyCore>;
|
|
909
|
-
version?: Version;
|
|
910
|
-
feeAsset?: TCurrencyInput;
|
|
911
|
-
disableFallback: boolean;
|
|
912
|
-
useRootOrigin?: boolean;
|
|
913
|
-
};
|
|
914
|
-
type TGetOriginXcmFeeOptions<TApi, TRes, TSigner> = WithApi<TGetOriginXcmFeeBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
915
|
-
type TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner> = Omit<TGetOriginXcmFeeOptions<TApi, TRes, TSigner>, 'buildTx'> & {
|
|
916
|
-
tx: TRes;
|
|
917
|
-
};
|
|
918
|
-
type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
919
|
-
prevChain: TSubstrateChain;
|
|
920
|
-
origin: TSubstrateChain;
|
|
921
|
-
destination: TChain;
|
|
922
|
-
sender: string;
|
|
923
|
-
recipient: string;
|
|
924
|
-
currency: WithAmount<TCurrencyCore>;
|
|
925
|
-
forwardedXcms: any;
|
|
926
|
-
tx: TRes;
|
|
927
|
-
asset: TAssetInfo;
|
|
928
|
-
version: Version;
|
|
929
|
-
originFee: bigint;
|
|
930
|
-
feeAsset?: TCurrencyInput;
|
|
931
|
-
disableFallback: boolean;
|
|
932
|
-
hasPassedExchange?: boolean;
|
|
933
|
-
swapConfig?: TXcmFeeSwapConfig;
|
|
934
|
-
skipReverseFeeCalculation?: boolean;
|
|
935
|
-
};
|
|
936
|
-
type TGetFeeForDestChainOptions<TApi, TRes, TSigner> = WithApi<TGetFeeForDestChainBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
937
|
-
type TGetReverseTxFeeOptions<TApi, TRes, TSigner> = Omit<TGetFeeForDestChainOptions<TApi, TRes, TSigner>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevChain' | 'version'> & {
|
|
938
|
-
destination: TSubstrateChain;
|
|
939
|
-
};
|
|
940
|
-
type TFeeType = 'dryRun' | 'paymentInfo' | 'noFeeRequired';
|
|
941
|
-
type TXcmFeeBase$1 = {
|
|
942
|
-
asset: TAssetInfo;
|
|
943
|
-
weight?: TWeight;
|
|
944
|
-
sufficient?: boolean;
|
|
945
|
-
isExchange?: boolean;
|
|
946
|
-
};
|
|
947
|
-
type TXcmFeeDetailSuccess = TXcmFeeBase$1 & {
|
|
948
|
-
fee: bigint;
|
|
949
|
-
feeType: TFeeType;
|
|
950
|
-
dryRunError?: string;
|
|
951
|
-
dryRunSubError?: string;
|
|
952
|
-
};
|
|
953
|
-
type TXcmFeeDetailWithFallback = TXcmFeeDetailSuccess;
|
|
954
|
-
type TXcmFeeDetailError = TXcmFeeBase$1 & {
|
|
955
|
-
fee?: bigint;
|
|
956
|
-
feeType?: TFeeType;
|
|
957
|
-
dryRunError: string;
|
|
958
|
-
dryRunSubError?: string;
|
|
959
|
-
};
|
|
960
|
-
type TXcmFeeDetail = TXcmFeeDetailSuccess | TXcmFeeDetailError;
|
|
961
|
-
type TXcmFeeHopResult = {
|
|
962
|
-
fee?: bigint;
|
|
963
|
-
feeType?: TFeeType;
|
|
964
|
-
sufficient?: boolean;
|
|
965
|
-
dryRunError?: string;
|
|
966
|
-
dryRunSubError?: string;
|
|
967
|
-
forwardedXcms?: any;
|
|
968
|
-
destParaId?: number;
|
|
969
|
-
asset: TAssetInfo;
|
|
970
|
-
};
|
|
971
|
-
type TConditionalXcmFeeDetail<TDisableFallback extends boolean> = TDisableFallback extends false ? TXcmFeeDetailWithFallback : TXcmFeeDetail;
|
|
972
|
-
type TDestXcmFeeDetail<TDisableFallback extends boolean> = TConditionalXcmFeeDetail<TDisableFallback> & {
|
|
973
|
-
forwardedXcms?: any;
|
|
974
|
-
destParaId?: number;
|
|
975
|
-
};
|
|
976
|
-
type TConditionalXcmFeeHopInfo<TDisableFallback extends boolean> = {
|
|
977
|
-
chain: TChain;
|
|
978
|
-
result: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
979
|
-
};
|
|
980
|
-
type TXcmFeeHopInfo = {
|
|
981
|
-
chain: TChain;
|
|
982
|
-
result: TXcmFeeDetail;
|
|
983
|
-
};
|
|
984
|
-
type TGetXcmFeeResult<TDisableFallback extends boolean = boolean> = {
|
|
985
|
-
failureReason?: string;
|
|
986
|
-
failureChain?: TChainEndpoint;
|
|
987
|
-
origin: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
988
|
-
destination: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
989
|
-
hops: TConditionalXcmFeeHopInfo<TDisableFallback>[];
|
|
990
|
-
};
|
|
991
|
-
type TPaymentInfo = {
|
|
992
|
-
partialFee: bigint;
|
|
993
|
-
weight: TWeight;
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
type TExchangeChain = (typeof EXCHANGE_CHAINS)[number];
|
|
997
|
-
type TExchangeInput = TExchangeChain | TExchangeChain[] | undefined;
|
|
998
|
-
type TSwapOptions<TApi, TRes, TSigner> = {
|
|
999
|
-
currencyTo: TCurrencyCore;
|
|
1000
|
-
exchange?: TExchangeInput;
|
|
1001
|
-
slippage?: number;
|
|
1002
|
-
evmSenderAddress?: string;
|
|
1003
|
-
evmSigner?: TSigner;
|
|
1004
|
-
onStatusChange?: TStatusChangeCallback<TApi, TRes>;
|
|
1005
|
-
};
|
|
1006
|
-
type TTransactionContext<TApi, TRes> = {
|
|
1007
|
-
type: TTransactionType;
|
|
1008
|
-
api: TApi;
|
|
1009
|
-
chain: TSubstrateChain;
|
|
1010
|
-
tx: TRes;
|
|
1011
|
-
};
|
|
1012
|
-
type TTransactionType = 'TRANSFER' | 'SWAP' | 'SWAP_AND_TRANSFER';
|
|
1013
|
-
type TSwapEventType = TTransactionType | 'SELECTING_EXCHANGE' | 'COMPLETED';
|
|
1014
|
-
/**
|
|
1015
|
-
* The transaction progress information.
|
|
1016
|
-
*/
|
|
1017
|
-
type TSwapEvent<TApi, TRes> = {
|
|
1018
|
-
/**
|
|
1019
|
-
* Current execution phase type
|
|
1020
|
-
*/
|
|
1021
|
-
type: TSwapEventType;
|
|
1022
|
-
/**
|
|
1023
|
-
* Full transaction plan for visualization
|
|
1024
|
-
*/
|
|
1025
|
-
routerPlan?: TTransactionContext<TApi, TRes>[];
|
|
1026
|
-
/**
|
|
1027
|
-
* Current transaction's origin chain
|
|
1028
|
-
*/
|
|
1029
|
-
chain?: TSubstrateChain;
|
|
1030
|
-
/**
|
|
1031
|
-
* Current transaction's destination chain
|
|
1032
|
-
*/
|
|
1033
|
-
destinationChain?: TChain;
|
|
1034
|
-
/**
|
|
1035
|
-
* 0-based step index of current operation
|
|
1036
|
-
*/
|
|
1037
|
-
currentStep?: number;
|
|
1038
|
-
};
|
|
1039
|
-
type TStatusChangeCallback<TApi, TRes> = (info: TSwapEvent<TApi, TRes>) => void;
|
|
1040
|
-
interface TSwapBuilder<TApi, TRes, TSigner> {
|
|
1041
|
-
from(chain: TSubstrateChain | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1042
|
-
to(chain: TChain | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1043
|
-
exchange(chain: TExchangeInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1044
|
-
currencyFrom(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1045
|
-
currencyTo(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1046
|
-
feeAsset(currency: TCurrencyInput | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1047
|
-
amount(amount: TAmount): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1048
|
-
recipient(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1049
|
-
sender(address: string): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1050
|
-
signer(signer: TSigner): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1051
|
-
evmSenderAddress(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1052
|
-
evmSigner(signer: TSigner | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1053
|
-
slippagePct(pct: string): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1054
|
-
onStatusChange(callback: TStatusChangeCallback<TApi, TRes>): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1055
|
-
getXcmFees<TDisableFallback extends boolean = false>(options?: TGetXcmFeeBuilderOptions & {
|
|
1056
|
-
disableFallback: TDisableFallback;
|
|
1057
|
-
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
1058
|
-
getTransferableAmount(): Promise<bigint>;
|
|
1059
|
-
getMinTransferableAmount(): Promise<bigint>;
|
|
1060
|
-
getBestAmountOut(): Promise<{
|
|
1061
|
-
exchange: TExchangeChain;
|
|
1062
|
-
amountOut: bigint;
|
|
1063
|
-
}>;
|
|
1064
|
-
dryRun(): Promise<TDryRunResult>;
|
|
1065
|
-
build(): Promise<TTransactionContext<TApi, TRes>[]>;
|
|
1066
|
-
signAndSubmit(): Promise<string[]>;
|
|
1067
|
-
}
|
|
1068
|
-
type TSwapBuilderFactory = <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>) => TSwapBuilder<TApi, TRes, TSigner>;
|
|
1069
|
-
|
|
1070
|
-
type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
1071
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1072
|
-
chain: TSubstrateChain;
|
|
1073
|
-
beneficiaryLocation: TLocation;
|
|
1074
|
-
recipient: TAddress;
|
|
1075
|
-
asset: TAsset;
|
|
1076
|
-
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
1077
|
-
scenario: TScenario;
|
|
1078
|
-
assetInfo: WithAmount<TAssetInfo>;
|
|
1079
|
-
currency: TCurrencyInputWithAmount;
|
|
1080
|
-
feeAssetInfo?: TAssetInfo;
|
|
1081
|
-
feeCurrency?: TCurrencyInput;
|
|
1082
|
-
destination: TDestination;
|
|
1083
|
-
destChain?: TChain;
|
|
1084
|
-
paraIdTo?: number;
|
|
1085
|
-
version: Version;
|
|
1086
|
-
sender?: string;
|
|
1087
|
-
ahAddress?: string;
|
|
1088
|
-
pallet?: string;
|
|
1089
|
-
method?: string;
|
|
1090
|
-
transactOptions?: TTransactOptions<TRes>;
|
|
1091
|
-
};
|
|
1092
|
-
type TXTokensTransferOptions<TApi, TRes, TSigner> = {
|
|
1093
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1094
|
-
asset: WithAmount<TAssetInfo>;
|
|
1095
|
-
recipient: TAddress;
|
|
1096
|
-
scenario: TScenario;
|
|
1097
|
-
origin: TSubstrateChain;
|
|
1098
|
-
destination: TDestination;
|
|
1099
|
-
paraIdTo?: number;
|
|
1100
|
-
version: Version;
|
|
1101
|
-
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
1102
|
-
pallet?: string;
|
|
1103
|
-
method?: string;
|
|
1104
|
-
useMultiAssetTransfer?: boolean;
|
|
1105
|
-
};
|
|
1106
|
-
interface IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
1107
|
-
transferPolkadotXCM: (input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
1108
|
-
}
|
|
1109
|
-
interface IXTokensTransfer<TApi, TRes, TSigner> {
|
|
1110
|
-
transferXTokens: (input: TXTokensTransferOptions<TApi, TRes, TSigner>) => TRes;
|
|
1111
|
-
}
|
|
1112
|
-
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
1113
|
-
type TAddress = string | TLocation;
|
|
1114
|
-
type TDestination = TChain | TLocation;
|
|
1115
|
-
type TTransferBaseOptions<TApi, TRes, TSigner> = {
|
|
1116
|
-
/**
|
|
1117
|
-
* The origin chain
|
|
1118
|
-
*/
|
|
1119
|
-
from: TChain;
|
|
1120
|
-
/**
|
|
1121
|
-
* The destination address. A SS58 or H160 format.
|
|
1122
|
-
*/
|
|
1123
|
-
recipient: TAddress;
|
|
1124
|
-
/**
|
|
1125
|
-
* The optional sender address. A SS58 or H160 format.
|
|
1126
|
-
*/
|
|
1127
|
-
sender?: string;
|
|
1128
|
-
/**
|
|
1129
|
-
* The optional asset hub address. A SS58 format only.
|
|
1130
|
-
*/
|
|
1131
|
-
ahAddress?: string;
|
|
1132
|
-
/**
|
|
1133
|
-
* The destination chain or XCM location
|
|
1134
|
-
*/
|
|
1135
|
-
to: TDestination;
|
|
1136
|
-
/**
|
|
1137
|
-
* The currency to transfer. Either ID, symbol, location, or multi-asset
|
|
1138
|
-
*/
|
|
1139
|
-
currency: TCurrencyInputWithAmount;
|
|
1140
|
-
/**
|
|
1141
|
-
* The optional fee asset. Either ID, symbol, or location
|
|
1142
|
-
*/
|
|
1143
|
-
feeAsset?: TCurrencyInput;
|
|
1144
|
-
/**
|
|
1145
|
-
* The optional destination parachain ID
|
|
1146
|
-
*/
|
|
1147
|
-
paraIdTo?: number;
|
|
1148
|
-
/**
|
|
1149
|
-
* The optional overrided XCM version
|
|
1150
|
-
*/
|
|
1151
|
-
version?: Version;
|
|
1152
|
-
/**
|
|
1153
|
-
* The optional pallet override
|
|
1154
|
-
*/
|
|
1155
|
-
pallet?: string;
|
|
1156
|
-
/**
|
|
1157
|
-
* Whether to keep the account alive after the transfer.
|
|
1158
|
-
*/
|
|
1159
|
-
keepAlive?: boolean;
|
|
1160
|
-
/**
|
|
1161
|
-
* The optional pallet method override
|
|
1162
|
-
*/
|
|
1163
|
-
method?: string;
|
|
1164
|
-
/**
|
|
1165
|
-
* Hex of the encoded transaction call to apply on the destination chain
|
|
1166
|
-
*/
|
|
1167
|
-
transactOptions?: TTransactOptions<TRes>;
|
|
1168
|
-
/**
|
|
1169
|
-
* The optional swap options
|
|
1170
|
-
*/
|
|
1171
|
-
swapOptions?: TSwapOptions<TApi, TRes, TSigner>;
|
|
1172
|
-
};
|
|
1173
|
-
/**
|
|
1174
|
-
* Options for transferring from a parachain to another parachain or relay chain
|
|
1175
|
-
*/
|
|
1176
|
-
type TTransferOptions<TApi, TRes, TSigner> = WithApi<TTransferBaseOptions<TApi, TRes, TSigner>, TApi, TRes, TSigner> & {
|
|
1177
|
-
isAmountAll: boolean;
|
|
1178
|
-
};
|
|
1179
|
-
type TSubstrateTransferBaseOptions<TApi, TRes, TSigner> = Omit<TTransferBaseOptions<TApi, TRes, TSigner>, 'from'> & {
|
|
1180
|
-
from: TSubstrateChain;
|
|
1181
|
-
};
|
|
1182
|
-
type TSubstrateTransferOptions<TApi, TRes, TSigner> = Omit<TTransferOptions<TApi, TRes, TSigner>, 'from'> & {
|
|
1183
|
-
from: TSubstrateChain;
|
|
1184
|
-
};
|
|
1185
|
-
type WithRequiredSender<TBase> = Omit<TBase, 'sender'> & {
|
|
1186
|
-
/**
|
|
1187
|
-
* The sender address. A SS58 or H160 format.
|
|
1188
|
-
*/
|
|
1189
|
-
sender: string;
|
|
1190
|
-
};
|
|
1191
|
-
type WithRequiredSwapOptions<TBase, TApi, TRes, TSigner> = Omit<TBase, 'swapOptions'> & {
|
|
1192
|
-
swapOptions: TSwapOptions<TApi, TRes, TSigner>;
|
|
1193
|
-
};
|
|
1194
|
-
type TTransferOptionsWithSwap<TApi, TRes, TSigner> = WithRequiredSwapOptions<Omit<TSubstrateTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'>, TApi, TRes, TSigner>;
|
|
1195
|
-
type TTransferBaseOptionsWithSwap<TApi, TRes, TSigner> = WithRequiredSwapOptions<TTransferBaseOptions<TApi, TRes, TSigner>, TApi, TRes, TSigner>;
|
|
1196
|
-
type TTransferBaseOptionsWithSender<TApi, TRes, TSigner> = WithRequiredSender<TTransferBaseOptions<TApi, TRes, TSigner>>;
|
|
1197
|
-
type TSubstrateTransferBaseOptionsWithSender<TApi, TRes, TSigner> = WithRequiredSender<TSubstrateTransferBaseOptions<TApi, TRes, TSigner>>;
|
|
1198
|
-
type TTransferInternalOptions<TApi, TRes, TSigner> = Omit<TTransferBaseOptions<TApi, TRes, TSigner>, 'from' | 'feeAsset' | 'version'> & {
|
|
1199
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1200
|
-
assetInfo: WithAmount<TAssetInfo>;
|
|
1201
|
-
feeAsset?: TAssetInfo;
|
|
1202
|
-
feeCurrency?: TCurrencyInput;
|
|
1203
|
-
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
1204
|
-
version: Version;
|
|
1205
|
-
isAmountAll: boolean;
|
|
1206
|
-
};
|
|
1207
|
-
type TTransactOrigin = (typeof TRANSACT_ORIGINS)[number];
|
|
1208
|
-
type TTransactOptions<TRes, TWeightType = bigint> = {
|
|
1209
|
-
call: string | TRes;
|
|
1210
|
-
originKind?: TTransactOrigin;
|
|
1211
|
-
maxWeight?: TWeight<TWeightType>;
|
|
1212
|
-
};
|
|
1213
|
-
type TSerializedExtrinsics = {
|
|
1214
|
-
module: TPallet;
|
|
1215
|
-
method: string;
|
|
1216
|
-
params: Record<string, unknown>;
|
|
1217
|
-
};
|
|
1218
|
-
type TSerializedStateQuery = {
|
|
1219
|
-
module: TAssetsPallet;
|
|
1220
|
-
method: string;
|
|
1221
|
-
params: unknown[];
|
|
1222
|
-
};
|
|
1223
|
-
type TSerializedRuntimeApiQuery = {
|
|
1224
|
-
module: string;
|
|
1225
|
-
method: string;
|
|
1226
|
-
params: unknown[];
|
|
1227
|
-
};
|
|
1228
|
-
type TDestWeight = {
|
|
1229
|
-
ref_time: bigint;
|
|
1230
|
-
proof_size: bigint;
|
|
1231
|
-
};
|
|
1232
|
-
type TXTokensMethod = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
1233
|
-
type TPolkadotXcmMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
1234
|
-
type TXcmPalletMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
1235
|
-
type TWeight<TWeightType = bigint> = {
|
|
1236
|
-
refTime: TWeightType;
|
|
1237
|
-
proofSize: TWeightType;
|
|
1238
|
-
};
|
|
1239
|
-
type TCreateBeneficiaryOptions<TApi, TRes, TSigner> = {
|
|
1240
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1241
|
-
address: TAddress;
|
|
1242
|
-
version: Version;
|
|
1243
|
-
};
|
|
1244
|
-
type TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner> = {
|
|
1245
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1246
|
-
origin: TSubstrateChain;
|
|
1247
|
-
destination: TDestination;
|
|
1248
|
-
recipient: TAddress;
|
|
1249
|
-
version: Version;
|
|
1250
|
-
paraId?: number;
|
|
1251
|
-
};
|
|
1252
|
-
type TBridgeStatus = 'Normal' | 'Halted';
|
|
1253
|
-
type TTransferLocalOptions<TApi, TRes, TSigner> = Omit<TTransferInternalOptions<TApi, TRes, TSigner>, 'recipient'> & {
|
|
1254
|
-
recipient: string;
|
|
1255
|
-
balance: bigint;
|
|
1256
|
-
};
|
|
1257
|
-
type TTransferFeeEstimates = {
|
|
1258
|
-
originFee: bigint;
|
|
1259
|
-
reserveFee: bigint;
|
|
1260
|
-
};
|
|
1261
|
-
type TCreateBaseTransferXcmOptions<TRes> = {
|
|
1262
|
-
chain: TSubstrateChain;
|
|
1263
|
-
destChain: TChain;
|
|
1264
|
-
assetInfo: WithAmount<TAssetInfo>;
|
|
1265
|
-
feeAssetInfo?: TAssetInfo;
|
|
1266
|
-
fees: TTransferFeeEstimates;
|
|
1267
|
-
recipient: string;
|
|
1268
|
-
sender?: string;
|
|
1269
|
-
version: Version;
|
|
1270
|
-
useJitWithdraw?: boolean;
|
|
1271
|
-
useFeeAssetOnHops?: boolean;
|
|
1272
|
-
paraIdTo?: number;
|
|
1273
|
-
transactOptions?: TTransactOptions<TRes>;
|
|
1274
|
-
};
|
|
1275
|
-
type TCreateTransferXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseTransferXcmOptions<TRes>, TApi, TRes, TSigner>;
|
|
1276
|
-
type TCreateBaseSwapXcmOptions = {
|
|
1277
|
-
chain?: TSubstrateChain;
|
|
1278
|
-
exchangeChain: TExchangeChain;
|
|
1279
|
-
destChain?: TChain;
|
|
1280
|
-
assetInfoFrom: WithAmount<TAssetInfo>;
|
|
1281
|
-
assetInfoTo: WithAmount<TAssetInfo>;
|
|
1282
|
-
currencyTo: TCurrencyInput;
|
|
1283
|
-
feeAssetInfo?: TAssetInfo;
|
|
1284
|
-
sender: string;
|
|
1285
|
-
recipient: string;
|
|
1286
|
-
calculateMinAmountOut: (amountIn: bigint, assetTo?: TAssetInfo) => Promise<bigint>;
|
|
1287
|
-
};
|
|
1288
|
-
type TCreateSwapXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes, TSigner>;
|
|
1289
|
-
type TSwapFeeEstimates = {
|
|
1290
|
-
originFee: bigint;
|
|
1291
|
-
originReserveFee: bigint;
|
|
1292
|
-
exchangeFee: bigint;
|
|
1293
|
-
destReserveFee: bigint;
|
|
1294
|
-
};
|
|
1295
|
-
type TCreateSwapXcmInternalOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes, TSigner> & {
|
|
1296
|
-
version: Version;
|
|
1297
|
-
fees: TSwapFeeEstimates;
|
|
1298
|
-
paraIdTo?: number;
|
|
1299
|
-
};
|
|
1300
|
-
type TCreateEthBridgeInstructionsOptions<TApi, TRes, TSigner> = {
|
|
1301
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1302
|
-
recipient: TAddress;
|
|
1303
|
-
assetInfo: TAssetInfo;
|
|
1304
|
-
sender: string;
|
|
1305
|
-
ahAddress?: string;
|
|
1306
|
-
version: Version;
|
|
1307
|
-
};
|
|
1308
|
-
|
|
1309
|
-
/** @deprecated Asset claim functionality is deprecated and will be removed in v14. */
|
|
1310
|
-
type TAssetClaimOptionsBase = {
|
|
1311
|
-
chain: TSubstrateChain;
|
|
1312
|
-
currency: WithComplexAmount<TCurrencyCore> | TAsset<TAmount>[] | WithComplexAmount<TCurrencyCore>[];
|
|
1313
|
-
address: TAddress;
|
|
1314
|
-
version?: Version;
|
|
1315
|
-
};
|
|
1316
|
-
type TAssetClaimOptions<TApi, TRes, TSigner> = WithApi<TAssetClaimOptionsBase, TApi, TRes, TSigner>;
|
|
1317
|
-
type TAssetClaimInternalOptions<TApi, TRes, TSigner> = TAssetClaimOptions<TApi, TRes, TSigner> & {
|
|
1318
|
-
version: Version;
|
|
1319
|
-
assets: TAsset<bigint>[];
|
|
1320
|
-
};
|
|
1321
|
-
|
|
1322
|
-
type TSetBalanceRes = {
|
|
1323
|
-
assetStatusTx?: TSerializedExtrinsics;
|
|
1324
|
-
balanceTx: TSerializedExtrinsics;
|
|
1325
|
-
};
|
|
1326
|
-
declare abstract class BaseAssetsPallet {
|
|
1327
|
-
protected palletName: TAssetsPallet;
|
|
1328
|
-
constructor(palletName: TAssetsPallet);
|
|
1329
|
-
abstract mint<TApi, TRes, TSigner>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain, api: PolkadotApi<TApi, TRes, TSigner>): Promise<TSetBalanceRes>;
|
|
1330
|
-
abstract getBalance<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
/**
|
|
1334
|
-
* Builder class for constructing asset claim transactions.
|
|
1335
|
-
*
|
|
1336
|
-
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
1337
|
-
*/
|
|
1338
|
-
declare class AssetClaimBuilder<TApi, TRes, TSigner, T extends Partial<TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>> = object> {
|
|
1339
|
-
readonly api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1340
|
-
readonly _options: T;
|
|
1341
|
-
constructor(api: PolkadotApi<TApi, TRes, TSigner>, options?: T);
|
|
1342
|
-
/**
|
|
1343
|
-
* Specifies the assets to be claimed.
|
|
1344
|
-
*
|
|
1345
|
-
* @param assets - An array of assets to claim in a multi-asset format.
|
|
1346
|
-
* @returns An instance of Builder
|
|
1347
|
-
*/
|
|
1348
|
-
currency(currency: TAssetClaimOptionsBase['currency']): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
1349
|
-
currency: TAssetClaimOptionsBase['currency'];
|
|
1350
|
-
}>;
|
|
1351
|
-
/**
|
|
1352
|
-
* Sets the sender address.
|
|
1353
|
-
*
|
|
1354
|
-
* @param address - The sender address.
|
|
1355
|
-
* @returns
|
|
1356
|
-
*/
|
|
1357
|
-
sender(sender: TSender<TSigner>): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
1358
|
-
sender: string;
|
|
1359
|
-
}>;
|
|
1360
|
-
/**
|
|
1361
|
-
* Specifies the account address on which the assets will be claimed.
|
|
1362
|
-
*
|
|
1363
|
-
* @param address - The destination account address.
|
|
1364
|
-
* @returns An instance of Builder
|
|
1365
|
-
*/
|
|
1366
|
-
address(address: TAddress): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
1367
|
-
address: TAddress;
|
|
1368
|
-
}>;
|
|
1369
|
-
/**
|
|
1370
|
-
* Sets the XCM version to be used for the asset claim.
|
|
1371
|
-
*
|
|
1372
|
-
* @param version - The XCM version.
|
|
1373
|
-
* @returns An instance of Builder
|
|
1374
|
-
*/
|
|
1375
|
-
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
1376
|
-
version: Version;
|
|
1377
|
-
}>;
|
|
1378
|
-
/**
|
|
1379
|
-
* Builds and returns the asset claim extrinsic.
|
|
1380
|
-
*
|
|
1381
|
-
* @returns A Promise that resolves to the asset claim extrinsic.
|
|
1382
|
-
*/
|
|
1383
|
-
build(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase>): Promise<TRes>;
|
|
1384
|
-
signAndSubmit(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
1385
|
-
/**
|
|
1386
|
-
* Returns the API instance used by the builder.
|
|
1387
|
-
*
|
|
1388
|
-
* @returns The API instance.
|
|
1389
|
-
*/
|
|
1390
|
-
getApi(): TApi;
|
|
1391
|
-
/**
|
|
1392
|
-
* Disconnects the API.
|
|
1393
|
-
*
|
|
1394
|
-
* @returns A Promise that resolves when the API is disconnected.
|
|
1395
|
-
*/
|
|
1396
|
-
disconnect(): Promise<void>;
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
1400
|
-
transactionOptions: TBatchedTransferOptions<TApi, TRes, TSigner>[];
|
|
1401
|
-
addTransaction(options: TBatchedTransferOptions<TApi, TRes, TSigner>): void;
|
|
1402
|
-
isEmpty(): boolean;
|
|
1403
|
-
buildBatch(api: PolkadotApi<TApi, TRes, TSigner>, from: TSubstrateChain, options?: TBatchOptions): Promise<TRes>;
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
1408
|
-
*/
|
|
1409
|
-
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object> {
|
|
1410
|
-
readonly batchManager: BatchTransactionManager<TApi, TRes, TSigner>;
|
|
1411
|
-
readonly api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1412
|
-
readonly _options: T;
|
|
1413
|
-
constructor(api: PolkadotApi<TApi, TRes, TSigner>, batchManager: BatchTransactionManager<TApi, TRes, TSigner>, options?: T);
|
|
1414
|
-
/**
|
|
1415
|
-
* Specifies the origin chain for the transaction.
|
|
1416
|
-
*
|
|
1417
|
-
* @param chain - The chain from which the transaction originates.
|
|
1418
|
-
* @returns An instance of Builder
|
|
1419
|
-
*/
|
|
1420
|
-
from(chain: TChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1421
|
-
from: TChain;
|
|
1422
|
-
}>;
|
|
1423
|
-
/**
|
|
1424
|
-
* Specifies the destination chain for the transaction.
|
|
1425
|
-
*
|
|
1426
|
-
* @param chain - The chain to which the transaction is sent.
|
|
1427
|
-
* @param paraIdTo - (Optional) The parachain ID of the destination chain.
|
|
1428
|
-
* @returns An instance of Builder
|
|
1429
|
-
*/
|
|
1430
|
-
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1431
|
-
to: TDestination;
|
|
1432
|
-
}>;
|
|
1433
|
-
/**
|
|
1434
|
-
* Initiates the process to claim assets from a specified chain.
|
|
1435
|
-
*
|
|
1436
|
-
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
1437
|
-
* @param chain - The chain from which to claim assets.
|
|
1438
|
-
* @returns An instance of Builder
|
|
1439
|
-
*/
|
|
1440
|
-
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, TSigner, {
|
|
699
|
+
to(chain: TDestination, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
700
|
+
to: TDestination;
|
|
701
|
+
}>;
|
|
702
|
+
/**
|
|
703
|
+
* Initiates the process to claim assets from a specified chain.
|
|
704
|
+
*
|
|
705
|
+
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
706
|
+
* @param chain - The chain from which to claim assets.
|
|
707
|
+
* @returns An instance of Builder
|
|
708
|
+
*/
|
|
709
|
+
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, TSigner, {
|
|
1441
710
|
chain: TSubstrateChain;
|
|
1442
711
|
}>;
|
|
1443
712
|
/**
|
|
@@ -1506,641 +775,1388 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
1506
775
|
method: string | undefined;
|
|
1507
776
|
}>;
|
|
1508
777
|
/**
|
|
1509
|
-
* Optional fee asset for the transaction.
|
|
1510
|
-
*
|
|
1511
|
-
* @param currency - The currency to be used for the fee.
|
|
1512
|
-
* @returns An instance of the Builder
|
|
778
|
+
* Optional fee asset for the transaction.
|
|
779
|
+
*
|
|
780
|
+
* @param currency - The currency to be used for the fee.
|
|
781
|
+
* @returns An instance of the Builder
|
|
782
|
+
*/
|
|
783
|
+
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
784
|
+
feeAsset: TCurrencyInput | undefined;
|
|
785
|
+
}>;
|
|
786
|
+
/**
|
|
787
|
+
* Sets the hex of the encoded transaction call to apply on the destination chain
|
|
788
|
+
*
|
|
789
|
+
* @param hex - The encoded call hex or extrinsics.
|
|
790
|
+
* @param originKind - (Optional) The means of expressing the message origin as a dispatch origin.
|
|
791
|
+
* @param maxWeight - (Optional) The weight of the call. If not provided, the weight will be estimated.
|
|
792
|
+
* @returns An instance of the Builder.
|
|
793
|
+
*/
|
|
794
|
+
transact(call: string | TRes, originKind?: TTransactOrigin, maxWeight?: TWeight): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
795
|
+
transactOptions: {
|
|
796
|
+
call: string | TRes;
|
|
797
|
+
originKind: "Native" | "SovereignAccount" | "Superuser" | "Xcm" | undefined;
|
|
798
|
+
maxWeight: TWeight | undefined;
|
|
799
|
+
};
|
|
800
|
+
}>;
|
|
801
|
+
/**
|
|
802
|
+
* Performs a token swap as part of the transfer, using the specified exchange and destination currency.
|
|
803
|
+
*
|
|
804
|
+
* @param options - The swap options.
|
|
805
|
+
* @returns An instance of the Builder.
|
|
806
|
+
*/
|
|
807
|
+
swap(options: TSwapOptions<TApi, TRes, TSigner>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
808
|
+
swapOptions: TSwapOptions<TApi, TRes, TSigner>;
|
|
809
|
+
}>;
|
|
810
|
+
/**
|
|
811
|
+
* Adds the transfer transaction to the batch.
|
|
812
|
+
*
|
|
813
|
+
* @returns An instance of Builder
|
|
814
|
+
*/
|
|
815
|
+
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
816
|
+
from: TSubstrateChain;
|
|
817
|
+
}>;
|
|
818
|
+
/**
|
|
819
|
+
* Builds and returns the batched transaction based on the configured parameters.
|
|
820
|
+
*
|
|
821
|
+
* @param options - (Optional) Options to customize the batch transaction.
|
|
822
|
+
* @returns A Extrinsic representing the batched transactions.
|
|
823
|
+
*/
|
|
824
|
+
buildBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>, options?: TBatchOptions): Promise<TRes>;
|
|
825
|
+
protected buildInternal<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): Promise<TBuildInternalRes<TApi, TRes, TSigner, TOptions>>;
|
|
826
|
+
private prepareNormalizedOptions;
|
|
827
|
+
/**
|
|
828
|
+
* Builds and returns the transfer extrinsic.
|
|
829
|
+
*
|
|
830
|
+
* @returns A Promise that resolves to the transfer extrinsic.
|
|
831
|
+
*/
|
|
832
|
+
build(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<TRes>;
|
|
833
|
+
/**
|
|
834
|
+
* Builds an unsigned EIP-1559 transaction (viem `TransactionSerializableEIP1559`) for an
|
|
835
|
+
* EVM-compatible origin. `nonce`, `gas`, and fees are populated from the origin chain's RPC.
|
|
836
|
+
*/
|
|
837
|
+
buildEvm(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<TransactionSerializableEIP1559>;
|
|
838
|
+
/**
|
|
839
|
+
* Builds and returns multiple transfer or swap extrinsics
|
|
840
|
+
*
|
|
841
|
+
* @returns A Promise that resolves to the transfer extrinsic contexts
|
|
842
|
+
*/
|
|
843
|
+
buildAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<TTransactionContext<TApi, TRes>[]>;
|
|
844
|
+
private validateBatchState;
|
|
845
|
+
private buildCommon;
|
|
846
|
+
private buildCommonAll;
|
|
847
|
+
private maybePerformXcmFormatCheck;
|
|
848
|
+
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<TDryRunResult>;
|
|
849
|
+
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
850
|
+
protected createTxFactory<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): TTxFactory<TRes>;
|
|
851
|
+
/**
|
|
852
|
+
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
853
|
+
*
|
|
854
|
+
* @returns An origin and destination fee.
|
|
855
|
+
*/
|
|
856
|
+
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>, options?: TGetXcmFeeBuilderOptions & {
|
|
857
|
+
disableFallback: TDisableFallback;
|
|
858
|
+
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
859
|
+
/**
|
|
860
|
+
* Returns the origin XCM fee for the transfer using dryRun or paymentInfo function.
|
|
861
|
+
*
|
|
862
|
+
* @returns An origin fee.
|
|
863
|
+
*/
|
|
864
|
+
getOriginXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>, options?: TGetXcmFeeBuilderOptions & {
|
|
865
|
+
disableFallback: TDisableFallback;
|
|
866
|
+
}): Promise<TXcmFeeDetailWithForwardedXcm<TDisableFallback>>;
|
|
867
|
+
/**
|
|
868
|
+
* Returns the max transferable amount for the transfer
|
|
869
|
+
*
|
|
870
|
+
* @returns The max transferable amount.
|
|
871
|
+
*/
|
|
872
|
+
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<bigint>;
|
|
873
|
+
/**
|
|
874
|
+
* Returns the min transferable amount for the transfer
|
|
875
|
+
*
|
|
876
|
+
* @returns The min transferable amount.
|
|
877
|
+
*/
|
|
878
|
+
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<bigint>;
|
|
879
|
+
/**
|
|
880
|
+
* Returns the max transferable amount for the transfer
|
|
881
|
+
*
|
|
882
|
+
* @returns The max transferable amount.
|
|
883
|
+
*/
|
|
884
|
+
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<boolean>;
|
|
885
|
+
/**
|
|
886
|
+
* Returns the transfer info for the transfer
|
|
887
|
+
*
|
|
888
|
+
* @returns The transfer info.
|
|
889
|
+
*/
|
|
890
|
+
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<TTransferInfo>;
|
|
891
|
+
/**
|
|
892
|
+
* Returns the receivable amount on the destination after the transfer
|
|
893
|
+
*
|
|
894
|
+
* @returns The computed receivable amount.
|
|
895
|
+
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
896
|
+
*/
|
|
897
|
+
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<bigint>;
|
|
898
|
+
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSwap<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<{
|
|
899
|
+
exchange: TExchangeChain;
|
|
900
|
+
amountOut: bigint;
|
|
901
|
+
}>;
|
|
902
|
+
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
903
|
+
signAndSubmitAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<string[]>;
|
|
904
|
+
private executeWithEvmSigner;
|
|
905
|
+
private prepareEvmDispatch;
|
|
906
|
+
/**
|
|
907
|
+
* Returns the API instance used by the builder.
|
|
908
|
+
*
|
|
909
|
+
* @returns The API instance.
|
|
910
|
+
*/
|
|
911
|
+
getApi(): TApi;
|
|
912
|
+
/**
|
|
913
|
+
* Disconnects the API.
|
|
914
|
+
*
|
|
915
|
+
* @returns A Promise that resolves when the API is disconnected.
|
|
916
|
+
*/
|
|
917
|
+
disconnect(): Promise<void>;
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Creates a new Builder instance.
|
|
921
|
+
*
|
|
922
|
+
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
923
|
+
* @returns A new Builder instance.
|
|
924
|
+
*/
|
|
925
|
+
declare const Builder: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>) => GeneralBuilder<TApi, TRes, TSigner, object>;
|
|
926
|
+
|
|
927
|
+
type TEvmTransferOptionsBase = {
|
|
928
|
+
from: TChain;
|
|
929
|
+
to: TChain;
|
|
930
|
+
currency: TCurrencyInputWithAmount;
|
|
931
|
+
recipient: string;
|
|
932
|
+
ahAddress?: string;
|
|
933
|
+
};
|
|
934
|
+
type TEvmTransferOptions<TApi, TRes, TSigner> = WithApi<TEvmTransferOptionsBase & {
|
|
935
|
+
signer: WalletClient;
|
|
936
|
+
}, TApi, TRes, TSigner>;
|
|
937
|
+
type TBuildEvmTransferOptions<TApi, TRes, TSigner> = WithApi<TEvmTransferOptionsBase & {
|
|
938
|
+
sender: string;
|
|
939
|
+
}, TApi, TRes, TSigner>;
|
|
940
|
+
/**
|
|
941
|
+
* The options for the batch builder.
|
|
942
|
+
*/
|
|
943
|
+
declare enum BatchMode {
|
|
944
|
+
/**
|
|
945
|
+
* Does not commit if one of the calls in the batch fails.
|
|
946
|
+
*/
|
|
947
|
+
BATCH_ALL = "BATCH_ALL",
|
|
948
|
+
/**
|
|
949
|
+
* Commits each successful call regardless if a call fails.
|
|
950
|
+
*/
|
|
951
|
+
BATCH = "BATCH"
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* The options for the batch builder.
|
|
955
|
+
*/
|
|
956
|
+
type TBatchOptions = {
|
|
957
|
+
/**
|
|
958
|
+
* The batch mode. Can be either:
|
|
959
|
+
* `BATCH_ALL` - does not commit if one of the calls in the batch fails.
|
|
960
|
+
* `BATCH` - commits each successful call regardless if a call fails.
|
|
961
|
+
*/
|
|
962
|
+
mode: BatchMode;
|
|
963
|
+
};
|
|
964
|
+
type TDryRunPreviewOptions = {
|
|
965
|
+
mintFeeAssets?: boolean;
|
|
966
|
+
};
|
|
967
|
+
type TBuilderOptions<TApi> = TApi | TBuilderConfig<TApi>;
|
|
968
|
+
type TBuilderConfig<TApi> = Partial<{
|
|
969
|
+
apiOverrides: Partial<Record<TChain, TApi>>;
|
|
970
|
+
development: boolean;
|
|
971
|
+
abstractDecimals: boolean;
|
|
972
|
+
xcmFormatCheck: boolean;
|
|
973
|
+
}>;
|
|
974
|
+
type TCreateTxsOptions<TApi, TRes, TSigner> = Pick<TTransferOptions<TApi, TRes, TSigner>, 'api' | 'from' | 'to' | 'currency'>;
|
|
975
|
+
type TBatchedTransferOptions<TApi, TRes, TSigner> = Omit<TSubstrateTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'> & {
|
|
976
|
+
builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>;
|
|
977
|
+
};
|
|
978
|
+
type TBuildInternalResBase<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = {
|
|
979
|
+
options: TTransferOptions<TApi, TRes, TSigner> & TOptions;
|
|
980
|
+
};
|
|
981
|
+
type TBuildInternalRes<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = TBuildInternalResBase<TApi, TRes, TSigner, TOptions> & {
|
|
982
|
+
tx: TRes;
|
|
983
|
+
};
|
|
984
|
+
type TBuildAllInternalRes<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = TBuildInternalResBase<TApi, TRes, TSigner, TOptions> & {
|
|
985
|
+
txContexts: TTransactionContext<TApi, TRes>[];
|
|
986
|
+
};
|
|
987
|
+
type TSender<TSigner> = string | TSigner;
|
|
988
|
+
type TBuilderInternalOptions<TSigner> = {
|
|
989
|
+
senderSource?: TSender<TSigner> | WalletClient;
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
type TSwapConfig = {
|
|
993
|
+
currencyTo: TCurrencyCore;
|
|
994
|
+
exchangeChain: TParachain;
|
|
995
|
+
};
|
|
996
|
+
type TDryRunBaseOptions<TRes> = {
|
|
997
|
+
tx: TRes;
|
|
998
|
+
origin: TSubstrateChain;
|
|
999
|
+
destination: TChain;
|
|
1000
|
+
sender: string;
|
|
1001
|
+
currency: TCurrencyInputWithAmount;
|
|
1002
|
+
version?: Version;
|
|
1003
|
+
feeAsset?: TCurrencyInput;
|
|
1004
|
+
swapConfig?: TSwapConfig;
|
|
1005
|
+
useRootOrigin?: boolean;
|
|
1006
|
+
bypassOptions?: TBypassOptions;
|
|
1007
|
+
};
|
|
1008
|
+
type TDryRunOptions<TApi, TRes, TSigner> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1009
|
+
type TDryRunCallBaseOptions<TRes> = {
|
|
1010
|
+
/**
|
|
1011
|
+
* The transaction to dry-run
|
|
1513
1012
|
*/
|
|
1514
|
-
|
|
1515
|
-
feeAsset: TCurrencyInput | undefined;
|
|
1516
|
-
}>;
|
|
1013
|
+
tx: TRes;
|
|
1517
1014
|
/**
|
|
1518
|
-
*
|
|
1519
|
-
*
|
|
1520
|
-
* @param hex - The encoded call hex or extrinsics.
|
|
1521
|
-
* @param originKind - (Optional) The means of expressing the message origin as a dispatch origin.
|
|
1522
|
-
* @param maxWeight - (Optional) The weight of the call. If not provided, the weight will be estimated.
|
|
1523
|
-
* @returns An instance of the Builder.
|
|
1015
|
+
* The chain to dry-run on
|
|
1524
1016
|
*/
|
|
1525
|
-
|
|
1526
|
-
transactOptions: {
|
|
1527
|
-
call: string | TRes;
|
|
1528
|
-
originKind: "Native" | "SovereignAccount" | "Superuser" | "Xcm" | undefined;
|
|
1529
|
-
maxWeight: TWeight | undefined;
|
|
1530
|
-
};
|
|
1531
|
-
}>;
|
|
1017
|
+
chain: TSubstrateChain;
|
|
1532
1018
|
/**
|
|
1533
|
-
*
|
|
1534
|
-
*
|
|
1535
|
-
* @param options - The swap options.
|
|
1536
|
-
* @returns An instance of the Builder.
|
|
1019
|
+
* The destination chain
|
|
1537
1020
|
*/
|
|
1538
|
-
|
|
1539
|
-
swapOptions: TSwapOptions<TApi, TRes, TSigner>;
|
|
1540
|
-
}>;
|
|
1021
|
+
destination: TDestination;
|
|
1541
1022
|
/**
|
|
1542
|
-
*
|
|
1543
|
-
*
|
|
1544
|
-
* @returns An instance of Builder
|
|
1023
|
+
* The address to dry-run with
|
|
1545
1024
|
*/
|
|
1546
|
-
|
|
1547
|
-
from: TSubstrateChain;
|
|
1548
|
-
}>;
|
|
1025
|
+
address: string;
|
|
1549
1026
|
/**
|
|
1550
|
-
*
|
|
1551
|
-
*
|
|
1552
|
-
* @param options - (Optional) Options to customize the batch transaction.
|
|
1553
|
-
* @returns A Extrinsic representing the batched transactions.
|
|
1027
|
+
* Whether to use the root origin
|
|
1554
1028
|
*/
|
|
1555
|
-
|
|
1556
|
-
protected buildInternal<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): Promise<TBuildInternalRes<TApi, TRes, TSigner, TOptions>>;
|
|
1557
|
-
private prepareNormalizedOptions;
|
|
1029
|
+
useRootOrigin?: boolean;
|
|
1558
1030
|
/**
|
|
1559
|
-
*
|
|
1560
|
-
*
|
|
1561
|
-
* @returns A Promise that resolves to the transfer extrinsic.
|
|
1031
|
+
* XCM version to use for the dry-run parameters
|
|
1562
1032
|
*/
|
|
1563
|
-
|
|
1033
|
+
version: Version;
|
|
1034
|
+
asset: WithAmount<TAssetInfo>;
|
|
1035
|
+
bypassOptions?: TBypassOptions;
|
|
1036
|
+
feeAsset?: TAssetInfo;
|
|
1037
|
+
};
|
|
1038
|
+
type TDryRunBypassOptions<TApi, TRes, TSigner> = WithApi<Omit<TDryRunCallBaseOptions<TRes>, 'useRootOrigin' | 'destination'>, TApi, TRes, TSigner>;
|
|
1039
|
+
type TDryRunCallOptions<TApi, TRes, TSigner> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1040
|
+
type TDryRunXcmBaseOptions<TRes> = {
|
|
1041
|
+
originLocation: any;
|
|
1564
1042
|
/**
|
|
1565
|
-
*
|
|
1566
|
-
*
|
|
1567
|
-
* @returns A Promise that resolves to the transfer extrinsic contexts
|
|
1043
|
+
* The XCM instructions
|
|
1568
1044
|
*/
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
private buildCommonAll;
|
|
1573
|
-
private maybePerformXcmFormatCheck;
|
|
1574
|
-
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<TDryRunResult>;
|
|
1575
|
-
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
1576
|
-
protected createTxFactory<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): TTxFactory<TRes>;
|
|
1045
|
+
xcm: any;
|
|
1046
|
+
/** The transaction to dry-run */
|
|
1047
|
+
tx: TRes;
|
|
1577
1048
|
/**
|
|
1578
|
-
*
|
|
1579
|
-
*
|
|
1580
|
-
* @returns An origin and destination fee.
|
|
1049
|
+
* The chain to dry-run on
|
|
1581
1050
|
*/
|
|
1582
|
-
|
|
1583
|
-
disableFallback: TDisableFallback;
|
|
1584
|
-
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
1051
|
+
chain: TSubstrateChain;
|
|
1585
1052
|
/**
|
|
1586
|
-
*
|
|
1587
|
-
*
|
|
1588
|
-
* @returns An origin fee.
|
|
1053
|
+
* The origin chain
|
|
1589
1054
|
*/
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1055
|
+
origin: TSubstrateChain;
|
|
1056
|
+
asset: TAssetInfo;
|
|
1057
|
+
version: Version;
|
|
1058
|
+
feeAsset?: TAssetInfo;
|
|
1059
|
+
amount: bigint;
|
|
1060
|
+
originFee: bigint;
|
|
1061
|
+
};
|
|
1062
|
+
type TDryRunXcmOptions<TApi, TRes, TSigner> = WithApi<TDryRunXcmBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1063
|
+
type TDryRunResBase = {
|
|
1064
|
+
asset: TAssetInfo;
|
|
1065
|
+
isExchange?: boolean;
|
|
1066
|
+
};
|
|
1067
|
+
type TDryRunChainSuccess = TDryRunResBase & {
|
|
1068
|
+
success: true;
|
|
1069
|
+
fee: bigint;
|
|
1070
|
+
weight?: TWeight;
|
|
1071
|
+
forwardedXcms: any;
|
|
1072
|
+
destParaId?: number;
|
|
1073
|
+
};
|
|
1074
|
+
type TDryRunChainFailure = TDryRunResBase & {
|
|
1075
|
+
success: false;
|
|
1076
|
+
failureReason: string;
|
|
1077
|
+
failureSubReason?: string;
|
|
1078
|
+
};
|
|
1079
|
+
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
1080
|
+
type THopInfo = {
|
|
1081
|
+
chain: TChain;
|
|
1082
|
+
result: TDryRunChainResult;
|
|
1083
|
+
};
|
|
1084
|
+
type TChainEndpoint = 'origin' | 'destination' | TChain;
|
|
1085
|
+
type TDryRunResult = {
|
|
1086
|
+
failureReason?: string;
|
|
1087
|
+
failureSubReason?: string;
|
|
1088
|
+
failureChain?: TChainEndpoint;
|
|
1089
|
+
origin: TDryRunChainResult;
|
|
1090
|
+
destination?: TDryRunChainResult;
|
|
1091
|
+
hops: THopInfo[];
|
|
1092
|
+
};
|
|
1093
|
+
type TResolveHopParams<TApi, TRes, TSigner> = {
|
|
1094
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1095
|
+
tx: TRes;
|
|
1096
|
+
originChain: TSubstrateChain;
|
|
1097
|
+
currentChain: TSubstrateChain;
|
|
1098
|
+
destination: TDestination;
|
|
1099
|
+
asset: TAssetInfo;
|
|
1100
|
+
currency: TCurrencyInputWithAmount;
|
|
1101
|
+
swapConfig?: TSwapConfig;
|
|
1102
|
+
hasPassedExchange: boolean;
|
|
1103
|
+
};
|
|
1104
|
+
type HopProcessParams<TApi, TRes, TSigner> = {
|
|
1105
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1106
|
+
currentChain: TSubstrateChain;
|
|
1107
|
+
currentOrigin: TSubstrateChain;
|
|
1108
|
+
currentAsset: TAssetInfo;
|
|
1109
|
+
forwardedXcms: any;
|
|
1110
|
+
hasPassedExchange: boolean;
|
|
1111
|
+
isDestination: boolean;
|
|
1112
|
+
};
|
|
1113
|
+
type HopTraversalConfig<TApi, TRes, TSigner, THopResult> = {
|
|
1114
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1115
|
+
origin: TSubstrateChain;
|
|
1116
|
+
destination: TChain;
|
|
1117
|
+
currency: TCurrencyCore;
|
|
1118
|
+
initialForwardedXcms: any;
|
|
1119
|
+
initialDestParaId: number | undefined;
|
|
1120
|
+
swapConfig?: TSwapConfig;
|
|
1121
|
+
processHop: (params: HopProcessParams<TApi, TRes, TSigner>) => Promise<THopResult>;
|
|
1122
|
+
shouldContinue: (hopResult: THopResult) => boolean;
|
|
1123
|
+
extractNextHopData: (hopResult: THopResult) => {
|
|
1124
|
+
forwardedXcms: any;
|
|
1125
|
+
destParaId: number | undefined;
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
1128
|
+
type HopTraversalResult<THopResult> = {
|
|
1129
|
+
hops: Array<{
|
|
1130
|
+
chain: TSubstrateChain;
|
|
1131
|
+
result: THopResult;
|
|
1593
1132
|
}>;
|
|
1133
|
+
destination?: THopResult;
|
|
1134
|
+
lastProcessedChain?: TSubstrateChain;
|
|
1135
|
+
};
|
|
1136
|
+
type TBypassOptions = {
|
|
1137
|
+
mintFeeAssets?: boolean;
|
|
1138
|
+
sentAssetMintMode?: 'preview' | 'bypass';
|
|
1139
|
+
};
|
|
1140
|
+
declare enum XTokensError {
|
|
1141
|
+
AssetHasNoReserve = "AssetHasNoReserve",
|
|
1142
|
+
NotCrossChainTransfer = "NotCrossChainTransfer",
|
|
1143
|
+
InvalidDest = "InvalidDest",
|
|
1144
|
+
NotCrossChainTransferableCurrency = "NotCrossChainTransferableCurrency",
|
|
1145
|
+
UnweighableMessage = "UnweighableMessage",
|
|
1146
|
+
XcmExecutionFailed = "XcmExecutionFailed",
|
|
1147
|
+
CannotReanchor = "CannotReanchor",
|
|
1148
|
+
InvalidAncestry = "InvalidAncestry",
|
|
1149
|
+
InvalidAsset = "InvalidAsset",
|
|
1150
|
+
DestinationNotInvertible = "DestinationNotInvertible",
|
|
1151
|
+
BadVersion = "BadVersion",
|
|
1152
|
+
DistinctReserveForAssetAndFee = "DistinctReserveForAssetAndFee",
|
|
1153
|
+
ZeroFee = "ZeroFee",
|
|
1154
|
+
ZeroAmount = "ZeroAmount",
|
|
1155
|
+
TooManyAssetsBeingSent = "TooManyAssetsBeingSent",
|
|
1156
|
+
AssetIndexNonExistent = "AssetIndexNonExistent",
|
|
1157
|
+
FeeNotEnough = "FeeNotEnough",
|
|
1158
|
+
NotSupportedLocation = "NotSupportedLocation",
|
|
1159
|
+
MinXcmFeeNotDefined = "MinXcmFeeNotDefined",
|
|
1160
|
+
RateLimited = "RateLimited"
|
|
1161
|
+
}
|
|
1162
|
+
declare enum PolkadotXcmError {
|
|
1163
|
+
Unreachable = "Unreachable",
|
|
1164
|
+
SendFailure = "SendFailure",
|
|
1165
|
+
Filtered = "Filtered",
|
|
1166
|
+
UnweighableMessage = "UnweighableMessage",
|
|
1167
|
+
DestinationNotInvertible = "DestinationNotInvertible",
|
|
1168
|
+
Empty = "Empty",
|
|
1169
|
+
CannotReanchor = "CannotReanchor",
|
|
1170
|
+
TooManyAssets = "TooManyAssets",
|
|
1171
|
+
InvalidOrigin = "InvalidOrigin",
|
|
1172
|
+
BadVersion = "BadVersion",
|
|
1173
|
+
BadLocation = "BadLocation",
|
|
1174
|
+
NoSubscription = "NoSubscription",
|
|
1175
|
+
AlreadySubscribed = "AlreadySubscribed",
|
|
1176
|
+
CannotCheckOutTeleport = "CannotCheckOutTeleport",
|
|
1177
|
+
LowBalance = "LowBalance",
|
|
1178
|
+
TooManyLocks = "TooManyLocks",
|
|
1179
|
+
AccountNotSovereign = "AccountNotSovereign",
|
|
1180
|
+
FeesNotMet = "FeesNotMet",
|
|
1181
|
+
LockNotFound = "LockNotFound",
|
|
1182
|
+
InUse = "InUse",
|
|
1183
|
+
REMOVED = "REMOVED",
|
|
1184
|
+
InvalidAssetUnknownReserve = "InvalidAssetUnknownReserve",
|
|
1185
|
+
InvalidAssetUnsupportedReserve = "InvalidAssetUnsupportedReserve",
|
|
1186
|
+
TooManyReserves = "TooManyReserves",
|
|
1187
|
+
LocalExecutionIncomplete = "LocalExecutionIncomplete",
|
|
1188
|
+
TooManyAuthorizedAliases = "TooManyAuthorizedAliases",
|
|
1189
|
+
ExpiresInPast = "ExpiresInPast",
|
|
1190
|
+
AliasNotFound = "AliasNotFound",
|
|
1191
|
+
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
1192
|
+
}
|
|
1193
|
+
declare enum PolkadotXcmExecutionError {
|
|
1194
|
+
Overflow = "Overflow",
|
|
1195
|
+
Unimplemented = "Unimplemented",
|
|
1196
|
+
UntrustedReserveLocation = "UntrustedReserveLocation",
|
|
1197
|
+
UntrustedTeleportLocation = "UntrustedTeleportLocation",
|
|
1198
|
+
LocationFull = "LocationFull",
|
|
1199
|
+
LocationNotInvertible = "LocationNotInvertible",
|
|
1200
|
+
BadOrigin = "BadOrigin",
|
|
1201
|
+
InvalidLocation = "InvalidLocation",
|
|
1202
|
+
AssetNotFound = "AssetNotFound",
|
|
1203
|
+
FailedToTransactAsset = "FailedToTransactAsset",
|
|
1204
|
+
NotWithdrawable = "NotWithdrawable",
|
|
1205
|
+
LocationCannotHold = "LocationCannotHold",
|
|
1206
|
+
ExceedsMaxMessageSize = "ExceedsMaxMessageSize",
|
|
1207
|
+
DestinationUnsupported = "DestinationUnsupported",
|
|
1208
|
+
Transport = "Transport",
|
|
1209
|
+
Unroutable = "Unroutable",
|
|
1210
|
+
UnknownClaim = "UnknownClaim",
|
|
1211
|
+
FailedToDecode = "FailedToDecode",
|
|
1212
|
+
MaxWeightInvalid = "MaxWeightInvalid",
|
|
1213
|
+
NotHoldingFees = "NotHoldingFees",
|
|
1214
|
+
TooExpensive = "TooExpensive",
|
|
1215
|
+
Trap = "Trap",
|
|
1216
|
+
ExpectationFalse = "ExpectationFalse",
|
|
1217
|
+
PalletNotFound = "PalletNotFound",
|
|
1218
|
+
NameMismatch = "NameMismatch",
|
|
1219
|
+
VersionIncompatible = "VersionIncompatible",
|
|
1220
|
+
HoldingWouldOverflow = "HoldingWouldOverflow",
|
|
1221
|
+
ExportError = "ExportError",
|
|
1222
|
+
ReanchorFailed = "ReanchorFailed",
|
|
1223
|
+
NoDeal = "NoDeal",
|
|
1224
|
+
FeesNotMet = "FeesNotMet",
|
|
1225
|
+
LockError = "LockError",
|
|
1226
|
+
NoPermission = "NoPermission",
|
|
1227
|
+
Unanchored = "Unanchored",
|
|
1228
|
+
NotDepositable = "NotDepositable",
|
|
1229
|
+
TooManyAssets = "TooManyAssets",
|
|
1230
|
+
UnhandledXcmVersion = "UnhandledXcmVersion",
|
|
1231
|
+
WeightLimitReached = "WeightLimitReached",
|
|
1232
|
+
Barrier = "Barrier",
|
|
1233
|
+
WeightNotComputable = "WeightNotComputable",
|
|
1234
|
+
ExceedsStackLimit = "ExceedsStackLimit"
|
|
1235
|
+
}
|
|
1236
|
+
type TModuleError = {
|
|
1237
|
+
index: string;
|
|
1238
|
+
error: string;
|
|
1239
|
+
};
|
|
1240
|
+
type TDryRunError = {
|
|
1241
|
+
failureReason: string;
|
|
1242
|
+
failureSubReason?: string;
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
declare class AmountTooLowError extends Error {
|
|
1246
|
+
constructor(message?: string);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* Error thrown when an API operation is attempted before the API has been initialized.
|
|
1251
|
+
*/
|
|
1252
|
+
declare class ApiNotInitializedError extends Error {
|
|
1253
|
+
constructor();
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* Error thrown when a batch operation is invalid or cannot be executed.
|
|
1258
|
+
*/
|
|
1259
|
+
declare class BatchValidationError extends Error {
|
|
1260
|
+
constructor(message: string);
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Error thrown when the Ethereum bridge is halted.
|
|
1265
|
+
*/
|
|
1266
|
+
declare class BridgeHaltedError extends Error {
|
|
1594
1267
|
/**
|
|
1595
|
-
*
|
|
1596
|
-
*
|
|
1597
|
-
* @returns The max transferable amount.
|
|
1598
|
-
*/
|
|
1599
|
-
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<bigint>;
|
|
1600
|
-
/**
|
|
1601
|
-
* Returns the min transferable amount for the transfer
|
|
1268
|
+
* Constructs a new BridgeHaltedError.
|
|
1602
1269
|
*
|
|
1603
|
-
* @
|
|
1270
|
+
* @param message - Optional custom error message.
|
|
1604
1271
|
*/
|
|
1605
|
-
|
|
1272
|
+
constructor();
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* Error thrown when the Dry Run fails.
|
|
1277
|
+
*/
|
|
1278
|
+
declare class DryRunFailedError extends Error {
|
|
1279
|
+
readonly reason: string;
|
|
1280
|
+
readonly dryRunType?: TChainEndpoint;
|
|
1606
1281
|
/**
|
|
1607
|
-
*
|
|
1282
|
+
* Constructs a new DryRunFailedError.
|
|
1608
1283
|
*
|
|
1609
|
-
* @
|
|
1284
|
+
* @param reason - The reason why the dry run failed.
|
|
1285
|
+
* @param dryRunType - Optional. Specifies if the error is related to the 'origin' or 'destination' dry run.
|
|
1286
|
+
* @param prefix - Optional. A short sentence prepended to the message
|
|
1610
1287
|
*/
|
|
1611
|
-
|
|
1288
|
+
constructor(reason: string, dryRunType?: TChainEndpoint, prefix?: string);
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* Error thrown when an extension is not installed.
|
|
1293
|
+
*/
|
|
1294
|
+
declare class ExtensionNotInstalledError extends Error {
|
|
1612
1295
|
/**
|
|
1613
|
-
*
|
|
1296
|
+
* Constructs a new ExtensionNotInstalledError.
|
|
1614
1297
|
*
|
|
1615
|
-
* @
|
|
1298
|
+
* @param message - The error message.
|
|
1616
1299
|
*/
|
|
1617
|
-
|
|
1300
|
+
constructor(message: string);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Error thrown when a feature or route is temporarily disabled via configuration or governance.
|
|
1305
|
+
*/
|
|
1306
|
+
declare class FeatureTemporarilyDisabledError extends Error {
|
|
1307
|
+
constructor(message: string);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Error thrown when an invalid address is provided.
|
|
1312
|
+
*/
|
|
1313
|
+
declare class InvalidAddressError extends Error {
|
|
1618
1314
|
/**
|
|
1619
|
-
*
|
|
1315
|
+
* Constructs a new InvalidAddressError.
|
|
1620
1316
|
*
|
|
1621
|
-
* @
|
|
1622
|
-
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
1317
|
+
* @param message - The error message.
|
|
1623
1318
|
*/
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
private executeWithEvmSigner;
|
|
1319
|
+
constructor(message: string);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Error development mode is on and no API override is provided for a specific chain.
|
|
1324
|
+
*/
|
|
1325
|
+
declare class MissingChainApiError extends Error {
|
|
1632
1326
|
/**
|
|
1633
|
-
*
|
|
1327
|
+
* Constructs a new MissingChainApiError.
|
|
1634
1328
|
*
|
|
1635
|
-
* @
|
|
1329
|
+
* @param chain - The chain for which the API is missing.
|
|
1636
1330
|
*/
|
|
1637
|
-
|
|
1331
|
+
constructor(chain: TChain);
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Error thrown when a required parameter is missing.
|
|
1336
|
+
*/
|
|
1337
|
+
declare class MissingParameterError extends Error {
|
|
1338
|
+
constructor(parameter: string | string[], message?: string);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
1343
|
+
*/
|
|
1344
|
+
declare class NoXCMSupportImplementedError extends Error {
|
|
1638
1345
|
/**
|
|
1639
|
-
*
|
|
1346
|
+
* Constructs a new NoXCMSupportImplementedError.
|
|
1640
1347
|
*
|
|
1641
|
-
* @
|
|
1348
|
+
* @param chain - The chain for which XCM support is not implemented.
|
|
1642
1349
|
*/
|
|
1643
|
-
|
|
1350
|
+
constructor(chain: TChain);
|
|
1644
1351
|
}
|
|
1352
|
+
|
|
1645
1353
|
/**
|
|
1646
|
-
*
|
|
1647
|
-
*
|
|
1648
|
-
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
1649
|
-
* @returns A new Builder instance.
|
|
1354
|
+
* Error thrown when numeric input is invalid or cannot be parsed.
|
|
1650
1355
|
*/
|
|
1651
|
-
declare
|
|
1356
|
+
declare class NumberFormatError extends Error {
|
|
1357
|
+
constructor(message?: string);
|
|
1358
|
+
}
|
|
1652
1359
|
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1360
|
+
/**
|
|
1361
|
+
* Error thrown when asset or currency overrides are invalid or conflicting.
|
|
1362
|
+
*/
|
|
1363
|
+
declare class OverrideConflictError extends Error {
|
|
1364
|
+
constructor(message: string);
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* Error thrown when no provider or RPC endpoint is available for the requested chain.
|
|
1369
|
+
*/
|
|
1370
|
+
declare class ProviderUnavailableError extends Error {
|
|
1371
|
+
constructor(message: string);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* Error thrown when routing or path resolution fails.
|
|
1376
|
+
*/
|
|
1377
|
+
declare class RoutingResolutionError extends Error {
|
|
1378
|
+
constructor(message: string);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* Error thrown when a runtime API call fails
|
|
1383
|
+
*/
|
|
1384
|
+
declare class RuntimeApiError extends Error {
|
|
1385
|
+
constructor(message: string);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Error thrown when a required runtime API is not available on the target chain.
|
|
1390
|
+
*/
|
|
1391
|
+
declare class RuntimeApiUnavailableError extends Error {
|
|
1392
|
+
constructor(chain: string, apiName: string);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
type TScenarioNotSupportedContext = {
|
|
1661
1396
|
chain: TChain;
|
|
1397
|
+
scenario: TScenario;
|
|
1662
1398
|
};
|
|
1663
1399
|
/**
|
|
1664
|
-
*
|
|
1400
|
+
* Error thrown when a scenario, route, or chain capability is not supported.
|
|
1665
1401
|
*/
|
|
1666
|
-
|
|
1402
|
+
declare class ScenarioNotSupportedError extends Error {
|
|
1403
|
+
constructor(message: string);
|
|
1404
|
+
constructor({ chain, scenario }: TScenarioNotSupportedContext);
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* Error thrown when a submitted transaction encounters a dispatch error on-chain.
|
|
1409
|
+
*/
|
|
1410
|
+
declare class SubmitTransactionError extends Error {
|
|
1667
1411
|
/**
|
|
1668
|
-
*
|
|
1412
|
+
* Constructs a new SubmitTransactionError.
|
|
1413
|
+
*
|
|
1414
|
+
* @param message - The dispatch error details.
|
|
1669
1415
|
*/
|
|
1670
|
-
|
|
1671
|
-
}
|
|
1416
|
+
constructor(message: string);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
declare class TransferToAhNotSupported extends Error {
|
|
1420
|
+
constructor(message?: string);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
declare class TypeAndThenUnavailableError extends Error {
|
|
1424
|
+
constructor(message: string);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1672
1427
|
/**
|
|
1673
|
-
*
|
|
1428
|
+
* UnableToComputeError is thrown when a computation cannot be performed.
|
|
1674
1429
|
*/
|
|
1675
|
-
|
|
1430
|
+
declare class UnableToComputeError extends Error {
|
|
1676
1431
|
/**
|
|
1677
|
-
*
|
|
1432
|
+
* Constructs a new UnableToComputeError.
|
|
1433
|
+
*
|
|
1434
|
+
* @param message - Required error message.
|
|
1678
1435
|
*/
|
|
1679
|
-
|
|
1436
|
+
constructor(message: string);
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* Error thrown when an operation or parameter combination is not supported.
|
|
1441
|
+
*/
|
|
1442
|
+
declare class UnsupportedOperationError extends Error {
|
|
1443
|
+
constructor(message: string);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* Thrown when a validation check fails.
|
|
1448
|
+
*/
|
|
1449
|
+
declare class ValidationError extends Error {
|
|
1450
|
+
constructor(message: string);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
type TXcmFeeSwapConfig = TSwapConfig & {
|
|
1454
|
+
amountOut: bigint;
|
|
1680
1455
|
};
|
|
1681
|
-
type
|
|
1682
|
-
type
|
|
1683
|
-
type TGetTransferableAmountOptionsBase<TRes> = {
|
|
1456
|
+
type TTxFactory<TRes> = (amount?: string, relative?: boolean) => Promise<TRes>;
|
|
1457
|
+
type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
1684
1458
|
/**
|
|
1685
|
-
* The
|
|
1459
|
+
* The transaction factory
|
|
1686
1460
|
*/
|
|
1687
|
-
|
|
1461
|
+
buildTx: TTxFactory<TRes>;
|
|
1688
1462
|
/**
|
|
1689
|
-
* The chain
|
|
1463
|
+
* The origin chain
|
|
1690
1464
|
*/
|
|
1691
1465
|
origin: TSubstrateChain;
|
|
1692
1466
|
/**
|
|
1693
|
-
* The destination chain
|
|
1467
|
+
* The destination chain
|
|
1694
1468
|
*/
|
|
1695
1469
|
destination: TChain;
|
|
1696
1470
|
/**
|
|
1697
|
-
* The
|
|
1471
|
+
* The sender address
|
|
1698
1472
|
*/
|
|
1473
|
+
sender: string;
|
|
1474
|
+
recipient: string;
|
|
1699
1475
|
currency: WithAmount<TCurrencyCore>;
|
|
1700
|
-
version
|
|
1476
|
+
version?: Version;
|
|
1477
|
+
feeAsset?: TCurrencyInput;
|
|
1478
|
+
disableFallback: TDisableFallback;
|
|
1479
|
+
swapConfig?: TXcmFeeSwapConfig;
|
|
1480
|
+
skipReverseFeeCalculation?: boolean;
|
|
1481
|
+
};
|
|
1482
|
+
type TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback extends boolean = boolean> = WithApi<TGetXcmFeeBaseOptions<TRes, TDisableFallback>, TApi, TRes, TSigner>;
|
|
1483
|
+
type TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback extends boolean = boolean> = Omit<TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>, 'buildTx'> & {
|
|
1484
|
+
tx: TRes;
|
|
1485
|
+
useRootOrigin: boolean;
|
|
1486
|
+
};
|
|
1487
|
+
type TGetXcmFeeBuilderOptions = {
|
|
1488
|
+
disableFallback: boolean;
|
|
1489
|
+
};
|
|
1490
|
+
type TGetOriginXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
1701
1491
|
buildTx: TTxFactory<TRes>;
|
|
1492
|
+
origin: TSubstrateChain;
|
|
1493
|
+
destination: TChain;
|
|
1494
|
+
sender: string;
|
|
1495
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1496
|
+
version?: Version;
|
|
1702
1497
|
feeAsset?: TCurrencyInput;
|
|
1498
|
+
disableFallback: TDisableFallback;
|
|
1499
|
+
useRootOrigin?: boolean;
|
|
1703
1500
|
};
|
|
1704
|
-
type
|
|
1705
|
-
type
|
|
1501
|
+
type TGetOriginXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback extends boolean = boolean> = WithApi<TGetOriginXcmFeeBaseOptions<TRes, TDisableFallback>, TApi, TRes, TSigner>;
|
|
1502
|
+
type TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner> = Omit<TGetOriginXcmFeeOptions<TApi, TRes, TSigner>, 'buildTx'> & {
|
|
1503
|
+
tx: TRes;
|
|
1504
|
+
};
|
|
1505
|
+
type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
1506
|
+
prevChain: TSubstrateChain;
|
|
1507
|
+
origin: TSubstrateChain;
|
|
1508
|
+
destination: TChain;
|
|
1509
|
+
sender: string;
|
|
1706
1510
|
recipient: string;
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1511
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1512
|
+
forwardedXcms: any;
|
|
1513
|
+
tx: TRes;
|
|
1514
|
+
asset: TAssetInfo;
|
|
1515
|
+
version: Version;
|
|
1516
|
+
originFee: bigint;
|
|
1517
|
+
feeAsset?: TCurrencyInput;
|
|
1518
|
+
disableFallback: boolean;
|
|
1519
|
+
hasPassedExchange?: boolean;
|
|
1520
|
+
swapConfig?: TXcmFeeSwapConfig;
|
|
1521
|
+
skipReverseFeeCalculation?: boolean;
|
|
1522
|
+
};
|
|
1523
|
+
type TGetFeeForDestChainOptions<TApi, TRes, TSigner> = WithApi<TGetFeeForDestChainBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1524
|
+
type TGetReverseTxFeeOptions<TApi, TRes, TSigner> = Omit<TGetFeeForDestChainOptions<TApi, TRes, TSigner>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevChain' | 'version'> & {
|
|
1525
|
+
destination: TSubstrateChain;
|
|
1526
|
+
};
|
|
1527
|
+
type TFeeType = 'dryRun' | 'paymentInfo' | 'noFeeRequired';
|
|
1528
|
+
type TXcmFeeBase$1 = {
|
|
1529
|
+
asset: TAssetInfo;
|
|
1530
|
+
weight?: TWeight;
|
|
1531
|
+
sufficient?: boolean;
|
|
1532
|
+
isExchange?: boolean;
|
|
1533
|
+
};
|
|
1534
|
+
type TXcmFeeDetailSuccess = TXcmFeeBase$1 & {
|
|
1535
|
+
fee: bigint;
|
|
1536
|
+
feeType: TFeeType;
|
|
1537
|
+
dryRunError?: string;
|
|
1538
|
+
dryRunSubError?: string;
|
|
1539
|
+
};
|
|
1540
|
+
type TXcmFeeDetailWithFallback = TXcmFeeDetailSuccess;
|
|
1541
|
+
type TXcmFeeDetailError = TXcmFeeBase$1 & {
|
|
1542
|
+
fee?: bigint;
|
|
1543
|
+
feeType?: TFeeType;
|
|
1544
|
+
dryRunError: string;
|
|
1545
|
+
dryRunSubError?: string;
|
|
1546
|
+
};
|
|
1547
|
+
type TXcmFeeDetail = TXcmFeeDetailSuccess | TXcmFeeDetailError;
|
|
1548
|
+
type TXcmFeeHopResult = {
|
|
1549
|
+
fee?: bigint;
|
|
1550
|
+
feeType?: TFeeType;
|
|
1551
|
+
sufficient?: boolean;
|
|
1552
|
+
dryRunError?: string;
|
|
1553
|
+
dryRunSubError?: string;
|
|
1554
|
+
forwardedXcms?: any;
|
|
1555
|
+
destParaId?: number;
|
|
1556
|
+
asset: TAssetInfo;
|
|
1557
|
+
};
|
|
1558
|
+
type TConditionalXcmFeeDetail<TDisableFallback extends boolean> = TDisableFallback extends false ? TXcmFeeDetailWithFallback : TXcmFeeDetail;
|
|
1559
|
+
type TXcmFeeDetailWithForwardedXcm<TDisableFallback extends boolean> = TConditionalXcmFeeDetail<TDisableFallback> & {
|
|
1560
|
+
forwardedXcms?: unknown;
|
|
1561
|
+
destParaId?: number;
|
|
1562
|
+
};
|
|
1563
|
+
type TConditionalXcmFeeHopInfo<TDisableFallback extends boolean> = {
|
|
1564
|
+
chain: TChain;
|
|
1565
|
+
result: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1566
|
+
};
|
|
1567
|
+
type TXcmFeeHopInfo = {
|
|
1568
|
+
chain: TChain;
|
|
1569
|
+
result: TXcmFeeDetail;
|
|
1570
|
+
};
|
|
1571
|
+
type TGetXcmFeeResult<TDisableFallback extends boolean = boolean> = {
|
|
1572
|
+
failureReason?: string;
|
|
1573
|
+
failureChain?: TChainEndpoint;
|
|
1574
|
+
origin: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1575
|
+
destination: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1576
|
+
hops: TConditionalXcmFeeHopInfo<TDisableFallback>[];
|
|
1577
|
+
};
|
|
1578
|
+
type TPaymentInfo = {
|
|
1579
|
+
partialFee: bigint;
|
|
1580
|
+
weight: TWeight;
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
type THopTransferInfo = {
|
|
1584
|
+
chain: TChain;
|
|
1585
|
+
result: {
|
|
1586
|
+
xcmFee: TXcmFeeBase;
|
|
1587
|
+
asset: TAssetInfo;
|
|
1588
|
+
isExchange?: boolean;
|
|
1589
|
+
};
|
|
1590
|
+
};
|
|
1591
|
+
type TXcmFeeBase = {
|
|
1592
|
+
fee: bigint;
|
|
1593
|
+
asset: TAssetInfo;
|
|
1594
|
+
};
|
|
1595
|
+
type TTransferInfo = {
|
|
1596
|
+
chain: {
|
|
1597
|
+
origin: TChain;
|
|
1598
|
+
destination: TChain;
|
|
1599
|
+
ecosystem: string;
|
|
1600
|
+
};
|
|
1601
|
+
origin: {
|
|
1602
|
+
selectedCurrency: {
|
|
1603
|
+
sufficient: boolean;
|
|
1604
|
+
balance: bigint;
|
|
1605
|
+
balanceAfter: bigint;
|
|
1606
|
+
asset: TAssetInfo;
|
|
1607
|
+
};
|
|
1608
|
+
xcmFee: TXcmFeeBase & {
|
|
1609
|
+
sufficient: boolean;
|
|
1610
|
+
balance: bigint;
|
|
1611
|
+
balanceAfter: bigint;
|
|
1612
|
+
};
|
|
1613
|
+
isExchange?: boolean;
|
|
1614
|
+
};
|
|
1615
|
+
hops: THopTransferInfo[];
|
|
1616
|
+
destination: {
|
|
1617
|
+
receivedCurrency: {
|
|
1618
|
+
sufficient: boolean | UnableToComputeError;
|
|
1619
|
+
receivedAmount: bigint | UnableToComputeError;
|
|
1620
|
+
balance: bigint;
|
|
1621
|
+
balanceAfter: bigint | UnableToComputeError;
|
|
1622
|
+
asset: TAssetInfo;
|
|
1623
|
+
};
|
|
1624
|
+
xcmFee: TXcmFeeBase & {
|
|
1625
|
+
balanceAfter: bigint | UnableToComputeError;
|
|
1626
|
+
};
|
|
1627
|
+
isExchange?: boolean;
|
|
1628
|
+
};
|
|
1629
|
+
};
|
|
1630
|
+
type TBuildOriginInfoOptions<TApi, TRes, TSigner> = {
|
|
1631
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1632
|
+
origin: TSubstrateChain;
|
|
1633
|
+
sender: string;
|
|
1634
|
+
currency: TCurrencyCore;
|
|
1635
|
+
originAsset: TAssetInfo;
|
|
1636
|
+
amount: bigint;
|
|
1637
|
+
originFee: bigint;
|
|
1638
|
+
originFeeAsset: TAssetInfo;
|
|
1639
|
+
isFeeAssetAh: boolean;
|
|
1640
|
+
};
|
|
1641
|
+
type BuildHopInfoOptions<TApi, TRes, TSigner> = {
|
|
1642
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1643
|
+
chain: TChain;
|
|
1644
|
+
fee: bigint;
|
|
1645
|
+
originChain: TSubstrateChain;
|
|
1646
|
+
currency: TCurrencyCore;
|
|
1647
|
+
asset: TAssetInfo;
|
|
1648
|
+
sender: string;
|
|
1649
|
+
ahAddress?: string;
|
|
1650
|
+
};
|
|
1651
|
+
type TBuildDestInfoOptions<TApi, TRes, TSigner> = {
|
|
1652
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1653
|
+
origin: TSubstrateChain;
|
|
1654
|
+
destination: TChain;
|
|
1655
|
+
recipient: string;
|
|
1656
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1657
|
+
originFee: bigint;
|
|
1658
|
+
isFeeAssetAh: boolean;
|
|
1659
|
+
destFeeDetail: TXcmFeeDetail;
|
|
1660
|
+
totalHopFee: bigint;
|
|
1661
|
+
bridgeFee?: bigint;
|
|
1662
|
+
};
|
|
1663
|
+
type TOriginFeeDetails = {
|
|
1664
|
+
sufficientForXCM: boolean;
|
|
1665
|
+
xcmFee: bigint;
|
|
1666
|
+
};
|
|
1667
|
+
type TGetTransferInfoOptionsBase<TRes> = {
|
|
1668
|
+
buildTx: TTxFactory<TRes>;
|
|
1669
|
+
origin: TSubstrateChain;
|
|
1670
|
+
destination: TChain;
|
|
1671
|
+
sender: string;
|
|
1672
|
+
ahAddress?: string;
|
|
1673
|
+
recipient: string;
|
|
1674
|
+
currency: WithAmount<TCurrencyCore>;
|
|
1675
|
+
version: Version | undefined;
|
|
1676
|
+
feeAsset?: TCurrencyCore;
|
|
1677
|
+
};
|
|
1678
|
+
type TGetTransferInfoOptions<TApi, TRes, TSigner> = WithApi<TGetTransferInfoOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1679
|
+
|
|
1680
|
+
type TExchangeChain = (typeof EXCHANGE_CHAINS)[number];
|
|
1681
|
+
type TExchangeInput = TExchangeChain | TExchangeChain[] | undefined;
|
|
1682
|
+
type TSwapOptions<TApi, TRes, TSigner> = {
|
|
1683
|
+
currencyTo: TCurrencyCore;
|
|
1684
|
+
exchange?: TExchangeInput;
|
|
1685
|
+
slippage?: number;
|
|
1686
|
+
evmSenderAddress?: string;
|
|
1687
|
+
evmSigner?: TSigner;
|
|
1688
|
+
onStatusChange?: TStatusChangeCallback<TApi, TRes>;
|
|
1689
|
+
};
|
|
1690
|
+
type TTransactionContext<TApi, TRes> = {
|
|
1691
|
+
type: TTransactionType;
|
|
1692
|
+
api: TApi;
|
|
1693
|
+
chain: TSubstrateChain;
|
|
1694
|
+
tx: TRes;
|
|
1695
|
+
};
|
|
1696
|
+
type TTransactionType = 'TRANSFER' | 'SWAP' | 'SWAP_AND_TRANSFER';
|
|
1697
|
+
type TSwapEventType = TTransactionType | 'SELECTING_EXCHANGE' | 'COMPLETED';
|
|
1698
|
+
/**
|
|
1699
|
+
* The transaction progress information.
|
|
1700
|
+
*/
|
|
1701
|
+
type TSwapEvent<TApi, TRes> = {
|
|
1702
|
+
/**
|
|
1703
|
+
* Current execution phase type
|
|
1704
|
+
*/
|
|
1705
|
+
type: TSwapEventType;
|
|
1706
|
+
/**
|
|
1707
|
+
* Full transaction plan for visualization
|
|
1708
|
+
*/
|
|
1709
|
+
routerPlan?: TTransactionContext<TApi, TRes>[];
|
|
1710
|
+
/**
|
|
1711
|
+
* Current transaction's origin chain
|
|
1712
|
+
*/
|
|
1713
|
+
chain?: TSubstrateChain;
|
|
1714
|
+
/**
|
|
1715
|
+
* Current transaction's destination chain
|
|
1716
|
+
*/
|
|
1717
|
+
destinationChain?: TChain;
|
|
1710
1718
|
/**
|
|
1711
|
-
*
|
|
1719
|
+
* 0-based step index of current operation
|
|
1712
1720
|
*/
|
|
1721
|
+
currentStep?: number;
|
|
1722
|
+
};
|
|
1723
|
+
type TStatusChangeCallback<TApi, TRes> = (info: TSwapEvent<TApi, TRes>) => void;
|
|
1724
|
+
interface TSwapBuilder<TApi, TRes, TSigner> {
|
|
1725
|
+
from(chain: TSubstrateChain | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1726
|
+
to(chain: TChain | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1727
|
+
exchange(chain: TExchangeInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1728
|
+
currencyFrom(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1729
|
+
currencyTo(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1730
|
+
feeAsset(currency: TCurrencyInput | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1731
|
+
amount(amount: TAmount): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1732
|
+
recipient(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1733
|
+
sender(address: string): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1734
|
+
signer(signer: TSigner): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1735
|
+
evmSenderAddress(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1736
|
+
evmSigner(signer: TSigner | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1737
|
+
slippagePct(pct: string): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1738
|
+
onStatusChange(callback: TStatusChangeCallback<TApi, TRes>): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1739
|
+
getXcmFees<TDisableFallback extends boolean = false>(options?: TGetXcmFeeBuilderOptions & {
|
|
1740
|
+
disableFallback: TDisableFallback;
|
|
1741
|
+
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
1742
|
+
getOriginXcmFee<TDisableFallback extends boolean = false>(options?: TGetXcmFeeBuilderOptions & {
|
|
1743
|
+
disableFallback: TDisableFallback;
|
|
1744
|
+
}): Promise<TXcmFeeDetailWithForwardedXcm<TDisableFallback>>;
|
|
1745
|
+
getSwapInfo(): Promise<TTransferInfo>;
|
|
1746
|
+
getTransferableAmount(): Promise<bigint>;
|
|
1747
|
+
getMinTransferableAmount(): Promise<bigint>;
|
|
1748
|
+
getBestAmountOut(): Promise<{
|
|
1749
|
+
exchange: TExchangeChain;
|
|
1750
|
+
amountOut: bigint;
|
|
1751
|
+
}>;
|
|
1752
|
+
dryRun(): Promise<TDryRunResult>;
|
|
1753
|
+
dryRunPreview(previewOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
1754
|
+
build(): Promise<TTransactionContext<TApi, TRes>[]>;
|
|
1755
|
+
signAndSubmit(): Promise<string[]>;
|
|
1756
|
+
}
|
|
1757
|
+
type TSwapBuilderFactory = <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>) => TSwapBuilder<TApi, TRes, TSigner>;
|
|
1758
|
+
|
|
1759
|
+
type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
1760
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1761
|
+
chain: TSubstrateChain;
|
|
1762
|
+
beneficiaryLocation: TLocation;
|
|
1763
|
+
recipient: TAddress;
|
|
1764
|
+
asset: TAsset;
|
|
1765
|
+
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
1766
|
+
scenario: TScenario;
|
|
1767
|
+
assetInfo: WithAmount<TAssetInfo>;
|
|
1768
|
+
currency: TCurrencyInputWithAmount;
|
|
1769
|
+
feeAssetInfo?: TAssetInfo;
|
|
1770
|
+
feeCurrency?: TCurrencyInput;
|
|
1771
|
+
destination: TDestination;
|
|
1772
|
+
destChain?: TChain;
|
|
1773
|
+
paraIdTo?: number;
|
|
1774
|
+
version: Version;
|
|
1775
|
+
sender?: string;
|
|
1776
|
+
ahAddress?: string;
|
|
1777
|
+
pallet?: string;
|
|
1778
|
+
method?: string;
|
|
1779
|
+
transactOptions?: TTransactOptions<TRes>;
|
|
1780
|
+
};
|
|
1781
|
+
type TXTokensTransferOptions<TApi, TRes, TSigner> = {
|
|
1782
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1783
|
+
asset: WithAmount<TAssetInfo>;
|
|
1784
|
+
recipient: TAddress;
|
|
1785
|
+
scenario: TScenario;
|
|
1713
1786
|
origin: TSubstrateChain;
|
|
1787
|
+
destination: TDestination;
|
|
1788
|
+
paraIdTo?: number;
|
|
1789
|
+
version: Version;
|
|
1790
|
+
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
1791
|
+
pallet?: string;
|
|
1792
|
+
method?: string;
|
|
1793
|
+
useMultiAssetTransfer?: boolean;
|
|
1794
|
+
};
|
|
1795
|
+
interface IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
1796
|
+
transferPolkadotXCM: (input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
1797
|
+
}
|
|
1798
|
+
interface IXTokensTransfer<TApi, TRes, TSigner> {
|
|
1799
|
+
transferXTokens: (input: TXTokensTransferOptions<TApi, TRes, TSigner>) => TRes;
|
|
1800
|
+
}
|
|
1801
|
+
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
1802
|
+
type TAddress = string | TLocation;
|
|
1803
|
+
type TDestination = TChain | TLocation;
|
|
1804
|
+
type TTransferBaseOptions<TApi, TRes, TSigner> = {
|
|
1714
1805
|
/**
|
|
1715
|
-
* The
|
|
1806
|
+
* The origin chain
|
|
1716
1807
|
*/
|
|
1717
|
-
|
|
1808
|
+
from: TChain;
|
|
1718
1809
|
/**
|
|
1719
|
-
* The address
|
|
1810
|
+
* The destination address. A SS58 or H160 format.
|
|
1720
1811
|
*/
|
|
1721
|
-
recipient:
|
|
1812
|
+
recipient: TAddress;
|
|
1722
1813
|
/**
|
|
1723
|
-
* The
|
|
1814
|
+
* The optional sender address. A SS58 or H160 format.
|
|
1724
1815
|
*/
|
|
1725
|
-
sender
|
|
1816
|
+
sender?: string;
|
|
1726
1817
|
/**
|
|
1727
|
-
* The
|
|
1818
|
+
* The optional asset hub address. A SS58 format only.
|
|
1728
1819
|
*/
|
|
1729
|
-
currency: WithAmount<TCurrencyCore>;
|
|
1730
|
-
version: Version | undefined;
|
|
1731
|
-
buildTx: TTxFactory<TRes>;
|
|
1732
|
-
feeAsset?: TCurrencyInput;
|
|
1733
|
-
};
|
|
1734
|
-
type TVerifyEdOnDestinationOptions<TApi, TRes, TSigner> = WithApi<TVerifyEdOnDestinationOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1735
|
-
|
|
1736
|
-
type TEvmTransferOptionsBase = {
|
|
1737
|
-
from: TChain;
|
|
1738
|
-
to: TChain;
|
|
1739
|
-
currency: TCurrencyInputWithAmount;
|
|
1740
|
-
recipient: string;
|
|
1741
1820
|
ahAddress?: string;
|
|
1742
|
-
signer: WalletClient;
|
|
1743
|
-
};
|
|
1744
|
-
type TEvmTransferOptions<TApi, TRes, TSigner> = WithApi<TEvmTransferOptionsBase, TApi, TRes, TSigner>;
|
|
1745
|
-
/**
|
|
1746
|
-
* The options for the batch builder.
|
|
1747
|
-
*/
|
|
1748
|
-
declare enum BatchMode {
|
|
1749
1821
|
/**
|
|
1750
|
-
*
|
|
1822
|
+
* The destination chain or XCM location
|
|
1751
1823
|
*/
|
|
1752
|
-
|
|
1824
|
+
to: TDestination;
|
|
1753
1825
|
/**
|
|
1754
|
-
*
|
|
1826
|
+
* The currency to transfer. Either ID, symbol, location, or multi-asset
|
|
1755
1827
|
*/
|
|
1756
|
-
|
|
1757
|
-
}
|
|
1758
|
-
/**
|
|
1759
|
-
* The options for the batch builder.
|
|
1760
|
-
*/
|
|
1761
|
-
type TBatchOptions = {
|
|
1828
|
+
currency: TCurrencyInputWithAmount;
|
|
1762
1829
|
/**
|
|
1763
|
-
* The
|
|
1764
|
-
* `BATCH_ALL` - does not commit if one of the calls in the batch fails.
|
|
1765
|
-
* `BATCH` - commits each successful call regardless if a call fails.
|
|
1830
|
+
* The optional fee asset. Either ID, symbol, or location
|
|
1766
1831
|
*/
|
|
1767
|
-
|
|
1768
|
-
};
|
|
1769
|
-
type TDryRunPreviewOptions = {
|
|
1770
|
-
mintFeeAssets?: boolean;
|
|
1771
|
-
};
|
|
1772
|
-
type TBuilderOptions<TApi> = TApi | TBuilderConfig<TApi>;
|
|
1773
|
-
type TBuilderConfig<TApi> = Partial<{
|
|
1774
|
-
apiOverrides: Partial<Record<TChain, TApi>>;
|
|
1775
|
-
development: boolean;
|
|
1776
|
-
abstractDecimals: boolean;
|
|
1777
|
-
xcmFormatCheck: boolean;
|
|
1778
|
-
}>;
|
|
1779
|
-
type TCreateTxsOptions<TApi, TRes, TSigner> = Pick<TTransferOptions<TApi, TRes, TSigner>, 'api' | 'from' | 'to' | 'currency'>;
|
|
1780
|
-
type TBatchedTransferOptions<TApi, TRes, TSigner> = Omit<TSubstrateTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'> & {
|
|
1781
|
-
builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>;
|
|
1782
|
-
};
|
|
1783
|
-
type TBuildInternalResBase<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = {
|
|
1784
|
-
options: TTransferOptions<TApi, TRes, TSigner> & TOptions;
|
|
1785
|
-
};
|
|
1786
|
-
type TBuildInternalRes<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = TBuildInternalResBase<TApi, TRes, TSigner, TOptions> & {
|
|
1787
|
-
tx: TRes;
|
|
1788
|
-
};
|
|
1789
|
-
type TBuildAllInternalRes<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = TBuildInternalResBase<TApi, TRes, TSigner, TOptions> & {
|
|
1790
|
-
txContexts: TTransactionContext<TApi, TRes>[];
|
|
1791
|
-
};
|
|
1792
|
-
type TSender<TSigner> = string | TSigner;
|
|
1793
|
-
type TBuilderInternalOptions<TSigner> = {
|
|
1794
|
-
senderSource?: TSender<TSigner> | WalletClient;
|
|
1795
|
-
};
|
|
1796
|
-
|
|
1797
|
-
type TProviderEntry = {
|
|
1798
|
-
name: string;
|
|
1799
|
-
endpoint: string;
|
|
1800
|
-
};
|
|
1801
|
-
type TChainConfig = {
|
|
1802
|
-
name: string;
|
|
1803
|
-
info: string;
|
|
1804
|
-
paraId: number;
|
|
1805
|
-
providers: TProviderEntry[];
|
|
1806
|
-
};
|
|
1807
|
-
type TChainConfigMap = Record<TSubstrateChain, TChainConfig>;
|
|
1808
|
-
|
|
1809
|
-
type OneKey<K extends string, V = unknown> = {
|
|
1810
|
-
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
1811
|
-
[Q in keyof O]: O[Q];
|
|
1812
|
-
} : never;
|
|
1813
|
-
}[K];
|
|
1814
|
-
type TXcmVersioned<T> = OneKey<Version, T>;
|
|
1815
|
-
type TXcmForeignAsset = {
|
|
1816
|
-
ForeignAsset: string | number | bigint | undefined;
|
|
1817
|
-
};
|
|
1818
|
-
type TForeignAssetId = {
|
|
1819
|
-
ForeignAssetId: bigint | undefined;
|
|
1820
|
-
};
|
|
1821
|
-
type TForeignOrTokenAsset = TXcmForeignAsset | {
|
|
1822
|
-
Token: string | undefined;
|
|
1823
|
-
};
|
|
1824
|
-
type TForeignOrNativeAsset = TXcmForeignAsset | 'Native';
|
|
1825
|
-
type TXcmAsset = {
|
|
1826
|
-
XCM: number | undefined;
|
|
1827
|
-
} | {
|
|
1828
|
-
Native: null;
|
|
1829
|
-
};
|
|
1830
|
-
type TMantaAsset = {
|
|
1831
|
-
MantaCurrency: bigint | undefined;
|
|
1832
|
-
};
|
|
1833
|
-
type TNativeTokenAsset = 'NativeToken';
|
|
1834
|
-
type TZeitgeistAsset = 'Ztg';
|
|
1835
|
-
type TOtherReserveAsset = {
|
|
1836
|
-
OtherReserve: string | bigint | undefined;
|
|
1837
|
-
};
|
|
1838
|
-
type TSelfReserveAsset = 'SelfReserve';
|
|
1839
|
-
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
1840
|
-
type TBifrostToken = {
|
|
1841
|
-
Native: string | number;
|
|
1842
|
-
} | {
|
|
1843
|
-
VToken: string;
|
|
1844
|
-
} | {
|
|
1845
|
-
Token: string;
|
|
1846
|
-
} | {
|
|
1847
|
-
VSToken2: number;
|
|
1848
|
-
} | {
|
|
1849
|
-
VToken2: number;
|
|
1850
|
-
} | {
|
|
1851
|
-
Token2: number;
|
|
1852
|
-
};
|
|
1853
|
-
type TXTokensCurrencySelection = TXcmVersioned<TLocation | TAsset | TAsset[]> | TXcmForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | TBifrostToken | string | bigint | number | undefined;
|
|
1854
|
-
|
|
1855
|
-
declare class AmountTooLowError extends Error {
|
|
1856
|
-
constructor(message?: string);
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
/**
|
|
1860
|
-
* Error thrown when an API operation is attempted before the API has been initialized.
|
|
1861
|
-
*/
|
|
1862
|
-
declare class ApiNotInitializedError extends Error {
|
|
1863
|
-
constructor();
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
/**
|
|
1867
|
-
* Error thrown when a batch operation is invalid or cannot be executed.
|
|
1868
|
-
*/
|
|
1869
|
-
declare class BatchValidationError extends Error {
|
|
1870
|
-
constructor(message: string);
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
/**
|
|
1874
|
-
* Error thrown when the Ethereum bridge is halted.
|
|
1875
|
-
*/
|
|
1876
|
-
declare class BridgeHaltedError extends Error {
|
|
1832
|
+
feeAsset?: TCurrencyInput;
|
|
1877
1833
|
/**
|
|
1878
|
-
*
|
|
1879
|
-
*
|
|
1880
|
-
* @param message - Optional custom error message.
|
|
1834
|
+
* The optional destination parachain ID
|
|
1881
1835
|
*/
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
*/
|
|
1888
|
-
declare class DryRunFailedError extends Error {
|
|
1889
|
-
readonly reason: string;
|
|
1890
|
-
readonly dryRunType?: TChainEndpoint;
|
|
1836
|
+
paraIdTo?: number;
|
|
1837
|
+
/**
|
|
1838
|
+
* The optional overrided XCM version
|
|
1839
|
+
*/
|
|
1840
|
+
version?: Version;
|
|
1891
1841
|
/**
|
|
1892
|
-
*
|
|
1893
|
-
*
|
|
1894
|
-
* @param reason - The reason why the dry run failed.
|
|
1895
|
-
* @param dryRunType - Optional. Specifies if the error is related to the 'origin' or 'destination' dry run.
|
|
1842
|
+
* The optional pallet override
|
|
1896
1843
|
*/
|
|
1897
|
-
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
/**
|
|
1901
|
-
* Error thrown when an extension is not installed.
|
|
1902
|
-
*/
|
|
1903
|
-
declare class ExtensionNotInstalledError extends Error {
|
|
1844
|
+
pallet?: string;
|
|
1904
1845
|
/**
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
1907
|
-
* @param message - The error message.
|
|
1846
|
+
* Whether to keep the account alive after the transfer.
|
|
1908
1847
|
*/
|
|
1909
|
-
|
|
1910
|
-
}
|
|
1911
|
-
|
|
1912
|
-
/**
|
|
1913
|
-
* Error thrown when a feature or route is temporarily disabled via configuration or governance.
|
|
1914
|
-
*/
|
|
1915
|
-
declare class FeatureTemporarilyDisabledError extends Error {
|
|
1916
|
-
constructor(message: string);
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
/**
|
|
1920
|
-
* Error thrown when an invalid address is provided.
|
|
1921
|
-
*/
|
|
1922
|
-
declare class InvalidAddressError extends Error {
|
|
1848
|
+
keepAlive?: boolean;
|
|
1923
1849
|
/**
|
|
1924
|
-
*
|
|
1925
|
-
*
|
|
1926
|
-
* @param message - The error message.
|
|
1850
|
+
* The optional pallet method override
|
|
1927
1851
|
*/
|
|
1928
|
-
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
/**
|
|
1932
|
-
* Error development mode is on and no API override is provided for a specific chain.
|
|
1933
|
-
*/
|
|
1934
|
-
declare class MissingChainApiError extends Error {
|
|
1852
|
+
method?: string;
|
|
1935
1853
|
/**
|
|
1936
|
-
*
|
|
1937
|
-
*
|
|
1938
|
-
* @param chain - The chain for which the API is missing.
|
|
1854
|
+
* Hex of the encoded transaction call to apply on the destination chain
|
|
1939
1855
|
*/
|
|
1940
|
-
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
/**
|
|
1944
|
-
* Error thrown when a required parameter is missing.
|
|
1945
|
-
*/
|
|
1946
|
-
declare class MissingParameterError extends Error {
|
|
1947
|
-
constructor(parameter: string | string[], message?: string);
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
/**
|
|
1951
|
-
* Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
|
|
1952
|
-
*/
|
|
1953
|
-
declare class NoXCMSupportImplementedError extends Error {
|
|
1856
|
+
transactOptions?: TTransactOptions<TRes>;
|
|
1954
1857
|
/**
|
|
1955
|
-
*
|
|
1956
|
-
*
|
|
1957
|
-
* @param chain - The chain for which XCM support is not implemented.
|
|
1858
|
+
* The optional swap options
|
|
1958
1859
|
*/
|
|
1959
|
-
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
/**
|
|
1963
|
-
* Error thrown when numeric input is invalid or cannot be parsed.
|
|
1964
|
-
*/
|
|
1965
|
-
declare class NumberFormatError extends Error {
|
|
1966
|
-
constructor(message?: string);
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
/**
|
|
1970
|
-
* Error thrown when asset or currency overrides are invalid or conflicting.
|
|
1971
|
-
*/
|
|
1972
|
-
declare class OverrideConflictError extends Error {
|
|
1973
|
-
constructor(message: string);
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
/**
|
|
1977
|
-
* Error thrown when no provider or RPC endpoint is available for the requested chain.
|
|
1978
|
-
*/
|
|
1979
|
-
declare class ProviderUnavailableError extends Error {
|
|
1980
|
-
constructor(message: string);
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
/**
|
|
1984
|
-
* Error thrown when routing or path resolution fails.
|
|
1985
|
-
*/
|
|
1986
|
-
declare class RoutingResolutionError extends Error {
|
|
1987
|
-
constructor(message: string);
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1860
|
+
swapOptions?: TSwapOptions<TApi, TRes, TSigner>;
|
|
1861
|
+
};
|
|
1990
1862
|
/**
|
|
1991
|
-
*
|
|
1863
|
+
* Options for transferring from a parachain to another parachain or relay chain
|
|
1992
1864
|
*/
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
}
|
|
1865
|
+
type TTransferOptions<TApi, TRes, TSigner> = WithApi<TTransferBaseOptions<TApi, TRes, TSigner>, TApi, TRes, TSigner> & {
|
|
1866
|
+
isAmountAll: boolean;
|
|
1867
|
+
};
|
|
1868
|
+
type TSubstrateTransferBaseOptions<TApi, TRes, TSigner> = Omit<TTransferBaseOptions<TApi, TRes, TSigner>, 'from'> & {
|
|
1869
|
+
from: TSubstrateChain;
|
|
1870
|
+
};
|
|
1871
|
+
type TSubstrateTransferOptions<TApi, TRes, TSigner> = Omit<TTransferOptions<TApi, TRes, TSigner>, 'from'> & {
|
|
1872
|
+
from: TSubstrateChain;
|
|
1873
|
+
};
|
|
1874
|
+
type WithRequiredSender<TBase> = Omit<TBase, 'sender'> & {
|
|
1875
|
+
/**
|
|
1876
|
+
* The sender address. A SS58 or H160 format.
|
|
1877
|
+
*/
|
|
1878
|
+
sender: string;
|
|
1879
|
+
};
|
|
1880
|
+
type WithRequiredSwapOptions<TBase, TApi, TRes, TSigner> = Omit<TBase, 'swapOptions'> & {
|
|
1881
|
+
swapOptions: TSwapOptions<TApi, TRes, TSigner>;
|
|
1882
|
+
};
|
|
1883
|
+
type TTransferOptionsWithSwap<TApi, TRes, TSigner> = WithRequiredSwapOptions<Omit<TSubstrateTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'>, TApi, TRes, TSigner>;
|
|
1884
|
+
type TTransferBaseOptionsWithSwap<TApi, TRes, TSigner> = WithRequiredSwapOptions<TTransferBaseOptions<TApi, TRes, TSigner>, TApi, TRes, TSigner>;
|
|
1885
|
+
type TTransferBaseOptionsWithSender<TApi, TRes, TSigner> = WithRequiredSender<TTransferBaseOptions<TApi, TRes, TSigner>>;
|
|
1886
|
+
type TSubstrateTransferBaseOptionsWithSender<TApi, TRes, TSigner> = WithRequiredSender<TSubstrateTransferBaseOptions<TApi, TRes, TSigner>>;
|
|
1887
|
+
type TTransferInternalOptions<TApi, TRes, TSigner> = Omit<TTransferBaseOptions<TApi, TRes, TSigner>, 'from' | 'feeAsset' | 'version'> & {
|
|
1888
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1889
|
+
assetInfo: WithAmount<TAssetInfo>;
|
|
1890
|
+
feeAsset?: TAssetInfo;
|
|
1891
|
+
feeCurrency?: TCurrencyInput;
|
|
1892
|
+
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
1893
|
+
version: Version;
|
|
1894
|
+
isAmountAll: boolean;
|
|
1895
|
+
};
|
|
1896
|
+
type TTransactOrigin = (typeof TRANSACT_ORIGINS)[number];
|
|
1897
|
+
type TTransactOptions<TRes, TWeightType = bigint> = {
|
|
1898
|
+
call: string | TRes;
|
|
1899
|
+
originKind?: TTransactOrigin;
|
|
1900
|
+
maxWeight?: TWeight<TWeightType>;
|
|
1901
|
+
};
|
|
1902
|
+
type TSerializedExtrinsics = {
|
|
1903
|
+
module: TPallet;
|
|
1904
|
+
method: string;
|
|
1905
|
+
params: Record<string, unknown>;
|
|
1906
|
+
};
|
|
1907
|
+
type TSerializedStateQuery = {
|
|
1908
|
+
module: TAssetsPallet;
|
|
1909
|
+
method: string;
|
|
1910
|
+
params: unknown[];
|
|
1911
|
+
};
|
|
1912
|
+
type TSerializedRuntimeApiQuery = {
|
|
1913
|
+
module: string;
|
|
1914
|
+
method: string;
|
|
1915
|
+
params: unknown[];
|
|
1916
|
+
};
|
|
1917
|
+
type TDestWeight = {
|
|
1918
|
+
ref_time: bigint;
|
|
1919
|
+
proof_size: bigint;
|
|
1920
|
+
};
|
|
1921
|
+
type TXTokensMethod = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
1922
|
+
type TPolkadotXcmMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'reserve_transfer_assets' | 'reserve_withdraw_assets' | 'transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
1923
|
+
type TXcmPalletMethod = 'limited_teleport_assets' | 'limited_reserve_transfer_assets' | 'transfer_assets_using_type_and_then';
|
|
1924
|
+
type TWeight<TWeightType = bigint> = {
|
|
1925
|
+
refTime: TWeightType;
|
|
1926
|
+
proofSize: TWeightType;
|
|
1927
|
+
};
|
|
1928
|
+
type TCreateBeneficiaryOptions<TApi, TRes, TSigner> = {
|
|
1929
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1930
|
+
address: TAddress;
|
|
1931
|
+
version: Version;
|
|
1932
|
+
};
|
|
1933
|
+
type TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner> = {
|
|
1934
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1935
|
+
origin: TSubstrateChain;
|
|
1936
|
+
destination: TDestination;
|
|
1937
|
+
recipient: TAddress;
|
|
1938
|
+
version: Version;
|
|
1939
|
+
paraId?: number;
|
|
1940
|
+
};
|
|
1941
|
+
type TBridgeStatus = 'Normal' | 'Halted';
|
|
1942
|
+
type TTransferLocalOptions<TApi, TRes, TSigner> = Omit<TTransferInternalOptions<TApi, TRes, TSigner>, 'recipient'> & {
|
|
1943
|
+
recipient: string;
|
|
1944
|
+
balance: bigint;
|
|
1945
|
+
};
|
|
1946
|
+
type TTransferFeeEstimates = {
|
|
1947
|
+
originFee: bigint;
|
|
1948
|
+
reserveFee: bigint;
|
|
1949
|
+
};
|
|
1950
|
+
type TCreateBaseTransferXcmOptions<TRes> = {
|
|
1951
|
+
chain: TSubstrateChain;
|
|
1952
|
+
destChain: TChain;
|
|
1953
|
+
assetInfo: WithAmount<TAssetInfo>;
|
|
1954
|
+
feeAssetInfo?: TAssetInfo;
|
|
1955
|
+
fees: TTransferFeeEstimates;
|
|
1956
|
+
recipient: string;
|
|
1957
|
+
sender?: string;
|
|
1958
|
+
version: Version;
|
|
1959
|
+
useJitWithdraw?: boolean;
|
|
1960
|
+
useFeeAssetOnHops?: boolean;
|
|
1961
|
+
forceBuyExecution?: boolean;
|
|
1962
|
+
paraIdTo?: number;
|
|
1963
|
+
transactOptions?: TTransactOptions<TRes>;
|
|
1964
|
+
};
|
|
1965
|
+
type TCreateTransferXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseTransferXcmOptions<TRes>, TApi, TRes, TSigner>;
|
|
1966
|
+
type TCreateBaseSwapXcmOptions = {
|
|
1967
|
+
chain?: TSubstrateChain;
|
|
1968
|
+
exchangeChain: TExchangeChain;
|
|
1969
|
+
destChain?: TChain;
|
|
1970
|
+
assetInfoFrom: WithAmount<TAssetInfo>;
|
|
1971
|
+
assetInfoTo: WithAmount<TAssetInfo>;
|
|
1972
|
+
currencyTo: TCurrencyInput;
|
|
1973
|
+
feeAssetInfo?: TAssetInfo;
|
|
1974
|
+
sender: string;
|
|
1975
|
+
recipient: string;
|
|
1976
|
+
calculateMinAmountOut: (amountIn: bigint, assetTo?: TAssetInfo) => Promise<bigint>;
|
|
1977
|
+
};
|
|
1978
|
+
type TCreateSwapXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes, TSigner>;
|
|
1979
|
+
type TSwapFeeEstimates = {
|
|
1980
|
+
originFee: bigint;
|
|
1981
|
+
originReserveFee: bigint;
|
|
1982
|
+
exchangeFee: bigint;
|
|
1983
|
+
destReserveFee: bigint;
|
|
1984
|
+
};
|
|
1985
|
+
type TCreateSwapXcmInternalOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes, TSigner> & {
|
|
1986
|
+
version: Version;
|
|
1987
|
+
fees: TSwapFeeEstimates;
|
|
1988
|
+
paraIdTo?: number;
|
|
1989
|
+
};
|
|
1990
|
+
type TCreateEthBridgeInstructionsOptions<TApi, TRes, TSigner> = {
|
|
1991
|
+
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
1992
|
+
recipient: TAddress;
|
|
1993
|
+
assetInfo: TAssetInfo;
|
|
1994
|
+
sender: string;
|
|
1995
|
+
ahAddress?: string;
|
|
1996
|
+
version: Version;
|
|
1997
|
+
};
|
|
1996
1998
|
|
|
1997
|
-
/**
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
1999
|
+
/** @deprecated Asset claim functionality is deprecated and will be removed in v14. */
|
|
2000
|
+
type TAssetClaimOptionsBase = {
|
|
2001
|
+
chain: TSubstrateChain;
|
|
2002
|
+
currency: WithComplexAmount<TCurrencyCore> | TAsset<TAmount>[] | WithComplexAmount<TCurrencyCore>[];
|
|
2003
|
+
address: TAddress;
|
|
2004
|
+
version?: Version;
|
|
2005
|
+
};
|
|
2006
|
+
type TAssetClaimOptions<TApi, TRes, TSigner> = WithApi<TAssetClaimOptionsBase, TApi, TRes, TSigner>;
|
|
2007
|
+
type TAssetClaimInternalOptions<TApi, TRes, TSigner> = TAssetClaimOptions<TApi, TRes, TSigner> & {
|
|
2008
|
+
version: Version;
|
|
2009
|
+
assets: TAsset<bigint>[];
|
|
2010
|
+
};
|
|
2003
2011
|
|
|
2004
|
-
type
|
|
2005
|
-
|
|
2006
|
-
|
|
2012
|
+
type TSetBalanceRes = {
|
|
2013
|
+
assetStatusTx?: TSerializedExtrinsics;
|
|
2014
|
+
balanceTx: TSerializedExtrinsics;
|
|
2007
2015
|
};
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
constructor({ chain, scenario }: TScenarioNotSupportedContext);
|
|
2016
|
+
declare abstract class BaseAssetsPallet {
|
|
2017
|
+
protected palletName: TAssetsPallet;
|
|
2018
|
+
constructor(palletName: TAssetsPallet);
|
|
2019
|
+
abstract mint<TApi, TRes, TSigner>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain, api: PolkadotApi<TApi, TRes, TSigner>): Promise<TSetBalanceRes>;
|
|
2020
|
+
abstract getBalance<TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
2014
2021
|
}
|
|
2015
2022
|
|
|
2016
|
-
|
|
2017
|
-
* Error thrown when a submitted transaction encounters a dispatch error on-chain.
|
|
2018
|
-
*/
|
|
2019
|
-
declare class SubmitTransactionError extends Error {
|
|
2023
|
+
type TGetBalanceCommonOptions = {
|
|
2020
2024
|
/**
|
|
2021
|
-
*
|
|
2022
|
-
*
|
|
2023
|
-
* @param message - The dispatch error details.
|
|
2025
|
+
* The address of the account.
|
|
2024
2026
|
*/
|
|
2025
|
-
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
declare class TransferToAhNotSupported extends Error {
|
|
2029
|
-
constructor(message?: string);
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
declare class TypeAndThenUnavailableError extends Error {
|
|
2033
|
-
constructor(message: string);
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
/**
|
|
2037
|
-
* UnableToComputeError is thrown when a computation cannot be performed.
|
|
2038
|
-
*/
|
|
2039
|
-
declare class UnableToComputeError extends Error {
|
|
2027
|
+
address: string;
|
|
2040
2028
|
/**
|
|
2041
|
-
*
|
|
2042
|
-
*
|
|
2043
|
-
* @param message - Required error message.
|
|
2029
|
+
* The chain on which to query the balance.
|
|
2044
2030
|
*/
|
|
2045
|
-
constructor(message: string);
|
|
2046
|
-
}
|
|
2047
|
-
|
|
2048
|
-
/**
|
|
2049
|
-
* Error thrown when an operation or parameter combination is not supported.
|
|
2050
|
-
*/
|
|
2051
|
-
declare class UnsupportedOperationError extends Error {
|
|
2052
|
-
constructor(message: string);
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
/**
|
|
2056
|
-
* Thrown when a validation check fails.
|
|
2057
|
-
*/
|
|
2058
|
-
declare class ValidationError extends Error {
|
|
2059
|
-
constructor(message: string);
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
type THopTransferInfo = {
|
|
2063
2031
|
chain: TChain;
|
|
2064
|
-
result: {
|
|
2065
|
-
xcmFee: TXcmFeeBase;
|
|
2066
|
-
asset: TAssetInfo;
|
|
2067
|
-
};
|
|
2068
2032
|
};
|
|
2069
|
-
|
|
2070
|
-
|
|
2033
|
+
/**
|
|
2034
|
+
* Retrieves the asset balance for a given account on a specified chain.
|
|
2035
|
+
*/
|
|
2036
|
+
type TGetAssetBalanceOptionsBase = TGetBalanceCommonOptions & {
|
|
2037
|
+
/**
|
|
2038
|
+
* The resolved asset to query balance for.
|
|
2039
|
+
*/
|
|
2071
2040
|
asset: TAssetInfo;
|
|
2072
2041
|
};
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
sufficient: boolean;
|
|
2082
|
-
balance: bigint;
|
|
2083
|
-
balanceAfter: bigint;
|
|
2084
|
-
asset: TAssetInfo;
|
|
2085
|
-
};
|
|
2086
|
-
xcmFee: TXcmFeeBase & {
|
|
2087
|
-
sufficient: boolean;
|
|
2088
|
-
balance: bigint;
|
|
2089
|
-
balanceAfter: bigint;
|
|
2090
|
-
};
|
|
2091
|
-
};
|
|
2092
|
-
hops: THopTransferInfo[];
|
|
2093
|
-
destination: {
|
|
2094
|
-
receivedCurrency: {
|
|
2095
|
-
sufficient: boolean | UnableToComputeError;
|
|
2096
|
-
receivedAmount: bigint | UnableToComputeError;
|
|
2097
|
-
balance: bigint;
|
|
2098
|
-
balanceAfter: bigint | UnableToComputeError;
|
|
2099
|
-
asset: TAssetInfo;
|
|
2100
|
-
};
|
|
2101
|
-
xcmFee: TXcmFeeBase & {
|
|
2102
|
-
balanceAfter: bigint | UnableToComputeError;
|
|
2103
|
-
};
|
|
2104
|
-
};
|
|
2042
|
+
/**
|
|
2043
|
+
* Retrieves the currency balance for a given account on a specified chain.
|
|
2044
|
+
*/
|
|
2045
|
+
type TGetBalanceOptionsBase = TGetBalanceCommonOptions & {
|
|
2046
|
+
/**
|
|
2047
|
+
* The currency to query.
|
|
2048
|
+
*/
|
|
2049
|
+
currency?: TCurrencyCore;
|
|
2105
2050
|
};
|
|
2106
|
-
type
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
asset: TAssetInfo;
|
|
2051
|
+
type TGetBalanceOptions<TApi, TRes, TSigner> = WithApi<TGetBalanceOptionsBase, TApi, TRes, TSigner>;
|
|
2052
|
+
type TGetAssetBalanceOptions<TApi, TRes, TSigner> = WithApi<TGetAssetBalanceOptionsBase, TApi, TRes, TSigner>;
|
|
2053
|
+
type TGetTransferableAmountOptionsBase<TRes> = {
|
|
2054
|
+
/**
|
|
2055
|
+
* The sender address of the account.
|
|
2056
|
+
*/
|
|
2113
2057
|
sender: string;
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
2058
|
+
/**
|
|
2059
|
+
* The chain on which to query the balance.
|
|
2060
|
+
*/
|
|
2118
2061
|
origin: TSubstrateChain;
|
|
2062
|
+
/**
|
|
2063
|
+
* The destination chain.
|
|
2064
|
+
*/
|
|
2119
2065
|
destination: TChain;
|
|
2120
|
-
|
|
2066
|
+
/**
|
|
2067
|
+
* The currency to query.
|
|
2068
|
+
*/
|
|
2121
2069
|
currency: WithAmount<TCurrencyCore>;
|
|
2122
|
-
|
|
2123
|
-
isFeeAssetAh: boolean;
|
|
2124
|
-
destFeeDetail: TXcmFeeDetail;
|
|
2125
|
-
totalHopFee: bigint;
|
|
2126
|
-
bridgeFee?: bigint;
|
|
2127
|
-
};
|
|
2128
|
-
type TOriginFeeDetails = {
|
|
2129
|
-
sufficientForXCM: boolean;
|
|
2130
|
-
xcmFee: bigint;
|
|
2131
|
-
};
|
|
2132
|
-
type TGetTransferInfoOptionsBase<TRes> = {
|
|
2070
|
+
version: Version | undefined;
|
|
2133
2071
|
buildTx: TTxFactory<TRes>;
|
|
2072
|
+
feeAsset?: TCurrencyInput;
|
|
2073
|
+
};
|
|
2074
|
+
type TGetTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
2075
|
+
type TGetMinTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes> & {
|
|
2076
|
+
recipient: string;
|
|
2077
|
+
builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>;
|
|
2078
|
+
}, TApi, TRes, TSigner>;
|
|
2079
|
+
type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
2080
|
+
/**
|
|
2081
|
+
* The origin chain.
|
|
2082
|
+
*/
|
|
2134
2083
|
origin: TSubstrateChain;
|
|
2084
|
+
/**
|
|
2085
|
+
* The destination chain.
|
|
2086
|
+
*/
|
|
2135
2087
|
destination: TChain;
|
|
2136
|
-
|
|
2137
|
-
|
|
2088
|
+
/**
|
|
2089
|
+
* The address of the account.
|
|
2090
|
+
*/
|
|
2138
2091
|
recipient: string;
|
|
2092
|
+
/**
|
|
2093
|
+
* The account of the sender.
|
|
2094
|
+
*/
|
|
2095
|
+
sender: string;
|
|
2096
|
+
/**
|
|
2097
|
+
* The currency to query.
|
|
2098
|
+
*/
|
|
2139
2099
|
currency: WithAmount<TCurrencyCore>;
|
|
2140
2100
|
version: Version | undefined;
|
|
2141
|
-
|
|
2101
|
+
buildTx: TTxFactory<TRes>;
|
|
2102
|
+
feeAsset?: TCurrencyInput;
|
|
2142
2103
|
};
|
|
2143
|
-
type
|
|
2104
|
+
type TVerifyEdOnDestinationOptions<TApi, TRes, TSigner> = WithApi<TVerifyEdOnDestinationOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
2105
|
+
|
|
2106
|
+
type TProviderEntry = {
|
|
2107
|
+
name: string;
|
|
2108
|
+
endpoint: string;
|
|
2109
|
+
};
|
|
2110
|
+
type TChainConfig = {
|
|
2111
|
+
name: string;
|
|
2112
|
+
info: string;
|
|
2113
|
+
paraId: number;
|
|
2114
|
+
providers: TProviderEntry[];
|
|
2115
|
+
};
|
|
2116
|
+
type TChainConfigMap = Record<TSubstrateChain, TChainConfig>;
|
|
2117
|
+
|
|
2118
|
+
type OneKey<K extends string, V = unknown> = {
|
|
2119
|
+
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
2120
|
+
[Q in keyof O]: O[Q];
|
|
2121
|
+
} : never;
|
|
2122
|
+
}[K];
|
|
2123
|
+
type TXcmVersioned<T> = OneKey<Version, T>;
|
|
2124
|
+
type TXcmForeignAsset = {
|
|
2125
|
+
ForeignAsset: string | number | bigint | undefined;
|
|
2126
|
+
};
|
|
2127
|
+
type TForeignAssetId = {
|
|
2128
|
+
ForeignAssetId: bigint | undefined;
|
|
2129
|
+
};
|
|
2130
|
+
type TForeignOrTokenAsset = TXcmForeignAsset | {
|
|
2131
|
+
Token: string | undefined;
|
|
2132
|
+
};
|
|
2133
|
+
type TForeignOrNativeAsset = TXcmForeignAsset | 'Native';
|
|
2134
|
+
type TXcmAsset = {
|
|
2135
|
+
XCM: number | undefined;
|
|
2136
|
+
} | {
|
|
2137
|
+
Native: null;
|
|
2138
|
+
};
|
|
2139
|
+
type TNativeTokenAsset = 'NativeToken';
|
|
2140
|
+
type TZeitgeistAsset = 'Ztg';
|
|
2141
|
+
type TOtherReserveAsset = {
|
|
2142
|
+
OtherReserve: string | bigint | undefined;
|
|
2143
|
+
};
|
|
2144
|
+
type TSelfReserveAsset = 'SelfReserve';
|
|
2145
|
+
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
2146
|
+
type TBifrostToken = {
|
|
2147
|
+
Native: string | number;
|
|
2148
|
+
} | {
|
|
2149
|
+
VToken: string;
|
|
2150
|
+
} | {
|
|
2151
|
+
Token: string;
|
|
2152
|
+
} | {
|
|
2153
|
+
VSToken2: number;
|
|
2154
|
+
} | {
|
|
2155
|
+
VToken2: number;
|
|
2156
|
+
} | {
|
|
2157
|
+
Token2: number;
|
|
2158
|
+
};
|
|
2159
|
+
type TXTokensCurrencySelection = TXcmVersioned<TLocation | TAsset | TAsset[]> | TXcmForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TOtherReserveAsset | TBifrostToken | string | bigint | number | undefined;
|
|
2144
2160
|
|
|
2145
2161
|
type TChainWithApi<TApi, TRes, TSigner, T = TSubstrateChain> = {
|
|
2146
2162
|
api: PolkadotApi<TApi, TRes, TSigner>;
|
|
@@ -2148,13 +2164,14 @@ type TChainWithApi<TApi, TRes, TSigner, T = TSubstrateChain> = {
|
|
|
2148
2164
|
};
|
|
2149
2165
|
type TTypeAndThenCallContext<TApi, TRes, TSigner> = {
|
|
2150
2166
|
origin: TChainWithApi<TApi, TRes, TSigner>;
|
|
2151
|
-
dest: TChainWithApi<TApi, TRes, TSigner>;
|
|
2167
|
+
dest: TChainWithApi<TApi, TRes, TSigner, TChain>;
|
|
2152
2168
|
reserve: TChainWithApi<TApi, TRes, TSigner, TChain>;
|
|
2153
2169
|
isSubBridge: boolean;
|
|
2154
2170
|
isSnowbridge: boolean;
|
|
2155
2171
|
isRelayAsset: boolean;
|
|
2156
2172
|
assetInfo: WithAmount<TAssetInfo>;
|
|
2157
2173
|
systemAsset: TAssetInfo;
|
|
2174
|
+
bridgeHopChain?: TSubstrateChain;
|
|
2158
2175
|
options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>;
|
|
2159
2176
|
};
|
|
2160
2177
|
type TTypeAndThenFees = {
|
|
@@ -2209,13 +2226,15 @@ declare const getParaId: (chain: TChain) => number;
|
|
|
2209
2226
|
declare const getTChain: (paraId: number, ecosystem: TRelaychain | TExternalChain) => TChain | null;
|
|
2210
2227
|
|
|
2211
2228
|
interface TEvmExtension {
|
|
2212
|
-
|
|
2229
|
+
executeTransfer: <TApi, TRes, TSigner>(options: TEvmTransferOptions<TApi, TRes, TSigner>) => Promise<string>;
|
|
2230
|
+
buildTransfer: <TApi, TRes, TSigner>(options: TBuildEvmTransferOptions<TApi, TRes, TSigner>) => Promise<TransactionSerializableEIP1559>;
|
|
2213
2231
|
}
|
|
2214
2232
|
declare const registerEvmExtension: (extension: TEvmExtension | undefined) => void;
|
|
2215
2233
|
declare const getEvmExtensionOrThrow: () => TEvmExtension;
|
|
2216
2234
|
|
|
2217
2235
|
interface TEvmSnowbridgeExtension {
|
|
2218
|
-
|
|
2236
|
+
executeTransfer: <TApi, TRes, TSigner>(options: TEvmTransferOptions<TApi, TRes, TSigner>) => Promise<string>;
|
|
2237
|
+
buildTransfer: <TApi, TRes, TSigner>(options: TBuildEvmTransferOptions<TApi, TRes, TSigner>) => Promise<TransactionSerializableEIP1559>;
|
|
2219
2238
|
}
|
|
2220
2239
|
declare const registerEvmSnowbridgeExtension: (extension: TEvmSnowbridgeExtension | undefined) => void;
|
|
2221
2240
|
declare const getEvmSnowbridgeExtensionOrThrow: () => TEvmSnowbridgeExtension;
|
|
@@ -2271,10 +2290,7 @@ declare const transferMoonbeamEvm: <TApi, TRes, TSigner>(options: TEvmTransferOp
|
|
|
2271
2290
|
|
|
2272
2291
|
declare const transferMoonbeamToEth: <TApi, TRes, TSigner>(from: TSubstrateChain, { api, to, signer, recipient, ahAddress, currency }: TEvmTransferOptions<TApi, TRes, TSigner>) => Promise<`0x${string}`>;
|
|
2273
2292
|
|
|
2274
|
-
declare const getOriginXcmFee: <TApi, TRes, TSigner>(options: TGetOriginXcmFeeOptions<TApi, TRes, TSigner>) => Promise<
|
|
2275
|
-
forwardedXcms?: unknown;
|
|
2276
|
-
destParaId?: number;
|
|
2277
|
-
}>;
|
|
2293
|
+
declare const getOriginXcmFee: <TApi, TRes, TSigner, TDisableFallback extends boolean = boolean>(options: TGetOriginXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TXcmFeeDetailWithForwardedXcm<TDisableFallback>>;
|
|
2278
2294
|
|
|
2279
2295
|
declare const getOriginXcmFeeInternal: <TApi, TRes, TSigner>({ api, tx, origin, destination, sender, disableFallback, feeAsset, currency, version, useRootOrigin }: TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner>) => Promise<TXcmFeeDetail & {
|
|
2280
2296
|
forwardedXcms?: any;
|
|
@@ -2288,6 +2304,37 @@ declare const getXcmFeeOnce: <TApi, TRes, TSigner, TDisableFallback extends bool
|
|
|
2288
2304
|
|
|
2289
2305
|
declare const getBridgeStatus: <TApi, TRes, TSigner>(api: PolkadotApi<TApi, TRes, TSigner>) => Promise<TBridgeStatus>;
|
|
2290
2306
|
|
|
2307
|
+
declare const aggregateHopFees: (hops: TXcmFeeHopInfo[], matchAsset: TAssetInfo) => {
|
|
2308
|
+
totalHopFee: bigint;
|
|
2309
|
+
bridgeFee?: bigint;
|
|
2310
|
+
};
|
|
2311
|
+
|
|
2312
|
+
declare const buildDestInfo: <TApi, TRes, TSigner>({ api, origin, destination, recipient, currency, originFee, isFeeAssetAh, destFeeDetail, totalHopFee, bridgeFee }: TBuildDestInfoOptions<TApi, TRes, TSigner>) => Promise<{
|
|
2313
|
+
receivedCurrency: {
|
|
2314
|
+
sufficient: boolean | UnableToComputeError;
|
|
2315
|
+
receivedAmount: bigint | UnableToComputeError;
|
|
2316
|
+
balance: bigint;
|
|
2317
|
+
balanceAfter: bigint | UnableToComputeError;
|
|
2318
|
+
asset: _paraspell_assets.TAssetInfo;
|
|
2319
|
+
};
|
|
2320
|
+
xcmFee: {
|
|
2321
|
+
fee: bigint;
|
|
2322
|
+
balance: bigint;
|
|
2323
|
+
balanceAfter: bigint;
|
|
2324
|
+
asset: _paraspell_assets.TAssetInfo;
|
|
2325
|
+
};
|
|
2326
|
+
}>;
|
|
2327
|
+
|
|
2328
|
+
declare const buildHopInfo: <TApi, TRes, TSigner>({ api, chain, fee, originChain, asset, currency }: BuildHopInfoOptions<TApi, TRes, TSigner>) => Promise<{
|
|
2329
|
+
asset: _paraspell_assets.TAssetInfo;
|
|
2330
|
+
xcmFee: {
|
|
2331
|
+
fee: bigint;
|
|
2332
|
+
asset: _paraspell_assets.TAssetInfo;
|
|
2333
|
+
};
|
|
2334
|
+
}>;
|
|
2335
|
+
|
|
2336
|
+
declare const buildOriginInfo: <TApi, TRes, TSigner>({ api, origin, sender, currency, originAsset, amount, originFee, originFeeAsset, isFeeAssetAh }: TBuildOriginInfoOptions<TApi, TRes, TSigner>) => Promise<TTransferInfo["origin"]>;
|
|
2337
|
+
|
|
2291
2338
|
declare const getTransferInfo: <TApi, TRes, TSigner>({ api, buildTx, origin, destination, sender, ahAddress, recipient, currency, feeAsset, version }: TGetTransferInfoOptions<TApi, TRes, TSigner>) => Promise<TTransferInfo>;
|
|
2292
2339
|
|
|
2293
2340
|
declare const getMinTransferableAmountInternal: <TApi, TRes, TSigner>({ api, origin, sender, recipient, origin: chain, destination, currency, feeAsset, buildTx, builder, version }: TGetMinTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
@@ -2326,7 +2373,9 @@ declare const validateDestinationAddress: <TApi, TRes, TSigner>(address: TAddres
|
|
|
2326
2373
|
declare const assertToIsString: (to: TDestination, overrideMsg?: string) => asserts to is Exclude<TDestination, TLocation>;
|
|
2327
2374
|
declare const assertAddressIsString: (address: TAddress) => asserts address is Exclude<TAddress, TLocation>;
|
|
2328
2375
|
declare const assertSender: (address: string | undefined) => asserts address is string;
|
|
2376
|
+
declare const assertEvmAddress: (address: string) => asserts address is Address;
|
|
2329
2377
|
declare const assertHasId: (asset: TAssetInfo) => asserts asset is TAssetInfoWithId;
|
|
2378
|
+
declare const assertCurrencyCore: <T>(value: T) => asserts value is (T & TCurrencyCore) | (T & undefined);
|
|
2330
2379
|
declare const assertSenderSource: <TSigner>(sender?: TSender<TSigner>) => asserts sender is TSender<TSigner>;
|
|
2331
2380
|
declare const isSenderSigner: <TSigner>(sender: TSender<TSigner>) => sender is TSigner;
|
|
2332
2381
|
declare const assertSwapSupport: <TApi, TRes, TSigner>(options: TSwapOptions<TApi, TRes, TSigner> | undefined) => void;
|
|
@@ -2353,7 +2402,7 @@ declare const createTxOverrideAmount: <TApi, TRes, TSigner>(options: TCreateTxsO
|
|
|
2353
2402
|
declare const createTransferOrSwapAll: <TApi, TRes, TSigner>(options: TSubstrateTransferOptions<TApi, TRes, TSigner>) => Promise<TTransactionContext<TApi, TRes>[]>;
|
|
2354
2403
|
declare const createTransferOrSwap: <TApi, TRes, TSigner>(options: TSubstrateTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2355
2404
|
|
|
2356
|
-
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation) =>
|
|
2405
|
+
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation, resolveExternalReserve?: boolean) => TChain;
|
|
2357
2406
|
|
|
2358
2407
|
declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
2359
2408
|
|
|
@@ -2396,7 +2445,7 @@ declare const isViemSigner: (value: unknown) => value is WalletClient;
|
|
|
2396
2445
|
declare const createBeneficiaryLocXTokens: <TApi, TRes, TSigner>({ api, recipient, origin, destination, version, paraId }: TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2397
2446
|
declare const createBeneficiaryLocation: <TApi, TRes, TSigner>({ api, address, version }: TCreateBeneficiaryOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2398
2447
|
|
|
2399
|
-
declare const createDestination: (version: Version, origin:
|
|
2448
|
+
declare const createDestination: (version: Version, origin: TChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TLocation;
|
|
2400
2449
|
declare const createVersionedDestination: (version: Version, origin: TSubstrateChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TXcmVersioned<TLocation>;
|
|
2401
2450
|
|
|
2402
2451
|
declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
|
|
@@ -2418,7 +2467,7 @@ declare const reverseTransformLocation: (location: TLocation) => TLocation;
|
|
|
2418
2467
|
|
|
2419
2468
|
declare const normalizeAmount: (amount: bigint) => bigint;
|
|
2420
2469
|
|
|
2421
|
-
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" | "
|
|
2470
|
+
declare const resolveDestChain: (originChain: TSubstrateChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "Darwinia" | "EnergyWebX" | "Hydration" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "NeuroWeb" | "Pendulum" | "Mythos" | "Peaq" | "PeoplePolkadot" | "Unique" | "Xode" | "AssetHubKusama" | "BridgeHubKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "Laos" | "Quartz" | "RobonomicsPolkadot" | "PeopleKusama" | "Shiden" | "Zeitgeist" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AjunaPaseo" | "AssetHubPaseo" | "BifrostPaseo" | "BridgeHubPaseo" | "CoretimePaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "LaosPaseo" | "NeuroWebPaseo" | "PeoplePaseo" | "ZeitgeistPaseo" | undefined;
|
|
2422
2471
|
|
|
2423
2472
|
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
2424
2473
|
|
|
@@ -2471,5 +2520,5 @@ declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersi
|
|
|
2471
2520
|
declare const pickCompatibleXcmVersion: (origin: TSubstrateChain, destination: TDestination, override?: Version) => Version;
|
|
2472
2521
|
declare const pickRouterCompatibleXcmVersion: (origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2473
2522
|
|
|
2474
|
-
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2475
|
-
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedTransferOptions, TBifrostToken, TBridgeStatus, TBuildAllInternalRes, TBuildDestInfoOptions, TBuildInternalRes, TBuildInternalResBase, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainEndpoint, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateEthBridgeInstructionsOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight,
|
|
2523
|
+
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2b256, blake2b512, buildDestInfo, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2524
|
+
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedTransferOptions, TBifrostToken, TBridgeStatus, TBuildAllInternalRes, TBuildDestInfoOptions, TBuildEvmTransferOptions, TBuildInternalRes, TBuildInternalResBase, TBuildOriginInfoOptions, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainEndpoint, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateEthBridgeInstructionsOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmExtension, TEvmSnowbridgeExtension, TEvmTransferOptions, TEvmTransferOptionsBase, TExchangeChain, TExchangeInput, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TModuleError, TNativeTokenAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSender, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSubstrateTransferBaseOptions, TSubstrateTransferBaseOptionsWithSender, TSubstrateTransferOptions, TSwapBuilder, TSwapBuilderFactory, TSwapConfig, TSwapEvent, TSwapEventType, TSwapExtension, TSwapFeeEstimates, TSwapOptions, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferBaseOptions, TTransferBaseOptionsWithSender, TTransferBaseOptionsWithSwap, TTransferFeeEstimates, TTransferInfo, TTransferInternalOptions, TTransferLocalOptions, TTransferOptions, TTransferOptionsWithSwap, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeDetailWithForwardedXcm, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSender, WithRequiredSwapOptions };
|