Skip to content

Commit c851518

Browse files
authored
Merge pull request #8 from aave/chore/schema-and-cursor
chore: update bindings and missing Cursor scalar
2 parents 5389d40 + fc345ca commit c851518

File tree

12 files changed

+143
-72
lines changed

12 files changed

+143
-72
lines changed

packages/client/src/actions/transactions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export function vaultRedeemShares(
291291
}
292292

293293
/**
294-
* Creates a transaction to deploy a new vault.
294+
* Creates an execution plan to deploy a new vault.
295295
*
296296
* ```ts
297297
* const result = await vaultDeploy(client, {
@@ -306,7 +306,7 @@ export function vaultRedeemShares(
306306
* }).andThen(sendWith(wallet));
307307
*
308308
* if (result.isErr()) {
309-
* // Handle error, e.g. signing error, etc.
309+
* // Handle error, e.g. signing error, insufficient balance, etc.
310310
* return;
311311
* }
312312
*
@@ -315,12 +315,12 @@ export function vaultRedeemShares(
315315
*
316316
* @param client - Aave client.
317317
* @param request - The deploy vault request parameters.
318-
* @returns The transaction request data to deploy a vault.
318+
* @returns The execution plan data to deploy a vault. May require approval transactions.
319319
*/
320320
export function vaultDeploy(
321321
client: AaveClient,
322322
request: VaultDeployRequest,
323-
): ResultAsync<TransactionRequest, UnexpectedError> {
323+
): ResultAsync<ExecutionPlan, UnexpectedError> {
324324
return client.query(VaultDeployQuery, { request });
325325
}
326326

packages/client/src/actions/user.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
UserSuppliesQuery,
88
type UserSuppliesRequest,
99
UserTransactionHistoryQuery,
10+
type UserTransactionHistoryRequest,
1011
} from '@aave/graphql';
1112
import type { ResultAsync } from '@aave/types';
1213
import type { AaveClient } from '../client';
@@ -66,6 +67,7 @@ export function userBorrows(
6667
*/
6768
export function userTransactionHistory(
6869
client: AaveClient,
70+
request: UserTransactionHistoryRequest,
6971
): ResultAsync<PaginatedUserTransactionHistoryResult, UnexpectedError> {
70-
return client.query(UserTransactionHistoryQuery, {});
72+
return client.query(UserTransactionHistoryQuery, { request });
7173
}

packages/graphql/schema.graphql

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ type Chain {
8787
explorerUrl: String!
8888
}
8989

90+
"""A supported blockchain chain ID"""
9091
scalar ChainId
9192

9293
input CollateralToggleRequest {
@@ -368,17 +369,8 @@ input MarketReservesRequestOrderBy @oneOf {
368369
"""Order by the supply APY"""
369370
supplyApy: OrderDirection
370371

371-
"""Order by whether the asset can be used as collateral"""
372-
canBeCollateralized: OrderDirection
373-
374372
"""Order by the token name"""
375373
tokenName: OrderDirection
376-
377-
"""Order by the amount available for the user to borrow"""
378-
userAvailableToBorrow: OrderByUserCriteria
379-
380-
"""Order by the user's balance of this asset"""
381-
userBalance: OrderByUserCriteria
382374
}
383375

384376
enum MarketReservesRequestType {
@@ -485,14 +477,6 @@ type NativeCurrency {
485477
chainId: ChainId!
486478
}
487479

488-
input OrderByUserCriteria {
489-
"""The address of the user"""
490-
address: EvmAddress!
491-
492-
"""The order direction"""
493-
direction: OrderDirection! = DESC
494-
}
495-
496480
enum OrderDirection {
497481
ASC
498482
DESC
@@ -552,7 +536,7 @@ type Query {
552536
userVaults(request: UserVaultsRequest!): PaginatedVaultsResult!
553537

554538
"""Deploy a vault and earn fees from the yield"""
555-
vaultDeploy(request: VaultDeployRequest!): TransactionRequest!
539+
vaultDeploy(request: VaultDeployRequest!): ExecutionPlan!
556540

557541
"""
558542
Update a vault's fee. You MUST be the owner of the vault to send this tx request.
@@ -982,7 +966,7 @@ input UserBorrowsRequest {
982966

983967
input UserBorrowsRequestOrderBy @oneOf {
984968
"""Order by the user's debt amount"""
985-
debt: OrderByUserCriteria
969+
debt: OrderDirection
986970

987971
"""Order by the asset name"""
988972
name: OrderDirection
@@ -1070,7 +1054,7 @@ input UserSuppliesRequest {
10701054

10711055
input UserSuppliesRequestOrderBy @oneOf {
10721056
"""Order by the user's supply balance"""
1073-
balance: OrderByUserCriteria
1057+
balance: OrderDirection
10741058

10751059
"""Order by the asset name"""
10761060
name: OrderDirection
@@ -1079,7 +1063,7 @@ input UserSuppliesRequestOrderBy @oneOf {
10791063
apy: OrderDirection
10801064

10811065
"""Order by whether the position is used as collateral"""
1082-
isCollateralized: OrderByUserCriteria
1066+
isCollateralized: OrderDirection
10831067
}
10841068

10851069
"""A transaction where the user supplied assets to a reserve."""
@@ -1175,11 +1159,8 @@ type UserVaultShares {
11751159
"""The user's shares on the vault"""
11761160
shares: TokenAmount!
11771161

1178-
"""The amount they have deposited on the vault"""
1179-
amountDeposited: TokenAmount!
1180-
1181-
"""The amount they have withdrawn on the vault"""
1182-
amountWithdrawn: TokenAmount!
1162+
"""The amount of underlying tokens they have in the vault."""
1163+
balance: TokenAmount!
11831164
}
11841165

11851166
input UserVaultsFilter {
@@ -1343,12 +1324,23 @@ input VaultInput {
13431324
chainId: ChainId!
13441325
}
13451326

1327+
input VaultMintShareInput {
1328+
"""The amount of vault shares"""
1329+
amount: BigDecimal!
1330+
1331+
"""Whether the amount should be received as aToken."""
1332+
asAToken: Boolean! = false
1333+
1334+
"""The authorization to redeem the shares."""
1335+
signature: ERC712Signature
1336+
}
1337+
13461338
input VaultMintSharesRequest {
13471339
"""The vault address"""
13481340
vault: EvmAddress!
13491341

13501342
"""The amount of shares to mint"""
1351-
shares: VaultShareInput!
1343+
shares: VaultMintShareInput!
13521344

13531345
"""The user who is wanting to mint the shares"""
13541346
minter: EvmAddress!
@@ -1362,12 +1354,23 @@ input VaultMintSharesRequest {
13621354
chainId: ChainId!
13631355
}
13641356

1357+
input VaultRedeemShareInput {
1358+
"""The amount of vault shares"""
1359+
amount: BigDecimal!
1360+
1361+
"""Whether the amount should be sent as aToken."""
1362+
asAToken: Boolean! = false
1363+
1364+
"""The authorization to redeem the shares."""
1365+
signature: ERC712Signature
1366+
}
1367+
13651368
input VaultRedeemSharesRequest {
13661369
"""The vault address"""
13671370
vault: EvmAddress!
13681371

13691372
"""The shares to redeem."""
1370-
shares: VaultShareInput!
1373+
shares: VaultRedeemShareInput!
13711374

13721375
"""
13731376
The address from which vault shares will be burned (normally your own wallet).
@@ -1422,17 +1425,6 @@ input VaultSetFeeRequest {
14221425
chainId: ChainId!
14231426
}
14241427

1425-
input VaultShareInput {
1426-
"""The amount of vault shares"""
1427-
amount: BigDecimal!
1428-
1429-
"""Whether the amount should be sent/received as aToken."""
1430-
asAToken: Boolean! = false
1431-
1432-
"""The authorization to redeem the shares."""
1433-
signature: ERC712Signature
1434-
}
1435-
14361428
input VaultWithdrawFeesRequest {
14371429
"""The vault deployed address"""
14381430
vault: EvmAddress!
@@ -1449,12 +1441,23 @@ input VaultWithdrawFeesRequest {
14491441
chainId: ChainId!
14501442
}
14511443

1444+
input VaultWithdrawInput {
1445+
"""The amount of assets to withdraw."""
1446+
amount: BigDecimal!
1447+
1448+
"""Whether the amount should be sent/received as aToken."""
1449+
asAToken: Boolean! = false
1450+
1451+
"""The authorization to redeem the shares."""
1452+
signature: ERC712Signature
1453+
}
1454+
14521455
input VaultWithdrawRequest {
14531456
"""The vault address"""
14541457
vault: EvmAddress!
14551458

1456-
"""The shares to withdraw."""
1457-
shares: VaultShareInput!
1459+
"""The details of the underlying token to withdraw."""
1460+
underlyingToken: VaultWithdrawInput!
14581461

14591462
"""
14601463
The address from which vault shares will be burned (normally your own wallet).

packages/graphql/src/fragments/vaults.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ export const UserVaultSharesFragment = graphql(
99
shares {
1010
...TokenAmount
1111
}
12-
amountDeposited {
13-
...TokenAmount
14-
}
15-
amountWithdrawn {
12+
balance {
1613
...TokenAmount
1714
}
1815
}`,

0 commit comments

Comments
 (0)