@aave/react 4.0.0-next.30 → 4.0.0-next.31
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/{chunk-LBLCOU6O.js → chunk-5DRHIJI2.js} +2 -2
- package/dist/{chunk-LBLCOU6O.js.map → chunk-5DRHIJI2.js.map} +1 -1
- package/dist/{chunk-VGAHEW5B.js → chunk-SOTTMX3H.js} +2 -2
- package/dist/{chunk-VGAHEW5B.js.map → chunk-SOTTMX3H.js.map} +1 -1
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +1 -1
- package/dist/ethers.d.ts +1 -1
- package/dist/ethers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -39
- package/dist/index.d.ts +34 -39
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{misc-DP6al_6P.d.cts → misc-Dv6nwSVM.d.cts} +1 -1
- package/dist/{misc-C2MMWDjq.d.ts → misc-FhyRRjuS.d.ts} +1 -1
- package/dist/privy.cjs.map +1 -1
- package/dist/privy.d.cts +1 -1
- package/dist/privy.d.ts +1 -1
- package/dist/privy.js +1 -1
- package/dist/thirdweb.cjs.map +1 -1
- package/dist/thirdweb.d.cts +1 -1
- package/dist/thirdweb.d.ts +1 -1
- package/dist/thirdweb.js +1 -1
- package/dist/viem/index.cjs +1 -1
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +2 -2
- package/dist/viem/index.d.ts +2 -2
- package/dist/viem/index.js +1 -1
- package/dist/{writes-CqRSU8Ho.d.cts → writes-XDyuot3t.d.cts} +3 -3
- package/dist/{writes-CqRSU8Ho.d.ts → writes-XDyuot3t.d.ts} +3 -3
- package/package.json +4 -4
package/dist/viem/index.d.cts
CHANGED
|
@@ -2,8 +2,8 @@ export { viemChainsFrom } from '@aave/client/viem';
|
|
|
2
2
|
import { TypedData, SignTypedDataError } from '@aave/client';
|
|
3
3
|
import { Signature } from '@aave/types';
|
|
4
4
|
import { WalletClient } from 'viem';
|
|
5
|
-
import { U as UseSendTransactionResult, a as UseAsyncTask } from '../writes-
|
|
6
|
-
import { U as UseNetworkFee } from '../misc-
|
|
5
|
+
import { U as UseSendTransactionResult, a as UseAsyncTask } from '../writes-XDyuot3t.cjs';
|
|
6
|
+
import { U as UseNetworkFee } from '../misc-Dv6nwSVM.cjs';
|
|
7
7
|
import '@aave/core';
|
|
8
8
|
import '@aave/graphql';
|
|
9
9
|
|
package/dist/viem/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export { viemChainsFrom } from '@aave/client/viem';
|
|
|
2
2
|
import { TypedData, SignTypedDataError } from '@aave/client';
|
|
3
3
|
import { Signature } from '@aave/types';
|
|
4
4
|
import { WalletClient } from 'viem';
|
|
5
|
-
import { U as UseSendTransactionResult, a as UseAsyncTask } from '../writes-
|
|
6
|
-
import { U as UseNetworkFee } from '../misc-
|
|
5
|
+
import { U as UseSendTransactionResult, a as UseAsyncTask } from '../writes-XDyuot3t.js';
|
|
6
|
+
import { U as UseNetworkFee } from '../misc-FhyRRjuS.js';
|
|
7
7
|
import '@aave/core';
|
|
8
8
|
import '@aave/graphql';
|
|
9
9
|
|
package/dist/viem/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {g as g$1,a as a$1}from'../chunk-
|
|
1
|
+
import {g as g$1,a as a$1}from'../chunk-5DRHIJI2.js';import {b}from'../chunk-4NA4FB6K.js';import {a,c}from'../chunk-SOTTMX3H.js';import {ensureChain,sendTransaction,waitForTransactionResult,signTypedDataWith,toViemChain}from'@aave/client/viem';export{viemChainsFrom}from'@aave/client/viem';import {invariant,never,ResultAsync,okAsync,bigDecimal,RoundingMode,nonNullable}from'@aave/types';import {UnexpectedError}from'@aave/client';import {chain}from'@aave/client/actions';import {Currency,decodeReserveId,decodeUserPositionId}from'@aave/graphql';import {useEffect}from'react';import {createPublicClient,http}from'viem';function $(e){let t=b();return a(n=>(invariant(e,"Expected a WalletClient to handle the operation result."),ensureChain(t,e,n).andThen(()=>sendTransaction(e,n)).map(a=>new c(()=>waitForTransactionResult(e,n,a)))),[t,e])}function z(e){return a(t=>(invariant(e,"Expected a WalletClient to sign typed data"),signTypedDataWith(e,t)),[e])}var v=55558n,W={supply:132136n+v,borrow:250551n,withdraw:195049n,repay:217889n+v,setUserSuppliesAsCollateral:240284n,updateUserPositionConditions:280000n};function Q(e){let t=Object.keys(e)[0];return W[t]??never(`Expected gas estimate for action ${t}`)}function A(e){if("supply"in e)return decodeReserveId(e.supply.reserve).chainId;if("borrow"in e)return decodeReserveId(e.borrow.reserve).chainId;if("withdraw"in e)return decodeReserveId(e.withdraw.reserve).chainId;if("repay"in e)return decodeReserveId(e.repay.reserve).chainId;if("setUserSuppliesAsCollateral"in e)return e.setUserSuppliesAsCollateral.changes.map(({reserve:t})=>decodeReserveId(t)).reduce((t,n)=>(invariant(t.chainId===n.chainId&&t.spoke===n.spoke,"All reserves MUST on the same spoke"),t)).chainId;if("updateUserPositionConditions"in e)return decodeUserPositionId(e.updateUserPositionConditions.userPositionId).chainId;never("Expected reserve id");}function G(e){if("activity"in e&&e.activity)return e.activity.chain.chainId;if("estimate"in e&&e.estimate)return A(e.estimate)}function V(e){if("activity"in e&&e.activity)return e.activity.timestamp}function L(e,t){return "activity"in t&&t.activity?okAsync(t.activity.chain):"estimate"in t&&t.estimate?chain(e,{chainId:A(t.estimate)}).map(nonNullable):never("Expected chain")}function M(){let e=b();return a(t=>L(e,t).andThen(n=>{let a=createPublicClient({chain:toViemChain(n),transport:http()});return "activity"in t?ResultAsync.fromPromise(a.getTransactionReceipt({hash:t.activity.txHash}),i=>UnexpectedError.from(i)).map(i=>({chain:t.activity.chain,gasPrice:i.effectiveGasPrice,gasUnits:i.gasUsed})):"estimate"in t&&t.estimate?ResultAsync.fromPromise(a.estimateFeesPerGas(),i=>UnexpectedError.from(i)).map(({maxFeePerGas:i})=>({chain:n,gasPrice:i,gasUnits:Q(t.estimate)})):okAsync({chain:never("Expected chain"),gasPrice:0n,gasUnits:0n})}),[e])}function g(e,t){let n=e.gasPrice*e.gasUnits,a=bigDecimal(n).rescale(-e.chain.nativeInfo.decimals),i={__typename:"DecimalNumber",decimals:e.chain.nativeInfo.decimals,onChainValue:n,value:a};return {__typename:"NativeAmount",token:{__typename:"NativeToken",info:e.chain.nativeInfo,chain:e.chain},amount:i,exchange:{__typename:"ExchangeAmount",value:a.mul(t.value),name:t.name,symbol:t.symbol,icon:t.icon,decimals:t.decimals},exchangeRate:{__typename:"DecimalNumber",decimals:2,onChainValue:BigInt(t.value.rescale(2).toFixed(0,RoundingMode.Down)),value:t.value}}}var re=(({query:e,currency:t=Currency.Usd,pause:n=false,suspense:a=false})=>{let[i,r]=M(),s=g$1({from:{native:G(e)},to:t,at:V(e),pause:n,...a?{suspense:a}:{}});return useEffect(()=>{n||r.called||!e||i(e);},[i,n,r.called]),s.paused?a$1.Paused(r.data&&s.data?g(r.data,s.data):void 0,s.error?s.error:void 0):!r.called||r.loading||s.loading?a$1.Loading():r.error||s.error?a$1.Failure(r.error??s.error??never("Unknown error")):(invariant(r.data&&s.data,"Expected receipt, chain, and rate data"),a$1.Success(g(r.data,s.data)))});export{re as useNetworkFee,$ as useSendTransaction,z as useSignTypedData};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionResult } from '@aave/client';
|
|
2
2
|
import { CancelError, TimeoutError, TransactionError, UnexpectedError, SigningError } from '@aave/core';
|
|
3
|
-
import { TransactionRequest
|
|
3
|
+
import { TransactionRequest } from '@aave/graphql';
|
|
4
4
|
import { ResultAsync, Signature } from '@aave/types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -122,6 +122,6 @@ type UseSendTransactionResult = UseAsyncTask<TransactionRequest, PendingTransact
|
|
|
122
122
|
/**
|
|
123
123
|
* The Aave execution plan handler
|
|
124
124
|
*/
|
|
125
|
-
type
|
|
125
|
+
type ExecutionPlanHandler<T, R extends Signature | PendingTransaction> = (plan: T, options: TransactionHandlerOptions) => ResultAsync<R, SendTransactionError>;
|
|
126
126
|
|
|
127
|
-
export { type AsyncTaskError as A, type CancelOperation as C, PendingTransaction as P, type SendTransactionError as S, type
|
|
127
|
+
export { type AsyncTaskError as A, type CancelOperation as C, type ExecutionPlanHandler as E, PendingTransaction as P, type SendTransactionError as S, type TransactionHandlerOptions as T, type UseSendTransactionResult as U, type UseAsyncTask as a, type PendingTransactionError as b, type AsyncTaskIdle as c, type AsyncTaskLoading as d, type AsyncTaskState as e, type AsyncTaskSuccess as f };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionResult } from '@aave/client';
|
|
2
2
|
import { CancelError, TimeoutError, TransactionError, UnexpectedError, SigningError } from '@aave/core';
|
|
3
|
-
import { TransactionRequest
|
|
3
|
+
import { TransactionRequest } from '@aave/graphql';
|
|
4
4
|
import { ResultAsync, Signature } from '@aave/types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -122,6 +122,6 @@ type UseSendTransactionResult = UseAsyncTask<TransactionRequest, PendingTransact
|
|
|
122
122
|
/**
|
|
123
123
|
* The Aave execution plan handler
|
|
124
124
|
*/
|
|
125
|
-
type
|
|
125
|
+
type ExecutionPlanHandler<T, R extends Signature | PendingTransaction> = (plan: T, options: TransactionHandlerOptions) => ResultAsync<R, SendTransactionError>;
|
|
126
126
|
|
|
127
|
-
export { type AsyncTaskError as A, type CancelOperation as C, PendingTransaction as P, type SendTransactionError as S, type
|
|
127
|
+
export { type AsyncTaskError as A, type CancelOperation as C, type ExecutionPlanHandler as E, PendingTransaction as P, type SendTransactionError as S, type TransactionHandlerOptions as T, type UseSendTransactionResult as U, type UseAsyncTask as a, type PendingTransactionError as b, type AsyncTaskIdle as c, type AsyncTaskLoading as d, type AsyncTaskState as e, type AsyncTaskSuccess as f };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aave/react",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.31",
|
|
4
4
|
"description": "The official React bindings for the Aave Protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aave",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"sideEffects": false,
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"urql": "^5.0.1",
|
|
75
|
-
"@aave/client": "4.0.0-next.
|
|
75
|
+
"@aave/client": "4.0.0-next.31",
|
|
76
|
+
"@aave/graphql": "1.0.0-next.25",
|
|
76
77
|
"@aave/types": "1.0.0-next.7",
|
|
77
|
-
"@aave/core": "1.0.0-next.12"
|
|
78
|
-
"@aave/graphql": "1.0.0-next.25"
|
|
78
|
+
"@aave/core": "1.0.0-next.12"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@privy-io/react-auth": "^2.20.0",
|