@morpho-dev/router 0.0.20 → 0.0.21

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.
@@ -1416,22 +1416,13 @@ function memory(parameters) {
1416
1416
  // src/RouterEvent.ts
1417
1417
  var RouterEvent_exports = {};
1418
1418
  __export(RouterEvent_exports, {
1419
- buildId: () => buildId,
1419
+ from: () => from2,
1420
1420
  types: () => types
1421
1421
  });
1422
1422
  var types = ["offer_created", "offer_matched", "offer_validation"];
1423
- function buildId(event) {
1424
- switch (event.type) {
1425
- case "offer_created":
1426
- return `offer_created:${event.offer.hash.toLowerCase()}`;
1427
- case "offer_matched":
1428
- return `offer_matched:${event.offer.hash.toLowerCase()}`;
1429
- case "offer_validation":
1430
- return `offer_validation:${event.offer.hash.toLowerCase()}`;
1431
- default: {
1432
- throw new Error("Unhandled event type");
1433
- }
1434
- }
1423
+ function from2(base) {
1424
+ const id = `${base.type}:${base.offer.hash.toLowerCase()}`;
1425
+ return { id, ...base };
1435
1426
  }
1436
1427
 
1437
1428
  // src/Validation.ts