algorandfoundation / algokit-subscriber-ts

Simple, but flexible / configurable Algorand transaction subscription / indexing mechanism
MIT License
14 stars 6 forks source link

feat: Added methodSignatures filter #19

Closed ericsharma closed 8 months ago

ericsharma commented 8 months ago

Proposed Changes

methodSignatures is of typestring[] and will be used to Filter to app transactions that match one of the given ARC-0004 method selectors as the first app argument.

I've found myself needing to filter app transactions that use one of a few different methods and thought it might be helpful for other to have.

Related Issue

18

robdmoore commented 8 months ago

This is awesome - thanks!

Any chance you can write an automated test for it? Here's what you can base it off: https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/tests/scenarios/filters.spec.ts#L417

ericsharma commented 8 months ago

Sure thing -- I added the extra method "call_abi(string)string" to methodSignatures array and confirmed the result was 2, however, the test I committed filters only 1 transaction to fit the general pattern of the spec

robdmoore commented 8 months ago

Amazing! Thankyou for the contribution!