New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

coinbase-node

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coinbase-node - npm Package Compare versions

Comparing version 0.0.5 to 0.1.0

lib/client.js

28

package.json
{
"name": "coinbase-node",
"description" : "Coinbase Bitcoin payment library for Node.js",
"keywords" : ["bitcoin", "coinbase", "api", "client"],
"version": "0.0.5",
"main": "lib/coinbase.js",
"description": "Coinbase Bitcoin payment library for Node.js",
"keywords": [
"bitcoin",
"coinbase",
"api",
"client"
],
"version": "0.1.0",
"main": "lib/client.js",
"dependencies": {
"request" : "2.3.0",
"underscore" : "1.5.2"
"request": "2.3.0",
"underscore": "1.5.2",
"qs": "^2.2.4",
"bluebird": "^2.3.4",
"superagent": "^0.19.0"
},
"devDependencies" : {
"mocha" : "1.16.1",
"should" : "2.1.1",
"nock" : "0.27.0"
"devDependencies": {
"mocha": "1.16.1",
"should": "2.1.1",
"nock": "0.27.0"
}
}

@@ -8,4 +8,2 @@ ## coinbase-node

Currently only supports API Key based access.
## Installation

@@ -15,18 +13,44 @@

## Example
## Initialization
var Coinbase = require("coinbase-node");
var client = new Coinbase.Client({
api_key: process.env.COINBASE_API_KEY
});
const coinbase = new CoinbaseClient({
apiKey: process.env.COINBASE_API_KEY,
secret: process.env.COINBASE_SECRET
});
function callback(err, resp, body){
console.log(body);
}
client.send_money('1G2UULb1M3hbB2b4Kt5v3E1R6Pc2XNW756','0.01', callack);
### Send Money
The above code will send 0.01 bitcoins to the bitcoin address listed.
coinbase.sendMoney({
to: 'me@stevenzeiler.com',
amount: 1.5,
note: 'Payment for Services'
})
.then(function(transaction) {
// do something with new transaction
})
.error(function(error) {
// handle error
});
### Get Transaction
coinbase.getTransaction({
id: 12345
})
.then(function(transaction) {
// do something with new transaction
})
.error(function(error) {
// handle error
});
### List Transactions
coinbase.listTransactions()
.then(function(transaction) {
// do something with new transactions
})
.error(function(error) {
// handle error
});

@@ -1,10 +0,55 @@

var Coinbase = require('../lib/coinbase.js');
const CoinbaseClient = require(__dirname + '/../lib/client.js');
const assert = require('assert');
var client = new Coinbase.Client({
api_key: process.env.COINBASE_API_KEY
const client = new CoinbaseClient({
apiKey: process.env.COINBASE_API_KEY,
secret: process.env.COINBASE_SECRET_KEY
});
client.send_money('1PeStttm97H3twHfqpWRmAGAjWRWuYnxQn','0.001', function(err, data){
console.log(data);
console.log(err);
describe('Coinbase Node Service', function () {
it('should make a request to Coinbase to send money and log the response or error', function (done) {
client.sendMoney({
transaction: {
to: '',
amount: ''
}
})
.then(function(transactions) {
console.log(transactions);
done();
})
.error(function(error) {
console.log('ERROR', error);
assert(false);
done();
});
});
it('should make a request to Coinbase to see transaction details and log the response or error', function (done) {
client.show({id: ''})
.then(function(transaction) {
console.log(transaction);
done();
})
.error(function(error) {
console.log('ERROR', error);
assert(false);
done();
});
});
it('should make a request to Coinbase to see all transactions and log the response or error', function (done) {
client.list()
.then(function(transactions) {
console.log(transactions);
done();
})
.error(function(error) {
console.log('ERROR', error);
assert(false);
done();
});
});
});
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