Installations
npm install coinbase-pro-node-api
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=16.15.0
Node Version
16.15.1
NPM Version
8.13.1
Score
71.9
Supply Chain
99.4
Quality
76
Maintenance
100
Vulnerability
80.9
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (99.86%)
Shell (0.14%)
Developer
Download Statistics
Total Downloads
8,604
Last Day
1
Last Week
1
Last Month
6
Last Year
579
GitHub Statistics
5 Stars
403 Commits
3 Forks
2 Watching
2 Branches
3 Contributors
Sponsor this package
Package Meta Information
Latest Version
4.0.1
Package Id
coinbase-pro-node-api@4.0.1
Unpacked Size
83.82 kB
Size
24.17 kB
File Count
14
NPM Version
8.13.1
Node Version
16.15.1
Total Downloads
Cumulative downloads
Total Downloads
8,604
Last day
0%
1
Compared to previous day
Last week
-66.7%
1
Compared to previous week
Last month
-81.8%
6
Compared to previous month
Last year
-88%
579
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
coinbase-pro-node-api
Node.js library for Coinbase Pro
Installation
1npm install coinbase-pro-node-api
Usage
PublicClient
1import { PublicClient } from "coinbase-pro-node-api"; 2const sandbox = true; 3const client = new PublicClient({ sandbox });
1const products = await client.getProducts();
1const product_id = "ETH-BTC"; 2const product = await client.getProduct({ product_id });
1const level = 2; 2const book = await client.getOrderBook({ level });
1const product_id = "ETH-BTC"; 2const ticker = await client.getTicker({ product_id });
1const product_id = "ETH-BTC"; 2const limit = 10; 3const after = 74; 4const trades = await client.getTrades({ product_id, limit, after });
1const product_id = "ETH-BTC"; 2const end = "2019-11-12T16:40:00-0500"; 3const start = "2019-11-12T16:37:00-0500"; 4const granularity = 60; 5const candles = await client.getHistoricRates({ 6 product_id, 7 end, 8 start, 9 granularity, 10});
1const product_id = "ETH-BTC"; 2const stats = await client.get24hrStats({ product_id });
1const currencies = await client.getCurrencies();
1const id = "BTC"; 2const currency = await client.getCurrency({ id });
1const time = await client.getTime();
AuthenticatedClient
1import { AuthenticatedClient } from "coinbase-pro-node-api"; 2const key = "CoinbaseProAPIKey"; 3const secret = "CoinbaseProAPISecret"; 4const passphrase = "CoinbaseProAPIPassphrase"; 5const client = new AuthenticatedClient({ key, secret, passphrase });
1const accounts = await client.getAccounts();
1const account_id = "71452118-efc7-4cc4-8780-a5e22d4baa53"; 2const account = await client.getAccount({ account_id });
1const account_id = "71452118-efc7-4cc4-8780-a5e22d4baa53"; 2const after = "100"; 3const limit = 5; 4const history = await client.getAccountHistory({ account_id, after, limit });
1const account_id = "71452118-efc7-4cc4-8780-a5e22d4baa53"; 2const after = "2019-11-22T14:33:58.093436Z"; 3const before = "2019-11-21T14:33:58.093436Z"; 4const limit = 40; 5const holds = await client.getHolds({ account_id, after, before, limit });
1const client_oid = "71452118-efc7-4cc4-8780-a5e22d4baa53"; 2const type = "limit"; 3const side = "buy"; 4const product_id = "BTC-USD"; 5const stp = "cb"; 6const price = 10000; 7const size = 1; 8const post_only = true; 9const cancel_after = "hour"; 10const order = await client.placeOrder({ 11 client_oid, 12 type, 13 side, 14 product_id, 15 stp, 16 price, 17 size, 18 post_only, 19 cancel_after, 20});
1const id = "71452118-efc7-4cc4-8780-a5e22d4baa53"; 2let result = await client.cancelOrder({ id }); 3// or by `client_oid` 4const client_oid = "5523db2a-f6cb-4680-86a5-23ff21d9f514"; 5result = await client.cancelOrder({ client_oid });
1const product_id = "BTC-USD"; 2const result = await client.cancelAll({ product_id });
1const limit = 2; 2const after = "2019-09-29T19:16:37.991967Z"; 3const status = ["done", "rejected"]; 4const product_id = "BTC-USD"; 5const orders = await client.getOrders({ after, product_id, limit, status });
1const id = "71452118-efc7-4cc4-8780-a5e22d4baa53"; 2let order = await client.getOrder({ id }); 3// or by `client_oid` 4const client_oid = "5523db2a-f6cb-4680-86a5-23ff21d9f514"; 5order = await client.getOrder({ client_oid });
1const product_id = "BTC-ETH"; 2const before = 74; 3const fills = await client.getFills({ product_id, before });
1const amount = 10000; 2const currency = "USD"; 3const payment_method_id = "bc677162-d934-5f1a-968c-a496b1c1270b"; 4const deposit = await client.deposit({ amount, currency, payment_method_id });
1const amount = 10; 2const currency = "BTC"; 3const coinbase_account_id = "c13cd0fc-72ca-55e9-843b-b84ef628c198"; 4const deposit = await client.depositCoinbase({ 5 amount, 6 currency, 7 coinbase_account_id, 8});
1const amount = 10000; 2const currency = "USD"; 3const payment_method_id = "bc677162-d934-5f1a-968c-a496b1c1270b"; 4const withdraw = await client.withdraw({ amount, currency, payment_method_id });
1const amount = 10; 2const currency = "BTC"; 3const coinbase_account_id = "c13cd0fc-72ca-55e9-843b-b84ef628c198"; 4const withdraw = await client.withdrawCoinbase({ 5 amount, 6 currency, 7 coinbase_account_id, 8});
1const amount = 20000; 2const currency = "XRP"; 3const crypto_address = "r4hzEbkVkAaFyK23ZkgED2LZDAyHTfnBJg"; 4const no_destination_tag = true; 5const withdraw = await client.withdrawCrypto({ 6 amount, 7 currency, 8 crypto_address, 9 no_destination_tag, 10});
1const currency = "ETH"; 2const crypto_address = "0x5ad5769cd04681FeD900BCE3DDc877B50E83d469"; 3const estimate = await client.feeEstimate({ currency, crypto_address });
1const amount = 100; 2const from = "USD"; 3const to = "USDC"; 4const conversion = await client.convert({ amount, from, to });
1const methods = await client.getPaymentMethods();
1const accounts = await client.getCoinbaseAccounts();
1const fees = await client.getFees();
1const type = "fills"; 2const start_date = "2019-01-01T00:00:00.000Z"; 3const end_date = "2019-11-30T23:59:59.000Z"; 4const report = await client.createReport({ type, start_date, end_date });
1const id = "0428b97b-bec1-429e-a94c-59232926778d"; 2const report = await client.getReport({ id });
1const profiles = await client.getProfiles();
1const id = "86602c68-306a-4500-ac73-4ce56a91d83c"; 2const profile = await client.getProfile({ id });
1const from = "86602c68-306a-4500-ac73-4ce56a91d83c"; 2const to = "e87429d3-f0a7-4f28-8dff-8dd93d383de1"; 3const currency = "ETH"; 4const amount = 100; 5const result = await client.transfer({ from, to, currency, amount });
1const volume = await client.getTrailingVolume();
WebsocketClient
1import { WebsocketClient } from "coinbase-pro-node-api"; 2const sandbox = false; 3const key = "CoinbaseProAPIKey"; 4const secret = "CoinbaseProAPISecret"; 5const passphrase = "CoinbaseProAPIPassphrase"; 6const channels = [ 7 { name: "status" }, 8 { name: "ticker", product_ids: ["BTC-USD"] }, 9]; 10const websocket = new WebsocketClient({ 11 key, 12 secret, 13 passphrase, 14 channels, 15 sandbox, 16});
1await websocket.connect();
1await websocket.disconnect();
1const channels = [ 2 { name: "heartbeat", product_ids: ["ETH-USD"] }, 3 { name: "ticker", product_ids: ["ETH-EUR"] }, 4 { name: "status" }, 5]; 6await websocket.subscribe({ channels });
1const channels = [{ name: "ticker", product_ids: ["ETH-USD", "ETH-EUR"] }]; 2await websocket.unsubscribe({ channels });
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:95: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/coinbase-pro/ci.yml/main?enable=pin
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 3 out of 3 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 28 are checked with a SAST tool
Reason
13 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-vp56-6g26-6827
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-f9xv-q969-pqx4
Score
2.8
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More