Commit Graph

14 Commits

Author SHA1 Message Date
Sale Djenic 00559692bc chore!: router code organization improvements
It's a breaking change due to errors' changes, the list of mapped old error codes:
- `"WR-001"` is now `"WRR-001"`
- `"WR-002"` is now `"WRR-002"`
- `"WR-003"` is now `"WRR-003"`
- `"WR-004"` is now `"WRR-004"`
- `"WR-005"` is now `"WRR-005"`
- `"WR-006"` is now `"WRR-006"`
- `"WR-007"` is now `"WRR-007"`
- `"WR-008"` is now `"WRR-008"`
- `"WR-009"` is now `"WRR-009"`
- `"WR-010"` is now `"WRR-010"`
- `"WR-011"` is now `"WRR-011"`
- `"WR-012"` is now `"WRR-012"`
- `"WR-013"` is now `"WRR-013"`
- `"WR-014"` is now `"WRR-014"`
- `"WR-015"` is now `"WRR-015"`
- `"WR-019"` is now `"WRR-016"`
- `"WR-020"` is now `"WRR-017"`
- `"WR-021"` is now `"WRR-018"`
- `"WR-025"` is now `"WRR-019"`

- `"WR-016"` is now `"WR-001"`
- `"WR-017"` is now `"WR-002"`
- `"WR-018"` is now `"WR-003"`
- `"WR-022"` is now `"WR-004"`
- `"WR-023"` is now `"WR-005"`
- `"WR-024"` is now `"WR-006"`
- `"WR-026"` is now `"WR-007"`
- `"WR-027"` is now `"WR-008"`

Other changes:
- `RouteInputParams` type moved to `requests` package and code updated accordingly
- `SuggestedFees` type moved to a new `fees` package and code updated accordingly
- `SendType` type moved to a new `sendtype` package and code updated accordingly
- the following functions moved to `common` package
  - `ArrayContainsElement`
  - `ArraysWithSameElements`
  - `SameSingleChainTransfer`
  - `CopyMapGeneric`
  - `GweiToEth`
  - `WeiToGwei`
- the following consts moved to `common` package
  - `HexAddressLength`
  - `SupportedNetworks`
  - `SupportedTestNetworks`
2024-09-11 13:51:51 +02:00
Sale Djenic 9b9a91f654 chore_: map insufficient funds error
This commit maps this kind of errors
`status-proxy-0.error: failed with 50011064 gas: insufficient funds for gas * price + value: address 0x4eeB09cf0076F840b38511D808464eE48efD4305 have 0 want 10000000000000`
to this form:
`status-proxy-0.error: failed with 50011064 gas: insufficient funds for gas * price + value: address 0x4eeB09cf0076F840b38511D808464eE48efD4305`

which means that we don't want to display to a user details of how much they have and how much is needed for fees, cause those data are very often
misleading, referring mostly to "how much user has".

New error added in case there is no positive balances across all enabled chains.
2024-08-28 08:23:18 +02:00
frank 83aa01c7da
chore_:update route error details (#5749) 2024-08-20 21:14:35 +08:00
Sale Djenic 8787da1b89 feat_: added new error which will be returned in case bonder fee is higher than the amount being sent 2024-07-31 15:12:05 +02:00
Sale Djenic 20c1b83b7c chore_: when returning errors, give precedence to custom (network) errors 2024-07-29 10:05:56 +02:00
belalshehab 03cb3ad0ab fix(Wallet)_: Add quotes around token symbol in insufficient balance error messages to ensure valid JSON parsing 2024-07-26 13:16:23 +03:00
saledjenic 2bbdb35f6c
Added improvements in resolving the best route (#5569)
* fix_: filtering out routes which do not match the amount in

* fix_: finding the best route logic updated

* fix_: "to" chains being used in sending bridge tx via hop are more explicit

Using `ChainIDTo` depicts better an intention which chain should be used.

* chore_: checking for required balance improved

An error contains now more details, for which token on which chain there is not enough balance for
executing a tx. Also check for required balance now calculates in fees for all tx that possibly can be
sent from the same chain.
2024-07-25 08:15:30 -04:00
Dario Gabriel Lipicar afc6e7bcb9 feat(router)_: return processor error when no routes are found 2024-07-19 17:44:08 +02:00
Sale Djenic 378e5741b9 feat_: the router - add candidates, as potential paths, by taking the max amount on enabled chains 2024-07-05 14:51:34 +02:00
Samuel Hawksby-Robinson 59853fdbe2 test(router_validation)_: integrated the new errors into test loigc 2024-07-03 11:47:04 +01:00
Samuel Hawksby-Robinson da2af02049 test(router_validation)_: Added test cases for Sticker and Swaps 2024-07-03 11:47:04 +01:00
Samuel Hawksby-Robinson cdaca322d0 test(router_validation)_: Added Error consts for all tested paths 2024-07-03 11:47:04 +01:00
Sale Djenic 92361d9e20 feat_: new endpoint added for an async route/s calculation
- `GetSuggestedRoutesV2Async` calculates the route/s based on input parameters and sends
`wallet.suggested.routes` signal to notify a client.
2024-07-01 15:07:17 +02:00
Sale Djenic 1cdcc0dcc2 chore_: tests for router candidates added 2024-06-26 11:02:13 +01:00