Skip to main content

src/lib/uniswap/hooks

creatorvault-miniapp


creatorvault-miniapp / src/lib/uniswap/hooks

src/lib/uniswap/hooks

Type Aliases

PoolHistoryData

PoolHistoryData = object

Defined in: lib/uniswap/hooks.ts:3

Properties

dataPoints

dataPoints: object[]

Defined in: lib/uniswap/hooks.ts:11

close?

optional close: number

feesUSD

feesUSD: number

high?

optional high: number

low?

optional low: number

open?

optional open: number

timestamp

timestamp: number

tvlUSD

tvlUSD: number

volumeUSD

volumeUSD: number

feesUSD

feesUSD: number

Defined in: lib/uniswap/hooks.ts:8

poolId

poolId: string | null

Defined in: lib/uniswap/hooks.ts:6

priceChangePercent

priceChangePercent: number

Defined in: lib/uniswap/hooks.ts:10

timeframe

timeframe: string

Defined in: lib/uniswap/hooks.ts:5

tokenAddress

tokenAddress: string

Defined in: lib/uniswap/hooks.ts:4

tvlUSD

tvlUSD: number

Defined in: lib/uniswap/hooks.ts:9

volumeUSD

volumeUSD: number

Defined in: lib/uniswap/hooks.ts:7

Functions

usePoolHistory()

usePoolHistory(tokenAddress, timeframe, options?): UseQueryResult<PoolHistoryData | null, Error>

Defined in: lib/uniswap/hooks.ts:58

Hook to fetch historical pool data for a token

Parameters

tokenAddress

The token contract address

string | undefined

timeframe

One of: 1h, 1d, 1w, 1m, 1y

"1h" | "1d" | "1w" | "1m" | "1y"

options?

Query options (enabled, etc.)

enabled?

boolean

Returns

UseQueryResult<PoolHistoryData | null, Error>


useUniswapServiceStatus()

useUniswapServiceStatus(): UseQueryResult<{ available: boolean; reason: string; } | { available: boolean; reason: null; }, Error>

Defined in: lib/uniswap/hooks.ts:77

Check if Uniswap data service is available This can be used to conditionally enable timeframe filters

Returns

UseQueryResult<{ available: boolean; reason: string; } | { available: boolean; reason: null; }, Error>