@streamflow/distributor 7.5.3 → 8.0.0-alpha.p287.25d0c28

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.
Files changed (97) hide show
  1. package/dist/cjs/index.cjs +4531 -0
  2. package/dist/cjs/index.cjs.map +1 -0
  3. package/dist/cjs/index.d.cts +11 -0
  4. package/dist/cjs/solana/descriptor/aligned_distributor.cjs +4 -0
  5. package/dist/cjs/solana/descriptor/aligned_distributor.cjs.map +1 -0
  6. package/dist/cjs/solana/descriptor/{idl/aligned_distributor.json → aligned_distributor.d.cts} +641 -507
  7. package/dist/cjs/solana/descriptor/merkle_distributor.cjs +4 -0
  8. package/dist/cjs/solana/descriptor/merkle_distributor.cjs.map +1 -0
  9. package/dist/cjs/solana/descriptor/merkle_distributor.d.cts +1840 -0
  10. package/dist/cjs/solana/index.cjs +4525 -0
  11. package/dist/cjs/solana/index.cjs.map +1 -0
  12. package/dist/cjs/solana/index.d.cts +1506 -0
  13. package/dist/esm/index.d.ts +11 -1
  14. package/dist/esm/index.js +4505 -1
  15. package/dist/esm/index.js.map +1 -0
  16. package/dist/esm/solana/descriptor/aligned_distributor.d.ts +965 -506
  17. package/dist/esm/solana/descriptor/aligned_distributor.js +3 -1
  18. package/dist/esm/solana/descriptor/aligned_distributor.js.map +1 -0
  19. package/dist/esm/solana/descriptor/idl/aligned_distributor.json +934 -1181
  20. package/dist/esm/solana/descriptor/idl/merkle_distributor.json +1218 -0
  21. package/dist/esm/solana/descriptor/merkle_distributor.d.ts +1275 -561
  22. package/dist/esm/solana/descriptor/merkle_distributor.js +3 -1
  23. package/dist/esm/solana/descriptor/merkle_distributor.js.map +1 -0
  24. package/dist/esm/solana/index.d.ts +1506 -7
  25. package/dist/esm/solana/index.js +4477 -7
  26. package/dist/esm/solana/index.js.map +1 -0
  27. package/package.json +56 -20
  28. package/dist/cjs/index.js +0 -27
  29. package/dist/cjs/solana/clients/BaseDistributorClient.js +0 -276
  30. package/dist/cjs/solana/clients/SolanaAlignedDistributorClient.js +0 -116
  31. package/dist/cjs/solana/clients/SolanaDistributorClient.js +0 -17
  32. package/dist/cjs/solana/clients/index.js +0 -10
  33. package/dist/cjs/solana/constants.js +0 -28
  34. package/dist/cjs/solana/descriptor/aligned_distributor.js +0 -2
  35. package/dist/cjs/solana/descriptor/merkle_distributor.js +0 -2
  36. package/dist/cjs/solana/generated/accounts/ClaimStatus.js +0 -135
  37. package/dist/cjs/solana/generated/accounts/MerkleDistributor.js +0 -215
  38. package/dist/cjs/solana/generated/accounts/index.js +0 -7
  39. package/dist/cjs/solana/generated/errors/anchor.js +0 -712
  40. package/dist/cjs/solana/generated/errors/custom.js +0 -321
  41. package/dist/cjs/solana/generated/errors/index.js +0 -64
  42. package/dist/cjs/solana/generated/instructions/claimLocked.js +0 -22
  43. package/dist/cjs/solana/generated/instructions/clawback.js +0 -21
  44. package/dist/cjs/solana/generated/instructions/closeClaim.js +0 -57
  45. package/dist/cjs/solana/generated/instructions/index.js +0 -17
  46. package/dist/cjs/solana/generated/instructions/newClaim.js +0 -59
  47. package/dist/cjs/solana/generated/instructions/newDistributor.js +0 -104
  48. package/dist/cjs/solana/generated/instructions/setAdmin.js +0 -17
  49. package/dist/cjs/solana/generated/instructions/setClawbackReceiver.js +0 -17
  50. package/dist/cjs/solana/generated/programId.js +0 -8
  51. package/dist/cjs/solana/index.js +0 -36
  52. package/dist/cjs/solana/types.js +0 -159
  53. package/dist/cjs/solana/utils.js +0 -75
  54. package/dist/esm/solana/clients/BaseDistributorClient.d.ts +0 -43
  55. package/dist/esm/solana/clients/BaseDistributorClient.js +0 -274
  56. package/dist/esm/solana/clients/SolanaAlignedDistributorClient.d.ts +0 -16
  57. package/dist/esm/solana/clients/SolanaAlignedDistributorClient.js +0 -111
  58. package/dist/esm/solana/clients/SolanaDistributorClient.d.ts +0 -8
  59. package/dist/esm/solana/clients/SolanaDistributorClient.js +0 -11
  60. package/dist/esm/solana/clients/index.d.ts +0 -2
  61. package/dist/esm/solana/clients/index.js +0 -2
  62. package/dist/esm/solana/constants.d.ts +0 -24
  63. package/dist/esm/solana/constants.js +0 -25
  64. package/dist/esm/solana/generated/accounts/ClaimStatus.d.ts +0 -83
  65. package/dist/esm/solana/generated/accounts/ClaimStatus.js +0 -127
  66. package/dist/esm/solana/generated/accounts/MerkleDistributor.d.ts +0 -179
  67. package/dist/esm/solana/generated/accounts/MerkleDistributor.js +0 -239
  68. package/dist/esm/solana/generated/accounts/index.d.ts +0 -4
  69. package/dist/esm/solana/generated/accounts/index.js +0 -2
  70. package/dist/esm/solana/generated/errors/anchor.d.ts +0 -434
  71. package/dist/esm/solana/generated/errors/anchor.js +0 -707
  72. package/dist/esm/solana/generated/errors/custom.d.ts +0 -194
  73. package/dist/esm/solana/generated/errors/custom.js +0 -317
  74. package/dist/esm/solana/generated/errors/index.d.ts +0 -5
  75. package/dist/esm/solana/generated/errors/index.js +0 -37
  76. package/dist/esm/solana/generated/instructions/claimLocked.d.ts +0 -23
  77. package/dist/esm/solana/generated/instructions/claimLocked.js +0 -19
  78. package/dist/esm/solana/generated/instructions/clawback.d.ts +0 -17
  79. package/dist/esm/solana/generated/instructions/clawback.js +0 -18
  80. package/dist/esm/solana/generated/instructions/closeClaim.d.ts +0 -22
  81. package/dist/esm/solana/generated/instructions/closeClaim.js +0 -30
  82. package/dist/esm/solana/generated/instructions/index.d.ts +0 -14
  83. package/dist/esm/solana/generated/instructions/index.js +0 -7
  84. package/dist/esm/solana/generated/instructions/newClaim.d.ts +0 -29
  85. package/dist/esm/solana/generated/instructions/newClaim.js +0 -32
  86. package/dist/esm/solana/generated/instructions/newDistributor.d.ts +0 -58
  87. package/dist/esm/solana/generated/instructions/newDistributor.js +0 -77
  88. package/dist/esm/solana/generated/instructions/setAdmin.d.ts +0 -10
  89. package/dist/esm/solana/generated/instructions/setAdmin.js +0 -14
  90. package/dist/esm/solana/generated/instructions/setClawbackReceiver.d.ts +0 -10
  91. package/dist/esm/solana/generated/instructions/setClawbackReceiver.js +0 -14
  92. package/dist/esm/solana/generated/programId.d.ts +0 -3
  93. package/dist/esm/solana/generated/programId.js +0 -5
  94. package/dist/esm/solana/types.d.ts +0 -258
  95. package/dist/esm/solana/types.js +0 -156
  96. package/dist/esm/solana/utils.d.ts +0 -14
  97. package/dist/esm/solana/utils.js +0 -65
@@ -0,0 +1,1218 @@
1
+ {
2
+ "address": "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
3
+ "metadata": {
4
+ "name": "merkle_distributor",
5
+ "version": "1.5.0",
6
+ "spec": "0.1.0",
7
+ "description": "A Solana program for distributing tokens according to a Merkle root.",
8
+ "repository": "https://github.com/streamflow-finance/distributor"
9
+ },
10
+ "instructions": [
11
+ {
12
+ "name": "_expose_claim",
13
+ "discriminator": [103, 233, 83, 69, 115, 199, 128, 249],
14
+ "accounts": [
15
+ {
16
+ "name": "distributor",
17
+ "docs": ["The [MerkleDistributor]."]
18
+ },
19
+ {
20
+ "name": "claim_status",
21
+ "docs": ["Claim Status PDA"],
22
+ "optional": true,
23
+ "pda": {
24
+ "seeds": [
25
+ {
26
+ "kind": "const",
27
+ "value": [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
28
+ },
29
+ {
30
+ "kind": "account",
31
+ "path": "claimant"
32
+ },
33
+ {
34
+ "kind": "account",
35
+ "path": "distributor"
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "name": "compressed_claim_status",
42
+ "docs": ["Compress Claim Status PDA"],
43
+ "optional": true,
44
+ "pda": {
45
+ "seeds": [
46
+ {
47
+ "kind": "const",
48
+ "value": [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
49
+ },
50
+ {
51
+ "kind": "account",
52
+ "path": "claimant"
53
+ },
54
+ {
55
+ "kind": "account",
56
+ "path": "distributor"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "name": "claimant",
63
+ "docs": ["Who is claiming the tokens."],
64
+ "signer": true
65
+ }
66
+ ],
67
+ "args": []
68
+ },
69
+ {
70
+ "name": "claim_locked",
71
+ "discriminator": [34, 206, 181, 23, 11, 207, 147, 90],
72
+ "accounts": [
73
+ {
74
+ "name": "distributor",
75
+ "docs": ["The [MerkleDistributor]."],
76
+ "writable": true
77
+ },
78
+ {
79
+ "name": "claim_status",
80
+ "writable": true,
81
+ "pda": {
82
+ "seeds": [
83
+ {
84
+ "kind": "const",
85
+ "value": [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
86
+ },
87
+ {
88
+ "kind": "account",
89
+ "path": "claimant"
90
+ },
91
+ {
92
+ "kind": "account",
93
+ "path": "distributor"
94
+ }
95
+ ]
96
+ }
97
+ },
98
+ {
99
+ "name": "from",
100
+ "docs": ["Distributor ATA containing the tokens to distribute."],
101
+ "writable": true,
102
+ "pda": {
103
+ "seeds": [
104
+ {
105
+ "kind": "account",
106
+ "path": "distributor"
107
+ },
108
+ {
109
+ "kind": "account",
110
+ "path": "token_program"
111
+ },
112
+ {
113
+ "kind": "account",
114
+ "path": "distributor.mint",
115
+ "account": "MerkleDistributor"
116
+ }
117
+ ],
118
+ "program": {
119
+ "kind": "const",
120
+ "value": [
121
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16,
122
+ 132, 4, 142, 123, 216, 219, 233, 248, 89
123
+ ]
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "name": "to",
129
+ "docs": [
130
+ "Account to send the claimed tokens to.",
131
+ "Claimant must sign the transaction and can only claim on behalf of themself"
132
+ ],
133
+ "writable": true
134
+ },
135
+ {
136
+ "name": "claimant",
137
+ "docs": ["Who is claiming the tokens."],
138
+ "writable": true,
139
+ "signer": true
140
+ },
141
+ {
142
+ "name": "mint",
143
+ "docs": ["The mint to claim."],
144
+ "relations": ["distributor"]
145
+ },
146
+ {
147
+ "name": "token_program",
148
+ "docs": ["SPL [Token] program."]
149
+ },
150
+ {
151
+ "name": "event_authority",
152
+ "pda": {
153
+ "seeds": [
154
+ {
155
+ "kind": "const",
156
+ "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
157
+ }
158
+ ]
159
+ }
160
+ },
161
+ {
162
+ "name": "program"
163
+ }
164
+ ],
165
+ "args": []
166
+ },
167
+ {
168
+ "name": "clawback",
169
+ "discriminator": [111, 92, 142, 79, 33, 234, 82, 27],
170
+ "accounts": [
171
+ {
172
+ "name": "distributor",
173
+ "docs": ["The [MerkleDistributor]."],
174
+ "writable": true
175
+ },
176
+ {
177
+ "name": "from",
178
+ "docs": ["Distributor ATA containing the tokens to distribute."],
179
+ "writable": true
180
+ },
181
+ {
182
+ "name": "to",
183
+ "docs": ["The Clawback token account."],
184
+ "writable": true
185
+ },
186
+ {
187
+ "name": "admin",
188
+ "docs": ["Only Admin can trigger the clawback of funds"],
189
+ "writable": true,
190
+ "signer": true
191
+ },
192
+ {
193
+ "name": "mint"
194
+ },
195
+ {
196
+ "name": "system_program",
197
+ "docs": ["The [System] program."],
198
+ "address": "11111111111111111111111111111111"
199
+ },
200
+ {
201
+ "name": "token_program",
202
+ "docs": ["SPL [Token] program."]
203
+ }
204
+ ],
205
+ "args": []
206
+ },
207
+ {
208
+ "name": "close_claim",
209
+ "discriminator": [42, 177, 165, 35, 213, 179, 211, 19],
210
+ "accounts": [
211
+ {
212
+ "name": "distributor",
213
+ "docs": ["The [MerkleDistributor]."],
214
+ "writable": true
215
+ },
216
+ {
217
+ "name": "admin_or_claimant",
218
+ "docs": ["Admin signer"],
219
+ "writable": true,
220
+ "signer": true
221
+ },
222
+ {
223
+ "name": "claimant",
224
+ "writable": true
225
+ },
226
+ {
227
+ "name": "claim_status",
228
+ "writable": true,
229
+ "pda": {
230
+ "seeds": [
231
+ {
232
+ "kind": "const",
233
+ "value": [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
234
+ },
235
+ {
236
+ "kind": "account",
237
+ "path": "claimant"
238
+ },
239
+ {
240
+ "kind": "account",
241
+ "path": "distributor"
242
+ }
243
+ ]
244
+ }
245
+ },
246
+ {
247
+ "name": "system_program",
248
+ "docs": ["The [System] program."],
249
+ "address": "11111111111111111111111111111111"
250
+ },
251
+ {
252
+ "name": "event_authority",
253
+ "pda": {
254
+ "seeds": [
255
+ {
256
+ "kind": "const",
257
+ "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
258
+ }
259
+ ]
260
+ }
261
+ },
262
+ {
263
+ "name": "program"
264
+ }
265
+ ],
266
+ "args": [
267
+ {
268
+ "name": "amount_unlocked",
269
+ "type": {
270
+ "option": "u64"
271
+ }
272
+ },
273
+ {
274
+ "name": "amount_locked",
275
+ "type": {
276
+ "option": "u64"
277
+ }
278
+ },
279
+ {
280
+ "name": "proof",
281
+ "type": {
282
+ "option": {
283
+ "vec": {
284
+ "array": ["u8", 32]
285
+ }
286
+ }
287
+ }
288
+ }
289
+ ]
290
+ },
291
+ {
292
+ "name": "compress_claim",
293
+ "discriminator": [219, 45, 247, 134, 71, 119, 125, 89],
294
+ "accounts": [
295
+ {
296
+ "name": "distributor",
297
+ "docs": ["The [MerkleDistributor]."],
298
+ "writable": true
299
+ },
300
+ {
301
+ "name": "claim_status",
302
+ "writable": true,
303
+ "pda": {
304
+ "seeds": [
305
+ {
306
+ "kind": "const",
307
+ "value": [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
308
+ },
309
+ {
310
+ "kind": "account",
311
+ "path": "claimant"
312
+ },
313
+ {
314
+ "kind": "account",
315
+ "path": "distributor"
316
+ }
317
+ ]
318
+ }
319
+ },
320
+ {
321
+ "name": "signer",
322
+ "docs": ["Signer account"],
323
+ "writable": true,
324
+ "signer": true
325
+ },
326
+ {
327
+ "name": "claimant"
328
+ },
329
+ {
330
+ "name": "system_program",
331
+ "docs": ["The [System] program."],
332
+ "address": "11111111111111111111111111111111"
333
+ }
334
+ ],
335
+ "args": []
336
+ },
337
+ {
338
+ "name": "new_claim",
339
+ "discriminator": [78, 177, 98, 123, 210, 21, 187, 83],
340
+ "accounts": [
341
+ {
342
+ "name": "distributor",
343
+ "docs": ["The [MerkleDistributor]."],
344
+ "writable": true
345
+ },
346
+ {
347
+ "name": "claim_status",
348
+ "writable": true,
349
+ "pda": {
350
+ "seeds": [
351
+ {
352
+ "kind": "const",
353
+ "value": [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
354
+ },
355
+ {
356
+ "kind": "account",
357
+ "path": "claimant"
358
+ },
359
+ {
360
+ "kind": "account",
361
+ "path": "distributor"
362
+ }
363
+ ]
364
+ }
365
+ },
366
+ {
367
+ "name": "from",
368
+ "docs": ["Distributor ATA containing the tokens to distribute."],
369
+ "writable": true,
370
+ "pda": {
371
+ "seeds": [
372
+ {
373
+ "kind": "account",
374
+ "path": "distributor"
375
+ },
376
+ {
377
+ "kind": "account",
378
+ "path": "token_program"
379
+ },
380
+ {
381
+ "kind": "account",
382
+ "path": "distributor.mint",
383
+ "account": "MerkleDistributor"
384
+ }
385
+ ],
386
+ "program": {
387
+ "kind": "const",
388
+ "value": [
389
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16,
390
+ 132, 4, 142, 123, 216, 219, 233, 248, 89
391
+ ]
392
+ }
393
+ }
394
+ },
395
+ {
396
+ "name": "to",
397
+ "docs": ["Account to send the claimed tokens to."],
398
+ "writable": true
399
+ },
400
+ {
401
+ "name": "claimant",
402
+ "docs": ["Who is claiming the tokens."],
403
+ "writable": true,
404
+ "signer": true
405
+ },
406
+ {
407
+ "name": "mint",
408
+ "docs": ["The mint to claim."],
409
+ "relations": ["distributor"]
410
+ },
411
+ {
412
+ "name": "token_program",
413
+ "docs": ["SPL [Token] program."]
414
+ },
415
+ {
416
+ "name": "system_program",
417
+ "docs": ["The [System] program."],
418
+ "address": "11111111111111111111111111111111"
419
+ },
420
+ {
421
+ "name": "event_authority",
422
+ "pda": {
423
+ "seeds": [
424
+ {
425
+ "kind": "const",
426
+ "value": [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
427
+ }
428
+ ]
429
+ }
430
+ },
431
+ {
432
+ "name": "program"
433
+ }
434
+ ],
435
+ "args": [
436
+ {
437
+ "name": "amount_unlocked",
438
+ "type": "u64"
439
+ },
440
+ {
441
+ "name": "amount_locked",
442
+ "type": "u64"
443
+ },
444
+ {
445
+ "name": "proof",
446
+ "type": {
447
+ "vec": {
448
+ "array": ["u8", 32]
449
+ }
450
+ }
451
+ }
452
+ ]
453
+ },
454
+ {
455
+ "name": "new_distributor",
456
+ "docs": [
457
+ "READ THE FOLLOWING:",
458
+ "",
459
+ "This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
460
+ "",
461
+ "An attack could look like:",
462
+ "- A legitimate user opens a new distributor.",
463
+ "- Someone observes the call to this instruction.",
464
+ "- They replace the clawback_receiver, admin, or time parameters with their own.",
465
+ "",
466
+ "One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
467
+ "and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
468
+ "the attacker can steal all funds from the distributor to their own clawback_receiver account.",
469
+ "",
470
+ "HOW TO AVOID:",
471
+ "- When you call into this instruction, ensure your transaction succeeds.",
472
+ "- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
473
+ "assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
474
+ "- If your transaction fails, double check the value on-chain matches what you expect."
475
+ ],
476
+ "discriminator": [32, 139, 112, 171, 0, 2, 225, 155],
477
+ "accounts": [
478
+ {
479
+ "name": "distributor",
480
+ "docs": ["[MerkleDistributor]."],
481
+ "writable": true,
482
+ "pda": {
483
+ "seeds": [
484
+ {
485
+ "kind": "const",
486
+ "value": [77, 101, 114, 107, 108, 101, 68, 105, 115, 116, 114, 105, 98, 117, 116, 111, 114]
487
+ },
488
+ {
489
+ "kind": "account",
490
+ "path": "mint"
491
+ },
492
+ {
493
+ "kind": "arg",
494
+ "path": "version"
495
+ }
496
+ ]
497
+ }
498
+ },
499
+ {
500
+ "name": "clawback_receiver",
501
+ "docs": ["Clawback receiver token account"],
502
+ "writable": true
503
+ },
504
+ {
505
+ "name": "mint",
506
+ "docs": ["The mint to distribute."]
507
+ },
508
+ {
509
+ "name": "token_vault",
510
+ "docs": ["Token vault"],
511
+ "writable": true,
512
+ "pda": {
513
+ "seeds": [
514
+ {
515
+ "kind": "account",
516
+ "path": "distributor"
517
+ },
518
+ {
519
+ "kind": "account",
520
+ "path": "token_program"
521
+ },
522
+ {
523
+ "kind": "account",
524
+ "path": "mint"
525
+ }
526
+ ],
527
+ "program": {
528
+ "kind": "const",
529
+ "value": [
530
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16,
531
+ 132, 4, 142, 123, 216, 219, 233, 248, 89
532
+ ]
533
+ }
534
+ }
535
+ },
536
+ {
537
+ "name": "admin",
538
+ "docs": [
539
+ "Admin wallet, responsible for creating the distributor and paying for the transaction.",
540
+ "Also has the authority to set the clawback receiver and change itself."
541
+ ],
542
+ "writable": true,
543
+ "signer": true
544
+ },
545
+ {
546
+ "name": "system_program",
547
+ "docs": ["The [System] program."],
548
+ "address": "11111111111111111111111111111111"
549
+ },
550
+ {
551
+ "name": "associated_token_program",
552
+ "docs": ["The [Associated Token] program."],
553
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
554
+ },
555
+ {
556
+ "name": "token_program",
557
+ "docs": ["The [Token] program."]
558
+ }
559
+ ],
560
+ "args": [
561
+ {
562
+ "name": "version",
563
+ "type": "u64"
564
+ },
565
+ {
566
+ "name": "root",
567
+ "type": {
568
+ "array": ["u8", 32]
569
+ }
570
+ },
571
+ {
572
+ "name": "max_total_claim",
573
+ "type": "u64"
574
+ },
575
+ {
576
+ "name": "max_num_nodes",
577
+ "type": "u64"
578
+ },
579
+ {
580
+ "name": "unlock_period",
581
+ "type": "u64"
582
+ },
583
+ {
584
+ "name": "start_vesting_ts",
585
+ "type": "u64"
586
+ },
587
+ {
588
+ "name": "end_vesting_ts",
589
+ "type": "u64"
590
+ },
591
+ {
592
+ "name": "clawback_start_ts",
593
+ "type": "u64"
594
+ },
595
+ {
596
+ "name": "claims_closable_by_admin",
597
+ "type": "bool"
598
+ },
599
+ {
600
+ "name": "can_update_duration",
601
+ "type": {
602
+ "option": "bool"
603
+ }
604
+ },
605
+ {
606
+ "name": "total_amount_unlocked",
607
+ "type": {
608
+ "option": "u64"
609
+ }
610
+ },
611
+ {
612
+ "name": "total_amount_locked",
613
+ "type": {
614
+ "option": "u64"
615
+ }
616
+ },
617
+ {
618
+ "name": "claims_closable_by_claimant",
619
+ "type": {
620
+ "option": "bool"
621
+ }
622
+ },
623
+ {
624
+ "name": "claims_limit",
625
+ "type": {
626
+ "option": "u16"
627
+ }
628
+ }
629
+ ]
630
+ },
631
+ {
632
+ "name": "refund_claim",
633
+ "discriminator": [157, 23, 164, 146, 176, 53, 147, 143],
634
+ "accounts": [
635
+ {
636
+ "name": "distributor",
637
+ "docs": ["The [MerkleDistributor]."],
638
+ "writable": true
639
+ },
640
+ {
641
+ "name": "claim_status",
642
+ "writable": true,
643
+ "pda": {
644
+ "seeds": [
645
+ {
646
+ "kind": "const",
647
+ "value": [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
648
+ },
649
+ {
650
+ "kind": "account",
651
+ "path": "claimant"
652
+ },
653
+ {
654
+ "kind": "account",
655
+ "path": "distributor"
656
+ }
657
+ ]
658
+ }
659
+ },
660
+ {
661
+ "name": "signer",
662
+ "docs": ["Signer account"],
663
+ "writable": true,
664
+ "signer": true
665
+ },
666
+ {
667
+ "name": "claimant"
668
+ },
669
+ {
670
+ "name": "streamflow_treasury",
671
+ "writable": true,
672
+ "address": "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
673
+ },
674
+ {
675
+ "name": "system_program",
676
+ "docs": ["The [System] program."],
677
+ "address": "11111111111111111111111111111111"
678
+ }
679
+ ],
680
+ "args": []
681
+ },
682
+ {
683
+ "name": "set_admin",
684
+ "discriminator": [251, 163, 0, 52, 91, 194, 187, 92],
685
+ "accounts": [
686
+ {
687
+ "name": "distributor",
688
+ "docs": ["The [MerkleDistributor]."],
689
+ "writable": true
690
+ },
691
+ {
692
+ "name": "admin",
693
+ "docs": ["Admin signer"],
694
+ "writable": true,
695
+ "signer": true
696
+ },
697
+ {
698
+ "name": "new_admin",
699
+ "docs": ["New admin account"],
700
+ "writable": true
701
+ }
702
+ ],
703
+ "args": []
704
+ },
705
+ {
706
+ "name": "set_clawback_receiver",
707
+ "discriminator": [153, 217, 34, 20, 19, 29, 229, 75],
708
+ "accounts": [
709
+ {
710
+ "name": "distributor",
711
+ "docs": ["The [MerkleDistributor]."],
712
+ "writable": true
713
+ },
714
+ {
715
+ "name": "new_clawback_account",
716
+ "docs": ["New clawback account"]
717
+ },
718
+ {
719
+ "name": "admin",
720
+ "docs": ["Admin signer"],
721
+ "writable": true,
722
+ "signer": true
723
+ }
724
+ ],
725
+ "args": []
726
+ },
727
+ {
728
+ "name": "update",
729
+ "discriminator": [219, 200, 88, 176, 158, 63, 253, 127],
730
+ "accounts": [
731
+ {
732
+ "name": "distributor",
733
+ "docs": ["The [MerkleDistributor]."],
734
+ "writable": true
735
+ },
736
+ {
737
+ "name": "admin",
738
+ "docs": ["Only Admin can trigger the clawback of funds"],
739
+ "writable": true,
740
+ "signer": true
741
+ },
742
+ {
743
+ "name": "system_program",
744
+ "docs": ["The [System] program."],
745
+ "address": "11111111111111111111111111111111"
746
+ }
747
+ ],
748
+ "args": [
749
+ {
750
+ "name": "end_ts",
751
+ "type": {
752
+ "option": "u64"
753
+ }
754
+ }
755
+ ]
756
+ }
757
+ ],
758
+ "accounts": [
759
+ {
760
+ "name": "ClaimStatus",
761
+ "discriminator": [22, 183, 249, 157, 247, 95, 150, 96]
762
+ },
763
+ {
764
+ "name": "CompressedClaimStatus",
765
+ "discriminator": [53, 68, 161, 131, 212, 106, 98, 48]
766
+ },
767
+ {
768
+ "name": "MerkleDistributor",
769
+ "discriminator": [77, 119, 139, 70, 84, 247, 12, 26]
770
+ }
771
+ ],
772
+ "events": [
773
+ {
774
+ "name": "ClaimClosedEvent",
775
+ "discriminator": [139, 166, 215, 195, 184, 233, 26, 217]
776
+ },
777
+ {
778
+ "name": "ClaimedEvent",
779
+ "discriminator": [144, 172, 209, 86, 144, 87, 84, 115]
780
+ },
781
+ {
782
+ "name": "NewClaimEvent",
783
+ "discriminator": [244, 3, 231, 151, 60, 101, 55, 55]
784
+ }
785
+ ],
786
+ "errors": [
787
+ {
788
+ "code": 6000,
789
+ "name": "InsufficientUnlockedTokens",
790
+ "msg": "Insufficient unlocked tokens"
791
+ },
792
+ {
793
+ "code": 6001,
794
+ "name": "InvalidProof",
795
+ "msg": "Invalid Merkle proof"
796
+ },
797
+ {
798
+ "code": 6002,
799
+ "name": "ExceededMaxClaim",
800
+ "msg": "Exceeded maximum claim amount"
801
+ },
802
+ {
803
+ "code": 6003,
804
+ "name": "MaxNodesExceeded",
805
+ "msg": "Exceeded maximum node count"
806
+ },
807
+ {
808
+ "code": 6004,
809
+ "name": "Unauthorized",
810
+ "msg": "Account is not authorized to execute this instruction"
811
+ },
812
+ {
813
+ "code": 6005,
814
+ "name": "OwnerMismatch",
815
+ "msg": "Token account owner did not match intended owner"
816
+ },
817
+ {
818
+ "code": 6006,
819
+ "name": "ClawbackBeforeStart",
820
+ "msg": "Attempted clawback before start"
821
+ },
822
+ {
823
+ "code": 6007,
824
+ "name": "ClawbackAlreadyClaimed",
825
+ "msg": "Clawback already claimed"
826
+ },
827
+ {
828
+ "code": 6008,
829
+ "name": "SameClawbackReceiver",
830
+ "msg": "New and old Clawback receivers are identical"
831
+ },
832
+ {
833
+ "code": 6009,
834
+ "name": "ClawbackReceiverIsTokenVault",
835
+ "msg": "Clawback receiver can not be the Token Vault"
836
+ },
837
+ {
838
+ "code": 6010,
839
+ "name": "SameAdmin",
840
+ "msg": "New and old admin are identical"
841
+ },
842
+ {
843
+ "code": 6011,
844
+ "name": "ClaimExpired",
845
+ "msg": "Claim window expired"
846
+ },
847
+ {
848
+ "code": 6012,
849
+ "name": "ArithmeticError",
850
+ "msg": "Arithmetic Error (overflow/underflow)"
851
+ },
852
+ {
853
+ "code": 6013,
854
+ "name": "StartTimestampAfterEnd",
855
+ "msg": "Start Timestamp cannot be after end Timestamp"
856
+ },
857
+ {
858
+ "code": 6014,
859
+ "name": "TimestampsNotInFuture",
860
+ "msg": "Timestamps cannot be in the past"
861
+ },
862
+ {
863
+ "code": 6015,
864
+ "name": "InvalidMint",
865
+ "msg": "Invalid Mint"
866
+ },
867
+ {
868
+ "code": 6016,
869
+ "name": "ClaimIsClosed",
870
+ "msg": "Claim is closed"
871
+ },
872
+ {
873
+ "code": 6017,
874
+ "name": "ClaimsAreNotClosable",
875
+ "msg": "Claims are not closable"
876
+ },
877
+ {
878
+ "code": 6018,
879
+ "name": "InvalidUnlockPeriod",
880
+ "msg": "Invalid unlock period"
881
+ },
882
+ {
883
+ "code": 6019,
884
+ "name": "DurationUpdateNotAllowed",
885
+ "msg": "Duration update is not allowed"
886
+ },
887
+ {
888
+ "code": 6020,
889
+ "name": "NoVestingAmount",
890
+ "msg": "Vesting amounts are not set"
891
+ },
892
+ {
893
+ "code": 6021,
894
+ "name": "VestingAlreadyFinished",
895
+ "msg": "Vesting already finished"
896
+ },
897
+ {
898
+ "code": 6022,
899
+ "name": "InvalidAmounts",
900
+ "msg": "Provided amounts are invalid"
901
+ },
902
+ {
903
+ "code": 6023,
904
+ "name": "ClaimsLimitReached",
905
+ "msg": "Claims limit has been reached"
906
+ }
907
+ ],
908
+ "types": [
909
+ {
910
+ "name": "ClaimClosedEvent",
911
+ "docs": ["Emitted when a new claim is created."],
912
+ "type": {
913
+ "kind": "struct",
914
+ "fields": [
915
+ {
916
+ "name": "claimant",
917
+ "docs": ["User that claimed."],
918
+ "type": "pubkey"
919
+ },
920
+ {
921
+ "name": "timestamp",
922
+ "docs": ["Timestamp."],
923
+ "type": "u64"
924
+ }
925
+ ]
926
+ }
927
+ },
928
+ {
929
+ "name": "ClaimStatus",
930
+ "docs": ["Holds whether or not a claimant has claimed tokens."],
931
+ "type": {
932
+ "kind": "struct",
933
+ "fields": [
934
+ {
935
+ "name": "claimant",
936
+ "docs": ["Authority that claimed the tokens."],
937
+ "type": "pubkey"
938
+ },
939
+ {
940
+ "name": "locked_amount",
941
+ "docs": ["Locked amount"],
942
+ "type": "u64"
943
+ },
944
+ {
945
+ "name": "locked_amount_withdrawn",
946
+ "docs": ["Locked amount withdrawn"],
947
+ "type": "u64"
948
+ },
949
+ {
950
+ "name": "unlocked_amount",
951
+ "docs": ["Unlocked amount"],
952
+ "type": "u64"
953
+ },
954
+ {
955
+ "name": "last_claim_ts",
956
+ "docs": ["Last claim time"],
957
+ "type": "u64"
958
+ },
959
+ {
960
+ "name": "last_amount_per_unlock",
961
+ "docs": ["Track amount per unlock, can be useful for non-linear vesting"],
962
+ "type": "u64"
963
+ },
964
+ {
965
+ "name": "closed",
966
+ "docs": ["Whether claim is closed"],
967
+ "type": "bool"
968
+ },
969
+ {
970
+ "name": "distributor",
971
+ "docs": [
972
+ "Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts"
973
+ ],
974
+ "type": "pubkey"
975
+ },
976
+ {
977
+ "name": "claims_count",
978
+ "docs": ["Number of time amount has been claimed"],
979
+ "type": "u16"
980
+ },
981
+ {
982
+ "name": "closed_ts",
983
+ "docs": ["Time when claim has been closed"],
984
+ "type": "u64"
985
+ },
986
+ {
987
+ "name": "buffer_2",
988
+ "docs": ["Buffer for additional fields"],
989
+ "type": {
990
+ "array": ["u8", 22]
991
+ }
992
+ }
993
+ ]
994
+ }
995
+ },
996
+ {
997
+ "name": "ClaimedEvent",
998
+ "docs": ["Emitted when tokens are claimed."],
999
+ "type": {
1000
+ "kind": "struct",
1001
+ "fields": [
1002
+ {
1003
+ "name": "claimant",
1004
+ "docs": ["User that claimed."],
1005
+ "type": "pubkey"
1006
+ },
1007
+ {
1008
+ "name": "amount",
1009
+ "docs": ["Amount of tokens to distribute."],
1010
+ "type": "u64"
1011
+ }
1012
+ ]
1013
+ }
1014
+ },
1015
+ {
1016
+ "name": "CompressedClaimStatus",
1017
+ "docs": ["Holds whether or not a claimant has claimed tokens."],
1018
+ "type": {
1019
+ "kind": "struct",
1020
+ "fields": [
1021
+ {
1022
+ "name": "state",
1023
+ "type": {
1024
+ "defined": {
1025
+ "name": "State"
1026
+ }
1027
+ }
1028
+ }
1029
+ ]
1030
+ }
1031
+ },
1032
+ {
1033
+ "name": "MerkleDistributor",
1034
+ "docs": ["State for the account which distributes tokens."],
1035
+ "type": {
1036
+ "kind": "struct",
1037
+ "fields": [
1038
+ {
1039
+ "name": "bump",
1040
+ "docs": ["Bump seed."],
1041
+ "type": "u8"
1042
+ },
1043
+ {
1044
+ "name": "version",
1045
+ "docs": ["Version of the airdrop"],
1046
+ "type": "u64"
1047
+ },
1048
+ {
1049
+ "name": "root",
1050
+ "docs": ["The 256-bit merkle root."],
1051
+ "type": {
1052
+ "array": ["u8", 32]
1053
+ }
1054
+ },
1055
+ {
1056
+ "name": "mint",
1057
+ "docs": ["[Mint] of the token to be distributed."],
1058
+ "type": "pubkey"
1059
+ },
1060
+ {
1061
+ "name": "token_vault",
1062
+ "docs": ["Token Address of the vault"],
1063
+ "type": "pubkey"
1064
+ },
1065
+ {
1066
+ "name": "max_total_claim",
1067
+ "docs": ["Maximum number of tokens that can ever be claimed from this [MerkleDistributor]."],
1068
+ "type": "u64"
1069
+ },
1070
+ {
1071
+ "name": "max_num_nodes",
1072
+ "docs": ["Maximum number of nodes in [MerkleDistributor]."],
1073
+ "type": "u64"
1074
+ },
1075
+ {
1076
+ "name": "unlock_period",
1077
+ "docs": ["Time step (period) in seconds per which the unlock occurs"],
1078
+ "type": "u64"
1079
+ },
1080
+ {
1081
+ "name": "total_amount_claimed",
1082
+ "docs": ["Total amount of tokens that have been claimed."],
1083
+ "type": "u64"
1084
+ },
1085
+ {
1086
+ "name": "num_nodes_claimed",
1087
+ "docs": ["Number of nodes that have been claimed."],
1088
+ "type": "u64"
1089
+ },
1090
+ {
1091
+ "name": "start_ts",
1092
+ "docs": ["Lockup time start (Unix Timestamp)"],
1093
+ "type": "u64"
1094
+ },
1095
+ {
1096
+ "name": "end_ts",
1097
+ "docs": ["Lockup time end (Unix Timestamp)"],
1098
+ "type": "u64"
1099
+ },
1100
+ {
1101
+ "name": "clawback_start_ts",
1102
+ "docs": ["Clawback start (Unix Timestamp)"],
1103
+ "type": "u64"
1104
+ },
1105
+ {
1106
+ "name": "clawback_receiver",
1107
+ "docs": ["Clawback receiver"],
1108
+ "type": "pubkey"
1109
+ },
1110
+ {
1111
+ "name": "admin",
1112
+ "docs": ["Admin wallet"],
1113
+ "type": "pubkey"
1114
+ },
1115
+ {
1116
+ "name": "clawed_back",
1117
+ "docs": ["Whether or not the distributor has been clawed back"],
1118
+ "type": "bool"
1119
+ },
1120
+ {
1121
+ "name": "claims_closable_by_admin",
1122
+ "docs": ["Whether claims are closable by the admin or not"],
1123
+ "type": "bool"
1124
+ },
1125
+ {
1126
+ "name": "can_update_duration",
1127
+ "docs": ["Whether admin can update vesting duration"],
1128
+ "type": "bool"
1129
+ },
1130
+ {
1131
+ "name": "total_amount_unlocked",
1132
+ "docs": ["Total amount of funds unlocked (cliff/instant)"],
1133
+ "type": "u64"
1134
+ },
1135
+ {
1136
+ "name": "total_amount_locked",
1137
+ "docs": ["Total amount of funds locked (vested)"],
1138
+ "type": "u64"
1139
+ },
1140
+ {
1141
+ "name": "last_duration_update_ts",
1142
+ "docs": ["Timestamp when update was last called"],
1143
+ "type": "u64"
1144
+ },
1145
+ {
1146
+ "name": "total_claimable_pre_update",
1147
+ "docs": [
1148
+ "Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update"
1149
+ ],
1150
+ "type": "u64"
1151
+ },
1152
+ {
1153
+ "name": "clawed_back_ts",
1154
+ "docs": ["Timestamp when funds were clawed back"],
1155
+ "type": "u64"
1156
+ },
1157
+ {
1158
+ "name": "claims_closable_by_claimant",
1159
+ "docs": ["Whether claims are closable by claimant or not"],
1160
+ "type": "bool"
1161
+ },
1162
+ {
1163
+ "name": "claims_limit",
1164
+ "docs": ["Limit number of claims"],
1165
+ "type": "u16"
1166
+ },
1167
+ {
1168
+ "name": "buffer_2",
1169
+ "docs": ["Buffer for additional fields"],
1170
+ "type": {
1171
+ "array": ["u8", 20]
1172
+ }
1173
+ },
1174
+ {
1175
+ "name": "buffer_3",
1176
+ "docs": ["Buffer for additional fields"],
1177
+ "type": {
1178
+ "array": ["u8", 32]
1179
+ }
1180
+ }
1181
+ ]
1182
+ }
1183
+ },
1184
+ {
1185
+ "name": "NewClaimEvent",
1186
+ "docs": ["Emitted when a new claim is created."],
1187
+ "type": {
1188
+ "kind": "struct",
1189
+ "fields": [
1190
+ {
1191
+ "name": "claimant",
1192
+ "docs": ["User that claimed."],
1193
+ "type": "pubkey"
1194
+ },
1195
+ {
1196
+ "name": "timestamp",
1197
+ "docs": ["Timestamp."],
1198
+ "type": "u64"
1199
+ }
1200
+ ]
1201
+ }
1202
+ },
1203
+ {
1204
+ "name": "State",
1205
+ "type": {
1206
+ "kind": "enum",
1207
+ "variants": [
1208
+ {
1209
+ "name": "Claimed"
1210
+ },
1211
+ {
1212
+ "name": "Closed"
1213
+ }
1214
+ ]
1215
+ }
1216
+ }
1217
+ ]
1218
+ }