aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/test/fixtures/standard_relayer_api
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2017-11-15 07:26:36 +0800
committerBrandon Millman <brandon.millman@gmail.com>2017-11-15 10:55:29 +0800
commit655b0636facc110e9192cc7c3190f4b16f212be9 (patch)
tree562109951a69321e6d8857798d4d5310248b71d7 /packages/connect/test/fixtures/standard_relayer_api
parent5bd8e172c9415e9d8eca2d3893fe767684018351 (diff)
downloaddexon-0x-contracts-655b0636facc110e9192cc7c3190f4b16f212be9.tar.gz
dexon-0x-contracts-655b0636facc110e9192cc7c3190f4b16f212be9.tar.zst
dexon-0x-contracts-655b0636facc110e9192cc7c3190f4b16f212be9.zip
Add connect to monorepo
Diffstat (limited to 'packages/connect/test/fixtures/standard_relayer_api')
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/fees.json5
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/fees.ts8
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json19
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts21
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/orderbook.json44
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/orderbook.ts46
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/orders.json21
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/orders.ts23
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/snapshot_orderbook_channel_message.ts17
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/token_pairs.json16
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/token_pairs.ts19
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/unknown_orderbook_channel_message.ts10
-rw-r--r--packages/connect/test/fixtures/standard_relayer_api/update_orderbook_channel_message.ts17
13 files changed, 266 insertions, 0 deletions
diff --git a/packages/connect/test/fixtures/standard_relayer_api/fees.json b/packages/connect/test/fixtures/standard_relayer_api/fees.json
new file mode 100644
index 000000000..483a74254
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/fees.json
@@ -0,0 +1,5 @@
+{
+ "feeRecipient": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
+ "makerFee": "10000000000000000",
+ "takerFee": "30000000000000000"
+}
diff --git a/packages/connect/test/fixtures/standard_relayer_api/fees.ts b/packages/connect/test/fixtures/standard_relayer_api/fees.ts
new file mode 100644
index 000000000..c57b42717
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/fees.ts
@@ -0,0 +1,8 @@
+import {BigNumber} from 'bignumber.js';
+import {FeesResponse} from '../../../src/types';
+
+export const feesResponse: FeesResponse = {
+ feeRecipient: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ makerFee: new BigNumber('10000000000000000'),
+ takerFee: new BigNumber('30000000000000000'),
+};
diff --git a/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json b/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json
new file mode 100644
index 000000000..e84954b0d
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json
@@ -0,0 +1,19 @@
+{
+ "maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
+ "taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
+ "makerFee": "100000000000000",
+ "takerFee": "200000000000000",
+ "makerTokenAmount": "10000000000000000",
+ "takerTokenAmount": "20000000000000000",
+ "makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
+ "takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
+ "salt": "256",
+ "feeRecipient": "0xb046140686d052fff581f63f8136cce132e857da",
+ "exchangeContractAddress": "0x12459c951127e0c374ff9105dda097662a027093",
+ "expirationUnixTimestampSec": "42",
+ "ecSignature": {
+ "v": 27,
+ "r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
+ "s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
+ }
+}
diff --git a/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts b/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts
new file mode 100644
index 000000000..9df45065c
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.ts
@@ -0,0 +1,21 @@
+import {BigNumber} from 'bignumber.js';
+
+export const orderResponse = {
+ maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerFee: new BigNumber('100000000000000'),
+ takerFee: new BigNumber('200000000000000'),
+ makerTokenAmount: new BigNumber('10000000000000000'),
+ takerTokenAmount: new BigNumber('20000000000000000'),
+ makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
+ salt: new BigNumber('256'),
+ feeRecipient: '0xb046140686d052fff581f63f8136cce132e857da',
+ exchangeContractAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ expirationUnixTimestampSec: new BigNumber('42'),
+ ecSignature: {
+ v: 27,
+ r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
+ },
+};
diff --git a/packages/connect/test/fixtures/standard_relayer_api/orderbook.json b/packages/connect/test/fixtures/standard_relayer_api/orderbook.json
new file mode 100644
index 000000000..bd6e10e4c
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/orderbook.json
@@ -0,0 +1,44 @@
+{
+ "bids": [
+ {
+ "maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
+ "taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
+ "makerFee": "100000000000000",
+ "takerFee": "200000000000000",
+ "makerTokenAmount": "10000000000000000",
+ "takerTokenAmount": "20000000000000000",
+ "makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
+ "takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
+ "salt": "256",
+ "feeRecipient": "0xb046140686d052fff581f63f8136cce132e857da",
+ "exchangeContractAddress": "0x12459c951127e0c374ff9105dda097662a027093",
+ "expirationUnixTimestampSec": "42",
+ "ecSignature": {
+ "v": 27,
+ "r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
+ "s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
+ }
+ }
+ ],
+ "asks": [
+ {
+ "maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
+ "taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
+ "makerFee": "100000000000000",
+ "takerFee": "200000000000000",
+ "makerTokenAmount": "10000000000000000",
+ "takerTokenAmount": "20000000000000000",
+ "makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
+ "takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
+ "salt": "256",
+ "feeRecipient": "0xb046140686d052fff581f63f8136cce132e857da",
+ "exchangeContractAddress": "0x12459c951127e0c374ff9105dda097662a027093",
+ "expirationUnixTimestampSec": "42",
+ "ecSignature": {
+ "v": 27,
+ "r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
+ "s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts
new file mode 100644
index 000000000..529d2b450
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts
@@ -0,0 +1,46 @@
+import {BigNumber} from 'bignumber.js';
+
+export const orderbookResponse = {
+ bids: [
+ {
+ maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerFee: new BigNumber('100000000000000'),
+ takerFee: new BigNumber('200000000000000'),
+ makerTokenAmount: new BigNumber('10000000000000000'),
+ takerTokenAmount: new BigNumber('20000000000000000'),
+ makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
+ salt: new BigNumber('256'),
+ feeRecipient: '0xb046140686d052fff581f63f8136cce132e857da',
+ exchangeContractAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ expirationUnixTimestampSec: new BigNumber('42'),
+ ecSignature: {
+ v: 27,
+ r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
+ },
+ },
+ ],
+ asks: [
+ {
+ maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerFee: new BigNumber('100000000000000'),
+ takerFee: new BigNumber('200000000000000'),
+ makerTokenAmount: new BigNumber('10000000000000000'),
+ takerTokenAmount: new BigNumber('20000000000000000'),
+ makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
+ salt: new BigNumber('256'),
+ feeRecipient: '0xb046140686d052fff581f63f8136cce132e857da',
+ exchangeContractAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ expirationUnixTimestampSec: new BigNumber('42'),
+ ecSignature: {
+ v: 27,
+ r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
+ },
+ },
+ ],
+};
diff --git a/packages/connect/test/fixtures/standard_relayer_api/orders.json b/packages/connect/test/fixtures/standard_relayer_api/orders.json
new file mode 100644
index 000000000..cfa780dc4
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/orders.json
@@ -0,0 +1,21 @@
+[
+ {
+ "maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
+ "taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
+ "makerFee": "100000000000000",
+ "takerFee": "200000000000000",
+ "makerTokenAmount": "10000000000000000",
+ "takerTokenAmount": "20000000000000000",
+ "makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
+ "takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
+ "salt": "256",
+ "feeRecipient": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
+ "exchangeContractAddress": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
+ "expirationUnixTimestampSec": "42",
+ "ecSignature": {
+ "v": 27,
+ "r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
+ "s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
+ }
+ }
+]
diff --git a/packages/connect/test/fixtures/standard_relayer_api/orders.ts b/packages/connect/test/fixtures/standard_relayer_api/orders.ts
new file mode 100644
index 000000000..54c8a150d
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/orders.ts
@@ -0,0 +1,23 @@
+import {BigNumber} from 'bignumber.js';
+
+export const ordersResponse = [
+ {
+ maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerFee: new BigNumber('100000000000000'),
+ takerFee: new BigNumber('200000000000000'),
+ makerTokenAmount: new BigNumber('10000000000000000'),
+ takerTokenAmount: new BigNumber('20000000000000000'),
+ makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
+ salt: new BigNumber('256'),
+ feeRecipient: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ exchangeContractAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ expirationUnixTimestampSec: new BigNumber('42'),
+ ecSignature: {
+ v: 27,
+ r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
+ },
+ },
+];
diff --git a/packages/connect/test/fixtures/standard_relayer_api/snapshot_orderbook_channel_message.ts b/packages/connect/test/fixtures/standard_relayer_api/snapshot_orderbook_channel_message.ts
new file mode 100644
index 000000000..3cedafb20
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/snapshot_orderbook_channel_message.ts
@@ -0,0 +1,17 @@
+import * as orderbookJSON from './orderbook.json';
+
+const orderbookJsonString = JSON.stringify(orderbookJSON);
+
+export const snapshotOrderbookChannelMessage = `{
+ "type": "snapshot",
+ "channel": "orderbook",
+ "channelId": 1,
+ "payload": ${orderbookJsonString}
+}`;
+
+export const malformedSnapshotOrderbookChannelMessage = `{
+ "type": "snapshot",
+ "channel": "orderbook",
+ "channelId": 1,
+ "payload": {}
+}`;
diff --git a/packages/connect/test/fixtures/standard_relayer_api/token_pairs.json b/packages/connect/test/fixtures/standard_relayer_api/token_pairs.json
new file mode 100644
index 000000000..90f57a974
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/token_pairs.json
@@ -0,0 +1,16 @@
+[
+ {
+ "tokenA": {
+ "address": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
+ "minAmount": "0",
+ "maxAmount": "10000000000000000000",
+ "precision": 5
+ },
+ "tokenB": {
+ "address": "0xef7fff64389b814a946f3e92105513705ca6b990",
+ "minAmount": "0",
+ "maxAmount": "50000000000000000000",
+ "precision": 5
+ }
+ }
+]
diff --git a/packages/connect/test/fixtures/standard_relayer_api/token_pairs.ts b/packages/connect/test/fixtures/standard_relayer_api/token_pairs.ts
new file mode 100644
index 000000000..250277436
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/token_pairs.ts
@@ -0,0 +1,19 @@
+import {BigNumber} from 'bignumber.js';
+import {TokenPairsItem} from '../../../src/types';
+
+export const tokenPairsResponse: TokenPairsItem[] = [
+ {
+ tokenA: {
+ address: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ minAmount: new BigNumber(0),
+ maxAmount: new BigNumber('10000000000000000000'),
+ precision: 5,
+ },
+ tokenB: {
+ address: '0xef7fff64389b814a946f3e92105513705ca6b990',
+ minAmount: new BigNumber(0),
+ maxAmount: new BigNumber('50000000000000000000'),
+ precision: 5,
+ },
+ },
+];
diff --git a/packages/connect/test/fixtures/standard_relayer_api/unknown_orderbook_channel_message.ts b/packages/connect/test/fixtures/standard_relayer_api/unknown_orderbook_channel_message.ts
new file mode 100644
index 000000000..842738d99
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/unknown_orderbook_channel_message.ts
@@ -0,0 +1,10 @@
+import * as orderResponseJSON from './order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json';
+
+const orderJSONString = JSON.stringify(orderResponseJSON);
+
+export const unknownOrderbookChannelMessage = `{
+ "type": "superGoodUpdate",
+ "channel": "orderbook",
+ "channelId": 1,
+ "payload": ${orderJSONString}
+}`;
diff --git a/packages/connect/test/fixtures/standard_relayer_api/update_orderbook_channel_message.ts b/packages/connect/test/fixtures/standard_relayer_api/update_orderbook_channel_message.ts
new file mode 100644
index 000000000..bc83854c6
--- /dev/null
+++ b/packages/connect/test/fixtures/standard_relayer_api/update_orderbook_channel_message.ts
@@ -0,0 +1,17 @@
+import * as orderResponseJSON from './order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json';
+
+const orderJSONString = JSON.stringify(orderResponseJSON);
+
+export const updateOrderbookChannelMessage = `{
+ "type": "update",
+ "channel": "orderbook",
+ "channelId": 1,
+ "payload": ${orderJSONString}
+}`;
+
+export const malformedUpdateOrderbookChannelMessage = `{
+ "type": "update",
+ "channel": "orderbook",
+ "channelId": 1,
+ "payload": {}
+}`;