feat: Implementing close_position method#386
Closed
ndatta-nethermind wants to merge 82 commits into
Closed
Conversation
…l#387) This PR: - Updates `dydx-proto` version. - Introduces `#[serde(deny_unknown_fields)]` to not miss any fields from return types. - Adds several missed return types. - Reorders some of the struct fields to align with the indexer implementation. - Has some minor fixes for new clippy version
Reference to the PR this one is created in place of [here](dydxprotocol#389)
fix: close position
This pull request introduces support for proxy configurations in the `v4-client-js` package. The changes include adding proxy support to both REST and WebSocket clients, updating constructors, and introducing utility functions to handle proxy agents. ### Proxy Support Enhancements: * **Proxy configuration added to `IndexerConfig`:** The `IndexerConfig` class now includes an optional `proxy` parameter of type `AxiosProxyConfig`, allowing users to specify proxy settings. The constructor was updated to initialize this property. (`v4-client-js/src/clients/constants.ts`, [v4-client-js/src/clients/constants.tsR247-R252](diffhunk://#diff-1a0931f9cb2a865b6d73148c440e7d29f6fe1f6991fb406a190f2e56082bcbd5R247-R252)) * **REST client proxy integration:** The `RestClient` class now uses an `axios` instance configured with the optional `proxy` parameter. This replaces the previous direct use of the `request` function for HTTP requests. (`v4-client-js/src/clients/modules/rest.ts`, [[1]](diffhunk://#diff-0a6ead65c843f918b4acedfc6e9b595005415d093160fbdb43bca1c867dd49ecR1-R28) [[2]](diffhunk://#diff-0a6ead65c843f918b4acedfc6e9b595005415d093160fbdb43bca1c867dd49ecL32-R39) * **WebSocket client proxy integration:** The `SocketClient` class now supports proxy configurations by utilizing the `HttpsProxyAgent` library. The `proxyAgent` is initialized using a new utility function, `getProxyAgent`, and passed to the WebSocket connection. (`v4-client-js/src/clients/socket-client.ts`, [[1]](diffhunk://#diff-c4c36d3ced6c5f292f1d45c1ff474d57f921370435bd85caafbe72b6465d260cR1-R5) [[2]](diffhunk://#diff-c4c36d3ced6c5f292f1d45c1ff474d57f921370435bd85caafbe72b6465d260cR42) [[3]](diffhunk://#diff-c4c36d3ced6c5f292f1d45c1ff474d57f921370435bd85caafbe72b6465d260cR57-R67) * **Utility function for proxy agent creation:** A new utility function, `getProxyAgent`, was added to generate an `HttpsProxyAgent` instance from an `AxiosProxyConfig` object. (`v4-client-js/src/lib/utils.ts`, [[1]](diffhunk://#diff-63d05f995846a96324239cfaf78bdd5bfb2b1e5a32726bb236915b6ce379e201R1-R3) [[2]](diffhunk://#diff-63d05f995846a96324239cfaf78bdd5bfb2b1e5a32726bb236915b6ce379e201R80-R84) ### Dependency Updates: * **Added `https-proxy-agent` dependency:** The `https-proxy-agent` library was added to the `package.json` file to enable proxy support for WebSocket connections. (`v4-client-js/package.json`, [v4-client-js/package.jsonR65](diffhunk://#diff-ec61c6dbaf924b282dbb0275f615f0fe5daa0eab5e3f720e5cedb87fa3caeffaR65))
gaonip
reviewed
Aug 13, 2025
gaonip
requested changes
Aug 20, 2025
'util' is unnecessary and breaks in some browser setups apparently
Contributor
Author
|
Created another PR with cleaned up code here: #421 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.