Skip to main content

Class: TradeEventManagement

Constructors​

constructor​

β€’ new TradeEventManagement(): TradeEventManagement

Returns​

TradeEventManagement

Methods​

createCleanSummaryFromEvent​

β–Έ createCleanSummaryFromEvent(event): CleanSummary

Parameters​

NameType
eventCleanStartEvent

Returns​

CleanSummary

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:32


createSummaryFromEvent​

β–Έ createSummaryFromEvent(event, fillToken): OrderSummary

Parameters​

NameType
eventObject
event.argsObject
event.args.olKeyHashstring
event.args.takerstring
event.args.fillOrKill?boolean
event.args.tick?BigNumber
event.args.maxTick?BigNumber
event.args.fillVolumeBigNumber
event.args.fillWantsboolean
event.args.restingOrder?boolean
event.args.restingOrderId?number
fillTokenToken

Returns​

OrderSummary

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:40


createSuccessFromEvent​

β–Έ createSuccessFromEvent(evt, got, gave): Object

Parameters​

NameType
evtOfferSuccessEvent
gotToken
gaveToken

Returns​

Object

NameType
offerIdnumber
gotBig
gaveBig

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:77


createTradeFailureFromEvent​

β–Έ createTradeFailureFromEvent(evt, got, gave): Object

Parameters​

NameType
evtOfferFailEvent
gotToken
gaveToken

Returns​

Object

NameType
offerIdnumber
reasonstring
FailToDeliverBig
volumeGivenBig
penaltyBigNumber

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:86


createPosthookFailureFromEvent​

β–Έ createPosthookFailureFromEvent(evt): Object

Parameters​

NameType
evtOfferFailWithPosthookDataEvent | OfferSuccessWithPosthookDataEvent

Returns​

Object

NameType
offerIdnumber
reasonstring

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:97


createOfferWriteFromEvent​

β–Έ createOfferWriteFromEvent(market, evt): undefined | { ba: BA ; offer: OfferSlim }

Parameters​

NameType
marketMarket
evtOfferWriteEvent

Returns​

undefined | { ba: BA ; offer: OfferSlim }

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:107


createSummaryFromOrderSummaryEvent​

β–Έ createSummaryFromOrderSummaryEvent(evt, fillToken): OrderSummary

Parameters​

NameType
evtMangroveOrderStartEvent
fillTokenToken

Returns​

OrderSummary

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:135


createRestingOrderFromIdAndBA​

β–Έ createRestingOrderFromIdAndBA(ba, offerId, offerWrites): undefined | OfferSlim

Parameters​

NameType
baBA
offerIdundefined | number
offerWrites{ ba: BA ; offer: OfferSlim }[]

Returns​

undefined | OfferSlim

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:156


createPartialFillFunc​

β–Έ createPartialFillFunc(fillWants, fillVolume): (takerGotWithFee: BigNumber, takerGave: BigNumber) => boolean

Parameters​

NameType
fillWantsboolean
fillVolumeBigNumber

Returns​

fn

β–Έ (takerGotWithFee, takerGave): boolean

Parameters​
NameType
takerGotWithFeeBigNumber
takerGaveBigNumber
Returns​

boolean

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:165


resultOfMangroveEventCore​

β–Έ resultOfMangroveEventCore(evt, ba, partialFillFunc, fillWants, result, market): void

Parameters​

NameType
evtLogDescription | Event
baBA
partialFillFunc(takerGotWithFee: BigNumber, takerGave: BigNumber) => boolean
fillWantsboolean
resultOrderResultWithOptionalSummary
marketMarket

Returns​

void

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:175


resultOfMangroveOrderEventCore​

β–Έ resultOfMangroveOrderEventCore(receipt, evt, ba, fillWants, result, market): void

Parameters​

NameType
receiptContractReceipt
evtLogDescription | Event
baBA
fillWantsboolean
resultOrderResultWithOptionalSummary
marketMarket

Returns​

void

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:341


getContractEventsFromReceipt​

β–Έ getContractEventsFromReceipt(receipt, contract): Event[] | LogDescription[]

Parameters​

NameType
receiptContractReceipt
contractBaseContract

Returns​

Event[] | LogDescription[]

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:398


processMangroveEvents​

β–Έ processMangroveEvents(result, receipt, ba, fillWants, fillVolume, market): void

Parameters​

NameType
resultOrderResultWithOptionalSummary
receiptContractReceipt
baBA
fillWantsboolean
fillVolumeBigNumber
marketMarket

Returns​

void

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:414


processMangroveOrderEvents​

β–Έ processMangroveOrderEvents(result, receipt, ba, fillWants, market): void

Parameters​

NameType
resultOrderResultWithOptionalSummary
receiptContractReceipt
baBA
fillWantsboolean
marketMarket

Returns​

void

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:437


isOrderResult​

β–Έ isOrderResult(result): result is OrderResult

Parameters​

NameType
resultOrderResultWithOptionalSummary

Returns​

result is OrderResult

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:459


isCleanResult​

β–Έ isCleanResult(result): result is OrderResult

Parameters​

NameType
resultOrderResultWithOptionalSummary

Returns​

result is OrderResult

Defined in​

@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:465

  • Constructors
    • constructor
  • Methods
    • createCleanSummaryFromEvent
    • createSummaryFromEvent
    • createSuccessFromEvent
    • createTradeFailureFromEvent
    • createPosthookFailureFromEvent
    • createOfferWriteFromEvent
    • createSummaryFromOrderSummaryEvent
    • createRestingOrderFromIdAndBA
    • createPartialFillFunc
    • resultOfMangroveEventCore
    • resultOfMangroveOrderEventCore
    • getContractEventsFromReceipt
    • processMangroveEvents
    • processMangroveOrderEvents
    • isOrderResult
    • isCleanResult