shovel-config-ts: update types to match documentation #279
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.
I was attempting to use @indexsupply/shovel-config to make a shovel config in TypeScript but was running into type errors.
Upon further investigation, it appeared that the TypeScript types in the
shovel-config-ts
subproject were out of date with the current version of theshovel
indexer in the repo. Specifically:Some of the block data options in
dig.go
were not present in theBlockDataOptions
type in Typescript (e.g.tx_contract_address
,tx_max_priority_fee_per_gas
):shovel/dig/dig.go
Lines 896 to 962 in cb9264e
shovel/shovel-config-ts/src/index.ts
Lines 52 to 73 in cb9264e
The
FilterOp
type was missing the filter ops corresponding to a config withfilter_arg
, as outlined in the docs under the "Filter Fields" section: https://indexsupply.com/shovel/docs/#filter-fieldsTo fix this, I added the missing options to the TypeScript types. I also added the
bun install
command to the build instructions, as the build was failing when I initially cloned the repo to test locally since I hadn't installed any of the dependencies.When testing my shovel config with the updated types in this PR, the type errors were no longer present.