File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ export class UniDevKitV4 {
137137 * from the pool key currencies, computes the PoolId, and then reads the tick info from the
138138 * blockchain.
139139 *
140- * @param args @type { GetTickInfoArgs } - Tick query parameters including pool key and tick index
140+ * @param args - Tick query parameters including pool key and tick index
141141 * @returns Promise<TickInfoResponse> - Tick information including liquidity and fee growth data
142142 * @throws Error if tick data cannot be fetched or contract call reverts
143143 */
Original file line number Diff line number Diff line change @@ -17,11 +17,17 @@ export async function getTickInfo(
1717 const { poolKey, tick } = args
1818
1919 // Create Token instances for currency0 and currency1 in the provided order
20- const [ currency0 , currency1 ] = await getTokens (
20+ const tokens = await getTokens (
2121 { addresses : [ poolKey . currency0 as `0x${string } `, poolKey . currency1 as `0x${string } `] } ,
2222 instance ,
2323 )
2424
25+ if ( ! tokens || tokens . length < 2 ) {
26+ throw new Error ( 'Failed to fetch token instances' )
27+ }
28+
29+ const [ currency0 , currency1 ] = tokens
30+
2531 // Compute PoolId from PoolKey components
2632 const poolId32Bytes = Pool . getPoolId (
2733 currency0 ,
You can’t perform that action at this time.
0 commit comments