feat(DepositAddressHandler): send depositAddress and inputToken on execute - #3636
Merged
Conversation
…ecute The execute endpoint gained two new payload params. Relay both on every v3 execute: - `depositAddress`: the funded address being swept. The API resolves which contract generation the address belongs to from this rather than assuming the latest. - `inputToken`: the funding token. Without it the API falls back to origin-native USDC, which mis-routes any non-USDC sweep. Both come straight off the polled indexer item — `depositAddress` and `erc20Transfer.contractAddress` are required fields on the v3 `/deposit-address-transfers` projection (a row missing either is skipped server-side, never served), and both are forwarded verbatim so Tron stays base58 end-to-end. Neither field is gated. `inputToken` was previously behind ENABLE_EXECUTE_INPUT_TOKEN because an API predating the schema change 400s on an unknown param; that reason is gone now that every deployment accepts both (older contract generations parse and ignore them), so the flag is removed and one build is safe against every environment. ENABLE_EXECUTE_ERC20_TRANSFER_METADATA is untouched and stays gated. Also fixes a pre-existing failure in the tests this touches: the `SIGNER` literal was not EIP-55 checksummed, so it never matched the handler's `toAddressType().toNative()` output. Three request-shape assertions were red on master; the file is now green (50 passing). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzGPkq61Nh5zrpiXx3NY4R
amateima
requested review from
bmzig,
dijanin-brat,
mrice32,
nicholaspai and
pxrl
as code owners
July 27, 2026 21:23
bmzig
approved these changes
Jul 28, 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.
What
The
POST /deposit-addresses/executeendpoint gained new payload params. Relay two of them on every v3 execute:depositAddress— the funded address being swept. The API resolves which contract generation the address belongs to from this, instead of assuming the latest.inputToken— the funding token as{ chainId, address }. Without it the API falls back to origin-native USDC, which mis-routes any non-USDC sweep.Indexer data availability (checked before implementing)
Both values are already on the polled
/deposit-address-transfersitem, so nothing new is needed indexer-side:depositAddressdepositAddress(= transfer.to)inputToken.addresserc20Transfer.contractAddressBoth are non-optional on
DepositAddressTransferItemV3, and the indexer's v3 builder skips-and-warns any row missing a required durable field — so every served v3 item carries them. Both are forwarded verbatim, keeping Tron base58 end-to-end (the execute endpoint expects origin-chain-native encodings for origin fields).Why neither field is gated
inputTokenwas previously behindENABLE_EXECUTE_INPUT_TOKEN, because an API predating the schema change rejects an unknown param with400 INVALID_PARAM(superstructobject()is exact). That reason is gone: both fields are nowoptional()inExecuteRequestSchemaon quote-apimaster, accepted-and-ignored on older contract generations. One bot build is therefore safe against every environment, so the flag is removed rather than extended to cover the second field.ENABLE_EXECUTE_ERC20_TRANSFER_METADATAis untouched and stays gated.bridgeOverride— the third field the endpoint now accepts — is deliberately not wired up here. It is an ops escape hatch to force a bridge instead of letting the API route, and needs its own config surface.Config note
ENABLE_EXECUTE_INPUT_TOKEN: trueinbot-configs/serverless-bots/across-config-5m.jsonbecomes an unused key after this merges. Harmless (unknown env vars are ignored), but worth tidying in a bot-configs pass.Drive-by test fix
The
SIGNERliteral intest/DepositAddressHandler.tswas not EIP-55 checksummed, so it never matched the handler'stoAddressType().toNative()output. Three request-shape assertions were already red on master before this change; checksumming the constant fixes them.Verification
test/DepositAddressHandler.ts: 50 passing, 0 failing (master baseline: 48 passing, 3 failing — the checksum issue above).yarn lint: clean.yarn typecheck: the 3 pre-existingDataworker.ts/validateRootBundle.tspoolRebalanceLeafCounterrors are present identically on master and unrelated to these files; no new errors.🤖 Generated with Claude Code
https://claude.ai/code/session_01GzGPkq61Nh5zrpiXx3NY4R