Class: Lock

message.Lock(options)

A hashed lock that prevents transfers from being completed until secret is provided

Constructor

new Lock(options)

Parameters:
Name Type Description
options object
Properties
Name Type Default Description
amount int | BN 0
expiration int | BN 0
hashLock Buffer EMPTY_32BYTE_BUFFER
Properties:
Name Type Description
amount BN the amount of money that will be transferred if the secret is revealed
expiration BN the absolute blockNumber where this lock is no longer valid and cannot be redeemed
hashLock Buffer the keccak256 32 byte hash of the secret
Source:

Extends

  • Hashable

Methods

encode() → {Buffer}

encode - solidity pack the properties into a serilazed lock object that can be unpacked or hashed by EVM
Source:
Returns:
- 96 Byte Buffer encoding amount,expiration,hashLock
Type
Buffer