UNPKG

kiban-agent-kit

Version:

Open-source framework connecting AI agents to Katana ecosystem protocols

57 lines (56 loc) 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TokenService = void 0; /** * Core token service for token-related operations */ class TokenService { constructor(agent) { this.agent = agent; } /** * Get information about a token */ async getTokenInfo(tokenAddress) { return this.agent.checkToken(tokenAddress); } /** * Send tokens (ETH or ERC20) */ async sendTokens(params) { const txHash = await this.agent.sendTokens(params); // We're just returning the hash here return { hash: txHash, }; } /** * Wait for a transaction to be confirmed */ async waitForTransaction(hash) { return this.agent.waitForTransaction(hash); } /** * Approve token spending */ async approveSpending(params) { const txHash = await this.agent.approveSpending(params); // We're just returning the hash here return { hash: txHash, }; } /** * Get token metadata */ async getTokenMetadata(tokenAddress) { return this.agent.getTokenMetadata(tokenAddress); } /** * Get token allowance */ async getAllowance(params) { return this.agent.getAllowance(params); } } exports.TokenService = TokenService;