Skip to content

Commit

Permalink
Add rpc.CompiledInstruction{} type so that we can add to it the `St…
Browse files Browse the repository at this point in the history
…ackHeight` field without touching the `solana.CompiledInstruction` type.
  • Loading branch information
gagliardetto committed Jan 16, 2025
1 parent 9ab6f81 commit 39e2b98
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion rpc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,24 @@ type InnerInstruction struct {
Index uint16 `json:"index"`

// Ordered list of inner program instructions that were invoked during a single transaction instruction.
Instructions []solana.CompiledInstruction `json:"instructions"`
Instructions []CompiledInstruction `json:"instructions"`
}

type CompiledInstruction struct {
// Index into the message.accountKeys array indicating the program account that executes this instruction.
// NOTE: it is actually a uint8, but using a uint16 because uint8 is treated as a byte everywhere,
// and that can be an issue.
ProgramIDIndex uint16 `json:"programIdIndex"`

// List of ordered indices into the message.accountKeys array indicating which accounts to pass to the program.
// NOTE: it is actually a []uint8, but using a uint16 because []uint8 is treated as a []byte everywhere,
// and that can be an issue.
Accounts []uint16 `json:"accounts"`

// The program input data encoded in a base-58 string.
Data solana.Base58 `json:"data"`

StackHeight uint16 `json:"stackHeight"`
}

// Ok interface{} `json:"Ok"` // <null> Transaction was successful
Expand Down

0 comments on commit 39e2b98

Please sign in to comment.