Skip to content

@lelantos-org/sdk / protocol / withdrawNet

Function: withdrawNet() ​

ts
function withdrawNet(args): WithdrawNet;

Defined in: @lelantos-org/sdk/dist/protocol/fees.d.ts:76

Split a withdrawal's gross into what the recipient receives and what the protocol keeps.

publicOut is the gross: MASP._unshieldLeg skims the fee out of the amount leaving the pool (net = outAmt - fee). A caller picks the gross (a ladder denomination, since that figure is published on chain) and receives slightly less.

The two branches mirror the contract and round at different points, so the wrong one misreports the net by up to a unit.

plain the fee is taken from the converted token amount, floored yield the fee is taken in normalized units before conversion and rounded up (YieldOps._unshield → Fees.unitFee)

Parameters ​

ParameterType
argsWithdrawNetArgs

Returns ​

WithdrawNet