index.ts 955 B

1234567891011121314151617181920212223242526
  1. import { Idl, Coder } from "@coral-xyz/anchor";
  2. import { SplGovernanceAccountsCoder } from "./accounts";
  3. import { SplGovernanceEventsCoder } from "./events";
  4. import { SplGovernanceInstructionCoder } from "./instructions";
  5. import { SplGovernanceStateCoder } from "./state";
  6. import { SplGovernanceTypesCoder } from "./types";
  7. /**
  8. * Coder for SplGovernance
  9. */
  10. export class SplGovernanceCoder implements Coder {
  11. readonly accounts: SplGovernanceAccountsCoder;
  12. readonly events: SplGovernanceEventsCoder;
  13. readonly instruction: SplGovernanceInstructionCoder;
  14. readonly state: SplGovernanceStateCoder;
  15. readonly types: SplGovernanceTypesCoder;
  16. constructor(idl: Idl) {
  17. this.accounts = new SplGovernanceAccountsCoder(idl);
  18. this.events = new SplGovernanceEventsCoder(idl);
  19. this.instruction = new SplGovernanceInstructionCoder(idl);
  20. this.state = new SplGovernanceStateCoder(idl);
  21. this.types = new SplGovernanceTypesCoder(idl);
  22. }
  23. }