Closed Defi-Moses closed 5 days ago
The pull request introduces enhancements to the Synapse Protocol REST API, specifically in the bridge
and swap
functionalities. It adds optional query parameters destAddress
and address
to their respective controllers and routes, updating the request handling and response structures accordingly. The API documentation is also revised to reflect these changes, including validation logic for the new parameters. Additionally, new test cases are added to ensure proper functionality and error handling for the updated routes.
File Path | Change Summary |
---|---|
packages/rest-api/src/controllers/bridgeController.ts |
- Added optional destAddress parameter to the request query.- Updated type definitions for request query. - Modified response logic to include callData based on destAddress . |
packages/rest-api/src/controllers/swapController.ts |
- Added optional address parameter to the request query.- Updated logic to conditionally call Synapse.swap based on address presence, and modified response to include callData . |
packages/rest-api/src/routes/bridgeRoute.ts |
- Added optional destAddress parameter in OpenAPI documentation and route validation.- Updated response schema to include callData property. |
packages/rest-api/src/routes/swapRoute.ts |
- Added optional address parameter in OpenAPI documentation.- Implemented validation for address parameter.- Updated response schema to include callData object. |
packages/rest-api/src/tests/bridgeRoute.test.ts |
- Added new test cases for handling destAddress , including valid, invalid, and absence scenarios. |
packages/rest-api/src/tests/swapRoute.test.ts |
- Added new test cases for handling address , including valid, invalid, and absence scenarios. |
packages/rest-api/swagger.json |
- Updated API documentation to include new destAddress and address parameters for /bridge and /swap endpoints, respectively. |
sdk-router
related to the originUserAddress
parameter are relevant as they enhance the handling of bridge operations, similar to the updates made in the bridgeController
of the main PR.originUserAddress
in the context of bridge quotes, aligning with the changes in the main PR that involve the originUserAddress
parameter.bridgeController
regarding the bridgeFeeFormatted
calculation are related to the changes in the main PR, which also involves updates to the bridgeController
.originUserAddress
parameter in the bridgeController
and bridgeTxInfoController
is directly related to the changes made in the main PR, which also introduces this parameter.BRIDGE_MAP
and token definitions, including the addition of new tokens, are relevant as they may interact with the changes made in the main PR regarding the handling of bridge transactions.size/m
, M-explorer-ui
π In the land of code where the rabbits play,
New paths are forged, come join the fray!
WithdestAddress
andaddress
in tow,
Our API leaps, ready to grow!
So hop along, letβs test and see,
What wonders await in our code spree! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Latest commit: |
7d0afc5
|
Status: | β Deploy successful! |
Preview URL: | https://23a8196e.sanguine-fe.pages.dev |
Branch Preview URL: | https://api-bridge-change.sanguine-fe.pages.dev |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.44834%. Comparing base (
798286f
) to head (7d0afc5
). Report is 2 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
Release Notes
New Features
destAddress
parameter for the/bridge
endpoint, enhancing token bridging capabilities.address
parameter for the/swap
endpoint, allowing users to specify the address performing the swap.Documentation
Tests
/bridge
and/swap
endpoints to ensure robust handling of new parameters and error scenarios.