aave-v3-react
Version:
A collection of React hooks to interact with the Aave V3 pools and smart contracts.
1,357 lines (1,355 loc) • 81.6 kB
TypeScript
import * as _tanstack_react_query from '@tanstack/react-query';
import * as _aave_contract_helpers from '@aave/contract-helpers';
import { ReservesDataHumanized, ReserveDataHumanized, ReservesIncentiveDataHumanized, UserReserveDataHumanized, InterestRate } from '@aave/contract-helpers';
import * as _aave_math_utils from '@aave/math-utils';
import { FormatReserveUSDResponse, FormatUserSummaryResponse } from '@aave/math-utils';
import { LPSupplyParamsType, LPWithdrawParamsType, LPRepayParamsType, LPBorrowParamsType, LPSignERC20ApprovalType, LPSupplyWithPermitType, LPRepayWithPermitParamsType, LPSetUsageAsCollateral } from '@aave/contract-helpers/dist/esm/v3-pool-contract/lendingPoolTypes';
import * as viem from 'viem';
import { WalletClient } from 'viem';
import { providers } from 'ethers';
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as viem_chains from 'viem/chains';
import { AaveV3BNB, AaveV3Sepolia, AaveV3Ethereum, AaveV3Arbitrum, AaveV3ArbitrumSepolia, AaveV3Avalanche, AaveV3Base, AaveV3BaseSepolia, AaveV3Gnosis, AaveV3Polygon, AaveV3Optimism, AaveV3OptimismSepolia, AaveV3Scroll, AaveV3ScrollSepolia, AaveV3Linea, AaveV3Mantle, AaveV3ZkSync } from '@bgd-labs/aave-address-book';
declare const supportedNetworks: ({
blockExplorers: {
readonly default: {
readonly name: "Etherscan";
readonly url: "https://sepolia.etherscan.io";
readonly apiUrl: "https://api-sepolia.etherscan.io/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 751532;
};
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC";
readonly blockCreated: 5317080;
};
};
id: 11155111;
name: "Sepolia";
nativeCurrency: {
readonly name: "Sepolia Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://sepolia.drpc.org"];
};
};
sourceId?: number | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Etherscan";
readonly url: "https://etherscan.io";
readonly apiUrl: "https://api.etherscan.io/api";
};
};
contracts: {
readonly ensRegistry: {
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
};
readonly ensUniversalResolver: {
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
readonly blockCreated: 19258213;
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 14353601;
};
};
id: 1;
name: "Ethereum";
nativeCurrency: {
readonly name: "Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://eth.merkle.io"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Arbiscan";
readonly url: "https://arbiscan.io";
readonly apiUrl: "https://api.arbiscan.io/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 7654707;
};
};
id: 42161;
name: "Arbitrum One";
nativeCurrency: {
readonly name: "Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Arbiscan";
readonly url: "https://sepolia.arbiscan.io";
readonly apiUrl: "https://api-sepolia.arbiscan.io/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 81930;
};
};
id: 421614;
name: "Arbitrum Sepolia";
nativeCurrency: {
readonly name: "Arbitrum Sepolia Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://sepolia-rollup.arbitrum.io/rpc"];
};
};
sourceId?: number | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "SnowTrace";
readonly url: "https://snowtrace.io";
readonly apiUrl: "https://api.snowtrace.io";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 11907934;
};
};
id: 43114;
name: "Avalanche";
nativeCurrency: {
readonly decimals: 18;
readonly name: "Avalanche";
readonly symbol: "AVAX";
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://api.avax.network/ext/bc/C/rpc"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Basescan";
readonly url: "https://basescan.org";
readonly apiUrl: "https://api.basescan.org/api";
};
};
contracts: {
readonly disputeGameFactory: {
readonly 1: {
readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
};
};
readonly l2OutputOracle: {
readonly 1: {
readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
};
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 5022;
};
readonly portal: {
readonly 1: {
readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
readonly blockCreated: 17482143;
};
};
readonly l1StandardBridge: {
readonly 1: {
readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
readonly blockCreated: 17482143;
};
};
readonly gasPriceOracle: {
readonly address: "0x420000000000000000000000000000000000000F";
};
readonly l1Block: {
readonly address: "0x4200000000000000000000000000000000000015";
};
readonly l2CrossDomainMessenger: {
readonly address: "0x4200000000000000000000000000000000000007";
};
readonly l2Erc721Bridge: {
readonly address: "0x4200000000000000000000000000000000000014";
};
readonly l2StandardBridge: {
readonly address: "0x4200000000000000000000000000000000000010";
};
readonly l2ToL1MessagePasser: {
readonly address: "0x4200000000000000000000000000000000000016";
};
};
id: 8453;
name: "Base";
nativeCurrency: {
readonly name: "Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://mainnet.base.org"];
};
};
sourceId: 1;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters: {
readonly block: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcBlock<viem.BlockTag, boolean>) => {
baseFeePerGas: bigint | null;
blobGasUsed: bigint;
difficulty: bigint;
excessBlobGas: bigint;
extraData: `0x${string}`;
gasLimit: bigint;
gasUsed: bigint;
hash: `0x${string}` | null;
logsBloom: `0x${string}` | null;
miner: `0x${string}`;
mixHash: `0x${string}`;
nonce: `0x${string}` | null;
number: bigint | null;
parentBeaconBlockRoot?: `0x${string}` | undefined;
parentHash: `0x${string}`;
receiptsRoot: `0x${string}`;
sealFields: `0x${string}`[];
sha3Uncles: `0x${string}`;
size: bigint;
stateRoot: `0x${string}`;
timestamp: bigint;
totalDifficulty: bigint | null;
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
transactionsRoot: `0x${string}`;
uncles: `0x${string}`[];
withdrawals?: viem.Withdrawal[] | undefined;
withdrawalsRoot?: `0x${string}` | undefined;
};
type: "block";
};
readonly transaction: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcTransaction<boolean>) => {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: boolean | undefined;
mint?: bigint | undefined;
sourceHash: `0x${string}`;
type: "deposit";
} | {
r: `0x${string}`;
s: `0x${string}`;
v: bigint;
to: `0x${string}` | null;
from: `0x${string}`;
gas: bigint;
nonce: number;
value: bigint;
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
hash: `0x${string}`;
input: `0x${string}`;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
accessList?: undefined;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId?: number | undefined;
yParity?: undefined;
type: "legacy";
gasPrice: bigint;
maxFeePerBlobGas?: undefined;
maxFeePerGas?: undefined;
maxPriorityFeePerGas?: undefined;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip2930";
gasPrice: bigint;
maxFeePerBlobGas?: undefined;
maxFeePerGas?: undefined;
maxPriorityFeePerGas?: undefined;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip1559";
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes: readonly `0x${string}`[];
chainId: number;
type: "eip4844";
gasPrice?: undefined;
maxFeePerBlobGas: bigint;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList: viem.SignedAuthorizationList<number>;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip7702";
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
};
type: "transaction";
};
readonly transactionReceipt: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcTransactionReceipt) => {
blobGasPrice?: bigint | undefined;
blobGasUsed?: bigint | undefined;
blockHash: `0x${string}`;
blockNumber: bigint;
contractAddress: `0x${string}` | null | undefined;
cumulativeGasUsed: bigint;
effectiveGasPrice: bigint;
from: `0x${string}`;
gasUsed: bigint;
logs: viem.Log<bigint, number, false, undefined, undefined, undefined, undefined>[];
logsBloom: `0x${string}`;
root?: `0x${string}` | undefined;
status: "success" | "reverted";
to: `0x${string}` | null;
transactionHash: `0x${string}`;
transactionIndex: number;
type: viem.TransactionType;
l1GasPrice: bigint | null;
l1GasUsed: bigint | null;
l1Fee: bigint | null;
l1FeeScalar: number | null;
};
type: "transactionReceipt";
};
};
serializers: {
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
};
} | {
blockExplorers: {
readonly default: {
readonly name: "Basescan";
readonly url: "https://sepolia.basescan.org";
readonly apiUrl: "https://api-sepolia.basescan.org/api";
};
};
contracts: {
readonly disputeGameFactory: {
readonly 11155111: {
readonly address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1";
};
};
readonly l2OutputOracle: {
readonly 11155111: {
readonly address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254";
};
};
readonly portal: {
readonly 11155111: {
readonly address: "0x49f53e41452c74589e85ca1677426ba426459e85";
readonly blockCreated: 4446677;
};
};
readonly l1StandardBridge: {
readonly 11155111: {
readonly address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120";
readonly blockCreated: 4446677;
};
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 1059647;
};
readonly gasPriceOracle: {
readonly address: "0x420000000000000000000000000000000000000F";
};
readonly l1Block: {
readonly address: "0x4200000000000000000000000000000000000015";
};
readonly l2CrossDomainMessenger: {
readonly address: "0x4200000000000000000000000000000000000007";
};
readonly l2Erc721Bridge: {
readonly address: "0x4200000000000000000000000000000000000014";
};
readonly l2StandardBridge: {
readonly address: "0x4200000000000000000000000000000000000010";
};
readonly l2ToL1MessagePasser: {
readonly address: "0x4200000000000000000000000000000000000016";
};
};
id: 84532;
name: "Base Sepolia";
nativeCurrency: {
readonly name: "Sepolia Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://sepolia.base.org"];
};
};
sourceId: 11155111;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters: {
readonly block: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcBlock<viem.BlockTag, boolean>) => {
baseFeePerGas: bigint | null;
blobGasUsed: bigint;
difficulty: bigint;
excessBlobGas: bigint;
extraData: `0x${string}`;
gasLimit: bigint;
gasUsed: bigint;
hash: `0x${string}` | null;
logsBloom: `0x${string}` | null;
miner: `0x${string}`;
mixHash: `0x${string}`;
nonce: `0x${string}` | null;
number: bigint | null;
parentBeaconBlockRoot?: `0x${string}` | undefined;
parentHash: `0x${string}`;
receiptsRoot: `0x${string}`;
sealFields: `0x${string}`[];
sha3Uncles: `0x${string}`;
size: bigint;
stateRoot: `0x${string}`;
timestamp: bigint;
totalDifficulty: bigint | null;
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
transactionsRoot: `0x${string}`;
uncles: `0x${string}`[];
withdrawals?: viem.Withdrawal[] | undefined;
withdrawalsRoot?: `0x${string}` | undefined;
};
type: "block";
};
readonly transaction: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcTransaction<boolean>) => {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: boolean | undefined;
mint?: bigint | undefined;
sourceHash: `0x${string}`;
type: "deposit";
} | {
r: `0x${string}`;
s: `0x${string}`;
v: bigint;
to: `0x${string}` | null;
from: `0x${string}`;
gas: bigint;
nonce: number;
value: bigint;
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
hash: `0x${string}`;
input: `0x${string}`;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
accessList?: undefined;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId?: number | undefined;
yParity?: undefined;
type: "legacy";
gasPrice: bigint;
maxFeePerBlobGas?: undefined;
maxFeePerGas?: undefined;
maxPriorityFeePerGas?: undefined;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip2930";
gasPrice: bigint;
maxFeePerBlobGas?: undefined;
maxFeePerGas?: undefined;
maxPriorityFeePerGas?: undefined;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip1559";
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes: readonly `0x${string}`[];
chainId: number;
type: "eip4844";
gasPrice?: undefined;
maxFeePerBlobGas: bigint;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList: viem.SignedAuthorizationList<number>;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip7702";
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
};
type: "transaction";
};
readonly transactionReceipt: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcTransactionReceipt) => {
blobGasPrice?: bigint | undefined;
blobGasUsed?: bigint | undefined;
blockHash: `0x${string}`;
blockNumber: bigint;
contractAddress: `0x${string}` | null | undefined;
cumulativeGasUsed: bigint;
effectiveGasPrice: bigint;
from: `0x${string}`;
gasUsed: bigint;
logs: viem.Log<bigint, number, false, undefined, undefined, undefined, undefined>[];
logsBloom: `0x${string}`;
root?: `0x${string}` | undefined;
status: "success" | "reverted";
to: `0x${string}` | null;
transactionHash: `0x${string}`;
transactionIndex: number;
type: viem.TransactionType;
l1GasPrice: bigint | null;
l1GasUsed: bigint | null;
l1Fee: bigint | null;
l1FeeScalar: number | null;
};
type: "transactionReceipt";
};
};
serializers: {
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
};
readonly network: "base-sepolia";
} | {
blockExplorers: {
readonly default: {
readonly name: "FTMScan";
readonly url: "https://ftmscan.com";
readonly apiUrl: "https://api.ftmscan.com/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 33001987;
};
};
id: 250;
name: "Fantom";
nativeCurrency: {
readonly decimals: 18;
readonly name: "Fantom";
readonly symbol: "FTM";
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://250.rpc.thirdweb.com"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "FTMScan";
readonly url: "https://testnet.ftmscan.com";
readonly apiUrl: "https://testnet.ftmscan.com/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 8328688;
};
};
id: 4002;
name: "Fantom Testnet";
nativeCurrency: {
readonly decimals: 18;
readonly name: "Fantom";
readonly symbol: "FTM";
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://rpc.testnet.fantom.network"];
};
};
sourceId?: number | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Gnosisscan";
readonly url: "https://gnosisscan.io";
readonly apiUrl: "https://api.gnosisscan.io/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 21022491;
};
};
id: 100;
name: "Gnosis";
nativeCurrency: {
readonly decimals: 18;
readonly name: "xDAI";
readonly symbol: "XDAI";
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://rpc.gnosischain.com"];
readonly webSocket: readonly ["wss://rpc.gnosischain.com/wss"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Harmony Explorer";
readonly url: "https://explorer.harmony.one";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 24185753;
};
};
id: 1666600000;
name: "Harmony One";
nativeCurrency: {
readonly name: "Harmony";
readonly symbol: "ONE";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://1666600000.rpc.thirdweb.com"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "SnowTrace";
readonly url: "https://testnet.snowtrace.io";
readonly apiUrl: "https://api-testnet.snowtrace.io";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 7096959;
};
};
id: 43113;
name: "Avalanche Fuji";
nativeCurrency: {
readonly decimals: 18;
readonly name: "Avalanche Fuji";
readonly symbol: "AVAX";
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://api.avax-test.network/ext/bc/C/rpc"];
};
};
sourceId?: number | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "PolygonScan";
readonly url: "https://mumbai.polygonscan.com";
readonly apiUrl: "https://api-testnet.polygonscan.com/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 25770160;
};
};
id: 80001;
name: "Polygon Mumbai";
nativeCurrency: {
readonly name: "MATIC";
readonly symbol: "MATIC";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://80001.rpc.thirdweb.com"];
};
};
sourceId?: number | undefined;
testnet: true;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "PolygonScan";
readonly url: "https://polygonscan.com";
readonly apiUrl: "https://api.polygonscan.com/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 25770160;
};
};
id: 137;
name: "Polygon";
nativeCurrency: {
readonly name: "POL";
readonly symbol: "POL";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://polygon-rpc.com"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "PolygonScan";
readonly url: "https://zkevm.polygonscan.com";
readonly apiUrl: "https://api-zkevm.polygonscan.com/api";
};
};
contracts: {
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 57746;
};
};
id: 1101;
name: "Polygon zkEVM";
nativeCurrency: {
readonly name: "Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://zkevm-rpc.com"];
};
};
sourceId?: number | undefined;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters?: undefined;
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
} | {
blockExplorers: {
readonly default: {
readonly name: "Optimism Explorer";
readonly url: "https://optimistic.etherscan.io";
readonly apiUrl: "https://api-optimistic.etherscan.io/api";
};
};
contracts: {
readonly disputeGameFactory: {
readonly 1: {
readonly address: "0xe5965Ab5962eDc7477C8520243A95517CD252fA9";
};
};
readonly l2OutputOracle: {
readonly 1: {
readonly address: "0xdfe97868233d1aa22e815a266982f2cf17685a27";
};
};
readonly multicall3: {
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
readonly blockCreated: 4286263;
};
readonly portal: {
readonly 1: {
readonly address: "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed";
};
};
readonly l1StandardBridge: {
readonly 1: {
readonly address: "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1";
};
};
readonly gasPriceOracle: {
readonly address: "0x420000000000000000000000000000000000000F";
};
readonly l1Block: {
readonly address: "0x4200000000000000000000000000000000000015";
};
readonly l2CrossDomainMessenger: {
readonly address: "0x4200000000000000000000000000000000000007";
};
readonly l2Erc721Bridge: {
readonly address: "0x4200000000000000000000000000000000000014";
};
readonly l2StandardBridge: {
readonly address: "0x4200000000000000000000000000000000000010";
};
readonly l2ToL1MessagePasser: {
readonly address: "0x4200000000000000000000000000000000000016";
};
};
id: 10;
name: "OP Mainnet";
nativeCurrency: {
readonly name: "Ether";
readonly symbol: "ETH";
readonly decimals: 18;
};
rpcUrls: {
readonly default: {
readonly http: readonly ["https://mainnet.optimism.io"];
};
};
sourceId: 1;
testnet?: boolean | undefined;
custom?: Record<string, unknown> | undefined;
fees?: viem.ChainFees<undefined> | undefined;
formatters: {
readonly block: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcBlock<viem.BlockTag, boolean>) => {
baseFeePerGas: bigint | null;
blobGasUsed: bigint;
difficulty: bigint;
excessBlobGas: bigint;
extraData: `0x${string}`;
gasLimit: bigint;
gasUsed: bigint;
hash: `0x${string}` | null;
logsBloom: `0x${string}` | null;
miner: `0x${string}`;
mixHash: `0x${string}`;
nonce: `0x${string}` | null;
number: bigint | null;
parentBeaconBlockRoot?: `0x${string}` | undefined;
parentHash: `0x${string}`;
receiptsRoot: `0x${string}`;
sealFields: `0x${string}`[];
sha3Uncles: `0x${string}`;
size: bigint;
stateRoot: `0x${string}`;
timestamp: bigint;
totalDifficulty: bigint | null;
transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
transactionsRoot: `0x${string}`;
uncles: `0x${string}`[];
withdrawals?: viem.Withdrawal[] | undefined;
withdrawalsRoot?: `0x${string}` | undefined;
};
type: "block";
};
readonly transaction: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcTransaction<boolean>) => {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: boolean | undefined;
mint?: bigint | undefined;
sourceHash: `0x${string}`;
type: "deposit";
} | {
r: `0x${string}`;
s: `0x${string}`;
v: bigint;
to: `0x${string}` | null;
from: `0x${string}`;
gas: bigint;
nonce: number;
value: bigint;
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
hash: `0x${string}`;
input: `0x${string}`;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
accessList?: undefined;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId?: number | undefined;
yParity?: undefined;
type: "legacy";
gasPrice: bigint;
maxFeePerBlobGas?: undefined;
maxFeePerGas?: undefined;
maxPriorityFeePerGas?: undefined;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip2930";
gasPrice: bigint;
maxFeePerBlobGas?: undefined;
maxFeePerGas?: undefined;
maxPriorityFeePerGas?: undefined;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip1559";
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList?: undefined;
blobVersionedHashes: readonly `0x${string}`[];
chainId: number;
type: "eip4844";
gasPrice?: undefined;
maxFeePerBlobGas: bigint;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
} | {
blockHash: `0x${string}` | null;
blockNumber: bigint | null;
from: `0x${string}`;
gas: bigint;
hash: `0x${string}`;
input: `0x${string}`;
nonce: number;
r: `0x${string}`;
s: `0x${string}`;
to: `0x${string}` | null;
transactionIndex: number | null;
typeHex: `0x${string}` | null;
v: bigint;
value: bigint;
yParity: number;
accessList: viem.AccessList;
authorizationList: viem.SignedAuthorizationList<number>;
blobVersionedHashes?: undefined;
chainId: number;
type: "eip7702";
gasPrice?: undefined;
maxFeePerBlobGas?: undefined;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
isSystemTx?: undefined;
mint?: undefined;
sourceHash?: undefined;
};
type: "transaction";
};
readonly transactionReceipt: {
exclude: [] | undefined;
format: (args: viem_chains.OpStackRpcTransactionReceipt) => {
blobGasPrice?: bigint | undefined;
blobGasUsed?: bigint | undefined;
blockHash: `0x${string}`;
blockNumber: bigint;
contractAddress: `0x${string}` | null | undefined;
cumulativeGasUsed: bigint;
effectiveGasPrice: bigint;
from: `0x${string}`;
gasUsed: bigint;
logs: viem.Log<bigint, number, false, undefined, undefined, undefined, undefined>[];
logsBloom: `0x${string}`;
root?: `0x${string}` | undefined;
status: "success" | "reverted";
to: `0x${string}` | null;
transactionHash: `0x${string}`;
transactionIndex: number;
type: viem.TransactionType;
l1GasPrice: bigint | null;
l1GasUsed: bigint | null;
l1Fee: bigint | null;
l1FeeScalar: number | null;
};
type: "transactionReceipt";
};
};
serializers: {
readonly transaction: typeof viem_chains.serializeTransactionOpStack;
};
} | {
blockExplorers: {