<!--
{
  "availability" : [

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

# 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.

## Discussion

```swift
let count: Int = try await client.send("getblockcount")
```

> Throws: `RPCError` (server), ``doc://Bitcoin/documentation/Bitcoin/RPCClientError`` (client), or transport errors.