sysvars.js 559 B

12345678910111213141516171819
  1. const anchor = require('@project-serum/anchor');
  2. describe('sysvars', () => {
  3. // Configure the client to use the local cluster.
  4. anchor.setProvider(anchor.Provider.local());
  5. it('Is initialized!', async () => {
  6. const program = anchor.workspace.Sysvars;
  7. const tx = await program.rpc.sysvars({
  8. accounts: {
  9. clock: anchor.web3.SYSVAR_CLOCK_PUBKEY,
  10. rent: anchor.web3.SYSVAR_RENT_PUBKEY,
  11. stakeHistory: anchor.web3.SYSVAR_STAKE_HISTORY_PUBKEY,
  12. },
  13. });
  14. console.log("Your transaction signature", tx);
  15. });
  16. });