Amount and fee calculations
const amountToBeReceived = await sdk.getAmountToBeReceived(amount, sourceToken, destinationToken);
console.log(
"Send %d %s and %d %s (gas fee) on %s to receive %d %s on %s",
amount,
sourceToken.symbol,
gasFeeOptions.native.int,
sourceChainMinUnit,
sourceToken.chainSymbol,
amountToBeReceived,
destinationToken.symbol,
destinationToken.chainSymbol
);const gasFeeOptions = await sdk.getGasFeeOptions(sourceToken, destinationToken, Messenger.ALLBRIDGE);
const floatGasFeeAmount = gasFeeOptions.stablecoin.float;
console.log(
"Send %d %s and %d %s (gas fee) on %s to receive %d %s on %s",
amount,
sourceToken.symbol,
floatGasFeeAmount,
sourceToken.symbol,
sourceToken.chainSymbol,
amountToBeReceived,
destinationToken.symbol,
destinationToken.chainSymbol
);Last updated