Skip to content

feat(deposit-address): relay integratorId into v3 execute request#3498

Merged
amateima merged 1 commit into
masterfrom
deposit-address-v3-integrator-id
Jun 17, 2026
Merged

feat(deposit-address): relay integratorId into v3 execute request#3498
amateima merged 1 commit into
masterfrom
deposit-address-v3-integrator-id

Conversation

@amateima

Copy link
Copy Markdown
Contributor

Summary

The indexer now exposes integrator attribution on each /deposit-address-transfers item (across-protocol/indexer#1055), and the quote-api v3 execute endpoint POST /deposit-addresses/execute now takes a required integratorId (2-byte hex, ^0x[0-9a-fA-F]{4}$) that folds into the CREATE2 salt + on-chain integrator tag — so v3 deposit addresses are derived per-integrator (across-protocol/quote-api#2807).

This PR pulls integrator.integratorId from the indexer message and relays it verbatim to the execute endpoint.

Behavior

  • Relay verbatim: the bot sends the indexer-sourced integratorId (not its own auth key — it sweeps addresses owned by many integrators).
  • Missing/malformed → skip + warn, no API call: there are no funded/final v3 addresses pre-integrator (sponsored leaf still placeholder), so every real future v3 transfer carries a valid id. A missing one is a data anomaly, and sending it would only derive a different, unfunded address — so we guard before calling the API, mirroring the existing namespace guard.

Changes

  • src/interfaces/DepositAddress.ts — new DepositAddressIntegrator type mirroring the indexer DTO; optional integrator field on both v1 and v3 message interfaces (optional for rollout safety).
  • src/clients/AcrossSwapApiClient.ts — required integratorId on DepositAddressExecuteRequest.
  • src/deposit-address/DepositAddressHandler.tsINTEGRATOR_ID_REGEX constant; skip+warn guard in initiateDepositV3; validated integratorId relayed from _getExecuteTx (with an assert safety net so the required field narrows to string).
  • test/DepositAddressHandler.ts — extended the v3 fixture, asserted integratorId in the request-mapping test, and added 4 guard cases (integrator null, integratorId null, non-hex, wrong length).
  • src/deposit-address/README.md — documented the relay + guard in the v3 execute flow.

Testing

  • yarn build — clean.
  • RELAYER_TEST=true yarn hardhat test test/DepositAddressHandler.ts — 20 passing, including the updated mapping test and the 4 new guard cases.
  • ESLint clean on touched files.

🤖 Generated with Claude Code

The indexer's /deposit-address-transfers endpoint now exposes integrator
attribution on each item, and the quote-api v3 execute endpoint
(POST /deposit-addresses/execute) now requires an integratorId (2-byte hex)
that folds into the CREATE2 salt + on-chain integrator tag, so v3 addresses
are derived per-integrator.

Pull integrator.integratorId from the indexer message and relay it verbatim
to the execute endpoint. When it's absent or malformed, skip + warn rather
than call the API: no funded v3 addresses exist pre-integrator, so a missing
id is a data anomaly, and sending one would only derive a different, unfunded
address.

- Add DepositAddressIntegrator type + optional integrator field on both v1
  and v3 message interfaces.
- Add required integratorId to DepositAddressExecuteRequest.
- Guard initiateDepositV3 on a validated 2-byte-hex integratorId; relay it
  from _getExecuteTx.
- Tests: extend the v3 fixture, assert integratorId in the request mapping,
  and cover the four skip cases.
- Document the relay + guard in the deposit-address README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amateima

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 6473067f96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@amateima amateima merged commit eb3cbe5 into master Jun 17, 2026
5 checks passed
@amateima amateima deleted the deposit-address-v3-integrator-id branch June 17, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants