coinbase-node
Advanced tools
Comparing version 0.0.5 to 0.1.0
{ | ||
"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(); | ||
}); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
6546
174
55
5
5
1
+ Addedbluebird@^2.3.4
+ Addedqs@^2.2.4
+ Addedsuperagent@^0.19.0
+ Addedasync@0.9.2(transitive)
+ Addedbluebird@2.11.0(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addedcomponent-emitter@1.1.2(transitive)
+ Addedcookiejar@2.0.1(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@1.0.5(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addedextend@1.2.1(transitive)
+ Addedform-data@0.1.3(transitive)
+ Addedformidable@1.0.14(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedmethods@1.0.1(transitive)
+ Addedmime@1.2.11(transitive)
+ Addedms@2.0.0(transitive)
+ Addedqs@1.2.02.4.2(transitive)
+ Addedreadable-stream@1.0.27-1(transitive)
+ Addedreduce-component@1.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedsuperagent@0.19.1(transitive)