@paraspell/sdk-core 8.3.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +622 -436
- package/dist/index.d.ts +25 -10
- package/dist/index.mjs +619 -437
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ type WithApi<TBase, TApi, TRes> = TBase & {
|
|
|
6
6
|
};
|
|
7
7
|
type TApiOrUrl<TApi> = TApi | string | string[];
|
|
8
8
|
|
|
9
|
+
declare const ETH_CHAIN_ID: bigint;
|
|
10
|
+
declare const ETHEREUM_JUNCTION: TJunction;
|
|
9
11
|
/**
|
|
10
12
|
* Supported nodes excluding relay chains and Ethereum.
|
|
11
13
|
*/
|
|
@@ -33,9 +35,9 @@ declare abstract class ParachainNode<TApi, TRes> {
|
|
|
33
35
|
private readonly _type;
|
|
34
36
|
private readonly _version;
|
|
35
37
|
protected _assetCheckEnabled: boolean;
|
|
36
|
-
constructor(node: TNodePolkadotKusama, info: string, type:
|
|
38
|
+
constructor(node: TNodePolkadotKusama, info: string, type: TEcosystemType, version: Version);
|
|
37
39
|
get info(): string;
|
|
38
|
-
get type():
|
|
40
|
+
get type(): TEcosystemType;
|
|
39
41
|
get node(): TNodePolkadotKusama;
|
|
40
42
|
get version(): Version;
|
|
41
43
|
get assetCheckEnabled(): boolean;
|
|
@@ -46,6 +48,7 @@ declare abstract class ParachainNode<TApi, TRes> {
|
|
|
46
48
|
createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, _asset?: TAsset, overridedMultiLocation?: TMultiLocation | TMultiAsset[]): TCurrencySelectionHeaderArr;
|
|
47
49
|
createPolkadotXcmHeader(scenario: TScenario, version: Version, destination: TDestination, paraId?: number): TMultiLocationHeader;
|
|
48
50
|
getNativeAssetSymbol(): string;
|
|
51
|
+
protected transferToEthereum<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
declare class Acala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
@@ -111,6 +114,7 @@ declare class BifrostPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> impl
|
|
|
111
114
|
VToken2?: undefined;
|
|
112
115
|
};
|
|
113
116
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
117
|
+
transferToAssetHub<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
114
118
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
115
119
|
protected canUseXTokens({ asset, destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
116
120
|
}
|
|
@@ -133,7 +137,6 @@ declare class ComposableFinance<TApi, TRes> extends ParachainNode<TApi, TRes> im
|
|
|
133
137
|
declare class Hydration<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
134
138
|
private static NATIVE_ASSET_ID;
|
|
135
139
|
constructor();
|
|
136
|
-
transferToEthereum<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
137
140
|
transferToAssetHub<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): TRes;
|
|
138
141
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
139
142
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
@@ -909,7 +912,7 @@ type TNodePolkadotKusama = Exclude<TNode, 'Ethereum'>;
|
|
|
909
912
|
type TNodeWithRelayChains = (typeof NODES_WITH_RELAY_CHAINS)[number];
|
|
910
913
|
type TNodeDotKsmWithRelayChains = Exclude<TNodeWithRelayChains, 'Ethereum'>;
|
|
911
914
|
|
|
912
|
-
type
|
|
915
|
+
type TEcosystemType = 'polkadot' | 'kusama' | 'ethereum';
|
|
913
916
|
type TRelayChainSymbol = 'DOT' | 'KSM';
|
|
914
917
|
|
|
915
918
|
type TEdJsonMap = Record<TNodeDotKsmWithRelayChains, string | null>;
|
|
@@ -1001,7 +1004,7 @@ type TEvmBuilderOptionsBase = {
|
|
|
1001
1004
|
/**
|
|
1002
1005
|
* The destination node on Polkadot network.
|
|
1003
1006
|
*/
|
|
1004
|
-
to:
|
|
1007
|
+
to: TNodeWithRelayChains;
|
|
1005
1008
|
/**
|
|
1006
1009
|
* The currency to transfer. Symbol or ID.
|
|
1007
1010
|
*/
|
|
@@ -1010,6 +1013,10 @@ type TEvmBuilderOptionsBase = {
|
|
|
1010
1013
|
* The Polkadot destination address.
|
|
1011
1014
|
*/
|
|
1012
1015
|
address: string;
|
|
1016
|
+
/**
|
|
1017
|
+
* The AssetHub address
|
|
1018
|
+
*/
|
|
1019
|
+
ahAddress?: string;
|
|
1013
1020
|
/**
|
|
1014
1021
|
* The Ethereum signer.
|
|
1015
1022
|
*/
|
|
@@ -1213,7 +1220,7 @@ type TGetOriginFeeDetailsOptionsBase = {
|
|
|
1213
1220
|
/**
|
|
1214
1221
|
* The destination node.
|
|
1215
1222
|
*/
|
|
1216
|
-
destination:
|
|
1223
|
+
destination: TNodeWithRelayChains;
|
|
1217
1224
|
/**
|
|
1218
1225
|
* The currency to transfer.
|
|
1219
1226
|
*/
|
|
@@ -1226,6 +1233,10 @@ type TGetOriginFeeDetailsOptionsBase = {
|
|
|
1226
1233
|
* The destination account.
|
|
1227
1234
|
*/
|
|
1228
1235
|
accountDestination: string;
|
|
1236
|
+
/**
|
|
1237
|
+
* The AssetHub address
|
|
1238
|
+
*/
|
|
1239
|
+
ahAccount?: string;
|
|
1229
1240
|
/**
|
|
1230
1241
|
* The fee margin percentage.
|
|
1231
1242
|
*/
|
|
@@ -1407,7 +1418,7 @@ declare const getAssetDecimals: (node: TNodeWithRelayChains, symbol: string) =>
|
|
|
1407
1418
|
* @param paraId - The parachain ID.
|
|
1408
1419
|
* @returns The node name if found; otherwise, null.
|
|
1409
1420
|
*/
|
|
1410
|
-
declare const getTNode: (paraId: number, ecosystem:
|
|
1421
|
+
declare const getTNode: (paraId: number, ecosystem: TEcosystemType) => TNodeWithRelayChains | null;
|
|
1411
1422
|
|
|
1412
1423
|
declare const getAssetBalanceInternal: <TApi, TRes>({ address, node, currency, api }: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
1413
1424
|
declare const getAssetBalance: <TApi, TRes>(options: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
@@ -1418,7 +1429,7 @@ declare const getBalanceNative: <TApi, TRes>(options: TGetBalanceNativeOptions<T
|
|
|
1418
1429
|
declare const getBalanceForeignInternal: <TApi, TRes>({ address, node, currency, api }: TGetBalanceForeignOptions<TApi, TRes>) => Promise<bigint>;
|
|
1419
1430
|
declare const getBalanceForeign: <TApi, TRes>(options: TGetBalanceForeignOptions<TApi, TRes>) => Promise<bigint>;
|
|
1420
1431
|
|
|
1421
|
-
declare const getOriginFeeDetailsInternal: <TApi, TRes>({ api, account, accountDestination, currency, origin, destination, feeMarginPercentage }: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
|
|
1432
|
+
declare const getOriginFeeDetailsInternal: <TApi, TRes>({ api, account, accountDestination, ahAccount, currency, origin, destination, feeMarginPercentage }: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
|
|
1422
1433
|
declare const getOriginFeeDetails: <TApi, TRes>(options: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
|
|
1423
1434
|
|
|
1424
1435
|
declare const getTransferInfo: <TApi, TRes>({ origin, destination, accountOrigin, accountDestination, currency, api }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
|
|
@@ -1624,6 +1635,10 @@ declare const isOverrideMultiLocationSpecifier: (multiLocationSpecifier: TMultiL
|
|
|
1624
1635
|
|
|
1625
1636
|
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
1626
1637
|
|
|
1638
|
+
declare const calculateFee: <TApi, TRes>(ahApi: IPolkadotApi<TApi, TRes>) => Promise<string>;
|
|
1639
|
+
|
|
1640
|
+
declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, isDestination?: boolean) => void;
|
|
1641
|
+
|
|
1627
1642
|
/**
|
|
1628
1643
|
* Determines the relay chain for a given node.
|
|
1629
1644
|
*
|
|
@@ -1747,6 +1762,6 @@ declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
|
|
|
1747
1762
|
* @param node - The node for which to get the paraId.
|
|
1748
1763
|
* @returns The parachain ID of the node.
|
|
1749
1764
|
*/
|
|
1750
|
-
declare const getParaId: (node:
|
|
1765
|
+
declare const getParaId: (node: TNodeWithRelayChains) => number;
|
|
1751
1766
|
|
|
1752
|
-
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type
|
|
1767
|
+
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEcosystemType, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, calculateFee, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara, validateAddress };
|