
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@morpho-dev/router
Advanced tools
A TypeScript client to interact with the Morpho Router.
pnpm add @morpho-dev/router
import { RouterApi } from "@morpho-dev/router";
// Start a local router api on port 8081
await RouterApi.serve({ port: 8081 });
// Server will be available at http://localhost:8081
import { RouterApi } from "@morpho-dev/router";
// Create a router client
const router = RouterApi.connect();
// With custom URL
const router = RouterApi.connect({ url: "https://router.morpho.dev" });
// Connect to local server
const router = RouterApi.connect({ url: "http://localhost:8081" });
// Get all offers
const result = await router.get({});
// Get buy offers on Ethereum mainnet
const result = await router.get({ side: "buy", chains: [1], limit: 10 });
// Get offers with specific filters
const result = await router.get({
side: "sell",
chains: [1, 137],
loanTokens: ["0x1234567890123456789012345678901234567890"],
minAmount: 1000n,
maxAmount: 10000n,
minRate: 500000000000000000n,
maxRate: 1500000000000000000n,
sortBy: "rate",
sortOrder: "asc"
});
// Match offers for buy on Ethereum mainnet
const result = await router.match({ side: "buy", chainId: 1 });
// Match with specific requirements
const result = await router.match({
side: "sell",
chainId: 1,
rate: 1000000000000000000n,
loanToken: "0x1234567890123456789012345678901234567890",
collaterals: [
{
asset: "0x1234567890123456789012345678901234567890",
oracle: "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
lltv: 800000000000000000n
}
],
minMaturity: 1700000000,
maxMaturity: 1800000000
});
FAQs
Router package for Morpho protocol
The npm package @morpho-dev/router receives a total of 576 weekly downloads. As such, @morpho-dev/router popularity was classified as not popular.
We found that @morpho-dev/router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.