@paraspell/sdk-core 12.9.1 → 12.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +149 -142
- package/dist/index.mjs +85 -93
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as _paraspell_sdk_common from '@paraspell/sdk-common';
|
|
2
|
-
import { TChain, TSubstrateChain, Version, TLocation, TRelaychain, TParachain, TExternalChain, TJunction, Parents, TJunctions } from '@paraspell/sdk-common';
|
|
2
|
+
import { TChain as TChain$1, TSubstrateChain as TSubstrateChain$1, Version, TLocation, TRelaychain, TParachain, 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, TCurrencyCore, TCurrencyInputWithAmount, TCurrencyInput, TAssetWithFee, WithComplexAmount, TAmount, TAssetInfoWithId } from '@paraspell/assets';
|
|
5
|
+
import { TAssetInfo, WithAmount, TAsset, TCurrencyCore, TCurrencyInputWithAmount, TCurrencyInput as TCurrencyInput$1, TAssetWithFee, WithComplexAmount, TAmount as TAmount$1, 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
9
|
import { WalletClient, formatUnits as formatUnits$1, parseUnits as parseUnits$1 } from 'viem';
|
|
10
|
-
import * as
|
|
10
|
+
import * as _paraspell_swap from '@paraspell/swap';
|
|
11
|
+
import { RouterBuilder } from '@paraspell/swap';
|
|
11
12
|
|
|
12
13
|
type WithApi<TBase, TApi, TRes, TSigner> = TBase & {
|
|
13
14
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
@@ -43,8 +44,8 @@ interface IPolkadotApi<TApi, TRes, TSigner> {
|
|
|
43
44
|
getType(): TApiType;
|
|
44
45
|
getConfig(): TBuilderOptions<TApiOrUrl<TApi>> | undefined;
|
|
45
46
|
getApi(): TApi;
|
|
46
|
-
init(chain: TChain, clientTtlMs?: number): Promise<void>;
|
|
47
|
-
createApiInstance: (wsUrl: TUrl, chain: TSubstrateChain) => Promise<TApi>;
|
|
47
|
+
init(chain: TChain$1, clientTtlMs?: number): Promise<void>;
|
|
48
|
+
createApiInstance: (wsUrl: TUrl, chain: TSubstrateChain$1) => Promise<TApi>;
|
|
48
49
|
accountToHex(address: string, isPrefixed?: boolean): string;
|
|
49
50
|
accountToUint8a(address: string): Uint8Array;
|
|
50
51
|
deserializeExtrinsics(serialized: TSerializedExtrinsics): TRes;
|
|
@@ -65,12 +66,12 @@ interface IPolkadotApi<TApi, TRes, TSigner> {
|
|
|
65
66
|
}>;
|
|
66
67
|
quoteAhPrice(fromMl: TLocation, toMl: TLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
|
|
67
68
|
getXcmWeight(xcm: any): Promise<TWeight>;
|
|
68
|
-
getXcmPaymentApiFee(chain: TSubstrateChain, localXcm: any, forwardedXcm: any, asset: TAssetInfo, version: Version, transformXcm: boolean): Promise<bigint>;
|
|
69
|
+
getXcmPaymentApiFee(chain: TSubstrateChain$1, localXcm: any, forwardedXcm: any, asset: TAssetInfo, version: Version, transformXcm: boolean): Promise<bigint>;
|
|
69
70
|
getEvmStorage(contract: string, slot: string): Promise<string>;
|
|
70
71
|
getFromRpc(module: string, method: string, key: string): Promise<string>;
|
|
71
72
|
blake2AsHex(data: Uint8Array): string;
|
|
72
73
|
clone(): IPolkadotApi<TApi, TRes, TSigner>;
|
|
73
|
-
createApiForChain(chain: TSubstrateChain): Promise<IPolkadotApi<TApi, TRes, TSigner>>;
|
|
74
|
+
createApiForChain(chain: TSubstrateChain$1): Promise<IPolkadotApi<TApi, TRes, TSigner>>;
|
|
74
75
|
getDryRunCall(options: TDryRunCallBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
75
76
|
getDryRunXcm(options: TDryRunXcmBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
76
77
|
getBridgeStatus(): Promise<TBridgeStatus>;
|
|
@@ -88,18 +89,18 @@ declare abstract class Chain<TApi, TRes, TSigner> {
|
|
|
88
89
|
private readonly _info;
|
|
89
90
|
private readonly _ecosystem;
|
|
90
91
|
private readonly _version;
|
|
91
|
-
constructor(chain: TSubstrateChain, info: string, ecosystem: TRelaychain, version: Version);
|
|
92
|
+
constructor(chain: TSubstrateChain$1, info: string, ecosystem: TRelaychain, version: Version);
|
|
92
93
|
get info(): string;
|
|
93
94
|
get ecosystem(): TRelaychain;
|
|
94
|
-
get chain(): TSubstrateChain;
|
|
95
|
+
get chain(): TSubstrateChain$1;
|
|
95
96
|
get version(): Version;
|
|
96
97
|
transfer(sendOptions: TSendInternalOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
97
98
|
isRelayToParaEnabled(): boolean;
|
|
98
|
-
throwIfCantReceive(destChain: TChain | undefined): void;
|
|
99
|
-
throwIfTempDisabled(options: TSendInternalOptions<TApi, TRes, TSigner>, destChain?: TChain): void;
|
|
99
|
+
throwIfCantReceive(destChain: TChain$1 | undefined): void;
|
|
100
|
+
throwIfTempDisabled(options: TSendInternalOptions<TApi, TRes, TSigner>, destChain?: TChain$1): void;
|
|
100
101
|
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
101
102
|
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
102
|
-
canReceiveFrom(_origin: TChain): boolean;
|
|
103
|
+
canReceiveFrom(_origin: TChain$1): boolean;
|
|
103
104
|
shouldUseNativeAssetTeleport({ assetInfo: asset, to }: TSendInternalOptions<TApi, TRes, TSigner>): boolean;
|
|
104
105
|
createAsset(asset: WithAmount<TAssetInfo>, version: Version): TAsset;
|
|
105
106
|
getNativeAssetSymbol(): string;
|
|
@@ -285,7 +286,7 @@ declare class CoretimeKusama<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSig
|
|
|
285
286
|
declare class CoretimePolkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
286
287
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
287
288
|
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
288
|
-
canReceiveFrom(origin: TChain): boolean;
|
|
289
|
+
canReceiveFrom(origin: TChain$1): boolean;
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
declare class CoretimePaseo<TApi, TRes, TSigner> extends CoretimePolkadot<TApi, TRes, TSigner> {
|
|
@@ -387,7 +388,7 @@ declare class Kintsugi<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> i
|
|
|
387
388
|
}
|
|
388
389
|
|
|
389
390
|
declare class Polkadot<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
390
|
-
constructor(chain?: TSubstrateChain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
391
|
+
constructor(chain?: TSubstrateChain$1, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
391
392
|
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
392
393
|
}
|
|
393
394
|
|
|
@@ -513,14 +514,14 @@ declare class Westend<TApi, TRes, TSigner> extends Polkadot<TApi, TRes, TSigner>
|
|
|
513
514
|
declare class Xode<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
514
515
|
constructor();
|
|
515
516
|
transferPolkadotXCM(options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
516
|
-
canReceiveFrom(origin: TChain): boolean;
|
|
517
|
+
canReceiveFrom(origin: TChain$1): boolean;
|
|
517
518
|
}
|
|
518
519
|
|
|
519
520
|
declare class Zeitgeist<TApi, TRes, TSigner> extends Chain<TApi, TRes, TSigner> implements IPolkadotXCMTransfer<TApi, TRes, TSigner> {
|
|
520
521
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
521
522
|
getCustomCurrencyId(asset: TAssetInfo): TZeitgeistAsset | TXcmForeignAsset;
|
|
522
523
|
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>): Promise<TRes>;
|
|
523
|
-
canReceiveFrom(origin: TChain): boolean;
|
|
524
|
+
canReceiveFrom(origin: TChain$1): boolean;
|
|
524
525
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner>): TRes;
|
|
525
526
|
}
|
|
526
527
|
|
|
@@ -623,7 +624,7 @@ type TSwapOptions<TApi, TRes, TSigner> = {
|
|
|
623
624
|
type TTransactionContext<TApi, TRes> = {
|
|
624
625
|
type: TTransactionType;
|
|
625
626
|
api: TApi;
|
|
626
|
-
chain: TSubstrateChain;
|
|
627
|
+
chain: TSubstrateChain$1;
|
|
627
628
|
tx: TRes;
|
|
628
629
|
};
|
|
629
630
|
type TTransactionType = 'TRANSFER' | 'SWAP' | 'SWAP_AND_TRANSFER';
|
|
@@ -643,11 +644,11 @@ type TSwapEvent<TApi, TRes> = {
|
|
|
643
644
|
/**
|
|
644
645
|
* Current transaction's origin chain
|
|
645
646
|
*/
|
|
646
|
-
chain?: TSubstrateChain;
|
|
647
|
+
chain?: TSubstrateChain$1;
|
|
647
648
|
/**
|
|
648
649
|
* Current transaction's destination chain
|
|
649
650
|
*/
|
|
650
|
-
destinationChain?: TChain;
|
|
651
|
+
destinationChain?: TChain$1;
|
|
651
652
|
/**
|
|
652
653
|
* 0-based step index of current operation
|
|
653
654
|
*/
|
|
@@ -657,7 +658,7 @@ type TStatusChangeCallback<TApi, TRes> = (info: TSwapEvent<TApi, TRes>) => void;
|
|
|
657
658
|
|
|
658
659
|
type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
659
660
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
660
|
-
chain: TSubstrateChain;
|
|
661
|
+
chain: TSubstrateChain$1;
|
|
661
662
|
beneficiaryLocation: TLocation;
|
|
662
663
|
address: TAddress;
|
|
663
664
|
asset: TAsset;
|
|
@@ -666,9 +667,9 @@ type TPolkadotXCMTransferOptions<TApi, TRes, TSigner> = {
|
|
|
666
667
|
assetInfo: WithAmount<TAssetInfo>;
|
|
667
668
|
currency: TCurrencyInputWithAmount;
|
|
668
669
|
feeAssetInfo?: TAssetInfo;
|
|
669
|
-
feeCurrency?: TCurrencyInput;
|
|
670
|
+
feeCurrency?: TCurrencyInput$1;
|
|
670
671
|
destination: TDestination;
|
|
671
|
-
destChain?: TChain;
|
|
672
|
+
destChain?: TChain$1;
|
|
672
673
|
paraIdTo?: number;
|
|
673
674
|
version: Version;
|
|
674
675
|
senderAddress?: string;
|
|
@@ -682,7 +683,7 @@ type TXTokensTransferOptions<TApi, TRes, TSigner> = {
|
|
|
682
683
|
asset: WithAmount<TAssetInfo>;
|
|
683
684
|
address: TAddress;
|
|
684
685
|
scenario: TScenario;
|
|
685
|
-
origin: TSubstrateChain;
|
|
686
|
+
origin: TSubstrateChain$1;
|
|
686
687
|
destination: TDestination;
|
|
687
688
|
paraIdTo?: number;
|
|
688
689
|
version: Version;
|
|
@@ -699,12 +700,12 @@ interface IXTokensTransfer<TApi, TRes, TSigner> {
|
|
|
699
700
|
}
|
|
700
701
|
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
701
702
|
type TAddress = string | TLocation;
|
|
702
|
-
type TDestination = TChain | TLocation;
|
|
703
|
+
type TDestination = TChain$1 | TLocation;
|
|
703
704
|
type TSendBaseOptions<TApi, TRes, TSigner> = {
|
|
704
705
|
/**
|
|
705
706
|
* The origin chain
|
|
706
707
|
*/
|
|
707
|
-
from: TSubstrateChain;
|
|
708
|
+
from: TSubstrateChain$1;
|
|
708
709
|
/**
|
|
709
710
|
* The destination address. A SS58 or H160 format.
|
|
710
711
|
*/
|
|
@@ -728,7 +729,7 @@ type TSendBaseOptions<TApi, TRes, TSigner> = {
|
|
|
728
729
|
/**
|
|
729
730
|
* The optional fee asset. Either ID, symbol, or location
|
|
730
731
|
*/
|
|
731
|
-
feeAsset?: TCurrencyInput;
|
|
732
|
+
feeAsset?: TCurrencyInput$1;
|
|
732
733
|
/**
|
|
733
734
|
* The optional destination parachain ID
|
|
734
735
|
*/
|
|
@@ -780,7 +781,7 @@ type TSendInternalOptions<TApi, TRes, TSigner> = Omit<TSendBaseOptions<TApi, TRe
|
|
|
780
781
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
781
782
|
assetInfo: WithAmount<TAssetInfo>;
|
|
782
783
|
feeAsset?: TAssetInfo;
|
|
783
|
-
feeCurrency?: TCurrencyInput;
|
|
784
|
+
feeCurrency?: TCurrencyInput$1;
|
|
784
785
|
overriddenAsset?: TLocation | TAssetWithFee[];
|
|
785
786
|
version: Version;
|
|
786
787
|
isAmountAll: boolean;
|
|
@@ -824,7 +825,7 @@ type TCreateBeneficiaryOptions<TApi, TRes, TSigner> = {
|
|
|
824
825
|
};
|
|
825
826
|
type TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner> = {
|
|
826
827
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
827
|
-
origin: TSubstrateChain;
|
|
828
|
+
origin: TSubstrateChain$1;
|
|
828
829
|
destination: TDestination;
|
|
829
830
|
address: TAddress;
|
|
830
831
|
version: Version;
|
|
@@ -840,8 +841,8 @@ type TTransferFeeEstimates = {
|
|
|
840
841
|
reserveFee: bigint;
|
|
841
842
|
};
|
|
842
843
|
type TCreateBaseTransferXcmOptions<TRes> = {
|
|
843
|
-
chain: TSubstrateChain;
|
|
844
|
-
destChain: TChain;
|
|
844
|
+
chain: TSubstrateChain$1;
|
|
845
|
+
destChain: TChain$1;
|
|
845
846
|
assetInfo: WithAmount<TAssetInfo>;
|
|
846
847
|
feeAssetInfo?: TAssetInfo;
|
|
847
848
|
fees: TTransferFeeEstimates;
|
|
@@ -855,12 +856,12 @@ type TCreateBaseTransferXcmOptions<TRes> = {
|
|
|
855
856
|
};
|
|
856
857
|
type TCreateTransferXcmOptions<TApi, TRes, TSigner> = WithApi<TCreateBaseTransferXcmOptions<TRes>, TApi, TRes, TSigner>;
|
|
857
858
|
type TCreateBaseSwapXcmOptions = {
|
|
858
|
-
chain?: TSubstrateChain;
|
|
859
|
+
chain?: TSubstrateChain$1;
|
|
859
860
|
exchangeChain: TParachain;
|
|
860
|
-
destChain?: TChain;
|
|
861
|
+
destChain?: TChain$1;
|
|
861
862
|
assetInfoFrom: WithAmount<TAssetInfo>;
|
|
862
863
|
assetInfoTo: WithAmount<TAssetInfo>;
|
|
863
|
-
currencyTo: TCurrencyInput;
|
|
864
|
+
currencyTo: TCurrencyInput$1;
|
|
864
865
|
feeAssetInfo?: TAssetInfo;
|
|
865
866
|
senderAddress: string;
|
|
866
867
|
recipientAddress: string;
|
|
@@ -888,8 +889,8 @@ type TCreateEthBridgeInstructionsOptions<TApi, TRes, TSigner> = {
|
|
|
888
889
|
};
|
|
889
890
|
|
|
890
891
|
type TAssetClaimOptionsBase = {
|
|
891
|
-
chain: TSubstrateChain;
|
|
892
|
-
currency: WithComplexAmount<TCurrencyCore> | TAsset<TAmount>[] | WithComplexAmount<TCurrencyCore>[];
|
|
892
|
+
chain: TSubstrateChain$1;
|
|
893
|
+
currency: WithComplexAmount<TCurrencyCore> | TAsset<TAmount$1>[] | WithComplexAmount<TCurrencyCore>[];
|
|
893
894
|
address: TAddress;
|
|
894
895
|
version?: Version;
|
|
895
896
|
};
|
|
@@ -906,7 +907,7 @@ type TSetBalanceRes = {
|
|
|
906
907
|
declare abstract class BaseAssetsPallet {
|
|
907
908
|
protected palletName: TAssetsPallet;
|
|
908
909
|
constructor(palletName: TAssetsPallet);
|
|
909
|
-
abstract mint<TApi, TRes, TSigner>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain, api: IPolkadotApi<TApi, TRes, TSigner>): Promise<TSetBalanceRes>;
|
|
910
|
+
abstract mint<TApi, TRes, TSigner>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain$1, api: IPolkadotApi<TApi, TRes, TSigner>): Promise<TSetBalanceRes>;
|
|
910
911
|
abstract getBalance<TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
911
912
|
}
|
|
912
913
|
|
|
@@ -978,7 +979,7 @@ declare class BatchTransactionManager<TApi, TRes, TSigner> {
|
|
|
978
979
|
transactionOptions: TBatchedSendOptions<TApi, TRes, TSigner>[];
|
|
979
980
|
addTransaction(options: TBatchedSendOptions<TApi, TRes, TSigner>): void;
|
|
980
981
|
isEmpty(): boolean;
|
|
981
|
-
buildBatch(api: IPolkadotApi<TApi, TRes, TSigner>, from: TSubstrateChain, options?: TBatchOptions): Promise<TRes>;
|
|
982
|
+
buildBatch(api: IPolkadotApi<TApi, TRes, TSigner>, from: TSubstrateChain$1, options?: TBatchOptions): Promise<TRes>;
|
|
982
983
|
}
|
|
983
984
|
|
|
984
985
|
/**
|
|
@@ -995,8 +996,8 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
995
996
|
* @param chain - The chain from which the transaction originates.
|
|
996
997
|
* @returns An instance of Builder
|
|
997
998
|
*/
|
|
998
|
-
from(chain: TSubstrateChain): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
999
|
-
from: TSubstrateChain;
|
|
999
|
+
from(chain: TSubstrateChain$1): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1000
|
+
from: TSubstrateChain$1;
|
|
1000
1001
|
}>;
|
|
1001
1002
|
/**
|
|
1002
1003
|
* Specifies the destination chain for the transaction.
|
|
@@ -1014,8 +1015,8 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1014
1015
|
* @param chain - The chain from which to claim assets.
|
|
1015
1016
|
* @returns An instance of Builder
|
|
1016
1017
|
*/
|
|
1017
|
-
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, TSigner, {
|
|
1018
|
-
chain: TSubstrateChain;
|
|
1018
|
+
claimFrom(chain: TSubstrateChain$1): AssetClaimBuilder<TApi, TRes, TSigner, {
|
|
1019
|
+
chain: TSubstrateChain$1;
|
|
1019
1020
|
}>;
|
|
1020
1021
|
/**
|
|
1021
1022
|
* Specifies the currency to be used in the transaction. Symbol, ID, location or multi-asset.
|
|
@@ -1087,8 +1088,8 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1087
1088
|
* @param currency - The currency to be used for the fee.
|
|
1088
1089
|
* @returns An instance of the Builder
|
|
1089
1090
|
*/
|
|
1090
|
-
feeAsset(currency: TCurrencyInput | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1091
|
-
feeAsset: TCurrencyInput | undefined;
|
|
1091
|
+
feeAsset(currency: TCurrencyInput$1 | undefined): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1092
|
+
feeAsset: TCurrencyInput$1 | undefined;
|
|
1092
1093
|
}>;
|
|
1093
1094
|
/**
|
|
1094
1095
|
* Sets the hex of the encoded transaction call to apply on the destination chain
|
|
@@ -1120,7 +1121,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1120
1121
|
* @returns An instance of Builder
|
|
1121
1122
|
*/
|
|
1122
1123
|
addToBatch(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptions<TApi, TRes, TSigner>>): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
1123
|
-
from: TSubstrateChain;
|
|
1124
|
+
from: TSubstrateChain$1;
|
|
1124
1125
|
}>;
|
|
1125
1126
|
/**
|
|
1126
1127
|
* Builds and returns the batched transaction based on the configured parameters.
|
|
@@ -1222,7 +1223,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TSendBaseOpt
|
|
|
1222
1223
|
* @throws \{UnableToComputeError\} Thrown when the receivable amount cannot be determined.
|
|
1223
1224
|
*/
|
|
1224
1225
|
getReceivableAmount(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TApi, TRes, TSigner>>): Promise<bigint>;
|
|
1225
|
-
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSwap<TApi, TRes, TSigner>>): Promise<
|
|
1226
|
+
getBestAmountOut(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSwap<TApi, TRes, TSigner>>): Promise<_paraspell_swap.TGetBestAmountOutResult>;
|
|
1226
1227
|
signAndSubmit(this: GeneralBuilder<TApi, TRes, TSigner, TSendBaseOptionsWithSenderAddress<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
1227
1228
|
/**
|
|
1228
1229
|
* Returns the API instance used by the builder.
|
|
@@ -1251,13 +1252,13 @@ type TSwapConfig = {
|
|
|
1251
1252
|
};
|
|
1252
1253
|
type TDryRunBaseOptions<TRes> = {
|
|
1253
1254
|
tx: TRes;
|
|
1254
|
-
origin: TSubstrateChain;
|
|
1255
|
-
destination: TChain;
|
|
1255
|
+
origin: TSubstrateChain$1;
|
|
1256
|
+
destination: TChain$1;
|
|
1256
1257
|
senderAddress: string;
|
|
1257
1258
|
address: string;
|
|
1258
1259
|
currency: TCurrencyInputWithAmount;
|
|
1259
1260
|
version?: Version;
|
|
1260
|
-
feeAsset?: TCurrencyInput;
|
|
1261
|
+
feeAsset?: TCurrencyInput$1;
|
|
1261
1262
|
swapConfig?: TSwapConfig;
|
|
1262
1263
|
useRootOrigin?: boolean;
|
|
1263
1264
|
bypassOptions?: TBypassOptions;
|
|
@@ -1271,7 +1272,7 @@ type TDryRunCallBaseOptions<TRes> = {
|
|
|
1271
1272
|
/**
|
|
1272
1273
|
* The chain to dry-run on
|
|
1273
1274
|
*/
|
|
1274
|
-
chain: TSubstrateChain;
|
|
1275
|
+
chain: TSubstrateChain$1;
|
|
1275
1276
|
/**
|
|
1276
1277
|
* The destination chain
|
|
1277
1278
|
*/
|
|
@@ -1305,11 +1306,11 @@ type TDryRunXcmBaseOptions<TRes> = {
|
|
|
1305
1306
|
/**
|
|
1306
1307
|
* The chain to dry-run on
|
|
1307
1308
|
*/
|
|
1308
|
-
chain: TSubstrateChain;
|
|
1309
|
+
chain: TSubstrateChain$1;
|
|
1309
1310
|
/**
|
|
1310
1311
|
* The origin chain
|
|
1311
1312
|
*/
|
|
1312
|
-
origin: TSubstrateChain;
|
|
1313
|
+
origin: TSubstrateChain$1;
|
|
1313
1314
|
asset: TAssetInfo;
|
|
1314
1315
|
version: Version;
|
|
1315
1316
|
feeAsset?: TAssetInfo;
|
|
@@ -1335,12 +1336,12 @@ type TDryRunChainFailure = TDryRunResBase & {
|
|
|
1335
1336
|
};
|
|
1336
1337
|
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
1337
1338
|
type THopInfo = {
|
|
1338
|
-
chain: TChain;
|
|
1339
|
+
chain: TChain$1;
|
|
1339
1340
|
result: TDryRunChainResult;
|
|
1340
1341
|
/** @deprecated Use `result.isExchange` instead. Will be removed in v13. */
|
|
1341
1342
|
isExchange?: boolean;
|
|
1342
1343
|
};
|
|
1343
|
-
type TChainEndpoint = 'origin' | 'destination' | TChain;
|
|
1344
|
+
type TChainEndpoint = 'origin' | 'destination' | TChain$1;
|
|
1344
1345
|
type TDryRunResult = {
|
|
1345
1346
|
failureReason?: string;
|
|
1346
1347
|
failureSubReason?: string;
|
|
@@ -1352,8 +1353,8 @@ type TDryRunResult = {
|
|
|
1352
1353
|
type TResolveHopParams<TApi, TRes, TSigner> = {
|
|
1353
1354
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
1354
1355
|
tx: TRes;
|
|
1355
|
-
originChain: TSubstrateChain;
|
|
1356
|
-
currentChain: TSubstrateChain;
|
|
1356
|
+
originChain: TSubstrateChain$1;
|
|
1357
|
+
currentChain: TSubstrateChain$1;
|
|
1357
1358
|
destination: TDestination;
|
|
1358
1359
|
asset: TAssetInfo;
|
|
1359
1360
|
currency: TCurrencyInputWithAmount;
|
|
@@ -1362,8 +1363,8 @@ type TResolveHopParams<TApi, TRes, TSigner> = {
|
|
|
1362
1363
|
};
|
|
1363
1364
|
type HopProcessParams<TApi, TRes, TSigner> = {
|
|
1364
1365
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
1365
|
-
currentChain: TSubstrateChain;
|
|
1366
|
-
currentOrigin: TSubstrateChain;
|
|
1366
|
+
currentChain: TSubstrateChain$1;
|
|
1367
|
+
currentOrigin: TSubstrateChain$1;
|
|
1367
1368
|
currentAsset: TAssetInfo;
|
|
1368
1369
|
forwardedXcms: any;
|
|
1369
1370
|
hasPassedExchange: boolean;
|
|
@@ -1371,8 +1372,8 @@ type HopProcessParams<TApi, TRes, TSigner> = {
|
|
|
1371
1372
|
};
|
|
1372
1373
|
type HopTraversalConfig<TApi, TRes, TSigner, THopResult> = {
|
|
1373
1374
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
1374
|
-
origin: TSubstrateChain;
|
|
1375
|
-
destination: TChain;
|
|
1375
|
+
origin: TSubstrateChain$1;
|
|
1376
|
+
destination: TChain$1;
|
|
1376
1377
|
currency: TCurrencyCore;
|
|
1377
1378
|
initialForwardedXcms: any;
|
|
1378
1379
|
initialDestParaId: number | undefined;
|
|
@@ -1386,11 +1387,11 @@ type HopTraversalConfig<TApi, TRes, TSigner, THopResult> = {
|
|
|
1386
1387
|
};
|
|
1387
1388
|
type HopTraversalResult<THopResult> = {
|
|
1388
1389
|
hops: Array<{
|
|
1389
|
-
chain: TSubstrateChain;
|
|
1390
|
+
chain: TSubstrateChain$1;
|
|
1390
1391
|
result: THopResult;
|
|
1391
1392
|
}>;
|
|
1392
1393
|
destination?: THopResult;
|
|
1393
|
-
lastProcessedChain?: TSubstrateChain;
|
|
1394
|
+
lastProcessedChain?: TSubstrateChain$1;
|
|
1394
1395
|
};
|
|
1395
1396
|
type TBypassOptions = {
|
|
1396
1397
|
mintFeeAssets?: boolean;
|
|
@@ -1513,11 +1514,11 @@ type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
|
1513
1514
|
/**
|
|
1514
1515
|
* The origin chain
|
|
1515
1516
|
*/
|
|
1516
|
-
origin: TSubstrateChain;
|
|
1517
|
+
origin: TSubstrateChain$1;
|
|
1517
1518
|
/**
|
|
1518
1519
|
* The destination chain
|
|
1519
1520
|
*/
|
|
1520
|
-
destination: TChain;
|
|
1521
|
+
destination: TChain$1;
|
|
1521
1522
|
/**
|
|
1522
1523
|
* The sender address
|
|
1523
1524
|
*/
|
|
@@ -1525,7 +1526,7 @@ type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
|
1525
1526
|
address: string;
|
|
1526
1527
|
currency: WithAmount<TCurrencyCore>;
|
|
1527
1528
|
version?: Version;
|
|
1528
|
-
feeAsset?: TCurrencyInput;
|
|
1529
|
+
feeAsset?: TCurrencyInput$1;
|
|
1529
1530
|
disableFallback: TDisableFallback;
|
|
1530
1531
|
swapConfig?: TXcmFeeSwapConfig;
|
|
1531
1532
|
skipReverseFeeCalculation?: boolean;
|
|
@@ -1542,12 +1543,12 @@ type TGetXcmFeeBuilderOptions = {
|
|
|
1542
1543
|
};
|
|
1543
1544
|
type TGetOriginXcmFeeBaseOptions<TRes> = {
|
|
1544
1545
|
buildTx: TTxFactory<TRes>;
|
|
1545
|
-
origin: TSubstrateChain;
|
|
1546
|
-
destination: TChain;
|
|
1546
|
+
origin: TSubstrateChain$1;
|
|
1547
|
+
destination: TChain$1;
|
|
1547
1548
|
senderAddress: string;
|
|
1548
1549
|
currency: WithAmount<TCurrencyCore>;
|
|
1549
1550
|
version?: Version;
|
|
1550
|
-
feeAsset?: TCurrencyInput;
|
|
1551
|
+
feeAsset?: TCurrencyInput$1;
|
|
1551
1552
|
disableFallback: boolean;
|
|
1552
1553
|
useRootOrigin?: boolean;
|
|
1553
1554
|
};
|
|
@@ -1556,9 +1557,9 @@ type TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner> = Omit<TGetOriginXcmFe
|
|
|
1556
1557
|
tx: TRes;
|
|
1557
1558
|
};
|
|
1558
1559
|
type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
1559
|
-
prevChain: TSubstrateChain;
|
|
1560
|
-
origin: TSubstrateChain;
|
|
1561
|
-
destination: TChain;
|
|
1560
|
+
prevChain: TSubstrateChain$1;
|
|
1561
|
+
origin: TSubstrateChain$1;
|
|
1562
|
+
destination: TChain$1;
|
|
1562
1563
|
senderAddress: string;
|
|
1563
1564
|
address: string;
|
|
1564
1565
|
currency: WithAmount<TCurrencyCore>;
|
|
@@ -1567,7 +1568,7 @@ type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
|
1567
1568
|
asset: TAssetInfo;
|
|
1568
1569
|
version: Version;
|
|
1569
1570
|
originFee: bigint;
|
|
1570
|
-
feeAsset?: TCurrencyInput;
|
|
1571
|
+
feeAsset?: TCurrencyInput$1;
|
|
1571
1572
|
disableFallback: boolean;
|
|
1572
1573
|
hasPassedExchange?: boolean;
|
|
1573
1574
|
swapConfig?: TXcmFeeSwapConfig;
|
|
@@ -1575,7 +1576,7 @@ type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
|
1575
1576
|
};
|
|
1576
1577
|
type TGetFeeForDestChainOptions<TApi, TRes, TSigner> = WithApi<TGetFeeForDestChainBaseOptions<TRes>, TApi, TRes, TSigner>;
|
|
1577
1578
|
type TGetReverseTxFeeOptions<TApi, TRes, TSigner> = Omit<TGetFeeForDestChainOptions<TApi, TRes, TSigner>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevChain' | 'version'> & {
|
|
1578
|
-
destination: TSubstrateChain;
|
|
1579
|
+
destination: TSubstrateChain$1;
|
|
1579
1580
|
};
|
|
1580
1581
|
type TFeeType = 'dryRun' | 'paymentInfo' | 'noFeeRequired';
|
|
1581
1582
|
type TXcmFeeBase$1 = {
|
|
@@ -1614,13 +1615,13 @@ type TDestXcmFeeDetail<TDisableFallback extends boolean> = TConditionalXcmFeeDet
|
|
|
1614
1615
|
destParaId?: number;
|
|
1615
1616
|
};
|
|
1616
1617
|
type TConditionalXcmFeeHopInfo<TDisableFallback extends boolean> = {
|
|
1617
|
-
chain: TChain;
|
|
1618
|
+
chain: TChain$1;
|
|
1618
1619
|
result: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1619
1620
|
/** @deprecated - Use `result.isExchange` instead. Will be removed in v13. */
|
|
1620
1621
|
isExchange?: boolean;
|
|
1621
1622
|
};
|
|
1622
1623
|
type TXcmFeeHopInfo = {
|
|
1623
|
-
chain: TChain;
|
|
1624
|
+
chain: TChain$1;
|
|
1624
1625
|
result: TXcmFeeDetail;
|
|
1625
1626
|
/** @deprecated - Use `result.isExchange` instead. Will be removed in v13. */
|
|
1626
1627
|
isExchange?: boolean;
|
|
@@ -1654,7 +1655,7 @@ type TGetBalanceCommonOptions = {
|
|
|
1654
1655
|
/**
|
|
1655
1656
|
* The chain on which to query the balance.
|
|
1656
1657
|
*/
|
|
1657
|
-
chain: TChain;
|
|
1658
|
+
chain: TChain$1;
|
|
1658
1659
|
};
|
|
1659
1660
|
/**
|
|
1660
1661
|
* Retrieves the asset balance for a given account on a specified chain.
|
|
@@ -1684,18 +1685,18 @@ type TGetTransferableAmountOptionsBase<TRes> = {
|
|
|
1684
1685
|
/**
|
|
1685
1686
|
* The chain on which to query the balance.
|
|
1686
1687
|
*/
|
|
1687
|
-
origin: TSubstrateChain;
|
|
1688
|
+
origin: TSubstrateChain$1;
|
|
1688
1689
|
/**
|
|
1689
1690
|
* The destination chain.
|
|
1690
1691
|
*/
|
|
1691
|
-
destination: TChain;
|
|
1692
|
+
destination: TChain$1;
|
|
1692
1693
|
/**
|
|
1693
1694
|
* The currency to query.
|
|
1694
1695
|
*/
|
|
1695
1696
|
currency: WithAmount<TCurrencyCore>;
|
|
1696
1697
|
version: Version | undefined;
|
|
1697
1698
|
buildTx: TTxFactory<TRes>;
|
|
1698
|
-
feeAsset?: TCurrencyInput;
|
|
1699
|
+
feeAsset?: TCurrencyInput$1;
|
|
1699
1700
|
};
|
|
1700
1701
|
type TGetTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1701
1702
|
type TGetMinTransferableAmountOptions<TApi, TRes, TSigner> = WithApi<TGetTransferableAmountOptionsBase<TRes> & {
|
|
@@ -1706,11 +1707,11 @@ type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
|
1706
1707
|
/**
|
|
1707
1708
|
* The origin chain.
|
|
1708
1709
|
*/
|
|
1709
|
-
origin: TSubstrateChain;
|
|
1710
|
+
origin: TSubstrateChain$1;
|
|
1710
1711
|
/**
|
|
1711
1712
|
* The destination chain.
|
|
1712
1713
|
*/
|
|
1713
|
-
destination: TChain;
|
|
1714
|
+
destination: TChain$1;
|
|
1714
1715
|
/**
|
|
1715
1716
|
* The address of the account.
|
|
1716
1717
|
*/
|
|
@@ -1725,11 +1726,11 @@ type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
|
1725
1726
|
currency: WithAmount<TCurrencyCore>;
|
|
1726
1727
|
version: Version | undefined;
|
|
1727
1728
|
buildTx: TTxFactory<TRes>;
|
|
1728
|
-
feeAsset?: TCurrencyInput;
|
|
1729
|
+
feeAsset?: TCurrencyInput$1;
|
|
1729
1730
|
};
|
|
1730
1731
|
type TVerifyEdOnDestinationOptions<TApi, TRes, TSigner> = WithApi<TVerifyEdOnDestinationOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
1731
1732
|
|
|
1732
|
-
type TEvmChainFrom = Extract<TChain, 'Ethereum' | 'Moonbeam' | 'Moonriver' | 'Darwinia'>;
|
|
1733
|
+
type TEvmChainFrom = Extract<TChain$1, 'Ethereum' | 'Moonbeam' | 'Moonriver' | 'Darwinia'>;
|
|
1733
1734
|
/**
|
|
1734
1735
|
* The options for the Ethereum to Polkadot transfer builder.
|
|
1735
1736
|
*/
|
|
@@ -1741,7 +1742,7 @@ type TEvmBuilderOptionsBase = {
|
|
|
1741
1742
|
/**
|
|
1742
1743
|
* The destination chain on Polkadot network.
|
|
1743
1744
|
*/
|
|
1744
|
-
to: TChain;
|
|
1745
|
+
to: TChain$1;
|
|
1745
1746
|
/**
|
|
1746
1747
|
* The currency to transfer. Symbol or ID.
|
|
1747
1748
|
*/
|
|
@@ -1799,7 +1800,7 @@ type TDryRunPreviewOptions = {
|
|
|
1799
1800
|
};
|
|
1800
1801
|
type TBuilderOptions<TApi> = TApi | TBuilderConfig<TApi>;
|
|
1801
1802
|
type TBuilderConfig<TApi> = Partial<{
|
|
1802
|
-
apiOverrides: Partial<Record<TChain, TApi>>;
|
|
1803
|
+
apiOverrides: Partial<Record<TChain$1, TApi>>;
|
|
1803
1804
|
development: boolean;
|
|
1804
1805
|
abstractDecimals: boolean;
|
|
1805
1806
|
xcmFormatCheck: boolean;
|
|
@@ -1832,7 +1833,7 @@ type TChainConfig = {
|
|
|
1832
1833
|
paraId: number;
|
|
1833
1834
|
providers: TProviderEntry[];
|
|
1834
1835
|
};
|
|
1835
|
-
type TChainConfigMap = Record<TSubstrateChain, TChainConfig>;
|
|
1836
|
+
type TChainConfigMap = Record<TSubstrateChain$1, TChainConfig>;
|
|
1836
1837
|
|
|
1837
1838
|
type OneKey<K extends string, V = unknown> = {
|
|
1838
1839
|
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
@@ -1959,7 +1960,7 @@ declare class MissingChainApiError extends Error {
|
|
|
1959
1960
|
*
|
|
1960
1961
|
* @param chain - The chain for which the API is missing.
|
|
1961
1962
|
*/
|
|
1962
|
-
constructor(chain: TChain);
|
|
1963
|
+
constructor(chain: TChain$1);
|
|
1963
1964
|
}
|
|
1964
1965
|
|
|
1965
1966
|
/**
|
|
@@ -1978,7 +1979,7 @@ declare class NoXCMSupportImplementedError extends Error {
|
|
|
1978
1979
|
*
|
|
1979
1980
|
* @param chain - The chain for which XCM support is not implemented.
|
|
1980
1981
|
*/
|
|
1981
|
-
constructor(chain: TChain);
|
|
1982
|
+
constructor(chain: TChain$1);
|
|
1982
1983
|
}
|
|
1983
1984
|
|
|
1984
1985
|
/**
|
|
@@ -2017,7 +2018,7 @@ declare class RuntimeApiUnavailableError extends Error {
|
|
|
2017
2018
|
}
|
|
2018
2019
|
|
|
2019
2020
|
type TScenarioNotSupportedContext = {
|
|
2020
|
-
chain: TChain;
|
|
2021
|
+
chain: TChain$1;
|
|
2021
2022
|
scenario: TScenario;
|
|
2022
2023
|
};
|
|
2023
2024
|
/**
|
|
@@ -2063,7 +2064,7 @@ declare class ValidationError extends Error {
|
|
|
2063
2064
|
}
|
|
2064
2065
|
|
|
2065
2066
|
type THopTransferInfo = {
|
|
2066
|
-
chain: TChain;
|
|
2067
|
+
chain: TChain$1;
|
|
2067
2068
|
result: {
|
|
2068
2069
|
xcmFee: TXcmFeeBase;
|
|
2069
2070
|
asset: TAssetInfo;
|
|
@@ -2075,8 +2076,8 @@ type TXcmFeeBase = {
|
|
|
2075
2076
|
};
|
|
2076
2077
|
type TTransferInfo = {
|
|
2077
2078
|
chain: {
|
|
2078
|
-
origin: TChain;
|
|
2079
|
-
destination: TChain;
|
|
2079
|
+
origin: TChain$1;
|
|
2080
|
+
destination: TChain$1;
|
|
2080
2081
|
ecosystem: string;
|
|
2081
2082
|
};
|
|
2082
2083
|
origin: {
|
|
@@ -2108,9 +2109,9 @@ type TTransferInfo = {
|
|
|
2108
2109
|
};
|
|
2109
2110
|
type BuildHopInfoOptions<TApi, TRes, TSigner> = {
|
|
2110
2111
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
2111
|
-
chain: TSubstrateChain;
|
|
2112
|
+
chain: TSubstrateChain$1;
|
|
2112
2113
|
fee: bigint;
|
|
2113
|
-
originChain: TSubstrateChain;
|
|
2114
|
+
originChain: TSubstrateChain$1;
|
|
2114
2115
|
currency: TCurrencyCore;
|
|
2115
2116
|
asset: TAssetInfo;
|
|
2116
2117
|
senderAddress: string;
|
|
@@ -2118,8 +2119,8 @@ type BuildHopInfoOptions<TApi, TRes, TSigner> = {
|
|
|
2118
2119
|
};
|
|
2119
2120
|
type TBuildDestInfoOptions<TApi, TRes, TSigner> = {
|
|
2120
2121
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
2121
|
-
origin: TSubstrateChain;
|
|
2122
|
-
destination: TChain;
|
|
2122
|
+
origin: TSubstrateChain$1;
|
|
2123
|
+
destination: TChain$1;
|
|
2123
2124
|
address: string;
|
|
2124
2125
|
currency: WithAmount<TCurrencyCore>;
|
|
2125
2126
|
originFee: bigint;
|
|
@@ -2134,8 +2135,8 @@ type TOriginFeeDetails = {
|
|
|
2134
2135
|
};
|
|
2135
2136
|
type TGetTransferInfoOptionsBase<TRes> = {
|
|
2136
2137
|
buildTx: TTxFactory<TRes>;
|
|
2137
|
-
origin: TSubstrateChain;
|
|
2138
|
-
destination: TChain;
|
|
2138
|
+
origin: TSubstrateChain$1;
|
|
2139
|
+
destination: TChain$1;
|
|
2139
2140
|
senderAddress: string;
|
|
2140
2141
|
ahAddress?: string;
|
|
2141
2142
|
address: string;
|
|
@@ -2145,14 +2146,14 @@ type TGetTransferInfoOptionsBase<TRes> = {
|
|
|
2145
2146
|
};
|
|
2146
2147
|
type TGetTransferInfoOptions<TApi, TRes, TSigner> = WithApi<TGetTransferInfoOptionsBase<TRes>, TApi, TRes, TSigner>;
|
|
2147
2148
|
|
|
2148
|
-
type TChainWithApi<TApi, TRes, TSigner, T = TSubstrateChain> = {
|
|
2149
|
+
type TChainWithApi<TApi, TRes, TSigner, T = TSubstrateChain$1> = {
|
|
2149
2150
|
api: IPolkadotApi<TApi, TRes, TSigner>;
|
|
2150
2151
|
chain: T;
|
|
2151
2152
|
};
|
|
2152
2153
|
type TTypeAndThenCallContext<TApi, TRes, TSigner> = {
|
|
2153
2154
|
origin: TChainWithApi<TApi, TRes, TSigner>;
|
|
2154
2155
|
dest: TChainWithApi<TApi, TRes, TSigner>;
|
|
2155
|
-
reserve: TChainWithApi<TApi, TRes, TSigner, TChain>;
|
|
2156
|
+
reserve: TChainWithApi<TApi, TRes, TSigner, TChain$1>;
|
|
2156
2157
|
isSubBridge: boolean;
|
|
2157
2158
|
isSnowbridge: boolean;
|
|
2158
2159
|
isRelayAsset: boolean;
|
|
@@ -2165,7 +2166,7 @@ type TTypeAndThenFees = {
|
|
|
2165
2166
|
destFee: bigint;
|
|
2166
2167
|
};
|
|
2167
2168
|
type TTypeAndThenOverrides = {
|
|
2168
|
-
reserveChain?: TSubstrateChain;
|
|
2169
|
+
reserveChain?: TSubstrateChain$1;
|
|
2169
2170
|
noFeeAsset?: boolean;
|
|
2170
2171
|
};
|
|
2171
2172
|
|
|
@@ -2175,7 +2176,7 @@ declare const createClientPoolHelpers: <TClient>(clientPool: ClientCache<TClient
|
|
|
2175
2176
|
releaseClient: (ws: TUrl) => void;
|
|
2176
2177
|
};
|
|
2177
2178
|
|
|
2178
|
-
declare const resolveChainApi: <TApi>(config: TBuilderOptions<TApiOrUrl<TApi>> | undefined, chain: TSubstrateChain, createApiInstance: (wsUrl: TUrl, chain: TSubstrateChain) => Promise<TApi>) => Promise<TApi>;
|
|
2179
|
+
declare const resolveChainApi: <TApi>(config: TBuilderOptions<TApiOrUrl<TApi>> | undefined, chain: TSubstrateChain$1, createApiInstance: (wsUrl: TUrl, chain: TSubstrateChain$1) => Promise<TApi>) => Promise<TApi>;
|
|
2179
2180
|
|
|
2180
2181
|
declare const createClientCache: <T>(maxSize: number, pingClient: (client: T) => Promise<void>, onEviction?: (key: TClientKey, value: TClientEntry<T>) => void, extensionMs?: number) => ClientCache<T>;
|
|
2181
2182
|
|
|
@@ -2183,7 +2184,7 @@ declare const blake2b256: (msg: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
|
2183
2184
|
declare const blake2b512: (msg: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
2184
2185
|
declare const deriveAccountId: (raw: Uint8Array) => Uint8Array;
|
|
2185
2186
|
declare const encodeSs58: (payload: Uint8Array, network: number) => string;
|
|
2186
|
-
declare const convertSs58: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, chain: TSubstrateChain) => string;
|
|
2187
|
+
declare const convertSs58: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: string, chain: TSubstrateChain$1) => string;
|
|
2187
2188
|
|
|
2188
2189
|
declare const getAssetBalanceInternal: <TApi, TRes, TSigner>({ api, address, chain, asset }: TGetAssetBalanceOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
2189
2190
|
declare const getBalanceInternal: <TApi, TRes, TSigner>(options: TGetBalanceOptions<TApi, TRes, TSigner>) => Promise<bigint>;
|
|
@@ -2191,11 +2192,11 @@ declare const getBalance: <TApi, TRes, TSigner>(options: TGetBalanceOptions<TApi
|
|
|
2191
2192
|
|
|
2192
2193
|
declare const getEthErc20Balance: (chain: TExternalChain, asset: TAssetInfo, address: string) => Promise<bigint>;
|
|
2193
2194
|
|
|
2194
|
-
declare const getMoonbeamErc20Balance: (chain: TSubstrateChain, assetId: string, address: string) => Promise<bigint>;
|
|
2195
|
+
declare const getMoonbeamErc20Balance: (chain: TSubstrateChain$1, assetId: string, address: string) => Promise<bigint>;
|
|
2195
2196
|
|
|
2196
|
-
declare const getChainConfig: (chain: TSubstrateChain) => TChainConfig;
|
|
2197
|
+
declare const getChainConfig: (chain: TSubstrateChain$1) => TChainConfig;
|
|
2197
2198
|
|
|
2198
|
-
declare const getChainProviders: (chain: TSubstrateChain) => string[];
|
|
2199
|
+
declare const getChainProviders: (chain: TSubstrateChain$1) => string[];
|
|
2199
2200
|
|
|
2200
2201
|
/**
|
|
2201
2202
|
* Retrieves the parachain ID for a specified chain.
|
|
@@ -2203,7 +2204,7 @@ declare const getChainProviders: (chain: TSubstrateChain) => string[];
|
|
|
2203
2204
|
* @param chain - The chain for which to get the paraId.
|
|
2204
2205
|
* @returns The parachain ID of the chain.
|
|
2205
2206
|
*/
|
|
2206
|
-
declare const getParaId: (chain: TChain) => number;
|
|
2207
|
+
declare const getParaId: (chain: TChain$1) => number;
|
|
2207
2208
|
|
|
2208
2209
|
/**
|
|
2209
2210
|
* Retrieves the chain name corresponding to a specified parachain ID.
|
|
@@ -2211,7 +2212,7 @@ declare const getParaId: (chain: TChain) => number;
|
|
|
2211
2212
|
* @param paraId - The parachain ID.
|
|
2212
2213
|
* @returns The chain name if found; otherwise, null.
|
|
2213
2214
|
*/
|
|
2214
|
-
declare const getTChain: (paraId: number, ecosystem: TRelaychain | TExternalChain) => TChain | null;
|
|
2215
|
+
declare const getTChain: (paraId: number, ecosystem: TRelaychain | TExternalChain) => TChain$1 | null;
|
|
2215
2216
|
|
|
2216
2217
|
declare const claimAssets: <TApi, TRes, TSigner>(options: TAssetClaimOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2217
2218
|
|
|
@@ -2244,7 +2245,7 @@ declare const getFailureInfo: (result: TDryRunResult) => Pick<TDryRunResult, "fa
|
|
|
2244
2245
|
declare const traverseXcmHops: <TApi, TRes, TSigner, THopResult>(config: HopTraversalConfig<TApi, TRes, TSigner, THopResult>) => Promise<HopTraversalResult<THopResult>>;
|
|
2245
2246
|
declare const addEthereumBridgeFees: <TApi, TRes, TSigner, TResult extends {
|
|
2246
2247
|
fee?: bigint;
|
|
2247
|
-
}>(api: IPolkadotApi<TApi, TRes, TSigner>, bridgeHubResult: TResult | undefined, destination: TChain, assetHubChain: TSubstrateChain) => Promise<TResult | undefined>;
|
|
2248
|
+
}>(api: IPolkadotApi<TApi, TRes, TSigner>, bridgeHubResult: TResult | undefined, destination: TChain$1, assetHubChain: TSubstrateChain$1) => Promise<TResult | undefined>;
|
|
2248
2249
|
|
|
2249
2250
|
declare const calcPreviewMintAmount: (balance: bigint, desired: bigint) => bigint | null;
|
|
2250
2251
|
declare const wrapTxBypass: <TApi, TRes, TSigner>(dryRunOptions: TDryRunBypassOptions<TApi, TRes, TSigner>, options?: TBypassOptions) => Promise<TRes>;
|
|
@@ -2253,7 +2254,7 @@ declare const getParaEthTransferFees: <TApi, TRes, TSigner>(ahApi: IPolkadotApi<
|
|
|
2253
2254
|
|
|
2254
2255
|
declare const transferMoonbeamEvm: <TApi, TRes, TSigner>(options: TEvmBuilderOptions<TApi, TRes, TSigner>) => Promise<string>;
|
|
2255
2256
|
|
|
2256
|
-
declare const transferMoonbeamToEth: <TApi, TRes, TSigner>(from: TSubstrateChain, { api, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes, TSigner>) => Promise<`0x${string}`>;
|
|
2257
|
+
declare const transferMoonbeamToEth: <TApi, TRes, TSigner>(from: TSubstrateChain$1, { api, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes, TSigner>) => Promise<`0x${string}`>;
|
|
2257
2258
|
|
|
2258
2259
|
declare const getOriginXcmFee: <TApi, TRes, TSigner>(options: TGetOriginXcmFeeOptions<TApi, TRes, TSigner>) => Promise<TXcmFeeDetail & {
|
|
2259
2260
|
forwardedXcms?: unknown;
|
|
@@ -2309,18 +2310,18 @@ declare const createTypeAndThenCall: <TApi, TRes, TSigner>(options: TPolkadotXCM
|
|
|
2309
2310
|
* by dry-running both variants and preferring the one that succeeds. If both fail, returns the
|
|
2310
2311
|
* AssetHub variant. Supports only relaychain assets.
|
|
2311
2312
|
*/
|
|
2312
|
-
declare const createTypeThenAutoReserve: <TApi, TRes, TSigner>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TSerializedExtrinsics>;
|
|
2313
|
+
declare const createTypeThenAutoReserve: <TApi, TRes, TSigner>(chain: TSubstrateChain$1, options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TSerializedExtrinsics>;
|
|
2313
2314
|
|
|
2314
|
-
declare const validateCurrency: (currency: TCurrencyInput, feeAsset?: TCurrencyInput) => void;
|
|
2315
|
-
declare const validateDestination: (origin: TSubstrateChain, destination: TDestination) => void;
|
|
2316
|
-
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput) => void;
|
|
2315
|
+
declare const validateCurrency: (currency: TCurrencyInput$1, feeAsset?: TCurrencyInput$1) => void;
|
|
2316
|
+
declare const validateDestination: (origin: TSubstrateChain$1, destination: TDestination) => void;
|
|
2317
|
+
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput$1) => void;
|
|
2317
2318
|
declare const validateTransact: <TApi, TRes, TSigner>({ api, from, to, senderAddress, address, transactOptions }: TSendOptions<TApi, TRes, TSigner>) => ValidationError | undefined;
|
|
2318
2319
|
|
|
2319
2320
|
declare const verifyEdOnDestination: <TApi, TRes, TSigner>(options: TVerifyEdOnDestinationOptions<TApi, TRes, TSigner>) => Promise<boolean>;
|
|
2320
2321
|
|
|
2321
2322
|
declare const compareAddresses: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, addr1: string, addr2: string) => boolean;
|
|
2322
2323
|
|
|
2323
|
-
declare const validateAddress: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2324
|
+
declare const validateAddress: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, address: TAddress, chain: TChain$1, isDestination?: boolean) => void;
|
|
2324
2325
|
|
|
2325
2326
|
declare const validateDestinationAddress: <TApi, TRes, TSigner>(address: TAddress, destination: TDestination, api: IPolkadotApi<TApi, TRes, TSigner>) => void;
|
|
2326
2327
|
|
|
@@ -2353,9 +2354,9 @@ declare const createTransferOrSwap: <TApi, TRes, TSigner>(options: TSendOptions<
|
|
|
2353
2354
|
|
|
2354
2355
|
declare const isConfig: <TApi>(value: any) => value is TBuilderConfig<TApi>;
|
|
2355
2356
|
|
|
2356
|
-
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation) => TSubstrateChain;
|
|
2357
|
+
declare const getAssetReserveChain: (chain: TSubstrateChain$1, assetLocation: TLocation) => TSubstrateChain$1;
|
|
2357
2358
|
|
|
2358
|
-
declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
2359
|
+
declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain$1) => Version;
|
|
2359
2360
|
|
|
2360
2361
|
/**
|
|
2361
2362
|
* Gets the relay chain (Polkadot, Kusama, Westend, or Paseo) of a given chain.
|
|
@@ -2363,13 +2364,13 @@ declare const getChainVersion: <TApi, TRes, TSigner>(chain: TChain) => Version;
|
|
|
2363
2364
|
* @param chain - The chain to evaluate.
|
|
2364
2365
|
* @returns The corresponding relay chain.
|
|
2365
2366
|
*/
|
|
2366
|
-
declare const getRelayChainOf: (chain: TSubstrateChain) => TRelaychain;
|
|
2367
|
+
declare const getRelayChainOf: (chain: TSubstrateChain$1) => TRelaychain;
|
|
2367
2368
|
|
|
2368
|
-
declare const createChainClient: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain) => Promise<TApi>;
|
|
2369
|
+
declare const createChainClient: <TApi, TRes, TSigner>(api: IPolkadotApi<TApi, TRes, TSigner>, chain: TSubstrateChain$1) => Promise<TApi>;
|
|
2369
2370
|
|
|
2370
|
-
declare const resolveModuleError: (chain: TSubstrateChain, error: TModuleError) => TDryRunError;
|
|
2371
|
+
declare const resolveModuleError: (chain: TSubstrateChain$1, error: TModuleError) => TDryRunError;
|
|
2371
2372
|
|
|
2372
|
-
declare const padFee: (raw: bigint, origin: TSubstrateChain, dest: TChain, side: "origin" | "destination") => bigint;
|
|
2373
|
+
declare const padFee: (raw: bigint, origin: TSubstrateChain$1, dest: TChain$1, side: "origin" | "destination") => bigint;
|
|
2373
2374
|
declare const padValueBy: (amount: bigint, percent: number) => bigint;
|
|
2374
2375
|
|
|
2375
2376
|
/**
|
|
@@ -2385,12 +2386,12 @@ declare const getEvmPrivateKeyHex: (path: string) => "0x5fb92d6e98884f76de468fa3
|
|
|
2385
2386
|
declare const createBeneficiaryLocXTokens: <TApi, TRes, TSigner>({ api, address: recipientAddress, origin, destination, version, paraId }: TCreateBeneficiaryXTokensOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2386
2387
|
declare const createBeneficiaryLocation: <TApi, TRes, TSigner>({ api, address, version }: TCreateBeneficiaryOptions<TApi, TRes, TSigner>) => TLocation;
|
|
2387
2388
|
|
|
2388
|
-
declare const createDestination: (version: Version, origin: TSubstrateChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TLocation;
|
|
2389
|
-
declare const createVersionedDestination: (version: Version, origin: TSubstrateChain, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TXcmVersioned<TLocation>;
|
|
2389
|
+
declare const createDestination: (version: Version, origin: TSubstrateChain$1, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TLocation;
|
|
2390
|
+
declare const createVersionedDestination: (version: Version, origin: TSubstrateChain$1, destination: TDestination, chainId?: number, junction?: TJunction, parents?: Parents) => TXcmVersioned<TLocation>;
|
|
2390
2391
|
|
|
2391
2392
|
declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
|
|
2392
2393
|
|
|
2393
|
-
declare const getChainLocation: (chain: TChain, destChain: TChain) => TLocation;
|
|
2394
|
+
declare const getChainLocation: (chain: TChain$1, destChain: TChain$1) => TLocation;
|
|
2394
2395
|
|
|
2395
2396
|
/**
|
|
2396
2397
|
* This function localizes a location by removing the `Parachain` junction
|
|
@@ -2401,28 +2402,34 @@ declare const getChainLocation: (chain: TChain, destChain: TChain) => TLocation;
|
|
|
2401
2402
|
* @param location - The location to localize
|
|
2402
2403
|
* @returns The localized location
|
|
2403
2404
|
*/
|
|
2404
|
-
declare const localizeLocation: (chain: TChain, location: TLocation, origin?: TChain) => TLocation;
|
|
2405
|
+
declare const localizeLocation: (chain: TChain$1, location: TLocation, origin?: TChain$1) => TLocation;
|
|
2405
2406
|
|
|
2406
2407
|
declare const reverseTransformLocation: (location: TLocation) => TLocation;
|
|
2407
2408
|
|
|
2408
2409
|
declare const normalizeAmount: (amount: bigint) => bigint;
|
|
2409
2410
|
|
|
2410
|
-
declare const resolveDestChain: (originChain: TSubstrateChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "Darwinia" | "EnergyWebX" | "Hydration" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "Manta" | "Nodle" | "NeuroWeb" | "Pendulum" | "Mythos" | "Peaq" | "PeoplePolkadot" | "Unique" | "Xode" | "AssetHubKusama" | "BridgeHubKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Altair" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "Laos" | "Quartz" | "PeopleKusama" | "Shiden" | "Zeitgeist" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AjunaPaseo" | "AssetHubPaseo" | "BifrostPaseo" | "BridgeHubPaseo" | "CoretimePaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "LaosPaseo" | "NeuroWebPaseo" | "PeoplePaseo" | "ZeitgeistPaseo" | undefined;
|
|
2411
|
+
declare const resolveDestChain: (originChain: TSubstrateChain$1, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "Darwinia" | "EnergyWebX" | "Hydration" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "Manta" | "Nodle" | "NeuroWeb" | "Pendulum" | "Mythos" | "Peaq" | "PeoplePolkadot" | "Unique" | "Xode" | "AssetHubKusama" | "BridgeHubKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Altair" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "Laos" | "Quartz" | "PeopleKusama" | "Shiden" | "Zeitgeist" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AjunaPaseo" | "AssetHubPaseo" | "BifrostPaseo" | "BridgeHubPaseo" | "CoretimePaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "LaosPaseo" | "NeuroWebPaseo" | "PeoplePaseo" | "ZeitgeistPaseo" | undefined;
|
|
2411
2412
|
|
|
2412
2413
|
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
2413
2414
|
|
|
2414
|
-
|
|
2415
|
-
|
|
2415
|
+
interface TSwapExtension {
|
|
2416
|
+
RouterBuilder: typeof RouterBuilder;
|
|
2417
|
+
}
|
|
2418
|
+
declare const registerSwapExtension: (extension: TSwapExtension) => void;
|
|
2419
|
+
declare const getSwapExtensionOrThrow: () => TSwapExtension;
|
|
2420
|
+
|
|
2421
|
+
declare const createRouterBuilder: <TApi, TRes, TSigner>(options: TSendOptionsWithSwap<TApi, TRes, TSigner>) => _paraspell_swap.RouterBuilderCore<object & {
|
|
2422
|
+
from: TSubstrateChain | undefined;
|
|
2416
2423
|
} & {
|
|
2417
|
-
exchange:
|
|
2424
|
+
exchange: TExchangeInput;
|
|
2418
2425
|
} & {
|
|
2419
|
-
to:
|
|
2426
|
+
to: TChain | undefined;
|
|
2420
2427
|
} & {
|
|
2421
|
-
currencyFrom:
|
|
2428
|
+
currencyFrom: TCurrencyInput;
|
|
2422
2429
|
} & {
|
|
2423
|
-
currencyTo:
|
|
2430
|
+
currencyTo: TCurrencyInput;
|
|
2424
2431
|
} & {
|
|
2425
|
-
amount:
|
|
2432
|
+
amount: TAmount;
|
|
2426
2433
|
} & {
|
|
2427
2434
|
senderAddress: string;
|
|
2428
2435
|
} & {
|
|
@@ -2431,12 +2438,12 @@ declare const createRouterBuilder: <TApi, TRes, TSigner>(options: TSendOptionsWi
|
|
|
2431
2438
|
recipientAddress: string | undefined;
|
|
2432
2439
|
} & {
|
|
2433
2440
|
slippagePct: string;
|
|
2434
|
-
}
|
|
2441
|
+
}>;
|
|
2435
2442
|
declare const executeWithRouter: <TApi, TRes, TSigner, T>(options: TSendOptionsWithSwap<TApi, TRes, TSigner>, executor: (builder: Awaited<ReturnType<typeof createRouterBuilder>>) => Promise<T>) => Promise<T>;
|
|
2436
2443
|
declare const normalizeExchange: (exchange: TExchangeInput) => TExchangeInput;
|
|
2437
2444
|
|
|
2438
|
-
declare const abstractDecimals: <TApi, TRes, TSigner>(amount: TAmount, decimals: number | undefined, api: IPolkadotApi<TApi, TRes, TSigner>) => bigint;
|
|
2439
|
-
declare const applyDecimalAbstraction: (amount: TAmount, decimals: number | undefined, shouldAbstract: boolean) => bigint;
|
|
2445
|
+
declare const abstractDecimals: <TApi, TRes, TSigner>(amount: TAmount$1, decimals: number | undefined, api: IPolkadotApi<TApi, TRes, TSigner>) => bigint;
|
|
2446
|
+
declare const applyDecimalAbstraction: (amount: TAmount$1, decimals: number | undefined, shouldAbstract: boolean) => bigint;
|
|
2440
2447
|
|
|
2441
2448
|
declare const createAssetsFilter: (asset: TAsset, version: Version) => {
|
|
2442
2449
|
Wild: {
|
|
@@ -2453,9 +2460,9 @@ declare const createBaseExecuteXcm: <TRes>(options: TCreateBaseTransferXcmOption
|
|
|
2453
2460
|
suffixXcm?: unknown[];
|
|
2454
2461
|
}) => unknown[];
|
|
2455
2462
|
|
|
2456
|
-
declare const createExecuteCall: (chain: TSubstrateChain, xcm: TXcmVersioned<any>, maxWeight: TWeight) => TSerializedExtrinsics;
|
|
2463
|
+
declare const createExecuteCall: (chain: TSubstrateChain$1, xcm: TXcmVersioned<any>, maxWeight: TWeight) => TSerializedExtrinsics;
|
|
2457
2464
|
|
|
2458
|
-
declare const createExecuteExchangeXcm: <TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, origin: TSubstrateChain, weight: TWeight, originExecutionFee: bigint, destExecutionFee: bigint) => TRes;
|
|
2465
|
+
declare const createExecuteExchangeXcm: <TApi, TRes, TSigner>(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, origin: TSubstrateChain$1, weight: TWeight, originExecutionFee: bigint, destExecutionFee: bigint) => TRes;
|
|
2459
2466
|
|
|
2460
2467
|
declare const createDirectExecuteXcm: <TApi, TRes, TSigner>(options: TCreateTransferXcmOptions<TApi, TRes, TSigner>) => Promise<OneKey<_paraspell_sdk_common.Version, unknown[]>>;
|
|
2461
2468
|
|
|
@@ -2467,7 +2474,7 @@ declare const getLocalTransferAmount: <TApi, TRes, TSigner>({ assetInfo, balance
|
|
|
2467
2474
|
|
|
2468
2475
|
declare const handleToAhTeleport: <TApi, TRes, TSigner>(origin: TParachain, input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>, defaultTx: TRes) => Promise<TRes>;
|
|
2469
2476
|
|
|
2470
|
-
declare const throwUnsupportedCurrency: (currency: TCurrencyInput, chain: string, { isDestination }?: {
|
|
2477
|
+
declare const throwUnsupportedCurrency: (currency: TCurrencyInput$1, chain: string, { isDestination }?: {
|
|
2471
2478
|
isDestination: boolean;
|
|
2472
2479
|
}) => never;
|
|
2473
2480
|
|
|
@@ -2476,8 +2483,8 @@ declare const formatUnits: typeof formatUnits$1;
|
|
|
2476
2483
|
|
|
2477
2484
|
declare const addXcmVersionHeader: <T, V extends Version>(obj: T, version: V) => OneKey<V, T>;
|
|
2478
2485
|
declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersion: Version, destMaxVersion?: Version) => Version;
|
|
2479
|
-
declare const pickCompatibleXcmVersion: (origin: TSubstrateChain, destination: TDestination, override?: Version) => Version;
|
|
2480
|
-
declare const pickRouterCompatibleXcmVersion: (origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2486
|
+
declare const pickCompatibleXcmVersion: (origin: TSubstrateChain$1, destination: TDestination, override?: Version) => Version;
|
|
2487
|
+
declare const pickRouterCompatibleXcmVersion: (origin: TSubstrateChain$1 | undefined, exchangeChain: TSubstrateChain$1, destination: TChain$1 | undefined) => Version;
|
|
2481
2488
|
|
|
2482
|
-
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, assertSenderAddress, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, 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, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2483
|
-
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, 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, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendBaseOptionsWithSwap, TSendInternalOptions, TSendOptions, TSendOptionsWithSwap, TSender, TSerializeEthTransferOptions, TSerializedEthTransfer, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSwapConfig, TSwapEvent, TSwapEventType, TSwapFeeEstimates, TSwapOptions, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress, WithRequiredSwapOptions };
|
|
2489
|
+
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, assertSenderAddress, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, 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, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, 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 };
|
|
2490
|
+
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, 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, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPaymentInfo, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendBaseOptionsWithSwap, TSendInternalOptions, TSendOptions, TSendOptionsWithSwap, TSender, TSerializeEthTransferOptions, TSerializedEthTransfer, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSwapConfig, TSwapEvent, TSwapEventType, TSwapExtension, TSwapFeeEstimates, TSwapOptions, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress, WithRequiredSwapOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -9631,6 +9631,17 @@ var verifyEdOnDestination = /*#__PURE__*/function () {
|
|
|
9631
9631
|
};
|
|
9632
9632
|
}();
|
|
9633
9633
|
|
|
9634
|
+
var swapExtension;
|
|
9635
|
+
var registerSwapExtension = function registerSwapExtension(extension) {
|
|
9636
|
+
swapExtension = extension;
|
|
9637
|
+
};
|
|
9638
|
+
var getSwapExtensionOrThrow = function getSwapExtensionOrThrow() {
|
|
9639
|
+
if (!swapExtension) {
|
|
9640
|
+
throw new ExtensionNotInstalledError('The swap extension is not registered. Please install @paraspell/swap and import it before using swap features.');
|
|
9641
|
+
}
|
|
9642
|
+
return swapExtension;
|
|
9643
|
+
};
|
|
9644
|
+
|
|
9634
9645
|
var _excluded = ["apiOverrides"];
|
|
9635
9646
|
var isUrl = function isUrl(value) {
|
|
9636
9647
|
return typeof value === 'string' || Array.isArray(value);
|
|
@@ -9662,99 +9673,58 @@ var convertBuilderConfig = function convertBuilderConfig(config) {
|
|
|
9662
9673
|
throw new UnsupportedOperationError('Swap module does not support API client override');
|
|
9663
9674
|
}
|
|
9664
9675
|
};
|
|
9665
|
-
var
|
|
9666
|
-
var
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
if (!(api.getType() !== 'PAPI')) {
|
|
9705
|
-
_context2.n = 2;
|
|
9706
|
-
break;
|
|
9707
|
-
}
|
|
9708
|
-
throw new UnsupportedOperationError('Swaps are only supported when using PAPI SDK.');
|
|
9709
|
-
case 2:
|
|
9710
|
-
_context2.n = 3;
|
|
9711
|
-
return importSwapModuleOrThrow();
|
|
9712
|
-
case 3:
|
|
9713
|
-
_yield$importSwapModu = _context2.v;
|
|
9714
|
-
RouterBuilder = _yield$importSwapModu.RouterBuilder;
|
|
9715
|
-
from = options.from, to = options.to, currency = options.currency, _options$swapOptions = options.swapOptions, currencyTo = _options$swapOptions.currencyTo, evmSenderAddress = _options$swapOptions.evmSenderAddress, exchange = _options$swapOptions.exchange, slippage = _options$swapOptions.slippage, onStatusChange = _options$swapOptions.onStatusChange, senderAddress = options.senderAddress, address = options.address;
|
|
9716
|
-
assertToIsString(to);
|
|
9717
|
-
assertAddressIsString(address);
|
|
9718
|
-
assertSenderAddress(senderAddress);
|
|
9719
|
-
if (!Array.isArray(currency)) {
|
|
9720
|
-
_context2.n = 4;
|
|
9721
|
-
break;
|
|
9722
|
-
}
|
|
9723
|
-
throw new UnsupportedOperationError('Swaps with multiple currencies are not supported.');
|
|
9724
|
-
case 4:
|
|
9725
|
-
config = api.getConfig();
|
|
9726
|
-
routerConfig = convertBuilderConfig(config);
|
|
9727
|
-
builder = RouterBuilder(routerConfig).from(from).exchange(exchange).to(to).currencyFrom(currency).currencyTo(currencyTo).amount(currency.amount).senderAddress(senderAddress).evmSenderAddress(evmSenderAddress).recipientAddress(address).slippagePct((_slippage$toString = slippage === null || slippage === void 0 ? void 0 : slippage.toString()) !== null && _slippage$toString !== void 0 ? _slippage$toString : DEFAULT_SWAP_SLIPPAGE.toString());
|
|
9728
|
-
if (onStatusChange) {
|
|
9729
|
-
// We cast because router types are bind to specific PAPI types
|
|
9730
|
-
// Will be resolved when we make RouterBuilder generic
|
|
9731
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
9732
|
-
builder = builder.onStatusChange(onStatusChange);
|
|
9733
|
-
}
|
|
9734
|
-
return _context2.a(2, builder);
|
|
9735
|
-
}
|
|
9736
|
-
}, _callee2);
|
|
9737
|
-
}));
|
|
9738
|
-
return function createRouterBuilder(_x) {
|
|
9739
|
-
return _ref4.apply(this, arguments);
|
|
9740
|
-
};
|
|
9741
|
-
}();
|
|
9676
|
+
var createRouterBuilder = function createRouterBuilder(options) {
|
|
9677
|
+
var _options$transactOpti, _slippage$toString;
|
|
9678
|
+
var api = options.api;
|
|
9679
|
+
if ((_options$transactOpti = options.transactOptions) !== null && _options$transactOpti !== void 0 && _options$transactOpti.call) {
|
|
9680
|
+
throw new UnsupportedOperationError('Cannot use transact options together with swap options.');
|
|
9681
|
+
}
|
|
9682
|
+
if (api.getType() !== 'PAPI') {
|
|
9683
|
+
throw new UnsupportedOperationError('Swaps are only supported when using PAPI SDK.');
|
|
9684
|
+
}
|
|
9685
|
+
var _getSwapExtensionOrTh = getSwapExtensionOrThrow(),
|
|
9686
|
+
RouterBuilder = _getSwapExtensionOrTh.RouterBuilder;
|
|
9687
|
+
var from = options.from,
|
|
9688
|
+
to = options.to,
|
|
9689
|
+
currency = options.currency,
|
|
9690
|
+
_options$swapOptions = options.swapOptions,
|
|
9691
|
+
currencyTo = _options$swapOptions.currencyTo,
|
|
9692
|
+
evmSenderAddress = _options$swapOptions.evmSenderAddress,
|
|
9693
|
+
exchange = _options$swapOptions.exchange,
|
|
9694
|
+
slippage = _options$swapOptions.slippage,
|
|
9695
|
+
onStatusChange = _options$swapOptions.onStatusChange,
|
|
9696
|
+
senderAddress = options.senderAddress,
|
|
9697
|
+
address = options.address;
|
|
9698
|
+
assertToIsString(to);
|
|
9699
|
+
assertAddressIsString(address);
|
|
9700
|
+
assertSenderAddress(senderAddress);
|
|
9701
|
+
if (Array.isArray(currency)) {
|
|
9702
|
+
throw new UnsupportedOperationError('Swaps with multiple currencies are not supported.');
|
|
9703
|
+
}
|
|
9704
|
+
var config = api.getConfig();
|
|
9705
|
+
var routerConfig = convertBuilderConfig(config);
|
|
9706
|
+
var builder = RouterBuilder(routerConfig).from(from).exchange(exchange).to(to).currencyFrom(currency).currencyTo(currencyTo).amount(currency.amount).senderAddress(senderAddress).evmSenderAddress(evmSenderAddress).recipientAddress(address).slippagePct((_slippage$toString = slippage === null || slippage === void 0 ? void 0 : slippage.toString()) !== null && _slippage$toString !== void 0 ? _slippage$toString : DEFAULT_SWAP_SLIPPAGE.toString());
|
|
9707
|
+
if (onStatusChange) {
|
|
9708
|
+
// We cast because router types are bind to specific PAPI types
|
|
9709
|
+
// Will be resolved when we make RouterBuilder generic
|
|
9710
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
9711
|
+
builder = builder.onStatusChange(onStatusChange);
|
|
9712
|
+
}
|
|
9713
|
+
return builder;
|
|
9714
|
+
};
|
|
9742
9715
|
var executeWithRouter = /*#__PURE__*/function () {
|
|
9743
|
-
var
|
|
9716
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, executor) {
|
|
9744
9717
|
var routerBuilder;
|
|
9745
|
-
return _regenerator().w(function (
|
|
9746
|
-
while (1) switch (
|
|
9718
|
+
return _regenerator().w(function (_context) {
|
|
9719
|
+
while (1) switch (_context.n) {
|
|
9747
9720
|
case 0:
|
|
9748
|
-
|
|
9749
|
-
return
|
|
9750
|
-
case 1:
|
|
9751
|
-
routerBuilder = _context3.v;
|
|
9752
|
-
return _context3.a(2, executor(routerBuilder));
|
|
9721
|
+
routerBuilder = createRouterBuilder(options);
|
|
9722
|
+
return _context.a(2, executor(routerBuilder));
|
|
9753
9723
|
}
|
|
9754
|
-
},
|
|
9724
|
+
}, _callee);
|
|
9755
9725
|
}));
|
|
9756
|
-
return function executeWithRouter(
|
|
9757
|
-
return
|
|
9726
|
+
return function executeWithRouter(_x, _x2) {
|
|
9727
|
+
return _ref3.apply(this, arguments);
|
|
9758
9728
|
};
|
|
9759
9729
|
}();
|
|
9760
9730
|
var normalizeExchange = function normalizeExchange(exchange) {
|
|
@@ -12422,24 +12392,46 @@ var Hydration = /*#__PURE__*/function (_Chain) {
|
|
|
12422
12392
|
key: "transferPolkadotXCM",
|
|
12423
12393
|
value: function () {
|
|
12424
12394
|
var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
|
|
12425
|
-
var destination, asset, isMoonbeamWhAsset;
|
|
12395
|
+
var destination, asset, feeAsset, overriddenAsset, api, isNativeAsset, isNativeFeeAsset, isMoonbeamWhAsset, _t;
|
|
12426
12396
|
return _regenerator().w(function (_context) {
|
|
12427
12397
|
while (1) switch (_context.n) {
|
|
12428
12398
|
case 0:
|
|
12429
|
-
destination = input.destination, asset = input.assetInfo;
|
|
12399
|
+
destination = input.destination, asset = input.assetInfo, feeAsset = input.feeAssetInfo, overriddenAsset = input.overriddenAsset, api = input.api;
|
|
12430
12400
|
if (!(destination === 'Ethereum')) {
|
|
12431
12401
|
_context.n = 1;
|
|
12432
12402
|
break;
|
|
12433
12403
|
}
|
|
12434
12404
|
return _context.a(2, this.transferToEthereum(input));
|
|
12435
12405
|
case 1:
|
|
12406
|
+
if (!feeAsset) {
|
|
12407
|
+
_context.n = 4;
|
|
12408
|
+
break;
|
|
12409
|
+
}
|
|
12410
|
+
if (!overriddenAsset) {
|
|
12411
|
+
_context.n = 2;
|
|
12412
|
+
break;
|
|
12413
|
+
}
|
|
12414
|
+
throw new InvalidCurrencyError('Cannot use overridden assets with XCM execute');
|
|
12415
|
+
case 2:
|
|
12416
|
+
isNativeAsset = isSymbolMatch(asset.symbol, this.getNativeAssetSymbol());
|
|
12417
|
+
isNativeFeeAsset = isSymbolMatch(feeAsset.symbol, this.getNativeAssetSymbol());
|
|
12418
|
+
if (!(!isNativeAsset || !isNativeFeeAsset)) {
|
|
12419
|
+
_context.n = 4;
|
|
12420
|
+
break;
|
|
12421
|
+
}
|
|
12422
|
+
_t = api;
|
|
12423
|
+
_context.n = 3;
|
|
12424
|
+
return handleExecuteTransfer(input);
|
|
12425
|
+
case 3:
|
|
12426
|
+
return _context.a(2, _t.deserializeExtrinsics.call(_t, _context.v));
|
|
12427
|
+
case 4:
|
|
12436
12428
|
isMoonbeamWhAsset = hasJunction(asset.location, 'Parachain', getParaId('Moonbeam')) && hasJunction(asset.location, 'PalletInstance', 110);
|
|
12437
12429
|
if (!(isMoonbeamWhAsset && destination === 'Moonbeam')) {
|
|
12438
|
-
_context.n =
|
|
12430
|
+
_context.n = 5;
|
|
12439
12431
|
break;
|
|
12440
12432
|
}
|
|
12441
12433
|
return _context.a(2, this.transferMoonbeamWhAsset(input));
|
|
12442
|
-
case
|
|
12434
|
+
case 5:
|
|
12443
12435
|
return _context.a(2, transferPolkadotXcm(input));
|
|
12444
12436
|
}
|
|
12445
12437
|
}, _callee, this);
|
|
@@ -14433,4 +14425,4 @@ var createClientCache = function createClientCache(maxSize, pingClient, onEvicti
|
|
|
14433
14425
|
};
|
|
14434
14426
|
};
|
|
14435
14427
|
|
|
14436
|
-
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, assertSenderAddress, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, 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$1 as getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
14428
|
+
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, assertSenderAddress, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, 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$1 as getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "12.9.
|
|
3
|
+
"version": "12.9.2",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@noble/hashes": "^2.0.1",
|
|
27
27
|
"@scure/base": "^2.0.0",
|
|
28
28
|
"viem": "^2.47.1",
|
|
29
|
-
"@paraspell/assets": "12.9.
|
|
30
|
-
"@paraspell/pallets": "12.9.
|
|
31
|
-
"@paraspell/sdk-common": "12.9.
|
|
29
|
+
"@paraspell/assets": "12.9.2",
|
|
30
|
+
"@paraspell/pallets": "12.9.2",
|
|
31
|
+
"@paraspell/sdk-common": "12.9.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@paraspell/swap": "^12.0.0"
|