@agent-shield/sdk 0.3.0 → 0.4.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 +11 -4
- package/dist/idl-json.d.ts.map +1 -1
- package/dist/idl-json.js +2019 -2941
- package/dist/idl-json.js.map +1 -1
- package/dist/idl.d.ts +1402 -2056
- package/dist/idl.d.ts.map +1 -1
- package/dist/instructions.d.ts +893 -893
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ const sig = await client.executeJupiterSwap({
|
|
|
61
61
|
|
|
62
62
|
## On-Chain Account Model
|
|
63
63
|
|
|
64
|
-
AgentShield uses
|
|
64
|
+
AgentShield uses 5 PDA account types:
|
|
65
65
|
|
|
66
66
|
| Account | Seeds | Description |
|
|
67
67
|
|---------|-------|-------------|
|
|
@@ -69,6 +69,7 @@ AgentShield uses 4 PDA account types:
|
|
|
69
69
|
| **PolicyConfig** | `[b"policy", vault]` | Spending caps, token/protocol whitelists, leverage limits |
|
|
70
70
|
| **SpendTracker** | `[b"tracker", vault]` | Rolling 24h spend entries + bounded audit log (max 50 txs) |
|
|
71
71
|
| **SessionAuthority** | `[b"session", vault, agent, token_mint]` | Ephemeral PDA for atomic transaction validation (expires after 20 slots) |
|
|
72
|
+
| **PendingPolicyUpdate** | `[b"pending_policy", vault]` | Queued policy change with timelock, applied after delay |
|
|
72
73
|
|
|
73
74
|
## Instruction Composition Pattern
|
|
74
75
|
|
|
@@ -165,7 +166,7 @@ const tracker = await client.fetchTrackerByAddress(trackerPDA);
|
|
|
165
166
|
|
|
166
167
|
### Instruction Parameters
|
|
167
168
|
|
|
168
|
-
- **`InitializeVaultParams`** — `vaultId`, `dailySpendingCapUsd`, `maxTransactionSizeUsd`, `allowedTokens` (`AllowedToken[]`), `allowedProtocols`, `maxLeverageBps`, `maxConcurrentPositions`, `feeDestination`
|
|
169
|
+
- **`InitializeVaultParams`** — `vaultId`, `dailySpendingCapUsd`, `maxTransactionSizeUsd`, `allowedTokens` (`AllowedToken[]`), `allowedProtocols`, `maxLeverageBps`, `maxConcurrentPositions`, `feeDestination`, `trackerTier?` (`TrackerTier` — defaults to Standard)
|
|
169
170
|
- **`UpdatePolicyParams`** — All policy fields as optionals (only set fields are updated)
|
|
170
171
|
- **`AuthorizeParams`** — `actionType`, `tokenMint`, `amount`, `targetProtocol`, `leverageBps?`
|
|
171
172
|
- **`ComposeActionParams`** — Full params for composed transactions including `defiInstructions`, `success?`, token accounts
|
|
@@ -174,7 +175,7 @@ const tracker = await client.fetchTrackerByAddress(trackerPDA);
|
|
|
174
175
|
|
|
175
176
|
- **`AgentVaultAccount`** — owner, agent, feeDestination, vaultId, status, stats (totalTransactions, totalVolume)
|
|
176
177
|
- **`PolicyConfigAccount`** — dailySpendingCapUsd, maxTransactionSizeUsd, allowedTokens (`AllowedToken[]`), allowedProtocols, maxLeverageBps, maxConcurrentPositions, developerFeeRate
|
|
177
|
-
- **`SpendTrackerAccount`** — rollingSpends (`SpendEntry[]` with
|
|
178
|
+
- **`SpendTrackerAccount`** — trackerTier, maxSpendEntries, rollingSpends (`SpendEntry[]` with tokenIndex, usdAmount, baseAmount, timestamp), recentTransactions (audit log, max 50)
|
|
178
179
|
- **`SessionAuthorityAccount`** — vault, agent, actionType, expiresAt, delegated, delegationTokenAccount
|
|
179
180
|
|
|
180
181
|
### Enums
|
|
@@ -239,7 +240,7 @@ Owner creates vault with policy → Agent operates within policy constraints
|
|
|
239
240
|
| Rolling 24h window | Not calendar-day. Prevents edge-case burst at midnight. |
|
|
240
241
|
| Fees at finalization only | Not at authorization. Prevents fee charging on failed txs. |
|
|
241
242
|
| Immutable fee destination | Prevents owner from changing fee recipient after vault creation. |
|
|
242
|
-
| Bounded vectors | Max 10 tokens, 10 protocols,
|
|
243
|
+
| Bounded vectors | Max 10 tokens, 10 protocols, 200/500/1000 spend entries (by TrackerTier), 50 audit records. |
|
|
243
244
|
|
|
244
245
|
### Policy Constraints
|
|
245
246
|
|
|
@@ -294,6 +295,12 @@ IDL account: `Ev3gSzxLw6RwExAMpTHUKvn2o9YVULxiWehrHee7aepP`
|
|
|
294
295
|
| [`@agent-shield/plugin-solana-agent-kit`](https://www.npmjs.com/package/@agent-shield/plugin-solana-agent-kit) | Solana Agent Kit integration |
|
|
295
296
|
| [`@agent-shield/plugin-elizaos`](https://www.npmjs.com/package/@agent-shield/plugin-elizaos) | ElizaOS integration |
|
|
296
297
|
|
|
298
|
+
## Support
|
|
299
|
+
|
|
300
|
+
- X/Twitter: [@MightieMags](https://x.com/MightieMags)
|
|
301
|
+
- Telegram: [MightyMags](https://t.me/MightyMags)
|
|
302
|
+
- Issues: [GitHub Issues](https://github.com/Kaleb-Rupe/agentshield/issues)
|
|
303
|
+
|
|
297
304
|
## License
|
|
298
305
|
|
|
299
306
|
MIT
|
package/dist/idl-json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idl-json.d.ts","sourceRoot":"","sources":["../src/idl-json.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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