Lock-duration picker for vote-escrow tokens (Curve veCRV, GMX esGMX, veToken, …). Renders an amount input, a lock-period slider snapped to a configurable step (typically 1 week, the Curve standard), and a live projection of the resulting ve-balance.
Linear-decay vote-escrow standard:
veBalance = amount * lockSec / maxLockSecSo a maximum-length lock yields ve-balance equal to the principal; a quarter of max-length yields a quarter of the principal.
Web3.Ui.VeLock.view
{ amount = model.lockAmount
, amountInput = model.lockAmountInput
, decimals = 18
, symbol = "TKN"
, veSymbol = "veToken"
, lockSec = model.lockSec
, minLockSec = oneWeek
, maxLockSec = fourYears
, stepSec = oneWeek
, onAmountInput = LockAmountInput
, onLockChange = LockSecChanged
}CSS classes: web3-velock, web3-velock__amount, web3-velock__slider,
web3-velock__readout, web3-velock__preview, web3-velock__preview-label,
web3-velock__preview-value. Caller provides colors via stylesheet.
All configuration. amount is the principal as BigInt (used for the
ve-balance projection). amountInput is the live string in the input box
(separate so the consumer owns parse/validation state). lockSec is the
chosen lock duration in seconds. stepSec is the slider granularity —
pass 604800 (1 week) to match Curve's snap-to-week semantics.
Pure helper: project ve-balance from principal + chosen lock + max lock.
Mirrors the on-chain formula amount * lockSec / maxLockSec. Returns
BigInt.fromInt 0 if maxLockSec is non-positive.
Render the picker.