-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update OsmosisHistoricalQuery to receive custom Axios Instance
- Loading branch information
Showing
14 changed files
with
423 additions
and
380 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { osmosisInstance } from "../../../common"; | ||
import { AxiosInstance } from "axios"; | ||
import type { APRResponse, StakingAPRResponse } from "./types"; | ||
|
||
export type { APRResponse, StakingAPRResponse }; | ||
|
||
export const getStakingAPR = async (): Promise<StakingAPRResponse> => { | ||
return (await osmosisInstance.get("/apr/v2/staking")).data; | ||
}; | ||
export const getStakingAPR = | ||
(instance: AxiosInstance) => async (): Promise<StakingAPRResponse> => { | ||
return (await instance.get("/apr/v2/staking")).data; | ||
}; | ||
|
||
export const getAllAPR = async (): Promise<APRResponse> => { | ||
return (await osmosisInstance.get("/apr/v2/all")).data; | ||
}; | ||
export const getAllAPR = | ||
(instance: AxiosInstance) => async (): Promise<APRResponse> => { | ||
return (await instance.get("/apr/v2/all")).data; | ||
}; | ||
|
||
export const getAPR = async ({ | ||
poolId, | ||
}: { | ||
poolId: number; | ||
}): Promise<APRResponse> => { | ||
return (await osmosisInstance.get(`/apr/v2/${poolId}`)).data; | ||
}; | ||
export const getAPR = | ||
(instance: AxiosInstance) => | ||
async ({ poolId }: { poolId: number }): Promise<APRResponse> => { | ||
return (await instance.get(`/apr/v2/${poolId}`)).data; | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { osmosisInstance } from "../../../common"; | ||
import { AxiosInstance } from "axios"; | ||
import type { HealthResponse } from "./types"; | ||
|
||
export type { HealthResponse }; | ||
|
||
export const getHealth = async (): Promise<HealthResponse> => { | ||
return (await osmosisInstance.get("/health/v1/check")).data; | ||
}; | ||
export const getHealth = | ||
(instance: AxiosInstance) => async (): Promise<HealthResponse> => { | ||
return (await instance.get("/health/v1/check")).data; | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import { osmosisInstance } from "../../../common"; | ||
import { AxiosInstance } from "axios"; | ||
import type { LiquidityHistoricalChartResponse } from "./types"; | ||
|
||
export type { LiquidityHistoricalChartResponse }; | ||
|
||
export const getLiquidityHistoricalChart = | ||
(instance: AxiosInstance) => | ||
async (): Promise<LiquidityHistoricalChartResponse> => { | ||
return (await osmosisInstance.get("/liquidity/v2/historical/chart")).data; | ||
return (await instance.get("/liquidity/v2/historical/chart")).data; | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { osmosisInstance } from "../../../common"; | ||
import { AxiosInstance } from "axios"; | ||
import type { MessageResponse, MetricsResponse } from "./types"; | ||
|
||
export type { MessageResponse, MetricsResponse }; | ||
|
||
export const getMetrics = async (): Promise<MetricsResponse> => { | ||
return (await osmosisInstance.get("/overview/v1/metrics")).data; | ||
}; | ||
export const getMetrics = | ||
(instance: AxiosInstance) => async (): Promise<MetricsResponse> => { | ||
return (await instance.get("/overview/v1/metrics")).data; | ||
}; | ||
|
||
export const getMessage = async (): Promise<MessageResponse> => { | ||
return (await osmosisInstance.get("/overview/v1/message")).data; | ||
}; | ||
export const getMessage = | ||
(instance: AxiosInstance) => async (): Promise<MessageResponse> => { | ||
return (await instance.get("/overview/v1/message")).data; | ||
}; |
This file contains 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
Oops, something went wrong.