hirosystems / stacks-blockchain-api

API for the Stacks blockchain
https://stacks-blockchain-api.vercel.app
GNU General Public License v3.0
172 stars 111 forks source link

Add function name filtering to `/extended/v1/tx` #1999

Closed zone117x closed 3 months ago

zone117x commented 3 months ago

Related issue: https://github.com/hirosystems/explorer/issues/964

Add query params to the tx list endpoint that filter by contract-call function_name. This would implicitly filter for only contract_call type transactions.

The query param could require the fully qualified contract id + function name -- something like: /tx?=function_name=SP000000000000000000002Q6VF78.pox-4.delegate-stx

... or it could be broken up to allow filter by contract id and/or function name, like /tx?contract_id=SP000000000000000000002Q6VF78.pox-4&function_name=delegate-stx

The latter probably makes more sense because it's more flexible, and also I'm not aware of a convention for a "fully qualified function name". E.g. in Clarity these are broken up as separate arguments (contract-call? 'SP000000000000000000002Q6VF78.pox-4 delegate-stx ...)