15833 Commits

Author SHA1 Message Date
F. Eugene Aumson
5effc6ec90
asset-swapper: extract method
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411514718
2020-04-20 22:56:43 -04:00
F. Eugene Aumson
4cc9ceabd2
asset-swapper: Rm unused ERC20BridgeSource.Rfqt
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r410517580
2020-04-20 22:56:43 -04:00
F. Eugene Aumson
464c918134
asset-swapper: test RFQT indicative quote handling 2020-04-20 22:56:43 -04:00
F. Eugene Aumson
2456adcb68
asset-swapper: validate RFQT indicative quotes
Validate that the responses returned from maker endpoints both conform
to expected JSON schema data types and also have the expected asset
data, per the taker's request.
2020-04-20 22:56:43 -04:00
F. Eugene Aumson
45bc967f30
asset-swapper: Differentiate RFQT warning messages 2020-04-17 02:34:36 -04:00
F. Eugene Aumson
d6d4d29257
asset-swapper: RFQ-T indicative quotes
These changes have been exercised via mocha tests in the 0x-api repo.

Not sure why I had to add GetMarketOrdersRfqtOpts to the package
exports.  `yarn test:generate_docs:circleci` said:

$ node ./packages/monorepo-scripts/lib/doc_generate.js --package @0x/asset-swapper
GENERATE_DOCS: Generating Typedoc JSON for @0x/asset-swapper...
GENERATE_DOCS: Generating Typedoc Markdown for @0x/asset-swapper...
GENERATE_DOCS: Modifying Markdown To Exclude Unexported Items...
Error: @0x/asset-swapper package needs to export:
GetMarketOrdersRfqtOpts
From it's index.ts. If any are from external dependencies, then add them to the EXTERNAL_TYPE_MAP.
    at DocGenerateUtils._lookForMissingReferenceExportsThrowIfExists (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:288:19)
    at DocGenerateUtils.<anonymous> (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:255:34)
    at step (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:32:23)
    at Object.next (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:13:53)
    at fulfilled (/root/repo/packages/monorepo-scripts/lib/utils/doc_generate_utils.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
2020-04-17 02:34:36 -04:00
F. Eugene Aumson
33fdfdc8c0
asset-swapper: Extract method inferQueryParams
For use in upcoming implementation of indicative quotes.
2020-04-17 01:18:46 -04:00
F. Eugene Aumson
80c8712b2a
asset-swapper: Rm unused field in SwapQuoterOpts 2020-04-17 01:18:28 -04:00
F. Eugene Aumson
957e3eb93c
asset-swapper: Restructure RFQ-T request options
There's one subtlety here: apiKey has been moved to be within the rfqt
namespace, after talking to Fabio and discovering that he only needs to
re-use the API key in 0x API, not in asset-swapper.
2020-04-17 01:18:07 -04:00
F. Eugene Aumson
110e1afa8e
Merge pull request #2541 from 0xProject/rfq-t
asset-swapper: RFQ-T firm quotes
2020-04-15 15:24:48 -04:00
F. Eugene Aumson
1da8f68871
migrations: Add independent yarn prettier script 2020-04-15 14:17:03 -04:00
F. Eugene Aumson
513ddb4cca
Merge branch 'development' into rfq-t 2020-04-15 11:12:30 -04:00
F. Eugene Aumson
3bdfcb8542
Update {asset-s,migrat,contract-ad}* CHANGELOGs 2020-04-15 01:47:13 -04:00
F. Eugene Aumson
aee758eca2
Fix bug: Stop ignoring default SwapQuoteRequestOps
SwapQuoter._getSwapQuoteAsync() was merging defaults into the options
sent into SwapQuoteCalculator.calculateMarket{Buy,Sell}SwapQuoteAsync(),
but it was using the unmerged options function parameter for the RFQ-T
options and also for the gas price option.
2020-04-15 01:47:01 -04:00
Steve Klebanoff
47ef7fffce
RFQ-T: validate assetData & add more tests (#2552)
* test for returning a 200 with invalid data, and additonal logging for that case

* Ensure RFQ-T response has asset data we expect

* validate signed order schema

* give more descriptive variable names and test an unsigned order

* takeout unused var
2020-04-15 00:11:37 -04:00
F. Eugene Aumson
58d6256607
Bug fix: RFQ-T orders werent going through sorting 2020-04-13 12:53:08 -04:00
F. Eugene Aumson
b854fcdb72
Remove an unnecessary type annotation 2020-04-13 12:53:08 -04:00
F. Eugene Aumson
27ca75d94f
Clarify parallelization of orderbook & RFQT
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406955099
2020-04-13 12:53:08 -04:00
F. Eugene Aumson
bb15f78af0
Validate maker endpoint responses with JSON Schema
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406957115
2020-04-13 12:53:08 -04:00
F. Eugene Aumson
ccc9e18132
Type Axios response with undefined, not void
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406956436
2020-04-13 12:53:08 -04:00
F. Eugene Aumson
d55108ab60
Eliminate unnecessary else
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405906319
2020-04-13 12:53:07 -04:00
Steve Klebanoff
84adbcb683
asset-swapper: Mockable axios for QuoteRequestor (#2549)
* Mockable axios for QuoteRequestor

* Move RFQT Mocker to src

* move MockedRfqtFirmQuoteResponse into types file

* fix import
2020-04-10 23:09:56 -04:00
F. Eugene Aumson
0cb5e4553b
Await Axios response so we don't circumvent catch
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406604110
2020-04-10 15:34:06 -04:00
F. Eugene Aumson
264407b707
In Opts types, REQUIRE rfqt SUB-options
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406505994
2020-04-09 21:58:22 -04:00
F. Eugene Aumson
eb5ec58453
Add yarn prettier script, & call it from lint 2020-04-09 21:58:22 -04:00
F. Eugene Aumson
39c2a757be
Promote a closure to a function
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405953107
2020-04-09 18:39:46 -04:00
F. Eugene Aumson
8cdc05f582
Promote max maker response time to a global option 2020-04-09 17:21:36 -04:00
F. Eugene Aumson
5f4778c852
Don't throw when RFQ-T client isn't whitelisted
Addresses review comments
https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405964457
and
https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406040453
2020-04-09 17:21:35 -04:00
F. Eugene Aumson
70add44fc1
Push RFQ-T opts to SwapQuoterReqOpts subnamespace
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405969509
2020-04-09 17:21:35 -04:00
F. Eugene Aumson
fa617d2e9d
Demote public member to private
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405963834
2020-04-09 17:21:35 -04:00
F. Eugene Aumson
3c795d365d
Demote instance member to just constructor a arg
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405963779
2020-04-09 17:21:35 -04:00
F. Eugene Aumson
93872ad7a3
Push RFQ-T opts to own SwapQuoterOpts subnamespace
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405963240
2020-04-09 17:21:35 -04:00
F. Eugene Aumson
227676c150
Remove unused intentOnFilling method parameter
Addresses review comments
https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405952889
and
https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406048104
2020-04-09 17:21:35 -04:00
F. Eugene Aumson
5f23833b43
rm unused SwapQuoteRequestOpts key enableRfqt
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r406043111
2020-04-09 17:21:35 -04:00
F. Eugene Aumson
121d51b414
Use try...catch instead of Promise.catch()
Addresses review comments
https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405953735
and
https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405966703
2020-04-09 17:21:34 -04:00
Jacob Evans
0e196a59d9
Always use DFB in asset-swapper (#2542)
* Always use DFB in asset-swapper

* Clean up
2020-04-09 15:52:15 +10:00
F. Eugene Aumson
63bfd23310
Pass QuoteRequestor via SwapQuoteOpts not ctor arg
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405900525
2020-04-09 00:29:58 -04:00
F. Eugene Aumson
aadcf8fed0
Parallelize RFQ-T with orderbook query
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405905572
2020-04-09 00:29:57 -04:00
F. Eugene Aumson
37390e03b4
Use Array.push instead of Array.concat
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405905052
2020-04-09 00:09:10 -04:00
F. Eugene Aumson
98fc780ade
Use map idiom instead of for loop
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405904035
2020-04-08 23:14:06 -04:00
F. Eugene Aumson
1670b21123
Use NULL_ADDRESS instead of literal
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405901406
2020-04-08 22:56:11 -04:00
F. Eugene Aumson
5602aacbd2
mk SwapQuoterOpt rfqtTakerApiKeyWhitelist optional
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405749147
2020-04-08 22:48:21 -04:00
F. Eugene Aumson
6ddbea207f
Stop using 3rd party sphinx typehints plugin
Because sphinx itself supports typehints now, and a recent update to
plugin caused it to start spewing massive amounts of warnings.
2020-04-08 14:09:50 -04:00
F. Eugene Aumson
261bced822
Fix redundant docstrings and unpin sphinx
The latest version of Sphinx (documentation generation utility) was
giving a warning (which we were configured to treat as an error) about
there being multiple docstring definitions for the same class.  This had
never been flagged before.
2020-04-08 14:09:49 -04:00
Lawrence Forman
a80d1f861c
Merge pull request #2536 from 0xProject/feat/asset-swapper/DexForwarderBridge-support
asset-swapper: DFB support + refactors
2020-04-07 14:35:01 -04:00
Lawrence Forman
c541340ef5
Update CHANGELOG.json
`@0x/contract-addresses`: Redeploy `DexForwarderBridge` on Mainnet with Gas Token freeing
`@0x/contract-addresses`: Revert to older Curve Bridge (without Gas Tokens)
2020-04-07 13:41:37 -04:00
Lawrence Forman
434af0ae64
@0x/contracts-asset-proxy: Update CHANGELOG 2020-04-07 13:38:35 -04:00
Jacob Evans
c6379ca1d4 Update DexForwarderBridge address 2020-04-07 12:35:18 -04:00
Jacob Evans
cdbcada49b Authorize sender adddress 2020-04-07 12:35:18 -04:00
Jacob Evans
282930cb9b Add GST support to DFB 2020-04-07 12:35:18 -04:00