aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/schemas/call_data_schema.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-05 18:33:48 +0800
committerFabio Berger <me@fabioberger.com>2018-07-05 18:33:48 +0800
commit2a7b3aecc3886bb4b699df17a0efef984e633d1f (patch)
treeade60c329313350fcfb59d5372bf22f253eccff2 /packages/json-schemas/schemas/call_data_schema.ts
parent75babed69317ab1da02a10706871ab0bb2293883 (diff)
downloaddexon-0x-contracts-2a7b3aecc3886bb4b699df17a0efef984e633d1f.tar
dexon-0x-contracts-2a7b3aecc3886bb4b699df17a0efef984e633d1f.tar.gz
dexon-0x-contracts-2a7b3aecc3886bb4b699df17a0efef984e633d1f.tar.bz2
dexon-0x-contracts-2a7b3aecc3886bb4b699df17a0efef984e633d1f.tar.lz
dexon-0x-contracts-2a7b3aecc3886bb4b699df17a0efef984e633d1f.tar.xz
dexon-0x-contracts-2a7b3aecc3886bb4b699df17a0efef984e633d1f.tar.zst
dexon-0x-contracts-2a7b3aecc3886bb4b699df17a0efef984e633d1f.zip
Add CallData schema to json-schemas
Diffstat (limited to 'packages/json-schemas/schemas/call_data_schema.ts')
-rw-r--r--packages/json-schemas/schemas/call_data_schema.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/json-schemas/schemas/call_data_schema.ts b/packages/json-schemas/schemas/call_data_schema.ts
new file mode 100644
index 000000000..e8fcc7512
--- /dev/null
+++ b/packages/json-schemas/schemas/call_data_schema.ts
@@ -0,0 +1,27 @@
+export const callDataSchema = {
+ 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: [],
+ type: 'object',
+ additionalProperties: false,
+};