Skip to content

Commit c1ec632

Browse files
committed
feat: update implementation
1 parent a169180 commit c1ec632

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

src/actions/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ import getSanctumApyAction from "./sanctum/getApy";
129129
import getSanctumTvlAction from "./sanctum/getTvl";
130130
import sanctumAddLiquidityAction from "./sanctum/addLiquidity";
131131
import sanctumRemoveLiquidityAction from "./sanctum/removeLiquidity";
132+
import sanctumGetOwnedLstAction from "./sanctum/getOwnedLst";
133+
import sanctumSwapLstAction from "./sanctum/swapLst";
132134

133135
export const ACTIONS = {
134136
GET_INFO_ACTION: getInfoAction,
@@ -266,6 +268,8 @@ export const ACTIONS = {
266268
SANCTUM_GET_TVL_ACTION: getSanctumTvlAction,
267269
SANCTUM_ADD_LIQUIDITY_ACTION: sanctumAddLiquidityAction,
268270
SANCTUM_REMOVE_LIQUIDITY_ACTION: sanctumRemoveLiquidityAction,
271+
SANCTUM_GET_OWNED_LST_ACTION: sanctumGetOwnedLstAction,
272+
SANCTUM_SWAP_LST_ACTION: sanctumSwapLstAction,
269273
};
270274

271275
export type { Action, ActionExample, Handler } from "../types/action";

src/agent/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ import {
153153
get_tvl as getSanctumLSTTvl,
154154
add_liquidity as addSanctumLSTLiquidity,
155155
remove_liquidity as removeSanctumLSTLiquidity,
156+
get_owned_lst as getSanctumOwnedLst,
157+
swap_lst as swapLst,
156158
} from "../tools";
157159
import {
158160
Config,
@@ -1478,6 +1480,10 @@ export class SolanaAgentKit {
14781480
return getSanctumLSTTvl(inputs);
14791481
}
14801482

1483+
async getSanctumOwnedLst() {
1484+
return getSanctumOwnedLst(this);
1485+
}
1486+
14811487
async addSanctumLiquidity(
14821488
lstMint: string,
14831489
amount: string,
@@ -1507,4 +1513,21 @@ export class SolanaAgentKit {
15071513
priorityFee,
15081514
);
15091515
}
1516+
1517+
async swapSanctumLst(
1518+
inputLstMint: string,
1519+
amount: string,
1520+
quotedAmount: string,
1521+
priorityFee: number,
1522+
outputLstMint: string,
1523+
) {
1524+
return swapLst(
1525+
this,
1526+
inputLstMint,
1527+
amount,
1528+
quotedAmount,
1529+
priorityFee,
1530+
outputLstMint,
1531+
);
1532+
}
15101533
}

src/langchain/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ import {
174174
SanctumGetTvlTool,
175175
SanctumAddLiquidityTool,
176176
SanctumRemoveLiquidityTool,
177+
SanctumGetOwnedLstTool,
178+
SanctumSwapLstTool,
177179
} from "./index";
178180
import {
179181
SolanaCancelLimitOrdersTool,
@@ -320,5 +322,7 @@ export function createSolanaTools(solanaKit: SolanaAgentKit) {
320322
new SanctumGetTvlTool(solanaKit),
321323
new SanctumAddLiquidityTool(solanaKit),
322324
new SanctumRemoveLiquidityTool(solanaKit),
325+
new SanctumGetOwnedLstTool(solanaKit),
326+
new SanctumSwapLstTool(solanaKit),
323327
];
324328
}

src/langchain/sanctum/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export * from "./get_apy";
33
export * from "./get_tvl";
44
export * from "./add_liquidity";
55
export * from "./remove_liquidity";
6+
export * from "./get_owned_lst";
7+
export * from "./swap_lst";

src/tools/sanctum/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export * from "./get_apy";
33
export * from "./get_tvl";
44
export * from "./add_liquidity";
55
export * from "./remove_liquidity";
6+
export * from "./get_owned_lst";
7+
export * from "./swap_lst";

0 commit comments

Comments
 (0)