VyToken (Legacy)
Connecting to VyToken
Using Wagmi
import { connectVyToken, getContractAddresses, Chain } from "yieldfi-sdk";
import { ethers } from "ethers";
import { useAccount, useWalletClient } from "wagmi";
function VyTokenExample() {
const { address } = useAccount();
const { data: walletClient } = useWalletClient();
const connectVyTokenContract = 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 vyUSD = connectVyToken(
contracts.vyUSD,
vyTokenAbi, // Your VyToken ABI
signer
);
return vyUSD;
};
}Using Browser Provider
VyToken-Specific Operations
Deposit YToken
View Methods
Inherited Operations
Migration to V3
Last updated