Options
All
  • Public
  • Public/Protected
  • All
Menu

Encodes and decodes account objects.

Type Parameters

  • A extends string = string

Hierarchy

  • BorshAccountsCoder

Implements

Index

Constructors

Methods

  • accountDiscriminator(name: string): Buffer
  • Calculates and returns a unique 8 byte discriminator prepended to all anchor accounts.

    Parameters

    • name: string

      The name of the account to calculate the discriminator.

    Returns Buffer

  • decode<T>(accountName: A, data: Buffer): T
  • decodeAny<T>(data: Buffer): T
  • decodeUnchecked<T>(accountName: A, acc: Buffer): T
  • encode<T>(accountName: A, account: T): Promise<Buffer>
  • memcmp(accountName: A, appendData?: Buffer): any
  • size(accountName: A): number

Generated using TypeDoc