{"id":13772995,"url":"https://github.com/bitpay/bitcore-wallet-client","last_synced_at":"2025-05-11T05:34:02.704Z","repository":{"id":28048145,"uuid":"31544185","full_name":"bitpay/bitcore-wallet-client","owner":"bitpay","description":"A client library for bitcore-wallet-service","archived":true,"fork":false,"pushed_at":"2019-01-12T14:24:53.000Z","size":22925,"stargazers_count":152,"open_issues_count":49,"forks_count":271,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-04T16:05:16.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitpay.png","metadata":{"files":{"readme":"README.header.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-02T14:31:04.000Z","updated_at":"2024-08-23T02:48:18.000Z","dependencies_parsed_at":"2022-08-30T16:11:27.929Z","dependency_job_id":null,"html_url":"https://github.com/bitpay/bitcore-wallet-client","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-wallet-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-wallet-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-wallet-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-wallet-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitpay","download_url":"https://codeload.github.com/bitpay/bitcore-wallet-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523689,"owners_count":21921815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:10.051Z","updated_at":"2025-05-11T05:34:02.370Z","avatar_url":"https://github.com/bitpay.png","language":"JavaScript","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\u0026style=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 in any of these two ways:\n\n* via [Bower](http://bower.io/): by running `bower install bitcore-wallet-client` from your console\n* or 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 \u003cSecret\u003e')\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```\nnpm i bitcore-wallet-client\n```\n\nCreate a new wallet with the first script:\n\n```\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```\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\n\n","funding_links":[],"categories":["List of content"],"sub_categories":["Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fbitcore-wallet-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitpay%2Fbitcore-wallet-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fbitcore-wallet-client/lists"}