{"size": 1600, "ext": "js", "max_stars_repo_path": "cryptowallet/src/components/transactions/ethereum/ethereumFields.js", "max_stars_repo_name": "vasinkd/cryptowallet", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "cryptowallet/src/components/transactions/ethereum/ethereumFields.js", "max_issues_repo_name": "vasinkd/cryptowallet", "max_issues_repo_issues_event_min_datetime": "2018-05-03T15:28:57.000Z", "max_issues_repo_issues_event_max_datetime": "2018-10-07T21:13:43.000Z", "max_forks_repo_path": "cryptowallet/src/components/transactions/ethereum/ethereumFields.js", "max_forks_repo_name": "vasinkd/WMSCrypto", "max_forks_repo_forks_event_min_datetime": "2018-11-12T03:29:56.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-19T16:43:48.000Z"}
{"max_stars_count": null, "max_issues_count": 28, "max_forks_count": 2, "avg_line_length": 27.1186440678, "max_line_length": 92, "alphanum_fraction": 0.476875}
import { fieldTests, fieldCreator } from "../../../core/fields";

export default {
    'account': fieldCreator({
        name: 'Account',
        def: 0,
        fTest: fieldTests.integer,
        iTest: fieldTests.integer,
    }),
    'change': fieldCreator({
        name: 'Change',
        def: 0,
        fTest: fieldTests.integer,
        iTest: fieldTests.integer,
    }),
    'address': fieldCreator({
        name: 'Address',
        def: 0,
        fTest: fieldTests.integer,
        iTest: fieldTests.integer,
    }),
    'nonce': fieldCreator({
        name: 'Nonce',
        def: 0,
        fTest: fieldTests.integer,
        iTest: fieldTests.integer,
    }),
    'gasPrice': fieldCreator({
        name: 'Gas price (wei)',
        def: 0,
        fTest: fieldTests.integer,
        iTest: fieldTests.integer,
    }),
    'gasLimit': fieldCreator({
        name: 'Gas limit',
        def: 0,
        fTest: fieldTests.integer,
        iTest: fieldTests.integer,
    }),
    'to': fieldCreator({
        name: 'To',
        def: '',
        fTest: (v) => v ? /^0x[\da-fA-F]{40}$/.test(v) : false,
        iTest: (v) =>  v ? v === '0' || v === '0x' || /^0x[\da-fA-F]{0,40}$/.test(v) : false
    }),
    'value': fieldCreator({
        name: 'Value (wei)',
        def: 0,
        fTest: fieldTests.integer,
        iTest: fieldTests.integer,
    }),
    'data': fieldCreator({
        name: 'Data',
        def: '',
        fTest: (v) => v === '' || (v ? /^0x[\da-fA-F]+$/.test(v) : false),
        iTest: (v) =>  v ? v === '0' || v === '0x' || /^0x[\da-fA-F]*$/.test(v) : false
    }),
}
