hermes-swap 0.1.2 → 0.1.3

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
@@ -77,7 +77,6 @@ var Hermes = class {
77
77
  if (!wallet) {
78
78
  throw new Error(`Wallet not configured for chain: ${params.chain}`);
79
79
  }
80
- console.log(`params: ${JSON.stringify(params, (sanitizePricing, value) => typeof value === "bigint" ? value.toString() : value)}`);
81
80
  const response = await fetch(`${this.config.hermesSignalDomain}/api/v1/quote`, {
82
81
  method: "POST",
83
82
  headers: {
package/dist/esm/index.js CHANGED
@@ -84,11 +84,7 @@ var Hermes = /*#__PURE__*/function () {
84
84
  }
85
85
  throw new Error("Wallet not configured for chain: ".concat(params.chain));
86
86
  case 3:
87
- // 请求 hermesSignalDomain 下的 /api/v1/quote 接口,参数为 params
88
- console.log("params: ".concat(JSON.stringify(params, function (sanitizePricing, value) {
89
- return typeof value === 'bigint' ? value.toString() : value;
90
- })));
91
- _context.next = 6;
87
+ _context.next = 5;
92
88
  return fetch("".concat(this.config.hermesSignalDomain, "/api/v1/quote"), {
93
89
  method: 'POST',
94
90
  headers: {
@@ -98,26 +94,26 @@ var Hermes = /*#__PURE__*/function () {
98
94
  return typeof value === 'bigint' ? value.toString() : value;
99
95
  })
100
96
  });
101
- case 6:
97
+ case 5:
102
98
  response = _context.sent;
103
- _context.next = 9;
99
+ _context.next = 8;
104
100
  return response.json();
105
- case 9:
101
+ case 8:
106
102
  data = _context.sent;
107
103
  if (!(data.message && !data.amountOutWei)) {
108
- _context.next = 12;
104
+ _context.next = 11;
109
105
  break;
110
106
  }
111
107
  throw new Error("Hermes Signal API \u9519\u8BEF: ".concat(data.message));
112
- case 12:
108
+ case 11:
113
109
  if (data.amountOutWei) {
114
- _context.next = 14;
110
+ _context.next = 13;
115
111
  break;
116
112
  }
117
113
  throw new Error("Invalid response: amountOutWei is undefined. Response: ".concat(JSON.stringify(data)));
118
- case 14:
114
+ case 13:
119
115
  return _context.abrupt("return", BigInt(data.amountOutWei));
120
- case 15:
116
+ case 14:
121
117
  case "end":
122
118
  return _context.stop();
123
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-swap",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A TypeScript utility library for swap and bridge",
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",