Skip to content

Commit d96978c

Browse files
committed
copilot bot feedback
1 parent bf89aa2 commit d96978c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/core/uniDevKitV4.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
*/

src/utils/getTickInfo.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)