@morpho-dev/router 0.6.0 → 0.7.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.
@@ -14,7 +14,7 @@ To run these checks and validate your offers, call **`POST /v1/validate`**. If v
14
14
 
15
15
  ## Discover supported rules
16
16
 
17
- The router publishes configured rules (maturities, callbacks, and loan tokens) by chain. These rules are enforced by the gatekeeper when validating offers.
17
+ The router publishes configured rules (maturities, loan tokens, and oracles) by chain. These rules are enforced by the gatekeeper when validating offers.
18
18
 
19
19
  Call **`GET /v1/config/rules`** to retrieve the current rules (with pagination). Use the `types` and `chains` query params to filter which rules are returned. The response includes `meta.checksum` so integrators can detect updates.
20
20
 
@@ -43,13 +43,12 @@ The router computes `takeable = min(availableLiquidity, offerRemaining)`.
43
43
 
44
44
  A **callback** is the on-chain "liquidity source" used during settlement: it tells the protocol *where* to pull assets from (e.g., the maker’s wallet, or a specific vault position) when the offer is filled. Callbacks are extremely flexible, but that flexibility also means the router cannot reliably compute takeability for arbitrary callback logic.
45
45
 
46
- To keep takeability deterministic and indexable, the router only supports a **whitelist** of callback formats with well-defined semantics:
46
+ To keep takeability deterministic and indexable, the router only supports **empty callbacks** with well-defined semantics:
47
47
 
48
- - **Buy with empty callback (`0x`)** (`BuyWithEmptyCallback`): source the buy-side liquidity from the makers ERC20 balance/allowance.
49
- - **Buy with Vault V1 callback** (`BuyVaultV1Callback`): source the buy-side liquidity from specific Vault V1 positions listed in the callback data (and registered in the router’s allowed vault factories).
50
- - **Sell with ERC20 callback** (`SellERC20Callback`): source the sell-side collateral from ERC20 collateral contracts listed in the callback data (must match the offer’s `collaterals`).
48
+ - **Buy with empty callback** (`BuyWithEmptyCallback`): source the buy-side liquidity from the maker's ERC20 balance/allowance. The callback address is the zero address and data is `0x`.
49
+ - **Sell with empty callback** (`SellWithEmptyCallback`): sell-side offers with empty callback data. The callback address is the zero address and data is `0x`.
51
50
 
52
- In practice, the router indexes the underlying source (wallet balances/allowances, Vault V1 positions, etc.) and caps the offer by what is actually available. If an offer uses a non-whitelisted callback address or an unsupported callback shape, it may still be valid on-chain, but it will be rejected by the routers gatekeeper (see **`POST /v1/validate`**).
51
+ In practice, the router indexes the underlying source (wallet balances/allowances) and caps the offer by what is actually available. If an offer uses a non-empty callback (non-zero address or non-`0x` data), it will be rejected by the router's gatekeeper (see **`POST /v1/validate`**).
53
52
 
54
53
  If `availableLiquidity = 0`, the offer is **not** treated as invalid. The offer remains indexed, but it is returned with `takeable = 0` (and therefore will not be executed by router consumers).
55
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morpho-dev/router",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Router package for Morpho protocol",
5
5
  "type": "module",
6
6
  "license": "MIT",