Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
feat: Improve RFQ-T logging (#219)
Browse files Browse the repository at this point in the history
* Ran prettier (on existing code from `master`)

* /swap/quote: log makers, etc for RFQ-T firm quotes

* Pin to monorepo `development` commit

0xProject/0x-monorepo@d9e13d6
  • Loading branch information
feuGeneA authored May 12, 2020
1 parent 06bc402 commit 22b6b0c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# [1.3.0](https://github.com/0xProject/0x-api/compare/v1.2.0...v1.3.0) (2020-05-11)


### Features

* Remove Kyber exclusion ([#211](https://github.com/0xProject/0x-api/issues/211)) ([aa600ab](https://github.com/0xProject/0x-api/commit/aa600abd74bb963303720d8a3cdf3b5f5044ae4f))
* RFQ-T follow-ups ([#201](https://github.com/0xProject/0x-api/issues/201)) ([a55f22e](https://github.com/0xProject/0x-api/commit/a55f22ee866f0ce8a8e5164829bc511838019a47)), closes [/github.com/0xProject/0x-api/pull/201#discussion_r417775612](https://github.com//github.com/0xProject/0x-api/pull/201/issues/discussion_r417775612)
- Remove Kyber exclusion ([#211](https://github.com/0xProject/0x-api/issues/211)) ([aa600ab](https://github.com/0xProject/0x-api/commit/aa600abd74bb963303720d8a3cdf3b5f5044ae4f))
- RFQ-T follow-ups ([#201](https://github.com/0xProject/0x-api/issues/201)) ([a55f22e](https://github.com/0xProject/0x-api/commit/a55f22ee866f0ce8a8e5164829bc511838019a47)), closes [/github.com/0xProject/0x-api/pull/201#discussion_r417775612](https://github.com//github.com/0xProject/0x-api/pull/201/issues/discussion_r417775612)

# [1.2.0](https://github.com/0xProject/0x-api/compare/v1.1.0...v1.2.0) (2020-05-04)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
},
"dependencies": {
"@0x/assert": "^3.0.4",
"@0x/asset-swapper": "0xProject/gitpkg-registry#0x-asset-swapper-v4.4.0-ff1811ef9",
"@0x/asset-swapper": "0xProject/gitpkg-registry#0x-asset-swapper-v4.4.0-d9e13d6b9",
"@0x/connect": "^6.0.4",
"@0x/contract-addresses": "0xProject/gitpkg-registry#0x-contract-addresses-v4.9.0-fb0311e67",
"@0x/contract-wrappers": "0xProject/gitpkg-registry#0x-contract-wrappers-v13.6.3-fb0311e67",
Expand Down
19 changes: 16 additions & 3 deletions src/handlers/swap_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,22 @@ export class SwapHandlers {
this._swapService = swapService;
}
public async getSwapQuoteAsync(req: express.Request, res: express.Response): Promise<void> {
res.status(HttpStatus.OK).send(
await this._calculateSwapQuoteAsync(parseGetSwapQuoteRequestParams(req, 'quote')),
);
const params = parseGetSwapQuoteRequestParams(req, 'quote');
const quote = await this._calculateSwapQuoteAsync(params);
if (params.rfqt !== undefined) {
logger.info({
firmQuoteServed: {
taker: params.takerAddress,
apiKey: params.apiKey,
buyToken: params.buyToken,
sellToken: params.sellToken,
buyAmount: params.buyAmount,
sellAmount: params.sellAmount,
makers: quote.orders.map(order => order.makerAddress),
},
});
}
res.status(HttpStatus.OK).send(quote);
}
// tslint:disable-next-line:prefer-function-over-method
public async getSwapTokensAsync(_req: express.Request, res: express.Response): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
lodash "^4.17.11"
valid-url "^1.0.9"

"@0x/asset-swapper@0xProject/gitpkg-registry#0x-asset-swapper-v4.4.0-ff1811ef9":
"@0x/asset-swapper@0xProject/gitpkg-registry#0x-asset-swapper-v4.4.0-d9e13d6b9":
version "4.4.0"
resolved "https://codeload.github.com/0xProject/gitpkg-registry/tar.gz/64535d1f229d124c2d57102f6a9d28a9e94cc820"
resolved "https://codeload.github.com/0xProject/gitpkg-registry/tar.gz/8bf3e651d724a72912dee78cc1978a674b82b93c"
dependencies:
"@0x/assert" "^3.0.7"
"@0x/contract-addresses" "^4.9.0"
Expand Down

0 comments on commit 22b6b0c

Please sign in to comment.