sadoprotocol/ordit

feat(address): add get spendables method

Closed this issue · 0 comments

What would you like to be added:

Add a method where the user can request a list of spendable utxos that fulfills a desired amount.

{
  "jsonrpc": "2.0",
  "method": "GetSpendables",
  "params": {
    "value": 1,
    "options": {
      "maxOrdinalRarity": "common"
    },
    "filter": [
      { "txid": "<txid>", "n": 0 }
    ]
  },
  "id": "postman"
}

Why is this needed:

Using GetUnspent will result in many round trips for the pagination and also provides more details than required for a spendable utxo result. This method gives all the information needed in a single request for third party services to construct transactions using the provided result.