From e6b599ce4a24ca9e3fc48cd1ee5c5f541bbe8023 Mon Sep 17 00:00:00 2001 From: Oumar Fall Date: Mon, 27 Jan 2025 22:24:38 +0100 Subject: [PATCH] feat(api): update types --- packages/blue-api-sdk/src/types.ts | 161 ++++++++++++++++++++--------- 1 file changed, 112 insertions(+), 49 deletions(-) diff --git a/packages/blue-api-sdk/src/types.ts b/packages/blue-api-sdk/src/types.ts index 80635d4e..a5fdd32e 100644 --- a/packages/blue-api-sdk/src/types.ts +++ b/packages/blue-api-sdk/src/types.ts @@ -158,12 +158,25 @@ export type CollateralAtRiskDataPoint = { collateralUsd: Scalars["Float"]["output"]; }; +/** Custom Warning Metadata */ +export type CustomMetadata = { + __typename?: "CustomMetadata"; + content: Maybe; +}; + export type FloatDataPoint = { __typename?: "FloatDataPoint"; x: Scalars["Float"]["output"]; y: Maybe; }; +/** Hardcoded Price Metadata */ +export type HardcodedPriceMetadata = { + __typename?: "HardcodedPriceMetadata"; + symbolFrom: Maybe; + symbolTo: Maybe; +}; + /** IRM curve data point */ export type IrmCurveDataPoint = { __typename?: "IRMCurveDataPoint"; @@ -796,19 +809,13 @@ export type MarketPosition = { collateralUsd: Maybe; /** Health factor of the position, computed as collateral value divided by borrow value. */ healthFactor: Maybe; - /** - * State history - * @deprecated Not indexed yet. - */ + /** State history */ historicalState: Maybe; id: Scalars["ID"]["output"]; market: Market; /** Price variation required for the given position to reach its liquidation threshold (scaled by WAD) */ priceVariationToLiquidationPrice: Maybe; - /** - * Current state - * @deprecated Not indexed yet. - */ + /** Current state */ state: Maybe; /** Amount of loan asset supplied, in underlying token units. */ supplyAssets: Scalars["BigInt"]["output"]; @@ -855,16 +862,24 @@ export type MarketPositionHistory = { __typename?: "MarketPositionHistory"; /** Borrow assets history. */ borrowAssets: Maybe>; + /** Borrow assets history, in USD. */ + borrowAssetsUsd: Maybe>; /** Borrow shares history. */ borrowShares: Maybe>; /** Collateral history. */ collateral: Maybe>; + /** Collateral value history, in USD. */ + collateralUsd: Maybe>; + /** Collateral value history, in loan assets. */ + collateralValue: Maybe>; /** Profit (from the collateral's price variation) & Loss (from the loan interest) history, in loan assets. */ pnl: Maybe>; /** Profit (from the collateral's price variation) & Loss (from the loan interest) history, in USD for display purposes. */ pnlUsd: Maybe>; /** Supply assets history. */ supplyAssets: Maybe>; + /** Supply assets history, in USD. */ + supplyAssetsUsd: Maybe>; /** Supply shares history. */ supplyShares: Maybe>; }; @@ -874,6 +889,11 @@ export type MarketPositionHistoryBorrowAssetsArgs = { options?: InputMaybe; }; +/** Market position state history */ +export type MarketPositionHistoryBorrowAssetsUsdArgs = { + options?: InputMaybe; +}; + /** Market position state history */ export type MarketPositionHistoryBorrowSharesArgs = { options?: InputMaybe; @@ -884,6 +904,16 @@ export type MarketPositionHistoryCollateralArgs = { options?: InputMaybe; }; +/** Market position state history */ +export type MarketPositionHistoryCollateralUsdArgs = { + options?: InputMaybe; +}; + +/** Market position state history */ +export type MarketPositionHistoryCollateralValueArgs = { + options?: InputMaybe; +}; + /** Market position state history */ export type MarketPositionHistoryPnlArgs = { options?: InputMaybe; @@ -899,6 +929,11 @@ export type MarketPositionHistorySupplyAssetsArgs = { options?: InputMaybe; }; +/** Market position state history */ +export type MarketPositionHistorySupplyAssetsUsdArgs = { + options?: InputMaybe; +}; + /** Market position state history */ export type MarketPositionHistorySupplySharesArgs = { options?: InputMaybe; @@ -914,29 +949,31 @@ export enum MarketPositionOrderBy { /** Market position state */ export type MarketPositionState = { __typename?: "MarketPositionState"; - /** The last borrow assets used to update the position's P&L. */ - borrowAssets: Scalars["BigInt"]["output"]; - /** The last borrow shares used to update the position's P&L. */ + /** The latest borrow assets indexed for this position. */ + borrowAssets: Maybe; + /** The latest borrow assets indexed for this position, in USD. */ + borrowAssetsUsd: Maybe; + /** The latest borrow shares indexed for this position. */ borrowShares: Scalars["BigInt"]["output"]; - /** The last collateral assets used to update the position's P&L. */ + /** The latest collateral assets indexed for this position. */ collateral: Scalars["BigInt"]["output"]; - /** The last collateral asset USD price used to update the position's P&L in USD. */ - collateralAssetUsdPrice: Maybe; - /** The last collateral price used to update the position's P&L. */ - collateralPrice: Scalars["BigInt"]["output"]; + /** The latest collateral assets indexed for this position, in USD. */ + collateralUsd: Maybe; + /** The latest collateral assets indexed for this position, in loan assets. */ + collateralValue: Maybe; id: Scalars["ID"]["output"]; - /** The last loan asset USD price used to update the position's P&L in USD. */ - loanAssetUsdPrice: Maybe; /** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in loan assets. */ - pnl: Scalars["BigInt"]["output"]; - /** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in USD for display purpose */ + pnl: Maybe; + /** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in USD for display purpose. */ pnlUsd: Maybe; position: MarketPosition; - /** The last supply assets used to update the position's P&L. */ - supplyAssets: Scalars["BigInt"]["output"]; - /** The last supply shares used to update the position's P&L. */ + /** The latest supply assets indexed for this position. */ + supplyAssets: Maybe; + /** The latest supply assets indexed for this position, in USD. */ + supplyAssetsUsd: Maybe; + /** The latest supply shares indexed for this position. */ supplyShares: Scalars["BigInt"]["output"]; - /** Last update timestamp. */ + /** The latest update timestamp. */ timestamp: Scalars["BigInt"]["output"]; }; @@ -1084,9 +1121,12 @@ export type MarketTransferTransactionData = { export type MarketWarning = { __typename?: "MarketWarning"; level: WarningLevel; + metadata: Maybe; type: Scalars["String"]["output"]; }; +export type MarketWarningMetadata = CustomMetadata | HardcodedPriceMetadata; + /** Morpho Blue deployment */ export type MorphoBlue = { __typename?: "MorphoBlue"; @@ -1310,6 +1350,12 @@ export type PaginatedMarkets = { pageInfo: Maybe; }; +export type PaginatedMetaMorphoFactories = { + __typename?: "PaginatedMetaMorphoFactories"; + items: Maybe>; + pageInfo: Maybe; +}; + export type PaginatedMetaMorphoPositions = { __typename?: "PaginatedMetaMorphoPositions"; items: Maybe>; @@ -1509,6 +1555,9 @@ export type Query = { users: PaginatedUsers; vault: Vault; vaultByAddress: Vault; + vaultFactories: PaginatedMetaMorphoFactories; + vaultFactory: VaultFactory; + vaultFactoryByAddress: VaultFactory; vaultPosition: VaultPosition; vaultPositions: PaginatedMetaMorphoPositions; vaultReallocates: PaginatedVaultReallocates; @@ -1700,6 +1749,15 @@ export type QueryVaultByAddressArgs = { chainId?: InputMaybe; }; +export type QueryVaultFactoryArgs = { + id: Scalars["String"]["input"]; +}; + +export type QueryVaultFactoryByAddressArgs = { + address: Scalars["String"]["input"]; + chainId?: InputMaybe; +}; + export type QueryVaultPositionArgs = { chainId?: InputMaybe; userAddress: Scalars["String"]["input"]; @@ -1790,8 +1848,7 @@ export type TransactionData = | MarketCollateralTransferTransactionData | MarketLiquidationTransactionData | MarketTransferTransactionData - | VaultTransactionData - | VaultTransferTransactionData; + | VaultTransactionData; /** Filtering options for transactions. AND operator is used for multiple filters, while OR operator is used for multiple values in the same filter. */ export type TransactionFilters = { @@ -1990,6 +2047,7 @@ export type Vault = { dailyApy: Maybe; /** Daily vault APYs */ dailyApys: Maybe; + factory: VaultFactory; historicalState: VaultHistory; id: Scalars["ID"]["output"]; /** Vault liquidity */ @@ -2106,6 +2164,15 @@ export type VaultApyAggregates = { netApy: Maybe; }; +/** MetaMorpho Vault Factories */ +export type VaultFactory = { + __typename?: "VaultFactory"; + address: Scalars["Address"]["output"]; + chain: Chain; + creationBlockNumber: Scalars["Int"]["output"]; + id: Scalars["ID"]["output"]; +}; + export type VaultFilters = { /** Filter by MetaMorpho vault address */ address_in?: InputMaybe>; @@ -2134,6 +2201,8 @@ export type VaultFilters = { credoraRiskScore_lte?: InputMaybe; /** Filter by MetaMorpho current curator address */ curatorAddress_in?: InputMaybe>; + /** Filter by MetaMorphoFactory address */ + factoryAddress_in?: InputMaybe>; /** Filter by greater than or equal to given fee rate. */ fee_gte?: InputMaybe; /** Filter by lower than or equal to given fee rate. */ @@ -2418,18 +2487,12 @@ export type VaultPosition = { assets: Scalars["BigInt"]["output"]; /** Value of vault shares held, in USD for display purpose. */ assetsUsd: Maybe; - /** - * State history - * @deprecated Not indexed yet. - */ + /** State history */ historicalState: Maybe; id: Scalars["ID"]["output"]; /** Amount of vault shares */ shares: Scalars["BigInt"]["output"]; - /** - * Current state - * @deprecated Not indexed yet. - */ + /** Current state */ state: Maybe; user: User; vault: Vault; @@ -2459,6 +2522,8 @@ export type VaultPositionHistory = { __typename?: "VaultPositionHistory"; /** Value of the position since its inception, in underlying assets. */ assets: Maybe>; + /** Value of the position since its inception, in USD. */ + assetsUsd: Maybe>; /** Profit (from the underlying asset's price variation) & Loss (from bad debt socialization) of the position since its inception, in underlying assets. */ pnl: Maybe>; /** Profit (from the underlying asset's price variation) & Loss (from bad debt socialization) of the position since its inception, in USD for display purposes. */ @@ -2472,6 +2537,11 @@ export type VaultPositionHistoryAssetsArgs = { options?: InputMaybe; }; +/** Vault position state history */ +export type VaultPositionHistoryAssetsUsdArgs = { + options?: InputMaybe; +}; + /** Vault position state history */ export type VaultPositionHistoryPnlArgs = { options?: InputMaybe; @@ -2494,19 +2564,19 @@ export enum VaultPositionOrderBy { /** Vault position state */ export type VaultPositionState = { __typename?: "VaultPositionState"; - /** The last asset USD price used to update the position's P&L in USD. */ - assetUsdPrice: Maybe; + /** The latest supply assets indexed for this position. */ + assets: Maybe; + /** The latest supply assets indexed for this position, in USD. */ + assetsUsd: Maybe; id: Scalars["ID"]["output"]; /** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in loan assets. */ - pnl: Scalars["BigInt"]["output"]; + pnl: Maybe; /** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in USD for display purpose */ pnlUsd: Maybe; position: VaultPosition; - /** The last supply assets used to update the position's P&L. */ - supplyAssets: Scalars["BigInt"]["output"]; - /** The last supply shares used to update the position's P&L. */ - supplyShares: Scalars["BigInt"]["output"]; - /** Last update timestamp. */ + /** The latest supply shares indexed for this position. */ + shares: Scalars["BigInt"]["output"]; + /** The latest update timestamp. */ timestamp: Scalars["BigInt"]["output"]; }; @@ -2664,13 +2734,6 @@ export type VaultTransactionData = { vault: Vault; }; -/** Meta Morpho vault transfer transaction data */ -export type VaultTransferTransactionData = { - __typename?: "VaultTransferTransactionData"; - shares: Scalars["BigInt"]["output"]; - vault: Vault; -}; - /** Vault warning */ export type VaultWarning = { __typename?: "VaultWarning";