@lelantos-org/sdk / protocol / grossForNet
Function: grossForNet()
ts
function grossForNet(args): bigint;Defined in: @lelantos-org/sdk/dist/protocol/fees.d.ts:95
The smallest publicOut (circuit units) whose withdrawNet delivers at least net base units.
withdrawNet(publicOut).net is non-decreasing in publicOut on both branches, so the minimum is found by bisection over a checked upper bound.
The result is rarely a denomination: publishing it makes the withdrawal distinguishable. Returns 0n for a net of zero or less.
Parameters
| Parameter | Type |
|---|---|
args | GrossForNetArgs |
Returns
bigint
Throws
when no publicOut can deliver net (a fee of 100% or more, or a zero scale / index).