@t2000/engine 0.7.3 → 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.js +3 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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';
|
|
@@ -1064,9 +1064,7 @@ var saveDepositTool = buildTool({
|
|
|
1064
1064
|
isReadOnly: false,
|
|
1065
1065
|
permissionLevel: "confirm",
|
|
1066
1066
|
async call(input, context) {
|
|
1067
|
-
|
|
1068
|
-
throw new Error(`Only USDC deposits are supported. Cannot deposit ${input.asset}. Swap to USDC first, then deposit.`);
|
|
1069
|
-
}
|
|
1067
|
+
assertAllowedAsset("save", input.asset);
|
|
1070
1068
|
const agent = requireAgent(context);
|
|
1071
1069
|
const result = await agent.save({ amount: input.amount });
|
|
1072
1070
|
return {
|
|
@@ -1190,9 +1188,7 @@ var borrowTool = buildTool({
|
|
|
1190
1188
|
isReadOnly: false,
|
|
1191
1189
|
permissionLevel: "confirm",
|
|
1192
1190
|
async call(input, context) {
|
|
1193
|
-
|
|
1194
|
-
throw new Error(`Only USDC borrows are supported. Cannot borrow ${input.asset}.`);
|
|
1195
|
-
}
|
|
1191
|
+
assertAllowedAsset("borrow", input.asset);
|
|
1196
1192
|
const agent = requireAgent(context);
|
|
1197
1193
|
const result = await agent.borrow({ amount: input.amount });
|
|
1198
1194
|
return {
|