0.0.6 • Published 8 months ago
@goat-sdk/plugin-curves v0.0.6
Curves GOAT Plugin
Installation
npm install @goat-sdk/plugin-curves
yarn add @goat-sdk/plugin-curves
pnpm add @goat-sdk/plugin-curvesUsage
Basic Setup
import { viem } from "@goat-sdk/wallet-viem";
import { curves } from "@goat-sdk/plugin-curves";
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
// Create a wallet client
const walletClient = createWalletClient({
account: account,
transport: http(process.env.RPC_PROVIDER_URL),
chain: base,
});
const tools = await getOnChainTools({
wallet: viem(walletClient),
plugins: [
curves(),
],
});
// Or with custom curves address and abi
const tools2 = await getOnChainTools({
wallet: viem(walletClient),
plugins: [
curves({
address: YOUR_CURVES_ADDRESS,
abi: YOUR_CUSTOM_ABI
}),
],
});Tools
When using with Goat SDK, the following tools are available:
buy_curves_token: Buy curves tokensget_buy_curves_token: Get curves token buy pricesell_curves_token: Sell curves tokensget_sell_curves_token: Get curves token sell priceget_curves_erc20: Get ERC20 token informationget_curves_balance: Get curves token balancewithdraw_curves: Withdraw to ERC20 tokensdeposit_curves: Deposit from ERC20 tokensmint_curves_erc20: Set name and symbol for your ERC20 token and mint it
Each tool handles parameter validation and provides clear error messages.