getMarket
Retrieves detailed information about a specific Moonwell lending market.
This function allows you to query market data using either:
- Chain ID and market address
- Network name and market identifier
Usage
example.ts
import { moonwellClient } from './client'
const market = await moonwellClient.getMarket({
chainId: 8453,
marketAddress: "0x628ff693426583D9a7FB391E54366292F509D457",
});
Returns
Example
Loading example...
Market | undefined
- Type:
Market
Parameters
chainId
- Type:
number
The chain ID where the market is located.
const market = await moonwellClient.getMarket({
chainId: 8453,
marketAddress: "0x628ff693426583D9a7FB391E54366292F509D457",
});
marketAddress
- Type:
Address
The address of the market.
const market = await moonwellClient.getMarket({
chainId: 8453,
marketAddress: "0x628ff693426583D9a7FB391E54366292F509D457",
});
network
- Type:
string
The network where the market is located.
import { base } from "@moonwell-fi/moonwell-sdk/environments";
const market = await moonwellClient.getMarket<typeof base>({
network: "base",
market: "MOONWELL_ETH",
});
market
- Type:
string
The name of the market.
import { base } from "@moonwell-fi/moonwell-sdk/environments";
const market = await moonwellClient.getMarket<typeof base>({
network: "base",
market: "MOONWELL_ETH",
});