aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/formatters.ts
blob: 2b6f4ddb7edd282504b76ea97da4df1283fd66c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { Order, OrderAddresses, OrderValues } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';

export const formatters = {
    getOrderAddressesAndValues(order: Order): [OrderAddresses, OrderValues] {
        const orderAddresses: OrderAddresses = [
            order.maker,
            order.taker,
            order.makerTokenAddress,
            order.takerTokenAddress,
            order.feeRecipient,
        ];
        const orderValues: OrderValues = [
            order.makerTokenAmount,
            order.takerTokenAmount,
            order.makerFee,
            order.takerFee,
            order.expirationUnixTimestampSec,
            order.salt,
        ];
        return [orderAddresses, orderValues];
    },
};