@paraspell/sdk-core 12.9.6 → 13.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +125 -163
- package/dist/index.mjs +484 -713
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ interface IPolkadotApi<TApi, TRes, TSigner> {
|
|
|
82
82
|
deriveAddress(path: string): string;
|
|
83
83
|
deriveAddress(sender: TSender<TSigner>): string;
|
|
84
84
|
signAndSubmit(tx: TRes, sender: TSender<TSigner>): Promise<string>;
|
|
85
|
+
signAndSubmitFinalized(tx: TRes, sender: TSender<TSigner>): Promise<string>;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
declare abstract class Chain<TApi, TRes, TSigner> {
|
|
@@ -94,17 +95,17 @@ declare abstract class Chain<TApi, TRes, TSigner> {
|
|
|
94
95
|
get ecosystem(): TRelaychain;
|
|
95
96
|
get chain(): TSubstrateChain$1;
|
|
96
97
|
get version(): Version;
|
|
97
|
-
transfer(
|
|
98
|
+
transfer(transferOptions: TTransferInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
98
99
|
isRelayToParaEnabled(): boolean;
|
|
99
100
|
throwIfCantReceive(destChain: TChain$1 | undefined): void;
|
|
100
|
-
throwIfTempDisabled(options:
|
|
101
|
-
isSendingTempDisabled(_options:
|
|
101
|
+
throwIfTempDisabled(options: TTransferInternalOptions<TApi, TRes, TSigner>, destChain?: TChain$1): void;
|
|
102
|
+
isSendingTempDisabled(_options: TTransferInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
102
103
|
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
103
104
|
canReceiveFrom(_origin: TChain$1): boolean;
|
|
104
|
-
shouldUseNativeAssetTeleport({ assetInfo: asset, to }:
|
|
105
|
+
shouldUseNativeAssetTeleport({ assetInfo: asset, to }: TTransferInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
105
106
|
createAsset(asset: WithAmount<TAssetInfo>, version: Version): TAsset;
|
|
106
107
|
getNativeAssetSymbol(): string;
|
|
107
|
-
transferLocal(options:
|
|
108
|
+
transferLocal(options: TTransferInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
108
109
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
109
110
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
110
111
|
protected transferToEthereum<TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, useOnlyDepositInstruction?: boolean): Promise<TRes>;
|
|
@@ -652,7 +653,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
|
652
653
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
653
654
|
chain: TSubstrateChain$1;
|
|
654
655
|
beneficiaryLocation: TLocation;
|
|
655
|
-
|
|
656
|
+
recipient: TAddress;
|
|
656
657
|
asset: TAsset;
|
|
657
658
|
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
658
659
|
scenario: TScenario;
|
|
@@ -664,7 +665,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
|
664
665
|
destChain?: TChain$1;
|
|
665
666
|
paraIdTo?: number;
|
|
666
667
|
version: Version;
|
|
667
|
-
|
|
668
|
+
sender?: string;
|
|
668
669
|
ahAddress?: string;
|
|
669
670
|
pallet?: string;
|
|
670
671
|
method?: string;
|
|
@@ -673,7 +674,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
|
673
674
|
type TXTokensTransferOptions<TApi, TRes, TSigner> = {
|
|
674
675
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
675
676
|
asset: WithAmount<TAssetInfo>;
|
|
676
|
-
|
|
677
|
+
recipient: TAddress;
|
|
677
678
|
scenario: TScenario;
|
|
678
679
|
origin: TSubstrateChain$1;
|
|
679
680
|
destination: TDestination;
|
|
@@ -693,7 +694,7 @@ interface IXTokensTransfer<TApi, TRes, TSigner> {
|
|
|
693
694
|
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
694
695
|
type TAddress = string | TLocation;
|
|
695
696
|
type TDestination = TChain$1 | TLocation;
|
|
696
|
-
type
|
|
697
|
+
type TTransferBaseOptions<TApi, TRes, TSigner> = {
|
|
697
698
|
/**
|
|
698
699
|
* The origin chain
|
|
699
700
|
*/
|
|
@@ -701,11 +702,11 @@ type TSendBaseOptions<TApi, TRes, TSigner> = {
|
|
|
701
702
|
/**
|
|
702
703
|
* The destination address. A SS58 or H160 format.
|
|
703
704
|
*/
|
|
704
|
-
|
|
705
|
+
recipient: TAddress;
|
|
705
706
|
/**
|
|
706
707
|
* The optional sender address. A SS58 or H160 format.
|
|
707
708
|
*/
|
|
708
|
-
|
|
709
|
+
sender?: string;
|
|
709
710
|
/**
|
|
710
711
|
* The optional asset hub address. A SS58 format only.
|
|
711
712
|
*/
|
|
@@ -754,22 +755,22 @@ type TSendBaseOptions<TApi, TRes, TSigner> = {
|
|
|
754
755
|
/**
|
|
755
756
|
* Options for transferring from a parachain to another parachain or relay chain
|
|
756
757
|
*/
|
|
757
|
-
type
|
|
758
|
+
type TTransferOptions<TApi, TRes, TSigner> = WithApi<TTransferBaseOptions<TApi, TRes, TSigner>, TApi, TRes, TSigner> & {
|
|
758
759
|
isAmountAll: boolean;
|
|
759
760
|
};
|
|
760
|
-
type
|
|
761
|
+
type WithRequiredSender<TBase> = Omit<TBase, 'sender'> & {
|
|
761
762
|
/**
|
|
762
763
|
* The sender address. A SS58 or H160 format.
|
|
763
764
|
*/
|
|
764
|
-
|
|
765
|
+
sender: string;
|
|
765
766
|
};
|
|
766
767
|
type WithRequiredSwapOptions<TBase, TApi, TRes, TSigner> = Omit<TBase, 'swapOptions'> & {
|
|
767
768
|
swapOptions: TSwapOptions<TApi, TRes, TSigner>;
|
|
768
769
|
};
|
|
769
|
-
type
|
|
770
|
-
type
|
|
771
|
-
type
|
|
772
|
-
type
|
|
770
|
+
type TTransferOptionsWithSwap<TApi, TRes, TSigner> = WithRequiredSwapOptions<Omit<TTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'>, TApi, TRes, TSigner>;
|
|
771
|
+
type TTransferBaseOptionsWithSwap<TApi, TRes, TSigner> = WithRequiredSwapOptions<TTransferBaseOptions<TApi, TRes, TSigner>, TApi, TRes, TSigner>;
|
|
772
|
+
type TTransferBaseOptionsWithSender<TApi, TRes, TSigner> = WithRequiredSender<TTransferBaseOptions<TApi, TRes, TSigner>>;
|
|
773
|
+
type TTransferInternalOptions<TApi, TRes, TSigner> = Omit<TTransferBaseOptions<TApi, TRes, TSigner>, 'from' | 'feeAsset' | 'version'> & {
|
|
773
774
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
774
775
|
assetInfo: WithAmount<TAssetInfo>;
|
|
775
776
|
feeAsset?: TAssetInfo;
|
|
@@ -819,13 +820,13 @@ type TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner> = {
|
|
|
819
820
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
820
821
|
origin: TSubstrateChain$1;
|
|
821
822
|
destination: TDestination;
|
|
822
|
-
|
|
823
|
+
recipient: TAddress;
|
|
823
824
|
version: Version;
|
|
824
825
|
paraId?: number;
|
|
825
826
|
};
|
|
826
827
|
type TBridgeStatus = 'Normal' | 'Halted';
|
|
827
|
-
type TTransferLocalOptions<TApi, TRes, TSigner> = Omit<
|
|
828
|
-
|
|
828
|
+
type TTransferLocalOptions<TApi, TRes, TSigner> = Omit<TTransferInternalOptions<TApi, TRes, TSigner>, 'recipient'> & {
|
|
829
|
+
recipient: string;
|
|
829
830
|
balance: bigint;
|
|
830
831
|
};
|
|
831
832
|
type TTransferFeeEstimates = {
|
|
@@ -838,8 +839,8 @@ type TCreateBaseTransferXcmOptions<TRes> = {
|
|
|
838
839
|
assetInfo: WithAmount<TAssetInfo>;
|
|
839
840
|
feeAssetInfo?: TAssetInfo;
|
|
840
841
|
fees: TTransferFeeEstimates;
|
|
841
|
-
|
|
842
|
-
|
|
842
|
+
recipient: string;
|
|
843
|
+
sender?: string;
|
|
843
844
|
version: Version;
|
|
844
845
|
useJitWithdraw?: boolean;
|
|
845
846
|
useFeeAssetOnHops?: boolean;
|
|
@@ -855,8 +856,8 @@ type TCreateBaseSwapXcmOptions = {
|
|
|
855
856
|
assetInfoTo: WithAmount<TAssetInfo>;
|
|
856
857
|
currencyTo: TCurrencyInput$1;
|
|
857
858
|
feeAssetInfo?: TAssetInfo;
|
|
858
|
-
|
|
859
|
-
|
|
859
|
+
sender: string;
|
|
860
|
+
recipient: string;
|
|
860
861
|
calculateMinAmountOut: (amountIn: bigint, assetTo?: TAssetInfo) => Promise<bigint>;
|
|
861
862
|
};
|
|
862
863
|
type TCreateSwapXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwapXcmOptions, TApi, TRes, TSigner>;
|
|
@@ -873,13 +874,14 @@ type TCreateSwapXcmInternalOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseSwa
|
|
|
873
874
|
};
|
|
874
875
|
type TCreateEthBridgeInstructionsOptions<TApi, TRes, TSigner> = {
|
|
875
876
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
876
|
-
|
|
877
|
+
recipient: TAddress;
|
|
877
878
|
assetInfo: TAssetInfo;
|
|
878
|
-
|
|
879
|
+
sender: string;
|
|
879
880
|
ahAddress?: string;
|
|
880
881
|
version: Version;
|
|
881
882
|
};
|
|
882
883
|
|
|
884
|
+
/** @deprecated Asset claim functionality is deprecated and will be removed in v14. */
|
|
883
885
|
type TAssetClaimOptionsBase = {
|
|
884
886
|
chain: TSubstrateChain$1;
|
|
885
887
|
currency: WithComplexAmount<TCurrencyCore> | TAsset<TAmount$1>[] | WithComplexAmount<TCurrencyCore>[];
|
|
@@ -905,6 +907,8 @@ declare abstract class BaseAssetsPallet {
|
|
|
905
907
|
|
|
906
908
|
/**
|
|
907
909
|
* Builder class for constructing asset claim transactions.
|
|
910
|
+
*
|
|
911
|
+
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
908
912
|
*/
|
|
909
913
|
declare class AssetClaimBuilder<TApi, TRes, TSigner, T extends Partial<TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>> = object> {
|
|
910
914
|
readonly api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
@@ -925,8 +929,8 @@ declare class AssetClaimBuilder<TApi, TRes, TSigner, T extends Partial<TAssetCla
|
|
|
925
929
|
* @param address - The sender address.
|
|
926
930
|
* @returns
|
|
927
931
|
*/
|
|
928
|
-
|
|
929
|
-
|
|
932
|
+
sender(sender: TSender<TSigner>): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
933
|
+
sender: string;
|
|
930
934
|
}>;
|
|
931
935
|
/**
|
|
932
936
|
* Specifies the account address on which the assets will be claimed.
|
|
@@ -968,8 +972,8 @@ declare class AssetClaimBuilder<TApi, TRes, TSigner, T extends Partial<TAssetCla
|
|
|
968
972
|
}
|
|
969
973
|
|
|
970
974
|
declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
971
|
-
transactionOptions:
|
|
972
|
-
addTransaction(options:
|
|
975
|
+
transactionOptions: TBatchedTransferOptions<TApi, TRes, TSigner>[];
|
|
976
|
+
addTransaction(options: TBatchedTransferOptions<TApi, TRes, TSigner>): void;
|
|
973
977
|
isEmpty(): boolean;
|
|
974
978
|
buildBatch(api: IPolkadotApi<TApi, TRes, TSigner>, from: TSubstrateChain$1, options?: TBatchOptions): Promise<TRes>;
|
|
975
979
|
}
|
|
@@ -977,7 +981,7 @@ declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
|
977
981
|
/**
|
|
978
982
|
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
979
983
|
*/
|
|
980
|
-
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<
|
|
984
|
+
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object> {
|
|
981
985
|
readonly batchManager: BatchTransactionManager<TApi, TRes, TSigner>;
|
|
982
986
|
readonly api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
983
987
|
readonly _options: T;
|
|
@@ -1004,6 +1008,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1004
1008
|
/**
|
|
1005
1009
|
* Initiates the process to claim assets from a specified chain.
|
|
1006
1010
|
*
|
|
1011
|
+
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
1007
1012
|
* @param chain - The chain from which to claim assets.
|
|
1008
1013
|
* @returns An instance of Builder
|
|
1009
1014
|
*/
|
|
@@ -1022,20 +1027,20 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1022
1027
|
/**
|
|
1023
1028
|
* Sets the recipient address.
|
|
1024
1029
|
*
|
|
1025
|
-
* @param address - The destination
|
|
1030
|
+
* @param address - The recipient address on the destination chain.
|
|
1026
1031
|
* @returns An instance of Builder
|
|
1027
1032
|
*/
|
|
1028
|
-
|
|
1029
|
-
|
|
1033
|
+
recipient(address: TAddress): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1034
|
+
recipient: TAddress;
|
|
1030
1035
|
}>;
|
|
1031
1036
|
/**
|
|
1032
1037
|
* Sets the sender address.
|
|
1033
1038
|
*
|
|
1034
|
-
* @param
|
|
1035
|
-
* @returns
|
|
1039
|
+
* @param sender - The sender address or signer.
|
|
1040
|
+
* @returns An instance of Builder
|
|
1036
1041
|
*/
|
|
1037
|
-
|
|
1038
|
-
|
|
1042
|
+
sender(sender: TSender<TSigner>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1043
|
+
sender: string;
|
|
1039
1044
|
}>;
|
|
1040
1045
|
/**
|
|
1041
1046
|
* Sets the asset hub address. This is used for transfers that go through the Asset Hub and originate from an EVM chain.
|
|
@@ -1112,7 +1117,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1112
1117
|
*
|
|
1113
1118
|
* @returns An instance of Builder
|
|
1114
1119
|
*/
|
|
1115
|
-
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1120
|
+
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner>>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1116
1121
|
from: TSubstrateChain$1;
|
|
1117
1122
|
}>;
|
|
1118
1123
|
/**
|
|
@@ -1121,34 +1126,34 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1121
1126
|
* @param options - (Optional) Options to customize the batch transaction.
|
|
1122
1127
|
* @returns A Extrinsic representing the batched transactions.
|
|
1123
1128
|
*/
|
|
1124
|
-
buildBatch(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1125
|
-
protected buildInternal<TOptions extends
|
|
1129
|
+
buildBatch(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner>>, options?: TBatchOptions): Promise<TRes>;
|
|
1130
|
+
protected buildInternal<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): Promise<TBuildInternalRes<TApi, TRes, TSigner, TOptions>>;
|
|
1126
1131
|
private prepareNormalizedOptions;
|
|
1127
1132
|
/**
|
|
1128
1133
|
* Builds and returns the transfer extrinsic.
|
|
1129
1134
|
*
|
|
1130
1135
|
* @returns A Promise that resolves to the transfer extrinsic.
|
|
1131
1136
|
*/
|
|
1132
|
-
build(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1137
|
+
build(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner>>): Promise<TRes>;
|
|
1133
1138
|
/**
|
|
1134
1139
|
* Builds and returns multiple transfer or swap extrinsics
|
|
1135
1140
|
*
|
|
1136
1141
|
* @returns A Promise that resolves to the transfer extrinsic contexts
|
|
1137
1142
|
*/
|
|
1138
|
-
buildAll(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1143
|
+
buildAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner>>): Promise<TTransactionContext<TApi, TRes>[]>;
|
|
1139
1144
|
private validateBatchState;
|
|
1140
1145
|
private buildCommon;
|
|
1141
1146
|
private buildCommonAll;
|
|
1142
1147
|
private maybePerformXcmFormatCheck;
|
|
1143
|
-
dryRun(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1144
|
-
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1145
|
-
protected createTxFactory<TOptions extends
|
|
1148
|
+
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>): Promise<TDryRunResult>;
|
|
1149
|
+
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
1150
|
+
protected createTxFactory<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions>): TTxFactory<TRes>;
|
|
1146
1151
|
/**
|
|
1147
1152
|
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
1148
1153
|
*
|
|
1149
1154
|
* @returns An origin and destination fee.
|
|
1150
1155
|
*/
|
|
1151
|
-
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1156
|
+
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>, options?: TGetXcmFeeBuilderOptions & {
|
|
1152
1157
|
disableFallback: TDisableFallback;
|
|
1153
1158
|
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
1154
1159
|
/**
|
|
@@ -1156,67 +1161,44 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1156
1161
|
*
|
|
1157
1162
|
* @returns An origin fee.
|
|
1158
1163
|
*/
|
|
1159
|
-
getOriginXcmFee(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1164
|
+
getOriginXcmFee(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TXcmFeeDetail & {
|
|
1160
1165
|
forwardedXcms?: unknown;
|
|
1161
1166
|
destParaId?: number;
|
|
1162
1167
|
}>;
|
|
1163
|
-
/**
|
|
1164
|
-
* Estimates the origin and destination XCM fee using the `paymentInfo` function.
|
|
1165
|
-
*
|
|
1166
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
1167
|
-
* Please use `builder.getXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
1168
|
-
* Will be removed in v13.
|
|
1169
|
-
* For more details, see the documentation:
|
|
1170
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
1171
|
-
*
|
|
1172
|
-
* @returns An origin and destination fee estimate.
|
|
1173
|
-
*/
|
|
1174
|
-
getXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TApi, TRes, TSigner>>): Promise<TGetXcmFeeEstimateResult>;
|
|
1175
|
-
/**
|
|
1176
|
-
* Estimates the origin XCM fee using paymentInfo function.
|
|
1177
|
-
*
|
|
1178
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
1179
|
-
* Please use `builder.getOriginXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
1180
|
-
* Will be removed in v13.
|
|
1181
|
-
* For more details, see the documentation:
|
|
1182
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
1183
|
-
*
|
|
1184
|
-
* @returns An origin fee estimate.
|
|
1185
|
-
*/
|
|
1186
|
-
getOriginXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TApi, TRes, TSigner>>): Promise<TGetXcmFeeEstimateDetail>;
|
|
1187
1168
|
/**
|
|
1188
1169
|
* Returns the max transferable amount for the transfer
|
|
1189
1170
|
*
|
|
1190
1171
|
* @returns The max transferable amount.
|
|
1191
1172
|
*/
|
|
1192
|
-
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1173
|
+
getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>): Promise<bigint>;
|
|
1193
1174
|
/**
|
|
1194
1175
|
* Returns the min transferable amount for the transfer
|
|
1195
1176
|
*
|
|
1196
1177
|
* @returns The min transferable amount.
|
|
1197
1178
|
*/
|
|
1198
|
-
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1179
|
+
getMinTransferableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>): Promise<bigint>;
|
|
1199
1180
|
/**
|
|
1200
1181
|
* Returns the max transferable amount for the transfer
|
|
1201
1182
|
*
|
|
1202
1183
|
* @returns The max transferable amount.
|
|
1203
1184
|
*/
|
|
1204
|
-
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1185
|
+
verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>): Promise<boolean>;
|
|
1205
1186
|
/**
|
|
1206
1187
|
* Returns the transfer info for the transfer
|
|
1207
1188
|
*
|
|
1208
1189
|
* @returns The transfer info.
|
|
1209
1190
|
*/
|
|
1210
|
-
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1191
|
+
getTransferInfo(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>): Promise<TTransferInfo>;
|
|
1211
1192
|
/**
|
|
1212
1193
|
* Returns the receivable amount on the destination after the transfer
|
|
1213
1194
|
*
|
|
1214
1195
|
* @returns The computed receivable amount.
|
|
1215
1196
|
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
1216
1197
|
*/
|
|
1217
|
-
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1218
|
-
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1219
|
-
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner,
|
|
1198
|
+
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>): Promise<bigint>;
|
|
1199
|
+
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSwap<TApi, TRes, TSigner>>): Promise<_paraspell_swap.TGetBestAmountOutResult>;
|
|
1200
|
+
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
1201
|
+
signAndSubmitAll(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<string[]>;
|
|
1220
1202
|
/**
|
|
1221
1203
|
* Returns the API instance used by the builder.
|
|
1222
1204
|
*
|
|
@@ -1246,8 +1228,7 @@ type TDryRunBaseOptions<TRes> = {
|
|
|
1246
1228
|
tx: TRes;
|
|
1247
1229
|
origin: TSubstrateChain$1;
|
|
1248
1230
|
destination: TChain$1;
|
|
1249
|
-
|
|
1250
|
-
address: string;
|
|
1231
|
+
sender: string;
|
|
1251
1232
|
currency: TCurrencyInputWithAmount;
|
|
1252
1233
|
version?: Version;
|
|
1253
1234
|
feeAsset?: TCurrencyInput$1;
|
|
@@ -1270,7 +1251,7 @@ type TDryRunCallBaseOptions<TRes> = {
|
|
|
1270
1251
|
*/
|
|
1271
1252
|
destination: TDestination;
|
|
1272
1253
|
/**
|
|
1273
|
-
* The address to dry-run with
|
|
1254
|
+
* The address to dry-run with
|
|
1274
1255
|
*/
|
|
1275
1256
|
address: string;
|
|
1276
1257
|
/**
|
|
@@ -1330,8 +1311,6 @@ type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
|
1330
1311
|
type THopInfo = {
|
|
1331
1312
|
chain: TChain$1;
|
|
1332
1313
|
result: TDryRunChainResult;
|
|
1333
|
-
/** @deprecated Use `result.isExchange` instead. Will be removed in v13. */
|
|
1334
|
-
isExchange?: boolean;
|
|
1335
1314
|
};
|
|
1336
1315
|
type TChainEndpoint = 'origin' | 'destination' | TChain$1;
|
|
1337
1316
|
type TDryRunResult = {
|
|
@@ -1514,8 +1493,8 @@ type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
|
1514
1493
|
/**
|
|
1515
1494
|
* The sender address
|
|
1516
1495
|
*/
|
|
1517
|
-
|
|
1518
|
-
|
|
1496
|
+
sender: string;
|
|
1497
|
+
recipient: string;
|
|
1519
1498
|
currency: WithAmount<TCurrencyCore>;
|
|
1520
1499
|
version?: Version;
|
|
1521
1500
|
feeAsset?: TCurrencyInput$1;
|
|
@@ -1528,8 +1507,6 @@ type TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback extends boo
|
|
|
1528
1507
|
tx: TRes;
|
|
1529
1508
|
useRootOrigin: boolean;
|
|
1530
1509
|
};
|
|
1531
|
-
type TGetXcmFeeEstimateOptions<TApi, TRes, TSigner> = Omit<TGetXcmFeeInternalOptions<TApi, TRes, TSigner>, 'disableFallback' | 'useRootOrigin' | 'buildTx' | 'version'>;
|
|
1532
|
-
type TGetOriginXcmFeeEstimateOptions<TApi, TRes, TSigner> = Omit<TGetXcmFeeInternalOptions<TApi, TRes, TSigner>, 'disableFallback' | 'address' | 'useRootOrigin' | 'buildTx' | 'version'>;
|
|
1533
1510
|
type TGetXcmFeeBuilderOptions = {
|
|
1534
1511
|
disableFallback: boolean;
|
|
1535
1512
|
};
|
|
@@ -1537,7 +1514,7 @@ type TGetOriginXcmFeeBaseOptions<TRes> = {
|
|
|
1537
1514
|
buildTx: TTxFactory<TRes>;
|
|
1538
1515
|
origin: TSubstrateChain$1;
|
|
1539
1516
|
destination: TChain$1;
|
|
1540
|
-
|
|
1517
|
+
sender: string;
|
|
1541
1518
|
currency: WithAmount<TCurrencyCore>;
|
|
1542
1519
|
version?: Version;
|
|
1543
1520
|
feeAsset?: TCurrencyInput$1;
|
|
@@ -1552,8 +1529,8 @@ type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
|
1552
1529
|
prevChain: TSubstrateChain$1;
|
|
1553
1530
|
origin: TSubstrateChain$1;
|
|
1554
1531
|
destination: TChain$1;
|
|
1555
|
-
|
|
1556
|
-
|
|
1532
|
+
sender: string;
|
|
1533
|
+
recipient: string;
|
|
1557
1534
|
currency: WithAmount<TCurrencyCore>;
|
|
1558
1535
|
forwardedXcms: any;
|
|
1559
1536
|
tx: TRes;
|
|
@@ -1609,14 +1586,10 @@ type TDestXcmFeeDetail<TDisableFallback extends boolean> = TConditionalXcmFeeDet
|
|
|
1609
1586
|
type TConditionalXcmFeeHopInfo<TDisableFallback extends boolean> = {
|
|
1610
1587
|
chain: TChain$1;
|
|
1611
1588
|
result: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1612
|
-
/** @deprecated - Use `result.isExchange` instead. Will be removed in v13. */
|
|
1613
|
-
isExchange?: boolean;
|
|
1614
1589
|
};
|
|
1615
1590
|
type TXcmFeeHopInfo = {
|
|
1616
1591
|
chain: TChain$1;
|
|
1617
1592
|
result: TXcmFeeDetail;
|
|
1618
|
-
/** @deprecated - Use `result.isExchange` instead. Will be removed in v13. */
|
|
1619
|
-
isExchange?: boolean;
|
|
1620
1593
|
};
|
|
1621
1594
|
type TGetXcmFeeResult<TDisableFallback extends boolean = boolean> = {
|
|
1622
1595
|
failureReason?: string;
|
|
@@ -1625,15 +1598,6 @@ type TGetXcmFeeResult<TDisableFallback extends boolean = boolean> = {
|
|
|
1625
1598
|
destination: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1626
1599
|
hops: TConditionalXcmFeeHopInfo<TDisableFallback>[];
|
|
1627
1600
|
};
|
|
1628
|
-
type TGetXcmFeeEstimateDetail = {
|
|
1629
|
-
fee: bigint;
|
|
1630
|
-
asset: TAssetInfo;
|
|
1631
|
-
sufficient?: boolean;
|
|
1632
|
-
};
|
|
1633
|
-
type TGetXcmFeeEstimateResult = {
|
|
1634
|
-
origin: TGetXcmFeeEstimateDetail;
|
|
1635
|
-
destination: TGetXcmFeeEstimateDetail;
|
|
1636
|
-
};
|
|
1637
1601
|
type TPaymentInfo = {
|
|
1638
1602
|
partialFee: bigint;
|
|
1639
1603
|
weight: TWeight;
|
|
@@ -1673,7 +1637,7 @@ type TGetTransferableAmountOptionsBase<TRes> = {
|
|
|
1673
1637
|
/**
|
|
1674
1638
|
* The sender address of the account.
|
|
1675
1639
|
*/
|
|
1676
|
-
|
|
1640
|
+
sender: string;
|
|
1677
1641
|
/**
|
|
1678
1642
|
* The chain on which to query the balance.
|
|
1679
1643
|
*/
|
|
@@ -1692,8 +1656,8 @@ type TGetTransferableAmountOptionsBase<TRes> = {
|
|
|
1692
1656
|
};
|
|
1693
1657
|
type TGetTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1694
1658
|
type TGetMinTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes> & {
|
|
1695
|
-
|
|
1696
|
-
builder: GeneralBuilder<TApi, TRes, TSigner,
|
|
1659
|
+
recipient: string;
|
|
1660
|
+
builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner>>;
|
|
1697
1661
|
}, TApi, TRes, TSigner>;
|
|
1698
1662
|
type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
1699
1663
|
/**
|
|
@@ -1707,11 +1671,11 @@ type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
|
1707
1671
|
/**
|
|
1708
1672
|
* The address of the account.
|
|
1709
1673
|
*/
|
|
1710
|
-
|
|
1674
|
+
recipient: string;
|
|
1711
1675
|
/**
|
|
1712
1676
|
* The account of the sender.
|
|
1713
1677
|
*/
|
|
1714
|
-
|
|
1678
|
+
sender: string;
|
|
1715
1679
|
/**
|
|
1716
1680
|
* The currency to query.
|
|
1717
1681
|
*/
|
|
@@ -1742,7 +1706,7 @@ type TEvmBuilderOptionsBase = {
|
|
|
1742
1706
|
/**
|
|
1743
1707
|
* The Polkadot destination address.
|
|
1744
1708
|
*/
|
|
1745
|
-
|
|
1709
|
+
recipient: string;
|
|
1746
1710
|
/**
|
|
1747
1711
|
* The AssetHub address
|
|
1748
1712
|
*/
|
|
@@ -1797,22 +1761,22 @@ type TBuilderConfig<TApi> = Partial<{
|
|
|
1797
1761
|
abstractDecimals: boolean;
|
|
1798
1762
|
xcmFormatCheck: boolean;
|
|
1799
1763
|
}>;
|
|
1800
|
-
type TCreateTxsOptions<TApi, TRes, TSigner> = Pick<
|
|
1801
|
-
type
|
|
1802
|
-
builder: GeneralBuilder<TApi, TRes, TSigner,
|
|
1764
|
+
type TCreateTxsOptions<TApi, TRes, TSigner> = Pick<TTransferOptions<TApi, TRes, TSigner>, 'api' | 'from' | 'to' | 'currency'>;
|
|
1765
|
+
type TBatchedTransferOptions<TApi, TRes, TSigner> = Omit<TTransferOptions<TApi, TRes, TSigner>, 'isAmountAll'> & {
|
|
1766
|
+
builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner>>;
|
|
1803
1767
|
};
|
|
1804
|
-
type TBuildInternalResBase<TApi, TRes, TSigner, TOptions extends
|
|
1805
|
-
options:
|
|
1768
|
+
type TBuildInternalResBase<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = {
|
|
1769
|
+
options: TTransferOptions<TApi, TRes, TSigner> & TOptions;
|
|
1806
1770
|
};
|
|
1807
|
-
type TBuildInternalRes<TApi, TRes, TSigner, TOptions extends
|
|
1771
|
+
type TBuildInternalRes<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = TBuildInternalResBase<TApi, TRes, TSigner, TOptions> & {
|
|
1808
1772
|
tx: TRes;
|
|
1809
1773
|
};
|
|
1810
|
-
type TBuildAllInternalRes<TApi, TRes, TSigner, TOptions extends
|
|
1774
|
+
type TBuildAllInternalRes<TApi, TRes, TSigner, TOptions extends TTransferBaseOptions<TApi, TRes, TSigner> = TTransferBaseOptions<TApi, TRes, TSigner>> = TBuildInternalResBase<TApi, TRes, TSigner, TOptions> & {
|
|
1811
1775
|
txContexts: TTransactionContext<TApi, TRes>[];
|
|
1812
1776
|
};
|
|
1813
1777
|
type TSender<TSigner> = string | TSigner;
|
|
1814
1778
|
type TBuilderInternalOptions<TSigner> = {
|
|
1815
|
-
|
|
1779
|
+
senderSource?: TSender<TSigner>;
|
|
1816
1780
|
};
|
|
1817
1781
|
|
|
1818
1782
|
type TProviderEntry = {
|
|
@@ -2020,6 +1984,18 @@ declare class ScenarioNotSupportedError extends Error {
|
|
|
2020
1984
|
constructor({ chain, scenario }: TScenarioNotSupportedContext);
|
|
2021
1985
|
}
|
|
2022
1986
|
|
|
1987
|
+
/**
|
|
1988
|
+
* Error thrown when a submitted transaction encounters a dispatch error on-chain.
|
|
1989
|
+
*/
|
|
1990
|
+
declare class SubmitTransactionError extends Error {
|
|
1991
|
+
/**
|
|
1992
|
+
* Constructs a new SubmitTransactionError.
|
|
1993
|
+
*
|
|
1994
|
+
* @param message - The dispatch error details.
|
|
1995
|
+
*/
|
|
1996
|
+
constructor(message: string);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
2023
1999
|
declare class TransferToAhNotSupported extends Error {
|
|
2024
2000
|
constructor(message?: string);
|
|
2025
2001
|
}
|
|
@@ -2105,14 +2081,14 @@ type BuildHopInfoOptions<TApi, TRes, TSigner> = {
|
|
|
2105
2081
|
originChain: TSubstrateChain$1;
|
|
2106
2082
|
currency: TCurrencyCore;
|
|
2107
2083
|
asset: TAssetInfo;
|
|
2108
|
-
|
|
2084
|
+
sender: string;
|
|
2109
2085
|
ahAddress?: string;
|
|
2110
2086
|
};
|
|
2111
2087
|
type TBuildDestInfoOptions<TApi, TRes, TSigner> = {
|
|
2112
2088
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
2113
2089
|
origin: TSubstrateChain$1;
|
|
2114
2090
|
destination: TChain$1;
|
|
2115
|
-
|
|
2091
|
+
recipient: string;
|
|
2116
2092
|
currency: WithAmount<TCurrencyCore>;
|
|
2117
2093
|
originFee: bigint;
|
|
2118
2094
|
isFeeAssetAh: boolean;
|
|
@@ -2128,9 +2104,9 @@ type TGetTransferInfoOptionsBase<TRes> = {
|
|
|
2128
2104
|
buildTx: TTxFactory<TRes>;
|
|
2129
2105
|
origin: TSubstrateChain$1;
|
|
2130
2106
|
destination: TChain$1;
|
|
2131
|
-
|
|
2107
|
+
sender: string;
|
|
2132
2108
|
ahAddress?: string;
|
|
2133
|
-
|
|
2109
|
+
recipient: string;
|
|
2134
2110
|
currency: WithAmount<TCurrencyCore>;
|
|
2135
2111
|
version: Version | undefined;
|
|
2136
2112
|
feeAsset?: TCurrencyCore;
|
|
@@ -2205,9 +2181,12 @@ declare const getParaId: (chain: TChain$1) => number;
|
|
|
2205
2181
|
*/
|
|
2206
2182
|
declare const getTChain: (paraId: number, ecosystem: TRelaychain | TExternalChain) => TChain$1 | null;
|
|
2207
2183
|
|
|
2184
|
+
/**
|
|
2185
|
+
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
2186
|
+
*/
|
|
2208
2187
|
declare const claimAssets: <TApi, TRes, TSigner>(options: TAssetClaimOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2209
2188
|
|
|
2210
|
-
declare const resolveTransferParams: <TApi, TRes, TSigner>(options:
|
|
2189
|
+
declare const resolveTransferParams: <TApi, TRes, TSigner>(options: TTransferOptions<TApi, TRes, TSigner>) => {
|
|
2211
2190
|
resolvedFeeAsset: TAssetInfo | undefined;
|
|
2212
2191
|
resolvedVersion: _paraspell_sdk_common.Version;
|
|
2213
2192
|
overriddenAsset: _paraspell_sdk_common.TLocation | _paraspell_assets.TAssetWithFee[] | undefined;
|
|
@@ -2223,7 +2202,7 @@ declare const resolveTransferParams: <TApi, TRes, TSigner>(options: TSendOptions
|
|
|
2223
2202
|
alias?: string;
|
|
2224
2203
|
};
|
|
2225
2204
|
};
|
|
2226
|
-
declare const createTransfer: <TApi, TRes, TSigner>(options:
|
|
2205
|
+
declare const createTransfer: <TApi, TRes, TSigner>(options: TTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2227
2206
|
|
|
2228
2207
|
declare const dryRun: <TApi, TRes, TSigner>(options: TDryRunOptions<TApi, TRes, TSigner>) => Promise<TDryRunResult>;
|
|
2229
2208
|
|
|
@@ -2245,23 +2224,14 @@ declare const getParaEthTransferFees: <TApi, TRes, TSigner>(ahApi: IPolkadotApi<
|
|
|
2245
2224
|
|
|
2246
2225
|
declare const transferMoonbeamEvm: <TApi, TRes, TSigner>(options: TEvmBuilderOptions<TApi, TRes, TSigner>) => Promise<string>;
|
|
2247
2226
|
|
|
2248
|
-
declare const transferMoonbeamToEth: <TApi, TRes, TSigner>(from: TSubstrateChain$1, { api, to, signer,
|
|
2227
|
+
declare const transferMoonbeamToEth: <TApi, TRes, TSigner>(from: TSubstrateChain$1, { api, to, signer, recipient, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes, TSigner>) => Promise<`0x${string}`>;
|
|
2249
2228
|
|
|
2250
2229
|
declare const getOriginXcmFee: <TApi, TRes, TSigner>(options: TGetOriginXcmFeeOptions<TApi, TRes, TSigner>) => Promise<TXcmFeeDetail & {
|
|
2251
2230
|
forwardedXcms?: unknown;
|
|
2252
2231
|
destParaId?: number;
|
|
2253
2232
|
}>;
|
|
2254
2233
|
|
|
2255
|
-
|
|
2256
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
2257
|
-
* Please use `builder.getOriginXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
2258
|
-
* Will be removed in v13.
|
|
2259
|
-
* For more details, see the documentation:
|
|
2260
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
2261
|
-
*/
|
|
2262
|
-
declare const getOriginXcmFeeEstimate: <TApi, TRes, TSigner>({ api, tx, origin, destination, currency, senderAddress, feeAsset }: TGetOriginXcmFeeEstimateOptions<TApi, TRes, TSigner>) => Promise<TGetXcmFeeEstimateDetail>;
|
|
2263
|
-
|
|
2264
|
-
declare const getOriginXcmFeeInternal: <TApi, TRes, TSigner>({ api, tx, origin, destination, senderAddress, disableFallback, feeAsset, currency, version, useRootOrigin }: TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner>) => Promise<TXcmFeeDetail & {
|
|
2234
|
+
declare const getOriginXcmFeeInternal: <TApi, TRes, TSigner>({ api, tx, origin, destination, sender, disableFallback, feeAsset, currency, version, useRootOrigin }: TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner>) => Promise<TXcmFeeDetail & {
|
|
2265
2235
|
forwardedXcms?: any;
|
|
2266
2236
|
destParaId?: number;
|
|
2267
2237
|
}>;
|
|
@@ -2269,25 +2239,16 @@ declare const getOriginXcmFeeInternal: <TApi, TRes, TSigner>({ api, tx, origin,
|
|
|
2269
2239
|
declare const getXcmFeeInternal: <TApi, TRes, TSigner, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2270
2240
|
declare const getXcmFee: <TApi, TRes, TSigner, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2271
2241
|
|
|
2272
|
-
|
|
2273
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
2274
|
-
* Please use `builder.getXcmFee()` instead, where `builder` is an instance of `Builder()`.
|
|
2275
|
-
* Will be removed in v13.
|
|
2276
|
-
* For more details, see the documentation:
|
|
2277
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
2278
|
-
*/
|
|
2279
|
-
declare const getXcmFeeEstimate: <TApi, TRes, TSigner>(options: TGetXcmFeeEstimateOptions<TApi, TRes, TSigner>) => Promise<TGetXcmFeeEstimateResult>;
|
|
2280
|
-
|
|
2281
|
-
declare const getXcmFeeOnce: <TApi, TRes, TSigner, TDisableFallback extends boolean>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset, version, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation }: TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2242
|
+
declare const getXcmFeeOnce: <TApi, TRes, TSigner, TDisableFallback extends boolean>({ api, tx, origin, destination, sender, recipient, currency, feeAsset, version, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation }: TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2282
2243
|
|
|
2283
2244
|
declare const getBridgeStatus: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>) => Promise<TBridgeStatus>;
|
|
2284
2245
|
|
|
2285
|
-
declare const getTransferInfo: <TApi, TRes, TSigner>({ api, buildTx, origin, destination,
|
|
2246
|
+
declare const getTransferInfo: <TApi, TRes, TSigner>({ api, buildTx, origin, destination, sender, ahAddress, recipient, currency, feeAsset, version }: TGetTransferInfoOptions<TApi, TRes, TSigner>) => Promise<TTransferInfo>;
|
|
2286
2247
|
|
|
2287
|
-
declare const getMinTransferableAmountInternal: <TApi, TRes, TSigner>({ api, origin,
|
|
2248
|
+
declare const getMinTransferableAmountInternal: <TApi, TRes, TSigner>({ api, origin, sender, recipient, origin: chain, destination, currency, feeAsset, buildTx, builder, version }: TGetMinTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2288
2249
|
declare const getMinTransferableAmount: <TApi, TRes, TSigner>(options: TGetMinTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2289
2250
|
|
|
2290
|
-
declare const getTransferableAmountInternal: <TApi, TRes, TSigner>({ api,
|
|
2251
|
+
declare const getTransferableAmountInternal: <TApi, TRes, TSigner>({ api, sender, origin: chain, destination, currency, buildTx, feeAsset, version }: TGetTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2291
2252
|
declare const getTransferableAmount: <TApi, TRes, TSigner>(options: TGetTransferableAmountOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2292
2253
|
|
|
2293
2254
|
declare const constructTypeAndThenCall: <TApi, TRes, TSigner>(context: TTypeAndThenCallContext<TApi, TRes, TSigner>, fees?: TTypeAndThenFees | null) => Promise<TSerializedExtrinsics>;
|
|
@@ -2306,7 +2267,7 @@ declare const createTypeThenAutoReserve: <TApi, TRes, TSigner>(chain: TSubstrate
|
|
|
2306
2267
|
declare const validateCurrency: (currency: TCurrencyInput$1, feeAsset?: TCurrencyInput$1) => void;
|
|
2307
2268
|
declare const validateDestination: (origin: TSubstrateChain$1, destination: TDestination) => void;
|
|
2308
2269
|
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput$1) => void;
|
|
2309
|
-
declare const validateTransact: <TApi, TRes, TSigner>({ api, from, to,
|
|
2270
|
+
declare const validateTransact: <TApi, TRes, TSigner>({ api, from, to, sender, recipient: address, transactOptions }: TTransferOptions<TApi, TRes, TSigner>) => ValidationError | undefined;
|
|
2310
2271
|
|
|
2311
2272
|
declare const verifyEdOnDestination: <TApi, TRes, TSigner>(options: TVerifyEdOnDestinationOptions<TApi, TRes, TSigner>) => Promise<boolean>;
|
|
2312
2273
|
|
|
@@ -2318,9 +2279,9 @@ declare const validateDestinationAddress: <TApi, TRes, TSigner>(address: TAddres
|
|
|
2318
2279
|
|
|
2319
2280
|
declare const assertToIsString: (to: TDestination, overrideMsg?: string) => asserts to is Exclude<TDestination, TLocation>;
|
|
2320
2281
|
declare const assertAddressIsString: (address: TAddress) => asserts address is Exclude<TAddress, TLocation>;
|
|
2321
|
-
declare const
|
|
2282
|
+
declare const assertSender: (address: string | undefined) => asserts address is string;
|
|
2322
2283
|
declare const assertHasId: (asset: TAssetInfo) => asserts asset is TAssetInfoWithId;
|
|
2323
|
-
declare const
|
|
2284
|
+
declare const assertSenderSource: <TSigner>(sender?: TSender<TSigner>) => asserts sender is TSender<TSigner>;
|
|
2324
2285
|
declare const isSenderSigner: <TSigner>(sender: TSender<TSigner>) => sender is TSigner;
|
|
2325
2286
|
declare const assertSwapSupport: <TApi, TRes, TSigner>(options: TSwapOptions<TApi, TRes, TSigner> | undefined) => void;
|
|
2326
2287
|
|
|
@@ -2338,10 +2299,10 @@ declare const maybeOverrideAsset: (version: Version, amount: bigint, asset: TAss
|
|
|
2338
2299
|
declare const sortAssets: (assets: TAsset[]) => TAsset[];
|
|
2339
2300
|
|
|
2340
2301
|
declare const computeOverridenAmount: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, increaseAmount: string, relative?: boolean) => number | bigint;
|
|
2341
|
-
declare const overrideTxAmount: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, builder: GeneralBuilder<TApi, TRes, TSigner,
|
|
2342
|
-
declare const createTxOverrideAmount: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, builder: GeneralBuilder<TApi, TRes, TSigner,
|
|
2343
|
-
declare const createTransferOrSwapAll: <TApi, TRes, TSigner>(options:
|
|
2344
|
-
declare const createTransferOrSwap: <TApi, TRes, TSigner>(options:
|
|
2302
|
+
declare const overrideTxAmount: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner>>, amount: string, relative?: boolean) => Promise<TRes>;
|
|
2303
|
+
declare const createTxOverrideAmount: <TApi, TRes, TSigner>(options: TCreateTxsOptions<TApi, TRes, TSigner>, builder: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptions<TApi, TRes, TSigner>>, amount?: string, relative?: boolean) => Promise<TRes>;
|
|
2304
|
+
declare const createTransferOrSwapAll: <TApi, TRes, TSigner>(options: TTransferOptions<TApi, TRes, TSigner>) => Promise<TTransactionContext<TApi, TRes>[]>;
|
|
2305
|
+
declare const createTransferOrSwap: <TApi, TRes, TSigner>(options: TTransferOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2345
2306
|
|
|
2346
2307
|
declare const isConfig: <TApi>(value: any) => value is TBuilderConfig<TApi>;
|
|
2347
2308
|
|
|
@@ -2374,7 +2335,7 @@ declare const getChain: <TApi, TRes, TSigner, T extends keyof ReturnType<typeof
|
|
|
2374
2335
|
|
|
2375
2336
|
declare const getEvmPrivateKeyHex: (path: string) => "0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133" | "0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b" | "0x0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b" | "0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68" | "0x7dce9bc8babb68fec1409be38c8e1a52650206a7ed90ff956ae8a6d15eeaaef4" | "0xb9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df" | undefined;
|
|
2376
2337
|
|
|
2377
|
-
declare const createBeneficiaryLocXTokens: <TApi, TRes, TSigner>({ api,
|
|
2338
|
+
declare const createBeneficiaryLocXTokens: <TApi, TRes, TSigner>({ api, recipient, origin, destination, version, paraId }: TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2378
2339
|
declare const createBeneficiaryLocation: <TApi, TRes, TSigner>({ api, address, version }: TCreateBeneficiaryOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2379
2340
|
|
|
2380
2341
|
declare const createDestination: (version: Version, origin: TSubstrateChain$1, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TLocation;
|
|
@@ -2409,7 +2370,8 @@ interface TSwapExtension {
|
|
|
2409
2370
|
declare const registerSwapExtension: (extension: TSwapExtension) => void;
|
|
2410
2371
|
declare const getSwapExtensionOrThrow: () => TSwapExtension;
|
|
2411
2372
|
|
|
2412
|
-
declare const
|
|
2373
|
+
declare const convertBuilderConfig: <TApi>(config: TBuilderOptions<TApiOrUrl<TApi>> | undefined) => TBuilderConfig<TUrl> | undefined;
|
|
2374
|
+
declare const createRouterBuilder: <TApi, TRes, TSigner>(options: TTransferOptionsWithSwap<TApi, TRes, TSigner>) => _paraspell_swap.RouterBuilderCore<unknown, unknown, unknown, object & {
|
|
2413
2375
|
from: TSubstrateChain | undefined;
|
|
2414
2376
|
} & {
|
|
2415
2377
|
exchange: TExchangeInput;
|
|
@@ -2422,15 +2384,15 @@ declare const createRouterBuilder: <TApi, TRes, TSigner>(options: TSendOptionsWi
|
|
|
2422
2384
|
} & {
|
|
2423
2385
|
amount: TAmount;
|
|
2424
2386
|
} & {
|
|
2425
|
-
|
|
2387
|
+
sender: string;
|
|
2426
2388
|
} & {
|
|
2427
2389
|
evmSenderAddress: string | undefined;
|
|
2428
2390
|
} & {
|
|
2429
|
-
|
|
2391
|
+
recipient: string | undefined;
|
|
2430
2392
|
} & {
|
|
2431
2393
|
slippagePct: string;
|
|
2432
2394
|
}>;
|
|
2433
|
-
declare const executeWithRouter: <TApi, TRes, TSigner, T>(options:
|
|
2395
|
+
declare const executeWithRouter: <TApi, TRes, TSigner, T>(options: TTransferOptionsWithSwap<TApi, TRes, TSigner>, executor: (builder: ReturnType<typeof createRouterBuilder<TApi, TRes, TSigner>>) => Promise<T>) => Promise<T>;
|
|
2434
2396
|
declare const normalizeExchange: (exchange: TExchangeInput) => TExchangeInput;
|
|
2435
2397
|
|
|
2436
2398
|
declare const abstractDecimals: <TApi, TRes, TSigner>(amount: TAmount$1, decimals: number | undefined, api: IPolkadotApi<TApi, TRes, TSigner>) => bigint;
|
|
@@ -2477,5 +2439,5 @@ declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersi
|
|
|
2477
2439
|
declare const pickCompatibleXcmVersion: (origin: TSubstrateChain$1, destination: TDestination, override?: Version) => Version;
|
|
2478
2440
|
declare const pickRouterCompatibleXcmVersion: (origin: TSubstrateChain$1 | undefined, exchangeChain: TSubstrateChain$1, destination: TChain$1 | undefined) => Version;
|
|
2479
2441
|
|
|
2480
|
-
export { API_TYPES, AmountTooLowError, 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, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender,
|
|
2481
|
-
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions,
|
|
2442
|
+
export { API_TYPES, AmountTooLowError, 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, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender, assertSenderSource, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createRouterBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithRouter, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmPrivateKeyHex, getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerSwapExtension, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2443
|
+
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, 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, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, 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, TMantaAsset, TModuleError, TNativeTokenAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSender, TSerializeEthTransferOptions, TSerializedEthTransfer, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, 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, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSender, WithRequiredSwapOptions };
|