Last active
May 31, 2023 17:13
-
-
Save svanas/d1c66c21e8793f7b264e533abc199aae to your computer and use it in GitHub Desktop.
Listen to swaps between two tokens on Balancer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const client: IWeb3 = TWeb3.Create( | |
web3.eth.infura.endpoint(web3.Ethereum, INFURA_PROJECT_ID).Value | |
); | |
const task = web3.eth.balancer.v2.listen( | |
client, | |
procedure( | |
blockNo : BigInteger; | |
poolId : TBytes32; | |
tokenIn : TAddress; | |
tokenOut : TAddress; | |
amountIn : BigInteger; | |
amountOut: BigInteger) | |
begin | |
// a swap between two tokens happened | |
end); | |
task.Start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment