@orangecheck/me-client / computeFees
Function: computeFees()
function computeFees(cfg: IntegratorEventConfig, payment_amount_sats?: number): ComputedFees;
Defined in: me-client/src/types.ts:110
Compute the four-way fee split for an event given an integrator's config and (for percent_of_amount events) the underlying payment amount.
Invariants (verified by tests in oc-me-web/src/lib/events/types.test.ts):
- gross_fee_sats >= MIN_INTEGRATOR_PRICE_SATS
- platform_fee_sats >= PLATFORM_FEE_POLICY.min_floor_sats
- user_share_pct is clamped to [0, 0.8]
- site_rebate_sats >= 0
- gross == platform + user + rebate (exact, modulo rounding into rebate)
Parameters
| Parameter | Type |
|---|---|
cfg | IntegratorEventConfig |
payment_amount_sats? | number |