Wallet Infrastructure
Wallet Infrastructure
Quotes

Quote Spark exit

POST
/v1/quotes/spark

Requires scope quotes:read.

Authorization

ApiKey
headerAuthorizationBearer <sk_test_ or sk_live_ key>

Your sk_live_ / sk_test_ API key

Header Parameters

x-customer-id?string

Identifies whose spark wallet to price against.

Request Body

application/json
  1. body
operation*string

What to price. quoteWithdraw prices a cooperative exit from Spark to a Bitcoin L1 address and needs withdrawalAddress + amountSats. quoteLightningPayment prices paying a Lightning invoice and needs encodedInvoice.

Value in"quoteWithdraw""quoteLightningPayment"
treasury?boolean

Set true to price against the customer's treasury spark wallet rather than their ordinary one.

withdrawalAddress?string

quoteWithdraw only, and required for it: the Bitcoin L1 address the exit pays out to.

amountSats?integer

quoteWithdraw only, and required for it: the amount to withdraw, as an integer count of satoshis.

Range0 < value
encodedInvoice?string

quoteLightningPayment only, and required for it: the BOLT-11 invoice to pay.

btcUsdRate?number

Optional BTC/USD rate.

Range0 <= value

Response Body

200application/json

Spark exit fee quote

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
400application/json

Malformed body — an operation outside the two priced ones, a field the chosen operation requires but did not get, a withdrawalAddress that is not a valid Bitcoin address on the configured network, or a non-positive amountSats.

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
401application/json

The Authorization header is missing, malformed, or the API key is unknown or revoked

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
403application/json

The API key lacks the quotes:read scope

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
404application/json

No spark wallet exists for this owner.

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
429application/json

This business exceeded its per-minute enclave quote budget.

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
500application/json

A fault on our side.

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
502application/json

The enclave could not be reached, returned no fee, or the Spark service provider refused to price the exit.

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean
504application/json

The quote did not finish within the gateway's quote budget.

TypeScript Definitions

Use the response body type in TypeScript.

data*
status*number
success*boolean

Language

curl -X POST 'https://api.pilot.shiga.io/v1/quotes/spark' \  -H 'x-customer-id: <customer id>' \  -H 'Authorization: Bearer sk_test_...' \  -H 'Content-Type: application/json' \  -d '{  "operation": "quoteWithdraw"}'
Example Response
{  "data": {    "chain": "spark",    "moduleId": "spark",    "operation": "quoteWithdraw",    "fee": "0.784000",    "feeSats": 1206,    "sparkData": {}  },  "status": 200,  "success": true}