Skip to content

calculateFeeForSwap()

SIP Protocol API Reference v0.15.1


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-GLbkPPho.d.ts:25011

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; }>