bitpay-node-client
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12873
35