Skip to content

Commit

Permalink
Merge pull request #60 from JJ-Cro/update11122024
Browse files Browse the repository at this point in the history
v1.0.6 feat(); added new Loan endpoints, updated types as per release notes, added examples for new endpoints
  • Loading branch information
tiagosiebler authored Dec 11, 2024
2 parents 4e07ef6 + dd8fceb commit 78e2216
Show file tree
Hide file tree
Showing 14 changed files with 515 additions and 413 deletions.
166 changes: 86 additions & 80 deletions docs/endpointFunctionList.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions examples/apidoc/CBExchangeClient/getAllConversions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { CBExchangeClient } = 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: /conversions
// METHOD: GET
// PUBLIC: NO

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

client.getAllConversions(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
20 changes: 20 additions & 0 deletions examples/apidoc/CBInternationalClient/acquireOrRepayLoan.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { CBInternationalClient } = 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/v1/portfolios/{portfolio}/loans/{asset}
// METHOD: POST
// PUBLIC: NO

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

client.acquireOrRepayLoan(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { CBInternationalClient } = 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/v1/portfolios/{portfolio}/loans
// METHOD: GET
// PUBLIC: NO

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

client.getActiveLoansForPortfolio(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { CBInternationalClient } = 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/v1/portfolios/{portfolio}/loans/{asset}
// METHOD: GET
// PUBLIC: NO

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

client.getLoanInfoForPortfolioAsset(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
20 changes: 20 additions & 0 deletions examples/apidoc/CBInternationalClient/getMaxLoanAvailability.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { CBInternationalClient } = 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/v1/portfolios/{portfolio}/loans/{asset}/availability
// METHOD: GET
// PUBLIC: NO

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

client.getMaxLoanAvailability(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
20 changes: 20 additions & 0 deletions examples/apidoc/CBInternationalClient/previewLoanUpdate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { CBInternationalClient } = 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/v1/portfolios/{portfolio}/loans/{asset}/preview
// METHOD: POST
// PUBLIC: NO

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

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

0 comments on commit 78e2216

Please sign in to comment.