Instance Method
send(_:params:)
Sends an RPC and decodes the result into T.
func send<T>(_ method: String, params: [RPCParam] = []) async throws -> T where T : Decodable, T : Sendable
Parameters
-
method
-
The RPC method name (e.g., "getblockcount").
-
params
-
The parameters to pass to the RPC method.
Return Value
The decoded result.
Mentioned In
Discussion
let count: Int = try await client.send("getblockcount")
Throws
RPCError (server), RPCClientError (client), or transport errors.