Package com.algorand.algosdk.templates
Class LimitOrder
java.lang.Object
com.algorand.algosdk.templates.LimitOrder
@Deprecated
public class LimitOrder
extends java.lang.Object
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
referenceProgram
Deprecated. -
Constructor Summary
Constructors Constructor Description LimitOrder()
Deprecated. -
Method Summary
Modifier and Type Method Description static ContractTemplate
MakeLimitOrder(Address owner, java.lang.Integer assetId, java.lang.Integer ratn, java.lang.Integer ratd, java.lang.Integer expirationRound, java.lang.Integer minTrade, java.lang.Integer maxFee)
Deprecated.MakeLimitOrder allows a user to exchange some number of assets for some number of algos.static byte[]
MakeSwapAssetsTransaction(ContractTemplate contract, java.lang.Integer assetAmount, java.lang.Integer microAlgoAmount, Account sender, java.lang.Integer firstValid, java.lang.Integer lastValid, Digest genesisHash, java.lang.Integer feePerByte)
Deprecated.Creates a group transaction array which transfer funds according to the contract's ratioMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
referenceProgram
protected static java.lang.String referenceProgramDeprecated.
-
-
Constructor Details
-
LimitOrder
public LimitOrder()Deprecated.
-
-
Method Details
-
MakeLimitOrder
public static ContractTemplate MakeLimitOrder(Address owner, java.lang.Integer assetId, java.lang.Integer ratn, java.lang.Integer ratd, java.lang.Integer expirationRound, java.lang.Integer minTrade, java.lang.Integer maxFee) throws java.security.NoSuchAlgorithmExceptionDeprecated.MakeLimitOrder allows a user to exchange some number of assets for some number of algos. Fund the contract with some number of Algos to limit the maximum number of Algos you're willing to trade for some other asset. Works on two cases: - trading Algos for some other asset - closing out Algos back to the originator after a timeout trade case, a 2 transaction group: - gtxn[0] (this txn) Algos from Me to Other - gtxn[1] asset from Other to Me We want to get at least some amount of the other asset per our Algos gtxn[1].AssetAmount / gtxn[0].Amount >= N / D === gtxn[1].AssetAmount * D >= gtxn[0].Amount * N close-out case: - txn alone, close out value after timeout- Parameters:
owner
- an address that can receive the asset after the expiry roundassetId
- asset to be transferedratn
- the numerator of the exchange rateratd
- the denominator of the exchange rateexpirationRound
- the round on which the assets can be transferred back to ownerminTrade
- the minimum amount (of Algos) to be traded awaymaxFee
- the maximum fee that can be paid to the network by the account- Throws:
java.security.NoSuchAlgorithmException
-
MakeSwapAssetsTransaction
public static byte[] MakeSwapAssetsTransaction(ContractTemplate contract, java.lang.Integer assetAmount, java.lang.Integer microAlgoAmount, Account sender, java.lang.Integer firstValid, java.lang.Integer lastValid, Digest genesisHash, java.lang.Integer feePerByte) throws java.io.IOException, java.security.NoSuchAlgorithmExceptionDeprecated.Creates a group transaction array which transfer funds according to the contract's ratio- Parameters:
contract
- previously created LimitOrder contractassetAmount
- amount of assets to be sentmicroAlgoAmount
- number of algos to transfersender
- account to sign the payment transactionfirstValid
- first round on which these txns will be validlastValid
- last round on which these txns will be validgenesisHash
- Genesis hash for the network where the transaction will be submitted.feePerByte
- fee per byte used for the transactions- Returns:
- Throws:
java.io.IOException
java.security.NoSuchAlgorithmException
-