@paraspell/sdk-core 13.11.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +110 -199
- package/dist/index.mjs +891 -1623
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<h1 align="center">@paraspell/sdk-core</h1>
|
|
5
|
-
<h4 align="center"> Core component for @paraspell/sdk
|
|
5
|
+
<h4 align="center"> Core component for @paraspell/sdk, @paraspell/sdk-pjs & @paraspell/sdk-dedot. </h4>
|
|
6
6
|
<p align="center">
|
|
7
7
|
<a href="https://npmjs.com/package/@paraspell/sdk-core">
|
|
8
8
|
<img alt="version" src="https://img.shields.io/npm/v/@paraspell/sdk-core?style=flat-square" />
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _paraspell_sdk_common from '@paraspell/sdk-common';
|
|
2
|
-
import {
|
|
2
|
+
import { TChain, TRelaychain, Version, TSubstrateChain, TLocation, 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 {
|
|
5
|
+
import { TAssetInfo, TChainAssetsInfo, TCurrencyInput, TCurrencyCore, WithAmount, TAsset, TCurrencyInputWithAmount, WithComplexAmount, TSingleCurrencyInputWithAmount, TCustomAssetInfo, TCustomCtx, TCustomAssetsMap, TSingleCurrencyInput, TAmount, TAssetWithFee, TAssetInfoWithId } from '@paraspell/assets';
|
|
6
6
|
export * from '@paraspell/assets';
|
|
7
7
|
import { TPallet, TPalletEntry, TAssetsPallet, TCustomChainPallets, TCrosschainPallet } from '@paraspell/pallets';
|
|
8
8
|
export * from '@paraspell/pallets';
|
|
@@ -44,6 +44,17 @@ type TSystemProperties = {
|
|
|
44
44
|
tokenDecimals?: number;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
declare abstract class Chain<TApi, TRes, TSigner, TCustomChain extends string = never, TChainName extends TChain | TCustomChain = TChain | TCustomChain> {
|
|
48
|
+
private readonly _chain;
|
|
49
|
+
private readonly _ecosystem;
|
|
50
|
+
private readonly _version;
|
|
51
|
+
constructor(chain: TChainName, ecosystem: TRelaychain, version: Version);
|
|
52
|
+
get ecosystem(): TRelaychain;
|
|
53
|
+
get chain(): TChainName;
|
|
54
|
+
get version(): Version;
|
|
55
|
+
abstract getBalance(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
56
|
+
}
|
|
57
|
+
|
|
47
58
|
declare abstract class PolkadotApi<TApi, TRes, TSigner, TCustomChain extends string = never> {
|
|
48
59
|
_api?: TApi;
|
|
49
60
|
_chain?: TSubstrateChain | TCustomChain;
|
|
@@ -129,34 +140,6 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner, TCustomChain extends str
|
|
|
129
140
|
private maybeHydrateCustomChain;
|
|
130
141
|
}
|
|
131
142
|
|
|
132
|
-
declare abstract class Chain<TApi, TRes, TSigner, TCustomChain extends string = never, TChainName extends TChain | TCustomChain = TChain | TCustomChain> {
|
|
133
|
-
private readonly _chain;
|
|
134
|
-
private readonly _ecosystem;
|
|
135
|
-
private readonly _version;
|
|
136
|
-
constructor(chain: TChainName, ecosystem: TRelaychain, version: Version);
|
|
137
|
-
get ecosystem(): TRelaychain;
|
|
138
|
-
get chain(): TChainName;
|
|
139
|
-
get version(): Version;
|
|
140
|
-
abstract getBalance(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
type TSetBalanceRes = {
|
|
144
|
-
assetStatusTx?: TSerializedExtrinsics;
|
|
145
|
-
balanceTx: TSerializedExtrinsics;
|
|
146
|
-
};
|
|
147
|
-
type TMintConfig = {
|
|
148
|
-
useIdPrefix?: boolean;
|
|
149
|
-
useLocationId?: boolean;
|
|
150
|
-
useBigIntId?: boolean;
|
|
151
|
-
useCustomCurrencyId?: boolean;
|
|
152
|
-
};
|
|
153
|
-
declare abstract class BaseAssetsPallet {
|
|
154
|
-
protected palletName: TAssetsPallet;
|
|
155
|
-
constructor(palletName: TAssetsPallet);
|
|
156
|
-
abstract mint<TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: Chain<TApi, TRes, TSigner, TCustomChain>): Promise<TSetBalanceRes>;
|
|
157
|
-
abstract getBalance<TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
143
|
declare abstract class SubstrateChain<TApi, TRes, TSigner, TCustomChain extends string = never> extends Chain<TApi, TRes, TSigner, TCustomChain, TSubstrateChain | TCustomChain> {
|
|
161
144
|
private readonly _info;
|
|
162
145
|
constructor(chain: TSubstrateChain | TCustomChain, info: string, ecosystem: TRelaychain, version: Version);
|
|
@@ -677,72 +660,6 @@ declare const TRANSACT_ORIGINS: readonly ["Native", "SovereignAccount", "Superus
|
|
|
677
660
|
*/
|
|
678
661
|
declare const EXCHANGE_CHAINS: readonly ["AssetHubPolkadot", "AssetHubKusama", "AssetHubPaseo", "AssetHubWestend", "Hydration", "Karura", "Acala", "BifrostKusama", "BifrostPolkadot"];
|
|
679
662
|
|
|
680
|
-
/**
|
|
681
|
-
* Builder class for constructing asset claim transactions.
|
|
682
|
-
*
|
|
683
|
-
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
684
|
-
*/
|
|
685
|
-
declare class AssetClaimBuilder<TApi, TRes, TSigner, T extends Partial<TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>> = object, TCustomChain extends string = never> {
|
|
686
|
-
readonly api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>;
|
|
687
|
-
readonly _options: T;
|
|
688
|
-
constructor(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, options?: T);
|
|
689
|
-
/**
|
|
690
|
-
* Specifies the assets to be claimed.
|
|
691
|
-
*
|
|
692
|
-
* @param assets - An array of assets to claim in a multi-asset format.
|
|
693
|
-
* @returns An instance of Builder
|
|
694
|
-
*/
|
|
695
|
-
currency(currency: TAssetClaimOptionsBase['currency']): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
696
|
-
currency: TAssetClaimOptionsBase['currency'];
|
|
697
|
-
}, TCustomChain>;
|
|
698
|
-
/**
|
|
699
|
-
* Sets the sender address.
|
|
700
|
-
*
|
|
701
|
-
* @param address - The sender address.
|
|
702
|
-
* @returns
|
|
703
|
-
*/
|
|
704
|
-
sender(sender: TSender<TSigner>): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
705
|
-
sender: string;
|
|
706
|
-
}, TCustomChain>;
|
|
707
|
-
/**
|
|
708
|
-
* Specifies the account address on which the assets will be claimed.
|
|
709
|
-
*
|
|
710
|
-
* @param address - The destination account address.
|
|
711
|
-
* @returns An instance of Builder
|
|
712
|
-
*/
|
|
713
|
-
address(address: TAddress): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
714
|
-
address: TAddress;
|
|
715
|
-
}, TCustomChain>;
|
|
716
|
-
/**
|
|
717
|
-
* Sets the XCM version to be used for the asset claim.
|
|
718
|
-
*
|
|
719
|
-
* @param version - The XCM version.
|
|
720
|
-
* @returns An instance of Builder
|
|
721
|
-
*/
|
|
722
|
-
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, TSigner, T & {
|
|
723
|
-
version: Version;
|
|
724
|
-
}, TCustomChain>;
|
|
725
|
-
/**
|
|
726
|
-
* Builds and returns the asset claim extrinsic.
|
|
727
|
-
*
|
|
728
|
-
* @returns A Promise that resolves to the asset claim extrinsic.
|
|
729
|
-
*/
|
|
730
|
-
build(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase>): Promise<TRes>;
|
|
731
|
-
signAndSubmit(this: AssetClaimBuilder<TApi, TRes, TSigner, TAssetClaimOptionsBase & TBuilderInternalOptions<TSigner>>): Promise<string>;
|
|
732
|
-
/**
|
|
733
|
-
* Returns the API instance used by the builder.
|
|
734
|
-
*
|
|
735
|
-
* @returns The API instance.
|
|
736
|
-
*/
|
|
737
|
-
getApi(): TApi;
|
|
738
|
-
/**
|
|
739
|
-
* Disconnects the API.
|
|
740
|
-
*
|
|
741
|
-
* @returns A Promise that resolves when the API is disconnected.
|
|
742
|
-
*/
|
|
743
|
-
disconnect(): Promise<void>;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
663
|
declare class BatchTransactionManager<TApi, TRes, TSigner, TCustomChain extends string = never> {
|
|
747
664
|
transactionOptions: TBatchedTransferOptions<TApi, TRes, TSigner, TCustomChain>[];
|
|
748
665
|
addTransaction(options: TBatchedTransferOptions<TApi, TRes, TSigner, TCustomChain>): void;
|
|
@@ -751,7 +668,7 @@ declare class BatchTransactionManager<TApi, TRes, TSigner, TCustomChain extends
|
|
|
751
668
|
}
|
|
752
669
|
|
|
753
670
|
/**
|
|
754
|
-
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions
|
|
671
|
+
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions.
|
|
755
672
|
*/
|
|
756
673
|
declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBaseOptions<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>> = object, TCustomChain extends string = never> {
|
|
757
674
|
readonly batchManager: BatchTransactionManager<TApi, TRes, TSigner, TCustomChain>;
|
|
@@ -777,16 +694,6 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
777
694
|
to(chain: TDestination | TCustomChain, paraIdTo?: number): GeneralBuilder<TApi, TRes, TSigner, T & {
|
|
778
695
|
to: TDestination;
|
|
779
696
|
}, TCustomChain>;
|
|
780
|
-
/**
|
|
781
|
-
* Initiates the process to claim assets from a specified chain.
|
|
782
|
-
*
|
|
783
|
-
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
784
|
-
* @param chain - The chain from which to claim assets.
|
|
785
|
-
* @returns An instance of Builder
|
|
786
|
-
*/
|
|
787
|
-
claimFrom(chain: TSubstrateChain): AssetClaimBuilder<TApi, TRes, TSigner, {
|
|
788
|
-
chain: TSubstrateChain;
|
|
789
|
-
}, TCustomChain>;
|
|
790
697
|
/**
|
|
791
698
|
* Specifies the currency to be used in the transaction. Symbol, ID, location or multi-asset.
|
|
792
699
|
*
|
|
@@ -923,8 +830,8 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
923
830
|
private buildCommon;
|
|
924
831
|
private buildCommonAll;
|
|
925
832
|
private maybePerformXcmFormatCheck;
|
|
926
|
-
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TDryRunResult
|
|
927
|
-
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult
|
|
833
|
+
dryRun(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>): Promise<TDryRunResult<TCustomChain>>;
|
|
834
|
+
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, dryRunOptions?: TDryRunPreviewOptions): Promise<TDryRunResult<TCustomChain>>;
|
|
928
835
|
protected createTxFactory<TOptions extends TTransferBaseOptions<TApi, TRes, TSigner>>(this: GeneralBuilder<TApi, TRes, TSigner, TOptions, TCustomChain>): TTxFactory<TRes>;
|
|
929
836
|
/**
|
|
930
837
|
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
@@ -933,7 +840,7 @@ declare class GeneralBuilder<TApi, TRes, TSigner, T extends Partial<TTransferBas
|
|
|
933
840
|
*/
|
|
934
841
|
getXcmFee<TDisableFallback extends boolean = false>(this: GeneralBuilder<TApi, TRes, TSigner, TTransferBaseOptionsWithSender<TApi, TRes, TSigner> & TBuilderInternalOptions<TSigner>, TCustomChain>, options?: TGetXcmFeeBuilderOptions & {
|
|
935
842
|
disableFallback: TDisableFallback;
|
|
936
|
-
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
843
|
+
}): Promise<TGetXcmFeeResult<TDisableFallback, TCustomChain>>;
|
|
937
844
|
/**
|
|
938
845
|
* Returns the origin XCM fee for the transfer using dryRun or paymentInfo function.
|
|
939
846
|
*
|
|
@@ -1254,19 +1161,23 @@ type TDryRunChainSuccess = TDryRunResBase & {
|
|
|
1254
1161
|
forwardedXcms: any;
|
|
1255
1162
|
destParaId?: number;
|
|
1256
1163
|
};
|
|
1257
|
-
type TDryRunChainFailure = TDryRunResBase &
|
|
1164
|
+
type TDryRunChainFailure = TDryRunResBase & {
|
|
1258
1165
|
success: false;
|
|
1166
|
+
dryRunError: TDryRunError;
|
|
1259
1167
|
};
|
|
1260
1168
|
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
1261
1169
|
type THopInfo = {
|
|
1262
1170
|
chain: TChain;
|
|
1263
1171
|
result: TDryRunChainResult;
|
|
1264
1172
|
};
|
|
1265
|
-
type
|
|
1266
|
-
type
|
|
1267
|
-
|
|
1173
|
+
type TDryRunChainKind = 'origin' | 'destination' | 'hop';
|
|
1174
|
+
type TDryRunFailure<TCustomChain extends string = never> = TDryRunError & {
|
|
1175
|
+
chainKind: TDryRunChainKind;
|
|
1176
|
+
chain: TChain | TCustomChain;
|
|
1268
1177
|
};
|
|
1269
|
-
type TDryRunResult =
|
|
1178
|
+
type TDryRunResult<TCustomChain extends string = never> = {
|
|
1179
|
+
success: boolean;
|
|
1180
|
+
dryRunError?: TDryRunFailure<TCustomChain>;
|
|
1270
1181
|
origin: TDryRunChainResult;
|
|
1271
1182
|
destination?: TDryRunChainResult;
|
|
1272
1183
|
hops: THopInfo[];
|
|
@@ -1420,10 +1331,10 @@ type TModuleError = {
|
|
|
1420
1331
|
error: string;
|
|
1421
1332
|
};
|
|
1422
1333
|
type TDryRunError = {
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1334
|
+
reason: string;
|
|
1335
|
+
subReason?: string;
|
|
1336
|
+
instructionIndex?: number;
|
|
1337
|
+
instruction?: object;
|
|
1427
1338
|
};
|
|
1428
1339
|
|
|
1429
1340
|
declare class AmountTooLowError extends Error {
|
|
@@ -1474,17 +1385,15 @@ declare class CustomChainInvalidError extends Error {
|
|
|
1474
1385
|
/**
|
|
1475
1386
|
* Error thrown when the Dry Run fails.
|
|
1476
1387
|
*/
|
|
1477
|
-
declare class DryRunFailedError extends Error {
|
|
1478
|
-
readonly
|
|
1479
|
-
readonly dryRunType?: TChainEndpoint;
|
|
1388
|
+
declare class DryRunFailedError<TCustomChain extends string = never> extends Error {
|
|
1389
|
+
readonly dryRunError: TDryRunFailure<TCustomChain>;
|
|
1480
1390
|
/**
|
|
1481
1391
|
* Constructs a new DryRunFailedError.
|
|
1482
1392
|
*
|
|
1483
|
-
* @param
|
|
1484
|
-
* @param
|
|
1485
|
-
* @param prefix - Optional. A short sentence prepended to the message
|
|
1393
|
+
* @param error - The dry-run error. Its `chain` marks which chain failed.
|
|
1394
|
+
* @param prefix - Optional. A short sentence prepended to the message.
|
|
1486
1395
|
*/
|
|
1487
|
-
constructor(
|
|
1396
|
+
constructor(error: TDryRunFailure<TCustomChain>, prefix?: string);
|
|
1488
1397
|
}
|
|
1489
1398
|
|
|
1490
1399
|
/**
|
|
@@ -1730,29 +1639,20 @@ type TXcmFeeBase$1 = {
|
|
|
1730
1639
|
type TXcmFeeDetailSuccess = TXcmFeeBase$1 & {
|
|
1731
1640
|
fee: bigint;
|
|
1732
1641
|
feeType: TFeeType;
|
|
1733
|
-
dryRunError?:
|
|
1734
|
-
dryRunSubError?: string;
|
|
1735
|
-
dryRunErrorIndex?: number;
|
|
1736
|
-
dryRunErrorInstruction?: object;
|
|
1642
|
+
dryRunError?: TDryRunError;
|
|
1737
1643
|
};
|
|
1738
1644
|
type TXcmFeeDetailWithFallback = TXcmFeeDetailSuccess;
|
|
1739
1645
|
type TXcmFeeDetailError = TXcmFeeBase$1 & {
|
|
1740
1646
|
fee?: bigint;
|
|
1741
1647
|
feeType?: TFeeType;
|
|
1742
|
-
dryRunError:
|
|
1743
|
-
dryRunSubError?: string;
|
|
1744
|
-
dryRunErrorIndex?: number;
|
|
1745
|
-
dryRunErrorInstruction?: object;
|
|
1648
|
+
dryRunError: TDryRunError;
|
|
1746
1649
|
};
|
|
1747
1650
|
type TXcmFeeDetail = TXcmFeeDetailSuccess | TXcmFeeDetailError;
|
|
1748
1651
|
type TXcmFeeHopResult = {
|
|
1749
1652
|
fee?: bigint;
|
|
1750
1653
|
feeType?: TFeeType;
|
|
1751
1654
|
sufficient?: boolean;
|
|
1752
|
-
dryRunError?:
|
|
1753
|
-
dryRunSubError?: string;
|
|
1754
|
-
dryRunErrorIndex?: number;
|
|
1755
|
-
dryRunErrorInstruction?: object;
|
|
1655
|
+
dryRunError?: TDryRunError;
|
|
1756
1656
|
forwardedXcms?: any;
|
|
1757
1657
|
destParaId?: number;
|
|
1758
1658
|
asset: TAssetInfo;
|
|
@@ -1770,11 +1670,9 @@ type TXcmFeeHopInfo = {
|
|
|
1770
1670
|
chain: TChain;
|
|
1771
1671
|
result: TXcmFeeDetail;
|
|
1772
1672
|
};
|
|
1773
|
-
type TGetXcmFeeResult<TDisableFallback extends boolean = boolean> = {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
failureInstruction?: object;
|
|
1777
|
-
failureChain?: TChainEndpoint;
|
|
1673
|
+
type TGetXcmFeeResult<TDisableFallback extends boolean = boolean, TCustomChain extends string = never> = {
|
|
1674
|
+
success: boolean;
|
|
1675
|
+
dryRunError?: TDryRunFailure<TCustomChain>;
|
|
1778
1676
|
origin: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1779
1677
|
destination: TConditionalXcmFeeDetail<TDisableFallback>;
|
|
1780
1678
|
hops: TConditionalXcmFeeHopInfo<TDisableFallback>[];
|
|
@@ -2012,24 +1910,24 @@ type TSwapEvent<TApi, TRes> = {
|
|
|
2012
1910
|
currentStep?: number;
|
|
2013
1911
|
};
|
|
2014
1912
|
type TStatusChangeCallback<TApi, TRes> = (info: TSwapEvent<TApi, TRes>) => void;
|
|
2015
|
-
interface TSwapBuilder<TApi, TRes, TSigner> {
|
|
2016
|
-
from(chain: TSubstrateChain | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2017
|
-
to(chain: TChain | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2018
|
-
exchange(chain: TExchangeInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2019
|
-
currencyFrom(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2020
|
-
currencyTo(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2021
|
-
feeAsset(currency: TCurrencyInput | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2022
|
-
amount(amount: TAmount): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2023
|
-
recipient(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2024
|
-
sender(address: string): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2025
|
-
signer(signer: TSigner): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2026
|
-
evmSenderAddress(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2027
|
-
evmSigner(signer: TSigner | undefined): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2028
|
-
slippagePct(pct: string): TSwapBuilder<TApi, TRes, TSigner>;
|
|
2029
|
-
onStatusChange(callback: TStatusChangeCallback<TApi, TRes>): TSwapBuilder<TApi, TRes, TSigner>;
|
|
1913
|
+
interface TSwapBuilder<TApi, TRes, TSigner, TCustomChain extends string = never> {
|
|
1914
|
+
from(chain: TSubstrateChain | undefined): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1915
|
+
to(chain: TChain | undefined): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1916
|
+
exchange(chain: TExchangeInput): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1917
|
+
currencyFrom(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1918
|
+
currencyTo(currency: TCurrencyInput): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1919
|
+
feeAsset(currency: TCurrencyInput | undefined): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1920
|
+
amount(amount: TAmount): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1921
|
+
recipient(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1922
|
+
sender(address: string): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1923
|
+
signer(signer: TSigner): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1924
|
+
evmSenderAddress(address: string | undefined): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1925
|
+
evmSigner(signer: TSigner | undefined): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1926
|
+
slippagePct(pct: string): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
1927
|
+
onStatusChange(callback: TStatusChangeCallback<TApi, TRes>): TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
2030
1928
|
getXcmFees<TDisableFallback extends boolean = false>(options?: TGetXcmFeeBuilderOptions & {
|
|
2031
1929
|
disableFallback: TDisableFallback;
|
|
2032
|
-
}): Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
1930
|
+
}): Promise<TGetXcmFeeResult<TDisableFallback, TCustomChain>>;
|
|
2033
1931
|
getOriginXcmFee<TDisableFallback extends boolean = false>(options?: TGetXcmFeeBuilderOptions & {
|
|
2034
1932
|
disableFallback: TDisableFallback;
|
|
2035
1933
|
}): Promise<TXcmFeeDetailWithForwardedXcm<TDisableFallback>>;
|
|
@@ -2040,12 +1938,12 @@ interface TSwapBuilder<TApi, TRes, TSigner> {
|
|
|
2040
1938
|
exchange: TExchangeChain;
|
|
2041
1939
|
amountOut: bigint;
|
|
2042
1940
|
}>;
|
|
2043
|
-
dryRun(): Promise<TDryRunResult
|
|
2044
|
-
dryRunPreview(previewOptions?: TDryRunPreviewOptions): Promise<TDryRunResult
|
|
1941
|
+
dryRun(): Promise<TDryRunResult<TCustomChain>>;
|
|
1942
|
+
dryRunPreview(previewOptions?: TDryRunPreviewOptions): Promise<TDryRunResult<TCustomChain>>;
|
|
2045
1943
|
build(): Promise<TTransactionContext<TApi, TRes>[]>;
|
|
2046
1944
|
signAndSubmit(): Promise<string[]>;
|
|
2047
1945
|
}
|
|
2048
|
-
type TSwapBuilderFactory = <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>) => TSwapBuilder<TApi, TRes, TSigner>;
|
|
1946
|
+
type TSwapBuilderFactory = <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>) => TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
2049
1947
|
|
|
2050
1948
|
type TPolkadotXCMTransferOptions<TApi, TRes, TSigner, TCustomChain extends string = never> = {
|
|
2051
1949
|
api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>;
|
|
@@ -2053,7 +1951,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes, TSigner, TCustomChain extends strin
|
|
|
2053
1951
|
beneficiaryLocation: TLocation;
|
|
2054
1952
|
recipient: TAddress;
|
|
2055
1953
|
asset: TAsset;
|
|
2056
|
-
overriddenAsset?:
|
|
1954
|
+
overriddenAsset?: TAssetWithFee[];
|
|
2057
1955
|
scenario: TScenario;
|
|
2058
1956
|
assetInfo: WithAmount<TAssetInfo>;
|
|
2059
1957
|
currency: TCurrencyInputWithAmount;
|
|
@@ -2078,7 +1976,7 @@ type TXTokensTransferOptions<TApi, TRes, TSigner, TCustomChain extends string =
|
|
|
2078
1976
|
destination: TDestination;
|
|
2079
1977
|
paraIdTo?: number;
|
|
2080
1978
|
version: Version;
|
|
2081
|
-
overriddenAsset?:
|
|
1979
|
+
overriddenAsset?: TAssetWithFee[];
|
|
2082
1980
|
pallet?: string;
|
|
2083
1981
|
method?: string;
|
|
2084
1982
|
useMultiAssetTransfer?: boolean;
|
|
@@ -2184,7 +2082,7 @@ type TTransferInternalOptions<TApi, TRes, TSigner, TCustomChain extends string =
|
|
|
2184
2082
|
assetInfo: WithAmount<TAssetInfo>;
|
|
2185
2083
|
feeAsset?: TAssetInfo;
|
|
2186
2084
|
feeCurrency?: TCurrencyInput;
|
|
2187
|
-
overriddenAsset?:
|
|
2085
|
+
overriddenAsset?: TAssetWithFee[];
|
|
2188
2086
|
version: Version;
|
|
2189
2087
|
isAmountAll: boolean;
|
|
2190
2088
|
};
|
|
@@ -2289,18 +2187,22 @@ type TCreateEthBridgeInstructionsOptions<TApi, TRes, TSigner, TCustomChain exten
|
|
|
2289
2187
|
version: Version;
|
|
2290
2188
|
};
|
|
2291
2189
|
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
currency: WithComplexAmount<TCurrencyCore> | TAsset<TAmount>[] | WithComplexAmount<TCurrencyCore>[];
|
|
2296
|
-
address: TAddress;
|
|
2297
|
-
version?: Version;
|
|
2190
|
+
type TSetBalanceRes = {
|
|
2191
|
+
assetStatusTx?: TSerializedExtrinsics;
|
|
2192
|
+
balanceTx: TSerializedExtrinsics;
|
|
2298
2193
|
};
|
|
2299
|
-
type
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2194
|
+
type TMintConfig = {
|
|
2195
|
+
useIdPrefix?: boolean;
|
|
2196
|
+
useLocationId?: boolean;
|
|
2197
|
+
useBigIntId?: boolean;
|
|
2198
|
+
useCustomCurrencyId?: boolean;
|
|
2303
2199
|
};
|
|
2200
|
+
declare abstract class BaseAssetsPallet {
|
|
2201
|
+
protected palletName: TAssetsPallet;
|
|
2202
|
+
constructor(palletName: TAssetsPallet);
|
|
2203
|
+
abstract mint<TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: Chain<TApi, TRes, TSigner, TCustomChain>): Promise<TSetBalanceRes>;
|
|
2204
|
+
abstract getBalance<TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
2205
|
+
}
|
|
2304
2206
|
|
|
2305
2207
|
type OneKey<K extends string, V = unknown> = {
|
|
2306
2208
|
[P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? {
|
|
@@ -2405,7 +2307,7 @@ declare const getParaIdImpl: <TCustomChain extends string = never>(chain: TChain
|
|
|
2405
2307
|
* @param chain - The chain for which to get the paraId.
|
|
2406
2308
|
* @returns The parachain ID of the chain.
|
|
2407
2309
|
*/
|
|
2408
|
-
declare const getParaId:
|
|
2310
|
+
declare const getParaId: (chain: TChain) => number;
|
|
2409
2311
|
|
|
2410
2312
|
declare const normalizeCustomChains: (map: TCustomChainsMap | undefined) => TCustomChainsCtx;
|
|
2411
2313
|
declare const buildCustomChainConfig: (entry: TCustomChainEntry) => TChainConfig;
|
|
@@ -2418,6 +2320,13 @@ declare const buildCustomChainAssetsInfo: (entry: TCustomChainEntryHydrated) =>
|
|
|
2418
2320
|
* @returns The chain name if found; otherwise, null.
|
|
2419
2321
|
*/
|
|
2420
2322
|
declare const getTChain: (paraId: number, ecosystem: TRelaychain | TExternalChain) => TChain | null;
|
|
2323
|
+
/**
|
|
2324
|
+
* Retrieves the substrate chain name corresponding to a specified parachain ID.
|
|
2325
|
+
*
|
|
2326
|
+
* @param paraId - The parachain ID.
|
|
2327
|
+
* @returns The substrate chain name if found; otherwise, null.
|
|
2328
|
+
*/
|
|
2329
|
+
declare const getTSubstrateChain: (paraId: number, ecosystem: TRelaychain) => TSubstrateChain | null;
|
|
2421
2330
|
|
|
2422
2331
|
interface TEvmExtension {
|
|
2423
2332
|
executeTransfer: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TEvmTransferOptions<TApi, TRes, TSigner, TCustomChain>) => Promise<string>;
|
|
@@ -2439,15 +2348,10 @@ interface TSwapExtension {
|
|
|
2439
2348
|
declare const registerSwapExtension: (extension: TSwapExtension | undefined) => void;
|
|
2440
2349
|
declare const getSwapExtensionOrThrow: () => TSwapExtension;
|
|
2441
2350
|
|
|
2442
|
-
/**
|
|
2443
|
-
* @deprecated Asset claim functionality is deprecated and will be removed in v14.
|
|
2444
|
-
*/
|
|
2445
|
-
declare const claimAssets: <TApi, TRes, TSigner>(options: TAssetClaimOptions<TApi, TRes, TSigner>) => Promise<TRes>;
|
|
2446
|
-
|
|
2447
2351
|
declare const resolveTransferParams: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TSubstrateTransferOptions<TApi, TRes, TSigner, TCustomChain>) => {
|
|
2448
2352
|
resolvedFeeAsset: _paraspell_assets.WithOptionalAmount<TAssetInfo> | undefined;
|
|
2449
2353
|
resolvedVersion: _paraspell_sdk_common.Version;
|
|
2450
|
-
overriddenAsset:
|
|
2354
|
+
overriddenAsset: _paraspell_assets.TAssetWithFee[] | undefined;
|
|
2451
2355
|
normalizedAsset: {
|
|
2452
2356
|
amount: bigint;
|
|
2453
2357
|
decimals: number;
|
|
@@ -2462,13 +2366,24 @@ declare const resolveTransferParams: <TApi, TRes, TSigner, TCustomChain extends
|
|
|
2462
2366
|
};
|
|
2463
2367
|
declare const createTransfer: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TSubstrateTransferOptions<TApi, TRes, TSigner, TCustomChain>) => Promise<TRes>;
|
|
2464
2368
|
|
|
2465
|
-
declare const dryRun: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TDryRunOptions<TApi, TRes, TSigner, TCustomChain>) => Promise<TDryRunResult
|
|
2369
|
+
declare const dryRun: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TDryRunOptions<TApi, TRes, TSigner, TCustomChain>) => Promise<TDryRunResult<TCustomChain>>;
|
|
2466
2370
|
|
|
2467
|
-
declare const dryRunInternal: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TDryRunOptions<TApi, TRes, TSigner, TCustomChain>) => Promise<TDryRunResult
|
|
2371
|
+
declare const dryRunInternal: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TDryRunOptions<TApi, TRes, TSigner, TCustomChain>) => Promise<TDryRunResult<TCustomChain>>;
|
|
2468
2372
|
|
|
2469
2373
|
declare const dryRunOrigin: <TApi, TRes, TSigner>(options: TDryRunCallOptions<TApi, TRes, TSigner>) => Promise<TDryRunChainResult>;
|
|
2470
2374
|
|
|
2471
|
-
|
|
2375
|
+
type TChainResult<T, TCustomChain extends string> = {
|
|
2376
|
+
chain: TChain | TCustomChain;
|
|
2377
|
+
result: T;
|
|
2378
|
+
};
|
|
2379
|
+
declare const getDryRunError: <T extends {
|
|
2380
|
+
asset: TAssetInfo;
|
|
2381
|
+
dryRunError?: TDryRunError;
|
|
2382
|
+
}, TCustomChain extends string = never>({ origin, destination, hops }: {
|
|
2383
|
+
origin: TChainResult<T, TCustomChain>;
|
|
2384
|
+
destination?: TChainResult<T, TCustomChain>;
|
|
2385
|
+
hops: TChainResult<T, TCustomChain>[];
|
|
2386
|
+
}) => TDryRunFailure<TCustomChain> | undefined;
|
|
2472
2387
|
|
|
2473
2388
|
declare const traverseXcmHops: <TApi, TRes, TSigner, THopResult, TCustomChain extends string = never>(config: HopTraversalConfig<TApi, TRes, TSigner, THopResult, TCustomChain>) => Promise<HopTraversalResult<THopResult, TCustomChain>>;
|
|
2474
2389
|
declare const addEthereumBridgeFees: <TApi, TRes, TSigner, TResult extends {
|
|
@@ -2480,10 +2395,6 @@ declare const wrapTxBypass: <TApi, TRes, TSigner, TCustomChain extends string =
|
|
|
2480
2395
|
|
|
2481
2396
|
declare const getParaEthTransferFees: <TApi, TRes, TSigner, TCustomChain extends string = never>(ahApi: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, shouldDisconnect?: boolean) => Promise<[bigint, bigint]>;
|
|
2482
2397
|
|
|
2483
|
-
declare const transferMoonbeamEvm: <TApi, TRes, TSigner>(options: TEvmTransferOptions<TApi, TRes, TSigner>) => Promise<string>;
|
|
2484
|
-
|
|
2485
|
-
declare const transferMoonbeamToEth: <TApi, TRes, TSigner>(from: TSubstrateChain, { api, to, signer, recipient, ahAddress, currency }: TEvmTransferOptions<TApi, TRes, TSigner>) => Promise<`0x${string}`>;
|
|
2486
|
-
|
|
2487
2398
|
declare const getOriginXcmFee: <TApi, TRes, TSigner, TDisableFallback extends boolean = boolean, TCustomChain extends string = never>(options: TGetOriginXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback, TCustomChain>) => Promise<TXcmFeeDetailWithForwardedXcm<TDisableFallback>>;
|
|
2488
2399
|
|
|
2489
2400
|
declare const getOriginXcmFeeInternal: <TApi, TRes, TSigner, TCustomChain extends string = never>({ api, tx, origin, destination, sender, disableFallback, feeAsset, currency, version, useRootOrigin }: TGetOriginXcmFeeInternalOptions<TApi, TRes, TSigner, TCustomChain>) => Promise<TXcmFeeDetail & {
|
|
@@ -2491,10 +2402,10 @@ declare const getOriginXcmFeeInternal: <TApi, TRes, TSigner, TCustomChain extend
|
|
|
2491
2402
|
destParaId?: number;
|
|
2492
2403
|
}>;
|
|
2493
2404
|
|
|
2494
|
-
declare const getXcmFeeInternal: <TApi, TRes, TSigner, TDisableFallback extends boolean, TCustomChain extends string = never>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback, TCustomChain>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2495
|
-
declare const getXcmFee: <TApi, TRes, TSigner, TDisableFallback extends boolean, TCustomChain extends string = never>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback, TCustomChain>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2405
|
+
declare const getXcmFeeInternal: <TApi, TRes, TSigner, TDisableFallback extends boolean, TCustomChain extends string = never>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback, TCustomChain>) => Promise<TGetXcmFeeResult<TDisableFallback, TCustomChain>>;
|
|
2406
|
+
declare const getXcmFee: <TApi, TRes, TSigner, TDisableFallback extends boolean, TCustomChain extends string = never>(options: TGetXcmFeeOptions<TApi, TRes, TSigner, TDisableFallback, TCustomChain>) => Promise<TGetXcmFeeResult<TDisableFallback, TCustomChain>>;
|
|
2496
2407
|
|
|
2497
|
-
declare const getXcmFeeOnce: <TApi, TRes, TSigner, TDisableFallback extends boolean, TCustomChain extends string = never>({ api, tx, origin, destination, sender, recipient, currency, feeAsset, version, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation }: TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback, TCustomChain>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2408
|
+
declare const getXcmFeeOnce: <TApi, TRes, TSigner, TDisableFallback extends boolean, TCustomChain extends string = never>({ api, tx, origin, destination, sender, recipient, currency, feeAsset, version, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation }: TGetXcmFeeInternalOptions<TApi, TRes, TSigner, TDisableFallback, TCustomChain>) => Promise<TGetXcmFeeResult<TDisableFallback, TCustomChain>>;
|
|
2498
2409
|
|
|
2499
2410
|
declare const getBridgeStatus: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>) => Promise<TBridgeStatus>;
|
|
2500
2411
|
|
|
@@ -2554,9 +2465,8 @@ declare const createTypeAndThenCall: <TApi, TRes, TSigner, TCustomChain extends
|
|
|
2554
2465
|
*/
|
|
2555
2466
|
declare const createTypeThenAutoReserve: <TApi, TRes, TSigner>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes, TSigner>) => Promise<TSerializedExtrinsics>;
|
|
2556
2467
|
|
|
2557
|
-
declare const assertNotRawAssets: (currency: TCurrencyInput) => asserts currency is Exclude<TCurrencyInput, TAsset<TAmount>[]>;
|
|
2558
2468
|
declare const validateCurrency: (currency: TCurrencyInput, feeAsset?: TCurrencyInput) => void;
|
|
2559
|
-
declare const validateDestination: <TApi, TRes, TSigner, TCustomChain extends string = never>(origin: TSubstrateChain, destination: TDestination, api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>) => void;
|
|
2469
|
+
declare const validateDestination: <TApi, TRes, TSigner, TCustomChain extends string = never>(origin: TSubstrateChain | TCustomChain, destination: TDestination, api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>) => void;
|
|
2560
2470
|
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput) => void;
|
|
2561
2471
|
declare const validateTransact: <TApi, TRes, TSigner, TCustomChain extends string = never>({ api, from, to, sender, recipient: address, currency, transactOptions }: TSubstrateTransferOptions<TApi, TRes, TSigner, TCustomChain>) => ValidationError | undefined;
|
|
2562
2472
|
|
|
@@ -2626,7 +2536,8 @@ declare const getRelayChainSymbolOf: (chain: TSubstrateChain) => string;
|
|
|
2626
2536
|
|
|
2627
2537
|
declare const createChainClient: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, chain: TSubstrateChain) => Promise<TApi>;
|
|
2628
2538
|
|
|
2629
|
-
declare const
|
|
2539
|
+
declare const getErrorInstruction: (message: unknown, index?: number) => object | undefined;
|
|
2540
|
+
declare const buildDryRunError: (error: TDryRunError, message: unknown) => TDryRunError;
|
|
2630
2541
|
|
|
2631
2542
|
declare const resolveModuleError: (chain: TSubstrateChain, error: TModuleError) => TDryRunError;
|
|
2632
2543
|
|
|
@@ -2683,8 +2594,8 @@ declare const resolveParaId: <TApi, TRes, TSigner, TCustomChain extends string =
|
|
|
2683
2594
|
*/
|
|
2684
2595
|
declare const isExchange: (chain: string) => chain is TExchangeChain;
|
|
2685
2596
|
declare const convertBuilderConfig: <TApi>(config: TBuilderOptions<TApiOrUrl<TApi>> | undefined) => TBuilderConfig<TUrl> | undefined;
|
|
2686
|
-
declare const createSwapBuilder: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TTransferOptionsWithSwap<TApi, TRes, TSigner, TCustomChain>) => TSwapBuilder<TApi, TRes, TSigner>;
|
|
2687
|
-
declare const executeWithSwap: <TApi, TRes, TSigner, T, TCustomChain extends string = never>(options: TTransferOptionsWithSwap<TApi, TRes, TSigner, TCustomChain>, executor: (builder: TSwapBuilder<TApi, TRes, TSigner>) => Promise<T>) => Promise<T>;
|
|
2597
|
+
declare const createSwapBuilder: <TApi, TRes, TSigner, TCustomChain extends string = never>(options: TTransferOptionsWithSwap<TApi, TRes, TSigner, TCustomChain>) => TSwapBuilder<TApi, TRes, TSigner, TCustomChain>;
|
|
2598
|
+
declare const executeWithSwap: <TApi, TRes, TSigner, T, TCustomChain extends string = never>(options: TTransferOptionsWithSwap<TApi, TRes, TSigner, TCustomChain>, executor: (builder: TSwapBuilder<TApi, TRes, TSigner, TCustomChain>) => Promise<T>) => Promise<T>;
|
|
2688
2599
|
declare const normalizeExchange: (exchange: TExchangeInput) => TExchangeInput;
|
|
2689
2600
|
|
|
2690
2601
|
declare const abstractDecimals: <TApi, TRes, TSigner, TCustomChain extends string = never>(amount: TAmount, decimals: number | undefined, api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>) => bigint;
|
|
@@ -2733,5 +2644,5 @@ declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersi
|
|
|
2733
2644
|
declare const pickCompatibleXcmVersion: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, origin: TSubstrateChain | TCustomChain, destination: TDestination, override?: Version) => Version;
|
|
2734
2645
|
declare const pickRouterCompatibleXcmVersion: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2735
2646
|
|
|
2736
|
-
export { API_TYPES, AmountTooLowError, ApiNotInitializedError,
|
|
2737
|
-
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType,
|
|
2647
|
+
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, CustomChainConflictError, CustomChainInvalidError, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2b256, blake2b512, buildCustomChainAssetsInfo, buildCustomChainConfig, buildDestInfo, buildDryRunError, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getAssetReserveChainImpl, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainConfigImpl, getChainLocation, getChainProviders, getChainProvidersImpl, getChainVersion, getDryRunError, getErrorInstruction, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getParaIdImpl, getRelayChainOf, getRelayChainOfImpl, getRelayChainSymbolOf, getSwapExtensionOrThrow, getTChain, getTSubstrateChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isExchange, isNativeAssetTeleport, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, localizeLocationImpl, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeCustomChains, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickOtherMintPallet, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2648
|
+
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TBatchOptions, TBatchedTransferOptions, TBifrostToken, TBridgeStatus, TBuildAllInternalRes, TBuildDestInfoOptions, TBuildEvmTransferOptions, TBuildInternalRes, TBuildInternalResBase, TBuildOriginInfoOptions, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateEthBridgeInstructionsOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TCustomChainEntry, TCustomChainEntryHydrated, TCustomChainFrom, TCustomChainInput, TCustomChainPalletsInput, TCustomChainsCtx, TCustomChainsMap, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainKind, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunFailure, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmExtension, TEvmSnowbridgeExtension, TEvmTransferOptions, TEvmTransferOptionsBase, TExchangeChain, TExchangeInput, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TFullCustomCtx, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMintConfig, TModuleError, TNativeTokenAsset, TOriginFeeDetails, TOriginXcmFeeInfo, TOtherReserveAsset, TPaymentInfo, TPerAssetResult, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReceivedCurrencyInfo, TReserveAsset, TResolveHopParams, TResolvedCurrency, TRuntimeApi, TScenario, TSelectedCurrencyInfo, TSelfReserveAsset, TSender, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSubstrateTransferBaseOptions, TSubstrateTransferBaseOptionsWithSender, TSubstrateTransferOptions, TSwapBuilder, TSwapBuilderFactory, TSwapConfig, TSwapEvent, TSwapEventType, TSwapExtension, TSwapFeeEstimates, TSwapOptions, TSystemProperties, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferBaseOptions, TTransferBaseOptionsWithSender, TTransferBaseOptionsWithSwap, TTransferFeeEstimates, TTransferInfo, TTransferInternalOptions, TTransferLocalOptions, TTransferOptions, TTransferOptionsWithSwap, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeDetailWithForwardedXcm, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSender, WithRequiredSwapOptions };
|