Implements

  • RpcAccountModification

Constructors

Properties

_data?: Uint8Array
_executable?: boolean
_lamports?: bigint
_owner?: string
_rentEpoch?: bigint
accountAddress: string

Accessors

  • get executable(): undefined | boolean
  • Returns undefined | boolean

Methods

  • Sets the data for the account.

    In some cases it is important to ensure the data has a specific size. As an example anchor's program.coder.encode() will encode the data but not ensure it has a compatible size

    In that case one has to do the following, assuming we're encoding a Game account that is defined at index 0 in the IDL accounts array:

    const data = await program.coder.accounts.encode('Game', gameState)
    const gameAccountDef = program.idl.accounts[0]
    const size = program.coder.accounts.size(gameAccountDef)
    return luzid.mutator.modifyAccount(
    AccountModification.forAddr(gameKeypair.publicKey.toBase58()).setData(
    data,
    { size }
    )
    )

    Parameters

    • data: Uint8Array

      the data to set

    • Optional opts: {
          size?: number;
      }

      optional parameters

      • Optional size?: number

    Returns AccountModificationBuilder

  • Parameters

    • executable: boolean

    Returns AccountModificationBuilder

  • Parameters

    • accountAddress: string

    Returns AccountModificationBuilder

Generated using TypeDoc