-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(): updated examples with new functions
- Loading branch information
Showing
109 changed files
with
2,801 additions
and
526 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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v1/sol-staking/sol/claim | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.claimSolBoostRewards(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/MainClient/getFlexibleLoanCollateralRepayRate.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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v2/loan/flexible/repay/rate | ||
// METHOD: GET | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.getFlexibleLoanCollateralRepayRate(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/MainClient/getFlexibleLoanLiquidationHistory.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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v2/loan/flexible/liquidation/history | ||
// METHOD: GET | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.getFlexibleLoanLiquidationHistory(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v1/sol-staking/sol/history/boostRewardsHistory | ||
// METHOD: GET | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.getSolBoostRewardsHistory(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v1/sol-staking/sol/history/unclaimedRewards | ||
// METHOD: GET | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.getSolUnclaimedRewards(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v1/portfolio/mint | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.mintPortfolioMarginBFUSD(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v1/portfolio/redeem | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.redeemPortfolioMarginBFUSD(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/MainClient/repayCryptoLoanFlexibleWithCollateral.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 { MainClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: sapi/v2/loan/flexible/repay/collateral | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
|
||
const client = new MainClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.repayCryptoLoanFlexibleWithCollateral(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/auto-collection | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.autoCollectFunds(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/PortfolioClient/cancelAllCMConditionalOrders.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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/cm/conditional/allOpenOrders | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllCMConditionalOrders(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/cm/allOpenOrders | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllCMOrders(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/margin/allOpenOrders | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllMarginOrders(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/PortfolioClient/cancelAllUMConditionalOrders.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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/um/conditional/allOpenOrders | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllUMConditionalOrders(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/um/allOpenOrders | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllUMOrders(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/PortfolioClient/cancelCMConditionalOrder.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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/cm/conditional/order | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelCMConditionalOrder(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/cm/order | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelCMOrder(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/margin/orderList | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelMarginOCO(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/margin/order | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelMarginOrder(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
20 changes: 20 additions & 0 deletions
20
examples/apidoc/PortfolioClient/cancelUMConditionalOrder.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 { PortfolioClient } = require('binance'); | ||
|
||
// This example shows how to call this Binance API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "binance" for Binance exchange | ||
// This Binance API SDK is available on npm via "npm install binance" | ||
// ENDPOINT: papi/v1/um/conditional/order | ||
// METHOD: DELETE | ||
// PUBLIC: NO | ||
|
||
const client = new PortfolioClient({ | ||
api_key: 'insert_api_key_here', | ||
api_secret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelUMConditionalOrder(params) | ||
.then((response) => { | ||
console.log(response); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
Oops, something went wrong.