LimitOrder class
A limit order 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
gtxn1
.AssetAmount / gtxn0
.Amount >= N / D
gtxn1
.AssetAmount * D >= gtxn0
.Amount * N
close-out case:
- txn alone, close out value after timeout
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 int assetId, required int ratn, required int ratd, required int expirationRound, required int minTrade, required int maxFee}) → ContractTemplate - Create a new Dynamic Fee contract. DynamicFee contract allows you to create a transaction without specifying the fee. The fee will be determined at the moment of transfer.
-
getSwapAssetsTransaction(
{required ContractTemplate contract, required int assetAmount, required int microAlgoAmount, required Account sender, required int firstValid, required int lastValid, required String genesisHash, required int feePerByte}) → Future< Uint8List> - Creates a group transaction array which transfer funds according to the contract's ratio
Constants
- referenceProgram → const String