@aave/client 4.0.0-next.51 → 4.0.0-next.52

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/index.d.ts CHANGED
@@ -3,9 +3,9 @@ export * from '@aave/core';
3
3
  import { Erc20Approval, PermitTypedData } from '@aave/graphql';
4
4
  export * from '@aave/graphql';
5
5
  export * from '@aave/types';
6
- export { A as AaveClient, C as ClientConfig } from './AaveClient-DpWiYPGY.js';
6
+ export { A as AaveClient, C as ClientConfig } from './AaveClient-C7hQU3qX.js';
7
7
  export { B as BatchOptions, C as CurrencyQueryOptions, D as DEFAULT_QUERY_OPTIONS, R as RequestPolicyOptions, T as TimeWindowQueryOptions } from './options-BX6n3sbh.js';
8
- export { E as ExecutionPlanHandler, d as SendWithError, S as SignTypedDataError, c as TransactionReceipt, T as TransactionResult, b as TypedData, a as TypedDataHandler, i as isHasProcessedKnownTransactionRequest, t as transactionReceipt } from './types-BzGr7R2Y.js';
8
+ export { E as ExecutionPlanHandler, c as SendWithError, S as SignTypedDataError, d as TransactionReceipt, b as TransactionResult, a as TypedData, T as TypedDataHandler, i as isHasProcessedKnownTransactionRequest, t as transactionReceipt } from './types-XProSTZ7.js';
9
9
  import '@urql/core';
10
10
 
11
11
  type WithApprovals = {
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export{a as supportsPermit}from'./chunk-N4LXBTGY.js';import {i}from'./chunk-RM3HEVPN.js';export{a as DEFAULT_QUERY_OPTIONS}from'./chunk-RM3HEVPN.js';import {GqlClient,UnexpectedError,TimeoutError,delay}from'@aave/core';export*from'@aave/core';import {encodeReserveId,encodeHubId,isTxHashInputVariant,decodeSpokeId,encodeUserPositionId,isReserveInputVariant,isHubInputVariant}from'@aave/graphql';export*from'@aave/graphql';import {BigDecimal,ResultAsync,invariant}from'@aave/types';export*from'@aave/types';import U from'@aave/graphql/schema';import {cacheExchange}from'@urql/exchange-graphcache';var y=(e,r,n,a)=>BigInt(e[a.fieldName]),l=(e,r,n,a)=>BigDecimal.new(e[a.fieldName]),s=(e,r,n,a)=>{let i=e[a.fieldName];return i==null?null:l(e,r,n,a)},t=(e,r,n,a)=>new Date(e[a.fieldName]),d=(e,r,n,a)=>{let i=e[a.fieldName];return i==null?null:t(e,r,n,a)},f=cacheExchange({schema:U,resolvers:{PercentNumber:{onChainValue:y,value:l,normalized:l},DecimalNumber:{onChainValue:y,value:l},ExchangeAmount:{value:l},AssetPriceSample:{price:l,date:t},Reserve:{borrowCap:l,supplyCap:l},HealthFactorError:{current:s,after:s},HealthFactorVariation:{current:s,after:s},HealthFactorWithChange:{current:s},UserSummary:{lowestHealthFactor:s},UserSummaryHistoryItem:{healthFactor:s,date:t},TransactionRequest:{value:y},ApySample:{date:t},AssetBorrowSample:{date:t},AssetSupplySample:{date:t},HubSummarySample:{date:t},PreviewMerklBorrowReward:{startDate:t,endDate:t},PreviewMerklSupplyReward:{startDate:t,endDate:t},ProtocolHistorySample:{date:t},BorrowActivity:{timestamp:t},LiquidatedActivity:{timestamp:t},MerklBorrowReward:{startDate:t,endDate:t},MerklSupplyReward:{startDate:t,endDate:t},RepayActivity:{timestamp:t},SupplyActivity:{timestamp:t},WithdrawActivity:{timestamp:t},UsingAsCollateralActivity:{timestamp:t},UpdatedDynamicConfigActivity:{timestamp:t},UpdatedRiskPremiumActivity:{timestamp:t},TokenSwapActivity:{timestamp:t},SupplySwapActivity:{timestamp:t},BorrowSwapActivity:{timestamp:t},RepayWithSupplyActivity:{timestamp:t},WithdrawSwapActivity:{timestamp:t},UserMerklClaimableReward:{startDate:t,endDate:t,claimUntil:t},UserPosition:{createdAt:t},UserBorrowItem:{createdAt:d},UserSupplyItem:{createdAt:d},SpokeUserPositionManager:{approvedOn:t},SwapCancelled:{createdAt:t,cancelledAt:d},SwapCancelledResult:{createdAt:t,cancelledAt:d},SwapExpired:{createdAt:t,expiredAt:t},SwapFulfilled:{createdAt:t,fulfilledAt:t},SwapOpen:{createdAt:t,deadline:t},SwapPendingSignature:{createdAt:t,deadline:t},SwapReceipt:{createdAt:t},Query:{hub:(e,{request:r})=>isHubInputVariant(r.query)?{__typename:"Hub",id:encodeHubId(r.query.hubInput)}:{__typename:"Hub",id:r.query.hubId},reserve:(e,{request:r})=>isReserveInputVariant(r.query)?{__typename:"Reserve",id:encodeReserveId(r.query.reserveInput)}:{__typename:"Reserve",id:r.query.reserveId},userPosition:(e,{request:r})=>{if("userSpoke"in r&&r.userSpoke){let{chainId:n,address:a}=decodeSpokeId(r.userSpoke.spoke);return {__typename:"UserPosition",id:encodeUserPositionId({chainId:n,spoke:a,user:r.userSpoke.user})}}if("id"in r&&r.id)return {__typename:"UserPosition",id:r.id}},activities:(e,r,n)=>{if(!isTxHashInputVariant(r.request.query))return n.resolve("Query","activities",r);let{txHash:a,chainId:i}=r.request.query.txHash,v=n.inspectFields("Query").filter(o=>o.fieldName==="activities").reduce((o,S)=>{let p=n.resolve("Query",S.fieldKey);if(!p)return o;let u=n.resolve(p,"items");if(!u)return o;for(let c of u)o.add(c);return o},new Set).values().toArray().filter(o=>{if(n.resolve(o,"txHash")!==a)return false;let p=n.resolve(o,"spoke");if(p){let u=n.resolve(p,"chain"),c=u?n.resolve(u,"chainId"):void 0;if(typeof c=="number")return c===i}return true});if(v.length!==0)return {__typename:"PaginatedActivitiesResult",items:v,pageInfo:{__typename:"PaginatedResultInfo",prev:null,next:null}}}}},keys:{Asset:e=>e.id,BorrowActivity:e=>e.id,BorrowSwapActivity:e=>e.id,Hub:e=>e.id,HubAsset:e=>e.id,LiquidatedActivity:e=>e.id,MerklBorrowReward:e=>e.id,MerklGenericCriteria:e=>e.id,MerklSupplyReward:e=>e.id,RepayActivity:e=>e.id,RepayWithSupplyActivity:e=>e.id,Reserve:e=>e.id,ReserveInfo:e=>e.id,Spoke:e=>e.id,SupplyActivity:e=>e.id,SupplySwapActivity:e=>e.id,TokenInfo:e=>e.id,TokenSwapActivity:e=>e.id,UpdatedDynamicConfigActivity:e=>e.id,UpdatedRiskPremiumActivity:e=>e.id,UserMerklClaimableReward:e=>e.id,UserPosition:e=>e.id,UsingAsCollateralActivity:e=>e.id,WithdrawActivity:e=>e.id,WithdrawSwapActivity:e=>e.id,Erc20Token:e=>e.address,Chain:e=>e.chainId.toString(),NativeToken:e=>e.chain.chainId.toString(),ApySample:()=>null,BorrowSwap:()=>null,AssetAmountWithChange:()=>null,AssetBorrowSample:()=>null,AssetPriceSample:()=>null,AssetSampleBreakdown:()=>null,AssetSummary:()=>null,AssetSupplySample:()=>null,DecimalNumber:()=>null,CollateralFactorVariation:()=>null,DecimalNumberWithChange:()=>null,DomainData:()=>null,Erc20Amount:()=>null,Erc20Approval:()=>null,Erc20ApprovalRequired:()=>null,ExchangeAmount:()=>null,ExchangeAmountVariation:()=>null,ExchangeAmountWithChange:()=>null,ForkTopUpResponse:()=>null,HealthFactorError:()=>null,HealthFactorVariation:()=>null,HealthFactorWithChange:()=>null,HubAssetInterestRateModelPoint:()=>null,HubAssetInterestRateModelResult:()=>null,HubAssetSettings:()=>null,HubAssetSummary:()=>null,HubAssetUserState:()=>null,HubSummary:()=>null,HubSummarySample:()=>null,InsufficientBalanceError:()=>null,InsufficientLiquidityError:()=>null,LiquidationFeeVariation:()=>null,MaxLiquidationBonusVariation:()=>null,NativeAmount:()=>null,PaginatedActivitiesResult:()=>null,PaginatedResultInfo:()=>null,PaginatedSpokePositionManagerResult:()=>null,PaginatedSpokeUserPositionManagerResult:()=>null,PaginatedUserSwapsResult:()=>null,PercentNumber:()=>null,PercentNumberVariation:()=>null,PercentNumberWithChange:()=>null,PermitTypedData:()=>null,BorrowSwapQuoteResult:()=>null,PercentNumberChangeSnapshot:()=>null,PositionAmount:()=>null,PositionSwapAdapterContractApproval:()=>null,PositionSwapByIntentApprovalsRequired:()=>null,PositionSwapPositionManagerApproval:()=>null,PreContractActionRequired:()=>null,PrepareSwapCancelResult:()=>null,PrepareSwapOrder:()=>null,PreviewMerklBorrowReward:()=>null,PreviewMerklSupplyReward:()=>null,PreviewRewardOutcome:()=>null,PreviewUserPosition:()=>null,RepayWithSupply:()=>null,RepayWithSupplyQuoteResult:()=>null,ProtocolHistorySample:()=>null,ReserveSettings:()=>null,ReserveStatus:()=>null,ReserveSummary:()=>null,ReserveUserState:()=>null,SpokePositionManager:()=>null,SpokeUserPositionManager:()=>null,SwapByIntent:()=>null,SwapByIntentWithApprovalRequired:()=>null,SupplySwap:()=>null,SupplySwapQuoteResult:()=>null,SwapByTransaction:()=>null,SwapCancelled:()=>null,SwapCancelledResult:()=>null,SwapExpired:()=>null,SwapFulfilled:()=>null,SwapOpen:()=>null,SwapPendingSignature:()=>null,SwapQuote:()=>null,SwapQuoteCosts:()=>null,SwapReceipt:()=>null,SwapTransactionRequest:()=>null,SwapTypedData:()=>null,TokenSwap:()=>null,TokenSwapQuoteResult:()=>null,WithdrawSwap:()=>null,WithdrawSwapQuoteResult:()=>null,TransactionRequest:()=>null,UserBalance:()=>null,UserBorrowItem:()=>null,UserPositionRiskPremium:()=>null,UserRiskPremiumBreakdownItem:()=>null,UserSummary:()=>null,UserSummaryHistoryItem:()=>null,UserSupplyItem:()=>null}});var A={name:"production",backend:"https://api.aave.com/graphql",indexingTimeout:6e4,pollingInterval:100,exchangeRateInterval:1e4,swapQuoteInterval:3e4,swapStatusInterval:5e3},G={name:"staging",backend:"https://api.staging.aave.com/graphql",indexingTimeout:6e4,pollingInterval:500,exchangeRateInterval:1e4,swapQuoteInterval:3e4,swapStatusInterval:5e3},z={name:"local",backend:"http://localhost:3007/graphql",indexingTimeout:6e4,pollingInterval:1e3,exchangeRateInterval:1e4,swapQuoteInterval:3e4,swapStatusInterval:5e3};function R({environment:e=A,headers:r,cache:n=true,batch:a=true,debug:i=false}){return {displayName:"AaveClient",environment:e,headers:r,cache:n?f:null,batch:a,debug:i}}function g(e){return e.operations!==null&&e.operations.length>0}function m(e){return {__typename:"TransactionReceipt",txHash:e}}var x=class e extends GqlClient{static create(r){return new e(R(r??{}))}waitForTransaction=r=>(invariant(g(r),"AaveClient.waitForTransaction called with an non-tracked operation. See the documentation for correct tracking setup."),ResultAsync.fromPromise(this.pollTransactionStatus(r),n=>n instanceof TimeoutError||n instanceof UnexpectedError?n:UnexpectedError.from(n)));async pollTransactionStatus(r){let n=Date.now();for(;Date.now()-n<this.context.environment.indexingTimeout;){if(await i(this,r).match(i=>i,i=>{throw i}))return m(r.txHash);await delay(this.context.environment.pollingInterval);}throw TimeoutError.from(`Timeout waiting for transaction ${r.txHash} to be processed.`)}};
2
- export{x as AaveClient,z as local,A as production,G as staging,m as transactionReceipt};//# sourceMappingURL=index.js.map
1
+ export{a as supportsPermit}from'./chunk-N4LXBTGY.js';import {i}from'./chunk-LCNG3LBO.js';export{a as DEFAULT_QUERY_OPTIONS}from'./chunk-LCNG3LBO.js';import {GqlClient,TimeoutError,UnexpectedError,delay}from'@aave/core';export*from'@aave/core';import {isTxHashInputVariant,decodeSpokeId,encodeUserPositionId,isReserveInputVariant,encodeReserveId,isHubInputVariant,encodeHubId}from'@aave/graphql';export*from'@aave/graphql';import {BigDecimal,invariant,ResultAsync}from'@aave/types';export*from'@aave/types';import E from'@aave/graphql/schema';import {cacheExchange}from'@urql/exchange-graphcache';var d=(e,r,a,n)=>BigInt(e[n.fieldName]),l=(e,r,a,n)=>BigDecimal.new(e[n.fieldName]),p=(e,r,a,n)=>{let i=e[n.fieldName];return i==null?null:l(e,r,a,n)},t=(e,r,a,n)=>new Date(e[n.fieldName]),s=(e,r,a,n)=>{let i=e[n.fieldName];return i==null?null:t(e,r,a,n)},R=cacheExchange({schema:E,resolvers:{PercentNumber:{onChainValue:d,value:l,normalized:l},DecimalNumber:{onChainValue:d,value:l},ExchangeAmount:{value:l},AssetPriceSample:{price:l,date:t},Reserve:{borrowCap:l,supplyCap:l},HealthFactorError:{current:p,after:p},HealthFactorVariation:{current:p,after:p},HealthFactorWithChange:{current:p},UserSummary:{lowestHealthFactor:p},UserSummaryHistoryItem:{healthFactor:p,date:t},TransactionRequest:{value:d},ApySample:{date:t},AssetBorrowSample:{date:t},AssetSupplySample:{date:t},HubSummarySample:{date:t},BorrowPointsReward:{startDate:t,endDate:s},PreviewBorrowPointsReward:{startDate:t,endDate:s},PreviewMerklBorrowReward:{startDate:t,endDate:t},PreviewMerklSupplyReward:{startDate:t,endDate:t},PreviewSupplyPointsReward:{startDate:t,endDate:s},SupplyPointsReward:{startDate:t,endDate:s},ProtocolHistorySample:{date:t},BorrowActivity:{timestamp:t},LiquidatedActivity:{timestamp:t},MerklBorrowReward:{startDate:t,endDate:t},MerklSupplyReward:{startDate:t,endDate:t},RepayActivity:{timestamp:t},SupplyActivity:{timestamp:t},WithdrawActivity:{timestamp:t},UsingAsCollateralActivity:{timestamp:t},UpdatedDynamicConfigActivity:{timestamp:t},UpdatedRiskPremiumActivity:{timestamp:t},TokenSwapActivity:{timestamp:t},SupplySwapActivity:{timestamp:t},BorrowSwapActivity:{timestamp:t},RepayWithSupplyActivity:{timestamp:t},WithdrawSwapActivity:{timestamp:t},UserMerklClaimableReward:{startDate:t,endDate:t,claimUntil:t},UserPosition:{createdAt:t},UserBorrowItem:{createdAt:s},UserSupplyItem:{createdAt:s},SpokeUserPositionManager:{approvedOn:t},SwapCancelled:{createdAt:t,cancelledAt:s},SwapCancelledResult:{createdAt:t,cancelledAt:s},SwapExpired:{createdAt:t,expiredAt:t},SwapFulfilled:{createdAt:t,fulfilledAt:t},SwapOpen:{createdAt:t,deadline:t},SwapPendingSignature:{createdAt:t,deadline:t},SwapReceipt:{createdAt:t},StableVaultSummary:{shares:d,totalDeposits:l,userCount:d},StableVaultWithdrawClaim:{executableAfter:t},TokenMovementRecord:{timestamp:t},StableVaultPendingAvailability:{executableAfter:t},Query:{hub:(e,{request:r})=>isHubInputVariant(r.query)?{__typename:"Hub",id:encodeHubId(r.query.hubInput)}:{__typename:"Hub",id:r.query.hubId},reserve:(e,{request:r})=>isReserveInputVariant(r.query)?{__typename:"Reserve",id:encodeReserveId(r.query.reserveInput)}:{__typename:"Reserve",id:r.query.reserveId},userPosition:(e,{request:r})=>{if("userSpoke"in r&&r.userSpoke){let{chainId:a,address:n}=decodeSpokeId(r.userSpoke.spoke);return {__typename:"UserPosition",id:encodeUserPositionId({chainId:a,spoke:n,user:r.userSpoke.user})}}if("id"in r&&r.id)return {__typename:"UserPosition",id:r.id}},activities:(e,r,a)=>{if(!isTxHashInputVariant(r.request.query))return a.resolve("Query","activities",r);let{txHash:n,chainId:i}=r.request.query.txHash,v=a.inspectFields("Query").filter(o=>o.fieldName==="activities").reduce((o,S)=>{let u=a.resolve("Query",S.fieldKey);if(!u)return o;let c=a.resolve(u,"items");if(!c)return o;for(let y of c)o.add(y);return o},new Set).values().toArray().filter(o=>{if(a.resolve(o,"txHash")!==n)return false;let u=a.resolve(o,"spoke");if(u){let c=a.resolve(u,"chain"),y=c?a.resolve(c,"chainId"):void 0;if(typeof y=="number")return y===i}return true});if(v.length!==0)return {__typename:"PaginatedActivitiesResult",items:v,pageInfo:{__typename:"PaginatedResultInfo",prev:null,next:null}}}}},keys:{Asset:e=>e.id,BorrowActivity:e=>e.id,BorrowPointsReward:e=>e.id,BorrowSwapActivity:e=>e.id,BoostedRate:e=>e.id,Hub:e=>e.id,HubAsset:e=>e.id,LiquidatedActivity:e=>e.id,MerklBorrowReward:e=>e.id,MerklGenericCriteria:e=>e.id,MerklSupplyReward:e=>e.id,PointsGenericCriteria:e=>e.id,PointsProgram:e=>e.id,RepayActivity:e=>e.id,RepayWithSupplyActivity:e=>e.id,Reserve:e=>e.id,ReserveInfo:e=>e.id,Spoke:e=>e.id,StableVault:e=>e.id,StableVaultUserPosition:e=>e.id,SupplyActivity:e=>e.id,SupplyPointsReward:e=>e.id,SupplySwapActivity:e=>e.id,TokenInfo:e=>e.id,TokenMovementRecord:e=>e.id,TokenSwapActivity:e=>e.id,UpdatedDynamicConfigActivity:e=>e.id,UpdatedRiskPremiumActivity:e=>e.id,UserMerklClaimableReward:e=>e.id,UserPosition:e=>e.id,UsingAsCollateralActivity:e=>e.id,WithdrawActivity:e=>e.id,WithdrawSwapActivity:e=>e.id,Erc20Token:e=>e.address,Chain:e=>e.chainId.toString(),NativeToken:e=>e.chain.chainId.toString(),ApySample:()=>null,AssetAmountWithChange:()=>null,AssetBorrowSample:()=>null,AssetPriceSample:()=>null,AssetSampleBreakdown:()=>null,AssetSummary:()=>null,AssetSupplySample:()=>null,BorrowSwap:()=>null,BorrowSwapQuoteResult:()=>null,CollateralFactorVariation:()=>null,DecimalNumber:()=>null,DecimalNumberWithChange:()=>null,DomainData:()=>null,Erc20Amount:()=>null,Erc20Approval:()=>null,Erc20ApprovalRequired:()=>null,ExchangeAmount:()=>null,ExchangeAmountVariation:()=>null,ExchangeAmountWithChange:()=>null,ForkTopUpResponse:()=>null,HealthFactorError:()=>null,HealthFactorVariation:()=>null,HealthFactorWithChange:()=>null,HubAssetInterestRateModelPoint:()=>null,HubAssetInterestRateModelResult:()=>null,HubAssetSettings:()=>null,HubAssetSummary:()=>null,HubAssetUserState:()=>null,HubSummary:()=>null,HubSummarySample:()=>null,InsufficientBalanceError:()=>null,InsufficientLiquidityError:()=>null,LiquidationFeeVariation:()=>null,MaxLiquidationBonusVariation:()=>null,NativeAmount:()=>null,PaginatedActivitiesResult:()=>null,PaginatedResultInfo:()=>null,PaginatedSpokePositionManagerResult:()=>null,PaginatedSpokeUserPositionManagerResult:()=>null,PaginatedStableVaultMovementsResult:()=>null,PaginatedStableVaultRateUsersResult:()=>null,PaginatedUserSwapsResult:()=>null,PercentNumber:()=>null,PercentNumberChangeSnapshot:()=>null,PercentNumberVariation:()=>null,PercentNumberWithChange:()=>null,PermitTypedData:()=>null,PositionAmount:()=>null,PositionSwapAdapterContractApproval:()=>null,PositionSwapByIntentApprovalsRequired:()=>null,PositionSwapPositionManagerApproval:()=>null,PreContractActionRequired:()=>null,PrepareSwapCancelResult:()=>null,PrepareSwapOrder:()=>null,PreviewBorrowPointsReward:()=>null,PreviewMerklBorrowReward:()=>null,PreviewMerklSupplyReward:()=>null,PreviewRewardOutcome:()=>null,PreviewSupplyPointsReward:()=>null,PreviewUserPosition:()=>null,ProtocolHistorySample:()=>null,RepayWithSupply:()=>null,RepayWithSupplyQuoteResult:()=>null,ReserveSettings:()=>null,ReserveStatus:()=>null,ReserveSummary:()=>null,ReserveUserState:()=>null,SpokePositionManager:()=>null,SpokeUserPositionManager:()=>null,StableVaultPendingAvailability:()=>null,StableVaultRates:()=>null,StableVaultSummary:()=>null,StableVaultWithdrawClaim:()=>null,SupplySwap:()=>null,SupplySwapQuoteResult:()=>null,SwapByIntent:()=>null,SwapByIntentWithApprovalRequired:()=>null,SwapByTransaction:()=>null,SwapCancelled:()=>null,SwapCancelledResult:()=>null,SwapExpired:()=>null,SwapFulfilled:()=>null,SwapOpen:()=>null,SwapPendingSignature:()=>null,SwapQuote:()=>null,SwapQuoteCosts:()=>null,SwapReceipt:()=>null,SwapTransactionRequest:()=>null,SwapTypedData:()=>null,TokenMovementAllocate:()=>null,TokenMovementBridgeIn:()=>null,TokenMovementBridgeOut:()=>null,TokenMovementDeallocate:()=>null,TokenMovementRebalance:()=>null,TokenMovementSwap:()=>null,TokenSwap:()=>null,TokenSwapQuoteResult:()=>null,TransactionRequest:()=>null,UserBalance:()=>null,UserBorrowItem:()=>null,UserPositionRiskPremium:()=>null,UserRiskPremiumBreakdownItem:()=>null,UserSummary:()=>null,UserSummaryHistoryItem:()=>null,UserSupplyItem:()=>null,WithdrawSwap:()=>null,WithdrawSwapQuoteResult:()=>null}});var f={name:"production",backend:"https://api.aave.com/graphql",indexingTimeout:6e4,pollingInterval:100,exchangeRateInterval:1e4,swapQuoteInterval:3e4,swapStatusInterval:5e3},L={name:"staging",backend:"https://api.staging.aave.com/graphql",indexingTimeout:6e4,pollingInterval:500,exchangeRateInterval:1e4,swapQuoteInterval:3e4,swapStatusInterval:5e3},z={name:"local",backend:"http://localhost:3007/graphql",indexingTimeout:6e4,pollingInterval:1e3,exchangeRateInterval:1e4,swapQuoteInterval:3e4,swapStatusInterval:5e3};function A({environment:e=f,headers:r,cache:a=true,batch:n=true,debug:i=false}){return {displayName:"AaveClient",environment:e,headers:r,cache:a?R:null,batch:n,debug:i}}function g(e){return e.operations!==null&&e.operations.length>0}function m(e){return {__typename:"TransactionReceipt",txHash:e}}var T=class e extends GqlClient{static create(r){return new e(A(r??{}))}waitForTransaction=r=>(invariant(g(r),"AaveClient.waitForTransaction called with an non-tracked operation. See the documentation for correct tracking setup."),ResultAsync.fromPromise(this.pollTransactionStatus(r),a=>a instanceof TimeoutError||a instanceof UnexpectedError?a:UnexpectedError.from(a)));async pollTransactionStatus(r){let a=Date.now();for(;Date.now()-a<this.context.environment.indexingTimeout;){if(await i(this,r).match(i=>i,i=>{throw i}))return m(r.txHash);await delay(this.context.environment.pollingInterval);}throw TimeoutError.from(`Timeout waiting for transaction ${r.txHash} to be processed.`)}};
2
+ export{T as AaveClient,z as local,f as production,L as staging,m as transactionReceipt};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cache.ts","../src/environments.ts","../src/config.ts","../src/types.ts","../src/AaveClient.ts"],"names":["transformToBigInt","parent","_args","_cache","info","transformToBigDecimal","BigDecimal","transformToNullableBigDecimal","value","transformToDate","transformToNullableDate","exchange","cacheExchange","introspectedSchema","_","request","isHubInputVariant","encodeHubId","isReserveInputVariant","encodeReserveId","chainId","address","decodeSpokeId","encodeUserPositionId","_parent","args","cache","isTxHashInputVariant","txHash","matches","f","set","pageRef","itemRefs","ref","spokeRef","chainRef","itemChainId","data","production","staging","local","configureContext","environment","headers","batch","debug","isHasProcessedKnownTransactionRequest","result","transactionReceipt","AaveClient","_AaveClient","GqlClient","options","invariant","ResultAsync","err","TimeoutError","UnexpectedError","startedAt","hasProcessedKnownTransaction","ok","delay"],"mappings":"olBAkDA,IAAMA,CAAAA,CAA8B,CAACC,CAAAA,CAAQC,CAAAA,CAAOC,CAAAA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A,CAAQ,YAAY,eAAe,EACtD,CACA,MAAML,aAAa,IAAA,CACjB,CAAA,gCAAA,EAAmC1C,EAAQ,MAAM,CAAA,iBAAA,CACnD,CACF,CACF","file":"index.js","sourcesContent":["import {\n type ActivitiesQuery,\n type Asset,\n type BorrowActivity,\n type BorrowSwapActivity,\n type Chain,\n decodeSpokeId,\n type Erc20Token,\n encodeHubId,\n encodeReserveId,\n encodeUserPositionId,\n type Hub,\n type HubAsset,\n type HubQuery,\n isHubInputVariant,\n isReserveInputVariant,\n isTxHashInputVariant,\n type LiquidatedActivity,\n type MerklBorrowReward,\n type MerklGenericCriteria,\n type MerklSupplyReward,\n type NativeToken,\n type RepayActivity,\n type RepayWithSupplyActivity,\n type Reserve,\n type ReserveInfo,\n type ReserveQuery,\n type Spoke,\n type SupplyActivity,\n type SupplySwapActivity,\n type TokenInfo,\n type TokenSwapActivity,\n type UpdatedDynamicConfigActivity,\n type UpdatedRiskPremiumActivity,\n type UserMerklClaimableReward,\n type UserPosition,\n type UserPositionQuery,\n type UsingAsCollateralActivity,\n type VariablesOf,\n type WithdrawActivity,\n type WithdrawSwapActivity,\n} from '@aave/graphql';\nimport introspectedSchema from '@aave/graphql/schema';\nimport { BigDecimal, type TxHash } from '@aave/types';\nimport {\n cacheExchange,\n type Resolver,\n type Scalar,\n} from '@urql/exchange-graphcache';\n\nconst transformToBigInt: Resolver = (parent, _args, _cache, info) => {\n return BigInt(parent[info.fieldName] as string) as unknown as Scalar;\n};\n\nconst transformToBigDecimal: Resolver = (parent, _args, _cache, info) => {\n return BigDecimal.new(parent[info.fieldName] as string);\n};\n\nconst transformToNullableBigDecimal: Resolver = (\n parent,\n _args,\n _cache,\n info,\n) => {\n const value = parent[info.fieldName];\n if (value === null || value === undefined) {\n return null;\n }\n return transformToBigDecimal(parent, _args, _cache, info);\n};\n\nconst transformToDate: Resolver = (parent, _args, _cache, info) => {\n return new Date(parent[info.fieldName] as string);\n};\n\nconst transformToNullableDate: Resolver = (parent, _args, _cache, info) => {\n const value = parent[info.fieldName];\n if (value === null || value === undefined) {\n return null;\n }\n return transformToDate(parent, _args, _cache, info);\n};\n\nexport const exchange = cacheExchange({\n schema: introspectedSchema,\n resolvers: {\n PercentNumber: {\n onChainValue: transformToBigInt,\n value: transformToBigDecimal,\n normalized: transformToBigDecimal,\n },\n DecimalNumber: {\n onChainValue: transformToBigInt,\n value: transformToBigDecimal,\n },\n ExchangeAmount: {\n value: transformToBigDecimal,\n },\n AssetPriceSample: {\n price: transformToBigDecimal,\n date: transformToDate,\n },\n Reserve: {\n borrowCap: transformToBigDecimal,\n supplyCap: transformToBigDecimal,\n },\n HealthFactorError: {\n current: transformToNullableBigDecimal,\n after: transformToNullableBigDecimal,\n },\n HealthFactorVariation: {\n current: transformToNullableBigDecimal,\n after: transformToNullableBigDecimal,\n },\n HealthFactorWithChange: {\n current: transformToNullableBigDecimal,\n },\n UserSummary: {\n lowestHealthFactor: transformToNullableBigDecimal,\n },\n UserSummaryHistoryItem: {\n healthFactor: transformToNullableBigDecimal,\n date: transformToDate,\n },\n TransactionRequest: {\n value: transformToBigInt,\n },\n ApySample: {\n date: transformToDate,\n },\n AssetBorrowSample: {\n date: transformToDate,\n },\n AssetSupplySample: {\n date: transformToDate,\n },\n HubSummarySample: {\n date: transformToDate,\n },\n PreviewMerklBorrowReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n PreviewMerklSupplyReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n ProtocolHistorySample: {\n date: transformToDate,\n },\n BorrowActivity: {\n timestamp: transformToDate,\n },\n LiquidatedActivity: {\n timestamp: transformToDate,\n },\n MerklBorrowReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n MerklSupplyReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n RepayActivity: {\n timestamp: transformToDate,\n },\n SupplyActivity: {\n timestamp: transformToDate,\n },\n WithdrawActivity: {\n timestamp: transformToDate,\n },\n UsingAsCollateralActivity: {\n timestamp: transformToDate,\n },\n UpdatedDynamicConfigActivity: {\n timestamp: transformToDate,\n },\n UpdatedRiskPremiumActivity: {\n timestamp: transformToDate,\n },\n TokenSwapActivity: {\n timestamp: transformToDate,\n },\n SupplySwapActivity: {\n timestamp: transformToDate,\n },\n BorrowSwapActivity: {\n timestamp: transformToDate,\n },\n RepayWithSupplyActivity: {\n timestamp: transformToDate,\n },\n WithdrawSwapActivity: {\n timestamp: transformToDate,\n },\n UserMerklClaimableReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n claimUntil: transformToDate,\n },\n UserPosition: {\n createdAt: transformToDate,\n },\n UserBorrowItem: {\n createdAt: transformToNullableDate,\n },\n UserSupplyItem: {\n createdAt: transformToNullableDate,\n },\n SpokeUserPositionManager: {\n approvedOn: transformToDate,\n },\n SwapCancelled: {\n createdAt: transformToDate,\n cancelledAt: transformToNullableDate,\n },\n SwapCancelledResult: {\n createdAt: transformToDate,\n cancelledAt: transformToNullableDate,\n },\n SwapExpired: {\n createdAt: transformToDate,\n expiredAt: transformToDate,\n },\n SwapFulfilled: {\n createdAt: transformToDate,\n fulfilledAt: transformToDate,\n },\n SwapOpen: {\n createdAt: transformToDate,\n deadline: transformToDate,\n },\n SwapPendingSignature: {\n createdAt: transformToDate,\n deadline: transformToDate,\n },\n SwapReceipt: {\n createdAt: transformToDate,\n },\n Query: {\n hub: (_, { request }: VariablesOf<typeof HubQuery>) => {\n if (isHubInputVariant(request.query)) {\n return {\n __typename: 'Hub',\n id: encodeHubId(request.query.hubInput),\n };\n }\n return {\n __typename: 'Hub',\n id: request.query.hubId,\n };\n },\n\n reserve: (_, { request }: VariablesOf<typeof ReserveQuery>) => {\n if (isReserveInputVariant(request.query)) {\n return {\n __typename: 'Reserve',\n id: encodeReserveId(request.query.reserveInput),\n };\n }\n return {\n __typename: 'Reserve',\n id: request.query.reserveId,\n };\n },\n\n userPosition: (_, { request }: VariablesOf<typeof UserPositionQuery>) => {\n if ('userSpoke' in request && request.userSpoke) {\n const { chainId, address } = decodeSpokeId(request.userSpoke.spoke);\n return {\n __typename: 'UserPosition',\n id: encodeUserPositionId({\n chainId,\n spoke: address,\n user: request.userSpoke.user,\n }),\n };\n }\n if ('id' in request && request.id) {\n return {\n __typename: 'UserPosition',\n id: request.id,\n };\n }\n return undefined;\n },\n\n activities: (\n _parent,\n args: VariablesOf<typeof ActivitiesQuery>,\n cache,\n ) => {\n // Bail out if not a txHash filter lookup\n if (!isTxHashInputVariant(args.request.query)) {\n return cache.resolve('Query', 'activities', args);\n }\n\n const { txHash, chainId } = args.request.query.txHash;\n\n // Collect all cached activities matching txHash\n const matches = cache\n .inspectFields('Query')\n .filter((f) => f.fieldName === 'activities')\n .reduce((set, f) => {\n const pageRef = cache.resolve('Query', f.fieldKey) as string | null;\n if (!pageRef) return set;\n\n const itemRefs = cache.resolve(pageRef, 'items') as string[] | null;\n if (!itemRefs) return set;\n\n for (const ref of itemRefs) {\n set.add(ref);\n }\n return set;\n }, new Set<string>())\n .values()\n .toArray()\n .filter((ref) => {\n const itemTxHash = cache.resolve(ref, 'txHash') as TxHash;\n if (itemTxHash !== txHash) return false;\n\n // Verify chainId via spoke.chain.chainId if present\n const spokeRef = cache.resolve(ref, 'spoke') as string | null;\n if (spokeRef) {\n const chainRef = cache.resolve(spokeRef, 'chain') as\n | string\n | null;\n const itemChainId = chainRef\n ? (cache.resolve(chainRef, 'chainId') as number | undefined)\n : undefined;\n if (typeof itemChainId === 'number') {\n return itemChainId === chainId;\n }\n }\n return true;\n });\n\n if (matches.length === 0) return undefined;\n\n return {\n __typename: 'PaginatedActivitiesResult',\n items: matches,\n pageInfo: {\n __typename: 'PaginatedResultInfo',\n prev: null,\n next: null,\n },\n };\n },\n },\n },\n keys: {\n // Entities with id field as key\n Asset: (data: Asset) => data.id,\n BorrowActivity: (data: BorrowActivity) => data.id,\n BorrowSwapActivity: (data: BorrowSwapActivity) => data.id,\n Hub: (data: Hub) => data.id,\n HubAsset: (data: HubAsset) => data.id,\n LiquidatedActivity: (data: LiquidatedActivity) => data.id,\n MerklBorrowReward: (data: MerklBorrowReward) => data.id,\n MerklGenericCriteria: (data: MerklGenericCriteria) => data.id,\n MerklSupplyReward: (data: MerklSupplyReward) => data.id,\n RepayActivity: (data: RepayActivity) => data.id,\n RepayWithSupplyActivity: (data: RepayWithSupplyActivity) => data.id,\n Reserve: (data: Reserve) => data.id,\n ReserveInfo: (data: ReserveInfo) => data.id,\n Spoke: (data: Spoke) => data.id,\n SupplyActivity: (data: SupplyActivity) => data.id,\n SupplySwapActivity: (data: SupplySwapActivity) => data.id,\n TokenInfo: (data: TokenInfo) => data.id,\n TokenSwapActivity: (data: TokenSwapActivity) => data.id,\n UpdatedDynamicConfigActivity: (data: UpdatedDynamicConfigActivity) =>\n data.id,\n UpdatedRiskPremiumActivity: (data: UpdatedRiskPremiumActivity) => data.id,\n UserMerklClaimableReward: (data: UserMerklClaimableReward) => data.id,\n UserPosition: (data: UserPosition) => data.id,\n UsingAsCollateralActivity: (data: UsingAsCollateralActivity) => data.id,\n WithdrawActivity: (data: WithdrawActivity) => data.id,\n WithdrawSwapActivity: (data: WithdrawSwapActivity) => data.id,\n\n // Entities with address field as key\n Erc20Token: (data: Erc20Token) => data.address,\n\n // Entities with other fields as key\n Chain: (data: Chain) => data.chainId.toString(),\n NativeToken: (data: NativeToken) => data.chain.chainId.toString(),\n\n // Value objects and result types\n ApySample: () => null,\n BorrowSwap: () => null,\n AssetAmountWithChange: () => null,\n AssetBorrowSample: () => null,\n AssetPriceSample: () => null,\n AssetSampleBreakdown: () => null,\n AssetSummary: () => null,\n AssetSupplySample: () => null,\n DecimalNumber: () => null,\n CollateralFactorVariation: () => null,\n DecimalNumberWithChange: () => null,\n DomainData: () => null,\n Erc20Amount: () => null,\n Erc20Approval: () => null,\n Erc20ApprovalRequired: () => null,\n ExchangeAmount: () => null,\n ExchangeAmountVariation: () => null,\n ExchangeAmountWithChange: () => null,\n ForkTopUpResponse: () => null,\n HealthFactorError: () => null,\n HealthFactorVariation: () => null,\n HealthFactorWithChange: () => null,\n HubAssetInterestRateModelPoint: () => null,\n HubAssetInterestRateModelResult: () => null,\n HubAssetSettings: () => null,\n HubAssetSummary: () => null,\n HubAssetUserState: () => null,\n HubSummary: () => null,\n HubSummarySample: () => null,\n InsufficientBalanceError: () => null,\n InsufficientLiquidityError: () => null,\n LiquidationFeeVariation: () => null,\n MaxLiquidationBonusVariation: () => null,\n NativeAmount: () => null,\n PaginatedActivitiesResult: () => null,\n PaginatedResultInfo: () => null,\n PaginatedSpokePositionManagerResult: () => null,\n PaginatedSpokeUserPositionManagerResult: () => null,\n PaginatedUserSwapsResult: () => null,\n PercentNumber: () => null,\n PercentNumberVariation: () => null,\n PercentNumberWithChange: () => null,\n PermitTypedData: () => null,\n BorrowSwapQuoteResult: () => null,\n PercentNumberChangeSnapshot: () => null,\n PositionAmount: () => null,\n PositionSwapAdapterContractApproval: () => null,\n PositionSwapByIntentApprovalsRequired: () => null,\n PositionSwapPositionManagerApproval: () => null,\n PreContractActionRequired: () => null,\n PrepareSwapCancelResult: () => null,\n PrepareSwapOrder: () => null,\n PreviewMerklBorrowReward: () => null,\n PreviewMerklSupplyReward: () => null,\n PreviewRewardOutcome: () => null,\n PreviewUserPosition: () => null,\n RepayWithSupply: () => null,\n RepayWithSupplyQuoteResult: () => null,\n ProtocolHistorySample: () => null,\n ReserveSettings: () => null,\n ReserveStatus: () => null,\n ReserveSummary: () => null,\n ReserveUserState: () => null,\n SpokePositionManager: () => null,\n SpokeUserPositionManager: () => null,\n SwapByIntent: () => null,\n SwapByIntentWithApprovalRequired: () => null,\n SupplySwap: () => null,\n SupplySwapQuoteResult: () => null,\n SwapByTransaction: () => null,\n SwapCancelled: () => null,\n SwapCancelledResult: () => null,\n SwapExpired: () => null,\n SwapFulfilled: () => null,\n SwapOpen: () => null,\n SwapPendingSignature: () => null,\n SwapQuote: () => null,\n SwapQuoteCosts: () => null,\n SwapReceipt: () => null,\n SwapTransactionRequest: () => null,\n SwapTypedData: () => null,\n TokenSwap: () => null,\n TokenSwapQuoteResult: () => null,\n WithdrawSwap: () => null,\n WithdrawSwapQuoteResult: () => null,\n TransactionRequest: () => null,\n UserBalance: () => null,\n UserBorrowItem: () => null,\n UserPositionRiskPremium: () => null,\n UserRiskPremiumBreakdownItem: () => null,\n UserSummary: () => null,\n UserSummaryHistoryItem: () => null,\n UserSupplyItem: () => null,\n },\n});\n","import type { EnvironmentConfig } from '@aave/core';\n\n/**\n * The production environment configuration.\n */\nexport const production: EnvironmentConfig = {\n name: 'production',\n backend: 'https://api.aave.com/graphql',\n indexingTimeout: 60_000,\n pollingInterval: 100,\n exchangeRateInterval: 10_000,\n swapQuoteInterval: 30_000,\n swapStatusInterval: 5_000,\n};\n\n/**\n * @internal\n */\nexport const staging: EnvironmentConfig = {\n name: 'staging',\n backend: 'https://api.staging.aave.com/graphql',\n indexingTimeout: 60_000,\n pollingInterval: 500,\n exchangeRateInterval: 10_000,\n swapQuoteInterval: 30_000,\n swapStatusInterval: 5_000,\n};\n\n/**\n * @internal\n */\nexport const local: EnvironmentConfig = {\n name: 'local',\n backend: 'http://localhost:3007/graphql',\n indexingTimeout: 60_000,\n pollingInterval: 1000,\n exchangeRateInterval: 10_000,\n swapQuoteInterval: 30_000,\n swapStatusInterval: 5_000,\n};\n","import type { Context } from '@aave/core';\nimport type { EnvironmentConfig } from '../../core/src/types';\nimport { exchange } from './cache';\nimport { production } from './environments';\n\n/**\n * The client configuration.\n */\nexport type ClientConfig = {\n /**\n * @internal\n * @defaultValue `production`\n */\n environment?: EnvironmentConfig;\n /**\n * @internal\n */\n headers?: Record<string, string>;\n /**\n * Whether to enable caching.\n *\n * @defaultValue `true`\n */\n cache?: boolean;\n /**\n * Whether to enable query batching.\n *\n * @defaultValue `true`\n */\n batch?: boolean;\n /**\n * Whether to enable debug mode.\n *\n * @defaultValue `false`\n */\n debug?: boolean;\n};\n\n/**\n * @internal\n */\nexport function configureContext({\n environment = production,\n headers,\n cache = true,\n batch = true,\n debug = false,\n}: ClientConfig): Context {\n return {\n displayName: 'AaveClient',\n environment,\n headers,\n cache: cache ? exchange : null,\n batch,\n debug,\n };\n}\n","import type {\n CancelError,\n SigningError,\n TransactionError,\n UnexpectedError,\n ValidationError,\n} from '@aave/core';\nimport type {\n ExecutionPlan,\n HasProcessedKnownTransactionRequest,\n InsufficientBalanceError,\n OperationType,\n PermitTypedData,\n SwapTypedData,\n} from '@aave/graphql';\nimport type { ResultAsync, Signature, TxHash } from '@aave/types';\n\n/**\n * @internal\n */\nexport type TransactionResult = {\n txHash: TxHash;\n operations: OperationType[] | null;\n};\n\n/**\n * @internal\n */\nexport function isHasProcessedKnownTransactionRequest(\n result: TransactionResult,\n): result is HasProcessedKnownTransactionRequest {\n return result.operations !== null && result.operations.length > 0;\n}\n\nexport type TransactionReceipt = {\n __typename: 'TransactionReceipt';\n txHash: TxHash;\n};\n\n/**\n * @internal\n */\nexport function transactionReceipt(txHash: TxHash): TransactionReceipt {\n return { __typename: 'TransactionReceipt', txHash };\n}\n\nexport type SendWithError =\n | CancelError\n | SigningError\n | TransactionError\n | ValidationError<InsufficientBalanceError>\n | UnexpectedError;\n\nexport type ExecutionPlanHandler<T extends ExecutionPlan = ExecutionPlan> = (\n result: T,\n) => ResultAsync<TransactionResult, SendWithError>;\n\nexport type SignTypedDataError = CancelError | SigningError;\n\n/**\n * Union type for all EIP-712 typed data structures used in the SDK.\n */\nexport type TypedData = PermitTypedData | SwapTypedData;\n\nexport type TypedDataHandler = (\n data: TypedData,\n) => ResultAsync<Signature, SignTypedDataError>;\n","import { delay, GqlClient, TimeoutError, UnexpectedError } from '@aave/core';\nimport type { HasProcessedKnownTransactionRequest } from '@aave/graphql';\nimport { invariant, ResultAsync } from '@aave/types';\nimport { hasProcessedKnownTransaction } from './actions';\nimport { type ClientConfig, configureContext } from './config';\nimport {\n isHasProcessedKnownTransactionRequest,\n type TransactionReceipt,\n type TransactionResult,\n transactionReceipt,\n} from './types';\n\nexport class AaveClient extends GqlClient {\n /**\n * Create a new instance of the {@link AaveClient}.\n *\n * ```ts\n * const client = AaveClient.create({\n * environment: production,\n * });\n * ```\n *\n * @param options - The options to configure the client.\n * @returns The new instance of the client.\n */\n static create(options?: ClientConfig): AaveClient {\n return new AaveClient(configureContext(options ?? {}));\n }\n\n /**\n * Given the transaction hash of an Aave protocol transaction, wait for the transaction to be\n * processed by the Aave v4 API.\n *\n * Returns a {@link TimeoutError} if the transaction is not processed within the expected timeout period.\n *\n * @param result - The transaction execution result to wait for.\n * @returns The {@link TransactionReceipt} or a error\n */\n readonly waitForTransaction = (\n result: TransactionResult,\n ): ResultAsync<TransactionReceipt, TimeoutError | UnexpectedError> => {\n invariant(\n isHasProcessedKnownTransactionRequest(result),\n 'AaveClient.waitForTransaction called with an non-tracked operation. See the documentation for correct tracking setup.',\n );\n\n return ResultAsync.fromPromise(\n this.pollTransactionStatus(result),\n (err) => {\n if (err instanceof TimeoutError || err instanceof UnexpectedError) {\n return err;\n }\n return UnexpectedError.from(err);\n },\n );\n };\n\n protected async pollTransactionStatus(\n request: HasProcessedKnownTransactionRequest,\n ): Promise<TransactionReceipt> {\n const startedAt = Date.now();\n\n while (Date.now() - startedAt < this.context.environment.indexingTimeout) {\n const processed = await hasProcessedKnownTransaction(this, request).match(\n (ok) => ok,\n (err) => {\n throw err;\n },\n );\n\n if (processed) {\n return transactionReceipt(request.txHash);\n }\n\n await delay(this.context.environment.pollingInterval);\n }\n throw TimeoutError.from(\n `Timeout waiting for transaction ${request.txHash} to be processed.`,\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/cache.ts","../src/environments.ts","../src/config.ts","../src/types.ts","../src/AaveClient.ts"],"names":["transformToBigInt","parent","_args","_cache","info","transformToBigDecimal","BigDecimal","transformToNullableBigDecimal","value","transformToDate","transformToNullableDate","exchange","cacheExchange","introspectedSchema","_","request","isHubInputVariant","encodeHubId","isReserveInputVariant","encodeReserveId","chainId","address","decodeSpokeId","encodeUserPositionId","_parent","args","cache","isTxHashInputVariant","txHash","matches","f","set","pageRef","itemRefs","ref","spokeRef","chainRef","itemChainId","data","production","staging","local","configureContext","environment","headers","batch","debug","isHasProcessedKnownTransactionRequest","result","transactionReceipt","AaveClient","_AaveClient","GqlClient","options","invariant","ResultAsync","err","TimeoutError","UnexpectedError","startedAt","hasProcessedKnownTransaction","ok","delay"],"mappings":"olBA0DA,IAAMA,CAAAA,CAA8B,CAACC,CAAAA,CAAQC,CAAAA,CAAOC,CAAAA,CAAQC,CAAAA,GACnD,OAAOH,CAAAA,CAAOG,CAAAA,CAAK,SAAS,CAAW,CAAA,CAG1CC,EAAkC,CAACJ,CAAAA,CAAQC,CAAAA,CAAOC,CAAAA,CAAQC,IACvDE,UAAAA,CAAW,GAAA,CAAIL,EAAOG,CAAAA,CAAK,SAAS,CAAW,CAAA,CAGlDG,CAAAA,CAA0C,CAC9CN,CAAAA,CACAC,CAAAA,CACAC,EACAC,CAAAA,GACG,CACH,IAAMI,CAAAA,CAAQP,CAAAA,CAAOG,EAAK,SAAS,CAAA,CACnC,OAAII,CAAAA,EAAU,KACL,IAAA,CAEFH,CAAAA,CAAsBJ,EAAQC,CAAAA,CAAOC,CAAAA,CAAQC,CAAI,CAC1D,CAAA,CAEMK,CAAAA,CAA4B,CAACR,EAAQC,CAAAA,CAAOC,CAAAA,CAAQC,IACjD,IAAI,IAAA,CAAKH,EAAOG,CAAAA,CAAK,SAAS,CAAW,CAAA,CAG5CM,EAAoC,CAACT,CAAAA,CAAQC,EAAOC,CAAAA,CAAQC,CAAAA,GAAS,CACzE,IAAMI,CAAAA,CAAQP,EAAOG,CAAAA,CAAK,SAAS,EACnC,OAAII,CAAAA,EAAU,KACL,IAAA,CAEFC,CAAAA,CAAgBR,EAAQC,CAAAA,CAAOC,CAAAA,CAAQC,CAAI,CACpD,EAEaO,CAAAA,CAAWC,aAAAA,CAAc,CACpC,MAAA,CAAQC,CAAAA,CACR,UAAW,CACT,aAAA,CAAe,CACb,YAAA,CAAcb,EACd,KAAA,C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,IAAA,CAAK,QAAQ,WAAA,CAAY,eAAe,EACtD,CACA,MAAML,aAAa,IAAA,CACjB,CAAA,gCAAA,EAAmC1C,EAAQ,MAAM,CAAA,iBAAA,CACnD,CACF,CACF","file":"index.js","sourcesContent":["import {\n type ActivitiesQuery,\n type Asset,\n type BoostedRateId,\n type BorrowActivity,\n type BorrowPoints,\n type BorrowSwapActivity,\n type Chain,\n decodeSpokeId,\n type Erc20Token,\n encodeHubId,\n encodeReserveId,\n encodeUserPositionId,\n type Hub,\n type HubAsset,\n type HubQuery,\n isHubInputVariant,\n isReserveInputVariant,\n isTxHashInputVariant,\n type LiquidatedActivity,\n type MerklBorrowReward,\n type MerklGenericCriteria,\n type MerklSupplyReward,\n type NativeToken,\n type PointsGenericCriteria,\n type PointsProgram,\n type RepayActivity,\n type RepayWithSupplyActivity,\n type Reserve,\n type ReserveInfo,\n type ReserveQuery,\n type Spoke,\n type StableVault,\n type StableVaultUserPosition,\n type SupplyActivity,\n type SupplyPoints,\n type SupplySwapActivity,\n type TokenInfo,\n type TokenMovementRecord,\n type TokenSwapActivity,\n type UpdatedDynamicConfigActivity,\n type UpdatedRiskPremiumActivity,\n type UserMerklClaimableReward,\n type UserPosition,\n type UserPositionQuery,\n type UsingAsCollateralActivity,\n type VariablesOf,\n type WithdrawActivity,\n type WithdrawSwapActivity,\n} from '@aave/graphql';\nimport introspectedSchema from '@aave/graphql/schema';\nimport { BigDecimal, type TxHash } from '@aave/types';\nimport {\n cacheExchange,\n type Resolver,\n type Scalar,\n} from '@urql/exchange-graphcache';\n\nconst transformToBigInt: Resolver = (parent, _args, _cache, info) => {\n return BigInt(parent[info.fieldName] as string) as unknown as Scalar;\n};\n\nconst transformToBigDecimal: Resolver = (parent, _args, _cache, info) => {\n return BigDecimal.new(parent[info.fieldName] as string);\n};\n\nconst transformToNullableBigDecimal: Resolver = (\n parent,\n _args,\n _cache,\n info,\n) => {\n const value = parent[info.fieldName];\n if (value === null || value === undefined) {\n return null;\n }\n return transformToBigDecimal(parent, _args, _cache, info);\n};\n\nconst transformToDate: Resolver = (parent, _args, _cache, info) => {\n return new Date(parent[info.fieldName] as string);\n};\n\nconst transformToNullableDate: Resolver = (parent, _args, _cache, info) => {\n const value = parent[info.fieldName];\n if (value === null || value === undefined) {\n return null;\n }\n return transformToDate(parent, _args, _cache, info);\n};\n\nexport const exchange = cacheExchange({\n schema: introspectedSchema,\n resolvers: {\n PercentNumber: {\n onChainValue: transformToBigInt,\n value: transformToBigDecimal,\n normalized: transformToBigDecimal,\n },\n DecimalNumber: {\n onChainValue: transformToBigInt,\n value: transformToBigDecimal,\n },\n ExchangeAmount: {\n value: transformToBigDecimal,\n },\n AssetPriceSample: {\n price: transformToBigDecimal,\n date: transformToDate,\n },\n Reserve: {\n borrowCap: transformToBigDecimal,\n supplyCap: transformToBigDecimal,\n },\n HealthFactorError: {\n current: transformToNullableBigDecimal,\n after: transformToNullableBigDecimal,\n },\n HealthFactorVariation: {\n current: transformToNullableBigDecimal,\n after: transformToNullableBigDecimal,\n },\n HealthFactorWithChange: {\n current: transformToNullableBigDecimal,\n },\n UserSummary: {\n lowestHealthFactor: transformToNullableBigDecimal,\n },\n UserSummaryHistoryItem: {\n healthFactor: transformToNullableBigDecimal,\n date: transformToDate,\n },\n TransactionRequest: {\n value: transformToBigInt,\n },\n ApySample: {\n date: transformToDate,\n },\n AssetBorrowSample: {\n date: transformToDate,\n },\n AssetSupplySample: {\n date: transformToDate,\n },\n HubSummarySample: {\n date: transformToDate,\n },\n BorrowPointsReward: {\n startDate: transformToDate,\n endDate: transformToNullableDate,\n },\n PreviewBorrowPointsReward: {\n startDate: transformToDate,\n endDate: transformToNullableDate,\n },\n PreviewMerklBorrowReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n PreviewMerklSupplyReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n PreviewSupplyPointsReward: {\n startDate: transformToDate,\n endDate: transformToNullableDate,\n },\n SupplyPointsReward: {\n startDate: transformToDate,\n endDate: transformToNullableDate,\n },\n ProtocolHistorySample: {\n date: transformToDate,\n },\n BorrowActivity: {\n timestamp: transformToDate,\n },\n LiquidatedActivity: {\n timestamp: transformToDate,\n },\n MerklBorrowReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n MerklSupplyReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n },\n RepayActivity: {\n timestamp: transformToDate,\n },\n SupplyActivity: {\n timestamp: transformToDate,\n },\n WithdrawActivity: {\n timestamp: transformToDate,\n },\n UsingAsCollateralActivity: {\n timestamp: transformToDate,\n },\n UpdatedDynamicConfigActivity: {\n timestamp: transformToDate,\n },\n UpdatedRiskPremiumActivity: {\n timestamp: transformToDate,\n },\n TokenSwapActivity: {\n timestamp: transformToDate,\n },\n SupplySwapActivity: {\n timestamp: transformToDate,\n },\n BorrowSwapActivity: {\n timestamp: transformToDate,\n },\n RepayWithSupplyActivity: {\n timestamp: transformToDate,\n },\n WithdrawSwapActivity: {\n timestamp: transformToDate,\n },\n UserMerklClaimableReward: {\n startDate: transformToDate,\n endDate: transformToDate,\n claimUntil: transformToDate,\n },\n UserPosition: {\n createdAt: transformToDate,\n },\n UserBorrowItem: {\n createdAt: transformToNullableDate,\n },\n UserSupplyItem: {\n createdAt: transformToNullableDate,\n },\n SpokeUserPositionManager: {\n approvedOn: transformToDate,\n },\n SwapCancelled: {\n createdAt: transformToDate,\n cancelledAt: transformToNullableDate,\n },\n SwapCancelledResult: {\n createdAt: transformToDate,\n cancelledAt: transformToNullableDate,\n },\n SwapExpired: {\n createdAt: transformToDate,\n expiredAt: transformToDate,\n },\n SwapFulfilled: {\n createdAt: transformToDate,\n fulfilledAt: transformToDate,\n },\n SwapOpen: {\n createdAt: transformToDate,\n deadline: transformToDate,\n },\n SwapPendingSignature: {\n createdAt: transformToDate,\n deadline: transformToDate,\n },\n SwapReceipt: {\n createdAt: transformToDate,\n },\n StableVaultSummary: {\n shares: transformToBigInt,\n totalDeposits: transformToBigDecimal,\n userCount: transformToBigInt,\n },\n StableVaultWithdrawClaim: {\n executableAfter: transformToDate,\n },\n TokenMovementRecord: {\n timestamp: transformToDate,\n },\n StableVaultPendingAvailability: {\n executableAfter: transformToDate,\n },\n Query: {\n hub: (_, { request }: VariablesOf<typeof HubQuery>) => {\n if (isHubInputVariant(request.query)) {\n return {\n __typename: 'Hub',\n id: encodeHubId(request.query.hubInput),\n };\n }\n return {\n __typename: 'Hub',\n id: request.query.hubId,\n };\n },\n\n reserve: (_, { request }: VariablesOf<typeof ReserveQuery>) => {\n if (isReserveInputVariant(request.query)) {\n return {\n __typename: 'Reserve',\n id: encodeReserveId(request.query.reserveInput),\n };\n }\n return {\n __typename: 'Reserve',\n id: request.query.reserveId,\n };\n },\n\n userPosition: (_, { request }: VariablesOf<typeof UserPositionQuery>) => {\n if ('userSpoke' in request && request.userSpoke) {\n const { chainId, address } = decodeSpokeId(request.userSpoke.spoke);\n return {\n __typename: 'UserPosition',\n id: encodeUserPositionId({\n chainId,\n spoke: address,\n user: request.userSpoke.user,\n }),\n };\n }\n if ('id' in request && request.id) {\n return {\n __typename: 'UserPosition',\n id: request.id,\n };\n }\n return undefined;\n },\n\n activities: (\n _parent,\n args: VariablesOf<typeof ActivitiesQuery>,\n cache,\n ) => {\n // Bail out if not a txHash filter lookup\n if (!isTxHashInputVariant(args.request.query)) {\n return cache.resolve('Query', 'activities', args);\n }\n\n const { txHash, chainId } = args.request.query.txHash;\n\n // Collect all cached activities matching txHash\n const matches = cache\n .inspectFields('Query')\n .filter((f) => f.fieldName === 'activities')\n .reduce((set, f) => {\n const pageRef = cache.resolve('Query', f.fieldKey) as string | null;\n if (!pageRef) return set;\n\n const itemRefs = cache.resolve(pageRef, 'items') as string[] | null;\n if (!itemRefs) return set;\n\n for (const ref of itemRefs) {\n set.add(ref);\n }\n return set;\n }, new Set<string>())\n .values()\n .toArray()\n .filter((ref) => {\n const itemTxHash = cache.resolve(ref, 'txHash') as TxHash;\n if (itemTxHash !== txHash) return false;\n\n // Verify chainId via spoke.chain.chainId if present\n const spokeRef = cache.resolve(ref, 'spoke') as string | null;\n if (spokeRef) {\n const chainRef = cache.resolve(spokeRef, 'chain') as\n | string\n | null;\n const itemChainId = chainRef\n ? (cache.resolve(chainRef, 'chainId') as number | undefined)\n : undefined;\n if (typeof itemChainId === 'number') {\n return itemChainId === chainId;\n }\n }\n return true;\n });\n\n if (matches.length === 0) return undefined;\n\n return {\n __typename: 'PaginatedActivitiesResult',\n items: matches,\n pageInfo: {\n __typename: 'PaginatedResultInfo',\n prev: null,\n next: null,\n },\n };\n },\n },\n },\n keys: {\n // Entities with id field as key\n Asset: (data: Asset) => data.id,\n BorrowActivity: (data: BorrowActivity) => data.id,\n BorrowPointsReward: (data: BorrowPoints) => data.id,\n BorrowSwapActivity: (data: BorrowSwapActivity) => data.id,\n // URQL SystemFields & DataFields doesn't play ball with the bigint scalar (BoostedRate.userCounts field),\n // hence the type assertion to BoostedRateId which is a string alias of the id\n BoostedRate: (data) => data.id as BoostedRateId,\n Hub: (data: Hub) => data.id,\n HubAsset: (data: HubAsset) => data.id,\n LiquidatedActivity: (data: LiquidatedActivity) => data.id,\n MerklBorrowReward: (data: MerklBorrowReward) => data.id,\n MerklGenericCriteria: (data: MerklGenericCriteria) => data.id,\n MerklSupplyReward: (data: MerklSupplyReward) => data.id,\n PointsGenericCriteria: (data: PointsGenericCriteria) => data.id,\n PointsProgram: (data: PointsProgram) => data.id,\n RepayActivity: (data: RepayActivity) => data.id,\n RepayWithSupplyActivity: (data: RepayWithSupplyActivity) => data.id,\n Reserve: (data: Reserve) => data.id,\n ReserveInfo: (data: ReserveInfo) => data.id,\n Spoke: (data: Spoke) => data.id,\n StableVault: (data: StableVault) => data.id,\n StableVaultUserPosition: (data: StableVaultUserPosition) => data.id,\n SupplyActivity: (data: SupplyActivity) => data.id,\n SupplyPointsReward: (data: SupplyPoints) => data.id,\n SupplySwapActivity: (data: SupplySwapActivity) => data.id,\n TokenInfo: (data: TokenInfo) => data.id,\n TokenMovementRecord: (data: TokenMovementRecord) => data.id,\n TokenSwapActivity: (data: TokenSwapActivity) => data.id,\n UpdatedDynamicConfigActivity: (data: UpdatedDynamicConfigActivity) =>\n data.id,\n UpdatedRiskPremiumActivity: (data: UpdatedRiskPremiumActivity) => data.id,\n UserMerklClaimableReward: (data: UserMerklClaimableReward) => data.id,\n UserPosition: (data: UserPosition) => data.id,\n UsingAsCollateralActivity: (data: UsingAsCollateralActivity) => data.id,\n WithdrawActivity: (data: WithdrawActivity) => data.id,\n WithdrawSwapActivity: (data: WithdrawSwapActivity) => data.id,\n\n // Entities with address field as key\n Erc20Token: (data: Erc20Token) => data.address,\n\n // Entities with other fields as key\n Chain: (data: Chain) => data.chainId.toString(),\n NativeToken: (data: NativeToken) => data.chain.chainId.toString(),\n\n // Value objects and result types\n ApySample: () => null,\n AssetAmountWithChange: () => null,\n AssetBorrowSample: () => null,\n AssetPriceSample: () => null,\n AssetSampleBreakdown: () => null,\n AssetSummary: () => null,\n AssetSupplySample: () => null,\n BorrowSwap: () => null,\n BorrowSwapQuoteResult: () => null,\n CollateralFactorVariation: () => null,\n DecimalNumber: () => null,\n DecimalNumberWithChange: () => null,\n DomainData: () => null,\n Erc20Amount: () => null,\n Erc20Approval: () => null,\n Erc20ApprovalRequired: () => null,\n ExchangeAmount: () => null,\n ExchangeAmountVariation: () => null,\n ExchangeAmountWithChange: () => null,\n ForkTopUpResponse: () => null,\n HealthFactorError: () => null,\n HealthFactorVariation: () => null,\n HealthFactorWithChange: () => null,\n HubAssetInterestRateModelPoint: () => null,\n HubAssetInterestRateModelResult: () => null,\n HubAssetSettings: () => null,\n HubAssetSummary: () => null,\n HubAssetUserState: () => null,\n HubSummary: () => null,\n HubSummarySample: () => null,\n InsufficientBalanceError: () => null,\n InsufficientLiquidityError: () => null,\n LiquidationFeeVariation: () => null,\n MaxLiquidationBonusVariation: () => null,\n NativeAmount: () => null,\n PaginatedActivitiesResult: () => null,\n PaginatedResultInfo: () => null,\n PaginatedSpokePositionManagerResult: () => null,\n PaginatedSpokeUserPositionManagerResult: () => null,\n PaginatedStableVaultMovementsResult: () => null,\n PaginatedStableVaultRateUsersResult: () => null,\n PaginatedUserSwapsResult: () => null,\n PercentNumber: () => null,\n PercentNumberChangeSnapshot: () => null,\n PercentNumberVariation: () => null,\n PercentNumberWithChange: () => null,\n PermitTypedData: () => null,\n PositionAmount: () => null,\n PositionSwapAdapterContractApproval: () => null,\n PositionSwapByIntentApprovalsRequired: () => null,\n PositionSwapPositionManagerApproval: () => null,\n PreContractActionRequired: () => null,\n PrepareSwapCancelResult: () => null,\n PrepareSwapOrder: () => null,\n PreviewBorrowPointsReward: () => null,\n PreviewMerklBorrowReward: () => null,\n PreviewMerklSupplyReward: () => null,\n PreviewRewardOutcome: () => null,\n PreviewSupplyPointsReward: () => null,\n PreviewUserPosition: () => null,\n ProtocolHistorySample: () => null,\n RepayWithSupply: () => null,\n RepayWithSupplyQuoteResult: () => null,\n ReserveSettings: () => null,\n ReserveStatus: () => null,\n ReserveSummary: () => null,\n ReserveUserState: () => null,\n SpokePositionManager: () => null,\n SpokeUserPositionManager: () => null,\n StableVaultPendingAvailability: () => null,\n StableVaultRates: () => null,\n StableVaultSummary: () => null,\n StableVaultWithdrawClaim: () => null,\n SupplySwap: () => null,\n SupplySwapQuoteResult: () => null,\n SwapByIntent: () => null,\n SwapByIntentWithApprovalRequired: () => null,\n SwapByTransaction: () => null,\n SwapCancelled: () => null,\n SwapCancelledResult: () => null,\n SwapExpired: () => null,\n SwapFulfilled: () => null,\n SwapOpen: () => null,\n SwapPendingSignature: () => null,\n SwapQuote: () => null,\n SwapQuoteCosts: () => null,\n SwapReceipt: () => null,\n SwapTransactionRequest: () => null,\n SwapTypedData: () => null,\n TokenMovementAllocate: () => null,\n TokenMovementBridgeIn: () => null,\n TokenMovementBridgeOut: () => null,\n TokenMovementDeallocate: () => null,\n TokenMovementRebalance: () => null,\n TokenMovementSwap: () => null,\n TokenSwap: () => null,\n TokenSwapQuoteResult: () => null,\n TransactionRequest: () => null,\n UserBalance: () => null,\n UserBorrowItem: () => null,\n UserPositionRiskPremium: () => null,\n UserRiskPremiumBreakdownItem: () => null,\n UserSummary: () => null,\n UserSummaryHistoryItem: () => null,\n UserSupplyItem: () => null,\n WithdrawSwap: () => null,\n WithdrawSwapQuoteResult: () => null,\n },\n});\n","import type { EnvironmentConfig } from '@aave/core';\n\n/**\n * The production environment configuration.\n */\nexport const production: EnvironmentConfig = {\n name: 'production',\n backend: 'https://api.aave.com/graphql',\n indexingTimeout: 60_000,\n pollingInterval: 100,\n exchangeRateInterval: 10_000,\n swapQuoteInterval: 30_000,\n swapStatusInterval: 5_000,\n};\n\n/**\n * @internal\n */\nexport const staging: EnvironmentConfig = {\n name: 'staging',\n backend: 'https://api.staging.aave.com/graphql',\n indexingTimeout: 60_000,\n pollingInterval: 500,\n exchangeRateInterval: 10_000,\n swapQuoteInterval: 30_000,\n swapStatusInterval: 5_000,\n};\n\n/**\n * @internal\n */\nexport const local: EnvironmentConfig = {\n name: 'local',\n backend: 'http://localhost:3007/graphql',\n indexingTimeout: 60_000,\n pollingInterval: 1000,\n exchangeRateInterval: 10_000,\n swapQuoteInterval: 30_000,\n swapStatusInterval: 5_000,\n};\n","import type { Context } from '@aave/core';\nimport type { EnvironmentConfig } from '../../core/src/types';\nimport { exchange } from './cache';\nimport { production } from './environments';\n\n/**\n * The client configuration.\n */\nexport type ClientConfig = {\n /**\n * @internal\n * @defaultValue `production`\n */\n environment?: EnvironmentConfig;\n /**\n * @internal\n */\n headers?: Record<string, string>;\n /**\n * Whether to enable caching.\n *\n * @defaultValue `true`\n */\n cache?: boolean;\n /**\n * Whether to enable query batching.\n *\n * @defaultValue `true`\n */\n batch?: boolean;\n /**\n * Whether to enable debug mode.\n *\n * @defaultValue `false`\n */\n debug?: boolean;\n};\n\n/**\n * @internal\n */\nexport function configureContext({\n environment = production,\n headers,\n cache = true,\n batch = true,\n debug = false,\n}: ClientConfig): Context {\n return {\n displayName: 'AaveClient',\n environment,\n headers,\n cache: cache ? exchange : null,\n batch,\n debug,\n };\n}\n","import type {\n CancelError,\n SigningError,\n TransactionError,\n UnexpectedError,\n ValidationError,\n} from '@aave/core';\nimport type {\n ExecutionPlan,\n HasProcessedKnownTransactionRequest,\n InsufficientBalanceError,\n OperationType,\n PermitTypedData,\n SwapTypedData,\n} from '@aave/graphql';\nimport type { ResultAsync, Signature, TxHash } from '@aave/types';\n\n/**\n * @internal\n */\nexport type TransactionResult = {\n txHash: TxHash;\n operations: OperationType[] | null;\n};\n\n/**\n * @internal\n */\nexport function isHasProcessedKnownTransactionRequest(\n result: TransactionResult,\n): result is HasProcessedKnownTransactionRequest {\n return result.operations !== null && result.operations.length > 0;\n}\n\nexport type TransactionReceipt = {\n __typename: 'TransactionReceipt';\n txHash: TxHash;\n};\n\n/**\n * @internal\n */\nexport function transactionReceipt(txHash: TxHash): TransactionReceipt {\n return { __typename: 'TransactionReceipt', txHash };\n}\n\nexport type SendWithError =\n | CancelError\n | SigningError\n | TransactionError\n | ValidationError<InsufficientBalanceError>\n | UnexpectedError;\n\nexport type ExecutionPlanHandler<T extends ExecutionPlan = ExecutionPlan> = (\n result: T,\n) => ResultAsync<TransactionResult, SendWithError>;\n\nexport type SignTypedDataError = CancelError | SigningError;\n\n/**\n * Union type for all EIP-712 typed data structures used in the SDK.\n */\nexport type TypedData = PermitTypedData | SwapTypedData;\n\nexport type TypedDataHandler = (\n data: TypedData,\n) => ResultAsync<Signature, SignTypedDataError>;\n","import { delay, GqlClient, TimeoutError, UnexpectedError } from '@aave/core';\nimport type { HasProcessedKnownTransactionRequest } from '@aave/graphql';\nimport { invariant, ResultAsync } from '@aave/types';\nimport { hasProcessedKnownTransaction } from './actions';\nimport { type ClientConfig, configureContext } from './config';\nimport {\n isHasProcessedKnownTransactionRequest,\n type TransactionReceipt,\n type TransactionResult,\n transactionReceipt,\n} from './types';\n\nexport class AaveClient extends GqlClient {\n /**\n * Create a new instance of the {@link AaveClient}.\n *\n * ```ts\n * const client = AaveClient.create({\n * environment: production,\n * });\n * ```\n *\n * @param options - The options to configure the client.\n * @returns The new instance of the client.\n */\n static create(options?: ClientConfig): AaveClient {\n return new AaveClient(configureContext(options ?? {}));\n }\n\n /**\n * Given the transaction hash of an Aave protocol transaction, wait for the transaction to be\n * processed by the Aave v4 API.\n *\n * Returns a {@link TimeoutError} if the transaction is not processed within the expected timeout period.\n *\n * @param result - The transaction execution result to wait for.\n * @returns The {@link TransactionReceipt} or a error\n */\n readonly waitForTransaction = (\n result: TransactionResult,\n ): ResultAsync<TransactionReceipt, TimeoutError | UnexpectedError> => {\n invariant(\n isHasProcessedKnownTransactionRequest(result),\n 'AaveClient.waitForTransaction called with an non-tracked operation. See the documentation for correct tracking setup.',\n );\n\n return ResultAsync.fromPromise(\n this.pollTransactionStatus(result),\n (err) => {\n if (err instanceof TimeoutError || err instanceof UnexpectedError) {\n return err;\n }\n return UnexpectedError.from(err);\n },\n );\n };\n\n protected async pollTransactionStatus(\n request: HasProcessedKnownTransactionRequest,\n ): Promise<TransactionReceipt> {\n const startedAt = Date.now();\n\n while (Date.now() - startedAt < this.context.environment.indexingTimeout) {\n const processed = await hasProcessedKnownTransaction(this, request).match(\n (ok) => ok,\n (err) => {\n throw err;\n },\n );\n\n if (processed) {\n return transactionReceipt(request.txHash);\n }\n\n await delay(this.context.environment.pollingInterval);\n }\n throw TimeoutError.from(\n `Timeout waiting for transaction ${request.txHash} to be processed.`,\n );\n }\n}\n"]}
package/dist/privy.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { ExecutionPlan, ERC20PermitSignature } from '@aave/graphql';
1
+ import { ERC20PermitSignature, ExecutionPlan } from '@aave/graphql';
2
2
  import { ResultAsync } from '@aave/types';
3
3
  import { PrivyClient } from '@privy-io/server-auth';
4
- import { E as ExecutionPlanHandler, S as SignTypedDataError, a as TypedDataHandler, b as TypedData } from './types-BzGr7R2Y.cjs';
4
+ import { S as SignTypedDataError, E as ExecutionPlanHandler, T as TypedDataHandler, a as TypedData } from './types-XProSTZ7.cjs';
5
5
  import '@aave/core';
6
6
 
7
7
  /**
package/dist/privy.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ExecutionPlan, ERC20PermitSignature } from '@aave/graphql';
1
+ import { ERC20PermitSignature, ExecutionPlan } from '@aave/graphql';
2
2
  import { ResultAsync } from '@aave/types';
3
3
  import { PrivyClient } from '@privy-io/server-auth';
4
- import { E as ExecutionPlanHandler, S as SignTypedDataError, a as TypedDataHandler, b as TypedData } from './types-BzGr7R2Y.js';
4
+ import { S as SignTypedDataError, E as ExecutionPlanHandler, T as TypedDataHandler, a as TypedData } from './types-XProSTZ7.js';
5
5
  import '@aave/core';
6
6
 
7
7
  /**
package/dist/privy.js CHANGED
@@ -1,2 +1,2 @@
1
- import {e}from'./chunk-CMTDTGTS.js';import {a}from'./chunk-N4LXBTGY.js';import'./chunk-RM3HEVPN.js';import {ValidationError,SigningError,UnexpectedError}from'@aave/core';import {okAsync,signatureFrom,errAsync,ResultAsync,txHash}from'@aave/types';import {extractChain,createPublicClient,http}from'viem';import {waitForTransactionReceipt}from'viem/actions';import*as R from'viem/chains';var D=Object.values(R);async function H(e,n,t){let{hash:r}=await e.walletApi.ethereum.sendTransaction({walletId:t,caip2:`eip155:${n.chainId}`,transaction:{from:n.from,to:n.to,value:`0x${BigInt(n.value).toString(16)}`,chainId:n.chainId,data:n.data}});return txHash(r)}function o(e$1,n,t){let r=extractChain({chains:D,id:n.chainId}),i=createPublicClient({chain:r,transport:http()});return ResultAsync.fromPromise(H(e$1,n,t),a=>SigningError.from(a)).andThen(a=>ResultAsync.fromPromise(waitForTransactionReceipt(i,{hash:a,pollingInterval:100,retryCount:20,retryDelay:50}),s=>UnexpectedError.from(s))).andThen(a=>{let s=txHash(a.transactionHash);return a.status==="reverted"?errAsync(e(r,s,n)):okAsync({txHash:s,operations:n.operations})})}function y(e,n,t){switch(t.__typename){case "TransactionRequest":return o(e,t,n);case "Erc20ApprovalRequired":return t.approvals.reduce((r,i)=>r.andThen(()=>o(e,i.byTransaction,n)),okAsync(void 0)).andThen(()=>o(e,t.originalTransaction,n));case "PreContractActionRequired":return o(e,t.transaction,n).andThen(()=>o(e,t.originalTransaction,n));case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t))}}function F(e,n,t){return t?y(e,n,t):y.bind(null,e,n)}function U(e,n,t){return t().andThen(r=>{if(a(r)){let i=r.approvals[0].bySignature;return A(e,n,i).map(a=>({deadline:i.message.deadline,value:a})).andThen(a=>t(a))}return okAsync(r)})}function T(e,n,t){return ResultAsync.fromPromise(e.walletApi.ethereum.signTypedData({walletId:n,typedData:{domain:t.domain,types:t.types,message:t.message,primaryType:t.primaryType}}),r=>SigningError.from(r)).map(r=>r.signature)}function A(e,n,t){return t===void 0?r=>T(e,n,r).map(signatureFrom):T(e,n,t).map(signatureFrom)}export{U as permitWith,F as sendWith,A as signTypedDataWith};//# sourceMappingURL=privy.js.map
1
+ import {e}from'./chunk-7THMGPSC.js';import {a}from'./chunk-N4LXBTGY.js';import'./chunk-LCNG3LBO.js';import {ValidationError,SigningError,UnexpectedError}from'@aave/core';import {okAsync,signatureFrom,errAsync,ResultAsync,txHash}from'@aave/types';import {extractChain,createPublicClient,http}from'viem';import {waitForTransactionReceipt}from'viem/actions';import*as R from'viem/chains';var D=Object.values(R);async function H(e,n,t){let{hash:r}=await e.walletApi.ethereum.sendTransaction({walletId:t,caip2:`eip155:${n.chainId}`,transaction:{from:n.from,to:n.to,value:`0x${BigInt(n.value).toString(16)}`,chainId:n.chainId,data:n.data}});return txHash(r)}function o(e$1,n,t){let r=extractChain({chains:D,id:n.chainId}),i=createPublicClient({chain:r,transport:http()});return ResultAsync.fromPromise(H(e$1,n,t),a=>SigningError.from(a)).andThen(a=>ResultAsync.fromPromise(waitForTransactionReceipt(i,{hash:a,pollingInterval:100,retryCount:20,retryDelay:50}),s=>UnexpectedError.from(s))).andThen(a=>{let s=txHash(a.transactionHash);return a.status==="reverted"?errAsync(e(r,s,n)):okAsync({txHash:s,operations:n.operations})})}function y(e,n,t){switch(t.__typename){case "TransactionRequest":return o(e,t,n);case "Erc20ApprovalRequired":return t.approvals.reduce((r,i)=>r.andThen(()=>o(e,i.byTransaction,n)),okAsync(void 0)).andThen(()=>o(e,t.originalTransaction,n));case "PreContractActionRequired":return o(e,t.transaction,n).andThen(()=>o(e,t.originalTransaction,n));case "InsufficientBalanceError":return errAsync(ValidationError.fromGqlNode(t))}}function F(e,n,t){return t?y(e,n,t):y.bind(null,e,n)}function U(e,n,t){return t().andThen(r=>{if(a(r)){let i=r.approvals[0].bySignature;return A(e,n,i).map(a=>({deadline:i.message.deadline,value:a})).andThen(a=>t(a))}return okAsync(r)})}function T(e,n,t){return ResultAsync.fromPromise(e.walletApi.ethereum.signTypedData({walletId:n,typedData:{domain:t.domain,types:t.types,message:t.message,primaryType:t.primaryType}}),r=>SigningError.from(r)).map(r=>r.signature)}function A(e,n,t){return t===void 0?r=>T(e,n,r).map(signatureFrom):T(e,n,t).map(signatureFrom)}export{U as permitWith,F as sendWith,A as signTypedDataWith};//# sourceMappingURL=privy.js.map
2
2
  //# sourceMappingURL=privy.js.map
package/dist/testing.d.ts CHANGED
@@ -9,7 +9,7 @@ import { Chain, Account, WalletClient, Transport } from 'viem';
9
9
  import * as _aave_graphql from '@aave/graphql';
10
10
  import { OperationType, HasProcessedKnownTransactionRequest } from '@aave/graphql';
11
11
  import * as _aave_types from '@aave/types';
12
- import { TxHash, ResultAsync, EvmAddress, BigDecimal, HexString } from '@aave/types';
12
+ import { TxHash, ResultAsync, EvmAddress, HexString, BigDecimal } from '@aave/types';
13
13
  import * as _aave_core from '@aave/core';
14
14
  import { GqlClient, TimeoutError, UnexpectedError } from '@aave/core';
15
15
  import { Eip1193Provider } from 'ethers';