yhtx 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -80,7 +80,11 @@ async function call(path, { apiKey, secret, data, method, recvWindow } = {}) {
80
80
  } else if (dt?.status == "error") {
81
81
  if (dt?.["err-code"] == "api-signature-not-valid") {
82
82
  console.log("api bug2: null"); ////{status: 'error','err-code': 'api-signature-not-valid','err-msg': 'Signature not valid: Verification failure [校验失败]',data:null}
83
- } else if (dt?.err_code == 403) console.log("api bug3: undefined"); //{status:"error",err_code:403,err_msg:"Verification failure [校验失败]",ts:1758854139970};
83
+ } else if (dt?.err_code == 403) {
84
+ console.log("api bug3: undefined"); //{status:"error",err_code:403,err_msg:"Verification failure [校验失败]",ts:1758854139970};
85
+ } else if (dt?.["err-msg"] == "Format Error: account-id") {
86
+ console.log("api bug(accId): null"); //{status: 'error','err-code': 'validation-format-error','err-msg': 'Format Error: account-id.',data:null}
87
+ } else console.log(dt);
84
88
  } else if (dt?.message == "Verification failure [校验失败]" && dt?.code == 1003) {
85
89
  console.log("api bug4: undefined"); //{ message: 'Verification failure [校验失败]', code: 1003, success: false }
86
90
  } else if (dt?.message == "Verification failure" && dt?.code == 12008) {
@@ -91,7 +95,9 @@ async function call(path, { apiKey, secret, data, method, recvWindow } = {}) {
91
95
 
92
96
  let rs = r.data.data;
93
97
  if (rs == null && dt?.status == "error") {
94
- rs = r.data; //eg rs={status:"error","err-code":"dw-withdraw-precision-limit","err-msg":"withdraw amount precision cannot be greater than 6",data:null}
98
+ if (dt?.["err-msg"] != "Format Error: account-id") {
99
+ rs = r.data; //eg rs={status:"error","err-code":"dw-withdraw-precision-limit","err-msg":"withdraw amount precision cannot be greater than 6",data:null}
100
+ }
95
101
  } else if (rs == undefined) {
96
102
  if (![dt?.err_msg, dt?.message].includes("Verification failure [校验失败]")) {
97
103
  rs = r.data; //eg rs={message:'The account API interface queried is empty',code:40237,success:false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yhtx",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "HTX API",
5
5
  "main": "index.js",
6
6
  "scripts": {