@augustdigital/sdk 9.11.0 → 9.12.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.
Files changed (38) hide show
  1. package/lib/adapters/solana/constants.d.ts +12 -4
  2. package/lib/adapters/solana/constants.js +8 -3
  3. package/lib/adapters/solana/getters.d.ts +5 -0
  4. package/lib/adapters/solana/getters.js +35 -1
  5. package/lib/adapters/solana/idl/vault-idl.d.ts +334 -7
  6. package/lib/adapters/solana/idl/vault-idl.js +600 -59
  7. package/lib/adapters/solana/idl/withdrawal-queue-idl.d.ts +790 -0
  8. package/lib/adapters/solana/idl/withdrawal-queue-idl.js +1868 -0
  9. package/lib/adapters/solana/index.d.ts +108 -10
  10. package/lib/adapters/solana/index.js +137 -12
  11. package/lib/adapters/solana/pricing.d.ts +11 -0
  12. package/lib/adapters/solana/pricing.js +24 -8
  13. package/lib/adapters/solana/queue.actions.d.ts +98 -0
  14. package/lib/adapters/solana/queue.actions.js +488 -0
  15. package/lib/adapters/solana/token-reads.d.ts +108 -0
  16. package/lib/adapters/solana/token-reads.js +145 -0
  17. package/lib/adapters/solana/types.d.ts +200 -1
  18. package/lib/adapters/solana/utils.d.ts +16 -0
  19. package/lib/adapters/solana/utils.js +41 -4
  20. package/lib/adapters/solana/vault.actions.d.ts +17 -0
  21. package/lib/adapters/solana/vault.actions.js +14 -125
  22. package/lib/adapters/solana/withdrawal-queue.d.ts +125 -0
  23. package/lib/adapters/solana/withdrawal-queue.js +301 -0
  24. package/lib/core/analytics/method-taxonomy.js +2 -0
  25. package/lib/core/analytics/version.d.ts +1 -1
  26. package/lib/core/analytics/version.js +1 -1
  27. package/lib/main.d.ts +16 -0
  28. package/lib/main.js +16 -0
  29. package/lib/modules/vaults/getters.d.ts +2 -2
  30. package/lib/modules/vaults/getters.js +103 -3
  31. package/lib/modules/vaults/main.d.ts +12 -0
  32. package/lib/modules/vaults/main.js +17 -1
  33. package/lib/modules/vaults/types.d.ts +14 -1
  34. package/lib/sdk.d.ts +2389 -1723
  35. package/lib/types/vaults.d.ts +47 -1
  36. package/lib/types/vaults.js +5 -0
  37. package/lib/types/webserver.d.ts +8 -0
  38. package/package.json +1 -1
@@ -0,0 +1,1868 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withdrawalQueueIdl = void 0;
4
+ /**
5
+ * august_withdrawal_queue program IDL (Anchor).
6
+ *
7
+ * GENERATED — do not edit by hand. Source of truth is the program repo's build
8
+ * artifact: `target/idl/august_withdrawal_queue.json` from
9
+ * fractal-protocol/solana-upshift-vault-programs, built at the release the SDK
10
+ * targets. Regenerate from there, NOT with `anchor idl fetch`, for the same
11
+ * reason as `vault-idl.ts`: an uploaded IDL is not refreshed by an upgrade.
12
+ *
13
+ * Generated from release v0.3.0 (87c0f2d), which restores the request's
14
+ * `min_assets_out` floor. One hand edit: `finalize_withdrawal`'s `deposit_mint`
15
+ * stays writable, in step with `vault-idl.ts`. That build (like #41) only reads
16
+ * it and accepts it writable. Regenerate from the build the mainnet upgrade
17
+ * deploys, once mainnet runs it.
18
+ *
19
+ * `address` is a build stamp, NOT network-aware. SolanaAdapter resolves the
20
+ * real program id per network from `programIds.withdrawalQueue`.
21
+ *
22
+ * Drift is guarded by tests/vaults/solana-idl-drift.test.ts, which pins the
23
+ * deployed binary and checks that every discriminator declared here appears in
24
+ * it.
25
+ */
26
+ exports.withdrawalQueueIdl = {
27
+ accounts: [
28
+ {
29
+ discriminator: [228, 196, 82, 165, 98, 210, 235, 152],
30
+ name: 'VaultState',
31
+ },
32
+ {
33
+ discriminator: [54, 56, 158, 88, 232, 203, 241, 163],
34
+ name: 'WithdrawalQueue',
35
+ },
36
+ {
37
+ discriminator: [242, 88, 147, 173, 182, 62, 229, 193],
38
+ name: 'WithdrawalRequest',
39
+ },
40
+ ],
41
+ address: 'upQhC7mgYwmHLVaatRWoGAu394piLT9th9FiQZHnPrW',
42
+ errors: [
43
+ {
44
+ code: 6000,
45
+ msg: "Signer is not the vault's admin",
46
+ name: 'NotVaultAdmin',
47
+ },
48
+ {
49
+ code: 6001,
50
+ msg: 'Math error',
51
+ name: 'MathError',
52
+ },
53
+ {
54
+ code: 6002,
55
+ msg: 'vault_state is not the vault this queue serves',
56
+ name: 'VaultMismatch',
57
+ },
58
+ {
59
+ code: 6003,
60
+ msg: 'Cooldown exceeds the 30-day maximum',
61
+ name: 'CooldownOutOfBounds',
62
+ },
63
+ {
64
+ code: 6004,
65
+ msg: 'Fulfillment window must be zero or between one and 90 days',
66
+ name: 'FulfillmentWindowOutOfBounds',
67
+ },
68
+ {
69
+ code: 6005,
70
+ msg: "The vault's withdrawal_queue_authority does not point at this queue",
71
+ name: 'QueueNotActiveOnVault',
72
+ },
73
+ {
74
+ code: 6006,
75
+ msg: 'Deposit mint carries a Token-2022 extension the queue does not support',
76
+ name: 'UnsupportedDepositMint',
77
+ },
78
+ {
79
+ code: 6007,
80
+ msg: 'A request must escrow at least one share',
81
+ name: 'ZeroShares',
82
+ },
83
+ {
84
+ code: 6008,
85
+ msg: 'Recipient must be a deposit-mint token account that is not an escrow or the vault reserve',
86
+ name: 'InvalidRecipient',
87
+ },
88
+ {
89
+ code: 6009,
90
+ msg: "Signer is not the request's owner",
91
+ name: 'NotRequestOwner',
92
+ },
93
+ {
94
+ code: 6010,
95
+ msg: "The request's fulfillment window has closed; it can only be cancelled",
96
+ name: 'RequestExpired',
97
+ },
98
+ {
99
+ code: 6011,
100
+ msg: 'expected_sequence does not match the request; it may have been recreated',
101
+ name: 'StaleRequestSequence',
102
+ },
103
+ {
104
+ code: 6012,
105
+ msg: "The request's cooldown has not elapsed",
106
+ name: 'CooldownNotElapsed',
107
+ },
108
+ {
109
+ code: 6013,
110
+ msg: "Signer is neither the request's owner nor its finalizer",
111
+ name: 'FinalizerNotAllowed',
112
+ },
113
+ {
114
+ code: 6014,
115
+ msg: "Signer is neither the vault's admin nor its operator",
116
+ name: 'NotVaultAdminOrOperator',
117
+ },
118
+ {
119
+ code: 6015,
120
+ msg: 'The request is already eligible; there is nothing to expedite',
121
+ name: 'RequestAlreadyEligible',
122
+ },
123
+ {
124
+ code: 6016,
125
+ msg: 'The share mint is freezable or carries an unsupported extension',
126
+ name: 'UnsupportedShareMint',
127
+ },
128
+ {
129
+ code: 6017,
130
+ msg: 'The share escrow holds nothing beyond the pending requests',
131
+ name: 'NothingToSweep',
132
+ },
133
+ {
134
+ code: 6018,
135
+ msg: "A sweep's destination may not be an account the queue or the vault owns",
136
+ name: 'InvalidSweepDestination',
137
+ },
138
+ {
139
+ code: 6019,
140
+ msg: "The payout is below the request's min_assets_out",
141
+ name: 'PayoutBelowFloor',
142
+ },
143
+ ],
144
+ events: [
145
+ {
146
+ discriminator: [183, 123, 76, 75, 208, 119, 180, 208],
147
+ name: 'EscrowSwept',
148
+ },
149
+ {
150
+ discriminator: [149, 240, 214, 55, 199, 16, 75, 127],
151
+ name: 'QueueConfigUpdated',
152
+ },
153
+ {
154
+ discriminator: [122, 178, 111, 1, 22, 158, 148, 46],
155
+ name: 'QueueInitialized',
156
+ },
157
+ {
158
+ discriminator: [71, 205, 57, 90, 244, 213, 241, 226],
159
+ name: 'VaultReleased',
160
+ },
161
+ {
162
+ discriminator: [119, 175, 207, 80, 186, 237, 229, 9],
163
+ name: 'WithdrawalCancelled',
164
+ },
165
+ {
166
+ discriminator: [131, 89, 148, 0, 6, 49, 167, 69],
167
+ name: 'WithdrawalExpedited',
168
+ },
169
+ {
170
+ discriminator: [180, 63, 101, 47, 242, 164, 179, 166],
171
+ name: 'WithdrawalFinalized',
172
+ },
173
+ {
174
+ discriminator: [75, 207, 21, 12, 160, 102, 150, 55],
175
+ name: 'WithdrawalRequested',
176
+ },
177
+ ],
178
+ instructions: [
179
+ {
180
+ accounts: [
181
+ {
182
+ name: 'queue',
183
+ pda: {
184
+ seeds: [
185
+ {
186
+ kind: 'const',
187
+ value: [
188
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
189
+ 101, 117, 101,
190
+ ],
191
+ },
192
+ {
193
+ account: 'WithdrawalQueue',
194
+ kind: 'account',
195
+ path: 'queue.vault_state',
196
+ },
197
+ ],
198
+ },
199
+ relations: ['request'],
200
+ writable: true,
201
+ },
202
+ {
203
+ docs: ["Signs, and receives the request's rent."],
204
+ name: 'owner',
205
+ relations: ['request'],
206
+ signer: true,
207
+ writable: true,
208
+ },
209
+ {
210
+ docs: [
211
+ 'Seeds come from its own stored fields rather than the signer, so a wrong',
212
+ 'signer is reported as `NotRequestOwner`.',
213
+ ],
214
+ name: 'request',
215
+ pda: {
216
+ seeds: [
217
+ {
218
+ kind: 'const',
219
+ value: [
220
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 114, 101,
221
+ 113, 117, 101, 115, 116,
222
+ ],
223
+ },
224
+ {
225
+ account: 'WithdrawalRequest',
226
+ kind: 'account',
227
+ path: 'request.queue',
228
+ },
229
+ {
230
+ account: 'WithdrawalRequest',
231
+ kind: 'account',
232
+ path: 'request.owner',
233
+ },
234
+ {
235
+ account: 'WithdrawalRequest',
236
+ kind: 'account',
237
+ path: 'request.request_id',
238
+ },
239
+ ],
240
+ },
241
+ writable: true,
242
+ },
243
+ {
244
+ name: 'escrow_shares',
245
+ relations: ['queue'],
246
+ writable: true,
247
+ },
248
+ {
249
+ name: 'share_mint',
250
+ relations: ['queue'],
251
+ },
252
+ {
253
+ name: 'destination_share_account',
254
+ writable: true,
255
+ },
256
+ {
257
+ name: 'token_program',
258
+ },
259
+ {
260
+ name: 'event_authority',
261
+ pda: {
262
+ seeds: [
263
+ {
264
+ kind: 'const',
265
+ value: [
266
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
267
+ 114, 105, 116, 121,
268
+ ],
269
+ },
270
+ ],
271
+ },
272
+ },
273
+ {
274
+ name: 'program',
275
+ },
276
+ ],
277
+ args: [
278
+ {
279
+ name: 'expected_sequence',
280
+ type: 'u64',
281
+ },
282
+ ],
283
+ discriminator: [183, 104, 181, 250, 28, 128, 210, 70],
284
+ docs: [
285
+ 'The owner takes a pending request back: its shares return to a share',
286
+ 'account the owner controls and the request closes with its rent to the',
287
+ 'owner. Allowed at any time while the request exists, in either vault',
288
+ 'state, and while the vault is paused.',
289
+ '',
290
+ '### Parameters',
291
+ "- `expected_sequence` - The request's stamp, so a delayed call cannot land",
292
+ 'on a recreated request with the same id',
293
+ ],
294
+ name: 'cancel_withdrawal',
295
+ },
296
+ {
297
+ accounts: [
298
+ {
299
+ name: 'queue',
300
+ pda: {
301
+ seeds: [
302
+ {
303
+ kind: 'const',
304
+ value: [
305
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
306
+ 101, 117, 101,
307
+ ],
308
+ },
309
+ {
310
+ account: 'WithdrawalQueue',
311
+ kind: 'account',
312
+ path: 'queue.vault_state',
313
+ },
314
+ ],
315
+ },
316
+ relations: ['request'],
317
+ },
318
+ {
319
+ name: 'vault_state',
320
+ relations: ['queue'],
321
+ },
322
+ {
323
+ docs: ["The vault's admin or operator."],
324
+ name: 'authority',
325
+ signer: true,
326
+ },
327
+ {
328
+ name: 'request',
329
+ pda: {
330
+ seeds: [
331
+ {
332
+ kind: 'const',
333
+ value: [
334
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 114, 101,
335
+ 113, 117, 101, 115, 116,
336
+ ],
337
+ },
338
+ {
339
+ account: 'WithdrawalRequest',
340
+ kind: 'account',
341
+ path: 'request.queue',
342
+ },
343
+ {
344
+ account: 'WithdrawalRequest',
345
+ kind: 'account',
346
+ path: 'request.owner',
347
+ },
348
+ {
349
+ account: 'WithdrawalRequest',
350
+ kind: 'account',
351
+ path: 'request.request_id',
352
+ },
353
+ ],
354
+ },
355
+ writable: true,
356
+ },
357
+ {
358
+ name: 'event_authority',
359
+ pda: {
360
+ seeds: [
361
+ {
362
+ kind: 'const',
363
+ value: [
364
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
365
+ 114, 105, 116, 121,
366
+ ],
367
+ },
368
+ ],
369
+ },
370
+ },
371
+ {
372
+ name: 'program',
373
+ },
374
+ ],
375
+ args: [
376
+ {
377
+ name: 'expected_sequence',
378
+ type: 'u64',
379
+ },
380
+ ],
381
+ discriminator: [179, 180, 110, 75, 218, 143, 214, 114],
382
+ docs: [
383
+ 'Admin or operator makes one not-yet-eligible request finalizable now:',
384
+ '`eligible_at` moves to the current time; `scheduled_eligible_at` and',
385
+ '`expires_at` do not, so the window only ever widens. An eligible or',
386
+ 'expired request is refused. Who may finalize is unchanged: the same',
387
+ 'callers as before, from the earlier time.',
388
+ '',
389
+ '### Parameters',
390
+ "- `expected_sequence` - The request's stamp, so a delayed call cannot land",
391
+ 'on a recreated request with the same id',
392
+ ],
393
+ name: 'expedite_request',
394
+ },
395
+ {
396
+ accounts: [
397
+ {
398
+ name: 'queue',
399
+ pda: {
400
+ seeds: [
401
+ {
402
+ kind: 'const',
403
+ value: [
404
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
405
+ 101, 117, 101,
406
+ ],
407
+ },
408
+ {
409
+ account: 'WithdrawalQueue',
410
+ kind: 'account',
411
+ path: 'queue.vault_state',
412
+ },
413
+ ],
414
+ },
415
+ relations: ['request'],
416
+ writable: true,
417
+ },
418
+ {
419
+ docs: ['Written by the vault inside the CPI, never by this program.'],
420
+ name: 'vault_state',
421
+ relations: ['queue'],
422
+ writable: true,
423
+ },
424
+ {
425
+ name: 'vault_deposit_ata',
426
+ writable: true,
427
+ },
428
+ {
429
+ name: 'fee_recipient_account',
430
+ writable: true,
431
+ },
432
+ {
433
+ name: 'escrow_shares',
434
+ relations: ['queue'],
435
+ writable: true,
436
+ },
437
+ {
438
+ name: 'escrow_assets',
439
+ relations: ['queue'],
440
+ writable: true,
441
+ },
442
+ {
443
+ name: 'share_mint',
444
+ relations: ['queue'],
445
+ writable: true,
446
+ },
447
+ {
448
+ name: 'deposit_mint',
449
+ relations: ['queue'],
450
+ writable: true,
451
+ },
452
+ {
453
+ docs: [
454
+ 'Whoever chooses the moment; `WithdrawalRequest::may_finalize` decides.',
455
+ ],
456
+ name: 'finalizer',
457
+ signer: true,
458
+ },
459
+ {
460
+ docs: [
461
+ 'Closed on success with its rent to `owner`. Seeds come from its own',
462
+ 'stored fields, so no argument can point it elsewhere.',
463
+ ],
464
+ name: 'request',
465
+ pda: {
466
+ seeds: [
467
+ {
468
+ kind: 'const',
469
+ value: [
470
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 114, 101,
471
+ 113, 117, 101, 115, 116,
472
+ ],
473
+ },
474
+ {
475
+ account: 'WithdrawalRequest',
476
+ kind: 'account',
477
+ path: 'request.queue',
478
+ },
479
+ {
480
+ account: 'WithdrawalRequest',
481
+ kind: 'account',
482
+ path: 'request.owner',
483
+ },
484
+ {
485
+ account: 'WithdrawalRequest',
486
+ kind: 'account',
487
+ path: 'request.request_id',
488
+ },
489
+ ],
490
+ },
491
+ writable: true,
492
+ },
493
+ {
494
+ docs: ['need not sign.'],
495
+ name: 'owner',
496
+ relations: ['request'],
497
+ writable: true,
498
+ },
499
+ {
500
+ docs: [
501
+ "The request's stored recipient, re-validated in the handler.",
502
+ ],
503
+ name: 'recipient_token_account',
504
+ relations: ['request'],
505
+ writable: true,
506
+ },
507
+ {
508
+ address: 'up12bytoZBmwofqsySf2uqKQ7zpfeKiAWwfvqzJjtRt',
509
+ name: 'vault_program',
510
+ },
511
+ {
512
+ name: 'token_program',
513
+ },
514
+ {
515
+ name: 'event_authority',
516
+ pda: {
517
+ seeds: [
518
+ {
519
+ kind: 'const',
520
+ value: [
521
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
522
+ 114, 105, 116, 121,
523
+ ],
524
+ },
525
+ ],
526
+ },
527
+ },
528
+ {
529
+ name: 'program',
530
+ },
531
+ ],
532
+ args: [
533
+ {
534
+ name: 'expected_sequence',
535
+ type: 'u64',
536
+ },
537
+ ],
538
+ discriminator: [178, 87, 206, 68, 201, 186, 164, 232],
539
+ docs: [
540
+ 'Pays out a request whose cooldown has run and whose window is open: the',
541
+ 'queue redeems the escrowed shares by CPI into the vault as its PDA,',
542
+ "forwards the net payout to the request's recipient, and closes the",
543
+ "request with its rent to the owner. Anyone the request's `finalizer`",
544
+ 'permits may call it, the owner always, and an expedite does not change',
545
+ "who. The vault's `VaultPaused` and `NotEnoughLiquidity` propagate",
546
+ 'unchanged and leave the request pending, as does a payout below the',
547
+ "request's `min_assets_out`.",
548
+ '',
549
+ '### Parameters',
550
+ "- `expected_sequence` - The request's stamp, so a delayed call cannot land",
551
+ 'on a recreated request with the same id',
552
+ ],
553
+ name: 'finalize_withdrawal',
554
+ },
555
+ {
556
+ accounts: [
557
+ {
558
+ docs: [
559
+ '`Account` pins the vault program as owner, so this is a genuine vault.',
560
+ ],
561
+ name: 'vault_state',
562
+ },
563
+ {
564
+ docs: [
565
+ "The vault's admin. Authorizes creation but need not fund it.",
566
+ ],
567
+ name: 'admin',
568
+ signer: true,
569
+ },
570
+ {
571
+ docs: [
572
+ 'Funds the three accounts below. May be the same key as `admin`.',
573
+ ],
574
+ name: 'payer',
575
+ signer: true,
576
+ writable: true,
577
+ },
578
+ {
579
+ name: 'deposit_mint',
580
+ },
581
+ {
582
+ name: 'share_mint',
583
+ },
584
+ {
585
+ name: 'queue',
586
+ pda: {
587
+ seeds: [
588
+ {
589
+ kind: 'const',
590
+ value: [
591
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
592
+ 101, 117, 101,
593
+ ],
594
+ },
595
+ {
596
+ kind: 'account',
597
+ path: 'vault_state',
598
+ },
599
+ ],
600
+ },
601
+ writable: true,
602
+ },
603
+ {
604
+ docs: [
605
+ "`init_if_needed`, not `init`: an ATA's address is a pure function of",
606
+ '(owner, mint, token program) and anyone may create it, so a stranger who',
607
+ 'created these two first would otherwise make every `initialize_queue`',
608
+ 'for this vault fail in the create CPI. When the account exists, Anchor',
609
+ 'checks its mint, authority and token program against these constraints,',
610
+ 'which is exactly what a fresh create would have produced. A balance',
611
+ 'someone already sent there is a donation; payouts are balance deltas.',
612
+ ],
613
+ name: 'escrow_shares',
614
+ pda: {
615
+ program: {
616
+ kind: 'const',
617
+ value: [
618
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
619
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
620
+ 219, 233, 248, 89,
621
+ ],
622
+ },
623
+ seeds: [
624
+ {
625
+ kind: 'account',
626
+ path: 'queue',
627
+ },
628
+ {
629
+ kind: 'account',
630
+ path: 'token_program',
631
+ },
632
+ {
633
+ kind: 'account',
634
+ path: 'share_mint',
635
+ },
636
+ ],
637
+ },
638
+ writable: true,
639
+ },
640
+ {
641
+ name: 'escrow_assets',
642
+ pda: {
643
+ program: {
644
+ kind: 'const',
645
+ value: [
646
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
647
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
648
+ 219, 233, 248, 89,
649
+ ],
650
+ },
651
+ seeds: [
652
+ {
653
+ kind: 'account',
654
+ path: 'queue',
655
+ },
656
+ {
657
+ kind: 'account',
658
+ path: 'token_program',
659
+ },
660
+ {
661
+ kind: 'account',
662
+ path: 'deposit_mint',
663
+ },
664
+ ],
665
+ },
666
+ writable: true,
667
+ },
668
+ {
669
+ docs: [
670
+ 'The program owning both mints; the vault creates its share mint under the',
671
+ "deposit mint's program. The ATA program refuses a mismatch.",
672
+ ],
673
+ name: 'token_program',
674
+ },
675
+ {
676
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
677
+ name: 'associated_token_program',
678
+ },
679
+ {
680
+ address: '11111111111111111111111111111111',
681
+ name: 'system_program',
682
+ },
683
+ {
684
+ name: 'event_authority',
685
+ pda: {
686
+ seeds: [
687
+ {
688
+ kind: 'const',
689
+ value: [
690
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
691
+ 114, 105, 116, 121,
692
+ ],
693
+ },
694
+ ],
695
+ },
696
+ },
697
+ {
698
+ name: 'program',
699
+ },
700
+ ],
701
+ args: [
702
+ {
703
+ name: 'cooldown_seconds',
704
+ type: 'u64',
705
+ },
706
+ ],
707
+ discriminator: [174, 102, 132, 232, 90, 202, 27, 20],
708
+ docs: [
709
+ "Admin creates the vault's withdrawal queue: the queue PDA and its two",
710
+ 'escrow token accounts. The deposit mint must be classic',
711
+ 'SPL, or Token-2022 carrying at most the two metadata extensions.',
712
+ 'Attaching the queue to the vault is a separate, vault-side step, and is',
713
+ 'what makes it live.',
714
+ '',
715
+ '### Parameters',
716
+ '- `cooldown_seconds` - Wait between request and eligibility, at most 30 days',
717
+ ],
718
+ name: 'initialize_queue',
719
+ },
720
+ {
721
+ accounts: [
722
+ {
723
+ name: 'queue',
724
+ pda: {
725
+ seeds: [
726
+ {
727
+ kind: 'const',
728
+ value: [
729
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
730
+ 101, 117, 101,
731
+ ],
732
+ },
733
+ {
734
+ account: 'WithdrawalQueue',
735
+ kind: 'account',
736
+ path: 'queue.vault_state',
737
+ },
738
+ ],
739
+ },
740
+ },
741
+ {
742
+ docs: ['Written by the vault inside the CPI, never by this program.'],
743
+ name: 'vault_state',
744
+ relations: ['queue'],
745
+ writable: true,
746
+ },
747
+ {
748
+ name: 'deposit_mint',
749
+ relations: ['queue'],
750
+ },
751
+ {
752
+ name: 'admin',
753
+ signer: true,
754
+ },
755
+ {
756
+ address: 'up12bytoZBmwofqsySf2uqKQ7zpfeKiAWwfvqzJjtRt',
757
+ name: 'vault_program',
758
+ },
759
+ {
760
+ name: 'event_authority',
761
+ pda: {
762
+ seeds: [
763
+ {
764
+ kind: 'const',
765
+ value: [
766
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
767
+ 114, 105, 116, 121,
768
+ ],
769
+ },
770
+ ],
771
+ },
772
+ },
773
+ {
774
+ name: 'program',
775
+ },
776
+ ],
777
+ args: [],
778
+ discriminator: [162, 80, 81, 254, 102, 228, 132, 87],
779
+ docs: [
780
+ 'Admin returns the vault to instant redemption: the queue co-signs the',
781
+ "vault's `detach_withdrawal_queue` by CPI. It checks no liquidity: nothing",
782
+ 'could hold assets back for the pending set once the gate is off. Pending requests',
783
+ "survive and finalize or cancel afterwards; the vault's gate stops new",
784
+ 'ones. The queue account persists, so the vault can be attached again.',
785
+ ],
786
+ name: 'release_vault',
787
+ },
788
+ {
789
+ accounts: [
790
+ {
791
+ name: 'queue',
792
+ pda: {
793
+ seeds: [
794
+ {
795
+ kind: 'const',
796
+ value: [
797
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
798
+ 101, 117, 101,
799
+ ],
800
+ },
801
+ {
802
+ account: 'WithdrawalQueue',
803
+ kind: 'account',
804
+ path: 'queue.vault_state',
805
+ },
806
+ ],
807
+ },
808
+ writable: true,
809
+ },
810
+ {
811
+ name: 'vault_state',
812
+ relations: ['queue'],
813
+ },
814
+ {
815
+ docs: [
816
+ "Signs the share transfer and pays the request's rent, which returns to",
817
+ 'them when the request closes.',
818
+ ],
819
+ name: 'owner',
820
+ signer: true,
821
+ writable: true,
822
+ },
823
+ {
824
+ name: 'owner_share_account',
825
+ writable: true,
826
+ },
827
+ {
828
+ name: 'escrow_shares',
829
+ relations: ['queue'],
830
+ writable: true,
831
+ },
832
+ {
833
+ name: 'share_mint',
834
+ relations: ['queue'],
835
+ },
836
+ {
837
+ docs: [
838
+ 'Deposit-mint token account paid at finalization; not an escrow or the',
839
+ 'vault reserve.',
840
+ ],
841
+ name: 'recipient_token_account',
842
+ },
843
+ {
844
+ docs: [
845
+ 'Created here; fails if this owner already has a request with this id.',
846
+ ],
847
+ name: 'request',
848
+ pda: {
849
+ seeds: [
850
+ {
851
+ kind: 'const',
852
+ value: [
853
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 114, 101,
854
+ 113, 117, 101, 115, 116,
855
+ ],
856
+ },
857
+ {
858
+ kind: 'account',
859
+ path: 'queue',
860
+ },
861
+ {
862
+ kind: 'account',
863
+ path: 'owner',
864
+ },
865
+ {
866
+ kind: 'arg',
867
+ path: 'request_id',
868
+ },
869
+ ],
870
+ },
871
+ writable: true,
872
+ },
873
+ {
874
+ name: 'token_program',
875
+ },
876
+ {
877
+ address: '11111111111111111111111111111111',
878
+ name: 'system_program',
879
+ },
880
+ {
881
+ name: 'event_authority',
882
+ pda: {
883
+ seeds: [
884
+ {
885
+ kind: 'const',
886
+ value: [
887
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
888
+ 114, 105, 116, 121,
889
+ ],
890
+ },
891
+ ],
892
+ },
893
+ },
894
+ {
895
+ name: 'program',
896
+ },
897
+ ],
898
+ args: [
899
+ {
900
+ name: 'request_id',
901
+ type: 'u64',
902
+ },
903
+ {
904
+ name: 'shares',
905
+ type: 'u64',
906
+ },
907
+ {
908
+ name: 'min_assets_out',
909
+ type: 'u64',
910
+ },
911
+ {
912
+ name: 'finalizer',
913
+ type: 'pubkey',
914
+ },
915
+ ],
916
+ discriminator: [251, 85, 121, 205, 56, 201, 12, 177],
917
+ docs: [
918
+ 'A holder escrows `shares` and opens a request that becomes finalizable',
919
+ "after the queue's cooldown, paying `recipient_token_account` the shares'",
920
+ 'value at the moment of finalization, and at least `min_assets_out`.',
921
+ "Requires the vault's gate to point at this queue.",
922
+ '',
923
+ '### Parameters',
924
+ '- `request_id` - Owner-chosen id, unique per owner while the request exists',
925
+ '- `shares` - Shares to escrow, nonzero',
926
+ '- `min_assets_out` - Floor on the net payout; zero for none',
927
+ '- `finalizer` - Who may finalize besides the owner; zero for anyone',
928
+ ],
929
+ name: 'request_withdrawal',
930
+ },
931
+ {
932
+ accounts: [
933
+ {
934
+ name: 'queue',
935
+ pda: {
936
+ seeds: [
937
+ {
938
+ kind: 'const',
939
+ value: [
940
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
941
+ 101, 117, 101,
942
+ ],
943
+ },
944
+ {
945
+ account: 'WithdrawalQueue',
946
+ kind: 'account',
947
+ path: 'queue.vault_state',
948
+ },
949
+ ],
950
+ },
951
+ writable: true,
952
+ },
953
+ {
954
+ name: 'vault_state',
955
+ relations: ['queue'],
956
+ },
957
+ {
958
+ name: 'admin',
959
+ signer: true,
960
+ },
961
+ {
962
+ name: 'event_authority',
963
+ pda: {
964
+ seeds: [
965
+ {
966
+ kind: 'const',
967
+ value: [
968
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
969
+ 114, 105, 116, 121,
970
+ ],
971
+ },
972
+ ],
973
+ },
974
+ },
975
+ {
976
+ name: 'program',
977
+ },
978
+ ],
979
+ args: [
980
+ {
981
+ name: 'seconds',
982
+ type: 'u64',
983
+ },
984
+ ],
985
+ discriminator: [57, 78, 91, 178, 112, 152, 211, 87],
986
+ docs: ['Admin sets the cooldown for new requests, at most 30 days.'],
987
+ name: 'set_cooldown',
988
+ },
989
+ {
990
+ accounts: [
991
+ {
992
+ name: 'queue',
993
+ pda: {
994
+ seeds: [
995
+ {
996
+ kind: 'const',
997
+ value: [
998
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
999
+ 101, 117, 101,
1000
+ ],
1001
+ },
1002
+ {
1003
+ account: 'WithdrawalQueue',
1004
+ kind: 'account',
1005
+ path: 'queue.vault_state',
1006
+ },
1007
+ ],
1008
+ },
1009
+ writable: true,
1010
+ },
1011
+ {
1012
+ name: 'vault_state',
1013
+ relations: ['queue'],
1014
+ },
1015
+ {
1016
+ name: 'admin',
1017
+ signer: true,
1018
+ },
1019
+ {
1020
+ name: 'event_authority',
1021
+ pda: {
1022
+ seeds: [
1023
+ {
1024
+ kind: 'const',
1025
+ value: [
1026
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
1027
+ 114, 105, 116, 121,
1028
+ ],
1029
+ },
1030
+ ],
1031
+ },
1032
+ },
1033
+ {
1034
+ name: 'program',
1035
+ },
1036
+ ],
1037
+ args: [
1038
+ {
1039
+ name: 'seconds',
1040
+ type: 'u64',
1041
+ },
1042
+ ],
1043
+ discriminator: [107, 18, 240, 153, 114, 108, 105, 120],
1044
+ docs: [
1045
+ 'Admin sets how long after scheduled eligibility a new request may still',
1046
+ 'be finalized, in seconds: zero disables expiry, otherwise',
1047
+ '`86_400 ..= 7_776_000` (1 to 90 days).',
1048
+ ],
1049
+ name: 'set_fulfillment_window',
1050
+ },
1051
+ {
1052
+ accounts: [
1053
+ {
1054
+ name: 'queue',
1055
+ pda: {
1056
+ seeds: [
1057
+ {
1058
+ kind: 'const',
1059
+ value: [
1060
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 113, 117,
1061
+ 101, 117, 101,
1062
+ ],
1063
+ },
1064
+ {
1065
+ account: 'WithdrawalQueue',
1066
+ kind: 'account',
1067
+ path: 'queue.vault_state',
1068
+ },
1069
+ ],
1070
+ },
1071
+ },
1072
+ {
1073
+ docs: ['Read for its admin, never written.'],
1074
+ name: 'vault_state',
1075
+ relations: ['queue'],
1076
+ },
1077
+ {
1078
+ name: 'admin',
1079
+ signer: true,
1080
+ },
1081
+ {
1082
+ name: 'escrow_shares',
1083
+ relations: ['queue'],
1084
+ writable: true,
1085
+ },
1086
+ {
1087
+ name: 'share_mint',
1088
+ relations: ['queue'],
1089
+ },
1090
+ {
1091
+ docs: [
1092
+ 'Any share account neither PDA owns: nothing moves shares out of an',
1093
+ 'account the queue owns, the escrow included, or one the vault owns, so',
1094
+ 'shares sent to either would be stuck again.',
1095
+ ],
1096
+ name: 'destination',
1097
+ writable: true,
1098
+ },
1099
+ {
1100
+ name: 'token_program',
1101
+ },
1102
+ {
1103
+ name: 'event_authority',
1104
+ pda: {
1105
+ seeds: [
1106
+ {
1107
+ kind: 'const',
1108
+ value: [
1109
+ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111,
1110
+ 114, 105, 116, 121,
1111
+ ],
1112
+ },
1113
+ ],
1114
+ },
1115
+ },
1116
+ {
1117
+ name: 'program',
1118
+ },
1119
+ ],
1120
+ args: [],
1121
+ discriminator: [183, 242, 60, 206, 189, 47, 207, 242],
1122
+ docs: [
1123
+ "Admin moves whatever the share escrow holds beyond the pending requests'",
1124
+ 'shares to `destination`, so shares sent to the escrow by mistake can be',
1125
+ 'returned to whoever sent them. Nothing else moves them out, so they would',
1126
+ 'otherwise be stuck there and block `close_vault` forever. Pending',
1127
+ 'requests are never touched.',
1128
+ ],
1129
+ name: 'sweep_escrow_shares',
1130
+ },
1131
+ ],
1132
+ metadata: {
1133
+ description: 'Delayed redemption queue for august-vault',
1134
+ name: 'august_withdrawal_queue',
1135
+ spec: '0.1.0',
1136
+ version: '0.1.0',
1137
+ },
1138
+ types: [
1139
+ {
1140
+ docs: [
1141
+ 'Shares no request owned were moved out of the escrow to `destination`.',
1142
+ ],
1143
+ name: 'EscrowSwept',
1144
+ type: {
1145
+ fields: [
1146
+ {
1147
+ name: 'vault',
1148
+ type: 'pubkey',
1149
+ },
1150
+ {
1151
+ name: 'queue',
1152
+ type: 'pubkey',
1153
+ },
1154
+ {
1155
+ name: 'shares',
1156
+ type: 'u64',
1157
+ },
1158
+ {
1159
+ name: 'destination',
1160
+ type: 'pubkey',
1161
+ },
1162
+ {
1163
+ name: 'by',
1164
+ type: 'pubkey',
1165
+ },
1166
+ ],
1167
+ kind: 'struct',
1168
+ },
1169
+ },
1170
+ {
1171
+ docs: [
1172
+ 'Emitted by every admin setter with the whole configuration after the change,',
1173
+ 'so an indexer needs no earlier state to know the current one.',
1174
+ ],
1175
+ name: 'QueueConfigUpdated',
1176
+ type: {
1177
+ fields: [
1178
+ {
1179
+ name: 'vault',
1180
+ type: 'pubkey',
1181
+ },
1182
+ {
1183
+ name: 'queue',
1184
+ type: 'pubkey',
1185
+ },
1186
+ {
1187
+ name: 'cooldown_seconds',
1188
+ type: 'u64',
1189
+ },
1190
+ {
1191
+ name: 'fulfillment_window_seconds',
1192
+ type: 'u64',
1193
+ },
1194
+ ],
1195
+ kind: 'struct',
1196
+ },
1197
+ },
1198
+ {
1199
+ docs: ['Emitted once per vault, when its queue is created.'],
1200
+ name: 'QueueInitialized',
1201
+ type: {
1202
+ fields: [
1203
+ {
1204
+ name: 'vault',
1205
+ type: 'pubkey',
1206
+ },
1207
+ {
1208
+ name: 'queue',
1209
+ type: 'pubkey',
1210
+ },
1211
+ {
1212
+ name: 'deposit_mint',
1213
+ type: 'pubkey',
1214
+ },
1215
+ {
1216
+ name: 'share_mint',
1217
+ type: 'pubkey',
1218
+ },
1219
+ {
1220
+ name: 'escrow_shares',
1221
+ type: 'pubkey',
1222
+ },
1223
+ {
1224
+ name: 'escrow_assets',
1225
+ type: 'pubkey',
1226
+ },
1227
+ {
1228
+ name: 'cooldown_seconds',
1229
+ type: 'u64',
1230
+ },
1231
+ ],
1232
+ kind: 'struct',
1233
+ },
1234
+ },
1235
+ {
1236
+ docs: [
1237
+ 'The vault was returned to instant redemption with this much still pending.',
1238
+ ],
1239
+ name: 'VaultReleased',
1240
+ type: {
1241
+ fields: [
1242
+ {
1243
+ name: 'vault',
1244
+ type: 'pubkey',
1245
+ },
1246
+ {
1247
+ name: 'queue',
1248
+ type: 'pubkey',
1249
+ },
1250
+ {
1251
+ name: 'pending_requests',
1252
+ type: 'u64',
1253
+ },
1254
+ {
1255
+ name: 'pending_shares',
1256
+ type: 'u64',
1257
+ },
1258
+ ],
1259
+ kind: 'struct',
1260
+ },
1261
+ },
1262
+ {
1263
+ name: 'VaultState',
1264
+ type: {
1265
+ fields: [
1266
+ {
1267
+ name: 'operator',
1268
+ type: 'pubkey',
1269
+ },
1270
+ {
1271
+ name: 'admin',
1272
+ type: 'pubkey',
1273
+ },
1274
+ {
1275
+ name: 'share_mint',
1276
+ type: 'pubkey',
1277
+ },
1278
+ {
1279
+ name: 'deposit_mint',
1280
+ type: 'pubkey',
1281
+ },
1282
+ {
1283
+ name: 'fee_recipient',
1284
+ type: 'pubkey',
1285
+ },
1286
+ {
1287
+ name: 'withdrawal_fee',
1288
+ type: 'u32',
1289
+ },
1290
+ {
1291
+ name: 'local_aum',
1292
+ type: 'u64',
1293
+ },
1294
+ {
1295
+ name: 'deployed_aum',
1296
+ type: 'u64',
1297
+ },
1298
+ {
1299
+ name: 'aum_increase_limit',
1300
+ type: 'u32',
1301
+ },
1302
+ {
1303
+ name: 'aum_decrease_limit',
1304
+ type: 'u32',
1305
+ },
1306
+ {
1307
+ name: 'pda_bump',
1308
+ type: {
1309
+ array: ['u8', 1],
1310
+ },
1311
+ },
1312
+ {
1313
+ name: 'vault_version',
1314
+ type: {
1315
+ array: ['u8', 1],
1316
+ },
1317
+ },
1318
+ {
1319
+ name: 'paused',
1320
+ type: 'bool',
1321
+ },
1322
+ {
1323
+ docs: [
1324
+ "This vault's virtual-share offset, in base units.",
1325
+ '',
1326
+ 'Per-vault rather than global because the right value depends on what a',
1327
+ 'base unit of the deposit mint is *worth*. The offset must dominate a',
1328
+ '1-unit retained sliver (so it is an absolute count), while',
1329
+ '`MIN_SUPPLY_MULTIPLE * offset` is the minimum first deposit — whose cost',
1330
+ 'is that count times the base-unit price. One global constant cannot serve',
1331
+ 'both a 6-decimal dollar stablecoin and an 8-decimal asset worth ~$100k.',
1332
+ '',
1333
+ '**Zero means "not set" and maps to [`EXTRA_SHARES`].** Vaults created',
1334
+ 'before this field existed have zeroed padding, so they read 0 — both live',
1335
+ 'mainnet vaults are in that state. Never read this field directly: on-chain',
1336
+ 'use `VaultState::share_offset()`, and off-chain use',
1337
+ '`resolved_share_offset()` from the generated Rust client, which mirrors it.',
1338
+ 'A raw 0 collapses the pricing to pure pro-rata, which agrees with the',
1339
+ 'program only while the vault sits exactly at par.',
1340
+ ],
1341
+ name: 'share_offset',
1342
+ type: 'u64',
1343
+ },
1344
+ {
1345
+ docs: [
1346
+ 'The only key permitted to redeem, or zero for "no queue".',
1347
+ '',
1348
+ 'Zero is what every live vault reads — their padding is zeroed here, so the',
1349
+ 'field arrives without a migration and redemption stays open to any holder.',
1350
+ "When set it holds this vault's withdrawal-queue PDA, and a direct holder",
1351
+ 'redeem is refused with `WithdrawalQueueRequired` (6021).',
1352
+ '',
1353
+ 'Two instructions write this field. `attach_withdrawal_queue` stores',
1354
+ "nothing but this vault's [`withdrawal_queue_pda`], and only while the field",
1355
+ 'is zero. `detach_withdrawal_queue` clears it, and needs **both** the',
1356
+ "admin's signature and the stored key's. Both rules exist because a key",
1357
+ 'nobody can sign for would freeze every exit permanently while deposits',
1358
+ 'kept working.',
1359
+ '',
1360
+ '`close_vault` also clears it, by closing the whole account, behind its',
1361
+ 'zero-supply and empty-reserve checks. Closing a gated vault is therefore an',
1362
+ 'implicit detach.',
1363
+ '',
1364
+ 'Read this field via [`Self::withdrawal_queue`] at every decision point.',
1365
+ "The only raw accesses are the two writers' own writes.",
1366
+ ],
1367
+ name: 'withdrawal_queue_authority',
1368
+ type: 'pubkey',
1369
+ },
1370
+ {
1371
+ docs: [
1372
+ 'Registered operator destinations. Nonzero means operator transfers must',
1373
+ "name one; zero means the operator's own ATA.",
1374
+ '',
1375
+ 'Zero on every vault created before the registry existed, so it arrives',
1376
+ 'without a migration. A count rather than an address because the',
1377
+ 'destination is always passed as a PDA — this only decides *whether* one',
1378
+ 'is required. Its safety rests on the addresses being custody the',
1379
+ 'operator cannot sweep, and on the admin being a different party from',
1380
+ 'the operator. One address serves one vault per deposit mint, since an',
1381
+ 'ATA has a single delegate slot.',
1382
+ ],
1383
+ name: 'subaccount_count',
1384
+ type: 'u64',
1385
+ },
1386
+ {
1387
+ docs: [
1388
+ 'Total principal taken out and not returned, across destinations.',
1389
+ '',
1390
+ 'Distinct from `deployed_aum`, which `operator_update_aum` marks with no',
1391
+ "tokens moving. Informational: coverage reads the destination's own",
1392
+ '`Subaccount::principal`, so nothing on-chain trusts this.',
1393
+ ],
1394
+ name: 'deployed_principal',
1395
+ type: 'u64',
1396
+ },
1397
+ {
1398
+ docs: [
1399
+ 'Reserved. Carve new fields **out of** this array so `LEN` stays 455, the',
1400
+ 'size of the live mainnet accounts — enforced by the `const` assertion below.',
1401
+ '',
1402
+ '**Declare a new field immediately before `padding`.** Anything inserted',
1403
+ 'earlier shifts the fields after it silently, and each then reads zero:',
1404
+ '`share_offset` (199) re-prices the vault, `withdrawal_queue_authority`',
1405
+ '(207) reopens a gated vault, `subaccount_count` (239) reads as no',
1406
+ 'subaccounts and pays the operator again, `deployed_principal` (247)',
1407
+ 'reads as nothing owed. Pinned by the per-field',
1408
+ '`*_stays_at_its_byte_offset` tests plus',
1409
+ '`every_field_stays_at_its_byte_offset`.',
1410
+ '',
1411
+ 'Shrinks in 8-byte steps only: it is an array of `u64`.',
1412
+ ],
1413
+ name: 'padding',
1414
+ type: {
1415
+ array: ['u64', 25],
1416
+ },
1417
+ },
1418
+ ],
1419
+ kind: 'struct',
1420
+ },
1421
+ },
1422
+ {
1423
+ docs: [
1424
+ 'A request was cancelled and its shares returned. `by` is the signer, always',
1425
+ 'the owner.',
1426
+ ],
1427
+ name: 'WithdrawalCancelled',
1428
+ type: {
1429
+ fields: [
1430
+ {
1431
+ name: 'vault',
1432
+ type: 'pubkey',
1433
+ },
1434
+ {
1435
+ name: 'queue',
1436
+ type: 'pubkey',
1437
+ },
1438
+ {
1439
+ name: 'request',
1440
+ type: 'pubkey',
1441
+ },
1442
+ {
1443
+ name: 'request_id',
1444
+ type: 'u64',
1445
+ },
1446
+ {
1447
+ name: 'owner',
1448
+ type: 'pubkey',
1449
+ },
1450
+ {
1451
+ name: 'sequence',
1452
+ type: 'u64',
1453
+ },
1454
+ {
1455
+ name: 'by',
1456
+ type: 'pubkey',
1457
+ },
1458
+ {
1459
+ name: 'shares',
1460
+ type: 'u64',
1461
+ },
1462
+ {
1463
+ name: 'destination',
1464
+ type: 'pubkey',
1465
+ },
1466
+ ],
1467
+ kind: 'struct',
1468
+ },
1469
+ },
1470
+ {
1471
+ docs: [
1472
+ "The admin or operator moved a request's eligibility to now (decision 15).",
1473
+ ],
1474
+ name: 'WithdrawalExpedited',
1475
+ type: {
1476
+ fields: [
1477
+ {
1478
+ name: 'vault',
1479
+ type: 'pubkey',
1480
+ },
1481
+ {
1482
+ name: 'queue',
1483
+ type: 'pubkey',
1484
+ },
1485
+ {
1486
+ name: 'request',
1487
+ type: 'pubkey',
1488
+ },
1489
+ {
1490
+ name: 'request_id',
1491
+ type: 'u64',
1492
+ },
1493
+ {
1494
+ name: 'owner',
1495
+ type: 'pubkey',
1496
+ },
1497
+ {
1498
+ name: 'sequence',
1499
+ type: 'u64',
1500
+ },
1501
+ {
1502
+ name: 'by',
1503
+ type: 'pubkey',
1504
+ },
1505
+ {
1506
+ name: 'previous_eligible_at',
1507
+ type: 'i64',
1508
+ },
1509
+ {
1510
+ name: 'new_eligible_at',
1511
+ type: 'i64',
1512
+ },
1513
+ ],
1514
+ kind: 'struct',
1515
+ },
1516
+ },
1517
+ {
1518
+ docs: [
1519
+ 'A request was paid and closed. `assets` is what left the escrow for the',
1520
+ "recipient: the vault's net payout, never a balance that already sat there.",
1521
+ ],
1522
+ name: 'WithdrawalFinalized',
1523
+ type: {
1524
+ fields: [
1525
+ {
1526
+ name: 'vault',
1527
+ type: 'pubkey',
1528
+ },
1529
+ {
1530
+ name: 'queue',
1531
+ type: 'pubkey',
1532
+ },
1533
+ {
1534
+ name: 'request',
1535
+ type: 'pubkey',
1536
+ },
1537
+ {
1538
+ name: 'request_id',
1539
+ type: 'u64',
1540
+ },
1541
+ {
1542
+ name: 'owner',
1543
+ type: 'pubkey',
1544
+ },
1545
+ {
1546
+ name: 'sequence',
1547
+ type: 'u64',
1548
+ },
1549
+ {
1550
+ name: 'recipient',
1551
+ type: 'pubkey',
1552
+ },
1553
+ {
1554
+ name: 'finalizer',
1555
+ type: 'pubkey',
1556
+ },
1557
+ {
1558
+ name: 'shares',
1559
+ type: 'u64',
1560
+ },
1561
+ {
1562
+ name: 'assets',
1563
+ type: 'u64',
1564
+ },
1565
+ ],
1566
+ kind: 'struct',
1567
+ },
1568
+ },
1569
+ {
1570
+ docs: [
1571
+ 'One queue per vault, at `["withdrawal_queue", vault_state]`. It is the escrow',
1572
+ "authority for pending shares and the key that signs the vault's",
1573
+ '`redeem_checked` by CPI at finalization, so its address is the value the vault',
1574
+ 'stores in `withdrawal_queue_authority`. Stores no admin key; see `crate::auth`.',
1575
+ '',
1576
+ 'The counters and bounds move only through the methods below, so the',
1577
+ 'instructions cannot update one counter and forget its partner.',
1578
+ ],
1579
+ name: 'WithdrawalQueue',
1580
+ type: {
1581
+ fields: [
1582
+ {
1583
+ docs: [
1584
+ 'The vault this queue serves. Every instruction binds the passed vault',
1585
+ 'account to this key.',
1586
+ ],
1587
+ name: 'vault_state',
1588
+ type: 'pubkey',
1589
+ },
1590
+ {
1591
+ docs: [
1592
+ "Copied from the vault at init; binds the CPI's mint accounts.",
1593
+ ],
1594
+ name: 'deposit_mint',
1595
+ type: 'pubkey',
1596
+ },
1597
+ {
1598
+ docs: [
1599
+ "Copied from the vault at init; binds the CPI's mint accounts.",
1600
+ ],
1601
+ name: 'share_mint',
1602
+ type: 'pubkey',
1603
+ },
1604
+ {
1605
+ docs: [
1606
+ "ATA of this PDA for `share_mint`. Holds every pending request's shares.",
1607
+ ],
1608
+ name: 'escrow_shares',
1609
+ type: 'pubkey',
1610
+ },
1611
+ {
1612
+ docs: [
1613
+ 'ATA of this PDA for `deposit_mint`. Transit only: the payout is the balance',
1614
+ 'delta across the CPI, forwarded to the recipient in the same instruction.',
1615
+ ],
1616
+ name: 'escrow_assets',
1617
+ type: 'pubkey',
1618
+ },
1619
+ {
1620
+ docs: [
1621
+ 'Wait between request and eligibility, `0 ..= MAX_COOLDOWN_SECONDS`. Stamped',
1622
+ 'per request at creation, so a change applies to new requests only.',
1623
+ ],
1624
+ name: 'cooldown_seconds',
1625
+ type: 'u64',
1626
+ },
1627
+ {
1628
+ docs: [
1629
+ 'How long after scheduled eligibility a request may still be finalized,',
1630
+ '`0` (never expires) or `MIN_FULFILLMENT_WINDOW_SECONDS ..=',
1631
+ 'MAX_FULFILLMENT_WINDOW_SECONDS`. Stamped per',
1632
+ 'request at creation.',
1633
+ ],
1634
+ name: 'fulfillment_window_seconds',
1635
+ type: 'u64',
1636
+ },
1637
+ {
1638
+ docs: [
1639
+ 'Queue-wide counter, incremented before it is stamped on a request, so the',
1640
+ 'first stamp is 1 and a zero stamp marks a request that was never opened.',
1641
+ 'Not a seed: request identity is owner-scoped. It orders events and pins',
1642
+ 'stale instructions (`expected_sequence`).',
1643
+ ],
1644
+ name: 'sequence',
1645
+ type: 'u64',
1646
+ },
1647
+ {
1648
+ docs: [
1649
+ 'Live requests. Nothing gates on it: once the vault is released no new',
1650
+ 'request can open, so the set closes by itself.',
1651
+ ],
1652
+ name: 'pending_requests',
1653
+ type: 'u64',
1654
+ },
1655
+ {
1656
+ docs: [
1657
+ 'Sum of `shares` over live requests: escrowed exposure, not a demand',
1658
+ 'forecast, since a mature request is a standing exit authorization.',
1659
+ ],
1660
+ name: 'pending_shares',
1661
+ type: 'u64',
1662
+ },
1663
+ {
1664
+ docs: [
1665
+ 'Canonical bump of this PDA. The vault accepts the canonical address only,',
1666
+ "so this must come from Anchor's `bump` at init, never a caller.",
1667
+ ],
1668
+ name: 'bump',
1669
+ type: 'u8',
1670
+ },
1671
+ {
1672
+ docs: [
1673
+ 'Reserved. Carve new fields **out of** this array so `LEN` stays 369. A',
1674
+ 'field carved later reads zero on every queue that already exists, so zero',
1675
+ 'must mean "legacy behaviour" for it, as it does for every field above.',
1676
+ ],
1677
+ name: 'padding',
1678
+ type: {
1679
+ array: ['u64', 20],
1680
+ },
1681
+ },
1682
+ ],
1683
+ kind: 'struct',
1684
+ },
1685
+ },
1686
+ {
1687
+ docs: [
1688
+ 'One pending withdrawal, at `["withdrawal_request", queue, owner, request_id]`.',
1689
+ 'Rent is paid by the owner and returned to them when the account closes on',
1690
+ 'finalize or cancel. One account per request, so an owner can hold many at once',
1691
+ 'and nothing is ever reallocated.',
1692
+ '',
1693
+ 'Owner-scoped ids remove cross-user contention on a shared counter. Because an',
1694
+ 'id can be reused once its account closes, every instruction that targets an',
1695
+ 'existing request also quotes `sequence`, and a signed-but-delayed instruction',
1696
+ 'for the old request fails against the new one.',
1697
+ '',
1698
+ "A zero-filled request, which is what Anchor's `init` hands the handler, reads",
1699
+ 'as eligible immediately and never expiring. [`Self::schedule`] is therefore',
1700
+ 'the only way the timestamps are meant to be written.',
1701
+ ],
1702
+ name: 'WithdrawalRequest',
1703
+ type: {
1704
+ fields: [
1705
+ {
1706
+ docs: ["The queue holding this request's shares."],
1707
+ name: 'queue',
1708
+ type: 'pubkey',
1709
+ },
1710
+ {
1711
+ docs: [
1712
+ 'Who requested, pays rent, may cancel, and may always finalize.',
1713
+ ],
1714
+ name: 'owner',
1715
+ type: 'pubkey',
1716
+ },
1717
+ {
1718
+ docs: [
1719
+ 'Deposit-mint token account paid at finalization. Never an escrow or the',
1720
+ 'vault reserve, checked at request and again at finalize.',
1721
+ ],
1722
+ name: 'recipient_token_account',
1723
+ type: 'pubkey',
1724
+ },
1725
+ {
1726
+ docs: [
1727
+ 'Who may finalize besides the owner. Zero means anyone. Read it through',
1728
+ '[`Self::may_finalize`].',
1729
+ ],
1730
+ name: 'finalizer',
1731
+ type: 'pubkey',
1732
+ },
1733
+ {
1734
+ docs: ["Shares held in the queue's escrow for this request."],
1735
+ name: 'shares',
1736
+ type: 'u64',
1737
+ },
1738
+ {
1739
+ docs: [
1740
+ 'Owner-chosen id, unique per owner while this account exists.',
1741
+ ],
1742
+ name: 'request_id',
1743
+ type: 'u64',
1744
+ },
1745
+ {
1746
+ docs: [
1747
+ 'Queue-wide ordering stamp at creation, from `WithdrawalQueue::open_request`.',
1748
+ 'Quoted as `expected_sequence` by every instruction that targets this',
1749
+ 'request.',
1750
+ ],
1751
+ name: 'sequence',
1752
+ type: 'u64',
1753
+ },
1754
+ {
1755
+ docs: ['Unix time the request was created.'],
1756
+ name: 'requested_at',
1757
+ type: 'i64',
1758
+ },
1759
+ {
1760
+ docs: [
1761
+ '`requested_at + cooldown` at creation. Never changes: `expires_at` is',
1762
+ 'measured from it, so expediting cannot move a deadline.',
1763
+ ],
1764
+ name: 'scheduled_eligible_at',
1765
+ type: 'i64',
1766
+ },
1767
+ {
1768
+ docs: [
1769
+ 'Unix time finalization may begin. Equals `scheduled_eligible_at` unless',
1770
+ '`expedite_request` moved it earlier; it only ever moves earlier.',
1771
+ ],
1772
+ name: 'eligible_at',
1773
+ type: 'i64',
1774
+ },
1775
+ {
1776
+ docs: [
1777
+ '`scheduled_eligible_at + fulfillment_window` at creation, or `0` when the',
1778
+ 'window is disabled. Read it through [`Self::is_expired`]. An expired',
1779
+ 'request stays pending, and counted, until cancelled.',
1780
+ ],
1781
+ name: 'expires_at',
1782
+ type: 'i64',
1783
+ },
1784
+ {
1785
+ docs: [
1786
+ 'Bump of this PDA, for `bump = request.bump` constraints. This account',
1787
+ 'never signs.',
1788
+ ],
1789
+ name: 'bump',
1790
+ type: 'u8',
1791
+ },
1792
+ {
1793
+ name: 'min_assets_out',
1794
+ type: 'u64',
1795
+ },
1796
+ {
1797
+ docs: [
1798
+ 'Reserved. Carve new fields **out of** this array so `LEN` stays 265.',
1799
+ ],
1800
+ name: 'padding',
1801
+ type: {
1802
+ array: ['u64', 8],
1803
+ },
1804
+ },
1805
+ ],
1806
+ kind: 'struct',
1807
+ },
1808
+ },
1809
+ {
1810
+ docs: ['A request was created and its shares escrowed.'],
1811
+ name: 'WithdrawalRequested',
1812
+ type: {
1813
+ fields: [
1814
+ {
1815
+ name: 'vault',
1816
+ type: 'pubkey',
1817
+ },
1818
+ {
1819
+ name: 'queue',
1820
+ type: 'pubkey',
1821
+ },
1822
+ {
1823
+ name: 'request',
1824
+ type: 'pubkey',
1825
+ },
1826
+ {
1827
+ name: 'request_id',
1828
+ type: 'u64',
1829
+ },
1830
+ {
1831
+ name: 'owner',
1832
+ type: 'pubkey',
1833
+ },
1834
+ {
1835
+ name: 'sequence',
1836
+ type: 'u64',
1837
+ },
1838
+ {
1839
+ name: 'shares',
1840
+ type: 'u64',
1841
+ },
1842
+ {
1843
+ name: 'recipient_token_account',
1844
+ type: 'pubkey',
1845
+ },
1846
+ {
1847
+ name: 'finalizer',
1848
+ type: 'pubkey',
1849
+ },
1850
+ {
1851
+ name: 'eligible_at',
1852
+ type: 'i64',
1853
+ },
1854
+ {
1855
+ name: 'expires_at',
1856
+ type: 'i64',
1857
+ },
1858
+ {
1859
+ name: 'min_assets_out',
1860
+ type: 'u64',
1861
+ },
1862
+ ],
1863
+ kind: 'struct',
1864
+ },
1865
+ },
1866
+ ],
1867
+ };
1868
+ //# sourceMappingURL=withdrawal-queue-idl.js.map