@aave/graphql 1.0.0-next.15 → 1.0.0-next.17

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
@@ -86,7 +86,7 @@ type introspection_types = {
86
86
  'AssetPriceSample': { kind: 'OBJECT'; name: 'AssetPriceSample'; fields: { 'date': { name: 'date'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'price': { name: 'price'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; }; };
87
87
  'AssetRequest': { kind: 'INPUT_OBJECT'; name: 'AssetRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'AssetRequestQuery'; ofType: null; }; }; defaultValue: null }]; };
88
88
  'AssetRequestQuery': { kind: 'INPUT_OBJECT'; name: 'AssetRequestQuery'; isOneOf: true; inputFields: [{ name: 'token'; type: { kind: 'INPUT_OBJECT'; name: 'Erc20Input'; ofType: null; }; defaultValue: null }, { name: 'assetId'; type: { kind: 'SCALAR'; name: 'AssetId'; ofType: null; }; defaultValue: null }]; };
89
- 'AssetSummary': { kind: 'OBJECT'; name: 'AssetSummary'; fields: { 'borrowApy': { name: 'borrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'supplyApy': { name: 'supplyApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'totalBorrowCap': { name: 'totalBorrowCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DecimalNumberWithChange'; ofType: null; }; } }; 'totalBorrowable': { name: 'totalBorrowable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalBorrowed': { name: 'totalBorrowed'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalSuppliable': { name: 'totalSuppliable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalSupplied': { name: 'totalSupplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalSupplyCap': { name: 'totalSupplyCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DecimalNumberWithChange'; ofType: null; }; } }; }; };
89
+ 'AssetSummary': { kind: 'OBJECT'; name: 'AssetSummary'; fields: { 'borrowApy': { name: 'borrowApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'supplyApy': { name: 'supplyApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'totalBorrowCap': { name: 'totalBorrowCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalBorrowable': { name: 'totalBorrowable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalBorrowed': { name: 'totalBorrowed'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalSuppliable': { name: 'totalSuppliable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalSupplied': { name: 'totalSupplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; 'totalSupplyCap': { name: 'totalSupplyCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AssetAmountWithChange'; ofType: null; }; } }; }; };
90
90
  'AssetSupplyHistoryRequest': { kind: 'INPUT_OBJECT'; name: 'AssetSupplyHistoryRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'AssetSupplyHistoryRequestQuery'; ofType: null; }; }; defaultValue: null }, { name: 'window'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TimeWindow'; ofType: null; }; }; defaultValue: "LAST_DAY" }]; };
91
91
  'AssetSupplyHistoryRequestQuery': { kind: 'INPUT_OBJECT'; name: 'AssetSupplyHistoryRequestQuery'; isOneOf: true; inputFields: [{ name: 'token'; type: { kind: 'INPUT_OBJECT'; name: 'Erc20Input'; ofType: null; }; defaultValue: null }, { name: 'assetId'; type: { kind: 'SCALAR'; name: 'AssetId'; ofType: null; }; defaultValue: null }]; };
92
92
  'AssetSupplySample': { kind: 'OBJECT'; name: 'AssetSupplySample'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DecimalNumber'; ofType: null; }; } }; 'date': { name: 'date'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'highestApy': { name: 'highestApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'lowestApy': { name: 'lowestApy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
@@ -136,11 +136,10 @@ type introspection_types = {
136
136
  'ForkTopUpErc20': { kind: 'INPUT_OBJECT'; name: 'ForkTopUpErc20'; isOneOf: false; inputFields: [{ name: 'currency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }]; };
137
137
  'ForkTopUpRequest': { kind: 'INPUT_OBJECT'; name: 'ForkTopUpRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'erc20'; type: { kind: 'INPUT_OBJECT'; name: 'ForkTopUpErc20'; ofType: null; }; defaultValue: null }, { name: 'native'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
138
138
  'ForkTopUpResponse': { kind: 'OBJECT'; name: 'ForkTopUpResponse'; fields: { 'message': { name: 'message'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
139
- 'FromQuoteDebtSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteDebtSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { 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 }]; };
140
- 'FromQuoteRepayWithSupplyQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteRepayWithSupplyQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { 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 }]; };
141
- 'FromQuoteSupplySwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteSupplySwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { 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 }]; };
142
- 'FromQuoteSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
143
- 'FromQuoteWithdrawSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteWithdrawSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { 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 }]; };
139
+ 'FromQuoteDebtSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteDebtSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
140
+ 'FromQuoteRepayWithSupplyQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteRepayWithSupplyQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
141
+ 'FromQuoteSupplySwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteSupplySwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
142
+ 'FromQuoteWithdrawSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'FromQuoteWithdrawSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
144
143
  'HasProcessedKnownTransactionRequest': { kind: 'INPUT_OBJECT'; name: 'HasProcessedKnownTransactionRequest'; isOneOf: false; inputFields: [{ name: 'operations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'OperationType'; ofType: null; }; }; }; }; defaultValue: null }, { name: 'txHash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; }; }; defaultValue: null }]; };
145
144
  'HealthFactorError': { kind: 'OBJECT'; name: 'HealthFactorError'; fields: { 'after': { name: 'after'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; } }; 'current': { name: 'current'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; } }; 'reason': { name: 'reason'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
146
145
  'HealthFactorResult': { kind: 'UNION'; name: 'HealthFactorResult'; fields: {}; possibleTypes: 'HealthFactorError' | 'HealthFactorVariation'; };
@@ -173,9 +172,9 @@ type introspection_types = {
173
172
  'Int': unknown;
174
173
  'JSON': unknown;
175
174
  'LimitDebtSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'LimitDebtSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; defaultValue: null }, { name: 'currentPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserBorrowItemId'; ofType: null; }; }; defaultValue: null }, { name: 'currentAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }, { name: 'newReserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; }; defaultValue: null }, { name: 'newAmount'; 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: 'kind'; type: { kind: 'ENUM'; name: 'BorrowSwapKind'; ofType: null; }; defaultValue: null }]; };
176
- 'LimitOrderTokenSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'LimitOrderTokenSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSellAmount'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }, { name: 'newBuyAmount'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }, { name: 'newReceiver'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; defaultValue: null }, { name: 'newKind'; type: { kind: 'ENUM'; name: 'SwapKind'; ofType: null; }; defaultValue: null }]; };
175
+ 'LimitOrderTokenSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'LimitOrderTokenSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; defaultValue: null }, { name: 'sell'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'SwapTokenInput'; ofType: null; }; }; defaultValue: null }, { name: 'buy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'SwapTokenInput'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; defaultValue: null }, { name: 'kind'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SwapKind'; ofType: null; }; }; defaultValue: "SELL" }, { name: 'previousQuoteId'; type: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; defaultValue: null }]; };
177
176
  'LimitRepayWithSupplyQuoteInput': { kind: 'INPUT_OBJECT'; name: 'LimitRepayWithSupplyQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; defaultValue: null }, { name: 'repayPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserBorrowItemId'; ofType: null; }; }; defaultValue: null }, { name: 'repayAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }, { name: 'supplyPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserSupplyItemId'; ofType: null; }; }; defaultValue: null }, { name: 'supplyAmount'; 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: 'kind'; type: { kind: 'ENUM'; name: 'RepayWithSupplyKind'; ofType: null; }; defaultValue: null }]; };
178
- 'LimitSupplySwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'LimitSupplySwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; defaultValue: null }, { name: 'currentPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserSupplyItemId'; ofType: null; }; }; defaultValue: null }, { name: 'currentAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }, { name: 'newReserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; }; defaultValue: null }, { name: 'newAmount'; 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: 'kind'; type: { kind: 'ENUM'; name: 'SupplySwapKind'; ofType: null; }; defaultValue: null }]; };
177
+ 'LimitSupplySwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'LimitSupplySwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; defaultValue: null }, { name: 'currentPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserSupplyItemId'; ofType: null; }; }; defaultValue: null }, { name: 'currentAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }, { name: 'newReserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; }; defaultValue: null }, { name: 'newAmount'; 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: 'kind'; type: { kind: 'ENUM'; name: 'SupplySwapKind'; ofType: null; }; defaultValue: null }, { name: 'enableCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }]; };
179
178
  'LimitWithdrawSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'LimitWithdrawSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; defaultValue: null }, { name: 'withdrawPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserSupplyItemId'; ofType: null; }; }; defaultValue: null }, { name: 'withdrawAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }, { name: 'buyToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'TokenInput'; ofType: null; }; }; defaultValue: null }, { name: 'buyAmount'; 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: 'kind'; type: { kind: 'ENUM'; name: 'WithdrawSwapKind'; ofType: null; }; defaultValue: null }]; };
180
179
  'LiquidatePositionDebtAmount': { kind: 'INPUT_OBJECT'; name: 'LiquidatePositionDebtAmount'; isOneOf: true; inputFields: [{ name: 'exact'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }, { name: 'max'; type: { kind: 'SCALAR'; name: 'AlwaysTrue'; ofType: null; }; defaultValue: null }]; };
181
180
  'LiquidatePositionExecutionPlan': { kind: 'UNION'; name: 'LiquidatePositionExecutionPlan'; fields: {}; possibleTypes: 'Erc20ApprovalRequired' | 'InsufficientBalanceError' | 'TransactionRequest'; };
@@ -183,9 +182,10 @@ type introspection_types = {
183
182
  'LiquidatedActivity': { kind: 'OBJECT'; name: 'LiquidatedActivity'; fields: { 'chain': { name: 'chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; } }; 'collateral': { name: 'collateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'collateralReserve': { name: 'collateralReserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; 'debt': { name: 'debt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'debtReserve': { name: 'debtReserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'liquidator': { name: 'liquidator'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; 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; }; } }; }; };
184
183
  'LiquidationFeeVariation': { kind: 'OBJECT'; name: 'LiquidationFeeVariation'; 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; }; } }; }; };
185
184
  'MarketDebtSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketDebtSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'debtPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserBorrowItemId'; 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 }]; };
185
+ 'MarketOrderTokenSwapFromQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketOrderTokenSwapFromQuoteInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'newSlippage'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }]; };
186
186
  'MarketOrderTokenSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketOrderTokenSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; defaultValue: null }, { name: 'buy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'TokenInput'; ofType: null; }; }; defaultValue: null }, { name: 'sell'; 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: 'kind'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SwapKind'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; defaultValue: null }]; };
187
187
  'MarketRepayWithSupplyQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketRepayWithSupplyQuoteInput'; isOneOf: false; inputFields: [{ name: 'debtPosition'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UserBorrowItemId'; ofType: null; }; }; defaultValue: null }, { name: 'repayWithReserve'; 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 }]; };
188
- 'MarketSupplySwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketSupplySwapQuoteInput'; isOneOf: false; inputFields: [{ 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 }]; };
188
+ 'MarketSupplySwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketSupplySwapQuoteInput'; isOneOf: false; inputFields: [{ 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 }]; };
189
189
  'MarketWithdrawSwapQuoteInput': { kind: 'INPUT_OBJECT'; name: 'MarketWithdrawSwapQuoteInput'; isOneOf: false; inputFields: [{ name: 'position'; 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 }]; };
190
190
  '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; }; } }; }; };
191
191
  '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; }; } }; }; };
@@ -215,11 +215,12 @@ type introspection_types = {
215
215
  'PositionSwapPositionManagerApproval': { kind: 'OBJECT'; name: 'PositionSwapPositionManagerApproval'; fields: { 'bySignature': { name: 'bySignature'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapTypedData'; ofType: null; }; } }; 'byTransaction': { name: 'byTransaction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; }; };
216
216
  'PreContractActionRequired': { kind: 'OBJECT'; name: 'PreContractActionRequired'; fields: { 'originalTransaction': { name: 'originalTransaction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; 'reason': { name: 'reason'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'transaction': { name: 'transaction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; }; };
217
217
  'PreparePositionSwapRequest': { kind: 'INPUT_OBJECT'; name: 'PreparePositionSwapRequest'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'adapterContractSignature'; type: { kind: 'SCALAR'; name: 'Signature'; ofType: null; }; defaultValue: null }, { name: 'positionManagerSignature'; type: { kind: 'SCALAR'; name: 'Signature'; ofType: null; }; defaultValue: null }]; };
218
- 'PreparePositionSwapResult': { kind: 'UNION'; name: 'PreparePositionSwapResult'; fields: {}; possibleTypes: 'InsufficientBalanceError' | 'SwapByIntent'; };
218
+ 'PreparePositionSwapResult': { kind: 'UNION'; name: 'PreparePositionSwapResult'; fields: {}; possibleTypes: 'InsufficientBalanceError' | 'PrepareSwapOrder'; };
219
219
  'PrepareSwapCancelRequest': { kind: 'INPUT_OBJECT'; name: 'PrepareSwapCancelRequest'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapId'; ofType: null; }; }; defaultValue: null }]; };
220
220
  'PrepareSwapCancelResult': { kind: 'OBJECT'; name: 'PrepareSwapCancelResult'; fields: { 'data': { name: 'data'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapTypedData'; ofType: null; }; } }; }; };
221
+ 'PrepareSwapOrder': { kind: 'OBJECT'; name: 'PrepareSwapOrder'; fields: { 'data': { name: 'data'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapTypedData'; ofType: null; }; } }; 'newQuoteId': { name: 'newQuoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; } }; }; };
221
222
  '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 }]; };
222
- 'PrepareTokenSwapResult': { kind: 'UNION'; name: 'PrepareTokenSwapResult'; fields: {}; possibleTypes: 'InsufficientBalanceError' | 'SwapByIntent'; };
223
+ 'PrepareTokenSwapResult': { kind: 'UNION'; name: 'PrepareTokenSwapResult'; fields: {}; possibleTypes: 'InsufficientBalanceError' | 'PrepareSwapOrder'; };
223
224
  '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 }]; };
224
225
  '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 }]; };
225
226
  '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; }; } }; }; };
@@ -235,7 +236,7 @@ type introspection_types = {
235
236
  'RepayWithSupplyKind': { name: 'RepayWithSupplyKind'; enumValues: 'REPAY' | 'SUPPLY'; };
236
237
  'RepayWithSupplyQuoteRequest': { kind: 'INPUT_OBJECT'; name: 'RepayWithSupplyQuoteRequest'; isOneOf: true; inputFields: [{ name: 'market'; type: { kind: 'INPUT_OBJECT'; name: 'MarketRepayWithSupplyQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'limit'; type: { kind: 'INPUT_OBJECT'; name: 'LimitRepayWithSupplyQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'fromQuote'; type: { kind: 'INPUT_OBJECT'; name: 'FromQuoteRepayWithSupplyQuoteInput'; ofType: null; }; defaultValue: null }]; };
237
238
  'RepayWithSupplyQuoteResult': { kind: 'UNION'; name: 'RepayWithSupplyQuoteResult'; fields: {}; possibleTypes: 'PositionSwapByIntentApprovalsRequired'; };
238
- 'Reserve': { kind: 'OBJECT'; name: 'Reserve'; fields: { 'asset': { name: 'asset'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HubAsset'; ofType: null; }; } }; 'borrowCap': { name: 'borrowCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'canBorrow': { name: 'canBorrow'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'canSupply': { name: 'canSupply'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'canUseAsCollateral': { name: 'canUseAsCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; '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: 'ReserveId'; ofType: null; }; } }; 'onChainId': { name: 'onChainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'OnChainReserveId'; ofType: null; }; } }; 'settings': { name: 'settings'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveSettings'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'status': { name: 'status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveStatus'; ofType: null; }; } }; 'summary': { name: 'summary'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveSummary'; ofType: null; }; } }; 'supplyCap': { name: 'supplyCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'userState': { name: 'userState'; type: { kind: 'OBJECT'; name: 'ReserveUserState'; ofType: null; } }; }; };
239
+ 'Reserve': { kind: 'OBJECT'; name: 'Reserve'; fields: { 'asset': { name: 'asset'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HubAsset'; ofType: null; }; } }; 'borrowCap': { name: 'borrowCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'canBorrow': { name: 'canBorrow'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'canSupply': { name: 'canSupply'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'canSwapFrom': { name: 'canSwapFrom'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'canUseAsCollateral': { name: 'canUseAsCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; '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: 'ReserveId'; ofType: null; }; } }; 'onChainId': { name: 'onChainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'OnChainReserveId'; ofType: null; }; } }; 'settings': { name: 'settings'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveSettings'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'status': { name: 'status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveStatus'; ofType: null; }; } }; 'summary': { name: 'summary'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveSummary'; ofType: null; }; } }; 'supplyCap': { name: 'supplyCap'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'userState': { name: 'userState'; type: { kind: 'OBJECT'; name: 'ReserveUserState'; ofType: null; } }; }; };
239
240
  'ReserveAmountInput': { kind: 'INPUT_OBJECT'; name: 'ReserveAmountInput'; isOneOf: true; inputFields: [{ name: 'native'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }, { name: 'erc20'; type: { kind: 'INPUT_OBJECT'; name: 'ReserveErc20AmountInput'; ofType: null; }; defaultValue: null }]; };
240
241
  'ReserveAmountInputWithPermit': { kind: 'INPUT_OBJECT'; name: 'ReserveAmountInputWithPermit'; isOneOf: true; inputFields: [{ name: 'native'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }, { name: 'erc20'; type: { kind: 'INPUT_OBJECT'; name: 'ReserveErc20AmountInputWithPermit'; ofType: null; }; defaultValue: null }]; };
241
242
  'ReserveErc20AmountInput': { kind: 'INPUT_OBJECT'; name: 'ReserveErc20AmountInput'; isOneOf: false; inputFields: [{ name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }]; };
@@ -277,11 +278,12 @@ type introspection_types = {
277
278
  'SupplySwapQuoteRequest': { kind: 'INPUT_OBJECT'; name: 'SupplySwapQuoteRequest'; isOneOf: true; inputFields: [{ name: 'market'; type: { kind: 'INPUT_OBJECT'; name: 'MarketSupplySwapQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'limit'; type: { kind: 'INPUT_OBJECT'; name: 'LimitSupplySwapQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'fromQuote'; type: { kind: 'INPUT_OBJECT'; name: 'FromQuoteSupplySwapQuoteInput'; ofType: null; }; defaultValue: null }]; };
278
279
  'SupplySwapQuoteResult': { kind: 'UNION'; name: 'SupplySwapQuoteResult'; fields: {}; possibleTypes: 'PositionSwapByIntentApprovalsRequired'; };
279
280
  'SwapAmount': { kind: 'UNION'; name: 'SwapAmount'; fields: {}; possibleTypes: 'Erc20Amount' | 'NativeAmount' | 'PositionAmount'; };
280
- 'SwapByIntent': { kind: 'OBJECT'; name: 'SwapByIntent'; fields: { 'data': { name: 'data'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapTypedData'; ofType: null; }; } }; 'quote': { name: 'quote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapQuote'; ofType: null; }; } }; }; };
281
+ 'SwapByIntent': { kind: 'OBJECT'; name: 'SwapByIntent'; fields: { 'quote': { name: 'quote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapQuote'; ofType: null; }; } }; }; };
281
282
  'SwapByIntentInput': { kind: 'INPUT_OBJECT'; name: 'SwapByIntentInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'signature'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Signature'; ofType: null; }; }; defaultValue: null }]; };
282
283
  'SwapByIntentWithApprovalRequired': { kind: 'OBJECT'; name: 'SwapByIntentWithApprovalRequired'; fields: { 'approval': { name: 'approval'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Approval'; ofType: null; }; } }; 'quote': { name: 'quote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapQuote'; ofType: null; }; } }; }; };
283
284
  'SwapByTransaction': { kind: 'OBJECT'; name: 'SwapByTransaction'; fields: { 'quote': { name: 'quote'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapQuote'; ofType: null; }; } }; }; };
284
285
  'SwapCancelled': { kind: 'OBJECT'; name: 'SwapCancelled'; fields: { 'cancelledAt': { name: 'cancelledAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'explorerLink': { name: 'explorerLink'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
286
+ 'SwapErc20Input': { kind: 'INPUT_OBJECT'; name: 'SwapErc20Input'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }]; };
285
287
  'SwapExecutionPlan': { kind: 'UNION'; name: 'SwapExecutionPlan'; fields: {}; possibleTypes: 'InsufficientBalanceError' | 'SwapReceipt' | 'SwapTransactionRequest'; };
286
288
  'SwapExpired': { kind: 'OBJECT'; name: 'SwapExpired'; fields: { 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'expiredAt': { name: 'expiredAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'explorerLink': { name: 'explorerLink'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
287
289
  'SwapFulfilled': { kind: 'OBJECT'; name: 'SwapFulfilled'; fields: { 'bought': { name: 'bought'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SwapAmount'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'desiredBuy': { name: 'desiredBuy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SwapAmount'; ofType: null; }; } }; 'desiredSell': { name: 'desiredSell'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SwapAmount'; ofType: null; }; } }; 'explorerLink': { name: 'explorerLink'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'fulfilledAt': { name: 'fulfilledAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'refundTxHash': { name: 'refundTxHash'; type: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; } }; 'sold': { name: 'sold'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'SwapAmount'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
@@ -297,6 +299,7 @@ type introspection_types = {
297
299
  'SwapStatus': { kind: 'UNION'; name: 'SwapStatus'; fields: {}; possibleTypes: 'SwapCancelled' | 'SwapExpired' | 'SwapFulfilled' | 'SwapOpen' | 'SwapPendingSignature'; };
298
300
  'SwapStatusFilter': { name: 'SwapStatusFilter'; enumValues: 'CANCELLED' | 'EXPIRED' | 'FULFILLED' | 'OPEN' | 'PENDING_SIGNATURE'; };
299
301
  'SwapStatusRequest': { kind: 'INPUT_OBJECT'; name: 'SwapStatusRequest'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapId'; ofType: null; }; }; defaultValue: null }]; };
302
+ 'SwapTokenInput': { kind: 'INPUT_OBJECT'; name: 'SwapTokenInput'; isOneOf: true; inputFields: [{ name: 'native'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; defaultValue: null }, { name: 'erc20'; type: { kind: 'INPUT_OBJECT'; name: 'SwapErc20Input'; ofType: null; }; defaultValue: null }]; };
300
303
  'SwapTransactionRequest': { kind: 'OBJECT'; name: 'SwapTransactionRequest'; fields: { 'orderReceipt': { name: 'orderReceipt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SwapReceipt'; ofType: null; }; } }; 'transaction': { name: 'transaction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TransactionRequest'; ofType: null; }; } }; }; };
301
304
  'SwapTypedData': { kind: 'OBJECT'; name: 'SwapTypedData'; 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; }; } }; }; };
302
305
  'SwapWithTransactionInput': { kind: 'INPUT_OBJECT'; name: 'SwapWithTransactionInput'; isOneOf: false; inputFields: [{ name: 'quoteId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SwapQuoteId'; ofType: null; }; }; defaultValue: null }, { name: 'permitSig'; type: { kind: 'SCALAR'; name: 'Signature'; ofType: null; }; defaultValue: null }, { name: 'isSenderSmartContractWallet'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }]; };
@@ -310,7 +313,7 @@ type introspection_types = {
310
313
  'TokenInfo': { kind: 'OBJECT'; name: 'TokenInfo'; fields: { 'categories': { name: 'categories'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TokenCategory'; ofType: null; }; }; }; } }; 'decimals': { name: 'decimals'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'icon': { name: 'icon'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'TokenInfoId'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'symbol': { name: 'symbol'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
311
314
  'TokenInfoId': unknown;
312
315
  'TokenInput': { kind: 'INPUT_OBJECT'; name: 'TokenInput'; isOneOf: true; inputFields: [{ name: 'native'; type: { kind: 'SCALAR'; name: 'AlwaysTrue'; ofType: null; }; defaultValue: null }, { name: 'erc20'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; defaultValue: null }]; };
313
- 'TokenSwapQuoteRequest': { kind: 'INPUT_OBJECT'; name: 'TokenSwapQuoteRequest'; isOneOf: true; inputFields: [{ name: 'market'; type: { kind: 'INPUT_OBJECT'; name: 'MarketOrderTokenSwapQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'limit'; type: { kind: 'INPUT_OBJECT'; name: 'LimitOrderTokenSwapQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'fromQuote'; type: { kind: 'INPUT_OBJECT'; name: 'FromQuoteSwapQuoteInput'; ofType: null; }; defaultValue: null }]; };
316
+ 'TokenSwapQuoteRequest': { kind: 'INPUT_OBJECT'; name: 'TokenSwapQuoteRequest'; isOneOf: true; inputFields: [{ name: 'market'; type: { kind: 'INPUT_OBJECT'; name: 'MarketOrderTokenSwapQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'limit'; type: { kind: 'INPUT_OBJECT'; name: 'LimitOrderTokenSwapQuoteInput'; ofType: null; }; defaultValue: null }, { name: 'fromQuote'; type: { kind: 'INPUT_OBJECT'; name: 'MarketOrderTokenSwapFromQuoteInput'; ofType: null; }; defaultValue: null }]; };
314
317
  'TokenSwapQuoteResult': { kind: 'UNION'; name: 'TokenSwapQuoteResult'; fields: {}; possibleTypes: 'SwapByIntent' | 'SwapByIntentWithApprovalRequired' | 'SwapByTransaction'; };
315
318
  'TransactionRequest': { kind: 'OBJECT'; name: 'TransactionRequest'; fields: { 'chainId': { name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; } }; 'data': { name: 'data'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BlockchainData'; ofType: null; }; } }; 'from': { name: 'from'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'operations': { name: 'operations'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'OperationType'; ofType: null; }; }; } }; 'to': { name: 'to'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'value': { name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; } }; }; };
316
319
  'TxHash': unknown;
@@ -339,7 +342,7 @@ type introspection_types = {
339
342
  '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 }]; };
340
343
  '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 }]; };
341
344
  '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 }]; };
342
- '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; } }; '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; }; } }; }; };
345
+ '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; }; } }; }; };
343
346
  'UserPositionConditionVariation': { kind: 'UNION'; name: 'UserPositionConditionVariation'; fields: {}; possibleTypes: 'CollateralFactorVariation' | 'LiquidationFeeVariation' | 'MaxLiquidationBonusVariation'; };
344
347
  'UserPositionConditionsUpdate': { name: 'UserPositionConditionsUpdate'; enumValues: 'ALL_DYNAMIC_CONFIG' | 'JUST_RISK_PREMIUM'; };
345
348
  'UserPositionId': unknown;
@@ -352,7 +355,7 @@ type introspection_types = {
352
355
  'UserRiskPremiumBreakdownRequest': { kind: 'INPUT_OBJECT'; name: 'UserRiskPremiumBreakdownRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UserRiskPremiumBreakdownRequestQuery'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
353
356
  'UserRiskPremiumBreakdownRequestQuery': { kind: 'INPUT_OBJECT'; name: 'UserRiskPremiumBreakdownRequestQuery'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }]; };
354
357
  'UserSpokeInput': { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; isOneOf: false; inputFields: [{ name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SpokeId'; ofType: null; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
355
- 'UserSummary': { kind: 'OBJECT'; name: 'UserSummary'; fields: { 'lowestHealthFactor': { name: 'lowestHealthFactor'; type: { kind: 'SCALAR'; name: 'BigDecimal'; 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; }; } }; 'netFeeEarned': { name: 'netFeeEarned'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'totalCollateral': { name: 'totalCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'totalDebt': { name: 'totalDebt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'totalPositions': { name: 'totalPositions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'totalSupplied': { name: 'totalSupplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; }; };
358
+ 'UserSummary': { kind: 'OBJECT'; name: 'UserSummary'; fields: { 'lowestHealthFactor': { name: 'lowestHealthFactor'; type: { kind: 'SCALAR'; name: 'BigDecimal'; 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; }; } }; 'totalCollateral': { name: 'totalCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'totalDebt': { name: 'totalDebt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'totalPositions': { name: 'totalPositions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'totalSupplied': { name: 'totalSupplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; }; };
356
359
  'UserSummaryFilter': { kind: 'INPUT_OBJECT'; name: 'UserSummaryFilter'; 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: 'chainIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }]; };
357
360
  'UserSummaryHistoryItem': { kind: 'OBJECT'; name: 'UserSummaryHistoryItem'; 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; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; } }; 'netBalance': { name: 'netBalance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; 'supplies': { name: 'supplies'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExchangeAmount'; ofType: null; }; } }; }; };
358
361
  'UserSummaryHistoryRequest': { kind: 'INPUT_OBJECT'; name: 'UserSummaryHistoryRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'filter'; type: { kind: 'INPUT_OBJECT'; name: 'UserSummaryFilter'; ofType: null; }; defaultValue: null }, { name: 'window'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TimeWindow'; ofType: null; }; }; defaultValue: "LAST_DAY" }]; };
@@ -1605,6 +1608,27 @@ declare const SwapTypedDataFragment: gql_tada.TadaDocumentNode<{
1605
1608
  masked: false;
1606
1609
  }>;
1607
1610
  type SwapTypedData = FragmentOf<typeof SwapTypedDataFragment>;
1611
+ declare const PrepareSwapOrderFragment: gql_tada.TadaDocumentNode<{
1612
+ __typename: "PrepareSwapOrder";
1613
+ newQuoteId: SwapQuoteId;
1614
+ data: {
1615
+ __typename: "SwapTypedData";
1616
+ primaryType: string;
1617
+ types: type_fest.JsonObject;
1618
+ domain: {
1619
+ name: string;
1620
+ version: string;
1621
+ chainId: _aave_types.ChainId;
1622
+ verifyingContract: _aave_types.EvmAddress;
1623
+ };
1624
+ message: type_fest.JsonObject;
1625
+ };
1626
+ }, {}, {
1627
+ fragment: "PrepareSwapOrder";
1628
+ on: "PrepareSwapOrder";
1629
+ masked: false;
1630
+ }>;
1631
+ type PrepareSwapOrder = FragmentOf<typeof PrepareSwapOrderFragment>;
1608
1632
  declare const SwapByIntentFragment: gql_tada.TadaDocumentNode<{
1609
1633
  __typename: "SwapByIntent";
1610
1634
  quote: {
@@ -2549,18 +2573,6 @@ declare const SwapByIntentFragment: gql_tada.TadaDocumentNode<{
2549
2573
  };
2550
2574
  };
2551
2575
  };
2552
- data: {
2553
- __typename: "SwapTypedData";
2554
- primaryType: string;
2555
- types: type_fest.JsonObject;
2556
- domain: {
2557
- name: string;
2558
- version: string;
2559
- chainId: _aave_types.ChainId;
2560
- verifyingContract: _aave_types.EvmAddress;
2561
- };
2562
- message: type_fest.JsonObject;
2563
- };
2564
2576
  }, {}, {
2565
2577
  fragment: "SwapByIntent";
2566
2578
  on: "SwapByIntent";
@@ -5949,6 +5961,10 @@ declare function makeSwapByTransaction(): SwapByTransaction;
5949
5961
  * @internal
5950
5962
  */
5951
5963
  declare function makeSwapByIntent(): SwapByIntent;
5964
+ /**
5965
+ * @internal
5966
+ */
5967
+ declare function makePrepareSwapOrder(): PrepareSwapOrder;
5952
5968
  /**
5953
5969
  * @internal
5954
5970
  */
@@ -5966,4 +5982,4 @@ declare function makeSwapByIntentWithApprovalRequired({ approval, }?: {
5966
5982
  approval?: Erc20Approval;
5967
5983
  }): SwapByIntentWithApprovalRequired;
5968
5984
 
5969
- export { TestTokens, decimalNumber, makeChain, makeErc20Amount, makeErc20Approval, makeErc20Token, makeExchangeAmount, makePermitTypedDataResponse, makePositionSwapAdapterContractApproval, makePositionSwapPositionManagerApproval, makeSwapByIntent, makeSwapByIntentWithApprovalRequired, makeSwapByTransaction, makeSwapCancelled, makeSwapOpen, makeSwapQuote, makeSwapReceipt, makeSwapTransactionRequest, makeSwapTypedData, makeTokenInfo, makeTransactionRequest, percentNumber, randomEvmAddress };
5985
+ export { TestTokens, decimalNumber, makeChain, makeErc20Amount, makeErc20Approval, makeErc20Token, makeExchangeAmount, makePermitTypedDataResponse, makePositionSwapAdapterContractApproval, makePositionSwapPositionManagerApproval, makePrepareSwapOrder, makeSwapByIntent, makeSwapByIntentWithApprovalRequired, makeSwapByTransaction, makeSwapCancelled, makeSwapOpen, makeSwapQuote, makeSwapReceipt, makeSwapTransactionRequest, makeSwapTypedData, makeTokenInfo, makeTransactionRequest, percentNumber, randomEvmAddress };
package/dist/testing.js CHANGED
@@ -1,3 +1,3 @@
1
- import {bigDecimal,evmAddress,chainId,invariant}from'@aave/types';function I(e){return invariant(typeof e=="string"&&e.length>0,`Invalid TokenInfoId: ${e}`),e}function p(){return btoa(crypto.randomUUID())}function T(e,t=6){let r=bigDecimal(e);return {__typename:"PercentNumber",value:r.div(2),normalized:r,onChainValue:BigInt(r.rescale(t).toApproximateNumber()),decimals:t}}function u(e,t=18){return {__typename:"DecimalNumber",value:bigDecimal(e),onChainValue:BigInt(bigDecimal(e).rescale(t).toApproximateNumber()),decimals:t}}function f(e){return [...Array(e)].map(()=>Math.floor(Math.random()*16).toString(16)).join("")}function a(){return evmAddress(`0x${f(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 y(e){let{name:t,decimals:r}=i[e];return {__typename:"TokenInfo",id:I(p()),name:t,symbol:e,decimals:r,icon:"https://example.com/icon.png",categories:[]}}function l(){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:a(),nativeGateway:a(),signatureGateway:a(),nativeInfo:y("WETH")}}function x(e){let{isWrappedNativeToken:t}=i[e];return {__typename:"Erc20Token",address:a(),chain:l(),info:y(e),isWrappedNativeToken:t,permitSupported:false}}function w(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:u(e,i[t].decimals),token:x(t),exchange:w(e),exchangeRate:u(e)}}function d({chainId:e=chainId(1),from:t=a()}={}){return {__typename:"TransactionRequest",to:t,from:t,data:"0x",value:0n,chainId:e,operations:[]}}function c(){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:a()},message:{amount:"1000000000000000000",deadline:1234567890}}}function m(){return {__typename:"SwapQuote",quoteId:p(),suggestedSlippage:T(.01),spotBuy:n(1e3,"USDC"),spotSell:n(1e3,"WETH"),costs:{__typename:"SwapQuoteCosts",networkCosts:n(1e3,"WETH"),partnerFee:n(1e3,"USDC"),flashloanFee:n(1e3,"WETH"),providerFee:n(1e3,"USDC")},finalBuy:n(1e3,"USDC"),finalSell:n(1e3,"WETH")}}function A(){return {__typename:"SwapReceipt",id:p(),createdAt:new Date,explorerLink:"https://example.com/explorer.json"}}function $(){return {__typename:"SwapOpen",swapId:p(),createdAt:new Date,deadline:new Date(Date.now()+36e5),explorerLink:"https://example.com/explorer.json",desiredSell:n(1e3,"WETH"),desiredBuy:n(1e3,"USDC")}}function U(){return {__typename:"SwapCancelled",createdAt:new Date,cancelledAt:new Date,explorerLink:"https://example.com/explorer.json"}}function R({bySignature:e=c()}={}){return {__typename:"PositionSwapAdapterContractApproval",bySignature:e}}function v({bySignature:e=c(),byTransaction:t=d()}={}){return {__typename:"PositionSwapPositionManagerApproval",bySignature:e,byTransaction:t}}function H({transaction:e=d()}={}){return {__typename:"SwapTransactionRequest",transaction:e,orderReceipt:A()}}function q(){return {__typename:"SwapByTransaction",quote:m()}}function F(){return {__typename:"SwapByIntent",quote:m(),data:c()}}function h(){return {__typename:"PermitTypedDataResponse",types:{__typename:"TypeDefinition",EIP712Domain:[{__typename:"TypeField",name:"name",type:"string"}],Permit:[{__typename:"TypeField",name:"owner",type:"address"},{__typename:"TypeField",name:"spender",type:"address"},{__typename:"TypeField",name:"value",type:"uint256"},{__typename:"TypeField",name:"nonce",type:"uint256"},{__typename:"TypeField",name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{__typename:"DomainData",name:"Permit",version:"1",chainId:chainId(1),verifyingContract:a()},message:{__typename:"PermitMessageData",owner:a(),spender:a(),value:1000000000000000000n,nonce:0n,deadline:1234567890}}}function k({byTransaction:e=d()}={}){return {__typename:"Erc20Approval",byTransaction:e,bySignature:h()}}function N({approval:e=k()}={}){return {__typename:"SwapByIntentWithApprovalRequired",quote:m(),approval:e}}
2
- export{i as TestTokens,u as decimalNumber,l as makeChain,n as makeErc20Amount,k as makeErc20Approval,x as makeErc20Token,w as makeExchangeAmount,h as makePermitTypedDataResponse,R as makePositionSwapAdapterContractApproval,v as makePositionSwapPositionManagerApproval,F as makeSwapByIntent,N as makeSwapByIntentWithApprovalRequired,q as makeSwapByTransaction,U as makeSwapCancelled,$ as makeSwapOpen,m as makeSwapQuote,A as makeSwapReceipt,H as makeSwapTransactionRequest,c as makeSwapTypedData,y as makeTokenInfo,d as makeTransactionRequest,T as percentNumber,a as randomEvmAddress};//# sourceMappingURL=testing.js.map
1
+ import {bigDecimal,evmAddress,chainId,invariant}from'@aave/types';function I(e){return invariant(typeof e=="string"&&e.length>0,`Invalid TokenInfoId: ${e}`),e}function p(){return btoa(crypto.randomUUID())}function f(e,t=6){let r=bigDecimal(e);return {__typename:"PercentNumber",value:r.div(2),normalized:r,onChainValue:BigInt(r.rescale(t).toApproximateNumber()),decimals:t}}function u(e,t=18){return {__typename:"DecimalNumber",value:bigDecimal(e),onChainValue:BigInt(bigDecimal(e).rescale(t).toApproximateNumber()),decimals:t}}function l(e){return [...Array(e)].map(()=>Math.floor(Math.random()*16).toString(16)).join("")}function a(){return evmAddress(`0x${l(40)}`)}var d={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 y(e){let{name:t,decimals:r}=d[e];return {__typename:"TokenInfo",id:I(p()),name:t,symbol:e,decimals:r,icon:"https://example.com/icon.png",categories:[]}}function x(){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:a(),nativeGateway:a(),signatureGateway:a(),nativeInfo:y("WETH")}}function w(e){let{isWrappedNativeToken:t}=d[e];return {__typename:"Erc20Token",address:a(),chain:x(),info:y(e),isWrappedNativeToken:t,permitSupported:false}}function A(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:u(e,d[t].decimals),token:w(t),exchange:A(e),exchangeRate:u(e)}}function i({chainId:e=chainId(1),from:t=a()}={}){return {__typename:"TransactionRequest",to:t,from:t,data:"0x",value:0n,chainId:e,operations:[]}}function c(){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:a()},message:{amount:"1000000000000000000",deadline:1234567890}}}function g(){return p()}function m(){return {__typename:"SwapQuote",quoteId:g(),suggestedSlippage:f(.01),spotBuy:n(1e3,"USDC"),spotSell:n(1e3,"WETH"),costs:{__typename:"SwapQuoteCosts",networkCosts:n(1e3,"WETH"),partnerFee:n(1e3,"USDC"),flashloanFee:n(1e3,"WETH"),providerFee:n(1e3,"USDC")},finalBuy:n(1e3,"USDC"),finalSell:n(1e3,"WETH")}}function h(){return {__typename:"SwapReceipt",id:p(),createdAt:new Date,explorerLink:"https://example.com/explorer.json"}}function U(){return {__typename:"SwapOpen",swapId:p(),createdAt:new Date,deadline:new Date(Date.now()+36e5),explorerLink:"https://example.com/explorer.json",desiredSell:n(1e3,"WETH"),desiredBuy:n(1e3,"USDC")}}function R(){return {__typename:"SwapCancelled",createdAt:new Date,cancelledAt:new Date,explorerLink:"https://example.com/explorer.json"}}function v({bySignature:e=c()}={}){return {__typename:"PositionSwapAdapterContractApproval",bySignature:e}}function H({bySignature:e=c(),byTransaction:t=i()}={}){return {__typename:"PositionSwapPositionManagerApproval",bySignature:e,byTransaction:t}}function q({transaction:e=i()}={}){return {__typename:"SwapTransactionRequest",transaction:e,orderReceipt:h()}}function F(){return {__typename:"SwapByTransaction",quote:m()}}function N(){return {__typename:"SwapByIntent",quote:m()}}function O(){return {__typename:"PrepareSwapOrder",newQuoteId:g(),data:c()}}function k(){return {__typename:"PermitTypedDataResponse",types:{__typename:"TypeDefinition",EIP712Domain:[{__typename:"TypeField",name:"name",type:"string"}],Permit:[{__typename:"TypeField",name:"owner",type:"address"},{__typename:"TypeField",name:"spender",type:"address"},{__typename:"TypeField",name:"value",type:"uint256"},{__typename:"TypeField",name:"nonce",type:"uint256"},{__typename:"TypeField",name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{__typename:"DomainData",name:"Permit",version:"1",chainId:chainId(1),verifyingContract:a()},message:{__typename:"PermitMessageData",owner:a(),spender:a(),value:1000000000000000000n,nonce:0n,deadline:1234567890}}}function b({byTransaction:e=i()}={}){return {__typename:"Erc20Approval",byTransaction:e,bySignature:k()}}function W({approval:e=b()}={}){return {__typename:"SwapByIntentWithApprovalRequired",quote:m(),approval:e}}
2
+ export{d as TestTokens,u as decimalNumber,x as makeChain,n as makeErc20Amount,b as makeErc20Approval,w as makeErc20Token,A as makeExchangeAmount,k as makePermitTypedDataResponse,v as makePositionSwapAdapterContractApproval,H as makePositionSwapPositionManagerApproval,O as makePrepareSwapOrder,N as makeSwapByIntent,W as makeSwapByIntentWithApprovalRequired,F as makeSwapByTransaction,R as makeSwapCancelled,U as makeSwapOpen,m as makeSwapQuote,h as makeSwapReceipt,q as makeSwapTransactionRequest,c as makeSwapTypedData,y as makeTokenInfo,i as makeTransactionRequest,f as percentNumber,a 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":["tokenInfoId","value","invariant","randomBase64String","percentNumber","decimals","normalized","bigDecimal","decimalNumber","randomHexString","size","randomEvmAddress","evmAddress","TestTokens","makeTokenInfo","symbol","name","makeChain","toChainId","makeErc20Token","isWrappedNativeToken","makeExchangeAmount","makeErc20Amount","makeTransactionRequest","chainId","from","makeSwapTypedData","makeSwapQuote","makeSwapReceipt","makeSwapOpen","makeSwapCancelled","makePositionSwapAdapterContractApproval","bySignature","makePositionSwapPositionManagerApproval","byTransaction","makeSwapTransactionRequest","transaction","makeSwapByTransaction","makeSwapByIntent","makePermitTypedDataResponse","makeErc20Approval","makeSwapByIntentWithApprovalRequired","approval"],"mappings":"kEA+aO,SAASA,CAAAA,CAAYC,CAAAA,CAA4B,CACtD,OAAAC,SAAAA,CACE,OAAOD,CAAAA,EAAU,QAAA,EAAYA,EAAM,MAAA,CAAS,CAAA,CAC5C,wBAAwBA,CAAK,CAAA,CAC/B,EACOA,CACT,CC9YA,SAASE,CAAAA,EAA6B,CACpC,OAAO,IAAA,CAAK,MAAA,CAAO,YAAY,CACjC,CAKO,SAASC,CAAAA,CAAcH,CAAAA,CAAeI,EAAW,CAAA,CAAkB,CACxE,IAAMC,CAAAA,CAAaC,UAAAA,CAAWN,CAAK,CAAA,CAEnC,OAAO,CACL,UAAA,CAAY,eAAA,CACZ,MAAOK,CAAAA,CAAW,GAAA,CAAI,CAAC,CAAA,CACvB,UAAA,CAAAA,EACA,YAAA,CAAc,MAAA,CAAOA,CAAAA,CAAW,OAAA,CAAQD,CAAQ,CAAA,CAAE,qBAAqB,CAAA,CACvE,SAAAA,CACF,CACF,CAKO,SAASG,CAAAA,CAAcP,CAAAA,CAAeI,CAAAA,CAAW,EAAA,CAAmB,CACzE,OAAO,CACL,UAAA,CAAY,gBACZ,KAAA,CAAOE,UAAAA,CAAWN,CAAK,CAAA,CACvB,YAAA,CAAc,MAAA,CACZM,UAAAA,CAAWN,CAAK,CAAA,CAAE,QAAQI,CAAQ,CAAA,CAAE,qBACtC,CAAA,CACA,SAAAA,CACF,CACF,CAEA,SAASI,CAAAA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AAA,CACZ,MAAOb,CAAAA,EAAc,CACrB,QAAA,CAAAe,CACF,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 * 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 type {\n Chain,\n DecimalNumber,\n DomainData,\n Erc20Amount,\n Erc20Approval,\n Erc20Token,\n ExchangeAmount,\n PercentNumber,\n PositionSwapAdapterContractApproval,\n PositionSwapPositionManagerApproval,\n SwapByIntent,\n SwapByIntentWithApprovalRequired,\n SwapByTransaction,\n SwapCancelled,\n SwapOpen,\n SwapQuote,\n SwapReceipt,\n SwapTransactionRequest,\n SwapTypedData,\n TokenInfo,\n TransactionRequest,\n} from './fragments';\nimport { type SwapId, type SwapQuoteId, tokenInfoId } from './id';\nimport type {\n PermitMessageData,\n PermitTypedDataResponse,\n TypeDefinition,\n TypeField,\n} from './permits';\n\nfunction randomBase64String(): string {\n return btoa(crypto.randomUUID());\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 permitSupported: false,\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\n/**\n * @internal\n */\nexport function makeSwapQuote(): SwapQuote {\n return {\n __typename: 'SwapQuote',\n quoteId: randomBase64String() as SwapQuoteId,\n suggestedSlippage: percentNumber(0.01),\n spotBuy: makeErc20Amount(1000, 'USDC'),\n spotSell: 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(1000, '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 explorerLink: 'https://example.com/explorer.json',\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 explorerLink: 'https://example.com/explorer.json',\n desiredSell: makeErc20Amount(1000, 'WETH'),\n desiredBuy: makeErc20Amount(1000, 'USDC'),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelled(): SwapCancelled {\n return {\n __typename: 'SwapCancelled',\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerLink: '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(): SwapByIntent {\n return {\n __typename: 'SwapByIntent',\n quote: makeSwapQuote(),\n data: makeSwapTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makePermitTypedDataResponse(): PermitTypedDataResponse {\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 TypeField, TypeDefinition, etc.)\n return {\n __typename: 'PermitTypedDataResponse',\n types: {\n __typename: 'TypeDefinition',\n EIP712Domain: [\n { __typename: 'TypeField', name: 'name', type: 'string' } as TypeField,\n ],\n Permit: [\n {\n __typename: 'TypeField',\n name: 'owner',\n type: 'address',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'spender',\n type: 'address',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'value',\n type: 'uint256',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'nonce',\n type: 'uint256',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'deadline',\n type: 'uint256',\n } as TypeField,\n ],\n } as TypeDefinition,\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 __typename: 'PermitMessageData',\n owner: randomEvmAddress(),\n spender: randomEvmAddress(),\n value: 1000000000000000000n,\n nonce: 0n,\n deadline: 1234567890,\n } as PermitMessageData,\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: makePermitTypedDataResponse(),\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 approval,\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/id.ts","../src/testing.ts"],"names":["tokenInfoId","value","invariant","randomBase64String","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","makeSwapReceipt","makeSwapOpen","makeSwapCancelled","makePositionSwapAdapterContractApproval","bySignature","makePositionSwapPositionManagerApproval","byTransaction","makeSwapTransactionRequest","transaction","makeSwapByTransaction","makeSwapByIntent","makePrepareSwapOrder","makePermitTypedDataResponse","makeErc20Approval","makeSwapByIntentWithApprovalRequired","approval"],"mappings":"kEA+aO,SAASA,CAAAA,CAAYC,CAAAA,CAA4B,CACtD,OAAAC,SAAAA,CACE,OAAOD,GAAU,QAAA,EAAYA,CAAAA,CAAM,OAAS,CAAA,CAC5C,CAAA,qBAAA,EAAwBA,CAAK,CAAA,CAC/B,CAAA,CACOA,CACT,CC7YA,SAASE,CAAAA,EAA6B,CACpC,OAAO,IAAA,CAAK,OAAO,UAAA,EAAY,CACjC,CAKO,SAASC,CAAAA,CAAcH,CAAAA,CAAeI,CAAAA,CAAW,CAAA,CAAkB,CACxE,IAAMC,CAAAA,CAAaC,WAAWN,CAAK,CAAA,CAEnC,OAAO,CACL,UAAA,CAAY,eAAA,CACZ,KAAA,CAAOK,CAAAA,CAAW,GAAA,CAAI,CAAC,CAAA,CACvB,UAAA,CAAAA,EACA,YAAA,CAAc,MAAA,CAAOA,EAAW,OAAA,CAAQD,CAAQ,CAAA,CAAE,mBAAA,EAAqB,CAAA,CACvE,SAAAA,CACF,CACF,CAKO,SAASG,CAAAA,CAAcP,EAAeI,CAAAA,CAAW,EAAA,CAAmB,CACzE,OAAO,CACL,UAAA,CAAY,gBACZ,KAAA,CAAOE,UAAAA,CAAWN,CAAK,CAAA,CACvB,YAAA,CAAc,OACZM,UAAAA,CAAWN,CAAK,CAAA,CAAE,OAAA,CAAQI,CAAQ,CAAA,CAAE,qBACtC,CAAA,CACA,SAAAA,CACF,CACF,CAEA,SAASI,CAAAA,CAAgBC,CAAAA,CAA6B,CACpD,OAAO,CAAC,GAAG,KAA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,aAAA,CAAAY,CAAAA,CACA,YAAaM,CAAAA,EACf,CACF,CAKO,SAASE,EAAqC,CACnD,QAAA,CAAAC,CAAAA,CAAWF,CAAAA,EACb,CAAA,CAEI,EAAC,CAAqC,CACxC,OAAO,CACL,UAAA,CAAY,kCAAA,CACZ,MAAOd,CAAAA,EAAc,CACrB,QAAA,CAAAgB,CACF,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 * 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 type {\n Chain,\n DecimalNumber,\n DomainData,\n Erc20Amount,\n Erc20Approval,\n Erc20Token,\n ExchangeAmount,\n PercentNumber,\n PositionSwapAdapterContractApproval,\n PositionSwapPositionManagerApproval,\n PrepareSwapOrder,\n SwapByIntent,\n SwapByIntentWithApprovalRequired,\n SwapByTransaction,\n SwapCancelled,\n SwapOpen,\n SwapQuote,\n SwapReceipt,\n SwapTransactionRequest,\n SwapTypedData,\n TokenInfo,\n TransactionRequest,\n} from './fragments';\nimport { type SwapId, type SwapQuoteId, tokenInfoId } from './id';\nimport type {\n PermitMessageData,\n PermitTypedDataResponse,\n TypeDefinition,\n TypeField,\n} from './permits';\n\nfunction randomBase64String(): string {\n return btoa(crypto.randomUUID());\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 permitSupported: false,\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(): SwapQuote {\n return {\n __typename: 'SwapQuote',\n quoteId: makeQuoteId(),\n suggestedSlippage: percentNumber(0.01),\n spotBuy: makeErc20Amount(1000, 'USDC'),\n spotSell: 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(1000, '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 explorerLink: 'https://example.com/explorer.json',\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 explorerLink: 'https://example.com/explorer.json',\n desiredSell: makeErc20Amount(1000, 'WETH'),\n desiredBuy: makeErc20Amount(1000, 'USDC'),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelled(): SwapCancelled {\n return {\n __typename: 'SwapCancelled',\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerLink: '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(): SwapByIntent {\n return {\n __typename: 'SwapByIntent',\n quote: makeSwapQuote(),\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 makePermitTypedDataResponse(): PermitTypedDataResponse {\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 TypeField, TypeDefinition, etc.)\n return {\n __typename: 'PermitTypedDataResponse',\n types: {\n __typename: 'TypeDefinition',\n EIP712Domain: [\n { __typename: 'TypeField', name: 'name', type: 'string' } as TypeField,\n ],\n Permit: [\n {\n __typename: 'TypeField',\n name: 'owner',\n type: 'address',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'spender',\n type: 'address',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'value',\n type: 'uint256',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'nonce',\n type: 'uint256',\n } as TypeField,\n {\n __typename: 'TypeField',\n name: 'deadline',\n type: 'uint256',\n } as TypeField,\n ],\n } as TypeDefinition,\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 __typename: 'PermitMessageData',\n owner: randomEvmAddress(),\n spender: randomEvmAddress(),\n value: 1000000000000000000n,\n nonce: 0n,\n deadline: 1234567890,\n } as PermitMessageData,\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: makePermitTypedDataResponse(),\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 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.15",
3
+ "version": "1.0.0-next.17",
4
4
  "description": "GraphQL bindings for the Aave API",
5
5
  "repository": {
6
6
  "directory": "packages/graphql",
@@ -49,7 +49,7 @@
49
49
  "gql.tada": "^1.8.13",
50
50
  "graphql": "^16.11.0",
51
51
  "type-fest": "^5.1.0",
52
- "@aave/types": "1.0.0-next.6"
52
+ "@aave/types": "1.0.0-next.7"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@urql/introspection": "^1.2.1",