gagliardetto / solana-go

Go SDK library and RPC client for the Solana Blockchain
Apache License 2.0
929 stars 264 forks source link

feat: Add `.Response()` and `.Err()` method for all subscriber #177

Closed GoudanWoo closed 8 months ago

GoudanWoo commented 8 months ago

Sometimes when we call this project to subscribe to some data, we need to use select {} for timeout control. like:

https://github.com/gagliardetto/solana-go/blob/790032bfec094566011ad551254b1df937e0a027/rpc/sendAndConfirmTransaction/sendAndConfirmTransaction.go#L123-L143

But if there is only .Recv() method, we are unable to complete requirements such as timeout control and active cancel. So I added .Response() and .Err() to do it.

gagliardetto commented 8 months ago

thanks!