@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 +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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
|
}
|