hermes-swap 0.1.4 → 0.1.5

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/cjs/index.js CHANGED
@@ -81,8 +81,8 @@ var Hermes = class {
81
81
  body: JSON.stringify(params, (sanitizePricing, value) => typeof value === "bigint" ? value.toString() : value)
82
82
  });
83
83
  const data = await response.json();
84
- if (data.message && !data.amountOutWei) {
85
- throw new Error(`Hermes Signal API 错误: ${data.message}`);
84
+ if (data.code && data.msg) {
85
+ throw new Error(`Hermes Signal API 错误 [${data.code}]: ${data.msg}`);
86
86
  }
87
87
  if (!data.amountOutWei) {
88
88
  throw new Error(`Invalid response: amountOutWei is undefined. Response: ${JSON.stringify(data)}`);
package/dist/esm/index.js CHANGED
@@ -93,11 +93,11 @@ var Hermes = /*#__PURE__*/function () {
93
93
  return response.json();
94
94
  case 5:
95
95
  data = _context.sent;
96
- if (!(data.message && !data.amountOutWei)) {
96
+ if (!(data.code && data.msg)) {
97
97
  _context.next = 8;
98
98
  break;
99
99
  }
100
- throw new Error("Hermes Signal API \u9519\u8BEF: ".concat(data.message));
100
+ throw new Error("Hermes Signal API \u9519\u8BEF [".concat(data.code, "]: ").concat(data.msg));
101
101
  case 8:
102
102
  if (data.amountOutWei) {
103
103
  _context.next = 10;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-swap",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "A TypeScript utility library for swap and bridge",
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",