@t2000/engine 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -823,6 +823,7 @@ declare const transactionHistoryTool: Tool<{
|
|
|
823
823
|
|
|
824
824
|
declare const saveDepositTool: Tool<{
|
|
825
825
|
amount: number;
|
|
826
|
+
asset?: string | undefined;
|
|
826
827
|
}, {
|
|
827
828
|
success: boolean;
|
|
828
829
|
tx: string;
|
|
@@ -861,6 +862,7 @@ declare const sendTransferTool: Tool<{
|
|
|
861
862
|
|
|
862
863
|
declare const borrowTool: Tool<{
|
|
863
864
|
amount: number;
|
|
865
|
+
asset?: string | undefined;
|
|
864
866
|
}, {
|
|
865
867
|
success: boolean;
|
|
866
868
|
tx: string;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { resolveSymbol, getDecimalsForCoinType, getSwapQuote, SUI_TYPE } from '@t2000/sdk';
|
|
2
|
+
import { resolveSymbol, getDecimalsForCoinType, assertAllowedAsset, getSwapQuote, SUI_TYPE } from '@t2000/sdk';
|
|
3
3
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
4
4
|
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
5
5
|
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
@@ -1043,15 +1043,20 @@ var transactionHistoryTool = buildTool({
|
|
|
1043
1043
|
});
|
|
1044
1044
|
var saveDepositTool = buildTool({
|
|
1045
1045
|
name: "save_deposit",
|
|
1046
|
-
description: "Deposit USDC into NAVI
|
|
1046
|
+
description: "Deposit USDC into NAVI savings to earn yield. ONLY USDC is accepted \u2014 if the user asks to save any other token (USDT, SUI, USDe, etc.), do NOT call this tool. Instead tell them to swap to USDC first, then deposit.",
|
|
1047
1047
|
inputSchema: z.object({
|
|
1048
|
-
amount: z.number().positive()
|
|
1048
|
+
amount: z.number().positive(),
|
|
1049
|
+
asset: z.string().optional().describe("Must be USDC or omitted. Any other asset is rejected.")
|
|
1049
1050
|
}),
|
|
1050
1051
|
jsonSchema: {
|
|
1051
1052
|
type: "object",
|
|
1052
1053
|
properties: {
|
|
1053
1054
|
amount: {
|
|
1054
1055
|
description: "Exact amount of USDC to deposit"
|
|
1056
|
+
},
|
|
1057
|
+
asset: {
|
|
1058
|
+
type: "string",
|
|
1059
|
+
description: "Must be USDC or omitted. Any other asset is rejected."
|
|
1055
1060
|
}
|
|
1056
1061
|
},
|
|
1057
1062
|
required: ["amount"]
|
|
@@ -1059,6 +1064,7 @@ var saveDepositTool = buildTool({
|
|
|
1059
1064
|
isReadOnly: false,
|
|
1060
1065
|
permissionLevel: "confirm",
|
|
1061
1066
|
async call(input, context) {
|
|
1067
|
+
assertAllowedAsset("save", input.asset);
|
|
1062
1068
|
const agent = requireAgent(context);
|
|
1063
1069
|
const result = await agent.save({ amount: input.amount });
|
|
1064
1070
|
return {
|
|
@@ -1160,16 +1166,21 @@ var sendTransferTool = buildTool({
|
|
|
1160
1166
|
});
|
|
1161
1167
|
var borrowTool = buildTool({
|
|
1162
1168
|
name: "borrow",
|
|
1163
|
-
description: "Borrow USDC against savings collateral. Requires existing savings deposits. Checks max safe borrow and health factor. Returns tx hash, fee, and post-borrow health factor.",
|
|
1169
|
+
description: "Borrow USDC against savings collateral. ONLY USDC borrows are supported. Requires existing savings deposits. Checks max safe borrow and health factor. Returns tx hash, fee, and post-borrow health factor.",
|
|
1164
1170
|
inputSchema: z.object({
|
|
1165
|
-
amount: z.number().positive()
|
|
1171
|
+
amount: z.number().positive(),
|
|
1172
|
+
asset: z.string().optional().describe("Must be USDC or omitted. Any other asset is rejected.")
|
|
1166
1173
|
}),
|
|
1167
1174
|
jsonSchema: {
|
|
1168
1175
|
type: "object",
|
|
1169
1176
|
properties: {
|
|
1170
1177
|
amount: {
|
|
1171
1178
|
type: "number",
|
|
1172
|
-
description: "Amount in
|
|
1179
|
+
description: "Amount in USDC to borrow"
|
|
1180
|
+
},
|
|
1181
|
+
asset: {
|
|
1182
|
+
type: "string",
|
|
1183
|
+
description: "Must be USDC or omitted. Any other asset is rejected."
|
|
1173
1184
|
}
|
|
1174
1185
|
},
|
|
1175
1186
|
required: ["amount"]
|
|
@@ -1177,6 +1188,7 @@ var borrowTool = buildTool({
|
|
|
1177
1188
|
isReadOnly: false,
|
|
1178
1189
|
permissionLevel: "confirm",
|
|
1179
1190
|
async call(input, context) {
|
|
1191
|
+
assertAllowedAsset("borrow", input.asset);
|
|
1180
1192
|
const agent = requireAgent(context);
|
|
1181
1193
|
const result = await agent.borrow({ amount: input.amount });
|
|
1182
1194
|
return {
|