Skip to main content
The claim() function allows a stream recipient to withdraw all currently vested but not-yet-claimed tokens. The covenant enforces the math directly — no trust in the frontend required.

Claim Formula

Linear vesting:
elapsed       = tx.locktime - cursor
duration      = endTimestamp - startTimestamp
vestedTotal   = (totalAmount × elapsed) / duration
claimable     = vestedTotal - totalReleased
Step vesting:
completedSteps = elapsed / stepInterval
vestedTotal    = completedSteps × stepAmount
claimable      = vestedTotal - totalReleased
Where cursor begins at startTimestamp and is advanced by the cumulative pause duration each time the stream is resumed.

Cliff

If cliffTimestamp > 0, calling claim() before the cliff will fail at the contract level:
require(tx.locktime >= cliffTimestamp)
After the cliff, all tokens that have vested since startTimestamp become claimable at once.

How to Claim in the App

1

Open your stream

Go to Streams and select the stream. The dashboard shows claimable amount, total vested, and time remaining.
2

Click Claim

Click Claim Vested. Your wallet will prompt you to sign a transaction.
3

Confirm

The transaction consumes the current stream UTXO and produces:
  • An output to your address with the claimable amount
  • A new stream UTXO with updated total_released and optional auto-complete if fully vested

Auto-Complete

When newTotalReleased >= totalAmount, the claim transaction produces no replacement NFT output. The stream is marked COMPLETED and disappears from the active streams list.

API

POST /api/streams/:id/claim

# Response
{
  "txid": "hex_transaction_id",
  "claimed": 125000000,
  "totalReleased": 375000000,
  "status": "ACTIVE"
}