Manager (V3)
Connecting to Manager V3
Using Wagmi
import { connectManagerV3, getContractAddresses, Chain } from "yieldfi-sdk";
import { ethers } from "ethers";
import { useAccount, useWalletClient } from "wagmi";
import ManagerV3ABI from "yieldfi-sdk/abis/v3/Manager.json";
function ManagerV3Example() {
const { address } = useAccount();
const { data: walletClient } = useWalletClient();
const connectManager = async () => {
if (!walletClient || !address) {
throw new Error("Wallet not connected");
}
const provider = new ethers.BrowserProvider(walletClient);
const signer = await provider.getSigner();
const contracts = getContractAddresses(Chain.ETHEREUM);
const managerV3 = connectManagerV3(
contracts.manager,
ManagerV3ABI,
signer
);
return managerV3;
};
}Using Browser Provider
Common Operations
Deposit Assets
Request Redemption
Cancel Redemption
Process Redemption (Operator Only)
View Functions
Get Redemption Queue Length
Get Redemption Queue Entry
Get Standard Debt
Get NAV
Check Whitelisting
Get Vault Asset
Type Safety
Complete Example
Using Wagmi
Using Browser Provider
Last updated