Class: TradeEventManagement
Constructorsβ
constructorβ
β’ new TradeEventManagement(): TradeEventManagement
Returnsβ
Methodsβ
createCleanSummaryFromEventβ
βΈ createCleanSummaryFromEvent(event
): CleanSummary
Parametersβ
Name | Type |
---|---|
event | CleanStartEvent |
Returnsβ
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:32
createSummaryFromEventβ
βΈ createSummaryFromEvent(event
, fillToken
): OrderSummary
Parametersβ
Name | Type |
---|---|
event | Object |
event.args | Object |
event.args.olKeyHash | string |
event.args.taker | string |
event.args.fillOrKill? | boolean |
event.args.tick? | BigNumber |
event.args.maxTick? | BigNumber |
event.args.fillVolume | BigNumber |
event.args.fillWants | boolean |
event.args.restingOrder? | boolean |
event.args.restingOrderId? | number |
fillToken | Token |
Returnsβ
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:40
createSuccessFromEventβ
βΈ createSuccessFromEvent(evt
, got
, gave
): Object
Parametersβ
Name | Type |
---|---|
evt | OfferSuccessEvent |
got | Token |
gave | Token |
Returnsβ
Object
Name | Type |
---|---|
offerId | number |
got | Big |
gave | Big |
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:77
createTradeFailureFromEventβ
βΈ createTradeFailureFromEvent(evt
, got
, gave
): Object
Parametersβ
Name | Type |
---|---|
evt | OfferFailEvent |
got | Token |
gave | Token |
Returnsβ
Object
Name | Type |
---|---|
offerId | number |
reason | string |
FailToDeliver | Big |
volumeGiven | Big |
penalty | BigNumber |
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:86
createPosthookFailureFromEventβ
βΈ createPosthookFailureFromEvent(evt
): Object
Parametersβ
Name | Type |
---|---|
evt | OfferFailWithPosthookDataEvent | OfferSuccessWithPosthookDataEvent |
Returnsβ
Object
Name | Type |
---|---|
offerId | number |
reason | string |
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:97
createOfferWriteFromEventβ
βΈ createOfferWriteFromEvent(market
, evt
): undefined
| { ba
: BA
; offer
: OfferSlim
}
Parametersβ
Name | Type |
---|---|
market | Market |
evt | OfferWriteEvent |
Returnsβ
undefined
| { ba
: BA
; offer
: OfferSlim
}
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:107
createSummaryFromOrderSummaryEventβ
βΈ createSummaryFromOrderSummaryEvent(evt
, fillToken
): OrderSummary
Parametersβ
Name | Type |
---|---|
evt | MangroveOrderStartEvent |
fillToken | Token |
Returnsβ
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:135
createRestingOrderFromIdAndBAβ
βΈ createRestingOrderFromIdAndBA(ba
, offerId
, offerWrites
): undefined
| OfferSlim
Parametersβ
Name | Type |
---|---|
ba | BA |
offerId | undefined | 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β
Name | Type |
---|---|
fillWants | boolean |
fillVolume | BigNumber |
Returnsβ
fn
βΈ (takerGotWithFee
, takerGave
): boolean
Parametersβ
Name | Type |
---|---|
takerGotWithFee | BigNumber |
takerGave | BigNumber |
Returnsβ
boolean
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:165
resultOfMangroveEventCoreβ
βΈ resultOfMangroveEventCore(evt
, ba
, partialFillFunc
, fillWants
, result
, market
): void
Parametersβ
Name | Type |
---|---|
evt | LogDescription | Event |
ba | BA |
partialFillFunc | (takerGotWithFee : BigNumber , takerGave : BigNumber ) => boolean |
fillWants | boolean |
result | OrderResultWithOptionalSummary |
market | Market |
Returnsβ
void
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:175
resultOfMangroveOrderEventCoreβ
βΈ resultOfMangroveOrderEventCore(receipt
, evt
, ba
, fillWants
, result
, market
): void
Parametersβ
Name | Type |
---|---|
receipt | ContractReceipt |
evt | LogDescription | Event |
ba | BA |
fillWants | boolean |
result | OrderResultWithOptionalSummary |
market | Market |
Returnsβ
void
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:341
getContractEventsFromReceiptβ
βΈ getContractEventsFromReceipt(receipt
, contract
): Event
[] | LogDescription
[]
Parametersβ
Name | Type |
---|---|
receipt | ContractReceipt |
contract | BaseContract |
Returnsβ
Event
[] | LogDescription
[]
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:398
processMangroveEventsβ
βΈ processMangroveEvents(result
, receipt
, ba
, fillWants
, fillVolume
, market
): void
Parametersβ
Name | Type |
---|---|
result | OrderResultWithOptionalSummary |
receipt | ContractReceipt |
ba | BA |
fillWants | boolean |
fillVolume | BigNumber |
market | Market |
Returnsβ
void
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:414
processMangroveOrderEventsβ
βΈ processMangroveOrderEvents(result
, receipt
, ba
, fillWants
, market
): void
Parametersβ
Name | Type |
---|---|
result | OrderResultWithOptionalSummary |
receipt | ContractReceipt |
ba | BA |
fillWants | boolean |
market | Market |
Returnsβ
void
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:437
isOrderResultβ
βΈ isOrderResult(result
): result is OrderResult
Parametersβ
Name | Type |
---|---|
result | OrderResultWithOptionalSummary |
Returnsβ
result is OrderResult
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:459
isCleanResultβ
βΈ isCleanResult(result
): result is OrderResult
Parametersβ
Name | Type |
---|---|
result | OrderResultWithOptionalSummary |
Returnsβ
result is OrderResult
Defined inβ
@mangrovedao/mangrove.js/src/util/tradeEventManagement.ts:465