@@ -24,7 +24,7 @@ import {
2424 type UserSuppliesRequest ,
2525 type UserSupplyItem ,
2626} from '@aave/graphql-next' ;
27- import type { ResultAsync } from '@aave/types-next' ;
27+ import type { Prettify , ResultAsync } from '@aave/types-next' ;
2828import type { AaveClient } from '../AaveClient' ;
2929import {
3030 type CurrencyQueryOptions ,
@@ -88,6 +88,10 @@ export function userBorrows(
8888 return client . query ( UserBorrowsQuery , { request, ...options } ) ;
8989}
9090
91+ export type UserSummaryQueryOptions = Prettify <
92+ CurrencyQueryOptions & TimeWindowQueryOptions
93+ > ;
94+
9195/**
9296 * Fetches a user's summary across all positions.
9397 *
@@ -108,11 +112,15 @@ export function userBorrows(
108112export function userSummary (
109113 client : AaveClient ,
110114 request : UserSummaryRequest ,
111- options : Required < TimeWindowQueryOptions > = DEFAULT_QUERY_OPTIONS ,
115+ {
116+ currency = DEFAULT_QUERY_OPTIONS . currency ,
117+ timeWindow = DEFAULT_QUERY_OPTIONS . timeWindow ,
118+ } : UserSummaryQueryOptions = DEFAULT_QUERY_OPTIONS ,
112119) : ResultAsync < UserSummary , UnexpectedError > {
113120 return client . query ( UserSummaryQuery , {
114121 request,
115- timeWindow : options . timeWindow ,
122+ currency,
123+ timeWindow,
116124 } ) ;
117125}
118126
@@ -138,9 +146,12 @@ export type UserPositionQueryOptions = CurrencyQueryOptions &
138146export function userPositions (
139147 client : AaveClient ,
140148 request : UserPositionsRequest ,
141- options : Required < UserPositionQueryOptions > = DEFAULT_QUERY_OPTIONS ,
149+ {
150+ currency = DEFAULT_QUERY_OPTIONS . currency ,
151+ timeWindow = DEFAULT_QUERY_OPTIONS . timeWindow ,
152+ } : UserPositionQueryOptions = DEFAULT_QUERY_OPTIONS ,
142153) : ResultAsync < UserPosition [ ] , UnexpectedError > {
143- return client . query ( UserPositionsQuery , { request, ... options } ) ;
154+ return client . query ( UserPositionsQuery , { request, currency , timeWindow } ) ;
144155}
145156
146157/**
@@ -160,9 +171,12 @@ export function userPositions(
160171export function userPosition (
161172 client : AaveClient ,
162173 request : UserPositionRequest ,
163- options : Required < UserPositionQueryOptions > = DEFAULT_QUERY_OPTIONS ,
174+ {
175+ currency = DEFAULT_QUERY_OPTIONS . currency ,
176+ timeWindow = DEFAULT_QUERY_OPTIONS . timeWindow ,
177+ } : UserPositionQueryOptions = DEFAULT_QUERY_OPTIONS ,
164178) : ResultAsync < UserPosition | null , UnexpectedError > {
165- return client . query ( UserPositionQuery , { request, ... options } ) ;
179+ return client . query ( UserPositionQuery , { request, currency , timeWindow } ) ;
166180}
167181
168182/**
0 commit comments