Skip to content

Commit 468f454

Browse files
committed
Merge branch 'main' into chore/update-publish-skill
2 parents 0cc16df + 820cc38 commit 468f454

15 files changed

Lines changed: 791 additions & 14 deletions

File tree

.changeset/incentives-kind-sync.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@aave/graphql": minor
3+
"@aave/client": minor
4+
"@aave/react": minor
5+
"@aave/types": minor
6+
---
7+
8+
Sync GraphQL schema with V3 backend and add the `kind` discriminator on points incentives.
9+
10+
- `SupplyPointsIncentive` / `BorrowPointsIncentive` now expose `kind: PointsProgramKind!` (`CAMPAIGN` for Merkl-backed programs, `LOYALTY` for fixed-multiplier partner programs like Ethena, Ether.fi). For `LOYALTY`, `dailyPoints` / `pointsPerThousandUsd` are always null.
11+
- New fragments: `MerklSupplyIncentive`, `MerklBorrowIncentive`, `SupplyPointsIncentive`, `BorrowPointsIncentive`, `IncentiveCriteria`, `PointsProgram`, plus extended Merit fragments (`actionKey`, `rewardTokenAddress`, `rewardTokenSymbol`, `customMessage`, `customForumLink`, `selfApr`).
12+
- New canonical `userRewards` query (supersedes `userMeritRewards`).
13+
- `RewardId` scalar mapped to a branded string in `@aave/types`.

.changeset/ninety-regions-yell.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@aave/graphql": minor
3+
"@aave/client": minor
4+
"@aave/react": minor
5+
---
6+
7+
Add stkGHO migration action support

packages/client/src/actions/gho.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
SghoVaultRedeemSharesQuery,
2020
type SghoVaultRedeemSharesRequest,
2121
type SghoVaultRequest,
22+
StkGhoMigrateQuery,
23+
type StkGhoMigrateRequest,
2224
type TokenAmount,
2325
} from '@aave/graphql';
2426
import type { ResultAsync } from '@aave/types';
@@ -181,6 +183,33 @@ export function sghoVaultRedeemShares(
181183
return client.query(SghoVaultRedeemSharesQuery, { request });
182184
}
183185

186+
/**
187+
* Creates a transaction to migrate the caller's full stkGHO position into the sGHO ERC-4626 vault.
188+
*
189+
* ```ts
190+
* const result = await stkGhoMigrate(client, {
191+
* user: evmAddress('0x9abc…'),
192+
* chainId: chainId(1),
193+
* }).andThen(sendWith(wallet))
194+
*
195+
* if (result.isErr()) {
196+
* return;
197+
* }
198+
*
199+
* // result.value: TxHash
200+
* ```
201+
*
202+
* @param client - Aave client.
203+
* @param request - The stkGHO migration request parameters.
204+
* @returns The transaction request data to migrate stkGHO to sGHO.
205+
*/
206+
export function stkGhoMigrate(
207+
client: AaveClient,
208+
request: StkGhoMigrateRequest,
209+
): ResultAsync<ExecutionPlan, UnexpectedError> {
210+
return client.query(StkGhoMigrateQuery, { request });
211+
}
212+
184213
/**
185214
* Returns the number of sGHO shares minted for a given GHO deposit amount.
186215
*

packages/client/src/actions/incentives.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import {
22
UserMeritRewardsQuery,
33
type UserMeritRewardsRequest,
4+
UserRewardsQuery,
5+
type UserRewardsRequest,
46
} from '@aave/graphql';
57
import type { AaveClient } from '../AaveClient';
68

79
/**
10+
* @deprecated Use {@link userRewards} instead. The `userMeritRewards` query is
11+
* kept as a backwards-compatible alias and will be removed in a future release.
12+
*
813
* Fetches Merit rewards for a user with the transaction request to claim them.
914
*
1015
* ```ts
@@ -24,3 +29,26 @@ export function userMeritRewards(
2429
) {
2530
return client.query(UserMeritRewardsQuery, { request });
2631
}
32+
33+
/**
34+
* Fetches the user's Merkl-claimable rewards on a chain together with the
35+
* claim transaction. Canonical replacement for {@link userMeritRewards} —
36+
* same data source (the Merkl distributor), with an added `rewardIds` filter
37+
* that scopes the claim to specific Aave-owned programs.
38+
*
39+
* ```ts
40+
* const result = await userRewards(client, {
41+
* user: evmAddress('0x742d35cc…'),
42+
* chainId: chainId(1),
43+
* filter: { rewardIds: ['11111111-1111-1111-1111-111111111111'] },
44+
* });
45+
* ```
46+
*
47+
* @param client - Aave client.
48+
* @param request - The rewards request parameters.
49+
* @returns The claimable rewards with the transaction request, or `null`
50+
* when the user has nothing to claim on that chain.
51+
*/
52+
export function userRewards(client: AaveClient, request: UserRewardsRequest) {
53+
return client.query(UserRewardsQuery, { request });
54+
}

0 commit comments

Comments
 (0)