@augustdigital/sdk 8.22.1 → 8.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/adapters/solana/idl/vault-idl.d.ts +185 -18
- package/lib/adapters/solana/idl/vault-idl.js +521 -28
- package/lib/core/analytics/method-taxonomy.js +10 -0
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/attribution.d.ts +24 -8
- package/lib/core/attribution.js +21 -5
- package/lib/core/constants/core.d.ts +11 -0
- package/lib/core/constants/core.js +54 -0
- package/lib/core/helpers/signer.d.ts +2 -1
- package/lib/core/helpers/signer.js +7 -5
- package/lib/evm/methods/crossChainVault.d.ts +5 -1
- package/lib/evm/methods/crossChainVault.js +8 -4
- package/lib/main.d.ts +22 -2
- package/lib/main.js +22 -2
- package/lib/modules/api/fetcher.d.ts +27 -1
- package/lib/modules/api/fetcher.js +38 -1
- package/lib/modules/api/main.d.ts +288 -14
- package/lib/modules/api/main.js +439 -13
- package/lib/modules/vaults/write.actions.d.ts +4 -0
- package/lib/modules/vaults/write.actions.js +9 -1
- package/lib/sdk.d.ts +11586 -10847
- package/lib/types/api.d.ts +218 -0
- package/package.json +1 -1
|
@@ -4,21 +4,21 @@ exports.vaultIdl = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* august_vault program IDL (Anchor).
|
|
6
6
|
*
|
|
7
|
-
* GENERATED — do not edit by hand.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `anchor idl fetch
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* it can't be used as the generation source. The solana-idl-drift check (CI)
|
|
15
|
-
* therefore validates `up12…` by pinning its deployed binary and by decoding
|
|
16
|
-
* live VaultState accounts against this file — see
|
|
17
|
-
* tests/vaults/solana-idl-drift.test.ts.
|
|
7
|
+
* GENERATED — do not edit by hand. Source of truth is the program repo's build
|
|
8
|
+
* artifact: solana-vaults `frontend/idl/august_vault.json` (synced from the
|
|
9
|
+
* vendored program by `scripts/sync-idl.sh`). Regenerate from there, NOT with
|
|
10
|
+
* `anchor idl fetch`: an Anchor IDL upload is not refreshed by a program
|
|
11
|
+
* upgrade, so every IDL published for this program lineage is stale — both
|
|
12
|
+
* `up12…` on mainnet (last written 2026-01-21) and the `C8B1…` devnet reference
|
|
13
|
+
* (2026-01-23) predate the ProgramConfig build deployed on 2026-08-06.
|
|
18
14
|
*
|
|
19
15
|
* `address` is a build stamp (the mainnet id), NOT network-aware. Never rely on
|
|
20
16
|
* it: SolanaAdapter/getProgram resolve the real program id per network from
|
|
21
17
|
* programIds, or from an explicit `programId` override.
|
|
18
|
+
*
|
|
19
|
+
* Drift is guarded by tests/vaults/solana-idl-drift.test.ts: the deployed binary
|
|
20
|
+
* is pinned, every discriminator declared here must appear in that binary, and
|
|
21
|
+
* live VaultState accounts must decode against this file.
|
|
22
22
|
*/
|
|
23
23
|
exports.vaultIdl = {
|
|
24
24
|
accounts: [
|
|
@@ -26,6 +26,10 @@ exports.vaultIdl = {
|
|
|
26
26
|
discriminator: [195, 131, 96, 55, 140, 253, 93, 195],
|
|
27
27
|
name: 'NominatedAdmin',
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
discriminator: [196, 210, 90, 231, 144, 149, 140, 63],
|
|
31
|
+
name: 'ProgramConfig',
|
|
32
|
+
},
|
|
29
33
|
{
|
|
30
34
|
discriminator: [228, 196, 82, 165, 98, 210, 235, 152],
|
|
31
35
|
name: 'VaultState',
|
|
@@ -113,6 +117,31 @@ exports.vaultIdl = {
|
|
|
113
117
|
msg: 'Vault must be empty to close',
|
|
114
118
|
name: 'VaultNotEmpty',
|
|
115
119
|
},
|
|
120
|
+
{
|
|
121
|
+
code: 6016,
|
|
122
|
+
msg: 'Signer is not the protocol authority',
|
|
123
|
+
name: 'NotProtocolAuthority',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
code: 6017,
|
|
127
|
+
msg: 'Authority must not be the zero key',
|
|
128
|
+
name: 'InvalidAuthority',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
code: 6018,
|
|
132
|
+
msg: "Received fewer shares than the caller's minimum",
|
|
133
|
+
name: 'SlippageExceeded',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
code: 6019,
|
|
137
|
+
msg: 'Vault holds no assets while shares are outstanding; share price is undefined',
|
|
138
|
+
name: 'SharePriceUndefined',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
code: 6020,
|
|
142
|
+
msg: 'Share offset must be a power of ten within the permitted range',
|
|
143
|
+
name: 'InvalidShareOffset',
|
|
144
|
+
},
|
|
116
145
|
],
|
|
117
146
|
events: [
|
|
118
147
|
{
|
|
@@ -339,6 +368,8 @@ exports.vaultIdl = {
|
|
|
339
368
|
'Deposit funds in the Vault',
|
|
340
369
|
'Mint Vault shares',
|
|
341
370
|
'',
|
|
371
|
+
'No slippage bound — prefer `deposit_checked` in new integrations.',
|
|
372
|
+
'',
|
|
342
373
|
'### Parameters',
|
|
343
374
|
'- `amount` - The amount to deposit',
|
|
344
375
|
],
|
|
@@ -351,19 +382,134 @@ exports.vaultIdl = {
|
|
|
351
382
|
writable: true,
|
|
352
383
|
},
|
|
353
384
|
{
|
|
354
|
-
name: '
|
|
385
|
+
name: 'vault_token_ata',
|
|
355
386
|
writable: true,
|
|
356
387
|
},
|
|
357
388
|
{
|
|
358
|
-
name: '
|
|
389
|
+
name: 'sender_token_account',
|
|
390
|
+
writable: true,
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: 'sender_share_account',
|
|
394
|
+
writable: true,
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: 'share_mint',
|
|
359
398
|
writable: true,
|
|
360
399
|
},
|
|
361
400
|
{
|
|
362
401
|
name: 'deposit_mint',
|
|
402
|
+
writable: true,
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: 'signer',
|
|
406
|
+
signer: true,
|
|
407
|
+
writable: true,
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: 'token_program',
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
args: [
|
|
414
|
+
{
|
|
415
|
+
name: 'amount',
|
|
416
|
+
type: 'u64',
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'min_shares_out',
|
|
420
|
+
type: 'u64',
|
|
421
|
+
},
|
|
422
|
+
],
|
|
423
|
+
discriminator: [216, 117, 3, 197, 107, 28, 130, 111],
|
|
424
|
+
docs: [
|
|
425
|
+
'Deposit funds in the Vault, refusing to mint fewer than',
|
|
426
|
+
'`min_shares_out` shares.',
|
|
427
|
+
'',
|
|
428
|
+
'Same accounts and semantics as `deposit`, plus a caller-stated worst',
|
|
429
|
+
'acceptable rate. Additive rather than a change to `deposit`, so existing',
|
|
430
|
+
'integrations keep working; pass 0 for identical behaviour.',
|
|
431
|
+
'',
|
|
432
|
+
'### Parameters',
|
|
433
|
+
'- `amount` - The amount to deposit',
|
|
434
|
+
'- `min_shares_out` - Revert with `SlippageExceeded` below this many shares',
|
|
435
|
+
],
|
|
436
|
+
name: 'deposit_checked',
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
accounts: [
|
|
440
|
+
{
|
|
441
|
+
docs: [
|
|
442
|
+
'Gates vault creation: it is restricted to the authority recorded in',
|
|
443
|
+
'`ProgramConfig`, rather than being open to any paying signer.',
|
|
444
|
+
'',
|
|
445
|
+
'**Declared first so a missing config fails closed early.** Anchor',
|
|
446
|
+
'deserializes fields in declaration order, so if this account does not',
|
|
447
|
+
'exist the instruction aborts with `AccountNotInitialized` before any',
|
|
448
|
+
'account is created. That much *is* order-sensitive.',
|
|
449
|
+
'',
|
|
450
|
+
'The authority comparison below is **not**. It is a `constraint` on a',
|
|
451
|
+
'non-`init` field, and `anchor_syn::codegen::accounts::try_accounts::',
|
|
452
|
+
"generate_constraints` emits every `init` field's creation CPI ahead of",
|
|
453
|
+
'*all* non-init access checks, regardless of declaration order — and',
|
|
454
|
+
'within a single field `linearize` orders `Init` before `Raw`, so moving',
|
|
455
|
+
'the constraint onto an `init` account would not help either. An',
|
|
456
|
+
'unauthorized caller who is also their own `payer` and cannot fund the',
|
|
457
|
+
'rent therefore fails with a System Program "insufficient lamports" error',
|
|
458
|
+
'rather than `NotProtocolAuthority`.',
|
|
459
|
+
'',
|
|
460
|
+
'Authorization is still enforced in every case — only the error surfaced',
|
|
461
|
+
"depends on the caller's balance. Pinned by",
|
|
462
|
+
'`unauthorized_signer_creates_nothing_whatever_their_balance`.',
|
|
463
|
+
'',
|
|
464
|
+
'**Namespace note**: `vault_version` is a `u8` seed byte, so each deposit',
|
|
465
|
+
'mint has 256 namespaces and each is single-use. `close_vault` cannot',
|
|
466
|
+
'close the share mint (classic SPL Token has no close-mint instruction)',
|
|
467
|
+
'and revokes its mint authority irreversibly, so a retired version can',
|
|
468
|
+
'never be re-initialized. Retiring a vault therefore consumes one of the',
|
|
469
|
+
'256 permanently and strands its share-mint rent.',
|
|
470
|
+
],
|
|
471
|
+
name: 'program_config',
|
|
472
|
+
pda: {
|
|
473
|
+
seeds: [
|
|
474
|
+
{
|
|
475
|
+
kind: 'const',
|
|
476
|
+
value: [
|
|
477
|
+
112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
|
|
478
|
+
103,
|
|
479
|
+
],
|
|
480
|
+
},
|
|
481
|
+
],
|
|
482
|
+
},
|
|
363
483
|
},
|
|
364
484
|
{
|
|
485
|
+
docs: [
|
|
486
|
+
'The protocol authority. Authorizes creation but does not fund it, so a',
|
|
487
|
+
'cold or MPC-held key can hold this role without carrying SOL.',
|
|
488
|
+
],
|
|
365
489
|
name: 'signer',
|
|
366
490
|
signer: true,
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
docs: [
|
|
494
|
+
'Funds the three accounts below. May be the same key as `signer`.',
|
|
495
|
+
],
|
|
496
|
+
name: 'payer',
|
|
497
|
+
signer: true,
|
|
498
|
+
writable: true,
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
name: 'deposit_mint',
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: 'vault_state',
|
|
505
|
+
writable: true,
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: 'share_mint',
|
|
509
|
+
writable: true,
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: 'vault_token_ata',
|
|
367
513
|
writable: true,
|
|
368
514
|
},
|
|
369
515
|
{
|
|
@@ -395,20 +541,118 @@ exports.vaultIdl = {
|
|
|
395
541
|
name: 'vault_version',
|
|
396
542
|
type: 'u8',
|
|
397
543
|
},
|
|
544
|
+
{
|
|
545
|
+
name: 'share_offset',
|
|
546
|
+
type: 'u64',
|
|
547
|
+
},
|
|
398
548
|
],
|
|
399
549
|
discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
|
|
400
550
|
docs: [
|
|
401
551
|
'Initialize the Vault state',
|
|
402
552
|
'Mint Vault shares',
|
|
403
553
|
'',
|
|
554
|
+
'Requires the signer to be the protocol authority from `ProgramConfig`.',
|
|
555
|
+
'',
|
|
404
556
|
'### Parameters',
|
|
405
557
|
'- `admin` - The Admin of the Vault',
|
|
406
558
|
'- `operator` - The Operator of the Vault',
|
|
407
559
|
'- `fee_recipient` - The Fee recipient of the Vault',
|
|
408
560
|
'- `vault_version` - Version number for the vault (allows multiple vaults per deposit mint)',
|
|
561
|
+
"- `share_offset` - This vault's virtual-share offset, in base units of the",
|
|
562
|
+
'deposit mint. Must be a power of ten within',
|
|
563
|
+
'`MIN_SHARE_OFFSET..=MAX_SHARE_OFFSET`. It is fixed for the life of the',
|
|
564
|
+
'vault and also sets the minimum first deposit',
|
|
565
|
+
'(`MIN_SUPPLY_MULTIPLE * share_offset`), so choose it for what a base',
|
|
566
|
+
'unit of this mint is worth: a larger offset buys a wider margin against',
|
|
567
|
+
'share-burn price manipulation, a smaller one keeps a high-value mint',
|
|
568
|
+
'launchable.',
|
|
409
569
|
],
|
|
410
570
|
name: 'initialize',
|
|
411
571
|
},
|
|
572
|
+
{
|
|
573
|
+
accounts: [
|
|
574
|
+
{
|
|
575
|
+
docs: ["Must be the program's current upgrade authority."],
|
|
576
|
+
name: 'upgrade_authority',
|
|
577
|
+
signer: true,
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
docs: [
|
|
581
|
+
"This program's `ProgramData`. The seed constraint pins it to *this*",
|
|
582
|
+
'program, so a caller cannot present the `ProgramData` of some unrelated',
|
|
583
|
+
'program they happen to control.',
|
|
584
|
+
'',
|
|
585
|
+
'Note that declaration order does **not** make this check run before',
|
|
586
|
+
"`program_config` is created: Anchor emits every `init` field's creation",
|
|
587
|
+
'CPI ahead of all non-init access checks. An upgrade-authority mismatch is',
|
|
588
|
+
'still always caught — the whole transaction reverts — but a caller who',
|
|
589
|
+
"cannot fund the config's rent sees the System Program's error rather than",
|
|
590
|
+
'`NotProtocolAuthority`.',
|
|
591
|
+
],
|
|
592
|
+
name: 'program_data',
|
|
593
|
+
pda: {
|
|
594
|
+
program: {
|
|
595
|
+
kind: 'const',
|
|
596
|
+
value: [
|
|
597
|
+
2, 168, 246, 145, 78, 136, 161, 176, 226, 16, 21, 62, 247, 99,
|
|
598
|
+
174, 43, 0, 194, 185, 61, 22, 193, 36, 210, 192, 83, 122, 16, 4,
|
|
599
|
+
128, 0, 0,
|
|
600
|
+
],
|
|
601
|
+
},
|
|
602
|
+
seeds: [
|
|
603
|
+
{
|
|
604
|
+
kind: 'const',
|
|
605
|
+
value: [
|
|
606
|
+
13, 135, 88, 126, 126, 197, 36, 47, 73, 223, 215, 77, 214,
|
|
607
|
+
167, 161, 118, 224, 21, 117, 226, 241, 67, 46, 100, 19, 247,
|
|
608
|
+
103, 179, 29, 106, 67, 143,
|
|
609
|
+
],
|
|
610
|
+
},
|
|
611
|
+
],
|
|
612
|
+
},
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
name: 'payer',
|
|
616
|
+
signer: true,
|
|
617
|
+
writable: true,
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: 'program_config',
|
|
621
|
+
pda: {
|
|
622
|
+
seeds: [
|
|
623
|
+
{
|
|
624
|
+
kind: 'const',
|
|
625
|
+
value: [
|
|
626
|
+
112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
|
|
627
|
+
103,
|
|
628
|
+
],
|
|
629
|
+
},
|
|
630
|
+
],
|
|
631
|
+
},
|
|
632
|
+
writable: true,
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
address: '11111111111111111111111111111111',
|
|
636
|
+
name: 'system_program',
|
|
637
|
+
},
|
|
638
|
+
],
|
|
639
|
+
args: [
|
|
640
|
+
{
|
|
641
|
+
name: 'authority',
|
|
642
|
+
type: 'pubkey',
|
|
643
|
+
},
|
|
644
|
+
],
|
|
645
|
+
discriminator: [208, 127, 21, 1, 194, 190, 196, 70],
|
|
646
|
+
docs: [
|
|
647
|
+
'Create the singleton program config, naming the key permitted to create',
|
|
648
|
+
"vaults. Callable only by the program's current upgrade authority, and",
|
|
649
|
+
'only once.',
|
|
650
|
+
'',
|
|
651
|
+
'### Parameters',
|
|
652
|
+
'- `authority` - The key that may call `initialize` from now on',
|
|
653
|
+
],
|
|
654
|
+
name: 'initialize_config',
|
|
655
|
+
},
|
|
412
656
|
{
|
|
413
657
|
accounts: [
|
|
414
658
|
{
|
|
@@ -477,12 +721,8 @@ exports.vaultIdl = {
|
|
|
477
721
|
path: 'operator',
|
|
478
722
|
},
|
|
479
723
|
{
|
|
480
|
-
kind: '
|
|
481
|
-
|
|
482
|
-
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
483
|
-
235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
|
|
484
|
-
245, 133, 126, 255, 0, 169,
|
|
485
|
-
],
|
|
724
|
+
kind: 'account',
|
|
725
|
+
path: 'token_program',
|
|
486
726
|
},
|
|
487
727
|
{
|
|
488
728
|
kind: 'account',
|
|
@@ -578,12 +818,8 @@ exports.vaultIdl = {
|
|
|
578
818
|
path: 'operator',
|
|
579
819
|
},
|
|
580
820
|
{
|
|
581
|
-
kind: '
|
|
582
|
-
|
|
583
|
-
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
584
|
-
235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
|
|
585
|
-
245, 133, 126, 255, 0, 169,
|
|
586
|
-
],
|
|
821
|
+
kind: 'account',
|
|
822
|
+
path: 'token_program',
|
|
587
823
|
},
|
|
588
824
|
{
|
|
589
825
|
kind: 'account',
|
|
@@ -621,6 +857,72 @@ exports.vaultIdl = {
|
|
|
621
857
|
],
|
|
622
858
|
name: 'operator_withdraw',
|
|
623
859
|
},
|
|
860
|
+
{
|
|
861
|
+
accounts: [
|
|
862
|
+
{
|
|
863
|
+
name: 'program_config',
|
|
864
|
+
pda: {
|
|
865
|
+
seeds: [
|
|
866
|
+
{
|
|
867
|
+
kind: 'const',
|
|
868
|
+
value: [
|
|
869
|
+
112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
|
|
870
|
+
103,
|
|
871
|
+
],
|
|
872
|
+
},
|
|
873
|
+
],
|
|
874
|
+
},
|
|
875
|
+
writable: true,
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
docs: ["Must be the program's current upgrade authority."],
|
|
879
|
+
name: 'upgrade_authority',
|
|
880
|
+
signer: true,
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
docs: [
|
|
884
|
+
"This program's `ProgramData`, pinned by seeds so a caller cannot present",
|
|
885
|
+
'the `ProgramData` of an unrelated program they happen to control.',
|
|
886
|
+
],
|
|
887
|
+
name: 'program_data',
|
|
888
|
+
pda: {
|
|
889
|
+
program: {
|
|
890
|
+
kind: 'const',
|
|
891
|
+
value: [
|
|
892
|
+
2, 168, 246, 145, 78, 136, 161, 176, 226, 16, 21, 62, 247, 99,
|
|
893
|
+
174, 43, 0, 194, 185, 61, 22, 193, 36, 210, 192, 83, 122, 16, 4,
|
|
894
|
+
128, 0, 0,
|
|
895
|
+
],
|
|
896
|
+
},
|
|
897
|
+
seeds: [
|
|
898
|
+
{
|
|
899
|
+
kind: 'const',
|
|
900
|
+
value: [
|
|
901
|
+
13, 135, 88, 126, 126, 197, 36, 47, 73, 223, 215, 77, 214,
|
|
902
|
+
167, 161, 118, 224, 21, 117, 226, 241, 67, 46, 100, 19, 247,
|
|
903
|
+
103, 179, 29, 106, 67, 143,
|
|
904
|
+
],
|
|
905
|
+
},
|
|
906
|
+
],
|
|
907
|
+
},
|
|
908
|
+
},
|
|
909
|
+
],
|
|
910
|
+
args: [
|
|
911
|
+
{
|
|
912
|
+
name: 'new_authority',
|
|
913
|
+
type: 'pubkey',
|
|
914
|
+
},
|
|
915
|
+
],
|
|
916
|
+
discriminator: [49, 53, 195, 205, 146, 192, 154, 236],
|
|
917
|
+
docs: [
|
|
918
|
+
"Reset the vault-creation authority using the program's **upgrade",
|
|
919
|
+
'authority**, for when the current config authority is wrong or lost.',
|
|
920
|
+
'',
|
|
921
|
+
'### Parameters',
|
|
922
|
+
'- `new_authority` - The replacement authority (must not be the zero key)',
|
|
923
|
+
],
|
|
924
|
+
name: 'override_config_authority',
|
|
925
|
+
},
|
|
624
926
|
{
|
|
625
927
|
accounts: [
|
|
626
928
|
{
|
|
@@ -694,11 +996,79 @@ exports.vaultIdl = {
|
|
|
694
996
|
'Redeem funds from the Vault',
|
|
695
997
|
'Burn shared',
|
|
696
998
|
'Get tokens out',
|
|
999
|
+
'',
|
|
1000
|
+
'No slippage bound — prefer `redeem_checked` in new integrations.',
|
|
1001
|
+
'',
|
|
697
1002
|
'### Parameters',
|
|
698
1003
|
'- `shares` - The amount of shares to burn',
|
|
699
1004
|
],
|
|
700
1005
|
name: 'redeem',
|
|
701
1006
|
},
|
|
1007
|
+
{
|
|
1008
|
+
accounts: [
|
|
1009
|
+
{
|
|
1010
|
+
name: 'vault_state',
|
|
1011
|
+
writable: true,
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
name: 'vault_deposit_ata',
|
|
1015
|
+
writable: true,
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
name: 'sender_token_account',
|
|
1019
|
+
writable: true,
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
name: 'sender_share_account',
|
|
1023
|
+
writable: true,
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
name: 'fee_recipient_account',
|
|
1027
|
+
writable: true,
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
name: 'share_mint',
|
|
1031
|
+
writable: true,
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
name: 'deposit_mint',
|
|
1035
|
+
writable: true,
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
name: 'signer',
|
|
1039
|
+
signer: true,
|
|
1040
|
+
writable: true,
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
name: 'token_program',
|
|
1044
|
+
},
|
|
1045
|
+
],
|
|
1046
|
+
args: [
|
|
1047
|
+
{
|
|
1048
|
+
name: 'shares',
|
|
1049
|
+
type: 'u64',
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
name: 'min_assets_out',
|
|
1053
|
+
type: 'u64',
|
|
1054
|
+
},
|
|
1055
|
+
],
|
|
1056
|
+
discriminator: [37, 136, 51, 20, 129, 161, 11, 218],
|
|
1057
|
+
docs: [
|
|
1058
|
+
'Redeem funds from the Vault, refusing to pay out less than',
|
|
1059
|
+
'`min_assets_out`.',
|
|
1060
|
+
'',
|
|
1061
|
+
'Same accounts and semantics as `redeem`, plus a caller-stated worst',
|
|
1062
|
+
'acceptable payout, measured **net of the withdrawal fee** — what the',
|
|
1063
|
+
'caller actually receives. Additive rather than a change to `redeem`, so',
|
|
1064
|
+
'existing integrations keep working; pass 0 for identical behaviour.',
|
|
1065
|
+
'',
|
|
1066
|
+
'### Parameters',
|
|
1067
|
+
'- `shares` - The amount of shares to burn',
|
|
1068
|
+
'- `min_assets_out` - Revert with `SlippageExceeded` below this payout',
|
|
1069
|
+
],
|
|
1070
|
+
name: 'redeem_checked',
|
|
1071
|
+
},
|
|
702
1072
|
{
|
|
703
1073
|
accounts: [
|
|
704
1074
|
{
|
|
@@ -733,6 +1103,44 @@ exports.vaultIdl = {
|
|
|
733
1103
|
],
|
|
734
1104
|
name: 'set_aum_limits',
|
|
735
1105
|
},
|
|
1106
|
+
{
|
|
1107
|
+
accounts: [
|
|
1108
|
+
{
|
|
1109
|
+
name: 'program_config',
|
|
1110
|
+
pda: {
|
|
1111
|
+
seeds: [
|
|
1112
|
+
{
|
|
1113
|
+
kind: 'const',
|
|
1114
|
+
value: [
|
|
1115
|
+
112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
|
|
1116
|
+
103,
|
|
1117
|
+
],
|
|
1118
|
+
},
|
|
1119
|
+
],
|
|
1120
|
+
},
|
|
1121
|
+
writable: true,
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
name: 'authority',
|
|
1125
|
+
signer: true,
|
|
1126
|
+
},
|
|
1127
|
+
],
|
|
1128
|
+
args: [
|
|
1129
|
+
{
|
|
1130
|
+
name: 'new_authority',
|
|
1131
|
+
type: 'pubkey',
|
|
1132
|
+
},
|
|
1133
|
+
],
|
|
1134
|
+
discriminator: [16, 200, 212, 18, 95, 43, 107, 89],
|
|
1135
|
+
docs: [
|
|
1136
|
+
'Rotate the key permitted to create vaults. Signed by the current',
|
|
1137
|
+
'authority; see `override_config_authority` for the recovery path.',
|
|
1138
|
+
'',
|
|
1139
|
+
'### Parameters',
|
|
1140
|
+
'- `new_authority` - The replacement authority (must not be the zero key)',
|
|
1141
|
+
],
|
|
1142
|
+
name: 'set_config_authority',
|
|
1143
|
+
},
|
|
736
1144
|
{
|
|
737
1145
|
accounts: [
|
|
738
1146
|
{
|
|
@@ -813,9 +1221,13 @@ exports.vaultIdl = {
|
|
|
813
1221
|
docs: [
|
|
814
1222
|
'Admin Updates the Withdrawal Fee',
|
|
815
1223
|
'',
|
|
816
|
-
'Fee should discourage users from sandwiching operator_update_aum',
|
|
1224
|
+
'Fee should discourage users from sandwiching operator_update_aum.',
|
|
817
1225
|
'### Parameters',
|
|
818
|
-
'- `new_fee` -
|
|
1226
|
+
'- `new_fee` - Fee in units of `FEE_RATE_DENOMINATOR_VALUE` (full denominator',
|
|
1227
|
+
'≡ 100%). The handler caps `new_fee` strictly below',
|
|
1228
|
+
'`FEE_RATE_DENOMINATOR_VALUE / 10` (i.e. < 10%); see',
|
|
1229
|
+
'`set_withdrawal_fee::handler` for the exact cap expression. Higher',
|
|
1230
|
+
'inputs revert with `WithdrawalFeeTooHigh`.',
|
|
819
1231
|
],
|
|
820
1232
|
name: 'set_withdrawal_fee',
|
|
821
1233
|
},
|
|
@@ -981,6 +1393,55 @@ exports.vaultIdl = {
|
|
|
981
1393
|
kind: 'struct',
|
|
982
1394
|
},
|
|
983
1395
|
},
|
|
1396
|
+
{
|
|
1397
|
+
docs: [
|
|
1398
|
+
'Program-wide configuration.',
|
|
1399
|
+
'',
|
|
1400
|
+
'Exists so vault creation is authenticated rather than open to any paying',
|
|
1401
|
+
'signer. See the namespace note in `initialize.rs` for why a',
|
|
1402
|
+
'`(deposit_mint, vault_version)` pair cannot be reused once retired.',
|
|
1403
|
+
'',
|
|
1404
|
+
'The authority is stored here rather than hardcoded so it can be rotated with',
|
|
1405
|
+
'`set_config_authority` instead of a program upgrade (upgrades require a',
|
|
1406
|
+
'Fordefi-signed verified deploy).',
|
|
1407
|
+
],
|
|
1408
|
+
name: 'ProgramConfig',
|
|
1409
|
+
type: {
|
|
1410
|
+
fields: [
|
|
1411
|
+
{
|
|
1412
|
+
docs: ['The only key permitted to call `initialize`.'],
|
|
1413
|
+
name: 'authority',
|
|
1414
|
+
type: 'pubkey',
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
docs: [
|
|
1418
|
+
'Bump of this PDA, stored so callers need not recompute it.',
|
|
1419
|
+
],
|
|
1420
|
+
name: 'bump',
|
|
1421
|
+
type: {
|
|
1422
|
+
array: ['u8', 1],
|
|
1423
|
+
},
|
|
1424
|
+
},
|
|
1425
|
+
{
|
|
1426
|
+
docs: [
|
|
1427
|
+
'Reserved. Lets a future change add policy fields (for example an',
|
|
1428
|
+
'allowlist of approved vault creators) without resizing the account.',
|
|
1429
|
+
'New fields must be carved **out of** this array, keeping `LEN` at 169:',
|
|
1430
|
+
'`initialize_config` uses `init` and can never be re-run, so once the',
|
|
1431
|
+
'config exists on mainnet a larger `LEN` would make Anchor allocate a',
|
|
1432
|
+
'different size for new deployments while the live account stays 169 and',
|
|
1433
|
+
'stops deserializing. Enforced by a compile-time assertion in',
|
|
1434
|
+
'`programs/august-vault/src/state/config.rs`.',
|
|
1435
|
+
],
|
|
1436
|
+
name: 'padding',
|
|
1437
|
+
type: {
|
|
1438
|
+
array: ['u64', 16],
|
|
1439
|
+
},
|
|
1440
|
+
},
|
|
1441
|
+
],
|
|
1442
|
+
kind: 'struct',
|
|
1443
|
+
},
|
|
1444
|
+
},
|
|
984
1445
|
{
|
|
985
1446
|
name: 'VaultState',
|
|
986
1447
|
type: {
|
|
@@ -1042,9 +1503,41 @@ exports.vaultIdl = {
|
|
|
1042
1503
|
type: 'bool',
|
|
1043
1504
|
},
|
|
1044
1505
|
{
|
|
1506
|
+
docs: [
|
|
1507
|
+
"This vault's virtual-share offset, in base units.",
|
|
1508
|
+
'',
|
|
1509
|
+
'Per-vault rather than global because the right value depends on what a',
|
|
1510
|
+
'base unit of the deposit mint is *worth*. The offset must dominate a',
|
|
1511
|
+
'1-unit retained sliver (so it is an absolute count), while',
|
|
1512
|
+
'`MIN_SUPPLY_MULTIPLE * offset` is the minimum first deposit — whose cost',
|
|
1513
|
+
'is that count times the base-unit price. One global constant cannot serve',
|
|
1514
|
+
'both a 6-decimal dollar stablecoin and an 8-decimal asset worth ~$100k.',
|
|
1515
|
+
'',
|
|
1516
|
+
'**Zero means "not set" and maps to [`EXTRA_SHARES`].** Vaults created',
|
|
1517
|
+
'before this field existed have zeroed padding, so they read 0 — both live',
|
|
1518
|
+
'mainnet vaults are in that state. Never read this field directly: on-chain',
|
|
1519
|
+
'use `VaultState::share_offset()`, and off-chain use',
|
|
1520
|
+
'`resolved_share_offset()` from the generated Rust client, which mirrors it.',
|
|
1521
|
+
'A raw 0 collapses the pricing to pure pro-rata, which agrees with the',
|
|
1522
|
+
'program only while the vault sits exactly at par.',
|
|
1523
|
+
],
|
|
1524
|
+
name: 'share_offset',
|
|
1525
|
+
type: 'u64',
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
docs: [
|
|
1529
|
+
'Reserved. New fields must be carved **out of** this array so `LEN` stays',
|
|
1530
|
+
'455, the size of the live mainnet vault accounts — enforced by the `const`',
|
|
1531
|
+
'assertion below the struct.',
|
|
1532
|
+
'',
|
|
1533
|
+
'**Declare them AFTER `share_offset`, never before it.** Inserting a field',
|
|
1534
|
+
'earlier shifts `share_offset` off byte 199, and every vault storing a',
|
|
1535
|
+
'non-default offset would then silently read 0 and fall back to the default.',
|
|
1536
|
+
'`share_offset_stays_at_its_byte_offset` fails if that happens.',
|
|
1537
|
+
],
|
|
1045
1538
|
name: 'padding',
|
|
1046
1539
|
type: {
|
|
1047
|
-
array: ['u64',
|
|
1540
|
+
array: ['u64', 31],
|
|
1048
1541
|
},
|
|
1049
1542
|
},
|
|
1050
1543
|
],
|