@aave/graphql 1.0.0-next.36 → 1.0.0-next.37

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
@@ -200,7 +200,7 @@ type introspection_types = {
200
200
  'ChainsFilter': { name: 'ChainsFilter'; enumValues: 'TESTNET_ONLY' | 'MAINNET_ONLY' | 'ALL'; };
201
201
  'ChainsRequest': { kind: 'INPUT_OBJECT'; name: 'ChainsRequest'; isOneOf: false; inputFields: [{ name: 'query'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ChainsRequestQuery'; ofType: null; }; }; defaultValue: null }]; };
202
202
  'ChainsRequestQuery': { kind: 'INPUT_OBJECT'; name: 'ChainsRequestQuery'; isOneOf: true; inputFields: [{ name: 'chainIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; defaultValue: null }, { name: 'filter'; type: { kind: 'ENUM'; name: 'ChainsFilter'; ofType: null; }; defaultValue: null }]; };
203
- 'ClaimRewardsRequest': { kind: 'INPUT_OBJECT'; name: 'ClaimRewardsRequest'; isOneOf: false; inputFields: [{ name: 'ids'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; }; }; }; defaultValue: null }]; };
203
+ 'ClaimRewardsRequest': { kind: 'INPUT_OBJECT'; name: 'ClaimRewardsRequest'; isOneOf: false; inputFields: [{ name: 'ids'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; }; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; defaultValue: null }]; };
204
204
  'CollateralFactorVariation': { kind: 'OBJECT'; name: 'CollateralFactorVariation'; fields: { 'after': { name: 'after'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'reserveId': { name: 'reserveId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ReserveId'; ofType: null; }; } }; 'token': { name: 'token'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Token'; ofType: null; }; } }; }; };
205
205
  'CollateralMetric': { name: 'CollateralMetric'; enumValues: 'HIGHEST' | 'LOWEST'; };
206
206
  'Currency': { name: 'Currency'; enumValues: 'USD' | 'GBP' | 'EUR'; };
@@ -308,7 +308,7 @@ type introspection_types = {
308
308
  'PercentNumberChangeSnapshot': { kind: 'OBJECT'; name: 'PercentNumberChangeSnapshot'; fields: { 'after': { name: 'after'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'before': { name: 'before'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
309
309
  'PercentNumberVariation': { kind: 'OBJECT'; name: 'PercentNumberVariation'; fields: { 'after': { name: 'after'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
310
310
  'PercentNumberWithChange': { kind: 'OBJECT'; name: 'PercentNumberWithChange'; fields: { 'change': { name: 'change'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; 'current': { name: 'current'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentNumber'; ofType: null; }; } }; }; };
311
- 'PermitTypedData': { kind: 'OBJECT'; name: 'PermitTypedData'; fields: { 'domain': { name: 'domain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DomainData'; ofType: null; }; } }; 'message': { name: 'message'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; 'primaryType': { name: 'primaryType'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'types': { name: 'types'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; }; };
311
+ 'PermitTypedData': { kind: 'OBJECT'; name: 'PermitTypedData'; fields: { 'domain': { name: 'domain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'DomainData'; ofType: null; }; } }; 'message': { name: 'message'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; 'primaryType': { name: 'primaryType'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'signedAmount': { name: 'signedAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'types': { name: 'types'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; }; };
312
312
  'PointsCriteria': { kind: 'UNION'; name: 'PointsCriteria'; fields: {}; possibleTypes: 'PointsGenericCriteria'; };
313
313
  'PointsGenericCriteria': { kind: 'OBJECT'; name: 'PointsGenericCriteria'; fields: { 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'text': { name: 'text'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'userPassed': { name: 'userPassed'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
314
314
  'PointsProgram': { kind: 'OBJECT'; name: 'PointsProgram'; fields: { 'externalUrl': { name: 'externalUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'iconUrl': { name: 'iconUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
@@ -341,14 +341,15 @@ type introspection_types = {
341
341
  'RenounceSpokeUserPositionManagerRequest': { kind: 'INPUT_OBJECT'; name: 'RenounceSpokeUserPositionManagerRequest'; isOneOf: false; inputFields: [{ name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'SpokeId'; ofType: null; }; }; defaultValue: null }, { name: 'manager'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'managing'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
342
342
  'RepayActivity': { kind: 'OBJECT'; name: 'RepayActivity'; fields: { 'chain': { name: 'chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'repaid': { name: 'repaid'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'reserve': { name: 'reserve'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ReserveInfo'; ofType: null; }; } }; 'spoke': { name: 'spoke'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Spoke'; ofType: null; }; } }; 'timestamp': { name: 'timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; }; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
343
343
  'RepayAmountInputWithPermit': { kind: 'INPUT_OBJECT'; name: 'RepayAmountInputWithPermit'; isOneOf: true; inputFields: [{ name: 'native'; type: { kind: 'INPUT_OBJECT'; name: 'AmountInput'; ofType: null; }; defaultValue: null }, { name: 'erc20'; type: { kind: 'INPUT_OBJECT'; name: 'RepayErc20AmountInputWithPermit'; ofType: null; }; defaultValue: null }]; };
344
- 'RepayErc20AmountInputWithPermit': { kind: 'INPUT_OBJECT'; name: 'RepayErc20AmountInputWithPermit'; isOneOf: false; inputFields: [{ name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'AmountInput'; ofType: null; }; }; defaultValue: null }, { name: 'permitSig'; type: { kind: 'INPUT_OBJECT'; name: 'ERC20PermitSignature'; ofType: null; }; defaultValue: null }]; };
344
+ 'RepayErc20AmountInputWithPermit': { kind: 'INPUT_OBJECT'; name: 'RepayErc20AmountInputWithPermit'; isOneOf: false; inputFields: [{ name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'AmountInput'; ofType: null; }; }; defaultValue: null }, { name: 'permit'; type: { kind: 'INPUT_OBJECT'; name: 'RepaySignedPermitInput'; ofType: null; }; defaultValue: null }]; };
345
345
  'RepayRequest': { kind: 'INPUT_OBJECT'; name: 'RepayRequest'; isOneOf: false; inputFields: [{ name: 'reserve'; 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: 'INPUT_OBJECT'; name: 'RepayAmountInputWithPermit'; ofType: null; }; }; defaultValue: null }, { name: 'sender'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
346
+ 'RepaySignedPermitInput': { kind: 'INPUT_OBJECT'; name: 'RepaySignedPermitInput'; isOneOf: false; inputFields: [{ name: 'permitSig'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ERC20PermitSignature'; ofType: null; }; }; defaultValue: null }, { name: 'signedAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; }; defaultValue: null }]; };
346
347
  'RepayWithSupply': { kind: 'OBJECT'; name: 'RepayWithSupply'; fields: { 'kind': { name: 'kind'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'RepayWithSupplyKind'; ofType: null; }; } }; 'orderClass': { name: 'orderClass'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SwapOrderClass'; ofType: null; }; } }; 'repay': { name: 'repay'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PositionAmount'; ofType: null; }; } }; 'supply': { name: 'supply'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PositionAmount'; ofType: null; }; } }; }; };
347
348
  'RepayWithSupplyActivity': { kind: 'OBJECT'; name: 'RepayWithSupplyActivity'; fields: { 'chain': { name: 'chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Chain'; ofType: null; }; } }; 'explorerUrl': { name: 'explorerUrl'; 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: 'ID'; ofType: null; }; } }; 'kind': { name: 'kind'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'RepayWithSupplyKind'; ofType: null; }; } }; 'orderClass': { name: 'orderClass'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SwapOrderClass'; ofType: null; }; } }; 'repay': { name: 'repay'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PositionAmount'; ofType: null; }; } }; 'status': { name: 'status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SwapActivityStatus'; ofType: null; }; } }; 'supply': { name: 'supply'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PositionAmount'; ofType: null; }; } }; 'timestamp': { name: 'timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'SCALAR'; name: 'TxHash'; ofType: null; } }; 'user': { name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
348
349
  'RepayWithSupplyKind': { name: 'RepayWithSupplyKind'; enumValues: 'REPAY' | 'SUPPLY'; };
349
350
  '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 }]; };
350
351
  'RepayWithSupplyQuoteResult': { kind: 'UNION'; name: 'RepayWithSupplyQuoteResult'; fields: {}; possibleTypes: 'InsufficientLiquidityError' | 'PositionSwapByIntentApprovalsRequired'; };
351
- '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; } }; }; };
352
+ 'Reserve': { kind: 'OBJECT'; name: 'Reserve'; fields: { 'asset': { name: 'asset'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'HubAsset'; 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; }; } }; 'userState': { name: 'userState'; type: { kind: 'OBJECT'; name: 'ReserveUserState'; ofType: null; } }; }; };
352
353
  '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 }]; };
353
354
  '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 }]; };
354
355
  '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 }]; };
@@ -499,7 +500,7 @@ type introspection_types = {
499
500
  'UserBorrowsRequestQuery': { kind: 'INPUT_OBJECT'; name: 'UserBorrowsRequestQuery'; isOneOf: true; inputFields: [{ name: 'userSpoke'; type: { kind: 'INPUT_OBJECT'; name: 'UserSpokeInput'; ofType: null; }; defaultValue: null }, { name: 'userToken'; type: { kind: 'INPUT_OBJECT'; name: 'UserToken'; ofType: null; }; defaultValue: null }, { name: 'userPositionId'; type: { kind: 'SCALAR'; name: 'UserPositionId'; ofType: null; }; defaultValue: null }, { name: 'userChains'; type: { kind: 'INPUT_OBJECT'; name: 'UserChains'; ofType: null; }; defaultValue: null }, { name: 'userHub'; type: { kind: 'INPUT_OBJECT'; name: 'UserHub'; ofType: null; }; defaultValue: null }]; };
500
501
  '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 }]; };
501
502
  'UserClaimableReward': { kind: 'UNION'; name: 'UserClaimableReward'; fields: {}; possibleTypes: 'UserMerklClaimableReward'; };
502
- 'UserClaimableRewardsRequest': { kind: 'INPUT_OBJECT'; name: 'UserClaimableRewardsRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }]; };
503
+ 'UserClaimableRewardsRequest': { kind: 'INPUT_OBJECT'; name: 'UserClaimableRewardsRequest'; isOneOf: false; inputFields: [{ name: 'user'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; }; defaultValue: null }, { name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; defaultValue: null }]; };
503
504
  '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 }]; };
504
505
  '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 }]; };
505
506
  'UserMerklClaimableReward': { kind: 'OBJECT'; name: 'UserMerklClaimableReward'; fields: { 'claimUntil': { name: 'claimUntil'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'claimable': { name: 'claimable'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Erc20Amount'; ofType: null; }; } }; 'endDate': { name: 'endDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RewardId'; ofType: null; }; } }; 'startDate': { name: 'startDate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
@@ -757,6 +758,7 @@ declare const PermitTypedDataFragment: gql_tada.TadaDocumentNode<{
757
758
  verifyingContract: _aave_types.EvmAddress;
758
759
  };
759
760
  message: type_fest.JsonObject;
761
+ signedAmount: _aave_types.BigDecimal;
760
762
  }, {}, {
761
763
  fragment: "PermitTypedData";
762
764
  on: "PermitTypedData";
@@ -800,6 +802,7 @@ declare const Erc20ApprovalFragment: gql_tada.TadaDocumentNode<{
800
802
  verifyingContract: _aave_types.EvmAddress;
801
803
  };
802
804
  message: type_fest.JsonObject;
805
+ signedAmount: _aave_types.BigDecimal;
803
806
  } | null;
804
807
  }, {}, {
805
808
  fragment: "Erc20Approval";
@@ -2767,6 +2770,7 @@ declare const SwapByIntentWithApprovalRequiredFragment: gql_tada.TadaDocumentNod
2767
2770
  verifyingContract: _aave_types.EvmAddress;
2768
2771
  };
2769
2772
  message: type_fest.JsonObject;
2773
+ signedAmount: _aave_types.BigDecimal;
2770
2774
  } | null;
2771
2775
  }[];
2772
2776
  quote: {
package/dist/testing.js CHANGED
@@ -1,3 +1,3 @@
1
- import {bigDecimal,evmAddress,chainId,invariant}from'@aave/types';function P(e){return btoa(String.fromCharCode(...new TextEncoder().encode(e)))}var _="::";function h(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserPositionId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserPositionId must be valid base64: ${e}`),e}function f(e){return U(P(`${e.chainId}${_}${e.address}`))}function U(e){return invariant(typeof e=="string"&&e.length>0,`Invalid SpokeId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`SpokeId must be valid base64: ${e}`),e}function x(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserBorrowItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserBorrowItemId must be valid base64: ${e}`),e}function k(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserSupplyItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserSupplyItemId must be valid base64: ${e}`),e}function T(e){return invariant(typeof e=="string"&&e.length>0,`Invalid TokenInfoId: ${e}`),e}function a(){return btoa(crypto.randomUUID())}function m(e){return Object.create(BigInt.prototype,{toJSON:{value(){return e.toString()}},valueOf:{value(){return e}}})}function J(){return x(a())}function K(){return k(a())}function L(){return a()}function R(e,t=6){let o=bigDecimal(e);return {__typename:"PercentNumber",value:o.div(2),normalized:o,onChainValue:m(BigInt(o.rescale(t).toApproximateNumber())),decimals:t}}function b(e,t=18){return {__typename:"DecimalNumber",value:bigDecimal(e),onChainValue:m(BigInt(bigDecimal(e).rescale(t).toApproximateNumber())),decimals:t}}function B(e){return [...Array(e)].map(()=>Math.floor(Math.random()*16).toString(16)).join("")}function n(){return evmAddress(`0x${B(40)}`)}var u={WETH:{name:"Wrapped Ether",decimals:18,address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",isWrappedNativeToken:true},USDC:{name:"USD Coin",decimals:6,address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",isWrappedNativeToken:false},GHO:{name:"Gho Token",decimals:18,address:"0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",isWrappedNativeToken:false},AAVE:{name:"Aave Token",decimals:18,address:"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",isWrappedNativeToken:false}};function l(e){let{name:t,decimals:o}=u[e];return {__typename:"TokenInfo",id:T(a()),name:t,symbol:e,decimals:o,icon:"https://example.com/icon.png",categories:[]}}function D(){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:n(),nativeGateway:n(),signatureGateway:n(),nativeInfo:l("WETH")}}function $(e){let{isWrappedNativeToken:t}=u[e];return {__typename:"Erc20Token",address:n(),chain:D(),info:l(e),isWrappedNativeToken:t}}function c(e){return {__typename:"ExchangeAmount",value:bigDecimal(e),name:"USD",symbol:"$",icon:"https://example.com/icon.png",decimals:2}}function r(e,t){return {__typename:"Erc20Amount",amount:b(e,u[t].decimals),token:$(t),exchange:c(e),exchangeRate:b(e)}}function g({chainId:e=chainId(1),from:t=n(),operations:o=[]}={}){return {__typename:"TransactionRequest",to:t,from:t,data:"0x",value:m(0n),chainId:e,operations:o}}function p(e=0){return {__typename:"PercentNumber",value:bigDecimal(e),normalized:bigDecimal(e),onChainValue:m(0n),decimals:6}}function A(e=0){return {__typename:"PercentNumberWithChange",current:p(e),change:p(0)}}function d(e=0){return {__typename:"ExchangeAmountWithChange",current:c(e),change:p(0)}}function v(){return {__typename:"HealthFactorWithChange",current:null,change:p(0)}}function H(){return {__typename:"UserPositionRiskPremium",current:p(0),latest:p(0)}}function W({address:e,chainId:t}){return {__typename:"Spoke",id:f({chainId:t,address:e}),name:"Test Spoke",address:e,chain:{__typename:"Chain",name:"Test Chain",icon:"https://example.com/icon.png",chainId:t,rpcUrl:"https://example.com/rpc",explorerUrl:"https://example.com/explorer",isTestnet:true,isFork:true,nativeWrappedToken:n(),nativeGateway:n(),signatureGateway:n(),nativeInfo:l("WETH")}}}function X({address:e,chainId:t,user:o}){return {__typename:"UserPosition",id:h(a()),spoke:W({address:e,chainId:t}),user:o,createdAt:new Date,netApy:p(0),netCollateral:d(0),netBalance:d(0),netAccruedInterest:c(0),totalCollateral:d(0),totalSupplied:d(0),totalDebt:d(0),netSupplyApy:A(0),netBorrowApy:A(0),healthFactor:v(),riskPremium:H(),liquidationPrice:c(0),borrowingPower:c(0),canUpdateDynamicConfig:false,netBalancePercentChange:p(0),averageCollateralFactor:p(0)}}function y(){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:n()},message:{amount:"1000000000000000000",deadline:1234567890}}}function C(){return a()}function S({accuracy:e="ACCURATE",buyAmount:t=1e3}={}){return {__typename:"SwapQuote",accuracy:e,quoteId:C(),suggestedSlippage:R(.01),selectedSlippage:null,buy:r(t,"USDC"),sell:r(1e3,"WETH"),costs:{__typename:"SwapQuoteCosts",networkCosts:r(1e3,"WETH"),partnerFee:r(1e3,"USDC"),flashloanFee:r(1e3,"WETH"),providerFee:r(1e3,"USDC")},finalBuy:r(t,"USDC"),finalSell:r(1e3,"WETH")}}function N(){return {__typename:"SwapReceipt",id:a(),createdAt:new Date}}function w(){return {__typename:"TokenSwap",sell:r(1e3,"WETH"),buy:r(1e3,"USDC"),kind:"SELL",orderClass:"MARKET"}}function Y(){return {__typename:"SwapOpen",swapId:a(),createdAt:new Date,deadline:new Date(Date.now()+36e5),explorerUrl:"https://example.com/explorer.json",operation:w()}}function ee(){return {__typename:"SwapCancelled",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json",operation:w()}}function te(){return {__typename:"SwapFulfilled",swapId:a(),txHash:"0xabc123",createdAt:new Date,fulfilledAt:new Date,explorerUrl:"https://example.com/explorer.json",refundTxHash:null,operation:w()}}function ne(e){return {__typename:"PaginatedUserSwapsResult",items:e,pageInfo:{__typename:"PaginatedResultInfo",prev:null,next:null}}}function ae(){return {__typename:"SwapCancelledResult",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json"}}function re({bySignature:e=y()}={}){return {__typename:"PositionSwapAdapterContractApproval",bySignature:e}}function oe({bySignature:e=y(),byTransaction:t=g()}={}){return {__typename:"PositionSwapPositionManagerApproval",bySignature:e,byTransaction:t}}function se({transaction:e=g()}={}){return {__typename:"SwapTransactionRequest",transaction:e,orderReceipt:N()}}function pe(){return {__typename:"SwapByTransaction",quote:S()}}function ie({quote:e=S()}={}){return {__typename:"SwapByIntent",quote:e}}function de(){return {__typename:"PrepareSwapOrder",newQuoteId:C(),data:y()}}function O(){return {__typename:"PermitTypedData",types:{EIP712Domain:[{name:"name",type:"string"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{__typename:"DomainData",name:"Permit",version:"1",chainId:chainId(1),verifyingContract:n()},message:{owner:n(),spender:n(),value:"1000000000000000000",nonce:"0",deadline:1234567890}}}function V({byTransaction:e=g()}={}){return {__typename:"Erc20Approval",byTransaction:e,bySignature:O()}}function ce({approval:e=V()}={}){return {__typename:"SwapByIntentWithApprovalRequired",quote:S(),approvals:[e]}}
1
+ import {bigDecimal,evmAddress,chainId,invariant}from'@aave/types';function P(e){return btoa(String.fromCharCode(...new TextEncoder().encode(e)))}var _="::";function h(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserPositionId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserPositionId must be valid base64: ${e}`),e}function f(e){return U(P(`${e.chainId}${_}${e.address}`))}function U(e){return invariant(typeof e=="string"&&e.length>0,`Invalid SpokeId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`SpokeId must be valid base64: ${e}`),e}function x(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserBorrowItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserBorrowItemId must be valid base64: ${e}`),e}function k(e){return invariant(typeof e=="string"&&e.length>0,`Invalid UserSupplyItemId: ${e}`),invariant(/^[A-Za-z0-9+/]*={0,2}$/.test(e),`UserSupplyItemId must be valid base64: ${e}`),e}function T(e){return invariant(typeof e=="string"&&e.length>0,`Invalid TokenInfoId: ${e}`),e}function a(){return btoa(crypto.randomUUID())}function I(e){return Object.create(BigInt.prototype,{toJSON:{value(){return e.toString()}},valueOf:{value(){return e}}})}function J(){return x(a())}function K(){return k(a())}function L(){return a()}function R(e,t=6){let o=bigDecimal(e);return {__typename:"PercentNumber",value:o.div(2),normalized:o,onChainValue:I(BigInt(o.rescale(t).toApproximateNumber())),decimals:t}}function b(e,t=18){return {__typename:"DecimalNumber",value:bigDecimal(e),onChainValue:I(BigInt(bigDecimal(e).rescale(t).toApproximateNumber())),decimals:t}}function B(e){return [...Array(e)].map(()=>Math.floor(Math.random()*16).toString(16)).join("")}function n(){return evmAddress(`0x${B(40)}`)}var u={WETH:{name:"Wrapped Ether",decimals:18,address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",isWrappedNativeToken:true},USDC:{name:"USD Coin",decimals:6,address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",isWrappedNativeToken:false},GHO:{name:"Gho Token",decimals:18,address:"0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",isWrappedNativeToken:false},AAVE:{name:"Aave Token",decimals:18,address:"0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",isWrappedNativeToken:false}};function l(e){let{name:t,decimals:o}=u[e];return {__typename:"TokenInfo",id:T(a()),name:t,symbol:e,decimals:o,icon:"https://example.com/icon.png",categories:[]}}function D(){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:n(),nativeGateway:n(),signatureGateway:n(),nativeInfo:l("WETH")}}function $(e){let{isWrappedNativeToken:t}=u[e];return {__typename:"Erc20Token",address:n(),chain:D(),info:l(e),isWrappedNativeToken:t}}function c(e){return {__typename:"ExchangeAmount",value:bigDecimal(e),name:"USD",symbol:"$",icon:"https://example.com/icon.png",decimals:2}}function r(e,t){return {__typename:"Erc20Amount",amount:b(e,u[t].decimals),token:$(t),exchange:c(e),exchangeRate:b(e)}}function g({chainId:e=chainId(1),from:t=n(),operations:o=[]}={}){return {__typename:"TransactionRequest",to:t,from:t,data:"0x",value:I(0n),chainId:e,operations:o}}function p(e=0){return {__typename:"PercentNumber",value:bigDecimal(e),normalized:bigDecimal(e),onChainValue:I(0n),decimals:6}}function A(e=0){return {__typename:"PercentNumberWithChange",current:p(e),change:p(0)}}function d(e=0){return {__typename:"ExchangeAmountWithChange",current:c(e),change:p(0)}}function v(){return {__typename:"HealthFactorWithChange",current:null,change:p(0)}}function H(){return {__typename:"UserPositionRiskPremium",current:p(0),latest:p(0)}}function W({address:e,chainId:t}){return {__typename:"Spoke",id:f({chainId:t,address:e}),name:"Test Spoke",address:e,chain:{__typename:"Chain",name:"Test Chain",icon:"https://example.com/icon.png",chainId:t,rpcUrl:"https://example.com/rpc",explorerUrl:"https://example.com/explorer",isTestnet:true,isFork:true,nativeWrappedToken:n(),nativeGateway:n(),signatureGateway:n(),nativeInfo:l("WETH")}}}function X({address:e,chainId:t,user:o}){return {__typename:"UserPosition",id:h(a()),spoke:W({address:e,chainId:t}),user:o,createdAt:new Date,netApy:p(0),netCollateral:d(0),netBalance:d(0),netAccruedInterest:c(0),totalCollateral:d(0),totalSupplied:d(0),totalDebt:d(0),netSupplyApy:A(0),netBorrowApy:A(0),healthFactor:v(),riskPremium:H(),liquidationPrice:c(0),borrowingPower:c(0),canUpdateDynamicConfig:false,netBalancePercentChange:p(0),averageCollateralFactor:p(0)}}function y(){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:n()},message:{amount:"1000000000000000000",deadline:1234567890}}}function C(){return a()}function S({accuracy:e="ACCURATE",buyAmount:t=1e3}={}){return {__typename:"SwapQuote",accuracy:e,quoteId:C(),suggestedSlippage:R(.01),selectedSlippage:null,buy:r(t,"USDC"),sell:r(1e3,"WETH"),costs:{__typename:"SwapQuoteCosts",networkCosts:r(1e3,"WETH"),partnerFee:r(1e3,"USDC"),flashloanFee:r(1e3,"WETH"),providerFee:r(1e3,"USDC")},finalBuy:r(t,"USDC"),finalSell:r(1e3,"WETH")}}function N(){return {__typename:"SwapReceipt",id:a(),createdAt:new Date}}function w(){return {__typename:"TokenSwap",sell:r(1e3,"WETH"),buy:r(1e3,"USDC"),kind:"SELL",orderClass:"MARKET"}}function Y(){return {__typename:"SwapOpen",swapId:a(),createdAt:new Date,deadline:new Date(Date.now()+36e5),explorerUrl:"https://example.com/explorer.json",operation:w()}}function ee(){return {__typename:"SwapCancelled",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json",operation:w()}}function te(){return {__typename:"SwapFulfilled",swapId:a(),txHash:"0xabc123",createdAt:new Date,fulfilledAt:new Date,explorerUrl:"https://example.com/explorer.json",refundTxHash:null,operation:w()}}function ne(e){return {__typename:"PaginatedUserSwapsResult",items:e,pageInfo:{__typename:"PaginatedResultInfo",prev:null,next:null}}}function ae(){return {__typename:"SwapCancelledResult",swapId:a(),createdAt:new Date,cancelledAt:new Date,explorerUrl:"https://example.com/explorer.json"}}function re({bySignature:e=y()}={}){return {__typename:"PositionSwapAdapterContractApproval",bySignature:e}}function oe({bySignature:e=y(),byTransaction:t=g()}={}){return {__typename:"PositionSwapPositionManagerApproval",bySignature:e,byTransaction:t}}function se({transaction:e=g()}={}){return {__typename:"SwapTransactionRequest",transaction:e,orderReceipt:N()}}function pe(){return {__typename:"SwapByTransaction",quote:S()}}function ie({quote:e=S()}={}){return {__typename:"SwapByIntent",quote:e}}function de(){return {__typename:"PrepareSwapOrder",newQuoteId:C(),data:y()}}function O(){return {__typename:"PermitTypedData",types:{EIP712Domain:[{name:"name",type:"string"}],Permit:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]},primaryType:"Permit",domain:{__typename:"DomainData",name:"Permit",version:"1",chainId:chainId(1),verifyingContract:n()},message:{owner:n(),spender:n(),value:"1000000000000000000",nonce:"0",deadline:1234567890},signedAmount:bigDecimal(1)}}function V({byTransaction:e=g()}={}){return {__typename:"Erc20Approval",byTransaction:e,bySignature:O()}}function ce({approval:e=V()}={}){return {__typename:"SwapByIntentWithApprovalRequired",quote:S(),approvals:[e]}}
2
2
  export{u as TestTokens,b as decimalNumber,D as makeChain,r as makeErc20Amount,V as makeErc20Approval,$ as makeErc20Token,c as makeExchangeAmount,ne as makePaginatedUserSwapsResult,O as makePermitTypedData,re as makePositionSwapAdapterContractApproval,oe as makePositionSwapPositionManagerApproval,de as makePrepareSwapOrder,L as makeReserveId,ie as makeSwapByIntent,ce as makeSwapByIntentWithApprovalRequired,pe as makeSwapByTransaction,ee as makeSwapCancelled,ae as makeSwapCancelledResult,te as makeSwapFulfilled,Y as makeSwapOpen,S as makeSwapQuote,N as makeSwapReceipt,se as makeSwapTransactionRequest,y as makeSwapTypedData,l as makeTokenInfo,w as makeTokenSwap,g as makeTransactionRequest,J as makeUserBorrowItemId,X as makeUserPosition,K as makeUserSupplyItemId,R as percentNumber,n 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":["encodeBase64","value","COMPOSITE_ID_SEPARATOR","userPositionId","invariant","encodeSpokeId","spoke","spokeId","userBorrowItemId","userSupplyItemId","tokenInfoId","randomBase64String","makeSerializableBigInt","makeUserBorrowItemId","makeUserSupplyItemId","makeReserveId","percentNumber","decimals","normalized","bigDecimal","decimalNumber","randomHexString","size","randomEvmAddress","evmAddress","TestTokens","makeTokenInfo","symbol","name","makeChain","toChainId","makeErc20Token","isWrappedNativeToken","makeExchangeAmount","makeErc20Amount","makeTransactionRequest","chainId","from","operations","makePercentNumber","makePercentNumberWithChange","makeExchangeAmountWithChange","makeHealthFactorWithChange","makeUserPositionRiskPremium","makeSpoke","address","makeUserPosition","user","makeSwapTypedData","makeQuoteId","makeSwapQuote","accuracy","buyAmount","makeSwapReceipt","makeTokenSwap","makeSwapOpen","makeSwapCancelled","makeSwapFulfilled","makePaginatedUserSwapsResult","items","makeSwapCancelledResult","makePositionSwapAdapterContractApproval","bySignature","makePositionSwapPositionManagerApproval","byTransaction","makeSwapTransactionRequest","transaction","makeSwapByTransaction","makeSwapByIntent","quote","makePrepareSwapOrder","makePermitTypedData","makeErc20Approval","makeSwapByIntentWithApprovalRequired","approval"],"mappings":"kEA+BA,SAASA,CAAAA,CAAaC,CAAAA,CAAyC,CAC7D,OAAO,IAAA,CACL,MAAA,CAAO,aAAa,GAAG,IAAI,aAAY,CAAE,MAAA,CAAOA,CAAK,CAAC,CACxD,CACF,CAEA,IAAMC,CAAAA,CAAyB,IAAA,CA0MxB,SAASC,CAAAA,CAAeF,CAAAA,CAA+B,CAC5D,OAAAG,UAC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AAY,iBAAA,CACZ,MAAO,CACL,YAAA,CAAc,CAAC,CAAE,IAAA,CAAM,MAAA,CAAQ,IAAA,CAAM,QAAS,CAAC,CAAA,CAC/C,OAAQ,CACN,CAAE,KAAM,OAAA,CAAS,IAAA,CAAM,SAAU,CAAA,CACjC,CAAE,IAAA,CAAM,SAAA,CAAW,KAAM,SAAU,CAAA,CACnC,CAAE,IAAA,CAAM,OAAA,CAAS,IAAA,CAAM,SAAU,EACjC,CAAE,IAAA,CAAM,QAAS,IAAA,CAAM,SAAU,EACjC,CAAE,IAAA,CAAM,UAAA,CAAY,IAAA,CAAM,SAAU,CACtC,CACF,CAAA,CACA,WAAA,CAAa,SACb,MAAA,CAAQ,CACN,UAAA,CAAY,YAAA,CACZ,KAAM,QAAA,CACN,OAAA,CAAS,IACT,OAAA,CAASzC,OAAAA,CAAU,CAAC,CAAA,CACpB,iBAAA,CAAmBP,CAAAA,EACrB,EACA,OAAA,CAAS,CACP,MAAOA,CAAAA,EAAiB,CACxB,QAASA,CAAAA,EAAiB,CAC1B,KAAA,CAAO,qBAAA,CACP,MAAO,GAAA,CACP,QAAA,CAAU,UACZ,CACF,CACF,CAKO,SAASiD,CAAAA,CAAkB,CAChC,aAAA,CAAAR,EAAgB7B,CAAAA,EAClB,EAEI,EAAC,CAAkB,CACrB,OAAO,CACL,UAAA,CAAY,eAAA,CACZ,cAAA6B,CAAAA,CACA,WAAA,CAAaO,GACf,CACF,CAKO,SAASE,EAAAA,CAAqC,CACnD,QAAA,CAAAC,EAAWF,CAAAA,EACb,EAEI,EAAC,CAAqC,CACxC,OAAO,CACL,UAAA,CAAY,kCAAA,CACZ,MAAOtB,CAAAA,EAAc,CACrB,UAAW,CAACwB,CAAQ,CACtB,CACF","file":"testing.js","sourcesContent":["import {\n type ChainId,\n chainId,\n type EvmAddress,\n evmAddress,\n invariant,\n isValidHexString,\n} from '@aave/types';\nimport type { Tagged } from 'type-fest';\n\n/**\n * An identifier.\n */\nexport type ID = Tagged<string, 'ID'>;\n\n/**\n * A base64 encoded composite identifier.\n *\n * @internal\n */\nexport type Base64EncodedCompositeId = Tagged<\n string,\n 'Base64EncodedCompositeId'\n>;\n\nfunction decodeBase64(value: Base64EncodedCompositeId): string {\n return new TextDecoder().decode(\n Uint8Array.from(atob(value), (c) => c.charCodeAt(0)),\n );\n}\n\nfunction encodeBase64(value: string): Base64EncodedCompositeId {\n return btoa(\n String.fromCharCode(...new TextEncoder().encode(value)),\n ) as Base64EncodedCompositeId;\n}\n\nconst COMPOSITE_ID_SEPARATOR = '::';\n\n/**\n * An asset identifier.\n */\nexport type AssetId = Tagged<Base64EncodedCompositeId, 'AssetId'>;\n\n/**\n * Creates an asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Asset.id` retrieved from another API call.\n */\nexport function assetId(value: string): AssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid AssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `AssetId must be valid base64: ${value}`,\n );\n return value as AssetId;\n}\n\n/**\n * A boosted stable vault rate identifier.\n */\nexport type BoostedRateId = Tagged<string, 'BoostedRateId'>;\n\n/**\n * @internal\n */\nexport function boostedRateId(value: string): BoostedRateId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid BoostedRateId: ${value}`,\n );\n return value as BoostedRateId;\n}\n\n/**\n * A hub identifier.\n */\nexport type HubId = Tagged<Base64EncodedCompositeId, 'HubId'>;\n\n/**\n * Creates a hub identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Hub.id` retrieved from another API call.\n */\nexport function hubId(value: string): HubId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubId must be valid base64: ${value}`,\n );\n return value as HubId;\n}\n\n/**\n * @internal\n */\nexport type HubIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeHubId(hub: HubIdParts): HubId {\n return hubId(\n encodeBase64(`${hub.chainId}${COMPOSITE_ID_SEPARATOR}${hub.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeHubId(value: HubId): HubIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * A hub asset identifier.\n */\nexport type HubAssetId = Tagged<Base64EncodedCompositeId, 'HubAssetId'>;\n\n/**\n * Creates a hub asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `HubAsset.id` retrieved from another API call.\n */\nexport function hubAssetId(value: string): HubAssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubAssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubAssetId must be valid base64: ${value}`,\n );\n return value as HubAssetId;\n}\n\n/**\n * The on-chain ID of a HubAsset. This is scoped to the specific Hub.\n */\nexport type OnChainHubAssetId = Tagged<number, 'OnChainHubAssetId'>;\n\n/**\n * The on-chain ID of a Reserve. This is scoped to the specific Spoke.\n */\nexport type OnChainReserveId = Tagged<string, 'OnChainReserveId'>;\n\n/**\n * A reserve identifier.\n */\nexport type ReserveId = Tagged<Base64EncodedCompositeId, 'ReserveId'>;\n\n/**\n * A reward identifier.\n */\nexport type RewardId = Tagged<string, 'RewardId'>;\n\n/**\n * Creates a reserve identifier from a given value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Reserve.id` from data retrieved from the API.\n */\nexport function reserveId(value: string): ReserveId {\n return value as ReserveId;\n}\n\n/**\n * @internal\n */\nexport type ReserveIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n onChainId: OnChainReserveId;\n};\n\n/**\n * @internal\n */\nexport function decodeReserveId(value: ReserveId): ReserveIdParts {\n const decoded = decodeBase64(value);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n onChainId: c as OnChainReserveId,\n };\n}\n\n/**\n * @internal\n */\nexport function encodeReserveId(reserve: ReserveIdParts): ReserveId {\n return reserveId(\n encodeBase64(\n `${reserve.chainId}${COMPOSITE_ID_SEPARATOR}${reserve.spoke}${COMPOSITE_ID_SEPARATOR}${reserve.onChainId}`,\n ),\n );\n}\n\n/**\n * A user position identifier.\n */\nexport type UserPositionId = Tagged<string, 'UserPositionId'>;\n\n/**\n * Creates a user position identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `UserPosition.id` retrieved from another API call.\n */\nexport function userPositionId(value: string): UserPositionId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserPositionId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserPositionId must be valid base64: ${value}`,\n );\n return value as UserPositionId;\n}\n\n/**\n * @internal\n */\nexport type UserPositionIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n user: EvmAddress;\n};\n\n/**\n * @internal\n */\nexport function decodeUserPositionId(\n value: UserPositionId,\n): UserPositionIdParts {\n const decoded = decodeBase64(value as unknown as Base64EncodedCompositeId);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n user: evmAddress(c),\n };\n}\n\n/**\n * @internal\n */\nexport function encodeUserPositionId(\n parts: UserPositionIdParts,\n): UserPositionId {\n return userPositionId(\n encodeBase64(\n `${parts.chainId}${COMPOSITE_ID_SEPARATOR}${parts.spoke}${COMPOSITE_ID_SEPARATOR}${parts.user}`,\n ),\n );\n}\n\n/**\n * A swap identifier.\n */\nexport type SwapId = Tagged<string, 'SwapId'>;\n\n/**\n * Creates a type-safe swap Id.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Swap.id` retrieved from another API call.\n */\nexport function swapId(value: string): SwapId {\n invariant(isValidHexString(value), `Invalid SwapId: ${value}`);\n return value as SwapId;\n}\n\n/**\n * A swap quote identifier.\n */\nexport type SwapQuoteId = Tagged<string, 'SwapQuoteId'>;\n\n/**\n * Creates a type-safe Swap Quote ID.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `SwapQuote.id` retrieved from another API call.\n */\nexport function swapQuoteId(value: string): SwapQuoteId {\n invariant(isValidHexString(value), `Invalid SwapQuoteId: ${value}`);\n return value as SwapQuoteId;\n}\n\n/**\n * A spoke identifier.\n */\nexport type SpokeId = Tagged<Base64EncodedCompositeId, 'SpokeId'>;\n\n/**\n * A stable vault identifier.\n */\nexport type StableVaultId = Tagged<string, 'StableVaultId'>;\n\n/**\n * Creates a stable vault identifier from a given value.\n */\nexport function stableVaultId(value: string): StableVaultId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid StableVaultId: ${value}`,\n );\n return value as StableVaultId;\n}\n\n/**\n * A stable vault user position identifier.\n */\nexport type StableVaultUserPositionId = Tagged<\n string,\n 'StableVaultUserPositionId'\n>;\n\n/**\n * Creates a stable vault user position identifier from a given value.\n */\nexport function stableVaultUserPositionId(\n value: string,\n): StableVaultUserPositionId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid StableVaultUserPositionId: ${value}`,\n );\n return value as StableVaultUserPositionId;\n}\n\n/**\n * A stable vault withdrawal claim identifier.\n */\nexport type StableVaultWithdrawClaimId = Tagged<\n string,\n 'StableVaultWithdrawClaimId'\n>;\n\n/**\n * Creates a stable vault withdrawal claim identifier from a given value.\n */\nexport function stableVaultWithdrawClaimId(\n value: string,\n): StableVaultWithdrawClaimId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid StableVaultWithdrawClaimId: ${value}`,\n );\n return value as StableVaultWithdrawClaimId;\n}\n\n/**\n * @internal\n */\nexport type SpokeIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeSpokeId(spoke: SpokeIdParts): SpokeId {\n return spokeId(\n encodeBase64(`${spoke.chainId}${COMPOSITE_ID_SEPARATOR}${spoke.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeSpokeId(value: SpokeId): SpokeIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * Creates a spoke identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Spoke.id` retrieved from another API call.\n */\nexport function spokeId(value: string): SpokeId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid SpokeId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `SpokeId must be valid base64: ${value}`,\n );\n return value as SpokeId;\n}\n\n/**\n * A user balance identifier.\n */\nexport type UserBalanceId = Tagged<string, 'UserBalanceId'>;\n\n/**\n * Creates a user balance identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBalance.id` retrieved from another API call.\n */\nexport function userBalanceId(value: string): UserBalanceId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBalanceId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBalanceId must be valid base64: ${value}`,\n );\n return value as UserBalanceId;\n}\n\n/**\n * A user borrow item identifier.\n */\nexport type UserBorrowItemId = Tagged<string, 'UserBorrowItemId'>;\n\n/**\n * Creates a user borrow item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBorrowItem.id` retrieved from another API call.\n */\nexport function userBorrowItemId(value: string): UserBorrowItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBorrowItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBorrowItemId must be valid base64: ${value}`,\n );\n return value as UserBorrowItemId;\n}\n\n/**\n * A user supply item identifier.\n */\nexport type UserSupplyItemId = Tagged<string, 'UserSupplyItemId'>;\n\n/**\n * Creates a user supply item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserSupplyItem.id` retrieved from another API call.\n */\nexport function userSupplyItemId(value: string): UserSupplyItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserSupplyItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserSupplyItemId must be valid base64: ${value}`,\n );\n return value as UserSupplyItemId;\n}\n\n/**\n * A token info identifier.\n */\nexport type TokenInfoId = Tagged<string, 'TokenInfoId'>;\n\n/**\n * @internal\n */\nexport function tokenInfoId(value: string): TokenInfoId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid TokenInfoId: ${value}`,\n );\n return value as TokenInfoId;\n}\n\n/**\n * A token movement identifier.\n */\nexport type TokenMovementId = Tagged<string, 'TokenMovementId'>;\n\n/**\n * Creates a token movement identifier from a given value.\n */\nexport function tokenMovementId(value: string): TokenMovementId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid TokenMovementId: ${value}`,\n );\n return value as TokenMovementId;\n}\n","import {\n type BlockchainData,\n bigDecimal,\n type ChainId,\n type EvmAddress,\n evmAddress,\n type TxHash,\n chainId as toChainId,\n} from '@aave/types';\nimport {\n type OperationType,\n QuoteAccuracy,\n SwapOrderClass,\n TokenSwapKind,\n} from './enums';\nimport type {\n Chain,\n DecimalNumber,\n DomainData,\n Erc20Amount,\n Erc20Approval,\n Erc20Token,\n ExchangeAmount,\n ExchangeAmountWithChange,\n HealthFactorWithChange,\n PaginatedUserSwapsResult,\n PercentNumber,\n PercentNumberWithChange,\n PermitTypedData,\n PositionSwapAdapterContractApproval,\n PositionSwapPositionManagerApproval,\n PrepareSwapOrder,\n Spoke,\n SwapByIntent,\n SwapByIntentWithApprovalRequired,\n SwapByTransaction,\n SwapCancelled,\n SwapCancelledResult,\n SwapFulfilled,\n SwapOpen,\n SwapQuote,\n SwapReceipt,\n SwapTransactionRequest,\n SwapTypedData,\n TokenInfo,\n TokenSwap,\n TransactionRequest,\n UserPosition,\n UserPositionRiskPremium,\n} from './fragments';\nimport {\n encodeSpokeId,\n type ReserveId,\n reserveId,\n type SwapId,\n type SwapQuoteId,\n tokenInfoId,\n type UserBorrowItemId,\n type UserSupplyItemId,\n userBorrowItemId,\n userPositionId,\n userSupplyItemId,\n} from './id';\n\nfunction randomBase64String(): string {\n return btoa(crypto.randomUUID());\n}\n\nfunction makeSerializableBigInt(value: bigint): bigint {\n return Object.create(BigInt.prototype, {\n toJSON: {\n value() {\n return value.toString();\n },\n },\n valueOf: {\n value() {\n return value;\n },\n },\n });\n}\n\n/**\n * @internal\n */\nexport function makeUserBorrowItemId(): UserBorrowItemId {\n return userBorrowItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeUserSupplyItemId(): UserSupplyItemId {\n return userSupplyItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeReserveId(): ReserveId {\n return reserveId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function percentNumber(value: number, decimals = 6): PercentNumber {\n const normalized = bigDecimal(value);\n\n return {\n __typename: 'PercentNumber',\n value: normalized.div(2),\n normalized,\n onChainValue: makeSerializableBigInt(\n BigInt(normalized.rescale(decimals).toApproximateNumber()),\n ),\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: makeSerializableBigInt(\n BigInt(bigDecimal(value).rescale(decimals).toApproximateNumber()),\n ),\n decimals,\n };\n}\n\nfunction randomHexString(size: number): `0x${string}` {\n return [...Array<string>(size)]\n .map(() => Math.floor(Math.random() * 16).toString(16))\n .join('') as `0x${string}`;\n}\n\n/**\n * @internal\n */\nexport function randomEvmAddress(): EvmAddress {\n return evmAddress(`0x${randomHexString(20 * 2)}`);\n}\n\nexport const TestTokens = {\n WETH: {\n name: 'Wrapped Ether',\n decimals: 18,\n address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n isWrappedNativeToken: true,\n },\n USDC: {\n name: 'USD Coin',\n decimals: 6,\n address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n isWrappedNativeToken: false,\n },\n GHO: {\n name: 'Gho Token',\n decimals: 18,\n address: '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f',\n isWrappedNativeToken: false,\n },\n AAVE: {\n name: 'Aave Token',\n decimals: 18,\n address: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',\n isWrappedNativeToken: false,\n },\n} as const;\n\nexport function makeTokenInfo(symbol: keyof typeof TestTokens): TokenInfo {\n const { name, decimals } = TestTokens[symbol];\n\n return {\n __typename: 'TokenInfo',\n id: tokenInfoId(randomBase64String()),\n name,\n symbol,\n decimals,\n icon: 'https://example.com/icon.png',\n categories: [],\n };\n}\n\nexport function makeChain(): Chain {\n return {\n __typename: 'Chain',\n name: 'Ethereum',\n icon: 'https://example.com/icon.png',\n chainId: toChainId(1),\n rpcUrl: 'https://example.com/rpc.json',\n explorerUrl: 'https://example.com/explorer.json',\n isTestnet: false,\n isFork: false,\n nativeWrappedToken: randomEvmAddress(),\n nativeGateway: randomEvmAddress(),\n signatureGateway: randomEvmAddress(),\n nativeInfo: makeTokenInfo('WETH'),\n };\n}\n\nexport function makeErc20Token(symbol: keyof typeof TestTokens): Erc20Token {\n const { isWrappedNativeToken } = TestTokens[symbol];\n\n return {\n __typename: 'Erc20Token',\n address: randomEvmAddress(),\n chain: makeChain(),\n info: makeTokenInfo(symbol),\n isWrappedNativeToken,\n };\n}\n\nexport function makeExchangeAmount(value: number): ExchangeAmount {\n return {\n __typename: 'ExchangeAmount',\n value: bigDecimal(value),\n name: 'USD',\n symbol: '$',\n icon: 'https://example.com/icon.png',\n decimals: 2,\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Amount(\n value: number,\n symbol: keyof typeof TestTokens,\n): Erc20Amount {\n return {\n __typename: 'Erc20Amount',\n amount: decimalNumber(value, TestTokens[symbol].decimals),\n token: makeErc20Token(symbol),\n exchange: makeExchangeAmount(value),\n exchangeRate: decimalNumber(value),\n };\n}\n\n/**\n * @internal\n */\nexport function makeTransactionRequest({\n chainId = toChainId(1),\n from = randomEvmAddress(),\n operations = [],\n}: {\n chainId?: ChainId;\n from?: EvmAddress;\n operations?: OperationType[];\n} = {}): TransactionRequest {\n return {\n __typename: 'TransactionRequest',\n to: from,\n from,\n data: '0x' as BlockchainData,\n value: makeSerializableBigInt(0n),\n chainId,\n operations,\n };\n}\n\nfunction makePercentNumber(value = 0): PercentNumber {\n return {\n __typename: 'PercentNumber',\n value: bigDecimal(value),\n normalized: bigDecimal(value),\n onChainValue: makeSerializableBigInt(0n),\n decimals: 6,\n };\n}\n\nfunction makePercentNumberWithChange(value = 0): PercentNumberWithChange {\n return {\n __typename: 'PercentNumberWithChange',\n current: makePercentNumber(value),\n change: makePercentNumber(0),\n };\n}\n\nfunction makeExchangeAmountWithChange(value = 0): ExchangeAmountWithChange {\n return {\n __typename: 'ExchangeAmountWithChange',\n current: makeExchangeAmount(value),\n change: makePercentNumber(0),\n };\n}\n\nfunction makeHealthFactorWithChange(): HealthFactorWithChange {\n return {\n __typename: 'HealthFactorWithChange',\n current: null,\n change: makePercentNumber(0),\n };\n}\n\nfunction makeUserPositionRiskPremium(): UserPositionRiskPremium {\n return {\n __typename: 'UserPositionRiskPremium',\n current: makePercentNumber(0),\n latest: makePercentNumber(0),\n };\n}\n\nfunction makeSpoke({\n address,\n chainId,\n}: {\n address: EvmAddress;\n chainId: ChainId;\n}): Spoke {\n return {\n __typename: 'Spoke',\n id: encodeSpokeId({ chainId, address }),\n name: 'Test Spoke',\n address,\n chain: {\n __typename: 'Chain',\n name: 'Test Chain',\n icon: 'https://example.com/icon.png',\n chainId,\n rpcUrl: 'https://example.com/rpc',\n explorerUrl: 'https://example.com/explorer',\n isTestnet: true,\n isFork: true,\n nativeWrappedToken: randomEvmAddress(),\n nativeGateway: randomEvmAddress(),\n signatureGateway: randomEvmAddress(),\n nativeInfo: makeTokenInfo('WETH'),\n },\n };\n}\n\n/**\n * @internal\n */\nexport function makeUserPosition({\n address,\n chainId,\n user,\n}: {\n address: EvmAddress;\n chainId: ChainId;\n user: EvmAddress;\n}): UserPosition {\n return {\n __typename: 'UserPosition',\n id: userPositionId(randomBase64String()),\n spoke: makeSpoke({ address, chainId }),\n user,\n createdAt: new Date(),\n netApy: makePercentNumber(0),\n netCollateral: makeExchangeAmountWithChange(0),\n netBalance: makeExchangeAmountWithChange(0),\n netAccruedInterest: makeExchangeAmount(0),\n totalCollateral: makeExchangeAmountWithChange(0),\n totalSupplied: makeExchangeAmountWithChange(0),\n totalDebt: makeExchangeAmountWithChange(0),\n netSupplyApy: makePercentNumberWithChange(0),\n netBorrowApy: makePercentNumberWithChange(0),\n healthFactor: makeHealthFactorWithChange(),\n riskPremium: makeUserPositionRiskPremium(),\n liquidationPrice: makeExchangeAmount(0),\n borrowingPower: makeExchangeAmount(0),\n canUpdateDynamicConfig: false,\n netBalancePercentChange: makePercentNumber(0),\n averageCollateralFactor: makePercentNumber(0),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTypedData(): SwapTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type (as DomainData)\n return {\n __typename: 'SwapTypedData',\n primaryType: 'Swap',\n types: {\n Swap: [\n { name: 'amount', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n domain: {\n __typename: 'DomainData',\n name: 'Swap',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n amount: '1000000000000000000',\n deadline: 1234567890,\n },\n };\n}\n\nfunction makeQuoteId(): SwapQuoteId {\n return randomBase64String() as SwapQuoteId;\n}\n\n/**\n * @internal\n */\nexport function makeSwapQuote({\n accuracy = QuoteAccuracy.Accurate,\n buyAmount = 1000,\n}: {\n accuracy?: QuoteAccuracy;\n buyAmount?: number;\n} = {}): SwapQuote {\n return {\n __typename: 'SwapQuote',\n accuracy,\n quoteId: makeQuoteId(),\n suggestedSlippage: percentNumber(0.01),\n selectedSlippage: null,\n buy: makeErc20Amount(buyAmount, 'USDC'),\n sell: makeErc20Amount(1000, 'WETH'),\n costs: {\n __typename: 'SwapQuoteCosts',\n networkCosts: makeErc20Amount(1000, 'WETH'),\n partnerFee: makeErc20Amount(1000, 'USDC'),\n flashloanFee: makeErc20Amount(1000, 'WETH'),\n providerFee: makeErc20Amount(1000, 'USDC'),\n },\n finalBuy: makeErc20Amount(buyAmount, 'USDC'),\n finalSell: makeErc20Amount(1000, 'WETH'),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapReceipt(): SwapReceipt {\n return {\n __typename: 'SwapReceipt',\n id: randomBase64String() as SwapId,\n createdAt: new Date(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeTokenSwap(): TokenSwap {\n return {\n __typename: 'TokenSwap',\n sell: makeErc20Amount(1000, 'WETH'),\n buy: makeErc20Amount(1000, 'USDC'),\n kind: TokenSwapKind.Sell,\n orderClass: SwapOrderClass.Market,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapOpen(): SwapOpen {\n return {\n __typename: 'SwapOpen',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n deadline: new Date(Date.now() + 3600_000), // 1 hour from now\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelled(): SwapCancelled {\n return {\n __typename: 'SwapCancelled',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapFulfilled(): SwapFulfilled {\n return {\n __typename: 'SwapFulfilled',\n swapId: randomBase64String() as SwapId,\n txHash: '0xabc123' as TxHash,\n createdAt: new Date(),\n fulfilledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n refundTxHash: null,\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makePaginatedUserSwapsResult(\n items: Array<SwapOpen | SwapFulfilled | SwapCancelled>,\n): PaginatedUserSwapsResult {\n return {\n __typename: 'PaginatedUserSwapsResult',\n items,\n pageInfo: {\n __typename: 'PaginatedResultInfo',\n prev: null,\n next: null,\n },\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelledResult(): SwapCancelledResult {\n return {\n __typename: 'SwapCancelledResult',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapAdapterContractApproval({\n bySignature = makeSwapTypedData(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapAdapterContractApproval {\n return {\n __typename: 'PositionSwapAdapterContractApproval',\n bySignature,\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapPositionManagerApproval({\n bySignature = makeSwapTypedData(),\n byTransaction = makeTransactionRequest(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapPositionManagerApproval {\n return {\n __typename: 'PositionSwapPositionManagerApproval',\n bySignature,\n byTransaction,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTransactionRequest({\n transaction = makeTransactionRequest(),\n}: {\n transaction?: TransactionRequest;\n} = {}): SwapTransactionRequest {\n return {\n __typename: 'SwapTransactionRequest',\n transaction,\n orderReceipt: makeSwapReceipt(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByTransaction(): SwapByTransaction {\n return {\n __typename: 'SwapByTransaction',\n quote: makeSwapQuote(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntent({\n quote = makeSwapQuote(),\n}: {\n quote?: SwapQuote;\n} = {}): SwapByIntent {\n return {\n __typename: 'SwapByIntent',\n quote,\n };\n}\n\n/**\n * @internal\n */\nexport function makePrepareSwapOrder(): PrepareSwapOrder {\n return {\n __typename: 'PrepareSwapOrder',\n newQuoteId: makeQuoteId(),\n data: makeSwapTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makePermitTypedData(): PermitTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type as DomainData\n return {\n __typename: 'PermitTypedData',\n types: {\n EIP712Domain: [{ name: 'name', type: 'string' }],\n Permit: [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n primaryType: 'Permit',\n domain: {\n __typename: 'DomainData',\n name: 'Permit',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n owner: randomEvmAddress(),\n spender: randomEvmAddress(),\n value: '1000000000000000000',\n nonce: '0',\n deadline: 1234567890,\n },\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Approval({\n byTransaction = makeTransactionRequest(),\n}: {\n byTransaction?: TransactionRequest;\n} = {}): Erc20Approval {\n return {\n __typename: 'Erc20Approval',\n byTransaction,\n bySignature: makePermitTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntentWithApprovalRequired({\n approval = makeErc20Approval(),\n}: {\n approval?: Erc20Approval;\n} = {}): SwapByIntentWithApprovalRequired {\n return {\n __typename: 'SwapByIntentWithApprovalRequired',\n quote: makeSwapQuote(),\n approvals: [approval],\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/id.ts","../src/testing.ts"],"names":["encodeBase64","value","COMPOSITE_ID_SEPARATOR","userPositionId","invariant","encodeSpokeId","spoke","spokeId","userBorrowItemId","userSupplyItemId","tokenInfoId","randomBase64String","makeSerializableBigInt","makeUserBorrowItemId","makeUserSupplyItemId","makeReserveId","percentNumber","decimals","normalized","bigDecimal","decimalNumber","randomHexString","size","randomEvmAddress","evmAddress","TestTokens","makeTokenInfo","symbol","name","makeChain","toChainId","makeErc20Token","isWrappedNativeToken","makeExchangeAmount","makeErc20Amount","makeTransactionRequest","chainId","from","operations","makePercentNumber","makePercentNumberWithChange","makeExchangeAmountWithChange","makeHealthFactorWithChange","makeUserPositionRiskPremium","makeSpoke","address","makeUserPosition","user","makeSwapTypedData","makeQuoteId","makeSwapQuote","accuracy","buyAmount","makeSwapReceipt","makeTokenSwap","makeSwapOpen","makeSwapCancelled","makeSwapFulfilled","makePaginatedUserSwapsResult","items","makeSwapCancelledResult","makePositionSwapAdapterContractApproval","bySignature","makePositionSwapPositionManagerApproval","byTransaction","makeSwapTransactionRequest","transaction","makeSwapByTransaction","makeSwapByIntent","quote","makePrepareSwapOrder","makePermitTypedData","makeErc20Approval","makeSwapByIntentWithApprovalRequired","approval"],"mappings":"kEA+BA,SAASA,CAAAA,CAAaC,CAAAA,CAAyC,CAC7D,OAAO,IAAA,CACL,MAAA,CAAO,aAAa,GAAG,IAAI,aAAY,CAAE,MAAA,CAAOA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A,EAAc,CACrB,UAAW,CAACwB,CAAQ,CACtB,CACF","file":"testing.js","sourcesContent":["import {\n type ChainId,\n chainId,\n type EvmAddress,\n evmAddress,\n invariant,\n isValidHexString,\n} from '@aave/types';\nimport type { Tagged } from 'type-fest';\n\n/**\n * An identifier.\n */\nexport type ID = Tagged<string, 'ID'>;\n\n/**\n * A base64 encoded composite identifier.\n *\n * @internal\n */\nexport type Base64EncodedCompositeId = Tagged<\n string,\n 'Base64EncodedCompositeId'\n>;\n\nfunction decodeBase64(value: Base64EncodedCompositeId): string {\n return new TextDecoder().decode(\n Uint8Array.from(atob(value), (c) => c.charCodeAt(0)),\n );\n}\n\nfunction encodeBase64(value: string): Base64EncodedCompositeId {\n return btoa(\n String.fromCharCode(...new TextEncoder().encode(value)),\n ) as Base64EncodedCompositeId;\n}\n\nconst COMPOSITE_ID_SEPARATOR = '::';\n\n/**\n * An asset identifier.\n */\nexport type AssetId = Tagged<Base64EncodedCompositeId, 'AssetId'>;\n\n/**\n * Creates an asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Asset.id` retrieved from another API call.\n */\nexport function assetId(value: string): AssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid AssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `AssetId must be valid base64: ${value}`,\n );\n return value as AssetId;\n}\n\n/**\n * A boosted stable vault rate identifier.\n */\nexport type BoostedRateId = Tagged<string, 'BoostedRateId'>;\n\n/**\n * @internal\n */\nexport function boostedRateId(value: string): BoostedRateId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid BoostedRateId: ${value}`,\n );\n return value as BoostedRateId;\n}\n\n/**\n * A hub identifier.\n */\nexport type HubId = Tagged<Base64EncodedCompositeId, 'HubId'>;\n\n/**\n * Creates a hub identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Hub.id` retrieved from another API call.\n */\nexport function hubId(value: string): HubId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubId must be valid base64: ${value}`,\n );\n return value as HubId;\n}\n\n/**\n * @internal\n */\nexport type HubIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeHubId(hub: HubIdParts): HubId {\n return hubId(\n encodeBase64(`${hub.chainId}${COMPOSITE_ID_SEPARATOR}${hub.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeHubId(value: HubId): HubIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * A hub asset identifier.\n */\nexport type HubAssetId = Tagged<Base64EncodedCompositeId, 'HubAssetId'>;\n\n/**\n * Creates a hub asset identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `HubAsset.id` retrieved from another API call.\n */\nexport function hubAssetId(value: string): HubAssetId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid HubAssetId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `HubAssetId must be valid base64: ${value}`,\n );\n return value as HubAssetId;\n}\n\n/**\n * The on-chain ID of a HubAsset. This is scoped to the specific Hub.\n */\nexport type OnChainHubAssetId = Tagged<number, 'OnChainHubAssetId'>;\n\n/**\n * The on-chain ID of a Reserve. This is scoped to the specific Spoke.\n */\nexport type OnChainReserveId = Tagged<string, 'OnChainReserveId'>;\n\n/**\n * A reserve identifier.\n */\nexport type ReserveId = Tagged<Base64EncodedCompositeId, 'ReserveId'>;\n\n/**\n * A reward identifier.\n */\nexport type RewardId = Tagged<string, 'RewardId'>;\n\n/**\n * Creates a reserve identifier from a given value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Reserve.id` from data retrieved from the API.\n */\nexport function reserveId(value: string): ReserveId {\n return value as ReserveId;\n}\n\n/**\n * @internal\n */\nexport type ReserveIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n onChainId: OnChainReserveId;\n};\n\n/**\n * @internal\n */\nexport function decodeReserveId(value: ReserveId): ReserveIdParts {\n const decoded = decodeBase64(value);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n onChainId: c as OnChainReserveId,\n };\n}\n\n/**\n * @internal\n */\nexport function encodeReserveId(reserve: ReserveIdParts): ReserveId {\n return reserveId(\n encodeBase64(\n `${reserve.chainId}${COMPOSITE_ID_SEPARATOR}${reserve.spoke}${COMPOSITE_ID_SEPARATOR}${reserve.onChainId}`,\n ),\n );\n}\n\n/**\n * A user position identifier.\n */\nexport type UserPositionId = Tagged<string, 'UserPositionId'>;\n\n/**\n * Creates a user position identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `UserPosition.id` retrieved from another API call.\n */\nexport function userPositionId(value: string): UserPositionId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserPositionId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserPositionId must be valid base64: ${value}`,\n );\n return value as UserPositionId;\n}\n\n/**\n * @internal\n */\nexport type UserPositionIdParts = {\n chainId: ChainId;\n spoke: EvmAddress;\n user: EvmAddress;\n};\n\n/**\n * @internal\n */\nexport function decodeUserPositionId(\n value: UserPositionId,\n): UserPositionIdParts {\n const decoded = decodeBase64(value as unknown as Base64EncodedCompositeId);\n const [a, b, c] = decoded.split(COMPOSITE_ID_SEPARATOR) as [\n string,\n string,\n string,\n ];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n spoke: evmAddress(b),\n user: evmAddress(c),\n };\n}\n\n/**\n * @internal\n */\nexport function encodeUserPositionId(\n parts: UserPositionIdParts,\n): UserPositionId {\n return userPositionId(\n encodeBase64(\n `${parts.chainId}${COMPOSITE_ID_SEPARATOR}${parts.spoke}${COMPOSITE_ID_SEPARATOR}${parts.user}`,\n ),\n );\n}\n\n/**\n * A swap identifier.\n */\nexport type SwapId = Tagged<string, 'SwapId'>;\n\n/**\n * Creates a type-safe swap Id.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal ciscumstances\n * use the `Swap.id` retrieved from another API call.\n */\nexport function swapId(value: string): SwapId {\n invariant(isValidHexString(value), `Invalid SwapId: ${value}`);\n return value as SwapId;\n}\n\n/**\n * A swap quote identifier.\n */\nexport type SwapQuoteId = Tagged<string, 'SwapQuoteId'>;\n\n/**\n * Creates a type-safe Swap Quote ID.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `SwapQuote.id` retrieved from another API call.\n */\nexport function swapQuoteId(value: string): SwapQuoteId {\n invariant(isValidHexString(value), `Invalid SwapQuoteId: ${value}`);\n return value as SwapQuoteId;\n}\n\n/**\n * A spoke identifier.\n */\nexport type SpokeId = Tagged<Base64EncodedCompositeId, 'SpokeId'>;\n\n/**\n * A stable vault identifier.\n */\nexport type StableVaultId = Tagged<string, 'StableVaultId'>;\n\n/**\n * Creates a stable vault identifier from a given value.\n */\nexport function stableVaultId(value: string): StableVaultId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid StableVaultId: ${value}`,\n );\n return value as StableVaultId;\n}\n\n/**\n * A stable vault user position identifier.\n */\nexport type StableVaultUserPositionId = Tagged<\n string,\n 'StableVaultUserPositionId'\n>;\n\n/**\n * Creates a stable vault user position identifier from a given value.\n */\nexport function stableVaultUserPositionId(\n value: string,\n): StableVaultUserPositionId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid StableVaultUserPositionId: ${value}`,\n );\n return value as StableVaultUserPositionId;\n}\n\n/**\n * A stable vault withdrawal claim identifier.\n */\nexport type StableVaultWithdrawClaimId = Tagged<\n string,\n 'StableVaultWithdrawClaimId'\n>;\n\n/**\n * Creates a stable vault withdrawal claim identifier from a given value.\n */\nexport function stableVaultWithdrawClaimId(\n value: string,\n): StableVaultWithdrawClaimId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid StableVaultWithdrawClaimId: ${value}`,\n );\n return value as StableVaultWithdrawClaimId;\n}\n\n/**\n * @internal\n */\nexport type SpokeIdParts = {\n address: EvmAddress;\n chainId: ChainId;\n};\n\n/**\n * @internal\n */\nexport function encodeSpokeId(spoke: SpokeIdParts): SpokeId {\n return spokeId(\n encodeBase64(`${spoke.chainId}${COMPOSITE_ID_SEPARATOR}${spoke.address}`),\n );\n}\n\n/**\n * @internal\n */\nexport function decodeSpokeId(value: SpokeId): SpokeIdParts {\n const decoded = decodeBase64(value);\n const [a, b] = decoded.split(COMPOSITE_ID_SEPARATOR) as [string, string];\n return {\n chainId: chainId(Number.parseInt(a, 10)),\n address: evmAddress(b),\n };\n}\n\n/**\n * Creates a spoke identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `Spoke.id` retrieved from another API call.\n */\nexport function spokeId(value: string): SpokeId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid SpokeId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `SpokeId must be valid base64: ${value}`,\n );\n return value as SpokeId;\n}\n\n/**\n * A user balance identifier.\n */\nexport type UserBalanceId = Tagged<string, 'UserBalanceId'>;\n\n/**\n * Creates a user balance identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBalance.id` retrieved from another API call.\n */\nexport function userBalanceId(value: string): UserBalanceId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBalanceId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBalanceId must be valid base64: ${value}`,\n );\n return value as UserBalanceId;\n}\n\n/**\n * A user borrow item identifier.\n */\nexport type UserBorrowItemId = Tagged<string, 'UserBorrowItemId'>;\n\n/**\n * Creates a user borrow item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserBorrowItem.id` retrieved from another API call.\n */\nexport function userBorrowItemId(value: string): UserBorrowItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserBorrowItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserBorrowItemId must be valid base64: ${value}`,\n );\n return value as UserBorrowItemId;\n}\n\n/**\n * A user supply item identifier.\n */\nexport type UserSupplyItemId = Tagged<string, 'UserSupplyItemId'>;\n\n/**\n * Creates a user supply item identifier from a given base64 value.\n *\n * @remarks\n * This is meant to be used in tests and POC context. In normal circumstances\n * use the `UserSupplyItem.id` retrieved from another API call.\n */\nexport function userSupplyItemId(value: string): UserSupplyItemId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid UserSupplyItemId: ${value}`,\n );\n // Basic base64 validation - contains only valid base64 characters\n invariant(\n /^[A-Za-z0-9+/]*={0,2}$/.test(value),\n `UserSupplyItemId must be valid base64: ${value}`,\n );\n return value as UserSupplyItemId;\n}\n\n/**\n * A token info identifier.\n */\nexport type TokenInfoId = Tagged<string, 'TokenInfoId'>;\n\n/**\n * @internal\n */\nexport function tokenInfoId(value: string): TokenInfoId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid TokenInfoId: ${value}`,\n );\n return value as TokenInfoId;\n}\n\n/**\n * A token movement identifier.\n */\nexport type TokenMovementId = Tagged<string, 'TokenMovementId'>;\n\n/**\n * Creates a token movement identifier from a given value.\n */\nexport function tokenMovementId(value: string): TokenMovementId {\n invariant(\n typeof value === 'string' && value.length > 0,\n `Invalid TokenMovementId: ${value}`,\n );\n return value as TokenMovementId;\n}\n","import {\n type BlockchainData,\n bigDecimal,\n type ChainId,\n type EvmAddress,\n evmAddress,\n type TxHash,\n chainId as toChainId,\n} from '@aave/types';\nimport {\n type OperationType,\n QuoteAccuracy,\n SwapOrderClass,\n TokenSwapKind,\n} from './enums';\nimport type {\n Chain,\n DecimalNumber,\n DomainData,\n Erc20Amount,\n Erc20Approval,\n Erc20Token,\n ExchangeAmount,\n ExchangeAmountWithChange,\n HealthFactorWithChange,\n PaginatedUserSwapsResult,\n PercentNumber,\n PercentNumberWithChange,\n PermitTypedData,\n PositionSwapAdapterContractApproval,\n PositionSwapPositionManagerApproval,\n PrepareSwapOrder,\n Spoke,\n SwapByIntent,\n SwapByIntentWithApprovalRequired,\n SwapByTransaction,\n SwapCancelled,\n SwapCancelledResult,\n SwapFulfilled,\n SwapOpen,\n SwapQuote,\n SwapReceipt,\n SwapTransactionRequest,\n SwapTypedData,\n TokenInfo,\n TokenSwap,\n TransactionRequest,\n UserPosition,\n UserPositionRiskPremium,\n} from './fragments';\nimport {\n encodeSpokeId,\n type ReserveId,\n reserveId,\n type SwapId,\n type SwapQuoteId,\n tokenInfoId,\n type UserBorrowItemId,\n type UserSupplyItemId,\n userBorrowItemId,\n userPositionId,\n userSupplyItemId,\n} from './id';\n\nfunction randomBase64String(): string {\n return btoa(crypto.randomUUID());\n}\n\nfunction makeSerializableBigInt(value: bigint): bigint {\n return Object.create(BigInt.prototype, {\n toJSON: {\n value() {\n return value.toString();\n },\n },\n valueOf: {\n value() {\n return value;\n },\n },\n });\n}\n\n/**\n * @internal\n */\nexport function makeUserBorrowItemId(): UserBorrowItemId {\n return userBorrowItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeUserSupplyItemId(): UserSupplyItemId {\n return userSupplyItemId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function makeReserveId(): ReserveId {\n return reserveId(randomBase64String());\n}\n\n/**\n * @internal\n */\nexport function percentNumber(value: number, decimals = 6): PercentNumber {\n const normalized = bigDecimal(value);\n\n return {\n __typename: 'PercentNumber',\n value: normalized.div(2),\n normalized,\n onChainValue: makeSerializableBigInt(\n BigInt(normalized.rescale(decimals).toApproximateNumber()),\n ),\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: makeSerializableBigInt(\n BigInt(bigDecimal(value).rescale(decimals).toApproximateNumber()),\n ),\n decimals,\n };\n}\n\nfunction randomHexString(size: number): `0x${string}` {\n return [...Array<string>(size)]\n .map(() => Math.floor(Math.random() * 16).toString(16))\n .join('') as `0x${string}`;\n}\n\n/**\n * @internal\n */\nexport function randomEvmAddress(): EvmAddress {\n return evmAddress(`0x${randomHexString(20 * 2)}`);\n}\n\nexport const TestTokens = {\n WETH: {\n name: 'Wrapped Ether',\n decimals: 18,\n address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n isWrappedNativeToken: true,\n },\n USDC: {\n name: 'USD Coin',\n decimals: 6,\n address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n isWrappedNativeToken: false,\n },\n GHO: {\n name: 'Gho Token',\n decimals: 18,\n address: '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f',\n isWrappedNativeToken: false,\n },\n AAVE: {\n name: 'Aave Token',\n decimals: 18,\n address: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',\n isWrappedNativeToken: false,\n },\n} as const;\n\nexport function makeTokenInfo(symbol: keyof typeof TestTokens): TokenInfo {\n const { name, decimals } = TestTokens[symbol];\n\n return {\n __typename: 'TokenInfo',\n id: tokenInfoId(randomBase64String()),\n name,\n symbol,\n decimals,\n icon: 'https://example.com/icon.png',\n categories: [],\n };\n}\n\nexport function makeChain(): Chain {\n return {\n __typename: 'Chain',\n name: 'Ethereum',\n icon: 'https://example.com/icon.png',\n chainId: toChainId(1),\n rpcUrl: 'https://example.com/rpc.json',\n explorerUrl: 'https://example.com/explorer.json',\n isTestnet: false,\n isFork: false,\n nativeWrappedToken: randomEvmAddress(),\n nativeGateway: randomEvmAddress(),\n signatureGateway: randomEvmAddress(),\n nativeInfo: makeTokenInfo('WETH'),\n };\n}\n\nexport function makeErc20Token(symbol: keyof typeof TestTokens): Erc20Token {\n const { isWrappedNativeToken } = TestTokens[symbol];\n\n return {\n __typename: 'Erc20Token',\n address: randomEvmAddress(),\n chain: makeChain(),\n info: makeTokenInfo(symbol),\n isWrappedNativeToken,\n };\n}\n\nexport function makeExchangeAmount(value: number): ExchangeAmount {\n return {\n __typename: 'ExchangeAmount',\n value: bigDecimal(value),\n name: 'USD',\n symbol: '$',\n icon: 'https://example.com/icon.png',\n decimals: 2,\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Amount(\n value: number,\n symbol: keyof typeof TestTokens,\n): Erc20Amount {\n return {\n __typename: 'Erc20Amount',\n amount: decimalNumber(value, TestTokens[symbol].decimals),\n token: makeErc20Token(symbol),\n exchange: makeExchangeAmount(value),\n exchangeRate: decimalNumber(value),\n };\n}\n\n/**\n * @internal\n */\nexport function makeTransactionRequest({\n chainId = toChainId(1),\n from = randomEvmAddress(),\n operations = [],\n}: {\n chainId?: ChainId;\n from?: EvmAddress;\n operations?: OperationType[];\n} = {}): TransactionRequest {\n return {\n __typename: 'TransactionRequest',\n to: from,\n from,\n data: '0x' as BlockchainData,\n value: makeSerializableBigInt(0n),\n chainId,\n operations,\n };\n}\n\nfunction makePercentNumber(value = 0): PercentNumber {\n return {\n __typename: 'PercentNumber',\n value: bigDecimal(value),\n normalized: bigDecimal(value),\n onChainValue: makeSerializableBigInt(0n),\n decimals: 6,\n };\n}\n\nfunction makePercentNumberWithChange(value = 0): PercentNumberWithChange {\n return {\n __typename: 'PercentNumberWithChange',\n current: makePercentNumber(value),\n change: makePercentNumber(0),\n };\n}\n\nfunction makeExchangeAmountWithChange(value = 0): ExchangeAmountWithChange {\n return {\n __typename: 'ExchangeAmountWithChange',\n current: makeExchangeAmount(value),\n change: makePercentNumber(0),\n };\n}\n\nfunction makeHealthFactorWithChange(): HealthFactorWithChange {\n return {\n __typename: 'HealthFactorWithChange',\n current: null,\n change: makePercentNumber(0),\n };\n}\n\nfunction makeUserPositionRiskPremium(): UserPositionRiskPremium {\n return {\n __typename: 'UserPositionRiskPremium',\n current: makePercentNumber(0),\n latest: makePercentNumber(0),\n };\n}\n\nfunction makeSpoke({\n address,\n chainId,\n}: {\n address: EvmAddress;\n chainId: ChainId;\n}): Spoke {\n return {\n __typename: 'Spoke',\n id: encodeSpokeId({ chainId, address }),\n name: 'Test Spoke',\n address,\n chain: {\n __typename: 'Chain',\n name: 'Test Chain',\n icon: 'https://example.com/icon.png',\n chainId,\n rpcUrl: 'https://example.com/rpc',\n explorerUrl: 'https://example.com/explorer',\n isTestnet: true,\n isFork: true,\n nativeWrappedToken: randomEvmAddress(),\n nativeGateway: randomEvmAddress(),\n signatureGateway: randomEvmAddress(),\n nativeInfo: makeTokenInfo('WETH'),\n },\n };\n}\n\n/**\n * @internal\n */\nexport function makeUserPosition({\n address,\n chainId,\n user,\n}: {\n address: EvmAddress;\n chainId: ChainId;\n user: EvmAddress;\n}): UserPosition {\n return {\n __typename: 'UserPosition',\n id: userPositionId(randomBase64String()),\n spoke: makeSpoke({ address, chainId }),\n user,\n createdAt: new Date(),\n netApy: makePercentNumber(0),\n netCollateral: makeExchangeAmountWithChange(0),\n netBalance: makeExchangeAmountWithChange(0),\n netAccruedInterest: makeExchangeAmount(0),\n totalCollateral: makeExchangeAmountWithChange(0),\n totalSupplied: makeExchangeAmountWithChange(0),\n totalDebt: makeExchangeAmountWithChange(0),\n netSupplyApy: makePercentNumberWithChange(0),\n netBorrowApy: makePercentNumberWithChange(0),\n healthFactor: makeHealthFactorWithChange(),\n riskPremium: makeUserPositionRiskPremium(),\n liquidationPrice: makeExchangeAmount(0),\n borrowingPower: makeExchangeAmount(0),\n canUpdateDynamicConfig: false,\n netBalancePercentChange: makePercentNumber(0),\n averageCollateralFactor: makePercentNumber(0),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTypedData(): SwapTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type (as DomainData)\n return {\n __typename: 'SwapTypedData',\n primaryType: 'Swap',\n types: {\n Swap: [\n { name: 'amount', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n domain: {\n __typename: 'DomainData',\n name: 'Swap',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n amount: '1000000000000000000',\n deadline: 1234567890,\n },\n };\n}\n\nfunction makeQuoteId(): SwapQuoteId {\n return randomBase64String() as SwapQuoteId;\n}\n\n/**\n * @internal\n */\nexport function makeSwapQuote({\n accuracy = QuoteAccuracy.Accurate,\n buyAmount = 1000,\n}: {\n accuracy?: QuoteAccuracy;\n buyAmount?: number;\n} = {}): SwapQuote {\n return {\n __typename: 'SwapQuote',\n accuracy,\n quoteId: makeQuoteId(),\n suggestedSlippage: percentNumber(0.01),\n selectedSlippage: null,\n buy: makeErc20Amount(buyAmount, 'USDC'),\n sell: makeErc20Amount(1000, 'WETH'),\n costs: {\n __typename: 'SwapQuoteCosts',\n networkCosts: makeErc20Amount(1000, 'WETH'),\n partnerFee: makeErc20Amount(1000, 'USDC'),\n flashloanFee: makeErc20Amount(1000, 'WETH'),\n providerFee: makeErc20Amount(1000, 'USDC'),\n },\n finalBuy: makeErc20Amount(buyAmount, 'USDC'),\n finalSell: makeErc20Amount(1000, 'WETH'),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapReceipt(): SwapReceipt {\n return {\n __typename: 'SwapReceipt',\n id: randomBase64String() as SwapId,\n createdAt: new Date(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeTokenSwap(): TokenSwap {\n return {\n __typename: 'TokenSwap',\n sell: makeErc20Amount(1000, 'WETH'),\n buy: makeErc20Amount(1000, 'USDC'),\n kind: TokenSwapKind.Sell,\n orderClass: SwapOrderClass.Market,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapOpen(): SwapOpen {\n return {\n __typename: 'SwapOpen',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n deadline: new Date(Date.now() + 3600_000), // 1 hour from now\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelled(): SwapCancelled {\n return {\n __typename: 'SwapCancelled',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapFulfilled(): SwapFulfilled {\n return {\n __typename: 'SwapFulfilled',\n swapId: randomBase64String() as SwapId,\n txHash: '0xabc123' as TxHash,\n createdAt: new Date(),\n fulfilledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n refundTxHash: null,\n operation: makeTokenSwap(),\n };\n}\n\n/**\n * @internal\n */\nexport function makePaginatedUserSwapsResult(\n items: Array<SwapOpen | SwapFulfilled | SwapCancelled>,\n): PaginatedUserSwapsResult {\n return {\n __typename: 'PaginatedUserSwapsResult',\n items,\n pageInfo: {\n __typename: 'PaginatedResultInfo',\n prev: null,\n next: null,\n },\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapCancelledResult(): SwapCancelledResult {\n return {\n __typename: 'SwapCancelledResult',\n swapId: randomBase64String() as SwapId,\n createdAt: new Date(),\n cancelledAt: new Date(),\n explorerUrl: 'https://example.com/explorer.json',\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapAdapterContractApproval({\n bySignature = makeSwapTypedData(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapAdapterContractApproval {\n return {\n __typename: 'PositionSwapAdapterContractApproval',\n bySignature,\n };\n}\n\n/**\n * @internal\n */\nexport function makePositionSwapPositionManagerApproval({\n bySignature = makeSwapTypedData(),\n byTransaction = makeTransactionRequest(),\n}: {\n bySignature?: SwapTypedData;\n byTransaction?: TransactionRequest;\n} = {}): PositionSwapPositionManagerApproval {\n return {\n __typename: 'PositionSwapPositionManagerApproval',\n bySignature,\n byTransaction,\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapTransactionRequest({\n transaction = makeTransactionRequest(),\n}: {\n transaction?: TransactionRequest;\n} = {}): SwapTransactionRequest {\n return {\n __typename: 'SwapTransactionRequest',\n transaction,\n orderReceipt: makeSwapReceipt(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByTransaction(): SwapByTransaction {\n return {\n __typename: 'SwapByTransaction',\n quote: makeSwapQuote(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntent({\n quote = makeSwapQuote(),\n}: {\n quote?: SwapQuote;\n} = {}): SwapByIntent {\n return {\n __typename: 'SwapByIntent',\n quote,\n };\n}\n\n/**\n * @internal\n */\nexport function makePrepareSwapOrder(): PrepareSwapOrder {\n return {\n __typename: 'PrepareSwapOrder',\n newQuoteId: makeQuoteId(),\n data: makeSwapTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makePermitTypedData(): PermitTypedData {\n // __typenames that you see and are normally not part of the fragment fieldset selection\n // are used here to allow the URQL cache to be able to normalize the data. Hence the need to\n // assert the type as DomainData\n return {\n __typename: 'PermitTypedData',\n types: {\n EIP712Domain: [{ name: 'name', type: 'string' }],\n Permit: [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ],\n },\n primaryType: 'Permit',\n domain: {\n __typename: 'DomainData',\n name: 'Permit',\n version: '1',\n chainId: toChainId(1),\n verifyingContract: randomEvmAddress(),\n } as DomainData,\n message: {\n owner: randomEvmAddress(),\n spender: randomEvmAddress(),\n value: '1000000000000000000',\n nonce: '0',\n deadline: 1234567890,\n },\n signedAmount: bigDecimal(1),\n };\n}\n\n/**\n * @internal\n */\nexport function makeErc20Approval({\n byTransaction = makeTransactionRequest(),\n}: {\n byTransaction?: TransactionRequest;\n} = {}): Erc20Approval {\n return {\n __typename: 'Erc20Approval',\n byTransaction,\n bySignature: makePermitTypedData(),\n };\n}\n\n/**\n * @internal\n */\nexport function makeSwapByIntentWithApprovalRequired({\n approval = makeErc20Approval(),\n}: {\n approval?: Erc20Approval;\n} = {}): SwapByIntentWithApprovalRequired {\n return {\n __typename: 'SwapByIntentWithApprovalRequired',\n quote: makeSwapQuote(),\n approvals: [approval],\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aave/graphql",
3
- "version": "1.0.0-next.36",
3
+ "version": "1.0.0-next.37",
4
4
  "description": "GraphQL bindings for the Aave API",
5
5
  "repository": {
6
6
  "directory": "packages/graphql",