
Updated Node Binance API
!!! BE CAREFULL !!!
This project is a duplicate of node-binance-api library, I just added some new features that I needed for my personal project.
See ==> Node binance api project and docs : (https://npmjs.org/package/node-binance-api)
New features:
- Get Fiat deposit history (credit card / Cash balance)
- Get Stacking history
- Get Stacking position
- Get Flexible Stacking position
- Get NFT transaction history
This project is designed to help you make your own projects that interact with the Binance API. You can stream candlestick chart data, market depth, or use other advanced features such as setting stop losses and iceberg orders. This project seeks to have complete API coverage including WebSockets and then you can get the fiat deposit history and also the stacking history.
Installation: npm install -s updated-node-binance-api
Getting started
const Binance = require('updated-node-binance-api');
const binance = new Binance().options({
APIKEY: '<key>',
APISECRET: '<secret>'
});
Updated Node Binance API (new feature)
Getting Fiat deposit history
const params = { "transactionType": 0, "beginTime": 1514761200000, "endTime": 1675401553952 };
binance.fiatDepositHistory((error, data) => {
console.info(`My deposit history from ${params.beginTime} to ${params.endTime}: `, data);
}, params);
View Response
{
"code": "000000",
"message": "success",
"data": [
{
"orderNo": "11954f0208cf8987937da46ece761f6a",
"sourceAmount": "500.0",
"fiatCurrency": "EUR",
"obtainAmount": "0.43522778",
"cryptoCurrency": "ETH",
"totalFee": "0.0",
"price": "1146.53",
"status": "Completed",
"paymentMethod": "Cash Balance",
"createTime": 1672146583000,
"updateTime":1672146593000
},{
"orderNo": "f130a09ee0ef4e60b2692edf3c819dff",
"sourceAmount": "500.0",
"fiatCurrency": "USD",
"obtainAmount": "2.17998657",
"cryptoCurrency": "BNB",
"totalFee": "0.0",
"price": "229.359",
"status": "Completed",
"paymentMethod": "Credit Card",
"createTime": 1672146521000,
"updateTime": 1672146532000
},{
"orderNo": "N01285495125038081024110506",
"sourceAmount": "200.0",
"fiatCurrency": "EUR",
"obtainAmount": "188.61631353",
"cryptoCurrency": "BUSD",
"totalFee": "3.91",
"price": "1.01311491",
"status": "Failed",
"paymentMethod": "Credit Card",
"createTime": 1667681091000,
"updateTime": 1667681156386
}
],
"total": 3,
"success": true
}
Getting Stacking history
const params = { "product": "STACKING", "txnType": "INTEREST", "startTime": 1514761200000, "endTime": 1675401553952 };
binance.stackingHistory((error, data) => {
console.info(`My stacking history (${params.product} and ${params.txnType}) from ${params.startTime} to ${params.endTime}: `, data);
}, params);
View Response
[
{
amount: "0.0005223",
asset: "QTUM",
positionId: 137781268,
status: "SUCCESS",
time: 1675385706000
},{
amount: "0.001043",
asset: "BNB",
positionId: 137581268,
status: "SUCCESS",
time: 1675385706000
},{
amount: "0.0000112",
asset: "BTC",
positionId: 297781268,
status: "SUCCESS",
time: 1675385706000,
}
]
Getting Stacking position
const params = { "product": "STACKING", "txnType": "INTEREST", "startTime": 1514761200000, "endTime": 1675401553952 };
binance.stackingPosition((error, data) => {
console.info(`My stacking postion (${params.product} from ${params.startTime} to ${params.endTime}: `, data);
}, params);
View Response
[
{
"positionId":"123123",
"projectId": "Axs*90",
"asset":"AXS",
"amount":"122.09202928",
"purchaseTime": "1646182276000",
"duration": "60",
"accrualDays": "4",
"rewardAsset":"AXS",
"APY":"0.2032",
"rewardAmt": "5.17181528",
"extraRewardAsset":"BNB",
"extraRewardAPY":"0.0203",
"estExtraRewardAmt": "5.17181528",
"nextInterestPay": "1.29295383",
"nextInterestPayDate": "1646697600000",
"payInterestPeriod": "1",
"redeemAmountEarly": "2802.24068892",
"interestEndDate": "1651449600000",
"deliverDate": "1651536000000",
"redeemPeriod": "1",
"redeemingAmt":"232.2323",
"partialAmtDeliverDate":"1651536000000",
"canRedeemEarly": true,
"renewable":true,
"type":"AUTO",
"status": "HOLDING"
}
]
Getting Flexible Stacking position
const params = { "startTime": 1514761200000, "endTime": 1675401553952 };
binance.flexibleStackingPosition((error, data) => {
console.info(`My flexible stacking postion (from ${params.startTime} to ${params.endTime}: `, data);
}, params);
View Response
[
{
"tierAnnualInterestRate": {
"0-5BTC": 0.05,
"5-10BTC": 0.03,
">10BTC": 0.01
},
"annualInterestRate":"0.02599895",
"asset": "USDT",
"avgAnnualInterestRate": "0.02599895",
"canRedeem": true,
"dailyInterestRate": "0.00007123",
"freeAmount": "75.46000000",
"freezeAmount": "0.00000000",
"lockedAmount": "0.00000000",
"productId": "USDT001",
"productName": "USDT",
"redeemingAmount": "0.00000000",
"todayPurchasedAmount": "0.00000000",
"totalAmount": "75.46000000",
"totalInterest": "0.22759183"
}
]
Getting Nft Transaction history
const params = { "orderType": 3, "startTime": 1514761200000, "endTime": 1675401553952, page: 1 };
binance.nftTransactionHistory((error, data) => {
console.info(`My Nft Transaction history (for market order from ${params.startTime} to ${params.endTime}: `, data);
}, params);
View Response
{
"total": 2,
"list": [
{
"orderNo": "1_470502070600699904",
"tokens": [
{
"network": "BSC",
"tokenId": "216000000496",
"contractAddress": "MYSTERY_BOX0000087"
}
],
"tradeTime": 1626941236000,
"tradeAmount": "19.60000000",
"tradeCurrency": "BNB"
},
{
"orderNo": "1_488306442479116288",
"tokens": [
{
"network": "BSC",
"tokenId": "132900000007",
"contractAddress": "0xAf12111a592e408DAbC740849fcd5e68629D9fb6"
}
],
"tradeTime": 1631186130000,
"tradeAmount": "192.00000000",
"tradeCurrency": "BNB"
}
]
}
Contribution
- Give us a star :star:
- Fork and Clone! Awesome