Skip to main content

Built and signed on GitHub Actions

Coinbase Exchange (institutional) client, written in TypeScript for Deno/Bun.

This package works with Deno, Bun
This package works with Deno
This package works with Bun
JSR Score
76%
Published
6 days ago (0.3.5)

Gravitywell / Coinbase

JSR continuous integration codecov Maintainability

Coinbase Exchange (institutional) client, written in TypeScript for Deno/Bun.

Currently, the only dependencies are @std/encoding and npm:dotenv but this library may evolve to include more helpful stuff in the future. Ergonomics and correctness are prioritized over minimal purity. A good example, that is being considered, is npm:decimal.js.

WARNING: The public API may change before v1. Breaking changes will effect minor versions. Pinning to a patch version is fine for non-breaking changes.

Installation

Deno: deno add @gravity/coinbase

Bun: bunx jsr add @gravity/coinbase

Usage

Note that this package does not export a JS bundle or TypeScript definition files. It is intended to be used in environments that can use TypeScript natively; such as Deno and Bun. There is no planned support for bundling or other environments.

import { Coinbase } from '@gravity/coinbase'

/**
 * Initialization will automatically pick up auth variables set in the
 * environment (through a `.env` file or otherwise) based on these keys:
 * `COINBASE_API_KEY`, `COINBASE_API_SECRET`, `COINBASE_API_PASSPHRASE`
 *
 * Supplying a configuration manually will override any environment configs.
 */
const coinbase = new Coinbase()

// Use resources to interact with the REST API.
const currencies = await coinbase.currencies.all()

REST Progress (Documentation)

Module Status
Auth (Reference)
Errors (Reference)
Accounts
--- Get all accounts for a profile
--- Get a single account by id
--- Get a single account's holds
--- Get a single account's ledger
--- Get a single account's transfers
Address Book
--- Get address book
--- Add addresses
--- Delete address
Coinbase Accounts
--- Get all Coinbase wallets
--- Generate crypto address
Conversions
--- Convert currency
--- Get conversion fee rates
--- Get a conversion
Currencies
--- Get all known currencies
--- Get a currency
Transfers
--- Deposit from Coinbase account
--- Deposit from payment method
--- Get all payment methods
--- Get all transfers
--- Get a single transfer
--- Submit travel information for a transfer
--- Withdraw to Coinbase account
--- Withdraw to crypto address
--- Get fee estimate for crypto withdrawal
--- Withdraw to payment method
Fees
--- Get fees
Orders
--- Get all fills
--- Get all orders
--- Cancel all orders
--- Create a new order
--- Get single order
--- Cancel an order
Loans
--- List loans
--- List loan assets
--- Get all interest summaries
--- Get a single loan's interest rate history
--- Get a single loan's interest charges
--- Get lending overview
--- Get new loan preview
--- Open new loan
--- List new loan options
--- Repay loan interest
--- Repay loan principal
--- Get principal repayment preview
Coinbase Price Oracle
--- Get signed prices
Products
--- Get all known trading pairs
--- Get all product volume
--- Get single product
--- Get product book
--- Get product candles
--- Get product stats
--- Get product ticker
--- Get product trades
Profiles
--- Get profiles
--- Create a profile
--- Transfer funds between profiles
--- Get profile by id
--- Rename a profile
--- Delete a profile
Reports
--- Get all reports
--- Create a report
--- Get a report
Travel Rules
--- Get all travel rule information
--- Create travel rule entry
--- Delete existing travel rule entry
Users
--- Get user exchange limits
--- Update settlement preference
--- Get user trading volumes
Wrapped Assets
--- Get all wrapped assets
--- Get all stake-wraps
--- Create a new stake-wrap
--- Get a single stake-wrap
--- Get wrapped asset details
--- Get wrapped asset conversion rate

WebSocket Channel Progress (Documentation)

Module Status
Auth (Reference)
Errors (Reference)
Heartbeat (Reference)
Status (Reference)
Auction (Reference)
Matches (Reference)
RFQ Matches (Reference)
Ticker (Reference)
Ticker Batch (Reference)
Full (Reference)
--- Received
--- Open
--- Done
--- Match
--- Change
--- Activate
User (Reference)
Level2 (Reference)
Level2 Batch (Reference)
Level3 (Reference)
Balance (Reference)

License

this library is provided under the Mozilla Public License 2.0.

A copy of the MPLv2 is included license.md file for convenience.

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @gravity/coinbase

Import symbol

import * as mod from "@gravity/coinbase/";

Add Package

bunx jsr add @gravity/coinbase

Import symbol

import * as mod from "@gravity/coinbase/";