getUserReward
Returns a user's reward for a specific market.
Usage
example.ts
import { moonwellClient } from './client'
const reward = await moonwellClient.getUserReward({
userAddress: "0x0000000000000000000000000000000000000000",
chainId: 8453,
marketAddress: "0x628ff693426583D9a7FB391E54366292F509D457",
});
Returns
Example
Loading example...
UserReward | undefined
- Type:
UserReward
Parameters
userAddress
- Type:
Address
The address of the user.
const reward = await moonwellClient.getUserReward({
userAddress: "0x0000000000000000000000000000000000000000",
chainId: 8453,
marketAddress: "0x628ff693426583D9a7FB391E54366292F509D457",
});
chainId
- Type:
number
The chain ID to get the reward for.
const reward = await moonwellClient.getUserReward({
userAddress: "0x0000000000000000000000000000000000000000",
chainId: 8453,
marketAddress: "0x628ff693426583D9a7FB391E54366292F509D457",
});
marketAddress
- Type:
Address
The address of the market.
const reward = await moonwellClient.getUserReward({
userAddress: "0x0000000000000000000000000000000000000000",
chainId: 8453,
marketAddress: "0x628ff693426583D9a7FB391E54366292F509D457",
});
network
- Type:
string
The network where the market is located.
import { base } from "@moonwell-fi/moonwell-sdk/environments";
const reward = await moonwellClient.getUserReward<typeof base>({
userAddress: "0x0000000000000000000000000000000000000000",
network: "base",
market: "MOONWELL_ETH",
});
market
- Type:
string
The name of the market.
import { base } from "@moonwell-fi/moonwell-sdk/environments";
const reward = await moonwellClient.getUserReward<typeof base>({
userAddress: "0x0000000000000000000000000000000000000000",
network: "base",
market: "MOONWELL_ETH",
});