@aave/graphql 1.0.0-next.29 → 1.0.0-next.30

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.
package/dist/testing.d.ts CHANGED
@@ -189,6 +189,7 @@ type introspection_types = {
189
189
  'ChainsFilter': { name: 'ChainsFilter'; enumValues: 'TESTNET_ONLY' | 'MAINNET_ONLY' | 'ALL'; };
190
190
  'ChainsRequest': { kind: 'INPUT_OBJECT'; name: 'ChainsRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ChainsRequestQuery'; ofType: null; }; }; defaultValue: null }]; };
191
191
  'ChainsRequestQuery': { kind: 'INPUT_OBJECT'; name: 'ChainsRequestQuery'; isOneOf: true; inputFields: [{ name: 'chainIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; defaultValue: null }, { name: 'filter'; type: { kind: 'ENUM'; name: 'ChainsFilter'; ofType: null; }; defaultValue: null }]; };
192
+ 'ClaimRewardsRequest': { kind: 'INPUT_OBJECT'; name: 'ClaimRewardsRequest'; isOneOf: false; inputFields: [{ name: 'ids'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; }; }; }; defaultValue: null }]; };
192
193
  'CollateralFactorVariation': { kind: 'OBJECT'; name: 'CollateralFactorVariation'; fields: { 'after': { name: 'after'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'reserveId': { name: 'reserveId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; } }; 'token': { name: 'token'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Token'; ofType: null; }; } }; }; };
193
194
  'CollateralMetric': { name: 'CollateralMetric'; enumValues: 'HIGHEST' | 'LOWEST'; };
194
195
  'Currency': { name: 'Currency'; enumValues: 'USD' | 'GBP' | 'EUR'; };
@@ -267,6 +268,10 @@ type introspection_types = {
267
268
  'MarketSupplySwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketSupplySwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'accuracy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'QuoteAccuracy'; ofType: null; }; }; defaultValue: "ACCURATE" }, { name: 'sellPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserSupplyItemId'; ofType: null; }; }; defaultValue: null }, { name: 'buyReserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; }; defaultValue: null }, { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'enableCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }, { name: 'selectedSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
268
269
  'MarketWithdrawSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketWithdrawSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'accuracy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'QuoteAccuracy'; ofType: null; }; }; defaultValue: "ACCURATE" }, { name: 'sellPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserSupplyItemId'; ofType: null; }; }; defaultValue: null }, { name: 'buyToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'TokenInput'; ofType: null; }; }; defaultValue: null }, { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'selectedSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
269
270
  'MaxLiquidationBonusVariation': { kind: 'OBJECT'; name: 'MaxLiquidationBonusVariation'; fields: { 'after': { name: 'after'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'reserveId': { name: 'reserveId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; } }; 'token': { name: 'token'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Token'; ofType: null; }; } }; }; };
271
+ 'MerklBorrowReward': { kind: 'OBJECT'; name: 'MerklBorrowReward'; fields: { 'criteria': { name: 'criteria'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'MerklCriteria'; ofType: null; }; }; }; } }; 'discountApy': { name: 'discountApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'endDate': { name: 'endDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; } }; 'payoutToken': { name: 'payoutToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Token'; ofType: null; }; } }; 'startDate': { name: 'startDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'userEligible': { name: 'userEligible'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
272
+ 'MerklCriteria': { kind: 'UNION'; name: 'MerklCriteria'; fields: {}; possibleTypes: 'MerklGenericCriteria'; };
273
+ 'MerklGenericCriteria': { kind: 'OBJECT'; name: 'MerklGenericCriteria'; fields: { 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'text': { name: 'text'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'userPassed': { name: 'userPassed'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
274
+ 'MerklSupplyReward': { kind: 'OBJECT'; name: 'MerklSupplyReward'; fields: { 'criteria': { name: 'criteria'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'MerklCriteria'; ofType: null; }; }; }; } }; 'endDate': { name: 'endDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'extraApy': { name: 'extraApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; } }; 'payoutToken': { name: 'payoutToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Token'; ofType: null; }; } }; 'startDate': { name: 'startDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'userEligible': { name: 'userEligible'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
270
275
  'Mutation': { kind: 'OBJECT'; name: 'Mutation'; fields: { 'cancelSwap': { name: 'cancelSwap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'CancelSwapExecutionPlan'; ofType: null; }; } }; 'forkTopUp': { name: 'forkTopUp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ForkTopUpResponse'; ofType: null; }; } }; 'swap': { name: 'swap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SwapExecutionPlan'; ofType: null; }; } }; }; };
271
276
  'NativeAmount': { kind: 'OBJECT'; name: 'NativeAmount'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DecimalNumber'; ofType: null; }; } }; 'exchange': { name: 'exchange'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'exchangeRate': { name: 'exchangeRate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DecimalNumber'; ofType: null; }; } }; 'token': { name: 'token'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'NativeToken'; ofType: null; }; } }; }; };
272
277
  'NativeToken': { kind: 'OBJECT'; name: 'NativeToken'; fields: { 'chain': { name: 'chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; } }; 'info': { name: 'info'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TokenInfo'; ofType: null; }; } }; }; };
@@ -285,7 +290,7 @@ type introspection_types = {
285
290
  'PercentNumberVariation': { kind: 'OBJECT'; name: 'PercentNumberVariation'; fields: { 'after': { name: 'after'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
286
291
  'PercentNumberWithChange': { kind: 'OBJECT'; name: 'PercentNumberWithChange'; fields: { 'change': { name: 'change'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
287
292
  'PermitTypedData': { kind: 'OBJECT'; name: 'PermitTypedData'; fields: { 'domain': { name: 'domain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DomainData'; ofType: null; }; } }; 'message': { name: 'message'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; 'primaryType': { name: 'primaryType'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'types': { name: 'types'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; }; };
288
- 'PositionAmount': { kind: 'OBJECT'; name: 'PositionAmount'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; } }; }; };
293
+ 'PositionAmount': { kind: 'OBJECT'; name: 'PositionAmount'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; }; };
289
294
  'PositionSwapAdapterContractApproval': { kind: 'OBJECT'; name: 'PositionSwapAdapterContractApproval'; fields: { 'bySignature': { name: 'bySignature'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapTypedData'; ofType: null; }; } }; }; };
290
295
  'PositionSwapApproval': { kind: 'UNION'; name: 'PositionSwapApproval'; fields: {}; possibleTypes: 'PositionSwapAdapterContractApproval' | 'PositionSwapPositionManagerApproval'; };
291
296
  'PositionSwapByIntentApprovalsRequired': { kind: 'OBJECT'; name: 'PositionSwapByIntentApprovalsRequired'; fields: { 'approvals': { name: 'approvals'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'PositionSwapApproval'; ofType: null; }; }; }; } }; 'quote': { name: 'quote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapQuote'; ofType: null; }; } }; }; };
@@ -299,11 +304,15 @@ type introspection_types = {
299
304
  'PrepareTokenSwapRequest': { kind: 'INPUT_OBJECT'; name: 'PrepareTokenSwapRequest'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'permitSig'; type: { kind: 'INPUT_OBJECT'; name: 'ERC20PermitSignature'; ofType: null; }; defaultValue: null }]; };
300
305
  'PrepareTokenSwapResult': { kind: 'UNION'; name: 'PrepareTokenSwapResult'; fields: {}; possibleTypes: 'InsufficientBalanceError' | 'PrepareSwapOrder'; };
301
306
  'PreviewAction': { kind: 'INPUT_OBJECT'; name: 'PreviewAction'; isOneOf: true; inputFields: [{ name: 'supply'; type: { kind: 'INPUT_OBJECT'; name: 'SupplyRequest'; ofType: null; }; defaultValue: null }, { name: 'borrow'; type: { kind: 'INPUT_OBJECT'; name: 'BorrowRequest'; ofType: null; }; defaultValue: null }, { name: 'repay'; type: { kind: 'INPUT_OBJECT'; name: 'RepayRequest'; ofType: null; }; defaultValue: null }, { name: 'withdraw'; type: { kind: 'INPUT_OBJECT'; name: 'WithdrawRequest'; ofType: null; }; defaultValue: null }, { name: 'setUserSuppliesAsCollateral'; type: { kind: 'INPUT_OBJECT'; name: 'SetUserSuppliesAsCollateralRequest'; ofType: null; }; defaultValue: null }, { name: 'updateUserPositionConditions'; type: { kind: 'INPUT_OBJECT'; name: 'UpdateUserPositionConditionsRequest'; ofType: null; }; defaultValue: null }, { name: 'supplySwap'; type: { kind: 'INPUT_OBJECT'; name: 'SupplySwapQuoteRequest'; ofType: null; }; defaultValue: null }, { name: 'borrowSwap'; type: { kind: 'INPUT_OBJECT'; name: 'BorrowSwapQuoteRequest'; ofType: null; }; defaultValue: null }, { name: 'repayWithSupply'; type: { kind: 'INPUT_OBJECT'; name: 'RepayWithSupplyQuoteRequest'; ofType: null; }; defaultValue: null }, { name: 'withdrawSwap'; type: { kind: 'INPUT_OBJECT'; name: 'WithdrawSwapQuoteRequest'; ofType: null; }; defaultValue: null }]; };
307
+ 'PreviewMerklBorrowReward': { kind: 'OBJECT'; name: 'PreviewMerklBorrowReward'; fields: { 'criteria': { name: 'criteria'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'MerklCriteria'; ofType: null; }; }; }; } }; 'discountApy': { name: 'discountApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'endDate': { name: 'endDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; } }; 'payoutToken': { name: 'payoutToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Token'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; 'startDate': { name: 'startDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
308
+ 'PreviewMerklSupplyReward': { kind: 'OBJECT'; name: 'PreviewMerklSupplyReward'; fields: { 'criteria': { name: 'criteria'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'MerklCriteria'; ofType: null; }; }; }; } }; 'endDate': { name: 'endDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'extraApy': { name: 'extraApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; } }; 'payoutToken': { name: 'payoutToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Token'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; 'startDate': { name: 'startDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
302
309
  'PreviewRequest': { kind: 'INPUT_OBJECT'; name: 'PreviewRequest'; isOneOf: false; inputFields: [{ name: 'action'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'PreviewAction'; ofType: null; }; }; defaultValue: null }]; };
303
- 'PreviewUserPosition': { kind: 'OBJECT'; name: 'PreviewUserPosition'; fields: { 'borrowingPower': { name: 'borrowingPower'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'HealthFactorResult'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; } }; 'netApy': { name: 'netApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberVariation'; ofType: null; }; } }; 'netBalance': { name: 'netBalance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'netCollateral': { name: 'netCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'otherConditions': { name: 'otherConditions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'UserPositionConditionVariation'; ofType: null; }; }; }; } }; 'projectedEarnings': { name: 'projectedEarnings'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'riskPremium': { name: 'riskPremium'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberVariation'; ofType: null; }; } }; }; };
310
+ 'PreviewReward': { kind: 'UNION'; name: 'PreviewReward'; fields: {}; possibleTypes: 'PreviewMerklBorrowReward' | 'PreviewMerklSupplyReward'; };
311
+ 'PreviewRewardOutcome': { kind: 'OBJECT'; name: 'PreviewRewardOutcome'; fields: { 'gained': { name: 'gained'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'PreviewReward'; ofType: null; }; }; }; } }; 'lost': { name: 'lost'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'PreviewReward'; ofType: null; }; }; }; } }; }; };
312
+ 'PreviewUserPosition': { kind: 'OBJECT'; name: 'PreviewUserPosition'; fields: { 'borrowingPower': { name: 'borrowingPower'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'HealthFactorResult'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; } }; 'netApy': { name: 'netApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberVariation'; ofType: null; }; } }; 'netBalance': { name: 'netBalance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'netCollateral': { name: 'netCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'otherConditions': { name: 'otherConditions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'UserPositionConditionVariation'; ofType: null; }; }; }; } }; 'projectedEarnings': { name: 'projectedEarnings'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountVariation'; ofType: null; }; } }; 'rewards': { name: 'rewards'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PreviewRewardOutcome'; ofType: null; }; } }; 'riskPremium': { name: 'riskPremium'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberVariation'; ofType: null; }; } }; }; };
304
313
  'ProtocolHistoryRequest': { kind: 'INPUT_OBJECT'; name: 'ProtocolHistoryRequest'; isOneOf: false; inputFields: [{ name: 'currency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'Currency'; ofType: null; }; }; defaultValue: "USD" }, { name: 'window'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TimeWindow'; ofType: null; }; }; defaultValue: "LAST_DAY" }]; };
305
314
  'ProtocolHistorySample': { kind: 'OBJECT'; name: 'ProtocolHistorySample'; fields: { 'borrows': { name: 'borrows'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'date': { name: 'date'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'deposits': { name: 'deposits'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; }; };
306
- 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'activities': { name: 'activities'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedActivitiesResult'; ofType: null; }; } }; 'asset': { name: 'asset'; type: { kind: 'OBJECT'; name: 'Asset'; ofType: null; } }; 'assetBorrowHistory': { name: 'assetBorrowHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetBorrowSample'; ofType: null; }; }; }; } }; 'assetPriceHistory': { name: 'assetPriceHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetPriceSample'; ofType: null; }; }; }; } }; 'assetSupplyHistory': { name: 'assetSupplyHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetSupplySample'; ofType: null; }; }; }; } }; 'borrow': { name: 'borrow'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'borrowApyHistory': { name: 'borrowApyHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApySample'; ofType: null; }; }; }; } }; 'borrowSwapQuote': { name: 'borrowSwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'BorrowSwapQuoteResult'; ofType: null; }; } }; 'chain': { name: 'chain'; type: { kind: 'OBJECT'; name: 'Chain'; ofType: null; } }; 'chains': { name: 'chains'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; }; }; } }; 'exchangeRate': { name: 'exchangeRate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'hasProcessedKnownTransaction': { name: 'hasProcessedKnownTransaction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'health': { name: 'health'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'hub': { name: 'hub'; type: { kind: 'OBJECT'; name: 'Hub'; ofType: null; } }; 'hubAssets': { name: 'hubAssets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HubAsset'; ofType: null; }; }; }; } }; 'hubSummaryHistory': { name: 'hubSummaryHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HubSummarySample'; ofType: null; }; }; }; } }; 'hubs': { name: 'hubs'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Hub'; ofType: null; }; }; }; } }; 'liquidatePosition': { name: 'liquidatePosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'LiquidatePositionExecutionPlan'; ofType: null; }; } }; 'preparePositionSwap': { name: 'preparePositionSwap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'PreparePositionSwapResult'; ofType: null; }; } }; 'prepareSwapCancel': { name: 'prepareSwapCancel'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PrepareSwapCancelResult'; ofType: null; }; } }; 'prepareTokenSwap': { name: 'prepareTokenSwap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'PrepareTokenSwapResult'; ofType: null; }; } }; 'preview': { name: 'preview'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PreviewUserPosition'; ofType: null; }; } }; 'protocolHistory': { name: 'protocolHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProtocolHistorySample'; ofType: null; }; }; }; } }; 'renounceSpokeUserPositionManager': { name: 'renounceSpokeUserPositionManager'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'repay': { name: 'repay'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'repayWithSupplyQuote': { name: 'repayWithSupplyQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'RepayWithSupplyQuoteResult'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'OBJECT'; name: 'Reserve'; ofType: null; } }; 'reserves': { name: 'reserves'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Reserve'; ofType: null; }; }; }; } }; 'setSpokeUserPositionManager': { name: 'setSpokeUserPositionManager'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'setUserSuppliesAsCollateral': { name: 'setUserSuppliesAsCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; } }; 'spokePositionManagers': { name: 'spokePositionManagers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedSpokePositionManagerResult'; ofType: null; }; } }; 'spokeUserPositionManagers': { name: 'spokeUserPositionManagers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedSpokeUserPositionManagerResult'; ofType: null; }; } }; 'spokes': { name: 'spokes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; }; }; } }; 'supply': { name: 'supply'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'supplyApyHistory': { name: 'supplyApyHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApySample'; ofType: null; }; }; }; } }; 'supplySwapQuote': { name: 'supplySwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SupplySwapQuoteResult'; ofType: null; }; } }; 'swapStatus': { name: 'swapStatus'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SwapStatus'; ofType: null; }; } }; 'swappableTokens': { name: 'swappableTokens'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'Token'; ofType: null; }; }; }; } }; 'tokenSwapQuote': { name: 'tokenSwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'TokenSwapQuoteResult'; ofType: null; }; } }; 'updateUserPositionConditions': { name: 'updateUserPositionConditions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'userBalances': { name: 'userBalances'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserBalance'; ofType: null; }; }; }; } }; 'userBorrows': { name: 'userBorrows'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserBorrowItem'; ofType: null; }; }; }; } }; 'userPosition': { name: 'userPosition'; type: { kind: 'OBJECT'; name: 'UserPosition'; ofType: null; } }; 'userPositions': { name: 'userPositions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserPosition'; ofType: null; }; }; }; } }; 'userRiskPremiumBreakdown': { name: 'userRiskPremiumBreakdown'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserRiskPremiumBreakdownItem'; ofType: null; }; }; }; } }; 'userSummary': { name: 'userSummary'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserSummary'; ofType: null; }; } }; 'userSummaryHistory': { name: 'userSummaryHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserSummaryHistoryItem'; ofType: null; }; }; }; } }; 'userSupplies': { name: 'userSupplies'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserSupplyItem'; ofType: null; }; }; }; } }; 'userSwaps': { name: 'userSwaps'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedUserSwapsResult'; ofType: null; }; } }; 'withdraw': { name: 'withdraw'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'withdrawSwapQuote': { name: 'withdrawSwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'WithdrawSwapQuoteResult'; ofType: null; }; } }; }; };
315
+ 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'activities': { name: 'activities'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedActivitiesResult'; ofType: null; }; } }; 'asset': { name: 'asset'; type: { kind: 'OBJECT'; name: 'Asset'; ofType: null; } }; 'assetBorrowHistory': { name: 'assetBorrowHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetBorrowSample'; ofType: null; }; }; }; } }; 'assetPriceHistory': { name: 'assetPriceHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetPriceSample'; ofType: null; }; }; }; } }; 'assetSupplyHistory': { name: 'assetSupplyHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetSupplySample'; ofType: null; }; }; }; } }; 'borrow': { name: 'borrow'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'borrowApyHistory': { name: 'borrowApyHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApySample'; ofType: null; }; }; }; } }; 'borrowSwapQuote': { name: 'borrowSwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'BorrowSwapQuoteResult'; ofType: null; }; } }; 'chain': { name: 'chain'; type: { kind: 'OBJECT'; name: 'Chain'; ofType: null; } }; 'chains': { name: 'chains'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; }; }; } }; 'claimRewards': { name: 'claimRewards'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'exchangeRate': { name: 'exchangeRate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'hasProcessedKnownTransaction': { name: 'hasProcessedKnownTransaction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'health': { name: 'health'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'hub': { name: 'hub'; type: { kind: 'OBJECT'; name: 'Hub'; ofType: null; } }; 'hubAssets': { name: 'hubAssets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HubAsset'; ofType: null; }; }; }; } }; 'hubSummaryHistory': { name: 'hubSummaryHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HubSummarySample'; ofType: null; }; }; }; } }; 'hubs': { name: 'hubs'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Hub'; ofType: null; }; }; }; } }; 'liquidatePosition': { name: 'liquidatePosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'LiquidatePositionExecutionPlan'; ofType: null; }; } }; 'preparePositionSwap': { name: 'preparePositionSwap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'PreparePositionSwapResult'; ofType: null; }; } }; 'prepareSwapCancel': { name: 'prepareSwapCancel'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PrepareSwapCancelResult'; ofType: null; }; } }; 'prepareTokenSwap': { name: 'prepareTokenSwap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'PrepareTokenSwapResult'; ofType: null; }; } }; 'preview': { name: 'preview'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PreviewUserPosition'; ofType: null; }; } }; 'protocolHistory': { name: 'protocolHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProtocolHistorySample'; ofType: null; }; }; }; } }; 'renounceSpokeUserPositionManager': { name: 'renounceSpokeUserPositionManager'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'repay': { name: 'repay'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'repayWithSupplyQuote': { name: 'repayWithSupplyQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'RepayWithSupplyQuoteResult'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'OBJECT'; name: 'Reserve'; ofType: null; } }; 'reserves': { name: 'reserves'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Reserve'; ofType: null; }; }; }; } }; 'setSpokeUserPositionManager': { name: 'setSpokeUserPositionManager'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'setUserSuppliesAsCollateral': { name: 'setUserSuppliesAsCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; } }; 'spokePositionManagers': { name: 'spokePositionManagers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedSpokePositionManagerResult'; ofType: null; }; } }; 'spokeUserPositionManagers': { name: 'spokeUserPositionManagers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedSpokeUserPositionManagerResult'; ofType: null; }; } }; 'spokes': { name: 'spokes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; }; }; } }; 'supply': { name: 'supply'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'supplyApyHistory': { name: 'supplyApyHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ApySample'; ofType: null; }; }; }; } }; 'supplySwapQuote': { name: 'supplySwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SupplySwapQuoteResult'; ofType: null; }; } }; 'swapStatus': { name: 'swapStatus'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SwapStatus'; ofType: null; }; } }; 'swappableTokens': { name: 'swappableTokens'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'Token'; ofType: null; }; }; }; } }; 'tokenSwapQuote': { name: 'tokenSwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'TokenSwapQuoteResult'; ofType: null; }; } }; 'updateUserPositionConditions': { name: 'updateUserPositionConditions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'userBalances': { name: 'userBalances'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserBalance'; ofType: null; }; }; }; } }; 'userBorrows': { name: 'userBorrows'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserBorrowItem'; ofType: null; }; }; }; } }; 'userClaimableRewards': { name: 'userClaimableRewards'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'UserClaimableReward'; ofType: null; }; }; }; } }; 'userPosition': { name: 'userPosition'; type: { kind: 'OBJECT'; name: 'UserPosition'; ofType: null; } }; 'userPositions': { name: 'userPositions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserPosition'; ofType: null; }; }; }; } }; 'userRiskPremiumBreakdown': { name: 'userRiskPremiumBreakdown'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserRiskPremiumBreakdownItem'; ofType: null; }; }; }; } }; 'userSummary': { name: 'userSummary'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserSummary'; ofType: null; }; } }; 'userSummaryHistory': { name: 'userSummaryHistory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserSummaryHistoryItem'; ofType: null; }; }; }; } }; 'userSupplies': { name: 'userSupplies'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'UserSupplyItem'; ofType: null; }; }; }; } }; 'userSwaps': { name: 'userSwaps'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PaginatedUserSwapsResult'; ofType: null; }; } }; 'withdraw': { name: 'withdraw'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'ExecutionPlan'; ofType: null; }; } }; 'withdrawSwapQuote': { name: 'withdrawSwapQuote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'WithdrawSwapQuoteResult'; ofType: null; }; } }; }; };
307
316
  'QuoteAccuracy': { name: 'QuoteAccuracy'; enumValues: 'FAST' | 'ACCURATE'; };
308
317
  'RenounceSpokeUserPositionManagerRequest': { kind: 'INPUT_OBJECT'; name: 'RenounceSpokeUserPositionManagerRequest'; isOneOf: false; inputFields: [{ name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SpokeId'; ofType: null; }; }; defaultValue: null }, { name: 'manager'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'managing'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
309
318
  'RepayActivity': { kind: 'OBJECT'; name: 'RepayActivity'; fields: { 'chain': { name: 'chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'repaid': { name: 'repaid'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'timestamp': { name: 'timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; }; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
@@ -327,12 +336,14 @@ type introspection_types = {
327
336
  'ReserveRequestQuery': { kind: 'INPUT_OBJECT'; name: 'ReserveRequestQuery'; isOneOf: true; inputFields: [{ name: 'reserveId'; type: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; defaultValue: null }, { name: 'reserveInput'; type: { kind: 'INPUT_OBJECT'; name: 'ReserveInput'; ofType: null; }; defaultValue: null }]; };
328
337
  'ReserveSettings': { kind: 'OBJECT'; name: 'ReserveSettings'; fields: { 'borrowable': { name: 'borrowable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'collateral': { name: 'collateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'collateralFactor': { name: 'collateralFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'collateralRisk': { name: 'collateralRisk'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'latestDynamicConfigKey': { name: 'latestDynamicConfigKey'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DynamicConfigKey'; ofType: null; }; } }; 'liquidationFee': { name: 'liquidationFee'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'maxLiquidationBonus': { name: 'maxLiquidationBonus'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'suppliable': { name: 'suppliable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
329
338
  'ReserveStatus': { kind: 'OBJECT'; name: 'ReserveStatus'; fields: { 'active': { name: 'active'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'frozen': { name: 'frozen'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'paused': { name: 'paused'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
330
- 'ReserveSummary': { kind: 'OBJECT'; name: 'ReserveSummary'; fields: { 'borrowApy': { name: 'borrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'borrowed': { name: 'borrowed'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'supplied': { name: 'supplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'supplyApy': { name: 'supplyApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
339
+ 'ReserveSummary': { kind: 'OBJECT'; name: 'ReserveSummary'; fields: { 'borrowApy': { name: 'borrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'borrowed': { name: 'borrowed'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'rewards': { name: 'rewards'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'Reward'; ofType: null; }; }; }; } }; 'supplied': { name: 'supplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'supplyApy': { name: 'supplyApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
331
340
  'ReserveUserState': { kind: 'OBJECT'; name: 'ReserveUserState'; fields: { 'balance': { name: 'balance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'borrowApy': { name: 'borrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'borrowable': { name: 'borrowable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'collateralFactor': { name: 'collateralFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'dynamicConfigKey': { name: 'dynamicConfigKey'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DynamicConfigKey'; ofType: null; }; } }; 'liquidationFee': { name: 'liquidationFee'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'maxLiquidationBonus': { name: 'maxLiquidationBonus'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'suppliable': { name: 'suppliable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; }; };
332
341
  'ReservesRequest': { kind: 'INPUT_OBJECT'; name: 'ReservesRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ReservesRequestQuery'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; defaultValue: null }, { name: 'filter'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'ReservesRequestFilter'; ofType: null; }; }; defaultValue: "ALL" }, { name: 'orderBy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ReservesRequestOrderBy'; ofType: null; }; }; defaultValue: "{assetName: ASC}" }]; };
333
342
  'ReservesRequestFilter': { name: 'ReservesRequestFilter'; enumValues: 'SUPPLY' | 'BORROW' | 'COLLATERAL' | 'ALL'; };
334
343
  'ReservesRequestOrderBy': { kind: 'INPUT_OBJECT'; name: 'ReservesRequestOrderBy'; isOneOf: true; inputFields: [{ name: 'assetName'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'userBalance'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'supplyApy'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'supplyAvailable'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'borrowApy'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'borrowAvailable'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'collateralFactor'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }]; };
335
344
  'ReservesRequestQuery': { kind: 'INPUT_OBJECT'; name: 'ReservesRequestQuery'; isOneOf: true; inputFields: [{ name: 'spoke'; type: { kind: 'INPUT_OBJECT'; name: 'SpokeInput'; ofType: null; }; defaultValue: null }, { name: 'spokeId'; type: { kind: 'SCALAR'; name: 'SpokeId'; ofType: null; }; defaultValue: null }, { name: 'tokens'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'Erc20Input'; ofType: null; }; }; }; defaultValue: null }, { name: 'hubToken'; type: { kind: 'INPUT_OBJECT'; name: 'HubTokenInput'; ofType: null; }; defaultValue: null }, { name: 'hubIdToken'; type: { kind: 'INPUT_OBJECT'; name: 'HubIdTokenInput'; ofType: null; }; defaultValue: null }, { name: 'chainIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; defaultValue: null }, { name: 'spokeToken'; type: { kind: 'INPUT_OBJECT'; name: 'SpokeTokenInput'; ofType: null; }; defaultValue: null }, { name: 'hub'; type: { kind: 'INPUT_OBJECT'; name: 'HubInput'; ofType: null; }; defaultValue: null }, { name: 'hubId'; type: { kind: 'SCALAR'; name: 'HubId'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }, { name: 'chainTokenCategories'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ChainTokenCategories'; ofType: null; }; }; }; defaultValue: null }]; };
345
+ 'Reward': { kind: 'UNION'; name: 'Reward'; fields: {}; possibleTypes: 'MerklBorrowReward' | 'MerklSupplyReward'; };
346
+ 'RewardId': unknown;
336
347
  'SetSpokeUserPositionManagerRequest': { kind: 'INPUT_OBJECT'; name: 'SetSpokeUserPositionManagerRequest'; isOneOf: false; inputFields: [{ name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SpokeId'; ofType: null; }; }; defaultValue: null }, { name: 'manager'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'approve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'signature'; type: { kind: 'INPUT_OBJECT'; name: 'ERC20PermitSignature'; ofType: null; }; defaultValue: null }]; };
337
348
  'SetUserSuppliesAsCollateralRequest': { kind: 'INPUT_OBJECT'; name: 'SetUserSuppliesAsCollateralRequest'; isOneOf: false; inputFields: [{ name: 'changes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserSupplyAsCollateral'; ofType: null; }; }; }; }; defaultValue: null }, { name: 'sender'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
338
349
  'Signature': unknown;
@@ -423,8 +434,11 @@ type introspection_types = {
423
434
  'UserBorrowsRequestOrderBy': { kind: 'INPUT_OBJECT'; name: 'UserBorrowsRequestOrderBy'; isOneOf: true; inputFields: [{ name: 'assetName'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'created'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'amount'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }, { name: 'apy'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: null }]; };
424
435
  'UserBorrowsRequestQuery': { kind: 'INPUT_OBJECT'; name: 'UserBorrowsRequestQuery'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'userToken'; type: { kind: 'INPUT_OBJECT'; name: 'UserToken'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }, { name: 'userChains'; type: { kind: 'INPUT_OBJECT'; name: 'UserChains'; ofType: null; }; defaultValue: null }, { name: 'userHub'; type: { kind: 'INPUT_OBJECT'; name: 'UserHub'; ofType: null; }; defaultValue: null }]; };
425
436
  'UserChains': { kind: 'INPUT_OBJECT'; name: 'UserChains'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'chainIds'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; }; defaultValue: null }]; };
437
+ 'UserClaimableReward': { kind: 'UNION'; name: 'UserClaimableReward'; fields: {}; possibleTypes: 'UserMerklClaimableReward'; };
438
+ 'UserClaimableRewardsRequest': { kind: 'INPUT_OBJECT'; name: 'UserClaimableRewardsRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
426
439
  'UserHub': { kind: 'INPUT_OBJECT'; name: 'UserHub'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'hub'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserHubInput'; ofType: null; }; }; defaultValue: null }]; };
427
440
  'UserHubInput': { kind: 'INPUT_OBJECT'; name: 'UserHubInput'; isOneOf: true; inputFields: [{ name: 'input'; type: { kind: 'INPUT_OBJECT'; name: 'HubInput'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'SCALAR'; name: 'HubId'; ofType: null; }; defaultValue: null }]; };
441
+ 'UserMerklClaimableReward': { kind: 'OBJECT'; name: 'UserMerklClaimableReward'; fields: { 'claimUntil': { name: 'claimUntil'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'claimable': { name: 'claimable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'endDate': { name: 'endDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; } }; 'startDate': { name: 'startDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
428
442
  'UserPosition': { kind: 'OBJECT'; name: 'UserPosition'; fields: { 'averageCollateralFactor': { name: 'averageCollateralFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'borrowingPower': { name: 'borrowingPower'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'canUpdateDynamicConfig': { name: 'canUpdateDynamicConfig'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HealthFactorWithChange'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; } }; 'liquidationPrice': { name: 'liquidationPrice'; type: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; } }; 'netAccruedInterest': { name: 'netAccruedInterest'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'netApy': { name: 'netApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'netBalance': { name: 'netBalance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'netBalancePercentChange': { name: 'netBalancePercentChange'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'netBorrowApy': { name: 'netBorrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberWithChange'; ofType: null; }; } }; 'netCollateral': { name: 'netCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'netSupplyApy': { name: 'netSupplyApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumberWithChange'; ofType: null; }; } }; 'riskPremium': { name: 'riskPremium'; type: { kind: 'OBJECT'; name: 'UserPositionRiskPremium'; ofType: null; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'totalCollateral': { name: 'totalCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'totalDebt': { name: 'totalDebt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'totalSupplied': { name: 'totalSupplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmountWithChange'; ofType: null; }; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
429
443
  'UserPositionConditionVariation': { kind: 'UNION'; name: 'UserPositionConditionVariation'; fields: {}; possibleTypes: 'CollateralFactorVariation' | 'LiquidationFeeVariation' | 'MaxLiquidationBonusVariation'; };
430
444
  'UserPositionConditionsUpdate': { name: 'UserPositionConditionsUpdate'; enumValues: 'ALL_DYNAMIC_CONFIG' | 'JUST_RISK_PREMIUM'; };
@@ -5524,7 +5538,7 @@ declare const SwapCancelledFragment: gql_tada.TadaDocumentNode<{
5524
5538
  };
5525
5539
  } | null;
5526
5540
  };
5527
- } | null;
5541
+ };
5528
5542
  amount: {
5529
5543
  __typename: "Erc20Amount";
5530
5544
  token: {
@@ -6004,7 +6018,7 @@ declare const SwapCancelledFragment: gql_tada.TadaDocumentNode<{
6004
6018
  };
6005
6019
  } | null;
6006
6020
  };
6007
- } | null;
6021
+ };
6008
6022
  amount: {
6009
6023
  __typename: "Erc20Amount";
6010
6024
  token: {
@@ -6488,7 +6502,7 @@ declare const SwapCancelledFragment: gql_tada.TadaDocumentNode<{
6488
6502
  };
6489
6503
  } | null;
6490
6504
  };
6491
- } | null;
6505
+ };
6492
6506
  amount: {
6493
6507
  __typename: "Erc20Amount";
6494
6508
  token: {
@@ -6968,7 +6982,7 @@ declare const SwapCancelledFragment: gql_tada.TadaDocumentNode<{
6968
6982
  };
6969
6983
  } | null;
6970
6984
  };
6971
- } | null;
6985
+ };
6972
6986
  amount: {
6973
6987
  __typename: "Erc20Amount";
6974
6988
  token: {
@@ -7452,7 +7466,7 @@ declare const SwapCancelledFragment: gql_tada.TadaDocumentNode<{
7452
7466
  };
7453
7467
  } | null;
7454
7468
  };
7455
- } | null;
7469
+ };
7456
7470
  amount: {
7457
7471
  __typename: "Erc20Amount";
7458
7472
  token: {
@@ -7932,7 +7946,7 @@ declare const SwapCancelledFragment: gql_tada.TadaDocumentNode<{
7932
7946
  };
7933
7947
  } | null;
7934
7948
  };
7935
- } | null;
7949
+ };
7936
7950
  amount: {
7937
7951
  __typename: "Erc20Amount";
7938
7952
  token: {
@@ -8416,7 +8430,7 @@ declare const SwapCancelledFragment: gql_tada.TadaDocumentNode<{
8416
8430
  };
8417
8431
  } | null;
8418
8432
  };
8419
- } | null;
8433
+ };
8420
8434
  amount: {
8421
8435
  __typename: "Erc20Amount";
8422
8436
  token: {
@@ -9262,7 +9276,7 @@ declare const SwapOpenFragment: gql_tada.TadaDocumentNode<{
9262
9276
  };
9263
9277
  } | null;
9264
9278
  };
9265
- } | null;
9279
+ };
9266
9280
  amount: {
9267
9281
  __typename: "Erc20Amount";
9268
9282
  token: {
@@ -9742,7 +9756,7 @@ declare const SwapOpenFragment: gql_tada.TadaDocumentNode<{
9742
9756
  };
9743
9757
  } | null;
9744
9758
  };
9745
- } | null;
9759
+ };
9746
9760
  amount: {
9747
9761
  __typename: "Erc20Amount";
9748
9762
  token: {
@@ -10226,7 +10240,7 @@ declare const SwapOpenFragment: gql_tada.TadaDocumentNode<{
10226
10240
  };
10227
10241
  } | null;
10228
10242
  };
10229
- } | null;
10243
+ };
10230
10244
  amount: {
10231
10245
  __typename: "Erc20Amount";
10232
10246
  token: {
@@ -10706,7 +10720,7 @@ declare const SwapOpenFragment: gql_tada.TadaDocumentNode<{
10706
10720
  };
10707
10721
  } | null;
10708
10722
  };
10709
- } | null;
10723
+ };
10710
10724
  amount: {
10711
10725
  __typename: "Erc20Amount";
10712
10726
  token: {
@@ -11190,7 +11204,7 @@ declare const SwapOpenFragment: gql_tada.TadaDocumentNode<{
11190
11204
  };
11191
11205
  } | null;
11192
11206
  };
11193
- } | null;
11207
+ };
11194
11208
  amount: {
11195
11209
  __typename: "Erc20Amount";
11196
11210
  token: {
@@ -11670,7 +11684,7 @@ declare const SwapOpenFragment: gql_tada.TadaDocumentNode<{
11670
11684
  };
11671
11685
  } | null;
11672
11686
  };
11673
- } | null;
11687
+ };
11674
11688
  amount: {
11675
11689
  __typename: "Erc20Amount";
11676
11690
  token: {
@@ -12154,7 +12168,7 @@ declare const SwapOpenFragment: gql_tada.TadaDocumentNode<{
12154
12168
  };
12155
12169
  } | null;
12156
12170
  };
12157
- } | null;
12171
+ };
12158
12172
  amount: {
12159
12173
  __typename: "Erc20Amount";
12160
12174
  token: {
package/dist/testing.js CHANGED
@@ -1,3 +1,3 @@
1
- import {bigDecimal,evmAddress,chainId,invariant}from'@aave/types';function u(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserBorrowItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserBorrowItemId must be valid base64: ${e}`),e}function y(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserSupplyItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserSupplyItemId must be valid base64: ${e}`),e}function S(e){return invariant(typeof e=="string"&&e.length>0,`Invalid TokenInfoId: ${e}`),e}function a(){return btoa(crypto.randomUUID())}function q(){return u(a())}function N(){return y(a())}function O(){return a()}function T(e,t=6){let o=bigDecimal(e);return {__typename:"PercentNumber",value:o.div(2),normalized:o,onChainValue:BigInt(o.rescale(t).toApproximateNumber()),decimals:t}}function g(e,t=18){return {__typename:"DecimalNumber",value:bigDecimal(e),onChainValue:BigInt(bigDecimal(e).rescale(t).toApproximateNumber()),decimals:t}}function k(e){return [...Array(e)].map(()=>Math.floor(Math.random()*16).toString(16)).join("")}function r(){return evmAddress(`0x${k(40)}`)}var i={WETH:{name:"Wrapped Ether",decimals:18,address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",isWrappedNativeToken:true},USDC:{name:"USD Coin",decimals:6,address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",isWrappedNativeToken:false},GHO:{name:"Gho Token",decimals:18,address:"0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",isWrappedNativeToken:false},AAVE:{name:"Aave Token",decimals:18,address:"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",isWrappedNativeToken:false}};function l(e){let{name:t,decimals:o}=i[e];return {__typename:"TokenInfo",id:S(a()),name:t,symbol:e,decimals:o,icon:"https://example.com/icon.png",categories:[]}}function A(){return {__typename:"Chain",name:"Ethereum",icon:"https://example.com/icon.png",chainId:chainId(1),rpcUrl:"https://example.com/rpc.json",explorerUrl:"https://example.com/explorer.json",isTestnet:false,isFork:false,nativeWrappedToken:r(),nativeGateway:r(),signatureGateway:r(),nativeInfo:l("WETH")}}function h(e){let{isWrappedNativeToken:t}=i[e];return {__typename:"Erc20Token",address:r(),chain:A(),info:l(e),isWrappedNativeToken:t}}function b(e){return {__typename:"ExchangeAmount",value:bigDecimal(e),name:"USD",symbol:"$",icon:"https://example.com/icon.png",decimals:2}}function n(e,t){return {__typename:"Erc20Amount",amount:g(e,i[t].decimals),token:h(t),exchange:b(e),exchangeRate:g(e)}}function c({chainId:e=chainId(1),from:t=r()}={}){return {__typename:"TransactionRequest",to:t,from:t,data:"0x",value:0n,chainId:e,operations:[]}}function I(){return {__typename:"SwapTypedData",primaryType:"Swap",types:{Swap:[{name:"amount",type:"uint256"},{name:"deadline",type:"uint256"}]},domain:{__typename:"DomainData",name:"Swap",version:"1",chainId:chainId(1),verifyingContract:r()},message:{amount:"1000000000000000000",deadline:1234567890}}}function w(){return a()}function m({accuracy:e="ACCURATE",buyAmount:t=1e3}={}){return {__typename:"SwapQuote",accuracy:e,quoteId:w(),suggestedSlippage:T(.01),selectedSlippage:null,buy:n(t,"USDC"),sell:n(1e3,"WETH"),costs:{__typename:"SwapQuoteCosts",networkCosts:n(1e3,"WETH"),partnerFee:n(1e3,"USDC"),flashloanFee:n(1e3,"WETH"),providerFee:n(1e3,"USDC")},finalBuy:n(t,"USDC"),finalSell:n(1e3,"WETH")}}function C(){return {__typename:"SwapReceipt",id:a(),createdAt:new Date,explorerUrl:"https://example.com/explorer.json"}}function x(){return {__typename:"TokenSwap",sell:n(1e3,"WETH"),buy:n(1e3,"USDC"),kind:"SELL",orderClass:"MARKET"}}function Q(){return {__typename:"SwapOpen",swapId:a(),createdAt:new Date,deadline:new Date(Date.now()+36e5),explorerUrl:"https://example.com/explorer.json",operation:x()}}function W(){return {__typename:"SwapCancelled",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json",operation:x()}}function z(){return {__typename:"SwapCancelledResult",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json"}}function M({bySignature:e=I()}={}){return {__typename:"PositionSwapAdapterContractApproval",bySignature:e}}function Z({bySignature:e=I(),byTransaction:t=c()}={}){return {__typename:"PositionSwapPositionManagerApproval",bySignature:e,byTransaction:t}}function j({transaction:e=c()}={}){return {__typename:"SwapTransactionRequest",transaction:e,orderReceipt:C()}}function F(){return {__typename:"SwapByTransaction",quote:m()}}function G({quote:e=m()}={}){return {__typename:"SwapByIntent",quote:e}}function V(){return {__typename:"PrepareSwapOrder",newQuoteId:w(),data:I()}}function _(){return {__typename:"PermitTypedData",types:{EIP712Domain:[{name:"name",type:"string"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{__typename:"DomainData",name:"Permit",version:"1",chainId:chainId(1),verifyingContract:r()},message:{owner:r(),spender:r(),value:"1000000000000000000",nonce:"0",deadline:1234567890}}}function D({byTransaction:e=c()}={}){return {__typename:"Erc20Approval",byTransaction:e,bySignature:_()}}function K({approval:e=D()}={}){return {__typename:"SwapByIntentWithApprovalRequired",quote:m(),approvals:[e]}}
2
- export{i as TestTokens,g as decimalNumber,A as makeChain,n as makeErc20Amount,D as makeErc20Approval,h as makeErc20Token,b as makeExchangeAmount,_ as makePermitTypedData,M as makePositionSwapAdapterContractApproval,Z as makePositionSwapPositionManagerApproval,V as makePrepareSwapOrder,O as makeReserveId,G as makeSwapByIntent,K as makeSwapByIntentWithApprovalRequired,F as makeSwapByTransaction,W as makeSwapCancelled,z as makeSwapCancelledResult,Q as makeSwapOpen,m as makeSwapQuote,C as makeSwapReceipt,j as makeSwapTransactionRequest,I as makeSwapTypedData,l as makeTokenInfo,x as makeTokenSwap,c as makeTransactionRequest,q as makeUserBorrowItemId,N as makeUserSupplyItemId,T as percentNumber,r as randomEvmAddress};//# sourceMappingURL=testing.js.map
1
+ import {bigDecimal,evmAddress,chainId,invariant}from'@aave/types';function u(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserBorrowItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserBorrowItemId must be valid base64: ${e}`),e}function y(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserSupplyItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserSupplyItemId must be valid base64: ${e}`),e}function g(e){return invariant(typeof e=="string"&&e.length>0,`Invalid TokenInfoId: ${e}`),e}function a(){return btoa(crypto.randomUUID())}function q(){return u(a())}function N(){return y(a())}function O(){return a()}function T(e,t=6){let o=bigDecimal(e);return {__typename:"PercentNumber",value:o.div(2),normalized:o,onChainValue:BigInt(o.rescale(t).toApproximateNumber()),decimals:t}}function S(e,t=18){return {__typename:"DecimalNumber",value:bigDecimal(e),onChainValue:BigInt(bigDecimal(e).rescale(t).toApproximateNumber()),decimals:t}}function k(e){return [...Array(e)].map(()=>Math.floor(Math.random()*16).toString(16)).join("")}function r(){return evmAddress(`0x${k(40)}`)}var i={WETH:{name:"Wrapped Ether",decimals:18,address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",isWrappedNativeToken:true},USDC:{name:"USD Coin",decimals:6,address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",isWrappedNativeToken:false},GHO:{name:"Gho Token",decimals:18,address:"0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",isWrappedNativeToken:false},AAVE:{name:"Aave Token",decimals:18,address:"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",isWrappedNativeToken:false}};function l(e){let{name:t,decimals:o}=i[e];return {__typename:"TokenInfo",id:g(a()),name:t,symbol:e,decimals:o,icon:"https://example.com/icon.png",categories:[]}}function A(){return {__typename:"Chain",name:"Ethereum",icon:"https://example.com/icon.png",chainId:chainId(1),rpcUrl:"https://example.com/rpc.json",explorerUrl:"https://example.com/explorer.json",isTestnet:false,isFork:false,nativeWrappedToken:r(),nativeGateway:r(),signatureGateway:r(),nativeInfo:l("WETH")}}function h(e){let{isWrappedNativeToken:t}=i[e];return {__typename:"Erc20Token",address:r(),chain:A(),info:l(e),isWrappedNativeToken:t}}function b(e){return {__typename:"ExchangeAmount",value:bigDecimal(e),name:"USD",symbol:"$",icon:"https://example.com/icon.png",decimals:2}}function n(e,t){return {__typename:"Erc20Amount",amount:S(e,i[t].decimals),token:h(t),exchange:b(e),exchangeRate:S(e)}}function c({chainId:e=chainId(1),from:t=r()}={}){return {__typename:"TransactionRequest",to:t,from:t,data:"0x",value:0n,chainId:e,operations:[]}}function I(){return {__typename:"SwapTypedData",primaryType:"Swap",types:{Swap:[{name:"amount",type:"uint256"},{name:"deadline",type:"uint256"}]},domain:{__typename:"DomainData",name:"Swap",version:"1",chainId:chainId(1),verifyingContract:r()},message:{amount:"1000000000000000000",deadline:1234567890}}}function w(){return a()}function m({accuracy:e="ACCURATE",buyAmount:t=1e3}={}){return {__typename:"SwapQuote",accuracy:e,quoteId:w(),suggestedSlippage:T(.01),selectedSlippage:null,buy:n(t,"USDC"),sell:n(1e3,"WETH"),costs:{__typename:"SwapQuoteCosts",networkCosts:n(1e3,"WETH"),partnerFee:n(1e3,"USDC"),flashloanFee:n(1e3,"WETH"),providerFee:n(1e3,"USDC")},finalBuy:n(t,"USDC"),finalSell:n(1e3,"WETH")}}function C(){return {__typename:"SwapReceipt",id:a(),createdAt:new Date,explorerUrl:"https://example.com/explorer.json"}}function x(){return {__typename:"TokenSwap",sell:n(1e3,"WETH"),buy:n(1e3,"USDC"),kind:"SELL",orderClass:"MARKET"}}function Q(){return {__typename:"SwapOpen",swapId:a(),createdAt:new Date,deadline:new Date(Date.now()+36e5),explorerUrl:"https://example.com/explorer.json",operation:x()}}function W(){return {__typename:"SwapCancelled",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json",operation:x()}}function z(){return {__typename:"SwapCancelledResult",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json"}}function M({bySignature:e=I()}={}){return {__typename:"PositionSwapAdapterContractApproval",bySignature:e}}function Z({bySignature:e=I(),byTransaction:t=c()}={}){return {__typename:"PositionSwapPositionManagerApproval",bySignature:e,byTransaction:t}}function j({transaction:e=c()}={}){return {__typename:"SwapTransactionRequest",transaction:e,orderReceipt:C()}}function F(){return {__typename:"SwapByTransaction",quote:m()}}function G({quote:e=m()}={}){return {__typename:"SwapByIntent",quote:e}}function V(){return {__typename:"PrepareSwapOrder",newQuoteId:w(),data:I()}}function _(){return {__typename:"PermitTypedData",types:{EIP712Domain:[{name:"name",type:"string"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{__typename:"DomainData",name:"Permit",version:"1",chainId:chainId(1),verifyingContract:r()},message:{owner:r(),spender:r(),value:"1000000000000000000",nonce:"0",deadline:1234567890}}}function D({byTransaction:e=c()}={}){return {__typename:"Erc20Approval",byTransaction:e,bySignature:_()}}function K({approval:e=D()}={}){return {__typename:"SwapByIntentWithApprovalRequired",quote:m(),approvals:[e]}}
2
+ export{i as TestTokens,S as decimalNumber,A as makeChain,n as makeErc20Amount,D as makeErc20Approval,h as makeErc20Token,b as makeExchangeAmount,_ as makePermitTypedData,M as makePositionSwapAdapterContractApproval,Z as makePositionSwapPositionManagerApproval,V as makePrepareSwapOrder,O as makeReserveId,G as makeSwapByIntent,K as makeSwapByIntentWithApprovalRequired,F as makeSwapByTransaction,W as makeSwapCancelled,z as makeSwapCancelledResult,Q as makeSwapOpen,m as makeSwapQuote,C as makeSwapReceipt,j as makeSwapTransactionRequest,I as makeSwapTypedData,l as makeTokenInfo,x as makeTokenSwap,c as makeTransactionRequest,q as makeUserBorrowItemId,N as makeUserSupplyItemId,T as percentNumber,r as randomEvmAddress};//# sourceMappingURL=testing.js.map
3
3
  //# sourceMappingURL=testing.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/id.ts","../src/testing.ts"],"names":["userBorrowItemId","value","invariant","userSupplyItemId","tokenInfoId","randomBase64String","makeUserBorrowItemId","makeUserSupplyItemId","makeReserveId","percentNumber","decimals","normalized","bigDecimal","decimalNumber","randomHexString","size","randomEvmAddress","evmAddress","TestTokens","makeTokenInfo","symbol","name","makeChain","toChainId","makeErc20Token","isWrappedNativeToken","makeExchangeAmount","makeErc20Amount","makeTransactionRequest","chainId","from","makeSwapTypedData","makeQuoteId","makeSwapQuote","accuracy","buyAmount","makeSwapReceipt","makeTokenSwap","makeSwapOpen","makeSwapCancelled","makeSwapCancelledResult","makePositionSwapAdapterContractApproval","bySignature","makePositionSwapPositionManagerApproval","byTransaction","makeSwapTransactionRequest","transaction","makeSwapByTransaction","makeSwapByIntent","quote","makePrepareSwapOrder","makePermitTypedData","makeErc20Approval","makeSwapByIntentWithApprovalRequired","approval"],"mappings":"kEA6YO,SAASA,CAAAA,CAAiBC,CAAAA,CAAiC,CAChE,OAAAC,SAAAA,CACE,OAAOD,CAAAA,EAAU,QAAA,EAAYA,CAAAA,CAAM,OAAS,CAAA,CAC5C,CAAA,0BAAA,EAA6BA,CAAK,CAAA,CACpC,CAAA,CAEAC,SAAAA,CACE,wBAAA,CAAyB,IAAA,CAAKD,CAAK,CAAA,CACnC,CAAA,uCAAA,EAA0CA,CAAK,CAAA,CACjD,CAAA,CACOA,CACT,CAcO,SAASE,CAAAA,CAAiBF,CAAAA,CAAiC,CAChE,OAAAC,SAAAA,CACE,OAAOD,CAAAA,EAAU,QAAA,EAAYA,CAAAA,CAAM,MAAA,CAAS,CAAA,CAC5C,CAAA,0BAAA,EAA6BA,CAAK,CAAA,CACpC,CAAA,CAEAC,SAAAA,CACE,wBAAA,CAAyB,IAAA,CAAKD,CAAK,CAAA,CACnC,CAAA,uCAAA,EAA0CA,CAAK,CAAA,CACjD,CAAA,CACOA,CACT,CAUO,SAASG,EAAYH,CAAAA,CAA4B,CACtD,OAAAC,SAAAA,CACE,OAAOD,CAAAA,EAAU,QAAA,EAAYA,CAAAA,CAAM,MAAA,CAAS,CAAA,CAC5C,CAAA,qBAAA,EAAwBA,CAAK,CAAA,CAC/B,CAAA,CACOA,CACT,CCjZA,SAASI,CAAAA,EAA6B,CACpC,OAAO,IAAA,CAAK,MAAA,CAAO,UAAA,EAAY,CACjC,CAKO,SAASC,CAAAA,EAAyC,CACvD,OAAON,CAAAA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AA,CAAa,QAAA,CACb,MAAA,CAAQ,CACN,UAAA,CAAY,YAAA,CACZ,KAAM,QAAA,CACN,OAAA,CAAS,GAAA,CACT,OAAA,CAAS5B,OAAAA,CAAU,CAAC,CAAA,CACpB,iBAAA,CAAmBP,CAAAA,EACrB,CAAA,CACA,OAAA,CAAS,CACP,KAAA,CAAOA,GAAiB,CACxB,OAAA,CAASA,CAAAA,EAAiB,CAC1B,KAAA,CAAO,qBAAA,CACP,KAAA,CAAO,GAAA,CACP,QAAA,CAAU,UACZ,CACF,CACF,CAKO,SAASoC,EAAkB,CAChC,aAAA,CAAAR,CAAAA,CAAgBhB,CAAAA,EAClB,CAAA,CAEI,EAAC,CAAkB,CACrB,OAAO,CACL,UAAA,CAAY,eAAA,CACZ,aAAA,CAAAgB,EACA,WAAA,CAAaO,CAAAA,EACf,CACF,CAKO,SAASE,CAAAA,CAAqC,CACnD,QAAA,CAAAC,CAAAA,CAAWF,CAAAA,EACb,CAAA,CAEI,GAAsC,CACxC,OAAO,CACL,UAAA,CAAY,kCAAA,CACZ,KAAA,CAAOnB,CAAAA,EAAc,CACrB,SAAA,CAAW,CAACqB,CAAQ,CACtB,CACF","file":"testing.js","sourcesContent":["import {\n type ChainId,\n chainId,\n type EvmAddress,\n evmAddress,\n invariant,\n isValidHexString,\n} from '@aave/types';\nimport type { Tagged } from 'type-fest';\n\n/**\n * An identifier.\n */\nexport type ID = Tagged<string, 'ID'>;\n\n/**\n * A base64 encoded composite identifier.\n *\n * @internal\n */\nexport type Base64EncodedCompositeId = Tagged<\n string,\n 'Base64EncodedCompositeId'\n>;\n\nfunction decodeBase64(value: Base64EncodedCompositeId): string {\n return new TextDecoder().decode(\n Uint8Array.from(atob(value), (c) => c.charCodeAt(0)),\n );\n}\n\nfunction encodeBase64(value: string): Base64EncodedCompositeId {\n return btoa(\n String.fromCharCode(...new TextEncoder().encode(value)),\n ) as Base64EncodedCompositeId;\n}\n\nconst COMPOSITE_ID_SEPARATOR = '::';\n\n/**\n * An asset identifier.\n */\nexport type AssetId = Tagged<Base64EncodedCompositeId, 'AssetId'>;\n\n/**\n * Creates an asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Asset.id` retrieved from another API call.\n */\nexport function assetId(value: string): AssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid AssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `AssetId must be valid base64: ${value}`,\n );\n return value as AssetId;\n}\n\n/**\n * A hub identifier.\n */\nexport type HubId = Tagged<Base64EncodedCompositeId, 'HubId'>;\n\n/**\n * Creates a hub identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Hub.id` retrieved from another API call.\n */\nexport function hubId(value: string): HubId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubId must be valid base64: ${value}`,\n );\n return value as HubId;\n}\n\n/**\n * @internal\n */\nexport type HubIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeHubId(hub: HubIdParts): HubId {\n return hubId(\n encodeBase64(`${hub.chainId}${COMPOSITE_ID_SEPARATOR}${hub.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeHubId(value: HubId): HubIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * A hub asset identifier.\n */\nexport type HubAssetId = Tagged<Base64EncodedCompositeId, 'HubAssetId'>;\n\n/**\n * Creates a hub asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `HubAsset.id` retrieved from another API call.\n */\nexport function hubAssetId(value: string): HubAssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubAssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubAssetId must be valid base64: ${value}`,\n );\n return value as HubAssetId;\n}\n\n/**\n * The on-chain ID of a HubAsset. This is scoped to the specific Hub.\n */\nexport type OnChainHubAssetId = Tagged<number, 'OnChainHubAssetId'>;\n\n/**\n * The on-chain ID of a Reserve. This is scoped to the specific Spoke.\n */\nexport type OnChainReserveId = Tagged<string, 'OnChainReserveId'>;\n\n/**\n * A reserve identifier.\n */\nexport type ReserveId = Tagged<Base64EncodedCompositeId, 'ReserveId'>;\n\n/**\n * Creates a reserve identifier from a given value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Reserve.id` from data retrieved from the API.\n */\nexport function reserveId(value: string): ReserveId {\n return value as ReserveId;\n}\n\n/**\n * @internal\n */\nexport type ReserveIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n onChainId: OnChainReserveId;\n};\n\n/**\n * @internal\n */\nexport function decodeReserveId(value: ReserveId): ReserveIdParts {\n const decoded = decodeBase64(value);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n onChainId: c as OnChainReserveId,\n };\n}\n\n/**\n * @internal\n */\nexport function encodeReserveId(reserve: ReserveIdParts): ReserveId {\n return reserveId(\n encodeBase64(\n `${reserve.chainId}${COMPOSITE_ID_SEPARATOR}${reserve.spoke}${COMPOSITE_ID_SEPARATOR}${reserve.onChainId}`,\n ),\n );\n}\n\n/**\n * A user position identifier.\n */\nexport type UserPositionId = Tagged<string, 'UserPositionId'>;\n\n/**\n * Creates a user position identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `UserPosition.id` retrieved from another API call.\n */\nexport function userPositionId(value: string): UserPositionId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserPositionId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserPositionId must be valid base64: ${value}`,\n );\n return value as UserPositionId;\n}\n\n/**\n * @internal\n */\nexport type UserPositionIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n user: EvmAddress;\n};\n\n/**\n * @internal\n */\nexport function decodeUserPositionId(\n value: UserPositionId,\n): UserPositionIdParts {\n const decoded = decodeBase64(value as unknown as Base64EncodedCompositeId);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n user: evmAddress(c),\n };\n}\n\n/**\n * @internal\n */\nexport function encodeUserPositionId(\n parts: UserPositionIdParts,\n): UserPositionId {\n return userPositionId(\n encodeBase64(\n `${parts.chainId}${COMPOSITE_ID_SEPARATOR}${parts.spoke}${COMPOSITE_ID_SEPARATOR}${parts.user}`,\n ),\n );\n}\n\n/**\n * A swap identifier.\n */\nexport type SwapId = Tagged<string, 'SwapId'>;\n\n/**\n * Creates a type-safe swap Id.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Swap.id` retrieved from another API call.\n */\nexport function swapId(value: string): SwapId {\n invariant(isValidHexString(value), `Invalid SwapId: ${value}`);\n return value as SwapId;\n}\n\n/**\n * A swap quote identifier.\n */\nexport type SwapQuoteId = Tagged<string, 'SwapQuoteId'>;\n\n/**\n * Creates a type-safe Swap Quote ID.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `SwapQuote.id` retrieved from another API call.\n */\nexport function swapQuoteId(value: string): SwapQuoteId {\n invariant(isValidHexString(value), `Invalid SwapQuoteId: ${value}`);\n return value as SwapQuoteId;\n}\n\n/**\n * A spoke identifier.\n */\nexport type SpokeId = Tagged<Base64EncodedCompositeId, 'SpokeId'>;\n\n/**\n * @internal\n */\nexport type SpokeIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeSpokeId(spoke: SpokeIdParts): SpokeId {\n return spokeId(\n encodeBase64(`${spoke.chainId}${COMPOSITE_ID_SEPARATOR}${spoke.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeSpokeId(value: SpokeId): SpokeIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * Creates a spoke identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Spoke.id` retrieved from another API call.\n */\nexport function spokeId(value: string): SpokeId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid SpokeId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `SpokeId must be valid base64: ${value}`,\n );\n return value as SpokeId;\n}\n\n/**\n * A user balance identifier.\n */\nexport type UserBalanceId = Tagged<string, 'UserBalanceId'>;\n\n/**\n * Creates a user balance identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBalance.id` retrieved from another API call.\n */\nexport function userBalanceId(value: string): UserBalanceId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBalanceId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBalanceId must be valid base64: ${value}`,\n );\n return value as UserBalanceId;\n}\n\n/**\n * A user borrow item identifier.\n */\nexport type UserBorrowItemId = Tagged<string, 'UserBorrowItemId'>;\n\n/**\n * Creates a user borrow item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBorrowItem.id` retrieved from another API call.\n */\nexport function userBorrowItemId(value: string): UserBorrowItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBorrowItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBorrowItemId must be valid base64: ${value}`,\n );\n return value as UserBorrowItemId;\n}\n\n/**\n * A user supply item identifier.\n */\nexport type UserSupplyItemId = Tagged<string, 'UserSupplyItemId'>;\n\n/**\n * Creates a user supply item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserSupplyItem.id` retrieved from another API call.\n */\nexport function userSupplyItemId(value: string): UserSupplyItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserSupplyItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserSupplyItemId must be valid base64: ${value}`,\n );\n return value as UserSupplyItemId;\n}\n\n/**\n * A token info identifier.\n */\nexport type TokenInfoId = Tagged<string, 'TokenInfoId'>;\n\n/**\n * @internal\n */\nexport function tokenInfoId(value: string): TokenInfoId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid TokenInfoId: ${value}`,\n );\n return value as TokenInfoId;\n}\n","import {\n type BlockchainData,\n bigDecimal,\n type ChainId,\n type EvmAddress,\n evmAddress,\n chainId as toChainId,\n} from '@aave/types';\nimport { QuoteAccuracy, SwapOrderClass, TokenSwapKind } from './enums';\nimport type {\n Chain,\n DecimalNumber,\n DomainData,\n Erc20Amount,\n Erc20Approval,\n Erc20Token,\n ExchangeAmount,\n PercentNumber,\n PermitTypedData,\n PositionSwapAdapterContractApproval,\n PositionSwapPositionManagerApproval,\n PrepareSwapOrder,\n SwapByIntent,\n SwapByIntentWithApprovalRequired,\n SwapByTransaction,\n SwapCancelled,\n SwapCancelledResult,\n SwapOpen,\n SwapQuote,\n SwapReceipt,\n SwapTransactionRequest,\n SwapTypedData,\n TokenInfo,\n TokenSwap,\n TransactionRequest,\n} from './fragments';\nimport {\n type ReserveId,\n reserveId,\n type SwapId,\n type SwapQuoteId,\n tokenInfoId,\n type UserBorrowItemId,\n type UserSupplyItemId,\n userBorrowItemId,\n userSupplyItemId,\n} from './id';\n\nfunction randomBase64String(): string {\n return btoa(crypto.randomUUID());\n}\n\n/**\n * @internal\n */\nexport function makeUserBorrowItemId(): UserBorrowItemId {\n return userBorrowItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeUserSupplyItemId(): UserSupplyItemId {\n return userSupplyItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeReserveId(): ReserveId {\n return reserveId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function percentNumber(value: number, decimals = 6): PercentNumber {\n const normalized = bigDecimal(value);\n\n return {\n __typename: 'PercentNumber',\n value: normalized.div(2),\n normalized,\n onChainValue: BigInt(normalized.rescale(decimals).toApproximateNumber()),\n decimals,\n };\n}\n\n/**\n * @internal\n */\nexport function decimalNumber(value: number, decimals = 18): DecimalNumber {\n return {\n __typename: 'DecimalNumber',\n value: bigDecimal(value),\n onChainValue: BigInt(\n bigDecimal(value).rescale(decimals).toApproximateNumber(),\n ),\n decimals,\n };\n}\n\nfunction randomHexString(size: number): `0x${string}` {\n return [...Array<string>(size)]\n .map(() => Math.floor(Math.random() * 16).toString(16))\n .join('') as `0x${string}`;\n}\n\n/**\n * @internal\n */\nexport function randomEvmAddress(): EvmAddress {\n return evmAddress(`0x${randomHexString(20 * 2)}`);\n}\n\nexport const TestTokens = {\n WETH: {\n name: 'Wrapped Ether',\n decimals: 18,\n address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n isWrappedNativeToken: true,\n },\n USDC: {\n name: 'USD Coin',\n decimals: 6,\n address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n isWrappedNativeToken: false,\n },\n GHO: {\n name: 'Gho Token',\n decimals: 18,\n address: '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f',\n isWrappedNativeToken: false,\n },\n AAVE: {\n name: 'Aave Token',\n decimals: 18,\n address: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',\n isWrappedNativeToken: false,\n },\n} as const;\n\nexport function makeTokenInfo(symbol: keyof typeof TestTokens): TokenInfo {\n const { name, decimals } = TestTokens[symbol];\n\n return {\n __typename: 'TokenInfo',\n id: tokenInfoId(randomBase64String()),\n name,\n symbol,\n decimals,\n icon: 'https://example.com/icon.png',\n categories: [],\n };\n}\n\nexport function makeChain(): Chain {\n return {\n __typename: 'Chain',\n name: 'Ethereum',\n icon: 'https://example.com/icon.png',\n chainId: toChainId(1),\n rpcUrl: 'https://example.com/rpc.json',\n explorerUrl: 'https://example.com/explorer.json',\n isTestnet: false,\n isFork: false,\n nativeWrappedToken: randomEvmAddress(),\n nativeGateway: randomEvmAddress(),\n signatureGateway: randomEvmAddress(),\n nativeInfo: makeTokenInfo('WETH'),\n };\n}\n\nexport function makeErc20Token(symbol: keyof typeof TestTokens): Erc20Token {\n const { isWrappedNativeToken } = TestTokens[symbol];\n\n return {\n __typename: 'Erc20Token',\n address: randomEvmAddress(),\n chain: makeChain(),\n info: makeTokenInfo(symbol),\n isWrappedNativeToken,\n };\n}\n\nexport function makeExchangeAmount(value: number): ExchangeAmount {\n return {\n __typename: 'ExchangeAmount',\n value: bigDecimal(value),\n name: 'USD',\n symbol: '$',\n icon: 'https://example.com/icon.png',\n decimals: 2,\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Amount(\n value: number,\n symbol: keyof typeof TestTokens,\n): Erc20Amount {\n return {\n __typename: 'Erc20Amount',\n amount: decimalNumber(value, TestTokens[symbol].decimals),\n token: makeErc20Token(symbol),\n exchange: makeExchangeAmount(value),\n exchangeRate: decimalNumber(value),\n };\n}\n\n/**\n * @internal\n */\nexport function makeTransactionRequest({\n chainId = toChainId(1),\n from = randomEvmAddress(),\n}: {\n chainId?: ChainId;\n from?: EvmAddress;\n} = {}): TransactionRequest {\n return {\n __typename: 'TransactionRequest',\n to: from,\n from,\n data: '0x' as BlockchainData,\n value: 0n,\n chainId,\n operations: [],\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTypedData(): SwapTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type (as DomainData)\n return {\n __typename: 'SwapTypedData',\n primaryType: 'Swap',\n types: {\n Swap: [\n { name: 'amount', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n domain: {\n __typename: 'DomainData',\n name: 'Swap',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n amount: '1000000000000000000',\n deadline: 1234567890,\n },\n };\n}\n\nfunction makeQuoteId(): SwapQuoteId {\n return randomBase64String() as SwapQuoteId;\n}\n\n/**\n * @internal\n */\nexport function makeSwapQuote({\n accuracy = QuoteAccuracy.Accurate,\n buyAmount = 1000,\n}: {\n accuracy?: QuoteAccuracy;\n buyAmount?: number;\n} = {}): SwapQuote {\n return {\n __typename: 'SwapQuote',\n accuracy,\n quoteId: makeQuoteId(),\n suggestedSlippage: percentNumber(0.01),\n selectedSlippage: null,\n buy: makeErc20Amount(buyAmount, 'USDC'),\n sell: makeErc20Amount(1000, 'WETH'),\n costs: {\n __typename: 'SwapQuoteCosts',\n networkCosts: makeErc20Amount(1000, 'WETH'),\n partnerFee: makeErc20Amount(1000, 'USDC'),\n flashloanFee: makeErc20Amount(1000, 'WETH'),\n providerFee: makeErc20Amount(1000, 'USDC'),\n },\n finalBuy: makeErc20Amount(buyAmount, 'USDC'),\n finalSell: makeErc20Amount(1000, 'WETH'),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapReceipt(): SwapReceipt {\n return {\n __typename: 'SwapReceipt',\n id: randomBase64String() as SwapId,\n createdAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n };\n}\n\n/**\n * @internal\n */\nexport function makeTokenSwap(): TokenSwap {\n return {\n __typename: 'TokenSwap',\n sell: makeErc20Amount(1000, 'WETH'),\n buy: makeErc20Amount(1000, 'USDC'),\n kind: TokenSwapKind.Sell,\n orderClass: SwapOrderClass.Market,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapOpen(): SwapOpen {\n return {\n __typename: 'SwapOpen',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n deadline: new Date(Date.now() + 3600_000), // 1 hour from now\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelled(): SwapCancelled {\n return {\n __typename: 'SwapCancelled',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelledResult(): SwapCancelledResult {\n return {\n __typename: 'SwapCancelledResult',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapAdapterContractApproval({\n bySignature = makeSwapTypedData(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapAdapterContractApproval {\n return {\n __typename: 'PositionSwapAdapterContractApproval',\n bySignature,\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapPositionManagerApproval({\n bySignature = makeSwapTypedData(),\n byTransaction = makeTransactionRequest(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapPositionManagerApproval {\n return {\n __typename: 'PositionSwapPositionManagerApproval',\n bySignature,\n byTransaction,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTransactionRequest({\n transaction = makeTransactionRequest(),\n}: {\n transaction?: TransactionRequest;\n} = {}): SwapTransactionRequest {\n return {\n __typename: 'SwapTransactionRequest',\n transaction,\n orderReceipt: makeSwapReceipt(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByTransaction(): SwapByTransaction {\n return {\n __typename: 'SwapByTransaction',\n quote: makeSwapQuote(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntent({\n quote = makeSwapQuote(),\n}: {\n quote?: SwapQuote;\n} = {}): SwapByIntent {\n return {\n __typename: 'SwapByIntent',\n quote,\n };\n}\n\n/**\n * @internal\n */\nexport function makePrepareSwapOrder(): PrepareSwapOrder {\n return {\n __typename: 'PrepareSwapOrder',\n newQuoteId: makeQuoteId(),\n data: makeSwapTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makePermitTypedData(): PermitTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type as DomainData\n return {\n __typename: 'PermitTypedData',\n types: {\n EIP712Domain: [{ name: 'name', type: 'string' }],\n Permit: [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n primaryType: 'Permit',\n domain: {\n __typename: 'DomainData',\n name: 'Permit',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n owner: randomEvmAddress(),\n spender: randomEvmAddress(),\n value: '1000000000000000000',\n nonce: '0',\n deadline: 1234567890,\n },\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Approval({\n byTransaction = makeTransactionRequest(),\n}: {\n byTransaction?: TransactionRequest;\n} = {}): Erc20Approval {\n return {\n __typename: 'Erc20Approval',\n byTransaction,\n bySignature: makePermitTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntentWithApprovalRequired({\n approval = makeErc20Approval(),\n}: {\n approval?: Erc20Approval;\n} = {}): SwapByIntentWithApprovalRequired {\n return {\n __typename: 'SwapByIntentWithApprovalRequired',\n quote: makeSwapQuote(),\n approvals: [approval],\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/id.ts","../src/testing.ts"],"names":["userBorrowItemId","value","invariant","userSupplyItemId","tokenInfoId","randomBase64String","makeUserBorrowItemId","makeUserSupplyItemId","makeReserveId","percentNumber","decimals","normalized","bigDecimal","decimalNumber","randomHexString","size","randomEvmAddress","evmAddress","TestTokens","makeTokenInfo","symbol","name","makeChain","toChainId","makeErc20Token","isWrappedNativeToken","makeExchangeAmount","makeErc20Amount","makeTransactionRequest","chainId","from","makeSwapTypedData","makeQuoteId","makeSwapQuote","accuracy","buyAmount","makeSwapReceipt","makeTokenSwap","makeSwapOpen","makeSwapCancelled","makeSwapCancelledResult","makePositionSwapAdapterContractApproval","bySignature","makePositionSwapPositionManagerApproval","byTransaction","makeSwapTransactionRequest","transaction","makeSwapByTransaction","makeSwapByIntent","quote","makePrepareSwapOrder","makePermitTypedData","makeErc20Approval","makeSwapByIntentWithApprovalRequired","approval"],"mappings":"kEAkZO,SAASA,CAAAA,CAAiBC,CAAAA,CAAiC,CAChE,OAAAC,SAAAA,CACE,OAAOD,CAAAA,EAAU,QAAA,EAAYA,CAAAA,CAAM,OAAS,CAAA,CAC5C,CAAA,0BAAA,EAA6BA,CAAK,CAAA,CACpC,CAAA,CAEAC,SAAAA,CACE,wBAAA,CAAyB,IAAA,CAAKD,CAAK,CAAA,CACnC,CAAA,uCAAA,EAA0CA,CAAK,CAAA,CACjD,CAAA,CACOA,CACT,CAcO,SAASE,CAAAA,CAAiBF,CAAAA,CAAiC,CAChE,OAAAC,SAAAA,CACE,OAAOD,CAAAA,EAAU,QAAA,EAAYA,CAAAA,CAAM,MAAA,CAAS,CAAA,CAC5C,CAAA,0BAAA,EAA6BA,CAAK,CAAA,CACpC,CAAA,CAEAC,SAAAA,CACE,wBAA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A,CAAO,CACL,YAAA,CAAc,CAAC,CAAE,IAAA,CAAM,OAAQ,IAAA,CAAM,QAAS,CAAC,CAAA,CAC/C,MAAA,CAAQ,CACN,CAAE,IAAA,CAAM,OAAA,CAAS,IAAA,CAAM,SAAU,CAAA,CACjC,CAAE,IAAA,CAAM,UAAW,IAAA,CAAM,SAAU,CAAA,CACnC,CAAE,IAAA,CAAM,OAAA,CAAS,IAAA,CAAM,SAAU,CAAA,CACjC,CAAE,IAAA,CAAM,OAAA,CAAS,IAAA,CAAM,SAAU,EACjC,CAAE,IAAA,CAAM,UAAA,CAAY,IAAA,CAAM,SAAU,CACtC,CACF,CAAA,CACA,WAAA,CAAa,QAAA,CACb,MAAA,CAAQ,CACN,UAAA,CAAY,YAAA,CACZ,KAAM,QAAA,CACN,OAAA,CAAS,GAAA,CACT,OAAA,CAAS5B,OAAAA,CAAU,CAAC,CAAA,CACpB,iBAAA,CAAmBP,CAAAA,EACrB,CAAA,CACA,OAAA,CAAS,CACP,KAAA,CAAOA,GAAiB,CACxB,OAAA,CAASA,CAAAA,EAAiB,CAC1B,KAAA,CAAO,qBAAA,CACP,KAAA,CAAO,GAAA,CACP,QAAA,CAAU,UACZ,CACF,CACF,CAKO,SAASoC,EAAkB,CAChC,aAAA,CAAAR,CAAAA,CAAgBhB,CAAAA,EAClB,CAAA,CAEI,EAAC,CAAkB,CACrB,OAAO,CACL,UAAA,CAAY,eAAA,CACZ,aAAA,CAAAgB,EACA,WAAA,CAAaO,CAAAA,EACf,CACF,CAKO,SAASE,CAAAA,CAAqC,CACnD,QAAA,CAAAC,CAAAA,CAAWF,CAAAA,EACb,CAAA,CAEI,GAAsC,CACxC,OAAO,CACL,UAAA,CAAY,kCAAA,CACZ,KAAA,CAAOnB,CAAAA,EAAc,CACrB,SAAA,CAAW,CAACqB,CAAQ,CACtB,CACF","file":"testing.js","sourcesContent":["import {\n type ChainId,\n chainId,\n type EvmAddress,\n evmAddress,\n invariant,\n isValidHexString,\n} from '@aave/types';\nimport type { Tagged } from 'type-fest';\n\n/**\n * An identifier.\n */\nexport type ID = Tagged<string, 'ID'>;\n\n/**\n * A base64 encoded composite identifier.\n *\n * @internal\n */\nexport type Base64EncodedCompositeId = Tagged<\n string,\n 'Base64EncodedCompositeId'\n>;\n\nfunction decodeBase64(value: Base64EncodedCompositeId): string {\n return new TextDecoder().decode(\n Uint8Array.from(atob(value), (c) => c.charCodeAt(0)),\n );\n}\n\nfunction encodeBase64(value: string): Base64EncodedCompositeId {\n return btoa(\n String.fromCharCode(...new TextEncoder().encode(value)),\n ) as Base64EncodedCompositeId;\n}\n\nconst COMPOSITE_ID_SEPARATOR = '::';\n\n/**\n * An asset identifier.\n */\nexport type AssetId = Tagged<Base64EncodedCompositeId, 'AssetId'>;\n\n/**\n * Creates an asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Asset.id` retrieved from another API call.\n */\nexport function assetId(value: string): AssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid AssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `AssetId must be valid base64: ${value}`,\n );\n return value as AssetId;\n}\n\n/**\n * A hub identifier.\n */\nexport type HubId = Tagged<Base64EncodedCompositeId, 'HubId'>;\n\n/**\n * Creates a hub identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Hub.id` retrieved from another API call.\n */\nexport function hubId(value: string): HubId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubId must be valid base64: ${value}`,\n );\n return value as HubId;\n}\n\n/**\n * @internal\n */\nexport type HubIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeHubId(hub: HubIdParts): HubId {\n return hubId(\n encodeBase64(`${hub.chainId}${COMPOSITE_ID_SEPARATOR}${hub.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeHubId(value: HubId): HubIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * A hub asset identifier.\n */\nexport type HubAssetId = Tagged<Base64EncodedCompositeId, 'HubAssetId'>;\n\n/**\n * Creates a hub asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `HubAsset.id` retrieved from another API call.\n */\nexport function hubAssetId(value: string): HubAssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubAssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubAssetId must be valid base64: ${value}`,\n );\n return value as HubAssetId;\n}\n\n/**\n * The on-chain ID of a HubAsset. This is scoped to the specific Hub.\n */\nexport type OnChainHubAssetId = Tagged<number, 'OnChainHubAssetId'>;\n\n/**\n * The on-chain ID of a Reserve. This is scoped to the specific Spoke.\n */\nexport type OnChainReserveId = Tagged<string, 'OnChainReserveId'>;\n\n/**\n * A reserve identifier.\n */\nexport type ReserveId = Tagged<Base64EncodedCompositeId, 'ReserveId'>;\n\n/**\n * A reward identifier.\n */\nexport type RewardId = Tagged<string, 'RewardId'>;\n\n/**\n * Creates a reserve identifier from a given value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Reserve.id` from data retrieved from the API.\n */\nexport function reserveId(value: string): ReserveId {\n return value as ReserveId;\n}\n\n/**\n * @internal\n */\nexport type ReserveIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n onChainId: OnChainReserveId;\n};\n\n/**\n * @internal\n */\nexport function decodeReserveId(value: ReserveId): ReserveIdParts {\n const decoded = decodeBase64(value);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n onChainId: c as OnChainReserveId,\n };\n}\n\n/**\n * @internal\n */\nexport function encodeReserveId(reserve: ReserveIdParts): ReserveId {\n return reserveId(\n encodeBase64(\n `${reserve.chainId}${COMPOSITE_ID_SEPARATOR}${reserve.spoke}${COMPOSITE_ID_SEPARATOR}${reserve.onChainId}`,\n ),\n );\n}\n\n/**\n * A user position identifier.\n */\nexport type UserPositionId = Tagged<string, 'UserPositionId'>;\n\n/**\n * Creates a user position identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `UserPosition.id` retrieved from another API call.\n */\nexport function userPositionId(value: string): UserPositionId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserPositionId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserPositionId must be valid base64: ${value}`,\n );\n return value as UserPositionId;\n}\n\n/**\n * @internal\n */\nexport type UserPositionIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n user: EvmAddress;\n};\n\n/**\n * @internal\n */\nexport function decodeUserPositionId(\n value: UserPositionId,\n): UserPositionIdParts {\n const decoded = decodeBase64(value as unknown as Base64EncodedCompositeId);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n user: evmAddress(c),\n };\n}\n\n/**\n * @internal\n */\nexport function encodeUserPositionId(\n parts: UserPositionIdParts,\n): UserPositionId {\n return userPositionId(\n encodeBase64(\n `${parts.chainId}${COMPOSITE_ID_SEPARATOR}${parts.spoke}${COMPOSITE_ID_SEPARATOR}${parts.user}`,\n ),\n );\n}\n\n/**\n * A swap identifier.\n */\nexport type SwapId = Tagged<string, 'SwapId'>;\n\n/**\n * Creates a type-safe swap Id.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Swap.id` retrieved from another API call.\n */\nexport function swapId(value: string): SwapId {\n invariant(isValidHexString(value), `Invalid SwapId: ${value}`);\n return value as SwapId;\n}\n\n/**\n * A swap quote identifier.\n */\nexport type SwapQuoteId = Tagged<string, 'SwapQuoteId'>;\n\n/**\n * Creates a type-safe Swap Quote ID.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `SwapQuote.id` retrieved from another API call.\n */\nexport function swapQuoteId(value: string): SwapQuoteId {\n invariant(isValidHexString(value), `Invalid SwapQuoteId: ${value}`);\n return value as SwapQuoteId;\n}\n\n/**\n * A spoke identifier.\n */\nexport type SpokeId = Tagged<Base64EncodedCompositeId, 'SpokeId'>;\n\n/**\n * @internal\n */\nexport type SpokeIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeSpokeId(spoke: SpokeIdParts): SpokeId {\n return spokeId(\n encodeBase64(`${spoke.chainId}${COMPOSITE_ID_SEPARATOR}${spoke.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeSpokeId(value: SpokeId): SpokeIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * Creates a spoke identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Spoke.id` retrieved from another API call.\n */\nexport function spokeId(value: string): SpokeId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid SpokeId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `SpokeId must be valid base64: ${value}`,\n );\n return value as SpokeId;\n}\n\n/**\n * A user balance identifier.\n */\nexport type UserBalanceId = Tagged<string, 'UserBalanceId'>;\n\n/**\n * Creates a user balance identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBalance.id` retrieved from another API call.\n */\nexport function userBalanceId(value: string): UserBalanceId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBalanceId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBalanceId must be valid base64: ${value}`,\n );\n return value as UserBalanceId;\n}\n\n/**\n * A user borrow item identifier.\n */\nexport type UserBorrowItemId = Tagged<string, 'UserBorrowItemId'>;\n\n/**\n * Creates a user borrow item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBorrowItem.id` retrieved from another API call.\n */\nexport function userBorrowItemId(value: string): UserBorrowItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBorrowItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBorrowItemId must be valid base64: ${value}`,\n );\n return value as UserBorrowItemId;\n}\n\n/**\n * A user supply item identifier.\n */\nexport type UserSupplyItemId = Tagged<string, 'UserSupplyItemId'>;\n\n/**\n * Creates a user supply item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserSupplyItem.id` retrieved from another API call.\n */\nexport function userSupplyItemId(value: string): UserSupplyItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserSupplyItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserSupplyItemId must be valid base64: ${value}`,\n );\n return value as UserSupplyItemId;\n}\n\n/**\n * A token info identifier.\n */\nexport type TokenInfoId = Tagged<string, 'TokenInfoId'>;\n\n/**\n * @internal\n */\nexport function tokenInfoId(value: string): TokenInfoId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid TokenInfoId: ${value}`,\n );\n return value as TokenInfoId;\n}\n","import {\n type BlockchainData,\n bigDecimal,\n type ChainId,\n type EvmAddress,\n evmAddress,\n chainId as toChainId,\n} from '@aave/types';\nimport { QuoteAccuracy, SwapOrderClass, TokenSwapKind } from './enums';\nimport type {\n Chain,\n DecimalNumber,\n DomainData,\n Erc20Amount,\n Erc20Approval,\n Erc20Token,\n ExchangeAmount,\n PercentNumber,\n PermitTypedData,\n PositionSwapAdapterContractApproval,\n PositionSwapPositionManagerApproval,\n PrepareSwapOrder,\n SwapByIntent,\n SwapByIntentWithApprovalRequired,\n SwapByTransaction,\n SwapCancelled,\n SwapCancelledResult,\n SwapOpen,\n SwapQuote,\n SwapReceipt,\n SwapTransactionRequest,\n SwapTypedData,\n TokenInfo,\n TokenSwap,\n TransactionRequest,\n} from './fragments';\nimport {\n type ReserveId,\n reserveId,\n type SwapId,\n type SwapQuoteId,\n tokenInfoId,\n type UserBorrowItemId,\n type UserSupplyItemId,\n userBorrowItemId,\n userSupplyItemId,\n} from './id';\n\nfunction randomBase64String(): string {\n return btoa(crypto.randomUUID());\n}\n\n/**\n * @internal\n */\nexport function makeUserBorrowItemId(): UserBorrowItemId {\n return userBorrowItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeUserSupplyItemId(): UserSupplyItemId {\n return userSupplyItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeReserveId(): ReserveId {\n return reserveId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function percentNumber(value: number, decimals = 6): PercentNumber {\n const normalized = bigDecimal(value);\n\n return {\n __typename: 'PercentNumber',\n value: normalized.div(2),\n normalized,\n onChainValue: BigInt(normalized.rescale(decimals).toApproximateNumber()),\n decimals,\n };\n}\n\n/**\n * @internal\n */\nexport function decimalNumber(value: number, decimals = 18): DecimalNumber {\n return {\n __typename: 'DecimalNumber',\n value: bigDecimal(value),\n onChainValue: BigInt(\n bigDecimal(value).rescale(decimals).toApproximateNumber(),\n ),\n decimals,\n };\n}\n\nfunction randomHexString(size: number): `0x${string}` {\n return [...Array<string>(size)]\n .map(() => Math.floor(Math.random() * 16).toString(16))\n .join('') as `0x${string}`;\n}\n\n/**\n * @internal\n */\nexport function randomEvmAddress(): EvmAddress {\n return evmAddress(`0x${randomHexString(20 * 2)}`);\n}\n\nexport const TestTokens = {\n WETH: {\n name: 'Wrapped Ether',\n decimals: 18,\n address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n isWrappedNativeToken: true,\n },\n USDC: {\n name: 'USD Coin',\n decimals: 6,\n address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n isWrappedNativeToken: false,\n },\n GHO: {\n name: 'Gho Token',\n decimals: 18,\n address: '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f',\n isWrappedNativeToken: false,\n },\n AAVE: {\n name: 'Aave Token',\n decimals: 18,\n address: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',\n isWrappedNativeToken: false,\n },\n} as const;\n\nexport function makeTokenInfo(symbol: keyof typeof TestTokens): TokenInfo {\n const { name, decimals } = TestTokens[symbol];\n\n return {\n __typename: 'TokenInfo',\n id: tokenInfoId(randomBase64String()),\n name,\n symbol,\n decimals,\n icon: 'https://example.com/icon.png',\n categories: [],\n };\n}\n\nexport function makeChain(): Chain {\n return {\n __typename: 'Chain',\n name: 'Ethereum',\n icon: 'https://example.com/icon.png',\n chainId: toChainId(1),\n rpcUrl: 'https://example.com/rpc.json',\n explorerUrl: 'https://example.com/explorer.json',\n isTestnet: false,\n isFork: false,\n nativeWrappedToken: randomEvmAddress(),\n nativeGateway: randomEvmAddress(),\n signatureGateway: randomEvmAddress(),\n nativeInfo: makeTokenInfo('WETH'),\n };\n}\n\nexport function makeErc20Token(symbol: keyof typeof TestTokens): Erc20Token {\n const { isWrappedNativeToken } = TestTokens[symbol];\n\n return {\n __typename: 'Erc20Token',\n address: randomEvmAddress(),\n chain: makeChain(),\n info: makeTokenInfo(symbol),\n isWrappedNativeToken,\n };\n}\n\nexport function makeExchangeAmount(value: number): ExchangeAmount {\n return {\n __typename: 'ExchangeAmount',\n value: bigDecimal(value),\n name: 'USD',\n symbol: '$',\n icon: 'https://example.com/icon.png',\n decimals: 2,\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Amount(\n value: number,\n symbol: keyof typeof TestTokens,\n): Erc20Amount {\n return {\n __typename: 'Erc20Amount',\n amount: decimalNumber(value, TestTokens[symbol].decimals),\n token: makeErc20Token(symbol),\n exchange: makeExchangeAmount(value),\n exchangeRate: decimalNumber(value),\n };\n}\n\n/**\n * @internal\n */\nexport function makeTransactionRequest({\n chainId = toChainId(1),\n from = randomEvmAddress(),\n}: {\n chainId?: ChainId;\n from?: EvmAddress;\n} = {}): TransactionRequest {\n return {\n __typename: 'TransactionRequest',\n to: from,\n from,\n data: '0x' as BlockchainData,\n value: 0n,\n chainId,\n operations: [],\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTypedData(): SwapTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type (as DomainData)\n return {\n __typename: 'SwapTypedData',\n primaryType: 'Swap',\n types: {\n Swap: [\n { name: 'amount', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n domain: {\n __typename: 'DomainData',\n name: 'Swap',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n amount: '1000000000000000000',\n deadline: 1234567890,\n },\n };\n}\n\nfunction makeQuoteId(): SwapQuoteId {\n return randomBase64String() as SwapQuoteId;\n}\n\n/**\n * @internal\n */\nexport function makeSwapQuote({\n accuracy = QuoteAccuracy.Accurate,\n buyAmount = 1000,\n}: {\n accuracy?: QuoteAccuracy;\n buyAmount?: number;\n} = {}): SwapQuote {\n return {\n __typename: 'SwapQuote',\n accuracy,\n quoteId: makeQuoteId(),\n suggestedSlippage: percentNumber(0.01),\n selectedSlippage: null,\n buy: makeErc20Amount(buyAmount, 'USDC'),\n sell: makeErc20Amount(1000, 'WETH'),\n costs: {\n __typename: 'SwapQuoteCosts',\n networkCosts: makeErc20Amount(1000, 'WETH'),\n partnerFee: makeErc20Amount(1000, 'USDC'),\n flashloanFee: makeErc20Amount(1000, 'WETH'),\n providerFee: makeErc20Amount(1000, 'USDC'),\n },\n finalBuy: makeErc20Amount(buyAmount, 'USDC'),\n finalSell: makeErc20Amount(1000, 'WETH'),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapReceipt(): SwapReceipt {\n return {\n __typename: 'SwapReceipt',\n id: randomBase64String() as SwapId,\n createdAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n };\n}\n\n/**\n * @internal\n */\nexport function makeTokenSwap(): TokenSwap {\n return {\n __typename: 'TokenSwap',\n sell: makeErc20Amount(1000, 'WETH'),\n buy: makeErc20Amount(1000, 'USDC'),\n kind: TokenSwapKind.Sell,\n orderClass: SwapOrderClass.Market,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapOpen(): SwapOpen {\n return {\n __typename: 'SwapOpen',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n deadline: new Date(Date.now() + 3600_000), // 1 hour from now\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelled(): SwapCancelled {\n return {\n __typename: 'SwapCancelled',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelledResult(): SwapCancelledResult {\n return {\n __typename: 'SwapCancelledResult',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapAdapterContractApproval({\n bySignature = makeSwapTypedData(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapAdapterContractApproval {\n return {\n __typename: 'PositionSwapAdapterContractApproval',\n bySignature,\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapPositionManagerApproval({\n bySignature = makeSwapTypedData(),\n byTransaction = makeTransactionRequest(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapPositionManagerApproval {\n return {\n __typename: 'PositionSwapPositionManagerApproval',\n bySignature,\n byTransaction,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTransactionRequest({\n transaction = makeTransactionRequest(),\n}: {\n transaction?: TransactionRequest;\n} = {}): SwapTransactionRequest {\n return {\n __typename: 'SwapTransactionRequest',\n transaction,\n orderReceipt: makeSwapReceipt(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByTransaction(): SwapByTransaction {\n return {\n __typename: 'SwapByTransaction',\n quote: makeSwapQuote(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntent({\n quote = makeSwapQuote(),\n}: {\n quote?: SwapQuote;\n} = {}): SwapByIntent {\n return {\n __typename: 'SwapByIntent',\n quote,\n };\n}\n\n/**\n * @internal\n */\nexport function makePrepareSwapOrder(): PrepareSwapOrder {\n return {\n __typename: 'PrepareSwapOrder',\n newQuoteId: makeQuoteId(),\n data: makeSwapTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makePermitTypedData(): PermitTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type as DomainData\n return {\n __typename: 'PermitTypedData',\n types: {\n EIP712Domain: [{ name: 'name', type: 'string' }],\n Permit: [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n primaryType: 'Permit',\n domain: {\n __typename: 'DomainData',\n name: 'Permit',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n owner: randomEvmAddress(),\n spender: randomEvmAddress(),\n value: '1000000000000000000',\n nonce: '0',\n deadline: 1234567890,\n },\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Approval({\n byTransaction = makeTransactionRequest(),\n}: {\n byTransaction?: TransactionRequest;\n} = {}): Erc20Approval {\n return {\n __typename: 'Erc20Approval',\n byTransaction,\n bySignature: makePermitTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntentWithApprovalRequired({\n approval = makeErc20Approval(),\n}: {\n approval?: Erc20Approval;\n} = {}): SwapByIntentWithApprovalRequired {\n return {\n __typename: 'SwapByIntentWithApprovalRequired',\n quote: makeSwapQuote(),\n approvals: [approval],\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aave/graphql",
3
- "version": "1.0.0-next.29",
3
+ "version": "1.0.0-next.30",
4
4
  "description": "GraphQL bindings for the Aave API",
5
5
  "repository": {
6
6
  "directory": "packages/graphql",