Skip to content

Commit

Permalink
Add optional axios instance to getSolverCapacity params
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-palmer committed Feb 21, 2024
1 parent 237d571 commit f695805
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/sdk/src/methods/getSolverCapacity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { paths } from '../types/index.js'
import { axios } from '../utils/axios.js'
import { getClient } from '../client.js'
import { zeroAddress } from 'viem'
import type { AxiosInstance } from 'axios'

export type GetConfigQueryParams = Required<
Pick<
Expand All @@ -18,7 +19,8 @@ export type GetConfigResponse =
paths['/config']['get']['responses']['200']['content']['application/json']

export async function getSolverCapacity(
data: GetConfigQueryParams
data: GetConfigQueryParams,
axiosInstance: AxiosInstance = axios
): Promise<GetConfigResponse> {
const client = getClient()

Expand All @@ -30,7 +32,7 @@ export async function getSolverCapacity(
data.user = data.user || zeroAddress
data.currency = data.currency || zeroAddress

const response = await axios.get<GetConfigResponse>(
const response = await axiosInstance.get<GetConfigResponse>(
`${client.baseApiUrl}/config`,
{ params: data }
)
Expand Down

0 comments on commit f695805

Please sign in to comment.