Instance Method
sendNullable(_:params:)
Sends an RPC and decodes the result into T?. Null is a valid domain value.
func sendNullable<T>(_ method: String, params: [RPCParam] = []) async throws -> T? where T : Decodable, T : Sendable
Parameters
-
method
-
The RPC method name.
-
params
-
The parameters to pass to the RPC method.
Return Value
The decoded result, or nil if the server returned null.
Discussion
Use for RPCs where null means something (e.g., getTxOut null = spent).
Throws
RPCError (server), RPCClientError (client), or transport errors.