BigBlocks
Lock BSV
5,000,000 sats locked
Time-lock satoshis until a future block height
Total Locked5,000,000 sats
Unlockable1,500,000 sats
Next Unlock892,450
Ready to Unlock1,500,000 sats available
Empty State
Lock BSV
Time-lock satoshis until a future block height
Total Locked0 sats
Unlockable0 sats
Next Unlock—
Installation
bunx shadcn@latest add https://registry.bigblocks.dev/r/lock-bsv.jsonUsage
LockBsv requires onLock and onUnlock callbacks that perform the actual lock/unlock transactions. Wire these to @1sat/actions lock operations.
import { LockBsv } from "@/components/blocks/lock-bsv"
import { lockBsv, unlockBsv, createContext } from "@1sat/actions"
import { useWallet } from "@1sat/react"
export function WalletLocks() {
const { wallet } = useWallet()
const ctx = createContext(wallet)
return (
<LockBsv
onLock={(params) =>
lockBsv.execute(ctx, { requests: [params] })
}
onUnlock={() => unlockBsv.execute(ctx)}
onSuccess={(result) => console.log("txid:", result.txid)}
onError={(err) => console.error(err)}
/>
)
}Props
LockBsv
| Prop | Type | Default | Description |
|---|---|---|---|
lockData | { totalLocked: number; unlockable: number; nextUnlock: number } | -- | Pre-populated lock summary data |
onLock | (params: { satoshis: number; until: number }) => Promise<LockOperationResult> | -- | Callback to execute the lock transaction |
onUnlock | () => Promise<LockOperationResult> | -- | Callback to unlock matured locks |
onSuccess | (result: LockOperationResult) => void | -- | Called after a successful lock or unlock |
onError | (error: Error) => void | -- | Called on error |
className | string | -- | Additional CSS classes |
LockOperationResult
interface LockOperationResult {
txid?: string
error?: string
}