@edge-protocol/sdk 0.8.0 → 0.9.1

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 CHANGED
@@ -1,20 +1,20 @@
1
1
  # @edge-protocol/sdk
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@edge-protocol/sdk)](https://npmjs.com/package/@edge-protocol/sdk)
4
- [![npm downloads](https://img.shields.io/npm/dm/@edge-protocol/sdk)](https://npmjs.com/package/@edge-protocol/sdk)
5
- [![Tests](https://img.shields.io/badge/tests-34%20passed-brightgreen)](https://github.com/fluturecode/edge)
6
- [![Built on Sui](https://img.shields.io/badge/built%20on-Sui-6fbcf0)](https://sui.io)
7
- [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
4
+ [![npm downloads](https://img.shields.io/npm/dw/@edge-protocol/sdk)](https://npmjs.com/package/@edge-protocol/sdk)
5
+ [![Tests](https://img.shields.io/badge/tests-34%20passing-brightgreen)](https://github.com/fluturecode/edge)
6
+ [![Built on Sui](https://img.shields.io/badge/built%20on-Sui-blue)](https://sui.io)
7
+ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
8
8
 
9
- > **Give agents your rules, not your keys.**
9
+ Give agents your rules, not your keys.
10
10
 
11
- [Live Demo](https://edge-web-cyan.vercel.app) · [Full Docs](https://github.com/fluturecode/edge/blob/main/packages/sdk/DOCS.md) · [GitHub](https://github.com/fluturecode/edge)
11
+ [Live Demo](https://edge-web-cyan.vercel.app) · [Full Docs](DOCS.md) · [GitHub](https://github.com/fluturecode/edge)
12
12
 
13
13
  ---
14
14
 
15
15
  As autonomous agents begin managing real assets onchain, they need a trust layer that governs how they interact with them. Raw private keys are a security nightmare. Requiring human approval for every transaction defeats the purpose of automation.
16
16
 
17
- **EdgePass is the policy layer** — scoped, programmatic spend authority issued directly to agent runtimes, with cryptographic guardrails enforced by the Sui VM. Not a payment rail. Not a wallet. The boundary between what an agent can do and what it cannot.
17
+ EdgePass is the policy layer — scoped, programmatic spend authority issued directly to agent runtimes, with cryptographic guardrails enforced by the Sui VM. Not a payment rail. Not a wallet. The boundary between what an agent can do and what it cannot.
18
18
 
19
19
  ---
20
20
 
@@ -38,11 +38,11 @@ Every EdgePass is a native Sui Move object encoding five distinct governance dim
38
38
 
39
39
  | Dimension | What it controls |
40
40
  |-----------|-----------------|
41
- | **BUDGET** | Maximum global spending ceiling |
42
- | **VELOCITY** | Auto-approve threshold before escalation fires |
43
- | **SCOPE** | Explicit allowlist of approved merchants / contracts |
44
- | **TIME** | Hard cryptographic expiration date |
45
- | **ESCALATION** | Programmatic fallback when a limit is exceeded |
41
+ | BUDGET | Maximum global spending ceiling |
42
+ | VELOCITY | Auto-approve threshold before escalation fires |
43
+ | SCOPE | Explicit allowlist of approved merchants / contracts |
44
+ | TIME | Hard cryptographic expiration date |
45
+ | ESCALATION | Programmatic fallback when a limit is exceeded |
46
46
 
47
47
  ---
48
48
 
@@ -58,7 +58,8 @@ EdgePass.fromTemplate('defi', { owner }) // $10k · auto <$500 · esca
58
58
  EdgePass.fromTemplate('enterprise', { owner }) // $50k · auto <$1k · escalate >$5k · 30d
59
59
  ```
60
60
 
61
- **Example — brand licensing agent:**
61
+ Example — brand licensing agent:
62
+
62
63
  ```typescript
63
64
  EdgePass.fromTemplate('enterprise', {
64
65
  approvedMerchants: ['nike-licensing.sui', 'brand-registry.sui'],
@@ -70,6 +71,54 @@ EdgePass.fromTemplate('enterprise', {
70
71
 
71
72
  ---
72
73
 
74
+ ## 🔮 Simulate Before You Execute
75
+
76
+ Plan an agent's session without touching the chain. Zero network calls.
77
+
78
+ ```typescript
79
+ const plan = sdk.simulate(pass, [
80
+ { merchant: 'Shuttle Express', amount: 45n * MIST_PER_SUI },
81
+ { merchant: 'ShadyTokens.xyz', amount: 1n },
82
+ { merchant: 'Stage Access VIP', amount: 220n * MIST_PER_SUI },
83
+ ]);
84
+
85
+ console.log(plan.summary);
86
+ // { approvedCount: 1, blockedCount: 1, escalatedCount: 1, totalDecisions: 3 }
87
+
88
+ console.log(plan.utilizationPct); // projected budget usage after approved decisions
89
+ console.log(plan.remainingBudget); // projected remaining in MIST
90
+
91
+ // Show plan to user, then execute approved decisions
92
+ for (const decision of plan.approved) {
93
+ await sdk.execute(pass, decision.request, signer);
94
+ }
95
+ ```
96
+
97
+ ---
98
+
99
+ ## 💰 Budget Intelligence
100
+
101
+ ```typescript
102
+ const status = sdk.budgetStatus(pass);
103
+ // {
104
+ // budget: 500000000000n,
105
+ // spent: 218000000000n,
106
+ // remaining: 282000000000n,
107
+ // utilizationPct: 43.6,
108
+ // isNearLimit: false, // true when > 80%
109
+ // isExhausted: false,
110
+ // }
111
+
112
+ sdk.utilizationPct(pass) // 43.6
113
+ sdk.isNearLimit(pass) // false (default threshold: 80%)
114
+ sdk.isNearLimit(pass, 0.5) // true if > 50% spent
115
+ sdk.remainingBudget(pass) // 282000000000n MIST
116
+ sdk.timeRemaining(pass) // ms until expiry
117
+ sdk.isExpiringSoon(pass) // true if expires within 1 hour
118
+ ```
119
+
120
+ ---
121
+
73
122
  ## 🤖 Agent Framework Integration
74
123
 
75
124
  ### Vercel AI SDK / Mastra
@@ -91,14 +140,29 @@ export const autonomousPurchaseTool = tool({
91
140
  amount: BigInt(Math.floor(amountSUI * 1e9)),
92
141
  }, agentSigner);
93
142
 
94
- if (outcome.status === 'blocked') return { success: false, error: `Blocked by EdgePass policy: ${outcome.reason}` };
95
- if (outcome.status === 'escalated') return { success: false, error: `Paused — human approval required: ${outcome.reason}` };
143
+ if (outcome.status === 'blocked') return { success: false, error: `Blocked: ${outcome.reason}` };
144
+ if (outcome.status === 'escalated') return { success: false, error: `Escalated: ${outcome.reason}` };
96
145
 
97
146
  return { success: true, digest: outcome.digest };
98
147
  }
99
148
  });
100
149
  ```
101
150
 
151
+ ### `withPolicy` — Wrap Any Tool
152
+
153
+ ```typescript
154
+ const safePurchase = EdgePass.withPolicy(pass, signer, sdk, async (request) => {
155
+ return await purchaseItem(request.merchant, request.amount);
156
+ });
157
+
158
+ // safePurchase enforces EdgePass policy automatically
159
+ // blocked/escalated never reach your tool logic
160
+ const { outcome, result } = await safePurchase({
161
+ merchant: 'Hydra Bar',
162
+ amount: 32n * MIST_PER_SUI,
163
+ });
164
+ ```
165
+
102
166
  ### Native Agent System Prompt
103
167
 
104
168
  ```typescript
@@ -118,6 +182,41 @@ The transaction was executed on-chain and logged to Walrus.
118
182
 
119
183
  ---
120
184
 
185
+ ## ⚛️ React Hook
186
+
187
+ ```typescript
188
+ import { useEdgePass } from '@edge-protocol/sdk/react';
189
+
190
+ function AgentDashboard({ passId, signer }) {
191
+ const { pass, execute, simulate, budgetStatus, loading } = useEdgePass({
192
+ passId,
193
+ network: 'mainnet',
194
+ enokiApiKey: process.env.NEXT_PUBLIC_ENOKI_API_KEY!,
195
+ signer,
196
+ autoRefresh: true, // re-fetch after every approved execute
197
+ });
198
+
199
+ if (loading) return <Spinner />;
200
+ if (!pass) return <div>Pass not found</div>;
201
+
202
+ return (
203
+ <div>
204
+ <progress value={budgetStatus?.utilizationPct} max={100} />
205
+ <button onClick={() => execute({ merchant: 'Hydra Bar', amount: 32n * MIST_PER_SUI })}>
206
+ Purchase
207
+ </button>
208
+ </div>
209
+ );
210
+ }
211
+ ```
212
+
213
+ Three hooks available:
214
+ - `useEdgePass` — full featured: fetch, execute, simulate, budgetStatus, refresh
215
+ - `useBudgetStatus` — lightweight budget display
216
+ - `useSimulate` — reactive simulation when requests change
217
+
218
+ ---
219
+
121
220
  ## 📊 Execution Results
122
221
 
123
222
  Every `sdk.execute()` returns a structured outcome — not a flat string:
@@ -127,6 +226,7 @@ type TransactionOutcome =
127
226
  | { status: 'approved'; digest: string; auto: true; }
128
227
  | { status: 'escalated'; reason: string; auto: false; }
129
228
  | { status: 'blocked'; reason: string; auto: false; }
229
+ | { status: 'error'; reason: string; code?: string; auto: false; }
130
230
 
131
231
  // Approved
132
232
  { status: 'approved', digest: '4REcPLezK8gF...', auto: true }
@@ -164,7 +264,7 @@ await sdk.execute(pass, request, signer);
164
264
 
165
265
  ## 🔌 Pluggable Escalation Handlers
166
266
 
167
- Route escalation alerts to dashboards, Slack, or Telegram:
267
+ Route escalation alerts to Slack, Telegram, or your dashboard:
168
268
 
169
269
  ```typescript
170
270
  sdk.on('escalated', async ({ outcome, request }) => {
@@ -179,22 +279,8 @@ sdk.on('escalated', async ({ outcome, request }) => {
179
279
 
180
280
  ---
181
281
 
182
- ## 📜 Cryptographic Audit Trail
183
-
184
- Every execution writes an immutable receipt to Walrus — decentralized, tamper-evident, permanent. No database. No server. Cryptographically committed.
185
-
186
- ```typescript
187
- const outcome = await sdk.execute(pass, request, signer);
188
- // audit receipt automatically written to Walrus
189
- // verifiable at walruscan.com/mainnet/blob/{blobId}
190
- ```
191
-
192
- ---
193
-
194
282
  ## 🔍 Preview Without Executing
195
283
 
196
- Zero network calls. Sub-millisecond. Use for UI previews:
197
-
198
284
  ```typescript
199
285
  const preview = sdk.validate(pass, { merchant, amount });
200
286
  // { allowed: boolean, requiresEscalation: boolean, reason: string }
@@ -230,8 +316,6 @@ assert!(amount <= pass.escalate_threshold, EAmountExceedsEscalationThreshold);
230
316
 
231
317
  If any assertion fails, the entire transaction reverts. A compromised agent cannot bypass the contract. **The chain is the trust boundary.**
232
318
 
233
- For production: always execute via the Move contract. The TypeScript layer is a preview — the chain is the guarantee.
234
-
235
319
  ---
236
320
 
237
321
  ## 🧪 Testing
@@ -273,6 +357,11 @@ pnpm add @edge-protocol/sdk
273
357
  yarn add @edge-protocol/sdk
274
358
  ```
275
359
 
360
+ React hook (requires React 18+):
361
+ ```bash
362
+ import { useEdgePass } from '@edge-protocol/sdk/react';
363
+ ```
364
+
276
365
  ---
277
366
 
278
367
  ## Competitive Positioning
@@ -302,6 +391,6 @@ Edge (policy layer) → x402 (payment rail) → Settlement
302
391
 
303
392
  *The best infrastructure is invisible.*
304
393
 
305
- Built for [Sui Overflow 2026](https://overflow.sui.io) · MIT License
394
+ Built for Sui Overflow 2026 · MIT License
306
395
 
307
396
  [GitHub](https://github.com/fluturecode/edge) · [npm](https://npmjs.com/package/@edge-protocol/sdk)
@@ -0,0 +1,29 @@
1
+ import { Transaction } from '@mysten/sui/transactions';
2
+ import { EdgePass } from '../core/EdgePass';
3
+ import { EdgePassObject, TransactionRequest, TransactionOutcome, SimulationResult, BudgetStatus, Network } from '../utils/types';
4
+ export interface UseEdgePassConfig {
5
+ passId: string;
6
+ network: Network;
7
+ enokiApiKey: string;
8
+ signer?: {
9
+ signAndExecute: (tx: Transaction) => Promise<{
10
+ digest: string;
11
+ }>;
12
+ };
13
+ autoRefresh?: boolean;
14
+ pollInterval?: number;
15
+ }
16
+ export interface UseEdgePassResult {
17
+ pass: EdgePassObject | null;
18
+ loading: boolean;
19
+ error: Error | null;
20
+ execute: (request: TransactionRequest) => Promise<TransactionOutcome>;
21
+ simulate: (requests: TransactionRequest[]) => SimulationResult | null;
22
+ budgetStatus: BudgetStatus | null;
23
+ refresh: () => Promise<void>;
24
+ sdk: EdgePass;
25
+ }
26
+ export declare function useEdgePass({ passId, network, enokiApiKey, signer, autoRefresh, pollInterval, }: UseEdgePassConfig): UseEdgePassResult;
27
+ export declare function useBudgetStatus(config: UseEdgePassConfig): BudgetStatus | null;
28
+ export declare function useSimulate(config: UseEdgePassConfig, requests: TransactionRequest[]): SimulationResult | null;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAS,MAAM,CAAC;IACtB,OAAO,EAAQ,OAAO,CAAC;IACvB,WAAW,EAAI,MAAM,CAAC;IACtB,MAAM,CAAC,EAAQ;QAAE,cAAc,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IACpF,WAAW,CAAC,EAAG,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAU,cAAc,GAAG,IAAI,CAAC;IACpC,OAAO,EAAO,OAAO,CAAC;IACtB,KAAK,EAAS,KAAK,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAO,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC3E,QAAQ,EAAM,CAAC,QAAQ,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,GAAG,IAAI,CAAC;IAC1E,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,OAAO,EAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,GAAG,EAAW,QAAQ,CAAC;CACxB;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,OAAO,EACP,WAAW,EACX,MAAM,EACN,WAAkB,EAClB,YAAgB,GACjB,EAAE,iBAAiB,GAAG,iBAAiB,CAsDvC;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CAG9E;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,kBAAkB,EAAE,GAC7B,gBAAgB,GAAG,IAAI,CAGzB"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useEdgePass = useEdgePass;
4
+ exports.useBudgetStatus = useBudgetStatus;
5
+ exports.useSimulate = useSimulate;
6
+ const react_1 = require("react");
7
+ const EdgePass_1 = require("../core/EdgePass");
8
+ function useEdgePass({ passId, network, enokiApiKey, signer, autoRefresh = true, pollInterval = 0, }) {
9
+ const [pass, setPass] = (0, react_1.useState)(null);
10
+ const [loading, setLoading] = (0, react_1.useState)(true);
11
+ const [error, setError] = (0, react_1.useState)(null);
12
+ const sdkRef = (0, react_1.useRef)(new EdgePass_1.EdgePass({ network, enokiApiKey }));
13
+ (0, react_1.useEffect)(() => {
14
+ sdkRef.current = new EdgePass_1.EdgePass({ network, enokiApiKey });
15
+ }, [network, enokiApiKey]);
16
+ const refresh = (0, react_1.useCallback)(async () => {
17
+ if (!passId)
18
+ return;
19
+ try {
20
+ setError(null);
21
+ const fetched = await sdkRef.current.fetch(passId);
22
+ setPass(fetched);
23
+ }
24
+ catch (e) {
25
+ setError(e instanceof Error ? e : new Error(String(e)));
26
+ }
27
+ }, [passId]);
28
+ (0, react_1.useEffect)(() => {
29
+ let cancelled = false;
30
+ setLoading(true);
31
+ sdkRef.current.fetch(passId)
32
+ .then(fetched => { if (!cancelled) {
33
+ setPass(fetched);
34
+ setError(null);
35
+ } })
36
+ .catch(e => { if (!cancelled)
37
+ setError(e instanceof Error ? e : new Error(String(e))); })
38
+ .finally(() => { if (!cancelled)
39
+ setLoading(false); });
40
+ return () => { cancelled = true; };
41
+ }, [passId]);
42
+ (0, react_1.useEffect)(() => {
43
+ if (!pollInterval || pollInterval <= 0)
44
+ return;
45
+ const interval = setInterval(refresh, pollInterval);
46
+ return () => clearInterval(interval);
47
+ }, [refresh, pollInterval]);
48
+ const execute = (0, react_1.useCallback)(async (request) => {
49
+ if (!pass)
50
+ throw new Error('EdgePass not loaded');
51
+ if (!signer)
52
+ throw new Error('No signer provided');
53
+ const outcome = await sdkRef.current.execute(pass, request, signer);
54
+ if (outcome.status === 'approved' && autoRefresh)
55
+ await refresh();
56
+ return outcome;
57
+ }, [pass, signer, autoRefresh, refresh]);
58
+ const simulate = (0, react_1.useCallback)((requests) => {
59
+ if (!pass)
60
+ return null;
61
+ return sdkRef.current.simulate(pass, requests);
62
+ }, [pass]);
63
+ const budgetStatus = pass ? sdkRef.current.budgetStatus(pass) : null;
64
+ return { pass, loading, error, execute, simulate, budgetStatus, refresh, sdk: sdkRef.current };
65
+ }
66
+ function useBudgetStatus(config) {
67
+ const { budgetStatus } = useEdgePass(config);
68
+ return budgetStatus;
69
+ }
70
+ function useSimulate(config, requests) {
71
+ const { simulate } = useEdgePass(config);
72
+ return simulate(requests);
73
+ }
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":";;AAgCA,kCA6DC;AAED,0CAGC;AAED,kCAMC;AA1GD,iCAAiE;AAEjE,+CAA4C;AA8B5C,SAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,OAAO,EACP,WAAW,EACX,MAAM,EACN,WAAW,GAAG,IAAI,EAClB,YAAY,GAAG,CAAC,GACE;IAElB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAwB,IAAI,CAAC,CAAC;IAC9D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,MAAM,GAAG,IAAA,cAAM,EAAW,IAAI,mBAAQ,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IACxE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,CAAC,OAAO,GAAG,IAAI,mBAAQ,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAC1D,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAE3B,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAC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,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;AACjG,CAAC;AAED,SAAgB,eAAe,CAAC,MAAyB;IACvD,MAAM,EAAE,YAAY,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAgB,WAAW,CACzB,MAAyB,EACzB,QAA8B;IAE9B,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,24 @@
1
1
  {
2
2
  "name": "@edge-protocol/sdk",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "Programmable trust infrastructure for autonomous AI agents on Sui. Give agents your rules, not your keys.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "require": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ },
12
+ "./react": {
13
+ "require": "./dist/react/index.js",
14
+ "types": "./dist/react/index.d.ts"
15
+ }
16
+ },
7
17
  "files": [
8
18
  "dist",
9
19
  "README.md",
10
- "DOCS.md"
20
+ "DOCS.md",
21
+ "CHANGELOG.md"
11
22
  ],
12
23
  "scripts": {
13
24
  "build": "tsc",
@@ -15,50 +26,21 @@
15
26
  "test": "ts-node --compiler-options '{\"module\":\"CommonJS\"}' src/test.ts",
16
27
  "prepublishOnly": "pnpm build"
17
28
  },
18
- "keywords": [
19
- "sui",
20
- "sui-sdk",
21
- "zklogin",
22
- "autonomous-agents",
23
- "ai-agents",
24
- "trust-delegation",
25
- "edgepass",
26
- "walrus",
27
- "defi",
28
- "web3",
29
- "blockchain",
30
- "move",
31
- "move-language",
32
- "ptb",
33
- "programmable-transaction",
34
- "agent-policy",
35
- "spending-limits",
36
- "crypto-agents",
37
- "agentic-web",
38
- "autonomous",
39
- "trust",
40
- "delegation",
41
- "agent",
42
- "mysten",
43
- "enoki",
44
- "sponsored-transactions"
45
- ],
46
- "author": "fluturecode",
47
- "license": "MIT",
48
- "repository": {
49
- "type": "git",
50
- "url": "https://github.com/fluturecode/edge"
51
- },
52
- "homepage": "https://github.com/fluturecode/edge#readme",
53
- "bugs": {
54
- "url": "https://github.com/fluturecode/edge/issues"
55
- },
56
29
  "dependencies": {
57
30
  "@mysten/sui": "^1.30.0",
58
31
  "@mysten/zklogin": "^0.8.1"
59
32
  },
33
+ "peerDependencies": {
34
+ "react": ">=18.0.0"
35
+ },
36
+ "peerDependenciesMeta": {
37
+ "react": {
38
+ "optional": true
39
+ }
40
+ },
60
41
  "devDependencies": {
61
42
  "@types/node": "^20.19.41",
43
+ "@types/react": "^18.3.31",
62
44
  "ts-node": "^10.9.2",
63
45
  "typescript": "^5.9.3"
64
46
  }