Skip to content

Commit

Permalink
chore: update dependencies and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
martiliones committed Dec 22, 2022
1 parent 95bb681 commit db64d24
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@
"license": "GPL-3.0",
"dependencies": {
"@liskhq/lisk-cryptography": "3.2.1",
"axios": "^1.1.3",
"bignumber.js": "^9.1.0",
"bitcoinjs-lib": "^5.2.0",
"axios": "^1.2.1",
"bignumber.js": "^9.1.1",
"bitcoinjs-lib": "^6.1.0",
"bitcore-mnemonic": "^8.25.40",
"bytebuffer": "^5.0.1",
"coininfo": "^5.2.1",
"ecpair": "^2.1.0",
"ed2curve": "^0.3.0",
"ethereumjs-util": "^7.1.5",
"hdkey": "^2.0.1",
"pbkdf2": "^3.1.2",
"socket.io-client": "^4.5.3",
"sodium-browserify-tweetnacl": "^0.2.6"
"socket.io-client": "^4.5.4",
"sodium-browserify-tweetnacl": "^0.2.6",
"tiny-secp256k1": "^2.2.1"
},
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -63,11 +65,11 @@
},
"homepage": "https://github.com/Adamant-im/adamant-api-jsclient#readme",
"devDependencies": {
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"eslint": "^8.27.0",
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"eslint": "^8.30.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-jest": "^27.1.7",
"husky": "^8.0.2",
"jest": "^29.3.1"
}
Expand Down
12 changes: 8 additions & 4 deletions src/groups/btc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
const bitcoin = require('bitcoinjs-lib');
const {ECPairFactory} = require('ecpair');
const tinysecp = require('tiny-secp256k1');

const coinNetworks = require('./coinNetworks');
const btc = { };
const btc = {};

/**
* Generates a BTC account from the passphrase specified.
* @param {string} passphrase ADAMANT account passphrase
* @returns {object} network info, keyPair, privateKey, privateKeyWIF
* @return {object} network info, keyPair, privateKey, privateKeyWIF
*/

btc.keys = (passphrase) => {
const network = coinNetworks.BTC;
const pwHash = bitcoin.crypto.sha256(Buffer.from(passphrase));
const keyPair = bitcoin.ECPair.fromPrivateKey(pwHash, {network});

const ECPairAPI = new ECPairFactory(tinysecp);
const keyPair = ECPairAPI.fromPrivateKey(pwHash, {network});

return {
network,
Expand Down
10 changes: 7 additions & 3 deletions src/groups/dash.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
const bitcoin = require('bitcoinjs-lib');
const {ECPairFactory} = require('ecpair');
const tinysecp = require('tiny-secp256k1');

const coinNetworks = require('./coinNetworks');
const dash = { };

/**
* Generates a DASH account from the passphrase specified.
* @param {string} passphrase ADAMANT account passphrase
* @returns {object} network info, keyPair, privateKey, privateKeyWIF
* @return {object} network info, keyPair, privateKey, privateKeyWIF
*/

dash.keys = (passphrase) => {
const network = coinNetworks.DASH;
const pwHash = bitcoin.crypto.sha256(Buffer.from(passphrase));
const keyPair = bitcoin.ECPair.fromPrivateKey(pwHash, {network});

const ECPairAPI = new ECPairFactory(tinysecp);
const keyPair = ECPairAPI.fromPrivateKey(pwHash, {network});

return {
network,
Expand Down
12 changes: 8 additions & 4 deletions src/groups/doge.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
const bitcoin = require('bitcoinjs-lib');
const {ECPairFactory} = require('ecpair');
const tinysecp = require('tiny-secp256k1');

const coinNetworks = require('./coinNetworks');
const doge = { };
const doge = {};

/**
* Generates a DOGE account from the passphrase specified.
* @param {string} passphrase ADAMANT account passphrase
* @returns {object} network info, keyPair, privateKey, privateKeyWIF
* @return {object} network info, keyPair, privateKey, privateKeyWIF
*/

doge.keys = (passphrase) => {
const network = coinNetworks.DOGE;
const pwHash = bitcoin.crypto.sha256(Buffer.from(passphrase));
const keyPair = bitcoin.ECPair.fromPrivateKey(pwHash, {network});

const ECPairAPI = new ECPairFactory(tinysecp);
const keyPair = ECPairAPI.fromPrivateKey(pwHash, {network});

return {
network,
Expand Down

0 comments on commit db64d24

Please sign in to comment.