npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ballin-coinbase-api

v0.0.1

Published

Nodejs coinbase api

Downloads

5

Readme

##Coinbase

Coinbase's api details here

Installation

$ npm install ballin-coinbase-api

Require coinbase

var coinbase = require('ballin-coinbase-api');

Usage

Account

GET /api/v1/account/balance

Get the user's account balance in BTC.

coinbase.account.balance(accessToken, function(err, balance){
    console.log(balance);
});
GET /api/v1/account/receive_address

Get the user's current bitcoin receive address.

coinbase.account.receiveAddress(accessToken, function(err, address){
    console.log(address); 
});
GET /api/v1/account/generate_receive_address

Generates a new bitcoin receive address for the user.

coinbase.account.generateReceiveAddress(accessToken, function(err, address){
    console.log(address);
});

Buttons

POST /api/v1/buttons

Create a new payment button, page, or iFrame.

var param = {
    "button": {
        "name": "test",
        "type": "buy_now",
        "price_string": "1.23",
        "price_currency_iso": "USD",
        "custom": "Order123",
        "callback_url": "http://www.example.com/my_custom_button_callback",
        "description": "Sample description",
        "type": "buy_now",
        "style": "custom_large",
        "include_email": true
    }
}

coinbase.buttons.create(accessToken, param, function(err, button){
   console.log(button); 
});

Buys

POST /api/v1/buys

Purchase bitcoin by debiting your U.S. bank account.

var param = {
    {
        "qty": 1
    }
}

coinbase.buy(accessToken, param, function(err, buy){
    console.log(buy);
});

Contacts

GET /api/v1/contacts

List emails the user has previously used for autocompletion.

coinbase.contacts(accessToken, function(err, contacts){
    console.log(contacts);
});

Currencies

GET /api/v1/currencies

Show currencies supported by Coinbase.

coinbase.currencies.list(accessToken, function(err, currencies){
    console.log(currencies);
});
GET /api/v1/currencies/exchange_rates

Show exchange rates between BTC and other currencies.

coinbase.currencies.exchangeRates(function(err, rates){
    console.log(rates);
});

Orders

GET /api/v1/orders

List merchant orders received.

coinbase.orders.list(accessToken, function(err, orders){
    console.log(orders);
});
GET /api/v1/orders/:id

Show an individual merchant order.

coinbase.orders.get(accessToken, id, function(err, order){
    console.log(order);
});

Prices

GET /api/v1/prices/spot_rate

Get the spot price of bitcoin.

coinbase.spotRate(function(err, spotRate){
    console.log(spotRate);
});

Transactions

GET /api/v1/transactions

List a user's recent transactions.

coinbase.transactions.list(accessToken, param, function(err, transactions){
    console.log(transactions);
});
GET /api/v1/transactions/:id

Show details for an individual transaction.

coinbase.transactions.get(accessToken, id, function(err, transaction){
    console.log(transaction);
});
POST /api/v1/transactions/send_money

Send bitcoins to an email address or bitcoin address.

var transaction = {
    "transaction": {
        "to": "[email protected]",
        "amount": "1.234",
        "notes": "Sample transaction for you"
    }
}
coinbase.transactions.sendMoney(accessToken, transaction, function(err, data){
    console.log(data);
});
POST /api/v1/transactions/request_money

Send an invoice/money request to an email address.

var transaction = {
        "transaction": {
        "from": "[email protected]",
        "amount": "1.234",
        "notes": "Sample transaction for you"
    }
}
coinbase.transactions.requestMoney(accessToken, transaction, function(err, data){
    console.log(data);
});
PUT /api/v1/transactions/:id/resend_request

Resend emails for a money request.

coinbase.transactions.resendRequest(accessToken, id, function(err, data){
    console.log(data);
});
DELETE /api/v1/transactions/:id/cancel_request

Cancel a money request.

coinbase.transactions.cancelRequest(accessToken, id, function(err, data){
    console.log(data);
});

Transfers

GET /api/v1/transfers

List a user's recent buys and sells.

coinbase.transfers.list(accessToken, function(err, transfers){
    console.log(transfers);
});

Users

GET /api/v1/users

Show current user with account settings.

coinbase.users.account(accessToken, function(err, account){
    console.log(account);
});