Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public final class Instruction

  1. Object
  2. Instruction
A call to an on-chain program: the program, the accounts it reads and writes, and its opaque instruction data. SystemProgram, TokenProgram and ComputeBudget build the common ones.

Constructors

public Instruction(SolanaAddress programId, List<AccountMeta> accounts, byte[] data)An instruction.
public Instruction(SolanaAddress programId, AccountMeta[] accounts, byte[] data)An instruction from an account array.

Methods

public SolanaAddress getProgramId()The program invoked.
public List<AccountMeta> getAccounts()The accounts, in the order the program expects them.
public byte[] getData()The instruction data, a copy.

Inherited methods

Constructor details

Instruction

public Instruction(SolanaAddress programId, List<AccountMeta> accounts, byte[] data)
An instruction.

Instruction

public Instruction(SolanaAddress programId, AccountMeta[] accounts, byte[] data)
An instruction from an account array.

Method details

getProgramId

public SolanaAddress getProgramId()
The program invoked.

getAccounts

public List<AccountMeta> getAccounts()
The accounts, in the order the program expects them.

getData

public byte[] getData()
The instruction data, a copy.