Add optional transactionIndex to getSignaturesForAddress response#1660
Merged
mcintyre94 merged 2 commits intoMay 19, 2026
Merged
Conversation
Agave 4.0 (anza-xyz/agave#9683) added the 0 based transaction index inside the block to each signature returned by getSignaturesForAddress. This change exposes the new field on the Kit response type as an optional property so callers can read it where available without breaking against older RPC servers that omit it.
🦋 Changeset detectedLatest commit: c635c14 The changes in this PR will be included in the next version bump. This PR includes changesets to release 47 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
BundleMonFiles updated (4)
Unchanged files (143)
Total files change +79B +0.01% Final result: ✅ View report in BundleMon website ➡️ |
This was referenced May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agave 4.0 added a 0 based transaction index inside the block to every signature returned by
getSignaturesForAddress(anza-xyz/agave#9683). The Kit response type does not currently expose this field, so callers that want to read it have to cast throughanyor define their own response shape. This change adds an optionaltransactionIndexproperty toGetSignaturesForAddressTransactionso that the new field is surfaced as soon as the RPC server provides it, without breaking compatibility with older servers that omit it.Background
The upstream Rust change adds the field on
RpcConfirmedTransactionStatusWithSignatureas:The combination of
defaultandskip_serializing_if = "Option::is_none"means the field can be missing from the JSON payload entirely when the server has nothing to report (or when an older server is in use). The TypeScript counterpart of that shape is an optionaltransactionIndex?: number, which is what this change adds.Before
Reading the field required a cast:
After
Reading it now type checks directly:
Tests
A new typetest in
packages/rpc-api/src/__typetests__/get-signatures-for-address-typetest.tscovers:signature,slot,blockTime,confirmationStatus,err,memo) remain on each response element with their existing types.transactionIndexis exposed asnumber | undefined.transactionIndexstill satisfies the response element type, which models the older RPC server case.Behavioral impact
None at runtime. The change is purely additive on the response type. Existing call sites that destructure or read other fields continue to compile without modification, and callers that already worked around the missing field with a cast can drop that cast.
Closes
Closes #1246