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 +0 -1
- package/dist/esm/index.js +9 -13
- package/package.json +1 -1
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
|
-
|
|
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
|
|
97
|
+
case 5:
|
|
102
98
|
response = _context.sent;
|
|
103
|
-
_context.next =
|
|
99
|
+
_context.next = 8;
|
|
104
100
|
return response.json();
|
|
105
|
-
case
|
|
101
|
+
case 8:
|
|
106
102
|
data = _context.sent;
|
|
107
103
|
if (!(data.message && !data.amountOutWei)) {
|
|
108
|
-
_context.next =
|
|
104
|
+
_context.next = 11;
|
|
109
105
|
break;
|
|
110
106
|
}
|
|
111
107
|
throw new Error("Hermes Signal API \u9519\u8BEF: ".concat(data.message));
|
|
112
|
-
case
|
|
108
|
+
case 11:
|
|
113
109
|
if (data.amountOutWei) {
|
|
114
|
-
_context.next =
|
|
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
|
|
114
|
+
case 13:
|
|
119
115
|
return _context.abrupt("return", BigInt(data.amountOutWei));
|
|
120
|
-
case
|
|
116
|
+
case 14:
|
|
121
117
|
case "end":
|
|
122
118
|
return _context.stop();
|
|
123
119
|
}
|