fizzl-langchain 0.2.0 → 0.4.0
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/README.md +5 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +52 -9
package/README.md
CHANGED
|
@@ -10,6 +10,9 @@ Five LangChain tools you pass to `createAgent`, `createReactAgent` or `model.bin
|
|
|
10
10
|
|---|---|---|---|
|
|
11
11
|
| `check_before_signing` | a transaction, token approval or signature **before signing it**: green / orange / red with reason codes (drainers, unlimited approvals to unknown spenders, look-alike tokens, Permit/Permit2/Seaport signatures that hand over tokens). With `from` (the agent's wallet) a transaction is simulated, so a hidden approval, an NFT leaving or a transaction that would fail shows up; with `intent` (one sentence) signing something else than meant is caught; with `x402` (the accepts entry being paid) a payment that pays more or someone else is red | [presign-guard](https://presign-guard.fizzl.eu) | $0.01 |
|
|
12
12
|
| `check_xrpl_transaction` | an **XRP Ledger** transaction before signing it: account takeover (SetRegularKey, SignerListSet, master key off), AccountDelete, fake RLUSD (red); partial payments, destinations that refuse or need a tag, risky issuers, DEX orders far below the order book or AMM price (orange) | presign-guard | $0.01 |
|
|
13
|
+
| `check_solana_transaction` | a **Solana** transaction before signing it: every instruction is read and the transaction simulated. Token account takeover (SetAuthority), System Assign (red); unlimited delegates, durable nonces, closing to someone else, hidden owner or delegate changes, a failing transaction (orange) | presign-guard | $0.01 |
|
|
14
|
+
| `check_message` | a plain message before `personal_sign` / `eth_sign`: eth_sign, a Sign-In with Ethereum message for another site (red); unreadable bytes, a sign-in for another URI, address or chain (orange) | presign-guard | $0.01 |
|
|
15
|
+
| `check_algorand_transaction` | an **Algorand** transaction or atomic group before signing it: every transaction your account sends is read and the group simulated. Rekey to another key, closing the account or an asset holding to someone else, fake USDC (red); clawbacks, risky opt-ins, app update/delete/clear-state, a partial group, a group that would fail (orange) | presign-guard | $0.01 |
|
|
13
16
|
| `check_token` | a token **before buying or accepting it**: honeypot, rug-pull signs, look-alikes (Solana, EVM, and XRPL tokens as `CURRENCY.rIssuer`: clawback, freeze, transfer fee, fake RLUSD) | presign-guard | $0.01 |
|
|
14
17
|
| `check_wallet_approvals` | every open approval of a wallet and which to revoke | presign-guard | $0.02 |
|
|
15
18
|
| `check_endpoint_before_paying` | an x402 or MPP paid API **before paying it**: go / caution / no_go, the cheapest option that settles, budget, track record, bait signs (fake brands, airdrop lures, output that doesn't match) | [x402 Doctor](https://x402-doctor.fizzl.eu) | $0.001 |
|
|
@@ -33,7 +36,7 @@ console.log(await checkToken.invoke({ chain: "base", address: "0x833589fCD6eDb6E
|
|
|
33
36
|
// {"verdict":"green","grade":"SAFE","free":true,"note":"Free quick check: the verdict only, a few per hour. ..."}
|
|
34
37
|
```
|
|
35
38
|
|
|
36
|
-
With no paying fetch and no credit keys, `check_token`, `check_before_signing` and `check_endpoint_before_paying` fall back to the free quick checks: the verdict only (green / orange / red, or go / caution / no_go with the problems found), a few per hour, marked `free: true` with a note on what the full check costs. `check_wallet_approvals` and `check_xrpl_transaction` have no free version. Pass `free: false` to get `payment_required` instead.
|
|
39
|
+
With no paying fetch and no credit keys, `check_token`, `check_before_signing`, `check_solana_transaction`, `check_algorand_transaction`, `check_message` and `check_endpoint_before_paying` fall back to the free quick checks: the verdict only (green / orange / red, or go / caution / no_go with the problems found), a few per hour, marked `free: true` with a note on what the full check costs. `check_wallet_approvals` and `check_xrpl_transaction` have no free version. Pass `free: false` to get `payment_required` instead.
|
|
37
40
|
|
|
38
41
|
## Use in an agent
|
|
39
42
|
|
|
@@ -74,7 +77,7 @@ fizzlTools({ creditKeys: { presign: process.env.PRESIGN_CREDIT_KEY, doctor: proc
|
|
|
74
77
|
|---|---|---|
|
|
75
78
|
| `fetch` | global `fetch` | An x402-paying fetch (`wrapFetchWithPayment` from `@x402/fetch`), or plain fetch with credit keys |
|
|
76
79
|
| `creditKeys` | none | `{ presign, doctor }`, sent as `x-credit-key` |
|
|
77
|
-
| `only` | all
|
|
80
|
+
| `only` | all eight | Tool names to include |
|
|
78
81
|
| `free` | `true` | Fall back to the free quick check (verdict only) when a check can't be paid |
|
|
79
82
|
| `timeoutMs` | 30000 | Per check |
|
|
80
83
|
| `presignUrl`, `doctorUrl` | the fizzl.eu services | For tests or self-hosting |
|
package/index.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ export declare const PRESIGN_URL: string;
|
|
|
5
5
|
export declare const DOCTOR_URL: string;
|
|
6
6
|
export declare const PRICES: Record<FizzlToolName, string>;
|
|
7
7
|
|
|
8
|
-
export type FizzlToolName = "check_before_signing" | "check_xrpl_transaction" | "check_token" | "check_wallet_approvals" | "check_endpoint_before_paying";
|
|
8
|
+
export type FizzlToolName = "check_before_signing" | "check_xrpl_transaction" | "check_solana_transaction" | "check_algorand_transaction" | "check_message" | "check_token" | "check_wallet_approvals" | "check_endpoint_before_paying";
|
|
9
9
|
|
|
10
10
|
export interface FizzlToolsOptions {
|
|
11
11
|
/** fetch that pays x402 (wrapFetchWithPayment from @x402/fetch); plain fetch works with credit keys. */
|
|
12
12
|
fetch?: typeof fetch;
|
|
13
13
|
/** Prepaid credit keys (sent as x-credit-key), per service. */
|
|
14
14
|
creditKeys?: { presign?: string; doctor?: string };
|
|
15
|
-
/** The tools to include (default: all
|
|
15
|
+
/** The tools to include (default: all eight). */
|
|
16
16
|
only?: FizzlToolName[];
|
|
17
17
|
/** Fall back to the free quick check (verdict only, a few per hour) when a check can't be paid. Default true. */
|
|
18
18
|
free?: boolean;
|
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { tool } from "@langchain/core/tools";
|
|
10
10
|
import { fizzlTools as checks, PRICES, PRESIGN_URL, DOCTOR_URL } from "presign-guard-ai-sdk";
|
|
11
11
|
|
|
12
|
-
export const VERSION = "0.
|
|
12
|
+
export const VERSION = "0.4.0";
|
|
13
13
|
export { PRICES, PRESIGN_URL, DOCTOR_URL };
|
|
14
14
|
|
|
15
15
|
// The same checks as presign-guard-ai-sdk; only the user agent says where the call came from.
|
|
@@ -22,7 +22,7 @@ function withUserAgent(fetchImpl) {
|
|
|
22
22
|
* @param {object} [options]
|
|
23
23
|
* @param {typeof fetch} [options.fetch] fetch that pays x402 (wrapFetchWithPayment from @x402/fetch); plain fetch works with credit keys
|
|
24
24
|
* @param {{ presign?: string, doctor?: string }} [options.creditKeys] prepaid credit keys (x-credit-key) per service
|
|
25
|
-
* @param {string[]} [options.only] the tool names to include (default: all
|
|
25
|
+
* @param {string[]} [options.only] the tool names to include (default: all eight)
|
|
26
26
|
* @param {boolean} [options.free] fall back to the free quick checks when a check can't be paid (default true)
|
|
27
27
|
* @param {string} [options.presignUrl] @param {string} [options.doctorUrl] @param {number} [options.timeoutMs]
|
|
28
28
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fizzl-langchain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Safety checks for LangChain.js and LangGraph.js agents that pay: tools to check a transaction or signature before signing, a token before buying, a wallet's open approvals, and an x402 endpoint before paying it (presign-guard and x402 Doctor, paid per call over x402, with a free quick check to try them).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,14 +11,57 @@
|
|
|
11
11
|
},
|
|
12
12
|
"main": "./index.js",
|
|
13
13
|
"types": "./index.d.ts",
|
|
14
|
-
"files": [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
14
|
+
"files": [
|
|
15
|
+
"index.js",
|
|
16
|
+
"index.d.ts",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "node --test test/*.test.mjs",
|
|
25
|
+
"example": "node example/agent.mjs"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"presign-guard-ai-sdk": "^0.6.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@langchain/core": ">=0.3.58 <2.0.0",
|
|
32
|
+
"zod": "^3.25.0 || ^4.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@langchain/core": "^1.2.0",
|
|
36
|
+
"@langchain/langgraph": "^1.0.0",
|
|
37
|
+
"zod": "^4.0.0"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"langchain",
|
|
41
|
+
"langchainjs",
|
|
42
|
+
"langgraph",
|
|
43
|
+
"tools",
|
|
44
|
+
"agents",
|
|
45
|
+
"x402",
|
|
46
|
+
"mpp",
|
|
47
|
+
"wallet",
|
|
48
|
+
"security",
|
|
49
|
+
"presign",
|
|
50
|
+
"token-check",
|
|
51
|
+
"honeypot",
|
|
52
|
+
"approvals",
|
|
53
|
+
"permit2",
|
|
54
|
+
"usdc",
|
|
55
|
+
"base",
|
|
56
|
+
"solana",
|
|
57
|
+
"xrpl",
|
|
58
|
+
"rlusd"
|
|
59
|
+
],
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "git+https://github.com/Fizzl13/x402-examples.git",
|
|
63
|
+
"directory": "fizzl-langchain"
|
|
64
|
+
},
|
|
22
65
|
"homepage": "https://github.com/Fizzl13/x402-examples/tree/main/fizzl-langchain#readme",
|
|
23
66
|
"license": "MIT"
|
|
24
67
|
}
|