Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitpay-node-client

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitpay-node-client - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "bitpay-node-client",
"version": "1.2.0",
"version": "1.2.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,5 +7,30 @@ # Bitpay node client

## Example
## Example usage
```javascript
const fs = require('fs')
const path = require('path')
const BitpayNodeClient = require('bitpay-node-client')
const privateKeyFilename = path.join(__dirname, 'api.key')
const encryptedPrivateKey = fs.readFileSync(privateKeyFilename, 'utf8')
const bitpay = new BitpayNodeClient({
encryptedPrivateKey
})
bitpay.getTokens()
.then(() => bitpay.asMerchant().post('invoices', {
price: 1,
currency: 'USD'
}))
.then((invoices) => {
console.log('invoices', invoices)
})
```
## Running provided example
- Clone this repository
- Run `npm install`
- Generate `api.key` for merchant ([see this](https://github.com/bitpay/node-bitpay-client) for how)
- Copy the `USER_HOME/.bitpay/api.key` to this project's root directory
- Run `npm run example` to create a invoice
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc