feat: getTransfersByAddress method#41
Open
ChiefWoods wants to merge 3 commits into
Open
Conversation
ChiefWoods
force-pushed
the
feat/get-transfers-by-address
branch
3 times, most recently
from
July 14, 2026 07:55
487b69d to
ad012f7
Compare
ChiefWoods
force-pushed
the
feat/get-transfers-by-address
branch
from
July 14, 2026 07:56
ad012f7 to
258a9ae
Compare
ChiefWoods
marked this pull request as ready for review
July 14, 2026 07:57
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.
Adds support for the
getTransfersByAddressmethod, largely inspired by the Helius specification.On backwards compatibility
This implementation does not provide a 100% parity match with the Helius getTransferByAddress method. The responses returned from Helius are found to be inconsistent and does not strictly conform to their own specification. For this reason, this Superbank implementation is based on a modified specification detailed below.
Divergence from Helius' specification
solModesetting only affects response projection forTransferandTransferCheckedevents. It changes the mint and the presence offromTokenAccountandtoTokenAccountin the returned event:mergedreturns native SOL, whileseparatereturns the WSOL mint.wrapandunwrapevent types are not emitted. WSOL movement is represented through the coveredtransferandcloseAccountrows.fromTokenAccountandtoTokenAccountare omitted for native SOL transfer rows because token-account endpoints are not meaningful for those rows.paginationTokenis returned only when another matching page exists after applying all request filters and the current cursor. When absent ornull, the page is exhausted. Superbank uses its own documented cursor format rather than Helius' opaque 5- or 6-field token variants:slot:transactionIdx:instructionIdx:innerInstructionIdx:type.slotis the returned row's slot.transactionIdxis the returned row's transaction index within the slot.instructionIdxis Superbank's transfer event index used for ordering the materialized transfer rows.innerInstructionIdxis the inner instruction index recorded for the transfer event.typeis Superbank's public response transfer type, such astransfer,mint,burn,closeAccount,changeOwner, orwithdrawWithheldFee.The token points to the last row returned by the current page and must be interpreted with the same filter and sort parameters used to produce it.
amountand whether the account appears infromUserAccount,toUserAccount,fromTokenAccount, ortoTokenAccount.fromUserAccountandtoUserAccountrepresent either an authority/sender or recipient non-token account, andfromTokenAccountandtoTokenAccountrepresent the token accounts for which the sender and recipient are authorities.Token::InitializeAccount,Token::InitializeAccount2, andToken::InitializeAccount3do not have associated transfer events. Token account lifecycle lamport changes are represented bySystemProgram::CreateAccountandToken::CloseAccount.WithdraExcessLamports,UnwrapLamports) are represented as native SOL rows with the native SOL mint and 9 decimals.SystemProgram::Transferare not registered as events. For example, direct lamport subtraction from a PDA and addition to another address will not appear.Covered Instructions
SystemProgram::TransfertransferSystemProgram::TransferWithSeedtransferSystemProgram::WithdrawNonceAccounttransferSystemProgram::CreateAccounttransfertoUserAccountis the new account receiving lamports, not its eventual owner.SystemProgram::CreateAccountWithSeedtransfertoUserAccountis the new account receiving lamports, not its eventual owner.SystemProgram::CreateAccountAllowPrefundtransferToken::TransfertransferToken::TransferCheckedtransferToken-2022::TransfertransferToken-2022::TransferCheckedtransferToken-2022::TransferCheckedWithFeetransferfeeAmountrecords the withheld fee;amountrecords destination credit.Token::MintTomintToken::MintToCheckedmintToken::BurnburnToken::BurnCheckedburnToken::CloseAccounton WSOL with positive token balancecloseAccountfromUserAccountis the close authority andtoUserAccountis the rent receiver.Token::CloseAccountrent recoverycloseAccountfromUserAccountis the close authority andtoUserAccountis the rent receiver.Token::WithdrawExcessLamportstransferfromUserAccountis the authority,toUserAccountis the destination, andfromTokenAccountis the source account. Amount is inferred from the source lamport balance delta.Token::UnwrapLamports(Some(amount))transferfromUserAccountis the authority,toUserAccountis the destination, andfromTokenAccountis the source account. Amount is read from instruction data.Token::UnwrapLamports(None)closeAccountfromUserAccountis the authority,toUserAccountis the destination, andfromTokenAccountis the source account. Amount is the source account's full pre-token balance.Token::SetAuthority(AccountOwner)changeOwnerToken-2022::WithdrawWithheldTokensFromMintwithdrawWithheldFeeToken-2022::WithdrawWithheldTokensFromAccountswithdrawWithheldFeefromUserAccountis the withdraw authority. Amount is the collected withheld fee derived from destination token balance deltas.