Quick Start
This section provides a quick start guide for common use cases, including checking allowances, setting up wallet clients, providing approvals, signing permits, and creating positions.
Check Token Allowance
const tokenAllowance = await DZapDcaClient.getAllowance({
account: /* Your account address */,
chainId: 42161, // arbitrum
fromToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDC
});Set Up Wallet Client
Use walletClient as per the viem library's requirements.
import { createWalletClient, custom } from 'viem';
import { arbitrum } from 'viem/chains';
const client = createWalletClient({
chain: arbitrum,
transport: custom(window.ethereum),
});Provide Approval
const approvalResponse = await DZapDcaClient.approve({
account: /* Your account address */,
chainId: 42161,
fromToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
walletClient: client,
amount: maxUint256, // Defaults to max amount
});Sign Permit
Create a Position
Last updated