lunesjs 1.5.4 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -17,13 +17,13 @@ class Account {
|
|
17
17
|
}
|
18
18
|
function accountFactory({ privateKey, publicKey, address, nWords, chain, nonce, seed } = {}) {
|
19
19
|
if (seed != undefined) {
|
20
|
-
return new Account(Object.assign({}, crypto_1.default.fromExistingSeed(seed, nonce != undefined ? nonce : 0, chain != undefined ? chain :
|
20
|
+
return new Account(Object.assign({}, crypto_1.default.fromExistingSeed(seed, nonce != undefined ? nonce : 0, chain != undefined ? chain : 1)));
|
21
21
|
}
|
22
22
|
else if (privateKey != undefined) {
|
23
|
-
return new Account(Object.assign({}, crypto_1.default.fromPrivateKey(privateKey, chain != undefined ? chain :
|
23
|
+
return new Account(Object.assign({}, crypto_1.default.fromPrivateKey(privateKey, chain != undefined ? chain : 1)));
|
24
24
|
}
|
25
25
|
else if (publicKey != undefined) {
|
26
|
-
return new Account(Object.assign({}, crypto_1.default.fromPublicKey(publicKey, chain != undefined ? chain :
|
26
|
+
return new Account(Object.assign({}, crypto_1.default.fromPublicKey(publicKey, chain != undefined ? chain : 1)));
|
27
27
|
}
|
28
28
|
else if (address != undefined) {
|
29
29
|
return new Account(Object.assign({}, crypto_1.default.fromAddress(address, chain != undefined ? chain : 0)));
|
package/package.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "lunesjs",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.7",
|
4
4
|
"description": "Library for communication with nodes in mainnet or testnet of the lunes-blockchain network",
|
5
|
-
"main": "dist
|
6
|
-
"types": "dist
|
5
|
+
"main": "dist/**/*.js",
|
6
|
+
"types": "dist/**/*/*.d.ts",
|
7
7
|
"repository": "git@git.lunes.io:blockchain/labs/lunesjs.git",
|
8
8
|
"keywords": [
|
9
9
|
"blockchain",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"client"
|
12
12
|
],
|
13
13
|
"author": "lunes-platform",
|
14
|
-
"license": "
|
14
|
+
"license": "Apache 2.0",
|
15
15
|
"scripts": {
|
16
16
|
"build": "tsc --declaration",
|
17
17
|
"fmtc": "prettier -c",
|
@@ -30,4 +30,4 @@
|
|
30
30
|
"axios": "^0.26.1",
|
31
31
|
"lunesrs": "1.8.1"
|
32
32
|
}
|
33
|
-
}
|
33
|
+
}
|
@@ -41,21 +41,21 @@ export function accountFactory({
|
|
41
41
|
...cryptoUtils.fromExistingSeed(
|
42
42
|
seed,
|
43
43
|
nonce != undefined ? nonce : 0,
|
44
|
-
chain != undefined ? chain :
|
44
|
+
chain != undefined ? chain : 1
|
45
45
|
)
|
46
46
|
})
|
47
47
|
} else if (privateKey != undefined) {
|
48
48
|
return new Account({
|
49
49
|
...cryptoUtils.fromPrivateKey(
|
50
50
|
privateKey,
|
51
|
-
chain != undefined ? chain :
|
51
|
+
chain != undefined ? chain : 1
|
52
52
|
)
|
53
53
|
})
|
54
54
|
} else if (publicKey != undefined) {
|
55
55
|
return new Account({
|
56
56
|
...cryptoUtils.fromPublicKey(
|
57
57
|
publicKey,
|
58
|
-
chain != undefined ? chain :
|
58
|
+
chain != undefined ? chain : 1
|
59
59
|
)
|
60
60
|
})
|
61
61
|
} else if (address != undefined) {
|