acheron 1 год назад
Родитель
Сommit
51b21cebca
28 измененных файлов с 1 добавлено и 200 удалено
  1. 1 0
      CHANGELOG.md
  2. 0 5
      ts/packages/anchor/src/coder/index.ts
  3. 0 3
      ts/packages/spl-associated-token-account/src/coder/index.ts
  4. 0 12
      ts/packages/spl-associated-token-account/src/coder/state.ts
  5. 0 3
      ts/packages/spl-binary-option/src/coder/index.ts
  6. 0 12
      ts/packages/spl-binary-option/src/coder/state.ts
  7. 0 3
      ts/packages/spl-binary-oracle-pair/src/coder/index.ts
  8. 0 12
      ts/packages/spl-binary-oracle-pair/src/coder/state.ts
  9. 0 3
      ts/packages/spl-feature-proposal/src/coder/index.ts
  10. 0 12
      ts/packages/spl-feature-proposal/src/coder/state.ts
  11. 0 3
      ts/packages/spl-governance/src/coder/index.ts
  12. 0 12
      ts/packages/spl-governance/src/coder/state.ts
  13. 0 3
      ts/packages/spl-memo/src/coder/index.ts
  14. 0 12
      ts/packages/spl-memo/src/coder/state.ts
  15. 0 3
      ts/packages/spl-name-service/src/coder/index.ts
  16. 0 12
      ts/packages/spl-name-service/src/coder/state.ts
  17. 0 3
      ts/packages/spl-record/src/coder/index.ts
  18. 0 12
      ts/packages/spl-record/src/coder/state.ts
  19. 0 3
      ts/packages/spl-stake-pool/src/coder/index.ts
  20. 0 12
      ts/packages/spl-stake-pool/src/coder/state.ts
  21. 0 3
      ts/packages/spl-stateless-asks/src/coder/index.ts
  22. 0 12
      ts/packages/spl-stateless-asks/src/coder/state.ts
  23. 0 3
      ts/packages/spl-token-lending/src/coder/index.ts
  24. 0 12
      ts/packages/spl-token-lending/src/coder/state.ts
  25. 0 3
      ts/packages/spl-token-swap/src/coder/index.ts
  26. 0 12
      ts/packages/spl-token-swap/src/coder/state.ts
  27. 0 3
      ts/packages/spl-token/src/coder/index.ts
  28. 0 12
      ts/packages/spl-token/src/coder/state.ts

+ 1 - 0
CHANGELOG.md

@@ -85,6 +85,7 @@ The minor version will be incremented upon a breaking change and the patch versi
 - ts: Change the `Program` constructor's `idl` parameter type to `any` ([#3181](https://github.com/coral-xyz/anchor/pull/3181)).
 - lang, spl: Remove `borsh 0.9` support ([#3199](https://github.com/coral-xyz/anchor/pull/3199)).
 - ts: Upgrade `typescript` to `5.5.4` and remove the generic parameters of `SimulateResponse` ([#3221](https://github.com/coral-xyz/anchor/pull/3221)).
+- ts: Remove `StateCoder`([#3224](https://github.com/coral-xyz/anchor/pull/3224)).
 
 ## [0.30.1] - 2024-06-20
 

+ 0 - 5
ts/packages/anchor/src/coder/index.ts

@@ -29,11 +29,6 @@ export interface Coder<A extends string = string, T extends string = string> {
   readonly types: TypesCoder<T>;
 }
 
-export interface StateCoder {
-  encode<T = any>(name: string, account: T): Promise<Buffer>;
-  decode<T = any>(ix: Buffer): T;
-}
-
 export interface AccountsCoder<A extends string = string> {
   encode<T = any>(accountName: A, account: T): Promise<Buffer>;
   decode<T = any>(accountName: A, acc: Buffer): T;

+ 0 - 3
ts/packages/spl-associated-token-account/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplAssociatedTokenAccountAccountsCoder } from "./accounts";
 import { SplAssociatedTokenAccountEventsCoder } from "./events";
 import { SplAssociatedTokenAccountInstructionCoder } from "./instructions";
-import { SplAssociatedTokenAccountStateCoder } from "./state";
 import { SplAssociatedTokenAccountTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplAssociatedTokenAccountCoder implements Coder {
   readonly accounts: SplAssociatedTokenAccountAccountsCoder;
   readonly events: SplAssociatedTokenAccountEventsCoder;
   readonly instruction: SplAssociatedTokenAccountInstructionCoder;
-  readonly state: SplAssociatedTokenAccountStateCoder;
   readonly types: SplAssociatedTokenAccountTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplAssociatedTokenAccountAccountsCoder(idl);
     this.events = new SplAssociatedTokenAccountEventsCoder(idl);
     this.instruction = new SplAssociatedTokenAccountInstructionCoder(idl);
-    this.state = new SplAssociatedTokenAccountStateCoder(idl);
     this.types = new SplAssociatedTokenAccountTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-associated-token-account/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplAssociatedTokenAccountStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplAssociatedTokenAccount does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplAssociatedTokenAccount does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-binary-option/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplBinaryOptionAccountsCoder } from "./accounts";
 import { SplBinaryOptionEventsCoder } from "./events";
 import { SplBinaryOptionInstructionCoder } from "./instructions";
-import { SplBinaryOptionStateCoder } from "./state";
 import { SplBinaryOptionTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplBinaryOptionCoder implements Coder {
   readonly accounts: SplBinaryOptionAccountsCoder;
   readonly events: SplBinaryOptionEventsCoder;
   readonly instruction: SplBinaryOptionInstructionCoder;
-  readonly state: SplBinaryOptionStateCoder;
   readonly types: SplBinaryOptionTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplBinaryOptionAccountsCoder(idl);
     this.events = new SplBinaryOptionEventsCoder(idl);
     this.instruction = new SplBinaryOptionInstructionCoder(idl);
-    this.state = new SplBinaryOptionStateCoder(idl);
     this.types = new SplBinaryOptionTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-binary-option/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplBinaryOptionStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplBinaryOption does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplBinaryOption does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-binary-oracle-pair/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplBinaryOraclePairAccountsCoder } from "./accounts";
 import { SplBinaryOraclePairEventsCoder } from "./events";
 import { SplBinaryOraclePairInstructionCoder } from "./instructions";
-import { SplBinaryOraclePairStateCoder } from "./state";
 import { SplBinaryOraclePairTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplBinaryOraclePairCoder implements Coder {
   readonly accounts: SplBinaryOraclePairAccountsCoder;
   readonly events: SplBinaryOraclePairEventsCoder;
   readonly instruction: SplBinaryOraclePairInstructionCoder;
-  readonly state: SplBinaryOraclePairStateCoder;
   readonly types: SplBinaryOraclePairTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplBinaryOraclePairAccountsCoder(idl);
     this.events = new SplBinaryOraclePairEventsCoder(idl);
     this.instruction = new SplBinaryOraclePairInstructionCoder(idl);
-    this.state = new SplBinaryOraclePairStateCoder(idl);
     this.types = new SplBinaryOraclePairTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-binary-oracle-pair/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplBinaryOraclePairStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplBinaryOraclePair does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplBinaryOraclePair does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-feature-proposal/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplFeatureProposalAccountsCoder } from "./accounts";
 import { SplFeatureProposalEventsCoder } from "./events";
 import { SplFeatureProposalInstructionCoder } from "./instructions";
-import { SplFeatureProposalStateCoder } from "./state";
 import { SplFeatureProposalTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplFeatureProposalCoder implements Coder {
   readonly accounts: SplFeatureProposalAccountsCoder;
   readonly events: SplFeatureProposalEventsCoder;
   readonly instruction: SplFeatureProposalInstructionCoder;
-  readonly state: SplFeatureProposalStateCoder;
   readonly types: SplFeatureProposalTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplFeatureProposalAccountsCoder(idl);
     this.events = new SplFeatureProposalEventsCoder(idl);
     this.instruction = new SplFeatureProposalInstructionCoder(idl);
-    this.state = new SplFeatureProposalStateCoder(idl);
     this.types = new SplFeatureProposalTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-feature-proposal/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplFeatureProposalStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplFeatureProposal does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplFeatureProposal does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-governance/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplGovernanceAccountsCoder } from "./accounts";
 import { SplGovernanceEventsCoder } from "./events";
 import { SplGovernanceInstructionCoder } from "./instructions";
-import { SplGovernanceStateCoder } from "./state";
 import { SplGovernanceTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplGovernanceCoder implements Coder {
   readonly accounts: SplGovernanceAccountsCoder;
   readonly events: SplGovernanceEventsCoder;
   readonly instruction: SplGovernanceInstructionCoder;
-  readonly state: SplGovernanceStateCoder;
   readonly types: SplGovernanceTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplGovernanceAccountsCoder(idl);
     this.events = new SplGovernanceEventsCoder(idl);
     this.instruction = new SplGovernanceInstructionCoder(idl);
-    this.state = new SplGovernanceStateCoder(idl);
     this.types = new SplGovernanceTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-governance/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplGovernanceStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplGovernance does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplGovernance does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-memo/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplMemoAccountsCoder } from "./accounts";
 import { SplMemoEventsCoder } from "./events";
 import { SplMemoInstructionCoder } from "./instructions";
-import { SplMemoStateCoder } from "./state";
 import { SplMemoTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplMemoCoder implements Coder {
   readonly accounts: SplMemoAccountsCoder;
   readonly events: SplMemoEventsCoder;
   readonly instruction: SplMemoInstructionCoder;
-  readonly state: SplMemoStateCoder;
   readonly types: SplMemoTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplMemoAccountsCoder(idl);
     this.events = new SplMemoEventsCoder(idl);
     this.instruction = new SplMemoInstructionCoder(idl);
-    this.state = new SplMemoStateCoder(idl);
     this.types = new SplMemoTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-memo/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplMemoStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplMemo does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplMemo does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-name-service/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplNameServiceAccountsCoder } from "./accounts";
 import { SplNameServiceEventsCoder } from "./events";
 import { SplNameServiceInstructionCoder } from "./instructions";
-import { SplNameServiceStateCoder } from "./state";
 import { SplNameServiceTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplNameServiceCoder implements Coder {
   readonly accounts: SplNameServiceAccountsCoder;
   readonly events: SplNameServiceEventsCoder;
   readonly instruction: SplNameServiceInstructionCoder;
-  readonly state: SplNameServiceStateCoder;
   readonly types: SplNameServiceTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplNameServiceAccountsCoder(idl);
     this.events = new SplNameServiceEventsCoder(idl);
     this.instruction = new SplNameServiceInstructionCoder(idl);
-    this.state = new SplNameServiceStateCoder(idl);
     this.types = new SplNameServiceTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-name-service/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplNameServiceStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplNameService does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplNameService does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-record/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplRecordAccountsCoder } from "./accounts";
 import { SplRecordEventsCoder } from "./events";
 import { SplRecordInstructionCoder } from "./instructions";
-import { SplRecordStateCoder } from "./state";
 import { SplRecordTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplRecordCoder implements Coder {
   readonly accounts: SplRecordAccountsCoder;
   readonly events: SplRecordEventsCoder;
   readonly instruction: SplRecordInstructionCoder;
-  readonly state: SplRecordStateCoder;
   readonly types: SplRecordTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplRecordAccountsCoder(idl);
     this.events = new SplRecordEventsCoder(idl);
     this.instruction = new SplRecordInstructionCoder(idl);
-    this.state = new SplRecordStateCoder(idl);
     this.types = new SplRecordTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-record/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplRecordStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplRecord does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplRecord does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-stake-pool/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplStakePoolAccountsCoder } from "./accounts";
 import { SplStakePoolEventsCoder } from "./events";
 import { SplStakePoolInstructionCoder } from "./instructions";
-import { SplStakePoolStateCoder } from "./state";
 import { SplStakePoolTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplStakePoolCoder implements Coder {
   readonly accounts: SplStakePoolAccountsCoder;
   readonly events: SplStakePoolEventsCoder;
   readonly instruction: SplStakePoolInstructionCoder;
-  readonly state: SplStakePoolStateCoder;
   readonly types: SplStakePoolTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplStakePoolAccountsCoder(idl);
     this.events = new SplStakePoolEventsCoder(idl);
     this.instruction = new SplStakePoolInstructionCoder(idl);
-    this.state = new SplStakePoolStateCoder(idl);
     this.types = new SplStakePoolTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-stake-pool/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplStakePoolStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplStakePool does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplStakePool does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-stateless-asks/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplStatelessAsksAccountsCoder } from "./accounts";
 import { SplStatelessAsksEventsCoder } from "./events";
 import { SplStatelessAsksInstructionCoder } from "./instructions";
-import { SplStatelessAsksStateCoder } from "./state";
 import { SplStatelessAsksTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplStatelessAsksCoder implements Coder {
   readonly accounts: SplStatelessAsksAccountsCoder;
   readonly events: SplStatelessAsksEventsCoder;
   readonly instruction: SplStatelessAsksInstructionCoder;
-  readonly state: SplStatelessAsksStateCoder;
   readonly types: SplStatelessAsksTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplStatelessAsksAccountsCoder(idl);
     this.events = new SplStatelessAsksEventsCoder(idl);
     this.instruction = new SplStatelessAsksInstructionCoder(idl);
-    this.state = new SplStatelessAsksStateCoder(idl);
     this.types = new SplStatelessAsksTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-stateless-asks/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplStatelessAsksStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplStatelessAsks does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplStatelessAsks does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-token-lending/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplTokenLendingAccountsCoder } from "./accounts";
 import { SplTokenLendingEventsCoder } from "./events";
 import { SplTokenLendingInstructionCoder } from "./instructions";
-import { SplTokenLendingStateCoder } from "./state";
 import { SplTokenLendingTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplTokenLendingCoder implements Coder {
   readonly accounts: SplTokenLendingAccountsCoder;
   readonly events: SplTokenLendingEventsCoder;
   readonly instruction: SplTokenLendingInstructionCoder;
-  readonly state: SplTokenLendingStateCoder;
   readonly types: SplTokenLendingTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplTokenLendingAccountsCoder(idl);
     this.events = new SplTokenLendingEventsCoder(idl);
     this.instruction = new SplTokenLendingInstructionCoder(idl);
-    this.state = new SplTokenLendingStateCoder(idl);
     this.types = new SplTokenLendingTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-token-lending/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplTokenLendingStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplTokenLending does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplTokenLending does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-token-swap/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplTokenSwapAccountsCoder } from "./accounts";
 import { SplTokenSwapEventsCoder } from "./events";
 import { SplTokenSwapInstructionCoder } from "./instructions";
-import { SplTokenSwapStateCoder } from "./state";
 import { SplTokenSwapTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplTokenSwapCoder implements Coder {
   readonly accounts: SplTokenSwapAccountsCoder;
   readonly events: SplTokenSwapEventsCoder;
   readonly instruction: SplTokenSwapInstructionCoder;
-  readonly state: SplTokenSwapStateCoder;
   readonly types: SplTokenSwapTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplTokenSwapAccountsCoder(idl);
     this.events = new SplTokenSwapEventsCoder(idl);
     this.instruction = new SplTokenSwapInstructionCoder(idl);
-    this.state = new SplTokenSwapStateCoder(idl);
     this.types = new SplTokenSwapTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-token-swap/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplTokenSwapStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplTokenSwap does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplTokenSwap does not have state");
-  }
-}

+ 0 - 3
ts/packages/spl-token/src/coder/index.ts

@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
 import { SplTokenAccountsCoder } from "./accounts";
 import { SplTokenEventsCoder } from "./events";
 import { SplTokenInstructionCoder } from "./instructions";
-import { SplTokenStateCoder } from "./state";
 import { SplTokenTypesCoder } from "./types";
 
 /**
@@ -13,14 +12,12 @@ export class SplTokenCoder implements Coder {
   readonly accounts: SplTokenAccountsCoder;
   readonly events: SplTokenEventsCoder;
   readonly instruction: SplTokenInstructionCoder;
-  readonly state: SplTokenStateCoder;
   readonly types: SplTokenTypesCoder;
 
   constructor(idl: Idl) {
     this.accounts = new SplTokenAccountsCoder(idl);
     this.events = new SplTokenEventsCoder(idl);
     this.instruction = new SplTokenInstructionCoder(idl);
-    this.state = new SplTokenStateCoder(idl);
     this.types = new SplTokenTypesCoder(idl);
   }
 }

+ 0 - 12
ts/packages/spl-token/src/coder/state.ts

@@ -1,12 +0,0 @@
-import { Idl, StateCoder } from "@coral-xyz/anchor";
-
-export class SplTokenStateCoder implements StateCoder {
-  constructor(_idl: Idl) {}
-
-  encode<T = any>(_name: string, _account: T): Promise<Buffer> {
-    throw new Error("SplToken does not have state");
-  }
-  decode<T = any>(_ix: Buffer): T {
-    throw new Error("SplToken does not have state");
-  }
-}