sdk.txbuilder.locklovelace
Home > @blaze-cardano/sdk > TxBuilder > lockLovelace
TxBuilder.lockLovelace() method
Locks a specified amount of lovelace to a script. The difference between 'pay' and 'lock' is that you pay to a public key/user, and you lock at a script. This method ensures that the address is valid and the lovelace is locked to the script.
Signature:
lockLovelace(address: Address, lovelace: bigint, datum: Datum, scriptReference?: Script): TxBuilder;
Parameters
Parameter |
Type |
Description |
---|---|---|
address |
The address to lock the lovelace to. | |
lovelace |
bigint |
The amount of lovelace to lock. |
datum |
The datum to be associated with the locked lovelace. | |
scriptReference |
(Optional) The reference to the script to lock the lovelace to. |
Returns:
{TxBuilder} The same transaction builder