Skip to content

getUserRewards

Returns all user rewards across Moonwell core and isolated markets.

Usage

example.ts
import { moonwellClient } from './client'
 
const rewards = await moonwellClient.getUserRewards({ 
  userAddress: "0x0000000000000000000000000000000000000000",
});

Returns

Example
Loading example...
UserReward[]

Parameters

userAddress

  • Type: Address

The address of the user.

const rewards = await moonwellClient.getUserRewards({
  userAddress: "0x0000000000000000000000000000000000000000", 
});

chainId (optional)

  • Type: number

The chain ID to get the rewards for.

const rewards = await moonwellClient.getUserRewards({
  userAddress: "0x0000000000000000000000000000000000000000",
  chainId: 8453, 
});

network (optional)

  • Type: string

The network to filter the markets by.

import { base } from "@moonwell-fi/moonwell-sdk/environments";
 
const rewards = await moonwellClient.getUserRewards<typeof base>({
  userAddress: "0x0000000000000000000000000000000000000000",
  network: "base"
})