geniusyield-dex-api-0.1.0.0: API code to interact with GeniusYield DEX.
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainersupport@geniusyield.co
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

GeniusYield.Api.Dex.PartialOrder

Description

 
Synopsis

Documentation

data PORefs #

Constructors

PORefs 

Fields

Instances

Instances details
Show PORefs # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

PartialOrderInfo

data PartialOrderInfo #

Constructors

PartialOrderInfo 

Fields

Instances

Instances details
Generic PartialOrderInfo # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

Associated Types

type Rep PartialOrderInfoTypeType Source #

Show PartialOrderInfo # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

Eq PartialOrderInfo # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

ToSchema PartialOrderInfo # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

type Rep PartialOrderInfo # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

type Rep PartialOrderInfo = D1 ('MetaData "PartialOrderInfo" "GeniusYield.Api.Dex.PartialOrder" "geniusyield-dex-api-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PartialOrderInfo" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "poiRef") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYTxOutRef) :*: S1 ('MetaSel ('Just "poiOwnerKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYPubKeyHash)) :*: (S1 ('MetaSel ('Just "poiOwnerAddr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYAddress) :*: S1 ('MetaSel ('Just "poiOfferedAsset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYAssetClass))) :*: ((S1 ('MetaSel ('Just "poiOfferedOriginalAmount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "poiOfferedAmount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)) :*: (S1 ('MetaSel ('Just "poiAskedAsset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYAssetClass) :*: (S1 ('MetaSel ('Just "poiPrice") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYRational) :*: S1 ('MetaSel ('Just "poiNFT") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYTokenName))))) :*: (((S1 ('MetaSel ('Just "poiStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe GYTime)) :*: S1 ('MetaSel ('Just "poiEnd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe GYTime))) :*: (S1 ('MetaSel ('Just "poiPartialFills") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "poiMakerLovelaceFlatFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "poiTakerLovelaceFlatFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)))) :*: ((S1 ('MetaSel ('Just "poiContainedFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 POIContainedFee) :*: S1 ('MetaSel ('Just "poiContainedPayment") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)) :*: (S1 ('MetaSel ('Just "poiUTxOValue") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYValue) :*: (S1 ('MetaSel ('Just "poiUTxOAddr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYAddress) :*: S1 ('MetaSel ('Just "poiNFTCS") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GYMintingPolicyId)))))))

data POIContainedFee #

Instances

Instances details
Monoid POIContainedFee # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

Semigroup POIContainedFee # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

Generic POIContainedFee # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

Associated Types

type Rep POIContainedFeeTypeType Source #

Show POIContainedFee # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

Eq POIContainedFee # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

ToSchema POIContainedFee # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

type Rep POIContainedFee # 
Instance details

Defined in GeniusYield.Api.Dex.PartialOrder

type Rep POIContainedFee = D1 ('MetaData "POIContainedFee" "GeniusYield.Api.Dex.PartialOrder" "geniusyield-dex-api-0.1.0.0-inplace" 'False) (C1 ('MetaCons "POIContainedFee" 'PrefixI 'True) (S1 ('MetaSel ('Just "poifLovelaces") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "poifOfferedTokens") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "poifAskedTokens") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural))))

expectedPaymentWithDepositPartialOrderInfoBoolGYValue #

Note that at any moment, an order UTxO contains:- * An NFT. * Remaining offered tokens. * Payment for tokens consumed. * Initial deposit. * Collected fees.

Redeemer & Datum

data PartialOrderAction #

Instances

Instances details
Generic PartialOrderAction # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

Associated Types

type Rep PartialOrderActionTypeType Source #

Show PartialOrderAction # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

FromData PartialOrderAction # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

ToData PartialOrderAction # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

UnsafeFromData PartialOrderAction # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

type Rep PartialOrderAction # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

type Rep PartialOrderAction = D1 ('MetaData "PartialOrderAction" "GeniusYield.Scripts.Dex.PartialOrder" "geniusyield-dex-api-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PartialCancel" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "PartialFill" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :+: C1 ('MetaCons "CompleteFill" 'PrefixI 'False) (U1TypeType)))

data PartialOrderDatum #

Datum specifying a partial order.

Constructors

PartialOrderDatum 

Fields

Instances

Instances details
Generic PartialOrderDatum # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

Associated Types

type Rep PartialOrderDatumTypeType Source #

Show PartialOrderDatum # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

FromData PartialOrderDatum # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

ToData PartialOrderDatum # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

UnsafeFromData PartialOrderDatum # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

type Rep PartialOrderDatum # 
Instance details

Defined in GeniusYield.Scripts.Dex.PartialOrder

type Rep PartialOrderDatum = D1 ('MetaData "PartialOrderDatum" "GeniusYield.Scripts.Dex.PartialOrder" "geniusyield-dex-api-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PartialOrderDatum" 'PrefixI 'True) (((S1 ('MetaSel ('Just "podOwnerKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PubKeyHash) :*: (S1 ('MetaSel ('Just "podOwnerAddr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address) :*: S1 ('MetaSel ('Just "podOfferedAsset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssetClass))) :*: ((S1 ('MetaSel ('Just "podOfferedOriginalAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "podOfferedAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :*: (S1 ('MetaSel ('Just "podAskedAsset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssetClass) :*: S1 ('MetaSel ('Just "podPrice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))) :*: (((S1 ('MetaSel ('Just "podNFT") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TokenName) :*: S1 ('MetaSel ('Just "podStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime))) :*: (S1 ('MetaSel ('Just "podEnd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime)) :*: S1 ('MetaSel ('Just "podPartialFills") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))) :*: ((S1 ('MetaSel ('Just "podMakerLovelaceFlatFee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "podTakerLovelaceFlatFee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :*: (S1 ('MetaSel ('Just "podContainedFee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PartialOrderContainedFee) :*: S1 ('MetaSel ('Just "podContainedPayment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))))))

Partial order NFT policy

partialOrderNftPolicy #

Arguments

GYDexApiQueryMonad m a 
PORefs 
→ m (GYMintingPolicy 'PlutusV2)

The minting policy of the partial order NFT.

partialOrderNftPolicyId #

Arguments

GYDexApiQueryMonad m a 
PORefs 
→ m GYMintingPolicyId

The minting policy id of the partial order NFT.

Queries

Tx constructors

placePartialOrder #

Arguments

GYDexApiMonad m a 
PORefs 
GYAddress

Order owner

→ (Natural, GYAssetClass)

Amount and asset to offer.

GYAssetClass

The asset being asked for as payment.

GYRational

The price for one unit of the offered asset.

Maybe GYTime

The earliest time when the order can be filled (optional).

Maybe GYTime

The latest time when the order can be filled (optional).

Maybe GYStakeCredential

Stake credential of user. We do not support pointer reference.

→ m (GYTxSkeleton 'PlutusV2) 

placePartialOrder' #

Arguments

∷ (GYDexApiMonad m a, HasCallStack) 
PORefs 
GYAddress

Order owner

→ (Natural, GYAssetClass)

Amount and asset to offer.

GYAssetClass

The asset being asked for as payment.

GYRational

The price for one unit of the offered asset.

Maybe GYTime

The earliest time when the order can be filled (optional).

Maybe GYTime

The latest time when the order can be filled (optional).

Natural

Additional lovelace fee.

Natural

Additional fee in offered tokens.

Maybe GYStakeCredential

Stake credential of user. We do not support pointer reference.

GYTxOutRef 
PartialOrderConfigInfoF GYAddress 
→ m (GYTxSkeleton 'PlutusV2) 

completelyFillPartialOrder #

Arguments

∷ (HasCallStack, GYDexApiMonad m a) 
PORefs 
GYTxOutRef

The order reference.

Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) 
Natural

Additional taker fee in payment tokens.

→ m (GYTxSkeleton 'PlutusV2) 

Completely fill a partially-fillable order.

partiallyFillPartialOrder #

Arguments

∷ (HasCallStack, GYDexApiMonad m a) 
PORefs 
GYTxOutRef

The order reference.

Natural

The amount of offered tokens to buy.

Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) 
Natural

Additional taker fee in payment tokens.

→ m (GYTxSkeleton 'PlutusV2) 

Partially fill a partially-fillable order.

fillPartialOrder #

Arguments

∷ (HasCallStack, GYDexApiMonad m a) 
PORefs 
GYTxOutRef

The order reference.

Natural

The amount of offered tokens to buy.

Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) 
Natural

Additional taker fee in payment tokens.

→ m (GYTxSkeleton 'PlutusV2) 

Fills an order. If the provided amount of offered tokens to buy is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.

fillPartialOrder' #

Arguments

∷ (HasCallStack, GYDexApiMonad m a) 
PORefs 
PartialOrderInfo

The order information.

Natural

The amount of offered tokens to buy.

Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) 
Natural

Additional taker fee in payment tokens.

→ m (GYTxSkeleton 'PlutusV2) 

Fills an order. If the provided amount of offered tokens to buy is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.

This differs from fillPartialOrder in that it takes fetched order information instead of it's reference.

fillMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [(GYTxOutRef, Natural)] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2) #

Fills multiple orders. If the provided amount of offered tokens to buy in an order is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.

fillMultiplePartialOrders' ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [(PartialOrderInfo, Natural)] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2) #

Fills multiple orders. If the provided amount of offered tokens to buy in an order is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.

cancelPartialOrder #

Arguments

∷ (HasCallStack, GYDexApiMonad m a) 
PORefs 
GYTxOutRef

The order reference.

→ m (GYTxSkeleton 'PlutusV2) 

cancelPartialOrder' #

Arguments

∷ (HasCallStack, GYDexApiMonad m a) 
PORefs 
PartialOrderInfo

The order information.

→ m (GYTxSkeleton 'PlutusV2) 

cancelMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [PartialOrderInfo] → m (GYTxSkeleton 'PlutusV2) #

Cancel multiple partial orders.

Utilities