aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-spec/src/examples
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-27 22:28:57 +0800
committerFabio Berger <me@fabioberger.com>2018-08-27 22:28:57 +0800
commitb8241c0f808518a3f727424cacb952cc9ce80c4c (patch)
tree309abba264ea3578cefdc8d7a4f53ef482ff26c9 /packages/sra-spec/src/examples
parentfe7a8be98c32c6aed8548574e67e36962db732fb (diff)
parentf4a4fefe422a5b2140d5bb394a7f06f842352c69 (diff)
downloaddexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar
dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.gz
dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.bz2
dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.lz
dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.xz
dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.tar.zst
dexon-sol-tools-b8241c0f808518a3f727424cacb952cc9ce80c4c.zip
Merge branch 'development' into dev-dropdown
* development: (120 commits) Exit with non-error code at end of publishRelease Publish Updated CHANGELOGS Fix prettier Update changelog files for RC packages Skip doc generation for local publishes since we test this in a separate CI test Fix typo Use absolute path Run yarn a second time if the first fails Try relative to root dir Fix command Move md files to lib folder during build Change exit code to failure Fix sra-spec `main` and `types` in package.json Actual relative path Try relative path Issue #1025 BlockParam unroll Fix command Move md files to lib folder during build Fix sra-spec `main` and `types` in package.json ...
Diffstat (limited to 'packages/sra-spec/src/examples')
-rw-r--r--packages/sra-spec/src/examples/errors.ts11
-rw-r--r--packages/sra-spec/src/examples/index.ts21
-rw-r--r--packages/sra-spec/src/examples/relayerApiAssetDataPairsResponse.ts21
-rw-r--r--packages/sra-spec/src/examples/relayerApiFeeRecipientsResponse.ts10
-rw-r--r--packages/sra-spec/src/examples/relayerApiOrder.ts19
-rw-r--r--packages/sra-spec/src/examples/relayerApiOrderConfigPayload.ts10
-rw-r--r--packages/sra-spec/src/examples/relayerApiOrderConfigResponse.ts6
-rw-r--r--packages/sra-spec/src/examples/relayerApiOrderbookResponse.ts54
-rw-r--r--packages/sra-spec/src/examples/relayerApiOrdersResponse.ts26
-rw-r--r--packages/sra-spec/src/examples/signedOrder.ts16
10 files changed, 194 insertions, 0 deletions
diff --git a/packages/sra-spec/src/examples/errors.ts b/packages/sra-spec/src/examples/errors.ts
new file mode 100644
index 000000000..81f29d81c
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/index.ts b/packages/sra-spec/src/examples/index.ts
new file mode 100644
index 000000000..dcf9b13eb
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/relayerApiAssetDataPairsResponse.ts b/packages/sra-spec/src/examples/relayerApiAssetDataPairsResponse.ts
new file mode 100644
index 000000000..9eead5239
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/relayerApiFeeRecipientsResponse.ts b/packages/sra-spec/src/examples/relayerApiFeeRecipientsResponse.ts
new file mode 100644
index 000000000..0182af629
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/relayerApiOrder.ts b/packages/sra-spec/src/examples/relayerApiOrder.ts
new file mode 100644
index 000000000..31181d677
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/relayerApiOrderConfigPayload.ts b/packages/sra-spec/src/examples/relayerApiOrderConfigPayload.ts
new file mode 100644
index 000000000..5251d5b4d
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/relayerApiOrderConfigResponse.ts b/packages/sra-spec/src/examples/relayerApiOrderConfigResponse.ts
new file mode 100644
index 000000000..a3c531c0a
--- /dev/null
+++ b/packages/sra-spec/src/examples/relayerApiOrderConfigResponse.ts
@@ -0,0 +1,6 @@
+export const relayerApiOrderConfigResponse = {
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+};
diff --git a/packages/sra-spec/src/examples/relayerApiOrderbookResponse.ts b/packages/sra-spec/src/examples/relayerApiOrderbookResponse.ts
new file mode 100644
index 000000000..40c09eff9
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/relayerApiOrdersResponse.ts b/packages/sra-spec/src/examples/relayerApiOrdersResponse.ts
new file mode 100644
index 000000000..ac16e7e34
--- /dev/null
+++ b/packages/sra-spec/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-spec/src/examples/signedOrder.ts b/packages/sra-spec/src/examples/signedOrder.ts
new file mode 100644
index 000000000..440566027
--- /dev/null
+++ b/packages/sra-spec/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',
+};