@pooflabs/core 0.0.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.
@@ -0,0 +1,1381 @@
1
+ /**
2
+ * Program IDL in camelCase format in order to be used in JS/TS.
3
+ *
4
+ * Note that this is only a type helper and is not the actual IDL. The original
5
+ * IDL can be found at `target/idl/tarobase.json`.
6
+ */
7
+ export type Tarobase = {
8
+ "address": "poof4b5pk1L9tmThvBmaABjcyjfhFGbMbQP5BXk2QZp";
9
+ "metadata": {
10
+ "name": "tarobase";
11
+ "version": "0.1.0";
12
+ "spec": "0.1.0";
13
+ "description": "Created with Anchor";
14
+ };
15
+ "instructions": [
16
+ {
17
+ "name": "appendBytecodeChunk";
18
+ "docs": [
19
+ "Appends a chunk of bytecode to the bytecode stream for a generic path in a Tarobase app.",
20
+ "",
21
+ "This instruction appends a chunk of bytecode to the bytecode stream for a specific",
22
+ "generic path within an application. It is used to append the bytecode for the rules and hooks for a path.",
23
+ "Since the bytecode can be large, we need to stream it in chunks. A new stream should wipe any existing bytecode for the path + rule/hook combo.",
24
+ "Only the admin can begin a new stream. It should also handle account size and rent. Refund the leftover lamports to the admin.",
25
+ "",
26
+ "# Arguments",
27
+ "* `ctx` - The context containing all accounts needed for this instruction",
28
+ "* `app_id` - The identifier of the Tarobase application",
29
+ "* `generic_path` - The generic path within the app for which to append the bytecode chunk",
30
+ "* `chunk` - The chunk of bytecode to append"
31
+ ];
32
+ "discriminator": [
33
+ 20,
34
+ 225,
35
+ 119,
36
+ 78,
37
+ 123,
38
+ 221,
39
+ 35,
40
+ 113
41
+ ];
42
+ "accounts": [
43
+ {
44
+ "name": "genericPathExecutionData";
45
+ "writable": true;
46
+ "pda": {
47
+ "seeds": [
48
+ {
49
+ "kind": "const";
50
+ "value": [
51
+ 97,
52
+ 110,
53
+ 99,
54
+ 104,
55
+ 111,
56
+ 114,
57
+ 95,
58
+ 108,
59
+ 97,
60
+ 110,
61
+ 103,
62
+ 32,
63
+ 58,
64
+ 58,
65
+ 32,
66
+ 115,
67
+ 111,
68
+ 108,
69
+ 97,
70
+ 110,
71
+ 97,
72
+ 95,
73
+ 112,
74
+ 114,
75
+ 111,
76
+ 103,
77
+ 114,
78
+ 97,
79
+ 109,
80
+ 32,
81
+ 58,
82
+ 58,
83
+ 32,
84
+ 104,
85
+ 97,
86
+ 115,
87
+ 104,
88
+ 32,
89
+ 58,
90
+ 58,
91
+ 10,
92
+ 104,
93
+ 97,
94
+ 115,
95
+ 104,
96
+ 40,
97
+ 38,
98
+ 10,
99
+ 91,
100
+ 98,
101
+ 34,
102
+ 116,
103
+ 97,
104
+ 114,
105
+ 111,
106
+ 98,
107
+ 97,
108
+ 115,
109
+ 101,
110
+ 95,
111
+ 103,
112
+ 101,
113
+ 110,
114
+ 101,
115
+ 114,
116
+ 105,
117
+ 99,
118
+ 95,
119
+ 112,
120
+ 97,
121
+ 116,
122
+ 104,
123
+ 34,
124
+ 44,
125
+ 32,
126
+ 97,
127
+ 112,
128
+ 112,
129
+ 95,
130
+ 105,
131
+ 100
132
+ ];
133
+ }
134
+ ];
135
+ };
136
+ },
137
+ {
138
+ "name": "admin";
139
+ "signer": true;
140
+ "relations": [
141
+ "genericPathExecutionData"
142
+ ];
143
+ },
144
+ {
145
+ "name": "systemProgram";
146
+ "address": "11111111111111111111111111111111";
147
+ }
148
+ ];
149
+ "args": [
150
+ {
151
+ "name": "appId";
152
+ "type": "string";
153
+ },
154
+ {
155
+ "name": "genericPath";
156
+ "type": "string";
157
+ },
158
+ {
159
+ "name": "chunk";
160
+ "type": "bytes";
161
+ }
162
+ ];
163
+ },
164
+ {
165
+ "name": "beginBytecodeStream";
166
+ "docs": [
167
+ "Begins a bytecode stream for a generic path in a Tarobase app.",
168
+ "",
169
+ "This instruction initializes the bytecode stream for a specific",
170
+ "generic path within a Tarobase app. It is used to append the bytecode for the rules and hooks for a path.",
171
+ "Since the bytecode can be large, we need to stream it in chunks. A new stream should wipe any existing bytecode for the path + rule/hook combo.",
172
+ "Only the admin can begin a new stream.",
173
+ "",
174
+ "# Arguments",
175
+ "* `ctx` - The context containing all accounts needed for this instruction",
176
+ "* `app_id` - The identifier of the Tarobase application",
177
+ "* `generic_path` - The generic path within the app for which to begin the bytecode stream",
178
+ "* `index` - The index of the bytecode type to begin the stream for"
179
+ ];
180
+ "discriminator": [
181
+ 71,
182
+ 123,
183
+ 3,
184
+ 200,
185
+ 121,
186
+ 141,
187
+ 146,
188
+ 117
189
+ ];
190
+ "accounts": [
191
+ {
192
+ "name": "genericPathExecutionData";
193
+ "writable": true;
194
+ "pda": {
195
+ "seeds": [
196
+ {
197
+ "kind": "const";
198
+ "value": [
199
+ 97,
200
+ 110,
201
+ 99,
202
+ 104,
203
+ 111,
204
+ 114,
205
+ 95,
206
+ 108,
207
+ 97,
208
+ 110,
209
+ 103,
210
+ 32,
211
+ 58,
212
+ 58,
213
+ 32,
214
+ 115,
215
+ 111,
216
+ 108,
217
+ 97,
218
+ 110,
219
+ 97,
220
+ 95,
221
+ 112,
222
+ 114,
223
+ 111,
224
+ 103,
225
+ 114,
226
+ 97,
227
+ 109,
228
+ 32,
229
+ 58,
230
+ 58,
231
+ 32,
232
+ 104,
233
+ 97,
234
+ 115,
235
+ 104,
236
+ 32,
237
+ 58,
238
+ 58,
239
+ 10,
240
+ 104,
241
+ 97,
242
+ 115,
243
+ 104,
244
+ 40,
245
+ 38,
246
+ 10,
247
+ 91,
248
+ 98,
249
+ 34,
250
+ 116,
251
+ 97,
252
+ 114,
253
+ 111,
254
+ 98,
255
+ 97,
256
+ 115,
257
+ 101,
258
+ 95,
259
+ 103,
260
+ 101,
261
+ 110,
262
+ 101,
263
+ 114,
264
+ 105,
265
+ 99,
266
+ 95,
267
+ 112,
268
+ 97,
269
+ 116,
270
+ 104,
271
+ 34,
272
+ 44,
273
+ 32,
274
+ 97,
275
+ 112,
276
+ 112,
277
+ 95,
278
+ 105,
279
+ 100
280
+ ];
281
+ }
282
+ ];
283
+ };
284
+ },
285
+ {
286
+ "name": "admin";
287
+ "writable": true;
288
+ "signer": true;
289
+ "relations": [
290
+ "genericPathExecutionData"
291
+ ];
292
+ },
293
+ {
294
+ "name": "systemProgram";
295
+ "address": "11111111111111111111111111111111";
296
+ }
297
+ ];
298
+ "args": [
299
+ {
300
+ "name": "appId";
301
+ "type": "string";
302
+ },
303
+ {
304
+ "name": "genericPath";
305
+ "type": "string";
306
+ },
307
+ {
308
+ "name": "index";
309
+ "type": "u8";
310
+ }
311
+ ];
312
+ },
313
+ {
314
+ "name": "createGenericPathExecutionData";
315
+ "docs": [
316
+ "Creates an account to store executable bytecode for a generic path in a Tarobase app.",
317
+ "",
318
+ "This instruction initializes the account that will hold the bytecode for a specific",
319
+ "generic path within an application. It also sets the admin who has permission to",
320
+ "update the bytecode.",
321
+ "",
322
+ "# Important",
323
+ "The admin should be consistent across all generic paths for a given app ID.",
324
+ "",
325
+ "# Arguments",
326
+ "* `ctx` - The context containing all accounts needed for this instruction",
327
+ "* `app_id` - The identifier of the Tarobase application",
328
+ "* `generic_path` - The generic path within the app for which to store bytecode",
329
+ "* `slot_expiry` - The slot expiry for the permit",
330
+ "* `signature` - The signature for the permit"
331
+ ];
332
+ "discriminator": [
333
+ 156,
334
+ 97,
335
+ 194,
336
+ 41,
337
+ 169,
338
+ 63,
339
+ 176,
340
+ 101
341
+ ];
342
+ "accounts": [
343
+ {
344
+ "name": "admin";
345
+ "writable": true;
346
+ "signer": true;
347
+ },
348
+ {
349
+ "name": "genericPathExecutionData";
350
+ "writable": true;
351
+ },
352
+ {
353
+ "name": "instructions";
354
+ "docs": [
355
+ "Sysvar giving us every instruction in the tx",
356
+ "(must be supplied by the runtime; no signer/ mut)"
357
+ ];
358
+ "address": "Sysvar1nstructions1111111111111111111111111";
359
+ },
360
+ {
361
+ "name": "systemProgram";
362
+ "address": "11111111111111111111111111111111";
363
+ }
364
+ ];
365
+ "args": [
366
+ {
367
+ "name": "appId";
368
+ "type": "string";
369
+ },
370
+ {
371
+ "name": "genericPath";
372
+ "type": "string";
373
+ },
374
+ {
375
+ "name": "slotExpiry";
376
+ "type": "u64";
377
+ },
378
+ {
379
+ "name": "signature";
380
+ "type": {
381
+ "array": [
382
+ "u8",
383
+ 64
384
+ ];
385
+ };
386
+ }
387
+ ];
388
+ },
389
+ {
390
+ "name": "deleteGenericPathExecutionData";
391
+ "docs": [
392
+ "Deletes the account for a generic path in a Tarobase app.",
393
+ "",
394
+ "This instruction removes the account that stores the bytecode and metadata",
395
+ "for a specific generic path within an application. It is used to clean up",
396
+ "the account when it is no longer needed or when the path is being removed and return the lamports to the admin.",
397
+ ""
398
+ ];
399
+ "discriminator": [
400
+ 171,
401
+ 79,
402
+ 20,
403
+ 109,
404
+ 104,
405
+ 2,
406
+ 247,
407
+ 240
408
+ ];
409
+ "accounts": [
410
+ {
411
+ "name": "admin";
412
+ "writable": true;
413
+ "signer": true;
414
+ "relations": [
415
+ "genericPathExecutionData"
416
+ ];
417
+ },
418
+ {
419
+ "name": "genericPathExecutionData";
420
+ "writable": true;
421
+ }
422
+ ];
423
+ "args": [
424
+ {
425
+ "name": "appId";
426
+ "type": "string";
427
+ },
428
+ {
429
+ "name": "genericPath";
430
+ "type": "string";
431
+ }
432
+ ];
433
+ },
434
+ {
435
+ "name": "dummyDocument";
436
+ "docs": [
437
+ "Dummy instruction to force inclusion of the Document account in the IDL."
438
+ ];
439
+ "discriminator": [
440
+ 61,
441
+ 21,
442
+ 15,
443
+ 130,
444
+ 144,
445
+ 18,
446
+ 7,
447
+ 170
448
+ ];
449
+ "accounts": [
450
+ {
451
+ "name": "document";
452
+ "writable": true;
453
+ }
454
+ ];
455
+ "args": [];
456
+ },
457
+ {
458
+ "name": "executeQuery";
459
+ "docs": [
460
+ "Executes a query for a generic path in a Tarobase app.",
461
+ "",
462
+ "READONLY INSTRUCTION. This instruction executes a query for a specific",
463
+ "generic path within an application. NOTE: The queries are not stored on chain so they are passed in as a bytecode stream.",
464
+ "We do replace Tarobase variables with the actual values in the bytecode and return the result.",
465
+ "",
466
+ "# Arguments",
467
+ "* `ctx` - The context containing all accounts needed for this instruction",
468
+ "* `bytecode` - The bytecode for the query",
469
+ "* `app_id` - The identifier of the Tarobase application",
470
+ "* `document_input` - The input document for the query i.e what @newData points to",
471
+ "* `simulate` - Whether to simulate the query to extract the remaining accounts needed for the query",
472
+ "* `user_address` - The address of the user executing the query"
473
+ ];
474
+ "discriminator": [
475
+ 171,
476
+ 145,
477
+ 112,
478
+ 132,
479
+ 36,
480
+ 159,
481
+ 36,
482
+ 59
483
+ ];
484
+ "accounts": [
485
+ {
486
+ "name": "payer";
487
+ "writable": true;
488
+ "signer": true;
489
+ },
490
+ {
491
+ "name": "genericPathExecutionData";
492
+ "docs": [
493
+ "GenericPathExecutionData account - constraint removed to simplify"
494
+ ];
495
+ }
496
+ ];
497
+ "args": [
498
+ {
499
+ "name": "bytecode";
500
+ "type": "bytes";
501
+ },
502
+ {
503
+ "name": "appId";
504
+ "type": "string";
505
+ },
506
+ {
507
+ "name": "documentInput";
508
+ "type": {
509
+ "defined": {
510
+ "name": "setDocumentData";
511
+ };
512
+ };
513
+ },
514
+ {
515
+ "name": "simulate";
516
+ "type": "bool";
517
+ },
518
+ {
519
+ "name": "userAddress";
520
+ "type": "pubkey";
521
+ }
522
+ ];
523
+ },
524
+ {
525
+ "name": "finishBytecodeStream";
526
+ "docs": [
527
+ "Finishes the bytecode stream for a generic path in a Tarobase app.",
528
+ "",
529
+ "This instruction finishes the bytecode stream for a specific",
530
+ "generic path within an application. It is used to finalize the bytecode for the rules and hooks for a path. It resets the streaming target to None.",
531
+ "Only the admin can finish a stream.",
532
+ "",
533
+ "# Arguments",
534
+ "* `ctx` - The context containing all accounts needed for this instruction",
535
+ "* `app_id` - The identifier of the Tarobase application",
536
+ "* `generic_path` - The generic path within the app for which to finish the bytecode stream"
537
+ ];
538
+ "discriminator": [
539
+ 253,
540
+ 181,
541
+ 4,
542
+ 101,
543
+ 80,
544
+ 76,
545
+ 9,
546
+ 136
547
+ ];
548
+ "accounts": [
549
+ {
550
+ "name": "genericPathExecutionData";
551
+ "writable": true;
552
+ "pda": {
553
+ "seeds": [
554
+ {
555
+ "kind": "const";
556
+ "value": [
557
+ 97,
558
+ 110,
559
+ 99,
560
+ 104,
561
+ 111,
562
+ 114,
563
+ 95,
564
+ 108,
565
+ 97,
566
+ 110,
567
+ 103,
568
+ 32,
569
+ 58,
570
+ 58,
571
+ 32,
572
+ 115,
573
+ 111,
574
+ 108,
575
+ 97,
576
+ 110,
577
+ 97,
578
+ 95,
579
+ 112,
580
+ 114,
581
+ 111,
582
+ 103,
583
+ 114,
584
+ 97,
585
+ 109,
586
+ 32,
587
+ 58,
588
+ 58,
589
+ 32,
590
+ 104,
591
+ 97,
592
+ 115,
593
+ 104,
594
+ 32,
595
+ 58,
596
+ 58,
597
+ 10,
598
+ 104,
599
+ 97,
600
+ 115,
601
+ 104,
602
+ 40,
603
+ 38,
604
+ 10,
605
+ 91,
606
+ 98,
607
+ 34,
608
+ 116,
609
+ 97,
610
+ 114,
611
+ 111,
612
+ 98,
613
+ 97,
614
+ 115,
615
+ 101,
616
+ 95,
617
+ 103,
618
+ 101,
619
+ 110,
620
+ 101,
621
+ 114,
622
+ 105,
623
+ 99,
624
+ 95,
625
+ 112,
626
+ 97,
627
+ 116,
628
+ 104,
629
+ 34,
630
+ 44,
631
+ 32,
632
+ 97,
633
+ 112,
634
+ 112,
635
+ 95,
636
+ 105,
637
+ 100
638
+ ];
639
+ }
640
+ ];
641
+ };
642
+ },
643
+ {
644
+ "name": "admin";
645
+ "signer": true;
646
+ "relations": [
647
+ "genericPathExecutionData"
648
+ ];
649
+ }
650
+ ];
651
+ "args": [
652
+ {
653
+ "name": "appId";
654
+ "type": "string";
655
+ },
656
+ {
657
+ "name": "genericPath";
658
+ "type": "string";
659
+ }
660
+ ];
661
+ },
662
+ {
663
+ "name": "resolveGenericPathExecutionData";
664
+ "docs": [
665
+ "Resolves the generic path execution data for a generic path in a Tarobase app.",
666
+ "",
667
+ "This instruction resolves the generic path execution data for a specific",
668
+ "generic path within an application. It is used to finalize the bytecode for the rules and hooks for a path.",
669
+ "Only the admin can finish a stream. Once a path is resolved then you can call set_documents to set data.",
670
+ "",
671
+ "# Arguments",
672
+ "* `ctx` - The context containing all accounts needed for this instruction",
673
+ "* `app_id` - The identifier of the Tarobase application",
674
+ "* `generic_path` - The generic path within the app for which to resolve the generic path execution data"
675
+ ];
676
+ "discriminator": [
677
+ 220,
678
+ 84,
679
+ 242,
680
+ 227,
681
+ 241,
682
+ 140,
683
+ 159,
684
+ 12
685
+ ];
686
+ "accounts": [
687
+ {
688
+ "name": "admin";
689
+ "writable": true;
690
+ "signer": true;
691
+ "relations": [
692
+ "genericPathExecutionData"
693
+ ];
694
+ },
695
+ {
696
+ "name": "genericPathExecutionData";
697
+ "writable": true;
698
+ }
699
+ ];
700
+ "args": [
701
+ {
702
+ "name": "appId";
703
+ "type": "string";
704
+ },
705
+ {
706
+ "name": "genericPath";
707
+ "type": "string";
708
+ }
709
+ ];
710
+ },
711
+ {
712
+ "name": "setDocuments";
713
+ "docs": [
714
+ "Sets documents in a Tarobase app.",
715
+ "",
716
+ "This core instruction that sets documents in a Tarobase app. It is called when somone calls set() or setMany() from the Tarobase SDK.",
717
+ "It is used to set the documents in the Tarobase app. For each document we are trying to set we need to run its rules and hooks.",
718
+ "If it fails the rule for the specific operation we are trying to do CREATE/UPDATE/DELETE, we need to revert the changes and return an error.",
719
+ "The transaction should revert and no changes should go through even if other documents would have been updated successfully.",
720
+ "If all rules pass then we execute the hooks and update the actual documents on chain.",
721
+ "It should handle lamports and account sizes. Excess should be refunded to the payer.",
722
+ "Simulate mode is used to extract the remaining accounts needed for the transaction. It should be readonly and not modify state or run any rules/hooks.",
723
+ "It simply logs the remaining accounts needed for the transaction.",
724
+ "",
725
+ "# Arguments",
726
+ "* `ctx` - The context containing all accounts needed for this instruction",
727
+ "* `app_id` - The identifier of the Tarobase application",
728
+ "* `documents` - The documents to set",
729
+ "* `delete_paths` - The paths of the documents to delete",
730
+ "* `simulate` - Whether to simulate the transaction to extract the remaining accounts needed for the transaction"
731
+ ];
732
+ "discriminator": [
733
+ 79,
734
+ 46,
735
+ 72,
736
+ 73,
737
+ 24,
738
+ 79,
739
+ 66,
740
+ 245
741
+ ];
742
+ "accounts": [
743
+ {
744
+ "name": "payer";
745
+ "writable": true;
746
+ "signer": true;
747
+ },
748
+ {
749
+ "name": "systemProgram";
750
+ "address": "11111111111111111111111111111111";
751
+ }
752
+ ];
753
+ "args": [
754
+ {
755
+ "name": "appId";
756
+ "type": "string";
757
+ },
758
+ {
759
+ "name": "documents";
760
+ "type": {
761
+ "vec": {
762
+ "defined": {
763
+ "name": "setDocumentData";
764
+ };
765
+ };
766
+ };
767
+ },
768
+ {
769
+ "name": "deletePaths";
770
+ "type": {
771
+ "vec": "string";
772
+ };
773
+ },
774
+ {
775
+ "name": "txData";
776
+ "type": {
777
+ "vec": {
778
+ "defined": {
779
+ "name": "txData";
780
+ };
781
+ };
782
+ };
783
+ },
784
+ {
785
+ "name": "simulate";
786
+ "type": "bool";
787
+ }
788
+ ];
789
+ },
790
+ {
791
+ "name": "updateGenericPathExecutionData";
792
+ "docs": [
793
+ "Updates the executable bytecode for a generic path in a Tarobase app.",
794
+ "",
795
+ "This instruction allows the admin to update the bytecode for a specific",
796
+ "generic path within an application. It supports updating the rules, hooks,",
797
+ "and other metadata associated with the generic path. It lets you update the account partially to get around",
798
+ "transaction size limits. It should handle account sizes and handle rent and refund the leftover lamports to the admin.",
799
+ "",
800
+ "# Arguments",
801
+ "* `ctx` - The context containing all accounts needed for this instruction",
802
+ "* `app_id` - The identifier of the Tarobase application",
803
+ "* `generic_path` - The generic path within the app for which to update bytecode",
804
+ "* `create_rule_bytecode` - The bytecode for the create rule",
805
+ "* `update_rule_bytecode` - The bytecode for the update rule",
806
+ "* `delete_rule_bytecode` - The bytecode for the delete rule",
807
+ "* `create_hook_bytecode` - The bytecode for the create hook",
808
+ "* `update_hook_bytecode` - The bytecode for the update hook",
809
+ "* `delete_hook_bytecode` - The bytecode for the delete hook",
810
+ "* `string_literal_map` - An array of string literals, field names access, path variables and path segments used in the bytecode, indexed by the bytecode index. The bytecode uses the index to know which field name to use for the literal.",
811
+ "* `path_var_map` - An array of the path variables used for this path like $userId, $postId, etc.",
812
+ "* `field_to_type_map` - An array of the field names and their types",
813
+ "* `field_to_required_map` - An array of the field names and if they are required",
814
+ "* `field_to_readonly_map` - An array of the field names and if they are readonly aka can never be updated",
815
+ "* `is_passthrough` - Whether the path is a passthrough path, meaning it will not actually store the fields on the PDA, but will instead pass the fields to the hooks."
816
+ ];
817
+ "discriminator": [
818
+ 216,
819
+ 188,
820
+ 3,
821
+ 56,
822
+ 131,
823
+ 81,
824
+ 178,
825
+ 239
826
+ ];
827
+ "accounts": [
828
+ {
829
+ "name": "admin";
830
+ "writable": true;
831
+ "signer": true;
832
+ "relations": [
833
+ "genericPathExecutionData"
834
+ ];
835
+ },
836
+ {
837
+ "name": "genericPathExecutionData";
838
+ "writable": true;
839
+ },
840
+ {
841
+ "name": "systemProgram";
842
+ "address": "11111111111111111111111111111111";
843
+ }
844
+ ];
845
+ "args": [
846
+ {
847
+ "name": "appId";
848
+ "type": "string";
849
+ },
850
+ {
851
+ "name": "genericPath";
852
+ "type": "string";
853
+ },
854
+ {
855
+ "name": "createRuleBytecode";
856
+ "type": {
857
+ "option": "bytes";
858
+ };
859
+ },
860
+ {
861
+ "name": "updateRuleBytecode";
862
+ "type": {
863
+ "option": "bytes";
864
+ };
865
+ },
866
+ {
867
+ "name": "deleteRuleBytecode";
868
+ "type": {
869
+ "option": "bytes";
870
+ };
871
+ },
872
+ {
873
+ "name": "createHookBytecode";
874
+ "type": {
875
+ "option": "bytes";
876
+ };
877
+ },
878
+ {
879
+ "name": "updateHookBytecode";
880
+ "type": {
881
+ "option": "bytes";
882
+ };
883
+ },
884
+ {
885
+ "name": "deleteHookBytecode";
886
+ "type": {
887
+ "option": "bytes";
888
+ };
889
+ },
890
+ {
891
+ "name": "stringLiteralMap";
892
+ "type": {
893
+ "option": {
894
+ "vec": "string";
895
+ };
896
+ };
897
+ },
898
+ {
899
+ "name": "pathVarMap";
900
+ "type": {
901
+ "option": {
902
+ "vec": "string";
903
+ };
904
+ };
905
+ },
906
+ {
907
+ "name": "fieldToTypeMap";
908
+ "type": {
909
+ "option": {
910
+ "vec": {
911
+ "defined": {
912
+ "name": "fieldToTypeMap";
913
+ };
914
+ };
915
+ };
916
+ };
917
+ },
918
+ {
919
+ "name": "fieldToRequiredMap";
920
+ "type": {
921
+ "option": {
922
+ "vec": {
923
+ "defined": {
924
+ "name": "fieldToBooleanMap";
925
+ };
926
+ };
927
+ };
928
+ };
929
+ },
930
+ {
931
+ "name": "fieldToReadonlyMap";
932
+ "type": {
933
+ "option": {
934
+ "vec": {
935
+ "defined": {
936
+ "name": "fieldToBooleanMap";
937
+ };
938
+ };
939
+ };
940
+ };
941
+ },
942
+ {
943
+ "name": "isPassthrough";
944
+ "type": {
945
+ "option": "bool";
946
+ };
947
+ }
948
+ ];
949
+ }
950
+ ];
951
+ "accounts": [
952
+ {
953
+ "name": "document";
954
+ "discriminator": [
955
+ 226,
956
+ 212,
957
+ 133,
958
+ 177,
959
+ 48,
960
+ 5,
961
+ 171,
962
+ 243
963
+ ];
964
+ },
965
+ {
966
+ "name": "genericPathExecutionData";
967
+ "discriminator": [
968
+ 206,
969
+ 245,
970
+ 184,
971
+ 13,
972
+ 145,
973
+ 124,
974
+ 191,
975
+ 6
976
+ ];
977
+ }
978
+ ];
979
+ "errors": [
980
+ {
981
+ "code": 6000;
982
+ "name": "missingTypeTag";
983
+ "msg": "Missing type tag for literal";
984
+ },
985
+ {
986
+ "code": 6001;
987
+ "name": "notEnoughBytes";
988
+ "msg": "Not enough bytes";
989
+ },
990
+ {
991
+ "code": 6002;
992
+ "name": "invalidFieldId";
993
+ "msg": "Invalid field ID";
994
+ },
995
+ {
996
+ "code": 6003;
997
+ "name": "stackUnderflow";
998
+ "msg": "Stack underflow";
999
+ },
1000
+ {
1001
+ "code": 6004;
1002
+ "name": "typeMismatch";
1003
+ "msg": "Type mismatch in operation";
1004
+ },
1005
+ {
1006
+ "code": 6005;
1007
+ "name": "invalidConversion";
1008
+ "msg": "Invalid conversion";
1009
+ },
1010
+ {
1011
+ "code": 6006;
1012
+ "name": "unknownLiteralType";
1013
+ "msg": "Unknown literal type";
1014
+ },
1015
+ {
1016
+ "code": 6007;
1017
+ "name": "invalidOpcode";
1018
+ "msg": "Invalid opcode";
1019
+ },
1020
+ {
1021
+ "code": 6008;
1022
+ "name": "invalidTimeTag";
1023
+ "msg": "Invalid time tag";
1024
+ },
1025
+ {
1026
+ "code": 6009;
1027
+ "name": "functionNotImplemented";
1028
+ "msg": "Function not implemented";
1029
+ },
1030
+ {
1031
+ "code": 6010;
1032
+ "name": "invalidFunctionType";
1033
+ "msg": "Invalid function type";
1034
+ },
1035
+ {
1036
+ "code": 6011;
1037
+ "name": "unexpectedOwner";
1038
+ "msg": "Unexpected owner";
1039
+ }
1040
+ ];
1041
+ "types": [
1042
+ {
1043
+ "name": "bytecodeType";
1044
+ "repr": {
1045
+ "kind": "rust";
1046
+ };
1047
+ "type": {
1048
+ "kind": "enum";
1049
+ "variants": [
1050
+ {
1051
+ "name": "createRule";
1052
+ },
1053
+ {
1054
+ "name": "updateRule";
1055
+ },
1056
+ {
1057
+ "name": "deleteRule";
1058
+ },
1059
+ {
1060
+ "name": "createHook";
1061
+ },
1062
+ {
1063
+ "name": "updateHook";
1064
+ },
1065
+ {
1066
+ "name": "deleteHook";
1067
+ }
1068
+ ];
1069
+ };
1070
+ },
1071
+ {
1072
+ "name": "document";
1073
+ "type": {
1074
+ "kind": "struct";
1075
+ "fields": [
1076
+ {
1077
+ "name": "payer";
1078
+ "type": "pubkey";
1079
+ },
1080
+ {
1081
+ "name": "path";
1082
+ "type": "string";
1083
+ },
1084
+ {
1085
+ "name": "appId";
1086
+ "type": "string";
1087
+ },
1088
+ {
1089
+ "name": "fields";
1090
+ "type": {
1091
+ "vec": {
1092
+ "defined": {
1093
+ "name": "kvPair";
1094
+ };
1095
+ };
1096
+ };
1097
+ }
1098
+ ];
1099
+ };
1100
+ },
1101
+ {
1102
+ "name": "fieldOperation";
1103
+ "type": {
1104
+ "kind": "struct";
1105
+ "fields": [
1106
+ {
1107
+ "name": "key";
1108
+ "type": "string";
1109
+ },
1110
+ {
1111
+ "name": "value";
1112
+ "type": {
1113
+ "option": {
1114
+ "defined": {
1115
+ "name": "fieldValue";
1116
+ };
1117
+ };
1118
+ };
1119
+ },
1120
+ {
1121
+ "name": "operation";
1122
+ "type": "u8";
1123
+ }
1124
+ ];
1125
+ };
1126
+ },
1127
+ {
1128
+ "name": "fieldToBooleanMap";
1129
+ "type": {
1130
+ "kind": "struct";
1131
+ "fields": [
1132
+ {
1133
+ "name": "field";
1134
+ "type": "string";
1135
+ },
1136
+ {
1137
+ "name": "boolean";
1138
+ "type": "bool";
1139
+ }
1140
+ ];
1141
+ };
1142
+ },
1143
+ {
1144
+ "name": "fieldToTypeMap";
1145
+ "type": {
1146
+ "kind": "struct";
1147
+ "fields": [
1148
+ {
1149
+ "name": "field";
1150
+ "type": "string";
1151
+ },
1152
+ {
1153
+ "name": "fieldType";
1154
+ "type": "u8";
1155
+ }
1156
+ ];
1157
+ };
1158
+ },
1159
+ {
1160
+ "name": "fieldValue";
1161
+ "type": {
1162
+ "kind": "enum";
1163
+ "variants": [
1164
+ {
1165
+ "name": "u64Val";
1166
+ "fields": [
1167
+ {
1168
+ "name": "value";
1169
+ "type": "u64";
1170
+ }
1171
+ ];
1172
+ },
1173
+ {
1174
+ "name": "i64Val";
1175
+ "fields": [
1176
+ {
1177
+ "name": "value";
1178
+ "type": "i64";
1179
+ }
1180
+ ];
1181
+ },
1182
+ {
1183
+ "name": "boolVal";
1184
+ "fields": [
1185
+ {
1186
+ "name": "value";
1187
+ "type": "bool";
1188
+ }
1189
+ ];
1190
+ },
1191
+ {
1192
+ "name": "stringVal";
1193
+ "fields": [
1194
+ {
1195
+ "name": "value";
1196
+ "type": "string";
1197
+ }
1198
+ ];
1199
+ },
1200
+ {
1201
+ "name": "addressVal";
1202
+ "fields": [
1203
+ {
1204
+ "name": "value";
1205
+ "type": "pubkey";
1206
+ }
1207
+ ];
1208
+ }
1209
+ ];
1210
+ };
1211
+ },
1212
+ {
1213
+ "name": "genericPathExecutionData";
1214
+ "type": {
1215
+ "kind": "struct";
1216
+ "fields": [
1217
+ {
1218
+ "name": "admin";
1219
+ "type": "pubkey";
1220
+ },
1221
+ {
1222
+ "name": "appId";
1223
+ "type": "string";
1224
+ },
1225
+ {
1226
+ "name": "genericPath";
1227
+ "type": "string";
1228
+ },
1229
+ {
1230
+ "name": "createRuleBytecode";
1231
+ "type": "bytes";
1232
+ },
1233
+ {
1234
+ "name": "updateRuleBytecode";
1235
+ "type": "bytes";
1236
+ },
1237
+ {
1238
+ "name": "deleteRuleBytecode";
1239
+ "type": "bytes";
1240
+ },
1241
+ {
1242
+ "name": "createHookBytecode";
1243
+ "type": "bytes";
1244
+ },
1245
+ {
1246
+ "name": "updateHookBytecode";
1247
+ "type": "bytes";
1248
+ },
1249
+ {
1250
+ "name": "deleteHookBytecode";
1251
+ "type": "bytes";
1252
+ },
1253
+ {
1254
+ "name": "stringLiteralMap";
1255
+ "type": {
1256
+ "vec": "string";
1257
+ };
1258
+ },
1259
+ {
1260
+ "name": "pathVarMap";
1261
+ "type": {
1262
+ "vec": "string";
1263
+ };
1264
+ },
1265
+ {
1266
+ "name": "fieldToTypeMap";
1267
+ "type": {
1268
+ "vec": {
1269
+ "defined": {
1270
+ "name": "fieldToTypeMap";
1271
+ };
1272
+ };
1273
+ };
1274
+ },
1275
+ {
1276
+ "name": "fieldToRequiredMap";
1277
+ "type": {
1278
+ "vec": {
1279
+ "defined": {
1280
+ "name": "fieldToBooleanMap";
1281
+ };
1282
+ };
1283
+ };
1284
+ },
1285
+ {
1286
+ "name": "fieldToReadonlyMap";
1287
+ "type": {
1288
+ "vec": {
1289
+ "defined": {
1290
+ "name": "fieldToBooleanMap";
1291
+ };
1292
+ };
1293
+ };
1294
+ },
1295
+ {
1296
+ "name": "streamingTarget";
1297
+ "type": {
1298
+ "option": {
1299
+ "defined": {
1300
+ "name": "bytecodeType";
1301
+ };
1302
+ };
1303
+ };
1304
+ },
1305
+ {
1306
+ "name": "isPassthrough";
1307
+ "type": "bool";
1308
+ },
1309
+ {
1310
+ "name": "isUpdating";
1311
+ "type": "bool";
1312
+ }
1313
+ ];
1314
+ };
1315
+ },
1316
+ {
1317
+ "name": "kvPair";
1318
+ "type": {
1319
+ "kind": "struct";
1320
+ "fields": [
1321
+ {
1322
+ "name": "key";
1323
+ "type": "string";
1324
+ },
1325
+ {
1326
+ "name": "value";
1327
+ "type": {
1328
+ "defined": {
1329
+ "name": "fieldValue";
1330
+ };
1331
+ };
1332
+ }
1333
+ ];
1334
+ };
1335
+ },
1336
+ {
1337
+ "name": "setDocumentData";
1338
+ "type": {
1339
+ "kind": "struct";
1340
+ "fields": [
1341
+ {
1342
+ "name": "path";
1343
+ "type": "string";
1344
+ },
1345
+ {
1346
+ "name": "operations";
1347
+ "type": {
1348
+ "vec": {
1349
+ "defined": {
1350
+ "name": "fieldOperation";
1351
+ };
1352
+ };
1353
+ };
1354
+ }
1355
+ ];
1356
+ };
1357
+ },
1358
+ {
1359
+ "name": "txData";
1360
+ "type": {
1361
+ "kind": "struct";
1362
+ "fields": [
1363
+ {
1364
+ "name": "pluginFunctionKey";
1365
+ "type": "string";
1366
+ },
1367
+ {
1368
+ "name": "txData";
1369
+ "type": "bytes";
1370
+ },
1371
+ {
1372
+ "name": "raIndices";
1373
+ "type": {
1374
+ "vec": "u64";
1375
+ };
1376
+ }
1377
+ ];
1378
+ };
1379
+ }
1380
+ ];
1381
+ };