seahorse.ts 729 B

12345678910111213141516171819202122232425
  1. import * as anchor from "@coral-xyz/anchor";
  2. import { Program } from "@coral-xyz/anchor";
  3. import { 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(
  9. "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG"
  10. );
  11. it("Is initialized!", async () => {
  12. // Add your test here.
  13. const tx = await program.methods
  14. .getPythPrice()
  15. .accounts({
  16. pythPriceAccount: PYTH_PRICE_ACCOUNT,
  17. })
  18. .rpc();
  19. console.log("Your transaction signature", tx);
  20. });
  21. });