Skip to content

Commit 17e7f84

Browse files
committed
feat(starknet_getEvent): add transaction_index and event_index to emitted event context
To make creating unique IDs (like used by Voyager, that combines the block number, the transaction index, and the event index within the transaction) possible without additional JSON-RPC calls, this change adds two new indices to the context of emitted events: - `transaction_index` is the index of the transaction within the block that has emitted the event. - `event_index` is the index of the event within the transaction.
1 parent 3dc21ae commit 17e7f84

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

api/starknet_api_openrpc.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,9 +1114,21 @@
11141114
"title": "Transaction hash",
11151115
"description": "The transaction that emitted the event",
11161116
"$ref": "#/components/schemas/TXN_HASH"
1117+
},
1118+
"transaction_index": {
1119+
"title": "Transaction index",
1120+
"description": "The index of the transaction in the block by which the event was emitted",
1121+
"type": "integer",
1122+
"minimum": 0
1123+
},
1124+
"event_index": {
1125+
"title": "Event index",
1126+
"description": "The index of the event in the transaction by which it was emitted",
1127+
"type": "integer",
1128+
"minimum": 0
11171129
}
11181130
},
1119-
"required": ["transaction_hash"]
1131+
"required": ["transaction_hash", "transaction_index", "event_index"]
11201132
}
11211133
]
11221134
},

0 commit comments

Comments
 (0)