@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.
- package/lib/adapters/solana/constants.d.ts +12 -4
- package/lib/adapters/solana/constants.js +8 -3
- package/lib/adapters/solana/getters.d.ts +5 -0
- package/lib/adapters/solana/getters.js +35 -1
- package/lib/adapters/solana/idl/vault-idl.d.ts +334 -7
- package/lib/adapters/solana/idl/vault-idl.js +600 -59
- package/lib/adapters/solana/idl/withdrawal-queue-idl.d.ts +790 -0
- package/lib/adapters/solana/idl/withdrawal-queue-idl.js +1868 -0
- package/lib/adapters/solana/index.d.ts +108 -10
- package/lib/adapters/solana/index.js +137 -12
- package/lib/adapters/solana/pricing.d.ts +11 -0
- package/lib/adapters/solana/pricing.js +24 -8
- package/lib/adapters/solana/queue.actions.d.ts +98 -0
- package/lib/adapters/solana/queue.actions.js +488 -0
- package/lib/adapters/solana/token-reads.d.ts +108 -0
- package/lib/adapters/solana/token-reads.js +145 -0
- package/lib/adapters/solana/types.d.ts +200 -1
- package/lib/adapters/solana/utils.d.ts +16 -0
- package/lib/adapters/solana/utils.js +41 -4
- package/lib/adapters/solana/vault.actions.d.ts +17 -0
- package/lib/adapters/solana/vault.actions.js +14 -125
- package/lib/adapters/solana/withdrawal-queue.d.ts +125 -0
- package/lib/adapters/solana/withdrawal-queue.js +301 -0
- package/lib/core/analytics/method-taxonomy.js +2 -0
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/main.d.ts +16 -0
- package/lib/main.js +16 -0
- package/lib/modules/vaults/getters.d.ts +2 -2
- package/lib/modules/vaults/getters.js +103 -3
- package/lib/modules/vaults/main.d.ts +12 -0
- package/lib/modules/vaults/main.js +17 -1
- package/lib/modules/vaults/types.d.ts +14 -1
- package/lib/sdk.d.ts +2389 -1723
- package/lib/types/vaults.d.ts +47 -1
- package/lib/types/vaults.js +5 -0
- package/lib/types/webserver.d.ts +8 -0
- package/package.json +1 -1
|
@@ -5,8 +5,10 @@ exports.vaultIdl = void 0;
|
|
|
5
5
|
* august_vault program IDL (Anchor).
|
|
6
6
|
*
|
|
7
7
|
* GENERATED — do not edit by hand. Source of truth is the program repo's build
|
|
8
|
-
* artifact:
|
|
9
|
-
*
|
|
8
|
+
* artifact: `target/idl/august_vault.json` from
|
|
9
|
+
* fractal-protocol/solana-upshift-vault-programs, built at the release the SDK
|
|
10
|
+
* targets (solana-vaults' `frontend/idl/august_vault.json` is a copy of the same
|
|
11
|
+
* artifact, synced from its vendored submodule). Regenerate from there, NOT with
|
|
10
12
|
* `anchor idl fetch`: an Anchor IDL upload is not refreshed by a program
|
|
11
13
|
* upgrade, so every IDL published for this program lineage is stale — both
|
|
12
14
|
* `up12…` on mainnet (last written 2026-01-21) and the `C8B1…` devnet reference
|
|
@@ -16,6 +18,22 @@ exports.vaultIdl = void 0;
|
|
|
16
18
|
* it: SolanaAdapter/getProgram resolve the real program id per network from
|
|
17
19
|
* programIds, or from an explicit `programId` override.
|
|
18
20
|
*
|
|
21
|
+
* Writability: generated from the withdrawal-queue release build (#34). Later
|
|
22
|
+
* builds (devnet runs #41) drop `mut` from accounts they only read. Do not
|
|
23
|
+
* regenerate from one of those until mainnet runs it: mainnet's build rejects
|
|
24
|
+
* those accounts arriving read-only, while every build accepts them writable.
|
|
25
|
+
* Guarded by tests/adapters/solana-idl.test.ts. Built with the doc-only fix
|
|
26
|
+
* from program PR #48 applied (`SubaccountDelegationMissing` is 6027), so it
|
|
27
|
+
* differs from #34's artifact in doc strings alone.
|
|
28
|
+
*
|
|
29
|
+
* One hand edit after generation: `operator_token_account` in `operator_deposit`
|
|
30
|
+
* and `operator_withdraw` carries no `pda`. The program derives it as the ATA of
|
|
31
|
+
* the registered subaccount's stored `address`, or of the operator when there is
|
|
32
|
+
* none, which Anchor's IDL cannot express: the generated seed names the
|
|
33
|
+
* `subaccount` account itself, so Anchor would silently resolve the wrong ATA.
|
|
34
|
+
* Without the `pda`, callers must pass the account, and a missing one throws.
|
|
35
|
+
* Pinned by tests/adapters/solana-idl.test.ts; reapply it on every regeneration.
|
|
36
|
+
*
|
|
19
37
|
* Drift is guarded by tests/vaults/solana-idl-drift.test.ts: the deployed binary
|
|
20
38
|
* is pinned, every discriminator declared here must appear in that binary, and
|
|
21
39
|
* live VaultState accounts must decode against this file.
|
|
@@ -30,6 +48,10 @@ exports.vaultIdl = {
|
|
|
30
48
|
discriminator: [196, 210, 90, 231, 144, 149, 140, 63],
|
|
31
49
|
name: 'ProgramConfig',
|
|
32
50
|
},
|
|
51
|
+
{
|
|
52
|
+
discriminator: [205, 168, 49, 209, 131, 86, 56, 195],
|
|
53
|
+
name: 'Subaccount',
|
|
54
|
+
},
|
|
33
55
|
{
|
|
34
56
|
discriminator: [228, 196, 82, 165, 98, 210, 235, 152],
|
|
35
57
|
name: 'VaultState',
|
|
@@ -39,7 +61,7 @@ exports.vaultIdl = {
|
|
|
39
61
|
errors: [
|
|
40
62
|
{
|
|
41
63
|
code: 6000,
|
|
42
|
-
msg: 'Signer must be the
|
|
64
|
+
msg: 'Signer must be the operator',
|
|
43
65
|
name: 'NotOperator',
|
|
44
66
|
},
|
|
45
67
|
{
|
|
@@ -142,6 +164,51 @@ exports.vaultIdl = {
|
|
|
142
164
|
msg: 'Share offset must be a power of ten within the permitted range',
|
|
143
165
|
name: 'InvalidShareOffset',
|
|
144
166
|
},
|
|
167
|
+
{
|
|
168
|
+
code: 6021,
|
|
169
|
+
msg: "Signer is not this vault's withdrawal_queue_authority; holders request a withdrawal at the queue instead",
|
|
170
|
+
name: 'WithdrawalQueueRequired',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
code: 6022,
|
|
174
|
+
msg: "Queue must be this vault's initialized, queue-program-owned withdrawal-queue PDA",
|
|
175
|
+
name: 'InvalidWithdrawalQueueAuthority',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
code: 6023,
|
|
179
|
+
msg: 'The queue slot was signed by a key other than the attached queue',
|
|
180
|
+
name: 'WrongWithdrawalQueueSigner',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
code: 6024,
|
|
184
|
+
msg: 'A withdrawal queue is already attached; detach it before attaching again',
|
|
185
|
+
name: 'WithdrawalQueueAlreadyAttached',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
code: 6025,
|
|
189
|
+
msg: 'No withdrawal queue is attached to this vault',
|
|
190
|
+
name: 'WithdrawalQueueNotAttached',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
code: 6026,
|
|
194
|
+
msg: 'A subaccount must differ from the operator, belong to this vault, and be passed whenever the vault has any registered',
|
|
195
|
+
name: 'InvalidSubaccount',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
code: 6027,
|
|
199
|
+
msg: "The named address's ATA must have this vault approved as delegate, with an allowance covering the transfer",
|
|
200
|
+
name: 'SubaccountDelegationMissing',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
code: 6028,
|
|
204
|
+
msg: 'A subaccount still holds outstanding principal and cannot be deregistered',
|
|
205
|
+
name: 'SubaccountNotEmpty',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
code: 6029,
|
|
209
|
+
msg: 'A loss settlement may not exceed the principal that is not sitting at the destination',
|
|
210
|
+
name: 'LossExceedsShortfall',
|
|
211
|
+
},
|
|
145
212
|
],
|
|
146
213
|
events: [
|
|
147
214
|
{
|
|
@@ -152,6 +219,14 @@ exports.vaultIdl = {
|
|
|
152
219
|
discriminator: [6, 132, 68, 72, 106, 106, 131, 225],
|
|
153
220
|
name: 'WithdrawEvt',
|
|
154
221
|
},
|
|
222
|
+
{
|
|
223
|
+
discriminator: [215, 155, 176, 78, 69, 189, 182, 34],
|
|
224
|
+
name: 'WithdrawalQueueAttached',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
discriminator: [152, 26, 84, 125, 223, 150, 156, 122],
|
|
228
|
+
name: 'WithdrawalQueueDetached',
|
|
229
|
+
},
|
|
155
230
|
],
|
|
156
231
|
instructions: [
|
|
157
232
|
{
|
|
@@ -185,6 +260,41 @@ exports.vaultIdl = {
|
|
|
185
260
|
docs: ['New accepts the Admin Nomination', '### Parameters'],
|
|
186
261
|
name: 'accept_admin_nomination',
|
|
187
262
|
},
|
|
263
|
+
{
|
|
264
|
+
accounts: [
|
|
265
|
+
{
|
|
266
|
+
name: 'vault_state',
|
|
267
|
+
writable: true,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: 'deposit_mint',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: 'admin',
|
|
274
|
+
signer: true,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
docs: [
|
|
278
|
+
'This vault\'s queue PDA, `["withdrawal_queue", vault_state]` under the',
|
|
279
|
+
'hardcoded queue program, already initialized by that program.',
|
|
280
|
+
'',
|
|
281
|
+
],
|
|
282
|
+
name: 'queue',
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
args: [],
|
|
286
|
+
discriminator: [6, 130, 226, 67, 214, 208, 145, 212],
|
|
287
|
+
docs: [
|
|
288
|
+
"Admin attaches this vault's withdrawal queue.",
|
|
289
|
+
'',
|
|
290
|
+
"`queue` must be this vault's queue PDA under the hardcoded queue program,",
|
|
291
|
+
'already initialized there. Anything else is refused, because a stored key',
|
|
292
|
+
'nobody can sign for would freeze every exit. That PDA is a pure function',
|
|
293
|
+
'of the vault, so the instruction takes no key argument: there is exactly',
|
|
294
|
+
'one value it can store. A vault with a queue already attached is refused.',
|
|
295
|
+
],
|
|
296
|
+
name: 'attach_withdrawal_queue',
|
|
297
|
+
},
|
|
188
298
|
{
|
|
189
299
|
accounts: [
|
|
190
300
|
{
|
|
@@ -435,6 +545,84 @@ exports.vaultIdl = {
|
|
|
435
545
|
],
|
|
436
546
|
name: 'deposit_checked',
|
|
437
547
|
},
|
|
548
|
+
{
|
|
549
|
+
accounts: [
|
|
550
|
+
{
|
|
551
|
+
name: 'vault_state',
|
|
552
|
+
writable: true,
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
name: 'subaccount',
|
|
556
|
+
pda: {
|
|
557
|
+
seeds: [
|
|
558
|
+
{
|
|
559
|
+
kind: 'const',
|
|
560
|
+
value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
kind: 'account',
|
|
564
|
+
path: 'vault_state',
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
account: 'Subaccount',
|
|
568
|
+
kind: 'account',
|
|
569
|
+
path: 'subaccount.address',
|
|
570
|
+
},
|
|
571
|
+
],
|
|
572
|
+
},
|
|
573
|
+
writable: true,
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: 'deposit_mint',
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
name: 'admin',
|
|
580
|
+
signer: true,
|
|
581
|
+
writable: true,
|
|
582
|
+
},
|
|
583
|
+
],
|
|
584
|
+
args: [],
|
|
585
|
+
discriminator: [112, 91, 26, 5, 186, 249, 34, 151],
|
|
586
|
+
docs: [
|
|
587
|
+
'Remove a registered destination, refunding its rent. Admin only, and',
|
|
588
|
+
'only once its outstanding principal is zero. Removing the last one',
|
|
589
|
+
"returns the vault to the operator's own ATA.",
|
|
590
|
+
],
|
|
591
|
+
name: 'deregister_subaccount',
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
accounts: [
|
|
595
|
+
{
|
|
596
|
+
name: 'vault_state',
|
|
597
|
+
writable: true,
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
name: 'deposit_mint',
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: 'admin',
|
|
604
|
+
signer: true,
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
docs: [
|
|
608
|
+
'The attached queue, which must sign. The handler checks its key against',
|
|
609
|
+
'the stored authority.',
|
|
610
|
+
],
|
|
611
|
+
name: 'queue',
|
|
612
|
+
signer: true,
|
|
613
|
+
},
|
|
614
|
+
],
|
|
615
|
+
args: [],
|
|
616
|
+
discriminator: [58, 25, 112, 37, 254, 105, 157, 96],
|
|
617
|
+
docs: [
|
|
618
|
+
"Admin detaches this vault's withdrawal queue, restoring direct redemption.",
|
|
619
|
+
'',
|
|
620
|
+
'The attached queue must co-sign, which it does only from its',
|
|
621
|
+
'`release_vault`. The vault never reads queue state, so that signature is',
|
|
622
|
+
"how the queue's consent is expressed.",
|
|
623
|
+
],
|
|
624
|
+
name: 'detach_withdrawal_queue',
|
|
625
|
+
},
|
|
438
626
|
{
|
|
439
627
|
accounts: [
|
|
440
628
|
{
|
|
@@ -705,44 +893,56 @@ exports.vaultIdl = {
|
|
|
705
893
|
writable: true,
|
|
706
894
|
},
|
|
707
895
|
{
|
|
896
|
+
docs: [
|
|
897
|
+
"Source: a registered subaccount's ATA, else the operator's own. Keeps the",
|
|
898
|
+
'old name for wire compatibility.',
|
|
899
|
+
],
|
|
708
900
|
name: 'operator_token_account',
|
|
901
|
+
writable: true,
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
name: 'deposit_mint',
|
|
905
|
+
writable: true,
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
docs: [
|
|
909
|
+
'Still the operator: the destination changed, not who may move funds.',
|
|
910
|
+
],
|
|
911
|
+
name: 'operator',
|
|
912
|
+
signer: true,
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
name: 'token_program',
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
docs: [
|
|
919
|
+
"The source's registry entry, required exactly when the vault has",
|
|
920
|
+
'registrations. Its PDA binds it to this vault.',
|
|
921
|
+
'',
|
|
922
|
+
'**Last, and omittable.** Inserted mid-struct it would shift',
|
|
923
|
+
'`deposit_mint`, breaking every pre-registry operator call on upgrade.',
|
|
924
|
+
],
|
|
925
|
+
name: 'subaccount',
|
|
926
|
+
optional: true,
|
|
709
927
|
pda: {
|
|
710
|
-
program: {
|
|
711
|
-
kind: 'const',
|
|
712
|
-
value: [
|
|
713
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
714
|
-
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
715
|
-
219, 233, 248, 89,
|
|
716
|
-
],
|
|
717
|
-
},
|
|
718
928
|
seeds: [
|
|
719
929
|
{
|
|
720
|
-
kind: '
|
|
721
|
-
|
|
930
|
+
kind: 'const',
|
|
931
|
+
value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
|
|
722
932
|
},
|
|
723
933
|
{
|
|
724
934
|
kind: 'account',
|
|
725
|
-
path: '
|
|
935
|
+
path: 'vault_state',
|
|
726
936
|
},
|
|
727
937
|
{
|
|
938
|
+
account: 'Subaccount',
|
|
728
939
|
kind: 'account',
|
|
729
|
-
path: '
|
|
940
|
+
path: 'subaccount.address',
|
|
730
941
|
},
|
|
731
942
|
],
|
|
732
943
|
},
|
|
733
944
|
writable: true,
|
|
734
945
|
},
|
|
735
|
-
{
|
|
736
|
-
name: 'deposit_mint',
|
|
737
|
-
writable: true,
|
|
738
|
-
},
|
|
739
|
-
{
|
|
740
|
-
name: 'operator',
|
|
741
|
-
signer: true,
|
|
742
|
-
},
|
|
743
|
-
{
|
|
744
|
-
name: 'token_program',
|
|
745
|
-
},
|
|
746
946
|
],
|
|
747
947
|
args: [
|
|
748
948
|
{
|
|
@@ -754,7 +954,11 @@ exports.vaultIdl = {
|
|
|
754
954
|
docs: [
|
|
755
955
|
'Operator deposit funds in the Vault',
|
|
756
956
|
'',
|
|
757
|
-
|
|
957
|
+
"Get tokens in, from the named registered subaccount's ATA once the vault",
|
|
958
|
+
"has any, else the operator's own. From a subaccount the vault PDA — not",
|
|
959
|
+
'the operator — signs against the granted delegation; a missing or short',
|
|
960
|
+
'allowance fails `SubaccountDelegationMissing` (6027).',
|
|
961
|
+
'',
|
|
758
962
|
'### Parameters',
|
|
759
963
|
'- `amount` - The amount of tokens to get in the Vault',
|
|
760
964
|
],
|
|
@@ -802,44 +1006,53 @@ exports.vaultIdl = {
|
|
|
802
1006
|
writable: true,
|
|
803
1007
|
},
|
|
804
1008
|
{
|
|
1009
|
+
docs: [
|
|
1010
|
+
"Destination: a registered subaccount's ATA, else the operator's own.",
|
|
1011
|
+
'Keeps the old name for wire compatibility.',
|
|
1012
|
+
],
|
|
805
1013
|
name: 'operator_token_account',
|
|
1014
|
+
writable: true,
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
name: 'deposit_mint',
|
|
1018
|
+
writable: true,
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: 'operator',
|
|
1022
|
+
signer: true,
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
name: 'token_program',
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
docs: [
|
|
1029
|
+
"The destination's registry entry, required exactly when the vault has",
|
|
1030
|
+
'registrations. Its PDA binds it to this vault.',
|
|
1031
|
+
'',
|
|
1032
|
+
'**Last, and omittable.** Inserted mid-struct it would shift',
|
|
1033
|
+
'`deposit_mint`, breaking every pre-registry operator call on upgrade.',
|
|
1034
|
+
],
|
|
1035
|
+
name: 'subaccount',
|
|
1036
|
+
optional: true,
|
|
806
1037
|
pda: {
|
|
807
|
-
program: {
|
|
808
|
-
kind: 'const',
|
|
809
|
-
value: [
|
|
810
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
811
|
-
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
812
|
-
219, 233, 248, 89,
|
|
813
|
-
],
|
|
814
|
-
},
|
|
815
1038
|
seeds: [
|
|
816
1039
|
{
|
|
817
|
-
kind: '
|
|
818
|
-
|
|
1040
|
+
kind: 'const',
|
|
1041
|
+
value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
|
|
819
1042
|
},
|
|
820
1043
|
{
|
|
821
1044
|
kind: 'account',
|
|
822
|
-
path: '
|
|
1045
|
+
path: 'vault_state',
|
|
823
1046
|
},
|
|
824
1047
|
{
|
|
1048
|
+
account: 'Subaccount',
|
|
825
1049
|
kind: 'account',
|
|
826
|
-
path: '
|
|
1050
|
+
path: 'subaccount.address',
|
|
827
1051
|
},
|
|
828
1052
|
],
|
|
829
1053
|
},
|
|
830
1054
|
writable: true,
|
|
831
1055
|
},
|
|
832
|
-
{
|
|
833
|
-
name: 'deposit_mint',
|
|
834
|
-
writable: true,
|
|
835
|
-
},
|
|
836
|
-
{
|
|
837
|
-
name: 'operator',
|
|
838
|
-
signer: true,
|
|
839
|
-
},
|
|
840
|
-
{
|
|
841
|
-
name: 'token_program',
|
|
842
|
-
},
|
|
843
1056
|
],
|
|
844
1057
|
args: [
|
|
845
1058
|
{
|
|
@@ -851,7 +1064,12 @@ exports.vaultIdl = {
|
|
|
851
1064
|
docs: [
|
|
852
1065
|
'Operator withdraw funds from the Vault',
|
|
853
1066
|
'',
|
|
854
|
-
|
|
1067
|
+
"Get tokens out, to the named registered subaccount's ATA once the vault",
|
|
1068
|
+
"has any, else the operator's own; the account must already exist. The",
|
|
1069
|
+
"subaccount's delegation must cover its outstanding principal plus",
|
|
1070
|
+
'`amount`, else `SubaccountDelegationMissing` (6027). A wrong-party ATA',
|
|
1071
|
+
'fails `ConstraintTokenOwner` (2015); a non-derived token account, 2009.',
|
|
1072
|
+
'',
|
|
855
1073
|
'### Parameters',
|
|
856
1074
|
'- `amount` - The amount of tokens to get out of the Vault',
|
|
857
1075
|
],
|
|
@@ -1069,6 +1287,107 @@ exports.vaultIdl = {
|
|
|
1069
1287
|
],
|
|
1070
1288
|
name: 'redeem_checked',
|
|
1071
1289
|
},
|
|
1290
|
+
{
|
|
1291
|
+
accounts: [
|
|
1292
|
+
{
|
|
1293
|
+
name: 'vault_state',
|
|
1294
|
+
writable: true,
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
name: 'subaccount',
|
|
1298
|
+
pda: {
|
|
1299
|
+
seeds: [
|
|
1300
|
+
{
|
|
1301
|
+
kind: 'const',
|
|
1302
|
+
value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
kind: 'account',
|
|
1306
|
+
path: 'vault_state',
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
kind: 'arg',
|
|
1310
|
+
path: 'address',
|
|
1311
|
+
},
|
|
1312
|
+
],
|
|
1313
|
+
},
|
|
1314
|
+
writable: true,
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
name: 'deposit_mint',
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
docs: [
|
|
1321
|
+
"The address's ATA, carrying the delegation. Derived from `address`, so it",
|
|
1322
|
+
'cannot disagree with the argument.',
|
|
1323
|
+
],
|
|
1324
|
+
name: 'subaccount_ata',
|
|
1325
|
+
pda: {
|
|
1326
|
+
program: {
|
|
1327
|
+
kind: 'const',
|
|
1328
|
+
value: [
|
|
1329
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
1330
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
1331
|
+
219, 233, 248, 89,
|
|
1332
|
+
],
|
|
1333
|
+
},
|
|
1334
|
+
seeds: [
|
|
1335
|
+
{
|
|
1336
|
+
kind: 'arg',
|
|
1337
|
+
path: 'address',
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
kind: 'account',
|
|
1341
|
+
path: 'token_program',
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
kind: 'account',
|
|
1345
|
+
path: 'deposit_mint',
|
|
1346
|
+
},
|
|
1347
|
+
],
|
|
1348
|
+
},
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
name: 'token_program',
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
docs: [
|
|
1355
|
+
'Admin, not the operator. Where they are the same key this buys nothing.',
|
|
1356
|
+
],
|
|
1357
|
+
name: 'admin',
|
|
1358
|
+
signer: true,
|
|
1359
|
+
writable: true,
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
address: '11111111111111111111111111111111',
|
|
1363
|
+
name: 'system_program',
|
|
1364
|
+
},
|
|
1365
|
+
],
|
|
1366
|
+
args: [
|
|
1367
|
+
{
|
|
1368
|
+
name: 'address',
|
|
1369
|
+
type: 'pubkey',
|
|
1370
|
+
},
|
|
1371
|
+
],
|
|
1372
|
+
discriminator: [12, 219, 227, 235, 28, 220, 20, 220],
|
|
1373
|
+
docs: [
|
|
1374
|
+
'Register a permitted operator destination. Admin only. Once any exists,',
|
|
1375
|
+
"both operator transfers must name one and the operator's own ATA is",
|
|
1376
|
+
'refused.',
|
|
1377
|
+
'',
|
|
1378
|
+
"The address's ATA must already delegate to this vault",
|
|
1379
|
+
'(`approve(subaccount_ata, vault_state, n)`) — the only on-chain proof it',
|
|
1380
|
+
'can return funds. `n` also caps deployments to that destination, is spent',
|
|
1381
|
+
'down by returns, and SPL clears it at zero, so it needs re-granting per',
|
|
1382
|
+
'cycle; short or lapsed fails `SubaccountDelegationMissing` (6027). The',
|
|
1383
|
+
"first registration adopts the vault's outstanding principal and must",
|
|
1384
|
+
'cover it.',
|
|
1385
|
+
'',
|
|
1386
|
+
'### Parameters',
|
|
1387
|
+
'- `address` - The receiving address. Must not be the operator',
|
|
1388
|
+
],
|
|
1389
|
+
name: 'register_subaccount',
|
|
1390
|
+
},
|
|
1072
1391
|
{
|
|
1073
1392
|
accounts: [
|
|
1074
1393
|
{
|
|
@@ -1231,6 +1550,97 @@ exports.vaultIdl = {
|
|
|
1231
1550
|
],
|
|
1232
1551
|
name: 'set_withdrawal_fee',
|
|
1233
1552
|
},
|
|
1553
|
+
{
|
|
1554
|
+
accounts: [
|
|
1555
|
+
{
|
|
1556
|
+
name: 'vault_state',
|
|
1557
|
+
writable: true,
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: 'subaccount',
|
|
1561
|
+
pda: {
|
|
1562
|
+
seeds: [
|
|
1563
|
+
{
|
|
1564
|
+
kind: 'const',
|
|
1565
|
+
value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
kind: 'account',
|
|
1569
|
+
path: 'vault_state',
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
account: 'Subaccount',
|
|
1573
|
+
kind: 'account',
|
|
1574
|
+
path: 'subaccount.address',
|
|
1575
|
+
},
|
|
1576
|
+
],
|
|
1577
|
+
},
|
|
1578
|
+
writable: true,
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
name: 'deposit_mint',
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
docs: [
|
|
1585
|
+
'Read for its balance, to bound the write-down. Derived, so it cannot be',
|
|
1586
|
+
'substituted.',
|
|
1587
|
+
],
|
|
1588
|
+
name: 'subaccount_ata',
|
|
1589
|
+
pda: {
|
|
1590
|
+
program: {
|
|
1591
|
+
kind: 'const',
|
|
1592
|
+
value: [
|
|
1593
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
1594
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
1595
|
+
219, 233, 248, 89,
|
|
1596
|
+
],
|
|
1597
|
+
},
|
|
1598
|
+
seeds: [
|
|
1599
|
+
{
|
|
1600
|
+
account: 'Subaccount',
|
|
1601
|
+
kind: 'account',
|
|
1602
|
+
path: 'subaccount.address',
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
kind: 'account',
|
|
1606
|
+
path: 'token_program',
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
kind: 'account',
|
|
1610
|
+
path: 'deposit_mint',
|
|
1611
|
+
},
|
|
1612
|
+
],
|
|
1613
|
+
},
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
name: 'token_program',
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
name: 'admin',
|
|
1620
|
+
signer: true,
|
|
1621
|
+
},
|
|
1622
|
+
],
|
|
1623
|
+
args: [
|
|
1624
|
+
{
|
|
1625
|
+
name: 'amount',
|
|
1626
|
+
type: 'u64',
|
|
1627
|
+
},
|
|
1628
|
+
],
|
|
1629
|
+
discriminator: [0, 151, 152, 213, 157, 238, 7, 62],
|
|
1630
|
+
docs: [
|
|
1631
|
+
'Write down principal a destination will never return, after a realized',
|
|
1632
|
+
'loss. Admin only; the operator reducing principal would reopen',
|
|
1633
|
+
'deployment capacity.',
|
|
1634
|
+
'',
|
|
1635
|
+
'Bounded by `principal - ata.amount`, so funds still sitting there must be',
|
|
1636
|
+
'returned rather than written off. Leaves `deployed_aum` alone. Without',
|
|
1637
|
+
'this a vault that took a loss could never be closed.',
|
|
1638
|
+
'',
|
|
1639
|
+
'### Parameters',
|
|
1640
|
+
'- `amount` - Principal to write down',
|
|
1641
|
+
],
|
|
1642
|
+
name: 'settle_subaccount_loss',
|
|
1643
|
+
},
|
|
1234
1644
|
{
|
|
1235
1645
|
accounts: [
|
|
1236
1646
|
{
|
|
@@ -1442,6 +1852,45 @@ exports.vaultIdl = {
|
|
|
1442
1852
|
kind: 'struct',
|
|
1443
1853
|
},
|
|
1444
1854
|
},
|
|
1855
|
+
{
|
|
1856
|
+
name: 'Subaccount',
|
|
1857
|
+
type: {
|
|
1858
|
+
fields: [
|
|
1859
|
+
{
|
|
1860
|
+
docs: [
|
|
1861
|
+
'In the seeds, so it cannot be used against another vault; stored for',
|
|
1862
|
+
'`getProgramAccounts` indexing.',
|
|
1863
|
+
],
|
|
1864
|
+
name: 'vault_state',
|
|
1865
|
+
type: 'pubkey',
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
docs: ['The receiving address. Its ATA is where funds go.'],
|
|
1869
|
+
name: 'address',
|
|
1870
|
+
type: 'pubkey',
|
|
1871
|
+
},
|
|
1872
|
+
{
|
|
1873
|
+
docs: [
|
|
1874
|
+
'Principal sent here and not returned. Read by the coverage rule;',
|
|
1875
|
+
'deregistration requires zero.',
|
|
1876
|
+
],
|
|
1877
|
+
name: 'principal',
|
|
1878
|
+
type: 'u64',
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
name: 'bump',
|
|
1882
|
+
type: 'u8',
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
name: 'padding',
|
|
1886
|
+
type: {
|
|
1887
|
+
array: ['u64', 8],
|
|
1888
|
+
},
|
|
1889
|
+
},
|
|
1890
|
+
],
|
|
1891
|
+
kind: 'struct',
|
|
1892
|
+
},
|
|
1893
|
+
},
|
|
1445
1894
|
{
|
|
1446
1895
|
name: 'VaultState',
|
|
1447
1896
|
type: {
|
|
@@ -1526,18 +1975,76 @@ exports.vaultIdl = {
|
|
|
1526
1975
|
},
|
|
1527
1976
|
{
|
|
1528
1977
|
docs: [
|
|
1529
|
-
'
|
|
1530
|
-
'
|
|
1531
|
-
'
|
|
1978
|
+
'The only key permitted to redeem, or zero for "no queue".',
|
|
1979
|
+
'',
|
|
1980
|
+
'Zero is what every live vault reads — their padding is zeroed here, so the',
|
|
1981
|
+
'field arrives without a migration and redemption stays open to any holder.',
|
|
1982
|
+
"When set it holds this vault's withdrawal-queue PDA, and a direct holder",
|
|
1983
|
+
'redeem is refused with `WithdrawalQueueRequired` (6021).',
|
|
1984
|
+
'',
|
|
1985
|
+
'Two instructions write this field. `attach_withdrawal_queue` stores',
|
|
1986
|
+
"nothing but this vault's [`withdrawal_queue_pda`], and only while the field",
|
|
1987
|
+
'is zero. `detach_withdrawal_queue` clears it, and needs **both** the',
|
|
1988
|
+
"admin's signature and the stored key's. Both rules exist because a key",
|
|
1989
|
+
'nobody can sign for would freeze every exit permanently while deposits',
|
|
1990
|
+
'kept working.',
|
|
1991
|
+
'',
|
|
1992
|
+
'`close_vault` also clears it, by closing the whole account, behind its',
|
|
1993
|
+
'zero-supply and empty-reserve checks. Closing a gated vault is therefore an',
|
|
1994
|
+
'implicit detach.',
|
|
1995
|
+
'',
|
|
1996
|
+
'Read this field via [`Self::withdrawal_queue`] at every decision point.',
|
|
1997
|
+
"The only raw accesses are the two writers' own writes.",
|
|
1998
|
+
],
|
|
1999
|
+
name: 'withdrawal_queue_authority',
|
|
2000
|
+
type: 'pubkey',
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
docs: [
|
|
2004
|
+
'Registered operator destinations. Nonzero means operator transfers must',
|
|
2005
|
+
"name one; zero means the operator's own ATA.",
|
|
2006
|
+
'',
|
|
2007
|
+
'Zero on every vault created before the registry existed, so it arrives',
|
|
2008
|
+
'without a migration. A count rather than an address because the',
|
|
2009
|
+
'destination is always passed as a PDA — this only decides *whether* one',
|
|
2010
|
+
'is required. Its safety rests on the addresses being custody the',
|
|
2011
|
+
'operator cannot sweep, and on the admin being a different party from',
|
|
2012
|
+
'the operator. One address serves one vault per deposit mint, since an',
|
|
2013
|
+
'ATA has a single delegate slot.',
|
|
2014
|
+
],
|
|
2015
|
+
name: 'subaccount_count',
|
|
2016
|
+
type: 'u64',
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
docs: [
|
|
2020
|
+
'Total principal taken out and not returned, across destinations.',
|
|
2021
|
+
'',
|
|
2022
|
+
'Distinct from `deployed_aum`, which `operator_update_aum` marks with no',
|
|
2023
|
+
"tokens moving. Informational: coverage reads the destination's own",
|
|
2024
|
+
'`Subaccount::principal`, so nothing on-chain trusts this.',
|
|
2025
|
+
],
|
|
2026
|
+
name: 'deployed_principal',
|
|
2027
|
+
type: 'u64',
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
docs: [
|
|
2031
|
+
'Reserved. Carve new fields **out of** this array so `LEN` stays 455, the',
|
|
2032
|
+
'size of the live mainnet accounts — enforced by the `const` assertion below.',
|
|
2033
|
+
'',
|
|
2034
|
+
'**Declare a new field immediately before `padding`.** Anything inserted',
|
|
2035
|
+
'earlier shifts the fields after it silently, and each then reads zero:',
|
|
2036
|
+
'`share_offset` (199) re-prices the vault, `withdrawal_queue_authority`',
|
|
2037
|
+
'(207) reopens a gated vault, `subaccount_count` (239) reads as no',
|
|
2038
|
+
'subaccounts and pays the operator again, `deployed_principal` (247)',
|
|
2039
|
+
'reads as nothing owed. Pinned by the per-field',
|
|
2040
|
+
'`*_stays_at_its_byte_offset` tests plus',
|
|
2041
|
+
'`every_field_stays_at_its_byte_offset`.',
|
|
1532
2042
|
'',
|
|
1533
|
-
'
|
|
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.',
|
|
2043
|
+
'Shrinks in 8-byte steps only: it is an array of `u64`.',
|
|
1537
2044
|
],
|
|
1538
2045
|
name: 'padding',
|
|
1539
2046
|
type: {
|
|
1540
|
-
array: ['u64',
|
|
2047
|
+
array: ['u64', 25],
|
|
1541
2048
|
},
|
|
1542
2049
|
},
|
|
1543
2050
|
],
|
|
@@ -1572,6 +2079,40 @@ exports.vaultIdl = {
|
|
|
1572
2079
|
kind: 'struct',
|
|
1573
2080
|
},
|
|
1574
2081
|
},
|
|
2082
|
+
{
|
|
2083
|
+
docs: ['`queue` is the key now stored in `withdrawal_queue_authority`.'],
|
|
2084
|
+
name: 'WithdrawalQueueAttached',
|
|
2085
|
+
type: {
|
|
2086
|
+
fields: [
|
|
2087
|
+
{
|
|
2088
|
+
name: 'vault',
|
|
2089
|
+
type: 'pubkey',
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
name: 'queue',
|
|
2093
|
+
type: 'pubkey',
|
|
2094
|
+
},
|
|
2095
|
+
],
|
|
2096
|
+
kind: 'struct',
|
|
2097
|
+
},
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
docs: ['`queue` is the key that was stored, and has just been cleared.'],
|
|
2101
|
+
name: 'WithdrawalQueueDetached',
|
|
2102
|
+
type: {
|
|
2103
|
+
fields: [
|
|
2104
|
+
{
|
|
2105
|
+
name: 'vault',
|
|
2106
|
+
type: 'pubkey',
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
name: 'queue',
|
|
2110
|
+
type: 'pubkey',
|
|
2111
|
+
},
|
|
2112
|
+
],
|
|
2113
|
+
kind: 'struct',
|
|
2114
|
+
},
|
|
2115
|
+
},
|
|
1575
2116
|
],
|
|
1576
2117
|
};
|
|
1577
2118
|
//# sourceMappingURL=vault-idl.js.map
|