Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/client/src/actions/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function swapQuote(
*
* ```ts
* const result = await swappableTokens(client, {
* query: { chainId: chainId(1) },
* query: { chainIds: [chainId(1)] },
* });
* ```
*
Expand Down
5 changes: 2 additions & 3 deletions packages/client/src/actions/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ export function userHistory(
export function userSummaryHistory(
client: AaveClient,
request: UserSummaryHistoryRequest,
_options: Required<CurrencyQueryOptions> = DEFAULT_QUERY_OPTIONS,
options: Required<CurrencyQueryOptions> = DEFAULT_QUERY_OPTIONS,
): ResultAsync<UserSummaryHistoryItem[], UnexpectedError> {
// TODO: wire up _options once AAVE-1982 is implemented
return client.query(UserSummaryHistoryQuery, { request });
return client.query(UserSummaryHistoryQuery, { request, ...options });
}
2 changes: 1 addition & 1 deletion packages/client/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const exchange = cacheExchange({
PaginatedUserHistoryResult: () => null,
SpokeConfig: () => null,
SpokePositionManger: () => null,
SpokeUserPositionManger: () => null,
SpokeUserPositionManager: () => null,
SwapReceipt: () => null,
SwapTransactionRequest: () => null,

Expand Down
39 changes: 25 additions & 14 deletions packages/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ type PaginatedSpokePositionManagerResult {
}

type PaginatedSpokeUserPositionManagerResult {
items: [SpokeUserPositionManger!]!
items: [SpokeUserPositionManager!]!
pageInfo: PaginatedResultInfo!
}

Expand Down Expand Up @@ -870,6 +870,7 @@ type ReserveSettings {
type ReserveStatus {
frozen: Boolean!
paused: Boolean!
active: Boolean!
}

type ReserveSummary {
Expand Down Expand Up @@ -987,8 +988,8 @@ type Spoke {
}

type SpokeConfig {
"""Is the spoke active"""
active: Boolean!
nativeGateway: EvmAddress!
signatureGateway: EvmAddress!
}

input SpokeInput {
Expand All @@ -1001,13 +1002,15 @@ input SpokeInput {

input SpokePositionManagersRequest {
spoke: SpokeInput!
includeInactive: Boolean
pageSize: PageSize!
cursor: Cursor
}

type SpokePositionManger {
name: String
name: String!
address: EvmAddress!
active: Boolean!
}

input SpokeTokenInput {
Expand All @@ -1021,18 +1024,20 @@ input SpokeTokenInput {
chainId: ChainId!
}

type SpokeUserPositionManager {
name: String!
address: EvmAddress!
approvedOn: DateTime!
active: Boolean!
}

input SpokeUserPositionManagersRequest {
spoke: SpokeInput!
user: EvmAddress!
pageSize: PageSize!
cursor: Cursor
}

type SpokeUserPositionManger {
name: String
address: EvmAddress!
enabledAt: DateTime!
}

input SpokesRequest @oneOf {
"""
The hub address and chain id
Expand Down Expand Up @@ -1276,7 +1281,7 @@ input SwappableTokensRequest {
}

input SwappableTokensRequestQuery {
chainId: ChainId!
chainIds: [ChainId!]!
}

enum TimeWindow {
Expand Down Expand Up @@ -1559,11 +1564,17 @@ input UserSummaryFilter @oneOf {
}

type UserSummaryHistoryItem {
netBalance: FiatAmount!
borrows: FiatAmount!
supplies: FiatAmount!
healthFactor: BigDecimal
date: DateTime!

"""The net balance"""
netBalance(currency: Currency! = USD): FiatAmount!

"""The borrows"""
borrows(currency: Currency! = USD): FiatAmount!

"""The supplies"""
supplies(currency: Currency! = USD): FiatAmount!
}

input UserSummaryHistoryRequest {
Expand Down
1 change: 1 addition & 0 deletions packages/graphql/src/fragments/reserve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const ReserveStatusFragment = graphql(
__typename
frozen
paused
active
}`,
);
export type ReserveStatus = FragmentOf<typeof ReserveStatusFragment>;
Expand Down
20 changes: 17 additions & 3 deletions packages/graphql/src/fragments/spoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import type { FragmentOf } from 'gql.tada';
import { graphql } from '../graphql';
import { ChainFragment, PaginatedResultInfoFragment } from './common';

export const SpokeConfigFragment = graphql(
`fragment SpokeConfig on SpokeConfig {
__typename
nativeGateway
signatureGateway
}`,
);
export type SpokeConfig = FragmentOf<typeof SpokeConfigFragment>;

export const SpokeFragment = graphql(
`fragment Spoke on Spoke {
__typename
Expand All @@ -10,8 +19,11 @@ export const SpokeFragment = graphql(
chain {
...Chain
}
config {
...SpokeConfig
}
}`,
[ChainFragment],
[ChainFragment, SpokeConfigFragment],
);

export type Spoke = FragmentOf<typeof SpokeFragment>;
Expand All @@ -20,6 +32,7 @@ export const SpokePositionManagerFragment = graphql(
`fragment SpokePositionManager on SpokePositionManger {
__typename
address
active
name
}`,
);
Expand All @@ -46,10 +59,11 @@ export type PaginatedSpokePositionManagerResult = FragmentOf<
>;

export const SpokeUserPositionManagerFragment = graphql(
`fragment SpokeUserPositionManager on SpokeUserPositionManger {
`fragment SpokeUserPositionManager on SpokeUserPositionManager {
__typename
address
enabledAt
approvedOn
active
name
}`,
);
Expand Down
6 changes: 3 additions & 3 deletions packages/graphql/src/fragments/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,13 @@ export type PaginatedUserHistoryResult = FragmentOf<
export const UserSummaryHistoryItemFragment = graphql(
`fragment UserSummaryHistoryItem on UserSummaryHistoryItem {
__typename
netBalance {
netBalance(currency: $currency) {
...FiatAmount
}
borrows {
borrows(currency: $currency) {
...FiatAmount
}
supplies {
supplies(currency: $currency) {
...FiatAmount
}
healthFactor
Expand Down
Loading