aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/schemas/order_schemas.ts
blob: 183118c2341d033ba0dbe2b7dff62bf22fa98deb (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
36
37
38
39
40
41
42
43
export const orderSchema = {
    id: '/Order',
    properties: {
        makerAddress: { $ref: '/Address' },
        takerAddress: { $ref: '/Address' },
        makerFee: { $ref: '/Number' },
        takerFee: { $ref: '/Number' },
        makerAssetAmount: { $ref: '/Number' },
        takerAssetAmount: { $ref: '/Number' },
        makerAssetData: { $ref: '/Hex' },
        takerAssetData: { $ref: '/Hex' },
        salt: { $ref: '/Number' },
        feeRecipientAddress: { $ref: '/Address' },
        expirationTimeSeconds: { $ref: '/Number' },
    },
    required: [
        'makerAddress',
        'takerAddress',
        'makerFee',
        'takerFee',
        'makerAssetAmount',
        'takerAssetAmount',
        'makerAssetData',
        'takerAssetData',
        'salt',
        'feeRecipientAddress',
        'expirationTimeSeconds',
    ],
    type: 'object',
};

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