New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

binance-futures-connector

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binance-futures-connector - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "binance-futures-connector",
"version": "1.0.2",
"version": "1.0.3",
"description": "币安合约sdk持续更新,欢迎PR一起完善。",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -26,44 +26,2 @@ const { validateRequiredParameters } = require('../helpers/validation.js')

/**
* 获取交易规则和交易对 NONE
* @param {*} options
*
* {@link https://binance-docs.github.io/apidocs/futures/cn/#3f1907847c}
*/
exchangeInfo(options = {}) {
return this.publicRequest(
'GET',
'/fapi/v1/exchangeInfo',
options
)
}
/**
* 获取服务器时间
* @param {*} options
* {@link https://binance-docs.github.io/apidocs/futures/cn/#3f1907847c}
*/
time(options = {}) {
return this.publicRequest(
'GET',
'/fapi/v1/time',
options
)
}
/**
* 获取交易对价格
* {@link https://binance-docs.github.io/apidocs/futures/cn/#8ff46b58de}
* @param {*} symbol
* @param {*} options
* @returns
*/
price(options = {}) {
// symbol = symbol + "USDT";
return this.publicRequest(
'GET',
'/fapi/v1/ticker/price',
options
)
}
/**
* 延长listenKey有效期 (USER_STREAM)<br>

@@ -128,18 +86,2 @@ *

}
/**
* 获取交易对深度
* @param {*} symbol
* @param {*} options
* @returns
*/
getDepth(symbol, options = {}) {
validateRequiredParameters({ symbol })
return this.signRequest(
'GET',
'/fapi/v1/depth',
Object.assign(options, {
symbol: symbol
})
)
}

@@ -146,0 +88,0 @@ /**

@@ -10,2 +10,148 @@ const { validateRequiredParameters } = require('../helpers/validation.js')

/**
* 测试服务器连通性 PING
* @param {*} options
* @returns
*/
ping(options = {}) {
return this.publicRequest(
'GET',
'/fapi/v1/ping',
options
)
}
/**
* 获取服务器时间
* @param {*} options
* {@link https://binance-docs.github.io/apidocs/futures/cn/#3f1907847c}
*/
time(options = {}) {
return this.publicRequest(
'GET',
'/fapi/v1/time',
options
)
}
/**
* 获取交易规则和交易对 NONE
* @param {*} options
*
* {@link https://binance-docs.github.io/apidocs/futures/cn/#3f1907847c}
*/
exchangeInfo(options = {}) {
return this.publicRequest(
'GET',
'/fapi/v1/exchangeInfo',
options
)
}
/**
* 获取交易对深度
* @param {*} symbol
* @param {*} options
* @returns
*/
depth(symbol, options = {}) {
validateRequiredParameters({ symbol })
return this.signRequest(
'GET',
'/fapi/v1/depth',
Object.assign(options, {
symbol: symbol
})
)
}
/**
* 获取近期订单簿成交
* @param {*} options
*
* {@link https://binance-docs.github.io/apidocs/futures/cn/#38a975b802}
*/
trades(symbol, options = {}) {
validateRequiredParameters({ symbol })
return this.publicRequest(
'GET',
'/fapi/v1/trades',
Object.assign(options, {
symbol: symbol
})
)
}
/**
* 获取交易对价格
* {@link https://binance-docs.github.io/apidocs/futures/cn/#8ff46b58de}
* @param {*} symbol
* @param {*} options
* @returns
*/
price(options = {}) {
return this.publicRequest(
'GET',
'/fapi/v1/ticker/price',
options
)
}
/**
* 24hr价格变动情况
* @param {*} options
* @returns
*/
price24hr(options = {}) {
return this.publicRequest(
'GET',
'/fapi/v1/ticker/24hr',
options
)
}
/**
* K线数据 symbol STRING YES 交易对
interval ENUM YES 时间间隔
startTime LONG NO 起始时间
endTime LONG NO 结束时间
limit INT NO 默认值:500 最大值:1500.
* @param {*} symbol
* @param {*} interval
* @param {*} options
* @returns
*/
klines(symbol, interval, options = {}) {
validateRequiredParameters({ symbol, interval })
return this.publicRequest(
'GET',
'/fapi/v1/klines',
Object.assign(options, {
symbol: symbol,
interval: interval
})
)
}
/**
* 标记价格K线数据 symbol STRING YES 交易对
interval ENUM YES 时间间隔
startTime LONG NO 起始时间
endTime LONG NO 结束时间
limit INT NO 默认值:500 最大值:1500.
* @param {*} symbol
* @param {*} interval
* @param {*} options
* @returns
*/
markPriceKlines(symbol, interval, options = {}) {
validateRequiredParameters({ symbol, interval })
return this.publicRequest(
'GET',
'/fapi/v1/markPriceKlines',
Object.assign(options, {
symbol: symbol,
interval: interval
})
)
}
/**
* 最新标记价格和资金费率<br>

@@ -38,4 +184,132 @@ *

}
/**
* 获取未平仓合约数 symbol STRING YES 交易对
* @param {*} options
* @returns
*/
openInterest(options = {}) {
return this.signRequest(
'GET',
'/fapi/v1/openInterest',
options
)
}
/**
* 合约持仓量 symbol STRING YES
period ENUM YES "5m","15m","30m","1h","2h","4h","6h","12h","1d"
limit LONG NO default 30, max 500
startTime LONG NO
endTime LONG NO
* @param {*} symbol
* @param {*} period
* @param {*} options
* @returns
*/
openInterestHist(symbol, period, options = {}) {
validateRequiredParameters({ symbol, period })
return this.publicRequest(
'GET',
'/futures/data/openInterestHist',
Object.assign(options, {
symbol: symbol,
period: period
})
)
}
/**
* 大户账户数多空比 symbol STRING YES
period ENUM YES "5m","15m","30m","1h","2h","4h","6h","12h","1d"
limit LONG NO default 30, max 500
startTime LONG NO
endTime LONG NO
* @param {*} symbol
* @param {*} period
* @param {*} options
* @returns
*/
topLongShortAccountRatio(symbol, period, options = {}) {
validateRequiredParameters({ symbol, period })
return this.publicRequest(
'GET',
'/futures/data/topLongShortAccountRatio',
Object.assign(options, {
symbol: symbol,
period: period
})
)
}
/**
* 大户持仓量多空比 symbol STRING YES
period ENUM YES "5m","15m","30m","1h","2h","4h","6h","12h","1d"
limit LONG NO default 30, max 500
startTime LONG NO
endTime LONG NO
* @param {*} symbol
* @param {*} period
* @param {*} options
* @returns
*/
topLongShortPositionRatio(symbol, period, options = {}) {
validateRequiredParameters({ symbol, period })
return this.publicRequest(
'GET',
'/futures/data/topLongShortPositionRatio',
Object.assign(options, {
symbol: symbol,
period: period
})
)
}
/**
* 大户持仓量多空比 symbol STRING YES
period ENUM YES "5m","15m","30m","1h","2h","4h","6h","12h","1d"
limit LONG NO default 30, max 500
startTime LONG NO
endTime LONG NO
* @param {*} symbol
* @param {*} period
* @param {*} options
* @returns
*/
globalLongShortAccountRatio(symbol, period, options = {}) {
validateRequiredParameters({ symbol, period })
return this.publicRequest(
'GET',
'/futures/data/globalLongShortAccountRatio',
Object.assign(options, {
symbol: symbol,
period: period
})
)
}
/**
* 合约主动买卖量 symbol STRING YES
period ENUM YES "5m","15m","30m","1h","2h","4h","6h","12h","1d"
limit LONG NO default 30, max 500
startTime LONG NO
endTime LONG NO
* @param {*} symbol
* @param {*} period
* @param {*} options
* @returns
*/
takerlongshortRatio(symbol, period, options = {}) {
validateRequiredParameters({ symbol, period })
return this.publicRequest(
'GET',
'/futures/data/takerlongshortRatio',
Object.assign(options, {
symbol: symbol,
period: period
})
)
}
}
module.exports = MarketData
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc