estimate

fun estimate(schedule: TransferFeeSchedule, amuletPriceUsd: BigDecimal, amountCc: BigDecimal, outputCount: Int = 2): TransferFeeEstimator.Estimate

Estimates the fee for sending amountCc with outputCount created outputs, converted at amuletPriceUsd.

Mirrors the fee arithmetic of Splice's classic (pre-CIP-0078) AmuletRules_Transfer: fees are denominated in USD — the amount is converted to USD at the round price, the stepped rate is charged per tranche (SteppedRate.charge), each created output pays the fixed create fee, and the USD total converts back to CC at the same price. On current Canton Network configs every schedule value is zero (CIP-0078/0107 — see TransferFeeSchedule) and the estimate is zero.

This is an estimate, not a quote:

  • fees convert at the price of the round the transfer executes in, which can differ from the round previewed here (prices move between rounds; rounds tick every ~10 minutes);

  • holding fees accrued on the input holdings are excluded — they depend on which inputs the wallet selects (and since CIP-0078, transfers do not charge them at all; they only reduce value when a holding is expired);

  • lock-holder fees are excluded (no output of a plain transfer is locked).

Parameters

schedule

the USD fee schedule from ScanClient.amuletRulesConfig.

amuletPriceUsd

the open round's USD price per CC, > 0 — pick the round via latestUsable.

amountCc

the CC amount being sent to the receiver, > 0.

outputCount

created outputs paying the fixed create fee. Default 2: one receiver output + one sender change output — the wallet default for a simple send (senders with exact-amount inputs produce no change; pass 1 then).