Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

[1689 - Quote endpoint] update Error objects to include new fee > sell error #1758

Merged
merged 2 commits into from
Nov 9, 2021

Conversation

W3stside
Copy link
Contributor

@W3stside W3stside commented Nov 2, 2021

Part of #1689

Updates error classes to add backend SellAmountDoesNotCoverFee error and catch it

@W3stside W3stside changed the title update Error objects to include new fee > sell error [1689 - Quote endpoint] update Error objects to include new fee > sell error Nov 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2021

  • 🔭 GP Swap: Gnosis Protocol v2 Swap UI

…1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
@W3stside
Copy link
Contributor Author

W3stside commented Nov 8, 2021

@gnosis/gp-frontend we're all pretty busy so I will consolidate a lot of the #1689 PRs and you can all post-merge review
@anxolin
@alfetopito
@nenadV91

@W3stside W3stside merged commit 61a4ee1 into 1689/useValidTo-hook Nov 9, 2021
W3stside added a commit that referenced this pull request Nov 9, 2021
* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
@alfetopito alfetopito deleted the 1689/update-error-classes branch November 9, 2021 19:45
W3stside added a commit that referenced this pull request Nov 15, 2021
* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
nenadV91 pushed a commit that referenced this pull request Nov 15, 2021
* chore: simplify app dispatch and selector types with ts inference

* update SearchModal to use new types inference
W3stside added a commit that referenced this pull request Nov 15, 2021
* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
W3stside added a commit that referenced this pull request Dec 6, 2021
* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
W3stside added a commit that referenced this pull request Dec 9, 2021
* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
W3stside added a commit that referenced this pull request Dec 13, 2021
* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
W3stside added a commit that referenced this pull request Dec 13, 2021
* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
W3stside added a commit that referenced this pull request Dec 15, 2021
* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
W3stside added a commit that referenced this pull request Dec 16, 2021
* [1689 - Quote endpoint] Consolidate waterfall PRs:

* useGetGpApiStatus hook (mocked)

1. checks api to use
2. mocked right now

* export type

* [1689 - Quote endpoint] useOrderValidTo hook (#1728)

* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs

* fix package name and update yarn

yarn lock

* add receiver to quote params

* better GP API default

* removed unused import

* rename gpQuoteStatus to gpPriceStrategy

* comments

* comment

* pass new params to useQuoteAndSwap/useFallbackPi

* better types/param name

* round validTo UP @alfetopito

* get correct ETH address

* create validTo adjuster. return more from useOrderValidTo

* MINIMUM_VALID_TO = 120

* paths, fixed type, and renaming stuff

* set the validTo in the callback

* export resolveLast best quote call

* use resolveLast for quote promise

* add manual price setting for dev

* logs

* pass order validTo thanks !@alfetopito

* timestamp

* add param to stubResponse cypress

* fix incorrect version name

* yarn lock update

* Bumpbing bignumber.js and dex-js to the same version

* Removed bignumber.js from dependency as it's only used on dex-js

Co-authored-by: Leandro Boscariol <[email protected]>
anxolin pushed a commit to anxolin/cowswap that referenced this pull request Apr 1, 2022
* useOrderValidTo hook

- syntactic sugar for getting validTo time (unix u32) from deadline TTL

* [1689 - Quote endpoint] update Error objects to include new fee > sell error (gnosis/cowswap#1758)

* update Error objects to include new fee > sell error

* [1689 - Quote endpoint] update gp v2 contracts 1.1.2 & set env check (gnosis/cowswap#1759)

* add default Gp_Api_Status to env

* update to 1.1.2 gp-v2-contracts

yarn lock [email protected]

* [1689 - Quote Endpoint] Add new quote getting methods in API and Price (fix types) (gnosis/cowswap#1772)

* utils/price: add new quote logic

* gnosisProtocol API - add new quote logic

1. map old params to new
2. add post logic

* add legacy/new to index

* use gpStatus and new api method in useRefetch and Unfillable

* set mock to LEGACY (temp)

* add validTo to necessary places

* [1689 - Quote Endpoint] getQuote > replace getFeeQuote and getPriceQuote (gnosis/cowswap#1773)

* change getPriceQuote and getFeeQuote

- getQuote - one endpoint

* [1689 - Quote endpoint] Fix Cypress Fee test (gnosis/cowswap#1775)

* setup fee test for new endpoint

* add mock quote data and fix command for stubs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants