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 ratio

    Methods 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 referenceProgram
      Deprecated.
  • 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.NoSuchAlgorithmException
      Deprecated.
      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 round
      assetId - asset to be transfered
      ratn - the numerator of the exchange rate
      ratd - the denominator of the exchange rate
      expirationRound - the round on which the assets can be transferred back to owner
      minTrade - the minimum amount (of Algos) to be traded away
      maxFee - 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.NoSuchAlgorithmException
      Deprecated.
      Creates a group transaction array which transfer funds according to the contract's ratio
      Parameters:
      contract - previously created LimitOrder contract
      assetAmount - amount of assets to be sent
      microAlgoAmount - number of algos to transfer
      sender - account to sign the payment transaction
      firstValid - first round on which these txns will be valid
      lastValid - last round on which these txns will be valid
      genesisHash - 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