seahorse.ts 731 B

1234567891011121314151617181920212223
  1. import * as anchor from '@coral-xyz/anchor';
  2. import type { Program } from '@coral-xyz/anchor';
  3. import type { Seahorse } from '../target/types/seahorse';
  4. describe('seahorse', () => {
  5. // Configure the client to use the local cluster.
  6. anchor.setProvider(anchor.AnchorProvider.env());
  7. const program = anchor.workspace.Seahorse as Program<Seahorse>;
  8. const PYTH_PRICE_ACCOUNT = new anchor.web3.PublicKey('H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG');
  9. it('Is initialized!', async () => {
  10. // Add your test here.
  11. const tx = await program.methods
  12. .getPythPrice()
  13. .accounts({
  14. pythPriceAccount: PYTH_PRICE_ACCOUNT,
  15. })
  16. .rpc();
  17. console.log('Your transaction signature', tx);
  18. });
  19. });