Skip to content
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 214 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 2 additions & 18 deletions clients/js/src/generated/instructions/authorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export function getAuthorizeDiscriminatorBytes() {
export type AuthorizeInstruction<
TProgram extends string = typeof STAKE_PROGRAM_ADDRESS,
TAccountStake extends string | AccountMeta<string> = string,
TAccountClockSysvar extends
| string
| AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111',
TAccountClockSysvar extends string | AccountMeta<string> = string,
TAccountAuthority extends string | AccountMeta<string> = string,
TAccountLockupAuthority extends
| string
Expand Down Expand Up @@ -129,13 +127,9 @@ export type AuthorizeInput<
TAccountAuthority extends string = string,
TAccountLockupAuthority extends string = string,
> = {
/** Stake account to be updated */
stake: Address<TAccountStake>;
/** Clock sysvar */
clockSysvar?: Address<TAccountClockSysvar>;
/** Stake or withdraw authority */
clockSysvar: Address<TAccountClockSysvar>;
authority: TransactionSigner<TAccountAuthority>;
/** Lockup authority */
lockupAuthority?: TransactionSigner<TAccountLockupAuthority>;
arg0: AuthorizeInstructionDataArgs['arg0'];
arg1: AuthorizeInstructionDataArgs['arg1'];
Expand Down Expand Up @@ -183,12 +177,6 @@ export function getAuthorizeInstruction<
// Original args.
const args = { ...input };

// Resolve default values.
if (!accounts.clockSysvar.value) {
accounts.clockSysvar.value =
'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>;
}

const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');
return Object.freeze({
accounts: [
Expand Down Expand Up @@ -216,13 +204,9 @@ export type ParsedAuthorizeInstruction<
> = {
programAddress: Address<TProgram>;
accounts: {
/** Stake account to be updated */
Copy link
Author

@rustopian rustopian Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Codama gen, I believe these comments would have to be added by a custom hand-written visitor for each instruction. I'm considering proposing a Codama feature that allows them to be generated just as Anchor did with desc on accounts, which would restore them here.

stake: TAccountMetas[0];
/** Clock sysvar */
clockSysvar: TAccountMetas[1];
/** Stake or withdraw authority */
authority: TAccountMetas[2];
/** Lockup authority */
lockupAuthority?: TAccountMetas[3] | undefined;
};
data: AuthorizeInstructionData;
Expand Down
22 changes: 2 additions & 20 deletions clients/js/src/generated/instructions/authorizeChecked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ export function getAuthorizeCheckedDiscriminatorBytes() {
export type AuthorizeCheckedInstruction<
TProgram extends string = typeof STAKE_PROGRAM_ADDRESS,
TAccountStake extends string | AccountMeta<string> = string,
TAccountClockSysvar extends
| string
| AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111',
TAccountClockSysvar extends string | AccountMeta<string> = string,
TAccountAuthority extends string | AccountMeta<string> = string,
TAccountNewAuthority extends string | AccountMeta<string> = string,
TAccountLockupAuthority extends
Expand Down Expand Up @@ -129,15 +127,10 @@ export type AuthorizeCheckedInput<
TAccountNewAuthority extends string = string,
TAccountLockupAuthority extends string = string,
> = {
/** Stake account to be updated */
stake: Address<TAccountStake>;
/** Clock sysvar */
clockSysvar?: Address<TAccountClockSysvar>;
/** The stake or withdraw authority */
clockSysvar: Address<TAccountClockSysvar>;
authority: TransactionSigner<TAccountAuthority>;
/** The new stake or withdraw authority */
newAuthority: TransactionSigner<TAccountNewAuthority>;
/** Lockup authority */
lockupAuthority?: TransactionSigner<TAccountLockupAuthority>;
stakeAuthorize: AuthorizeCheckedInstructionDataArgs['stakeAuthorize'];
};
Expand Down Expand Up @@ -188,12 +181,6 @@ export function getAuthorizeCheckedInstruction<
// Original args.
const args = { ...input };

// Resolve default values.
if (!accounts.clockSysvar.value) {
accounts.clockSysvar.value =
'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>;
}

const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');
return Object.freeze({
accounts: [
Expand Down Expand Up @@ -223,15 +210,10 @@ export type ParsedAuthorizeCheckedInstruction<
> = {
programAddress: Address<TProgram>;
accounts: {
/** Stake account to be updated */
stake: TAccountMetas[0];
/** Clock sysvar */
clockSysvar: TAccountMetas[1];
/** The stake or withdraw authority */
authority: TAccountMetas[2];
/** The new stake or withdraw authority */
newAuthority: TAccountMetas[3];
/** Lockup authority */
lockupAuthority?: TAccountMetas[4] | undefined;
};
data: AuthorizeCheckedInstructionData;
Expand Down
Loading