<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Bitcoin",
  "identifier" : "/documentation/Bitcoin/RPCClient/sendNullable(_:params:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Bitcoin"
    ],
    "preciseIdentifier" : "s:7Bitcoin9RPCClientC12sendNullable_6paramsxSgSS_SayAA8RPCParamOGtYaKSeRzs8SendableRzlF"
  },
  "title" : "sendNullable(_:params:)"
}
-->

# 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), ``doc://Bitcoin/documentation/Bitcoin/RPCClientError`` (client), or transport errors.