UNPKG

kiban-agent-kit

Version:

Open-source framework connecting AI agents to Katana ecosystem protocols

54 lines (53 loc) 1.49 kB
import { PublicClient, WalletClient, Address, Hash, Chain } from "viem"; export interface TokenTools { checkToken(tokenAddressOrSymbol: string): Promise<TokenInfo>; sendTokens(params: SendTokenParams): Promise<Hash>; approveSpending(params: ApproveParams): Promise<Hash>; getTokenMetadata(tokenAddress: string): Promise<TokenMetadata>; getAllowance(params: AllowanceParams): Promise<bigint>; waitForTransaction(hash: Hash): Promise<TransactionResult>; } export interface TokenInfo { address: Address; name: string; symbol: string; decimals: number; balance: string; balanceRaw: bigint; } export interface TokenMetadata { name: string; symbol: string; decimals: number; totalSupply: bigint; } export interface SendTokenParams { token: string; to: string; amount: string; options?: { slippageTolerance?: number; }; } export interface ApproveParams { token: string; spender: string; amount: string; } export interface AllowanceParams { token: string; owner: string; spender: string; } export interface TransactionResult { hash: Hash; wait: () => Promise<TransactionReceipt>; } export interface TransactionReceipt { status: "success" | "failure"; hash: Hash; blockNumber: bigint; gasUsed: bigint; } export declare function createTokenTools(publicClient: PublicClient, walletClient: WalletClient, chain: Chain): TokenTools; export * from "./service";