-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from JJ-Cro/update11122024
v1.0.6 feat(); added new Loan endpoints, updated types as per release notes, added examples for new endpoints
- Loading branch information
Showing
14 changed files
with
515 additions
and
413 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
examples/apidoc/CBInternationalClient/acquireOrRepayLoan.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/CBInternationalClient/getActiveLoansForPortfolio.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/CBInternationalClient/getLoanInfoForPortfolioAsset.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
examples/apidoc/CBInternationalClient/getMaxLoanAvailability.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
examples/apidoc/CBInternationalClient/previewLoanUpdate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
Oops, something went wrong.