aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/schemas/order_schemas.ts
blob: 3cce493516d9de06e5f64eeeadf9e65c0b948b37 (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
24
25
26
27
28
29
30
31
32
33
34
35
export const orderSchema = {
    id: '/Order',
    properties: {
        maker: {$ref: '/Address'},
        taker: {$ref: '/Address'},
        makerFee: {$ref: '/Number'},
        takerFee: {$ref: '/Number'},
        makerTokenAmount: {$ref: '/Number'},
        takerTokenAmount: {$ref: '/Number'},
        makerTokenAddress: {$ref: '/Address'},
        takerTokenAddress: {$ref: '/Address'},
        salt: {$ref: '/Number'},
        feeRecipient: {$ref: '/Address'},
        expirationUnixTimestampSec: {$ref: '/Number'},
        exchangeContractAddress: {$ref: '/Address'},
    },
    required: [
        'maker', 'taker', 'makerFee', 'takerFee', 'makerTokenAmount', 'takerTokenAmount',
        'salt', 'feeRecipient', 'expirationUnixTimestampSec', 'exchangeContractAddress',
    ],
    type: 'object',
};

export const signedOrderSchema = {
    id: '/SignedOrder',
    allOf: [
        { $ref: '/Order' },
        {
            properties: {
                ecSignature: {$ref: '/ECSignature'},
            },
            required: ['ecSignature'],
        },
    ],
};