web3agent-aof
Version:
AI Framework for Onchain Operations and DeFi Interactions
38 lines • 1.22 kB
JavaScript
import { agentExector } from './agent.js';
import { addLiquidity } from './mira/addLiquidity.js';
import { swapExactInput } from './mira/swap.js';
import { borrowAsset } from './swaylend/borrow.js';
import { supplyCollateral, } from './swaylend/supply.js';
import { transfer as walletTransfer, } from './transfers/transfers.js';
export class FuelAgent {
constructor() {
if (!process.env.OPENAI_API_KEY) {
throw new Error('OPENAI_API_KEY is not set');
}
if (!process.env.FUEL_WALLET_PRIVATE_KEY) {
throw new Error('FUEL_WALLET_PRIVATE_KEY is not set');
}
}
async execute(input) {
const response = await agentExector.invoke({
input,
});
return response;
}
async swapExactInput(params) {
return await swapExactInput(params);
}
async transfer(params) {
return await walletTransfer(params);
}
async supplyCollateral(params) {
return await supplyCollateral(params);
}
async borrowAsset(params) {
return await borrowAsset(params);
}
async addLiquidity(params) {
return await addLiquidity(params);
}
}
//# sourceMappingURL=FuelAgent.js.map