DeribitEx.AdapterIntegration (deribit_ex v0.2.0)

View Source

Integration file to add token management to Adapter.

This module provides a structured approach to patching Adapter with token management functionality. Using this approach ensures better migration control than directly modifying Adapter.ex.

Usage

Add the following line to the application.ex start function to apply patches:

DeribitEx.AdapterIntegration.apply_patches()

Summary

Functions

Applies all token management patches to Adapter.

Gets tracked request using response ID.

Checks if a message is an auth response.

Functions

apply_patches()

@spec apply_patches() :: :ok

Applies all token management patches to Adapter.

This function would set up function replacements, but for now it's just a placeholder since the :meck library is not included in the project.

get_tracked_request(request_id, state)

@spec get_tracked_request(String.t() | integer(), map()) :: map()

Gets tracked request using response ID.

Helper function for integration tests.

is_auth_response?(message)

@spec is_auth_response?(map() | any()) :: boolean()

Checks if a message is an auth response.

Helper function for integration tests.