@edge-protocol/sdk 0.9.1 โ 0.9.3
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 +67 -24
- package/dist/core/PolicyEngine.d.ts +0 -68
- package/dist/core/PolicyEngine.d.ts.map +1 -1
- package/dist/core/PolicyEngine.js +7 -85
- package/dist/core/PolicyEngine.js.map +1 -1
- package/dist/utils/constants.d.ts +8 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +11 -0
- package/dist/utils/constants.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,11 +25,13 @@ import { EdgePass, MIST_PER_SUI } from '@edge-protocol/sdk';
|
|
|
25
25
|
|
|
26
26
|
const sdk = new EdgePass({ network: 'mainnet', enokiApiKey: 'YOUR_KEY' });
|
|
27
27
|
const pass = await sdk.create(EdgePass.fromTemplate('festival', { owner: userAddress }), signer);
|
|
28
|
-
const outcome = await sdk.execute(pass, { merchant: 'Hydra Bar', amount:
|
|
28
|
+
const outcome = await sdk.execute(pass, { merchant: 'Hydra Bar', amount: BigInt(32) * MIST_PER_SUI }, signer);
|
|
29
29
|
|
|
30
30
|
console.log(outcome.status); // 'approved' | 'escalated' | 'blocked'
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
> **Note:** BigInt literal syntax (`32n`) requires TypeScript targeting ES2020+. For ES2019 apps use `BigInt(32) * MIST_PER_SUI` instead.
|
|
34
|
+
|
|
33
35
|
---
|
|
34
36
|
|
|
35
37
|
## ๐ The 5-Dimensional Trust Primitive
|
|
@@ -56,6 +58,7 @@ EdgePass.fromTemplate('gaming', { owner }) // $50 ยท auto <$2 ยท esca
|
|
|
56
58
|
EdgePass.fromTemplate('subscription', { owner }) // $200 ยท auto <$20 ยท escalate >$50 ยท 30d
|
|
57
59
|
EdgePass.fromTemplate('defi', { owner }) // $10k ยท auto <$500 ยท escalate >$1k ยท 7d
|
|
58
60
|
EdgePass.fromTemplate('enterprise', { owner }) // $50k ยท auto <$1k ยท escalate >$5k ยท 30d
|
|
61
|
+
EdgePass.fromTemplate('x402', { owner }) // $1k ยท auto <$10 ยท escalate >$100 ยท 24h ยท x402 payments
|
|
59
62
|
```
|
|
60
63
|
|
|
61
64
|
Example โ brand licensing agent:
|
|
@@ -63,7 +66,7 @@ Example โ brand licensing agent:
|
|
|
63
66
|
```typescript
|
|
64
67
|
EdgePass.fromTemplate('enterprise', {
|
|
65
68
|
approvedMerchants: ['nike-licensing.sui', 'brand-registry.sui'],
|
|
66
|
-
escalateThreshold:
|
|
69
|
+
escalateThreshold: BigInt(10_000) * MIST_PER_SUI,
|
|
67
70
|
owner: cfoAddress,
|
|
68
71
|
})
|
|
69
72
|
// Enforce IP usage terms autonomously โ no lawyers, no monitoring, no surprises
|
|
@@ -77,9 +80,9 @@ Plan an agent's session without touching the chain. Zero network calls.
|
|
|
77
80
|
|
|
78
81
|
```typescript
|
|
79
82
|
const plan = sdk.simulate(pass, [
|
|
80
|
-
{ merchant: 'Shuttle Express', amount:
|
|
81
|
-
{ merchant: 'ShadyTokens.xyz', amount:
|
|
82
|
-
{ merchant: 'Stage Access VIP', amount:
|
|
83
|
+
{ merchant: 'Shuttle Express', amount: BigInt(45) * MIST_PER_SUI },
|
|
84
|
+
{ merchant: 'ShadyTokens.xyz', amount: BigInt(1) },
|
|
85
|
+
{ merchant: 'Stage Access VIP', amount: BigInt(220) * MIST_PER_SUI },
|
|
83
86
|
]);
|
|
84
87
|
|
|
85
88
|
console.log(plan.summary);
|
|
@@ -159,7 +162,7 @@ const safePurchase = EdgePass.withPolicy(pass, signer, sdk, async (request) => {
|
|
|
159
162
|
// blocked/escalated never reach your tool logic
|
|
160
163
|
const { outcome, result } = await safePurchase({
|
|
161
164
|
merchant: 'Hydra Bar',
|
|
162
|
-
amount:
|
|
165
|
+
amount: BigInt(32) * MIST_PER_SUI,
|
|
163
166
|
});
|
|
164
167
|
```
|
|
165
168
|
|
|
@@ -202,7 +205,7 @@ function AgentDashboard({ passId, signer }) {
|
|
|
202
205
|
return (
|
|
203
206
|
<div>
|
|
204
207
|
<progress value={budgetStatus?.utilizationPct} max={100} />
|
|
205
|
-
<button onClick={() => execute({ merchant: 'Hydra Bar', amount:
|
|
208
|
+
<button onClick={() => execute({ merchant: 'Hydra Bar', amount: BigInt(32) * MIST_PER_SUI })}>
|
|
206
209
|
Purchase
|
|
207
210
|
</button>
|
|
208
211
|
</div>
|
|
@@ -291,6 +294,52 @@ if (preview.requiresEscalation) showEscalationModal(preview.reason);
|
|
|
291
294
|
|
|
292
295
|
---
|
|
293
296
|
|
|
297
|
+
## ๐ x402 Integration
|
|
298
|
+
|
|
299
|
+
Edge and x402 are complementary layers in the autonomous payment stack.
|
|
300
|
+
|
|
301
|
+
x402 answers: *how does money move from agent to merchant?*
|
|
302
|
+
Edge answers: *should this agent be allowed to spend this money at all?*
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
Edge (policy layer) โ x402 (payment rail) โ Settlement
|
|
306
|
+
"is this allowed?" "move the money"
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
import { EdgePass, MIST_PER_SUI } from '@edge-protocol/sdk';
|
|
311
|
+
|
|
312
|
+
// 1. Create a trust boundary scoped for x402 payments
|
|
313
|
+
const pass = await sdk.create(
|
|
314
|
+
EdgePass.fromTemplate('x402', {
|
|
315
|
+
approvedMerchants: ['api.example.com', 'data.provider.com'],
|
|
316
|
+
owner: agentAddress,
|
|
317
|
+
}),
|
|
318
|
+
signer
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
// 2. Edge validates policy before x402 moves money
|
|
322
|
+
const outcome = await sdk.execute(pass, {
|
|
323
|
+
merchant: endpoint,
|
|
324
|
+
amount: BigInt(Math.floor(amountUSD * 1e9)),
|
|
325
|
+
}, signer);
|
|
326
|
+
|
|
327
|
+
if (outcome.status === 'approved') {
|
|
328
|
+
// 3. x402 handles the actual payment
|
|
329
|
+
await fetch(endpoint, {
|
|
330
|
+
headers: { 'X-Payment': await createX402Payment(amount) }
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (outcome.status === 'escalated') {
|
|
335
|
+
await notifyUser('Payment requires your approval');
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// blocked โ never reaches x402, policy rejected it
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
294
343
|
## ๐ Security Model
|
|
295
344
|
|
|
296
345
|
Edge has two enforcement layers:
|
|
@@ -358,35 +407,29 @@ yarn add @edge-protocol/sdk
|
|
|
358
407
|
```
|
|
359
408
|
|
|
360
409
|
React hook (requires React 18+):
|
|
361
|
-
```
|
|
410
|
+
```typescript
|
|
362
411
|
import { useEdgePass } from '@edge-protocol/sdk/react';
|
|
363
412
|
```
|
|
364
413
|
|
|
414
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history.
|
|
415
|
+
|
|
365
416
|
---
|
|
366
417
|
|
|
367
418
|
## Competitive Positioning
|
|
368
419
|
|
|
369
420
|
Edge is the **policy layer** for the agentic economy. It is not a payment rail.
|
|
370
421
|
|
|
371
|
-
| Solution | Layer | Open Source | Sui Native | 3-line SDK |
|
|
372
|
-
|
|
373
|
-
| **Edge Protocol** | Policy enforcement | โ
| โ
| โ
|
|
|
374
|
-
| x402 (Coinbase) | Payment rail | โ
| โ | โ |
|
|
375
|
-
| ERC-4337 | Account abstraction | โ
| โ EVM only | โ |
|
|
376
|
-
| Trust Wallet Agent Kit | Wallet interactions | โ
| Partial | โ |
|
|
377
|
-
| Cobo Agentic Wallet | Custody | โ Enterprise | โ | โ |
|
|
378
|
-
| Skyfire | Identity + settlement | โ | โ | โ |
|
|
422
|
+
| Solution | Layer | Open Source | Sui Native | simulate() | 3-line SDK |
|
|
423
|
+
|----------|-------|-------------|------------|------------|------------|
|
|
424
|
+
| **Edge Protocol** | Policy enforcement | โ
| โ
| โ
| โ
|
|
|
425
|
+
| x402 (Coinbase) | Payment rail | โ
| โ | โ | โ |
|
|
426
|
+
| ERC-4337 | Account abstraction | โ
| โ EVM only | โ | โ |
|
|
427
|
+
| Trust Wallet Agent Kit | Wallet interactions | โ
| Partial | โ | โ |
|
|
428
|
+
| Cobo Agentic Wallet | Custody | โ Enterprise | โ | โ | โ |
|
|
429
|
+
| Skyfire | Identity + settlement | โ | โ | โ | โ |
|
|
379
430
|
|
|
380
431
|
**Edge complements x402, it does not compete with it.**
|
|
381
432
|
|
|
382
|
-
x402 answers: *how does money move from agent to merchant?*
|
|
383
|
-
Edge answers: *should this agent be allowed to spend this money at all?*
|
|
384
|
-
|
|
385
|
-
```
|
|
386
|
-
Edge (policy layer) โ x402 (payment rail) โ Settlement
|
|
387
|
-
"is this allowed?" "move the money"
|
|
388
|
-
```
|
|
389
|
-
|
|
390
433
|
---
|
|
391
434
|
|
|
392
435
|
*The best infrastructure is invisible.*
|
|
@@ -1,81 +1,13 @@
|
|
|
1
1
|
import { EdgePassObject, TransactionRequest, PolicyValidation, SimulationResult, BudgetStatus } from '../utils/types';
|
|
2
2
|
export declare class PolicyEngine {
|
|
3
|
-
/**
|
|
4
|
-
* Validates a transaction request against an EdgePass policy.
|
|
5
|
-
*
|
|
6
|
-
* Rules (in order):
|
|
7
|
-
* 1. Pass must be active
|
|
8
|
-
* 2. Pass must not be expired
|
|
9
|
-
* 3. Merchant must be in approved list
|
|
10
|
-
* 4. Amount must not exceed remaining budget
|
|
11
|
-
* 5. Amount must not exceed maxPerTransaction (if set)
|
|
12
|
-
* 6. If amount > escalateThreshold โ escalate
|
|
13
|
-
* 7. If amount โค autoThreshold โ auto-approve
|
|
14
|
-
*/
|
|
15
3
|
static validate(pass: EdgePassObject, request: TransactionRequest): PolicyValidation;
|
|
16
|
-
/**
|
|
17
|
-
* Simulate a sequence of transactions against an EdgePass.
|
|
18
|
-
* Zero network calls. Returns predicted outcomes for all decisions
|
|
19
|
-
* including projected budget state after each step.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* const plan = sdk.simulate(pass, claudeDecisions);
|
|
23
|
-
* console.log(plan.approved.length); // decisions that will execute
|
|
24
|
-
* console.log(plan.blocked.length); // decisions that will be rejected
|
|
25
|
-
* console.log(plan.utilizationPct); // projected budget usage
|
|
26
|
-
*
|
|
27
|
-
* // Show plan to user, then execute approved decisions
|
|
28
|
-
* for (const decision of plan.approved) {
|
|
29
|
-
* await sdk.execute(pass, decision.request, signer);
|
|
30
|
-
* }
|
|
31
|
-
*/
|
|
32
4
|
static simulate(pass: EdgePassObject, requests: TransactionRequest[]): SimulationResult;
|
|
33
|
-
/**
|
|
34
|
-
* Returns true if the pass is active and not expired.
|
|
35
|
-
*/
|
|
36
5
|
static isValid(pass: EdgePassObject): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Returns the remaining budget in MIST.
|
|
39
|
-
*/
|
|
40
6
|
static remainingBudget(pass: EdgePassObject): bigint;
|
|
41
|
-
/**
|
|
42
|
-
* Returns budget utilization as a percentage (0-100).
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* const pct = sdk.utilizationPct(pass);
|
|
46
|
-
* if (pct > 80) warnUser('Running low on budget');
|
|
47
|
-
*/
|
|
48
7
|
static utilizationPct(pass: EdgePassObject): number;
|
|
49
|
-
/**
|
|
50
|
-
* Returns true if budget utilization exceeds the given threshold.
|
|
51
|
-
* Default threshold is 80%.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* if (sdk.isNearLimit(pass)) notifyUser('Budget nearly exhausted');
|
|
55
|
-
* if (sdk.isNearLimit(pass, 0.5)) notifyUser('Halfway through budget');
|
|
56
|
-
*/
|
|
57
8
|
static isNearLimit(pass: EdgePassObject, threshold?: number): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Returns a complete budget status snapshot.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* const status = sdk.budgetStatus(pass);
|
|
63
|
-
* if (status.isExhausted) stopAgent();
|
|
64
|
-
* if (status.isNearLimit) notifyUser(`${status.utilizationPct}% spent`);
|
|
65
|
-
*/
|
|
66
9
|
static budgetStatus(pass: EdgePassObject, nearLimitThreshold?: number): BudgetStatus;
|
|
67
|
-
/**
|
|
68
|
-
* Returns the time remaining on the pass in milliseconds.
|
|
69
|
-
* Returns 0 if expired.
|
|
70
|
-
*/
|
|
71
10
|
static timeRemaining(pass: EdgePassObject): number;
|
|
72
|
-
/**
|
|
73
|
-
* Returns true if the pass will expire within the given window.
|
|
74
|
-
* Default window is 1 hour.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* if (sdk.isExpiringSoon(pass)) notifyUser('Pass expires in less than 1 hour');
|
|
78
|
-
*/
|
|
79
11
|
static isExpiringSoon(pass: EdgePassObject, withinMs?: number): boolean;
|
|
80
12
|
}
|
|
81
13
|
//# sourceMappingURL=PolicyEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyEngine.d.ts","sourceRoot":"","sources":["../../src/core/PolicyEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAEhB,gBAAgB,EAChB,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,qBAAa,YAAY;IAEvB
|
|
1
|
+
{"version":3,"file":"PolicyEngine.d.ts","sourceRoot":"","sources":["../../src/core/PolicyEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAEhB,gBAAgB,EAChB,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,qBAAa,YAAY;IAEvB,MAAM,CAAC,QAAQ,CACb,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,kBAAkB,GAC1B,gBAAgB;IA8BnB,MAAM,CAAC,QAAQ,CACb,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,kBAAkB,EAAE,GAC7B,gBAAgB;IA2DnB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO;IAI7C,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAIpD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAKnD,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,SAAM,GAAG,OAAO;IAIlE,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,kBAAkB,SAAM,GAAG,YAAY;IAajF,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAIlD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,SAAiB,GAAG,OAAO;CAIhF"}
|
|
@@ -2,68 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PolicyEngine = void 0;
|
|
4
4
|
class PolicyEngine {
|
|
5
|
-
/**
|
|
6
|
-
* Validates a transaction request against an EdgePass policy.
|
|
7
|
-
*
|
|
8
|
-
* Rules (in order):
|
|
9
|
-
* 1. Pass must be active
|
|
10
|
-
* 2. Pass must not be expired
|
|
11
|
-
* 3. Merchant must be in approved list
|
|
12
|
-
* 4. Amount must not exceed remaining budget
|
|
13
|
-
* 5. Amount must not exceed maxPerTransaction (if set)
|
|
14
|
-
* 6. If amount > escalateThreshold โ escalate
|
|
15
|
-
* 7. If amount โค autoThreshold โ auto-approve
|
|
16
|
-
*/
|
|
17
5
|
static validate(pass, request) {
|
|
18
|
-
// Rule 1 โ pass must be active
|
|
19
6
|
if (!pass.active) {
|
|
20
7
|
return { allowed: false, requiresEscalation: false, reason: 'EdgePass is inactive' };
|
|
21
8
|
}
|
|
22
|
-
// Rule 2 โ pass must not be expired
|
|
23
9
|
if (Date.now() > pass.expiresAt) {
|
|
24
10
|
return { allowed: false, requiresEscalation: false, reason: 'EdgePass has expired' };
|
|
25
11
|
}
|
|
26
|
-
// Rule 3 โ merchant must be approved
|
|
27
12
|
if (!pass.config.approvedMerchants.includes(request.merchant)) {
|
|
28
13
|
return { allowed: false, requiresEscalation: false, reason: `Merchant "${request.merchant}" is not approved` };
|
|
29
14
|
}
|
|
30
|
-
// Rule 4 โ must not exceed remaining budget
|
|
31
15
|
const remaining = pass.config.budget - pass.spent;
|
|
32
16
|
if (request.amount > remaining) {
|
|
33
17
|
return { allowed: false, requiresEscalation: false, reason: `Insufficient budget. Remaining: ${remaining} MIST` };
|
|
34
18
|
}
|
|
35
|
-
// Rule 5 โ must not exceed per-transaction limit (if set)
|
|
36
19
|
if (pass.config.maxPerTransaction !== undefined && request.amount > pass.config.maxPerTransaction) {
|
|
37
20
|
return { allowed: false, requiresEscalation: false, reason: `Amount exceeds per-transaction limit of ${pass.config.maxPerTransaction} MIST` };
|
|
38
21
|
}
|
|
39
|
-
// Rule 6 โ escalate if above escalation threshold
|
|
40
22
|
if (request.amount > pass.config.escalateThreshold) {
|
|
41
23
|
return { allowed: true, requiresEscalation: true, reason: `Amount exceeds escalation threshold of ${pass.config.escalateThreshold} MIST` };
|
|
42
24
|
}
|
|
43
|
-
// Rule 7 โ auto-approve
|
|
44
25
|
return { allowed: true, requiresEscalation: false, reason: 'Auto-approved' };
|
|
45
26
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Simulate a sequence of transactions against an EdgePass.
|
|
48
|
-
* Zero network calls. Returns predicted outcomes for all decisions
|
|
49
|
-
* including projected budget state after each step.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* const plan = sdk.simulate(pass, claudeDecisions);
|
|
53
|
-
* console.log(plan.approved.length); // decisions that will execute
|
|
54
|
-
* console.log(plan.blocked.length); // decisions that will be rejected
|
|
55
|
-
* console.log(plan.utilizationPct); // projected budget usage
|
|
56
|
-
*
|
|
57
|
-
* // Show plan to user, then execute approved decisions
|
|
58
|
-
* for (const decision of plan.approved) {
|
|
59
|
-
* await sdk.execute(pass, decision.request, signer);
|
|
60
|
-
* }
|
|
61
|
-
*/
|
|
62
27
|
static simulate(pass, requests) {
|
|
63
28
|
const decisions = [];
|
|
64
29
|
let projectedSpent = pass.spent;
|
|
65
30
|
for (const request of requests) {
|
|
66
|
-
// Create a projected pass with current projected spent for validation
|
|
67
31
|
const projectedPass = {
|
|
68
32
|
...pass,
|
|
69
33
|
spent: projectedSpent,
|
|
@@ -76,28 +40,26 @@ class PolicyEngine {
|
|
|
76
40
|
}
|
|
77
41
|
else if (validation.requiresEscalation) {
|
|
78
42
|
outcome = 'escalated';
|
|
79
|
-
// Escalated decisions don't spend budget until approved
|
|
80
43
|
}
|
|
81
44
|
else {
|
|
82
45
|
outcome = 'approved';
|
|
83
46
|
nextSpent = projectedSpent + request.amount;
|
|
84
47
|
}
|
|
85
|
-
|
|
48
|
+
decisions.push({
|
|
86
49
|
request,
|
|
87
50
|
outcome,
|
|
88
51
|
reason: validation.reason,
|
|
89
52
|
projectedSpent: nextSpent,
|
|
90
53
|
projectedRemaining: pass.config.budget - nextSpent,
|
|
91
|
-
};
|
|
92
|
-
decisions.push(decision);
|
|
54
|
+
});
|
|
93
55
|
projectedSpent = nextSpent;
|
|
94
56
|
}
|
|
95
57
|
const approved = decisions.filter(d => d.outcome === 'approved');
|
|
96
58
|
const blocked = decisions.filter(d => d.outcome === 'blocked');
|
|
97
59
|
const escalated = decisions.filter(d => d.outcome === 'escalated');
|
|
98
|
-
const totalSpend = approved.reduce((sum, d) => sum + d.request.amount,
|
|
60
|
+
const totalSpend = approved.reduce((sum, d) => sum + d.request.amount, BigInt(0));
|
|
99
61
|
const remainingBudget = pass.config.budget - pass.spent - totalSpend;
|
|
100
|
-
const utilizationPct = Number((pass.spent + totalSpend) *
|
|
62
|
+
const utilizationPct = Number((pass.spent + totalSpend) * BigInt(100) / pass.config.budget);
|
|
101
63
|
return {
|
|
102
64
|
decisions,
|
|
103
65
|
approved,
|
|
@@ -114,49 +76,20 @@ class PolicyEngine {
|
|
|
114
76
|
},
|
|
115
77
|
};
|
|
116
78
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Returns true if the pass is active and not expired.
|
|
119
|
-
*/
|
|
120
79
|
static isValid(pass) {
|
|
121
80
|
return pass.active && Date.now() <= pass.expiresAt;
|
|
122
81
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Returns the remaining budget in MIST.
|
|
125
|
-
*/
|
|
126
82
|
static remainingBudget(pass) {
|
|
127
83
|
return pass.config.budget - pass.spent;
|
|
128
84
|
}
|
|
129
|
-
/**
|
|
130
|
-
* Returns budget utilization as a percentage (0-100).
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* const pct = sdk.utilizationPct(pass);
|
|
134
|
-
* if (pct > 80) warnUser('Running low on budget');
|
|
135
|
-
*/
|
|
136
85
|
static utilizationPct(pass) {
|
|
137
|
-
if (pass.config.budget ===
|
|
86
|
+
if (pass.config.budget === BigInt(0))
|
|
138
87
|
return 0;
|
|
139
|
-
return Number(pass.spent *
|
|
88
|
+
return Number(pass.spent * BigInt(100) / pass.config.budget);
|
|
140
89
|
}
|
|
141
|
-
/**
|
|
142
|
-
* Returns true if budget utilization exceeds the given threshold.
|
|
143
|
-
* Default threshold is 80%.
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* if (sdk.isNearLimit(pass)) notifyUser('Budget nearly exhausted');
|
|
147
|
-
* if (sdk.isNearLimit(pass, 0.5)) notifyUser('Halfway through budget');
|
|
148
|
-
*/
|
|
149
90
|
static isNearLimit(pass, threshold = 0.8) {
|
|
150
91
|
return PolicyEngine.utilizationPct(pass) >= threshold * 100;
|
|
151
92
|
}
|
|
152
|
-
/**
|
|
153
|
-
* Returns a complete budget status snapshot.
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
156
|
-
* const status = sdk.budgetStatus(pass);
|
|
157
|
-
* if (status.isExhausted) stopAgent();
|
|
158
|
-
* if (status.isNearLimit) notifyUser(`${status.utilizationPct}% spent`);
|
|
159
|
-
*/
|
|
160
93
|
static budgetStatus(pass, nearLimitThreshold = 0.8) {
|
|
161
94
|
const remaining = pass.config.budget - pass.spent;
|
|
162
95
|
const utilizationPct = PolicyEngine.utilizationPct(pass);
|
|
@@ -166,23 +99,12 @@ class PolicyEngine {
|
|
|
166
99
|
remaining,
|
|
167
100
|
utilizationPct,
|
|
168
101
|
isNearLimit: utilizationPct >= nearLimitThreshold * 100,
|
|
169
|
-
isExhausted: remaining ===
|
|
102
|
+
isExhausted: remaining === BigInt(0),
|
|
170
103
|
};
|
|
171
104
|
}
|
|
172
|
-
/**
|
|
173
|
-
* Returns the time remaining on the pass in milliseconds.
|
|
174
|
-
* Returns 0 if expired.
|
|
175
|
-
*/
|
|
176
105
|
static timeRemaining(pass) {
|
|
177
106
|
return Math.max(0, pass.expiresAt - Date.now());
|
|
178
107
|
}
|
|
179
|
-
/**
|
|
180
|
-
* Returns true if the pass will expire within the given window.
|
|
181
|
-
* Default window is 1 hour.
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* if (sdk.isExpiringSoon(pass)) notifyUser('Pass expires in less than 1 hour');
|
|
185
|
-
*/
|
|
186
108
|
static isExpiringSoon(pass, withinMs = 60 * 60 * 1000) {
|
|
187
109
|
const remaining = PolicyEngine.timeRemaining(pass);
|
|
188
110
|
return remaining > 0 && remaining <= withinMs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyEngine.js","sourceRoot":"","sources":["../../src/core/PolicyEngine.ts"],"names":[],"mappings":";;;AASA,MAAa,YAAY;IAEvB
|
|
1
|
+
{"version":3,"file":"PolicyEngine.js","sourceRoot":"","sources":["../../src/core/PolicyEngine.ts"],"names":[],"mappings":";;;AASA,MAAa,YAAY;IAEvB,MAAM,CAAC,QAAQ,CACb,IAAoB,EACpB,OAA2B;QAG3B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,sBA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EMPLATES: {
|
|
|
43
43
|
readonly expiryMs: number;
|
|
44
44
|
readonly approvedMerchants: string[];
|
|
45
45
|
};
|
|
46
|
+
readonly x402: {
|
|
47
|
+
readonly budget: bigint;
|
|
48
|
+
readonly autoThreshold: bigint;
|
|
49
|
+
readonly escalateThreshold: bigint;
|
|
50
|
+
readonly maxPerTransaction: bigint;
|
|
51
|
+
readonly expiryMs: number;
|
|
52
|
+
readonly approvedMerchants: string[];
|
|
53
|
+
};
|
|
46
54
|
};
|
|
47
55
|
export type EdgePassTemplate = keyof typeof EDGE_TEMPLATES;
|
|
48
56
|
export declare const FESTIVAL_MERCHANTS: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAI/C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIlD,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAqB,CAAC;AAIrD,eAAO,MAAM,cAAc;;;;;;;oCAOE,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;CAE3B,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,cAAc,CAAC;AAI3D,eAAO,MAAM,kBAAkB,UAM9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;CAK3B,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAI/C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIlD,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAqB,CAAC;AAIrD,eAAO,MAAM,cAAc;;;;;;;oCAOE,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;;;;;;;oCAQR,MAAM,EAAE;;;;;;;;oCAWR,MAAM,EAAE;;CAE3B,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,cAAc,CAAC;AAI3D,eAAO,MAAM,kBAAkB,UAM9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;CAK3B,CAAC"}
|
package/dist/utils/constants.js
CHANGED
|
@@ -55,6 +55,17 @@ exports.EDGE_TEMPLATES = {
|
|
|
55
55
|
expiryMs: 30 * 24 * 60 * 60 * 1000,
|
|
56
56
|
approvedMerchants: [],
|
|
57
57
|
},
|
|
58
|
+
// x402 โ designed for Coinbase x402 payment protocol integration
|
|
59
|
+
// Edge validates policy (should this agent pay?), x402 moves the money (how does it pay?)
|
|
60
|
+
// Together they form a complete autonomous payment stack.
|
|
61
|
+
x402: {
|
|
62
|
+
budget: BigInt(1000) * exports.MIST_PER_SUI,
|
|
63
|
+
autoThreshold: BigInt(10) * exports.MIST_PER_SUI,
|
|
64
|
+
escalateThreshold: BigInt(100) * exports.MIST_PER_SUI,
|
|
65
|
+
maxPerTransaction: BigInt(200) * exports.MIST_PER_SUI,
|
|
66
|
+
expiryMs: 24 * 60 * 60 * 1000,
|
|
67
|
+
approvedMerchants: [],
|
|
68
|
+
},
|
|
58
69
|
};
|
|
59
70
|
// โโ Legacy festival constants (kept for backwards compat) โโโโโโโโโโโโโโโโโ
|
|
60
71
|
exports.FESTIVAL_MERCHANTS = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"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