refactor: rename SolaceScanScout to Solace and update related configurations
- Updated branding from "SolaceScanScout" to "Solace" across various files including deployment scripts, API responses, and documentation. - Changed default base URL for Playwright tests and updated security headers to reflect the new branding. - Enhanced README and API documentation to include new authentication endpoints and product access details. This refactor aligns the project branding and improves clarity in the API documentation.
This commit is contained in:
@@ -67,9 +67,42 @@ export interface MissionControlLiquidityPool {
|
||||
}
|
||||
|
||||
export interface MissionControlLiquidityPoolsResponse {
|
||||
count?: number
|
||||
pools?: MissionControlLiquidityPool[]
|
||||
}
|
||||
|
||||
interface RawMissionControlLiquidityPoolsResponse {
|
||||
count?: number
|
||||
pools?: MissionControlLiquidityPool[]
|
||||
data?: {
|
||||
count?: number
|
||||
pools?: MissionControlLiquidityPool[]
|
||||
}
|
||||
}
|
||||
|
||||
export function normalizeMissionControlLiquidityPools(
|
||||
raw: RawMissionControlLiquidityPoolsResponse | null | undefined
|
||||
): MissionControlLiquidityPoolsResponse {
|
||||
if (!raw) {
|
||||
return { count: 0, pools: [] }
|
||||
}
|
||||
|
||||
const nested = raw.data
|
||||
const pools = Array.isArray(raw.pools)
|
||||
? raw.pools
|
||||
: Array.isArray(nested?.pools)
|
||||
? nested.pools
|
||||
: []
|
||||
|
||||
const count = typeof raw.count === 'number'
|
||||
? raw.count
|
||||
: typeof nested?.count === 'number'
|
||||
? nested.count
|
||||
: pools.length
|
||||
|
||||
return { count, pools }
|
||||
}
|
||||
|
||||
const tokenAggregationBase = `${getExplorerApiBase()}/token-aggregation/api/v1`
|
||||
const missionControlBase = `${getExplorerApiBase()}/explorer-api/v1/mission-control`
|
||||
|
||||
@@ -89,7 +122,9 @@ export const routesApi = {
|
||||
fetchJson<RouteMatrixResponse>(`${tokenAggregationBase}/routes/matrix?includeNonLive=true`),
|
||||
|
||||
getTokenPools: async (tokenAddress: string): Promise<MissionControlLiquidityPoolsResponse> =>
|
||||
fetchJson<MissionControlLiquidityPoolsResponse>(
|
||||
`${missionControlBase}/liquidity/token/${tokenAddress}/pools`
|
||||
normalizeMissionControlLiquidityPools(
|
||||
await fetchJson<RawMissionControlLiquidityPoolsResponse>(
|
||||
`${missionControlBase}/liquidity/token/${tokenAddress}/pools`
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user