@aave/client 4.0.0-next.5 → 4.0.0-next.7

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.
@@ -1,9 +1,11 @@
1
+ import * as msw_node from 'msw/node';
1
2
  import * as _aave_graphql from '@aave/graphql';
2
3
  import { OperationType, HasProcessedKnownTransactionRequest } from '@aave/graphql';
3
4
  import * as _aave_types from '@aave/types';
4
- import { TxHash, ResultAsync, AnyVariables, EvmAddress, BigDecimal } from '@aave/types';
5
+ import { TxHash, ResultAsync, AnyVariables, EvmAddress, BigDecimal, HexString } from '@aave/types';
5
6
  import * as _aave_core from '@aave/core';
6
7
  import { GqlClient, TimeoutError, UnexpectedError, StandardData, GraphQLErrorCode } from '@aave/core';
8
+ import { Eip1193Provider } from 'ethers';
7
9
  import { WalletClient, Transport, Chain, Account } from 'viem';
8
10
  import { TypedDocumentNode } from '@urql/core';
9
11
 
@@ -128,5 +130,69 @@ declare function createGraphQLErrorObject(code: GraphQLErrorCode): {
128
130
  declare function wait(ms: number): Promise<unknown>;
129
131
  declare function getBalance(address: EvmAddress, tokenAddress: EvmAddress): Promise<BigDecimal>;
130
132
  declare function getNativeBalance(address: EvmAddress): Promise<BigDecimal>;
133
+ type JsonRpcId = number | string | null;
134
+ interface JsonRpcRequest<M extends string, P = unknown> {
135
+ jsonrpc: '2.0';
136
+ id: JsonRpcId;
137
+ method: M;
138
+ params: P;
139
+ }
140
+ interface JsonRpcSuccess<T = unknown> {
141
+ jsonrpc: '2.0';
142
+ id: JsonRpcId;
143
+ result: T;
144
+ }
145
+ interface JsonRpcError<E = unknown> {
146
+ jsonrpc: '2.0';
147
+ id: JsonRpcId;
148
+ error: {
149
+ code: number;
150
+ message: string;
151
+ data?: E;
152
+ };
153
+ }
154
+ type JsonRpcResponse<T = unknown, E = unknown> = JsonRpcSuccess<T> | JsonRpcError<E>;
155
+ type AnyOtherJsonRpcRequest = JsonRpcRequest<'__ANY_METHOD__'>;
156
+ type EthChainIdRequest = JsonRpcRequest<'eth_chainId', []>;
157
+ type WalletSwitchEthereumChainRequest = JsonRpcRequest<'wallet_switchEthereumChain', [
158
+ {
159
+ chainId: HexString;
160
+ }
161
+ ]>;
162
+ type WalletAddEthereumChainRequest = JsonRpcRequest<'wallet_addEthereumChain', [
163
+ {
164
+ chainId: HexString;
165
+ chainName?: string;
166
+ nativeCurrency?: {
167
+ name: string;
168
+ symbol: string;
169
+ decimals: number;
170
+ };
171
+ rpcUrls?: string[];
172
+ blockExplorerUrls?: string[];
173
+ iconUrls?: string[];
174
+ }
175
+ ]>;
176
+ type EthSendTransactionParams = {
177
+ from: HexString;
178
+ to?: HexString;
179
+ gas?: HexString;
180
+ gasPrice?: HexString;
181
+ maxFeePerGas?: HexString;
182
+ maxPriorityFeePerGas?: HexString;
183
+ value?: HexString;
184
+ data?: HexString;
185
+ nonce?: HexString;
186
+ type?: string | number;
187
+ };
188
+ type EthSendTransactionRequest = JsonRpcRequest<'eth_sendTransaction', [
189
+ EthSendTransactionParams
190
+ ]>;
191
+ type EthAccountsRequest = JsonRpcRequest<'eth_accounts', []>;
192
+ type SupportedJsonRpcRequest = EthChainIdRequest | EthAccountsRequest | WalletSwitchEthereumChainRequest | WalletAddEthereumChainRequest | EthSendTransactionRequest | AnyOtherJsonRpcRequest;
193
+ type SupportedJsonRpcBatchRequest = SupportedJsonRpcRequest[];
194
+ declare function setupRpcInterceptor(handler: (body: SupportedJsonRpcRequest) => JsonRpcResponse | undefined): msw_node.SetupServerApi;
195
+ type Eip1193Handler = (request: SupportedJsonRpcRequest) => JsonRpcResponse | undefined;
196
+ declare function setupEip1193Interceptor(handler: Eip1193Handler): Eip1193Provider;
131
197
 
132
- export { ETHEREUM_1INCH_ADDRESS, ETHEREUM_FORK_ID, ETHEREUM_FORK_RPC_URL, ETHEREUM_FORK_RPC_URL_ADMIN, ETHEREUM_GHO_ADDRESS, ETHEREUM_HUB_CORE_ADDRESS, ETHEREUM_HUB_CORE_ID, ETHEREUM_SPOKE_CORE_ADDRESS, ETHEREUM_SPOKE_CORE_ID, ETHEREUM_SPOKE_ETHENA_ADDRESS, ETHEREUM_SPOKE_ETHENA_ID, ETHEREUM_SPOKE_FRONTIER_ADDRESS, ETHEREUM_SPOKE_ISO_STABLE_ID, ETHEREUM_SPOKE_LST_ADDRESS, ETHEREUM_USDC_ADDRESS, ETHEREUM_USDS_ADDRESS, ETHEREUM_WETH_ADDRESS, ETHEREUM_WSTETH_ADDRESS, client, createGraphQLErrorObject, createNewWallet, environment, fundErc20Address, fundNativeAddress, getBalance, getNativeBalance, wait };
198
+ export { type AnyOtherJsonRpcRequest, ETHEREUM_1INCH_ADDRESS, ETHEREUM_FORK_ID, ETHEREUM_FORK_RPC_URL, ETHEREUM_FORK_RPC_URL_ADMIN, ETHEREUM_GHO_ADDRESS, ETHEREUM_HUB_CORE_ADDRESS, ETHEREUM_HUB_CORE_ID, ETHEREUM_SPOKE_CORE_ADDRESS, ETHEREUM_SPOKE_CORE_ID, ETHEREUM_SPOKE_ETHENA_ADDRESS, ETHEREUM_SPOKE_ETHENA_ID, ETHEREUM_SPOKE_FRONTIER_ADDRESS, ETHEREUM_SPOKE_ISO_STABLE_ID, ETHEREUM_SPOKE_LST_ADDRESS, ETHEREUM_USDC_ADDRESS, ETHEREUM_USDS_ADDRESS, ETHEREUM_WETH_ADDRESS, ETHEREUM_WSTETH_ADDRESS, type Eip1193Handler, type EthAccountsRequest, type EthChainIdRequest, type EthSendTransactionParams, type EthSendTransactionRequest, type JsonRpcError, type JsonRpcId, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccess, type SupportedJsonRpcBatchRequest, type SupportedJsonRpcRequest, type WalletAddEthereumChainRequest, type WalletSwitchEthereumChainRequest, client, createGraphQLErrorObject, createNewWallet, environment, fundErc20Address, fundNativeAddress, getBalance, getNativeBalance, setupEip1193Interceptor, setupRpcInterceptor, wait };