# request methods

You can use `request` to connect to users' wallets, prompt users to share their Bitcoin & Stacks wallet addresses, and sign messages and transactions with their Bitcoin & Stacks addresses.&#x20;

{% hint style="info" %}
The `request` method is available as `Wallet.request` from `sats-connect` if you'd like users to [connect to any wallet](https://docs.xverse.app/sats-connect/connecting-to-the-wallet/connect-to-other-wallets), or as a named export from `@sats-connect/core` if you only need Xverse Wallet support.
{% endhint %}

## Available methods

`request` gives you access to a set of [JSON RPC 2.0](https://www.jsonrpc.org/specification) methods which follow the [WBIP001](https://wbips.netlify.app/wbips/WBIP001) standard. All available Bitcoin & Stacks methods are detailed in the present documentation:

<table data-header-hidden><thead><tr><th width="268"></th><th></th></tr></thead><tbody><tr><td>Connect, fetch accounts &#x26; manage permissions</td><td><ul><li><a href="../connecting-to-the-wallet/connect-to-xverse-wallet">wallet_connect</a></li><li><a href="../connecting-to-the-wallet/disconnect-from-xverse-wallet">wallet_disconnect</a></li><li><a href="wallet_getaccount">getAccount</a></li><li><a href="../xverse-wallet-permissions">wallet_requestPermissions</a></li><li><a href="../xverse-wallet-permissions">wallet_getCurrentPermissions</a></li><li><a href="../xverse-wallet-permissions">wallet_renouncePermissions</a></li><li><a href="wallet_getnetwork">wallet_getNetwork</a></li><li><a href="wallet_changenetwork">wallet_changeNetwork</a></li><li><a href="wallet_addnetwork">wallet_addNetwork</a></li><li>[Legacy <span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span>]<a href="../connecting-to-the-wallet/legacy-getaccounts"> getAccounts</a></li></ul></td></tr><tr><td><i class="fa-bitcoin">:bitcoin:</i> Bitcoin Methods </td><td><p></p><ul><li><a href="../bitcoin-methods/getaddresses">getAddresses</a></li><li><a href="../bitcoin-methods/getbalance">getBalance</a></li><li><a href="../bitcoin-methods/signmessage">signMessage</a></li><li><a href="../bitcoin-methods/signpsbt">signPsbt</a></li><li><a href="../bitcoin-methods/sendtransfer">sendTransfer</a></li><li><a href="../bitcoin-methods/ord_getinscriptions">ord_getInscriptions</a> &#x26; <a href="../bitcoin-methods/ord_sendinscriptions">ord_sendInscriptions</a></li><li><a href="../bitcoin-methods/runes_getbalance">runes_getBalance</a> &#x26; <a href="../bitcoin-methods/runes_transfer">runes_transfer</a></li><li><a href="../bitcoin-methods/mint-runes">Runes Minting methods</a></li><li><a href="../bitcoin-methods/etch-runes">Runes Etching methods</a></li></ul></td></tr><tr><td>🔴 Stacks Methods </td><td><p></p><ul><li><a href="../stacks-methods/stx_getaccounts">stx_getAccounts</a></li><li><a href="../stacks-methods/stx_signmessage">stx_signMessage</a></li><li><a href="../stacks-methods/stx_signstructuredmessage">stx_signStructuredMessage</a></li><li><a href="../bitcoin-methods/signmessage">stx_signMessage</a></li><li><a href="../stacks-methods/stx_transferstx">stx_transferStx</a></li><li><a href="../stacks-methods/stx_signtransaction">stx_signTransaction</a></li><li><a href="../stacks-methods/stx_callcontract">stx_callContract</a></li><li><a href="../stacks-methods/stx_deploycontract">stx_deployContract</a></li></ul></td></tr><tr><td><i class="fa-sparkle">:sparkle:</i> Spark Methods</td><td><ul><li><a href="../spark-methods/spark_getaddress">spark_getAddress</a></li><li><a href="../spark-methods/spark_getbalance">spark_getBalance</a></li><li><a href="../spark-methods/spark_transfer">spark_transfer</a></li><li><a href="../spark-methods/spark_transfertoken">spark_transferToken</a></li><li><a href="../spark-methods/spark_signmessage">spark_signMessage</a></li></ul></td></tr></tbody></table>

## Request parameters

<table><thead><tr><th width="268">Request parameters</th><th>Description</th></tr></thead><tbody><tr><td><code>method</code></td><td>a string representing the RPC method to call</td></tr><tr><td><code>params</code></td><td>the params required by the RPC method</td></tr><tr><td><code>providerId (optional)</code></td><td>wallet provider id to use for the request</td></tr></tbody></table>

## Response format & error handling

Depending on the status property the response will contain either a result or error object.

<table><thead><tr><th width="223">Property</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> </td><td>success | error </td></tr><tr><td><code>result (optional)</code></td><td>an object containing the result of the RPC request</td></tr><tr><td><code>error (optional)</code> </td><td>an object containing the error of the RPC request</td></tr></tbody></table>

Error handling for these methods follows the JSON-RPC 2.0 protocol format:

<table><thead><tr><th width="162">Property</th><th>Description</th></tr></thead><tbody><tr><td><code>code</code> </td><td><code>RpcErrorCode</code></td></tr><tr><td><code>message</code></td><td> error message </td></tr><tr><td><code>data</code> </td><td>any</td></tr></tbody></table>

Error codes

```tsx
enum RpcErrorCode {
  PARSE_ERROR = -32700, // Parse error	Invalid JSON
  INVALID_REQUEST = -32600, // The JSON sent is not a valid Request object.
  METHOD_NOT_FOUND = -32601, // The method does not exist/is not available.
  INVALID_PARAMS = -32602, // Invalid method parameter(s)
  INTERNAL_ERROR = -32603, // Internal JSON-RPC error
  USER_REJECTION = -32000, // user rejected/canceled the request
  METHOD_NOT_SUPPORTED = -32001, // method is not supported for the address provided
}
```
