Instance Method
send(_:params:)
Sends an RPC method and returns the decoded response.
func send<T>(_ method: String, params: [RPCParam] = []) async throws -> T where T : Decodable, T : Sendable
Parameters
-
method
-
The RPC method name.
-
params
-
The parameters to pass.
Return Value
The decoded response of type T.
Discussion
Throws
An error if the request fails, the response is invalid, or decoding fails.