Package com.algorand.algosdk.templates
Class HTLC
java.lang.Object
com.algorand.algosdk.templates.HTLC
@Deprecated
public class HTLC
extends java.lang.Object
Deprecated.
-
Constructor Summary
Constructors Constructor Description HTLC()
Deprecated. -
Method Summary
Modifier and Type Method Description static SignedTransaction
GetHTLCTransaction(ContractTemplate contract, java.lang.String preImage, int firstValid, int lastValid, Digest genesisHash, int feePerByte)
Deprecated.static ContractTemplate
MakeHTLC(Address owner, Address receiver, java.lang.String hashFunction, java.lang.String hashImage, int expiryRound, int maxFee)
Deprecated.Hash Time Locked Contract allows a user to recieve 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
HTLC
public HTLC()Deprecated.
-
-
Method Details
-
MakeHTLC
public static ContractTemplate MakeHTLC(Address owner, Address receiver, java.lang.String hashFunction, java.lang.String hashImage, int expiryRound, int maxFee) throws java.security.NoSuchAlgorithmExceptionDeprecated.Hash Time Locked Contract allows a user to recieve 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: 1. To receiver if hash_function(arg_0) = hash_value 2. To owner if txn.FirstValid > expiry_round- Parameters:
owner
- an address that can receive the asset after the expiry roundreceiver
- address to receive AlgoshashFunction
- the hash function to be used (must be either sha256 or keccak256)hashImage
- the hash image in base64expiryRound
- the round on which the assets can be transferred back to ownermaxFee
- the maximum fee that can be paid to the network by the account- Returns:
- ContractTemplate with the address and the program with the given parameter values
- Throws:
java.security.NoSuchAlgorithmException
-
GetHTLCTransaction
public static SignedTransaction GetHTLCTransaction(ContractTemplate contract, java.lang.String preImage, int firstValid, int lastValid, Digest genesisHash, int feePerByte) throws java.security.NoSuchAlgorithmException, java.io.IOExceptionDeprecated.- Parameters:
contract
- the contract created with HTLC.MakeHTLCpreImage
- Base64 encoded pre-image string.firstValid
- first round where the transactions are validlastValid
- last round where the transactions are validfeePerByte
- fee per byte multipliergenesisHash
- genesis hash- Returns:
- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
-