@true402.dev/ai-sdk
Advanced tools
+38
-0
@@ -56,2 +56,40 @@ import * as ai from 'ai'; | ||
| }; | ||
| true402_tx_preflight: ai.Tool<z.ZodObject<{ | ||
| from: z.ZodString; | ||
| to: z.ZodString; | ||
| data: z.ZodOptional<z.ZodString>; | ||
| value: z.ZodOptional<z.ZodString>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| from: string; | ||
| to: string; | ||
| value?: string | undefined; | ||
| data?: string | undefined; | ||
| }, { | ||
| from: string; | ||
| to: string; | ||
| value?: string | undefined; | ||
| data?: string | undefined; | ||
| }>, unknown> & { | ||
| execute: (args: { | ||
| from: string; | ||
| to: string; | ||
| value?: string | undefined; | ||
| data?: string | undefined; | ||
| }, options: ai.ToolExecutionOptions) => PromiseLike<unknown>; | ||
| }; | ||
| true402_liquidity_history: ai.Tool<z.ZodObject<{ | ||
| token: z.ZodString; | ||
| limit: z.ZodOptional<z.ZodNumber>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| token: string; | ||
| limit?: number | undefined; | ||
| }, { | ||
| token: string; | ||
| limit?: number | undefined; | ||
| }>, unknown> & { | ||
| execute: (args: { | ||
| token: string; | ||
| limit?: number | undefined; | ||
| }, options: ai.ToolExecutionOptions) => PromiseLike<unknown>; | ||
| }; | ||
| true402_deployer_check: ai.Tool<z.ZodObject<{ | ||
@@ -58,0 +96,0 @@ token: z.ZodString; |
+20
-0
@@ -85,2 +85,12 @@ // src/index.ts | ||
| var addressSchema = z.object({ address: z.string().describe("Any Base address (0x\u2026) \u2014 an EOA or a contract") }); | ||
| var historySchema = z.object({ | ||
| token: z.string().describe("A Base ERC-20 token contract address (0x\u2026)"), | ||
| limit: z.number().int().min(1).max(200).optional().describe("Max removal events to return (1\u2013200, default 50)") | ||
| }); | ||
| var preflightSchema = z.object({ | ||
| from: z.string().describe("Sender address (0x\u2026). Asserted, never proven \u2014 no signature is taken."), | ||
| to: z.string().describe("Destination contract or address (0x\u2026)"), | ||
| data: z.string().optional().describe("Calldata hex (0x\u2026). Omit for a plain native transfer."), | ||
| value: z.string().optional().describe("Native value in wei, decimal string. Default 0.") | ||
| }); | ||
| function true402Tools(opts) { | ||
@@ -103,2 +113,12 @@ return { | ||
| }), | ||
| true402_tx_preflight: tool({ | ||
| description: `Check a Base transaction BEFORE signing it. Send the UNSIGNED transaction (from, to, data, value) and get three lenses: a simulation against current state (does it revert?), the decoded intent (is this an unlimited approval that outlives the trade?), and the counterparty's liquidity-removal history. Takes NO private key and NO signature, so it cannot broadcast or front-run the transaction it inspects. Never returns "safe" \u2014 a clean result means these checks found nothing, and every response states its limits. Call this LAST, immediately before signing. ~$0.008 USDC over x402.`, | ||
| parameters: preflightSchema, | ||
| execute: ({ from, to, data, value }) => payStall("/v1/base/tx-preflight", { from, to, ...data !== void 0 ? { data } : {}, ...value !== void 0 ? { value } : {} }, opts) | ||
| }), | ||
| true402_liquidity_history: tool({ | ||
| description: `What has ALREADY happened to a Base token's liquidity, from true402's own DEX archive: every removal event with the amount, block and transaction hash, plus the other tokens drained in the SAME transaction (one actor, several pools). A live honeypot simulation cannot see this \u2014 a pool drained last month simulates fine today if it was re-seeded. Every answer carries the block range the index covers, so "none observed" is not a claim of safety. ~$0.005 USDC over x402.`, | ||
| parameters: historySchema, | ||
| execute: ({ token, limit }) => payStall("/v1/base/liquidity-history", { token, ...limit !== void 0 ? { limit } : {} }, opts) | ||
| }), | ||
| true402_deployer_check: tool({ | ||
@@ -105,0 +125,0 @@ description: "Deployer reputation for a Base token: resolves who created it and that wallet's track record (age, contracts shipped, fresh-throwaway flag) to catch serial ruggers a structural check can't see. ~$0.008 USDC over x402.", |
+1
-1
| { | ||
| "name": "@true402.dev/ai-sdk", | ||
| "version": "1.0.2", | ||
| "version": "1.1.0", | ||
| "description": "true402 tools for the Vercel AI SDK \u2014 pay-per-call on-chain rug/honeypot & address safety for Base AI agents over x402 (USDC, no account, no API key).", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+2
-0
@@ -29,2 +29,4 @@ # @true402.dev/ai-sdk | ||
| | `true402_address_safety` | Profile + risk for any address before you send/approve/call it (proxy detection) | $0.005 | | ||
| | `true402_tx_preflight` | Check an **unsigned** transaction before signing: does it revert, does it grant an unlimited approval, has the counterparty been draining liquidity. Takes no key and no signature | $0.008 | | ||
| | `true402_liquidity_history` | What already happened to a token's liquidity — every removal with amount/block/tx, plus the tokens drained in the same transaction | $0.005 | | ||
| | `true402_deployer_check` | Deployer reputation — who made the token + their track record | $0.008 | | ||
@@ -31,0 +33,0 @@ |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
15310
32.9%237
34.66%45
4.65%2
-33.33%