@agent-shield/sdk 0.1.6 → 0.3.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 +14 -12
- package/dist/accounts.d.ts +5 -3
- package/dist/accounts.d.ts.map +1 -1
- package/dist/accounts.js +23 -4
- package/dist/accounts.js.map +1 -1
- package/dist/client.d.ts +24 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +73 -9
- package/dist/client.js.map +1 -1
- package/dist/composer.d.ts.map +1 -1
- package/dist/composer.js +3 -3
- package/dist/composer.js.map +1 -1
- package/dist/idl-json.d.ts +731 -33
- package/dist/idl-json.d.ts.map +1 -1
- package/dist/idl-json.js +1258 -54
- package/dist/idl-json.js.map +1 -1
- package/dist/idl.d.ts +1363 -159
- package/dist/idl.d.ts.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +658 -64
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +78 -8
- package/dist/instructions.js.map +1 -1
- package/dist/integrations/flash-trade.d.ts.map +1 -1
- package/dist/integrations/flash-trade.js +14 -6
- package/dist/integrations/flash-trade.js.map +1 -1
- package/dist/integrations/jupiter.d.ts.map +1 -1
- package/dist/integrations/jupiter.js +4 -1
- package/dist/integrations/jupiter.js.map +1 -1
- package/dist/oracle.d.ts +31 -0
- package/dist/oracle.d.ts.map +1 -0
- package/dist/oracle.js +57 -0
- package/dist/oracle.js.map +1 -0
- package/dist/rewriter.d.ts +21 -0
- package/dist/rewriter.d.ts.map +1 -0
- package/dist/rewriter.js +33 -0
- package/dist/rewriter.js.map +1 -0
- package/dist/types.d.ts +109 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +15 -1
- package/dist/types.js.map +1 -1
- package/dist/wrap.d.ts +60 -0
- package/dist/wrap.d.ts.map +1 -0
- package/dist/wrap.js +88 -0
- package/dist/wrap.js.map +1 -0
- package/package.json +13 -2
package/dist/idl-json.js
CHANGED
|
@@ -13,6 +13,374 @@ exports.IDL = {
|
|
|
13
13
|
"description": "AI Agent Financial Middleware for Solana - Permission controls, spending limits, and audit infrastructure for autonomous agents"
|
|
14
14
|
},
|
|
15
15
|
"instructions": [
|
|
16
|
+
{
|
|
17
|
+
"name": "agent_transfer",
|
|
18
|
+
"docs": [
|
|
19
|
+
"Transfer tokens from the vault to an allowed destination.",
|
|
20
|
+
"Only the agent can call this. Respects destination allowlist,",
|
|
21
|
+
"spending caps, and per-token limits."
|
|
22
|
+
],
|
|
23
|
+
"discriminator": [
|
|
24
|
+
199,
|
|
25
|
+
111,
|
|
26
|
+
151,
|
|
27
|
+
49,
|
|
28
|
+
124,
|
|
29
|
+
13,
|
|
30
|
+
150,
|
|
31
|
+
44
|
|
32
|
+
],
|
|
33
|
+
"accounts": [
|
|
34
|
+
{
|
|
35
|
+
"name": "agent",
|
|
36
|
+
"writable": true,
|
|
37
|
+
"signer": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "vault",
|
|
41
|
+
"writable": true,
|
|
42
|
+
"pda": {
|
|
43
|
+
"seeds": [
|
|
44
|
+
{
|
|
45
|
+
"kind": "const",
|
|
46
|
+
"value": [
|
|
47
|
+
118,
|
|
48
|
+
97,
|
|
49
|
+
117,
|
|
50
|
+
108,
|
|
51
|
+
116
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"kind": "account",
|
|
56
|
+
"path": "vault.owner",
|
|
57
|
+
"account": "AgentVault"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"kind": "account",
|
|
61
|
+
"path": "vault.vault_id",
|
|
62
|
+
"account": "AgentVault"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"relations": [
|
|
67
|
+
"policy",
|
|
68
|
+
"tracker"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "policy",
|
|
73
|
+
"pda": {
|
|
74
|
+
"seeds": [
|
|
75
|
+
{
|
|
76
|
+
"kind": "const",
|
|
77
|
+
"value": [
|
|
78
|
+
112,
|
|
79
|
+
111,
|
|
80
|
+
108,
|
|
81
|
+
105,
|
|
82
|
+
99,
|
|
83
|
+
121
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"kind": "account",
|
|
88
|
+
"path": "vault"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "tracker",
|
|
95
|
+
"writable": true,
|
|
96
|
+
"pda": {
|
|
97
|
+
"seeds": [
|
|
98
|
+
{
|
|
99
|
+
"kind": "const",
|
|
100
|
+
"value": [
|
|
101
|
+
116,
|
|
102
|
+
114,
|
|
103
|
+
97,
|
|
104
|
+
99,
|
|
105
|
+
107,
|
|
106
|
+
101,
|
|
107
|
+
114
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"kind": "account",
|
|
112
|
+
"path": "vault"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "vault_token_account",
|
|
119
|
+
"docs": [
|
|
120
|
+
"Vault's PDA-owned token account (source)"
|
|
121
|
+
],
|
|
122
|
+
"writable": true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "destination_token_account",
|
|
126
|
+
"docs": [
|
|
127
|
+
"Destination token account (must be in allowed destinations if configured)"
|
|
128
|
+
],
|
|
129
|
+
"writable": true
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "fee_destination_token_account",
|
|
133
|
+
"docs": [
|
|
134
|
+
"Developer fee destination token account \u2014 must match vault.fee_destination"
|
|
135
|
+
],
|
|
136
|
+
"writable": true,
|
|
137
|
+
"optional": true
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "protocol_treasury_token_account",
|
|
141
|
+
"docs": [
|
|
142
|
+
"Protocol treasury token account"
|
|
143
|
+
],
|
|
144
|
+
"writable": true,
|
|
145
|
+
"optional": true
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "token_program",
|
|
149
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"args": [
|
|
153
|
+
{
|
|
154
|
+
"name": "amount",
|
|
155
|
+
"type": "u64"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "apply_pending_policy",
|
|
161
|
+
"docs": [
|
|
162
|
+
"Apply a queued policy update after the timelock period has expired.",
|
|
163
|
+
"Closes the PendingPolicyUpdate PDA and returns rent to the owner."
|
|
164
|
+
],
|
|
165
|
+
"discriminator": [
|
|
166
|
+
114,
|
|
167
|
+
212,
|
|
168
|
+
19,
|
|
169
|
+
227,
|
|
170
|
+
89,
|
|
171
|
+
199,
|
|
172
|
+
74,
|
|
173
|
+
62
|
|
174
|
+
],
|
|
175
|
+
"accounts": [
|
|
176
|
+
{
|
|
177
|
+
"name": "owner",
|
|
178
|
+
"writable": true,
|
|
179
|
+
"signer": true,
|
|
180
|
+
"relations": [
|
|
181
|
+
"vault"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "vault",
|
|
186
|
+
"pda": {
|
|
187
|
+
"seeds": [
|
|
188
|
+
{
|
|
189
|
+
"kind": "const",
|
|
190
|
+
"value": [
|
|
191
|
+
118,
|
|
192
|
+
97,
|
|
193
|
+
117,
|
|
194
|
+
108,
|
|
195
|
+
116
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"kind": "account",
|
|
200
|
+
"path": "owner"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"kind": "account",
|
|
204
|
+
"path": "vault.vault_id",
|
|
205
|
+
"account": "AgentVault"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"relations": [
|
|
210
|
+
"policy",
|
|
211
|
+
"tracker",
|
|
212
|
+
"pending_policy"
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "policy",
|
|
217
|
+
"writable": true,
|
|
218
|
+
"pda": {
|
|
219
|
+
"seeds": [
|
|
220
|
+
{
|
|
221
|
+
"kind": "const",
|
|
222
|
+
"value": [
|
|
223
|
+
112,
|
|
224
|
+
111,
|
|
225
|
+
108,
|
|
226
|
+
105,
|
|
227
|
+
99,
|
|
228
|
+
121
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"kind": "account",
|
|
233
|
+
"path": "vault"
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "tracker",
|
|
240
|
+
"writable": true,
|
|
241
|
+
"pda": {
|
|
242
|
+
"seeds": [
|
|
243
|
+
{
|
|
244
|
+
"kind": "const",
|
|
245
|
+
"value": [
|
|
246
|
+
116,
|
|
247
|
+
114,
|
|
248
|
+
97,
|
|
249
|
+
99,
|
|
250
|
+
107,
|
|
251
|
+
101,
|
|
252
|
+
114
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"kind": "account",
|
|
257
|
+
"path": "vault"
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "pending_policy",
|
|
264
|
+
"writable": true,
|
|
265
|
+
"pda": {
|
|
266
|
+
"seeds": [
|
|
267
|
+
{
|
|
268
|
+
"kind": "const",
|
|
269
|
+
"value": [
|
|
270
|
+
112,
|
|
271
|
+
101,
|
|
272
|
+
110,
|
|
273
|
+
100,
|
|
274
|
+
105,
|
|
275
|
+
110,
|
|
276
|
+
103,
|
|
277
|
+
95,
|
|
278
|
+
112,
|
|
279
|
+
111,
|
|
280
|
+
108,
|
|
281
|
+
105,
|
|
282
|
+
99,
|
|
283
|
+
121
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"kind": "account",
|
|
288
|
+
"path": "vault"
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"args": []
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "cancel_pending_policy",
|
|
298
|
+
"docs": [
|
|
299
|
+
"Cancel a queued policy update. Closes the PendingPolicyUpdate PDA",
|
|
300
|
+
"and returns rent to the owner."
|
|
301
|
+
],
|
|
302
|
+
"discriminator": [
|
|
303
|
+
153,
|
|
304
|
+
36,
|
|
305
|
+
104,
|
|
306
|
+
200,
|
|
307
|
+
50,
|
|
308
|
+
94,
|
|
309
|
+
207,
|
|
310
|
+
33
|
|
311
|
+
],
|
|
312
|
+
"accounts": [
|
|
313
|
+
{
|
|
314
|
+
"name": "owner",
|
|
315
|
+
"writable": true,
|
|
316
|
+
"signer": true,
|
|
317
|
+
"relations": [
|
|
318
|
+
"vault"
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "vault",
|
|
323
|
+
"pda": {
|
|
324
|
+
"seeds": [
|
|
325
|
+
{
|
|
326
|
+
"kind": "const",
|
|
327
|
+
"value": [
|
|
328
|
+
118,
|
|
329
|
+
97,
|
|
330
|
+
117,
|
|
331
|
+
108,
|
|
332
|
+
116
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"kind": "account",
|
|
337
|
+
"path": "owner"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"kind": "account",
|
|
341
|
+
"path": "vault.vault_id",
|
|
342
|
+
"account": "AgentVault"
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
"relations": [
|
|
347
|
+
"pending_policy"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"name": "pending_policy",
|
|
352
|
+
"writable": true,
|
|
353
|
+
"pda": {
|
|
354
|
+
"seeds": [
|
|
355
|
+
{
|
|
356
|
+
"kind": "const",
|
|
357
|
+
"value": [
|
|
358
|
+
112,
|
|
359
|
+
101,
|
|
360
|
+
110,
|
|
361
|
+
100,
|
|
362
|
+
105,
|
|
363
|
+
110,
|
|
364
|
+
103,
|
|
365
|
+
95,
|
|
366
|
+
112,
|
|
367
|
+
111,
|
|
368
|
+
108,
|
|
369
|
+
105,
|
|
370
|
+
99,
|
|
371
|
+
121
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"kind": "account",
|
|
376
|
+
"path": "vault"
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
"args": []
|
|
383
|
+
},
|
|
16
384
|
{
|
|
17
385
|
"name": "close_vault",
|
|
18
386
|
"docs": [
|
|
@@ -387,7 +755,8 @@ exports.IDL = {
|
|
|
387
755
|
"name": "finalize_session",
|
|
388
756
|
"docs": [
|
|
389
757
|
"Finalize a session after the DeFi action completes.",
|
|
390
|
-
"
|
|
758
|
+
"Revokes token delegation, collects fees, closes the SessionAuthority PDA,",
|
|
759
|
+
"and records the transaction in the audit log.",
|
|
391
760
|
"Can be called by the agent or permissionlessly (for cleanup of expired sessions)."
|
|
392
761
|
],
|
|
393
762
|
"discriminator": [
|
|
@@ -489,7 +858,8 @@ exports.IDL = {
|
|
|
489
858
|
"name": "session",
|
|
490
859
|
"docs": [
|
|
491
860
|
"Session rent is returned to the session's agent (who paid for it),",
|
|
492
|
-
"not the arbitrary payer, to prevent rent theft."
|
|
861
|
+
"not the arbitrary payer, to prevent rent theft.",
|
|
862
|
+
"Seeds include token_mint for per-token concurrent sessions."
|
|
493
863
|
],
|
|
494
864
|
"writable": true,
|
|
495
865
|
"pda": {
|
|
@@ -514,6 +884,11 @@ exports.IDL = {
|
|
|
514
884
|
"kind": "account",
|
|
515
885
|
"path": "session.agent",
|
|
516
886
|
"account": "SessionAuthority"
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"kind": "account",
|
|
890
|
+
"path": "session.authorized_token",
|
|
891
|
+
"account": "SessionAuthority"
|
|
517
892
|
}
|
|
518
893
|
]
|
|
519
894
|
}
|
|
@@ -528,7 +903,7 @@ exports.IDL = {
|
|
|
528
903
|
{
|
|
529
904
|
"name": "vault_token_account",
|
|
530
905
|
"docs": [
|
|
531
|
-
"Vault's PDA token account for the session's token (fee source)"
|
|
906
|
+
"Vault's PDA token account for the session's token (fee source + delegation revocation)"
|
|
532
907
|
],
|
|
533
908
|
"writable": true,
|
|
534
909
|
"optional": true
|
|
@@ -569,7 +944,8 @@ exports.IDL = {
|
|
|
569
944
|
"name": "initialize_vault",
|
|
570
945
|
"docs": [
|
|
571
946
|
"Initialize a new agent vault with policy configuration.",
|
|
572
|
-
"Only the owner can call this. Creates vault PDA, policy PDA, and spend tracker PDA."
|
|
947
|
+
"Only the owner can call this. Creates vault PDA, policy PDA, and spend tracker PDA.",
|
|
948
|
+
"`tracker_tier`: 0 = Standard (200 entries), 1 = Pro (500), 2 = Max (1000)."
|
|
573
949
|
],
|
|
574
950
|
"discriminator": [
|
|
575
951
|
48,
|
|
@@ -650,7 +1026,183 @@ exports.IDL = {
|
|
|
650
1026
|
99,
|
|
651
1027
|
107,
|
|
652
1028
|
101,
|
|
653
|
-
114
|
|
1029
|
+
114
|
|
1030
|
+
]
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
"kind": "account",
|
|
1034
|
+
"path": "vault"
|
|
1035
|
+
}
|
|
1036
|
+
]
|
|
1037
|
+
}
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"name": "fee_destination",
|
|
1041
|
+
"docs": [
|
|
1042
|
+
"The protocol treasury that receives fees"
|
|
1043
|
+
]
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
"name": "system_program",
|
|
1047
|
+
"address": "11111111111111111111111111111111"
|
|
1048
|
+
}
|
|
1049
|
+
],
|
|
1050
|
+
"args": [
|
|
1051
|
+
{
|
|
1052
|
+
"name": "vault_id",
|
|
1053
|
+
"type": "u64"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"name": "daily_spending_cap_usd",
|
|
1057
|
+
"type": "u64"
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
"name": "max_transaction_size_usd",
|
|
1061
|
+
"type": "u64"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"name": "allowed_tokens",
|
|
1065
|
+
"type": {
|
|
1066
|
+
"vec": {
|
|
1067
|
+
"defined": {
|
|
1068
|
+
"name": "AllowedToken"
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"name": "allowed_protocols",
|
|
1075
|
+
"type": {
|
|
1076
|
+
"vec": "pubkey"
|
|
1077
|
+
}
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"name": "max_leverage_bps",
|
|
1081
|
+
"type": "u16"
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
"name": "max_concurrent_positions",
|
|
1085
|
+
"type": "u8"
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"name": "developer_fee_rate",
|
|
1089
|
+
"type": "u16"
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
"name": "timelock_duration",
|
|
1093
|
+
"type": "u64"
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
"name": "allowed_destinations",
|
|
1097
|
+
"type": {
|
|
1098
|
+
"vec": "pubkey"
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"name": "tracker_tier",
|
|
1103
|
+
"type": "u8"
|
|
1104
|
+
}
|
|
1105
|
+
]
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"name": "queue_policy_update",
|
|
1109
|
+
"docs": [
|
|
1110
|
+
"Queue a policy update when timelock is active.",
|
|
1111
|
+
"Creates a PendingPolicyUpdate PDA that becomes executable after",
|
|
1112
|
+
"the timelock period expires."
|
|
1113
|
+
],
|
|
1114
|
+
"discriminator": [
|
|
1115
|
+
149,
|
|
1116
|
+
18,
|
|
1117
|
+
76,
|
|
1118
|
+
197,
|
|
1119
|
+
179,
|
|
1120
|
+
193,
|
|
1121
|
+
91,
|
|
1122
|
+
77
|
|
1123
|
+
],
|
|
1124
|
+
"accounts": [
|
|
1125
|
+
{
|
|
1126
|
+
"name": "owner",
|
|
1127
|
+
"writable": true,
|
|
1128
|
+
"signer": true,
|
|
1129
|
+
"relations": [
|
|
1130
|
+
"vault"
|
|
1131
|
+
]
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
"name": "vault",
|
|
1135
|
+
"pda": {
|
|
1136
|
+
"seeds": [
|
|
1137
|
+
{
|
|
1138
|
+
"kind": "const",
|
|
1139
|
+
"value": [
|
|
1140
|
+
118,
|
|
1141
|
+
97,
|
|
1142
|
+
117,
|
|
1143
|
+
108,
|
|
1144
|
+
116
|
|
1145
|
+
]
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
"kind": "account",
|
|
1149
|
+
"path": "owner"
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
"kind": "account",
|
|
1153
|
+
"path": "vault.vault_id",
|
|
1154
|
+
"account": "AgentVault"
|
|
1155
|
+
}
|
|
1156
|
+
]
|
|
1157
|
+
},
|
|
1158
|
+
"relations": [
|
|
1159
|
+
"policy"
|
|
1160
|
+
]
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
"name": "policy",
|
|
1164
|
+
"pda": {
|
|
1165
|
+
"seeds": [
|
|
1166
|
+
{
|
|
1167
|
+
"kind": "const",
|
|
1168
|
+
"value": [
|
|
1169
|
+
112,
|
|
1170
|
+
111,
|
|
1171
|
+
108,
|
|
1172
|
+
105,
|
|
1173
|
+
99,
|
|
1174
|
+
121
|
|
1175
|
+
]
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
"kind": "account",
|
|
1179
|
+
"path": "vault"
|
|
1180
|
+
}
|
|
1181
|
+
]
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"name": "pending_policy",
|
|
1186
|
+
"writable": true,
|
|
1187
|
+
"pda": {
|
|
1188
|
+
"seeds": [
|
|
1189
|
+
{
|
|
1190
|
+
"kind": "const",
|
|
1191
|
+
"value": [
|
|
1192
|
+
112,
|
|
1193
|
+
101,
|
|
1194
|
+
110,
|
|
1195
|
+
100,
|
|
1196
|
+
105,
|
|
1197
|
+
110,
|
|
1198
|
+
103,
|
|
1199
|
+
95,
|
|
1200
|
+
112,
|
|
1201
|
+
111,
|
|
1202
|
+
108,
|
|
1203
|
+
105,
|
|
1204
|
+
99,
|
|
1205
|
+
121
|
|
654
1206
|
]
|
|
655
1207
|
},
|
|
656
1208
|
{
|
|
@@ -660,12 +1212,6 @@ exports.IDL = {
|
|
|
660
1212
|
]
|
|
661
1213
|
}
|
|
662
1214
|
},
|
|
663
|
-
{
|
|
664
|
-
"name": "fee_destination",
|
|
665
|
-
"docs": [
|
|
666
|
-
"The protocol treasury that receives fees"
|
|
667
|
-
]
|
|
668
|
-
},
|
|
669
1215
|
{
|
|
670
1216
|
"name": "system_program",
|
|
671
1217
|
"address": "11111111111111111111111111111111"
|
|
@@ -673,40 +1219,74 @@ exports.IDL = {
|
|
|
673
1219
|
],
|
|
674
1220
|
"args": [
|
|
675
1221
|
{
|
|
676
|
-
"name": "
|
|
677
|
-
"type":
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
"name": "daily_spending_cap",
|
|
681
|
-
"type": "u64"
|
|
1222
|
+
"name": "daily_spending_cap_usd",
|
|
1223
|
+
"type": {
|
|
1224
|
+
"option": "u64"
|
|
1225
|
+
}
|
|
682
1226
|
},
|
|
683
1227
|
{
|
|
684
|
-
"name": "
|
|
685
|
-
"type":
|
|
1228
|
+
"name": "max_transaction_amount_usd",
|
|
1229
|
+
"type": {
|
|
1230
|
+
"option": "u64"
|
|
1231
|
+
}
|
|
686
1232
|
},
|
|
687
1233
|
{
|
|
688
1234
|
"name": "allowed_tokens",
|
|
689
1235
|
"type": {
|
|
690
|
-
"
|
|
1236
|
+
"option": {
|
|
1237
|
+
"vec": {
|
|
1238
|
+
"defined": {
|
|
1239
|
+
"name": "AllowedToken"
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
691
1243
|
}
|
|
692
1244
|
},
|
|
693
1245
|
{
|
|
694
1246
|
"name": "allowed_protocols",
|
|
695
1247
|
"type": {
|
|
696
|
-
"
|
|
1248
|
+
"option": {
|
|
1249
|
+
"vec": "pubkey"
|
|
1250
|
+
}
|
|
697
1251
|
}
|
|
698
1252
|
},
|
|
699
1253
|
{
|
|
700
1254
|
"name": "max_leverage_bps",
|
|
701
|
-
"type":
|
|
1255
|
+
"type": {
|
|
1256
|
+
"option": "u16"
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
"name": "can_open_positions",
|
|
1261
|
+
"type": {
|
|
1262
|
+
"option": "bool"
|
|
1263
|
+
}
|
|
702
1264
|
},
|
|
703
1265
|
{
|
|
704
1266
|
"name": "max_concurrent_positions",
|
|
705
|
-
"type":
|
|
1267
|
+
"type": {
|
|
1268
|
+
"option": "u8"
|
|
1269
|
+
}
|
|
706
1270
|
},
|
|
707
1271
|
{
|
|
708
1272
|
"name": "developer_fee_rate",
|
|
709
|
-
"type":
|
|
1273
|
+
"type": {
|
|
1274
|
+
"option": "u16"
|
|
1275
|
+
}
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
"name": "timelock_duration",
|
|
1279
|
+
"type": {
|
|
1280
|
+
"option": "u64"
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
"name": "allowed_destinations",
|
|
1285
|
+
"type": {
|
|
1286
|
+
"option": {
|
|
1287
|
+
"vec": "pubkey"
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
710
1290
|
}
|
|
711
1291
|
]
|
|
712
1292
|
},
|
|
@@ -888,7 +1468,8 @@ exports.IDL = {
|
|
|
888
1468
|
"name": "update_policy",
|
|
889
1469
|
"docs": [
|
|
890
1470
|
"Update the policy configuration for a vault.",
|
|
891
|
-
"Only the owner can call this. Cannot be called by the agent."
|
|
1471
|
+
"Only the owner can call this. Cannot be called by the agent.",
|
|
1472
|
+
"Blocked when timelock_duration > 0 \u2014 use queue_policy_update instead."
|
|
892
1473
|
],
|
|
893
1474
|
"discriminator": [
|
|
894
1475
|
212,
|
|
@@ -934,7 +1515,8 @@ exports.IDL = {
|
|
|
934
1515
|
]
|
|
935
1516
|
},
|
|
936
1517
|
"relations": [
|
|
937
|
-
"policy"
|
|
1518
|
+
"policy",
|
|
1519
|
+
"tracker"
|
|
938
1520
|
]
|
|
939
1521
|
},
|
|
940
1522
|
{
|
|
@@ -959,17 +1541,41 @@ exports.IDL = {
|
|
|
959
1541
|
}
|
|
960
1542
|
]
|
|
961
1543
|
}
|
|
1544
|
+
},
|
|
1545
|
+
{
|
|
1546
|
+
"name": "tracker",
|
|
1547
|
+
"writable": true,
|
|
1548
|
+
"pda": {
|
|
1549
|
+
"seeds": [
|
|
1550
|
+
{
|
|
1551
|
+
"kind": "const",
|
|
1552
|
+
"value": [
|
|
1553
|
+
116,
|
|
1554
|
+
114,
|
|
1555
|
+
97,
|
|
1556
|
+
99,
|
|
1557
|
+
107,
|
|
1558
|
+
101,
|
|
1559
|
+
114
|
|
1560
|
+
]
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
"kind": "account",
|
|
1564
|
+
"path": "vault"
|
|
1565
|
+
}
|
|
1566
|
+
]
|
|
1567
|
+
}
|
|
962
1568
|
}
|
|
963
1569
|
],
|
|
964
1570
|
"args": [
|
|
965
1571
|
{
|
|
966
|
-
"name": "
|
|
1572
|
+
"name": "daily_spending_cap_usd",
|
|
967
1573
|
"type": {
|
|
968
1574
|
"option": "u64"
|
|
969
1575
|
}
|
|
970
1576
|
},
|
|
971
1577
|
{
|
|
972
|
-
"name": "
|
|
1578
|
+
"name": "max_transaction_size_usd",
|
|
973
1579
|
"type": {
|
|
974
1580
|
"option": "u64"
|
|
975
1581
|
}
|
|
@@ -978,7 +1584,11 @@ exports.IDL = {
|
|
|
978
1584
|
"name": "allowed_tokens",
|
|
979
1585
|
"type": {
|
|
980
1586
|
"option": {
|
|
981
|
-
"vec":
|
|
1587
|
+
"vec": {
|
|
1588
|
+
"defined": {
|
|
1589
|
+
"name": "AllowedToken"
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
982
1592
|
}
|
|
983
1593
|
}
|
|
984
1594
|
},
|
|
@@ -1013,6 +1623,20 @@ exports.IDL = {
|
|
|
1013
1623
|
"type": {
|
|
1014
1624
|
"option": "u16"
|
|
1015
1625
|
}
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"name": "timelock_duration",
|
|
1629
|
+
"type": {
|
|
1630
|
+
"option": "u64"
|
|
1631
|
+
}
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
"name": "allowed_destinations",
|
|
1635
|
+
"type": {
|
|
1636
|
+
"option": {
|
|
1637
|
+
"vec": "pubkey"
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1016
1640
|
}
|
|
1017
1641
|
]
|
|
1018
1642
|
},
|
|
@@ -1020,8 +1644,9 @@ exports.IDL = {
|
|
|
1020
1644
|
"name": "validate_and_authorize",
|
|
1021
1645
|
"docs": [
|
|
1022
1646
|
"Core permission check. Called by the agent before a DeFi action.",
|
|
1023
|
-
"Validates the action against all policy constraints.",
|
|
1024
|
-
"If approved, creates a SessionAuthority PDA
|
|
1647
|
+
"Validates the action against all policy constraints (USD caps, per-token caps).",
|
|
1648
|
+
"If approved, creates a SessionAuthority PDA, delegates tokens to agent,",
|
|
1649
|
+
"and updates spend tracking.",
|
|
1025
1650
|
"If denied, reverts the entire transaction (including subsequent DeFi instructions)."
|
|
1026
1651
|
],
|
|
1027
1652
|
"discriminator": [
|
|
@@ -1121,7 +1746,8 @@ exports.IDL = {
|
|
|
1121
1746
|
{
|
|
1122
1747
|
"name": "session",
|
|
1123
1748
|
"docs": [
|
|
1124
|
-
"Ephemeral session PDA \u2014 `init` ensures no double-authorization"
|
|
1749
|
+
"Ephemeral session PDA \u2014 `init` ensures no double-authorization.",
|
|
1750
|
+
"Seeds include token_mint for per-token concurrent sessions."
|
|
1125
1751
|
],
|
|
1126
1752
|
"writable": true,
|
|
1127
1753
|
"pda": {
|
|
@@ -1145,10 +1771,31 @@ exports.IDL = {
|
|
|
1145
1771
|
{
|
|
1146
1772
|
"kind": "account",
|
|
1147
1773
|
"path": "agent"
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
"kind": "arg",
|
|
1777
|
+
"path": "token_mint"
|
|
1148
1778
|
}
|
|
1149
1779
|
]
|
|
1150
1780
|
}
|
|
1151
1781
|
},
|
|
1782
|
+
{
|
|
1783
|
+
"name": "vault_token_account",
|
|
1784
|
+
"docs": [
|
|
1785
|
+
"Vault's PDA-owned token account for the spend token (delegation source)"
|
|
1786
|
+
],
|
|
1787
|
+
"writable": true
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
"name": "token_mint_account",
|
|
1791
|
+
"docs": [
|
|
1792
|
+
"The token mint being spent"
|
|
1793
|
+
]
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
"name": "token_program",
|
|
1797
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
1798
|
+
},
|
|
1152
1799
|
{
|
|
1153
1800
|
"name": "system_program",
|
|
1154
1801
|
"address": "11111111111111111111111111111111"
|
|
@@ -1450,6 +2097,19 @@ exports.IDL = {
|
|
|
1450
2097
|
194
|
|
1451
2098
|
]
|
|
1452
2099
|
},
|
|
2100
|
+
{
|
|
2101
|
+
"name": "PendingPolicyUpdate",
|
|
2102
|
+
"discriminator": [
|
|
2103
|
+
77,
|
|
2104
|
+
255,
|
|
2105
|
+
2,
|
|
2106
|
+
51,
|
|
2107
|
+
79,
|
|
2108
|
+
237,
|
|
2109
|
+
183,
|
|
2110
|
+
239
|
|
2111
|
+
]
|
|
2112
|
+
},
|
|
1453
2113
|
{
|
|
1454
2114
|
"name": "PolicyConfig",
|
|
1455
2115
|
"discriminator": [
|
|
@@ -1543,6 +2203,32 @@ exports.IDL = {
|
|
|
1543
2203
|
116
|
|
1544
2204
|
]
|
|
1545
2205
|
},
|
|
2206
|
+
{
|
|
2207
|
+
"name": "AgentTransferExecuted",
|
|
2208
|
+
"discriminator": [
|
|
2209
|
+
88,
|
|
2210
|
+
52,
|
|
2211
|
+
117,
|
|
2212
|
+
69,
|
|
2213
|
+
112,
|
|
2214
|
+
152,
|
|
2215
|
+
167,
|
|
2216
|
+
40
|
|
2217
|
+
]
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
"name": "DelegationRevoked",
|
|
2221
|
+
"discriminator": [
|
|
2222
|
+
59,
|
|
2223
|
+
158,
|
|
2224
|
+
142,
|
|
2225
|
+
49,
|
|
2226
|
+
164,
|
|
2227
|
+
116,
|
|
2228
|
+
220,
|
|
2229
|
+
8
|
|
2230
|
+
]
|
|
2231
|
+
},
|
|
1546
2232
|
{
|
|
1547
2233
|
"name": "FeesCollected",
|
|
1548
2234
|
"discriminator": [
|
|
@@ -1582,6 +2268,45 @@ exports.IDL = {
|
|
|
1582
2268
|
118
|
|
1583
2269
|
]
|
|
1584
2270
|
},
|
|
2271
|
+
{
|
|
2272
|
+
"name": "PolicyChangeApplied",
|
|
2273
|
+
"discriminator": [
|
|
2274
|
+
104,
|
|
2275
|
+
89,
|
|
2276
|
+
5,
|
|
2277
|
+
100,
|
|
2278
|
+
180,
|
|
2279
|
+
202,
|
|
2280
|
+
52,
|
|
2281
|
+
73
|
|
2282
|
+
]
|
|
2283
|
+
},
|
|
2284
|
+
{
|
|
2285
|
+
"name": "PolicyChangeCancelled",
|
|
2286
|
+
"discriminator": [
|
|
2287
|
+
200,
|
|
2288
|
+
158,
|
|
2289
|
+
226,
|
|
2290
|
+
255,
|
|
2291
|
+
25,
|
|
2292
|
+
211,
|
|
2293
|
+
30,
|
|
2294
|
+
151
|
|
2295
|
+
]
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
"name": "PolicyChangeQueued",
|
|
2299
|
+
"discriminator": [
|
|
2300
|
+
73,
|
|
2301
|
+
231,
|
|
2302
|
+
182,
|
|
2303
|
+
136,
|
|
2304
|
+
141,
|
|
2305
|
+
120,
|
|
2306
|
+
32,
|
|
2307
|
+
79
|
|
2308
|
+
]
|
|
2309
|
+
},
|
|
1585
2310
|
{
|
|
1586
2311
|
"name": "PolicyUpdated",
|
|
1587
2312
|
"discriminator": [
|
|
@@ -1788,6 +2513,96 @@ exports.IDL = {
|
|
|
1788
2513
|
"code": 6027,
|
|
1789
2514
|
"name": "Overflow",
|
|
1790
2515
|
"msg": "Arithmetic overflow"
|
|
2516
|
+
},
|
|
2517
|
+
{
|
|
2518
|
+
"code": 6028,
|
|
2519
|
+
"name": "DelegationFailed",
|
|
2520
|
+
"msg": "Token delegation approval failed"
|
|
2521
|
+
},
|
|
2522
|
+
{
|
|
2523
|
+
"code": 6029,
|
|
2524
|
+
"name": "RevocationFailed",
|
|
2525
|
+
"msg": "Token delegation revocation failed"
|
|
2526
|
+
},
|
|
2527
|
+
{
|
|
2528
|
+
"code": 6030,
|
|
2529
|
+
"name": "OracleFeedStale",
|
|
2530
|
+
"msg": "Oracle feed value is too stale"
|
|
2531
|
+
},
|
|
2532
|
+
{
|
|
2533
|
+
"code": 6031,
|
|
2534
|
+
"name": "OracleFeedInvalid",
|
|
2535
|
+
"msg": "Cannot parse oracle feed data"
|
|
2536
|
+
},
|
|
2537
|
+
{
|
|
2538
|
+
"code": 6032,
|
|
2539
|
+
"name": "TokenSpendBlocked",
|
|
2540
|
+
"msg": "Unpriced token cannot be spent (receive-only)"
|
|
2541
|
+
},
|
|
2542
|
+
{
|
|
2543
|
+
"code": 6033,
|
|
2544
|
+
"name": "InvalidTokenAccount",
|
|
2545
|
+
"msg": "Token account does not belong to vault or has wrong mint"
|
|
2546
|
+
},
|
|
2547
|
+
{
|
|
2548
|
+
"code": 6034,
|
|
2549
|
+
"name": "OracleAccountMissing",
|
|
2550
|
+
"msg": "Oracle-priced token requires feed account in remaining_accounts"
|
|
2551
|
+
},
|
|
2552
|
+
{
|
|
2553
|
+
"code": 6035,
|
|
2554
|
+
"name": "PerTokenCapExceeded",
|
|
2555
|
+
"msg": "Per-token daily spending cap would be exceeded"
|
|
2556
|
+
},
|
|
2557
|
+
{
|
|
2558
|
+
"code": 6036,
|
|
2559
|
+
"name": "PerTokenTxLimitExceeded",
|
|
2560
|
+
"msg": "Per-token single transaction limit exceeded"
|
|
2561
|
+
},
|
|
2562
|
+
{
|
|
2563
|
+
"code": 6037,
|
|
2564
|
+
"name": "OracleConfidenceTooWide",
|
|
2565
|
+
"msg": "Oracle price confidence interval too wide"
|
|
2566
|
+
},
|
|
2567
|
+
{
|
|
2568
|
+
"code": 6038,
|
|
2569
|
+
"name": "OracleUnsupportedType",
|
|
2570
|
+
"msg": "Oracle account owner is not a recognized oracle program"
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
"code": 6039,
|
|
2574
|
+
"name": "OracleNotVerified",
|
|
2575
|
+
"msg": "Pyth price update not fully verified by Wormhole"
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
"code": 6040,
|
|
2579
|
+
"name": "TimelockNotExpired",
|
|
2580
|
+
"msg": "Timelock period has not expired yet"
|
|
2581
|
+
},
|
|
2582
|
+
{
|
|
2583
|
+
"code": 6041,
|
|
2584
|
+
"name": "TimelockActive",
|
|
2585
|
+
"msg": "Vault has timelock active \u2014 use queue_policy_update instead"
|
|
2586
|
+
},
|
|
2587
|
+
{
|
|
2588
|
+
"code": 6042,
|
|
2589
|
+
"name": "NoTimelockConfigured",
|
|
2590
|
+
"msg": "No timelock configured on this vault"
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
"code": 6043,
|
|
2594
|
+
"name": "DestinationNotAllowed",
|
|
2595
|
+
"msg": "Destination not in allowed list"
|
|
2596
|
+
},
|
|
2597
|
+
{
|
|
2598
|
+
"code": 6044,
|
|
2599
|
+
"name": "TooManyDestinations",
|
|
2600
|
+
"msg": "Too many destinations (max 10)"
|
|
2601
|
+
},
|
|
2602
|
+
{
|
|
2603
|
+
"code": 6045,
|
|
2604
|
+
"name": "InvalidTrackerTier",
|
|
2605
|
+
"msg": "Invalid tracker tier (must be 0, 1, or 2)"
|
|
1791
2606
|
}
|
|
1792
2607
|
],
|
|
1793
2608
|
"types": [
|
|
@@ -1820,18 +2635,38 @@ exports.IDL = {
|
|
|
1820
2635
|
"name": "amount",
|
|
1821
2636
|
"type": "u64"
|
|
1822
2637
|
},
|
|
2638
|
+
{
|
|
2639
|
+
"name": "usd_amount",
|
|
2640
|
+
"type": "u64"
|
|
2641
|
+
},
|
|
1823
2642
|
{
|
|
1824
2643
|
"name": "protocol",
|
|
1825
2644
|
"type": "pubkey"
|
|
1826
2645
|
},
|
|
1827
2646
|
{
|
|
1828
|
-
"name": "
|
|
2647
|
+
"name": "rolling_spend_usd_after",
|
|
1829
2648
|
"type": "u64"
|
|
1830
2649
|
},
|
|
1831
2650
|
{
|
|
1832
|
-
"name": "
|
|
2651
|
+
"name": "daily_cap_usd",
|
|
1833
2652
|
"type": "u64"
|
|
1834
2653
|
},
|
|
2654
|
+
{
|
|
2655
|
+
"name": "delegated",
|
|
2656
|
+
"type": "bool"
|
|
2657
|
+
},
|
|
2658
|
+
{
|
|
2659
|
+
"name": "oracle_price",
|
|
2660
|
+
"type": {
|
|
2661
|
+
"option": "i128"
|
|
2662
|
+
}
|
|
2663
|
+
},
|
|
2664
|
+
{
|
|
2665
|
+
"name": "oracle_source",
|
|
2666
|
+
"type": {
|
|
2667
|
+
"option": "u8"
|
|
2668
|
+
}
|
|
2669
|
+
},
|
|
1835
2670
|
{
|
|
1836
2671
|
"name": "timestamp",
|
|
1837
2672
|
"type": "i64"
|
|
@@ -1891,6 +2726,9 @@ exports.IDL = {
|
|
|
1891
2726
|
},
|
|
1892
2727
|
{
|
|
1893
2728
|
"name": "Withdraw"
|
|
2729
|
+
},
|
|
2730
|
+
{
|
|
2731
|
+
"name": "Transfer"
|
|
1894
2732
|
}
|
|
1895
2733
|
]
|
|
1896
2734
|
}
|
|
@@ -1925,12 +2763,36 @@ exports.IDL = {
|
|
|
1925
2763
|
"type": "pubkey"
|
|
1926
2764
|
},
|
|
1927
2765
|
{
|
|
1928
|
-
"name": "agent",
|
|
2766
|
+
"name": "agent",
|
|
2767
|
+
"type": "pubkey"
|
|
2768
|
+
},
|
|
2769
|
+
{
|
|
2770
|
+
"name": "timestamp",
|
|
2771
|
+
"type": "i64"
|
|
2772
|
+
}
|
|
2773
|
+
]
|
|
2774
|
+
}
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
"name": "AgentTransferExecuted",
|
|
2778
|
+
"type": {
|
|
2779
|
+
"kind": "struct",
|
|
2780
|
+
"fields": [
|
|
2781
|
+
{
|
|
2782
|
+
"name": "vault",
|
|
2783
|
+
"type": "pubkey"
|
|
2784
|
+
},
|
|
2785
|
+
{
|
|
2786
|
+
"name": "destination",
|
|
2787
|
+
"type": "pubkey"
|
|
2788
|
+
},
|
|
2789
|
+
{
|
|
2790
|
+
"name": "amount",
|
|
2791
|
+
"type": "u64"
|
|
2792
|
+
},
|
|
2793
|
+
{
|
|
2794
|
+
"name": "mint",
|
|
1929
2795
|
"type": "pubkey"
|
|
1930
|
-
},
|
|
1931
|
-
{
|
|
1932
|
-
"name": "timestamp",
|
|
1933
|
-
"type": "i64"
|
|
1934
2796
|
}
|
|
1935
2797
|
]
|
|
1936
2798
|
}
|
|
@@ -1958,8 +2820,9 @@ exports.IDL = {
|
|
|
1958
2820
|
"name": "fee_destination",
|
|
1959
2821
|
"docs": [
|
|
1960
2822
|
"Developer fee destination \u2014 the wallet that receives developer fees",
|
|
1961
|
-
"on every finalized transaction.
|
|
1962
|
-
"
|
|
2823
|
+
"on every finalized transaction. IMMUTABLE after initialization \u2014 only",
|
|
2824
|
+
"`initialize_vault` writes this field. This prevents a compromised owner",
|
|
2825
|
+
"key from redirecting fees. Protocol fees go to PROTOCOL_TREASURY separately."
|
|
1963
2826
|
],
|
|
1964
2827
|
"type": "pubkey"
|
|
1965
2828
|
},
|
|
@@ -2023,6 +2886,93 @@ exports.IDL = {
|
|
|
2023
2886
|
"Protocol fees are tracked separately via events."
|
|
2024
2887
|
],
|
|
2025
2888
|
"type": "u64"
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
"name": "tracker_tier",
|
|
2892
|
+
"docs": [
|
|
2893
|
+
"Tracker capacity tier chosen at vault creation"
|
|
2894
|
+
],
|
|
2895
|
+
"type": {
|
|
2896
|
+
"defined": {
|
|
2897
|
+
"name": "TrackerTier"
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
]
|
|
2902
|
+
}
|
|
2903
|
+
},
|
|
2904
|
+
{
|
|
2905
|
+
"name": "AllowedToken",
|
|
2906
|
+
"docs": [
|
|
2907
|
+
"Per-token configuration including oracle feed and per-token caps.",
|
|
2908
|
+
"Replaces the old `Vec<Pubkey>` allowed_tokens with richer metadata.",
|
|
2909
|
+
"",
|
|
2910
|
+
"Oracle feed classification:",
|
|
2911
|
+
"- `Pubkey::default()` = stablecoin (1:1 USD, no oracle needed)",
|
|
2912
|
+
"- `UNPRICED_SENTINEL` ([0xFF; 32]) = unpriced token (receive-only)",
|
|
2913
|
+
"- Any other pubkey = Oracle feed account (Pyth PriceUpdateV2 or Switchboard PullFeed)"
|
|
2914
|
+
],
|
|
2915
|
+
"type": {
|
|
2916
|
+
"kind": "struct",
|
|
2917
|
+
"fields": [
|
|
2918
|
+
{
|
|
2919
|
+
"name": "mint",
|
|
2920
|
+
"docs": [
|
|
2921
|
+
"Token mint address"
|
|
2922
|
+
],
|
|
2923
|
+
"type": "pubkey"
|
|
2924
|
+
},
|
|
2925
|
+
{
|
|
2926
|
+
"name": "oracle_feed",
|
|
2927
|
+
"docs": [
|
|
2928
|
+
"Oracle feed account (Pyth PriceUpdateV2 or Switchboard PullFeed) for USD pricing.",
|
|
2929
|
+
"`Pubkey::default()` = stablecoin (1:1 USD).",
|
|
2930
|
+
"`UNPRICED_SENTINEL` = unpriced (receive-only, cannot be spent)."
|
|
2931
|
+
],
|
|
2932
|
+
"type": "pubkey"
|
|
2933
|
+
},
|
|
2934
|
+
{
|
|
2935
|
+
"name": "decimals",
|
|
2936
|
+
"docs": [
|
|
2937
|
+
"Token decimals (e.g., 6 for USDC, 9 for SOL)"
|
|
2938
|
+
],
|
|
2939
|
+
"type": "u8"
|
|
2940
|
+
},
|
|
2941
|
+
{
|
|
2942
|
+
"name": "daily_cap_base",
|
|
2943
|
+
"docs": [
|
|
2944
|
+
"Per-token daily cap in base units (0 = no per-token limit,",
|
|
2945
|
+
"only the aggregate USD cap applies)"
|
|
2946
|
+
],
|
|
2947
|
+
"type": "u64"
|
|
2948
|
+
},
|
|
2949
|
+
{
|
|
2950
|
+
"name": "max_tx_base",
|
|
2951
|
+
"docs": [
|
|
2952
|
+
"Per-token max single transaction in base units",
|
|
2953
|
+
"(0 = no per-token tx limit, only USD tx limit applies)"
|
|
2954
|
+
],
|
|
2955
|
+
"type": "u64"
|
|
2956
|
+
}
|
|
2957
|
+
]
|
|
2958
|
+
}
|
|
2959
|
+
},
|
|
2960
|
+
{
|
|
2961
|
+
"name": "DelegationRevoked",
|
|
2962
|
+
"type": {
|
|
2963
|
+
"kind": "struct",
|
|
2964
|
+
"fields": [
|
|
2965
|
+
{
|
|
2966
|
+
"name": "vault",
|
|
2967
|
+
"type": "pubkey"
|
|
2968
|
+
},
|
|
2969
|
+
{
|
|
2970
|
+
"name": "token_account",
|
|
2971
|
+
"type": "pubkey"
|
|
2972
|
+
},
|
|
2973
|
+
{
|
|
2974
|
+
"name": "timestamp",
|
|
2975
|
+
"type": "i64"
|
|
2026
2976
|
}
|
|
2027
2977
|
]
|
|
2028
2978
|
}
|
|
@@ -2131,6 +3081,163 @@ exports.IDL = {
|
|
|
2131
3081
|
]
|
|
2132
3082
|
}
|
|
2133
3083
|
},
|
|
3084
|
+
{
|
|
3085
|
+
"name": "PendingPolicyUpdate",
|
|
3086
|
+
"docs": [
|
|
3087
|
+
"Queued policy update that becomes executable after a timelock period.",
|
|
3088
|
+
"Created by `queue_policy_update`, applied by `apply_pending_policy`,",
|
|
3089
|
+
"or cancelled by `cancel_pending_policy`.",
|
|
3090
|
+
"",
|
|
3091
|
+
"PDA seeds: `[b\"pending_policy\", vault.key().as_ref()]`"
|
|
3092
|
+
],
|
|
3093
|
+
"type": {
|
|
3094
|
+
"kind": "struct",
|
|
3095
|
+
"fields": [
|
|
3096
|
+
{
|
|
3097
|
+
"name": "vault",
|
|
3098
|
+
"docs": [
|
|
3099
|
+
"Associated vault pubkey"
|
|
3100
|
+
],
|
|
3101
|
+
"type": "pubkey"
|
|
3102
|
+
},
|
|
3103
|
+
{
|
|
3104
|
+
"name": "queued_at",
|
|
3105
|
+
"docs": [
|
|
3106
|
+
"Unix timestamp when this update was queued"
|
|
3107
|
+
],
|
|
3108
|
+
"type": "i64"
|
|
3109
|
+
},
|
|
3110
|
+
{
|
|
3111
|
+
"name": "executes_at",
|
|
3112
|
+
"docs": [
|
|
3113
|
+
"Unix timestamp when this update becomes executable"
|
|
3114
|
+
],
|
|
3115
|
+
"type": "i64"
|
|
3116
|
+
},
|
|
3117
|
+
{
|
|
3118
|
+
"name": "daily_spending_cap_usd",
|
|
3119
|
+
"type": {
|
|
3120
|
+
"option": "u64"
|
|
3121
|
+
}
|
|
3122
|
+
},
|
|
3123
|
+
{
|
|
3124
|
+
"name": "max_transaction_amount_usd",
|
|
3125
|
+
"type": {
|
|
3126
|
+
"option": "u64"
|
|
3127
|
+
}
|
|
3128
|
+
},
|
|
3129
|
+
{
|
|
3130
|
+
"name": "allowed_tokens",
|
|
3131
|
+
"type": {
|
|
3132
|
+
"option": {
|
|
3133
|
+
"vec": {
|
|
3134
|
+
"defined": {
|
|
3135
|
+
"name": "AllowedToken"
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
},
|
|
3141
|
+
{
|
|
3142
|
+
"name": "allowed_protocols",
|
|
3143
|
+
"type": {
|
|
3144
|
+
"option": {
|
|
3145
|
+
"vec": "pubkey"
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
},
|
|
3149
|
+
{
|
|
3150
|
+
"name": "max_leverage_bps",
|
|
3151
|
+
"type": {
|
|
3152
|
+
"option": "u16"
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
{
|
|
3156
|
+
"name": "can_open_positions",
|
|
3157
|
+
"type": {
|
|
3158
|
+
"option": "bool"
|
|
3159
|
+
}
|
|
3160
|
+
},
|
|
3161
|
+
{
|
|
3162
|
+
"name": "max_concurrent_positions",
|
|
3163
|
+
"type": {
|
|
3164
|
+
"option": "u8"
|
|
3165
|
+
}
|
|
3166
|
+
},
|
|
3167
|
+
{
|
|
3168
|
+
"name": "developer_fee_rate",
|
|
3169
|
+
"type": {
|
|
3170
|
+
"option": "u16"
|
|
3171
|
+
}
|
|
3172
|
+
},
|
|
3173
|
+
{
|
|
3174
|
+
"name": "timelock_duration",
|
|
3175
|
+
"type": {
|
|
3176
|
+
"option": "u64"
|
|
3177
|
+
}
|
|
3178
|
+
},
|
|
3179
|
+
{
|
|
3180
|
+
"name": "allowed_destinations",
|
|
3181
|
+
"type": {
|
|
3182
|
+
"option": {
|
|
3183
|
+
"vec": "pubkey"
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
},
|
|
3187
|
+
{
|
|
3188
|
+
"name": "bump",
|
|
3189
|
+
"docs": [
|
|
3190
|
+
"Bump seed for PDA"
|
|
3191
|
+
],
|
|
3192
|
+
"type": "u8"
|
|
3193
|
+
}
|
|
3194
|
+
]
|
|
3195
|
+
}
|
|
3196
|
+
},
|
|
3197
|
+
{
|
|
3198
|
+
"name": "PolicyChangeApplied",
|
|
3199
|
+
"type": {
|
|
3200
|
+
"kind": "struct",
|
|
3201
|
+
"fields": [
|
|
3202
|
+
{
|
|
3203
|
+
"name": "vault",
|
|
3204
|
+
"type": "pubkey"
|
|
3205
|
+
},
|
|
3206
|
+
{
|
|
3207
|
+
"name": "applied_at",
|
|
3208
|
+
"type": "i64"
|
|
3209
|
+
}
|
|
3210
|
+
]
|
|
3211
|
+
}
|
|
3212
|
+
},
|
|
3213
|
+
{
|
|
3214
|
+
"name": "PolicyChangeCancelled",
|
|
3215
|
+
"type": {
|
|
3216
|
+
"kind": "struct",
|
|
3217
|
+
"fields": [
|
|
3218
|
+
{
|
|
3219
|
+
"name": "vault",
|
|
3220
|
+
"type": "pubkey"
|
|
3221
|
+
}
|
|
3222
|
+
]
|
|
3223
|
+
}
|
|
3224
|
+
},
|
|
3225
|
+
{
|
|
3226
|
+
"name": "PolicyChangeQueued",
|
|
3227
|
+
"type": {
|
|
3228
|
+
"kind": "struct",
|
|
3229
|
+
"fields": [
|
|
3230
|
+
{
|
|
3231
|
+
"name": "vault",
|
|
3232
|
+
"type": "pubkey"
|
|
3233
|
+
},
|
|
3234
|
+
{
|
|
3235
|
+
"name": "executes_at",
|
|
3236
|
+
"type": "i64"
|
|
3237
|
+
}
|
|
3238
|
+
]
|
|
3239
|
+
}
|
|
3240
|
+
},
|
|
2134
3241
|
{
|
|
2135
3242
|
"name": "PolicyConfig",
|
|
2136
3243
|
"type": {
|
|
@@ -2144,27 +3251,32 @@ exports.IDL = {
|
|
|
2144
3251
|
"type": "pubkey"
|
|
2145
3252
|
},
|
|
2146
3253
|
{
|
|
2147
|
-
"name": "
|
|
3254
|
+
"name": "daily_spending_cap_usd",
|
|
2148
3255
|
"docs": [
|
|
2149
|
-
"Maximum spend per rolling 24h period
|
|
3256
|
+
"Maximum aggregate spend per rolling 24h period in USD (6 decimals).",
|
|
3257
|
+
"$500 = 500_000_000. This is the primary spending cap."
|
|
2150
3258
|
],
|
|
2151
3259
|
"type": "u64"
|
|
2152
3260
|
},
|
|
2153
3261
|
{
|
|
2154
|
-
"name": "
|
|
3262
|
+
"name": "max_transaction_size_usd",
|
|
2155
3263
|
"docs": [
|
|
2156
|
-
"Maximum single transaction size
|
|
3264
|
+
"Maximum single transaction size in USD (6 decimals)."
|
|
2157
3265
|
],
|
|
2158
3266
|
"type": "u64"
|
|
2159
3267
|
},
|
|
2160
3268
|
{
|
|
2161
3269
|
"name": "allowed_tokens",
|
|
2162
3270
|
"docs": [
|
|
2163
|
-
"Allowed token mints
|
|
2164
|
-
"Bounded to MAX_ALLOWED_TOKENS entries"
|
|
3271
|
+
"Allowed token mints with oracle feeds and per-token caps.",
|
|
3272
|
+
"Bounded to MAX_ALLOWED_TOKENS entries."
|
|
2165
3273
|
],
|
|
2166
3274
|
"type": {
|
|
2167
|
-
"vec":
|
|
3275
|
+
"vec": {
|
|
3276
|
+
"defined": {
|
|
3277
|
+
"name": "AllowedToken"
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
2168
3280
|
}
|
|
2169
3281
|
},
|
|
2170
3282
|
{
|
|
@@ -2210,6 +3322,25 @@ exports.IDL = {
|
|
|
2210
3322
|
],
|
|
2211
3323
|
"type": "u16"
|
|
2212
3324
|
},
|
|
3325
|
+
{
|
|
3326
|
+
"name": "timelock_duration",
|
|
3327
|
+
"docs": [
|
|
3328
|
+
"Timelock duration in seconds for policy changes. 0 = no timelock",
|
|
3329
|
+
"(immediate updates allowed). When > 0, policy changes must go",
|
|
3330
|
+
"through queue_policy_update \u2192 apply_pending_policy."
|
|
3331
|
+
],
|
|
3332
|
+
"type": "u64"
|
|
3333
|
+
},
|
|
3334
|
+
{
|
|
3335
|
+
"name": "allowed_destinations",
|
|
3336
|
+
"docs": [
|
|
3337
|
+
"Allowed destination addresses for agent transfers.",
|
|
3338
|
+
"Empty = any destination allowed. Bounded to MAX_ALLOWED_DESTINATIONS."
|
|
3339
|
+
],
|
|
3340
|
+
"type": {
|
|
3341
|
+
"vec": "pubkey"
|
|
3342
|
+
}
|
|
3343
|
+
},
|
|
2213
3344
|
{
|
|
2214
3345
|
"name": "bump",
|
|
2215
3346
|
"docs": [
|
|
@@ -2230,11 +3361,11 @@ exports.IDL = {
|
|
|
2230
3361
|
"type": "pubkey"
|
|
2231
3362
|
},
|
|
2232
3363
|
{
|
|
2233
|
-
"name": "
|
|
3364
|
+
"name": "daily_cap_usd",
|
|
2234
3365
|
"type": "u64"
|
|
2235
3366
|
},
|
|
2236
3367
|
{
|
|
2237
|
-
"name": "
|
|
3368
|
+
"name": "max_transaction_size_usd",
|
|
2238
3369
|
"type": "u64"
|
|
2239
3370
|
},
|
|
2240
3371
|
{
|
|
@@ -2319,6 +3450,21 @@ exports.IDL = {
|
|
|
2319
3450
|
],
|
|
2320
3451
|
"type": "u64"
|
|
2321
3452
|
},
|
|
3453
|
+
{
|
|
3454
|
+
"name": "delegated",
|
|
3455
|
+
"docs": [
|
|
3456
|
+
"Whether token delegation was set up (approve CPI)"
|
|
3457
|
+
],
|
|
3458
|
+
"type": "bool"
|
|
3459
|
+
},
|
|
3460
|
+
{
|
|
3461
|
+
"name": "delegation_token_account",
|
|
3462
|
+
"docs": [
|
|
3463
|
+
"The vault's token account that was delegated to the agent",
|
|
3464
|
+
"(only meaningful when delegated == true)"
|
|
3465
|
+
],
|
|
3466
|
+
"type": "pubkey"
|
|
3467
|
+
},
|
|
2322
3468
|
{
|
|
2323
3469
|
"name": "bump",
|
|
2324
3470
|
"docs": [
|
|
@@ -2346,6 +3492,10 @@ exports.IDL = {
|
|
|
2346
3492
|
"name": "success",
|
|
2347
3493
|
"type": "bool"
|
|
2348
3494
|
},
|
|
3495
|
+
{
|
|
3496
|
+
"name": "is_expired",
|
|
3497
|
+
"type": "bool"
|
|
3498
|
+
},
|
|
2349
3499
|
{
|
|
2350
3500
|
"name": "timestamp",
|
|
2351
3501
|
"type": "i64"
|
|
@@ -2359,11 +3509,26 @@ exports.IDL = {
|
|
|
2359
3509
|
"kind": "struct",
|
|
2360
3510
|
"fields": [
|
|
2361
3511
|
{
|
|
2362
|
-
"name": "
|
|
2363
|
-
"
|
|
3512
|
+
"name": "token_index",
|
|
3513
|
+
"docs": [
|
|
3514
|
+
"Index into PolicyConfig.allowed_tokens[] (0-9).",
|
|
3515
|
+
"Compact representation \u2014 avoids storing full 32-byte Pubkey per entry.",
|
|
3516
|
+
"Invalidated when token list changes (rolling_spends is cleared)."
|
|
3517
|
+
],
|
|
3518
|
+
"type": "u8"
|
|
3519
|
+
},
|
|
3520
|
+
{
|
|
3521
|
+
"name": "usd_amount",
|
|
3522
|
+
"docs": [
|
|
3523
|
+
"USD value of this spend (6 decimals, e.g., $500 = 500_000_000)"
|
|
3524
|
+
],
|
|
3525
|
+
"type": "u64"
|
|
2364
3526
|
},
|
|
2365
3527
|
{
|
|
2366
|
-
"name": "
|
|
3528
|
+
"name": "base_amount",
|
|
3529
|
+
"docs": [
|
|
3530
|
+
"Original amount in token base units (for per-token cap checks)"
|
|
3531
|
+
],
|
|
2367
3532
|
"type": "u64"
|
|
2368
3533
|
},
|
|
2369
3534
|
{
|
|
@@ -2385,10 +3550,28 @@ exports.IDL = {
|
|
|
2385
3550
|
],
|
|
2386
3551
|
"type": "pubkey"
|
|
2387
3552
|
},
|
|
3553
|
+
{
|
|
3554
|
+
"name": "tracker_tier",
|
|
3555
|
+
"docs": [
|
|
3556
|
+
"Tracker capacity tier (Standard/Pro/Max)"
|
|
3557
|
+
],
|
|
3558
|
+
"type": {
|
|
3559
|
+
"defined": {
|
|
3560
|
+
"name": "TrackerTier"
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
},
|
|
3564
|
+
{
|
|
3565
|
+
"name": "max_spend_entries",
|
|
3566
|
+
"docs": [
|
|
3567
|
+
"Maximum spend entries for this tracker (derived from tier at init)"
|
|
3568
|
+
],
|
|
3569
|
+
"type": "u32"
|
|
3570
|
+
},
|
|
2388
3571
|
{
|
|
2389
3572
|
"name": "rolling_spends",
|
|
2390
3573
|
"docs": [
|
|
2391
|
-
"Rolling spend entries: (token_mint,
|
|
3574
|
+
"Rolling spend entries: (token_mint, usd_amount, base_amount, timestamp)",
|
|
2392
3575
|
"Entries older than ROLLING_WINDOW_SECONDS are pruned on each access"
|
|
2393
3576
|
],
|
|
2394
3577
|
"type": {
|
|
@@ -2423,6 +3606,27 @@ exports.IDL = {
|
|
|
2423
3606
|
]
|
|
2424
3607
|
}
|
|
2425
3608
|
},
|
|
3609
|
+
{
|
|
3610
|
+
"name": "TrackerTier",
|
|
3611
|
+
"docs": [
|
|
3612
|
+
"Tracker capacity tiers \u2014 chosen at vault creation, determines",
|
|
3613
|
+
"max rolling spend entries and SpendTracker account size."
|
|
3614
|
+
],
|
|
3615
|
+
"type": {
|
|
3616
|
+
"kind": "enum",
|
|
3617
|
+
"variants": [
|
|
3618
|
+
{
|
|
3619
|
+
"name": "Standard"
|
|
3620
|
+
},
|
|
3621
|
+
{
|
|
3622
|
+
"name": "Pro"
|
|
3623
|
+
},
|
|
3624
|
+
{
|
|
3625
|
+
"name": "Max"
|
|
3626
|
+
}
|
|
3627
|
+
]
|
|
3628
|
+
}
|
|
3629
|
+
},
|
|
2426
3630
|
{
|
|
2427
3631
|
"name": "TransactionRecord",
|
|
2428
3632
|
"type": {
|