@primuslabs/fund-js-sdk 0.1.1 → 0.1.2

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.
package/dist/index.js CHANGED
@@ -125,7 +125,8 @@ var Contract = class {
125
125
  resolve(txreceipt);
126
126
  } catch (error) {
127
127
  console.log("sendTransaction error:", error);
128
- if (error?.code === "ACTION_REJECTED") {
128
+ const errStr = error?.toString()?.toLowerCase() || "";
129
+ if (error?.code === "ACTION_REJECTED" || errStr.indexOf("user rejected") > -1 || errStr.indexOf("approval denied") > -1) {
129
130
  return reject("user rejected transaction");
130
131
  }
131
132
  if (error?.reason) {
@@ -134,6 +135,7 @@ var Contract = class {
134
135
  if (error?.data?.message === "insufficient balance") {
135
136
  return reject(error?.data?.message);
136
137
  }
138
+ return reject(error);
137
139
  }
138
140
  });
139
141
  }
package/dist/index.mjs CHANGED
@@ -101,7 +101,8 @@ var Contract = class {
101
101
  resolve(txreceipt);
102
102
  } catch (error) {
103
103
  console.log("sendTransaction error:", error);
104
- if (error?.code === "ACTION_REJECTED") {
104
+ const errStr = error?.toString()?.toLowerCase() || "";
105
+ if (error?.code === "ACTION_REJECTED" || errStr.indexOf("user rejected") > -1 || errStr.indexOf("approval denied") > -1) {
105
106
  return reject("user rejected transaction");
106
107
  }
107
108
  if (error?.reason) {
@@ -110,6 +111,7 @@ var Contract = class {
110
111
  if (error?.data?.message === "insufficient balance") {
111
112
  return reject(error?.data?.message);
112
113
  }
114
+ return reject(error);
113
115
  }
114
116
  });
115
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primuslabs/fund-js-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "author": "Primus Labs <dev@primuslabs.org>",
5
5
  "description": "Primus fund js sdk",
6
6
  "repository": {