@leofcoin/launch-chain 0.4.17 → 0.4.19
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/exports/index.js +4 -2
- package/exports/src/index.d.ts +38 -0
- package/package.json +6 -5
package/exports/index.js
CHANGED
|
@@ -108,7 +108,8 @@ const launch = async (options, password) => {
|
|
|
108
108
|
throw new Error(`no remotes connected`);
|
|
109
109
|
}
|
|
110
110
|
else if (options.mode === 'direct') {
|
|
111
|
-
|
|
111
|
+
const node = new Node({ network: options.network, stars: options.stars, networkVersion: options.networkVersion }, password);
|
|
112
|
+
await node.ready;
|
|
112
113
|
await nodeConfig({ network: options.network, networkVersion: options.networkVersion });
|
|
113
114
|
chain = new Chain({ network: options.network, stars: options.stars, networkVersion: options.networkVersion });
|
|
114
115
|
await chain.ready;
|
|
@@ -138,7 +139,8 @@ const launch = async (options, password) => {
|
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
else {
|
|
141
|
-
|
|
142
|
+
const node = new Node({ network: options.network, stars: options.stars, networkVersion: options.networkVersion }, password);
|
|
143
|
+
await node.ready;
|
|
142
144
|
await nodeConfig({ network: options.network, networkVersion: options.networkVersion });
|
|
143
145
|
chain = new Chain({ network: options.network, stars: options.stars, networkVersion: options.networkVersion });
|
|
144
146
|
await chain.ready;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Chain from '@leofcoin/chain/chain';
|
|
2
|
+
import WSClient from '@leofcoin/endpoint-clients/ws';
|
|
3
|
+
import HttpClient from '@leofcoin/endpoint-clients/http';
|
|
4
|
+
type launchMode = 'direct' | 'remote' | 'server';
|
|
5
|
+
type endpointReturns = {
|
|
6
|
+
http?: string[];
|
|
7
|
+
ws?: string[];
|
|
8
|
+
};
|
|
9
|
+
type clientReturns = {
|
|
10
|
+
http?: HttpClient[];
|
|
11
|
+
ws?: WSClient[];
|
|
12
|
+
};
|
|
13
|
+
type launchReturn = {
|
|
14
|
+
chain: Chain;
|
|
15
|
+
mode: launchMode;
|
|
16
|
+
endpoints: endpointReturns;
|
|
17
|
+
clients: clientReturns;
|
|
18
|
+
};
|
|
19
|
+
type endpointOptions = {
|
|
20
|
+
port: number;
|
|
21
|
+
url?: string;
|
|
22
|
+
};
|
|
23
|
+
type launchOptions = {
|
|
24
|
+
network?: string;
|
|
25
|
+
networkVersion?: string;
|
|
26
|
+
stars: string[];
|
|
27
|
+
forceRemote: boolean;
|
|
28
|
+
mode?: launchMode;
|
|
29
|
+
ws?: endpointOptions[] | undefined;
|
|
30
|
+
http?: endpointOptions[] | undefined;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {object} options { ws: boolean || {url: string, port: number}, http: boolean || {url: string, port: number}, network}
|
|
35
|
+
* @returns '{ mode: string, endpoints: object, chain}'
|
|
36
|
+
*/
|
|
37
|
+
declare const launch: (options: launchOptions, password: string) => Promise<launchReturn>;
|
|
38
|
+
export { launch as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/launch-chain",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -28,14 +28,15 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/leofcoin/launch-chain#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@leofcoin/chain": "^1.
|
|
31
|
+
"@leofcoin/chain": "^1.10.9",
|
|
32
32
|
"@leofcoin/endpoint-clients": "^0.3.15",
|
|
33
33
|
"@leofcoin/endpoints": "^0.4.8",
|
|
34
|
-
"@leofcoin/networks": "^1.1.
|
|
34
|
+
"@leofcoin/networks": "^1.1.30"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
38
|
-
"rollup": "^4.
|
|
39
|
-
"tslib": "^2.8.1"
|
|
38
|
+
"rollup": "^4.62.4",
|
|
39
|
+
"tslib": "^2.8.1",
|
|
40
|
+
"typescript": "^6.0.3"
|
|
40
41
|
}
|
|
41
42
|
}
|