aboutsummaryrefslogblamecommitdiffstats
path: root/packages/json-schemas/schemas/tx_data_schema.ts
blob: 4274c553fc676b532065d7f4792d9d46bab34199 (plain) (tree)
1
2
3
4
5
6
7
8
9








                             

                                   
                
                                                                

              
                                                                

                   
                                                                













                                     
export const jsNumber = {
    id: '/JsNumber',
    type: 'number',
    minimum: 0,
};

export const txDataSchema = {
    id: '/TxData',
    properties: {
        from: { $ref: '/Address' },
        to: { $ref: '/Address' },
        value: {
            oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
        },
        gas: {
            oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
        },
        gasPrice: {
            oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
        },
        data: {
            type: 'string',
            pattern: '^0x[0-9a-f]*$',
        },
        nonce: {
            type: 'number',
            minimum: 0,
        },
    },
    required: ['from'],
    type: 'object',
    additionalProperties: false,
};