Skip to content

Commit

Permalink
solana: add instructionIndex to instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgroul committed Oct 29, 2024
1 parent df25b72 commit e83c294
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@subsquid/solana-normalization",
"comment": "add instructionIndex to instruction",
"type": "minor"
}
],
"packageName": "@subsquid/solana-normalization"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@subsquid/solana-stream",
"comment": "support instruction.instructionIndex field",
"type": "minor"
}
],
"packageName": "@subsquid/solana-stream"
}
1 change: 1 addition & 0 deletions solana/solana-normalization/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface AddressTableLookup {

export interface Instruction {
transactionIndex: number
instructionIndex: number
instructionAddress: number[]
programId: Base58Bytes
accounts: Base58Bytes[]
Expand Down
1 change: 1 addition & 0 deletions solana/solana-normalization/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ class InstructionParser {
}

let i: Instruction = {
instructionIndex: this.instructions.length,
transactionIndex: this.tx.transactionIndex,
instructionAddress: address,
programId: this.getAccount(src.programIdIndex),
Expand Down
1 change: 1 addition & 0 deletions solana/solana-stream/src/archive/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const getDataSchema = weakMemo((fields: FieldSelection) => {
transactionIndex: NAT,
instructionAddress: array(NAT),
...project(fields.instruction, {
instructionIndex: NAT,
programId: B58,
accounts: array(B58),
data: B58,
Expand Down

0 comments on commit e83c294

Please sign in to comment.