{"name":"bitcore-wallet-client","version":"8.25.8","keywords":["bitcoin","copay","multisig","wallet","client","bitcore","BWS","BWC"],"author":{"name":"BitPay Inc"},"license":"MIT","_id":"bitcore-wallet-client@8.25.8","homepage":"https://github.com/bitpay/bitcore-wallet-client#readme","bugs":{"url":"https://github.com/bitpay/bitcore-wallet-client/issues"},"dist":{"shasum":"b645afcac0416c90b287ff8dbcc610137c0a68d2","tarball":"http://registry-npm.ywwl.com/bitcore-wallet-client/download/bitcore-wallet-client-8.25.8.tgz","fileCount":108,"integrity":"sha512-RNgtAIR5vHKqerLn6d160ZoOT9+hbwTlGt9AaeBNcwPVeiiACwTnM8/dWJahFUT2bE49ubjisbj59RXxK60EiQ==","signatures":[{"sig":"MEYCIQDyccQSqJp7+ujKhgPeTR9cKeC6GkoLpXKpQfCL2QK7/wIhAIgtoPMjR6F7n/dNBGwsP3Qwsu2VypDI8WzwEj8k0otz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":939216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdEIpCRA9TVsSAnZWagAAqdsP/isaJUi1lfsstPR75NvA\nUUzmoA3D5hNv6KYwA8AHZN+CGyHJRmSwONMQqnuq7oGK6WUX7QCDXoZvJfcj\nWzSF6Ku4/lBwJ8bi1IoRkkSn+qPIXhIhBa61gyc67XmPEVmTc2WU9e71w5aj\nNHea1O+G8+ccb9MA0oVa6S2eGvac/ub9N3cJ55aeyCk/bTJ0rb0YEvBYpZOa\nSeK/dROseSLaiIB4qXZV9Bo2P5b8UiqGZqfYfC13iukMwAzXPveV9AZhGW05\ntAHxX7ZngRWl6pgQsf8CIrxtRHe32Q3UbvVtocuhTxs/AlYkKF7dPv0ybbkR\n+oNJRJW5wo8OP5/oIuQjVdvTaVhINP9V825PQr/zWpXKFAVhbR8nWZImhhCT\nVASoKYRHT17CSa8v3CAP0cldC4huCf3r0VDthq4ezHj8txEA+4XtDxN3cFBY\nAxk7BMAz/UT+aHZk9gxaR/+9xpc70HijwicqF9kM2DjaQ8mKnus5RuU3umbZ\n7yp24Iz3p2ZaArzylLzsYdXleop2Z6/1MzXDi4nIUvNLUOt78DaFM7c3WjTx\nemS9FyvigcOT1YOWLmYsk4sWJJ51+7VkJzbmyVLwoHImD0FcV1fI8mg3oEhB\nDW7Odqzy7NIjRwKkPV3MhEIsdArCvS0/reOsZdmYEORSMSteT4OOl3l7L6KB\nTKO4\r\n=ipeQ\r\n-----END PGP SIGNATURE-----\r\n","size":179732,"noattachment":false,"key":"/bitcore-wallet-client/-/bitcore-wallet-client-8.25.8.tgz"},"main":"ts_build/index.js","types":"ts_build/index.d.js","engine":"node >= 8.0.0","gitHead":"012cc0216a9bc6b195035855bd17149bad41acd1","scripts":{"fix":"npm run fix:style && npm run fix:lint","pub":"npm run build && npm publish","tsc":"npm run clean && tsc","docs":"TODO ./node_modules/.bin/tsdoc src/lib/* src/lib/common src/lib/errors -o docs && cat README.header.md  docs/*.md LICENSE > README.md","lint":"npm run lint:ts && npm run lint:style","test":"npm run compile && mocha --exit","build":"tsc && npm run lint","clean":"rm -rf ./ts_build","start":"npm run clean && npm run tsc && node app.js","compile":"npm run tsc","lint:ts":"tslint -c ../../tslint.json 'src/**/*.ts'","test:ci":"npm run test","coverage":"istanbul cover ./node_modules/.bin/_mocha -- --reporter spec test","fix:lint":"tslint --fix -c ../../tslint.json 'src/**/*.ts'","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","fix:style":"prettier --write 'src/**/*.ts'","precommit":"npm run fix && npm run lint","lint:style":"prettier --check 'src/**/*.ts'"},"_npmUser":{"name":"ematiu","email":"ematiu@gmail.com"},"prettier":{"arrowParens":"avoid","singleQuote":true,"trailingComma":"none"},"repository":{"url":"git+ssh://git@github.com/bitpay/bitcore-wallet-client.git","type":"git"},"_npmVersion":"6.9.0","description":"Client for bitcore-wallet-service","directories":{},"_nodeVersion":"10.16.2","dependencies":{"ajv":"^6.10.0","sjcl":"1.0.3","async":"^0.9.0","bip38":"^1.3.0","lodash":"^4.17.20","superagent":"^5.1.0","typescript":"^3.9.3","preconditions":"^2.2.3","bitcore-mnemonic":"^8.25.8","source-map-loader":"^0.2.4","crypto-wallet-core":"^8.25.8","source-map-support":"^0.5.19","json-stable-stringify":"^1.0.1","awesome-typescript-loader":"^5.2.1"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^1.9.1","uuid":"^2.0.1","kbpgp":"^2.1.4","mocha":"^5.2.0","sinon":"^7.1.1","tslint":"^5.14.0","mongodb":"^2.0.27","ts-node":"^8.0.3","istanbul":"*","prettier":"^2.1.2","coveralls":"^3.0.2","supertest":"*","browserify":"^13.1.0","@types/node":"^10.0.2","@types/lodash":"^4.14.136","request-promise":"^4.2.4","bitcore-wallet-service":"^8.25.8","typescript-eslint-parser":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bitcore-wallet-client_8.25.8_1618231849055_0.5854331277195302","host":"s3://npm-registry-packages"},"readme":"# bitcore-wallet-client\n\n[![NPM Package](https://img.shields.io/npm/v/bitcore-wallet-client.svg?style=flat-square)](https://www.npmjs.org/package/bitcore-wallet-client)\n[![Build Status](https://img.shields.io/travis/bitpay/bitcore-wallet-client.svg?branch=master&style=flat-square)](https://travis-ci.org/bitpay/bitcore-wallet-client)\n[![Coverage Status](https://coveralls.io/repos/bitpay/bitcore-wallet-client/badge.svg)](https://coveralls.io/r/bitpay/bitcore-wallet-client)\n\nThe *official* client library for [bitcore-wallet-service](https://github.com/bitpay/bitcore-wallet-service).\n\n## Description\n\nThis package communicates with BWS [Bitcore wallet service](https://github.com/bitpay/bitcore-wallet-service) using the REST API. All REST endpoints are wrapped as simple async methods. All relevant responses from BWS are checked independently by the peers, thus the importance of using this library when talking to a third party BWS instance.\n\nSee [Bitcore-wallet] (https://github.com/bitpay/bitcore-wallet) for a simple CLI wallet implementation that relays on BWS and uses bitcore-wallet-client.\n\n## Get Started\n\nYou can start using bitcore-wallet-client via [NPM](https://www.npmjs.com/package/bitcore-wallet-client): by running `npm install bitcore-wallet-client` from your console.\n\n## Example\n\nStart your own local [Bitcore wallet service](https://github.com/bitpay/bitcore-wallet-service) instance. In this example we assume you have `bitcore-wallet-service` running on your `localhost:3232`.\n\nThen create two files `irene.js` and `tomas.js` with the content below:\n\n### **irene.js**\n\n``` javascript\nvar Client = require('bitcore-wallet-client');\n\n\nvar fs = require('fs');\nvar BWS_INSTANCE_URL = 'https://bws.bitpay.com/bws/api'\n\nvar client = new Client({\n  baseUrl: BWS_INSTANCE_URL,\n  verbose: false,\n});\n\nclient.createWallet(\"My Wallet\", \"Irene\", 2, 2, {network: 'testnet'}, function(err, secret) {\n  if (err) {\n    console.log('error: ',err); \n    return\n  };\n  // Handle err\n  console.log('Wallet Created. Share this secret with your copayers: ' + secret);\n  fs.writeFileSync('irene.dat', client.export());\n});\n```\n\n### **tomas.js**\n\n``` javascript\n\nvar Client = require('bitcore-wallet-client');\n\n\nvar fs = require('fs');\nvar BWS_INSTANCE_URL = 'https://bws.bitpay.com/bws/api'\n\nvar secret = process.argv[2];\nif (!secret) {\n  console.log('./tomas.js <Secret>')\n\n  process.exit(0);\n}\n\nvar client = new Client({\n  baseUrl: BWS_INSTANCE_URL,\n  verbose: false,\n});\n\nclient.joinWallet(secret, \"Tomas\", {}, function(err, wallet) {\n  if (err) {\n    console.log('error: ', err);\n    return\n  };\n\n  console.log('Joined ' + wallet.name + '!');\n  fs.writeFileSync('tomas.dat', client.export());\n\n\n  client.openWallet(function(err, ret) {\n    if (err) {\n      console.log('error: ', err);\n      return\n    };\n    console.log('\\n\\n** Wallet Info', ret); //TODO\n\n    console.log('\\n\\nCreating first address:', ret); //TODO\n    if (ret.wallet.status == 'complete') {\n      client.createAddress({}, function(err,addr){\n        if (err) {\n          console.log('error: ', err);\n          return;\n        };\n\n        console.log('\\nReturn:', addr)\n      });\n    }\n  });\n});\n```\n\nInstall `bitcore-wallet-client` before start:\n\n```sh\nnpm i bitcore-wallet-client\n```\n\nCreate a new wallet with the first script:\n\n```sh\n$ node irene.js\ninfo Generating new keys\n Wallet Created. Share this secret with your copayers: JbTDjtUkvWS4c3mgAtJf4zKyRGzdQzZacfx2S7gRqPLcbeAWaSDEnazFJF6mKbzBvY1ZRwZCbvT\n```\n\nJoin to this wallet with generated secret:\n\n```sh\n$ node tomas.js JbTDjtUkvWS4c3mgAtJf4zKyRGzdQzZacfx2S7gRqPLcbeAWaSDEnazFJF6mKbzBvY1ZRwZCbvT\nJoined My Wallet!\n\nWallet Info: [...]\n\nCreating first address:\n\nReturn: [...]\n\n```\n\nNote that the scripts created two files named `irene.dat` and `tomas.dat`. With these files you can get status, generate addresses, create proposals, sign transactions, etc.\n","publish_time":1618231849266,"maintainers":[{"name":"gasteve","email":"stephen@pairhome.net"},{"name":"cmgustavo","email":"cmgustavo83@gmail.com"},{"name":"nitsujlangston","email":"nitsujlangston@gmail.com"},{"name":"unusualbob","email":"unusualbob@gmail.com"},{"name":"johnathanwhite","email":"johnathanwwhite@gmail.com"}],"_cnpm_publish_time":1618231849266,"dist-tags":{"beta":"11.5.2","latest":"10.10.15"}}