Skip to content

parameter hookData in v4 universal router v4 pool swaps. #94

Answered by Elnaril
snarflakes asked this question in Q&A
Discussion options

You must be logged in to vote

@snarflakes
The hook data can already be passed to the v4 function swap_exact_in_single(), exactly where you imagine it would go.

I agree that the README/doc does not show all possibilities. It's intentional as this page is already a bit overloaded. But there is a docstring for each function that is part of the lib API, clarifying their purpose and arguments.
Here for swap_exact_in_single() :

>>> help(codec.encode.chain().v4_swap().swap_exact_in_single)

Help on method swap_exact_in_single in module uniswap_universal_router_decoder._encoder:

swap_exact_in_single(pool_key: 'PoolKey', zero_for_one: 'bool', amount_in: 'Wei', amount_out_min: 'Wei', hook_data: 'bytes' = b'') -> '_V4ChainedSwa…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Elnaril
Comment options

Answer selected by snarflakes
Comment options

You must be logged in to vote
1 reply
@Elnaril
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants