aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-api/src/examples
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-15 05:21:47 +0800
committerFabio Berger <me@fabioberger.com>2018-08-15 05:21:47 +0800
commit2f2582a0da3095d61a99ef09744dc0995677558e (patch)
tree54989565919038c42d495dafb7426d4148605e84 /packages/sra-api/src/examples
parent8169155a6547fb0283cd0f5362aad3c0b173b00b (diff)
parentfadd292ecf367e42154856509d0ea0c20b23f2f1 (diff)
downloaddexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar
dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar.gz
dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar.bz2
dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar.lz
dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar.xz
dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar.zst
dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.zip
Merge development
Diffstat (limited to 'packages/sra-api/src/examples')
-rw-r--r--packages/sra-api/src/examples/errors.ts11
-rw-r--r--packages/sra-api/src/examples/index.ts21
-rw-r--r--packages/sra-api/src/examples/relayerApiAssetDataPairsResponse.ts21
-rw-r--r--packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts10
-rw-r--r--packages/sra-api/src/examples/relayerApiOrder.ts19
-rw-r--r--packages/sra-api/src/examples/relayerApiOrderConfig0
-rw-r--r--packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts10
-rw-r--r--packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts6
-rw-r--r--packages/sra-api/src/examples/relayerApiOrderbookResponse.ts54
-rw-r--r--packages/sra-api/src/examples/relayerApiOrdersResponse.ts26
-rw-r--r--packages/sra-api/src/examples/signedOrder.ts16
11 files changed, 194 insertions, 0 deletions
diff --git a/packages/sra-api/src/examples/errors.ts b/packages/sra-api/src/examples/errors.ts
new file mode 100644
index 000000000..81f29d81c
--- /dev/null
+++ b/packages/sra-api/src/examples/errors.ts
@@ -0,0 +1,11 @@
+export const validationError = {
+ code: 100,
+ reason: 'Validation failed',
+ validationErrors: [
+ {
+ field: 'networkId',
+ code: 1006,
+ reason: 'Network id 42 is not supported',
+ },
+ ],
+};
diff --git a/packages/sra-api/src/examples/index.ts b/packages/sra-api/src/examples/index.ts
new file mode 100644
index 000000000..dcf9b13eb
--- /dev/null
+++ b/packages/sra-api/src/examples/index.ts
@@ -0,0 +1,21 @@
+import { validationError } from './errors';
+import { relayerApiAssetDataPairsResponse } from './relayerApiAssetDataPairsResponse';
+import { relayerApiFeeRecipientsResponse } from './relayerApiFeeRecipientsResponse';
+import { relayerApiOrder } from './relayerApiOrder';
+import { relayerApiOrderbookResponse } from './relayerApiOrderbookResponse';
+import { relayerApiOrderConfigPayload } from './relayerApiOrderConfigPayload';
+import { relayerApiOrderConfigResponse } from './relayerApiOrderConfigResponse';
+import { relayerApiOrdersResponse } from './relayerApiOrdersResponse';
+import { signedOrder } from './signedOrder';
+
+export const examples = {
+ validationError,
+ relayerApiAssetDataPairsResponse,
+ relayerApiFeeRecipientsResponse,
+ relayerApiOrder,
+ relayerApiOrderbookResponse,
+ relayerApiOrderConfigPayload,
+ relayerApiOrderConfigResponse,
+ relayerApiOrdersResponse,
+ signedOrder,
+};
diff --git a/packages/sra-api/src/examples/relayerApiAssetDataPairsResponse.ts b/packages/sra-api/src/examples/relayerApiAssetDataPairsResponse.ts
new file mode 100644
index 000000000..9eead5239
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiAssetDataPairsResponse.ts
@@ -0,0 +1,21 @@
+export const relayerApiAssetDataPairsResponse = {
+ total: 43,
+ page: 1,
+ perPage: 100,
+ records: [
+ {
+ assetDataA: {
+ minAmount: '0',
+ maxAmount: '10000000000000000000',
+ precision: 5,
+ assetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ },
+ assetDataB: {
+ minAmount: '0',
+ maxAmount: '50000000000000000000',
+ precision: 5,
+ assetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ },
+ },
+ ],
+};
diff --git a/packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts b/packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts
new file mode 100644
index 000000000..0182af629
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts
@@ -0,0 +1,10 @@
+export const relayerApiFeeRecipientsResponse = {
+ total: 3,
+ page: 1,
+ perPage: 10,
+ records: [
+ '0x6eC92694ea172ebC430C30fa31De87620967A082',
+ '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ ],
+};
diff --git a/packages/sra-api/src/examples/relayerApiOrder.ts b/packages/sra-api/src/examples/relayerApiOrder.ts
new file mode 100644
index 000000000..31181d677
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrder.ts
@@ -0,0 +1,19 @@
+export const relayerApiOrder = {
+ order: {
+ makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '10000000000000000',
+ takerAssetAmount: '20000000000000000',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+ expirationTimeSeconds: '1532560590',
+ salt: '1532559225',
+ makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ },
+ metaData: {},
+};
diff --git a/packages/sra-api/src/examples/relayerApiOrderConfig b/packages/sra-api/src/examples/relayerApiOrderConfig
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrderConfig
diff --git a/packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts b/packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts
new file mode 100644
index 000000000..5251d5b4d
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts
@@ -0,0 +1,10 @@
+export const relayerApiOrderConfigPayload = {
+ makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '10000000000000000',
+ takerAssetAmount: '20000000000000000',
+ makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ expirationTimeSeconds: '1532560590',
+};
diff --git a/packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts b/packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts
new file mode 100644
index 000000000..a3c531c0a
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts
@@ -0,0 +1,6 @@
+export const relayerApiOrderConfigResponse = {
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+};
diff --git a/packages/sra-api/src/examples/relayerApiOrderbookResponse.ts b/packages/sra-api/src/examples/relayerApiOrderbookResponse.ts
new file mode 100644
index 000000000..40c09eff9
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrderbookResponse.ts
@@ -0,0 +1,54 @@
+export const relayerApiOrderbookResponse = {
+ bids: {
+ total: 325,
+ page: 2,
+ perPage: 100,
+ records: [
+ {
+ order: {
+ makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '10000000000000000',
+ takerAssetAmount: '20000000000000000',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+ expirationTimeSeconds: '1532560590',
+ salt: '1532559225',
+ makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ },
+ metaData: {},
+ },
+ ],
+ },
+ asks: {
+ total: 500,
+ page: 2,
+ perPage: 100,
+ records: [
+ {
+ order: {
+ makerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ takerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '20000000000000000',
+ takerAssetAmount: '10000000000000000',
+ makerFee: '200000000000000',
+ takerFee: '100000000000000',
+ expirationTimeSeconds: '1532560590',
+ salt: '1532559225',
+ makerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ takerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ signature: '0x013842a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b3518891',
+ },
+ metaData: {},
+ },
+ ],
+ },
+};
diff --git a/packages/sra-api/src/examples/relayerApiOrdersResponse.ts b/packages/sra-api/src/examples/relayerApiOrdersResponse.ts
new file mode 100644
index 000000000..ac16e7e34
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrdersResponse.ts
@@ -0,0 +1,26 @@
+export const relayerApiOrdersResponse = {
+ total: 984,
+ page: 1,
+ perPage: 100,
+ records: [
+ {
+ order: {
+ makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '10000000000000000',
+ takerAssetAmount: '20000000000000000',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+ expirationTimeSeconds: '1532560590',
+ salt: '1532559225',
+ makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ },
+ metaData: {},
+ },
+ ],
+};
diff --git a/packages/sra-api/src/examples/signedOrder.ts b/packages/sra-api/src/examples/signedOrder.ts
new file mode 100644
index 000000000..440566027
--- /dev/null
+++ b/packages/sra-api/src/examples/signedOrder.ts
@@ -0,0 +1,16 @@
+export const signedOrder = {
+ makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '10000000000000000',
+ takerAssetAmount: '20000000000000000',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+ expirationTimeSeconds: '1532560590',
+ salt: '1532559225',
+ makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+};