import type { Account, Address, Chain, GetContractReturnType, PublicClient, Transport, WalletClient } from "viem"; import { erc20Abi } from "viem"; import { LevrChain, LevrEnv } from "../types"; import { abis } from "./abis"; import { levrContractAddresses } from "./addresses"; import { LevrMarketId } from "./constants"; import { MarketType } from "@prisma/client"; import type { ContractTypeMap } from "./contract-types"; export type CustomWalletClient = WalletClient; type ContractAddressName = keyof (typeof levrContractAddresses)["local"][LevrChain.MONAD_TESTNET]; export declare function getLevrContractAddress(contractName: ContractAddressName, chainId: LevrChain, levrEnv: LevrEnv): Address; /** * Retrieves an instance of a Levr smart contract for the specified contract name, chain, and environment. * * @template T - The contract name, constrained to the keys of the `abis` object. * @param contractName - The name of the contract to retrieve. * @param chainId - The chain ID where the contract is deployed. * @param levrEnv - The Levr environment (e.g., development, production). * @param walletClient - (Optional) A wallet client to use for contract interactions requiring signing. * @returns An instance of the contract typed according to its ABI and the provided wallet client. * @throws Will throw an error if the contract address is not found for the given contract name and chain. */ export declare function getLevrContract(contractName: T, chainId: LevrChain, levrEnv: LevrEnv, { publicClient, walletClient }?: { publicClient?: PublicClient; walletClient?: WalletClient; }): ContractTypeMap[T]; export declare function getErc20Contract(address: Address, chainId: LevrChain, { publicClient, walletClient }?: { publicClient?: PublicClient; walletClient?: WalletClient; }): GetContractReturnType; type MarketContractReturn = ContractTypeMap["levrFulltimeMarket"] & ContractTypeMap["levrOverUnderMarket"]; export declare function getLevrMarketContract(marketIdentifier: MarketType | LevrMarketId, chainId: LevrChain, levrEnv: LevrEnv, opts?: { publicClient?: PublicClient; walletClient?: WalletClient; }): MarketContractReturn; /** * Like `getLevrMarketContract` but uses an explicit contract address instead of * the registered address for the current environment. Use this when a position * was created on a contract that has since been superseded (e.g. after a * redeployment) and you need to reach the original contract directly. * * @param address - The exact on-chain address of the market contract. * @param marketIdentifier - The market type or LevrMarketId that determines which ABI to use. * @param chainId - The chain ID where the contract is deployed. * @param opts - Optional publicClient / walletClient overrides. */ export declare function getLevrMarketContractAt(address: Address, marketIdentifier: MarketType | LevrMarketId, chainId: LevrChain, opts?: { publicClient?: PublicClient; walletClient?: WalletClient; }): MarketContractReturn; export {};