aboutsummaryrefslogtreecommitdiffstats
path: root/src/schemas
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-03 00:53:21 +0800
committerGitHub <noreply@github.com>2017-06-03 00:53:21 +0800
commitc83587a16d016d1efafaf31abb9b39eb54128568 (patch)
treeac53dfb35344c644096f574802eb64eab5955f90 /src/schemas
parentb8ff2468776e1c784ff50e5ada1c633ee0d3aeda (diff)
parent3fad55d118b6a2f8f44ba5dec7fdae276c806eb3 (diff)
downloaddexon-sol-tools-c83587a16d016d1efafaf31abb9b39eb54128568.tar
dexon-sol-tools-c83587a16d016d1efafaf31abb9b39eb54128568.tar.gz
dexon-sol-tools-c83587a16d016d1efafaf31abb9b39eb54128568.tar.bz2
dexon-sol-tools-c83587a16d016d1efafaf31abb9b39eb54128568.tar.lz
dexon-sol-tools-c83587a16d016d1efafaf31abb9b39eb54128568.tar.xz
dexon-sol-tools-c83587a16d016d1efafaf31abb9b39eb54128568.tar.zst
dexon-sol-tools-c83587a16d016d1efafaf31abb9b39eb54128568.zip
Merge pull request #30 from 0xProject/fillOrderAsync
fillOrderAsync
Diffstat (limited to 'src/schemas')
-rw-r--r--src/schemas/order_schemas.ts50
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'],
+ },
+ ],
+};