@paraspell/sdk-pjs 8.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/LICENSE +21 -0
- package/README.md +323 -0
- package/dist/index.cjs +1408 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.mjs +1383 -0
- package/package.json +66 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import * as _paraspell_sdk_core from '@paraspell/sdk-core';
|
|
2
|
+
import { TApiOrUrl, TSerializeEthTransferOptions, TSerializedEthTransfer, TSendOptions, TEvmBuilderOptions, TOptionalEvmBuilderOptions, IPolkadotApi, TNodePolkadotKusama, TCurrencyCoreV1WithAmount, GeneralBuilder as GeneralBuilder$1, IUseKeepAliveFinalBuilder as IUseKeepAliveFinalBuilder$1, TNodeDotKsmWithRelayChains } from '@paraspell/sdk-core';
|
|
3
|
+
export * from '@paraspell/sdk-core';
|
|
4
|
+
import * as _snowbridge_api_dist_toPolkadot from '@snowbridge/api/dist/toPolkadot';
|
|
5
|
+
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
6
|
+
import * as _polkadot_api from '@polkadot/api';
|
|
7
|
+
import { ApiPromise } from '@polkadot/api';
|
|
8
|
+
import { AbstractProvider, Signer } from 'ethers';
|
|
9
|
+
|
|
10
|
+
type TPjsApi = ApiPromise;
|
|
11
|
+
type TPjsApiOrUrl = TApiOrUrl<TPjsApi>;
|
|
12
|
+
type Extrinsic = SubmittableExtrinsic<'promise'>;
|
|
13
|
+
|
|
14
|
+
declare const buildEthTransferOptions: ({ currency, to, address, destAddress }: TSerializeEthTransferOptions) => Promise<TSerializedEthTransfer>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Transfers assets from parachain to another parachain or from/to relay chain.
|
|
18
|
+
* @param options - The transfer options.
|
|
19
|
+
* @returns An extrinsic to be signed and sent.
|
|
20
|
+
*/
|
|
21
|
+
declare const send: (options: Omit<TSendOptions<TPjsApi, Extrinsic>, "api" | "destApiForKeepAlive"> & {
|
|
22
|
+
api?: TPjsApiOrUrl;
|
|
23
|
+
destApiForKeepAlive?: TPjsApiOrUrl;
|
|
24
|
+
}) => Promise<Extrinsic>;
|
|
25
|
+
declare const getDryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<Extrinsic> & {
|
|
26
|
+
api?: TPjsApiOrUrl;
|
|
27
|
+
}) => Promise<_paraspell_sdk_core.TDryRunResult>;
|
|
28
|
+
declare const transferEthToPolkadot: (options: Omit<TEvmBuilderOptions<TPjsApi, Extrinsic>, "api">) => Promise<{
|
|
29
|
+
result: _snowbridge_api_dist_toPolkadot.SendResult;
|
|
30
|
+
plan: _snowbridge_api_dist_toPolkadot.SendValidationResult;
|
|
31
|
+
}>;
|
|
32
|
+
|
|
33
|
+
declare const transfer_buildEthTransferOptions: typeof buildEthTransferOptions;
|
|
34
|
+
declare const transfer_getDryRun: typeof getDryRun;
|
|
35
|
+
declare const transfer_send: typeof send;
|
|
36
|
+
declare const transfer_transferEthToPolkadot: typeof transferEthToPolkadot;
|
|
37
|
+
declare namespace transfer {
|
|
38
|
+
export { transfer_buildEthTransferOptions as buildEthTransferOptions, transfer_getDryRun as getDryRun, transfer_send as send, transfer_transferEthToPolkadot as transferEthToPolkadot };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the native balance for a given account on a specified node.
|
|
43
|
+
*
|
|
44
|
+
* @returns The native balance as a bigint.
|
|
45
|
+
*/
|
|
46
|
+
declare const getBalanceNative: (options: _paraspell_sdk_core.TGetBalanceNativeOptionsBase & {
|
|
47
|
+
api?: TPjsApiOrUrl;
|
|
48
|
+
}) => Promise<bigint>;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the balance of a foreign asset for a given account on a specified node.
|
|
51
|
+
*
|
|
52
|
+
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
53
|
+
*/
|
|
54
|
+
declare const getBalanceForeign: (options: _paraspell_sdk_core.TGetBalanceForeignOptionsBase & {
|
|
55
|
+
api?: TPjsApiOrUrl;
|
|
56
|
+
}) => Promise<bigint>;
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves detailed transfer information for a cross-chain transfer.
|
|
59
|
+
*
|
|
60
|
+
* @returns A Promise that resolves to the transfer information.
|
|
61
|
+
*/
|
|
62
|
+
declare const getTransferInfo: (options: _paraspell_sdk_core.TGetTransferInfoOptionsBase & {
|
|
63
|
+
api?: TPjsApiOrUrl;
|
|
64
|
+
}) => Promise<_paraspell_sdk_core.TTransferInfo>;
|
|
65
|
+
/**
|
|
66
|
+
* Retrieves the asset balance for a given account on a specified node.
|
|
67
|
+
*
|
|
68
|
+
* @returns The asset balance as a bigint.
|
|
69
|
+
*/
|
|
70
|
+
declare const getAssetBalance: (options: _paraspell_sdk_core.TGetAssetBalanceOptionsBase & {
|
|
71
|
+
api?: TPjsApiOrUrl;
|
|
72
|
+
}) => Promise<bigint>;
|
|
73
|
+
/**
|
|
74
|
+
* Claims assets from a parachain.
|
|
75
|
+
*
|
|
76
|
+
* @returns An extrinsic representing the claim transaction.
|
|
77
|
+
*/
|
|
78
|
+
declare const claimAssets: (options: {
|
|
79
|
+
node: _paraspell_sdk_core.TNodeWithRelayChains;
|
|
80
|
+
multiAssets: _paraspell_sdk_core.TMultiAsset[];
|
|
81
|
+
address: _paraspell_sdk_core.TAddress;
|
|
82
|
+
version?: _paraspell_sdk_core.TVersionClaimAssets;
|
|
83
|
+
} & {
|
|
84
|
+
api?: TPjsApiOrUrl;
|
|
85
|
+
}) => Promise<Extrinsic>;
|
|
86
|
+
declare const getOriginFeeDetails: (options: _paraspell_sdk_core.TGetOriginFeeDetailsOptionsBase & {
|
|
87
|
+
api?: TPjsApiOrUrl;
|
|
88
|
+
}) => Promise<_paraspell_sdk_core.TOriginFeeDetails>;
|
|
89
|
+
declare const getMaxNativeTransferableAmount: (options: _paraspell_sdk_core.TGetMaxNativeTransferableAmountOptionsBase & {
|
|
90
|
+
api?: TPjsApiOrUrl;
|
|
91
|
+
}) => Promise<bigint>;
|
|
92
|
+
declare const getMaxForeignTransferableAmount: (options: _paraspell_sdk_core.TGetMaxForeignTransferableAmountOptionsBase & {
|
|
93
|
+
api?: TPjsApiOrUrl;
|
|
94
|
+
}) => Promise<bigint>;
|
|
95
|
+
declare const getTransferableAmount: (options: _paraspell_sdk_core.TGetTransferableAmountOptionsBase & {
|
|
96
|
+
api?: TPjsApiOrUrl;
|
|
97
|
+
}) => Promise<bigint>;
|
|
98
|
+
|
|
99
|
+
declare const assets_claimAssets: typeof claimAssets;
|
|
100
|
+
declare const assets_getAssetBalance: typeof getAssetBalance;
|
|
101
|
+
declare const assets_getBalanceForeign: typeof getBalanceForeign;
|
|
102
|
+
declare const assets_getBalanceNative: typeof getBalanceNative;
|
|
103
|
+
declare const assets_getMaxForeignTransferableAmount: typeof getMaxForeignTransferableAmount;
|
|
104
|
+
declare const assets_getMaxNativeTransferableAmount: typeof getMaxNativeTransferableAmount;
|
|
105
|
+
declare const assets_getOriginFeeDetails: typeof getOriginFeeDetails;
|
|
106
|
+
declare const assets_getTransferInfo: typeof getTransferInfo;
|
|
107
|
+
declare const assets_getTransferableAmount: typeof getTransferableAmount;
|
|
108
|
+
declare namespace assets {
|
|
109
|
+
export { assets_claimAssets as claimAssets, assets_getAssetBalance as getAssetBalance, assets_getBalanceForeign as getBalanceForeign, assets_getBalanceNative as getBalanceNative, assets_getMaxForeignTransferableAmount as getMaxForeignTransferableAmount, assets_getMaxNativeTransferableAmount as getMaxNativeTransferableAmount, assets_getOriginFeeDetails as getOriginFeeDetails, assets_getTransferInfo as getTransferInfo, assets_getTransferableAmount as getTransferableAmount };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Builder class for constructing transfers from Ethereum to Polkadot.
|
|
114
|
+
*/
|
|
115
|
+
declare class EvmBuilderClass<TApi, TRes> {
|
|
116
|
+
_options: TOptionalEvmBuilderOptions<TApi, TRes>;
|
|
117
|
+
constructor(api: IPolkadotApi<TApi, TRes>, provider?: AbstractProvider);
|
|
118
|
+
from(node: 'Ethereum' | 'Moonbeam' | 'Moonriver'): this;
|
|
119
|
+
/**
|
|
120
|
+
* Specifies the destination node on Polkadot.
|
|
121
|
+
*
|
|
122
|
+
* @param node - The Polkadot node to which the transfer will be made.
|
|
123
|
+
* @returns An instance of EvmBuilder
|
|
124
|
+
*/
|
|
125
|
+
to(node: TNodePolkadotKusama): this;
|
|
126
|
+
/**
|
|
127
|
+
* Specifies the currency to transfer.
|
|
128
|
+
*
|
|
129
|
+
* @param currency - The currency to be transferred.
|
|
130
|
+
* @returns An instance of EvmBuilder
|
|
131
|
+
*/
|
|
132
|
+
currency(currency: TCurrencyCoreV1WithAmount): this;
|
|
133
|
+
/**
|
|
134
|
+
* Specifies the recipient address on Polkadot.
|
|
135
|
+
*
|
|
136
|
+
* @param address - The Polkadot address to receive the transfer.
|
|
137
|
+
* @returns An instance of EvmBuilder
|
|
138
|
+
*/
|
|
139
|
+
address(address: string): this;
|
|
140
|
+
/**
|
|
141
|
+
* Specifies the signer for the Ethereum transaction.
|
|
142
|
+
*
|
|
143
|
+
* @param signer - The Ethereum signer to authorize the transfer.
|
|
144
|
+
* @returns An instance of EvmBuilder
|
|
145
|
+
*/
|
|
146
|
+
signer(signer: Signer): this;
|
|
147
|
+
/**
|
|
148
|
+
* Builds and executes the transfer from Ethereum to Polkadot.
|
|
149
|
+
*
|
|
150
|
+
* @throws Error if any required parameters are missing.
|
|
151
|
+
*/
|
|
152
|
+
build(): Promise<string>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Creates a new Builder instance.
|
|
157
|
+
*
|
|
158
|
+
* @param api - The API instance to use for building transactions. If not provided, a new instance will be created.
|
|
159
|
+
* @returns A new Builder instance.
|
|
160
|
+
*/
|
|
161
|
+
declare const Builder: (api?: TPjsApiOrUrl) => _paraspell_sdk_core.IFromBuilder<_polkadot_api.ApiPromise, Extrinsic>;
|
|
162
|
+
declare const GeneralBuilder: {
|
|
163
|
+
new (batchManager: {
|
|
164
|
+
transactionOptions: _paraspell_sdk_core.TSendOptions<_polkadot_api.ApiPromise, Extrinsic>[];
|
|
165
|
+
addTransaction(options: _paraspell_sdk_core.TSendOptions<_polkadot_api.ApiPromise, Extrinsic>): void;
|
|
166
|
+
isEmpty(): boolean;
|
|
167
|
+
buildBatch(api: _paraspell_sdk_core.IPolkadotApi<_polkadot_api.ApiPromise, Extrinsic>, from: _paraspell_sdk_core.TNodeDotKsmWithRelayChains, options?: _paraspell_sdk_core.TBatchOptions): Promise<Extrinsic>;
|
|
168
|
+
}, api: _paraspell_sdk_core.IPolkadotApi<_polkadot_api.ApiPromise, Extrinsic>, from?: _paraspell_sdk_core.TNodeDotKsmWithRelayChains): GeneralBuilder$1<_polkadot_api.ApiPromise, Extrinsic>;
|
|
169
|
+
};
|
|
170
|
+
declare const EvmBuilder: (provider?: AbstractProvider) => EvmBuilderClass<_polkadot_api.ApiPromise, Extrinsic>;
|
|
171
|
+
|
|
172
|
+
type IUseKeepAliveFinalBuilder = IUseKeepAliveFinalBuilder$1<TPjsApi, Extrinsic>;
|
|
173
|
+
|
|
174
|
+
declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
|
|
175
|
+
|
|
176
|
+
export { Builder, EvmBuilder, type Extrinsic, GeneralBuilder, type IUseKeepAliveFinalBuilder, type TPjsApi, type TPjsApiOrUrl, assets, buildEthTransferOptions, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, transfer as xcmPallet };
|