Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 66cf3e9

Browse files
token-2022: update doc style for confidential extension instructions (#2961)
1 parent 2e1286b commit 66cf3e9

File tree

1 file changed

+103
-58
lines changed

1 file changed

+103
-58
lines changed

token/program-2022/src/extension/confidential_transfer/instruction.rs

Lines changed: 103 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub enum ConfidentialTransferInstruction {
3333
///
3434
/// Accounts expected by this instruction:
3535
///
36-
/// 0. `[writable]` The SPL Token mint
36+
/// 0. `[writable]` The SPL Token mint.
3737
///
3838
/// Data expected by this instruction:
3939
/// `ConfidentialTransferMint`
@@ -44,9 +44,9 @@ pub enum ConfidentialTransferInstruction {
4444
///
4545
/// Accounts expected by this instruction:
4646
///
47-
/// 0. `[writable]` The SPL Token mint
48-
/// 1. `[signer]` Confidential transfer mint authority
49-
/// 2. `[signer]` New confidential transfer mint authority
47+
/// 0. `[writable]` The SPL Token mint.
48+
/// 1. `[signer]` Confidential transfer mint authority.
49+
/// 2. `[signer]` New confidential transfer mint authority.
5050
///
5151
/// Data expected by this instruction:
5252
/// `ConfidentialTransferMint`
@@ -66,12 +66,16 @@ pub enum ConfidentialTransferInstruction {
6666
///
6767
/// Accounts expected by this instruction:
6868
///
69-
/// 0. `[writeable]` The SPL Token account
70-
/// 1. `[]` The corresponding SPL Token mint
71-
/// 2. `[signer]` The single source account owner
72-
/// or:
73-
/// 2. `[]` The multisig source account owner
74-
/// 3.. `[signer]` Required M signer accounts for the SPL Token Multisig account
69+
/// * Single owner/delegate
70+
/// 0. `[writeable]` The SPL Token account.
71+
/// 1. `[]` The corresponding SPL Token mint.
72+
/// 2. `[signer]` The single source account owner.
73+
///
74+
/// * Multisignature owner/delegate
75+
/// 0. `[writeable]` The SPL Token account.
76+
/// 1. `[]` The corresponding SPL Token mint.
77+
/// 2. `[]` The multisig source account owner.
78+
/// 3.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
7579
///
7680
/// Data expected by this instruction:
7781
/// `ConfigureAccountInstructionData`
@@ -87,9 +91,9 @@ pub enum ConfidentialTransferInstruction {
8791
///
8892
/// Accounts expected by this instruction:
8993
///
90-
/// 0. `[writable]` The SPL Token account to approve
91-
/// 1. `[]` The SPL Token mint
92-
/// 2. `[signer]` Confidential transfer auditor authority
94+
/// 0. `[writable]` The SPL Token account to approve.
95+
/// 1. `[]` The SPL Token mint.
96+
/// 2. `[signer]` Confidential transfer auditor authority.
9397
///
9498
/// Data expected by this instruction:
9599
/// None
@@ -105,13 +109,16 @@ pub enum ConfidentialTransferInstruction {
105109
/// prior to account closing if no instructions beyond
106110
/// `ConfidentialTransferInstruction::ConfigureAccount` have affected the token account.
107111
///
112+
/// * Single owner/delegate
113+
/// 0. `[writable]` The SPL Token account.
114+
/// 1. `[]` Instructions sysvar.
115+
/// 2. `[signer]` The single account owner.
108116
///
109-
/// 0. `[writable]` The SPL Token account
110-
/// 1. `[]` Instructions sysvar
111-
/// 2. `[signer]` The single account owner
112-
/// or:
113-
/// 2. `[]` The multisig account owner
114-
/// 3.. `[signer]` Required M signer accounts for the SPL Token Multisig account
117+
/// * Multisignature owner/delegate
118+
/// 0. `[writable]` The SPL Token account.
119+
/// 1. `[]` Instructions sysvar.
120+
/// 2. `[]` The multisig account owner.
121+
/// 3.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
115122
///
116123
/// Data expected by this instruction:
117124
/// `EmptyAccountInstructionData`
@@ -127,13 +134,18 @@ pub enum ConfidentialTransferInstruction {
127134
///
128135
/// Accounts expected by this instruction:
129136
///
130-
/// 0. `[writable]` The source SPL Token account
131-
/// 1. `[writable]` The destination SPL Token account with confidential transfers configured
137+
/// * Single owner/delegate
138+
/// 0. `[writable]` The source SPL Token account.
139+
/// 1. `[writable]` The destination SPL Token account with confidential transfers configured.
140+
/// 2. `[]` The token mint.
141+
/// 3. `[signer]` The single source account owner or delegate.
142+
///
143+
/// * Multisignature owner/delegate
144+
/// 0. `[writable]` The source SPL Token account.
145+
/// 1. `[writable]` The destination SPL Token account with confidential transfers configured.
132146
/// 2. `[]` The token mint.
133-
/// 3. `[signer]` The single source account owner or delegate
134-
/// or:
135147
/// 3. `[]` The multisig source account owner or delegate.
136-
/// 4.. `[signer]` Required M signer accounts for the SPL Token Multisig account
148+
/// 4.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
137149
///
138150
/// Data expected by this instruction:
139151
/// `DepositInstructionData`
@@ -146,14 +158,20 @@ pub enum ConfidentialTransferInstruction {
146158
///
147159
/// Accounts expected by this instruction:
148160
///
149-
/// 0. `[writable]` The source SPL Token account with confidential transfers configured
150-
/// 1. `[writable]` The destination SPL Token account
161+
/// * Single owner/delegate
162+
/// 0. `[writable]` The source SPL Token account with confidential transfers configured.
163+
/// 1. `[writable]` The destination SPL Token account.
164+
/// 2. `[]` The token mint.
165+
/// 3. `[]` Instructions sysvar.
166+
/// 4. `[signer]` The single source account owner.
167+
///
168+
/// * Multisignature owner/delegate
169+
/// 0. `[writable]` The source SPL Token account with confidential transfers configured.
170+
/// 1. `[writable]` The destination SPL Token account.
151171
/// 2. `[]` The token mint.
152-
/// 3. `[]` Instructions sysvar
153-
/// 4. `[signer]` The single source account owner
154-
/// or:
155-
/// 4. `[]` The multisig source account owner
156-
/// 5.. `[signer]` Required M signer accounts for the SPL Token Multisig account
172+
/// 3. `[]` Instructions sysvar.
173+
/// 4. `[]` The multisig source account owner.
174+
/// 5.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
157175
///
158176
/// Data expected by this instruction:
159177
/// `WithdrawInstructionData`
@@ -162,14 +180,20 @@ pub enum ConfidentialTransferInstruction {
162180

163181
/// Transfer tokens confidentially.
164182
///
165-
/// 1. `[writable]` The source SPL Token account
166-
/// 2. `[writable]` The destination SPL Token account
167-
/// 3. `[]` The token mint
168-
/// 4. `[]` Instructions sysvar
169-
/// 5. `[signer]` The single source account owner
170-
/// or:
171-
/// 5. `[]` The multisig source account owner
172-
/// 6.. `[signer]` Required M signer accounts for the SPL Token Multisig account
183+
/// * Single owner/delegate
184+
/// 1. `[writable]` The source SPL Token account.
185+
/// 2. `[writable]` The destination SPL Token account.
186+
/// 3. `[]` The token mint.
187+
/// 4. `[]` Instructions sysvar.
188+
/// 5. `[signer]` The single source account owner.
189+
///
190+
/// * Multisignature owner/delegate
191+
/// 1. `[writable]` The source SPL Token account.
192+
/// 2. `[writable]` The destination SPL Token account.
193+
/// 3. `[]` The token mint.
194+
/// 4. `[]` Instructions sysvar.
195+
/// 5. `[]` The multisig source account owner.
196+
/// 6.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
173197
///
174198
/// Data expected by this instruction:
175199
/// `TransferInstructionData`
@@ -188,11 +212,14 @@ pub enum ConfidentialTransferInstruction {
188212
///
189213
/// Account expected by this instruction:
190214
///
191-
/// 0. `[writable]` The SPL Token account
192-
/// 1. `[signer]` The single account owner
193-
/// or:
194-
/// 1. `[]` The multisig account owner
195-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig account
215+
/// * Single owner/delegate
216+
/// 0. `[writable]` The SPL Token account.
217+
/// 1. `[signer]` The single account owner.
218+
///
219+
/// * Multisignature owner/delegate
220+
/// 0. `[writable]` The SPL Token account.
221+
/// 1. `[]` The multisig account owner.
222+
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
196223
///
197224
/// Data expected by this instruction:
198225
/// `ApplyPendingBalanceData`
@@ -203,11 +230,14 @@ pub enum ConfidentialTransferInstruction {
203230
///
204231
/// Accounts expected by this instruction:
205232
///
206-
/// 0. `[writable]` The SPL Token account
207-
/// 1. `[signer]` Single authority
208-
/// or:
209-
/// 1. `[]` Multisig authority
210-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig account
233+
/// * Single owner/delegate
234+
/// 0. `[writable]` The SPL Token account.
235+
/// 1. `[signer]` Single authority.
236+
///
237+
/// * Multisignature owner/delegate
238+
/// 0. `[writable]` The SPL Token account.
239+
/// 1. `[]` Multisig authority.
240+
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
211241
///
212242
/// Data expected by this instruction:
213243
/// None
@@ -218,11 +248,14 @@ pub enum ConfidentialTransferInstruction {
218248
///
219249
/// Accounts expected by this instruction:
220250
///
221-
/// 0. `[writable]` The SPL Token account
222-
/// 1. `[signer]` The single account owner
223-
/// or:
224-
/// 1. `[]` The multisig account owner
225-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig account
251+
/// * Single owner/delegate
252+
/// 0. `[writable]` The SPL Token account.
253+
/// 1. `[signer]` The single account owner.
254+
///
255+
/// * Multisignature owner/delegate
256+
/// 0. `[writable]` The SPL Token account.
257+
/// 1. `[]` The multisig account owner.
258+
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig account.
226259
///
227260
/// Data expected by this instruction:
228261
/// None
@@ -234,12 +267,18 @@ pub enum ConfidentialTransferInstruction {
234267
///
235268
/// Accounts expected by this instruction:
236269
///
270+
/// * Single owner/delegate
237271
/// 0. `[writable]` The token mint. Must include the `TransferFeeConfig` extension.
238272
/// 1. `[writable]` The fee receiver account. Must include the `TransferFeeAmount` and
239273
/// `ConfidentialTransferAccount` extensions.
240-
/// 2. `[]` Instructions sysvar
274+
/// 2. `[]` Instructions sysvar.
241275
/// 3. `[signer]` The mint's `withdraw_withheld_authority`.
242-
/// or:
276+
///
277+
/// * Multisignature owner/delegate
278+
/// 0. `[writable]` The token mint. Must include the `TransferFeeConfig` extension.
279+
/// 1. `[writable]` The fee receiver account. Must include the `TransferFeeAmount` and
280+
/// `ConfidentialTransferAccount` extensions.
281+
/// 2. `[]` Instructions sysvar.
243282
/// 3. `[]` The mint's `withdraw_withheld_authority`'s multisignature owner/delegate.
244283
/// 4. ..3+M `[signer]` M signer accounts.
245284
///
@@ -269,13 +308,19 @@ pub enum ConfidentialTransferInstruction {
269308
///
270309
/// Accounts expected by this instruction:
271310
///
311+
/// * Single owner/delegate
272312
/// 0. `[]` The token mint. Must include the `TransferFeeConfig` extension.
273313
/// 1. `[writable]` The fee receiver account. Must include the `TransferFeeAmount` and
274314
/// `ConfidentialTransferAccount` extensions.
275-
/// 2. `[]` Instructions sysvar
315+
/// 2. `[]` Instructions sysvar.
276316
/// 3. `[signer]` The mint's `withdraw_withheld_authority`.
277317
/// 4. ..3+N `[writable]` The source accounts to withdraw from.
278-
/// or:
318+
///
319+
/// * Multisignature owner/delegate
320+
/// 0. `[]` The token mint. Must include the `TransferFeeConfig` extension.
321+
/// 1. `[writable]` The fee receiver account. Must include the `TransferFeeAmount` and
322+
/// `ConfidentialTransferAccount` extensions.
323+
/// 2. `[]` Instructions sysvar.
279324
/// 3. `[]` The mint's `withdraw_withheld_authority`'s multisignature owner/delegate.
280325
/// 4. ..4+M `[signer]` M signer accounts.
281326
/// 4+M+1. ..3+M+N `[writable]` The source accounts to withdraw from.

0 commit comments

Comments
 (0)