Skip to content

Commit e83c294

Browse files
committed
solana: add instructionIndex to instruction
1 parent df25b72 commit e83c294

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@subsquid/solana-normalization",
5+
"comment": "add instructionIndex to instruction",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@subsquid/solana-normalization"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@subsquid/solana-stream",
5+
"comment": "support instruction.instructionIndex field",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@subsquid/solana-stream"
10+
}

solana/solana-normalization/src/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface AddressTableLookup {
4646

4747
export interface Instruction {
4848
transactionIndex: number
49+
instructionIndex: number
4950
instructionAddress: number[]
5051
programId: Base58Bytes
5152
accounts: Base58Bytes[]

solana/solana-normalization/src/mapping.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ class InstructionParser {
397397
}
398398

399399
let i: Instruction = {
400+
instructionIndex: this.instructions.length,
400401
transactionIndex: this.tx.transactionIndex,
401402
instructionAddress: address,
402403
programId: this.getAccount(src.programIdIndex),

solana/solana-stream/src/archive/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const getDataSchema = weakMemo((fields: FieldSelection) => {
6060
transactionIndex: NAT,
6161
instructionAddress: array(NAT),
6262
...project(fields.instruction, {
63+
instructionIndex: NAT,
6364
programId: B58,
6465
accounts: array(B58),
6566
data: B58,

0 commit comments

Comments
 (0)