Skip to content

Commit

Permalink
refactor(experimental): sysvars package: instructions
Browse files Browse the repository at this point in the history
This commit introduces the `Instructions` sysvar to the `@solana/sysvars` package.

Note this sysvar does not exist on-chain, but can be provided to on-chain
programs for information about the currently executing instruction.
  • Loading branch information
buffalojoec authored Mar 14, 2024
1 parent 3e3cb89 commit c835722
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/sysvars/src/__tests__/sysvar-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ describe('sysvar account', () => {
});
});
});
// `Instructions` does not exist on-chain.
});
5 changes: 4 additions & 1 deletion packages/sysvars/src/sysvar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ export const SYSVAR_EPOCH_SCHEDULE_ADDRESS =
'SysvarEpochSchedu1e111111111111111111111111' as Address<'SysvarEpochSchedu1e111111111111111111111111'>;
export const SYSVAR_FEES_ADDRESS =
'SysvarFees111111111111111111111111111111111' as Address<'SysvarFees111111111111111111111111111111111'>;
export const SYSVAR_INSTRUCTIONS_ADDRESS =
'Sysvar1nstructions1111111111111111111111111' as Address<'Sysvar1nstructions1111111111111111111111111'>;

type SysvarAddress =
| typeof SYSVAR_CLOCK_ADDRESS
| typeof SYSVAR_EPOCH_REWARDS_ADDRESS
| typeof SYSVAR_EPOCH_SCHEDULE_ADDRESS
| typeof SYSVAR_FEES_ADDRESS;
| typeof SYSVAR_FEES_ADDRESS
| typeof SYSVAR_INSTRUCTIONS_ADDRESS;

/**
* Fetch an encoded sysvar account.
Expand Down

0 comments on commit c835722

Please sign in to comment.