1234567891011121314151617181920212223242526 |
- // @ts-nocheck
- import { Idl, InstructionCoder } from "@coral-xyz/anchor";
- export class SplMemoInstructionCoder implements InstructionCoder {
- constructor(_idl: Idl) {}
- encode(ixName: string, ix: any): Buffer {
- switch (ixName) {
- case "addMemo": {
- return encodeAddMemo(ix);
- }
- default: {
- throw new Error(`Invalid instruction: ${ixName}`);
- }
- }
- }
- encodeState(_ixName: string, _ix: any): Buffer {
- throw new Error("SplMemo does not have state");
- }
- }
- function encodeAddMemo({ memo }: any): Buffer {
- return Buffer.from(memo);
- }
|