Skip to content

calculateFeeForSwap()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / calculateFeeForSwap

calculateFeeForSwap(contract, swapAmount, swapAmountUsd, sourceChain, destChain, viewingKeyDisclosed?): Promise<{ fee: FeeCalculationResult; netAmount: bigint; netAmountUsd: number; }>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:24675

Calculate fee and add to transaction

Helper for integrating fee collection into swap flows.

NEARFeeContract

bigint

number

ChainId

ChainId

boolean

Promise<{ fee: FeeCalculationResult; netAmount: bigint; netAmountUsd: number; }>