Methods
# (async, static) makeCloseAssetTxns(order) → {Promise.<Transactions>}
🏭 makeCloseAssetTxns(order)
Transaction Factory for Closing Sell Orders
❌ Cancel Order Transactions:
Index | Direction | Type | Description | Signer |
---|---|---|---|---|
TXN 0 | ESCROW TO ORDERBOOK | algosdk.makeApplicationClearStateTxn | Application call to order book contract for closeout | algosdk.LogicSigAccount |
TXN 1 | ESCROW TO SELLER | algosdk.makeAssetTransferTxnWithSuggestedParams | Asset transfer (escrow to owner) | algosdk.LogicSigAccount |
TXN 2 | ESCROW TO SELLER | algosdk.makePaymentTxnWithSuggestedParams | Pay transaction (from escrow to owner) | algosdk.LogicSigAccount |
TXN 3 | SELLER TO SELLER | algosdk.makePaymentTxnWithSuggestedParams | proof of ownership pay transaction (owner to owner) | Wallet |
Parameters:
Name | Type | Description |
---|---|---|
order |
Order | The Order Object |
Returns:
- Type
- Promise.<Transactions>
# (async, static) makeExecuteAssetTxns(order, withCloseoutopt) → {Promise.<Transactions>}
🏭 makeExecuteAssetTxns(order)
☠ Partial Order Execution:
Index | Direction | Type | Description | Signer |
---|---|---|---|---|
TXN 0 | ESCROW TO ORDERBOOK | algosdk.makeApplicationNoOpTxn | Application call to execute | Wallet |
TXN 1 | BUYER TO SELLER | algosdk.makePaymentTxn | Pay transaction (from buyer/executor to escrow owner | algosdk.LogicSigAccount |
TXN 2 | BUYER TO BUYER | algosdk.makeAssetTransferTxn | (Optional) asset opt-in transaction (for buyer/executor) | Wallet |
TXN 2/3 | ESCROW TO BUYER | algosdk.makeAssetTransferTxn | Asset transfer (from escrow to buyer/executor) | Wallet |
TXN 3/4 | BUYER TO ESCROW | algosdk.makePaymentTxn | Pay transaction for fee refund (from buyer/executor to escrow) | Wallet |
☠️ Full Order Execution:
Index | Direction | Type | Description | Signer |
---|---|---|---|---|
TXN 0 | ESCROW TO ORDERBOOK | algosdk.makeApplicationCloseOutTxn | Transaction must be a call to a stateful contract | Wallet |
TXN 1 | BUYER TO SELLER | algosdk.makePaymentTxnWithSuggestedParams | Pay transaction (from buyer/executor to escrow owner) | Wallet |
TXN 2 | BUYER TO BUYER | algosdk.makeAssetTransferTxn | (Optional) asset opt-in transaction (for buyer/executor) | Wallet |
TXN 2/3 | ESCROW TO BUYER | algosdk.makeAssetTransferTxn | Asset transfer (from escrow to buyer/executor) - closes out any remaining ASA to seller (escrow owner) as well | Wallet |
TXN 3/4 | ESCROW TO SELLER | algosdk.makePaymentTxn | Pay transaction to close out to escrow owner | Wallet |
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
order |
Order | The Order |
|
withCloseout |
boolean |
<optional> |
Flag to closeout the executable order |
Returns:
- Type
- Promise.<Transactions>
# (async, static) makePlaceAssetTxns(order, optInopt) → {Promise.<Structures>}
🏭 makePlaceAssetTxns(order)
Factory for creating Maker sell transactions
➕ Open Order Transactions:
Index | Direction | Type | Description | Signer |
---|---|---|---|---|
TXN 0 | SELLER TO ESCROW | algosdk.makeAssetTransferTxn | Pay from order creator to escrow account | Wallet |
TXN 1 | ESCROW TO ORDERBOOK | algosdk.makePaymentTxn | Stateful app opt-in to order book | algosdk.LogicSigAccount |
TXN 2 | ESCROW TO ESCROW | algosdk.makeAssetTransferTxn | (Optional) ASA opt-in for the newly created escrow account | algosdk.LogicSigAccount |
TXN 3 | SELLER TO ESCROW | algosdk.makeAssetTransferTxn | Asset transfer Txn representing the amount of asset moved to escrow | Wallet |
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
order |
Order | The Order |
||
optIn |
boolean |
<optional> |
false | Flag for if the escrow has opted in |
Throws:
ValidationError
Returns:
- Type
- Promise.<Structures>