sBTC on Stacks
sBTC deposits, withdrawals and peg totals
Completed deposits, withdrawal lifecycles with their Bitcoin confirmations, and peg totals. One key, one call.
Emily tracks an operation in flight; this is the decoded history and the push.
1$curl "https://api.secondlayer.tools/v1/index/sbtc/withdrawals?limit=1&fields=request_id,status,amount,btc_confirmations,settlement_confirmed" \
2 -H "Authorization: Bearer sk-sl_…"
1const { withdrawals } = await sl.index.sbtc.withdrawals.list({
2 limit: 1,
3 fields: ["request_id", "status", "amount", "btc_confirmations", "settlement_confirmed"],
4});
1{
2 "withdrawals": [{
3 "cursor": "9331677:2",
4 "request_id": 4610,
5 "status": "ACCEPTED",
6 "amount": "398000",
7 "settlement_confirmed": true,
8 "btc_confirmations": 12
9 }],
10 "next_cursor": "9331677:2"
11}
Webhooks· push
Get pushed instead
Be told when a peg-out settles on Bitcoin instead of polling for it.
1import { trigger } from "@secondlayer/sdk";
2
3await sl.webhooks.create({
4 name: "sbtc-settled",
5 url: "https://my-app.com/webhook",
6 triggers: [trigger.sbtcWithdrawalSweptConfirmed()],
7});