diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-03-06 16:20:36 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-03-06 16:20:36 +0800 |
commit | 551771235bc80209a1f3aafff56438621885f61a (patch) | |
tree | 0c73b2b86e0ea73084b00b494c1f186683bf9ad9 /packages/sra-report | |
parent | eb201c4084834e06fc8376434e8a7f793f916c24 (diff) | |
download | dexon-0x-contracts-551771235bc80209a1f3aafff56438621885f61a.tar.gz dexon-0x-contracts-551771235bc80209a1f3aafff56438621885f61a.tar.zst dexon-0x-contracts-551771235bc80209a1f3aafff56438621885f61a.zip |
Prettier
Diffstat (limited to 'packages/sra-report')
5 files changed, 922 insertions, 985 deletions
diff --git a/packages/sra-report/postman_configs/collections/sra_report.postman_collection.json b/packages/sra-report/postman_configs/collections/sra_report.postman_collection.json index fc7dd5b65..04c7bc51f 100644 --- a/packages/sra-report/postman_configs/collections/sra_report.postman_collection.json +++ b/packages/sra-report/postman_configs/collections/sra_report.postman_collection.json @@ -1,974 +1,909 @@ { - "info": { - "name": "sra_report", - "_postman_id": "d5828163-ddb9-46a9-ec39-c2b81417b6c0", - "description": "[Standard Relayer API](\nhttps://github.com/0xProject/standard-relayer-api)\n\n\n0x Protocol is an open standard. Because of this, we expect many independent applications to be built that will want to use the protocol. In order to make it easier for anyone to source liquidity that conforms to the 0x order format, relayers can opt-in to implementing a set of standard relayer API endpoints. In doing so, they allow clients of the standard relayer API to access the orders on their orderbook.", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "GET /token_pairs", - "description": "", - "item": [ - { - "name": "default request", - "event": [ - { - "listen": "test", - "script": { - "id": "42cb5e3f-6013-4a7c-b341-0d10cb3f2c9c", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/token_pairs", - "host": [ - "{{url}}" - ], - "path": [ - "token_pairs" - ] - }, - "description": "" - }, - "response": [] - }, - { - "name": "tokenA param", - "event": [ - { - "listen": "test", - "script": { - "id": "1b61aabb-ef9f-4269-9a0c-cb7559afcbd8", - "type": "text/javascript", - "exec": [ - "const filterTokenEnvKey = 'WETH_address';", - "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Token pairs are properly filtered', function() {", - " _.forEach(responseJsonData, function(tokenPair) {", - " const tokenAIsFilterToken = _.get(tokenPair, 'tokenA.address') === filterTokenAddress;", - " const tokenBIsFilterToken = _.get(tokenPair, 'tokenB.address') === filterTokenAddress;", - " const condition = tokenAIsFilterToken || tokenBIsFilterToken", - " pm.expect(condition).to.be.true;", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/token_pairs?tokenA={{WETH_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "token_pairs" - ], - "query": [ - { - "key": "tokenA", - "value": "{{WETH_address}}", - "equals": true - } - ] - }, - "description": "" - }, - "response": [] - }, - { - "name": "tokenB param", - "event": [ - { - "listen": "test", - "script": { - "id": "a5f946b1-fc97-4bcf-ae01-e0f97864a6c1", - "type": "text/javascript", - "exec": [ - "const filterTokenEnvKey = 'WETH_address';", - "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Token pairs are properly filtered', function() {", - " _.forEach(responseJsonData, function(tokenPair) {", - " const tokenAIsFilterToken = _.get(tokenPair, 'tokenA.address') === filterTokenAddress;", - " const tokenBIsFilterToken = _.get(tokenPair, 'tokenB.address') === filterTokenAddress;", - " const condition = tokenAIsFilterToken || tokenBIsFilterToken", - " pm.expect(condition).to.be.true;", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/token_pairs?tokenB={{WETH_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "token_pairs" - ], - "query": [ - { - "key": "tokenB", - "value": "{{WETH_address}}", - "equals": true - } - ] - }, - "description": "" - }, - "response": [] - }, - { - "name": "tokenA and tokenB params", - "event": [ - { - "listen": "test", - "script": { - "id": "bcd06e4f-aa3a-42f8-9f8c-bc902eb7a075", - "type": "text/javascript", - "exec": [ - "const filterTokenAEnvKey = 'WETH_address';", - "const filterTokenBEnvKey = 'ZRX_address';", - "const filterTokenAAddress = pm.environment.get(filterTokenAEnvKey);", - "const filterTokenBAddress = pm.environment.get(filterTokenBEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Token pairs are properly filtered', function() {", - " _.forEach(responseJsonData, function(tokenPair) {", - " const tokenAIsFilterTokenA = _.get(tokenPair, 'tokenA.address') === filterTokenAAddress;", - " const tokenAIsFilterTokenB = _.get(tokenPair, 'tokenA.address') === filterTokenBAddress;", - " const tokenBIsFilterTokenA = _.get(tokenPair, 'tokenB.address') === filterTokenAAddress;", - " const tokenBIsFilterTokenB = _.get(tokenPair, 'tokenB.address') === filterTokenBAddress;", - " const condition = (tokenAIsFilterTokenA && tokenBIsFilterTokenB) || (tokenBIsFilterTokenA && tokenAIsFilterTokenB)", - " pm.expect(condition).to.be.true;", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/token_pairs?tokenA={{WETH_address}}&tokenB={{ZRX_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "token_pairs" - ], - "query": [ - { - "key": "tokenA", - "value": "{{WETH_address}}", - "equals": true - }, - { - "key": "tokenB", - "value": "{{ZRX_address}}", - "equals": true - } - ] - }, - "description": "" - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "3d032e92-6a17-49f0-8115-bae1c7298b55", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "25addb38-bd1c-4eb3-a193-5617119dc0d6", - "type": "text/javascript", - "exec": [ - "const schema = tv4.getSchema('/RelayerApiTokenPairsResponse');", - "const responseJsonData = pm.response.json();", - "", - "pm.test('Schema is valid', function() {", - " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", - "});", - "" - ] - } - } - ] - }, - { - "name": "GET /orders", - "description": "", - "item": [ - { - "name": "default request", - "event": [ - { - "listen": "test", - "script": { - "id": "118f47dd-1d93-4288-841f-de88783eff3b", - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "exchangeContract param", - "event": [ - { - "listen": "test", - "script": { - "id": "e782ae77-66bf-4096-9190-ef9e7501b316", - "type": "text/javascript", - "exec": [ - "const exchangeContractEnvKey = 'EXCHANGE_CONTRACT_address';", - "const requestedExchangeContractAddress = pm.environment.get(exchangeContractEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const returnedExchangeContractAddress = _.get(order, 'exchangeContractAddress');", - " pm.expect(requestedExchangeContractAddress).to.equal(returnedExchangeContractAddress);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?exchangeContractAddress={{EXCHANGE_CONTRACT_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "exchangeContractAddress", - "value": "{{EXCHANGE_CONTRACT_address}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "tokenAddress param", - "event": [ - { - "listen": "test", - "script": { - "id": "1144a2d6-6175-40a6-8568-d0d3884492a1", - "type": "text/javascript", - "exec": [ - "const filterTokenEnvKey = 'ZRX_address';", - "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const makerTokenAddress = _.get(order, 'makerTokenAddress');", - " const takerTokenAddress = _.get(order, 'takerTokenAddress');", - " const makerTokenAddressIsFilterToken = makerTokenAddress === filterTokenAddress;", - " const takerTokenAddressIsFilterToken = takerTokenAddress === filterTokenAddress;", - " const condition = makerTokenAddressIsFilterToken || takerTokenAddressIsFilterToken;", - " pm.expect(condition).to.be.true;", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?tokenAddress={{ZRX_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "tokenAddress", - "value": "{{ZRX_address}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "makerTokenAddress param", - "event": [ - { - "listen": "test", - "script": { - "id": "01eb5865-edec-4216-8a90-c36d790366fc", - "type": "text/javascript", - "exec": [ - "const filterTokenEnvKey = 'ZRX_address';", - "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const makerTokenAddress = _.get(order, 'makerTokenAddress');", - " pm.expect(makerTokenAddress).to.be.equal(filterTokenAddress);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?makerTokenAddress={{ZRX_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "makerTokenAddress", - "value": "{{ZRX_address}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "takerTokenAddress param", - "event": [ - { - "listen": "test", - "script": { - "id": "bbbb6e15-60c7-4666-96be-a0ad56b6058b", - "type": "text/javascript", - "exec": [ - "const filterTokenEnvKey = 'ZRX_address';", - "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const takerTokenAddress = _.get(order, 'takerTokenAddress');", - " pm.expect(takerTokenAddress).to.be.equal(filterTokenAddress);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?takerTokenAddress={{ZRX_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "takerTokenAddress", - "value": "{{ZRX_address}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "maker param", - "event": [ - { - "listen": "test", - "script": { - "id": "1f5960de-117f-44fb-82e0-581626cbf62b", - "type": "text/javascript", - "exec": [ - "const orderMakerEnvKey = 'orderMaker';", - "const referenceOrderMakerAddress = pm.environment.get(orderMakerEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const returnedMakerAddress = _.get(order, 'maker');", - " pm.expect(referenceOrderMakerAddress).to.be.equal(returnedMakerAddress);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?maker={{orderMaker}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "maker", - "value": "{{orderMaker}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "taker param", - "event": [ - { - "listen": "test", - "script": { - "id": "f23de2eb-b444-49d3-93b7-14ae712d6502", - "type": "text/javascript", - "exec": [ - "const orderTakerEnvKey = 'orderTaker';", - "const referenceOrderTakerAddress = pm.environment.get(orderTakerEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const returnedTakerAddress = _.get(order, 'taker');", - " pm.expect(referenceOrderTakerAddress).to.be.equal(returnedTakerAddress);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?taker={{orderTaker}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "taker", - "value": "{{orderTaker}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "trader param", - "event": [ - { - "listen": "test", - "script": { - "id": "9689639a-47ce-4c3b-8180-859fd28437be", - "type": "text/javascript", - "exec": [ - "const orderTraderEnvKey = 'orderMaker';", - "const referenceOrderTraderAddress = pm.environment.get(orderTraderEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const returnedMakerAddress = _.get(order, 'maker');", - " const returnedTakerAddress = _.get(order, 'taker');", - " const condition = (referenceOrderTraderAddress === returnedMakerAddress) || (referenceOrderTraderAddress === returnedTakerAddress);", - " pm.expect(condition).to.be.true;", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?trader={{orderMaker}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "trader", - "value": "{{orderMaker}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - }, - { - "name": "feeRecipient param", - "event": [ - { - "listen": "test", - "script": { - "id": "010c0cf6-8d5b-4fe3-8b92-b2009ea43a3e", - "type": "text/javascript", - "exec": [ - "const orderFeeRecipientEnvKey = 'orderFeeRecipient';", - "const referenceOrderFeeRecipientAddress = pm.environment.get(orderFeeRecipientEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orders are properly filtered', function() {", - " _.forEach(responseJsonData, function(order) {", - " const returnedFeeRecipientAddress = _.get(order, 'feeRecipient');", - " pm.expect(referenceOrderFeeRecipientAddress).to.be.equal(returnedFeeRecipientAddress);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orders?feeRecipient={{orderFeeRecipient}}", - "host": [ - "{{url}}" - ], - "path": [ - "orders" - ], - "query": [ - { - "key": "feeRecipient", - "value": "{{orderFeeRecipient}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "4eafcc26-fb01-4182-b963-67a0b418fcbc", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "d28effd1-4a73-4ee8-82cc-21b1ab06928d", - "type": "text/javascript", - "exec": [ - "const schema = tv4.getSchema('/signedOrdersSchema');", - "const responseJsonData = pm.response.json();", - "", - "pm.test('Schema is valid', function() {", - " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", - "});", - "" - ] - } - } - ] - }, - { - "name": "GET /order", - "description": "", - "item": [ - { - "name": "orderHash param", - "event": [ - { - "listen": "test", - "script": { - "id": "18876df2-384e-43d5-93a1-7e24571e1308", - "type": "text/javascript", - "exec": [ - "const orderEnvKey = 'order';", - "const referenceOrderString = pm.environment.get(orderEnvKey);", - "const referenceOrderJson = JSON.parse(referenceOrderString);", - "const orderPropertyNames = [", - " 'maker',", - " 'taker',", - " 'makerFee',", - " 'takerFee',", - " 'makerTokenAmount',", - " 'takerTokenAmount',", - " 'makerTokenAddress',", - " 'takerTokenAddress',", - " 'salt',", - " 'feeRecipient',", - " 'expirationUnixTimestampSec',", - " 'exchangeContractAddress'", - "];", - "const signaturePropertyNames = [", - " 'v',", - " 'r',", - " 's'", - "];", - "const returnedOrderJson = pm.response.json();", - "pm.test('Order is properly retreived', function() {", - " _.forEach(orderPropertyNames, function(propertyName) {", - " const returnedProperty = _.get(returnedOrderJson, propertyName);", - " const referenceProperty = _.get(referenceOrderJson, propertyName);", - " pm.expect(returnedProperty).to.be.equal(referenceProperty);", - " });", - " const returnedSignature = _.get(returnedOrderJson, 'ecSignature');", - " const referenceSignature = _.get(returnedOrderJson, 'ecSignature');", - " _.forEach(signaturePropertyNames, function(propertyName) {", - " const returnedSignatureProperty = _.get(returnedSignature, propertyName);", - " const referenceSignatureProperty = _.get(referenceSignature, propertyName);", - " pm.expect(returnedSignatureProperty).to.be.equal(referenceSignatureProperty);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/order/{{orderHash}}", - "host": [ - "{{url}}" - ], - "path": [ - "order", - "{{orderHash}}" - ] - }, - "description": "Retrieves a specific order by orderHash." - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "e356d2ff-d105-42c1-b679-d9d917dcd68d", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "8d2d4717-6f76-47ab-8e5a-f383192f6ee4", - "type": "text/javascript", - "exec": [ - "const schema = tv4.getSchema('/SignedOrder');", - "const responseJsonData = pm.response.json();", - "", - "pm.test('Schema is valid', function() {", - " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", - "});", - "" - ] - } - } - ] - }, - { - "name": "GET /orderbook", - "description": "", - "item": [ - { - "name": "baseTokenAddress and quoteTokenAddress params", - "event": [ - { - "listen": "test", - "script": { - "id": "0198622e-9705-4ae1-b1f2-0c40b87de856", - "type": "text/javascript", - "exec": [ - "const baseTokenEnvKey = 'ZRX_address';", - "const quoteTokenEnvKey = 'WETH_address';", - "const baseTokenAddress = pm.environment.get(baseTokenEnvKey);", - "const quoteTokenAddress = pm.environment.get(quoteTokenEnvKey);", - "const responseJsonData = pm.response.json();", - "pm.test('Orderbook is properly filtered', function() {", - " const bids = _.get(responseJsonData, 'bids');", - " const asks = _.get(responseJsonData, 'asks');", - " _.forEach(bids, function(order) {", - " const makerTokenAddress = _.get(order, 'makerTokenAddress');", - " const takerTokenAddress = _.get(order, 'takerTokenAddress');", - " pm.expect(makerTokenAddress).to.be.equal(quoteTokenAddress);", - " pm.expect(takerTokenAddress).to.be.equal(baseTokenAddress);", - " });", - " _.forEach(asks, function(order) {", - " const makerTokenAddress = _.get(order, 'makerTokenAddress');", - " const takerTokenAddress = _.get(order, 'takerTokenAddress');", - " pm.expect(makerTokenAddress).to.be.equal(baseTokenAddress);", - " pm.expect(takerTokenAddress).to.be.equal(quoteTokenAddress);", - " });", - "});", - "" - ] - } - } - ], - "request": { - "method": "GET", - "header": [], - "body": {}, - "url": { - "raw": "{{url}}/orderbook?baseTokenAddress={{ZRX_address}}"eTokenAddress={{WETH_address}}", - "host": [ - "{{url}}" - ], - "path": [ - "orderbook" - ], - "query": [ - { - "key": "baseTokenAddress", - "value": "{{ZRX_address}}", - "equals": true - }, - { - "key": "quoteTokenAddress", - "value": "{{WETH_address}}", - "equals": true - } - ] - }, - "description": "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "bdf90dbc-9217-4089-8bc0-351baadddd3e", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "d5080a34-57c4-4d5d-8e01-5e79599282ec", - "type": "text/javascript", - "exec": [ - "const schema = tv4.getSchema('/RelayerApiOrderBookResponse');", - "const responseJsonData = pm.response.json();", - "", - "pm.test('Schema is valid', function() {", - " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", - "});", - "" - ] - } - } - ] - }, - { - "name": "POST /fees", - "description": "", - "item": [ - { - "name": "default request", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"exchangeContractAddress\": \"0x12459c951127e0c374ff9105dda097662a027093\",\n \"maker\": \"0x9e56625509c2f60af937f23b7b532600390e8c8b\",\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"makerTokenAddress\": \"0x323b5d4c32345ced77393b3530b1eed0f346429d\",\n \"takerTokenAddress\": \"0xef7fff64389b814a946f3e92105513705ca6b990\",\n \"makerTokenAmount\": \"10000000000000000\",\n \"takerTokenAmount\": \"20000000000000000\",\n \"expirationUnixTimestampSec\": \"42\",\n \"salt\": \"67006738228878699843088602623665307406148487219438534730168799356281242528500\"\n}" - }, - "url": { - "raw": "{{url}}/fees", - "host": [ - "{{url}}" - ], - "path": [ - "fees" - ] - }, - "description": "Given an unsigned order without the fee-related properties, returns the required feeRecipient, makerFee, and takerFee of that order." - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "75d66506-0fa9-4b0e-982b-ef53bf3310f8", - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "4c5f9f7b-8635-4bdb-9240-a74754a2de4f", - "type": "text/javascript", - "exec": [ - "const schema = tv4.getSchema('/RelayerApiFeesResponse');", - "const responseJsonData = pm.response.json();", - "", - "pm.test('Schema is valid', function() {", - " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", - "});", - "" - ] - } - } - ] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "id": "da60f639-df79-4f4d-9861-79219f5fc341", - "type": "text/javascript", - "exec": [ - "const schemaKeysString = pm.environment.get('schemaKeys');", - "const schemaKeys = JSON.parse(schemaKeysString);", - "_.forEach(schemaKeys, function(schemaKey) {", - " const schemaString = pm.environment.get(schemaKey);", - " const schema = JSON.parse(schemaString);", - " tv4.addSchema(schema);", - "});", - "" - ] - } - }, - { - "listen": "test", - "script": { - "id": "b4917e72-ac87-421d-b7a5-21b64285ba5b", - "type": "text/javascript", - "exec": [ - "pm.test('Has Content-Type header with value application/json', function () {", - " pm.response.to.have.header('Content-Type');", - " const contentType = postman.getResponseHeader('Content-Type');", - " pm.expect(contentType).to.include('application/json');", - "});", - "" - ] - } - } - ] -}
\ No newline at end of file + "info": { + "name": "sra_report", + "_postman_id": "d5828163-ddb9-46a9-ec39-c2b81417b6c0", + "description": + "[Standard Relayer API](\nhttps://github.com/0xProject/standard-relayer-api)\n\n\n0x Protocol is an open standard. Because of this, we expect many independent applications to be built that will want to use the protocol. In order to make it easier for anyone to source liquidity that conforms to the 0x order format, relayers can opt-in to implementing a set of standard relayer API endpoints. In doing so, they allow clients of the standard relayer API to access the orders on their orderbook.", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "GET /token_pairs", + "description": "", + "item": [ + { + "name": "default request", + "event": [ + { + "listen": "test", + "script": { + "id": "42cb5e3f-6013-4a7c-b341-0d10cb3f2c9c", + "type": "text/javascript", + "exec": [""] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/token_pairs", + "host": ["{{url}}"], + "path": ["token_pairs"] + }, + "description": "" + }, + "response": [] + }, + { + "name": "tokenA param", + "event": [ + { + "listen": "test", + "script": { + "id": "1b61aabb-ef9f-4269-9a0c-cb7559afcbd8", + "type": "text/javascript", + "exec": [ + "const filterTokenEnvKey = 'WETH_address';", + "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Token pairs are properly filtered', function() {", + " _.forEach(responseJsonData, function(tokenPair) {", + " const tokenAIsFilterToken = _.get(tokenPair, 'tokenA.address') === filterTokenAddress;", + " const tokenBIsFilterToken = _.get(tokenPair, 'tokenB.address') === filterTokenAddress;", + " const condition = tokenAIsFilterToken || tokenBIsFilterToken", + " pm.expect(condition).to.be.true;", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/token_pairs?tokenA={{WETH_address}}", + "host": ["{{url}}"], + "path": ["token_pairs"], + "query": [ + { + "key": "tokenA", + "value": "{{WETH_address}}", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "tokenB param", + "event": [ + { + "listen": "test", + "script": { + "id": "a5f946b1-fc97-4bcf-ae01-e0f97864a6c1", + "type": "text/javascript", + "exec": [ + "const filterTokenEnvKey = 'WETH_address';", + "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Token pairs are properly filtered', function() {", + " _.forEach(responseJsonData, function(tokenPair) {", + " const tokenAIsFilterToken = _.get(tokenPair, 'tokenA.address') === filterTokenAddress;", + " const tokenBIsFilterToken = _.get(tokenPair, 'tokenB.address') === filterTokenAddress;", + " const condition = tokenAIsFilterToken || tokenBIsFilterToken", + " pm.expect(condition).to.be.true;", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/token_pairs?tokenB={{WETH_address}}", + "host": ["{{url}}"], + "path": ["token_pairs"], + "query": [ + { + "key": "tokenB", + "value": "{{WETH_address}}", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "tokenA and tokenB params", + "event": [ + { + "listen": "test", + "script": { + "id": "bcd06e4f-aa3a-42f8-9f8c-bc902eb7a075", + "type": "text/javascript", + "exec": [ + "const filterTokenAEnvKey = 'WETH_address';", + "const filterTokenBEnvKey = 'ZRX_address';", + "const filterTokenAAddress = pm.environment.get(filterTokenAEnvKey);", + "const filterTokenBAddress = pm.environment.get(filterTokenBEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Token pairs are properly filtered', function() {", + " _.forEach(responseJsonData, function(tokenPair) {", + " const tokenAIsFilterTokenA = _.get(tokenPair, 'tokenA.address') === filterTokenAAddress;", + " const tokenAIsFilterTokenB = _.get(tokenPair, 'tokenA.address') === filterTokenBAddress;", + " const tokenBIsFilterTokenA = _.get(tokenPair, 'tokenB.address') === filterTokenAAddress;", + " const tokenBIsFilterTokenB = _.get(tokenPair, 'tokenB.address') === filterTokenBAddress;", + " const condition = (tokenAIsFilterTokenA && tokenBIsFilterTokenB) || (tokenBIsFilterTokenA && tokenAIsFilterTokenB)", + " pm.expect(condition).to.be.true;", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/token_pairs?tokenA={{WETH_address}}&tokenB={{ZRX_address}}", + "host": ["{{url}}"], + "path": ["token_pairs"], + "query": [ + { + "key": "tokenA", + "value": "{{WETH_address}}", + "equals": true + }, + { + "key": "tokenB", + "value": "{{ZRX_address}}", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "3d032e92-6a17-49f0-8115-bae1c7298b55", + "type": "text/javascript", + "exec": [""] + } + }, + { + "listen": "test", + "script": { + "id": "25addb38-bd1c-4eb3-a193-5617119dc0d6", + "type": "text/javascript", + "exec": [ + "const schema = tv4.getSchema('/RelayerApiTokenPairsResponse');", + "const responseJsonData = pm.response.json();", + "", + "pm.test('Schema is valid', function() {", + " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", + "});", + "" + ] + } + } + ] + }, + { + "name": "GET /orders", + "description": "", + "item": [ + { + "name": "default request", + "event": [ + { + "listen": "test", + "script": { + "id": "118f47dd-1d93-4288-841f-de88783eff3b", + "type": "text/javascript", + "exec": [""] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders", + "host": ["{{url}}"], + "path": ["orders"] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "exchangeContract param", + "event": [ + { + "listen": "test", + "script": { + "id": "e782ae77-66bf-4096-9190-ef9e7501b316", + "type": "text/javascript", + "exec": [ + "const exchangeContractEnvKey = 'EXCHANGE_CONTRACT_address';", + "const requestedExchangeContractAddress = pm.environment.get(exchangeContractEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const returnedExchangeContractAddress = _.get(order, 'exchangeContractAddress');", + " pm.expect(requestedExchangeContractAddress).to.equal(returnedExchangeContractAddress);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?exchangeContractAddress={{EXCHANGE_CONTRACT_address}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "exchangeContractAddress", + "value": "{{EXCHANGE_CONTRACT_address}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "tokenAddress param", + "event": [ + { + "listen": "test", + "script": { + "id": "1144a2d6-6175-40a6-8568-d0d3884492a1", + "type": "text/javascript", + "exec": [ + "const filterTokenEnvKey = 'ZRX_address';", + "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const makerTokenAddress = _.get(order, 'makerTokenAddress');", + " const takerTokenAddress = _.get(order, 'takerTokenAddress');", + " const makerTokenAddressIsFilterToken = makerTokenAddress === filterTokenAddress;", + " const takerTokenAddressIsFilterToken = takerTokenAddress === filterTokenAddress;", + " const condition = makerTokenAddressIsFilterToken || takerTokenAddressIsFilterToken;", + " pm.expect(condition).to.be.true;", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?tokenAddress={{ZRX_address}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "tokenAddress", + "value": "{{ZRX_address}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "makerTokenAddress param", + "event": [ + { + "listen": "test", + "script": { + "id": "01eb5865-edec-4216-8a90-c36d790366fc", + "type": "text/javascript", + "exec": [ + "const filterTokenEnvKey = 'ZRX_address';", + "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const makerTokenAddress = _.get(order, 'makerTokenAddress');", + " pm.expect(makerTokenAddress).to.be.equal(filterTokenAddress);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?makerTokenAddress={{ZRX_address}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "makerTokenAddress", + "value": "{{ZRX_address}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "takerTokenAddress param", + "event": [ + { + "listen": "test", + "script": { + "id": "bbbb6e15-60c7-4666-96be-a0ad56b6058b", + "type": "text/javascript", + "exec": [ + "const filterTokenEnvKey = 'ZRX_address';", + "const filterTokenAddress = pm.environment.get(filterTokenEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const takerTokenAddress = _.get(order, 'takerTokenAddress');", + " pm.expect(takerTokenAddress).to.be.equal(filterTokenAddress);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?takerTokenAddress={{ZRX_address}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "takerTokenAddress", + "value": "{{ZRX_address}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "maker param", + "event": [ + { + "listen": "test", + "script": { + "id": "1f5960de-117f-44fb-82e0-581626cbf62b", + "type": "text/javascript", + "exec": [ + "const orderMakerEnvKey = 'orderMaker';", + "const referenceOrderMakerAddress = pm.environment.get(orderMakerEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const returnedMakerAddress = _.get(order, 'maker');", + " pm.expect(referenceOrderMakerAddress).to.be.equal(returnedMakerAddress);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?maker={{orderMaker}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "maker", + "value": "{{orderMaker}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "taker param", + "event": [ + { + "listen": "test", + "script": { + "id": "f23de2eb-b444-49d3-93b7-14ae712d6502", + "type": "text/javascript", + "exec": [ + "const orderTakerEnvKey = 'orderTaker';", + "const referenceOrderTakerAddress = pm.environment.get(orderTakerEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const returnedTakerAddress = _.get(order, 'taker');", + " pm.expect(referenceOrderTakerAddress).to.be.equal(returnedTakerAddress);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?taker={{orderTaker}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "taker", + "value": "{{orderTaker}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "trader param", + "event": [ + { + "listen": "test", + "script": { + "id": "9689639a-47ce-4c3b-8180-859fd28437be", + "type": "text/javascript", + "exec": [ + "const orderTraderEnvKey = 'orderMaker';", + "const referenceOrderTraderAddress = pm.environment.get(orderTraderEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const returnedMakerAddress = _.get(order, 'maker');", + " const returnedTakerAddress = _.get(order, 'taker');", + " const condition = (referenceOrderTraderAddress === returnedMakerAddress) || (referenceOrderTraderAddress === returnedTakerAddress);", + " pm.expect(condition).to.be.true;", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?trader={{orderMaker}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "trader", + "value": "{{orderMaker}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + }, + { + "name": "feeRecipient param", + "event": [ + { + "listen": "test", + "script": { + "id": "010c0cf6-8d5b-4fe3-8b92-b2009ea43a3e", + "type": "text/javascript", + "exec": [ + "const orderFeeRecipientEnvKey = 'orderFeeRecipient';", + "const referenceOrderFeeRecipientAddress = pm.environment.get(orderFeeRecipientEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orders are properly filtered', function() {", + " _.forEach(responseJsonData, function(order) {", + " const returnedFeeRecipientAddress = _.get(order, 'feeRecipient');", + " pm.expect(referenceOrderFeeRecipientAddress).to.be.equal(returnedFeeRecipientAddress);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/orders?feeRecipient={{orderFeeRecipient}}", + "host": ["{{url}}"], + "path": ["orders"], + "query": [ + { + "key": "feeRecipient", + "value": "{{orderFeeRecipient}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "4eafcc26-fb01-4182-b963-67a0b418fcbc", + "type": "text/javascript", + "exec": [""] + } + }, + { + "listen": "test", + "script": { + "id": "d28effd1-4a73-4ee8-82cc-21b1ab06928d", + "type": "text/javascript", + "exec": [ + "const schema = tv4.getSchema('/signedOrdersSchema');", + "const responseJsonData = pm.response.json();", + "", + "pm.test('Schema is valid', function() {", + " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", + "});", + "" + ] + } + } + ] + }, + { + "name": "GET /order", + "description": "", + "item": [ + { + "name": "orderHash param", + "event": [ + { + "listen": "test", + "script": { + "id": "18876df2-384e-43d5-93a1-7e24571e1308", + "type": "text/javascript", + "exec": [ + "const orderEnvKey = 'order';", + "const referenceOrderString = pm.environment.get(orderEnvKey);", + "const referenceOrderJson = JSON.parse(referenceOrderString);", + "const orderPropertyNames = [", + " 'maker',", + " 'taker',", + " 'makerFee',", + " 'takerFee',", + " 'makerTokenAmount',", + " 'takerTokenAmount',", + " 'makerTokenAddress',", + " 'takerTokenAddress',", + " 'salt',", + " 'feeRecipient',", + " 'expirationUnixTimestampSec',", + " 'exchangeContractAddress'", + "];", + "const signaturePropertyNames = [", + " 'v',", + " 'r',", + " 's'", + "];", + "const returnedOrderJson = pm.response.json();", + "pm.test('Order is properly retreived', function() {", + " _.forEach(orderPropertyNames, function(propertyName) {", + " const returnedProperty = _.get(returnedOrderJson, propertyName);", + " const referenceProperty = _.get(referenceOrderJson, propertyName);", + " pm.expect(returnedProperty).to.be.equal(referenceProperty);", + " });", + " const returnedSignature = _.get(returnedOrderJson, 'ecSignature');", + " const referenceSignature = _.get(returnedOrderJson, 'ecSignature');", + " _.forEach(signaturePropertyNames, function(propertyName) {", + " const returnedSignatureProperty = _.get(returnedSignature, propertyName);", + " const referenceSignatureProperty = _.get(referenceSignature, propertyName);", + " pm.expect(returnedSignatureProperty).to.be.equal(referenceSignatureProperty);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "{{url}}/order/{{orderHash}}", + "host": ["{{url}}"], + "path": ["order", "{{orderHash}}"] + }, + "description": "Retrieves a specific order by orderHash." + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "e356d2ff-d105-42c1-b679-d9d917dcd68d", + "type": "text/javascript", + "exec": [""] + } + }, + { + "listen": "test", + "script": { + "id": "8d2d4717-6f76-47ab-8e5a-f383192f6ee4", + "type": "text/javascript", + "exec": [ + "const schema = tv4.getSchema('/SignedOrder');", + "const responseJsonData = pm.response.json();", + "", + "pm.test('Schema is valid', function() {", + " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", + "});", + "" + ] + } + } + ] + }, + { + "name": "GET /orderbook", + "description": "", + "item": [ + { + "name": "baseTokenAddress and quoteTokenAddress params", + "event": [ + { + "listen": "test", + "script": { + "id": "0198622e-9705-4ae1-b1f2-0c40b87de856", + "type": "text/javascript", + "exec": [ + "const baseTokenEnvKey = 'ZRX_address';", + "const quoteTokenEnvKey = 'WETH_address';", + "const baseTokenAddress = pm.environment.get(baseTokenEnvKey);", + "const quoteTokenAddress = pm.environment.get(quoteTokenEnvKey);", + "const responseJsonData = pm.response.json();", + "pm.test('Orderbook is properly filtered', function() {", + " const bids = _.get(responseJsonData, 'bids');", + " const asks = _.get(responseJsonData, 'asks');", + " _.forEach(bids, function(order) {", + " const makerTokenAddress = _.get(order, 'makerTokenAddress');", + " const takerTokenAddress = _.get(order, 'takerTokenAddress');", + " pm.expect(makerTokenAddress).to.be.equal(quoteTokenAddress);", + " pm.expect(takerTokenAddress).to.be.equal(baseTokenAddress);", + " });", + " _.forEach(asks, function(order) {", + " const makerTokenAddress = _.get(order, 'makerTokenAddress');", + " const takerTokenAddress = _.get(order, 'takerTokenAddress');", + " pm.expect(makerTokenAddress).to.be.equal(baseTokenAddress);", + " pm.expect(takerTokenAddress).to.be.equal(quoteTokenAddress);", + " });", + "});", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": + "{{url}}/orderbook?baseTokenAddress={{ZRX_address}}"eTokenAddress={{WETH_address}}", + "host": ["{{url}}"], + "path": ["orderbook"], + "query": [ + { + "key": "baseTokenAddress", + "value": "{{ZRX_address}}", + "equals": true + }, + { + "key": "quoteTokenAddress", + "value": "{{WETH_address}}", + "equals": true + } + ] + }, + "description": + "Retrieves a list of orders given query parameters. For querying an entire orderbook snapshot, the orderbook endpoint is recommended.\n\nParameters\n * exchangeContractAddress [string]: returns orders created for this exchange address\n * tokenAddress [string]: returns orders where makerTokenAddress or takerTokenAddress is token address\n * makerTokenAddress [string]: returns orders with specified makerTokenAddress\n * takerTokenAddress [string]: returns orders with specified makerTokenAddress\n * maker [string]: returns orders where maker is maker address\n * taker [string]: returns orders where taker is taker address\n * trader [string]: returns orders where maker or taker is trader address\n * feeRecipient [string]: returns orders where feeRecipient is feeRecipient address\n\nAll parameters are optional." + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "bdf90dbc-9217-4089-8bc0-351baadddd3e", + "type": "text/javascript", + "exec": [""] + } + }, + { + "listen": "test", + "script": { + "id": "d5080a34-57c4-4d5d-8e01-5e79599282ec", + "type": "text/javascript", + "exec": [ + "const schema = tv4.getSchema('/RelayerApiOrderBookResponse');", + "const responseJsonData = pm.response.json();", + "", + "pm.test('Schema is valid', function() {", + " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", + "});", + "" + ] + } + } + ] + }, + { + "name": "POST /fees", + "description": "", + "item": [ + { + "name": "default request", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": + "{\n \"exchangeContractAddress\": \"0x12459c951127e0c374ff9105dda097662a027093\",\n \"maker\": \"0x9e56625509c2f60af937f23b7b532600390e8c8b\",\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"makerTokenAddress\": \"0x323b5d4c32345ced77393b3530b1eed0f346429d\",\n \"takerTokenAddress\": \"0xef7fff64389b814a946f3e92105513705ca6b990\",\n \"makerTokenAmount\": \"10000000000000000\",\n \"takerTokenAmount\": \"20000000000000000\",\n \"expirationUnixTimestampSec\": \"42\",\n \"salt\": \"67006738228878699843088602623665307406148487219438534730168799356281242528500\"\n}" + }, + "url": { + "raw": "{{url}}/fees", + "host": ["{{url}}"], + "path": ["fees"] + }, + "description": + "Given an unsigned order without the fee-related properties, returns the required feeRecipient, makerFee, and takerFee of that order." + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "75d66506-0fa9-4b0e-982b-ef53bf3310f8", + "type": "text/javascript", + "exec": [""] + } + }, + { + "listen": "test", + "script": { + "id": "4c5f9f7b-8635-4bdb-9240-a74754a2de4f", + "type": "text/javascript", + "exec": [ + "const schema = tv4.getSchema('/RelayerApiFeesResponse');", + "const responseJsonData = pm.response.json();", + "", + "pm.test('Schema is valid', function() {", + " pm.expect(tv4.validate(responseJsonData, schema)).to.be.true;", + "});", + "" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "da60f639-df79-4f4d-9861-79219f5fc341", + "type": "text/javascript", + "exec": [ + "const schemaKeysString = pm.environment.get('schemaKeys');", + "const schemaKeys = JSON.parse(schemaKeysString);", + "_.forEach(schemaKeys, function(schemaKey) {", + " const schemaString = pm.environment.get(schemaKey);", + " const schema = JSON.parse(schemaString);", + " tv4.addSchema(schema);", + "});", + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "b4917e72-ac87-421d-b7a5-21b64285ba5b", + "type": "text/javascript", + "exec": [ + "pm.test('Has Content-Type header with value application/json', function () {", + " pm.response.to.have.header('Content-Type');", + " const contentType = postman.getResponseHeader('Content-Type');", + " pm.expect(contentType).to.include('application/json');", + "});", + "" + ] + } + } + ] +} diff --git a/packages/sra-report/src/contract_addresses/kovan_addresses.ts b/packages/sra-report/src/contract_addresses/kovan_addresses.ts index e097bf12a..4d2b76a51 100644 --- a/packages/sra-report/src/contract_addresses/kovan_addresses.ts +++ b/packages/sra-report/src/contract_addresses/kovan_addresses.ts @@ -1,6 +1,6 @@ export const addresses = { - 'DAI_address': '0xb18845c260f680d5b9d84649638813e342e4f8c9', - 'WETH_address': '0xd0a1e359811322d97991e03f863a0c30c2cf029c', - 'ZRX_address': '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570', - 'EXCHANGE_CONTRACT_address': '0x90fe2af704b34e0224bf2299c838e04d4dcf1364', + DAI_address: '0xb18845c260f680d5b9d84649638813e342e4f8c9', + WETH_address: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', + ZRX_address: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570', + EXCHANGE_CONTRACT_address: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364', }; diff --git a/packages/sra-report/src/contract_addresses/mainnet_addresses.ts b/packages/sra-report/src/contract_addresses/mainnet_addresses.ts index cbd79a0e7..4ccbdf12d 100644 --- a/packages/sra-report/src/contract_addresses/mainnet_addresses.ts +++ b/packages/sra-report/src/contract_addresses/mainnet_addresses.ts @@ -1,6 +1,6 @@ export const addresses = { - 'DAI_address': '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', - 'WETH_address': '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', - 'ZRX_address': '0xe41d2489571d322189246dafa5ebde1f4699f498', - 'EXCHANGE_CONTRACT_address': '0x12459c951127e0c374ff9105dda097662a027093', + DAI_address: '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359', + WETH_address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + ZRX_address: '0xe41d2489571d322189246dafa5ebde1f4699f498', + EXCHANGE_CONTRACT_address: '0x12459c951127e0c374ff9105dda097662a027093', }; diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts index 37c7a8f04..4419a3ec8 100644 --- a/packages/sra-report/src/index.ts +++ b/packages/sra-report/src/index.ts @@ -52,8 +52,10 @@ const args = yargs normalize: true, demandOption: false, }) - .example("$0 --endpoint-url 'http://api.example.com' --out 'path/to/report.json' --network-id 42 --export-environment 'path/to/environment.json' --export-collection 'path/to/collection.json'", 'Full usage example') - .argv; + .example( + "$0 --endpoint-url 'http://api.example.com' --out 'path/to/report.json' --network-id 42 --export-environment 'path/to/environment.json' --export-collection 'path/to/collection.json'", + 'Full usage example', + ).argv; // perform extra validation on command line arguments try { assert.isWebUri('args', args.endpointUrl); diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts index d32d41e18..e4276d4a5 100644 --- a/packages/sra-report/src/postman_environment_factory.ts +++ b/packages/sra-report/src/postman_environment_factory.ts @@ -2,8 +2,8 @@ import { SignedOrder, ZeroEx } from '0x.js'; import { Schema, schemas as schemasByName } from '@0xproject/json-schemas'; import * as _ from 'lodash'; -import { addresses as kovanAddresses} from './contract_addresses/kovan_addresses'; -import { addresses as mainnetAddresses} from './contract_addresses/mainnet_addresses'; +import { addresses as kovanAddresses } from './contract_addresses/kovan_addresses'; +import { addresses as mainnetAddresses } from './contract_addresses/mainnet_addresses'; interface EnvironmentValue { key: string; |