Skip to main content
Version: 0.2.38

sdk.calculaterequiredcollateral

Home > @blaze-cardano/sdk > calculateRequiredCollateral

calculateRequiredCollateral() function

Calculate the required "collateral" the a transaction must put up if it is running smart contracts. This is to prevent DDOS attacks with failing scripts, and must be some percentage above the total fee of the script.

Signature:

declare function calculateRequiredCollateral(fee: bigint, collateralPercentage: number): bigint;

Parameters

Parameter

Type

Description

fee

bigint

The full transaction fee

collateralPercentage

number

The protocol parameter defining the buffer above the fee that is required

Returns:

bigint

{bigint}