MorphoApi
Defined in: protocol-lending-morpho-evm/src/api.ts:49
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MorphoApi(
endpoint?,fetchImpl?):MorphoApi
Defined in: protocol-lending-morpho-evm/src/api.ts:50
Parameters
Section titled “Parameters”endpoint?
Section titled “endpoint?”string = MORPHO_API
fetchImpl?
Section titled “fetchImpl?”{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }
Returns
Section titled “Returns”MorphoApi
Methods
Section titled “Methods”listMarkets()
Section titled “listMarkets()”listMarkets(
o):Promise<ApiMarket[]>
Defined in: protocol-lending-morpho-evm/src/api.ts:123
Listed Blue markets on a chain, optionally filtered by loan / collateral token, biggest first.
Parameters
Section titled “Parameters”chainId
Section titled “chainId”number
collateralToken?
Section titled “collateralToken?”`0x${string}`
first?
Section titled “first?”number
loanToken?
Section titled “loanToken?”`0x${string}`
Returns
Section titled “Returns”Promise<ApiMarket[]>
listVaults()
Section titled “listVaults()”listVaults(
o):Promise<ApiVault[]>
Defined in: protocol-lending-morpho-evm/src/api.ts:79
Listed vaults on a chain (both generations), optionally for one deposit asset, biggest first.
Parameters
Section titled “Parameters”asset?
Section titled “asset?”`0x${string}`
chainId
Section titled “chainId”number
first?
Section titled “first?”number
version?
Section titled “version?”"v1" | "v2"
Returns
Section titled “Returns”Promise<ApiVault[]>
marketById()
Section titled “marketById()”marketById(
id,chainId):Promise<ApiMarket|null>
Defined in: protocol-lending-morpho-evm/src/api.ts:134
Parameters
Section titled “Parameters”`0x${string}`
chainId
Section titled “chainId”number
Returns
Section titled “Returns”Promise<ApiMarket | null>
vault()
Section titled “vault()”vault(
address,chainId):Promise<ApiVault|null>
Defined in: protocol-lending-morpho-evm/src/api.ts:99
One vault by address, whichever generation it is; null when the API does not know it.
Parameters
Section titled “Parameters”address
Section titled “address”`0x${string}`
chainId
Section titled “chainId”number
Returns
Section titled “Returns”Promise<ApiVault | null>