@helium/spl-utils 0.10.0-alpha.2 → 0.10.0-alpha.4

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,690 @@
1
+ {
2
+ "address": "propFYxqmVcufMhk5esNMrexq2ogHbbC2kP9PU1qxKs",
3
+ "metadata": {
4
+ "name": "proposal",
5
+ "version": "0.1.1",
6
+ "spec": "0.1.0",
7
+ "description": "Created with Anchor"
8
+ },
9
+ "instructions": [
10
+ {
11
+ "name": "initialize_proposal_config_v0",
12
+ "discriminator": [
13
+ 126,
14
+ 56,
15
+ 75,
16
+ 243,
17
+ 150,
18
+ 18,
19
+ 71,
20
+ 178
21
+ ],
22
+ "accounts": [
23
+ {
24
+ "name": "payer",
25
+ "writable": true,
26
+ "signer": true
27
+ },
28
+ {
29
+ "name": "owner",
30
+ "signer": true
31
+ },
32
+ {
33
+ "name": "proposal_config",
34
+ "writable": true,
35
+ "pda": {
36
+ "seeds": [
37
+ {
38
+ "kind": "const",
39
+ "value": [
40
+ 112,
41
+ 114,
42
+ 111,
43
+ 112,
44
+ 111,
45
+ 115,
46
+ 97,
47
+ 108,
48
+ 95,
49
+ 99,
50
+ 111,
51
+ 110,
52
+ 102,
53
+ 105,
54
+ 103
55
+ ]
56
+ },
57
+ {
58
+ "kind": "arg",
59
+ "path": "args.name"
60
+ }
61
+ ]
62
+ }
63
+ },
64
+ {
65
+ "name": "system_program",
66
+ "address": "11111111111111111111111111111111"
67
+ }
68
+ ],
69
+ "args": [
70
+ {
71
+ "name": "args",
72
+ "type": {
73
+ "defined": {
74
+ "name": "InitializeProposalConfigArgsV0"
75
+ }
76
+ }
77
+ }
78
+ ]
79
+ },
80
+ {
81
+ "name": "initialize_proposal_v0",
82
+ "discriminator": [
83
+ 63,
84
+ 235,
85
+ 9,
86
+ 201,
87
+ 163,
88
+ 171,
89
+ 206,
90
+ 33
91
+ ],
92
+ "accounts": [
93
+ {
94
+ "name": "payer",
95
+ "writable": true,
96
+ "signer": true
97
+ },
98
+ {
99
+ "name": "namespace",
100
+ "docs": [
101
+ "Every proposal must have a namespace to prevent seed collision"
102
+ ],
103
+ "signer": true
104
+ },
105
+ {
106
+ "name": "proposal",
107
+ "writable": true
108
+ },
109
+ {
110
+ "name": "owner"
111
+ },
112
+ {
113
+ "name": "proposal_config"
114
+ },
115
+ {
116
+ "name": "system_program",
117
+ "address": "11111111111111111111111111111111"
118
+ }
119
+ ],
120
+ "args": [
121
+ {
122
+ "name": "args",
123
+ "type": {
124
+ "defined": {
125
+ "name": "InitializeProposalArgsV0"
126
+ }
127
+ }
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "name": "update_proposal_config_v0",
133
+ "discriminator": [
134
+ 10,
135
+ 35,
136
+ 154,
137
+ 40,
138
+ 71,
139
+ 42,
140
+ 34,
141
+ 68
142
+ ],
143
+ "accounts": [
144
+ {
145
+ "name": "proposal_config",
146
+ "writable": true
147
+ },
148
+ {
149
+ "name": "authority",
150
+ "signer": true,
151
+ "relations": [
152
+ "proposal_config"
153
+ ]
154
+ }
155
+ ],
156
+ "args": [
157
+ {
158
+ "name": "args",
159
+ "type": {
160
+ "defined": {
161
+ "name": "UpdateProposalConfigArgsV0"
162
+ }
163
+ }
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "name": "update_state_v0",
169
+ "discriminator": [
170
+ 234,
171
+ 64,
172
+ 38,
173
+ 223,
174
+ 224,
175
+ 216,
176
+ 29,
177
+ 82
178
+ ],
179
+ "accounts": [
180
+ {
181
+ "name": "state_controller",
182
+ "signer": true,
183
+ "relations": [
184
+ "proposal_config"
185
+ ]
186
+ },
187
+ {
188
+ "name": "proposal",
189
+ "writable": true
190
+ },
191
+ {
192
+ "name": "proposal_config",
193
+ "relations": [
194
+ "proposal"
195
+ ]
196
+ }
197
+ ],
198
+ "args": [
199
+ {
200
+ "name": "args",
201
+ "type": {
202
+ "defined": {
203
+ "name": "UpdateStateArgsV0"
204
+ }
205
+ }
206
+ }
207
+ ]
208
+ },
209
+ {
210
+ "name": "vote_v0",
211
+ "discriminator": [
212
+ 82,
213
+ 47,
214
+ 20,
215
+ 22,
216
+ 108,
217
+ 59,
218
+ 245,
219
+ 115
220
+ ],
221
+ "accounts": [
222
+ {
223
+ "name": "vote_controller",
224
+ "signer": true,
225
+ "relations": [
226
+ "proposal_config"
227
+ ]
228
+ },
229
+ {
230
+ "name": "voter"
231
+ },
232
+ {
233
+ "name": "state_controller",
234
+ "writable": true,
235
+ "relations": [
236
+ "proposal_config"
237
+ ]
238
+ },
239
+ {
240
+ "name": "proposal_config",
241
+ "relations": [
242
+ "proposal"
243
+ ]
244
+ },
245
+ {
246
+ "name": "proposal",
247
+ "writable": true
248
+ },
249
+ {
250
+ "name": "on_vote_hook",
251
+ "relations": [
252
+ "proposal_config"
253
+ ]
254
+ }
255
+ ],
256
+ "args": [
257
+ {
258
+ "name": "args",
259
+ "type": {
260
+ "defined": {
261
+ "name": "VoteArgsV0"
262
+ }
263
+ }
264
+ }
265
+ ]
266
+ }
267
+ ],
268
+ "accounts": [
269
+ {
270
+ "name": "ProposalConfigV0",
271
+ "discriminator": [
272
+ 162,
273
+ 41,
274
+ 210,
275
+ 200,
276
+ 205,
277
+ 177,
278
+ 228,
279
+ 11
280
+ ]
281
+ },
282
+ {
283
+ "name": "ProposalV0",
284
+ "discriminator": [
285
+ 254,
286
+ 194,
287
+ 16,
288
+ 171,
289
+ 214,
290
+ 20,
291
+ 192,
292
+ 81
293
+ ]
294
+ }
295
+ ],
296
+ "errors": [
297
+ {
298
+ "code": 6000,
299
+ "name": "ArithmeticError",
300
+ "msg": "Error in arithmetic"
301
+ },
302
+ {
303
+ "code": 6001,
304
+ "name": "StringTooLong",
305
+ "msg": "String exceeds limits"
306
+ }
307
+ ],
308
+ "types": [
309
+ {
310
+ "name": "Choice",
311
+ "type": {
312
+ "kind": "struct",
313
+ "fields": [
314
+ {
315
+ "name": "weight",
316
+ "docs": [
317
+ "Total vote weight behind this choice. u128 to support u64 tokens multiplied by a large multiplier (as in helium)"
318
+ ],
319
+ "type": "u128"
320
+ },
321
+ {
322
+ "name": "name",
323
+ "type": "string"
324
+ },
325
+ {
326
+ "name": "uri",
327
+ "docs": [
328
+ "Any other data that you may want to put in here"
329
+ ],
330
+ "type": {
331
+ "option": "string"
332
+ }
333
+ }
334
+ ]
335
+ }
336
+ },
337
+ {
338
+ "name": "ChoiceArg",
339
+ "type": {
340
+ "kind": "struct",
341
+ "fields": [
342
+ {
343
+ "name": "name",
344
+ "type": "string"
345
+ },
346
+ {
347
+ "name": "uri",
348
+ "docs": [
349
+ "Any other data that you may want to put in here"
350
+ ],
351
+ "type": {
352
+ "option": "string"
353
+ }
354
+ }
355
+ ]
356
+ }
357
+ },
358
+ {
359
+ "name": "InitializeProposalArgsV0",
360
+ "type": {
361
+ "kind": "struct",
362
+ "fields": [
363
+ {
364
+ "name": "seed",
365
+ "docs": [
366
+ "Allow a custom seed for indexing"
367
+ ],
368
+ "type": "bytes"
369
+ },
370
+ {
371
+ "name": "name",
372
+ "type": "string"
373
+ },
374
+ {
375
+ "name": "uri",
376
+ "type": "string"
377
+ },
378
+ {
379
+ "name": "max_choices_per_voter",
380
+ "docs": [
381
+ "Allows for multiple selection votes"
382
+ ],
383
+ "type": "u16"
384
+ },
385
+ {
386
+ "name": "choices",
387
+ "type": {
388
+ "vec": {
389
+ "defined": {
390
+ "name": "ChoiceArg"
391
+ }
392
+ }
393
+ }
394
+ },
395
+ {
396
+ "name": "tags",
397
+ "type": {
398
+ "vec": "string"
399
+ }
400
+ }
401
+ ]
402
+ }
403
+ },
404
+ {
405
+ "name": "InitializeProposalConfigArgsV0",
406
+ "type": {
407
+ "kind": "struct",
408
+ "fields": [
409
+ {
410
+ "name": "name",
411
+ "type": "string"
412
+ },
413
+ {
414
+ "name": "vote_controller",
415
+ "docs": [
416
+ "Signer that controls voting and vote weights"
417
+ ],
418
+ "type": "pubkey"
419
+ },
420
+ {
421
+ "name": "state_controller",
422
+ "docs": [
423
+ "Signer that controls the transitions of `ProposalState`",
424
+ "You can either use the default `state-controller` smart contract",
425
+ "Or you can implement a program that calls the `resolve_v0` method.",
426
+ "The vote can only be resolved when this `resolution_settings` PDA signs `resolve_v0`. This allows",
427
+ "you to trigger resolution on either (a) a vote, (b) a timestamp, or (c) some custom trigger with clockwork"
428
+ ],
429
+ "type": "pubkey"
430
+ },
431
+ {
432
+ "name": "on_vote_hook",
433
+ "docs": [
434
+ "Optional program that will be called with `on_vote_v0` after every vote",
435
+ "Defaults to the owner of `resolution_settings`, which allows it to reactively call resolve_v0"
436
+ ],
437
+ "type": "pubkey"
438
+ },
439
+ {
440
+ "name": "authority",
441
+ "type": "pubkey"
442
+ }
443
+ ]
444
+ }
445
+ },
446
+ {
447
+ "name": "ProposalConfigV0",
448
+ "type": {
449
+ "kind": "struct",
450
+ "fields": [
451
+ {
452
+ "name": "vote_controller",
453
+ "docs": [
454
+ "Signer that controls voting and vote weights"
455
+ ],
456
+ "type": "pubkey"
457
+ },
458
+ {
459
+ "name": "state_controller",
460
+ "docs": [
461
+ "Signer that controls the transitions of `ProposalState`",
462
+ "You can either use the default `state-controller` smart contract",
463
+ "Or you can implement a program that calls the `resolve_v0` method.",
464
+ "The vote can only be resolved when this `resolution_settings` PDA signs `resolve_v0`. This allows",
465
+ "you to trigger resolution on either (a) a vote, (b) a timestamp, or (c) some custom trigger with clockwork"
466
+ ],
467
+ "type": "pubkey"
468
+ },
469
+ {
470
+ "name": "on_vote_hook",
471
+ "docs": [
472
+ "Optional program that will be called with `on_vote_v0` after every vote. This allows you to resolve",
473
+ "the vote eagerly. For most use cases, this should just be the owner of the state controller.",
474
+ "WARNING: This program has full authority to set the outcome of votes, make sure you trust it"
475
+ ],
476
+ "type": "pubkey"
477
+ },
478
+ {
479
+ "name": "name",
480
+ "type": "string"
481
+ },
482
+ {
483
+ "name": "bump_seed",
484
+ "type": "u8"
485
+ },
486
+ {
487
+ "name": "authority",
488
+ "type": "pubkey"
489
+ }
490
+ ]
491
+ }
492
+ },
493
+ {
494
+ "name": "ProposalState",
495
+ "type": {
496
+ "kind": "enum",
497
+ "variants": [
498
+ {
499
+ "name": "Draft"
500
+ },
501
+ {
502
+ "name": "Cancelled"
503
+ },
504
+ {
505
+ "name": "Voting",
506
+ "fields": [
507
+ {
508
+ "name": "start_ts",
509
+ "type": "i64"
510
+ }
511
+ ]
512
+ },
513
+ {
514
+ "name": "Resolved",
515
+ "fields": [
516
+ {
517
+ "name": "choices",
518
+ "type": {
519
+ "vec": "u16"
520
+ }
521
+ },
522
+ {
523
+ "name": "end_ts",
524
+ "type": "i64"
525
+ }
526
+ ]
527
+ },
528
+ {
529
+ "name": "Custom",
530
+ "fields": [
531
+ {
532
+ "name": "name",
533
+ "type": "string"
534
+ },
535
+ {
536
+ "name": "bin",
537
+ "type": "bytes"
538
+ }
539
+ ]
540
+ }
541
+ ]
542
+ }
543
+ },
544
+ {
545
+ "name": "ProposalV0",
546
+ "type": {
547
+ "kind": "struct",
548
+ "fields": [
549
+ {
550
+ "name": "namespace",
551
+ "type": "pubkey"
552
+ },
553
+ {
554
+ "name": "owner",
555
+ "type": "pubkey"
556
+ },
557
+ {
558
+ "name": "state",
559
+ "type": {
560
+ "defined": {
561
+ "name": "ProposalState"
562
+ }
563
+ }
564
+ },
565
+ {
566
+ "name": "created_at",
567
+ "type": "i64"
568
+ },
569
+ {
570
+ "name": "proposal_config",
571
+ "type": "pubkey"
572
+ },
573
+ {
574
+ "name": "max_choices_per_voter",
575
+ "docs": [
576
+ "Allows for multiple selection votes"
577
+ ],
578
+ "type": "u16"
579
+ },
580
+ {
581
+ "name": "seed",
582
+ "type": "bytes"
583
+ },
584
+ {
585
+ "name": "name",
586
+ "type": "string"
587
+ },
588
+ {
589
+ "name": "uri",
590
+ "docs": [
591
+ "URI to json containing name, description, etc"
592
+ ],
593
+ "type": "string"
594
+ },
595
+ {
596
+ "name": "tags",
597
+ "type": {
598
+ "vec": "string"
599
+ }
600
+ },
601
+ {
602
+ "name": "choices",
603
+ "type": {
604
+ "vec": {
605
+ "defined": {
606
+ "name": "Choice"
607
+ }
608
+ }
609
+ }
610
+ },
611
+ {
612
+ "name": "bump_seed",
613
+ "type": "u8"
614
+ }
615
+ ]
616
+ }
617
+ },
618
+ {
619
+ "name": "UpdateProposalConfigArgsV0",
620
+ "type": {
621
+ "kind": "struct",
622
+ "fields": [
623
+ {
624
+ "name": "vote_controller",
625
+ "type": {
626
+ "option": "pubkey"
627
+ }
628
+ },
629
+ {
630
+ "name": "state_controller",
631
+ "type": {
632
+ "option": "pubkey"
633
+ }
634
+ },
635
+ {
636
+ "name": "on_vote_hook",
637
+ "type": {
638
+ "option": "pubkey"
639
+ }
640
+ },
641
+ {
642
+ "name": "authority",
643
+ "type": {
644
+ "option": "pubkey"
645
+ }
646
+ }
647
+ ]
648
+ }
649
+ },
650
+ {
651
+ "name": "UpdateStateArgsV0",
652
+ "type": {
653
+ "kind": "struct",
654
+ "fields": [
655
+ {
656
+ "name": "new_state",
657
+ "type": {
658
+ "defined": {
659
+ "name": "ProposalState"
660
+ }
661
+ }
662
+ }
663
+ ]
664
+ }
665
+ },
666
+ {
667
+ "name": "VoteArgsV0",
668
+ "type": {
669
+ "kind": "struct",
670
+ "fields": [
671
+ {
672
+ "name": "choice",
673
+ "type": "u16"
674
+ },
675
+ {
676
+ "name": "weight",
677
+ "type": "u128"
678
+ },
679
+ {
680
+ "name": "remove_vote",
681
+ "docs": [
682
+ "This is a remove operation"
683
+ ],
684
+ "type": "bool"
685
+ }
686
+ ]
687
+ }
688
+ }
689
+ ]
690
+ }