evx-sdk
Version:
The Evx SDK is a developer toolkit designed to simplify interaction with the Evx decentralized liquidity protocol. It provides an abstraction layer over the smart contracts, allowing developers to easily build applications, integrate liquidity pools, fetc
42 lines (41 loc) • 1.47 kB
TypeScript
import { IBaseContract } from '../interfaces/contracts/IBaseContract';
import { chains } from '@resources';
import { ChainName, ContractName } from '@interfaces';
import { ethers, Signer } from 'ethers';
import { RPC } from '@providers';
/**
* @title Base Contract
* @notice Base class for all contract interactions
* @dev Provides common functionality for contract instances including signer management and chain switching
*/
export declare abstract class BaseContract implements IBaseContract {
signer: Signer | null | undefined;
chain: ChainName;
instance: ethers.Contract;
name: ContractName;
rpc: RPC;
abi: any;
/**
* @notice Creates a new contract instance
* @param name The name of the contract
* @param rpc The RPC provider instance
* @param abi The contract ABI
*/
constructor(name: ContractName, rpc: RPC, abi: any);
/**
* @notice Sets the signer for contract interactions
* @param signer The signer to use for transactions
*/
setSigner(signer?: Signer | null): Promise<void>;
/**
* @notice Sets the chain for contract interactions
* @param chain The chain to use for contract interactions
*/
setChain(chain: keyof typeof chains): void;
/**
* @notice Gets the contract address for the current chain
* @returns The contract address
* @throws Error if address is not found for the current chain
*/
getAddress(): string;
}