/mix-lib

Multiple Coins Library with Javascript

Primary LanguageJavaScriptOtherNOASSERTION

Multiple Coins Library with Javascript

A pure and powerful JavaScript Multiple Coins library.

Get Started

NodeJS

npm install mix-lib
var lib = require('mix-lib');
var priv = new lib.PrivateKey("GEEK");
console.log(priv);
console.log(priv.toWIF());
console.log(priv.toAddress());
// <PrivateKey: 8f446ab8fa9db83b367bc4d160b7a6f0fc2fa6f390d076c2616ae7dae2ed49ca, network: GeekCash>
// XG68DmUydnkdaj9VoXzD6mzGzc2ABz2jEFcUPAYWnBew3eJtYvWk
// <Address: GPJs2uSCFDjDD9GqS5PcGcixBUs6jB8qL8, type: pubkeyhash, network: GeekCash>
var lib = require('mix-lib');
var priv = new lib.PrivateKey("DASH");
console.log(priv);
console.log(priv.toWIF());
console.log(priv.toAddress());
// <PrivateKey: 58af0f84ecc68038f9d4f8ec5658c5bf4bea57fedaaa1ebe6e992ca32b101417, network: Dash>
// XEG2F8raABRoeze7xV4exbg6ji1YYR34qqWQGJ3CZuhdGcZvqGDx
// <Address: XkV5By8ADmr2jzm6bYjkQnUFHqeu9wk1bP, type: pubkeyhash, network: Dash>
var lib = require('mix-lib');
var priv = new lib.PrivateKey("BTC");
console.log(priv);
console.log(priv.toWIF());
console.log(priv.toAddress());
// <PrivateKey: 74b35dce79cb9154858615e8cb8b2889f826ec557bb0bcf95d40881d367779af, network: Bitcoin>
// L18ZXoA7z6xJBmE9mvctDzwyg2skLLHhYWmupXdnkHQ7JgtL9kXf
// <Address: 1B7zH2tuXAwqFj9AypBqjMqJiiNKY67os4, type: pubkeyhash, network: Bitcoin>
var lib = require('mix-lib');
var transaction = new lib.Transaction()
    .from(utxos)          // Feed information about what unspent outputs one can use
    .to(address, amount)  // Add an output with the given amount of satoshis
    .change(address)      // Sets up a change address where the rest of the funds will go
    .sign(privkeySet)     // Signs all the inputs it can

Import an address via WIF

var lib = require('mix-lib');
var wif = 'XG68DmUydnkdaj9VoXzD6mzGzc2ABz2jEFcUPAYWnBew3eJtYvWk';
var address = new lib.PrivateKey(wif).toAddress();
//<Address: GPJs2uSCFDjDD9GqS5PcGcixBUs6jB8qL8, type: pubkeyhash, network: GeekCash>

Coins

GeekCash [GEEK]
Dash [DASH]
Bitcoin [BTC]
PIVX [PIVX]
ColossusXT [COLX]
Aegeus [AEG]
MetaCash [META]
LightPayCoin [LPC]
Northern [NORT]
DeepOnion [ONION]
DigiByte [DGB]
Zcash [ZEC]
Stakenet [XSN]
MMOCoin [MMO]
Stakecube [SCC]
BitcoinCash [BCH]
Alqo [ALQ]
BlockNet [BLOCK]
Trittium [TRTT]

Docs

Examples

Some examples can be found here, below is a list of direct links for some of them.

License

Code released under the MIT license.