ERC20 plugin for Goat. Allows you to create tools for transferring and getting the balance of ERC20 tokens.
npm install @goat-sdk/plugin-erc20
yarn add @goat-sdk/plugin-erc20
pnpm add @goat-sdk/plugin-erc20
import { erc20 } from "@goat-sdk/plugin-erc20";
const plugin = erc20({
tokens: [USDC, PEPE],
});
import { erc20 } from "@goat-sdk/plugin-erc20";
const plugin = erc20({
tokens: [
USDC,
{
decimals: 18,
symbol: "SHIB",
name: "Shiba Inu",
chains: {
"1": {
contractAddress: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
},
},
},
],
});
- Get token info by symbol
- Get balance
- Transfer
- Approve
- Get allowance
- Total supply
- Revoke approval
- Convert to base unit
- Convert from base unit