binance-futures-connector
Advanced tools
Sorry, the diff of this file is not supported yet
+2
-2
| { | ||
| "name": "binance-futures-connector", | ||
| "version": "1.1.7", | ||
| "description": "币安-合约+现货-sdk,持续更新,欢迎PR一起完善,微信:wkc19891", | ||
| "version": "1.1.8", | ||
| "description": "binance-futures-connector 币安-合约+现货-sdk,持续更新,欢迎PR一起完善。微信:wkc19891", | ||
| "main": "src/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
+12
-2
| # binance-futures-connector in nodejs | ||
| > 币安-合约+现货-sdk,持续更新,欢迎PR一起完善,微信:wkc19891 | ||
| > tg:wkc19891 | ||
| > 币安-合约+现货-sdk,持续更新,欢迎PR一起完善 | ||
| > 策略定制联系 | ||
| > tg:wkc19891 微信:wkc19891 | ||
| ``` | ||
| 币安 返佣注册链接 实时返20% | ||
| https://accounts.binance.me/zh-CN/register?ref=JGLH0SR8 | ||
| 币安 返佣注册链接 月返 30% | ||
| https://accounts.binance.me/zh-CN/register?ref=48730146 | ||
| ``` | ||
| [](https://badge.fury.io/js/%40binance%2Fconnector) | ||
@@ -7,0 +17,0 @@ [](http://nodejs.org/download/) |
+67
-0
@@ -15,2 +15,3 @@ module.exports.Future = require('./future') | ||
| module.exports.Sleep = sleep | ||
| const { LocalStorage } = require("node-localstorage") | ||
@@ -49,1 +50,67 @@ let _g = new LocalStorage('./_G'); | ||
| function DateFormat(time = '') { | ||
| let myDate = '' | ||
| if (time == '') { | ||
| myDate = new Date; | ||
| } else { | ||
| myDate = new Date(time); | ||
| } | ||
| let year = myDate.getFullYear(); | ||
| let mon = myDate.getMonth() + 1; | ||
| if (mon < 10) { | ||
| mon = "0" + mon; | ||
| } | ||
| let date = myDate.getDate(); | ||
| if (date < 10) { | ||
| date = "0" + date; | ||
| } | ||
| let hours = myDate.getHours(); | ||
| if (hours < 10) { | ||
| hours = "0" + hours; | ||
| } | ||
| let minutes = myDate.getMinutes(); | ||
| if (minutes < 10) { | ||
| minutes = "0" + minutes; | ||
| } | ||
| let seconds = myDate.getSeconds(); | ||
| if (seconds < 10) { | ||
| seconds = "0" + seconds; | ||
| } | ||
| let now = year + "-" + mon + "-" + date + " " + hours + ":" + minutes + ":" + seconds; | ||
| return now; | ||
| } | ||
| module.exports.DateFormat = DateFormat | ||
| let logProfit = new LocalStorage('./_LogProfit'); | ||
| /** | ||
| * 持久化存储 | ||
| * @param {*} key | ||
| * @param {*} value | ||
| * @returns | ||
| */ | ||
| function LogProfit(value = '') { | ||
| if (value == null) { | ||
| logProfit.setItem('_LogProfit', null) | ||
| } else if (value == '') { | ||
| return JSON.parse(logProfit.getItem('_LogProfit')) | ||
| } else { | ||
| try { | ||
| value = Number(value) == NaN ? 0 : Number(value) | ||
| let pft = logProfit.getItem('_LogProfit') | ||
| if (pft == null) { | ||
| let arry = []; | ||
| arry.push({ income: value, time: DateFormat() }) | ||
| logProfit.setItem('_LogProfit', JSON.stringify(arry)) | ||
| } else { | ||
| pft = JSON.parse(pft) | ||
| pft.push({ income: value, time: DateFormat() }) | ||
| logProfit.setItem('_LogProfit', JSON.stringify(pft)) | ||
| } | ||
| } catch { | ||
| logProfit.setItem('_LogProfit', null) | ||
| } | ||
| } | ||
| } | ||
| module.exports.LogProfit = LogProfit |
+25
-18
@@ -1,2 +0,2 @@ | ||
| const { Future, TA, Sleep, _G, _N } = require('../index') | ||
| const { Future, TA, Sleep, _G, _N, LogProfit, DateFormat } = require('../index') | ||
@@ -17,21 +17,28 @@ const apiKey = '' | ||
| async function p() { | ||
| for (let i = 0; i < 100; i++) { | ||
| LogProfit(i + 1000) | ||
| console.log(LogProfit()) | ||
| await Sleep(2000) | ||
| } | ||
| // LogProfit(null) | ||
| // console.log(LogProfit()) | ||
| //== | ||
| console.log(_N(1234567.8978432, 3)) | ||
| console.log(_N('999887.54699', 3)) | ||
| console.log(_N('9x9887.54699', 3)) | ||
| //== | ||
| let name = _G('guo'); | ||
| console.log(name) | ||
| if (name == null) { | ||
| _G('guo', 666) | ||
| } | ||
| console.log(_G('guo')) | ||
| _G('guo1', JSON.stringify({ name: 'top', age: 18 })) | ||
| console.log(_G('guo1'), JSON.parse(_G('guo1'))) | ||
| // console.log(_N(1234567.8978432, 3)) | ||
| // console.log(_N('999887.54699', 3)) | ||
| // console.log(_N('9x9887.54699', 3)) | ||
| // //== | ||
| // let name = _G('guo'); | ||
| // console.log(name) | ||
| // if (name == null) { | ||
| // _G('guo', 666) | ||
| // } | ||
| // console.log(_G('guo')) | ||
| // _G('guo1', JSON.stringify({ name: 'top', age: 18 })) | ||
| // console.log(_G('guo1'), JSON.parse(_G('guo1'))) | ||
| //== | ||
| for (let i = 0; i < 10; i++) { | ||
| await Sleep(5000) | ||
| console.log(i) | ||
| } | ||
| // //== | ||
| // for (let i = 0; i < 10; i++) { | ||
| // await Sleep(5000) | ||
| // console.log(i) | ||
| // } | ||
| } | ||
@@ -38,0 +45,0 @@ p(); |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
248739
2.28%50
2.04%7051
1%282
3.68%