-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Use case: for interacting with a factory contract, we'd like to waitForTransactionReceipt and then grab the newly deployed contract's address from the events.
This is possible via viem directly, as the return object for waitForTransactionReceipt contains the logs array and we can easily filter & get our target event and its params.
But that's missing in the drift package.
For now I had to create a separate viem publicClient instance: https://github.com/flayerlabs/flaunch-sdk/blob/66dad923e7f4bb3e1692b8a86e6fbe08edc5a97d/src/clients/TreasuryManagerFactoryClient.ts#L37-L64
side note: is there a way to initialize viem publicClient here by using the same RPC as the one within drift? The user might have initialized the sdk with their own rpc endpoint, but I couldn't find a way to extra that from the viem adapter.