Skip to content

Commit

Permalink
Merge pull request #55 from JJ-Cro/Update151024
Browse files Browse the repository at this point in the history
Feat(): added examples, updated endpoint map
  • Loading branch information
tiagosiebler authored Oct 16, 2024
2 parents a6c7c2c + ca36b38 commit 5ce1690
Show file tree
Hide file tree
Showing 244 changed files with 5,325 additions and 242 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Updated & performant JavaScript & Node.js SDK for the Coinbase REST APIs and Web

- Issues? Check the [issues tab](https://github.com/tiagosiebler/coinbase-api/issues).
- Discuss & collaborate with other node devs? Join our [Node.js Algo Traders](https://t.me/nodetraders) engineering community on telegram.
- Follow our announcement channel for real-time updates on [X/Twitter](https://x.com/QuantSDKs)

<!-- template_related_projects -->

Expand Down
484 changes: 242 additions & 242 deletions docs/endpointFunctionList.md

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/allocatePortfolio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/intx/allocate
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L583

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.allocatePortfolio(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/cancelOrders.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/orders/batch_cancel
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L223

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.cancelOrders(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/cancelPendingFuturesSweep.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/cfm/sweeps
// METHOD: DELETE
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L567

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.cancelPendingFuturesSweep(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/closePosition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/orders/close_position
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L335

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.closePosition(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/commitConvertTrade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/convert/trade/{trade_id}
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L716

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.commitConvertTrade(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/createPortfolio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/portfolios
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L368

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.createPortfolio(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/deletePortfolio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/portfolios/{portfolio_uuid}
// METHOD: DELETE
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L411

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.deletePortfolio(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getAccount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/accounts/{account_id}
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L99

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getAccount(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getAccounts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/accounts
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L85

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getAccounts(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getApiKeyPermissions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/key_permissions
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L850

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getApiKeyPermissions(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getBestBidAsk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/best_bid_ask
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L116

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getBestBidAsk(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getConvertTrade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/convert/trade/{trade_id}
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L699

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getConvertTrade(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getCurrentMarginWindow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/cfm/intraday/current_margin_window
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L494

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getCurrentMarginWindow(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getFills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/orders/historical/fills
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L291

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getFills(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getFuturesBalanceSummary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/cfm/balance_summary
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L453

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getFuturesBalanceSummary(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getFuturesPosition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/cfm/positions/{product_id}
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L520

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getFuturesPosition(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/CBAdvancedTradeClient/getFuturesPositions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { CBAdvancedTradeClient } = require('coinbase-api');

// This example shows how to call this coinbase API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "coinbase-api" for coinbase exchange
// This coinbase API SDK is available on npm via "npm install coinbase-api"
// ENDPOINT: /api/v3/brokerage/cfm/positions
// METHOD: GET
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/coinbase-api/blob/master/src/CBAdvancedTradeClient.ts#L511

const client = new CBAdvancedTradeClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getFuturesPositions(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Loading

0 comments on commit 5ce1690

Please sign in to comment.