@emberai/onchain-actions-registry 4.1.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["id: number","rpcUrl: string","wrappedNativeTokenAddress?: string","UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN: Record<\n number,\n IUiPoolDataProviderConstructor\n>","marketMap: Record<number, keyof typeof markets>","AAVE_ERROR_CODES: Record<string, AaveErrorData>","txData: PopulatedTransaction | null","reserveLiquidationThreshold: string | null","totalBorrowsUSD","bundle: PoolBundle","underlyingAssets: string[]","aTokens: string[]"],"sources":["../src/core/schemas/enums.ts","../src/core/schemas/core.ts","../src/core/schemas/lending.ts","../src/core/schemas/liquidity.ts","../src/core/schemas/perpetuals.ts","../src/core/schemas/swap.ts","../src/core/schemas/tokenizedYield.ts","../src/aave-lending-plugin/chain.ts","../src/aave-lending-plugin/dataProvider.ts","../src/aave-lending-plugin/market.ts","../src/aave-lending-plugin/errors.ts","../src/aave-lending-plugin/populateTransaction.ts","../src/aave-lending-plugin/userSummary.ts","../src/aave-lending-plugin/adapter.ts","../src/aave-lending-plugin/index.ts","../src/registry.ts","../src/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const ChainTypeSchema = z.enum(['UNSPECIFIED', 'EVM', 'SOLANA', 'COSMOS']);\nexport type ChainType = z.infer<typeof ChainTypeSchema>;\n\n// TransactionType\nexport const TransactionTypes = {\n TRANSACTION_TYPE_UNSPECIFIED: 'TRANSACTION_TYPE_UNSPECIFIED' as const,\n EVM_TX: 'EVM_TX' as const,\n SOLANA_TX: 'SOLANA_TX' as const,\n} as const;\n\nexport const TransactionTypeSchema = z.enum(\n Object.values(TransactionTypes) as [string, ...string[]]\n);\nexport type TransactionType = keyof typeof TransactionTypes;\n","import { z } from 'zod';\n\nimport { ChainTypeSchema, TransactionTypeSchema } from './enums.js';\n\nexport const TokenIdentifierSchema = z.object({\n chainId: z.string(),\n address: z.string(),\n});\nexport type TokenIdentifier = z.infer<typeof TokenIdentifierSchema>;\n\nexport const TokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n name: z.string(),\n symbol: z.string(),\n isNative: z.boolean(),\n decimals: z.number().int(),\n iconUri: z.string().nullish(),\n isVetted: z.boolean(),\n});\nexport type Token = z.infer<typeof TokenSchema>;\n\nexport const ChainSchema = z.object({\n chainId: z.string(),\n type: ChainTypeSchema,\n iconUri: z.string(),\n nativeToken: TokenSchema,\n httpRpcUrl: z.string(),\n name: z.string(),\n blockExplorerUrls: z.array(z.string()),\n});\nexport type Chain = z.infer<typeof ChainSchema>;\n\nexport const FeeBreakdownSchema = z.object({\n serviceFee: z.string(),\n slippageCost: z.string(),\n total: z.string(),\n feeDenomination: z.string(),\n});\nexport type FeeBreakdown = z.infer<typeof FeeBreakdownSchema>;\n\nexport const TransactionPlanSchema = z.object({\n type: TransactionTypeSchema,\n to: z.string(),\n data: z.string(),\n value: z.string(),\n chainId: z.string(),\n});\nexport type TransactionPlan = z.infer<typeof TransactionPlanSchema>;\n\nexport const TransactionPlanErrorSchema = z.object({\n code: z.string(),\n message: z.string(),\n details: z.record(z.string(), z.string()),\n});\nexport type TransactionPlanError = z.infer<typeof TransactionPlanErrorSchema>;\n\nexport const ProviderTrackingInfoSchema = z.object({\n requestId: z.string(),\n providerName: z.string(),\n explorerUrl: z.string(),\n});\nexport type ProviderTrackingInfo = z.infer<typeof ProviderTrackingInfoSchema>;\n\nexport const SwapEstimationSchema = z.object({\n effectivePrice: z.string(),\n timeEstimate: z.string(),\n expiration: z.string(),\n});\nexport type SwapEstimation = z.infer<typeof SwapEstimationSchema>;\n\nexport const ProviderTrackingStatusSchema = z.object({\n requestId: z.string(),\n transactionId: z.string(),\n providerName: z.string(),\n explorerUrl: z.string(),\n status: z.string(),\n});\nexport type ProviderTrackingStatus = z.infer<typeof ProviderTrackingStatusSchema>;\n","import { z } from 'zod';\n\nimport {\n FeeBreakdownSchema,\n TransactionPlanSchema,\n TokenSchema,\n TokenIdentifierSchema,\n} from './core.js';\n\nexport const BorrowTokensRequestSchema = z.object({\n borrowToken: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type BorrowTokensRequest = z.infer<typeof BorrowTokensRequestSchema>;\n\nexport const BorrowTokensResponseSchema = z.object({\n currentBorrowApy: z.string(),\n liquidationThreshold: z.string(),\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type BorrowTokensResponse = z.infer<typeof BorrowTokensResponseSchema>;\n\nexport const RepayTokensRequestSchema = z.object({\n repayToken: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type RepayTokensRequest = z.infer<typeof RepayTokensRequestSchema>;\n\nexport const RepayTokensResponseSchema = z.object({\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type RepayTokensResponse = z.infer<typeof RepayTokensResponseSchema>;\n\nexport const SupplyTokensRequestSchema = z.object({\n supplyToken: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type SupplyTokensRequest = z.infer<typeof SupplyTokensRequestSchema>;\n\nexport const SupplyTokensResponseSchema = z.object({\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type SupplyTokensResponse = z.infer<typeof SupplyTokensResponseSchema>;\n\nexport const WithdrawTokensRequestSchema = z.object({\n tokenToWithdraw: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type WithdrawTokensRequest = z.infer<typeof WithdrawTokensRequestSchema>;\n\nexport const WithdrawTokensResponseSchema = z.object({\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type WithdrawTokensResponse = z.infer<typeof WithdrawTokensResponseSchema>;\n\nexport const GetWalletLendingPositionsRequestSchema = z.object({\n walletAddress: z.string(),\n chainId: z.string().optional(),\n tokenAddress: z.string().optional(),\n});\nexport type GetWalletLendingPositionsRequest = z.infer<\n typeof GetWalletLendingPositionsRequestSchema\n>;\n\nexport const LendTokenDetailSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n underlyingBalance: z.string(),\n underlyingBalanceUsd: z.string(),\n variableBorrows: z.string(),\n variableBorrowsUsd: z.string(),\n totalBorrows: z.string(),\n totalBorrowsUsd: z.string(),\n});\nexport type LendTokenDetail = z.infer<typeof LendTokenDetailSchema>;\n\nexport const GetWalletLendingPositionsResponseSchema = z.object({\n userReserves: z.array(LendTokenDetailSchema),\n totalLiquidityUsd: z.string(),\n totalCollateralUsd: z.string(),\n totalBorrowsUsd: z.string(),\n netWorthUsd: z.string(),\n availableBorrowsUsd: z.string(),\n currentLoanToValue: z.string(),\n currentLiquidationThreshold: z.string(),\n healthFactor: z.string(),\n});\nexport type GetWalletLendingPositionsResponse = z.infer<\n typeof GetWalletLendingPositionsResponseSchema\n>;\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema, TokenSchema, TransactionPlanSchema } from './core.js';\n\nexport const LiquidityProvisionRangeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('full'),\n }),\n z.object({\n type: z.literal('limited'),\n minPrice: z.string(),\n maxPrice: z.string(),\n }),\n]);\nexport type LiquidityProvisionRange = z.infer<typeof LiquidityProvisionRangeSchema>;\n\nexport const LiquidityPositionRangeSchema = z.object({\n fromPrice: z.string(),\n toPrice: z.string(),\n});\nexport type LiquidityPositionRange = z.infer<typeof LiquidityPositionRangeSchema>;\n\nexport const LiquiditySuppliedTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n suppliedAmount: z.string(),\n owedTokens: z.string(),\n});\nexport type LiquiditySuppliedToken = z.infer<typeof LiquiditySuppliedTokenSchema>;\n\nexport const LiquidityRewardsOwedTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n amount: z.string(),\n usdPrice: z.string().optional(),\n valueUsd: z.string().optional(),\n source: z.string(),\n});\nexport type LiquidityRewardsOwedToken = z.infer<typeof LiquidityRewardsOwedTokenSchema>;\n\nexport const LiquidityPooledTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n amount: z.string(),\n usdPrice: z.string().optional(),\n valueUsd: z.string().optional(),\n});\nexport type LiquidityPooledToken = z.infer<typeof LiquidityPooledTokenSchema>;\n\nexport const LiquidityFeesOwedTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n amount: z.string(),\n usdPrice: z.string().optional(),\n valueUsd: z.string().optional(),\n});\nexport type LiquidityFeesOwedToken = z.infer<typeof LiquidityFeesOwedTokenSchema>;\n\nexport const LiquidityPositionSchema = z.object({\n positionId: z.string(),\n poolIdentifier: TokenIdentifierSchema,\n operator: z.string(),\n suppliedTokens: z.array(LiquiditySuppliedTokenSchema),\n pooledTokens: z.array(LiquidityPooledTokenSchema),\n feesOwedTokens: z.array(LiquidityFeesOwedTokenSchema),\n rewardsOwedTokens: z.array(LiquidityRewardsOwedTokenSchema),\n feesValueUsd: z.string().optional(),\n rewardsValueUsd: z.string().optional(),\n positionValueUsd: z.string().optional(),\n currentPrice: z.string().optional(),\n currentTick: z.number().int().optional(),\n tickLower: z.number().int().optional(),\n tickUpper: z.number().int().optional(),\n inRange: z.boolean().optional(),\n apr: z.string().optional(),\n apy: z.string().optional(),\n poolFeeBps: z.number().int().optional(),\n providerId: z.string(),\n positionRange: LiquidityPositionRangeSchema.optional(),\n});\nexport type LiquidityPosition = z.infer<typeof LiquidityPositionSchema>;\n\nexport const LiquidityPoolTokens = z.object({\n tokenUid: TokenIdentifierSchema,\n});\nexport type LiquidityPoolTokens = z.infer<typeof LiquidityPoolTokens>;\n\nexport const LiquidityPoolSchema = z.object({\n identifier: TokenIdentifierSchema,\n tokens: z.array(LiquidityPoolTokens),\n currentPrice: z.string(),\n providerId: z.string(),\n feeTierBps: z.number().int().optional(),\n liquidity: z.string().optional(),\n tvlUsd: z.string().optional(),\n volume24hUsd: z.string().optional(),\n tickSpacing: z.number().int().optional(),\n});\nexport type LiquidityPool = z.infer<typeof LiquidityPoolSchema>;\n\nexport const LiquidityPayTokensSchema = z.object({\n token: TokenSchema,\n supplyAmount: z.bigint(),\n});\nexport type LiquidityPayTokens = z.infer<typeof LiquidityPayTokensSchema>;\n\nexport const SupplyLiquidityRequestSchema = z.object({\n walletAddress: z.string(),\n poolToken: TokenSchema,\n payTokens: z.array(LiquidityPayTokensSchema),\n range: LiquidityProvisionRangeSchema.optional(),\n});\nexport type SupplyLiquidityRequest = z.infer<typeof SupplyLiquidityRequestSchema>;\n\nexport const SupplyLiquidityResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n poolIdentifier: TokenIdentifierSchema,\n});\nexport type SupplyLiquidityResponse = z.infer<typeof SupplyLiquidityResponseSchema>;\n\nexport const WithdrawLiquidityRequestSchema = z.object({\n poolToken: TokenSchema,\n walletAddress: z.string(),\n});\nexport type WithdrawLiquidityRequest = z.infer<typeof WithdrawLiquidityRequestSchema>;\n\nexport const WithdrawLiquidityResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n chainId: z.string(),\n});\nexport type WithdrawLiquidityResponse = z.infer<typeof WithdrawLiquidityResponseSchema>;\n\nexport const GetWalletLiquidityPositionsRequestSchema = z.object({\n walletAddress: z.string(),\n includePrices: z.boolean().optional(),\n positionIds: z.array(z.string()).optional(),\n});\nexport type GetWalletLiquidityPositionsRequest = z.infer<\n typeof GetWalletLiquidityPositionsRequestSchema\n>;\n\nexport const GetWalletLiquidityPositionsResponseSchema = z.object({\n positions: z.array(LiquidityPositionSchema),\n});\nexport type GetWalletLiquidityPositionsResponse = z.infer<\n typeof GetWalletLiquidityPositionsResponseSchema\n>;\n\nexport const GetLiquidityPoolsResponseSchema = z.object({\n liquidityPools: z.array(LiquidityPoolSchema),\n});\nexport type GetLiquidityPoolsResponse = z.infer<typeof GetLiquidityPoolsResponseSchema>;\n","import { z } from 'zod';\n\nimport { TransactionPlanSchema, TokenIdentifierSchema } from './core.js';\n\n// Enums\nexport const DecreasePositionSwapTypeSchema = z.enum([\n 'NoSwap',\n 'SwapPnlTokenToCollateralToken',\n 'SwapCollateralTokenToPnlToken',\n]);\nexport type DecreasePositionSwapType = z.infer<typeof DecreasePositionSwapTypeSchema>;\n\nexport const PositionSideSchema = z.enum(['long', 'short']);\n\nexport type PositionSide = z.infer<typeof PositionSideSchema>;\n\n// API Schemas and types\nexport const PositionSchema = z.object({\n chainId: z.string(),\n key: z.string(),\n contractKey: z.string(),\n account: z.string(),\n marketAddress: z.string(),\n collateralTokenAddress: z.string(),\n sizeInUsd: z.string(),\n sizeInTokens: z.string(),\n collateralAmount: z.string(),\n pendingBorrowingFeesUsd: z.string(),\n increasedAtTime: z.string(),\n decreasedAtTime: z.string(),\n positionSide: PositionSideSchema,\n isLong: z.boolean(),\n fundingFeeAmount: z.string(),\n claimableLongTokenAmount: z.string(),\n claimableShortTokenAmount: z.string(),\n isOpening: z.boolean().optional(),\n pnl: z.string(),\n positionFeeAmount: z.string(),\n traderDiscountAmount: z.string(),\n uiFeeAmount: z.string(),\n data: z.string().optional(),\n});\n\nexport type PerpetualsPosition = z.infer<typeof PositionSchema>;\n\nexport const PositionsDataSchema = z.array(PositionSchema);\n\nexport const OrderTypeSchema = z.enum([\n 'MarketSwap',\n 'LimitSwap',\n 'MarketIncrease',\n 'LimitIncrease',\n 'MarketDecrease',\n 'LimitDecrease',\n 'StopLossDecrease',\n 'Liquidation',\n 'StopIncrease',\n]);\nexport type OrderType = z.infer<typeof OrderTypeSchema>;\n\n// Order Schema\nexport const OrderSchema = z.object({\n chainId: z.string(),\n key: z.string(),\n account: z.string(),\n callbackContract: z.string(),\n initialCollateralTokenAddress: z.string(),\n marketAddress: z.string(),\n decreasePositionSwapType: DecreasePositionSwapTypeSchema,\n receiver: z.string(),\n swapPath: z.array(z.string()),\n contractAcceptablePrice: z.string(),\n contractTriggerPrice: z.string(),\n callbackGasLimit: z.string(),\n executionFee: z.string(),\n initialCollateralDeltaAmount: z.string(),\n minOutputAmount: z.string(),\n sizeDeltaUsd: z.string(),\n updatedAtTime: z.string(),\n isFrozen: z.boolean(),\n positionSide: PositionSideSchema,\n orderType: OrderTypeSchema,\n shouldUnwrapNativeToken: z.boolean(),\n autoCancel: z.boolean(),\n data: z.string().optional(),\n uiFeeReceiver: z.string(),\n validFromTime: z.string(),\n title: z.string().optional(),\n});\n\nexport type PerpetualsOrder = z.infer<typeof OrderSchema>;\n\nexport const OrdersDataSchema = z.array(OrderSchema);\n\n// Definition for plugin with mapped entities already in place\nexport const CreatePerpetualsPositionRequestSchema = z.object({\n amount: z.bigint(),\n walletAddress: z.string(),\n chainId: z.string(),\n marketAddress: z.string(),\n payTokenAddress: z.string(),\n collateralTokenAddress: z.string(),\n referralCode: z.string().optional(),\n limitPrice: z.string().optional(),\n leverage: z.string(),\n});\n\nexport type CreatePerpetualsPositionRequest = z.infer<typeof CreatePerpetualsPositionRequestSchema>;\n\nexport const CreatePerpetualsPositionResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n});\nexport type CreatePerpetualsPositionResponse = z.infer<\n typeof CreatePerpetualsPositionResponseSchema\n>;\n\nexport const GetPerpetualsMarketsPositionsRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n});\n\nexport type GetPerpetualsMarketsPositionsRequest = z.infer<\n typeof GetPerpetualsMarketsPositionsRequestSchema\n>;\n\nexport const GetPerpetualsMarketsPositionsResponseSchema = z.object({\n positions: PositionsDataSchema,\n});\n\nexport type GetPerpetualsMarketsPositionsResponse = z.infer<\n typeof GetPerpetualsMarketsPositionsResponseSchema\n>;\n\nexport const GetPerpetualsMarketsOrdersRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n});\n\nexport type GetPerpetualsMarketsOrdersRequest = z.infer<\n typeof GetPerpetualsMarketsOrdersRequestSchema\n>;\n\nexport const GetPerpetualsMarketsOrdersResponseSchema = z.object({\n orders: OrdersDataSchema,\n});\n\nexport type GetPerpetualsMarketsOrdersResponse = z.infer<\n typeof GetPerpetualsMarketsOrdersResponseSchema\n>;\n\nexport const ClosePerpetualsOrdersRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n key: z.string(),\n});\n\nexport type ClosePerpetualsOrdersRequest = z.infer<typeof ClosePerpetualsOrdersRequestSchema>;\n\nexport const ClosePerpetualsOrdersResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n});\n\nexport type ClosePerpetualsOrdersResponse = z.infer<typeof ClosePerpetualsOrdersResponseSchema>;\n\nexport const GetPerpetualsMarketsRequestSchema = z.object({\n chainIds: z.array(z.string()),\n});\n\nexport type GetPerpetualsMarketsRequest = z.infer<typeof GetPerpetualsMarketsRequestSchema>;\n\nexport const PerpetualMarketSchema = z.object({\n marketToken: TokenIdentifierSchema,\n indexToken: TokenIdentifierSchema,\n longToken: TokenIdentifierSchema,\n shortToken: TokenIdentifierSchema,\n longFundingFee: z.string(),\n shortFundingFee: z.string(),\n longBorrowingFee: z.string(),\n shortBorrowingFee: z.string(),\n chainId: z.string(),\n name: z.string(),\n});\n\nexport type PerpetualMarket = z.infer<typeof PerpetualMarketSchema>;\n\nexport const GetPerpetualsMarketsResponseSchema = z.object({\n markets: z.array(PerpetualMarketSchema),\n});\n\nexport type GetPerpetualsMarketsResponse = z.infer<typeof GetPerpetualsMarketsResponseSchema>;\n","import { z } from 'zod';\n\nimport {\n FeeBreakdownSchema,\n TransactionPlanSchema,\n SwapEstimationSchema,\n ProviderTrackingInfoSchema,\n TokenSchema,\n} from './core.js';\n\nexport const SwapTokensRequestSchema = z.object({\n fromToken: TokenSchema,\n toToken: TokenSchema,\n amount: z.bigint(),\n limitPrice: z.string().optional(),\n slippageTolerance: z.string().optional(),\n expiration: z.string().optional(),\n recipient: z.string(),\n});\nexport type SwapTokensRequest = z.infer<typeof SwapTokensRequestSchema>;\n\nexport const SwapTokensResponseSchema = z.object({\n fromToken: TokenSchema,\n toToken: TokenSchema,\n exactFromAmount: z.string(),\n displayFromAmount: z.string(),\n exactToAmount: z.string(),\n displayToAmount: z.string(),\n transactions: z.array(TransactionPlanSchema),\n feeBreakdown: FeeBreakdownSchema.optional(),\n estimation: SwapEstimationSchema.optional(),\n providerTracking: ProviderTrackingInfoSchema.optional(),\n});\nexport type SwapTokensResponse = z.infer<typeof SwapTokensResponseSchema>;\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema, TokenSchema, TransactionPlanSchema } from './core.js';\n\nexport const MintPtAndYtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n inputToken: TokenSchema.describe('Token to be used for minting PT and YT'),\n amount: z.bigint().describe('Amount of input token to be used for minting'),\n marketAddress: z.string().describe('Address of the yield market'),\n});\nexport type MintPtAndYtRequest = z.infer<typeof MintPtAndYtRequestSchema>;\n\nexport const MintPtAndYtResponseSchema = z.object({\n exactPtAmount: z.string().describe('Amount of Principal Tokens (PT) minted'),\n ptTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Principal Token (PT)'),\n exactYtAmount: z.string().describe('Amount of Yield Tokens (YT) minted'),\n ytTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Yield Token (YT)'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the minting process'),\n});\nexport type MintPtAndYtResponse = z.infer<typeof MintPtAndYtResponseSchema>;\n\nexport const BuyPtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n inputToken: TokenSchema.describe('Token to be used for minting PT and YT'),\n amount: z.bigint().describe('Amount of input token to be used for minting'),\n marketAddress: z.string().describe('Address of the yield market'),\n});\nexport type BuyPtRequest = z.infer<typeof BuyPtRequestSchema>;\n\nexport const BuyPtResponseSchema = z.object({\n exactPtAmount: z.string().describe('Amount of Principal Tokens (PT) minted'),\n ptTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Principal Token (PT)'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the minting process'),\n});\nexport type BuyPtResponse = z.infer<typeof BuyPtResponseSchema>;\n\nexport const BuyYtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n inputToken: TokenSchema.describe('Token to be used for minting PT and YT'),\n amount: z.bigint().describe('Amount of input token to be used for minting'),\n marketAddress: z.string().describe('Address of the yield market'),\n});\nexport type BuyYtRequest = z.infer<typeof BuyYtRequestSchema>;\n\nexport const BuyYtResponseSchema = z.object({\n exactYtAmount: z.string().describe('Amount of Yield Tokens (YT) minted'),\n ytTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Yield Token (YT)'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the minting process'),\n});\nexport type BuyYtResponse = z.infer<typeof BuyYtResponseSchema>;\n\nexport const SellPtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n ptToken: TokenSchema.describe('Principal Token (PT) to be sold'),\n amount: z.bigint().describe('Amount of Principal Token (PT) to be sold'),\n});\nexport type SellPtRequest = z.infer<typeof SellPtRequestSchema>;\n\nexport const SellPtResponseSchema = z.object({\n tokenOutIdentifier: TokenIdentifierSchema.describe(\n 'Details of the token received from selling PT',\n ),\n exactAmountOut: z.string().describe('Exact amount of token received from selling PT'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the selling process'),\n});\nexport type SellPtResponse = z.infer<typeof SellPtResponseSchema>;\n\nexport const SellYtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n ytToken: TokenSchema.describe('Yield Token (YT) to be sold'),\n amount: z.bigint().describe('Amount of Yield Token (YT) to be sold'),\n});\nexport type SellYtRequest = z.infer<typeof SellYtRequestSchema>;\n\nexport const SellYtResponseSchema = z.object({\n tokenOutIdentifier: TokenIdentifierSchema.describe(\n 'Details of the token received from selling YT',\n ),\n exactAmountOut: z.string().describe('Exact amount of token received from selling YT'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the selling process'),\n});\nexport type SellYtResponse = z.infer<typeof SellYtResponseSchema>;\n\nexport const RedeemPtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n ptToken: TokenSchema.describe('Principal Token (PT) to be redeemed'),\n amount: z.bigint().describe('Amount of Principal Token (PT) to be redeemed'),\n});\nexport type RedeemPtRequest = z.infer<typeof RedeemPtRequestSchema>;\n\nexport const RedeemPtResponseSchema = z.object({\n underlyingTokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the underlying token received upon redemption',\n ),\n exactUnderlyingAmount: z.string().describe('Exact amount of underlying token received'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the redemption process'),\n});\nexport type RedeemPtResponse = z.infer<typeof RedeemPtResponseSchema>;\n\nexport const ClaimRewardsRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n ytToken: TokenSchema.describe('Yield Token (YT) for which to claim rewards'),\n});\nexport type ClaimRewardsRequest = z.infer<typeof ClaimRewardsRequestSchema>;\n\nexport const ClaimRewardsResponseSchema = z.object({\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the reward claiming process'),\n});\nexport type ClaimRewardsResponse = z.infer<typeof ClaimRewardsResponseSchema>;\n\nexport const MarketTokenizedYieldRequestSchema = z.object({\n chainIds: z\n .array(z.string().describe('Blockchain network identifier'))\n .describe('List of chain IDs to filter the markets'),\n});\nexport type MarketTokenizedYieldRequest = z.infer<typeof MarketTokenizedYieldRequestSchema>;\n\nexport const TokenizedYieldMarketSchema = z.object({\n marketIdentifier: TokenIdentifierSchema.describe('Unique identifier for the yield market'),\n ptTokenIdentifier: TokenIdentifierSchema.describe('Details of the Principal Token (PT)'),\n ytTokenIdentifier: TokenIdentifierSchema.describe('Details of the Yield Token (YT)'),\n underlyingTokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the underlying asset token',\n ),\n expiry: z.string().describe('Expiry date of the yield market in ISO 8601 format'),\n details: z.object({}),\n});\nexport type TokenizedYieldMarket = z.infer<typeof TokenizedYieldMarketSchema>;\n\nexport const MarketTokenizedYieldResponseSchema = z.object({\n markets: z\n .array(TokenizedYieldMarketSchema)\n .describe('Array of tokenized yield markets matching the request criteria'),\n});\nexport type MarketTokenizedYieldResponse = z.infer<typeof MarketTokenizedYieldResponseSchema>;\n\nexport const TokenizedYieldUserPositionSchema = z.object({\n marketIdentifier: TokenIdentifierSchema.describe('Unique identifier for the yield market'),\n pt: z.object({\n tokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the Principal Token (PT) held by the user',\n ),\n exactAmount: z.string().describe('Exact amount of Principal Token (PT) held'),\n }),\n yt: z.object({\n tokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the Yield Token (YT) held by the user',\n ),\n exactAmount: z.string().describe('Exact amount of Yield Token (YT) held'),\n claimableRewards: z.array(\n z.object({\n tokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the reward token claimable by the user',\n ),\n exactAmount: z.string().describe('Exact amount of reward token claimable'),\n }),\n ),\n }),\n});\nexport type TokenizedYieldUserPosition = z.infer<typeof TokenizedYieldUserPositionSchema>;\n\nexport const TokenizedYieldUserPositionsRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n chainIds: z\n .array(z.string().describe('Blockchain network identifier'))\n .describe('List of chain IDs to filter the user positions'),\n});\nexport type TokenizedYieldUserPositionsRequest = z.infer<\n typeof TokenizedYieldUserPositionsRequestSchema\n>;\n\nexport const TokenizedYieldUserPositionsResponseSchema = z.object({\n positions: z\n .array(TokenizedYieldUserPositionSchema)\n .describe('Array of user positions in tokenized yield markets'),\n});\nexport type TokenizedYieldUserPositionsResponse = z.infer<\n typeof TokenizedYieldUserPositionsResponseSchema\n>;\n","import { ethers } from 'ethers';\n\n/**\n * Represents a blockchain network configuration used to create JSON-RPC providers and\n * hold basic chain-specific metadata.\n *\n * The Chain class encapsulates:\n * - a numeric chain identifier (id),\n * - an RPC URL to connect to the chain (rpcUrl),\n * - an optional wrapped native token address (wrappedNativeTokenAddress).\n *\n * @param id - The numeric identifier for the chain (e.g., 1 for Ethereum mainnet).\n * @param rpcUrl - The JSON-RPC endpoint URL used to create providers for this chain.\n * @param wrappedNativeTokenAddress - Optional address of the chain's wrapped native token (if applicable).\n */\nexport class Chain {\n constructor(\n public id: number,\n public rpcUrl: string,\n public wrappedNativeTokenAddress?: string\n ) {}\n\n /**\n * Create and return an ethers.js JsonRpcProvider configured with this chain's RPC URL.\n *\n * This method constructs a new ethers.providers.JsonRpcProvider each time it is called.\n * Consumers may cache the provider if they intend to reuse it to avoid allocating multiple instances.\n *\n * @returns An instance of ethers.providers.JsonRpcProvider configured with the chain's rpcUrl.\n */\n public getProvider(): ethers.providers.JsonRpcProvider {\n return new ethers.providers.JsonRpcProvider(this.rpcUrl);\n }\n}\n","import {\n LegacyUiPoolDataProvider,\n UiPoolDataProvider,\n type ReservesDataHumanized,\n type ReservesHelperInput,\n type UserReservesHelperInput,\n type EModeData,\n type EmodeDataHumanized,\n type UserReserveDataHumanized,\n} from '@aave/contract-helpers';\nimport type { providers } from 'ethers';\n\n// @aave/contract-helpers provides two periphery contracts for fetching data from the blockchain:\n// `LegacyUiPoolDataProvider` and `UiPoolDataProvider`. Which one should be used is determined by the version that is actually deployed on a given chain.\n// Fortunately, for our use case we don't care about this complexity,\n// because their interfaces share just enough similarities for us to proceed.\n// `IUiPoolDataProvider` is an intersection of two interfaces.\n\n// Common functions between `LegacyUiPoolDataProvider` and `UiPoolDataProvider`\nexport interface IUiPoolDataProvider {\n getReservesHumanized: (args: ReservesHelperInput) => Promise<ReservesDataHumanized>;\n getUserReservesHumanized: (args: UserReservesHelperInput) => Promise<{\n userReserves: UserReserveDataHumanized[];\n userEmodeCategoryId: number;\n }>;\n getEModes: (args: ReservesHelperInput) => Promise<EModeData[]>;\n getEModesHumanized: (args: ReservesHelperInput) => Promise<EmodeDataHumanized[]>;\n}\n\nexport type IUiPoolDataProviderConstructor = new ({\n uiPoolDataProviderAddress,\n provider,\n chainId,\n}: {\n uiPoolDataProviderAddress: string;\n provider: providers.JsonRpcProvider;\n chainId: number;\n}) => IUiPoolDataProvider;\n\n// which class to use: LegacyUiPoolDataProvider or UiPoolDataProvider\n// When adding new chains, either compare the interfaces or bruteforce the correct option.\nexport const UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN: Record<\n number,\n IUiPoolDataProviderConstructor\n> = {\n 11155111: LegacyUiPoolDataProvider as IUiPoolDataProviderConstructor,\n 42161: UiPoolDataProvider as IUiPoolDataProviderConstructor,\n 1: UiPoolDataProvider as IUiPoolDataProviderConstructor,\n};\n\n// Use this function to get the correct pool data provider implementation.\nexport const getUiPoolDataProviderImpl = (chainId: number): IUiPoolDataProviderConstructor => {\n const res = UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN[chainId];\n if (!res) {\n throw new Error(\n 'UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN does not contain this chain ID. Edit providers/aave/dataProvider.ts.'\n );\n }\n return res;\n};\n","import * as markets from '@bgd-labs/aave-address-book';\n\n// AAVE market selection provided by aave-address-book is not very typescript-friendly:\n// we have to trust that the structure of their modules is the same, which\n// seems to be the case.\n\n// An interface that only contains fields of market definitions that we actually use\nexport type AAVEMarket = {\n AAVE_PROTOCOL_DATA_PROVIDER: string;\n POOL: string;\n POOL_ADDRESSES_PROVIDER: string;\n UI_INCENTIVE_DATA_PROVIDER: string;\n UI_POOL_DATA_PROVIDER: string;\n WALLET_BALANCE_PROVIDER: string;\n WETH_GATEWAY: string;\n};\n\nconst marketMap: Record<number, keyof typeof markets> = {\n 1: 'AaveV3Ethereum',\n 11155111: 'AaveV3Sepolia',\n 42161: 'AaveV3Arbitrum',\n 421614: 'AaveV3ArbitrumSepolia',\n 8453: 'AaveV3Base',\n 137: 'AaveV3Polygon',\n 10: 'AaveV3Optimism',\n};\n\nexport const getMarket = (chainId: number): AAVEMarket => {\n const marketKey = marketMap[chainId];\n if (!marketKey) {\n throw new Error(\n `AAVE: no market found for chain ID ${chainId}: modify providers/aave/market.ts`\n );\n }\n\n const market = markets[marketKey] as unknown as AAVEMarket;\n if (!market) {\n throw new Error(`No such market: ${marketKey}`);\n }\n\n return market;\n};\n","// based on https://github.com/aave-dao/aave-v3-origin/blob/083bd38a137b42b5df04e22ad4c9e72454365d0d/src/contracts/protocol/libraries/helpers/Errors.sol\n\nclass AaveError extends Error {\n public description: string;\n public override message: string;\n\n constructor(code: string, name: string, description: string) {\n const message = name + ` (${code}): ` + description;\n super(message);\n this.name = 'AaveError';\n this.description = description;\n this.message = message;\n\n // Ensures proper prototype chain in transpiled JavaScript\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\ntype AaveErrorData = {\n name: string;\n description: string;\n};\n\nexport const AAVE_ERROR_CODES: Record<string, AaveErrorData> = {\n '1': {\n name: 'CALLER_NOT_POOL_ADMIN',\n description: 'The caller of the function is not a pool admin',\n },\n '2': {\n name: 'CALLER_NOT_EMERGENCY_ADMIN',\n description: 'The caller of the function is not an emergency admin',\n },\n '3': {\n name: 'CALLER_NOT_POOL_OR_EMERGENCY_ADMIN',\n description: 'The caller of the function is not a pool or emergency admin',\n },\n '4': {\n name: 'CALLER_NOT_RISK_OR_POOL_ADMIN',\n description: 'The caller of the function is not a risk or pool admin',\n },\n '5': {\n name: 'CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN',\n description: 'The caller of the function is not an asset listing or pool admin',\n },\n '6': {\n name: 'CALLER_NOT_BRIDGE',\n description: 'The caller of the function is not a bridge',\n },\n '7': {\n name: 'ADDRESSES_PROVIDER_NOT_REGISTERED',\n description: 'Pool addresses provider is not registered',\n },\n '8': {\n name: 'INVALID_ADDRESSES_PROVIDER_ID',\n description: 'Invalid id for the pool addresses provider',\n },\n '9': { name: 'NOT_CONTRACT', description: 'Address is not a contract' },\n '10': {\n name: 'CALLER_NOT_POOL_CONFIGURATOR',\n description: 'The caller of the function is not the pool configurator',\n },\n '11': {\n name: 'CALLER_NOT_ATOKEN',\n description: 'The caller of the function is not an AToken',\n },\n '12': {\n name: 'INVALID_ADDRESSES_PROVIDER',\n description: 'The address of the pool addresses provider is invalid',\n },\n '13': {\n name: 'INVALID_FLASHLOAN_EXECUTOR_RETURN',\n description: 'Invalid return value of the flashloan executor function',\n },\n '14': {\n name: 'RESERVE_ALREADY_ADDED',\n description: 'Reserve has already been added to reserve list',\n },\n '15': {\n name: 'NO_MORE_RESERVES_ALLOWED',\n description: 'Maximum amount of reserves in the pool reached',\n },\n '16': {\n name: 'EMODE_CATEGORY_RESERVED',\n description: 'Zero eMode category is reserved for volatile heterogeneous assets',\n },\n '17': {\n name: 'INVALID_EMODE_CATEGORY_ASSIGNMENT',\n description: 'Invalid eMode category assignment to asset',\n },\n '18': {\n name: 'RESERVE_LIQUIDITY_NOT_ZERO',\n description: 'The liquidity of the reserve needs to be 0',\n },\n '19': {\n name: 'FLASHLOAN_PREMIUM_INVALID',\n description: 'Invalid flashloan premium',\n },\n '20': {\n name: 'INVALID_RESERVE_PARAMS',\n description: 'Invalid risk parameters for the reserve',\n },\n '21': {\n name: 'INVALID_EMODE_CATEGORY_PARAMS',\n description: 'Invalid risk parameters for the eMode category',\n },\n '22': {\n name: 'BRIDGE_PROTOCOL_FEE_INVALID',\n description: 'Invalid bridge protocol fee',\n },\n '23': {\n name: 'CALLER_MUST_BE_POOL',\n description: 'The caller of this function must be a pool',\n },\n '24': { name: 'INVALID_MINT_AMOUNT', description: 'Invalid amount to mint' },\n '25': { name: 'INVALID_BURN_AMOUNT', description: 'Invalid amount to burn' },\n '26': {\n name: 'INVALID_AMOUNT',\n description: 'Amount must be greater than 0',\n },\n '27': {\n name: 'RESERVE_INACTIVE',\n description: 'Action requires an active reserve',\n },\n '28': {\n name: 'RESERVE_FROZEN',\n description: 'Action cannot be performed because the reserve is frozen',\n },\n '29': {\n name: 'RESERVE_PAUSED',\n description: 'Action cannot be performed because the reserve is paused',\n },\n '30': {\n name: 'BORROWING_NOT_ENABLED',\n description: 'Borrowing is not enabled',\n },\n '32': {\n name: 'NOT_ENOUGH_AVAILABLE_USER_BALANCE',\n description: 'User cannot withdraw more than the available balance',\n },\n '33': {\n name: 'INVALID_INTEREST_RATE_MODE_SELECTED',\n description: 'Invalid interest rate mode selected',\n },\n '34': {\n name: 'COLLATERAL_BALANCE_IS_ZERO',\n description: 'The collateral balance is 0',\n },\n '35': {\n name: 'HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD',\n description: 'Health factor is lesser than the liquidation threshold',\n },\n '36': {\n name: 'COLLATERAL_CANNOT_COVER_NEW_BORROW',\n description: 'There is not enough collateral to cover a new borrow',\n },\n '37': {\n name: 'COLLATERAL_SAME_AS_BORROWING_CURRENCY',\n description: 'Collateral is (mostly) the same currency that is being borrowed',\n },\n '39': {\n name: 'NO_DEBT_OF_SELECTED_TYPE',\n description: 'For repayment of a specific type of debt, the user needs to have debt that type',\n },\n '40': {\n name: 'NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF',\n description: 'To repay on behalf of a user an explicit amount to repay is needed',\n },\n '42': {\n name: 'NO_OUTSTANDING_VARIABLE_DEBT',\n description: 'User does not have outstanding variable rate debt on this reserve',\n },\n '43': {\n name: 'UNDERLYING_BALANCE_ZERO',\n description: 'The underlying balance needs to be greater than 0',\n },\n '44': {\n name: 'INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET',\n description: 'Interest rate rebalance conditions were not met',\n },\n '45': {\n name: 'HEALTH_FACTOR_NOT_BELOW_THRESHOLD',\n description: 'Health factor is not below the threshold',\n },\n '46': {\n name: 'COLLATERAL_CANNOT_BE_LIQUIDATED',\n description: 'The collateral chosen cannot be liquidated',\n },\n '47': {\n name: 'SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER',\n description: 'User did not borrow the specified currency',\n },\n '49': {\n name: 'INCONSISTENT_FLASHLOAN_PARAMS',\n description: 'Inconsistent flashloan parameters',\n },\n '50': { name: 'BORROW_CAP_EXCEEDED', description: 'Borrow cap is exceeded' },\n '51': { name: 'SUPPLY_CAP_EXCEEDED', description: 'Supply cap is exceeded' },\n '52': {\n name: 'UNBACKED_MINT_CAP_EXCEEDED',\n description: 'Unbacked mint cap is exceeded',\n },\n '53': {\n name: 'DEBT_CEILING_EXCEEDED',\n description: 'Debt ceiling is exceeded',\n },\n '54': {\n name: 'UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO',\n description: 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)',\n },\n '56': {\n name: 'VARIABLE_DEBT_SUPPLY_NOT_ZERO',\n description: 'Variable debt supply is not zero',\n },\n '57': { name: 'LTV_VALIDATION_FAILED', description: 'Ltv validation failed' },\n '58': {\n name: 'INCONSISTENT_EMODE_CATEGORY',\n description: 'Inconsistent eMode category',\n },\n '59': {\n name: 'PRICE_ORACLE_SENTINEL_CHECK_FAILED',\n description: 'Price oracle sentinel validation failed',\n },\n '60': {\n name: 'ASSET_NOT_BORROWABLE_IN_ISOLATION',\n description: 'Asset is not borrowable in isolation mode',\n },\n '61': {\n name: 'RESERVE_ALREADY_INITIALIZED',\n description: 'Reserve has already been initialized',\n },\n '62': {\n name: 'USER_IN_ISOLATION_MODE_OR_LTV_ZERO',\n description: 'User is in isolation mode or ltv is zero',\n },\n '63': {\n name: 'INVALID_LTV',\n description: 'Invalid ltv parameter for the reserve',\n },\n '64': {\n name: 'INVALID_LIQ_THRESHOLD',\n description: 'Invalid liquidity threshold parameter for the reserve',\n },\n '65': {\n name: 'INVALID_LIQ_BONUS',\n description: 'Invalid liquidity bonus parameter for the reserve',\n },\n '66': {\n name: 'INVALID_DECIMALS',\n description: 'Invalid decimals parameter of the underlying asset of the reserve',\n },\n '67': {\n name: 'INVALID_RESERVE_FACTOR',\n description: 'Invalid reserve factor parameter for the reserve',\n },\n '68': {\n name: 'INVALID_BORROW_CAP',\n description: 'Invalid borrow cap for the reserve',\n },\n '69': {\n name: 'INVALID_SUPPLY_CAP',\n description: 'Invalid supply cap for the reserve',\n },\n '70': {\n name: 'INVALID_LIQUIDATION_PROTOCOL_FEE',\n description: 'Invalid liquidation protocol fee for the reserve',\n },\n '71': {\n name: 'INVALID_EMODE_CATEGORY',\n description: 'Invalid eMode category for the reserve',\n },\n '72': {\n name: 'INVALID_UNBACKED_MINT_CAP',\n description: 'Invalid unbacked mint cap for the reserve',\n },\n '73': {\n name: 'INVALID_DEBT_CEILING',\n description: 'Invalid debt ceiling for the reserve',\n },\n '74': { name: 'INVALID_RESERVE_INDEX', description: 'Invalid reserve index' },\n '75': {\n name: 'ACL_ADMIN_CANNOT_BE_ZERO',\n description: 'ACL admin cannot be set to the zero address',\n },\n '76': {\n name: 'INCONSISTENT_PARAMS_LENGTH',\n description: 'Array parameters that should be equal length are not',\n },\n '77': {\n name: 'ZERO_ADDRESS_NOT_VALID',\n description: 'Zero address not valid',\n },\n '78': { name: 'INVALID_EXPIRATION', description: 'Invalid expiration' },\n '79': { name: 'INVALID_SIGNATURE', description: 'Invalid signature' },\n '80': {\n name: 'OPERATION_NOT_SUPPORTED',\n description: 'Operation not supported',\n },\n '81': {\n name: 'DEBT_CEILING_NOT_ZERO',\n description: 'Debt ceiling is not zero',\n },\n '82': { name: 'ASSET_NOT_LISTED', description: 'Asset is not listed' },\n '83': {\n name: 'INVALID_OPTIMAL_USAGE_RATIO',\n description: 'Invalid optimal usage ratio',\n },\n '85': {\n name: 'UNDERLYING_CANNOT_BE_RESCUED',\n description: 'The underlying asset cannot be rescued',\n },\n '86': {\n name: 'ADDRESSES_PROVIDER_ALREADY_ADDED',\n description: 'Reserve has already been added to reserve list',\n },\n '87': {\n name: 'POOL_ADDRESSES_DO_NOT_MATCH',\n description:\n 'The token implementation pool address and the pool address provided by the initializing pool do not match',\n },\n '89': {\n name: 'SILOED_BORROWING_VIOLATION',\n description: 'User is trying to borrow multiple assets including a siloed one',\n },\n '90': {\n name: 'RESERVE_DEBT_NOT_ZERO',\n description: 'The total debt of the reserve needs to be 0',\n },\n '91': {\n name: 'FLASHLOAN_DISABLED',\n description: 'FlashLoaning for this asset is disabled',\n },\n '92': {\n name: 'INVALID_MAX_RATE',\n description: 'The expect maximum borrow rate is invalid',\n },\n '93': {\n name: 'WITHDRAW_TO_ATOKEN',\n description: 'Withdrawing to the aToken is not allowed',\n },\n '94': {\n name: 'SUPPLY_TO_ATOKEN',\n description: 'Supplying to the aToken is not allowed',\n },\n '95': {\n name: 'SLOPE_2_MUST_BE_GTE_SLOPE_1',\n description: 'Variable interest rate slope 2 can not be lower than slope 1',\n },\n '96': {\n name: 'CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN',\n description: 'The caller of the function is not a risk, pool or emergency admin',\n },\n '97': {\n name: 'LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED',\n description: 'Liquidation grace sentinel validation failed',\n },\n '98': {\n name: 'INVALID_GRACE_PERIOD',\n description: 'Grace period above a valid range',\n },\n '99': {\n name: 'INVALID_FREEZE_STATE',\n description: 'Reserve is already in the passed freeze state',\n },\n '100': {\n name: 'NOT_BORROWABLE_IN_EMODE',\n description: 'Asset not borrowable in eMode',\n },\n};\n\nexport function getAaveError(code: string): AaveError | null {\n const err = AAVE_ERROR_CODES[code];\n if (err) {\n return new AaveError(code, err.name, err.description);\n }\n return null;\n}\n","import type { EthereumTransactionTypeExtended } from '@aave/contract-helpers';\nimport { type PopulatedTransaction, ethers } from 'ethers';\n\nimport { getAaveError } from './errors.js';\n\nexport async function populateTransaction(\n tx: EthereumTransactionTypeExtended\n): Promise<PopulatedTransaction> {\n let txData: PopulatedTransaction | null = null;\n try {\n txData = await tx.tx();\n } catch (unknownError) {\n const reason =\n typeof unknownError === 'object' &&\n unknownError !== null &&\n 'reason' in unknownError &&\n typeof (unknownError as { reason: unknown }).reason === 'string'\n ? (unknownError as { reason: string }).reason\n : '';\n // error reason looks like 'execution reverted: revert: 32', with the aave\n // domain error code at the very end\n const errorCode = reason.split(' ').pop();\n // If we end up passing garbage to getAaveError, it does not matter - it will return null\n const aaveError = getAaveError(errorCode);\n if (aaveError !== null) {\n throw aaveError;\n } else {\n // we can hope that the LLM will provide an analysis of the error on the fly\n throw unknownError;\n }\n }\n if (!txData) {\n throw new Error('Failed to populate transaction');\n }\n return {\n value: ethers.BigNumber.from(txData.value ?? 0),\n from: txData.from,\n to: txData.to,\n data: txData.data,\n };\n}\n","import type { ReservesDataHumanized, UserReserveDataHumanized } from '@aave/contract-helpers';\nimport {\n formatReserves,\n formatUserSummary,\n type FormatUserSummaryResponse,\n type FormatReserveUSDResponse,\n} from '@aave/math-utils';\n\nfunction formatNumeric(value: string): string {\n const num = parseFloat(value);\n if (Number.isInteger(num)) return num.toString();\n return parseFloat(num.toFixed(2)).toString();\n}\n\nexport class UserSummary {\n public reserves: FormatUserSummaryResponse<FormatReserveUSDResponse>;\n\n /**\n * @param userReservesResponse - The response from getUserReservesHumanized.\n * @param reservesResponse - The response from getReservesHumanized.\n */\n constructor(\n userReservesResponse: {\n userReserves: UserReserveDataHumanized[];\n userEmodeCategoryId: number;\n },\n reservesResponse: ReservesDataHumanized\n ) {\n const currentTimestamp = Date.now() / 1000;\n\n const formattedReserves = formatReserves({\n reserves: reservesResponse.reservesData,\n currentTimestamp,\n marketReferenceCurrencyDecimals:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyDecimals,\n marketReferencePriceInUsd:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyPriceInUsd,\n });\n\n this.reserves = formatUserSummary({\n currentTimestamp,\n marketReferencePriceInUsd:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyPriceInUsd,\n marketReferenceCurrencyDecimals:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyDecimals,\n userReserves: userReservesResponse.userReserves,\n formattedReserves,\n userEmodeCategoryId: userReservesResponse.userEmodeCategoryId,\n });\n }\n\n public toHumanReadable(): string {\n let output = 'User Positions:\\n';\n output += `Total Liquidity (USD): ${formatNumeric(this.reserves.totalLiquidityUSD)}\\n`;\n output += `Total Collateral (USD): ${formatNumeric(this.reserves.totalCollateralUSD)}\\n`;\n output += `Total Borrows (USD): ${formatNumeric(this.reserves.totalBorrowsUSD)}\\n`;\n output += `Net Worth (USD): ${formatNumeric(this.reserves.netWorthUSD)}\\n`;\n output += `Health Factor: ${formatNumeric(this.reserves.healthFactor)}\\n\\n`;\n output += 'Deposits:\\n';\n for (const entry of this.reserves.userReservesData) {\n if (parseFloat(entry.scaledATokenBalance) > 0) {\n const underlying = entry.underlyingBalance;\n const underlyingUSD = entry.underlyingBalanceUSD\n ? formatNumeric(entry.underlyingBalanceUSD)\n : 'N/A';\n output += `- ${entry.reserve.symbol}: ${underlying} (USD: ${underlyingUSD})\\n`;\n }\n }\n output += '\\nLoans:\\n';\n for (const entry of this.reserves.userReservesData) {\n const borrow = entry.totalBorrows || '0';\n if (parseFloat(borrow) > 0) {\n const totalBorrows = entry.totalBorrows;\n const totalBorrowsUSD = entry.totalBorrowsUSD\n ? formatNumeric(entry.totalBorrowsUSD)\n : 'N/A';\n output += `- ${entry.reserve.symbol}: ${totalBorrows} (USD: ${totalBorrowsUSD})\\n`;\n }\n }\n return output;\n }\n}\n","import {\n Pool,\n PoolBundle,\n InterestRate,\n type ReservesDataHumanized,\n type ReserveDataHumanized,\n} from '@aave/contract-helpers';\nimport { ethers, type PopulatedTransaction, utils } from 'ethers';\n\nimport {\n type TransactionPlan,\n type BorrowTokensRequest,\n type BorrowTokensResponse,\n type RepayTokensRequest,\n type RepayTokensResponse,\n type SupplyTokensRequest,\n type SupplyTokensResponse,\n type WithdrawTokensRequest,\n type WithdrawTokensResponse,\n type GetWalletLendingPositionsResponse,\n TransactionTypes,\n type GetWalletLendingPositionsRequest,\n type Token,\n} from '../core/index.js';\n\nimport { Chain } from './chain.js';\nimport { getUiPoolDataProviderImpl, type IUiPoolDataProvider } from './dataProvider.js';\nimport { type AAVEMarket, getMarket } from './market.js';\nimport { populateTransaction } from './populateTransaction.js';\nimport { UserSummary } from './userSummary.js';\n\nexport type EModeCategory = 'default' | 'stablecoins';\n\nexport interface PoolData {\n tokenAddress: string;\n poolAddress: string;\n variableBorrowRate: string;\n variableSupplyRate: string;\n ltv: string;\n availableLiquidity: string;\n reserveSize: string;\n}\n\nexport type AAVEAction = PopulatedTransaction[];\n\nexport interface AAVEAdapterParams {\n chainId: number;\n rpcUrl: string;\n wrappedNativeToken?: string; // e.g. WETH address for ETH\n}\n\n// AAVE's ETH placeholder address used for native ETH operations\nconst AAVE_ETH_PLACEHOLDER = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';\n\n/**\n * AAVEAdapter is the primary class wrapping Aave V3 interactions.\n */\nexport class AAVEAdapter {\n public chain: Chain;\n public market: AAVEMarket;\n\n constructor(params: AAVEAdapterParams) {\n this.chain = new Chain(params.chainId, params.rpcUrl);\n this.market = getMarket(this.chain.id);\n }\n\n /**\n * If the token is native, return AAVE's placeholder address instead of the ember address.\n * @param token - The token to normalize.\n * @returns The normalized token address.\n */\n public normalizeTokenAddress(token: Token): string {\n return token.isNative ? AAVE_ETH_PLACEHOLDER : token.tokenUid.address;\n }\n\n public async createSupplyTransaction(params: SupplyTokensRequest): Promise<SupplyTokensResponse> {\n const { supplyToken: token, amount, walletAddress } = params;\n const txs = await this.supply(\n this.normalizeTokenAddress(token),\n amount.toString(),\n walletAddress,\n );\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createWithdrawTransaction(\n params: WithdrawTokensRequest,\n ): Promise<WithdrawTokensResponse> {\n const { tokenToWithdraw, amount, walletAddress } = params;\n\n // Find aToken he wants to withdraw from\n const alphaTokenAddress = (await this.getReserves()).reservesData.find(\n (reserve) => reserve.underlyingAsset === tokenToWithdraw.tokenUid.address,\n )?.aTokenAddress;\n if (!alphaTokenAddress) {\n throw new Error('No position can generate the token to withdraw');\n }\n\n const txs = await this.withdraw(alphaTokenAddress, amount, walletAddress, walletAddress);\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createBorrowTransaction(params: BorrowTokensRequest): Promise<BorrowTokensResponse> {\n const { borrowToken, amount, walletAddress } = params;\n const normalizedTokenAddress = this.normalizeTokenAddress(borrowToken);\n\n // Get pool data to fetch APR\n const poolData = await this.getPool(normalizedTokenAddress);\n const reservesResponse = await this.getReserves();\n\n let reserveLiquidationThreshold: string | null = null;\n for (const reserve of reservesResponse.reservesData) {\n const token = ethers.utils.getAddress(reserve.underlyingAsset);\n if (token === normalizedTokenAddress) {\n reserveLiquidationThreshold = reserve.reserveLiquidationThreshold;\n }\n }\n\n if (reserveLiquidationThreshold == null) {\n throw new Error('Reserve not found in AAVE pool for a given token');\n }\n\n // Create borrow transaction\n const txs = await this.borrow(normalizedTokenAddress, amount.toString(), walletAddress);\n\n return {\n liquidationThreshold: reserveLiquidationThreshold,\n currentBorrowApy: poolData.variableBorrowRate,\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createRepayTransaction(params: RepayTokensRequest): Promise<RepayTokensResponse> {\n const { repayToken, amount, walletAddress: from } = params;\n\n const normalizedAsset = this.normalizeTokenAddress(repayToken);\n\n // Choose repayment method based on useATokens flag\n const txs = await this.repay(normalizedAsset, amount.toString(), from, repayToken.decimals);\n\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createRepayTransactionWithATokens(\n params: RepayTokensRequest,\n ): Promise<RepayTokensResponse> {\n const { repayToken, amount, walletAddress: from } = params;\n\n const normalizedAsset = this.normalizeTokenAddress(repayToken);\n\n // Choose repayment method based on useATokens flag\n const txs = await this.repayWithATokens(\n normalizedAsset,\n amount.toString(),\n from,\n repayToken.decimals,\n );\n\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n // Private Methods\n private getProvider() {\n return this.chain.getProvider();\n }\n\n private getPoolBundle() {\n const provider = this.getProvider();\n return new PoolBundle(provider, {\n POOL: this.market.POOL,\n WETH_GATEWAY: this.market.WETH_GATEWAY,\n });\n }\n\n private getPoolDataProvider(): IUiPoolDataProvider {\n const provider = this.getProvider();\n const DataProviderImpl = getUiPoolDataProviderImpl(this.chain.id);\n return new DataProviderImpl({\n uiPoolDataProviderAddress: this.market.UI_POOL_DATA_PROVIDER,\n provider,\n chainId: this.chain.id,\n });\n }\n\n private getPoolContract() {\n const provider = this.getProvider();\n return new Pool(provider, {\n POOL: this.market.POOL,\n WETH_GATEWAY: this.market.WETH_GATEWAY,\n });\n }\n\n private async getPool(asset: string): Promise<PoolData> {\n const reservesResponse = await this.getReserves();\n\n let targetAsset = asset;\n\n // If asset is AAVE's native token placeholder, find the corresponding wrapped native token reserve\n if (asset === AAVE_ETH_PLACEHOLDER) {\n const configuredWrappedNativeToken = this.chain.wrappedNativeTokenAddress;\n\n if (!configuredWrappedNativeToken) {\n throw new Error(`No wrapped native token configured for chain ${this.chain.id}`);\n }\n\n const wrappedNativeTokenReserve = reservesResponse.reservesData.find(\n (r: ReserveDataHumanized) =>\n ethers.utils.getAddress(r.underlyingAsset) === configuredWrappedNativeToken,\n );\n\n if (!wrappedNativeTokenReserve) {\n throw new Error(`Wrapped native token reserve not found for native token operations`);\n }\n\n targetAsset = wrappedNativeTokenReserve.underlyingAsset;\n }\n\n const reserve = reservesResponse.reservesData.find(\n (r: ReserveDataHumanized) =>\n ethers.utils.getAddress(r.underlyingAsset) === ethers.utils.getAddress(targetAsset),\n );\n\n if (!reserve) {\n throw new Error(`Asset ${asset} not found in reserves`);\n }\n\n return {\n tokenAddress: reserve.underlyingAsset,\n poolAddress: this.market.POOL,\n variableBorrowRate: reserve.variableBorrowRate,\n variableSupplyRate: reserve.liquidityRate,\n ltv: reserve.baseLTVasCollateral,\n availableLiquidity: reserve.availableLiquidity,\n reserveSize: reserve.availableLiquidity,\n };\n }\n\n public async getReserves(): Promise<ReservesDataHumanized> {\n const reserves = this.getPoolDataProvider().getReservesHumanized({\n lendingPoolAddressProvider: this.market.POOL_ADDRESSES_PROVIDER,\n });\n return reserves;\n }\n\n public async getUserSummary(\n params: GetWalletLendingPositionsRequest,\n ): Promise<GetWalletLendingPositionsResponse> {\n const userSummaryResponse = await this._getUserSummary(params.walletAddress);\n const {\n totalLiquidityUSD,\n totalCollateralUSD,\n totalBorrowsUSD,\n netWorthUSD,\n availableBorrowsUSD,\n currentLoanToValue,\n currentLiquidationThreshold,\n healthFactor,\n userReservesData,\n } = userSummaryResponse.reserves;\n\n const userReservesFormatted = [];\n for (const {\n reserve,\n underlyingBalance,\n underlyingBalanceUSD,\n variableBorrows,\n variableBorrowsUSD,\n totalBorrows,\n totalBorrowsUSD,\n } of userReservesData.filter((ur) => ur.underlyingBalanceUSD !== '0')) {\n userReservesFormatted.push({\n tokenUid: {\n address: reserve.underlyingAsset,\n chainId: this.chain.id.toString(),\n },\n underlyingBalance,\n underlyingBalanceUsd: underlyingBalanceUSD,\n variableBorrows,\n variableBorrowsUsd: variableBorrowsUSD,\n totalBorrows,\n totalBorrowsUsd: totalBorrowsUSD,\n });\n }\n\n return {\n userReserves: userReservesFormatted,\n totalLiquidityUsd: totalLiquidityUSD,\n totalCollateralUsd: totalCollateralUSD,\n totalBorrowsUsd: totalBorrowsUSD,\n netWorthUsd: netWorthUSD,\n availableBorrowsUsd: availableBorrowsUSD,\n currentLoanToValue,\n currentLiquidationThreshold,\n healthFactor,\n };\n }\n\n private async _getUserSummary(userAddress: string): Promise<UserSummary> {\n const validatedUser = ethers.utils.getAddress(userAddress);\n const poolDataProvider = this.getPoolDataProvider();\n\n const reservesResponse = await this.getReserves();\n\n const userReservesResponse = await poolDataProvider.getUserReservesHumanized({\n lendingPoolAddressProvider: this.market.POOL_ADDRESSES_PROVIDER,\n user: validatedUser,\n });\n\n return new UserSummary(userReservesResponse, reservesResponse);\n }\n\n private borrow(asset: string, amount: string, from: string): Promise<AAVEAction> {\n // validate\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n\n const bundle: PoolBundle = this.getPoolBundle();\n\n const tx = bundle.borrowTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount,\n interestRateMode: InterestRate.Variable,\n });\n\n return Promise.resolve([tx]);\n }\n\n private async createApproval({\n asset,\n amount_raw,\n user,\n spender,\n }: {\n spender: string;\n user: string;\n asset: string;\n amount_raw: string;\n }): Promise<PopulatedTransaction | null> {\n const bundle = this.getPoolBundle();\n let approvalTx = null;\n const isApprovedEnough = await bundle.erc20Service.isApproved({\n user: user,\n token: asset,\n spender,\n amount: amount_raw,\n nativeDecimals: true,\n });\n\n if (!isApprovedEnough) {\n approvalTx = bundle.erc20Service.approveTxData({\n user,\n token: asset,\n spender,\n amount: amount_raw,\n });\n }\n\n return approvalTx;\n }\n\n private async supply(asset: string, amount: string, from: string): Promise<AAVEAction> {\n // validate\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n\n const bundle = this.getPoolBundle();\n\n const approvalTx = await this.createApproval({\n asset,\n amount_raw: amount,\n user: from,\n spender: bundle.poolAddress,\n });\n\n const tx = bundle.supplyTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount,\n onBehalfOf: from,\n });\n\n return (approvalTx ? [approvalTx] : []).concat([tx]);\n }\n\n private async repay(\n asset: string,\n amount_formatted: string,\n from: string,\n tokenDecimals: number,\n ): Promise<AAVEAction> {\n // validate\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n\n const bundle: PoolBundle = this.getPoolBundle();\n\n const amount = utils.parseUnits(amount_formatted, tokenDecimals).toString();\n\n const tx = bundle.repayTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount: amount,\n interestRateMode: InterestRate.Variable,\n onBehalfOf: from,\n });\n\n const approvalTx = await this.createApproval({\n asset,\n amount_raw: amount,\n user: from,\n spender: bundle.poolAddress,\n });\n\n return (approvalTx ? [approvalTx] : []).concat([tx]);\n }\n\n private repayWithATokens(\n asset: string,\n amount_formatted: string,\n from: string,\n tokenDecimals: number,\n ): Promise<AAVEAction> {\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n const bundle = this.getPoolBundle();\n const amount = utils.parseUnits(amount_formatted, tokenDecimals).toString();\n const tx = bundle.repayWithATokensTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount,\n rateMode: InterestRate.Variable,\n });\n return Promise.resolve([tx]);\n }\n\n private async withdraw(\n asset: string,\n amount: bigint,\n to: string,\n from: string,\n ): Promise<AAVEAction> {\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(to);\n ethers.utils.getAddress(from);\n\n const pool = this.getPoolContract();\n const txs = await pool.withdraw({\n user: from,\n reserve: asset,\n amount: amount.toString(),\n });\n\n if (txs.length !== 1) {\n throw new Error('AAVEInstance.withdraw: impossible happened');\n }\n\n // Null coercion is safe here because we checked txs.length above\n return [await populateTransaction(txs[0]!)];\n }\n}\n\nconst transactionPlanFromEthers = (\n chainId: string,\n tx: ethers.PopulatedTransaction,\n): TransactionPlan => {\n return {\n type: TransactionTypes.EVM_TX,\n to: tx.to!,\n value: tx.value?.toString() || '0',\n data: tx.data!,\n chainId,\n };\n};\n","import type { ChainConfig } from '../chainConfig.js';\nimport type { ActionDefinition, EmberPlugin, LendingActions } from '../core/index.js';\nimport type { PublicEmberPluginRegistry } from '../registry.js';\n\nimport { AAVEAdapter, type AAVEAdapterParams } from './adapter.js';\n\n/**\n * Get the AAVE Ember plugin.\n * @param params - Configuration parameters for the AAVEAdapter, including chainId and rpcUrl.\n * @returns The AAVE Ember plugin.\n */\nexport async function getAaveEmberPlugin(\n params: AAVEAdapterParams\n): Promise<EmberPlugin<'lending'>> {\n const adapter = new AAVEAdapter(params);\n\n return {\n id: `AAVE_CHAIN_${params.chainId}`,\n type: 'lending',\n name: `AAVE lending for ${params.chainId}`,\n description: 'Aave V3 lending protocol',\n website: 'https://aave.com',\n x: 'https://x.com/aave',\n actions: await getAaveActions(adapter),\n queries: {\n getPositions: adapter.getUserSummary.bind(adapter),\n },\n };\n}\n\n/**\n * Get the AAVE actions for the lending protocol.\n * @param adapter - An instance of AAVEAdapter to interact with the AAVE protocol.\n * @returns An array of action definitions for the AAVE lending protocol.\n */\nexport async function getAaveActions(\n adapter: AAVEAdapter\n): Promise<ActionDefinition<LendingActions>[]> {\n const reservesResponse = await adapter.getReserves();\n\n const underlyingAssets: string[] = reservesResponse.reservesData.map(\n reserve => reserve.underlyingAsset\n );\n const aTokens: string[] = reservesResponse.reservesData.map(reserve => reserve.aTokenAddress);\n const borrowableAssets = reservesResponse.reservesData\n .filter(reserve => reserve.borrowingEnabled)\n .map(reserve => reserve.underlyingAsset);\n\n return [\n // Supply any of the underlying assets to get aTokens\n {\n type: 'lending-supply',\n name: `AAVE lending pools in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: underlyingAssets,\n },\n ]),\n outputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n callback: adapter.createSupplyTransaction.bind(adapter),\n },\n\n // Borrow any of the borrowable assets if you have some alpha tokens as collateral\n {\n type: 'lending-borrow',\n name: `AAVE borrow in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n outputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: borrowableAssets,\n },\n ]),\n callback: adapter.createBorrowTransaction.bind(adapter),\n },\n\n // Repay your borrow with the underlying asset\n {\n type: 'lending-repay',\n name: `AAVE repay in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: borrowableAssets,\n },\n ]),\n // Empty output tokens as this doesn't generate any token\n outputTokens: async () => Promise.resolve([]),\n callback: adapter.createRepayTransaction.bind(adapter),\n },\n\n // Repay your borrow with aTokens\n {\n type: 'lending-repay',\n name: `AAVE repay with aTokens in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n // Empty output tokens as this doesn't generate any token\n outputTokens: async () => Promise.resolve([]),\n callback: adapter.createRepayTransactionWithATokens.bind(adapter),\n },\n\n // Withdraw from your aTokens to get the underlying asset back\n {\n type: 'lending-withdraw',\n name: `AAVE withdraw in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n outputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: underlyingAssets,\n },\n ]),\n callback: adapter.createWithdrawTransaction.bind(adapter),\n },\n ];\n}\n\n/**\n * Register the AAVE plugin for the specified chain configuration.\n * @param chainConfig - The chain configuration to check for AAVE support.\n * @param registry - The public Ember plugin registry to register the plugin with.\n * @returns A promise that resolves when the plugin is registered.\n */\nexport function registerAave(chainConfig: ChainConfig, registry: PublicEmberPluginRegistry) {\n const supportedChains = [42161];\n if (!supportedChains.includes(chainConfig.chainId)) {\n return;\n }\n\n registry.registerDeferredPlugin(\n getAaveEmberPlugin({\n chainId: chainConfig.chainId,\n rpcUrl: chainConfig.rpcUrl,\n wrappedNativeToken: chainConfig.wrappedNativeToken,\n })\n );\n}\n","import type { EmberPlugin, PluginType } from './core/index.js';\n\n/**\n * Registry for public Ember plugins.\n */\nexport class PublicEmberPluginRegistry {\n private plugins: EmberPlugin<PluginType>[] = [];\n private deferredPlugins: Promise<EmberPlugin<PluginType>>[] = [];\n\n /**\n * Register a new Ember plugin.\n * @param plugin The plugin to register.\n */\n public registerPlugin(plugin: EmberPlugin<PluginType>) {\n this.plugins.push(plugin);\n }\n\n /**\n * Register a new deferred Ember plugin.\n * @param pluginPromise The promise resolving to the plugin to register.\n */\n public registerDeferredPlugin(pluginPromise: Promise<EmberPlugin<PluginType>>) {\n this.deferredPlugins.push(pluginPromise);\n }\n\n /**\n * Iterator for the registered Ember plugins.\n */\n public async *getPlugins(): AsyncIterable<EmberPlugin<PluginType>> {\n yield* this.plugins;\n\n for (const pluginPromise of this.deferredPlugins) {\n const plugin = await pluginPromise;\n\n // Register the plugin now that it is resolved\n this.registerPlugin(plugin);\n\n yield plugin;\n }\n\n this.deferredPlugins = [];\n }\n\n public get emberPlugins(): EmberPlugin<PluginType>[] {\n return this.plugins;\n }\n}\n","import { registerAave } from './aave-lending-plugin/index.js';\nimport type { ChainConfig } from './chainConfig.js';\nimport { PublicEmberPluginRegistry } from './registry.js';\n\n/**\n * Initialize the public Ember plugin registry.\n * @returns The initialized public Ember plugin registry with registered plugins.\n */\nexport function initializePublicRegistry(chainConfigs: ChainConfig[]) {\n const registry = new PublicEmberPluginRegistry();\n\n // Register any plugin in here\n for (const chainConfig of chainConfigs) {\n // Create aave plugins for each chain config\n registerAave(chainConfig, registry);\n }\n\n return registry;\n}\n\nexport { type ChainConfig, PublicEmberPluginRegistry };\nexport * from './core/index.js';\n"],"mappings":";;;;;;;AAEA,MAAa,kBAAkB,EAAE,KAAK;CAAC;CAAe;CAAO;CAAU;CAAS,CAAC;AAIjF,MAAa,mBAAmB;CAC9B,8BAA8B;CAC9B,QAAQ;CACR,WAAW;CACZ;AAED,MAAa,wBAAwB,EAAE,KACrC,OAAO,OAAO,iBAAiB,CAChC;;;;ACVD,MAAa,wBAAwB,EAAE,OAAO;CAC5C,SAAS,EAAE,QAAQ;CACnB,SAAS,EAAE,QAAQ;CACpB,CAAC;AAGF,MAAa,cAAc,EAAE,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AG,UAAU;IACpC,QAAQ;IACT,CACF,CAAC;GACJ,UAAU,QAAQ,0BAA0B,KAAK,QAAQ;GAC1D;EACF;;;;;;;;AASH,SAAgB,aAAa,aAA0B,UAAqC;AAE1F,KAAI,CADoB,CAAC,MAAM,CACV,SAAS,YAAY,QAAQ,CAChD;AAGF,UAAS,uBACP,mBAAmB;EACjB,SAAS,YAAY;EACrB,QAAQ,YAAY;EACpB,oBAAoB,YAAY;EACjC,CAAC,CACH;;;;;;;;AC/JH,IAAa,4BAAb,MAAuC;CACrC,AAAQ,UAAqC,EAAE;CAC/C,AAAQ,kBAAsD,EAAE;;;;;CAMhE,AAAO,eAAe,QAAiC;AACrD,OAAK,QAAQ,KAAK,OAAO;;;;;;CAO3B,AAAO,uBAAuB,eAAiD;AAC7E,OAAK,gBAAgB,KAAK,cAAc;;;;;CAM1C,OAAc,aAAqD;AACjE,SAAO,KAAK;AAEZ,OAAK,MAAM,iBAAiB,KAAK,iBAAiB;GAChD,MAAM,SAAS,MAAM;AAGrB,QAAK,eAAe,OAAO;AAE3B,SAAM;;AAGR,OAAK,kBAAkB,EAAE;;CAG3B,IAAW,eAA0C;AACnD,SAAO,KAAK;;;;;;;;;;ACpChB,SAAgB,yBAAyB,cAA6B;CACpE,MAAM,WAAW,IAAI,2BAA2B;AAGhD,MAAK,MAAM,eAAe,aAExB,cAAa,aAAa,SAAS;AAGrC,QAAO"}
1
+ {"version":3,"file":"index.mjs","names":["id: number","rpcUrl: string","wrappedNativeTokenAddress?: string","UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN: Record<\n number,\n IUiPoolDataProviderConstructor\n>","marketMap: Record<number, keyof typeof markets>","AAVE_ERROR_CODES: Record<string, AaveErrorData>","txData: PopulatedTransaction | null","reserveLiquidationThreshold: string | null","totalBorrowsUSD","bundle: PoolBundle","underlyingAssets: string[]","aTokens: string[]","pagination.PaginatedPossibleResultsRequestSchema","pagination.PaginatedPossibleResultsResponseSchema","swap.AmountTypeSchema","swap.CreateSwapRequestSchema","swap.PromptSwapRequestSchema","swap.PossibleSwapsRequestSchema","swap.PossibleSwapOptionSchema","swap.PossibleSwapsResponseSchema","swap.CreateSwapEndpointRequestSchema","lending.CreateLendingSupplyRequestSchema","lending.PromptLendingSupplyRequestSchema","lending.PossibleLendingSupplyRequestSchema","lending.PossibleLendingSupplyOptionSchema","lending.PossibleLendingSupplyResponseSchema","lending.CreateSupplyEndpointRequestSchema","lending.CreateLendingBorrowRequestSchema","lending.PromptLendingBorrowRequestSchema","lending.PossibleLendingBorrowRequestSchema","lending.PossibleLendingBorrowOptionSchema","lending.PossibleLendingBorrowResponseSchema","lending.CreateBorrowEndpointRequestSchema","lending.CreateLendingRepayRequestSchema","lending.PromptLendingRepayRequestSchema","lending.PossibleLendingRepayRequestSchema","lending.PossibleLendingRepayOptionSchema","lending.PossibleLendingRepayResponseSchema","lending.CreateRepayEndpointRequestSchema","lending.CreateLendingWithdrawRequestSchema","lending.PromptLendingWithdrawRequestSchema","lending.PossibleLendingWithdrawRequestSchema","lending.PossibleLendingWithdrawOptionSchema","lending.PossibleLendingWithdrawResponseSchema","lending.CreateWithdrawEndpointRequestSchema","liquidity.NonMappedPayableTokens","liquidity.CreateLiquiditySupplyRequestSchema","liquidity.CreateLiquiditySupplyPayableTokenSchema","liquidity.CreateLiquiditySupplyEndpointRequestSchema","liquidity.CreateLiquidityWithdrawRequestSchema","liquidity.PromptLiquidityWithdrawRequestSchema","liquidity.PossibleLiquidityWithdrawRequestSchema","liquidity.LiquidityWithdrawOptionSchema","liquidity.PossibleLiquidityWithdrawResponseSchema","liquidity.CreateLiquidityWithdrawEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldBuyPtEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldBuyPtResponseSchema","tokenizedYield.CreateTokenizedYieldBuyPtSchema","tokenizedYield.PromptTokenizedYieldBuyPtRequestSchema","tokenizedYield.CreateTokenizedYieldBuyYtEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldBuyYtResponseSchema","tokenizedYield.CreateTokenizedYieldBuyYtSchema","tokenizedYield.PromptTokenizedYieldBuyYtRequestSchema","tokenizedYield.CreateTokenizedYieldSellPtEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldSellPtResponseSchema","tokenizedYield.CreateTokenizedYieldSellPtSchema","tokenizedYield.PromptTokenizedYieldSellPtRequestSchema","tokenizedYield.CreateTokenizedYieldSellYtEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldSellYtResponseSchema","tokenizedYield.CreateTokenizedYieldSellYtSchema","tokenizedYield.PromptTokenizedYieldSellYtRequestSchema","tokenizedYield.CreateTokenizedYieldMintPtAndYtEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldMintPtAndYtResponseSchema","tokenizedYield.CreateTokenizedYieldMintPtAndYtSchema","tokenizedYield.PromptTokenizedYieldMintPtAndYtRequestSchema","tokenizedYield.CreateTokenizedYieldRedeemPtEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldRedeemPtResponseSchema","tokenizedYield.CreateTokenizedYieldRedeemPtSchema","tokenizedYield.PromptTokenizedYieldRedeemPtRequestSchema","tokenizedYield.CreateTokenizedYieldClaimRewardsEndpointRequestSchema","tokenizedYield.CreateTokenizedYieldClaimRewardsResponseSchema","tokenizedYield.CreateTokenizedYieldClaimRewardsSchema","tokenizedYield.PromptTokenizedYieldClaimRewardsRequestSchema","perpetuals.PerpetualsCreatePositionRequestSchema","perpetuals.PerpetualsPositionPromptSchema","perpetuals.PossiblePerpetualPositionsRequestSchema","perpetuals.PossiblePerpetualPositionsOptionSchema","perpetuals.PossiblePerpetualPositionsResponseSchema","perpetuals.CreatePerpetualClosePositionRequestSchema","perpetuals.PerpetualsCloseOrderPromptSchema","perpetuals.PossiblePerpetualCloseRequestSchema","perpetuals.PositionDataSchema","perpetuals.LimitOrderDataSchema","perpetuals.TradingPositionDataSchema","perpetuals.PerpetualCloseOptionSchema","perpetuals.PossiblePerpetualCloseResponseSchema","perpetuals.CreatePerpetualCloseSimplifiedEndpointRequestSchema","queries.GetChainsRequestSchema","queries.GetChainsResponseSchema","queries.GetTokensRequestSchema","queries.GetTokensResponseSchema","queries.ProviderSchema","queries.GetProvidersRequestSchema","queries.GetProvidersResponseSchema","queries.BalanceSchema","queries.GetWalletBalancesRequestSchema","queries.GetWalletBalancesResponseSchema"],"sources":["../src/core/schemas/enums.ts","../src/core/schemas/core.ts","../src/core/schemas/lending.ts","../src/core/schemas/liquidity.ts","../src/core/schemas/perpetuals.ts","../src/core/schemas/swap.ts","../src/core/schemas/tokenizedYield.ts","../src/core/index.ts","../src/aave-lending-plugin/chain.ts","../src/aave-lending-plugin/dataProvider.ts","../src/aave-lending-plugin/market.ts","../src/aave-lending-plugin/errors.ts","../src/aave-lending-plugin/populateTransaction.ts","../src/aave-lending-plugin/userSummary.ts","../src/aave-lending-plugin/adapter.ts","../src/aave-lending-plugin/index.ts","../src/registry.ts","../src/endpoint-interfaces/pagination.ts","../src/endpoint-interfaces/lending.ts","../src/endpoint-interfaces/liquidity.ts","../src/endpoint-interfaces/perpetuals.ts","../src/endpoint-interfaces/queries.ts","../src/endpoint-interfaces/swap.ts","../src/endpoint-interfaces/tokenizedYield.ts","../src/endpoint-interfaces/index.ts","../src/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const ChainTypeSchema = z.enum(['UNSPECIFIED', 'EVM', 'SOLANA', 'COSMOS']);\nexport type ChainType = z.infer<typeof ChainTypeSchema>;\n\n// TransactionType\nexport const TransactionTypes = {\n TRANSACTION_TYPE_UNSPECIFIED: 'TRANSACTION_TYPE_UNSPECIFIED' as const,\n EVM_TX: 'EVM_TX' as const,\n SOLANA_TX: 'SOLANA_TX' as const,\n} as const;\n\nexport const TransactionTypeSchema = z.enum(\n Object.values(TransactionTypes) as [string, ...string[]]\n);\nexport type TransactionType = keyof typeof TransactionTypes;\n","import { z } from 'zod';\n\nimport { ChainTypeSchema, TransactionTypeSchema } from './enums.js';\n\nexport const TokenIdentifierSchema = z.object({\n chainId: z.string(),\n address: z.string(),\n});\nexport type TokenIdentifier = z.infer<typeof TokenIdentifierSchema>;\n\nexport const TokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n name: z.string(),\n symbol: z.string(),\n isNative: z.boolean(),\n decimals: z.number().int(),\n iconUri: z.string().nullish(),\n isVetted: z.boolean(),\n});\nexport type Token = z.infer<typeof TokenSchema>;\n\nexport const ChainSchema = z.object({\n chainId: z.string(),\n type: ChainTypeSchema,\n iconUri: z.string(),\n nativeToken: TokenSchema,\n httpRpcUrl: z.string(),\n name: z.string(),\n blockExplorerUrls: z.array(z.string()),\n});\nexport type Chain = z.infer<typeof ChainSchema>;\n\nexport const FeeBreakdownSchema = z.object({\n serviceFee: z.string(),\n slippageCost: z.string(),\n total: z.string(),\n feeDenomination: z.string(),\n});\nexport type FeeBreakdown = z.infer<typeof FeeBreakdownSchema>;\n\nexport const TransactionPlanSchema = z.object({\n type: TransactionTypeSchema,\n to: z.string(),\n data: z.string(),\n value: z.string(),\n chainId: z.string(),\n});\nexport type TransactionPlan = z.infer<typeof TransactionPlanSchema>;\n\nexport const TransactionPlanErrorSchema = z.object({\n code: z.string(),\n message: z.string(),\n details: z.record(z.string(), z.string()),\n});\nexport type TransactionPlanError = z.infer<typeof TransactionPlanErrorSchema>;\n\nexport const ProviderTrackingInfoSchema = z.object({\n requestId: z.string(),\n providerName: z.string(),\n explorerUrl: z.string(),\n});\nexport type ProviderTrackingInfo = z.infer<typeof ProviderTrackingInfoSchema>;\n\nexport const SwapEstimationSchema = z.object({\n effectivePrice: z.string(),\n timeEstimate: z.string(),\n expiration: z.string(),\n});\nexport type SwapEstimation = z.infer<typeof SwapEstimationSchema>;\n\nexport const ProviderTrackingStatusSchema = z.object({\n requestId: z.string(),\n transactionId: z.string(),\n providerName: z.string(),\n explorerUrl: z.string(),\n status: z.string(),\n});\nexport type ProviderTrackingStatus = z.infer<typeof ProviderTrackingStatusSchema>;\n","import { z } from 'zod';\n\nimport {\n FeeBreakdownSchema,\n TransactionPlanSchema,\n TokenSchema,\n TokenIdentifierSchema,\n} from './core.js';\n\nexport const BorrowTokensRequestSchema = z.object({\n borrowToken: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type BorrowTokensRequest = z.infer<typeof BorrowTokensRequestSchema>;\n\nexport const BorrowTokensResponseSchema = z.object({\n currentBorrowApy: z.string(),\n liquidationThreshold: z.string(),\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type BorrowTokensResponse = z.infer<typeof BorrowTokensResponseSchema>;\n\nexport const RepayTokensRequestSchema = z.object({\n repayToken: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type RepayTokensRequest = z.infer<typeof RepayTokensRequestSchema>;\n\nexport const RepayTokensResponseSchema = z.object({\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type RepayTokensResponse = z.infer<typeof RepayTokensResponseSchema>;\n\nexport const SupplyTokensRequestSchema = z.object({\n supplyToken: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type SupplyTokensRequest = z.infer<typeof SupplyTokensRequestSchema>;\n\nexport const SupplyTokensResponseSchema = z.object({\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type SupplyTokensResponse = z.infer<typeof SupplyTokensResponseSchema>;\n\nexport const WithdrawTokensRequestSchema = z.object({\n tokenToWithdraw: TokenSchema,\n amount: z.bigint(),\n walletAddress: z.string(),\n});\nexport type WithdrawTokensRequest = z.infer<typeof WithdrawTokensRequestSchema>;\n\nexport const WithdrawTokensResponseSchema = z.object({\n feeBreakdown: FeeBreakdownSchema.optional(),\n transactions: z.array(TransactionPlanSchema),\n});\nexport type WithdrawTokensResponse = z.infer<typeof WithdrawTokensResponseSchema>;\n\nexport const GetWalletLendingPositionsRequestSchema = z.object({\n walletAddress: z.string(),\n chainId: z.string().optional(),\n tokenAddress: z.string().optional(),\n});\nexport type GetWalletLendingPositionsRequest = z.infer<\n typeof GetWalletLendingPositionsRequestSchema\n>;\n\nexport const LendTokenDetailSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n underlyingBalance: z.string(),\n underlyingBalanceUsd: z.string(),\n variableBorrows: z.string(),\n variableBorrowsUsd: z.string(),\n totalBorrows: z.string(),\n totalBorrowsUsd: z.string(),\n});\nexport type LendTokenDetail = z.infer<typeof LendTokenDetailSchema>;\n\nexport const GetWalletLendingPositionsResponseSchema = z.object({\n userReserves: z.array(LendTokenDetailSchema),\n totalLiquidityUsd: z.string(),\n totalCollateralUsd: z.string(),\n totalBorrowsUsd: z.string(),\n netWorthUsd: z.string(),\n availableBorrowsUsd: z.string(),\n currentLoanToValue: z.string(),\n currentLiquidationThreshold: z.string(),\n healthFactor: z.string(),\n});\nexport type GetWalletLendingPositionsResponse = z.infer<\n typeof GetWalletLendingPositionsResponseSchema\n>;\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema, TokenSchema, TransactionPlanSchema } from './core.js';\n\nexport const LiquidityProvisionRangeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('full'),\n }),\n z.object({\n type: z.literal('limited'),\n minPrice: z.string(),\n maxPrice: z.string(),\n }),\n]);\nexport type LiquidityProvisionRange = z.infer<typeof LiquidityProvisionRangeSchema>;\n\nexport const LiquidityPositionRangeSchema = z.object({\n fromPrice: z.string(),\n toPrice: z.string(),\n});\nexport type LiquidityPositionRange = z.infer<typeof LiquidityPositionRangeSchema>;\n\nexport const LiquidityRewardsOwedTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n amount: z.string(),\n usdPrice: z.string().optional(),\n valueUsd: z.string().optional(),\n source: z.string(),\n});\nexport type LiquidityRewardsOwedToken = z.infer<typeof LiquidityRewardsOwedTokenSchema>;\n\nexport const LiquidityPooledTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n name: z.string(),\n symbol: z.string(),\n decimals: z.number().int(),\n amount: z.string(),\n usdPrice: z.string().optional(),\n valueUsd: z.string().optional(),\n});\nexport type LiquidityPooledToken = z.infer<typeof LiquidityPooledTokenSchema>;\n\nexport const LiquidityFeesOwedTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n name: z.string(),\n symbol: z.string(),\n decimals: z.number().int(),\n amount: z.string(),\n usdPrice: z.string().optional(),\n valueUsd: z.string().optional(),\n});\nexport type LiquidityFeesOwedToken = z.infer<typeof LiquidityFeesOwedTokenSchema>;\n\nexport const LiquidityPositionSchema = z.object({\n positionId: z.string(),\n poolIdentifier: TokenIdentifierSchema,\n operator: z.string(),\n pooledTokens: z.array(LiquidityPooledTokenSchema),\n feesOwedTokens: z.array(LiquidityFeesOwedTokenSchema),\n rewardsOwedTokens: z.array(LiquidityRewardsOwedTokenSchema),\n feesValueUsd: z.string().optional(),\n rewardsValueUsd: z.string().optional(),\n positionValueUsd: z.string().optional(),\n currentPrice: z.string().optional(),\n currentTick: z.number().int().optional(),\n tickLower: z.number().int().optional(),\n tickUpper: z.number().int().optional(),\n inRange: z.boolean().optional(),\n apr: z.string().optional(),\n apy: z.string().optional(),\n poolFeeBps: z.number().int().optional(),\n providerId: z.string(),\n positionRange: LiquidityPositionRangeSchema.optional(),\n});\nexport type LiquidityPosition = z.infer<typeof LiquidityPositionSchema>;\n\nexport const LiquidityPoolTokens = z.object({\n tokenUid: TokenIdentifierSchema,\n});\nexport type LiquidityPoolTokens = z.infer<typeof LiquidityPoolTokens>;\n\nexport const LiquidityPoolSchema = z.object({\n identifier: TokenIdentifierSchema,\n tokens: z.array(LiquidityPoolTokens),\n currentPrice: z.string(),\n providerId: z.string(),\n feeTierBps: z.number().int().optional(),\n liquidity: z.string().optional(),\n tvlUsd: z.string().optional(),\n volume24hUsd: z.string().optional(),\n tickSpacing: z.number().int().optional(),\n});\nexport type LiquidityPool = z.infer<typeof LiquidityPoolSchema>;\n\nexport const LiquidityPayTokensSchema = z.object({\n token: TokenSchema,\n supplyAmount: z.bigint(),\n});\nexport type LiquidityPayTokens = z.infer<typeof LiquidityPayTokensSchema>;\n\nexport const SupplyLiquidityRequestSchema = z.object({\n walletAddress: z.string(),\n poolToken: TokenSchema,\n payTokens: z.array(LiquidityPayTokensSchema),\n range: LiquidityProvisionRangeSchema.optional(),\n});\nexport type SupplyLiquidityRequest = z.infer<typeof SupplyLiquidityRequestSchema>;\n\nexport const SupplyLiquidityResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n poolIdentifier: TokenIdentifierSchema,\n});\nexport type SupplyLiquidityResponse = z.infer<typeof SupplyLiquidityResponseSchema>;\n\nexport const WithdrawLiquidityRequestSchema = z.object({\n poolToken: TokenSchema,\n walletAddress: z.string(),\n});\nexport type WithdrawLiquidityRequest = z.infer<typeof WithdrawLiquidityRequestSchema>;\n\nexport const WithdrawLiquidityResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n chainId: z.string(),\n});\nexport type WithdrawLiquidityResponse = z.infer<typeof WithdrawLiquidityResponseSchema>;\n\nexport const GetWalletLiquidityPositionsRequestSchema = z.object({\n walletAddress: z.string(),\n includePrices: z.boolean().optional(),\n positionIds: z.array(z.string()).optional(),\n});\nexport type GetWalletLiquidityPositionsRequest = z.infer<\n typeof GetWalletLiquidityPositionsRequestSchema\n>;\n\nexport const GetWalletLiquidityPositionsResponseSchema = z.object({\n positions: z.array(LiquidityPositionSchema),\n});\nexport type GetWalletLiquidityPositionsResponse = z.infer<\n typeof GetWalletLiquidityPositionsResponseSchema\n>;\n\nexport const GetLiquidityPoolsResponseSchema = z.object({\n liquidityPools: z.array(LiquidityPoolSchema),\n});\nexport type GetLiquidityPoolsResponse = z.infer<typeof GetLiquidityPoolsResponseSchema>;\n","import { z } from 'zod';\n\nimport { TransactionPlanSchema, TokenIdentifierSchema } from './core.js';\n\n// Enums\nexport const DecreasePositionSwapTypeSchema = z.enum([\n 'NoSwap',\n 'SwapPnlTokenToCollateralToken',\n 'SwapCollateralTokenToPnlToken',\n]);\nexport type DecreasePositionSwapType = z.infer<typeof DecreasePositionSwapTypeSchema>;\n\nexport const PositionSideSchema = z.enum(['long', 'short']);\n\nexport type PositionSide = z.infer<typeof PositionSideSchema>;\n\n// API Schemas and types\nexport const PositionSchema = z.object({\n chainId: z.string(),\n key: z.string(),\n contractKey: z.string(),\n account: z.string(),\n marketAddress: z.string(),\n collateralTokenAddress: z.string(),\n sizeInUsd: z.string(),\n sizeInTokens: z.string(),\n collateralAmount: z.string(),\n pendingBorrowingFeesUsd: z.string(),\n increasedAtTime: z.string(),\n decreasedAtTime: z.string(),\n positionSide: PositionSideSchema,\n isLong: z.boolean(),\n fundingFeeAmount: z.string(),\n claimableLongTokenAmount: z.string(),\n claimableShortTokenAmount: z.string(),\n isOpening: z.boolean().optional(),\n pnl: z.string(),\n positionFeeAmount: z.string(),\n traderDiscountAmount: z.string(),\n uiFeeAmount: z.string(),\n data: z.string().optional(),\n});\n\nexport type PerpetualsPosition = z.infer<typeof PositionSchema>;\n\nexport const PositionsDataSchema = z.array(PositionSchema);\n\nexport const OrderTypeSchema = z.enum([\n 'MarketSwap',\n 'LimitSwap',\n 'MarketIncrease',\n 'LimitIncrease',\n 'MarketDecrease',\n 'LimitDecrease',\n 'StopLossDecrease',\n 'Liquidation',\n 'StopIncrease',\n]);\nexport type OrderType = z.infer<typeof OrderTypeSchema>;\n\n// Order Schema\nexport const OrderSchema = z.object({\n chainId: z.string(),\n key: z.string(),\n account: z.string(),\n callbackContract: z.string(),\n initialCollateralTokenAddress: z.string(),\n marketAddress: z.string(),\n decreasePositionSwapType: DecreasePositionSwapTypeSchema,\n receiver: z.string(),\n swapPath: z.array(z.string()),\n contractAcceptablePrice: z.string(),\n contractTriggerPrice: z.string(),\n callbackGasLimit: z.string(),\n executionFee: z.string(),\n initialCollateralDeltaAmount: z.string(),\n minOutputAmount: z.string(),\n sizeDeltaUsd: z.string(),\n updatedAtTime: z.string(),\n isFrozen: z.boolean(),\n positionSide: PositionSideSchema,\n orderType: OrderTypeSchema,\n shouldUnwrapNativeToken: z.boolean(),\n autoCancel: z.boolean(),\n data: z.string().optional(),\n uiFeeReceiver: z.string(),\n validFromTime: z.string(),\n title: z.string().optional(),\n});\n\nexport type PerpetualsOrder = z.infer<typeof OrderSchema>;\n\nexport const OrdersDataSchema = z.array(OrderSchema);\n\n// Definition for plugin with mapped entities already in place\nexport const CreatePerpetualsPositionRequestSchema = z.object({\n amount: z.bigint(),\n walletAddress: z.string(),\n chainId: z.string(),\n marketAddress: z.string(),\n payTokenAddress: z.string(),\n collateralTokenAddress: z.string(),\n referralCode: z.string().optional(),\n limitPrice: z.string().optional(),\n leverage: z.string(),\n});\n\nexport type CreatePerpetualsPositionRequest = z.infer<typeof CreatePerpetualsPositionRequestSchema>;\n\nexport const CreatePerpetualsPositionResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n});\nexport type CreatePerpetualsPositionResponse = z.infer<\n typeof CreatePerpetualsPositionResponseSchema\n>;\n\nexport const GetPerpetualsMarketsPositionsRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n});\n\nexport type GetPerpetualsMarketsPositionsRequest = z.infer<\n typeof GetPerpetualsMarketsPositionsRequestSchema\n>;\n\nexport const GetPerpetualsMarketsPositionsResponseSchema = z.object({\n positions: PositionsDataSchema,\n});\n\nexport type GetPerpetualsMarketsPositionsResponse = z.infer<\n typeof GetPerpetualsMarketsPositionsResponseSchema\n>;\n\nexport const GetPerpetualsMarketsOrdersRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n});\n\nexport type GetPerpetualsMarketsOrdersRequest = z.infer<\n typeof GetPerpetualsMarketsOrdersRequestSchema\n>;\n\nexport const GetPerpetualsMarketsOrdersResponseSchema = z.object({\n orders: OrdersDataSchema,\n});\n\nexport type GetPerpetualsMarketsOrdersResponse = z.infer<\n typeof GetPerpetualsMarketsOrdersResponseSchema\n>;\n\nexport const ClosePerpetualsOrdersRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n key: z.string(),\n});\n\nexport type ClosePerpetualsOrdersRequest = z.infer<typeof ClosePerpetualsOrdersRequestSchema>;\n\nexport const ClosePerpetualsOrdersResponseSchema = z.object({\n transactions: z.array(TransactionPlanSchema),\n});\n\nexport type ClosePerpetualsOrdersResponse = z.infer<typeof ClosePerpetualsOrdersResponseSchema>;\n\nexport const GetPerpetualsMarketsRequestSchema = z.object({\n chainIds: z.array(z.string()),\n});\n\nexport type GetPerpetualsMarketsRequest = z.infer<typeof GetPerpetualsMarketsRequestSchema>;\n\nexport const PerpetualMarketSchema = z.object({\n marketToken: TokenIdentifierSchema,\n indexToken: TokenIdentifierSchema,\n longToken: TokenIdentifierSchema,\n shortToken: TokenIdentifierSchema,\n longFundingFee: z.string(),\n shortFundingFee: z.string(),\n longBorrowingFee: z.string(),\n shortBorrowingFee: z.string(),\n chainId: z.string(),\n name: z.string(),\n});\n\nexport type PerpetualMarket = z.infer<typeof PerpetualMarketSchema>;\n\nexport const GetPerpetualsMarketsResponseSchema = z.object({\n markets: z.array(PerpetualMarketSchema),\n});\n\nexport type GetPerpetualsMarketsResponse = z.infer<typeof GetPerpetualsMarketsResponseSchema>;\n","import { z } from 'zod';\n\nimport {\n FeeBreakdownSchema,\n TransactionPlanSchema,\n SwapEstimationSchema,\n ProviderTrackingInfoSchema,\n TokenSchema,\n} from './core.js';\n\nexport const SwapTokensRequestSchema = z.object({\n fromToken: TokenSchema,\n toToken: TokenSchema,\n amount: z.bigint(),\n limitPrice: z.string().optional(),\n slippageTolerance: z.string().optional(),\n expiration: z.string().optional(),\n recipient: z.string(),\n});\nexport type SwapTokensRequest = z.infer<typeof SwapTokensRequestSchema>;\n\nexport const SwapTokensResponseSchema = z.object({\n fromToken: TokenSchema,\n toToken: TokenSchema,\n exactFromAmount: z.string(),\n displayFromAmount: z.string(),\n exactToAmount: z.string(),\n displayToAmount: z.string(),\n transactions: z.array(TransactionPlanSchema),\n feeBreakdown: FeeBreakdownSchema.optional(),\n estimation: SwapEstimationSchema.optional(),\n providerTracking: ProviderTrackingInfoSchema.optional(),\n});\nexport type SwapTokensResponse = z.infer<typeof SwapTokensResponseSchema>;\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema, TokenSchema, TransactionPlanSchema } from './core.js';\n\nexport const MintPtAndYtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n inputToken: TokenSchema.describe('Token to be used for minting PT and YT'),\n amount: z.bigint().describe('Amount of input token to be used for minting'),\n marketAddress: z.string().describe('Address of the yield market'),\n});\nexport type MintPtAndYtRequest = z.infer<typeof MintPtAndYtRequestSchema>;\n\nexport const MintPtAndYtResponseSchema = z.object({\n exactPtAmount: z.string().describe('Amount of Principal Tokens (PT) minted'),\n ptTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Principal Token (PT)'),\n exactYtAmount: z.string().describe('Amount of Yield Tokens (YT) minted'),\n ytTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Yield Token (YT)'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the minting process'),\n});\nexport type MintPtAndYtResponse = z.infer<typeof MintPtAndYtResponseSchema>;\n\nexport const BuyPtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n inputToken: TokenSchema.describe('Token to be used for minting PT and YT'),\n amount: z.bigint().describe('Amount of input token to be used for minting'),\n marketAddress: z.string().describe('Address of the yield market'),\n});\nexport type BuyPtRequest = z.infer<typeof BuyPtRequestSchema>;\n\nexport const BuyPtResponseSchema = z.object({\n exactPtAmount: z.string().describe('Amount of Principal Tokens (PT) minted'),\n ptTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Principal Token (PT)'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the minting process'),\n});\nexport type BuyPtResponse = z.infer<typeof BuyPtResponseSchema>;\n\nexport const BuyYtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n inputToken: TokenSchema.describe('Token to be used for minting PT and YT'),\n amount: z.bigint().describe('Amount of input token to be used for minting'),\n marketAddress: z.string().describe('Address of the yield market'),\n});\nexport type BuyYtRequest = z.infer<typeof BuyYtRequestSchema>;\n\nexport const BuyYtResponseSchema = z.object({\n exactYtAmount: z.string().describe('Amount of Yield Tokens (YT) minted'),\n ytTokenIdentifier: TokenIdentifierSchema.describe('Details of the minted Yield Token (YT)'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the minting process'),\n});\nexport type BuyYtResponse = z.infer<typeof BuyYtResponseSchema>;\n\nexport const SellPtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n ptToken: TokenSchema.describe('Principal Token (PT) to be sold'),\n amount: z.bigint().describe('Amount of Principal Token (PT) to be sold'),\n});\nexport type SellPtRequest = z.infer<typeof SellPtRequestSchema>;\n\nexport const SellPtResponseSchema = z.object({\n tokenOutIdentifier: TokenIdentifierSchema.describe(\n 'Details of the token received from selling PT',\n ),\n exactAmountOut: z.string().describe('Exact amount of token received from selling PT'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the selling process'),\n});\nexport type SellPtResponse = z.infer<typeof SellPtResponseSchema>;\n\nexport const SellYtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n slippage: z\n .string()\n .describe('Maximum acceptable slippage percentage as a decimal string')\n .default('0.01'),\n ytToken: TokenSchema.describe('Yield Token (YT) to be sold'),\n amount: z.bigint().describe('Amount of Yield Token (YT) to be sold'),\n});\nexport type SellYtRequest = z.infer<typeof SellYtRequestSchema>;\n\nexport const SellYtResponseSchema = z.object({\n tokenOutIdentifier: TokenIdentifierSchema.describe(\n 'Details of the token received from selling YT',\n ),\n exactAmountOut: z.string().describe('Exact amount of token received from selling YT'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the selling process'),\n});\nexport type SellYtResponse = z.infer<typeof SellYtResponseSchema>;\n\nexport const RedeemPtRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n ptToken: TokenSchema.describe('Principal Token (PT) to be redeemed'),\n amount: z.bigint().describe('Amount of Principal Token (PT) to be redeemed'),\n});\nexport type RedeemPtRequest = z.infer<typeof RedeemPtRequestSchema>;\n\nexport const RedeemPtResponseSchema = z.object({\n underlyingTokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the underlying token received upon redemption',\n ),\n exactUnderlyingAmount: z.string().describe('Exact amount of underlying token received'),\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the redemption process'),\n});\nexport type RedeemPtResponse = z.infer<typeof RedeemPtResponseSchema>;\n\nexport const ClaimRewardsRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n ytToken: TokenSchema.describe('Yield Token (YT) for which to claim rewards'),\n});\nexport type ClaimRewardsRequest = z.infer<typeof ClaimRewardsRequestSchema>;\n\nexport const ClaimRewardsResponseSchema = z.object({\n transactions: z\n .array(TransactionPlanSchema)\n .describe('Array of transaction plans required to complete the reward claiming process'),\n});\nexport type ClaimRewardsResponse = z.infer<typeof ClaimRewardsResponseSchema>;\n\nexport const MarketTokenizedYieldRequestSchema = z.object({\n chainIds: z\n .array(z.string().describe('Blockchain network identifier'))\n .describe('List of chain IDs to filter the markets'),\n});\nexport type MarketTokenizedYieldRequest = z.infer<typeof MarketTokenizedYieldRequestSchema>;\n\nexport const TokenizedYieldMarketSchema = z.object({\n marketIdentifier: TokenIdentifierSchema.describe('Unique identifier for the yield market'),\n ptTokenIdentifier: TokenIdentifierSchema.describe('Details of the Principal Token (PT)'),\n ytTokenIdentifier: TokenIdentifierSchema.describe('Details of the Yield Token (YT)'),\n underlyingTokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the underlying asset token',\n ),\n expiry: z.string().describe('Expiry date of the yield market in ISO 8601 format'),\n details: z.object({}),\n});\nexport type TokenizedYieldMarket = z.infer<typeof TokenizedYieldMarketSchema>;\n\nexport const MarketTokenizedYieldResponseSchema = z.object({\n markets: z\n .array(TokenizedYieldMarketSchema)\n .describe('Array of tokenized yield markets matching the request criteria'),\n});\nexport type MarketTokenizedYieldResponse = z.infer<typeof MarketTokenizedYieldResponseSchema>;\n\nexport const TokenizedYieldUserPositionSchema = z.object({\n marketIdentifier: TokenIdentifierSchema.describe('Unique identifier for the yield market'),\n pt: z.object({\n tokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the Principal Token (PT) held by the user',\n ),\n exactAmount: z.string().describe('Exact amount of Principal Token (PT) held'),\n }),\n yt: z.object({\n tokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the Yield Token (YT) held by the user',\n ),\n exactAmount: z.string().describe('Exact amount of Yield Token (YT) held'),\n claimableRewards: z.array(\n z.object({\n tokenIdentifier: TokenIdentifierSchema.describe(\n 'Details of the reward token claimable by the user',\n ),\n exactAmount: z.string().describe('Exact amount of reward token claimable'),\n }),\n ),\n }),\n});\nexport type TokenizedYieldUserPosition = z.infer<typeof TokenizedYieldUserPositionSchema>;\n\nexport const TokenizedYieldUserPositionsRequestSchema = z.object({\n walletAddress: z.string().describe(\"User's wallet address\"),\n chainIds: z\n .array(z.string().describe('Blockchain network identifier'))\n .describe('List of chain IDs to filter the user positions'),\n});\nexport type TokenizedYieldUserPositionsRequest = z.infer<\n typeof TokenizedYieldUserPositionsRequestSchema\n>;\n\nexport const TokenizedYieldUserPositionsResponseSchema = z.object({\n positions: z\n .array(TokenizedYieldUserPositionSchema)\n .describe('Array of user positions in tokenized yield markets'),\n});\nexport type TokenizedYieldUserPositionsResponse = z.infer<\n typeof TokenizedYieldUserPositionsResponseSchema\n>;\n","import type { ActionDefinition } from './actions/index.js';\nimport type { AvailableActions, AvailableQueries, PluginType } from './pluginType.js';\n\nexport interface EmberPlugin<Type extends PluginType> {\n /**\n * The unique identifier for the plugin.\n */\n id: string;\n /**\n * The type of the plugin, which determines the actions and queries it supports.\n */\n type: Type;\n /**\n * The possible actions that the plugin can perform.\n */\n actions: ActionDefinition<AvailableActions[Type]>[];\n /**\n * The metadata getters that the plugin can provide.\n */\n queries: AvailableQueries[Type];\n /**\n * The name of the plugin.\n */\n name: string;\n /**\n * An optional description of the plugin.\n */\n description?: string;\n /**\n * The twitter URL for the plugin or its creator.\n */\n x?: string;\n /**\n * The website URL for the plugin or its creator.\n */\n website?: string;\n}\n\nexport * from './actions/index.js';\nexport * from './queries/index.js';\nexport * from './pluginType.js';\nexport * from './schemas/index.js';\n","import { ethers } from 'ethers';\n\n/**\n * Represents a blockchain network configuration used to create JSON-RPC providers and\n * hold basic chain-specific metadata.\n *\n * The Chain class encapsulates:\n * - a numeric chain identifier (id),\n * - an RPC URL to connect to the chain (rpcUrl),\n * - an optional wrapped native token address (wrappedNativeTokenAddress).\n *\n * @param id - The numeric identifier for the chain (e.g., 1 for Ethereum mainnet).\n * @param rpcUrl - The JSON-RPC endpoint URL used to create providers for this chain.\n * @param wrappedNativeTokenAddress - Optional address of the chain's wrapped native token (if applicable).\n */\nexport class Chain {\n constructor(\n public id: number,\n public rpcUrl: string,\n public wrappedNativeTokenAddress?: string\n ) {}\n\n /**\n * Create and return an ethers.js JsonRpcProvider configured with this chain's RPC URL.\n *\n * This method constructs a new ethers.providers.JsonRpcProvider each time it is called.\n * Consumers may cache the provider if they intend to reuse it to avoid allocating multiple instances.\n *\n * @returns An instance of ethers.providers.JsonRpcProvider configured with the chain's rpcUrl.\n */\n public getProvider(): ethers.providers.JsonRpcProvider {\n return new ethers.providers.JsonRpcProvider(this.rpcUrl);\n }\n}\n","import {\n LegacyUiPoolDataProvider,\n UiPoolDataProvider,\n type ReservesDataHumanized,\n type ReservesHelperInput,\n type UserReservesHelperInput,\n type EModeData,\n type EmodeDataHumanized,\n type UserReserveDataHumanized,\n} from '@aave/contract-helpers';\nimport type { providers } from 'ethers';\n\n// @aave/contract-helpers provides two periphery contracts for fetching data from the blockchain:\n// `LegacyUiPoolDataProvider` and `UiPoolDataProvider`. Which one should be used is determined by the version that is actually deployed on a given chain.\n// Fortunately, for our use case we don't care about this complexity,\n// because their interfaces share just enough similarities for us to proceed.\n// `IUiPoolDataProvider` is an intersection of two interfaces.\n\n// Common functions between `LegacyUiPoolDataProvider` and `UiPoolDataProvider`\nexport interface IUiPoolDataProvider {\n getReservesHumanized: (args: ReservesHelperInput) => Promise<ReservesDataHumanized>;\n getUserReservesHumanized: (args: UserReservesHelperInput) => Promise<{\n userReserves: UserReserveDataHumanized[];\n userEmodeCategoryId: number;\n }>;\n getEModes: (args: ReservesHelperInput) => Promise<EModeData[]>;\n getEModesHumanized: (args: ReservesHelperInput) => Promise<EmodeDataHumanized[]>;\n}\n\nexport type IUiPoolDataProviderConstructor = new ({\n uiPoolDataProviderAddress,\n provider,\n chainId,\n}: {\n uiPoolDataProviderAddress: string;\n provider: providers.JsonRpcProvider;\n chainId: number;\n}) => IUiPoolDataProvider;\n\n// which class to use: LegacyUiPoolDataProvider or UiPoolDataProvider\n// When adding new chains, either compare the interfaces or bruteforce the correct option.\nexport const UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN: Record<\n number,\n IUiPoolDataProviderConstructor\n> = {\n 11155111: LegacyUiPoolDataProvider as IUiPoolDataProviderConstructor,\n 42161: UiPoolDataProvider as IUiPoolDataProviderConstructor,\n 1: UiPoolDataProvider as IUiPoolDataProviderConstructor,\n};\n\n// Use this function to get the correct pool data provider implementation.\nexport const getUiPoolDataProviderImpl = (chainId: number): IUiPoolDataProviderConstructor => {\n const res = UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN[chainId];\n if (!res) {\n throw new Error(\n 'UI_POOL_DATA_PROVIDER_INTERFACE_PER_CHAIN does not contain this chain ID. Edit providers/aave/dataProvider.ts.'\n );\n }\n return res;\n};\n","import * as markets from '@bgd-labs/aave-address-book';\n\n// AAVE market selection provided by aave-address-book is not very typescript-friendly:\n// we have to trust that the structure of their modules is the same, which\n// seems to be the case.\n\n// An interface that only contains fields of market definitions that we actually use\nexport type AAVEMarket = {\n AAVE_PROTOCOL_DATA_PROVIDER: string;\n POOL: string;\n POOL_ADDRESSES_PROVIDER: string;\n UI_INCENTIVE_DATA_PROVIDER: string;\n UI_POOL_DATA_PROVIDER: string;\n WALLET_BALANCE_PROVIDER: string;\n WETH_GATEWAY: string;\n};\n\nconst marketMap: Record<number, keyof typeof markets> = {\n 1: 'AaveV3Ethereum',\n 11155111: 'AaveV3Sepolia',\n 42161: 'AaveV3Arbitrum',\n 421614: 'AaveV3ArbitrumSepolia',\n 8453: 'AaveV3Base',\n 137: 'AaveV3Polygon',\n 10: 'AaveV3Optimism',\n};\n\nexport const getMarket = (chainId: number): AAVEMarket => {\n const marketKey = marketMap[chainId];\n if (!marketKey) {\n throw new Error(\n `AAVE: no market found for chain ID ${chainId}: modify providers/aave/market.ts`\n );\n }\n\n const market = markets[marketKey] as unknown as AAVEMarket;\n if (!market) {\n throw new Error(`No such market: ${marketKey}`);\n }\n\n return market;\n};\n","// based on https://github.com/aave-dao/aave-v3-origin/blob/083bd38a137b42b5df04e22ad4c9e72454365d0d/src/contracts/protocol/libraries/helpers/Errors.sol\n\nclass AaveError extends Error {\n public description: string;\n public override message: string;\n\n constructor(code: string, name: string, description: string) {\n const message = name + ` (${code}): ` + description;\n super(message);\n this.name = 'AaveError';\n this.description = description;\n this.message = message;\n\n // Ensures proper prototype chain in transpiled JavaScript\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\ntype AaveErrorData = {\n name: string;\n description: string;\n};\n\nexport const AAVE_ERROR_CODES: Record<string, AaveErrorData> = {\n '1': {\n name: 'CALLER_NOT_POOL_ADMIN',\n description: 'The caller of the function is not a pool admin',\n },\n '2': {\n name: 'CALLER_NOT_EMERGENCY_ADMIN',\n description: 'The caller of the function is not an emergency admin',\n },\n '3': {\n name: 'CALLER_NOT_POOL_OR_EMERGENCY_ADMIN',\n description: 'The caller of the function is not a pool or emergency admin',\n },\n '4': {\n name: 'CALLER_NOT_RISK_OR_POOL_ADMIN',\n description: 'The caller of the function is not a risk or pool admin',\n },\n '5': {\n name: 'CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN',\n description: 'The caller of the function is not an asset listing or pool admin',\n },\n '6': {\n name: 'CALLER_NOT_BRIDGE',\n description: 'The caller of the function is not a bridge',\n },\n '7': {\n name: 'ADDRESSES_PROVIDER_NOT_REGISTERED',\n description: 'Pool addresses provider is not registered',\n },\n '8': {\n name: 'INVALID_ADDRESSES_PROVIDER_ID',\n description: 'Invalid id for the pool addresses provider',\n },\n '9': { name: 'NOT_CONTRACT', description: 'Address is not a contract' },\n '10': {\n name: 'CALLER_NOT_POOL_CONFIGURATOR',\n description: 'The caller of the function is not the pool configurator',\n },\n '11': {\n name: 'CALLER_NOT_ATOKEN',\n description: 'The caller of the function is not an AToken',\n },\n '12': {\n name: 'INVALID_ADDRESSES_PROVIDER',\n description: 'The address of the pool addresses provider is invalid',\n },\n '13': {\n name: 'INVALID_FLASHLOAN_EXECUTOR_RETURN',\n description: 'Invalid return value of the flashloan executor function',\n },\n '14': {\n name: 'RESERVE_ALREADY_ADDED',\n description: 'Reserve has already been added to reserve list',\n },\n '15': {\n name: 'NO_MORE_RESERVES_ALLOWED',\n description: 'Maximum amount of reserves in the pool reached',\n },\n '16': {\n name: 'EMODE_CATEGORY_RESERVED',\n description: 'Zero eMode category is reserved for volatile heterogeneous assets',\n },\n '17': {\n name: 'INVALID_EMODE_CATEGORY_ASSIGNMENT',\n description: 'Invalid eMode category assignment to asset',\n },\n '18': {\n name: 'RESERVE_LIQUIDITY_NOT_ZERO',\n description: 'The liquidity of the reserve needs to be 0',\n },\n '19': {\n name: 'FLASHLOAN_PREMIUM_INVALID',\n description: 'Invalid flashloan premium',\n },\n '20': {\n name: 'INVALID_RESERVE_PARAMS',\n description: 'Invalid risk parameters for the reserve',\n },\n '21': {\n name: 'INVALID_EMODE_CATEGORY_PARAMS',\n description: 'Invalid risk parameters for the eMode category',\n },\n '22': {\n name: 'BRIDGE_PROTOCOL_FEE_INVALID',\n description: 'Invalid bridge protocol fee',\n },\n '23': {\n name: 'CALLER_MUST_BE_POOL',\n description: 'The caller of this function must be a pool',\n },\n '24': { name: 'INVALID_MINT_AMOUNT', description: 'Invalid amount to mint' },\n '25': { name: 'INVALID_BURN_AMOUNT', description: 'Invalid amount to burn' },\n '26': {\n name: 'INVALID_AMOUNT',\n description: 'Amount must be greater than 0',\n },\n '27': {\n name: 'RESERVE_INACTIVE',\n description: 'Action requires an active reserve',\n },\n '28': {\n name: 'RESERVE_FROZEN',\n description: 'Action cannot be performed because the reserve is frozen',\n },\n '29': {\n name: 'RESERVE_PAUSED',\n description: 'Action cannot be performed because the reserve is paused',\n },\n '30': {\n name: 'BORROWING_NOT_ENABLED',\n description: 'Borrowing is not enabled',\n },\n '32': {\n name: 'NOT_ENOUGH_AVAILABLE_USER_BALANCE',\n description: 'User cannot withdraw more than the available balance',\n },\n '33': {\n name: 'INVALID_INTEREST_RATE_MODE_SELECTED',\n description: 'Invalid interest rate mode selected',\n },\n '34': {\n name: 'COLLATERAL_BALANCE_IS_ZERO',\n description: 'The collateral balance is 0',\n },\n '35': {\n name: 'HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD',\n description: 'Health factor is lesser than the liquidation threshold',\n },\n '36': {\n name: 'COLLATERAL_CANNOT_COVER_NEW_BORROW',\n description: 'There is not enough collateral to cover a new borrow',\n },\n '37': {\n name: 'COLLATERAL_SAME_AS_BORROWING_CURRENCY',\n description: 'Collateral is (mostly) the same currency that is being borrowed',\n },\n '39': {\n name: 'NO_DEBT_OF_SELECTED_TYPE',\n description: 'For repayment of a specific type of debt, the user needs to have debt that type',\n },\n '40': {\n name: 'NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF',\n description: 'To repay on behalf of a user an explicit amount to repay is needed',\n },\n '42': {\n name: 'NO_OUTSTANDING_VARIABLE_DEBT',\n description: 'User does not have outstanding variable rate debt on this reserve',\n },\n '43': {\n name: 'UNDERLYING_BALANCE_ZERO',\n description: 'The underlying balance needs to be greater than 0',\n },\n '44': {\n name: 'INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET',\n description: 'Interest rate rebalance conditions were not met',\n },\n '45': {\n name: 'HEALTH_FACTOR_NOT_BELOW_THRESHOLD',\n description: 'Health factor is not below the threshold',\n },\n '46': {\n name: 'COLLATERAL_CANNOT_BE_LIQUIDATED',\n description: 'The collateral chosen cannot be liquidated',\n },\n '47': {\n name: 'SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER',\n description: 'User did not borrow the specified currency',\n },\n '49': {\n name: 'INCONSISTENT_FLASHLOAN_PARAMS',\n description: 'Inconsistent flashloan parameters',\n },\n '50': { name: 'BORROW_CAP_EXCEEDED', description: 'Borrow cap is exceeded' },\n '51': { name: 'SUPPLY_CAP_EXCEEDED', description: 'Supply cap is exceeded' },\n '52': {\n name: 'UNBACKED_MINT_CAP_EXCEEDED',\n description: 'Unbacked mint cap is exceeded',\n },\n '53': {\n name: 'DEBT_CEILING_EXCEEDED',\n description: 'Debt ceiling is exceeded',\n },\n '54': {\n name: 'UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO',\n description: 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)',\n },\n '56': {\n name: 'VARIABLE_DEBT_SUPPLY_NOT_ZERO',\n description: 'Variable debt supply is not zero',\n },\n '57': { name: 'LTV_VALIDATION_FAILED', description: 'Ltv validation failed' },\n '58': {\n name: 'INCONSISTENT_EMODE_CATEGORY',\n description: 'Inconsistent eMode category',\n },\n '59': {\n name: 'PRICE_ORACLE_SENTINEL_CHECK_FAILED',\n description: 'Price oracle sentinel validation failed',\n },\n '60': {\n name: 'ASSET_NOT_BORROWABLE_IN_ISOLATION',\n description: 'Asset is not borrowable in isolation mode',\n },\n '61': {\n name: 'RESERVE_ALREADY_INITIALIZED',\n description: 'Reserve has already been initialized',\n },\n '62': {\n name: 'USER_IN_ISOLATION_MODE_OR_LTV_ZERO',\n description: 'User is in isolation mode or ltv is zero',\n },\n '63': {\n name: 'INVALID_LTV',\n description: 'Invalid ltv parameter for the reserve',\n },\n '64': {\n name: 'INVALID_LIQ_THRESHOLD',\n description: 'Invalid liquidity threshold parameter for the reserve',\n },\n '65': {\n name: 'INVALID_LIQ_BONUS',\n description: 'Invalid liquidity bonus parameter for the reserve',\n },\n '66': {\n name: 'INVALID_DECIMALS',\n description: 'Invalid decimals parameter of the underlying asset of the reserve',\n },\n '67': {\n name: 'INVALID_RESERVE_FACTOR',\n description: 'Invalid reserve factor parameter for the reserve',\n },\n '68': {\n name: 'INVALID_BORROW_CAP',\n description: 'Invalid borrow cap for the reserve',\n },\n '69': {\n name: 'INVALID_SUPPLY_CAP',\n description: 'Invalid supply cap for the reserve',\n },\n '70': {\n name: 'INVALID_LIQUIDATION_PROTOCOL_FEE',\n description: 'Invalid liquidation protocol fee for the reserve',\n },\n '71': {\n name: 'INVALID_EMODE_CATEGORY',\n description: 'Invalid eMode category for the reserve',\n },\n '72': {\n name: 'INVALID_UNBACKED_MINT_CAP',\n description: 'Invalid unbacked mint cap for the reserve',\n },\n '73': {\n name: 'INVALID_DEBT_CEILING',\n description: 'Invalid debt ceiling for the reserve',\n },\n '74': { name: 'INVALID_RESERVE_INDEX', description: 'Invalid reserve index' },\n '75': {\n name: 'ACL_ADMIN_CANNOT_BE_ZERO',\n description: 'ACL admin cannot be set to the zero address',\n },\n '76': {\n name: 'INCONSISTENT_PARAMS_LENGTH',\n description: 'Array parameters that should be equal length are not',\n },\n '77': {\n name: 'ZERO_ADDRESS_NOT_VALID',\n description: 'Zero address not valid',\n },\n '78': { name: 'INVALID_EXPIRATION', description: 'Invalid expiration' },\n '79': { name: 'INVALID_SIGNATURE', description: 'Invalid signature' },\n '80': {\n name: 'OPERATION_NOT_SUPPORTED',\n description: 'Operation not supported',\n },\n '81': {\n name: 'DEBT_CEILING_NOT_ZERO',\n description: 'Debt ceiling is not zero',\n },\n '82': { name: 'ASSET_NOT_LISTED', description: 'Asset is not listed' },\n '83': {\n name: 'INVALID_OPTIMAL_USAGE_RATIO',\n description: 'Invalid optimal usage ratio',\n },\n '85': {\n name: 'UNDERLYING_CANNOT_BE_RESCUED',\n description: 'The underlying asset cannot be rescued',\n },\n '86': {\n name: 'ADDRESSES_PROVIDER_ALREADY_ADDED',\n description: 'Reserve has already been added to reserve list',\n },\n '87': {\n name: 'POOL_ADDRESSES_DO_NOT_MATCH',\n description:\n 'The token implementation pool address and the pool address provided by the initializing pool do not match',\n },\n '89': {\n name: 'SILOED_BORROWING_VIOLATION',\n description: 'User is trying to borrow multiple assets including a siloed one',\n },\n '90': {\n name: 'RESERVE_DEBT_NOT_ZERO',\n description: 'The total debt of the reserve needs to be 0',\n },\n '91': {\n name: 'FLASHLOAN_DISABLED',\n description: 'FlashLoaning for this asset is disabled',\n },\n '92': {\n name: 'INVALID_MAX_RATE',\n description: 'The expect maximum borrow rate is invalid',\n },\n '93': {\n name: 'WITHDRAW_TO_ATOKEN',\n description: 'Withdrawing to the aToken is not allowed',\n },\n '94': {\n name: 'SUPPLY_TO_ATOKEN',\n description: 'Supplying to the aToken is not allowed',\n },\n '95': {\n name: 'SLOPE_2_MUST_BE_GTE_SLOPE_1',\n description: 'Variable interest rate slope 2 can not be lower than slope 1',\n },\n '96': {\n name: 'CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN',\n description: 'The caller of the function is not a risk, pool or emergency admin',\n },\n '97': {\n name: 'LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED',\n description: 'Liquidation grace sentinel validation failed',\n },\n '98': {\n name: 'INVALID_GRACE_PERIOD',\n description: 'Grace period above a valid range',\n },\n '99': {\n name: 'INVALID_FREEZE_STATE',\n description: 'Reserve is already in the passed freeze state',\n },\n '100': {\n name: 'NOT_BORROWABLE_IN_EMODE',\n description: 'Asset not borrowable in eMode',\n },\n};\n\nexport function getAaveError(code: string): AaveError | null {\n const err = AAVE_ERROR_CODES[code];\n if (err) {\n return new AaveError(code, err.name, err.description);\n }\n return null;\n}\n","import type { EthereumTransactionTypeExtended } from '@aave/contract-helpers';\nimport { type PopulatedTransaction, ethers } from 'ethers';\n\nimport { getAaveError } from './errors.js';\n\nexport async function populateTransaction(\n tx: EthereumTransactionTypeExtended\n): Promise<PopulatedTransaction> {\n let txData: PopulatedTransaction | null = null;\n try {\n txData = await tx.tx();\n } catch (unknownError) {\n const reason =\n typeof unknownError === 'object' &&\n unknownError !== null &&\n 'reason' in unknownError &&\n typeof (unknownError as { reason: unknown }).reason === 'string'\n ? (unknownError as { reason: string }).reason\n : '';\n // error reason looks like 'execution reverted: revert: 32', with the aave\n // domain error code at the very end\n const errorCode = reason.split(' ').pop();\n // If we end up passing garbage to getAaveError, it does not matter - it will return null\n const aaveError = getAaveError(errorCode);\n if (aaveError !== null) {\n throw aaveError;\n } else {\n // we can hope that the LLM will provide an analysis of the error on the fly\n throw unknownError;\n }\n }\n if (!txData) {\n throw new Error('Failed to populate transaction');\n }\n return {\n value: ethers.BigNumber.from(txData.value ?? 0),\n from: txData.from,\n to: txData.to,\n data: txData.data,\n };\n}\n","import type { ReservesDataHumanized, UserReserveDataHumanized } from '@aave/contract-helpers';\nimport {\n formatReserves,\n formatUserSummary,\n type FormatUserSummaryResponse,\n type FormatReserveUSDResponse,\n} from '@aave/math-utils';\n\nfunction formatNumeric(value: string): string {\n const num = parseFloat(value);\n if (Number.isInteger(num)) return num.toString();\n return parseFloat(num.toFixed(2)).toString();\n}\n\nexport class UserSummary {\n public reserves: FormatUserSummaryResponse<FormatReserveUSDResponse>;\n\n /**\n * @param userReservesResponse - The response from getUserReservesHumanized.\n * @param reservesResponse - The response from getReservesHumanized.\n */\n constructor(\n userReservesResponse: {\n userReserves: UserReserveDataHumanized[];\n userEmodeCategoryId: number;\n },\n reservesResponse: ReservesDataHumanized\n ) {\n const currentTimestamp = Date.now() / 1000;\n\n const formattedReserves = formatReserves({\n reserves: reservesResponse.reservesData,\n currentTimestamp,\n marketReferenceCurrencyDecimals:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyDecimals,\n marketReferencePriceInUsd:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyPriceInUsd,\n });\n\n this.reserves = formatUserSummary({\n currentTimestamp,\n marketReferencePriceInUsd:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyPriceInUsd,\n marketReferenceCurrencyDecimals:\n reservesResponse.baseCurrencyData.marketReferenceCurrencyDecimals,\n userReserves: userReservesResponse.userReserves,\n formattedReserves,\n userEmodeCategoryId: userReservesResponse.userEmodeCategoryId,\n });\n }\n\n public toHumanReadable(): string {\n let output = 'User Positions:\\n';\n output += `Total Liquidity (USD): ${formatNumeric(this.reserves.totalLiquidityUSD)}\\n`;\n output += `Total Collateral (USD): ${formatNumeric(this.reserves.totalCollateralUSD)}\\n`;\n output += `Total Borrows (USD): ${formatNumeric(this.reserves.totalBorrowsUSD)}\\n`;\n output += `Net Worth (USD): ${formatNumeric(this.reserves.netWorthUSD)}\\n`;\n output += `Health Factor: ${formatNumeric(this.reserves.healthFactor)}\\n\\n`;\n output += 'Deposits:\\n';\n for (const entry of this.reserves.userReservesData) {\n if (parseFloat(entry.scaledATokenBalance) > 0) {\n const underlying = entry.underlyingBalance;\n const underlyingUSD = entry.underlyingBalanceUSD\n ? formatNumeric(entry.underlyingBalanceUSD)\n : 'N/A';\n output += `- ${entry.reserve.symbol}: ${underlying} (USD: ${underlyingUSD})\\n`;\n }\n }\n output += '\\nLoans:\\n';\n for (const entry of this.reserves.userReservesData) {\n const borrow = entry.totalBorrows || '0';\n if (parseFloat(borrow) > 0) {\n const totalBorrows = entry.totalBorrows;\n const totalBorrowsUSD = entry.totalBorrowsUSD\n ? formatNumeric(entry.totalBorrowsUSD)\n : 'N/A';\n output += `- ${entry.reserve.symbol}: ${totalBorrows} (USD: ${totalBorrowsUSD})\\n`;\n }\n }\n return output;\n }\n}\n","import {\n Pool,\n PoolBundle,\n InterestRate,\n type ReservesDataHumanized,\n type ReserveDataHumanized,\n} from '@aave/contract-helpers';\nimport { ethers, type PopulatedTransaction, utils } from 'ethers';\n\nimport {\n type TransactionPlan,\n type BorrowTokensRequest,\n type BorrowTokensResponse,\n type RepayTokensRequest,\n type RepayTokensResponse,\n type SupplyTokensRequest,\n type SupplyTokensResponse,\n type WithdrawTokensRequest,\n type WithdrawTokensResponse,\n type GetWalletLendingPositionsResponse,\n TransactionTypes,\n type GetWalletLendingPositionsRequest,\n type Token,\n} from '../core/index.js';\n\nimport { Chain } from './chain.js';\nimport { getUiPoolDataProviderImpl, type IUiPoolDataProvider } from './dataProvider.js';\nimport { type AAVEMarket, getMarket } from './market.js';\nimport { populateTransaction } from './populateTransaction.js';\nimport { UserSummary } from './userSummary.js';\n\nexport type EModeCategory = 'default' | 'stablecoins';\n\nexport interface PoolData {\n tokenAddress: string;\n poolAddress: string;\n variableBorrowRate: string;\n variableSupplyRate: string;\n ltv: string;\n availableLiquidity: string;\n reserveSize: string;\n}\n\nexport type AAVEAction = PopulatedTransaction[];\n\nexport interface AAVEAdapterParams {\n chainId: number;\n rpcUrl: string;\n wrappedNativeToken?: string; // e.g. WETH address for ETH\n}\n\n// AAVE's ETH placeholder address used for native ETH operations\nconst AAVE_ETH_PLACEHOLDER = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';\n\n/**\n * AAVEAdapter is the primary class wrapping Aave V3 interactions.\n */\nexport class AAVEAdapter {\n public chain: Chain;\n public market: AAVEMarket;\n\n constructor(params: AAVEAdapterParams) {\n this.chain = new Chain(params.chainId, params.rpcUrl);\n this.market = getMarket(this.chain.id);\n }\n\n /**\n * If the token is native, return AAVE's placeholder address instead of the ember address.\n * @param token - The token to normalize.\n * @returns The normalized token address.\n */\n public normalizeTokenAddress(token: Token): string {\n return token.isNative ? AAVE_ETH_PLACEHOLDER : token.tokenUid.address;\n }\n\n public async createSupplyTransaction(params: SupplyTokensRequest): Promise<SupplyTokensResponse> {\n const { supplyToken: token, amount, walletAddress } = params;\n const txs = await this.supply(\n this.normalizeTokenAddress(token),\n amount.toString(),\n walletAddress,\n );\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createWithdrawTransaction(\n params: WithdrawTokensRequest,\n ): Promise<WithdrawTokensResponse> {\n const { tokenToWithdraw, amount, walletAddress } = params;\n\n // Find aToken he wants to withdraw from\n const alphaTokenAddress = (await this.getReserves()).reservesData.find(\n (reserve) => reserve.underlyingAsset === tokenToWithdraw.tokenUid.address,\n )?.aTokenAddress;\n if (!alphaTokenAddress) {\n throw new Error('No position can generate the token to withdraw');\n }\n\n const txs = await this.withdraw(alphaTokenAddress, amount, walletAddress, walletAddress);\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createBorrowTransaction(params: BorrowTokensRequest): Promise<BorrowTokensResponse> {\n const { borrowToken, amount, walletAddress } = params;\n const normalizedTokenAddress = this.normalizeTokenAddress(borrowToken);\n\n // Get pool data to fetch APR\n const poolData = await this.getPool(normalizedTokenAddress);\n const reservesResponse = await this.getReserves();\n\n let reserveLiquidationThreshold: string | null = null;\n for (const reserve of reservesResponse.reservesData) {\n const token = ethers.utils.getAddress(reserve.underlyingAsset);\n if (token === normalizedTokenAddress) {\n reserveLiquidationThreshold = reserve.reserveLiquidationThreshold;\n }\n }\n\n if (reserveLiquidationThreshold == null) {\n throw new Error('Reserve not found in AAVE pool for a given token');\n }\n\n // Create borrow transaction\n const txs = await this.borrow(normalizedTokenAddress, amount.toString(), walletAddress);\n\n return {\n liquidationThreshold: reserveLiquidationThreshold,\n currentBorrowApy: poolData.variableBorrowRate,\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createRepayTransaction(params: RepayTokensRequest): Promise<RepayTokensResponse> {\n const { repayToken, amount, walletAddress: from } = params;\n\n const normalizedAsset = this.normalizeTokenAddress(repayToken);\n\n // Choose repayment method based on useATokens flag\n const txs = await this.repay(normalizedAsset, amount.toString(), from, repayToken.decimals);\n\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n public async createRepayTransactionWithATokens(\n params: RepayTokensRequest,\n ): Promise<RepayTokensResponse> {\n const { repayToken, amount, walletAddress: from } = params;\n\n const normalizedAsset = this.normalizeTokenAddress(repayToken);\n\n // Choose repayment method based on useATokens flag\n const txs = await this.repayWithATokens(\n normalizedAsset,\n amount.toString(),\n from,\n repayToken.decimals,\n );\n\n return {\n transactions: txs.map((t) => transactionPlanFromEthers(this.chain.id.toString(), t)),\n };\n }\n\n // Private Methods\n private getProvider() {\n return this.chain.getProvider();\n }\n\n private getPoolBundle() {\n const provider = this.getProvider();\n return new PoolBundle(provider, {\n POOL: this.market.POOL,\n WETH_GATEWAY: this.market.WETH_GATEWAY,\n });\n }\n\n private getPoolDataProvider(): IUiPoolDataProvider {\n const provider = this.getProvider();\n const DataProviderImpl = getUiPoolDataProviderImpl(this.chain.id);\n return new DataProviderImpl({\n uiPoolDataProviderAddress: this.market.UI_POOL_DATA_PROVIDER,\n provider,\n chainId: this.chain.id,\n });\n }\n\n private getPoolContract() {\n const provider = this.getProvider();\n return new Pool(provider, {\n POOL: this.market.POOL,\n WETH_GATEWAY: this.market.WETH_GATEWAY,\n });\n }\n\n private async getPool(asset: string): Promise<PoolData> {\n const reservesResponse = await this.getReserves();\n\n let targetAsset = asset;\n\n // If asset is AAVE's native token placeholder, find the corresponding wrapped native token reserve\n if (asset === AAVE_ETH_PLACEHOLDER) {\n const configuredWrappedNativeToken = this.chain.wrappedNativeTokenAddress;\n\n if (!configuredWrappedNativeToken) {\n throw new Error(`No wrapped native token configured for chain ${this.chain.id}`);\n }\n\n const wrappedNativeTokenReserve = reservesResponse.reservesData.find(\n (r: ReserveDataHumanized) =>\n ethers.utils.getAddress(r.underlyingAsset) === configuredWrappedNativeToken,\n );\n\n if (!wrappedNativeTokenReserve) {\n throw new Error(`Wrapped native token reserve not found for native token operations`);\n }\n\n targetAsset = wrappedNativeTokenReserve.underlyingAsset;\n }\n\n const reserve = reservesResponse.reservesData.find(\n (r: ReserveDataHumanized) =>\n ethers.utils.getAddress(r.underlyingAsset) === ethers.utils.getAddress(targetAsset),\n );\n\n if (!reserve) {\n throw new Error(`Asset ${asset} not found in reserves`);\n }\n\n return {\n tokenAddress: reserve.underlyingAsset,\n poolAddress: this.market.POOL,\n variableBorrowRate: reserve.variableBorrowRate,\n variableSupplyRate: reserve.liquidityRate,\n ltv: reserve.baseLTVasCollateral,\n availableLiquidity: reserve.availableLiquidity,\n reserveSize: reserve.availableLiquidity,\n };\n }\n\n public async getReserves(): Promise<ReservesDataHumanized> {\n const reserves = this.getPoolDataProvider().getReservesHumanized({\n lendingPoolAddressProvider: this.market.POOL_ADDRESSES_PROVIDER,\n });\n return reserves;\n }\n\n public async getUserSummary(\n params: GetWalletLendingPositionsRequest,\n ): Promise<GetWalletLendingPositionsResponse> {\n const userSummaryResponse = await this._getUserSummary(params.walletAddress);\n const {\n totalLiquidityUSD,\n totalCollateralUSD,\n totalBorrowsUSD,\n netWorthUSD,\n availableBorrowsUSD,\n currentLoanToValue,\n currentLiquidationThreshold,\n healthFactor,\n userReservesData,\n } = userSummaryResponse.reserves;\n\n const userReservesFormatted = [];\n for (const {\n reserve,\n underlyingBalance,\n underlyingBalanceUSD,\n variableBorrows,\n variableBorrowsUSD,\n totalBorrows,\n totalBorrowsUSD,\n } of userReservesData.filter((ur) => ur.underlyingBalanceUSD !== '0')) {\n userReservesFormatted.push({\n tokenUid: {\n address: reserve.underlyingAsset,\n chainId: this.chain.id.toString(),\n },\n underlyingBalance,\n underlyingBalanceUsd: underlyingBalanceUSD,\n variableBorrows,\n variableBorrowsUsd: variableBorrowsUSD,\n totalBorrows,\n totalBorrowsUsd: totalBorrowsUSD,\n });\n }\n\n return {\n userReserves: userReservesFormatted,\n totalLiquidityUsd: totalLiquidityUSD,\n totalCollateralUsd: totalCollateralUSD,\n totalBorrowsUsd: totalBorrowsUSD,\n netWorthUsd: netWorthUSD,\n availableBorrowsUsd: availableBorrowsUSD,\n currentLoanToValue,\n currentLiquidationThreshold,\n healthFactor,\n };\n }\n\n private async _getUserSummary(userAddress: string): Promise<UserSummary> {\n const validatedUser = ethers.utils.getAddress(userAddress);\n const poolDataProvider = this.getPoolDataProvider();\n\n const reservesResponse = await this.getReserves();\n\n const userReservesResponse = await poolDataProvider.getUserReservesHumanized({\n lendingPoolAddressProvider: this.market.POOL_ADDRESSES_PROVIDER,\n user: validatedUser,\n });\n\n return new UserSummary(userReservesResponse, reservesResponse);\n }\n\n private borrow(asset: string, amount: string, from: string): Promise<AAVEAction> {\n // validate\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n\n const bundle: PoolBundle = this.getPoolBundle();\n\n const tx = bundle.borrowTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount,\n interestRateMode: InterestRate.Variable,\n });\n\n return Promise.resolve([tx]);\n }\n\n private async createApproval({\n asset,\n amount_raw,\n user,\n spender,\n }: {\n spender: string;\n user: string;\n asset: string;\n amount_raw: string;\n }): Promise<PopulatedTransaction | null> {\n const bundle = this.getPoolBundle();\n let approvalTx = null;\n const isApprovedEnough = await bundle.erc20Service.isApproved({\n user: user,\n token: asset,\n spender,\n amount: amount_raw,\n nativeDecimals: true,\n });\n\n if (!isApprovedEnough) {\n approvalTx = bundle.erc20Service.approveTxData({\n user,\n token: asset,\n spender,\n amount: amount_raw,\n });\n }\n\n return approvalTx;\n }\n\n private async supply(asset: string, amount: string, from: string): Promise<AAVEAction> {\n // validate\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n\n const bundle = this.getPoolBundle();\n\n const approvalTx = await this.createApproval({\n asset,\n amount_raw: amount,\n user: from,\n spender: bundle.poolAddress,\n });\n\n const tx = bundle.supplyTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount,\n onBehalfOf: from,\n });\n\n return (approvalTx ? [approvalTx] : []).concat([tx]);\n }\n\n private async repay(\n asset: string,\n amount_formatted: string,\n from: string,\n tokenDecimals: number,\n ): Promise<AAVEAction> {\n // validate\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n\n const bundle: PoolBundle = this.getPoolBundle();\n\n const amount = utils.parseUnits(amount_formatted, tokenDecimals).toString();\n\n const tx = bundle.repayTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount: amount,\n interestRateMode: InterestRate.Variable,\n onBehalfOf: from,\n });\n\n const approvalTx = await this.createApproval({\n asset,\n amount_raw: amount,\n user: from,\n spender: bundle.poolAddress,\n });\n\n return (approvalTx ? [approvalTx] : []).concat([tx]);\n }\n\n private repayWithATokens(\n asset: string,\n amount_formatted: string,\n from: string,\n tokenDecimals: number,\n ): Promise<AAVEAction> {\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(from);\n const bundle = this.getPoolBundle();\n const amount = utils.parseUnits(amount_formatted, tokenDecimals).toString();\n const tx = bundle.repayWithATokensTxBuilder.generateTxData({\n user: from,\n reserve: asset,\n amount,\n rateMode: InterestRate.Variable,\n });\n return Promise.resolve([tx]);\n }\n\n private async withdraw(\n asset: string,\n amount: bigint,\n to: string,\n from: string,\n ): Promise<AAVEAction> {\n ethers.utils.getAddress(asset);\n ethers.utils.getAddress(to);\n ethers.utils.getAddress(from);\n\n const pool = this.getPoolContract();\n const txs = await pool.withdraw({\n user: from,\n reserve: asset,\n amount: amount.toString(),\n });\n\n if (txs.length !== 1) {\n throw new Error('AAVEInstance.withdraw: impossible happened');\n }\n\n // Null coercion is safe here because we checked txs.length above\n return [await populateTransaction(txs[0]!)];\n }\n}\n\nconst transactionPlanFromEthers = (\n chainId: string,\n tx: ethers.PopulatedTransaction,\n): TransactionPlan => {\n return {\n type: TransactionTypes.EVM_TX,\n to: tx.to!,\n value: tx.value?.toString() || '0',\n data: tx.data!,\n chainId,\n };\n};\n","import type { ChainConfig } from '../chainConfig.js';\nimport type { ActionDefinition, EmberPlugin, LendingActions } from '../core/index.js';\nimport type { PublicEmberPluginRegistry } from '../registry.js';\n\nimport { AAVEAdapter, type AAVEAdapterParams } from './adapter.js';\n\n/**\n * Get the AAVE Ember plugin.\n * @param params - Configuration parameters for the AAVEAdapter, including chainId and rpcUrl.\n * @returns The AAVE Ember plugin.\n */\nexport async function getAaveEmberPlugin(\n params: AAVEAdapterParams\n): Promise<EmberPlugin<'lending'>> {\n const adapter = new AAVEAdapter(params);\n\n return {\n id: `AAVE_CHAIN_${params.chainId}`,\n type: 'lending',\n name: `AAVE lending for ${params.chainId}`,\n description: 'Aave V3 lending protocol',\n website: 'https://aave.com',\n x: 'https://x.com/aave',\n actions: await getAaveActions(adapter),\n queries: {\n getPositions: adapter.getUserSummary.bind(adapter),\n },\n };\n}\n\n/**\n * Get the AAVE actions for the lending protocol.\n * @param adapter - An instance of AAVEAdapter to interact with the AAVE protocol.\n * @returns An array of action definitions for the AAVE lending protocol.\n */\nexport async function getAaveActions(\n adapter: AAVEAdapter\n): Promise<ActionDefinition<LendingActions>[]> {\n const reservesResponse = await adapter.getReserves();\n\n const underlyingAssets: string[] = reservesResponse.reservesData.map(\n reserve => reserve.underlyingAsset\n );\n const aTokens: string[] = reservesResponse.reservesData.map(reserve => reserve.aTokenAddress);\n const borrowableAssets = reservesResponse.reservesData\n .filter(reserve => reserve.borrowingEnabled)\n .map(reserve => reserve.underlyingAsset);\n\n return [\n // Supply any of the underlying assets to get aTokens\n {\n type: 'lending-supply',\n name: `AAVE lending pools in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: underlyingAssets,\n },\n ]),\n outputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n callback: adapter.createSupplyTransaction.bind(adapter),\n },\n\n // Borrow any of the borrowable assets if you have some alpha tokens as collateral\n {\n type: 'lending-borrow',\n name: `AAVE borrow in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n outputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: borrowableAssets,\n },\n ]),\n callback: adapter.createBorrowTransaction.bind(adapter),\n },\n\n // Repay your borrow with the underlying asset\n {\n type: 'lending-repay',\n name: `AAVE repay in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: borrowableAssets,\n },\n ]),\n // Empty output tokens as this doesn't generate any token\n outputTokens: async () => Promise.resolve([]),\n callback: adapter.createRepayTransaction.bind(adapter),\n },\n\n // Repay your borrow with aTokens\n {\n type: 'lending-repay',\n name: `AAVE repay with aTokens in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n // Empty output tokens as this doesn't generate any token\n outputTokens: async () => Promise.resolve([]),\n callback: adapter.createRepayTransactionWithATokens.bind(adapter),\n },\n\n // Withdraw from your aTokens to get the underlying asset back\n {\n type: 'lending-withdraw',\n name: `AAVE withdraw in chain ${adapter.chain.id}`,\n inputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: aTokens,\n },\n ]),\n outputTokens: async () =>\n Promise.resolve([\n {\n chainId: adapter.chain.id.toString(),\n tokens: underlyingAssets,\n },\n ]),\n callback: adapter.createWithdrawTransaction.bind(adapter),\n },\n ];\n}\n\n/**\n * Register the AAVE plugin for the specified chain configuration.\n * @param chainConfig - The chain configuration to check for AAVE support.\n * @param registry - The public Ember plugin registry to register the plugin with.\n * @returns A promise that resolves when the plugin is registered.\n */\nexport function registerAave(chainConfig: ChainConfig, registry: PublicEmberPluginRegistry) {\n const supportedChains = [42161];\n if (!supportedChains.includes(chainConfig.chainId)) {\n return;\n }\n\n registry.registerDeferredPlugin(\n getAaveEmberPlugin({\n chainId: chainConfig.chainId,\n rpcUrl: chainConfig.rpcUrl,\n wrappedNativeToken: chainConfig.wrappedNativeToken,\n })\n );\n}\n","import type { EmberPlugin, PluginType } from './core/index.js';\n\n/**\n * Registry for public Ember plugins.\n */\nexport class PublicEmberPluginRegistry {\n private plugins: EmberPlugin<PluginType>[] = [];\n private deferredPlugins: Promise<EmberPlugin<PluginType>>[] = [];\n\n /**\n * Register a new Ember plugin.\n * @param plugin The plugin to register.\n */\n public registerPlugin(plugin: EmberPlugin<PluginType>) {\n this.plugins.push(plugin);\n }\n\n /**\n * Register a new deferred Ember plugin.\n * @param pluginPromise The promise resolving to the plugin to register.\n */\n public registerDeferredPlugin(pluginPromise: Promise<EmberPlugin<PluginType>>) {\n this.deferredPlugins.push(pluginPromise);\n }\n\n /**\n * Iterator for the registered Ember plugins.\n */\n public async *getPlugins(): AsyncIterable<EmberPlugin<PluginType>> {\n yield* this.plugins;\n\n for (const pluginPromise of this.deferredPlugins) {\n const plugin = await pluginPromise;\n\n // Register the plugin now that it is resolved\n this.registerPlugin(plugin);\n\n yield plugin;\n }\n\n this.deferredPlugins = [];\n }\n\n public get emberPlugins(): EmberPlugin<PluginType>[] {\n return this.plugins;\n }\n}\n","import { z } from 'zod';\n\nexport const PaginatedPossibleResultsRequestSchema = z.object({\n cursor: z.string().optional().describe('Pagination cursor for cached results'),\n page: z.number().int().positive().optional().describe('Page number to retrieve (defaults to 1)'),\n});\nexport type PaginatedPossibleResultsRequest = z.infer<\n typeof PaginatedPossibleResultsRequestSchema\n>;\n\nexport const PaginatedPossibleResultsResponseSchema = z.object({\n cursor: z.string().describe('Pagination cursor for retrieving next/previous pages'),\n currentPage: z.number().int().describe('Current page number'),\n totalPages: z.number().int().describe('Total number of pages'),\n totalItems: z.number().int().describe('Total number of items across all pages'),\n});\nexport type PaginatedPossibleResultsResponse = z.infer<\n typeof PaginatedPossibleResultsResponseSchema\n>;\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema } from '../core/schemas/core.js';\nimport {\n BorrowTokensRequestSchema,\n RepayTokensRequestSchema,\n SupplyTokensRequestSchema,\n WithdrawTokensRequestSchema,\n} from '../core/schemas/lending.js';\n\nimport {\n PaginatedPossibleResultsRequestSchema,\n PaginatedPossibleResultsResponseSchema,\n} from './pagination.js';\n\nexport const CreateLendingSupplyRequestSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet address that will supply tokens to the lending protocol'),\n amount: z.string().describe('The amount of tokens to supply to the lending protocol'),\n supplyChain: z\n .string()\n .describe('The blockchain network where the lending protocol exists'),\n supplyToken: z\n .string()\n .describe('The token symbol or name to supply to the lending protocol'),\n});\nexport type CreateLendingSupplyRequest = z.infer<typeof CreateLendingSupplyRequestSchema>;\n\nexport const PromptLendingSupplyRequestSchema = CreateLendingSupplyRequestSchema.pick({\n walletAddress: true,\n supplyToken: true,\n supplyChain: true,\n}).partial();\n\nexport const PossibleLendingSupplyRequestSchema = PaginatedPossibleResultsRequestSchema.merge(\n PromptLendingSupplyRequestSchema,\n);\nexport type PossibleLendingSupplyRequest = z.infer<typeof PossibleLendingSupplyRequestSchema>;\n\nexport const PossibleLendingSupplyOptionSchema = z.object({\n createRequest: CreateLendingSupplyRequestSchema.pick({\n supplyToken: true,\n supplyChain: true,\n }),\n data: z.object({}).describe('Additional lending supply data (currently empty)'),\n});\nexport type PossibleLendingSupplyOption = z.infer<typeof PossibleLendingSupplyOptionSchema>;\n\nexport const PossibleLendingSupplyResponseSchema = PaginatedPossibleResultsResponseSchema.extend({\n options: z\n .array(PossibleLendingSupplyOptionSchema)\n .describe('Available tokens and chains where you can supply to lending protocols'),\n});\n\nexport const CreateSupplyEndpointRequestSchema = SupplyTokensRequestSchema.omit({\n supplyToken: true,\n amount: true,\n}).extend({\n supplyTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n});\n\nexport const CreateLendingBorrowRequestSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet address that will borrow tokens from the lending protocol'),\n amount: z.string().describe('The amount of tokens to borrow from the lending protocol'),\n borrowChain: z.string().describe('The blockchain network where the borrowing will occur'),\n borrowToken: z.string().describe('The token symbol or name to borrow from lending protocols'),\n});\nexport type CreateLendingBorrowRequest = z.infer<typeof CreateLendingBorrowRequestSchema>;\n\nexport const PromptLendingBorrowRequestSchema = CreateLendingBorrowRequestSchema.pick({\n walletAddress: true,\n borrowToken: true,\n borrowChain: true,\n}).partial();\n\nexport const PossibleLendingBorrowRequestSchema = PaginatedPossibleResultsRequestSchema.merge(\n PromptLendingBorrowRequestSchema,\n);\nexport type PossibleLendingBorrowRequest = z.infer<typeof PossibleLendingBorrowRequestSchema>;\n\nexport const PossibleLendingBorrowOptionSchema = z.object({\n createRequest: CreateLendingBorrowRequestSchema.pick({\n borrowToken: true,\n borrowChain: true,\n }),\n data: z.object({}).describe('Additional borrow data (currently empty)'),\n});\nexport type PossibleLendingBorrowOption = z.infer<typeof PossibleLendingBorrowOptionSchema>;\n\nexport const PossibleLendingBorrowResponseSchema = PaginatedPossibleResultsResponseSchema.extend({\n options: z\n .array(PossibleLendingBorrowOptionSchema)\n .describe('Available tokens and chains where you can borrow from lending protocols'),\n});\n\nexport const CreateBorrowEndpointRequestSchema = BorrowTokensRequestSchema.omit({\n borrowToken: true,\n amount: true,\n}).extend({\n borrowTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n});\n\nexport const CreateLendingRepayRequestSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet address that will repay tokens to the lending protocol'),\n amount: z.string().describe('The amount of tokens to repay to the lending protocol'),\n repayChain: z.string().describe('The blockchain network where repayment will occur'),\n repayToken: z.string().describe('The token symbol or name to repay to lending protocols'),\n});\nexport type CreateLendingRepayRequest = z.infer<typeof CreateLendingRepayRequestSchema>;\n\nexport const PromptLendingRepayRequestSchema = CreateLendingRepayRequestSchema.pick({\n walletAddress: true,\n repayToken: true,\n repayChain: true,\n}).partial();\n\nexport const PossibleLendingRepayRequestSchema = PaginatedPossibleResultsRequestSchema.merge(\n PromptLendingRepayRequestSchema,\n);\nexport type PossibleLendingRepayRequest = z.infer<typeof PossibleLendingRepayRequestSchema>;\n\nexport const PossibleLendingRepayOptionSchema = z.object({\n createRequest: CreateLendingRepayRequestSchema.pick({\n repayToken: true,\n repayChain: true,\n }),\n data: z.object({}).describe('Additional repay data (currently empty)'),\n});\nexport type PossibleLendingRepayOption = z.infer<typeof PossibleLendingRepayOptionSchema>;\n\nexport const PossibleLendingRepayResponseSchema = PaginatedPossibleResultsResponseSchema.extend({\n options: z\n .array(PossibleLendingRepayOptionSchema)\n .describe('Available tokens and chains where you can repay to lending protocols'),\n});\n\nexport const CreateRepayEndpointRequestSchema = RepayTokensRequestSchema.omit({\n repayToken: true,\n amount: true,\n}).extend({\n repayTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n});\n\nexport const CreateLendingWithdrawRequestSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet address that will withdraw tokens from the lending protocol'),\n amount: z.string().describe('The amount of tokens to withdraw from the lending protocol'),\n withdrawChain: z\n .string()\n .describe('The blockchain network where the withdrawal will occur'),\n withdrawToken: z\n .string()\n .describe('The token symbol or name to withdraw from lending protocols'),\n});\nexport type CreateLendingWithdrawRequest = z.infer<typeof CreateLendingWithdrawRequestSchema>;\n\nexport const PromptLendingWithdrawRequestSchema = CreateLendingWithdrawRequestSchema.pick({\n walletAddress: true,\n withdrawToken: true,\n withdrawChain: true,\n}).partial();\n\nexport const PossibleLendingWithdrawRequestSchema =\n PaginatedPossibleResultsRequestSchema.merge(PromptLendingWithdrawRequestSchema);\nexport type PossibleLendingWithdrawRequest = z.infer<\n typeof PossibleLendingWithdrawRequestSchema\n>;\n\nexport const PossibleLendingWithdrawOptionSchema = z.object({\n createRequest: CreateLendingWithdrawRequestSchema.pick({\n withdrawToken: true,\n withdrawChain: true,\n }),\n data: z.object({}).describe('Additional withdraw data (currently empty)'),\n});\nexport type PossibleLendingWithdrawOption = z.infer<\n typeof PossibleLendingWithdrawOptionSchema\n>;\n\nexport const PossibleLendingWithdrawResponseSchema = PaginatedPossibleResultsResponseSchema.extend({\n options: z\n .array(PossibleLendingWithdrawOptionSchema)\n .describe('Available tokens and chains where you can withdraw from lending protocols'),\n});\n\nexport const CreateWithdrawEndpointRequestSchema = WithdrawTokensRequestSchema.omit({\n tokenToWithdraw: true,\n amount: true,\n}).extend({\n tokenUidToWidthraw: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n});\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema } from '../core/schemas/core.js';\nimport { LiquidityProvisionRangeSchema } from '../core/schemas/liquidity.js';\n\nimport {\n PaginatedPossibleResultsRequestSchema,\n PaginatedPossibleResultsResponseSchema,\n} from './pagination.js';\n\nexport const NonMappedPayableTokens = z.object({\n token: z.string().describe('The token to be paid'),\n amount: z.string().describe('The amount of the token to be paid as a string'),\n});\n\nexport const CreateLiquiditySupplyRequestSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will supply liquidity to the pool'),\n payableTokens: z\n .array(NonMappedPayableTokens)\n .describe('The tokens and amounts to be supplied to the liquidity pool'),\n poolToken: z.string().describe('The liquidity pool token'),\n supplyChain: z\n .string()\n .describe('The blockchain network where the liquidity pool exists'),\n range: LiquidityProvisionRangeSchema.describe(\n 'The price range for concentrated liquidity provision',\n ).optional(),\n});\nexport type CreateLiquiditySupplyRequest = z.infer<typeof CreateLiquiditySupplyRequestSchema>;\n\nexport const CreateLiquiditySupplyPayableTokenSchema = z.object({\n tokenUid: TokenIdentifierSchema.describe('The token to be paid'),\n amount: z.string().describe('The amount of the token to be paid as a string'),\n});\n\nexport const CreateLiquiditySupplyEndpointRequestSchema = CreateLiquiditySupplyRequestSchema.omit({\n payableTokens: true,\n poolToken: true,\n}).extend({\n payableTokens: z\n .array(CreateLiquiditySupplyPayableTokenSchema)\n .describe('The tokens and amounts to be supplied to the liquidity pool'),\n poolIdentifier: TokenIdentifierSchema.describe('The liquidity pool token'),\n});\n\nexport const CreateLiquidityWithdrawRequestSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet address that owns the liquidity position to withdraw'),\n poolToken: z.string().describe('The LP token representing the liquidity position'),\n});\nexport type CreateLiquidityWithdrawRequest = z.infer<typeof CreateLiquidityWithdrawRequestSchema>;\n\nexport const PromptLiquidityWithdrawRequestSchema =\n CreateLiquidityWithdrawRequestSchema.partial();\n\nexport const PossibleLiquidityWithdrawRequestSchema = PaginatedPossibleResultsRequestSchema.merge(\n PromptLiquidityWithdrawRequestSchema,\n);\nexport type PossibleLiquidityWithdrawRequest = z.infer<\n typeof PossibleLiquidityWithdrawRequestSchema\n>;\n\nexport const LiquidityWithdrawOptionSchema = z.object({\n createRequest: CreateLiquidityWithdrawRequestSchema.pick({\n walletAddress: true,\n poolToken: true,\n }),\n data: z.object({}),\n});\nexport type LiquidityWithdrawOption = z.infer<typeof LiquidityWithdrawOptionSchema>;\n\nexport const PossibleLiquidityWithdrawResponseSchema = PaginatedPossibleResultsResponseSchema.extend(\n {\n options: z\n .array(LiquidityWithdrawOptionSchema)\n .describe('Available liquidity positions that can be withdrawn'),\n },\n);\n\nexport const CreateLiquidityWithdrawEndpointRequestSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet owning the liquidity position to withdraw'),\n poolTokenUid: TokenIdentifierSchema.describe('The LP token identifier'),\n});\n","import { z } from 'zod';\n\nimport { PositionSideSchema } from '../core/schemas/perpetuals.js';\n\nimport {\n PaginatedPossibleResultsRequestSchema,\n PaginatedPossibleResultsResponseSchema,\n} from './pagination.js';\n\nexport const PerpetualsCreatePositionRequestSchema = z.object({\n amount: z.string().describe('The amount of tokens to use for opening the perpetual position'),\n walletAddress: z.string().describe('The wallet address that will create the perpetual position'),\n chain: z\n .string()\n .describe('The blockchain network where the perpetual position will be created'),\n market: z.string().describe('The perpetual futures market to trade (e.g., BTC-USD, ETH-USD)'),\n payToken: z.string().describe('The token used to pay for opening the position'),\n collateralToken: z.string().describe('The token used as collateral for the perpetual position'),\n referralCode: z.string().optional().describe('Optional referral code for fee discounts'),\n limitPrice: z\n .string()\n .optional()\n .describe('Limit price for the order. If not provided, will execute at market price'),\n leverage: z\n .string()\n .describe(\"The leverage multiplier for the position (e.g., '2', '5', '10')\"),\n});\nexport type PerpetualsCreatePositionRequest = z.infer<\n typeof PerpetualsCreatePositionRequestSchema\n>;\n\nexport const PerpetualsPositionPromptSchema = PerpetualsCreatePositionRequestSchema.pick({\n chain: true,\n market: true,\n payToken: true,\n collateralToken: true,\n walletAddress: true,\n}).partial();\n\nexport const PossiblePerpetualPositionsRequestSchema =\n PaginatedPossibleResultsRequestSchema.merge(PerpetualsPositionPromptSchema);\nexport type PossiblePerpetualPositionsRequest = z.infer<\n typeof PossiblePerpetualPositionsRequestSchema\n>;\n\nexport const PossiblePerpetualPositionsOptionSchema = z.object({\n createRequest: PerpetualsCreatePositionRequestSchema.pick({\n market: true,\n collateralToken: true,\n payToken: true,\n chain: true,\n }),\n data: z.object({\n fundingFee: z.string().describe('The funding fee rate for this perpetual market'),\n borrowingFee: z.string().describe('The borrowing fee rate for this perpetual market'),\n }),\n});\nexport type PossiblePerpetualPositionOption = z.infer<\n typeof PossiblePerpetualPositionsOptionSchema\n>;\n\nexport const PossiblePerpetualPositionsResponseSchema = z\n .object({\n options: z.array(PossiblePerpetualPositionsOptionSchema),\n })\n .merge(PaginatedPossibleResultsResponseSchema);\nexport type PossiblePerpetualPositionsResponse = z.infer<\n typeof PossiblePerpetualPositionsResponseSchema\n>;\n\nexport const CreatePerpetualClosePositionRequestSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet address that owns the perpetual position to close'),\n providerName: z\n .string()\n .describe('The DeFi protocol provider where the position exists (e.g., GMX, dYdX)'),\n market: z.string().describe('The perpetual futures market of the position to close'),\n collateralToken: z.string().describe('The collateral token used in the position'),\n positionSide: PositionSideSchema.describe('Whether the position is long or short'),\n isLimit: z\n .boolean()\n .describe('Whether to close using a limit order (true) or market order (false)'),\n});\nexport type CreatePerpetualClosePositionRequest = z.infer<\n typeof CreatePerpetualClosePositionRequestSchema\n>;\n\nexport const PerpetualsCloseOrderPromptSchema = CreatePerpetualClosePositionRequestSchema.pick({\n walletAddress: true,\n providerName: true,\n market: true,\n collateralToken: true,\n positionSide: true,\n})\n .extend({\n isLimit: z\n .string()\n .describe(\"Whether to use limit order ('true') or market order ('false') for closing\"),\n })\n .partial();\n\nexport const PossiblePerpetualCloseRequestSchema =\n PaginatedPossibleResultsRequestSchema.merge(\n CreatePerpetualClosePositionRequestSchema.omit({\n walletAddress: true,\n }).partial(),\n ).extend({\n walletAddress: z\n .string()\n .describe('The wallet address to check for closeable perpetual positions'),\n });\nexport type PossiblePerpetualCloseRequest = z.infer<\n typeof PossiblePerpetualCloseRequestSchema\n>;\n\nexport const PositionDataSchema = z.object({\n sizeInUsd: z.string().describe('The size of the position in USD value'),\n increasedAtTime: z.string().describe('Timestamp when the position was last increased'),\n decreasedAtTime: z.string().describe('Timestamp when the position was last decreased'),\n pnl: z.string().describe('Current profit and loss of the position in USD'),\n});\n\nexport const LimitOrderDataSchema = z.object({\n sizeDeltaUsd: z.string().describe('The USD size change for the limit order'),\n acceptablePrice: z.string().describe('The acceptable execution price for the limit order'),\n triggerPrice: z.string().describe('The trigger price that activates the limit order'),\n});\n\nexport const TradingPositionDataSchema = z.discriminatedUnion('type', [\n z\n .object({\n type: z.literal('limit'),\n })\n .merge(LimitOrderDataSchema),\n z\n .object({\n type: z.literal('market'),\n })\n .merge(PositionDataSchema),\n]);\n\nexport const PerpetualCloseOptionSchema = z.object({\n createRequest: CreatePerpetualClosePositionRequestSchema.pick({\n providerName: true,\n market: true,\n collateralToken: true,\n positionSide: true,\n isLimit: true,\n }),\n data: z.object({\n collateralAmount: z\n .string()\n .describe('The amount of collateral tokens in the position'),\n orderData: TradingPositionDataSchema.describe(\n 'Details about the position or order to be closed',\n ),\n }),\n});\nexport type PerpetualCloseOption = z.infer<typeof PerpetualCloseOptionSchema>;\n\nexport const PossiblePerpetualCloseResponseSchema = z\n .object({\n options: z\n .array(PerpetualCloseOptionSchema)\n .describe('Available perpetual positions and orders that can be closed'),\n })\n .merge(PaginatedPossibleResultsResponseSchema);\n\nexport const CreatePerpetualCloseSimplifiedEndpointRequestSchema = z.object({\n walletAddress: z.string().describe('Wallet owning the perpetual position/order to close'),\n marketAddress: z.string().describe('Perpetual market contract address').min(1),\n positionSide: PositionSideSchema.optional().describe('long or short (optional filter)'),\n isLimit: z\n .boolean()\n .optional()\n .describe(\n 'If true, target a limit order; if false, target a market position; if omitted, try market then limit',\n ),\n});\nexport type CreatePerpetualCloseSimplifiedEndpointRequest = z.infer<\n typeof CreatePerpetualCloseSimplifiedEndpointRequestSchema\n>;\n","import { z } from 'zod';\n\nimport { ChainSchema, TokenIdentifierSchema, TokenSchema } from '../core/schemas/core.js';\n\nexport const GetChainsRequestSchema = z.object({});\nexport type GetChainsRequest = z.infer<typeof GetChainsRequestSchema>;\n\nexport const GetChainsResponseSchema = z.object({\n chains: z.array(ChainSchema),\n});\nexport type GetChainsResponse = z.infer<typeof GetChainsResponseSchema>;\n\nexport const GetTokensRequestSchema = z.object({\n chainIds: z.array(z.string()).optional(),\n});\nexport type GetTokensRequest = z.infer<typeof GetTokensRequestSchema>;\n\nexport const GetTokensResponseSchema = z.object({\n tokens: z.array(TokenSchema),\n});\nexport type GetTokensResponse = z.infer<typeof GetTokensResponseSchema>;\n\nexport const ProviderSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n website: z.string().optional(),\n x: z.string().optional(),\n type: z.string(),\n});\nexport type Provider = z.infer<typeof ProviderSchema>;\n\nexport const GetProvidersRequestSchema = z.object({});\nexport type GetProvidersRequest = z.infer<typeof GetProvidersRequestSchema>;\n\nexport const GetProvidersResponseSchema = z.object({\n providers: z.array(ProviderSchema),\n});\nexport type GetProvidersResponse = z.infer<typeof GetProvidersResponseSchema>;\n\nexport const BalanceSchema = z.object({\n tokenUid: TokenIdentifierSchema,\n amount: z.string(),\n symbol: z.string().optional(),\n valueUsd: z.number().optional(),\n decimals: z.number().int().optional(),\n});\nexport type Balance = z.infer<typeof BalanceSchema>;\n\nexport const GetWalletBalancesRequestSchema = z.object({\n walletAddress: z.string(),\n});\nexport type GetWalletBalancesRequest = z.infer<typeof GetWalletBalancesRequestSchema>;\n\nexport const GetWalletBalancesResponseSchema = z.object({\n balances: z.array(BalanceSchema),\n});\nexport type GetWalletBalancesResponse = z.infer<typeof GetWalletBalancesResponseSchema>;\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema } from '../core/schemas/core.js';\n\nimport {\n PaginatedPossibleResultsRequestSchema,\n PaginatedPossibleResultsResponseSchema,\n} from './pagination.js';\n\nexport const AmountTypeSchema = z.union([\n z\n .literal('exactIn')\n .describe('Specify exact input amount - you know how much you want to spend'),\n z\n .literal('exactOut')\n .describe('Specify exact output amount - you know how much you want to receive'),\n]);\n\nexport const CreateSwapRequestSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will perform the token swap'),\n amount: z\n .string()\n .describe(\n 'The amount of tokens to swap (input amount for exactIn, output amount for exactOut)',\n ),\n amountType: AmountTypeSchema.describe(\n 'Whether the amount represents input tokens (exactIn) or desired output tokens (exactOut)',\n ),\n toChain: z.string().describe('The destination blockchain network for the token swap'),\n fromChain: z.string().describe('The source blockchain network for the token swap'),\n fromToken: z.string().describe('The token to swap from (source token symbol or name)'),\n toToken: z.string().describe('The token to swap to (destination token symbol or name)'),\n slippageTolerance: z\n .string()\n .optional()\n .describe(\"Maximum acceptable slippage percentage (e.g., '0.5' for 0.5%)\"),\n expiration: z.string().optional().describe('Transaction expiration time in seconds from now'),\n});\nexport type CreateSwapRequest = z.infer<typeof CreateSwapRequestSchema>;\n\nexport const PromptSwapRequestSchema = CreateSwapRequestSchema.pick({\n walletAddress: true,\n fromToken: true,\n toToken: true,\n fromChain: true,\n toChain: true,\n}).partial();\n\nexport const PossibleSwapsRequestSchema = PaginatedPossibleResultsRequestSchema.merge(\n PromptSwapRequestSchema,\n);\nexport type PossibleSwapsRequest = z.infer<typeof PossibleSwapsRequestSchema>;\n\nexport const PossibleSwapOptionSchema = z.object({\n createRequest: CreateSwapRequestSchema.pick({\n fromToken: true,\n fromChain: true,\n toToken: true,\n toChain: true,\n }),\n data: z.object({}).describe('Additional swap data (currently empty)'),\n});\nexport type PossibleSwapOption = z.infer<typeof PossibleSwapOptionSchema>;\n\nexport const PossibleSwapsResponseSchema = PaginatedPossibleResultsResponseSchema.extend({\n options: z\n .array(PossibleSwapOptionSchema)\n .describe('Available token swap pairs across different blockchain networks'),\n});\n\nexport const CreateSwapEndpointRequestSchema = CreateSwapRequestSchema.omit({\n fromToken: true,\n toToken: true,\n fromChain: true,\n toChain: true,\n}).extend({\n fromTokenUid: TokenIdentifierSchema.describe(\n 'Identifier (chainId + address) for the source token',\n ),\n toTokenUid: TokenIdentifierSchema.describe(\n 'Identifier (chainId + address) for the destination token',\n ),\n});\n","import { z } from 'zod';\n\nimport { TokenIdentifierSchema, TokenSchema } from '../core/schemas/core.js';\nimport {\n BuyPtRequestSchema,\n BuyPtResponseSchema,\n BuyYtRequestSchema,\n BuyYtResponseSchema,\n ClaimRewardsRequestSchema,\n ClaimRewardsResponseSchema,\n MintPtAndYtRequestSchema,\n MintPtAndYtResponseSchema,\n RedeemPtRequestSchema,\n RedeemPtResponseSchema,\n SellPtRequestSchema,\n SellPtResponseSchema,\n SellYtRequestSchema,\n SellYtResponseSchema,\n} from '../core/schemas/tokenizedYield.js';\n\nexport const CreateTokenizedYieldBuyPtEndpointRequestSchema =\n BuyPtRequestSchema.omit({ inputToken: true, amount: true }).extend({\n inputTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n });\n\nexport const CreateTokenizedYieldBuyPtResponseSchema = BuyPtResponseSchema.omit({\n ptTokenIdentifier: true,\n}).extend({\n ptToken: TokenSchema,\n displayPtAmount: z.string(),\n});\nexport type CreateTokenizedYieldBuyPtResponse = z.infer<\n typeof CreateTokenizedYieldBuyPtResponseSchema\n>;\n\nexport const CreateTokenizedYieldBuyPtSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will buy the PT tokens'),\n inputToken: z.string().describe('The token symbol or name to be used as input'),\n amount: z.string().describe('The amount of tokens to be used as input for buying PT'),\n slippage: z\n .string()\n .describe('The maximum acceptable slippage percentage for the buying transaction')\n .default('0.01'),\n chain: z.string().describe('The blockchain network to perform the action on'),\n minimumMarketExpiry: z.string().describe('The minimum expiry date of the market to use'),\n});\nexport type CreateTokenizedYieldBuyPt = z.infer<typeof CreateTokenizedYieldBuyPtSchema>;\n\nexport const PromptTokenizedYieldBuyPtRequestSchema = CreateTokenizedYieldBuyPtSchema.pick({\n walletAddress: true,\n inputToken: true,\n amount: true,\n chain: true,\n minimumMarketExpiry: true,\n}).partial();\n\nexport const CreateTokenizedYieldBuyYtEndpointRequestSchema =\n BuyYtRequestSchema.omit({ inputToken: true, amount: true }).extend({\n inputTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n });\n\nexport const CreateTokenizedYieldBuyYtResponseSchema = BuyYtResponseSchema.omit({\n ytTokenIdentifier: true,\n}).extend({\n ytToken: TokenSchema,\n displayYtAmount: z.string(),\n});\nexport type CreateTokenizedYieldBuyYtResponse = z.infer<\n typeof CreateTokenizedYieldBuyYtResponseSchema\n>;\n\nexport const CreateTokenizedYieldBuyYtSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will buy the YT tokens'),\n inputToken: z.string().describe('The token symbol or name to be used as input'),\n amount: z.string().describe('The amount of tokens to be used as input for buying YT'),\n slippage: z\n .string()\n .describe('The maximum acceptable slippage percentage for the buying transaction')\n .default('0.01'),\n chain: z.string().describe('The blockchain network to perform the action on'),\n minimumMarketExpiry: z.string().describe('The minimum expiry date of the market to use'),\n});\nexport type CreateTokenizedYieldBuyYt = z.infer<typeof CreateTokenizedYieldBuyYtSchema>;\n\nexport const PromptTokenizedYieldBuyYtRequestSchema = CreateTokenizedYieldBuyYtSchema.pick({\n walletAddress: true,\n inputToken: true,\n amount: true,\n chain: true,\n minimumMarketExpiry: true,\n}).partial();\n\nexport const CreateTokenizedYieldSellPtEndpointRequestSchema =\n SellPtRequestSchema.omit({ ptToken: true, amount: true }).extend({\n ptTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n });\n\nexport const CreateTokenizedYieldSellPtResponseSchema = SellPtResponseSchema.omit({\n tokenOutIdentifier: true,\n}).extend({\n tokenOut: TokenSchema,\n displayAmountOut: z.string(),\n});\nexport type CreateTokenizedYieldSellPtResponse = z.infer<\n typeof CreateTokenizedYieldSellPtResponseSchema\n>;\n\nexport const CreateTokenizedYieldSellPtSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will sell the PT tokens'),\n ptToken: z.string().describe('The PT token symbol or name to be sold'),\n amount: z.string().describe('The amount of PT tokens to sell'),\n slippage: z\n .string()\n .describe('The maximum acceptable slippage percentage for the selling transaction')\n .default('0.01'),\n chain: z.string().describe('The blockchain network to perform the action on'),\n});\nexport type CreateTokenizedYieldSellPt = z.infer<typeof CreateTokenizedYieldSellPtSchema>;\n\nexport const PromptTokenizedYieldSellPtRequestSchema = CreateTokenizedYieldSellPtSchema.pick({\n walletAddress: true,\n ptToken: true,\n amount: true,\n chain: true,\n}).partial();\n\nexport const CreateTokenizedYieldSellYtEndpointRequestSchema =\n SellYtRequestSchema.omit({ ytToken: true, amount: true }).extend({\n ytTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n });\n\nexport const CreateTokenizedYieldSellYtResponseSchema = SellYtResponseSchema.omit({\n tokenOutIdentifier: true,\n}).extend({\n tokenOut: TokenSchema,\n displayAmountOut: z.string(),\n});\nexport type CreateTokenizedYieldSellYtResponse = z.infer<\n typeof CreateTokenizedYieldSellYtResponseSchema\n>;\n\nexport const CreateTokenizedYieldSellYtSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will sell the YT tokens'),\n ytToken: z.string().describe('The YT token symbol or name to be sold'),\n amount: z.string().describe('The amount of YT tokens to sell'),\n slippage: z\n .string()\n .describe('The maximum acceptable slippage percentage for the selling transaction')\n .default('0.01'),\n chain: z.string().describe('The blockchain network to perform the action on'),\n});\nexport type CreateTokenizedYieldSellYt = z.infer<typeof CreateTokenizedYieldSellYtSchema>;\n\nexport const PromptTokenizedYieldSellYtRequestSchema = CreateTokenizedYieldSellYtSchema.pick({\n walletAddress: true,\n ytToken: true,\n amount: true,\n chain: true,\n}).partial();\n\nexport const CreateTokenizedYieldMintPtAndYtEndpointRequestSchema =\n MintPtAndYtRequestSchema.omit({ inputToken: true, amount: true }).extend({\n inputTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n });\n\nexport const CreateTokenizedYieldMintPtAndYtResponseSchema =\n MintPtAndYtResponseSchema.omit({\n ptTokenIdentifier: true,\n ytTokenIdentifier: true,\n }).extend({\n ptToken: TokenSchema,\n displayPtAmount: z.string(),\n ytToken: TokenSchema,\n displayYtAmount: z.string(),\n });\nexport type CreateTokenizedYieldMintPtAndYtResponse = z.infer<\n typeof CreateTokenizedYieldMintPtAndYtResponseSchema\n>;\n\nexport const CreateTokenizedYieldMintPtAndYtSchema = z.object({\n walletAddress: z\n .string()\n .describe('The wallet address that will mint the PT and YT tokens'),\n inputToken: z.string().describe('The token symbol or name to be used as input'),\n amount: z\n .string()\n .describe('The amount of tokens to be used as input for minting PT and YT'),\n slippage: z\n .string()\n .describe('The maximum acceptable slippage percentage for the minting transaction')\n .default('0.01'),\n chain: z.string().describe('The blockchain network to perform the action on'),\n minimumMarketExpiry: z.string().describe('The minimum expiry date of the market to use'),\n});\nexport type CreateTokenizedYieldMintPTAndYt = z.infer<\n typeof CreateTokenizedYieldMintPtAndYtSchema\n>;\n\nexport const PromptTokenizedYieldMintPtAndYtRequestSchema =\n CreateTokenizedYieldMintPtAndYtSchema.pick({\n walletAddress: true,\n inputToken: true,\n amount: true,\n chain: true,\n minimumMarketExpiry: true,\n }).partial();\n\nexport const CreateTokenizedYieldRedeemPtEndpointRequestSchema =\n RedeemPtRequestSchema.omit({ ptToken: true, amount: true }).extend({\n ptTokenUid: TokenIdentifierSchema,\n amount: z.string().transform((arg) => BigInt(arg)),\n });\n\nexport const CreateTokenizedYieldRedeemPtResponseSchema =\n RedeemPtResponseSchema.omit({\n underlyingTokenIdentifier: true,\n }).extend({\n underlyingToken: TokenSchema,\n displayUnderlyingAmount: z.string(),\n });\nexport type CreateTokenizedYieldRedeemPtResponse = z.infer<\n typeof CreateTokenizedYieldRedeemPtResponseSchema\n>;\n\nexport const CreateTokenizedYieldRedeemPtSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will redeem the PT tokens'),\n ptToken: z\n .string()\n .describe('The PT token symbol or name to be redeemed after maturity'),\n amount: z.string().describe('The amount of PT tokens to redeem'),\n chain: z.string().describe('The blockchain network to perform the action on'),\n});\nexport type CreateTokenizedYieldRedeemPt = z.infer<typeof CreateTokenizedYieldRedeemPtSchema>;\n\nexport const PromptTokenizedYieldRedeemPtRequestSchema =\n CreateTokenizedYieldRedeemPtSchema.pick({\n walletAddress: true,\n ptToken: true,\n amount: true,\n chain: true,\n }).partial();\n\nexport const CreateTokenizedYieldClaimRewardsEndpointRequestSchema =\n ClaimRewardsRequestSchema.omit({ ytToken: true }).extend({\n ytTokenUid: TokenIdentifierSchema,\n });\n\nexport const CreateTokenizedYieldClaimRewardsResponseSchema = ClaimRewardsResponseSchema;\nexport type CreateTokenizedYieldClaimRewardsResponse = z.infer<\n typeof CreateTokenizedYieldClaimRewardsResponseSchema\n>;\n\nexport const CreateTokenizedYieldClaimRewardsSchema = z.object({\n walletAddress: z.string().describe('The wallet address that will claim the rewards'),\n ytToken: z.string().describe('The YT token symbol or name to claim rewards from'),\n chain: z.string().describe('The blockchain network to perform the action on'),\n});\nexport type CreateTokenizedYieldClaimRewards = z.infer<\n typeof CreateTokenizedYieldClaimRewardsSchema\n>;\n\nexport const PromptTokenizedYieldClaimRewardsRequestSchema =\n CreateTokenizedYieldClaimRewardsSchema.pick({\n walletAddress: true,\n ytToken: true,\n chain: true,\n }).partial();\n","/* eslint-disable @typescript-eslint/no-namespace */\nimport * as lending from './lending.js';\nimport * as liquidity from './liquidity.js';\nimport * as pagination from './pagination.js';\nimport * as perpetuals from './perpetuals.js';\nimport * as queries from './queries.js';\nimport * as swap from './swap.js';\nimport * as tokenizedYield from './tokenizedYield.js';\n\nexport namespace EndpointInterfaces {\n export const PaginatedPossibleResultsRequestSchema =\n pagination.PaginatedPossibleResultsRequestSchema;\n export type PaginatedPossibleResultsRequest =\n pagination.PaginatedPossibleResultsRequest;\n export const PaginatedPossibleResultsResponseSchema =\n pagination.PaginatedPossibleResultsResponseSchema;\n export type PaginatedPossibleResultsResponse =\n pagination.PaginatedPossibleResultsResponse;\n\n export const AmountTypeSchema = swap.AmountTypeSchema;\n export const CreateSwapRequestSchema = swap.CreateSwapRequestSchema;\n export type CreateSwapRequest = swap.CreateSwapRequest;\n export const PromptSwapRequestSchema = swap.PromptSwapRequestSchema;\n export const PossibleSwapsRequestSchema = swap.PossibleSwapsRequestSchema;\n export type PossibleSwapsRequest = swap.PossibleSwapsRequest;\n export const PossibleSwapOptionSchema = swap.PossibleSwapOptionSchema;\n export type PossibleSwapOption = swap.PossibleSwapOption;\n export const PossibleSwapsResponseSchema = swap.PossibleSwapsResponseSchema;\n export const CreateSwapEndpointRequestSchema =\n swap.CreateSwapEndpointRequestSchema;\n\n export const CreateLendingSupplyRequestSchema =\n lending.CreateLendingSupplyRequestSchema;\n export type CreateLendingSupplyRequest = lending.CreateLendingSupplyRequest;\n export const PromptLendingSupplyRequestSchema =\n lending.PromptLendingSupplyRequestSchema;\n export const PossibleLendingSupplyRequestSchema =\n lending.PossibleLendingSupplyRequestSchema;\n export type PossibleLendingSupplyRequest =\n lending.PossibleLendingSupplyRequest;\n export const PossibleLendingSupplyOptionSchema =\n lending.PossibleLendingSupplyOptionSchema;\n export type PossibleLendingSupplyOption = lending.PossibleLendingSupplyOption;\n export const PossibleLendingSupplyResponseSchema =\n lending.PossibleLendingSupplyResponseSchema;\n export const CreateSupplyEndpointRequestSchema =\n lending.CreateSupplyEndpointRequestSchema;\n\n export const CreateLendingBorrowRequestSchema =\n lending.CreateLendingBorrowRequestSchema;\n export type CreateLendingBorrowRequest = lending.CreateLendingBorrowRequest;\n export const PromptLendingBorrowRequestSchema =\n lending.PromptLendingBorrowRequestSchema;\n export const PossibleLendingBorrowRequestSchema =\n lending.PossibleLendingBorrowRequestSchema;\n export type PossibleLendingBorrowRequest =\n lending.PossibleLendingBorrowRequest;\n export const PossibleLendingBorrowOptionSchema =\n lending.PossibleLendingBorrowOptionSchema;\n export type PossibleLendingBorrowOption = lending.PossibleLendingBorrowOption;\n export const PossibleLendingBorrowResponseSchema =\n lending.PossibleLendingBorrowResponseSchema;\n export const CreateBorrowEndpointRequestSchema =\n lending.CreateBorrowEndpointRequestSchema;\n\n export const CreateLendingRepayRequestSchema =\n lending.CreateLendingRepayRequestSchema;\n export type CreateLendingRepayRequest = lending.CreateLendingRepayRequest;\n export const PromptLendingRepayRequestSchema =\n lending.PromptLendingRepayRequestSchema;\n export const PossibleLendingRepayRequestSchema =\n lending.PossibleLendingRepayRequestSchema;\n export type PossibleLendingRepayRequest = lending.PossibleLendingRepayRequest;\n export const PossibleLendingRepayOptionSchema =\n lending.PossibleLendingRepayOptionSchema;\n export type PossibleLendingRepayOption = lending.PossibleLendingRepayOption;\n export const PossibleLendingRepayResponseSchema =\n lending.PossibleLendingRepayResponseSchema;\n export const CreateRepayEndpointRequestSchema =\n lending.CreateRepayEndpointRequestSchema;\n\n export const CreateLendingWithdrawRequestSchema =\n lending.CreateLendingWithdrawRequestSchema;\n export type CreateLendingWithdrawRequest = lending.CreateLendingWithdrawRequest;\n export const PromptLendingWithdrawRequestSchema =\n lending.PromptLendingWithdrawRequestSchema;\n export const PossibleLendingWithdrawRequestSchema =\n lending.PossibleLendingWithdrawRequestSchema;\n export type PossibleLendingWithdrawRequest =\n lending.PossibleLendingWithdrawRequest;\n export const PossibleLendingWithdrawOptionSchema =\n lending.PossibleLendingWithdrawOptionSchema;\n export type PossibleLendingWithdrawOption =\n lending.PossibleLendingWithdrawOption;\n export const PossibleLendingWithdrawResponseSchema =\n lending.PossibleLendingWithdrawResponseSchema;\n export const CreateWithdrawEndpointRequestSchema =\n lending.CreateWithdrawEndpointRequestSchema;\n\n export const NonMappedPayableTokens = liquidity.NonMappedPayableTokens;\n export const CreateLiquiditySupplyRequestSchema =\n liquidity.CreateLiquiditySupplyRequestSchema;\n export type CreateLiquiditySupplyRequest =\n liquidity.CreateLiquiditySupplyRequest;\n export const CreateLiquiditySupplyPayableTokenSchema =\n liquidity.CreateLiquiditySupplyPayableTokenSchema;\n export const CreateLiquiditySupplyEndpointRequestSchema =\n liquidity.CreateLiquiditySupplyEndpointRequestSchema;\n\n export const CreateLiquidityWithdrawRequestSchema =\n liquidity.CreateLiquidityWithdrawRequestSchema;\n export type CreateLiquidityWithdrawRequest =\n liquidity.CreateLiquidityWithdrawRequest;\n export const PromptLiquidityWithdrawRequestSchema =\n liquidity.PromptLiquidityWithdrawRequestSchema;\n export const PossibleLiquidityWithdrawRequestSchema =\n liquidity.PossibleLiquidityWithdrawRequestSchema;\n export type PossibleLiquidityWithdrawRequest =\n liquidity.PossibleLiquidityWithdrawRequest;\n export const LiquidityWithdrawOptionSchema =\n liquidity.LiquidityWithdrawOptionSchema;\n export type LiquidityWithdrawOption = liquidity.LiquidityWithdrawOption;\n export const PossibleLiquidityWithdrawResponseSchema =\n liquidity.PossibleLiquidityWithdrawResponseSchema;\n export const CreateLiquidityWithdrawEndpointRequestSchema =\n liquidity.CreateLiquidityWithdrawEndpointRequestSchema;\n\n export const CreateTokenizedYieldBuyPtEndpointRequestSchema =\n tokenizedYield.CreateTokenizedYieldBuyPtEndpointRequestSchema;\n export const CreateTokenizedYieldBuyPtResponseSchema =\n tokenizedYield.CreateTokenizedYieldBuyPtResponseSchema;\n export type CreateTokenizedYieldBuyPtResponse =\n tokenizedYield.CreateTokenizedYieldBuyPtResponse;\n export const CreateTokenizedYieldBuyPtSchema =\n tokenizedYield.CreateTokenizedYieldBuyPtSchema;\n export type CreateTokenizedYieldBuyPt = tokenizedYield.CreateTokenizedYieldBuyPt;\n export const PromptTokenizedYieldBuyPtRequestSchema =\n tokenizedYield.PromptTokenizedYieldBuyPtRequestSchema;\n\n export const CreateTokenizedYieldBuyYtEndpointRequestSchema =\n tokenizedYield.CreateTokenizedYieldBuyYtEndpointRequestSchema;\n export const CreateTokenizedYieldBuyYtResponseSchema =\n tokenizedYield.CreateTokenizedYieldBuyYtResponseSchema;\n export type CreateTokenizedYieldBuyYtResponse =\n tokenizedYield.CreateTokenizedYieldBuyYtResponse;\n export const CreateTokenizedYieldBuyYtSchema =\n tokenizedYield.CreateTokenizedYieldBuyYtSchema;\n export type CreateTokenizedYieldBuyYt = tokenizedYield.CreateTokenizedYieldBuyYt;\n export const PromptTokenizedYieldBuyYtRequestSchema =\n tokenizedYield.PromptTokenizedYieldBuyYtRequestSchema;\n\n export const CreateTokenizedYieldSellPtEndpointRequestSchema =\n tokenizedYield.CreateTokenizedYieldSellPtEndpointRequestSchema;\n export const CreateTokenizedYieldSellPtResponseSchema =\n tokenizedYield.CreateTokenizedYieldSellPtResponseSchema;\n export type CreateTokenizedYieldSellPtResponse =\n tokenizedYield.CreateTokenizedYieldSellPtResponse;\n export const CreateTokenizedYieldSellPtSchema =\n tokenizedYield.CreateTokenizedYieldSellPtSchema;\n export type CreateTokenizedYieldSellPt = tokenizedYield.CreateTokenizedYieldSellPt;\n export const PromptTokenizedYieldSellPtRequestSchema =\n tokenizedYield.PromptTokenizedYieldSellPtRequestSchema;\n\n export const CreateTokenizedYieldSellYtEndpointRequestSchema =\n tokenizedYield.CreateTokenizedYieldSellYtEndpointRequestSchema;\n export const CreateTokenizedYieldSellYtResponseSchema =\n tokenizedYield.CreateTokenizedYieldSellYtResponseSchema;\n export type CreateTokenizedYieldSellYtResponse =\n tokenizedYield.CreateTokenizedYieldSellYtResponse;\n export const CreateTokenizedYieldSellYtSchema =\n tokenizedYield.CreateTokenizedYieldSellYtSchema;\n export type CreateTokenizedYieldSellYt = tokenizedYield.CreateTokenizedYieldSellYt;\n export const PromptTokenizedYieldSellYtRequestSchema =\n tokenizedYield.PromptTokenizedYieldSellYtRequestSchema;\n\n export const CreateTokenizedYieldMintPtAndYtEndpointRequestSchema =\n tokenizedYield.CreateTokenizedYieldMintPtAndYtEndpointRequestSchema;\n export const CreateTokenizedYieldMintPtAndYtResponseSchema =\n tokenizedYield.CreateTokenizedYieldMintPtAndYtResponseSchema;\n export type CreateTokenizedYieldMintPtAndYtResponse =\n tokenizedYield.CreateTokenizedYieldMintPtAndYtResponse;\n export const CreateTokenizedYieldMintPtAndYtSchema =\n tokenizedYield.CreateTokenizedYieldMintPtAndYtSchema;\n export type CreateTokenizedYieldMintPTAndYt =\n tokenizedYield.CreateTokenizedYieldMintPTAndYt;\n export const PromptTokenizedYieldMintPtAndYtRequestSchema =\n tokenizedYield.PromptTokenizedYieldMintPtAndYtRequestSchema;\n\n export const CreateTokenizedYieldRedeemPtEndpointRequestSchema =\n tokenizedYield.CreateTokenizedYieldRedeemPtEndpointRequestSchema;\n export const CreateTokenizedYieldRedeemPtResponseSchema =\n tokenizedYield.CreateTokenizedYieldRedeemPtResponseSchema;\n export type CreateTokenizedYieldRedeemPtResponse =\n tokenizedYield.CreateTokenizedYieldRedeemPtResponse;\n export const CreateTokenizedYieldRedeemPtSchema =\n tokenizedYield.CreateTokenizedYieldRedeemPtSchema;\n export type CreateTokenizedYieldRedeemPt =\n tokenizedYield.CreateTokenizedYieldRedeemPt;\n export const PromptTokenizedYieldRedeemPtRequestSchema =\n tokenizedYield.PromptTokenizedYieldRedeemPtRequestSchema;\n\n export const CreateTokenizedYieldClaimRewardsEndpointRequestSchema =\n tokenizedYield.CreateTokenizedYieldClaimRewardsEndpointRequestSchema;\n export const CreateTokenizedYieldClaimRewardsResponseSchema =\n tokenizedYield.CreateTokenizedYieldClaimRewardsResponseSchema;\n export type CreateTokenizedYieldClaimRewardsResponse =\n tokenizedYield.CreateTokenizedYieldClaimRewardsResponse;\n export const CreateTokenizedYieldClaimRewardsSchema =\n tokenizedYield.CreateTokenizedYieldClaimRewardsSchema;\n export type CreateTokenizedYieldClaimRewards =\n tokenizedYield.CreateTokenizedYieldClaimRewards;\n export const PromptTokenizedYieldClaimRewardsRequestSchema =\n tokenizedYield.PromptTokenizedYieldClaimRewardsRequestSchema;\n\n export const PerpetualsCreatePositionRequestSchema =\n perpetuals.PerpetualsCreatePositionRequestSchema;\n export type PerpetualsCreatePositionRequest =\n perpetuals.PerpetualsCreatePositionRequest;\n export const PerpetualsPositionPromptSchema =\n perpetuals.PerpetualsPositionPromptSchema;\n export const PossiblePerpetualPositionsRequestSchema =\n perpetuals.PossiblePerpetualPositionsRequestSchema;\n export type PossiblePerpetualPositionsRequest =\n perpetuals.PossiblePerpetualPositionsRequest;\n export const PossiblePerpetualPositionsOptionSchema =\n perpetuals.PossiblePerpetualPositionsOptionSchema;\n export type PossiblePerpetualPositionOption =\n perpetuals.PossiblePerpetualPositionOption;\n export const PossiblePerpetualPositionsResponseSchema =\n perpetuals.PossiblePerpetualPositionsResponseSchema;\n export type PossiblePerpetualPositionsResponse =\n perpetuals.PossiblePerpetualPositionsResponse;\n\n export const CreatePerpetualClosePositionRequestSchema =\n perpetuals.CreatePerpetualClosePositionRequestSchema;\n export type CreatePerpetualClosePositionRequest =\n perpetuals.CreatePerpetualClosePositionRequest;\n export const PerpetualsCloseOrderPromptSchema =\n perpetuals.PerpetualsCloseOrderPromptSchema;\n export const PossiblePerpetualCloseRequestSchema =\n perpetuals.PossiblePerpetualCloseRequestSchema;\n export type PossiblePerpetualCloseRequest =\n perpetuals.PossiblePerpetualCloseRequest;\n export const PositionDataSchema = perpetuals.PositionDataSchema;\n export const LimitOrderDataSchema = perpetuals.LimitOrderDataSchema;\n export const TradingPositionDataSchema = perpetuals.TradingPositionDataSchema;\n export const PerpetualCloseOptionSchema = perpetuals.PerpetualCloseOptionSchema;\n export type PerpetualCloseOption = perpetuals.PerpetualCloseOption;\n export const PossiblePerpetualCloseResponseSchema =\n perpetuals.PossiblePerpetualCloseResponseSchema;\n export const CreatePerpetualCloseSimplifiedEndpointRequestSchema =\n perpetuals.CreatePerpetualCloseSimplifiedEndpointRequestSchema;\n export type CreatePerpetualCloseSimplifiedEndpointRequest =\n perpetuals.CreatePerpetualCloseSimplifiedEndpointRequest;\n\n export const GetChainsRequestSchema = queries.GetChainsRequestSchema;\n export type GetChainsRequest = queries.GetChainsRequest;\n export const GetChainsResponseSchema = queries.GetChainsResponseSchema;\n export type GetChainsResponse = queries.GetChainsResponse;\n export const GetTokensRequestSchema = queries.GetTokensRequestSchema;\n export type GetTokensRequest = queries.GetTokensRequest;\n export const GetTokensResponseSchema = queries.GetTokensResponseSchema;\n export type GetTokensResponse = queries.GetTokensResponse;\n export const ProviderSchema = queries.ProviderSchema;\n export type Provider = queries.Provider;\n export const GetProvidersRequestSchema = queries.GetProvidersRequestSchema;\n export type GetProvidersRequest = queries.GetProvidersRequest;\n export const GetProvidersResponseSchema = queries.GetProvidersResponseSchema;\n export type GetProvidersResponse = queries.GetProvidersResponse;\n export const BalanceSchema = queries.BalanceSchema;\n export type Balance = queries.Balance;\n export const GetWalletBalancesRequestSchema =\n queries.GetWalletBalancesRequestSchema;\n export type GetWalletBalancesRequest = queries.GetWalletBalancesRequest;\n export const GetWalletBalancesResponseSchema =\n queries.GetWalletBalancesResponseSchema;\n export type GetWalletBalancesResponse = queries.GetWalletBalancesResponse;\n}\n","import { registerAave } from './aave-lending-plugin/index.js';\nimport type { ChainConfig } from './chainConfig.js';\nimport { PublicEmberPluginRegistry } from './registry.js';\n\n/**\n * Initialize the public Ember plugin registry.\n * @returns The initialized public Ember plugin registry with registered plugins.\n */\nexport function initializePublicRegistry(chainConfigs: ChainConfig[]) {\n const registry = new PublicEmberPluginRegistry();\n\n // Register any plugin in here\n for (const chainConfig of chainConfigs) {\n // Create aave plugins for each chain config\n registerAave(chainConfig, registry);\n }\n\n return registry;\n}\n\nexport { type ChainConfig, PublicEmberPluginRegistry };\nexport { EndpointInterfaces } from './endpoint-interfaces/index.js';\nexport * as PluginInterfaces from './core/index.js';\nexport * from './core/index.js';\n"],"mappings":";;;;;;;;AAEA,MAAa,kBAAkB,EAAE,KAAK;CAAC;CAAe;CAAO;CAAU;CAAS,CAAC;AAIjF,MAAa,mBAAmB;CAC9B,8BAA8B;CAC9B,QAAQ;CACR,WAAW;CACZ;AAED,MAAa,wBAAwB,EAAE,KACrC,OAAO,OAAO,iBAAiB,CAChC;;;;ACVD,MAAa,wBAAwB,EAAE,OAAO;CAC5C,SAAS,EAAE,QAAQ;CACnB,SAAS,EAAE,QAAQ;CACpB,CAAC;AAGF,MAAa,cAAc,EAAE,OAAO;CAClC,UAAU;CACV,MAAM,EAAE,QAAQ;CAChB,QAAQ,EAAE,QAAQ;CAClB,UAAU,EAAE,SAAS;CACrB,UAAU,EAAE,QAAQ,CAAC,KAAK;CAC1B,SAAS,EAAE,QAAQ,CAAC,SAAS;CAC7B,UAAU,EAAE,SAAS;CACtB,CAAC;AAGF,MAAa,cAAc,EAAE,OAAO;CAClC,SAAS,EAAE,QAAQ;CACnB,MAAM;CACN,SAAS,EAAE,QAAQ;CACnB,aAAa;CACb,YAAY,EAAE,QAAQ;CACtB,MAAM,EAAE,QAAQ;CAChB,mBAAmB,EAAE,MAAM,EAAE,QAAQ,CAAC;CACvC,CAAC;AAGF,MAAa,qBAAqB,EAAE,OAAO;CACzC,YAAY,EAA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