@paraspell/sdk-core 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +897 -1094
- package/dist/index.d.ts +9 -78
- package/dist/index.mjs +898 -1093
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -544,7 +544,7 @@ type TAmount = string | number | bigint;
|
|
|
544
544
|
type TAddress = string | TMultiLocation;
|
|
545
545
|
type TDestination = TNodeWithRelayChains | TMultiLocation;
|
|
546
546
|
type TRelayToParaDestination = TNodePolkadotKusama | TMultiLocation;
|
|
547
|
-
type TSendBaseOptions
|
|
547
|
+
type TSendBaseOptions = {
|
|
548
548
|
/**
|
|
549
549
|
* The destination address. A SS58 or H160 format.
|
|
550
550
|
*/
|
|
@@ -561,10 +561,6 @@ type TSendBaseOptions<TApi, TRes> = {
|
|
|
561
561
|
* The optional destination parachain ID
|
|
562
562
|
*/
|
|
563
563
|
paraIdTo?: number;
|
|
564
|
-
/**
|
|
565
|
-
* The optional destination API instance required for keep-alive
|
|
566
|
-
*/
|
|
567
|
-
destApiForKeepAlive: IPolkadotApi<TApi, TRes>;
|
|
568
564
|
/**
|
|
569
565
|
* The optional overrided XCM version
|
|
570
566
|
*/
|
|
@@ -581,7 +577,7 @@ type TSendBaseOptions<TApi, TRes> = {
|
|
|
581
577
|
/**
|
|
582
578
|
* Options for transferring from a parachain to another parachain or relay chain
|
|
583
579
|
*/
|
|
584
|
-
type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions
|
|
580
|
+
type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions, TApi, TRes> & {
|
|
585
581
|
/**
|
|
586
582
|
* The origin node
|
|
587
583
|
*/
|
|
@@ -591,12 +587,12 @@ type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions<TApi, TRes>, TApi, TRes
|
|
|
591
587
|
*/
|
|
592
588
|
currency: TCurrencyInputWithAmount;
|
|
593
589
|
};
|
|
594
|
-
type TSendInternalOptions<TApi, TRes> = TSendBaseOptions
|
|
590
|
+
type TSendInternalOptions<TApi, TRes> = TSendBaseOptions & {
|
|
595
591
|
api: IPolkadotApi<TApi, TRes>;
|
|
596
592
|
asset: WithAmount<TAsset>;
|
|
597
593
|
overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
|
|
598
594
|
};
|
|
599
|
-
type TRelayToParaBaseOptions
|
|
595
|
+
type TRelayToParaBaseOptions = {
|
|
600
596
|
/**
|
|
601
597
|
* The origin node
|
|
602
598
|
*/
|
|
@@ -613,10 +609,6 @@ type TRelayToParaBaseOptions<TApi, TRes> = {
|
|
|
613
609
|
* The optional destination parachain ID
|
|
614
610
|
*/
|
|
615
611
|
paraIdTo?: number;
|
|
616
|
-
/**
|
|
617
|
-
* The optional destination API instance required for keep-alive
|
|
618
|
-
*/
|
|
619
|
-
destApiForKeepAlive?: IPolkadotApi<TApi, TRes>;
|
|
620
612
|
/**
|
|
621
613
|
* The optional overrided XCM version
|
|
622
614
|
*/
|
|
@@ -641,20 +633,12 @@ type TRelayToParaOverrides = {
|
|
|
641
633
|
/**
|
|
642
634
|
* Options for transferring from a relay chain to a parachain
|
|
643
635
|
*/
|
|
644
|
-
type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions
|
|
636
|
+
type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions, TApi, TRes>;
|
|
645
637
|
type TSerializedApiCall = {
|
|
646
638
|
module: TPallet | 'Utility';
|
|
647
639
|
section: string;
|
|
648
640
|
parameters: Record<string, unknown>;
|
|
649
641
|
};
|
|
650
|
-
type TCheckKeepAliveOptions<TApi, TRes> = {
|
|
651
|
-
api: IPolkadotApi<TApi, TRes>;
|
|
652
|
-
address: string;
|
|
653
|
-
origin: TNodeDotKsmWithRelayChains;
|
|
654
|
-
destApi: IPolkadotApi<TApi, TRes>;
|
|
655
|
-
asset: WithAmount<TAsset>;
|
|
656
|
-
destination: TNodeDotKsmWithRelayChains;
|
|
657
|
-
};
|
|
658
642
|
type TDestWeight = {
|
|
659
643
|
refTime: string;
|
|
660
644
|
proofSize: string;
|
|
@@ -1086,7 +1070,7 @@ interface IFinalBuilder<TRes> {
|
|
|
1086
1070
|
build: () => Promise<TRes>;
|
|
1087
1071
|
}
|
|
1088
1072
|
interface IAddressBuilder<TApi, TRes> {
|
|
1089
|
-
address: (address: TAddress, ahAddress?: string) =>
|
|
1073
|
+
address: (address: TAddress, ahAddress?: string) => IFinalBuilderWithOptions<TApi, TRes>;
|
|
1090
1074
|
}
|
|
1091
1075
|
interface IFungibleBuilder<TRes> {
|
|
1092
1076
|
fungible: (multiAssets: TMultiAsset[]) => IAccountBuilder<TRes>;
|
|
@@ -1100,8 +1084,7 @@ interface IVersionBuilder<TRes> extends IFinalBuilder<TRes> {
|
|
|
1100
1084
|
interface IAddToBatchBuilder<TApi, TRes> {
|
|
1101
1085
|
addToBatch(): IFromBuilder<TApi, TRes>;
|
|
1102
1086
|
}
|
|
1103
|
-
interface
|
|
1104
|
-
useKeepAlive: (destApi: TApi) => this;
|
|
1087
|
+
interface IFinalBuilderWithOptions<TApi, TRes> extends IAddToBatchBuilder<TApi, TRes> {
|
|
1105
1088
|
xcmVersion: (version: Version) => this;
|
|
1106
1089
|
customPallet: (pallet: string, method: string) => this;
|
|
1107
1090
|
build: () => Promise<TRes>;
|
|
@@ -1329,14 +1312,6 @@ declare const getDryRun: <TApi, TRes>(options: TDryRunOptions<TApi, TRes>) => Pr
|
|
|
1329
1312
|
|
|
1330
1313
|
declare const transferMoonbeamEvm: <TApi, TRes>({ api, from, to, signer, address, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
|
|
1331
1314
|
|
|
1332
|
-
declare const index$1_getDryRun: typeof getDryRun;
|
|
1333
|
-
declare const index$1_send: typeof send;
|
|
1334
|
-
declare const index$1_transferMoonbeamEvm: typeof transferMoonbeamEvm;
|
|
1335
|
-
declare const index$1_transferRelayToPara: typeof transferRelayToPara;
|
|
1336
|
-
declare namespace index$1 {
|
|
1337
|
-
export { index$1_getDryRun as getDryRun, index$1_send as send, index$1_transferMoonbeamEvm as transferMoonbeamEvm, index$1_transferRelayToPara as transferRelayToPara };
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
1315
|
/**
|
|
1341
1316
|
* Retrieves the existential deposit value for a given node.
|
|
1342
1317
|
*
|
|
@@ -1472,42 +1447,6 @@ declare const getTransferableAmount: <TApi, TRes>({ api, address, node, currency
|
|
|
1472
1447
|
|
|
1473
1448
|
declare const getAssetBySymbolOrId: (node: TNodeWithRelayChains, currency: TCurrencyInput, destination: TNodeWithRelayChains | null) => TAsset | null;
|
|
1474
1449
|
|
|
1475
|
-
declare const index_Foreign: typeof Foreign;
|
|
1476
|
-
declare const index_ForeignAbstract: typeof ForeignAbstract;
|
|
1477
|
-
declare const index_Native: typeof Native;
|
|
1478
|
-
declare const index_Override: typeof Override;
|
|
1479
|
-
declare const index_claimAssets: typeof claimAssets;
|
|
1480
|
-
declare const index_getAllAssetsSymbols: typeof getAllAssetsSymbols;
|
|
1481
|
-
declare const index_getAssetBalance: typeof getAssetBalance;
|
|
1482
|
-
declare const index_getAssetBalanceInternal: typeof getAssetBalanceInternal;
|
|
1483
|
-
declare const index_getAssetBySymbolOrId: typeof getAssetBySymbolOrId;
|
|
1484
|
-
declare const index_getAssetDecimals: typeof getAssetDecimals;
|
|
1485
|
-
declare const index_getAssetId: typeof getAssetId;
|
|
1486
|
-
declare const index_getAssets: typeof getAssets;
|
|
1487
|
-
declare const index_getAssetsObject: typeof getAssetsObject;
|
|
1488
|
-
declare const index_getBalanceForeign: typeof getBalanceForeign;
|
|
1489
|
-
declare const index_getBalanceForeignInternal: typeof getBalanceForeignInternal;
|
|
1490
|
-
declare const index_getBalanceNative: typeof getBalanceNative;
|
|
1491
|
-
declare const index_getBalanceNativeInternal: typeof getBalanceNativeInternal;
|
|
1492
|
-
declare const index_getExistentialDeposit: typeof getExistentialDeposit;
|
|
1493
|
-
declare const index_getMaxForeignTransferableAmount: typeof getMaxForeignTransferableAmount;
|
|
1494
|
-
declare const index_getMaxNativeTransferableAmount: typeof getMaxNativeTransferableAmount;
|
|
1495
|
-
declare const index_getNativeAssetSymbol: typeof getNativeAssetSymbol;
|
|
1496
|
-
declare const index_getNativeAssets: typeof getNativeAssets;
|
|
1497
|
-
declare const index_getOriginFeeDetails: typeof getOriginFeeDetails;
|
|
1498
|
-
declare const index_getOriginFeeDetailsInternal: typeof getOriginFeeDetailsInternal;
|
|
1499
|
-
declare const index_getOtherAssets: typeof getOtherAssets;
|
|
1500
|
-
declare const index_getRelayChainSymbol: typeof getRelayChainSymbol;
|
|
1501
|
-
declare const index_getSupportedAssets: typeof getSupportedAssets;
|
|
1502
|
-
declare const index_getTNode: typeof getTNode;
|
|
1503
|
-
declare const index_getTransferInfo: typeof getTransferInfo;
|
|
1504
|
-
declare const index_getTransferableAmount: typeof getTransferableAmount;
|
|
1505
|
-
declare const index_hasSupportForAsset: typeof hasSupportForAsset;
|
|
1506
|
-
declare const index_isNodeEvm: typeof isNodeEvm;
|
|
1507
|
-
declare namespace index {
|
|
1508
|
-
export { index_Foreign as Foreign, index_ForeignAbstract as ForeignAbstract, index_Native as Native, index_Override as Override, index_claimAssets as claimAssets, index_getAllAssetsSymbols as getAllAssetsSymbols, index_getAssetBalance as getAssetBalance, index_getAssetBalanceInternal as getAssetBalanceInternal, index_getAssetBySymbolOrId as getAssetBySymbolOrId, index_getAssetDecimals as getAssetDecimals, index_getAssetId as getAssetId, index_getAssets as getAssets, index_getAssetsObject as getAssetsObject, index_getBalanceForeign as getBalanceForeign, index_getBalanceForeignInternal as getBalanceForeignInternal, index_getBalanceNative as getBalanceNative, index_getBalanceNativeInternal as getBalanceNativeInternal, index_getExistentialDeposit as getExistentialDeposit, index_getMaxForeignTransferableAmount as getMaxForeignTransferableAmount, index_getMaxNativeTransferableAmount as getMaxNativeTransferableAmount, index_getNativeAssetSymbol as getNativeAssetSymbol, index_getNativeAssets as getNativeAssets, index_getOriginFeeDetails as getOriginFeeDetails, index_getOriginFeeDetailsInternal as getOriginFeeDetailsInternal, index_getOtherAssets as getOtherAssets, index_getRelayChainSymbol as getRelayChainSymbol, index_getSupportedAssets as getSupportedAssets, index_getTNode as getTNode, index_getTransferInfo as getTransferInfo, index_getTransferableAmount as getTransferableAmount, index_hasSupportForAsset as hasSupportForAsset, index_isNodeEvm as isNodeEvm };
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
1450
|
/**
|
|
1512
1451
|
* Retrieves the default pallet for a specified node.
|
|
1513
1452
|
*
|
|
@@ -1534,7 +1473,7 @@ declare class BatchTransactionManager<TApi, TRes> {
|
|
|
1534
1473
|
/**
|
|
1535
1474
|
* A builder class for constructing Para-to-Para, Para-to-Relay, Relay-to-Para transactions and asset claims.
|
|
1536
1475
|
*/
|
|
1537
|
-
declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICurrencyBuilder<TApi, TRes>, IAddressBuilder<TApi, TRes>,
|
|
1476
|
+
declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICurrencyBuilder<TApi, TRes>, IAddressBuilder<TApi, TRes>, IFinalBuilderWithOptions<TApi, TRes> {
|
|
1538
1477
|
private readonly batchManager;
|
|
1539
1478
|
private readonly api;
|
|
1540
1479
|
private _from;
|
|
@@ -1543,7 +1482,6 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
|
|
|
1543
1482
|
private _paraIdTo?;
|
|
1544
1483
|
private _address;
|
|
1545
1484
|
private _ahAddress?;
|
|
1546
|
-
private _destApi;
|
|
1547
1485
|
private _version?;
|
|
1548
1486
|
private _pallet?;
|
|
1549
1487
|
private _method?;
|
|
@@ -1584,13 +1522,6 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
|
|
|
1584
1522
|
* @returns An instance of Builder
|
|
1585
1523
|
*/
|
|
1586
1524
|
address(address: TAddress, ahAddress?: string): this;
|
|
1587
|
-
/**
|
|
1588
|
-
* Specifies to use the keep-alive option for the destination account to keep account active.
|
|
1589
|
-
*
|
|
1590
|
-
* @param destApi - The API instance of the destination chain.
|
|
1591
|
-
* @returns An instance of Builder
|
|
1592
|
-
*/
|
|
1593
|
-
useKeepAlive(destApi: TApi): this;
|
|
1594
1525
|
/**
|
|
1595
1526
|
* Sets the XCM version to be used for the transfer.
|
|
1596
1527
|
*
|
|
@@ -1788,4 +1719,4 @@ declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
|
|
|
1788
1719
|
*/
|
|
1789
1720
|
declare const getParaId: (node: TNodeDotKsmWithRelayChains) => number;
|
|
1790
1721
|
|
|
1791
|
-
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type
|
|
1722
|
+
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 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 TRelayChainType, 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, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, 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, isRelayChain, resolveModuleError, send, transferMoonbeamEvm, transferRelayToPara };
|