<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Bitcoin",
  "identifier" : "/documentation/Bitcoin/RPCClient",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Bitcoin"
    ],
    "preciseIdentifier" : "s:7Bitcoin9RPCClientC"
  },
  "title" : "RPCClient"
}
-->

# RPCClient

A client for interacting with the Bitcoin JSON-RPC API.

```
final class RPCClient
```

## Overview

`RPCClient` provides a high-level interface for sending commands to a Bitcoin node
using the JSON-RPC protocol. It supports multiple transports: HTTP for remote nodes
and a direct in-process bridge for embedded daemons.

Transport selection can be explicit (via [`init(transport:)`](/documentation/Bitcoin/RPCClient/init(transport:))) or automatic
(via [`init(url:username:password:)`](/documentation/Bitcoin/RPCClient/init(url:username:password:))), which picks the direct bridge when
available and falls back to HTTP.

RPC methods are organized into extensions matching
[Bitcoin Core’s RPC categories](https://developer.bitcoin.org/reference/rpc/):

- `RPCClient+Blockchain.swift` — Blockchain RPCs (incl. mempool)
- `RPCClient+Control.swift` — Control RPCs
- `RPCClient+Generating.swift` — Generating RPCs
- `RPCClient+Mining.swift` — Mining RPCs
- `RPCClient+RawTransactions.swift` — Rawtransactions RPCs (incl. PSBT)
- `RPCClient+Util.swift` — Util RPCs
- `RPCClient+Network.swift` — Network RPCs
- `RPCClient+Wallet.swift` — Wallet RPCs

> Note: Targets Bitcoin Core v31.x. All RPCs are covered.