@morpho-dev/router 0.0.19 → 0.0.20
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.browser.js +6 -7
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +6 -7
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.js +6 -7
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +6 -7
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.browser.js
CHANGED
|
@@ -5,6 +5,7 @@ var chains$1 = require('viem/chains');
|
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
var v4 = require('zod/v4');
|
|
7
7
|
var zodOpenapi = require('zod-openapi');
|
|
8
|
+
var jsBase64 = require('js-base64');
|
|
8
9
|
|
|
9
10
|
var __defProp = Object.defineProperty;
|
|
10
11
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -157,8 +158,6 @@ function* batch(array, batchSize) {
|
|
|
157
158
|
yield array.slice(i, i + batchSize);
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
|
-
|
|
161
|
-
// src/utils/cursor.ts
|
|
162
161
|
function validateCursor(cursor) {
|
|
163
162
|
if (!cursor || typeof cursor !== "object") {
|
|
164
163
|
throw new Error("Cursor must be an object");
|
|
@@ -229,11 +228,11 @@ function validateCursor(cursor) {
|
|
|
229
228
|
return true;
|
|
230
229
|
}
|
|
231
230
|
function encodeCursor(c) {
|
|
232
|
-
return
|
|
231
|
+
return jsBase64.Base64.encodeURL(JSON.stringify(c));
|
|
233
232
|
}
|
|
234
233
|
function decodeCursor(token) {
|
|
235
234
|
if (!token) return null;
|
|
236
|
-
const decoded = JSON.parse(
|
|
235
|
+
const decoded = JSON.parse(jsBase64.Base64.decode(token));
|
|
237
236
|
validateCursor(decoded);
|
|
238
237
|
return decoded;
|
|
239
238
|
}
|
|
@@ -986,12 +985,12 @@ async function getApi(config, url) {
|
|
|
986
985
|
const pathname = url.pathname;
|
|
987
986
|
let action;
|
|
988
987
|
switch (true) {
|
|
989
|
-
case pathname.includes("/v1/offers"):
|
|
990
|
-
action = "get_offers";
|
|
991
|
-
break;
|
|
992
988
|
case pathname.includes("/v1/offers/match"):
|
|
993
989
|
action = "match_offers";
|
|
994
990
|
break;
|
|
991
|
+
case pathname.includes("/v1/offers"):
|
|
992
|
+
action = "get_offers";
|
|
993
|
+
break;
|
|
995
994
|
default:
|
|
996
995
|
throw new HttpGetOffersFailedError("Unknown endpoint", {
|
|
997
996
|
details: `Unsupported path: ${pathname}`
|