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.

Available methods

request gives you access to a set of JSON RPC 2.0 methods which follow the WBIP001 standard. All available Bitcoin & Stacks methods are detailed in the present documentation:

Request parameters

Request parametersDescription

method

a string representing the RPC method to call

params

the params required by the RPC method

providerId (optional)

wallet provider id to use for the request

Response format & error handling

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

PropertyDescription

status

success | error

result (optional)

an object containing the result of the RPC request

error (optional)

an object containing the error of the RPC request

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

PropertyDescription

code

RpcErrorCode

message

error message

data

any

Error codes

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
}

Last updated