Skip to content

Commit 1767282

Browse files
authored
Merge branch 'main' into feat/exppand-cli
2 parents 2c9e657 + ef5f598 commit 1767282

File tree

10 files changed

+39
-11
lines changed

10 files changed

+39
-11
lines changed

.changeset/kind-lines-wave.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@aave/graphql": patch
3+
"@aave/client": patch
4+
"@aave/react": patch
5+
---
6+
7+
**chore:** adjusts `UpdateUserPositionConditionsRequest` to latest GQL schema.

examples/balances/src/App.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import {
2-
chainId,
32
evmAddress,
43
ReservesRequestFilter,
54
useUserBalances,
65
} from '@aave/react';
7-
import { supportedChains } from '@aave/react/viem';
8-
9-
const defaultChainId = chainId(supportedChains[0]!.id);
6+
import { defaultChainId } from './config';
107

118
export function App() {
129
const { data, loading } = useUserBalances({

examples/balances/src/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { chainId } from '@aave/react';
2+
3+
export const defaultChainId = chainId(Number(import.meta.env.VITE_CHAIN_ID));
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
/// <reference types="vite/client" />
2+
3+
interface ImportMetaEnv {
4+
readonly VITE_CHAIN_ID: string;
5+
}
6+
7+
interface ImportMeta {
8+
readonly env: ImportMetaEnv;
9+
}

packages/client/src/actions/transactions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ export function renounceSpokeUserPositionManager(
236236
* ```ts
237237
* const result = await updateUserPositionConditions(client, {
238238
* userPositionId: userPositionId('SGVsbG8h'),
239-
* dynamicConfig: true,
240-
* riskPremium: true,
239+
* update: UserPositionConditionsUpdate.AllDynamicConfig,
241240
* }).andThen(sendWith(wallet)).andThen(client.waitForTransaction);
242241
*
243242
* if (result.isErr()) {

packages/graphql/schema.graphql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,8 +1704,7 @@ type TypeField {
17041704

17051705
input UpdateUserPositionConditionsRequest {
17061706
userPositionId: UserPositionId!
1707-
dynamicConfig: Boolean!
1708-
riskPremium: Boolean!
1707+
update: UserPositionConditionsUpdate!
17091708
}
17101709

17111710
type UpdatedDynamicConfigActivity {
@@ -1977,6 +1976,11 @@ type UserPosition {
19771976

19781977
union UserPositionConditionVariation = CollateralFactorVariation | LiquidationFeeVariation | MaxLiquidationBonusVariation
19791978

1979+
enum UserPositionConditionsUpdate {
1980+
ALL_DYNAMIC_CONFIG
1981+
JUST_RISK_PREMIUM
1982+
}
1983+
19801984
scalar UserPositionId
19811985

19821986
input UserPositionRequest @oneOf {

packages/graphql/src/enums.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,11 @@ export enum TokenCategory {
156156
Stablecoin = 'STABLECOIN',
157157
EthCorrelated = 'ETH_CORRELATED',
158158
}
159+
160+
/**
161+
* The update type for user position conditions.
162+
*/
163+
export enum UserPositionConditionsUpdate {
164+
AllDynamicConfig = 'ALL_DYNAMIC_CONFIG',
165+
JustRiskPremium = 'JUST_RISK_PREMIUM',
166+
}

packages/graphql/src/graphql-env.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export type introspection_types = {
229229
'TxHashInput': { kind: 'INPUT_OBJECT'; name: 'TxHashInput'; isOneOf: false; inputFields: [{ name: 'txHash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; }; }; defaultValue: null }, { name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; defaultValue: null }]; };
230230
'TypeDefinition': { kind: 'OBJECT'; name: 'TypeDefinition'; fields: { 'EIP712Domain': { name: 'EIP712Domain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TypeField'; ofType: null; }; }; }; } }; 'Permit': { name: 'Permit'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TypeField'; ofType: null; }; }; }; } }; }; };
231231
'TypeField': { kind: 'OBJECT'; name: 'TypeField'; fields: { 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'type': { name: 'type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
232-
'UpdateUserPositionConditionsRequest': { kind: 'INPUT_OBJECT'; name: 'UpdateUserPositionConditionsRequest'; isOneOf: false; inputFields: [{ name: 'userPositionId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; }; defaultValue: null }, { name: 'dynamicConfig'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }, { name: 'riskPremium'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }]; };
232+
'UpdateUserPositionConditionsRequest': { kind: 'INPUT_OBJECT'; name: 'UpdateUserPositionConditionsRequest'; isOneOf: false; inputFields: [{ name: 'userPositionId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; }; defaultValue: null }, { name: 'update'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'UserPositionConditionsUpdate'; ofType: null; }; }; defaultValue: null }]; };
233233
'UpdatedDynamicConfigActivity': { kind: 'OBJECT'; name: 'UpdatedDynamicConfigActivity'; fields: { 'chain': { name: 'chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; } }; 'collateralFactor': { name: 'collateralFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberChangeSnapshot'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'liquidationFee': { name: 'liquidationFee'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberChangeSnapshot'; ofType: null; }; } }; 'maxLiquidationBonus': { name: 'maxLiquidationBonus'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberChangeSnapshot'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'timestamp': { name: 'timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; }; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
234234
'UpdatedRiskPremiumActivity': { kind: 'OBJECT'; name: 'UpdatedRiskPremiumActivity'; fields: { 'chain': { name: 'chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'premium': { name: 'premium'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberChangeSnapshot'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'timestamp': { name: 'timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; }; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
235235
'UserBalance': { kind: 'OBJECT'; name: 'UserBalance'; fields: { 'balances': { name: 'balances'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'TokenAmount'; ofType: null; }; }; }; } }; 'borrowApy': { name: 'borrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'collateralFactor': { name: 'collateralFactor'; type: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; } }; 'exchange': { name: 'exchange'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserBalanceId'; ofType: null; }; } }; 'info': { name: 'info'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TokenInfo'; ofType: null; }; } }; 'supplyApy': { name: 'supplyApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'totalAmount': { name: 'totalAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DecimalNumber'; ofType: null; }; } }; }; };
@@ -253,6 +253,7 @@ export type introspection_types = {
253253
'UserHubInput': { kind: 'INPUT_OBJECT'; name: 'UserHubInput'; isOneOf: true; inputFields: [{ name: 'input'; type: { kind: 'INPUT_OBJECT'; name: 'HubInput'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'SCALAR'; name: 'HubId'; ofType: null; }; defaultValue: null }]; };
254254
'UserPosition': { kind: 'OBJECT'; name: 'UserPosition'; fields: { 'averageCollateralFactor': { name: 'averageCollateralFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'borrowingPower': { name: 'borrowingPower'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HealthFactorWithChange'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; } }; 'isUsingLatestDynamicConfigKey': { name: 'isUsingLatestDynamicConfigKey'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'liquidationPrice': { name: 'liquidationPrice'; type: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; } }; 'netApy': { name: 'netApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'netBalance': { name: 'netBalance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'netBalancePercentChange': { name: 'netBalancePercentChange'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'netBorrowApy': { name: 'netBorrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberWithChange'; ofType: null; }; } }; 'netCollateral': { name: 'netCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'netSupplyApy': { name: 'netSupplyApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberWithChange'; ofType: null; }; } }; 'riskPremium': { name: 'riskPremium'; type: { kind: 'OBJECT'; name: 'UserPositionRiskPremium'; ofType: null; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'totalCollateral': { name: 'totalCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'totalDebt': { name: 'totalDebt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'totalSupplied': { name: 'totalSupplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
255255
'UserPositionConditionVariation': { kind: 'UNION'; name: 'UserPositionConditionVariation'; fields: {}; possibleTypes: 'CollateralFactorVariation' | 'LiquidationFeeVariation' | 'MaxLiquidationBonusVariation'; };
256+
'UserPositionConditionsUpdate': { name: 'UserPositionConditionsUpdate'; enumValues: 'ALL_DYNAMIC_CONFIG' | 'JUST_RISK_PREMIUM'; };
256257
'UserPositionId': unknown;
257258
'UserPositionRequest': { kind: 'INPUT_OBJECT'; name: 'UserPositionRequest'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }]; };
258259
'UserPositionRiskPremium': { kind: 'OBJECT'; name: 'UserPositionRiskPremium'; fields: { 'better': { name: 'better'; type: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; } }; 'breakdown': { name: 'breakdown'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserRiskPremiumBreakdownItem'; ofType: null; }; }; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };

packages/graphql/src/graphql.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import type {
3333
SwapStatusFilter,
3434
TimeWindow,
3535
TokenCategory,
36+
UserPositionConditionsUpdate,
3637
} from './enums';
3738
import type { introspection } from './graphql-env';
3839
import type {
@@ -102,6 +103,7 @@ export const graphql = initGraphQLTada<{
102103
TxHash: TxHash;
103104
UserBalanceId: UserBalanceId;
104105
UserBorrowItemId: UserBorrowItemId;
106+
UserPositionConditionsUpdate: UserPositionConditionsUpdate;
105107
UserPositionId: UserPositionId;
106108
UserSupplyItemId: UserSupplyItemId;
107109
Void: Void;

packages/react/src/transactions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,7 @@ export function useRenounceSpokeUserPositionManager(
585585
*
586586
* const result = await update({
587587
* userPositionId: userPosition.id,
588-
* dynamicConfig: true,
589-
* riskPremium: true,
588+
* update: UserPositionConditionsUpdate.AllDynamicConfig,
590589
* });
591590
*
592591
* if (result.isErr()) {

0 commit comments

Comments
 (0)