@occa/sdk 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +238 -0
- package/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/chunk-N7LNBSDD.js +658 -0
- package/dist/chunk-N7LNBSDD.js.map +1 -0
- package/dist/chunk-X6FBCGHU.js +97 -0
- package/dist/chunk-X6FBCGHU.js.map +1 -0
- package/dist/chunk-YCSBYRSH.js +75 -0
- package/dist/chunk-YCSBYRSH.js.map +1 -0
- package/dist/constants.cjs +121 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +53 -0
- package/dist/constants.d.ts +53 -0
- package/dist/constants.js +51 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.cjs +870 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +117 -0
- package/dist/index.js.map +1 -0
- package/dist/instructions.cjs +785 -0
- package/dist/instructions.cjs.map +1 -0
- package/dist/instructions.d.cts +442 -0
- package/dist/instructions.d.ts +442 -0
- package/dist/instructions.js +51 -0
- package/dist/instructions.js.map +1 -0
- package/dist/pda.cjs +146 -0
- package/dist/pda.cjs.map +1 -0
- package/dist/pda.d.cts +116 -0
- package/dist/pda.d.ts +116 -0
- package/dist/pda.js +24 -0
- package/dist/pda.js.map +1 -0
- package/package.json +80 -0
- package/src/constants.ts +93 -0
- package/src/idl/registry.json +1415 -0
- package/src/idl/treasury.json +1627 -0
- package/src/index.ts +18 -0
- package/src/instructions.ts +1171 -0
- package/src/pda.ts +199 -0
|
@@ -0,0 +1,1415 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "occaTHMv5eYG5aZ85jimxTvHkBfsDCvndXC6J2k8kxr",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"name": "registry",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"spec": "0.1.0",
|
|
7
|
+
"description": "OCCA Registry — Company, AgentIdentity, and Deployment accounts on Solana"
|
|
8
|
+
},
|
|
9
|
+
"instructions": [
|
|
10
|
+
{
|
|
11
|
+
"name": "commit_daily_anchor",
|
|
12
|
+
"docs": [
|
|
13
|
+
"Commit a daily Merkle root anchor for a deployment's task hashes.",
|
|
14
|
+
"",
|
|
15
|
+
"Per Whitepaper §2 trace architecture: per-task records live off-chain",
|
|
16
|
+
"in OCCA's database; this anchor proves OCCA didn't tamper with that",
|
|
17
|
+
"day's task list. Anyone can re-hash off-chain records and verify",
|
|
18
|
+
"against `merkle_root`.",
|
|
19
|
+
"",
|
|
20
|
+
"Seeds: `[\"daily_anchor\", deployment_pda, day_unix_le_i64]`.",
|
|
21
|
+
"PDA collision = at most one anchor per (deployment, day). Re-attempts",
|
|
22
|
+
"on the same key fail naturally (Anchor `init` rejects).",
|
|
23
|
+
"",
|
|
24
|
+
"Authorization: signed by the Anchor Wallet registered as",
|
|
25
|
+
"`OperationsAccount[Anchor]` in the treasury program. The signer",
|
|
26
|
+
"pubkey must equal `operations.signer`; this ix's discriminator must",
|
|
27
|
+
"be in `operations.action_whitelist`. The OperationsAccount is",
|
|
28
|
+
"resolved via cross-program PDA lookup (`seeds::program = treasury::ID`).",
|
|
29
|
+
"",
|
|
30
|
+
"Phase 1 rate limit: NOT enforced. Registry cannot mutate the",
|
|
31
|
+
"treasury-owned OperationsAccount's `signatures_this_period` counter",
|
|
32
|
+
"without an extra CPI. PDA collision (one per deployment+day) provides",
|
|
33
|
+
"natural deduplication; rent burn (~0.002 SOL each) caps griefing.",
|
|
34
|
+
"If a stronger rate limit becomes necessary, add a treasury CPI ix",
|
|
35
|
+
"`tick_anchor_signature` and wire it here."
|
|
36
|
+
],
|
|
37
|
+
"discriminator": [
|
|
38
|
+
18,
|
|
39
|
+
7,
|
|
40
|
+
3,
|
|
41
|
+
65,
|
|
42
|
+
58,
|
|
43
|
+
148,
|
|
44
|
+
164,
|
|
45
|
+
0
|
|
46
|
+
],
|
|
47
|
+
"accounts": [
|
|
48
|
+
{
|
|
49
|
+
"name": "deployment",
|
|
50
|
+
"docs": [
|
|
51
|
+
"Deployment whose task stream this anchor covers."
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "company",
|
|
56
|
+
"docs": [
|
|
57
|
+
"CompanyAccount referenced by deployment. Verified via",
|
|
58
|
+
"`deployment.company == company.key()` constraint in handler so we",
|
|
59
|
+
"can also resolve the OperationsAccount[Anchor] PDA."
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "anchor_signer",
|
|
64
|
+
"docs": [
|
|
65
|
+
"Anchor Wallet — pubkey verified against `operations.signer`."
|
|
66
|
+
],
|
|
67
|
+
"signer": true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "operations",
|
|
71
|
+
"docs": [
|
|
72
|
+
"`OperationsAccount[Anchor]` from treasury program. Resolved via",
|
|
73
|
+
"cross-program PDA derivation. Anchor `Account<T>` auto-verifies",
|
|
74
|
+
"owner = treasury::ID via `OperationsAccount`'s `Owner` impl."
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "daily_anchor",
|
|
79
|
+
"writable": true,
|
|
80
|
+
"pda": {
|
|
81
|
+
"seeds": [
|
|
82
|
+
{
|
|
83
|
+
"kind": "const",
|
|
84
|
+
"value": [
|
|
85
|
+
100,
|
|
86
|
+
97,
|
|
87
|
+
105,
|
|
88
|
+
108,
|
|
89
|
+
121,
|
|
90
|
+
95,
|
|
91
|
+
97,
|
|
92
|
+
110,
|
|
93
|
+
99,
|
|
94
|
+
104,
|
|
95
|
+
111,
|
|
96
|
+
114
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"kind": "account",
|
|
101
|
+
"path": "deployment"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"kind": "arg",
|
|
105
|
+
"path": "day_unix"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "payer",
|
|
112
|
+
"docs": [
|
|
113
|
+
"Pays rent for the DailyAnchorAccount PDA."
|
|
114
|
+
],
|
|
115
|
+
"writable": true,
|
|
116
|
+
"signer": true
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "system_program",
|
|
120
|
+
"address": "11111111111111111111111111111111"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"args": [
|
|
124
|
+
{
|
|
125
|
+
"name": "day_unix",
|
|
126
|
+
"type": "i64"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "merkle_root",
|
|
130
|
+
"type": {
|
|
131
|
+
"array": [
|
|
132
|
+
"u8",
|
|
133
|
+
32
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "task_count",
|
|
139
|
+
"type": "u32"
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "create_company",
|
|
145
|
+
"docs": [
|
|
146
|
+
"Create a new CompanyAccount PDA + atomically initialize its",
|
|
147
|
+
"TreasuryAccount + PolicyAccount via CPI to the treasury program.",
|
|
148
|
+
"Per design §6: company creation never leaves a window where treasury",
|
|
149
|
+
"pointers are unset; any failure rolls back the entire transaction.",
|
|
150
|
+
"",
|
|
151
|
+
"Seeds: `[\"company\", owner, nonce_le_u32]`"
|
|
152
|
+
],
|
|
153
|
+
"discriminator": [
|
|
154
|
+
36,
|
|
155
|
+
192,
|
|
156
|
+
217,
|
|
157
|
+
147,
|
|
158
|
+
233,
|
|
159
|
+
129,
|
|
160
|
+
198,
|
|
161
|
+
18
|
|
162
|
+
],
|
|
163
|
+
"accounts": [
|
|
164
|
+
{
|
|
165
|
+
"name": "company",
|
|
166
|
+
"writable": true,
|
|
167
|
+
"pda": {
|
|
168
|
+
"seeds": [
|
|
169
|
+
{
|
|
170
|
+
"kind": "const",
|
|
171
|
+
"value": [
|
|
172
|
+
99,
|
|
173
|
+
111,
|
|
174
|
+
109,
|
|
175
|
+
112,
|
|
176
|
+
97,
|
|
177
|
+
110,
|
|
178
|
+
121
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"kind": "account",
|
|
183
|
+
"path": "owner"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"kind": "arg",
|
|
187
|
+
"path": "nonce"
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "owner",
|
|
194
|
+
"docs": [
|
|
195
|
+
"Owning user wallet — signer to prevent PDA squatting."
|
|
196
|
+
],
|
|
197
|
+
"signer": true
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "payer",
|
|
201
|
+
"docs": [
|
|
202
|
+
"Pays rent for company + treasury + policy PDAs."
|
|
203
|
+
],
|
|
204
|
+
"writable": true,
|
|
205
|
+
"signer": true
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "treasury",
|
|
209
|
+
"docs": [
|
|
210
|
+
"TreasuryAccount PDA — created by `treasury::init_treasury` CPI in",
|
|
211
|
+
"the handler. Seed/owner verification happens inside that program."
|
|
212
|
+
],
|
|
213
|
+
"writable": true
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "policy",
|
|
217
|
+
"docs": [
|
|
218
|
+
"PolicyAccount PDA — created by `treasury::init_treasury` CPI."
|
|
219
|
+
],
|
|
220
|
+
"writable": true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "treasury_program",
|
|
224
|
+
"docs": [
|
|
225
|
+
"Treasury program — invoked via CPI to atomically init treasury+policy."
|
|
226
|
+
],
|
|
227
|
+
"address": "occaxyVLnurdjedWCBPrvDCCto8wGYadtTZ3nAmcVzh"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "system_program",
|
|
231
|
+
"address": "11111111111111111111111111111111"
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
"args": [
|
|
235
|
+
{
|
|
236
|
+
"name": "nonce",
|
|
237
|
+
"type": "u32"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "name",
|
|
241
|
+
"type": "string"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "locale",
|
|
245
|
+
"type": "string"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "metadata_uri",
|
|
249
|
+
"type": "string"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "metadata_hash",
|
|
253
|
+
"type": {
|
|
254
|
+
"array": [
|
|
255
|
+
"u8",
|
|
256
|
+
32
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "create_deployment",
|
|
264
|
+
"docs": [
|
|
265
|
+
"Create a Deployment binding an existing AgentIdentity to a Company.",
|
|
266
|
+
"",
|
|
267
|
+
"Seeds: `[\"deployment\", company_pda, deployment_index_le_u32]`",
|
|
268
|
+
"",
|
|
269
|
+
"`deployment_index` is a per-company u32 counter — caller picks",
|
|
270
|
+
"the next free index. Same identity may be deployed multiple times",
|
|
271
|
+
"in the same company (e.g. retired then re-deployed) — each gets",
|
|
272
|
+
"its own index.",
|
|
273
|
+
"",
|
|
274
|
+
"Constraint: `identity.owner == company.owner`. Both fields are",
|
|
275
|
+
"immutable, so this binding is permanent."
|
|
276
|
+
],
|
|
277
|
+
"discriminator": [
|
|
278
|
+
55,
|
|
279
|
+
207,
|
|
280
|
+
186,
|
|
281
|
+
101,
|
|
282
|
+
21,
|
|
283
|
+
218,
|
|
284
|
+
102,
|
|
285
|
+
171
|
|
286
|
+
],
|
|
287
|
+
"accounts": [
|
|
288
|
+
{
|
|
289
|
+
"name": "company"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "identity",
|
|
293
|
+
"docs": [
|
|
294
|
+
"AgentIdentity to deploy. Phase 1: must be owned by the same",
|
|
295
|
+
"wallet as the company (enforced in handler)."
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"name": "owner",
|
|
300
|
+
"docs": [
|
|
301
|
+
"Company owner (signer). Authority for state changes."
|
|
302
|
+
],
|
|
303
|
+
"signer": true,
|
|
304
|
+
"relations": [
|
|
305
|
+
"company"
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"name": "deployment",
|
|
310
|
+
"writable": true,
|
|
311
|
+
"pda": {
|
|
312
|
+
"seeds": [
|
|
313
|
+
{
|
|
314
|
+
"kind": "const",
|
|
315
|
+
"value": [
|
|
316
|
+
100,
|
|
317
|
+
101,
|
|
318
|
+
112,
|
|
319
|
+
108,
|
|
320
|
+
111,
|
|
321
|
+
121,
|
|
322
|
+
109,
|
|
323
|
+
101,
|
|
324
|
+
110,
|
|
325
|
+
116
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"kind": "account",
|
|
330
|
+
"path": "company"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"kind": "arg",
|
|
334
|
+
"path": "deployment_index"
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "payer",
|
|
341
|
+
"writable": true,
|
|
342
|
+
"signer": true
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "system_program",
|
|
346
|
+
"address": "11111111111111111111111111111111"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"args": [
|
|
350
|
+
{
|
|
351
|
+
"name": "deployment_index",
|
|
352
|
+
"type": "u32"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "role",
|
|
356
|
+
"type": "string"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "parent_deployment_index",
|
|
360
|
+
"type": {
|
|
361
|
+
"option": "u32"
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "adapter_id",
|
|
366
|
+
"type": "pubkey"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "metadata_uri",
|
|
370
|
+
"type": "string"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"name": "metadata_hash",
|
|
374
|
+
"type": {
|
|
375
|
+
"array": [
|
|
376
|
+
"u8",
|
|
377
|
+
32
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"name": "register_agent_identity",
|
|
385
|
+
"docs": [
|
|
386
|
+
"Mint a new AgentIdentity PDA.",
|
|
387
|
+
"",
|
|
388
|
+
"Seeds: `[\"agent_identity\", agent_pubkey]`",
|
|
389
|
+
"",
|
|
390
|
+
"`agent_pubkey` is a caller-supplied identifier (typically derived",
|
|
391
|
+
"from a generated keypair held by the user wallet). It is the",
|
|
392
|
+
"stable identity of the agent across deployments. The recorded",
|
|
393
|
+
"`owner` is immutable — there is no transfer instruction."
|
|
394
|
+
],
|
|
395
|
+
"discriminator": [
|
|
396
|
+
57,
|
|
397
|
+
31,
|
|
398
|
+
242,
|
|
399
|
+
205,
|
|
400
|
+
57,
|
|
401
|
+
129,
|
|
402
|
+
123,
|
|
403
|
+
35
|
|
404
|
+
],
|
|
405
|
+
"accounts": [
|
|
406
|
+
{
|
|
407
|
+
"name": "identity",
|
|
408
|
+
"writable": true,
|
|
409
|
+
"pda": {
|
|
410
|
+
"seeds": [
|
|
411
|
+
{
|
|
412
|
+
"kind": "const",
|
|
413
|
+
"value": [
|
|
414
|
+
97,
|
|
415
|
+
103,
|
|
416
|
+
101,
|
|
417
|
+
110,
|
|
418
|
+
116,
|
|
419
|
+
95,
|
|
420
|
+
105,
|
|
421
|
+
100,
|
|
422
|
+
101,
|
|
423
|
+
110,
|
|
424
|
+
116,
|
|
425
|
+
105,
|
|
426
|
+
116,
|
|
427
|
+
121
|
|
428
|
+
]
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"kind": "arg",
|
|
432
|
+
"path": "agent_pubkey"
|
|
433
|
+
}
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "owner",
|
|
439
|
+
"docs": [
|
|
440
|
+
"Identity owner (= user wallet that minted this identity)."
|
|
441
|
+
],
|
|
442
|
+
"signer": true
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "payer",
|
|
446
|
+
"writable": true,
|
|
447
|
+
"signer": true
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "system_program",
|
|
451
|
+
"address": "11111111111111111111111111111111"
|
|
452
|
+
}
|
|
453
|
+
],
|
|
454
|
+
"args": [
|
|
455
|
+
{
|
|
456
|
+
"name": "agent_pubkey",
|
|
457
|
+
"type": "pubkey"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"name": "name",
|
|
461
|
+
"type": "string"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "metadata_uri",
|
|
465
|
+
"type": "string"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "metadata_hash",
|
|
469
|
+
"type": {
|
|
470
|
+
"array": [
|
|
471
|
+
"u8",
|
|
472
|
+
32
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
]
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "retire_deployment",
|
|
480
|
+
"docs": [
|
|
481
|
+
"Retire a deployment. Terminal — once retired, this Deployment",
|
|
482
|
+
"PDA is read-only forever (preserves history). To re-engage the",
|
|
483
|
+
"same identity in the same company, create a new deployment with",
|
|
484
|
+
"the next deployment_index."
|
|
485
|
+
],
|
|
486
|
+
"discriminator": [
|
|
487
|
+
45,
|
|
488
|
+
188,
|
|
489
|
+
162,
|
|
490
|
+
197,
|
|
491
|
+
136,
|
|
492
|
+
180,
|
|
493
|
+
202,
|
|
494
|
+
153
|
|
495
|
+
],
|
|
496
|
+
"accounts": [
|
|
497
|
+
{
|
|
498
|
+
"name": "deployment",
|
|
499
|
+
"writable": true
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"name": "owner",
|
|
503
|
+
"signer": true,
|
|
504
|
+
"relations": [
|
|
505
|
+
"deployment"
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"args": []
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"name": "set_receiving_address",
|
|
513
|
+
"docs": [
|
|
514
|
+
"Set or replace the deployment's receiving address — the passive",
|
|
515
|
+
"destination wallet that funds disbursed *to* this agent land in.",
|
|
516
|
+
"Pass `Pubkey::default()` to clear. Owner-only. NEVER a signer:",
|
|
517
|
+
"this address does not authorize on-chain actions, it only receives."
|
|
518
|
+
],
|
|
519
|
+
"discriminator": [
|
|
520
|
+
70,
|
|
521
|
+
63,
|
|
522
|
+
44,
|
|
523
|
+
87,
|
|
524
|
+
16,
|
|
525
|
+
6,
|
|
526
|
+
156,
|
|
527
|
+
200
|
|
528
|
+
],
|
|
529
|
+
"accounts": [
|
|
530
|
+
{
|
|
531
|
+
"name": "deployment",
|
|
532
|
+
"writable": true
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"name": "owner",
|
|
536
|
+
"signer": true,
|
|
537
|
+
"relations": [
|
|
538
|
+
"deployment"
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
"args": [
|
|
543
|
+
{
|
|
544
|
+
"name": "new_receiving_address",
|
|
545
|
+
"type": "pubkey"
|
|
546
|
+
}
|
|
547
|
+
]
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"name": "update_agent_identity_metadata",
|
|
551
|
+
"docs": [
|
|
552
|
+
"Update identity metadata (rename, change persona, etc.).",
|
|
553
|
+
"Identity-owner only."
|
|
554
|
+
],
|
|
555
|
+
"discriminator": [
|
|
556
|
+
250,
|
|
557
|
+
182,
|
|
558
|
+
24,
|
|
559
|
+
200,
|
|
560
|
+
201,
|
|
561
|
+
147,
|
|
562
|
+
60,
|
|
563
|
+
183
|
|
564
|
+
],
|
|
565
|
+
"accounts": [
|
|
566
|
+
{
|
|
567
|
+
"name": "identity",
|
|
568
|
+
"writable": true
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"name": "owner",
|
|
572
|
+
"signer": true,
|
|
573
|
+
"relations": [
|
|
574
|
+
"identity"
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"args": [
|
|
579
|
+
{
|
|
580
|
+
"name": "name",
|
|
581
|
+
"type": "string"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"name": "metadata_uri",
|
|
585
|
+
"type": "string"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "metadata_hash",
|
|
589
|
+
"type": {
|
|
590
|
+
"array": [
|
|
591
|
+
"u8",
|
|
592
|
+
32
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
]
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"name": "update_company_metadata",
|
|
600
|
+
"docs": [
|
|
601
|
+
"Update company metadata (name / locale / off-chain pointer).",
|
|
602
|
+
"Owner-only. Use to rename, update brand assets, etc."
|
|
603
|
+
],
|
|
604
|
+
"discriminator": [
|
|
605
|
+
186,
|
|
606
|
+
229,
|
|
607
|
+
190,
|
|
608
|
+
16,
|
|
609
|
+
234,
|
|
610
|
+
141,
|
|
611
|
+
170,
|
|
612
|
+
89
|
|
613
|
+
],
|
|
614
|
+
"accounts": [
|
|
615
|
+
{
|
|
616
|
+
"name": "company",
|
|
617
|
+
"writable": true
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"name": "owner",
|
|
621
|
+
"signer": true,
|
|
622
|
+
"relations": [
|
|
623
|
+
"company"
|
|
624
|
+
]
|
|
625
|
+
}
|
|
626
|
+
],
|
|
627
|
+
"args": [
|
|
628
|
+
{
|
|
629
|
+
"name": "name",
|
|
630
|
+
"type": "string"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "locale",
|
|
634
|
+
"type": "string"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"name": "metadata_uri",
|
|
638
|
+
"type": "string"
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"name": "metadata_hash",
|
|
642
|
+
"type": {
|
|
643
|
+
"array": [
|
|
644
|
+
"u8",
|
|
645
|
+
32
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
]
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"name": "update_company_status",
|
|
653
|
+
"docs": [
|
|
654
|
+
"Pause / resume a company. Paused companies should be skipped by",
|
|
655
|
+
"dispatchers off-chain. Owner-only."
|
|
656
|
+
],
|
|
657
|
+
"discriminator": [
|
|
658
|
+
61,
|
|
659
|
+
6,
|
|
660
|
+
101,
|
|
661
|
+
120,
|
|
662
|
+
141,
|
|
663
|
+
13,
|
|
664
|
+
125,
|
|
665
|
+
75
|
|
666
|
+
],
|
|
667
|
+
"accounts": [
|
|
668
|
+
{
|
|
669
|
+
"name": "company",
|
|
670
|
+
"writable": true
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"name": "owner",
|
|
674
|
+
"signer": true,
|
|
675
|
+
"relations": [
|
|
676
|
+
"company"
|
|
677
|
+
]
|
|
678
|
+
}
|
|
679
|
+
],
|
|
680
|
+
"args": [
|
|
681
|
+
{
|
|
682
|
+
"name": "new_status",
|
|
683
|
+
"type": "u8"
|
|
684
|
+
}
|
|
685
|
+
]
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"name": "update_deployment_metadata",
|
|
689
|
+
"docs": [
|
|
690
|
+
"Update deployment metadata (role, off-chain pointer).",
|
|
691
|
+
"Owner-only."
|
|
692
|
+
],
|
|
693
|
+
"discriminator": [
|
|
694
|
+
100,
|
|
695
|
+
135,
|
|
696
|
+
41,
|
|
697
|
+
32,
|
|
698
|
+
16,
|
|
699
|
+
41,
|
|
700
|
+
29,
|
|
701
|
+
76
|
|
702
|
+
],
|
|
703
|
+
"accounts": [
|
|
704
|
+
{
|
|
705
|
+
"name": "deployment",
|
|
706
|
+
"writable": true
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"name": "owner",
|
|
710
|
+
"signer": true,
|
|
711
|
+
"relations": [
|
|
712
|
+
"deployment"
|
|
713
|
+
]
|
|
714
|
+
}
|
|
715
|
+
],
|
|
716
|
+
"args": [
|
|
717
|
+
{
|
|
718
|
+
"name": "role",
|
|
719
|
+
"type": "string"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"name": "metadata_uri",
|
|
723
|
+
"type": "string"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "metadata_hash",
|
|
727
|
+
"type": {
|
|
728
|
+
"array": [
|
|
729
|
+
"u8",
|
|
730
|
+
32
|
|
731
|
+
]
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
]
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"name": "update_deployment_status",
|
|
738
|
+
"docs": [
|
|
739
|
+
"Toggle deployment between Active and Paused. Owner-only.",
|
|
740
|
+
"Use `retire_deployment` for terminal transition."
|
|
741
|
+
],
|
|
742
|
+
"discriminator": [
|
|
743
|
+
225,
|
|
744
|
+
195,
|
|
745
|
+
150,
|
|
746
|
+
254,
|
|
747
|
+
178,
|
|
748
|
+
203,
|
|
749
|
+
53,
|
|
750
|
+
147
|
|
751
|
+
],
|
|
752
|
+
"accounts": [
|
|
753
|
+
{
|
|
754
|
+
"name": "deployment",
|
|
755
|
+
"writable": true
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "owner",
|
|
759
|
+
"signer": true,
|
|
760
|
+
"relations": [
|
|
761
|
+
"deployment"
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
],
|
|
765
|
+
"args": [
|
|
766
|
+
{
|
|
767
|
+
"name": "new_status",
|
|
768
|
+
"type": "u8"
|
|
769
|
+
}
|
|
770
|
+
]
|
|
771
|
+
}
|
|
772
|
+
],
|
|
773
|
+
"accounts": [
|
|
774
|
+
{
|
|
775
|
+
"name": "AgentIdentity",
|
|
776
|
+
"discriminator": [
|
|
777
|
+
11,
|
|
778
|
+
149,
|
|
779
|
+
31,
|
|
780
|
+
27,
|
|
781
|
+
186,
|
|
782
|
+
76,
|
|
783
|
+
241,
|
|
784
|
+
72
|
|
785
|
+
]
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"name": "CompanyAccount",
|
|
789
|
+
"discriminator": [
|
|
790
|
+
37,
|
|
791
|
+
215,
|
|
792
|
+
171,
|
|
793
|
+
200,
|
|
794
|
+
8,
|
|
795
|
+
141,
|
|
796
|
+
69,
|
|
797
|
+
96
|
|
798
|
+
]
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"name": "DailyAnchorAccount",
|
|
802
|
+
"discriminator": [
|
|
803
|
+
218,
|
|
804
|
+
106,
|
|
805
|
+
107,
|
|
806
|
+
94,
|
|
807
|
+
194,
|
|
808
|
+
48,
|
|
809
|
+
111,
|
|
810
|
+
254
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"name": "Deployment",
|
|
815
|
+
"discriminator": [
|
|
816
|
+
66,
|
|
817
|
+
90,
|
|
818
|
+
104,
|
|
819
|
+
89,
|
|
820
|
+
183,
|
|
821
|
+
130,
|
|
822
|
+
64,
|
|
823
|
+
178
|
|
824
|
+
]
|
|
825
|
+
}
|
|
826
|
+
],
|
|
827
|
+
"errors": [
|
|
828
|
+
{
|
|
829
|
+
"code": 6000,
|
|
830
|
+
"name": "Unauthorized",
|
|
831
|
+
"msg": "signer does not match the account owner"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"code": 6001,
|
|
835
|
+
"name": "NameRequired",
|
|
836
|
+
"msg": "name is required"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"code": 6002,
|
|
840
|
+
"name": "NameTooLong",
|
|
841
|
+
"msg": "name exceeds MAX_NAME_LEN"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"code": 6003,
|
|
845
|
+
"name": "LocaleTooLong",
|
|
846
|
+
"msg": "locale exceeds MAX_LOCALE_LEN"
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"code": 6004,
|
|
850
|
+
"name": "RoleRequired",
|
|
851
|
+
"msg": "role is required"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"code": 6005,
|
|
855
|
+
"name": "RoleTooLong",
|
|
856
|
+
"msg": "role exceeds MAX_ROLE_LEN"
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"code": 6006,
|
|
860
|
+
"name": "MetadataUriTooLong",
|
|
861
|
+
"msg": "metadata_uri exceeds MAX_METADATA_URI_LEN"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"code": 6007,
|
|
865
|
+
"name": "InvalidStatus",
|
|
866
|
+
"msg": "invalid status value"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"code": 6008,
|
|
870
|
+
"name": "DeploymentRetired",
|
|
871
|
+
"msg": "deployment is retired and cannot be modified"
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"code": 6009,
|
|
875
|
+
"name": "IdentityOwnerMismatch",
|
|
876
|
+
"msg": "identity owner does not match company owner"
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"code": 6010,
|
|
880
|
+
"name": "EmptyAnchor",
|
|
881
|
+
"msg": "daily anchor must cover at least one task"
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"code": 6011,
|
|
885
|
+
"name": "InvalidDayBoundary",
|
|
886
|
+
"msg": "day_unix must be > 0 and aligned to 00:00:00 UTC (multiple of 86400)"
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"code": 6012,
|
|
890
|
+
"name": "FutureAnchor",
|
|
891
|
+
"msg": "daily anchor cannot be for a future day"
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
"code": 6013,
|
|
895
|
+
"name": "DeploymentNotActive",
|
|
896
|
+
"msg": "deployment must be active to commit anchor"
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
"code": 6014,
|
|
900
|
+
"name": "CompanyMismatch",
|
|
901
|
+
"msg": "deployment.company does not match passed company account"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"code": 6015,
|
|
905
|
+
"name": "OperationsRevoked",
|
|
906
|
+
"msg": "operations account is revoked"
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
"code": 6016,
|
|
910
|
+
"name": "OperationsExpired",
|
|
911
|
+
"msg": "operations account is past its expiry"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"code": 6017,
|
|
915
|
+
"name": "WrongOperationsKind",
|
|
916
|
+
"msg": "operations account kind does not match instruction expectation"
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"code": 6018,
|
|
920
|
+
"name": "DiscriminatorNotWhitelisted",
|
|
921
|
+
"msg": "instruction discriminator is not whitelisted on operations account"
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
"code": 6019,
|
|
925
|
+
"name": "InvalidDiscriminator",
|
|
926
|
+
"msg": "could not parse instruction discriminator"
|
|
927
|
+
}
|
|
928
|
+
],
|
|
929
|
+
"types": [
|
|
930
|
+
{
|
|
931
|
+
"name": "AgentIdentity",
|
|
932
|
+
"type": {
|
|
933
|
+
"kind": "struct",
|
|
934
|
+
"fields": [
|
|
935
|
+
{
|
|
936
|
+
"name": "version",
|
|
937
|
+
"docs": [
|
|
938
|
+
"Schema version."
|
|
939
|
+
],
|
|
940
|
+
"type": "u8"
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"name": "agent_pubkey",
|
|
944
|
+
"docs": [
|
|
945
|
+
"Stable identity key — also baked into the PDA seed."
|
|
946
|
+
],
|
|
947
|
+
"type": "pubkey"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"name": "owner",
|
|
951
|
+
"docs": [
|
|
952
|
+
"Owning user wallet. Immutable — set at mint and never changes."
|
|
953
|
+
],
|
|
954
|
+
"type": "pubkey"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
"name": "created_at",
|
|
958
|
+
"docs": [
|
|
959
|
+
"Unix timestamp at mint."
|
|
960
|
+
],
|
|
961
|
+
"type": "i64"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"name": "updated_at",
|
|
965
|
+
"docs": [
|
|
966
|
+
"Unix timestamp of last state mutation."
|
|
967
|
+
],
|
|
968
|
+
"type": "i64"
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
"name": "name",
|
|
972
|
+
"docs": [
|
|
973
|
+
"Display name (e.g. \"Aiden\"). Not unique — identities are",
|
|
974
|
+
"disambiguated by `agent_pubkey`."
|
|
975
|
+
],
|
|
976
|
+
"type": "string"
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
"name": "metadata_uri",
|
|
980
|
+
"docs": [
|
|
981
|
+
"Off-chain metadata URI — persona, avatar, public bio."
|
|
982
|
+
],
|
|
983
|
+
"type": "string"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"name": "metadata_hash",
|
|
987
|
+
"docs": [
|
|
988
|
+
"SHA-256 of metadata JSON."
|
|
989
|
+
],
|
|
990
|
+
"type": {
|
|
991
|
+
"array": [
|
|
992
|
+
"u8",
|
|
993
|
+
32
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"name": "reputation_uri",
|
|
999
|
+
"docs": [
|
|
1000
|
+
"Pointer to ReputationAccount (Phase 2). Empty string = unminted."
|
|
1001
|
+
],
|
|
1002
|
+
"type": "string"
|
|
1003
|
+
}
|
|
1004
|
+
]
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"name": "CompanyAccount",
|
|
1009
|
+
"type": {
|
|
1010
|
+
"kind": "struct",
|
|
1011
|
+
"fields": [
|
|
1012
|
+
{
|
|
1013
|
+
"name": "version",
|
|
1014
|
+
"docs": [
|
|
1015
|
+
"Schema version — bump on field changes."
|
|
1016
|
+
],
|
|
1017
|
+
"type": "u8"
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"name": "owner",
|
|
1021
|
+
"docs": [
|
|
1022
|
+
"Owning user wallet — also baked into the PDA seed."
|
|
1023
|
+
],
|
|
1024
|
+
"type": "pubkey"
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
"name": "treasury",
|
|
1028
|
+
"docs": [
|
|
1029
|
+
"Pointer to TreasuryAccount PDA (Pubkey::default() until Phase 2)."
|
|
1030
|
+
],
|
|
1031
|
+
"type": "pubkey"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
"name": "policy",
|
|
1035
|
+
"docs": [
|
|
1036
|
+
"Pointer to PolicyAccount PDA (Pubkey::default() until Phase 2)."
|
|
1037
|
+
],
|
|
1038
|
+
"type": "pubkey"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
"name": "created_at",
|
|
1042
|
+
"docs": [
|
|
1043
|
+
"Unix timestamp at creation."
|
|
1044
|
+
],
|
|
1045
|
+
"type": "i64"
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
"name": "updated_at",
|
|
1049
|
+
"docs": [
|
|
1050
|
+
"Unix timestamp of last state mutation."
|
|
1051
|
+
],
|
|
1052
|
+
"type": "i64"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
"name": "nonce",
|
|
1056
|
+
"docs": [
|
|
1057
|
+
"Seed disambiguator — same owner can register multiple companies."
|
|
1058
|
+
],
|
|
1059
|
+
"type": "u32"
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"name": "status",
|
|
1063
|
+
"docs": [
|
|
1064
|
+
"Active=0, Paused=1."
|
|
1065
|
+
],
|
|
1066
|
+
"type": "u8"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
"name": "name",
|
|
1070
|
+
"docs": [
|
|
1071
|
+
"Display name."
|
|
1072
|
+
],
|
|
1073
|
+
"type": "string"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"name": "locale",
|
|
1077
|
+
"docs": [
|
|
1078
|
+
"BCP-47 locale tag for default UI rendering (\"en\", \"id\", ...)."
|
|
1079
|
+
],
|
|
1080
|
+
"type": "string"
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"name": "metadata_uri",
|
|
1084
|
+
"docs": [
|
|
1085
|
+
"Off-chain metadata URI (IPFS / Arweave / HTTPS) — extended profile,",
|
|
1086
|
+
"brand assets, etc."
|
|
1087
|
+
],
|
|
1088
|
+
"type": "string"
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
"name": "metadata_hash",
|
|
1092
|
+
"docs": [
|
|
1093
|
+
"SHA-256 of canonical metadata JSON for integrity verification."
|
|
1094
|
+
],
|
|
1095
|
+
"type": {
|
|
1096
|
+
"array": [
|
|
1097
|
+
"u8",
|
|
1098
|
+
32
|
|
1099
|
+
]
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
]
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
"name": "DailyAnchorAccount",
|
|
1107
|
+
"type": {
|
|
1108
|
+
"kind": "struct",
|
|
1109
|
+
"fields": [
|
|
1110
|
+
{
|
|
1111
|
+
"name": "version",
|
|
1112
|
+
"docs": [
|
|
1113
|
+
"Schema version."
|
|
1114
|
+
],
|
|
1115
|
+
"type": "u8"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
"name": "deployment",
|
|
1119
|
+
"docs": [
|
|
1120
|
+
"Deployment whose task stream this anchor covers."
|
|
1121
|
+
],
|
|
1122
|
+
"type": "pubkey"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"name": "company",
|
|
1126
|
+
"docs": [
|
|
1127
|
+
"CompanyAccount the deployment belongs to (denormalized for fast",
|
|
1128
|
+
"indexing — avoids a deployment-account fetch on read)."
|
|
1129
|
+
],
|
|
1130
|
+
"type": "pubkey"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
"name": "day_unix",
|
|
1134
|
+
"docs": [
|
|
1135
|
+
"Unix timestamp of 00:00:00 UTC for the day this anchor covers.",
|
|
1136
|
+
"Aligned by `day_unix % 86_400 == 0` constraint at commit time."
|
|
1137
|
+
],
|
|
1138
|
+
"type": "i64"
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
"name": "merkle_root",
|
|
1142
|
+
"docs": [
|
|
1143
|
+
"Merkle root over that day's task hashes (off-chain DB)."
|
|
1144
|
+
],
|
|
1145
|
+
"type": {
|
|
1146
|
+
"array": [
|
|
1147
|
+
"u8",
|
|
1148
|
+
32
|
|
1149
|
+
]
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"name": "task_count",
|
|
1154
|
+
"docs": [
|
|
1155
|
+
"Number of leaves (tasks) in the Merkle tree. Must be > 0 — empty",
|
|
1156
|
+
"days produce no anchor (§2)."
|
|
1157
|
+
],
|
|
1158
|
+
"type": "u32"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"name": "committed_at",
|
|
1162
|
+
"docs": [
|
|
1163
|
+
"Unix timestamp when this commit landed on-chain."
|
|
1164
|
+
],
|
|
1165
|
+
"type": "i64"
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
"name": "committed_by",
|
|
1169
|
+
"docs": [
|
|
1170
|
+
"Anchor Wallet pubkey that signed the commit. Mirror of",
|
|
1171
|
+
"`OperationsAccount[Anchor].signer` at commit time."
|
|
1172
|
+
],
|
|
1173
|
+
"type": "pubkey"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"name": "bump",
|
|
1177
|
+
"docs": [
|
|
1178
|
+
"Bump for PDA verification."
|
|
1179
|
+
],
|
|
1180
|
+
"type": "u8"
|
|
1181
|
+
}
|
|
1182
|
+
]
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
"name": "Deployment",
|
|
1187
|
+
"type": {
|
|
1188
|
+
"kind": "struct",
|
|
1189
|
+
"fields": [
|
|
1190
|
+
{
|
|
1191
|
+
"name": "version",
|
|
1192
|
+
"docs": [
|
|
1193
|
+
"Schema version."
|
|
1194
|
+
],
|
|
1195
|
+
"type": "u8"
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
"name": "agent_identity",
|
|
1199
|
+
"docs": [
|
|
1200
|
+
"AgentIdentity PDA this deployment belongs to."
|
|
1201
|
+
],
|
|
1202
|
+
"type": "pubkey"
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"name": "company",
|
|
1206
|
+
"docs": [
|
|
1207
|
+
"CompanyAccount PDA this deployment belongs to."
|
|
1208
|
+
],
|
|
1209
|
+
"type": "pubkey"
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
"name": "deployment_index",
|
|
1213
|
+
"docs": [
|
|
1214
|
+
"Per-company counter — also part of the PDA seed."
|
|
1215
|
+
],
|
|
1216
|
+
"type": "u32"
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
"name": "owner",
|
|
1220
|
+
"docs": [
|
|
1221
|
+
"Mirror of `company.owner` for fast single-account auth checks."
|
|
1222
|
+
],
|
|
1223
|
+
"type": "pubkey"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"name": "receiving_address",
|
|
1227
|
+
"docs": [
|
|
1228
|
+
"Passive destination wallet for funds disbursed *to* this agent",
|
|
1229
|
+
"(Agent Receiving Address per Whitepaper §8.2 v0.10). NOT a signer",
|
|
1230
|
+
"— never authorizes on-chain actions. Treasury disburse instructions",
|
|
1231
|
+
"match against this field to identify intra-company transfers and",
|
|
1232
|
+
"deduct the Agent Operating Fee. `Pubkey::default()` = unset",
|
|
1233
|
+
"(disbursements to this deployment will fail until set)."
|
|
1234
|
+
],
|
|
1235
|
+
"type": "pubkey"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"name": "adapter_id",
|
|
1239
|
+
"docs": [
|
|
1240
|
+
"Pinned adapter (Pubkey::default() = unspecified)."
|
|
1241
|
+
],
|
|
1242
|
+
"type": "pubkey"
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
"name": "role",
|
|
1246
|
+
"docs": [
|
|
1247
|
+
"Capability persona / function tag (e.g. \"ceo\", \"sdr\"). NOT a",
|
|
1248
|
+
"job title — see Whitepaper §15.7 + CLAUDE.md naming guardrails."
|
|
1249
|
+
],
|
|
1250
|
+
"type": "string"
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
"name": "parent_deployment_index",
|
|
1254
|
+
"docs": [
|
|
1255
|
+
"Reporting parent within the company (None = top-level)."
|
|
1256
|
+
],
|
|
1257
|
+
"type": {
|
|
1258
|
+
"option": "u32"
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"name": "status",
|
|
1263
|
+
"docs": [
|
|
1264
|
+
"Active=0, Paused=1, Retired=2 (terminal)."
|
|
1265
|
+
],
|
|
1266
|
+
"type": "u8"
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
"name": "deployed_at",
|
|
1270
|
+
"docs": [
|
|
1271
|
+
"Unix timestamp when deployment was created."
|
|
1272
|
+
],
|
|
1273
|
+
"type": "i64"
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
"name": "retired_at",
|
|
1277
|
+
"docs": [
|
|
1278
|
+
"Unix timestamp when retired (0 = still active)."
|
|
1279
|
+
],
|
|
1280
|
+
"type": "i64"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
"name": "updated_at",
|
|
1284
|
+
"docs": [
|
|
1285
|
+
"Unix timestamp of last state mutation."
|
|
1286
|
+
],
|
|
1287
|
+
"type": "i64"
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
"name": "metadata_uri",
|
|
1291
|
+
"docs": [
|
|
1292
|
+
"Off-chain metadata URI — model preferences, skill list, etc."
|
|
1293
|
+
],
|
|
1294
|
+
"type": "string"
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
"name": "metadata_hash",
|
|
1298
|
+
"docs": [
|
|
1299
|
+
"SHA-256 of metadata JSON."
|
|
1300
|
+
],
|
|
1301
|
+
"type": {
|
|
1302
|
+
"array": [
|
|
1303
|
+
"u8",
|
|
1304
|
+
32
|
|
1305
|
+
]
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
]
|
|
1309
|
+
}
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
"name": "OperationsAccount",
|
|
1313
|
+
"type": {
|
|
1314
|
+
"kind": "struct",
|
|
1315
|
+
"fields": [
|
|
1316
|
+
{
|
|
1317
|
+
"name": "version",
|
|
1318
|
+
"type": "u8"
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
"name": "company",
|
|
1322
|
+
"type": "pubkey"
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
"name": "kind",
|
|
1326
|
+
"docs": [
|
|
1327
|
+
"What kind of operations key this is (Disbursement | Anchor).",
|
|
1328
|
+
"Also encoded into the PDA seed so each company can host one of each."
|
|
1329
|
+
],
|
|
1330
|
+
"type": {
|
|
1331
|
+
"defined": {
|
|
1332
|
+
"name": "OperationsKind"
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
"name": "signer",
|
|
1338
|
+
"docs": [
|
|
1339
|
+
"Pubkey of the registered wallet:",
|
|
1340
|
+
"• Disbursement: operator-held only — OCCA never holds the privkey.",
|
|
1341
|
+
"• Anchor: shared session key — operator + OCCA both hold privkey,",
|
|
1342
|
+
"either can sign `commit_daily_anchor` (capability-scoped)."
|
|
1343
|
+
],
|
|
1344
|
+
"type": "pubkey"
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"name": "action_whitelist",
|
|
1348
|
+
"docs": [
|
|
1349
|
+
"Whitelist of allowed instruction discriminators (8-byte Anchor",
|
|
1350
|
+
"discriminators). Defaults set at registration:",
|
|
1351
|
+
"• Disbursement: `[disburse_routine]`",
|
|
1352
|
+
"• Anchor: `[commit_daily_anchor]` (lives in Registry program)"
|
|
1353
|
+
],
|
|
1354
|
+
"type": {
|
|
1355
|
+
"vec": {
|
|
1356
|
+
"array": [
|
|
1357
|
+
"u8",
|
|
1358
|
+
8
|
|
1359
|
+
]
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"name": "rate_limit_per_period",
|
|
1365
|
+
"type": "u32"
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"name": "signatures_this_period",
|
|
1369
|
+
"type": "u32"
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"name": "current_period_anchor",
|
|
1373
|
+
"docs": [
|
|
1374
|
+
"Unix timestamp of start-of-current-month UTC. `0` = uninitialized."
|
|
1375
|
+
],
|
|
1376
|
+
"type": "i64"
|
|
1377
|
+
},
|
|
1378
|
+
{
|
|
1379
|
+
"name": "expiry_unix",
|
|
1380
|
+
"docs": [
|
|
1381
|
+
"Hard expiry (unix timestamp). `0` = no expiry."
|
|
1382
|
+
],
|
|
1383
|
+
"type": "i64"
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"name": "revoked",
|
|
1387
|
+
"docs": [
|
|
1388
|
+
"Once true, all future signatures via this account are rejected.",
|
|
1389
|
+
"Rotation flow: revoke → close → re-create with new `signer`."
|
|
1390
|
+
],
|
|
1391
|
+
"type": "bool"
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"name": "bump",
|
|
1395
|
+
"type": "u8"
|
|
1396
|
+
}
|
|
1397
|
+
]
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"name": "OperationsKind",
|
|
1402
|
+
"type": {
|
|
1403
|
+
"kind": "enum",
|
|
1404
|
+
"variants": [
|
|
1405
|
+
{
|
|
1406
|
+
"name": "Disbursement"
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "Anchor"
|
|
1410
|
+
}
|
|
1411
|
+
]
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
]
|
|
1415
|
+
}
|