← BSV MCPInstall
Wallet

wallet_sweepBsv

Sweep BSV from an external WIF private key into the wallet

Read as Markdown

Result

An MCP result containing the operation outcome as text, with structured content where supplied. Check isError before using it; an output schema is shown when registered.

Permissions

This operation can change wallet, account or service state. A connected wallet applies its own permissions. Guarded broadcasts also require broadcasting to be enabled; service authorization is separate from wallet approval.

Inputs and availability

Full catalog · Legacy local wallet; Legacy local identity; Local Vault · broadcasting disabled; Local Vault · all roles; Local Vault · payment role only; External BRC-100 wallet; Local Vault + sponsor

FieldType / requiredDescription
inputsarray of object
Required
UTXOs to sweep (use prepareSweepInputs to build these)
inputs[].outpointstring
Required
Outpoint (txid_vout)
inputs[].satoshisinteger
Required
Satoshis in output

minimum: -9007199254740991; maximum: 9007199254740991

inputs[].lockingScriptstring
Required
Locking script hex
wifstring
Required
WIF private key controlling the inputs
amountinteger
Optional
Amount to sweep (satoshis). If omitted, sweeps all input value.

minimum: -9007199254740991; maximum: 9007199254740991

Nested fields are required only when their parent object or array item is supplied.

Full input schema
{
  "type": "object",
  "properties": {
    "inputs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "outpoint": {
            "type": "string",
            "description": "Outpoint (txid_vout)"
          },
          "satoshis": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Satoshis in output"
          },
          "lockingScript": {
            "type": "string",
            "description": "Locking script hex"
          }
        },
        "required": [
          "outpoint",
          "satoshis",
          "lockingScript"
        ]
      },
      "description": "UTXOs to sweep (use prepareSweepInputs to build these)"
    },
    "wif": {
      "type": "string",
      "description": "WIF private key controlling the inputs"
    },
    "amount": {
      "description": "Amount to sweep (satoshis). If omitted, sweeps all input value.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "inputs",
    "wif"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}