@paraspell/sdk-core 11.12.2 → 11.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +389 -333
- package/dist/index.d.ts +211 -207
- package/dist/index.mjs +391 -335
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -546,6 +546,212 @@ declare class GeneralBuilder<TApi, TRes, T extends Partial<TSendBaseOptions> = o
|
|
|
546
546
|
*/
|
|
547
547
|
declare const Builder: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => GeneralBuilder<TApi, TRes, object>;
|
|
548
548
|
|
|
549
|
+
type TSwapConfig = {
|
|
550
|
+
currencyTo: TCurrencyCore;
|
|
551
|
+
exchangeChain: TParachain;
|
|
552
|
+
};
|
|
553
|
+
type TDryRunBaseOptions<TRes> = {
|
|
554
|
+
tx: TRes;
|
|
555
|
+
origin: TSubstrateChain;
|
|
556
|
+
destination: TChain;
|
|
557
|
+
senderAddress: string;
|
|
558
|
+
address: string;
|
|
559
|
+
currency: TCurrencyInputWithAmount;
|
|
560
|
+
feeAsset?: TCurrencyInput;
|
|
561
|
+
swapConfig?: TSwapConfig;
|
|
562
|
+
useRootOrigin?: boolean;
|
|
563
|
+
bypassOptions?: TBypassOptions;
|
|
564
|
+
};
|
|
565
|
+
type TDryRunOptions<TApi, TRes> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes>;
|
|
566
|
+
type TDryRunCallBaseOptions<TRes> = {
|
|
567
|
+
/**
|
|
568
|
+
* The transaction to dry-run
|
|
569
|
+
*/
|
|
570
|
+
tx: TRes;
|
|
571
|
+
/**
|
|
572
|
+
* The chain to dry-run on
|
|
573
|
+
*/
|
|
574
|
+
chain: TSubstrateChain;
|
|
575
|
+
/**
|
|
576
|
+
* The destination chain
|
|
577
|
+
*/
|
|
578
|
+
destination: TDestination;
|
|
579
|
+
/**
|
|
580
|
+
* The address to dry-run with
|
|
581
|
+
*/
|
|
582
|
+
address: string;
|
|
583
|
+
/**
|
|
584
|
+
* Whether to use the root origin
|
|
585
|
+
*/
|
|
586
|
+
useRootOrigin?: boolean;
|
|
587
|
+
asset: WithAmount<TAssetInfo>;
|
|
588
|
+
bypassOptions?: TBypassOptions;
|
|
589
|
+
feeAsset?: TAssetInfo;
|
|
590
|
+
};
|
|
591
|
+
type TDryRunBypassOptions<TApi, TRes> = WithApi<Omit<TDryRunCallBaseOptions<TRes>, 'useRootOrigin' | 'destination'>, TApi, TRes>;
|
|
592
|
+
type TDryRunCallOptions<TApi, TRes> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes>;
|
|
593
|
+
type TDryRunXcmBaseOptions<TRes> = {
|
|
594
|
+
originLocation: any;
|
|
595
|
+
/**
|
|
596
|
+
* The XCM instructions
|
|
597
|
+
*/
|
|
598
|
+
xcm: any;
|
|
599
|
+
/** The transaction to dry-run */
|
|
600
|
+
tx: TRes;
|
|
601
|
+
/**
|
|
602
|
+
* The chain to dry-run on
|
|
603
|
+
*/
|
|
604
|
+
chain: TSubstrateChain;
|
|
605
|
+
/**
|
|
606
|
+
* The origin chain
|
|
607
|
+
*/
|
|
608
|
+
origin: TSubstrateChain;
|
|
609
|
+
asset: TAssetInfo;
|
|
610
|
+
feeAsset?: TAssetInfo;
|
|
611
|
+
amount: bigint;
|
|
612
|
+
originFee: bigint;
|
|
613
|
+
};
|
|
614
|
+
type TDryRunXcmOptions<TApi, TRes> = WithApi<TDryRunXcmBaseOptions<TRes>, TApi, TRes>;
|
|
615
|
+
type TDryRunResBase = {
|
|
616
|
+
/** @deprecated Use `asset` property instead. */
|
|
617
|
+
currency: string;
|
|
618
|
+
asset: TAssetInfo;
|
|
619
|
+
};
|
|
620
|
+
type TDryRunChainSuccess = TDryRunResBase & {
|
|
621
|
+
success: true;
|
|
622
|
+
fee: bigint;
|
|
623
|
+
weight?: TWeight;
|
|
624
|
+
forwardedXcms: any;
|
|
625
|
+
destParaId?: number;
|
|
626
|
+
};
|
|
627
|
+
type TDryRunChainFailure = TDryRunResBase & {
|
|
628
|
+
success: false;
|
|
629
|
+
failureReason: string;
|
|
630
|
+
};
|
|
631
|
+
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
632
|
+
type THopInfo = {
|
|
633
|
+
chain: TChain;
|
|
634
|
+
result: TDryRunChainResult;
|
|
635
|
+
};
|
|
636
|
+
type TDryRunChain = 'origin' | 'destination' | 'assetHub' | 'bridgeHub' | TChain;
|
|
637
|
+
type TDryRunResult = {
|
|
638
|
+
failureReason?: string;
|
|
639
|
+
failureChain?: TDryRunChain;
|
|
640
|
+
origin: TDryRunChainResult;
|
|
641
|
+
destination?: TDryRunChainResult;
|
|
642
|
+
assetHub?: TDryRunChainResult;
|
|
643
|
+
bridgeHub?: TDryRunChainResult;
|
|
644
|
+
hops: THopInfo[];
|
|
645
|
+
};
|
|
646
|
+
type TResolveHopParams = {
|
|
647
|
+
originChain: TSubstrateChain;
|
|
648
|
+
currentChain: TSubstrateChain;
|
|
649
|
+
asset: TAssetInfo;
|
|
650
|
+
currency: TCurrencyInputWithAmount;
|
|
651
|
+
swapConfig?: TSwapConfig;
|
|
652
|
+
hasPassedExchange: boolean;
|
|
653
|
+
};
|
|
654
|
+
type HopProcessParams<TApi, TRes> = {
|
|
655
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
656
|
+
currentChain: TSubstrateChain;
|
|
657
|
+
currentOrigin: TSubstrateChain;
|
|
658
|
+
currentAsset: TAssetInfo;
|
|
659
|
+
forwardedXcms: any;
|
|
660
|
+
hasPassedExchange: boolean;
|
|
661
|
+
isDestination: boolean;
|
|
662
|
+
isAssetHub: boolean;
|
|
663
|
+
isBridgeHub: boolean;
|
|
664
|
+
};
|
|
665
|
+
type HopTraversalConfig<TApi, TRes, THopResult> = {
|
|
666
|
+
api: IPolkadotApi<TApi, TRes>;
|
|
667
|
+
origin: TSubstrateChain;
|
|
668
|
+
destination: TChain;
|
|
669
|
+
currency: TCurrencyCore;
|
|
670
|
+
initialForwardedXcms: any;
|
|
671
|
+
initialDestParaId: number | undefined;
|
|
672
|
+
swapConfig?: TSwapConfig;
|
|
673
|
+
processHop: (params: HopProcessParams<TApi, TRes>) => Promise<THopResult>;
|
|
674
|
+
shouldContinue: (hopResult: THopResult) => boolean;
|
|
675
|
+
extractNextHopData: (hopResult: THopResult) => {
|
|
676
|
+
forwardedXcms: any;
|
|
677
|
+
destParaId: number | undefined;
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
type HopTraversalResult<THopResult> = {
|
|
681
|
+
hops: Array<{
|
|
682
|
+
chain: TSubstrateChain;
|
|
683
|
+
result: THopResult;
|
|
684
|
+
}>;
|
|
685
|
+
assetHub?: THopResult;
|
|
686
|
+
bridgeHub?: THopResult;
|
|
687
|
+
destination?: THopResult;
|
|
688
|
+
lastProcessedChain?: TSubstrateChain;
|
|
689
|
+
};
|
|
690
|
+
type TBypassOptions = {
|
|
691
|
+
mintFeeAssets?: boolean;
|
|
692
|
+
sentAssetMintMode?: 'preview' | 'bypass';
|
|
693
|
+
};
|
|
694
|
+
declare enum XTokensError {
|
|
695
|
+
AssetHasNoReserve = "AssetHasNoReserve",
|
|
696
|
+
NotCrossChainTransfer = "NotCrossChainTransfer",
|
|
697
|
+
InvalidDest = "InvalidDest",
|
|
698
|
+
NotCrossChainTransferableCurrency = "NotCrossChainTransferableCurrency",
|
|
699
|
+
UnweighableMessage = "UnweighableMessage",
|
|
700
|
+
XcmExecutionFailed = "XcmExecutionFailed",
|
|
701
|
+
CannotReanchor = "CannotReanchor",
|
|
702
|
+
InvalidAncestry = "InvalidAncestry",
|
|
703
|
+
InvalidAsset = "InvalidAsset",
|
|
704
|
+
DestinationNotInvertible = "DestinationNotInvertible",
|
|
705
|
+
BadVersion = "BadVersion",
|
|
706
|
+
DistinctReserveForAssetAndFee = "DistinctReserveForAssetAndFee",
|
|
707
|
+
ZeroFee = "ZeroFee",
|
|
708
|
+
ZeroAmount = "ZeroAmount",
|
|
709
|
+
TooManyAssetsBeingSent = "TooManyAssetsBeingSent",
|
|
710
|
+
AssetIndexNonExistent = "AssetIndexNonExistent",
|
|
711
|
+
FeeNotEnough = "FeeNotEnough",
|
|
712
|
+
NotSupportedLocation = "NotSupportedLocation",
|
|
713
|
+
MinXcmFeeNotDefined = "MinXcmFeeNotDefined",
|
|
714
|
+
RateLimited = "RateLimited"
|
|
715
|
+
}
|
|
716
|
+
declare enum PolkadotXcmError {
|
|
717
|
+
Unreachable = "Unreachable",
|
|
718
|
+
SendFailure = "SendFailure",
|
|
719
|
+
Filtered = "Filtered",
|
|
720
|
+
UnweighableMessage = "UnweighableMessage",
|
|
721
|
+
DestinationNotInvertible = "DestinationNotInvertible",
|
|
722
|
+
Empty = "Empty",
|
|
723
|
+
CannotReanchor = "CannotReanchor",
|
|
724
|
+
TooManyAssets = "TooManyAssets",
|
|
725
|
+
InvalidOrigin = "InvalidOrigin",
|
|
726
|
+
BadVersion = "BadVersion",
|
|
727
|
+
BadLocation = "BadLocation",
|
|
728
|
+
NoSubscription = "NoSubscription",
|
|
729
|
+
AlreadySubscribed = "AlreadySubscribed",
|
|
730
|
+
CannotCheckOutTeleport = "CannotCheckOutTeleport",
|
|
731
|
+
LowBalance = "LowBalance",
|
|
732
|
+
TooManyLocks = "TooManyLocks",
|
|
733
|
+
AccountNotSovereign = "AccountNotSovereign",
|
|
734
|
+
FeesNotMet = "FeesNotMet",
|
|
735
|
+
LockNotFound = "LockNotFound",
|
|
736
|
+
InUse = "InUse",
|
|
737
|
+
REMOVED = "REMOVED",
|
|
738
|
+
InvalidAssetUnknownReserve = "InvalidAssetUnknownReserve",
|
|
739
|
+
InvalidAssetUnsupportedReserve = "InvalidAssetUnsupportedReserve",
|
|
740
|
+
TooManyReserves = "TooManyReserves",
|
|
741
|
+
LocalExecutionIncomplete = "LocalExecutionIncomplete",
|
|
742
|
+
TooManyAuthorizedAliases = "TooManyAuthorizedAliases",
|
|
743
|
+
ExpiresInPast = "ExpiresInPast",
|
|
744
|
+
AliasNotFound = "AliasNotFound",
|
|
745
|
+
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
746
|
+
}
|
|
747
|
+
type TModuleError = {
|
|
748
|
+
index: string;
|
|
749
|
+
error: string;
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
type TXcmFeeSwapConfig = TSwapConfig & {
|
|
753
|
+
amountOut: bigint;
|
|
754
|
+
};
|
|
549
755
|
type TTxFactory<TRes> = (amount?: string) => Promise<TRes>;
|
|
550
756
|
type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
551
757
|
/**
|
|
@@ -568,7 +774,7 @@ type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
|
568
774
|
currency: WithAmount<TCurrencyCore>;
|
|
569
775
|
feeAsset?: TCurrencyInput;
|
|
570
776
|
disableFallback: TDisableFallback;
|
|
571
|
-
swapConfig?:
|
|
777
|
+
swapConfig?: TXcmFeeSwapConfig;
|
|
572
778
|
};
|
|
573
779
|
type TGetXcmFeeOptions<TApi, TRes, TDisableFallback extends boolean = boolean> = WithApi<TGetXcmFeeBaseOptions<TRes, TDisableFallback>, TApi, TRes>;
|
|
574
780
|
type TGetXcmFeeInternalOptions<TApi, TRes, TDisableFallback extends boolean = boolean> = Omit<TGetXcmFeeOptions<TApi, TRes, TDisableFallback>, 'buildTx'> & {
|
|
@@ -594,11 +800,6 @@ type TGetOriginXcmFeeOptions<TApi, TRes> = WithApi<TGetOriginXcmFeeBaseOptions<T
|
|
|
594
800
|
type TGetOriginXcmFeeInternalOptions<TApi, TRes> = Omit<TGetOriginXcmFeeOptions<TApi, TRes>, 'buildTx'> & {
|
|
595
801
|
tx: TRes;
|
|
596
802
|
};
|
|
597
|
-
type TSwapConfig = {
|
|
598
|
-
currencyTo: TCurrencyCore;
|
|
599
|
-
amountOut: bigint;
|
|
600
|
-
exchangeChain: TParachain;
|
|
601
|
-
};
|
|
602
803
|
type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
603
804
|
prevChain: TSubstrateChain;
|
|
604
805
|
origin: TSubstrateChain;
|
|
@@ -613,7 +814,7 @@ type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
|
613
814
|
feeAsset?: TCurrencyInput;
|
|
614
815
|
disableFallback: boolean;
|
|
615
816
|
hasPassedExchange?: boolean;
|
|
616
|
-
swapConfig?:
|
|
817
|
+
swapConfig?: TXcmFeeSwapConfig;
|
|
617
818
|
};
|
|
618
819
|
type TGetFeeForDestChainOptions<TApi, TRes> = WithApi<TGetFeeForDestChainBaseOptions<TRes>, TApi, TRes>;
|
|
619
820
|
type TGetReverseTxFeeOptions<TApi, TRes> = Omit<TGetFeeForDestChainOptions<TApi, TRes>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevChain'> & {
|
|
@@ -977,203 +1178,6 @@ type TBifrostToken = {
|
|
|
977
1178
|
};
|
|
978
1179
|
type TXTokensCurrencySelection = TXcmVersioned<TLocation | TAsset | TAsset[]> | TXcmForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | TBifrostToken | string | bigint | number | undefined;
|
|
979
1180
|
|
|
980
|
-
type TDryRunBaseOptions<TRes> = {
|
|
981
|
-
tx: TRes;
|
|
982
|
-
origin: TSubstrateChain;
|
|
983
|
-
destination: TChain;
|
|
984
|
-
senderAddress: string;
|
|
985
|
-
address: string;
|
|
986
|
-
currency: TCurrencyInputWithAmount;
|
|
987
|
-
feeAsset?: TCurrencyInput;
|
|
988
|
-
swapConfig?: {
|
|
989
|
-
currencyTo: TCurrencyCore;
|
|
990
|
-
exchangeChain: TParachain;
|
|
991
|
-
};
|
|
992
|
-
useRootOrigin?: boolean;
|
|
993
|
-
bypassOptions?: TBypassOptions;
|
|
994
|
-
};
|
|
995
|
-
type TDryRunOptions<TApi, TRes> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes>;
|
|
996
|
-
type TDryRunCallBaseOptions<TRes> = {
|
|
997
|
-
/**
|
|
998
|
-
* The transaction to dry-run
|
|
999
|
-
*/
|
|
1000
|
-
tx: TRes;
|
|
1001
|
-
/**
|
|
1002
|
-
* The chain to dry-run on
|
|
1003
|
-
*/
|
|
1004
|
-
chain: TSubstrateChain;
|
|
1005
|
-
/**
|
|
1006
|
-
* The destination chain
|
|
1007
|
-
*/
|
|
1008
|
-
destination: TDestination;
|
|
1009
|
-
/**
|
|
1010
|
-
* The address to dry-run with
|
|
1011
|
-
*/
|
|
1012
|
-
address: string;
|
|
1013
|
-
/**
|
|
1014
|
-
* Whether to use the root origin
|
|
1015
|
-
*/
|
|
1016
|
-
useRootOrigin?: boolean;
|
|
1017
|
-
asset: WithAmount<TAssetInfo>;
|
|
1018
|
-
bypassOptions?: TBypassOptions;
|
|
1019
|
-
feeAsset?: TAssetInfo;
|
|
1020
|
-
};
|
|
1021
|
-
type TDryRunBypassOptions<TApi, TRes> = WithApi<Omit<TDryRunCallBaseOptions<TRes>, 'useRootOrigin' | 'destination'>, TApi, TRes>;
|
|
1022
|
-
type TDryRunCallOptions<TApi, TRes> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes>;
|
|
1023
|
-
type TDryRunXcmBaseOptions<TRes> = {
|
|
1024
|
-
originLocation: any;
|
|
1025
|
-
/**
|
|
1026
|
-
* The XCM instructions
|
|
1027
|
-
*/
|
|
1028
|
-
xcm: any;
|
|
1029
|
-
/** The transaction to dry-run */
|
|
1030
|
-
tx: TRes;
|
|
1031
|
-
/**
|
|
1032
|
-
* The chain to dry-run on
|
|
1033
|
-
*/
|
|
1034
|
-
chain: TSubstrateChain;
|
|
1035
|
-
/**
|
|
1036
|
-
* The origin chain
|
|
1037
|
-
*/
|
|
1038
|
-
origin: TSubstrateChain;
|
|
1039
|
-
asset: TAssetInfo;
|
|
1040
|
-
feeAsset?: TAssetInfo;
|
|
1041
|
-
amount: bigint;
|
|
1042
|
-
originFee: bigint;
|
|
1043
|
-
};
|
|
1044
|
-
type TDryRunXcmOptions<TApi, TRes> = WithApi<TDryRunXcmBaseOptions<TRes>, TApi, TRes>;
|
|
1045
|
-
type TDryRunResBase = {
|
|
1046
|
-
/** @deprecated Use `asset` property instead. */
|
|
1047
|
-
currency: string;
|
|
1048
|
-
asset: TAssetInfo;
|
|
1049
|
-
};
|
|
1050
|
-
type TDryRunChainSuccess = TDryRunResBase & {
|
|
1051
|
-
success: true;
|
|
1052
|
-
fee: bigint;
|
|
1053
|
-
weight?: TWeight;
|
|
1054
|
-
forwardedXcms: any;
|
|
1055
|
-
destParaId?: number;
|
|
1056
|
-
};
|
|
1057
|
-
type TDryRunChainFailure = TDryRunResBase & {
|
|
1058
|
-
success: false;
|
|
1059
|
-
failureReason: string;
|
|
1060
|
-
};
|
|
1061
|
-
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
1062
|
-
type THopInfo = {
|
|
1063
|
-
chain: TChain;
|
|
1064
|
-
result: TDryRunChainResult;
|
|
1065
|
-
};
|
|
1066
|
-
type TDryRunChain = 'origin' | 'destination' | 'assetHub' | 'bridgeHub' | TChain;
|
|
1067
|
-
type TDryRunResult = {
|
|
1068
|
-
failureReason?: string;
|
|
1069
|
-
failureChain?: TDryRunChain;
|
|
1070
|
-
origin: TDryRunChainResult;
|
|
1071
|
-
destination?: TDryRunChainResult;
|
|
1072
|
-
assetHub?: TDryRunChainResult;
|
|
1073
|
-
bridgeHub?: TDryRunChainResult;
|
|
1074
|
-
hops: THopInfo[];
|
|
1075
|
-
};
|
|
1076
|
-
type HopProcessParams<TApi, TRes> = {
|
|
1077
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
1078
|
-
currentChain: TSubstrateChain;
|
|
1079
|
-
currentOrigin: TSubstrateChain;
|
|
1080
|
-
currentAsset: TAssetInfo;
|
|
1081
|
-
forwardedXcms: any;
|
|
1082
|
-
hasPassedExchange: boolean;
|
|
1083
|
-
isDestination: boolean;
|
|
1084
|
-
isAssetHub: boolean;
|
|
1085
|
-
isBridgeHub: boolean;
|
|
1086
|
-
};
|
|
1087
|
-
type HopTraversalConfig<TApi, TRes, THopResult> = {
|
|
1088
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
1089
|
-
origin: TSubstrateChain;
|
|
1090
|
-
destination: TChain;
|
|
1091
|
-
currency: TCurrencyCore;
|
|
1092
|
-
initialForwardedXcms: any;
|
|
1093
|
-
initialDestParaId: number | undefined;
|
|
1094
|
-
swapConfig?: {
|
|
1095
|
-
exchangeChain: TParachain;
|
|
1096
|
-
currencyTo: TCurrencyCore;
|
|
1097
|
-
};
|
|
1098
|
-
processHop: (params: HopProcessParams<TApi, TRes>) => Promise<THopResult>;
|
|
1099
|
-
shouldContinue: (hopResult: THopResult) => boolean;
|
|
1100
|
-
extractNextHopData: (hopResult: THopResult) => {
|
|
1101
|
-
forwardedXcms: any;
|
|
1102
|
-
destParaId: number | undefined;
|
|
1103
|
-
};
|
|
1104
|
-
};
|
|
1105
|
-
type HopTraversalResult<THopResult> = {
|
|
1106
|
-
hops: Array<{
|
|
1107
|
-
chain: TSubstrateChain;
|
|
1108
|
-
result: THopResult;
|
|
1109
|
-
}>;
|
|
1110
|
-
assetHub?: THopResult;
|
|
1111
|
-
bridgeHub?: THopResult;
|
|
1112
|
-
destination?: THopResult;
|
|
1113
|
-
lastProcessedChain?: TSubstrateChain;
|
|
1114
|
-
};
|
|
1115
|
-
type TBypassOptions = {
|
|
1116
|
-
mintFeeAssets?: boolean;
|
|
1117
|
-
sentAssetMintMode?: 'preview' | 'bypass';
|
|
1118
|
-
};
|
|
1119
|
-
declare enum XTokensError {
|
|
1120
|
-
AssetHasNoReserve = "AssetHasNoReserve",
|
|
1121
|
-
NotCrossChainTransfer = "NotCrossChainTransfer",
|
|
1122
|
-
InvalidDest = "InvalidDest",
|
|
1123
|
-
NotCrossChainTransferableCurrency = "NotCrossChainTransferableCurrency",
|
|
1124
|
-
UnweighableMessage = "UnweighableMessage",
|
|
1125
|
-
XcmExecutionFailed = "XcmExecutionFailed",
|
|
1126
|
-
CannotReanchor = "CannotReanchor",
|
|
1127
|
-
InvalidAncestry = "InvalidAncestry",
|
|
1128
|
-
InvalidAsset = "InvalidAsset",
|
|
1129
|
-
DestinationNotInvertible = "DestinationNotInvertible",
|
|
1130
|
-
BadVersion = "BadVersion",
|
|
1131
|
-
DistinctReserveForAssetAndFee = "DistinctReserveForAssetAndFee",
|
|
1132
|
-
ZeroFee = "ZeroFee",
|
|
1133
|
-
ZeroAmount = "ZeroAmount",
|
|
1134
|
-
TooManyAssetsBeingSent = "TooManyAssetsBeingSent",
|
|
1135
|
-
AssetIndexNonExistent = "AssetIndexNonExistent",
|
|
1136
|
-
FeeNotEnough = "FeeNotEnough",
|
|
1137
|
-
NotSupportedLocation = "NotSupportedLocation",
|
|
1138
|
-
MinXcmFeeNotDefined = "MinXcmFeeNotDefined",
|
|
1139
|
-
RateLimited = "RateLimited"
|
|
1140
|
-
}
|
|
1141
|
-
declare enum PolkadotXcmError {
|
|
1142
|
-
Unreachable = "Unreachable",
|
|
1143
|
-
SendFailure = "SendFailure",
|
|
1144
|
-
Filtered = "Filtered",
|
|
1145
|
-
UnweighableMessage = "UnweighableMessage",
|
|
1146
|
-
DestinationNotInvertible = "DestinationNotInvertible",
|
|
1147
|
-
Empty = "Empty",
|
|
1148
|
-
CannotReanchor = "CannotReanchor",
|
|
1149
|
-
TooManyAssets = "TooManyAssets",
|
|
1150
|
-
InvalidOrigin = "InvalidOrigin",
|
|
1151
|
-
BadVersion = "BadVersion",
|
|
1152
|
-
BadLocation = "BadLocation",
|
|
1153
|
-
NoSubscription = "NoSubscription",
|
|
1154
|
-
AlreadySubscribed = "AlreadySubscribed",
|
|
1155
|
-
CannotCheckOutTeleport = "CannotCheckOutTeleport",
|
|
1156
|
-
LowBalance = "LowBalance",
|
|
1157
|
-
TooManyLocks = "TooManyLocks",
|
|
1158
|
-
AccountNotSovereign = "AccountNotSovereign",
|
|
1159
|
-
FeesNotMet = "FeesNotMet",
|
|
1160
|
-
LockNotFound = "LockNotFound",
|
|
1161
|
-
InUse = "InUse",
|
|
1162
|
-
REMOVED = "REMOVED",
|
|
1163
|
-
InvalidAssetUnknownReserve = "InvalidAssetUnknownReserve",
|
|
1164
|
-
InvalidAssetUnsupportedReserve = "InvalidAssetUnsupportedReserve",
|
|
1165
|
-
TooManyReserves = "TooManyReserves",
|
|
1166
|
-
LocalExecutionIncomplete = "LocalExecutionIncomplete",
|
|
1167
|
-
TooManyAuthorizedAliases = "TooManyAuthorizedAliases",
|
|
1168
|
-
ExpiresInPast = "ExpiresInPast",
|
|
1169
|
-
AliasNotFound = "AliasNotFound",
|
|
1170
|
-
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
1171
|
-
}
|
|
1172
|
-
type TModuleError = {
|
|
1173
|
-
index: string;
|
|
1174
|
-
error: string;
|
|
1175
|
-
};
|
|
1176
|
-
|
|
1177
1181
|
declare class AmountTooLowError extends Error {
|
|
1178
1182
|
constructor(message?: string);
|
|
1179
1183
|
}
|
|
@@ -1425,6 +1429,7 @@ type TTypeAndThenCallContext<TApi, TRes> = {
|
|
|
1425
1429
|
origin: TChainWithApi<TApi, TRes>;
|
|
1426
1430
|
dest: TChainWithApi<TApi, TRes>;
|
|
1427
1431
|
reserve: TChainWithApi<TApi, TRes, TSubstrateChain>;
|
|
1432
|
+
isSubBridge: boolean;
|
|
1428
1433
|
assetInfo: WithAmount<TAssetWithLocation>;
|
|
1429
1434
|
options: TPolkadotXCMTransferOptions<TApi, TRes>;
|
|
1430
1435
|
};
|
|
@@ -1577,7 +1582,6 @@ declare class AssetHubKusama<TApi, TRes> extends Parachain<TApi, TRes> implement
|
|
|
1577
1582
|
|
|
1578
1583
|
declare class AssetHubPolkadot<TApi, TRes> extends Parachain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1579
1584
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1580
|
-
handleBridgeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>, targetChain: 'Polkadot' | 'Kusama'): Promise<TRes>;
|
|
1581
1585
|
handleEthBridgeNativeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1582
1586
|
handleEthBridgeTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1583
1587
|
handleMythosTransfer<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
@@ -2296,7 +2300,7 @@ declare const getChainLocation: (chain: TChain, destChain: TChain) => TLocation;
|
|
|
2296
2300
|
* @param location - The location to localize
|
|
2297
2301
|
* @returns The localized location
|
|
2298
2302
|
*/
|
|
2299
|
-
declare const localizeLocation: (chain: TChain, location: TLocation) => TLocation;
|
|
2303
|
+
declare const localizeLocation: (chain: TChain, location: TLocation, origin?: TChain) => TLocation;
|
|
2300
2304
|
|
|
2301
2305
|
declare const reverseTransformLocation: (location: TLocation) => TLocation;
|
|
2302
2306
|
|
|
@@ -2340,4 +2344,4 @@ declare const formatUnits: typeof formatUnits$1;
|
|
|
2340
2344
|
declare const validateAddress: (address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2341
2345
|
|
|
2342
2346
|
export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
|
|
2343
|
-
export type { BuildHopInfoOptions, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderOptions, TBypassOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignByAssetOptions, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|
|
2347
|
+
export type { BuildHopInfoOptions, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderOptions, TBypassOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignByAssetOptions, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|