New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

litecore-lib

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

litecore-lib - npm Package Compare versions

Comparing version 0.1.0 to 0.13.19

4

benchmark/script.js
'use strict';
var benchmark = require('benchmark');
var bitcore = require('..');
var litecore = require('..');
var async = require('async');

@@ -18,3 +18,3 @@ var blockData = require('./block-357238.json');

var scripts = [];
var block = bitcore.Block.fromString(blockData);
var block = litecore.Block.fromString(blockData);
for (var i = 0; i < block.transactions.length; i++) {

@@ -21,0 +21,0 @@ var tx = block.transactions[i];

'use strict';
var benchmark = require('benchmark');
var bitcore = require('..');
var litecore = require('..');
var bitcoinjs = require('bitcoinjs-lib');

@@ -25,9 +25,9 @@ var bcoin = require('bcoin');

// uint64le
var br = new bitcore.encoding.BufferWriter();
var br = new litecore.encoding.BufferWriter();
var num = Math.round(Math.random() * 10000000000000);
br.writeUInt64LEBN(new bitcore.crypto.BN(num));
br.writeUInt64LEBN(new litecore.crypto.BN(num));
buffers.push(br.toBuffer());
// hashes
var data = bitcore.crypto.Hash.sha256sha256(new Buffer(32));
var data = litecore.crypto.Hash.sha256sha256(new Buffer(32));
hashBuffers.push(data);

@@ -44,3 +44,3 @@ }

var buf = buffers[c];
var br = new bitcore.encoding.BufferReader(buf);
var br = new litecore.encoding.BufferReader(buf);
bn = br.readUInt64LEBN();

@@ -57,3 +57,3 @@ c++;

var buf = hashBuffers[c];
var br = new bitcore.encoding.BufferReader(buf);
var br = new litecore.encoding.BufferReader(buf);
reversed = br.readReverse();

@@ -85,4 +85,4 @@ c++;

function bitcoreTest() {
block1 = bitcore.Block.fromString(blockData);
function litecoreTest() {
block1 = litecore.Block.fromString(blockData);
}

@@ -109,3 +109,3 @@

var suite = new benchmark.Suite();
suite.add('bitcore', bitcoreTest, {maxTime: maxTime});
suite.add('litecore', litecoreTest, {maxTime: maxTime});
suite.add('bitcoinjs', bitcoinJSTest, {maxTime: maxTime});

@@ -112,0 +112,0 @@ suite.add('bcoin', bcoinTest, {maxTime: maxTime});

{
"name": "bitcore-lib",
"main": "./bitcore-lib.min.js",
"name": "litecore-lib",
"main": "./litecore-lib.min.js",
"version": "0.13.19",
"homepage": "http://bitcore.io",
"homepage": "http://litecore.io",
"authors": [
"BitPay, Inc."
],
"description": "A pure, powerful core for your bitcoin project.",
"description": "A pure, powerful core for your litecoin project.",
"moduleType": [

@@ -14,4 +14,4 @@ "globals"

"keywords": [
"bitcoin",
"bitcore",
"litecoin",
"litecore",
"btc",

@@ -18,0 +18,0 @@ "satoshi"

@@ -1,5 +0,5 @@

Contributing to Bitcore
Contributing to Litecore
=======
We're working hard to make *bitcore* the most powerful JavaScript library for working with bitcoin. Our goal is to have *bitcore* be a library that can be used by anyone interested in bitcoin, and to level expertise differences with great design and documentation.
We're working hard to make *litecore* the most powerful JavaScript library for working with litecoin. Our goal is to have *litecore* be a library that can be used by anyone interested in litecoin, and to level expertise differences with great design and documentation.

@@ -23,3 +23,3 @@ ## Community

These are some global design goals in bitcore that any change must adhere.
These are some global design goals in litecore that any change must adhere.

@@ -44,3 +44,3 @@ ### D1 - Naming Matters

Accept a wide variety of use cases and arguments, always return an internal form of an object. For example, the class `PublicKey` can accept strings or buffers with a DER encoded public key (either compressed or uncompressed), another PublicKey, a PrivateKey, or a Point, an instance of the `elliptic.js` library with the point in bitcoin's elliptic curve that represents the public key.
Accept a wide variety of use cases and arguments, always return an internal form of an object. For example, the class `PublicKey` can accept strings or buffers with a DER encoded public key (either compressed or uncompressed), another PublicKey, a PrivateKey, or a Point, an instance of the `elliptic.js` library with the point in litecoin's elliptic curve that represents the public key.

@@ -96,3 +96,3 @@ ### D4 - Consistency Everywhere

When possible, bitcore objects should have standard methods on an instance prototype:
When possible, litecore objects should have standard methods on an instance prototype:
* `toObject/toJSON` - A plain JavaScript object that `JSON.stringify` can call

@@ -107,3 +107,3 @@ * `toString` - A string representation of the instance

`JSON.stringify` and `JSON.parse` are expected to be handled outside of the scope of Bitcore methods. For example, calling `JSON.stringify` on an Bitcore object will behave as expected and call `transaction.toJSON()` and then stringify it:
`JSON.stringify` and `JSON.parse` are expected to be handled outside of the scope of Litecore methods. For example, calling `JSON.stringify` on a Litecore object will behave as expected and call `transaction.toJSON()` and then stringify it:

@@ -123,3 +123,3 @@ ```javascript

#### E1 - Use bitcore.Errors
#### E1 - Use litecore.Errors

@@ -214,10 +214,10 @@ We've designed a structure for Errors to follow and are slowly migrating to it.

#### T3 - Require 'bitcore' and Look up Classes from There
#### T3 - Require 'litecore' and Look up Classes from There
This helps to make tests more useful as examples, and more independent of where they are placed. This also helps prevent forgetting to include all submodules in the bitcore object.
This helps to make tests more useful as examples, and more independent of where they are placed. This also helps prevent forgetting to include all submodules in the litecore object.
DO:
```javascript
var bitcore = require('../');
var PublicKey = bitcore.PublicKey;
var litecore = require('../');
var PublicKey = litecore.PublicKey;
```

@@ -255,4 +255,4 @@ DON'T:

```sh
git remote add bitpay git@github.com:bitpay/bitcore.git
git pull --rebase bitpay master
git remote add litecoin-project git@github.com:litecoin-project/litecore.git
git pull --rebase litecoin-project master
```

@@ -268,9 +268,9 @@

```
Finally go to [github.com/bitpay/bitcore](https://github.com/bitpay/bitcore) in your web browser and issue a new pull request.
Finally go to [github.com/litecoin-project/litecore](https://github.com/litecoin-project/litecore) in your web browser and issue a new pull request.
Main contributors will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of bitcore.
Main contributors will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of litecore.
If you have any questions feel free to post them to
[github.com/bitpay/bitcore/issues](https://github.com/bitpay/bitcore/issues).
[github.com/litecoin-project/litecore/issues](https://github.com/litecoin-project/litecore/issues).
Thanks for your time and code!

@@ -5,3 +5,3 @@ # Bitcoin Address

## Instantiate an Address
To be able to receive bitcoins an address is needed, but in order to spend them a private key is necessary. Please take a look at the [`PrivateKey`](privatekey.md) docs for more information about exporting and saving a key.
To be able to receive bitcoins an address is needed, but in order to spend them a private key is necessary. Please take a look at the [`PrivateKey`](privatekey.md) docs for more information about exporting and saving a key.

@@ -38,3 +38,3 @@ ```javascript

## Validating an Address
The main use that we expect you'll have for the `Address` class in Bitcore is validating that an address is a valid one, what type of address it is (you may be interested on knowing if the address is a simple "pay to public key hash" address or a "pay to script hash" address) and what network does the address belong to.
The main use that we expect you'll have for the `Address` class in Litecore is validating that an address is a valid one, what type of address it is (you may be interested on knowing if the address is a simple "pay to public key hash" address or a "pay to script hash" address) and what network does the address belong to.

@@ -67,2 +67,2 @@ The code to do these validations looks like this:

The errors are listed in the generated file in the [errors folder](https://github.com/bitpay/bitcore/tree/master/lib/errors). There's a structure to errors defined in the [spec.js file](https://github.com/bitpay/bitcore/tree/master/lib/errors/spec.js).
The errors are listed in the generated file in the [errors folder](https://github.com/litecoin-project/litecore/tree/master/lib/errors). There's a structure to errors defined in the [spec.js file](https://github.com/litecoin-project/litecore/tree/master/lib/errors/spec.js).
# Browser Builds
Bitcore and most official submodules work in the browser, thanks to [browserify](http://browserify.org/) (some modules are not fully compatible with web browsers).
Litecore and most official submodules work in the browser, thanks to [browserify](http://browserify.org/) (some modules are not fully compatible with web browsers).
The easiest and recommended way to use them, is via [Bower](http://bower.io/), a browser package manager, and get the release bundles. For example, when building an app that uses `bitcore` and `bitcore-mnemonic`, you do:
The easiest and recommended way to use them, is via [Bower](http://bower.io/), a browser package manager, and get the release bundles. For example, when building an app that uses `litecore` and `bitcore-mnemonic`, you do:
```sh
bower install bitcore-lib
bower install litecore-lib
bower install bitcore-mnemonic

@@ -19,3 +19,3 @@ ```

"dependencies": {
"bitcore-lib": "^0.13.7",
"litecore-lib": "^0.13.7",
"bitcore-mnemonic": "^1.0.1"

@@ -36,3 +36,3 @@ }

<meta charset="utf-8">
<script src="bower_components/bitcore/bitcore-lib.min.js"></script>
<script src="bower_components/litecore/litecore-lib.min.js"></script>
<script src="bower_components/bitcore-mnemonic/bitcore-mnemonic.min.js"></script>

@@ -44,3 +44,3 @@ </head>

<script type="text/javascript">
var bitcore = require('bitcore-lib');
var litecore = require('litecore-lib');
var Mnemonic = require('bitcore-mnemonic');

@@ -59,7 +59,7 @@ // etc...

```sh
browserify --require ./index.js:bitcore-lib | uglifyjs > bitcore-lib.min.js
browserify --require ./index.js:litecore-lib | uglifyjs > litecore-lib.min.js
```
```sh
browserify --require ./index.js:bitcore-mnemonic --external bitcore-lib | uglifyjs > bitcore-mnemonic.min.js
browserify --require ./index.js:bitcore-mnemonic --external litecore-lib | uglifyjs > bitcore-mnemonic.min.js
```

@@ -66,0 +66,0 @@

@@ -5,14 +5,14 @@ # Bitcoin Crypto

## Random
The `bitcore.crypto.Random` namespace contains a single function, named `getRandomBuffer(size)` that returns a `Buffer` instance with random bytes. It may not work depending on the engine that bitcore is running on (doesn't work with IE versions lesser than 11).
The `litecore.crypto.Random` namespace contains a single function, named `getRandomBuffer(size)` that returns a `Buffer` instance with random bytes. It may not work depending on the engine that litecore is running on (doesn't work with IE versions lesser than 11).
## BN
The `bitcore.Crypto.BN` class contains a wrapper around [bn.js](https://github.com/indutny/bn.js), the bignum library used internally in bitcore.
The `litecore.Crypto.BN` class contains a wrapper around [bn.js](https://github.com/indutny/bn.js), the bignum library used internally in litecore.
## Point
The `bitcore.Crypto.Point` class contains a wrapper around the class Point of [elliptic.js](https://github.com/indutny/elliptic), the elliptic curve library used internally in bitcore.
The `litecore.Crypto.Point` class contains a wrapper around the class Point of [elliptic.js](https://github.com/indutny/elliptic), the elliptic curve library used internally in litecore.
## Hash
The `bitcore.Crypto.Hash` namespace contains a set of hashes and utilities. These are either the native `crypto` hash functions from `node.js` or their respective browser shims as provided by the `browserify` library.
The `litecore.Crypto.Hash` namespace contains a set of hashes and utilities. These are either the native `crypto` hash functions from `node.js` or their respective browser shims as provided by the `browserify` library.
## ECDSA
`bitcore.Crypto.ECDSA` contains a pure JavaScript implementation of the elliptic curve DSA signature scheme based on [elliptic.js](https://github.com/indutny/elliptic).
`litecore.Crypto.ECDSA` contains a pure JavaScript implementation of the elliptic curve DSA signature scheme based on [elliptic.js](https://github.com/indutny/elliptic).
# Encoding
The `bitcore.Encoding` namespace contains utilities for encoding information in common formats in the bitcoin ecosystem.
The `litecore.Encoding` namespace contains utilities for encoding information in common formats in the bitcoin ecosystem.

@@ -4,0 +4,0 @@ ## Base58 & Base58Check

@@ -1,6 +0,6 @@

# Bitcore examples
# Litecore examples
## Generate a random address
```javascript
var privateKey = new bitcore.PrivateKey();
var privateKey = new litecore.PrivateKey();

@@ -13,6 +13,6 @@ var address = privateKey.toAddress();

var value = new Buffer('correct horse battery staple');
var hash = bitcore.crypto.Hash.sha256(value);
var bn = bitcore.crypto.BN.fromBuffer(hash);
var hash = litecore.crypto.Hash.sha256(value);
var bn = litecore.crypto.BN.fromBuffer(hash);
var address = new bitcore.PrivateKey(bn).toAddress();
var address = new litecore.PrivateKey(bn).toAddress();
```

@@ -24,3 +24,3 @@

var address = new bitcore.PrivateKey(wif).toAddress();
var address = new litecore.PrivateKey(wif).toAddress();
```

@@ -30,3 +30,3 @@

```javascript
var privateKey = new bitcore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy');
var privateKey = new litecore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy');
var utxo = {

@@ -40,3 +40,3 @@ "txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986",

var transaction = new bitcore.Transaction()
var transaction = new litecore.Transaction()
.from(utxo)

@@ -49,5 +49,5 @@ .to('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 15000)

```javascript
var Message = require('bitcore-message');
var Message = require('litecore-message');
var privateKey = new bitcore.PrivateKey('L23PpjkBQqpAF4vbMHNfTZAb3KFPBSawQ7KinFTzz7dxq6TZX8UA');
var privateKey = new litecore.PrivateKey('L23PpjkBQqpAF4vbMHNfTZAb3KFPBSawQ7KinFTzz7dxq6TZX8UA');
var message = new Message('This is an example of a signed message.');

@@ -60,3 +60,3 @@

```javascript
var Message = require('bitcore-message');
var Message = require('litecore-message');

@@ -71,3 +71,3 @@ var address = '13Js7D3q4KvfSqgKN8LpNq57gcahrVc5JZ';

```javascript
var privateKey = new bitcore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy');
var privateKey = new litecore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy');
var utxo = {

@@ -81,5 +81,5 @@ "txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986",

var transaction = new bitcore.Transaction()
var transaction = new litecore.Transaction()
.from(utxo)
.addData('bitcore rocks') // Add OP_RETURN data
.addData('litecore rocks') // Add OP_RETURN data
.sign(privateKey);

@@ -97,3 +97,3 @@ ```

var address = new bitcore.Address(publicKeys, requiredSignatures);
var address = new litecore.Address(publicKeys, requiredSignatures);
```

@@ -104,7 +104,7 @@

var privateKeys = [
new bitcore.PrivateKey('91avARGdfge8E4tZfYLoxeJ5sGBdNJQH4kvjJoQFacbgwmaKkrx'),
new bitcore.PrivateKey('91avARGdfge8E4tZfYLoxeJ5sGBdNJQH4kvjJoQFacbgww7vXtT')
new litecore.PrivateKey('91avARGdfge8E4tZfYLoxeJ5sGBdNJQH4kvjJoQFacbgwmaKkrx'),
new litecore.PrivateKey('91avARGdfge8E4tZfYLoxeJ5sGBdNJQH4kvjJoQFacbgww7vXtT')
];
var publicKeys = privateKeys.map(bitcore.PublicKey);
var address = new bitcore.Address(publicKeys, 2); // 2 of 2
var publicKeys = privateKeys.map(litecore.PublicKey);
var address = new litecore.Address(publicKeys, 2); // 2 of 2

@@ -115,7 +115,7 @@ var utxo = {

"address" : address.toString(),
"script" : new bitcore.Script(address).toHex(),
"script" : new litecore.Script(address).toHex(),
"satoshis" : 20000
};
var transaction = new bitcore.Transaction()
var transaction = new litecore.Transaction()
.from(utxo, publicKeys, 2)

@@ -122,0 +122,0 @@ .to('mtoKs9V381UAhUia3d7Vb9GNak8Qvmcsme', 20000)

@@ -5,3 +5,3 @@ # HDKeys

## Hierarchically Derived Keys
Bitcore provides full support for [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki), allowing for many key management schemas that benefit from this property. Please be sure to read and understand the basic concepts and the warnings on that BIP before using these classes.
Litecore provides full support for [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki), allowing for many key management schemas that benefit from this property. Please be sure to read and understand the basic concepts and the warnings on that BIP before using these classes.

@@ -14,4 +14,4 @@ ## HDPrivateKey

```javascript
var bitcore = require('bitcore');
var HDPrivateKey = bitcore.HDPrivateKey;
var litecore = require('litecore');
var HDPrivateKey = litecore.HDPrivateKey;

@@ -18,0 +18,0 @@ var hdPrivateKey = new HDPrivateKey();

@@ -1,8 +0,8 @@

# Bitcore v0.13
# Litecore v0.1
## Principles
Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. Bitcore provides a reliable API for JavaScript apps that need to interface with Bitcoin.
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. Litecore provides a reliable API for JavaScript apps that need to interface with Litecoin.
To get started, just `npm install bitcore` or `bower install bitcore`.
To get started, just `npm install litecore` or `bower install litecore`.

@@ -20,6 +20,6 @@ # Documentation Index

* [Using Different Units](unit.md)
* [Acknowledging and Requesting Payments: Bitcoin URIs](uri.md)
* [Acknowledging and Requesting Payments: Litecoin URIs](uri.md)
* [The Transaction Class](transaction.md)
## Bitcoin Internals
## Litecoin Internals
* [Scripts](script.md)

@@ -40,3 +40,3 @@ * [Block](block.md)

* [Payment Protocol Support](https://github.com/bitpay/bitcore-payment-protocol)
* [Peer to Peer Networking](https://github.com/bitpay/bitcore-p2p)
* [Peer to Peer Networking](https://github.com/litecoin-project/litecore-p2p)
* [Bitcoin Core JSON-RPC](https://github.com/bitpay/bitcoind-rpc)

@@ -47,5 +47,5 @@ * [Payment Channels](https://github.com/bitpay/bitcore-channel)

* [Blockchain Explorers](https://github.com/bitpay/bitcore-explorers)
* [Signed Messages](https://github.com/bitpay/bitcore-message)
* [Signed Messages](https://github.com/litecoin-project/litecore-message)
# Examples
# Examples

@@ -55,7 +55,7 @@ ## Create and Save a Private Key

```javascript
var privateKey = new bitcore.PrivateKey();
var privateKey = new litecore.PrivateKey();
var exported = privateKey.toWIF();
// e.g. L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m
var imported = bitcore.PrivateKey.fromWIF(exported);
var imported = litecore.PrivateKey.fromWIF(exported);
var hexa = privateKey.toString();

@@ -75,3 +75,3 @@ // e.g. 'b9de6e778fe92aa7edb69395556f843f1dce0448350112e14906efc2a80fa61a'

// Build a 2-of-3 address from public keys
var p2shAddress = new bitcore.Address([publicKey1, publicKey2, publicKey3], 2);
var p2shAddress = new litecore.Address([publicKey1, publicKey2, publicKey3], 2);
```

@@ -86,3 +86,3 @@

};
var uri = new bitcore.URI(paymentInfo).toString();
var uri = new litecore.URI(paymentInfo).toString();
```

@@ -89,0 +89,0 @@

# Networks
Bitcore provides support for the main bitcoin network as well as for `testnet3`, the current test blockchain. We encourage the use of `Networks.livenet` and `Networks.testnet` as constants. Note that the library sometimes may check for equality against this object. Please avoid creating a deep copy of this object.
Litecore provides support for the main bitcoin network as well as for `testnet3`, the current test blockchain. We encourage the use of `Networks.livenet` and `Networks.testnet` as constants. Note that the library sometimes may check for equality against this object. Please avoid creating a deep copy of this object.

@@ -8,7 +8,7 @@ The `Network` namespace has a function, `get(...)` that returns an instance of a `Network` or `undefined`. The only argument to this function is some kind of identifier of the network: either its name, a reference to a Network object, or a number used as a magic constant to identify the network (for example, the value `0` that gives bitcoin addresses the distinctive `'1'` at its beginning on livenet, is a `0x6F` for testnet).

The regtest network is useful for development as it's possible to programmatically and instantly generate blocks for testing. It's currently supported as a variation of testnet. Here is an example of how to use regtest with the Bitcore Library:
The regtest network is useful for development as it's possible to programmatically and instantly generate blocks for testing. It's currently supported as a variation of testnet. Here is an example of how to use regtest with the Litecore Library:
```js
// Standard testnet
> bitcore.Networks.testnet.networkMagic;
> litecore.Networks.testnet.networkMagic;
<Buffer 0b 11 09 07>

@@ -19,4 +19,4 @@ ```

// Enabling testnet to use the regtest port and magicNumber
> bitcore.Networks.enableRegtest();
> bitcore.Networks.testnet.networkMagic;
> litecore.Networks.enableRegtest();
> litecore.Networks.testnet.networkMagic;
<Buffer fa bf b5 da>

@@ -31,3 +31,3 @@ ```

Take a look at this modified snippet from [networks.js](https://github.com/bitpay/bitcore/blob/master/lib/networks.js)
Take a look at this modified snippet from [networks.js](https://github.com/litecoin-project/litecore/blob/master/lib/networks.js)

@@ -34,0 +34,0 @@ ```javascript

# Private Key
Represents a bitcoin private key and is needed to be able to spend bitcoin and sign transactions. See the official [Bitcoin Wiki](https://en.bitcoin.it/wiki/Private_key) for more information about private keys. A PrivateKey in Bitcore is an immutable object that has methods to import and export into a variety of formats including [Wallet Import Format](https://en.bitcoin.it/wiki/Wallet_import_format).
Represents a bitcoin private key and is needed to be able to spend bitcoin and sign transactions. See the official [Bitcoin Wiki](https://en.bitcoin.it/wiki/Private_key) for more information about private keys. A PrivateKey in Litecore is an immutable object that has methods to import and export into a variety of formats including [Wallet Import Format](https://en.bitcoin.it/wiki/Wallet_import_format).

@@ -4,0 +4,0 @@ ## Instantiate a Private Key

# Public Key
Represents a bitcoin public key and is needed to be able to receive bitcoin, as is usually represented as a bitcoin [Address](address.md). See the official [Bitcoin Wiki](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses).
A PublicKey in Bitcore is an immutable object and can be instantiated from a [Point](crypto.md), string, [PrivateKey](privatekey.md), Buffer or a [BN](crypto.md).
A PublicKey in Litecore is an immutable object and can be instantiated from a [Point](crypto.md), string, [PrivateKey](privatekey.md), Buffer or a [BN](crypto.md).

@@ -35,6 +35,6 @@ ## Instantiate a Public Key

```javascript
> var bitcore = require('bitcore');
> var litecore = require('litecore');
// compressed public key starting with 0x03 (greater than midpoint of curve)
> var compressedPK = bitcore.PublicKey('030589ee559348bd6a7325994f9c8eff12bd'+
> var compressedPK = litecore.PublicKey('030589ee559348bd6a7325994f9c8eff12bd'+
'5d73cc683142bd0dd1a17abc99b0dc');

@@ -46,3 +46,3 @@ > compressedPK.compressed;

// compressed public key starting with 0x02 (smaller than midpoint of curve)
> var compressedPK2 = new bitcore.PublicKey('02a1633cafcc01ebfb6d78e39f687a1f'+
> var compressedPK2 = new litecore.PublicKey('02a1633cafcc01ebfb6d78e39f687a1f'+
'0995c62fc95f51ead10a02ee0be551b5dc');

@@ -54,3 +54,3 @@ > compressedPK2.compressed;

// uncompressed public key, starting with 0x04. Contains both X and Y encoded
> var uncompressed = bitcore.PublicKey('0479BE667EF9DCBBAC55A06295CE870B07029'+
> var uncompressed = litecore.PublicKey('0479BE667EF9DCBBAC55A06295CE870B07029'+
'BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68'+

@@ -57,0 +57,0 @@ '554199C47D08FFB10D4B8');

# Script
All bitcoin transactions have scripts embedded into its inputs and outputs. The scripts use a very simple programming language, which is evaluated from left to right using a stack. The language is designed such that it guarantees all scripts will execute in a limited amount of time (it is not Turing-Complete).
All litecoin transactions have scripts embedded into its inputs and outputs. The scripts use a very simple programming language, which is evaluated from left to right using a stack. The language is designed such that it guarantees all scripts will execute in a limited amount of time (it is not Turing-Complete).
When a transaction is validated, the input scripts are concatenated with the output scripts and evaluated. To be valid, all transaction scripts must evaluate to true. A good analogy for how this works is that the output scripts are puzzles that specify in which conditions can those bitcoins be spent. The input scripts provide the correct data to make those output scripts evaluate to true.
When a transaction is validated, the input scripts are concatenated with the output scripts and evaluated. To be valid, all transaction scripts must evaluate to true. A good analogy for how this works is that the output scripts are puzzles that specify in which conditions can those litecoins be spent. The input scripts provide the correct data to make those output scripts evaluate to true.
For more detailed information about the bitcoin scripting language, check the online reference [on bitcoin's wiki](https://en.bitcoin.it/wiki/Script).
For more detailed information about the litecoin scripting language, check the online reference [on bitcoin's wiki](https://en.bitcoin.it/wiki/Script).
The `Script` object provides an interface to construct, parse, and identify bitcoin scripts. It also gives simple interfaces to create most common script types. This class is useful if you want to create custom input or output scripts. In other case, you should probably use `Transaction`.
The `Script` object provides an interface to construct, parse, and identify litecoin scripts. It also gives simple interfaces to create most common script types. This class is useful if you want to create custom input or output scripts. In other case, you should probably use `Transaction`.

@@ -14,3 +14,3 @@ ## Script creation

### Pay to Public Key Hash (p2pkh)
This is the most commonly used transaction output script. It's used to pay to a bitcoin address (a bitcoin address is a public key hash encoded in base58check)
This is the most commonly used transaction output script. It's used to pay to a litecoin address (a litecoin address is a public key hash encoded in base58check)

@@ -35,3 +35,3 @@ ```javascript

### Pay to Multisig (p2ms)
Multisig outputs allow to share control of bitcoins between several keys. When creating the script, one specifies the public keys that control the funds, and how many of those keys are required to sign off spending transactions to be valid. An output with N public keys of which M are required is called an m-of-n output (For example, 2-of-3, 3-of-5, 4-of-4, etc.)
Multisig outputs allow to share control of litecoins between several keys. When creating the script, one specifies the public keys that control the funds, and how many of those keys are required to sign off spending transactions to be valid. An output with N public keys of which M are required is called an m-of-n output (For example, 2-of-3, 3-of-5, 4-of-4, etc.)

@@ -55,3 +55,3 @@ Note that regular multisig outputs are rarely used nowadays. The best practice is to use a p2sh multisig output (See Script#toScriptHashOut()).

### Pay to Script Hash (p2sh)
Pay to script hash outputs are scripts that contain the hash of another script, called `redeemScript`. To spend bitcoins sent in a p2sh output, the spending transaction must provide a script matching the script hash and data which makes the script evaluate to true. This allows to defer revealing the spending conditions to the moment of spending. It also makes it possible for the receiver to set the conditions to spend those bitcoins.
Pay to script hash outputs are scripts that contain the hash of another script, called `redeemScript`. To spend litecoins sent in a p2sh output, the spending transaction must provide a script matching the script hash and data which makes the script evaluate to true. This allows to defer revealing the spending conditions to the moment of spending. It also makes it possible for the receiver to set the conditions to spend those litecoins.

@@ -95,3 +95,3 @@ Most multisig transactions today use p2sh outputs where the `redeemScript` is a multisig output.

## Script Parsing and Identification
`Script` has an easy interface to parse raw scripts from the network or bitcoind, and to extract useful information. An illustrative example (for more options check the API reference)
`Script` has an easy interface to parse raw scripts from the network or litecoind, and to extract useful information. An illustrative example (for more options check the API reference)

@@ -110,3 +110,3 @@ ```javascript

## Script Interpreting and Validation
To validate a transaction, the bitcoin network validates all of its inputs and outputs. To validate an input, the input's script is concatenated with the referenced output script, and the result is executed. If at the end of execution the stack contains a 'true' value, then the transaction is valid. You can do this in `bitcore` by using the `Interpreter` class. The entry point (and probably the only interface you'll need for most applications) is the method `Interpreter#verify()`.
To validate a transaction, the litecoin network validates all of its inputs and outputs. To validate an input, the input's script is concatenated with the referenced output script, and the result is executed. If at the end of execution the stack contains a 'true' value, then the transaction is valid. You can do this in `litecore` by using the `Interpreter` class. The entry point (and probably the only interface you'll need for most applications) is the method `Interpreter#verify()`.

@@ -113,0 +113,0 @@ You can use it like this:

# Transaction
Bitcore provides a very simple API for creating transactions. We expect this API to be accessible for developers without knowing the working internals of bitcoin in deep detail. What follows is a small introduction to transactions with some basic knowledge required to use this API.
Litecore provides a very simple API for creating transactions. We expect this API to be accessible for developers without knowing the working internals of litecoin in deep detail. What follows is a small introduction to transactions with some basic knowledge required to use this API.
A Transaction contains a set of inputs and a set of outputs. Each input contains a reference to another transaction's output, and a signature that allows the value referenced in that output to be used in this transaction.
Note also that an output can be used only once. That's why there's a concept of "change address" in the bitcoin ecosystem: if an output of 10 BTC is available for me to spend, but I only need to transmit 1 BTC, I'll create a transaction with two outputs, one with 1 BTC that I want to spend, and the other with 9 BTC to a change address, so I can spend this 9 BTC with another private key that I own.
Note also that an output can be used only once. That's why there's a concept of "change address" in the litecoin ecosystem: if an output of 10 BTC is available for me to spend, but I only need to transmit 1 BTC, I'll create a transaction with two outputs, one with 1 BTC that I want to spend, and the other with 9 BTC to a change address, so I can spend this 9 BTC with another private key that I own.

@@ -22,6 +22,6 @@ So, in order to transmit a valid transaction, you must know what other transactions on the network store outputs that have not been spent and that are available for you to spend (meaning that you have the set of keys that can validate you own those funds). The unspent outputs are usually referred to as "utxo"s.

Now, this could just be serialized to hexadecimal ASCII values (`transaction.serialize()`) and sent over to the bitcoind reference client.
Now, this could just be serialized to hexadecimal ASCII values (`transaction.serialize()`) and sent over to the litecoind reference client.
```bash
bitcoin-cli sendrawtransaction <serialized transaction>
litecoin-cli sendrawtransaction <serialized transaction>
```

@@ -79,5 +79,5 @@

## Adding inputs
Transaction inputs are instances of either [Input](https://github.com/bitpay/bitcore/tree/master/lib/transaction/input) or its subclasses. `Input` has some abstract methods, as there is no actual concept of a "signed input" in the bitcoin scripting system (just valid signatures for <tt>OP_CHECKSIG</tt> and similar opcodes). They are stored in the `input` property of `Transaction` instances.
Transaction inputs are instances of either [Input](https://github.com/litecoin-project/litecore/tree/master/lib/transaction/input) or its subclasses. `Input` has some abstract methods, as there is no actual concept of a "signed input" in the litecoin scripting system (just valid signatures for <tt>OP_CHECKSIG</tt> and similar opcodes). They are stored in the `input` property of `Transaction` instances.
Bitcore contains two implementations of `Input`, one for spending _Pay to Public Key Hash_ outputs (called `PublicKeyHashInput`) and another to spend _Pay to Script Hash_ outputs for which the redeem script is a Multisig script (called `MultisigScriptHashInput`).
Litecore contains two implementations of `Input`, one for spending _Pay to Public Key Hash_ outputs (called `PublicKeyHashInput`) and another to spend _Pay to Script Hash_ outputs for which the redeem script is a Multisig script (called `MultisigScriptHashInput`).

@@ -88,3 +88,3 @@ All inputs have the following five properties:

- `sequenceNumber`: a `number`, the sequence number, see [bitcoin's developer guide on nLockTime and the sequence number](https://bitcoin.org/en/developer-guide#locktime-and-sequence-number).
- `script`: the `Script` instance for this input. Usually called `scriptSig` in the bitcoin community.
- `script`: the `Script` instance for this input. Usually called `scriptSig` in the litecoin community.
- `output`: if available, a `Output` instance of the output associated with this input.

@@ -96,7 +96,7 @@

- `from`: A high level interface to add an input from a UTXO. It has a series of variants:
- `from(utxo)`: add an input from an [Unspent Transaction Output](http://bitcore.io/guide/unspentoutput.html). Currently, only P2PKH outputs are supported.
- `from(utxo)`: add an input from an [Unspent Transaction Output](http://litecore.io/guide/unspentoutput.html). Currently, only P2PKH outputs are supported.
- `from(utxos)`: same as above, but passing in an array of Unspent Outputs.
- `from(utxo, publicKeys, threshold)`: add an input that spends a UTXO with a P2SH output for a Multisig script. The `publicKeys` argument is an array of public keys, and `threshold` is the number of required signatures in the Multisig script.
- `addInput`: Performs a series of checks on an input and appends it to the end of the `input` vector and updates the amount of incoming bitcoins of the transaction.
- `addInput`: Performs a series of checks on an input and appends it to the end of the `input` vector and updates the amount of incoming litecoins of the transaction.
- `uncheckedAddInput`: adds an input to the end of the `input` vector and updates the `inputAmount` without performing any checks.

@@ -113,3 +113,3 @@

- `getSignatures`: takes an array of `PrivateKey` or strings from which a `PrivateKey` can be instantiated; the transaction to be signed; the kind of [signature hash to use](https://bitcoin.org/en/developer-guide#signature-hash-types). Returns an array of objects with the following properties:
- `signature`: an instance of [Signature](https://github.com/bitpay/bitcore/blob/master/lib/crypto/signature.js)
- `signature`: an instance of [Signature](https://github.com/litecoin-project/litecore/blob/master/lib/crypto/signature.js)
- `prevTxId`: this input's `prevTxId`,

@@ -140,7 +140,7 @@ - `outputIndex`: this input's `outputIndex`,

- `inspect`: Returns a string with some information about the transaction (currently a string formatted as `<Transaction 000...000>`, that only shows the serialized value of the transaction.
- `toBuffer`: Serializes the transaction for sending over the wire in the bitcoin network
- `toBuffer`: Serializes the transaction for sending over the wire in the litecoin network
- `toBufferWriter`: Uses an already existing BufferWriter to copy over the serialized transaction
## Serialization Checks
When serializing, the bitcore library performs a series of checks. These can be disabled by providing an object to the `serialize` method with the checks that you'll like to skip.
When serializing, the litecore library performs a series of checks. These can be disabled by providing an object to the `serialize` method with the checks that you'll like to skip.
- `disableLargeFees` avoids checking that the fee is no more than `Transaction.FEE_PER_KB * Transaction.FEE_SECURITY_MARGIN * size_in_kb`.

@@ -152,3 +152,3 @@ - `disableSmallFees` avoids checking that the fee is less than `Transaction.FEE_PER_KB * size_in_kb / Transaction.FEE_SECURITY_MARGIN`.

These are the current default values in the bitcore library involved on these checks:
These are the current default values in the litecore library involved on these checks:
- `Transaction.FEE_PER_KB`: `10000` (satoshis per kilobyte)

@@ -159,3 +159,3 @@ - `Transaction.FEE_SECURITY_MARGIN`: `15`

## Fee calculation
When outputs' value don't sum up to the same amount that inputs, the difference in bitcoins goes to the miner of the block that includes this transaction. The concept of a "change address" usually is associated with this: an output with an address that can be spent by the creator of the transaction.
When outputs' value don't sum up to the same amount that inputs, the difference in litecoins goes to the miner of the block that includes this transaction. The concept of a "change address" usually is associated with this: an output with an address that can be spent by the creator of the transaction.

@@ -170,5 +170,5 @@ For this reason, some methods in the Transaction class are provided:

## Time-Locking transaction
All bitcoin transactions contain a locktime field. The locktime indicates the earliest time a transaction can be added to the blockchain. Locktime allows signers to create time-locked transactions which will only become valid in the future, giving the signers a chance to change their minds. Locktime can be set in the form of a bitcoin block height (the transaction can only be included in a block with a higher height than specified) or a linux timestamp (transaction can only be confirmed after that time). For more information see [bitcoin's development guide section on locktime](https://bitcoin.org/en/developer-guide#locktime-and-sequence-number).
All litecoin transactions contain a locktime field. The locktime indicates the earliest time a transaction can be added to the blockchain. Locktime allows signers to create time-locked transactions which will only become valid in the future, giving the signers a chance to change their minds. Locktime can be set in the form of a litecoin block height (the transaction can only be included in a block with a higher height than specified) or a linux timestamp (transaction can only be confirmed after that time). For more information see [bitcoin's development guide section on locktime](https://bitcoin.org/en/developer-guide#locktime-and-sequence-number).
In bitcore, you can set a `Transaction`'s locktime by using the methods `Transaction#lockUntilDate` and `Transaction#lockUntilBlockHeight`. You can also get a friendly version of the locktime field via `Transaction#getLockTime`;
In litecore, you can set a `Transaction`'s locktime by using the methods `Transaction#lockUntilDate` and `Transaction#lockUntilBlockHeight`. You can also get a friendly version of the locktime field via `Transaction#getLockTime`;

@@ -175,0 +175,0 @@ For example:

@@ -9,4 +9,4 @@ # Unit

8198999.999999999
> var bitcore = require('bitcore');
> var Unit = bitcore.Unit;
> var litecore = require('litecore');
> var Unit = litecore.Unit;
> Unit.fromMilis(81.99).toSatoshis() // correct

@@ -13,0 +13,0 @@ 8199000

# UnspentOutput
`bitcore.Transaction.UnspentOutput` is a class with stateless instances that provides information about an unspent output:
`litecore.Transaction.UnspentOutput` is a class with stateless instances that provides information about an unspent output:
- Transaction ID and output index

@@ -4,0 +4,0 @@ - The "scriptPubKey", the script included in the output

# Bitcoin URIs
Represents a bitcoin payment URI. Bitcoin URI strings became the most popular way to share payment request, sometimes as a bitcoin link and others using a QR code.
Represents a litecoin payment URI. Bitcoin URI strings became the most popular way to share payment request, sometimes as a litecoin link and others using a QR code.

@@ -7,9 +7,9 @@ URI Examples:

```
bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu
bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2
bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2&message=Payment&label=Satoshi&extra=other-param
litecoin:LLNxdByMgALUxS7KjNq6wbfqwQmgqGqfAB
litecoin:LLNxdByMgALUxS7KjNq6wbfqwQmgqGqfAB?amount=1.2
litecoin:LLNxdByMgALUxS7KjNq6wbfqwQmgqGqfAB?amount=1.2&message=Payment&label=Satoshi&extra=other-param
```
## URI Validation
The main use that we expect you'll have for the `URI` class in bitcore is validating and parsing bitcoin URIs. A `URI` instance exposes the address as a bitcore `Address` object and the amount in Satoshis, if present.
The main use that we expect you'll have for the `URI` class in litecore is validating and parsing litecoin URIs. A `URI` instance exposes the address as a litecore `Address` object and the amount in Satoshis, if present.

@@ -19,3 +19,3 @@ The code for validating URIs looks like this:

```javascript
var uriString = 'bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2';
var uriString = 'litecoin:LLNxdByMgALUxS7KjNq6wbfqwQmgqGqfAB?amount=1.2';
var valid = URI.isValid(uriString);

@@ -27,3 +27,3 @@ var uri = new URI(uriString);

## URI Parameters
All standard parameters can be found as members of the `URI` instance. However a bitcoin URI may contain other non-standard parameters, all those can be found under the `extra` namespace.
All standard parameters can be found as members of the `URI` instance. However a litecoin URI may contain other non-standard parameters, all those can be found under the `extra` namespace.

@@ -33,3 +33,3 @@ See [the official BIP21 spec](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki) for more information.

## Create URI
Another important use case for the `URI` class is creating a bitcoin URI for sharing a payment request. That can be accomplished by using a dictionary to create an instance of URI.
Another important use case for the `URI` class is creating a litecoin URI for sharing a payment request. That can be accomplished by using a dictionary to create an instance of URI.

@@ -40,3 +40,3 @@ The code for creating an URI from an Object looks like this:

var uriString = new URI({
address: '12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu',
address: 'LLNxdByMgALUxS7KjNq6wbfqwQmgqGqfAB',
amount : 10000, // in satoshis

@@ -43,0 +43,0 @@ message: 'My payment request'

var bitcoreTasks = require('bitcore-build');
var litecoreTasks = require('litecore-build');
bitcoreTasks('lib');
litecoreTasks('lib');
'use strict';
var bitcore = module.exports;
var litecore = module.exports;
// module information
bitcore.version = 'v' + require('./package.json').version;
bitcore.versionGuard = function(version) {
litecore.version = 'v' + require('./package.json').version;
litecore.versionGuard = function(version) {
if (version !== undefined) {
var message = 'More than one instance of bitcore-lib found. ' +
'Please make sure to require bitcore-lib and check that submodules do' +
' not also include their own bitcore-lib dependency.';
var message = 'More than one instance of litecore-lib found. ' +
'Please make sure to require litecore-lib and check that submodules do' +
' not also include their own litecore-lib dependency.';
throw new Error(message);
}
};
bitcore.versionGuard(global._bitcore);
global._bitcore = bitcore.version;
litecore.versionGuard(global._litecore);
global._litecore = litecore.version;
// crypto
bitcore.crypto = {};
bitcore.crypto.BN = require('./lib/crypto/bn');
bitcore.crypto.ECDSA = require('./lib/crypto/ecdsa');
bitcore.crypto.Hash = require('./lib/crypto/hash');
bitcore.crypto.Random = require('./lib/crypto/random');
bitcore.crypto.Point = require('./lib/crypto/point');
bitcore.crypto.Signature = require('./lib/crypto/signature');
litecore.crypto = {};
litecore.crypto.BN = require('./lib/crypto/bn');
litecore.crypto.ECDSA = require('./lib/crypto/ecdsa');
litecore.crypto.Hash = require('./lib/crypto/hash');
litecore.crypto.Random = require('./lib/crypto/random');
litecore.crypto.Point = require('./lib/crypto/point');
litecore.crypto.Signature = require('./lib/crypto/signature');
// encoding
bitcore.encoding = {};
bitcore.encoding.Base58 = require('./lib/encoding/base58');
bitcore.encoding.Base58Check = require('./lib/encoding/base58check');
bitcore.encoding.BufferReader = require('./lib/encoding/bufferreader');
bitcore.encoding.BufferWriter = require('./lib/encoding/bufferwriter');
bitcore.encoding.Varint = require('./lib/encoding/varint');
litecore.encoding = {};
litecore.encoding.Base58 = require('./lib/encoding/base58');
litecore.encoding.Base58Check = require('./lib/encoding/base58check');
litecore.encoding.BufferReader = require('./lib/encoding/bufferreader');
litecore.encoding.BufferWriter = require('./lib/encoding/bufferwriter');
litecore.encoding.Varint = require('./lib/encoding/varint');
// utilities
bitcore.util = {};
bitcore.util.buffer = require('./lib/util/buffer');
bitcore.util.js = require('./lib/util/js');
bitcore.util.preconditions = require('./lib/util/preconditions');
litecore.util = {};
litecore.util.buffer = require('./lib/util/buffer');
litecore.util.js = require('./lib/util/js');
litecore.util.preconditions = require('./lib/util/preconditions');
// errors thrown by the library
bitcore.errors = require('./lib/errors');
litecore.errors = require('./lib/errors');
// main bitcoin library
bitcore.Address = require('./lib/address');
bitcore.Block = require('./lib/block');
bitcore.MerkleBlock = require('./lib/block/merkleblock');
bitcore.BlockHeader = require('./lib/block/blockheader');
bitcore.HDPrivateKey = require('./lib/hdprivatekey.js');
bitcore.HDPublicKey = require('./lib/hdpublickey.js');
bitcore.Networks = require('./lib/networks');
bitcore.Opcode = require('./lib/opcode');
bitcore.PrivateKey = require('./lib/privatekey');
bitcore.PublicKey = require('./lib/publickey');
bitcore.Script = require('./lib/script');
bitcore.Transaction = require('./lib/transaction');
bitcore.URI = require('./lib/uri');
bitcore.Unit = require('./lib/unit');
litecore.Address = require('./lib/address');
litecore.Block = require('./lib/block');
litecore.MerkleBlock = require('./lib/block/merkleblock');
litecore.BlockHeader = require('./lib/block/blockheader');
litecore.HDPrivateKey = require('./lib/hdprivatekey.js');
litecore.HDPublicKey = require('./lib/hdpublickey.js');
litecore.Networks = require('./lib/networks');
litecore.Opcode = require('./lib/opcode');
litecore.PrivateKey = require('./lib/privatekey');
litecore.PublicKey = require('./lib/publickey');
litecore.Script = require('./lib/script');
litecore.Transaction = require('./lib/transaction');
litecore.URI = require('./lib/uri');
litecore.Unit = require('./lib/unit');
// dependencies, subject to change
bitcore.deps = {};
bitcore.deps.bnjs = require('bn.js');
bitcore.deps.bs58 = require('bs58');
bitcore.deps.Buffer = Buffer;
bitcore.deps.elliptic = require('elliptic');
bitcore.deps._ = require('lodash');
litecore.deps = {};
litecore.deps.bnjs = require('bn.js');
litecore.deps.bs58 = require('bs58');
litecore.deps.Buffer = Buffer;
litecore.deps.elliptic = require('elliptic');
litecore.deps._ = require('lodash');
// Internal usage, exposed for testing/advanced tweaking
bitcore._HDKeyCache = require('./lib/hdkeycache');
bitcore.Transaction.sighash = require('./lib/transaction/sighash');
litecore._HDKeyCache = require('./lib/hdkeycache');
litecore.Transaction.sighash = require('./lib/transaction/sighash');

@@ -45,18 +45,18 @@ 'use strict';

var bitcore = {};
bitcore.Error = function() {
var litecore = {};
litecore.Error = function() {
this.message = 'Internal error';
this.stack = this.message + '\n' + (new Error()).stack;
};
bitcore.Error.prototype = Object.create(Error.prototype);
bitcore.Error.prototype.name = 'bitcore.Error';
litecore.Error.prototype = Object.create(Error.prototype);
litecore.Error.prototype.name = 'litecore.Error';
var data = require('./spec');
traverseRoot(bitcore.Error, data);
traverseRoot(litecore.Error, data);
module.exports = bitcore.Error;
module.exports = litecore.Error;
module.exports.extend = function(spec) {
return traverseNode(bitcore.Error, spec);
return traverseNode(litecore.Error, spec);
};
'use strict';
var docsURL = 'http://bitcore.io/';
var docsURL = 'http://litecore.io/';

@@ -5,0 +5,0 @@ module.exports = [{

@@ -169,3 +169,3 @@ 'use strict';

serializationError.message += ' Use Transaction#uncheckedSerialize if you want to skip security checks. ' +
'See http://bitcore.io/guide/transaction.html#Serialization for more info.';
'See http://litecore.io/guide/transaction.html#Serialization for more info.';
throw serializationError;

@@ -191,3 +191,3 @@ }

* @param {Object} opts allows to skip certain tests. {@see Transaction#serialize}
* @return {bitcore.Error}
* @return {litecore.Error}
*/

@@ -502,3 +502,3 @@ Transaction.prototype.getSerializationError = function(opts) {

* Can receive, as output information, the output of bitcoind's `listunspent` command,
* and a slightly fancier format recognized by bitcore:
* and a slightly fancier format recognized by litecore:
*

@@ -514,4 +514,4 @@ * ```

* ```
* Where `address` can be either a string or a bitcore Address object. The
* same is true for `script`, which can be a string or a bitcore Script.
* Where `address` can be either a string or a litecore Address object. The
* same is true for `script`, which can be a string or a litecore Script.
*

@@ -518,0 +518,0 @@ * Beware that this resets all the signatures for inputs (in further versions,

@@ -23,3 +23,3 @@ 'use strict';

*
* var uri = new URI('litecoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2');
* var uri = new URI('litecoin:LLNxdByMgALUxS7KjNq6wbfqwQmgqGqfAB?amount=1.2');
* console.log(uri.address, uri.amount);

@@ -87,3 +87,3 @@ * ```

*
* var valid = URI.isValid('litecoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu');
* var valid = URI.isValid('litecoin:LLNxdByMgALUxS7KjNq6wbfqwQmgqGqfAB');
* // true

@@ -90,0 +90,0 @@ * ```

{
"name": "litecore-lib",
"version": "0.1.0",
"version": "0.13.19",
"description": "A pure and powerful JavaScript Litecoin library.",

@@ -96,3 +96,3 @@ "author": "BitPay <dev@bitpay.com>",

"devDependencies": {
"bitcore-build": "bitpay/bitcore-build",
"litecore-build": "litecoin-project/litecore-build",
"brfs": "^1.2.0",

@@ -99,0 +99,0 @@ "chai": "^1.10.0",

@@ -26,8 +26,8 @@ Litecore Library

The complete docs are hosted here: [litecore documentation](http://bitcore.io/guide/). There's also a [litecore API reference](http://bitcore.io/api/) available generated from the JSDocs of the project, where you'll find low-level details on each litecore utility.
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.
- [Read the Developer Guide](http://bitcore.io/guide/)
- [Read the API Reference](http://bitcore.io/api/)
- [Read the Developer Guide](http://litecore.io/guide/)
- [Read the API Reference](http://litecore.io/api/)
To get community assistance and ask for help with implementation questions, please use our [community forums](https://forum.bitcore.io/).
To get community assistance and ask for help with implementation questions, please use our [community forums](https://forum.litecore.io/).

@@ -49,3 +49,3 @@ ## Examples

We're using Litecore in production, as are [many others](http://bitcore.io#projects), but please use common sense when doing anything related to finances! We take no responsibility for your implementation decisions.
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.

@@ -52,0 +52,0 @@ If you find a security issue, please email security@bitpay.com.

'use strict';
var should = require('chai').should();
var bitcore = require('../');
var litecore = require('../');
describe('#versionGuard', function() {
it('global._bitcore should be defined', function() {
should.equal(global._bitcore, bitcore.version);
it('global._litecore should be defined', function() {
should.equal(global._litecore, litecore.version);
});

@@ -13,5 +13,5 @@

(function() {
bitcore.versionGuard('version');
}).should.throw('More than one instance of bitcore');
litecore.versionGuard('version');
}).should.throw('More than one instance of litecore');
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc