For the complete documentation index, see llms.txt. This page is also available as Markdown.

Redemption script

You can use this script to redeem gMON for MON at any time, subject to Monad withdrawal time: https://gist.github.com/0xMeir/89ebe112b413931cf9b45056cdf832d6

This script includes four functions to cover the entire Redemption life cycle.

getPendingRedeemShares

export async function getPendingRedeemShares(
  config: Config,
  magmaAddress: Address,
  controller: Address,
  owner: Address,
)

Get the amount of pending redeem shares for a given owner. Pending means the redeem request has been created but is not yet claimable.

getClaimableRedeem

export async function getClaimableRedeem(
  config: Config,
  magmaAddress: Address,
  controller: Address,
  owner: Address,
)

Get how much the user can currently redeem, both in shares and assets (MON or WMON equivalent).

requestRedeem

Initiate a redeem request for a given amount of shares. This creates or updates the user’s redeem position on the Magma contract.

claimRedeem

Claim an existing redeem request without explicitly passing the requestId.

Last updated