Skip to content

Add caller/transaction/log fields to EVM swaps and transaction/log fields to TVM swaps#443

Merged
DenisCarriere merged 6 commits intomainfrom
copilot/add-call-trx-log-fields
Mar 17, 2026
Merged

Add caller/transaction/log fields to EVM swaps and transaction/log fields to TVM swaps#443
DenisCarriere merged 6 commits intomainfrom
copilot/add-call-trx-log-fields

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

This updates /v1/evm and /v1/tvm swaps to expose the newer transaction/log metadata while preserving /v1 compatibility and TVM constraints. The scope is limited to ./swaps; no ./transfers changes are included.

  • Endpoint surface

    • Added new response fields for EVM swaps:
      • caller
      • call_index
      • transaction_index
      • transaction_from
      • log_ordinal
      • log_block_index
      • log_topic0
    • Added new response fields for TVM swaps:
      • transaction_index
      • transaction_from
      • log_ordinal
      • log_block_index
      • log_topic0
    • Kept TVM free of caller and call_* fields in the final API response.
  • Query/filter behavior

    • Added caller minute-prefilter support for EVM swaps using call_caller.
    • Added transaction_from minute-prefilter support for swaps via tx_from.
    • Kept TVM swap filters limited to supported/queryable semantics by accepting sender and transaction_from, while removing the misleading caller query param.
  • SQL routing

    • EVM swaps use the shared ./swaps/evm.sql with the new aliases projected from the underlying DB columns.
    • TVM swaps also reuse the shared ./swaps/evm.sql.
    • TVM-specific response shaping happens after the query, where unsupported caller / call_* fields are removed from the returned payload.
  • Schema/docs alignment

    • Updated OpenAPI response schemas and examples for the affected swap endpoints to include the new fields.
    • Updated the TVM swap query schema to remove caller.
    • Added focused regression coverage for:
      • EVM caller / transaction-from filter mapping
      • projected swap transaction/log aliases
      • TVM response stripping of unsupported caller / call_* fields
      • TVM query schema exclusion of caller
SELECT
    s.tx_index        AS transaction_index,
    s.tx_from         AS transaction_from,
    s.call_caller     AS caller,
    s.call_index      AS call_index,
    s.log_ordinal     AS log_ordinal,
    s.log_block_index AS log_block_index,
    s.log_topic0      AS log_topic0
FROM {db_dex:Identifier}.swaps s
Original prompt

This section details on the original issue you should resolve

<issue_title>Add call_* & trx_* & log_* fields to Swaps & Transfers for /evm & /tvm endpoints</issue_title>
<issue_description>Keeping backwards compatible /v1 endpoint.

Add the following fields once all the DB's support the new fields:

  • call_caller => caller
  • call_index
  • tx_index => transaction_index
  • trx_from => transaction_from
  • log_ordinal
  • log_block_index
  • log_index (already exists)
  • log_topic0

Note: call_* fields are not supported for TVM endpoints

Add minute filters for caller & transaction_from fields

Related: #294</issue_description>

Comments on the Issue (you are @copilot in this section)

@DenisCarriere `evm-transfers@v0.3.3` does not contain these fields @DenisCarriere Requires `evm-dex@v0.4.1`

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: DenisCarriere <550895+DenisCarriere@users.noreply.github.com>
Co-authored-by: DenisCarriere <550895+DenisCarriere@users.noreply.github.com>
Copilot AI changed the title [WIP] Add call, trx, and log fields to swaps and transfers Add caller/transaction/log fields to EVM and TVM swaps/transfers Mar 16, 2026
Copilot AI requested a review from DenisCarriere March 16, 2026 16:06
Copy link
Contributor

@DenisCarriere DenisCarriere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Do not make any changes to ./transfers (revert these changes)
  • Only make changes to ./swaps evm + tvm

For TVM

  • instead of creating a new SQL statement, let's keep re-using evm.sql
  • The fields exist on the DB, however they are all null/0
  • Add a post-query modifier to remove any caller + call_* fields from TVM swaps response

Co-authored-by: DenisCarriere <550895+DenisCarriere@users.noreply.github.com>
Co-authored-by: DenisCarriere <550895+DenisCarriere@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 16, 2026

  • Do not make any changes to ./transfers (revert these changes)
  • Only make changes to ./swaps evm + tvm
    ...

Addressed in 1aa2574. Transfers were reverted to their pre-change state, the swap work is now limited to EVM+TVM only, TVM swaps reuse the shared evm.sql, and the TVM route strips caller/call_* fields from the response after querying.

Copilot AI changed the title Add caller/transaction/log fields to EVM and TVM swaps/transfers Add caller/transaction/log fields to EVM and TVM swaps Mar 16, 2026
Copilot AI requested a review from DenisCarriere March 16, 2026 17:28
Copy link
Contributor

@DenisCarriere DenisCarriere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For TVM, let's remove caller as query param since we do not actually have the caller field in the data, it would be misleading to filter on this field and users would expect this would be available if they can filter on it.

  1. for TVM swaps remove caller from query param
  2. remove normalizeTvmSwapQueryParams since it won't be required

Co-authored-by: DenisCarriere <550895+DenisCarriere@users.noreply.github.com>
@YaroShkvorets YaroShkvorets temporarily deployed to copilot/add-call-trx-log-fields - token-api PR #443 March 16, 2026 18:45 — with Render Destroyed
Copy link
Contributor Author

Copilot AI commented Mar 16, 2026

For TVM, let's remove caller as query param since we do not actually have the caller field in the data, it would be misleading to filter on this field and users would expect this would be availabl...

Addressed in be2bd6a. TVM swaps no longer accept caller as a query param, and the normalizeTvmSwapQueryParams helper was removed.

Copilot AI changed the title Add caller/transaction/log fields to EVM and TVM swaps Add caller/transaction/log fields to EVM swaps and transaction/log fields to TVM swaps Mar 16, 2026
Copilot AI requested a review from DenisCarriere March 16, 2026 18:47
@DenisCarriere DenisCarriere marked this pull request as ready for review March 16, 2026 19:09
@DenisCarriere DenisCarriere merged commit 7e827cb into main Mar 17, 2026
2 checks passed
@DenisCarriere DenisCarriere deleted the copilot/add-call-trx-log-fields branch March 17, 2026 14:50
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.

Add call_* & trx_* & log_* fields to Swaps & Transfers for /evm & /tvm endpoints

3 participants