@morpho-dev/router 0.3.0 → 0.4.1

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.
Files changed (40) hide show
  1. package/README.md +67 -71
  2. package/dist/cli.js +3209 -1252
  3. package/dist/drizzle/migrations/0017_dusty_the_hunter.sql +1 -0
  4. package/dist/drizzle/migrations/0018_add_chain_collector_constraints.sql +3 -0
  5. package/dist/drizzle/migrations/0019_add-obligation-units-shares.sql +2 -0
  6. package/dist/drizzle/migrations/0020_add-session.sql +1 -0
  7. package/dist/drizzle/migrations/0021_drop_chain_collector_epoch_indexes.sql +2 -0
  8. package/dist/drizzle/migrations/0021_migrate-rate-to-price.sql +15 -0
  9. package/dist/drizzle/migrations/0022_consolidate-price.sql +15 -0
  10. package/dist/drizzle/migrations/meta/0017_snapshot.json +1525 -0
  11. package/dist/drizzle/migrations/meta/0018_snapshot.json +1572 -0
  12. package/dist/drizzle/migrations/meta/0019_snapshot.json +1586 -0
  13. package/dist/drizzle/migrations/meta/_journal.json +42 -0
  14. package/dist/evm/bytecode/erc20.txt +1 -0
  15. package/dist/evm/bytecode/factory.txt +1 -0
  16. package/dist/evm/bytecode/mempool.txt +1 -0
  17. package/dist/evm/bytecode/morpho.txt +1 -0
  18. package/dist/evm/bytecode/multicall3.txt +1 -0
  19. package/dist/evm/bytecode/oracle.txt +1 -0
  20. package/dist/evm/bytecode/terms.txt +1 -0
  21. package/dist/evm/bytecode/vault.txt +1 -0
  22. package/dist/evm/bytecode/vaultV1.txt +1 -0
  23. package/dist/index.browser.d.mts +1327 -816
  24. package/dist/index.browser.d.mts.map +1 -1
  25. package/dist/index.browser.d.ts +1358 -847
  26. package/dist/index.browser.d.ts.map +1 -1
  27. package/dist/index.browser.js +2209 -1668
  28. package/dist/index.browser.js.map +1 -1
  29. package/dist/index.browser.mjs +2173 -1632
  30. package/dist/index.browser.mjs.map +1 -1
  31. package/dist/index.node.d.mts +1885 -1222
  32. package/dist/index.node.d.mts.map +1 -1
  33. package/dist/index.node.d.ts +1885 -1222
  34. package/dist/index.node.d.ts.map +1 -1
  35. package/dist/index.node.js +1984 -1016
  36. package/dist/index.node.js.map +1 -1
  37. package/dist/index.node.mjs +1963 -1014
  38. package/dist/index.node.mjs.map +1 -1
  39. package/docs/integrator.md +78 -0
  40. package/package.json +11 -5
@@ -0,0 +1 @@
1
+ ALTER TABLE "router_v1.6"."offers" DROP COLUMN "nonce";
@@ -0,0 +1,3 @@
1
+ CREATE UNIQUE INDEX "chains_chain_id_idx" ON "router_v1.6"."chains" USING btree ("chain_id");--> statement-breakpoint
2
+ CREATE UNIQUE INDEX "collectors_chain_name_idx" ON "router_v1.6"."collectors" USING btree ("chain_id","name");--> statement-breakpoint
3
+ ALTER TABLE "router_v1.6"."collectors" ADD CONSTRAINT "collectors_chain_id_chains_chain_id_fk" FOREIGN KEY ("chain_id") REFERENCES "router_v1.6"."chains"("chain_id") ON DELETE no action ON UPDATE no action;
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "router_v1.6"."offers" ADD COLUMN "obligation_units" numeric(78, 0) DEFAULT '0' NOT NULL;--> statement-breakpoint
2
+ ALTER TABLE "router_v1.6"."offers" ADD COLUMN "obligation_shares" numeric(78, 0) DEFAULT '0' NOT NULL;
@@ -0,0 +1 @@
1
+ ALTER TABLE "router_v1.6"."offers" ADD COLUMN "session" varchar(66) NOT NULL DEFAULT '0x0000000000000000000000000000000000000000000000000000000000000000';
@@ -0,0 +1,2 @@
1
+ DROP INDEX IF EXISTS "router_v1.6"."collectors_chain_name_epoch_idx";--> statement-breakpoint
2
+ DROP INDEX IF EXISTS "router_v1.6"."chains_id_epoch_idx";--> statement-breakpoint
@@ -0,0 +1,15 @@
1
+ -- Add new columns start_price and expiry_price
2
+ ALTER TABLE "router_v1.6"."offers"
3
+ ADD COLUMN "start_price" numeric(78, 0),
4
+ ADD COLUMN "expiry_price" numeric(78, 0);--> statement-breakpoint
5
+ -- Migrate data from rate to start_price and expiry_price
6
+ UPDATE "router_v1.6"."offers" SET start_price = rate, expiry_price = rate;--> statement-breakpoint
7
+ -- Make columns NOT NULL after migration
8
+ ALTER TABLE "router_v1.6"."offers"
9
+ ALTER COLUMN "start_price" SET NOT NULL,
10
+ ALTER COLUMN "expiry_price" SET NOT NULL;--> statement-breakpoint
11
+ -- Drop the old rate column
12
+ ALTER TABLE "router_v1.6"."offers" DROP COLUMN "rate";--> statement-breakpoint
13
+ -- Drop rate-based indexes (can't index computed values)
14
+ DROP INDEX IF EXISTS "router_v1.6"."offers_group_winner_sell_side_idx";--> statement-breakpoint
15
+ DROP INDEX IF EXISTS "router_v1.6"."offers_group_winner_buy_side_idx";
@@ -0,0 +1,15 @@
1
+ -- Consolidate start_price and expiry_price into single price column
2
+ -- Since offers now have a constant price (no linear interpolation), we only need one column
3
+
4
+ -- Add new price column
5
+ ALTER TABLE "router_v1.6"."offers" ADD COLUMN "price" numeric(78, 0);--> statement-breakpoint
6
+
7
+ -- Migrate data: copy start_price to price (they should be equal, use start_price as canonical)
8
+ UPDATE "router_v1.6"."offers" SET price = start_price;--> statement-breakpoint
9
+
10
+ -- Make price NOT NULL after migration
11
+ ALTER TABLE "router_v1.6"."offers" ALTER COLUMN "price" SET NOT NULL;--> statement-breakpoint
12
+
13
+ -- Drop the old columns
14
+ ALTER TABLE "router_v1.6"."offers" DROP COLUMN "start_price";--> statement-breakpoint
15
+ ALTER TABLE "router_v1.6"."offers" DROP COLUMN "expiry_price";