Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
06-26-2017, 05:41 AM | #1 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 54,875
|
my code for creating btc addresses
I use this for my coinbase (this only works with coinbase api) use it the list all btc addresses in account, create a new address, list buy and sell prices, hopefully this is useful to someone .
node module coinbase needs to be installed. Code:
#!/usr/bin/node var Client = require('coinbase').Client; var client = new Client({ 'apiKey': 'apikeyhere', 'apiSecret': 'apisecrethere' }); var btcaccount = 'accountidhere'; if (process.argv.length <= 2) { console.log("usage: btc buyprice|sellprice|list|create"); process.exit(-1); } switch (process.argv[2]) { case 'buyprice': client.getBuyPrice({'currencyPair': 'BTC-USD'}, function(err, price) { console.log('$' + price.data.amount); }); break; case 'sellprice': client.getSellPrice({'currencyPair': 'BTC-USD'}, function(err, price) { console.log('$' + price.data.amount); }); break; case 'create': client.getAccount(btcaccount, function(err, account) { account.createAddress(null, function(err, address) { console.log(address.address); }); }); break; case 'list': client.getAccount(btcaccount, function(err, account) { account.getAddresses(null, function(err, addresses) { addresses.forEach(function(item) { console.log(item.address) }) }); }); break; default: console.log('Not a Valid Command'); }
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. WP Tube Themes |
|
|||||||
Bookmarks |