import { StarknetTool } from '@snakagent/core';
import {
borrowTroveSchema,
collateralActionSchema,
getTroveHealthSchema,
getUserTrovesSchema,
openTroveSchema,
repayTroveSchema,
} from '../schemas/index.js';
import { openTrove } from '../actions/openTrove.js';
import {
getBorrowFee,
getTroveHealth,
getUserTroves,
} from '../actions/getters.js';
import { depositTrove } from '../actions/depositTrove.js';
import { withdrawTrove } from '../actions/withdrawTrove.js';
import { borrowTrove } from '../actions/borrowTrove.js';
import { repayTrove } from '../actions/repayTrove.js';
export const registerTools = (SnakToolRegistry: StarknetTool[]) => {
SnakToolRegistry.push({
name: 'open_trove',
plugins: 'opus',
description: 'Open a Trove on Opus',
schema: openTroveSchema,
execute: openTrove,
});
SnakToolRegistry.push({
name: 'get_user_troves',
plugins: 'opus',
description: 'Get trove IDs for an address on Opus',
schema: getUserTrovesSchema,
execute: getUserTroves,
});
SnakToolRegistry.push({
name: 'get_trove_health',
plugins: 'opus',
description: 'Get the health of a trove on Opus',
schema: getTroveHealthSchema,
execute: getTroveHealth,
});
SnakToolRegistry.push({
name: 'get_borrow_fee',
plugins: 'opus',
description: 'Get the current borrow fee for Opus',
execute: getBorrowFee,
});
SnakToolRegistry.push({
name: 'deposit_trove',
plugins: 'opus',
description: 'Deposit collateral to a Trove on Opus',
schema: collateralActionSchema,
execute: depositTrove,
});
SnakToolRegistry.push({
name: 'withdraw_trove',
plugins: 'opus',
description: 'Withdraw collateral from a Trove on Opus',
schema: collateralActionSchema,
execute: withdrawTrove,
});
SnakToolRegistry.push({
name: 'borrow_trove',
plugins: 'opus',
description: 'Borrow CASH for a Trove on Opus',
schema: borrowTroveSchema,
execute: borrowTrove,
});
SnakToolRegistry.push({
name: 'repay_trove',
plugins: 'opus',
description: 'Repay CASH for a Trove on Opus',
schema: repayTroveSchema,
execute: repayTrove,
});
};