diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-03 01:45:57 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-03 01:45:57 +0800 |
commit | 1443c0838cbd795ae8e6273b1d7659c8e449f2eb (patch) | |
tree | 531df9d489dd4c5ce15623bee0beeae3ad58ccd4 /src/schemas/order_schemas.ts | |
parent | 3de655954743db4e2b9d02f5ac1243855b909236 (diff) | |
parent | d4320fec724c5bf34e7dcd006cba8ffe7a3c76d1 (diff) | |
download | dexon-sol-tools-1443c0838cbd795ae8e6273b1d7659c8e449f2eb.tar dexon-sol-tools-1443c0838cbd795ae8e6273b1d7659c8e449f2eb.tar.gz dexon-sol-tools-1443c0838cbd795ae8e6273b1d7659c8e449f2eb.tar.bz2 dexon-sol-tools-1443c0838cbd795ae8e6273b1d7659c8e449f2eb.tar.lz dexon-sol-tools-1443c0838cbd795ae8e6273b1d7659c8e449f2eb.tar.xz dexon-sol-tools-1443c0838cbd795ae8e6273b1d7659c8e449f2eb.tar.zst dexon-sol-tools-1443c0838cbd795ae8e6273b1d7659c8e449f2eb.zip |
Merge branch 'master' into remainingTokenMethods
# Conflicts:
# src/types.ts
# src/web3_wrapper.ts
Diffstat (limited to 'src/schemas/order_schemas.ts')
-rw-r--r-- | src/schemas/order_schemas.ts | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/schemas/order_schemas.ts b/src/schemas/order_schemas.ts new file mode 100644 index 000000000..72012dc26 --- /dev/null +++ b/src/schemas/order_schemas.ts @@ -0,0 +1,50 @@ +export const addressSchema = { + id: '/addressSchema', + type: 'string', + pattern: '^0[xX][0-9A-Fa-f]{40}$', +}; + +export const numberSchema = { + id: '/numberSchema', + type: 'string', + format: '\d+(\.\d+)?', +}; + +export const orderSchema = { + id: '/orderSchema', + properties: { + maker: {$ref: '/addressSchema'}, + taker: {$ref: '/addressSchema'}, + + makerFee: {$ref: '/numberSchema'}, + takerFee: {$ref: '/numberSchema'}, + + makerTokenAmount: {$ref: '/numberSchema'}, + takerTokenAmount: {$ref: '/numberSchema'}, + + makerTokenAddress: {$ref: '/addressSchema'}, + takerTokenAddress: {$ref: '/addressSchema'}, + + salt: {$ref: '/numberSchema'}, + feeRecipient: {$ref: '/addressSchema'}, + expirationUnixTimestampSec: {$ref: '/numberSchema'}, + }, + required: [ + 'maker', 'taker', 'makerFee', 'takerFee', 'makerTokenAmount', 'takerTokenAmount', + 'salt', 'feeRecipient', 'expirationUnixTimestampSec', + ], + type: 'object', +}; + +export const signedOrderSchema = { + id: '/signedOrderSchema', + allOf: [ + { $ref: '/orderSchema' }, + { + properties: { + ecSignature: {$ref: '/ECSignature'}, + }, + required: ['ecSignature'], + }, + ], +}; |