HashTimeLockContract class
Hash Time Locked Contract allows a user to receive the Algo prior to a deadline (in terms of a round) by proving knowledge of a special value or to forfeit the ability to claim, returning it to the payer.
This contract is usually used to perform cross-chained atomic swaps.
More formally, algos can be transfered under only two circumstances:
- To receiver if hash_function(arg_0) = hash_value
- To owner if txn.FirstValid > expiry_round
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
{required Address owner, required Address receiver, required HashFunction hashFunction, required String hashImage, required int expiryRound, required int maxFee}) → ContractTemplate - Create a new Hash Time Locked Contract. This allows a user to receive Algo prior to a deadline by proving knowledge of a special value or to forfeit the ability to claim, returning it to the payer.
-
getTransaction(
{required ContractTemplate contract, required String preImage, required int firstValid, required int lastValid, required String genesisHash, required int feePerByte}) → Future< SignedTransaction> - Read and verify the contract, and return the signed transaction
Constants
- referenceProgram → const String