Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.28 KB

币安小额资产转换.md

File metadata and controls

62 lines (46 loc) · 1.28 KB

Name

币安小额资产转换

Author

xunfeng91

Source (javascript)

//小额资产转换为BNB
function autoswaptobnb() {
    var ret = exchange.IO("api", "POST", "/sapi/v1/asset/dust-btc")
    Sleep(100)
    var dustarr = []

    for (var i = 0; i < ret.details.length; i++) {
        dustarr.push(ret.details[i].asset)
    }
    if (dustarr.length > 0) {
      Log("将进行小额资产转换", dustarr)
      var obj
      if (dustarr.length == 1) {
        obj = "asset=" + dustarr[0] + "&timestamp=" + new Date().getTime()
      }
      if (dustarr.length > 1) {
        obj = dustarr[0]
        for (var i = 1; i < dustarr.length; i++) {
          obj = obj + "," + dustarr[i]
        }
        //obj = obj + "&timestamp=" + new Date().getTime()
      }
      //var params = {
      //      "asset":obj,
      //     "timestamp":new Date().getTime()
      //      }
      var params = "asset=" + obj + "&timestamp=" + new Date().getTime()
      Log(params)
      var ret = exchange.IO("api", "POST", "/sapi/v1/asset/dust", "",params)
      Log("小额资产转换完成")
      Log(ret)
    }
  }
  
  function main() {
      autoswaptobnb()
  }

Detail

https://www.fmz.com/strategy/385533

Last Modified

2023-07-31 15:54:58