diff --git a/lib/coininfo.js b/lib/coininfo.js index 7a769b6..4687df0 100644 --- a/lib/coininfo.js +++ b/lib/coininfo.js @@ -25,6 +25,8 @@ var coins = [ require('./coins/rdd'), require('./coins/vtc'), require('./coins/x42'), + require('./coins/xec'), + require('./coins/xpi'), require('./coins/zec') ] diff --git a/lib/coins/xec.js b/lib/coins/xec.js new file mode 100644 index 0000000..8b0f68b --- /dev/null +++ b/lib/coins/xec.js @@ -0,0 +1,93 @@ +/* + info from: + https://github.com/Bitcoin-ABC/bitcoin-abc/blob/master/src/chainparams.cpp +*/ + +var common = { + name: 'ECash', + per1: 1e2, + unit: 'XEC' +} + +var main = Object.assign({}, { + hashGenesisBlock: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f', + // nDefaultPort + port: 8333, + portRpc: 8332, + protocol: { + // pchMessageStart + magic: 0xe8f3e1e3 // careful, sent over wire as little endian + }, + // vSeeds + seedsDns: [ + 'seed.bitcoinabc.org', + 'seeder.jasonbcox.com', + 'btccash-seeder.bitcoinunlimited.info', + 'seed.bchd.org', + 'seed.deadalnix.me', + 'seeder.fabien.cash' + ], + // base58Prefixes + versions: { + bip32: { + private: 0x0488ade4, + public: 0x0488b21e + }, + bip44: 145, + private: 0x80, + public: 0x00, + scripthash: 0x05 + } +}, common) + +var test = Object.assign({}, { + hashGenesisBlock: '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943', + port: 18333, + portRpc: 18332, + protocol: { + magic: 0xf4f3e5f4 + }, + seedsDns: [ + 'testnet-seed.bitcoinabc.org', + 'testnet-seed-abc.bitcoinforks.org', + 'testnet-seed.bitprim.org', + 'testnet-seed.deadalnix.me', + 'testnet-seeder.criptolayer.net' + ], + versions: { + bip32: { + private: 0x04358394, + public: 0x043587cf + }, + bip44: 1, + private: 0xef, + public: 0x6f, + scripthash: 0xc4 + } +}, common) + +var regtest = Object.assign({}, { + hashGenesisBlock: '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206', + port: 18444, + portRpc: 18332, + protocol: { + magic: 0xfabfb5da + }, + seedsDns: [], + versions: { + bip32: { + private: 0x04358394, + public: 0x043587cf + }, + bip44: 1, + private: 0xef, + public: 0x6f, + scripthash: 0xc4 + } +}, common) + +module.exports = { + main, + test, + regtest +} diff --git a/lib/coins/xpi.js b/lib/coins/xpi.js new file mode 100644 index 0000000..7aa9b8b --- /dev/null +++ b/lib/coins/xpi.js @@ -0,0 +1,84 @@ +/* + info from: + https://github.com/LogosFoundation/lotusd/blob/master/src/chainparams.cpp +*/ + +var common = { + name: 'Lotus', + per1: 1e6, + unit: 'XPI' +} + +var main = Object.assign({}, { + hashGenesisBlock: '000000000abc0cde58ee7e919d3d4de183e6844add1fd5d14b4eac89d958f470', + // nDefaultPort + port: 10605, + portRpc: 10604, + protocol: { + // pchMessageStart + magic: 0xece7eff3 // careful, sent over wire as little endian + }, + // vSeeds + seedsDns: [ + 'mainnet.seeds.cash', + 'seed.be.cash' + ], + // base58Prefixes + versions: { + bip32: { + private: 0x0488ade4, + public: 0x0488b21e + }, + bip44: 10605, + private: 0x80, + public: 0x00, + scripthash: 0x05 + } +}, common) + +var test = Object.assign({}, { + hashGenesisBlock: '106050de32db2a668422cc34aa0f96d739d4189b8e5d6e763deeca527bba9c9f', + port: 11605, + portRpc: 11604, + protocol: { + magic: 0xecf4f3f4 + }, + seedsDns: [ + ], + versions: { + bip32: { + private: 0x04358394, + public: 0x043587cf + }, + bip44: 1, + private: 0xef, + public: 0x6f, + scripthash: 0xc4 + } +}, common) + +var regtest = Object.assign({}, { + hashGenesisBlock: '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206', + port: 12605, + portRpc: 12604, + protocol: { + magic: 0xecf2e5e7 + }, + seedsDns: [], + versions: { + bip32: { + private: 0x04358394, + public: 0x043587cf + }, + bip44: 1, + private: 0xef, + public: 0x6f, + scripthash: 0xc4 + } +}, common) + +module.exports = { + main, + test, + regtest +} diff --git a/package.json b/package.json index 94a2ae5..affca93 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "coininfo", + "name": "@bcpros/coininfo", "version": "5.2.1", "description": "JavaScript component for crypto currency specific information.", "license": "MIT", @@ -29,7 +29,7 @@ "tape": "^4.8.0" }, "repository": { - "url": "https://github.com/cryptocoinjs/coininfo", + "url": "https://github.com/vince8x/coininfo", "type": "git" }, "main": "./lib/coininfo.js", @@ -44,4 +44,4 @@ "dependencies": { "safe-buffer": "^5.1.1" } -} +} \ No newline at end of file