Skip to content

Commit

Permalink
feat: do same as previous, but on Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito committed Dec 30, 2024
1 parent dfff7ee commit 9cf3ac8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
14 changes: 11 additions & 3 deletions apps/explorer/src/api/operator/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ export type RawOrder = EnrichedOrder
*/
export type Order = Pick<
RawOrder,
'owner' | 'uid' | 'appData' | 'kind' | 'partiallyFillable' | 'signature' | 'class' | 'fullAppData'
| 'owner'
| 'uid'
| 'appData'
| 'kind'
| 'partiallyFillable'
| 'signature'
| 'class'
| 'fullAppData'
| 'executedFeeToken'
> & {
receiver: string
txHash?: string
Expand All @@ -35,7 +43,7 @@ export type Order = Pick<
executedSellAmount: BigNumber
feeAmount: BigNumber
executedFeeAmount: BigNumber
executedSurplusFee: BigNumber | null
executedFee: BigNumber | null
totalFee: BigNumber
cancelled: boolean
status: OrderStatus
Expand All @@ -60,7 +68,7 @@ export type Trade = Pick<RawTrade, 'blockNumber' | 'logIndex' | 'owner' | 'txHas
kind?: OrderKind
buyAmount: BigNumber
sellAmount: BigNumber
executedSurplusFee?: BigNumber
executedFee?: BigNumber
sellAmountBeforeFees: BigNumber
buyToken?: TokenErc20 | null
buyTokenAddress: string
Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/src/test/data/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const RAW_ORDER = {
executedSellAmount: '0',
feeAmount: '0',
executedFeeAmount: '0',
executedSurplusFee: '0',
executedFee: '0',
executedSellAmountBeforeFees: '0',
totalFee: '0',
sellToken: WETH.address,
Expand All @@ -49,7 +49,7 @@ export const RICH_ORDER: Order = {
executedSellAmount: ZERO_BIG_NUMBER,
feeAmount: new BigNumber(RAW_ORDER.feeAmount),
executedFeeAmount: new BigNumber(RAW_ORDER.executedFeeAmount),
executedSurplusFee: ZERO_BIG_NUMBER,
executedFee: ZERO_BIG_NUMBER,
totalFee: ZERO_BIG_NUMBER,
cancelled: RAW_ORDER.invalidated,
status: 'open',
Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/src/utils/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export function transformOrder(rawOrder: RawOrder): Order {
sellAmount,
feeAmount,
executedFeeAmount,
executedSurplusFee,
executedFee,
totalFee,
invalidated,
...rest
Expand All @@ -397,7 +397,7 @@ export function transformOrder(rawOrder: RawOrder): Order {
executedSellAmount,
feeAmount: new BigNumber(feeAmount),
executedFeeAmount: new BigNumber(executedFeeAmount),
executedSurplusFee: executedSurplusFee ? new BigNumber(executedSurplusFee) : null,
executedFee: executedFee ? new BigNumber(executedFee) : null,
totalFee: new BigNumber(totalFee),
cancelled: invalidated,
status,
Expand Down

0 comments on commit 9cf3ac8

Please sign in to comment.