From f54e24af49afb88f3dafc0b59ff7f10091af2b73 Mon Sep 17 00:00:00 2001 From: Oumar Fall Date: Fri, 10 Jan 2025 11:41:07 +0100 Subject: [PATCH] feat(blue-api-sdk): update api types --- packages/blue-api-sdk/src/types.ts | 66 ++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/packages/blue-api-sdk/src/types.ts b/packages/blue-api-sdk/src/types.ts index da4d013b..80635d4e 100644 --- a/packages/blue-api-sdk/src/types.ts +++ b/packages/blue-api-sdk/src/types.ts @@ -58,6 +58,8 @@ export type Asset = { oraclePriceUsd: Maybe; /** Current price in USD, for display purpose. */ priceUsd: Maybe; + /** Risk related data on the asset */ + riskAnalysis: Maybe>; /** Current spot price in ETH. */ spotPriceEth: Maybe; symbol: Scalars["String"]["output"]; @@ -90,6 +92,11 @@ export type AssetSpotPriceEthArgs = { timestamp?: InputMaybe; }; +export enum AssetOrderBy { + Address = "Address", + CredoraRiskScore = "CredoraRiskScore", +} + /** Asset yield */ export type AssetYield = { __typename?: "AssetYield"; @@ -102,6 +109,10 @@ export type AssetsFilters = { address_in?: InputMaybe>; /** Filter by chain id */ chainId_in?: InputMaybe>; + /** Filter by credora risk score greater than or equal to given value */ + credoraRiskScore_gte?: InputMaybe; + /** Filter by credora risk score lower than or equal to given value */ + credoraRiskScore_lte?: InputMaybe; /** Filter by asset id */ id_in?: InputMaybe>; search?: InputMaybe; @@ -212,6 +223,8 @@ export type Market = { realizedBadDebt: Maybe; /** Underlying amount of assets that can be reallocated to this market */ reallocatableLiquidityAssets: Maybe; + /** Risk related data on the market */ + riskAnalysis: Maybe>; /** Current state */ state: Maybe; /** Vaults with the market in supply queue */ @@ -311,6 +324,10 @@ export type MarketFilters = { /** Filter by collateral asset tags. */ collateralAssetTags_in?: InputMaybe>; countryCode?: InputMaybe; + /** Filter by credora risk score greater than or equal to given value */ + credoraRiskScore_gte?: InputMaybe; + /** Filter by credora risk score lower than or equal to given value */ + credoraRiskScore_lte?: InputMaybe; /** Filter by greater than or equal to given fee rate */ fee_gte?: InputMaybe; /** Filter by lower than or equal to given fee rate */ @@ -746,6 +763,7 @@ export enum MarketOrderBy { BorrowAssetsUsd = "BorrowAssetsUsd", BorrowShares = "BorrowShares", CollateralAssetSymbol = "CollateralAssetSymbol", + CredoraRiskScore = "CredoraRiskScore", DailyBorrowApy = "DailyBorrowApy", DailyNetBorrowApy = "DailyNetBorrowApy", Fee = "Fee", @@ -1483,6 +1501,7 @@ export type Query = { publicAllocators: PaginatedPublicAllocator; search: SearchResults; transaction: Transaction; + /** @deprecated Multiple Transaction entities correspond to a single hash, because a Transaction entity corresponds to an onchain event. */ transactionByHash: Transaction; transactions: PaginatedTransactions; user: User; @@ -1507,6 +1526,8 @@ export type QueryAssetByAddressArgs = { export type QueryAssetsArgs = { first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; skip?: InputMaybe; where?: InputMaybe; }; @@ -1709,6 +1730,19 @@ export type QueryVaultsArgs = { where?: InputMaybe; }; +/** Risk analysis */ +export type RiskAnalysis = { + __typename?: "RiskAnalysis"; + isUnderReview: Scalars["Boolean"]["output"]; + provider: RiskProvider; + score: Scalars["Float"]["output"]; + timestamp: Scalars["Float"]["output"]; +}; + +export enum RiskProvider { + Credora = "CREDORA", +} + /** Global search results */ export type SearchResults = { __typename?: "SearchResults"; @@ -1756,7 +1790,8 @@ export type TransactionData = | MarketCollateralTransferTransactionData | MarketLiquidationTransactionData | MarketTransferTransactionData - | VaultTransactionData; + | VaultTransactionData + | VaultTransferTransactionData; /** 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 = { @@ -1847,6 +1882,7 @@ export enum TransactionType { MarketWithdrawCollateral = "MarketWithdrawCollateral", MetaMorphoDeposit = "MetaMorphoDeposit", MetaMorphoFee = "MetaMorphoFee", + MetaMorphoTransfer = "MetaMorphoTransfer", MetaMorphoWithdraw = "MetaMorphoWithdraw", } @@ -1870,7 +1906,7 @@ export type User = { __typename?: "User"; address: Scalars["Address"]["output"]; chain: Chain; - historicalState: Array; + historicalState: UserHistory; id: Scalars["ID"]["output"]; marketPositions: Array; state: UserState; @@ -1888,6 +1924,16 @@ export type UserHistory = { vaultsPnlUsd: Maybe>; }; +/** User state history */ +export type UserHistoryMarketsPnlUsdArgs = { + options?: InputMaybe; +}; + +/** User state history */ +export type UserHistoryVaultsPnlUsdArgs = { + options?: InputMaybe; +}; + /** User state */ export type UserState = { __typename?: "UserState"; @@ -1961,6 +2007,8 @@ export type Vault = { pendingCaps: Maybe>; /** Public allocator configuration */ publicAllocatorConfig: Maybe; + /** Risk related data on the vault */ + riskAnalysis: Maybe>; state: Maybe; symbol: Scalars["String"]["output"]; /** Vault warnings */ @@ -2080,6 +2128,10 @@ export type VaultFilters = { countryCode?: InputMaybe; /** Filter by MetaMorpho creator address */ creatorAddress_in?: InputMaybe>; + /** Filter by credora risk score greater than or equal to given value */ + credoraRiskScore_gte?: InputMaybe; + /** Filter by credora risk score lower than or equal to given value */ + credoraRiskScore_lte?: InputMaybe; /** Filter by MetaMorpho current curator address */ curatorAddress_in?: InputMaybe>; /** Filter by greater than or equal to given fee rate. */ @@ -2337,6 +2389,7 @@ export type VaultMetadataCurator = { export enum VaultOrderBy { Address = "Address", Apy = "Apy", + CredoraRiskScore = "CredoraRiskScore", Curator = "Curator", DailyApy = "DailyApy", DailyNetApy = "DailyNetApy", @@ -2602,7 +2655,7 @@ export type VaultStateReward = { yearlySupplyTokens: Scalars["BigInt"]["output"]; }; -/** Meta Morpho vault transfer transaction data */ +/** Meta Morpho vault transaction data */ export type VaultTransactionData = { __typename?: "VaultTransactionData"; assets: Scalars["BigInt"]["output"]; @@ -2611,6 +2664,13 @@ 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";