@paraspell/sdk 2.0.5 → 3.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/README.md +25 -109
- package/dist/index.cjs +1245 -751
- package/dist/index.d.ts +46 -12
- package/dist/index.mjs +1245 -752
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { ApiPromise } from '@polkadot/api';
|
|
2
|
-
import { SubmittableExtrinsic } from '@polkadot/api
|
|
2
|
+
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
3
3
|
import * as _polkadot_apps_config_endpoints_types from '@polkadot/apps-config/endpoints/types';
|
|
4
4
|
|
|
5
|
-
declare
|
|
5
|
+
declare abstract class ParachainNode {
|
|
6
|
+
private _node;
|
|
7
|
+
private _name;
|
|
8
|
+
private _type;
|
|
9
|
+
private _version;
|
|
10
|
+
constructor(node: TNode, name: string, type: TRelayChainType, version: Version);
|
|
11
|
+
get name(): string;
|
|
12
|
+
get type(): TRelayChainType;
|
|
13
|
+
get node(): "AssetHubPolkadot" | "Acala" | "Astar" | "BifrostPolkadot" | "Bitgreen" | "Centrifuge" | "Clover" | "ComposableFinance" | "Darwinia" | "HydraDX" | "Interlay" | "Kylin" | "Litentry" | "Moonbeam" | "Parallel" | "AssetHubKusama" | "Encointer" | "Altair" | "Amplitude" | "Bajun" | "Basilisk" | "BifrostKusama" | "Pioneer" | "Calamari" | "CrustShadow" | "Crab" | "Imbue" | "Integritee" | "InvArchTinker" | "Karura" | "Kintsugi" | "Litmus" | "Mangata" | "Moonriver" | "ParallelHeiko" | "Picasso" | "Quartz" | "Robonomics" | "Shiden" | "Turing" | "Equilibrium" | "Unique" | "Crust" | "Manta" | "Genshiro" | "Nodle" | "OriginTrail" | "Pendulum" | "Polkadex" | "Zeitgeist";
|
|
14
|
+
get version(): Version;
|
|
15
|
+
transfer(api: ApiPromise, currencySymbol: string | undefined, currencyId: number | undefined, amount: any, to: string, destination?: TNode, serializedApiCallEnabled?: boolean): Extrinsic | TSerializedApiCall;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare const NODE_NAMES: readonly ["AssetHubPolkadot", "Acala", "Astar", "BifrostPolkadot", "Bitgreen", "Centrifuge", "Clover", "ComposableFinance", "Darwinia", "HydraDX", "Interlay", "Kylin", "Litentry", "Moonbeam", "Parallel", "AssetHubKusama", "Encointer", "Altair", "Amplitude", "Bajun", "Basilisk", "BifrostKusama", "Pioneer", "Calamari", "CrustShadow", "Crab", "Imbue", "Integritee", "InvArchTinker", "Karura", "Kintsugi", "Litmus", "Mangata", "Moonriver", "ParallelHeiko", "Picasso", "Quartz", "Robonomics", "Shiden", "Turing", "Equilibrium", "Unique", "Crust", "Manta", "Genshiro", "Nodle", "OriginTrail", "Pendulum", "Polkadex", "Zeitgeist"];
|
|
6
19
|
declare const SUPPORTED_PALLETS: readonly ["XTokens", "OrmlXTokens", "PolkadotXcm", "RelayerXcm"];
|
|
7
20
|
|
|
8
21
|
type UpdateFunction = (name: string, index: number) => string;
|
|
@@ -12,8 +25,8 @@ type TRelayChainType = 'polkadot' | 'kusama';
|
|
|
12
25
|
type TNode = (typeof NODE_NAMES)[number];
|
|
13
26
|
type TAssetDetails = {
|
|
14
27
|
assetId: string;
|
|
15
|
-
symbol
|
|
16
|
-
decimals
|
|
28
|
+
symbol?: string;
|
|
29
|
+
decimals?: number;
|
|
17
30
|
};
|
|
18
31
|
type TNativeAssetDetails = {
|
|
19
32
|
assetId?: string;
|
|
@@ -42,11 +55,12 @@ type TSerializedApiCall = {
|
|
|
42
55
|
};
|
|
43
56
|
type XTokensTransferInput = {
|
|
44
57
|
api: ApiPromise;
|
|
45
|
-
currency: string;
|
|
58
|
+
currency: string | undefined;
|
|
46
59
|
currencyID: number | undefined;
|
|
47
60
|
amount: any;
|
|
48
61
|
addressSelection: any;
|
|
49
62
|
fees: number;
|
|
63
|
+
scenario: TScenario;
|
|
50
64
|
serializedApiCallEnabled?: boolean;
|
|
51
65
|
};
|
|
52
66
|
interface IXTokensTransfer {
|
|
@@ -58,14 +72,15 @@ type PolkadotXCMTransferInput = {
|
|
|
58
72
|
addressSelection: any;
|
|
59
73
|
currencySelection: any;
|
|
60
74
|
scenario: TScenario;
|
|
75
|
+
currencySymbol: string | undefined;
|
|
61
76
|
serializedApiCallEnabled?: boolean;
|
|
62
77
|
};
|
|
63
78
|
interface IPolkadotXCMTransfer {
|
|
64
79
|
transferPolkadotXCM(input: PolkadotXCMTransferInput): Extrinsic | TSerializedApiCall;
|
|
65
80
|
}
|
|
66
81
|
declare enum Version {
|
|
67
|
-
V1 =
|
|
68
|
-
V3 =
|
|
82
|
+
V1 = "V1",
|
|
83
|
+
V3 = "V3"
|
|
69
84
|
}
|
|
70
85
|
|
|
71
86
|
declare const sendSerializedApiCall: (api: ApiPromise, origin: TNode, currencySymbolOrId: string | number | bigint, amount: any, to: string, destination?: TNode) => TSerializedApiCall;
|
|
@@ -139,11 +154,11 @@ declare function getAssetId(node: TNode, symbol: string): string | null;
|
|
|
139
154
|
declare function getRelayChainSymbol(node: TNode): "DOT" | "KSM";
|
|
140
155
|
declare function getNativeAssets(node: TNode): TNativeAssetDetails[];
|
|
141
156
|
declare function getOtherAssets(node: TNode): TAssetDetails[];
|
|
142
|
-
declare function getAllAssetsSymbols(node: TNode): string[];
|
|
157
|
+
declare function getAllAssetsSymbols(node: TNode): (string | undefined)[];
|
|
143
158
|
declare function hasSupportForAsset(node: TNode, symbol: string): boolean;
|
|
144
|
-
declare function getAssetDecimals(node: TNode, symbol: string): number | null;
|
|
159
|
+
declare function getAssetDecimals(node: TNode, symbol: string): number | null | undefined;
|
|
145
160
|
declare function getParaId(node: TNode): number;
|
|
146
|
-
declare function getTNode(nodeID: number): "
|
|
161
|
+
declare function getTNode(nodeID: number): "AssetHubPolkadot" | "Acala" | "Astar" | "BifrostPolkadot" | "Bitgreen" | "Centrifuge" | "Clover" | "ComposableFinance" | "Darwinia" | "HydraDX" | "Interlay" | "Kylin" | "Litentry" | "Moonbeam" | "Parallel" | "AssetHubKusama" | "Encointer" | "Altair" | "Amplitude" | "Bajun" | "Basilisk" | "BifrostKusama" | "Pioneer" | "Calamari" | "CrustShadow" | "Crab" | "Imbue" | "Integritee" | "InvArchTinker" | "Karura" | "Kintsugi" | "Litmus" | "Mangata" | "Moonriver" | "ParallelHeiko" | "Picasso" | "Quartz" | "Robonomics" | "Shiden" | "Turing" | "Equilibrium" | "Unique" | "Crust" | "Manta" | "Genshiro" | "Nodle" | "OriginTrail" | "Pendulum" | "Polkadex" | "Zeitgeist" | undefined;
|
|
147
162
|
|
|
148
163
|
declare const index_getAllAssetsSymbols: typeof getAllAssetsSymbols;
|
|
149
164
|
declare const index_getAssetDecimals: typeof getAssetDecimals;
|
|
@@ -309,7 +324,26 @@ interface AmountBuilder {
|
|
|
309
324
|
declare const getDefaultPallet: (node: TNode) => TPallet;
|
|
310
325
|
declare const getSupportedPallets: (node: TNode) => TPallet[];
|
|
311
326
|
|
|
312
|
-
declare
|
|
327
|
+
declare const getNode: (node: TNode) => ParachainNode;
|
|
328
|
+
declare const getNodeEndpointOption: (node: TNode) => _polkadot_apps_config_endpoints_types.EndpointOption | {
|
|
329
|
+
info: string;
|
|
330
|
+
paraId: number;
|
|
331
|
+
providers: {
|
|
332
|
+
'Imbue Network 0': string;
|
|
333
|
+
Dwellir?: undefined;
|
|
334
|
+
OnFinality?: undefined;
|
|
335
|
+
RadiumBlock?: undefined;
|
|
336
|
+
};
|
|
337
|
+
} | {
|
|
338
|
+
info: string;
|
|
339
|
+
paraId: number;
|
|
340
|
+
providers: {
|
|
341
|
+
Dwellir: string;
|
|
342
|
+
OnFinality: string;
|
|
343
|
+
RadiumBlock: string;
|
|
344
|
+
'Imbue Network 0'?: undefined;
|
|
345
|
+
};
|
|
346
|
+
} | undefined;
|
|
313
347
|
|
|
314
348
|
declare class InvalidCurrencyError extends Error {
|
|
315
349
|
constructor(message: string);
|
|
@@ -331,4 +365,4 @@ declare class IncompatibleNodesError extends Error {
|
|
|
331
365
|
constructor();
|
|
332
366
|
}
|
|
333
367
|
|
|
334
|
-
export { Bool, Builder, Extrinsic, ExtrinsicFunction, IPolkadotXCMTransfer, IXTokensTransfer, IncompatibleNodesError, InvalidCurrencyError, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, TAssetDetails, TAssetJsonMap, TNativeAssetDetails, TNode, TNodeAssets, TPallet, TPalletJsonMap, TPalletMap, TRelayChainType, TScenario, TSerializedApiCall, UpdateFunction, Version, XTokensTransferInput, index as assets, index$1 as closeChannels, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getNodeEndpointOption, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$2 as openChannels, index$4 as xcmPallet, index$3 as xyk };
|
|
368
|
+
export { Bool, Builder, Extrinsic, ExtrinsicFunction, IPolkadotXCMTransfer, IXTokensTransfer, IncompatibleNodesError, InvalidCurrencyError, NODE_NAMES, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXCMTransferInput, SUPPORTED_PALLETS, ScenarioNotSupportedError, TAssetDetails, TAssetJsonMap, TNativeAssetDetails, TNode, TNodeAssets, TPallet, TPalletJsonMap, TPalletMap, TRelayChainType, TScenario, TSerializedApiCall, UpdateFunction, Version, XTokensTransferInput, index as assets, index$1 as closeChannels, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getNode, getNodeEndpointOption, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$2 as openChannels, index$4 as xcmPallet, index$3 as xyk };
|