Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump cow-sdk and api errors #149

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"@commander-js/extra-typings": "^11.0.0",
"@cowprotocol/contracts": "^1.4.0",
"@cowprotocol/cow-sdk": "^5.0.1",
"@cowprotocol/cow-sdk": "^5.2.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"chalk": "^4.1.2",
Expand Down
6 changes: 3 additions & 3 deletions src/domain/polling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ type BackOffApiErrorsDelays = {
* Handle error that will return `TRY_NEXT_BLOCK`, so it doesn't throw but is re-attempted on next block
*/
const API_ERRORS_TRY_NEXT_BLOCK: NextBlockApiErrorsArray = [
ApiErrors.INSUFFICIENT_FEE,
ApiErrors.QUOTE_NOT_FOUND,
ApiErrors.INVALID_QUOTE,
ApiErrors.INSUFFICIENT_VALID_TO,
Expand All @@ -66,15 +65,16 @@ const ONE_HOUR = 60 * 60;
const API_ERRORS_BACKOFF: BackOffApiErrorsDelays = {
[ApiErrors.INSUFFICIENT_ALLOWANCE]: TEN_MINS,
[ApiErrors.INSUFFICIENT_BALANCE]: TEN_MINS,
TooManyLimitOrders: ONE_HOUR,
[ApiErrors.TOO_MANY_LIMIT_ORDERS]: ONE_HOUR,
[ApiErrors.INVALID_APP_DATA]: ONE_MIN, // Give the user some time to upload the correct appData
};

const API_ERRORS_DROP: DropApiErrorsArray = [
ApiErrors.SELL_AMOUNT_OVERFLOW, // Implies a `feeAmount` has been set and `sellAmount` + `feeAmount` > `type(uint256).max`
ApiErrors.TRANSFER_SIMULATION_FAILED, // Sell token can't be transferred, drop it
ApiErrors.ZERO_AMOUNT, // Any order with zero amount indicates bad logic, drop it
"UnsupportedBuyTokenDestination",
ApiErrors.UNSUPPORTED_BUY_TOKEN_DESTINATION,
ApiErrors.TOO_MUCH_GAS, // Order is too large, likely some bad logic, drop it
ApiErrors.UNSUPPORTED_SELL_TOKEN_SOURCE,
ApiErrors.UNSUPPORTED_ORDER_TYPE,
ApiErrors.EXCESSIVE_VALID_TO, // Order is too far in the future, likely some bad logic, drop it
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@
resolved "https://registry.yarnpkg.com/@cowprotocol/contracts/-/contracts-1.4.0.tgz#e93e5f25aac76feeaa348fa57231903274676247"
integrity sha512-XLs3SlPmXD4lbiWIO7mxxuCn1eE5isuO6EUlE1cj17HqN/wukDAN0xXYPx6umOH/XdjGS33miMiPHELEyY9siw==

"@cowprotocol/cow-sdk@^5.0.1":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@cowprotocol/cow-sdk/-/cow-sdk-5.1.0.tgz#df179c43bdf9d66d7134ac1290d26b6993fb5a1f"
integrity sha512-o1QTav1TWvNeI9UV8Gy3TPGVUFIWlLBSWcRGpxRvGy6ktWceIKK54VVLrh2mlRBbBvl3eH8jCYthj9cBbzECfg==
"@cowprotocol/cow-sdk@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@cowprotocol/cow-sdk/-/cow-sdk-5.2.0.tgz#f3ec621b579b4a9bf2e6fd3d695786f7c7978e56"
integrity sha512-7AWWEM4uyKDHyBoivAEkgULpI+mVZ4thMQXRM/CB8hW5MrnGxq6ONJECrq2k7uAiHrn9i2kdPjCwSPxKayVY8Q==
dependencies:
"@cowprotocol/contracts" "^1.4.0"
"@ethersproject/abstract-signer" "^5.7.0"
Expand Down
Loading