///
import { TransactionDto, TransactionBatchDto, SmartAccountVersion, ChainId, SmartAccountContext, SmartWalletFactoryContract, MultiSendContract, SmartWalletContract, AddressForCounterFactualWalletDto, SmartAccountState, SmartAccountConfig, NetworkConfig } from '@biconomy-devx/core-types';
import NodeClient, { ISmartAccount, ChainConfig, SmartAccountsResponse, SmartAccountByOwnerDto, SCWTransactionResponse, BalancesResponse, BalancesDto, UsdBalanceResponse } from '@biconomy-devx/node-client';
import { JsonRpcProvider, Web3Provider } from '@ethersproject/providers';
import EventEmitter from 'events';
import { TransactionResponse } from '@ethersproject/providers';
import { ERC4337EthersProvider, BaseAccountAPI } from '@biconomy-devx/account-abstraction';
import { Signer } from 'ethers';
import { Transaction } from '@biconomy-devx/core-types';
import ContractUtils from './ContractUtils';
declare class SmartAccount extends EventEmitter {
#private;
DEFAULT_VERSION: SmartAccountVersion;
context: {
[chainId: number]: SmartAccountContext;
};
supportedNetworkIds: ChainId[];
chainConfig: ChainConfig[];
provider: JsonRpcProvider;
aaProvider: {
[chainId: number]: ERC4337EthersProvider;
};
signer: Signer;
nodeClient: NodeClient;
contractUtils: ContractUtils;
owner: string;
address: string;
smartAccountState: SmartAccountState;
/**
* Constructor for the Smart Account. If config is not provided it makes Smart Account available using default configuration
* If you wish to use your own backend server and relayer service, pass the URLs here
*/
constructor(signerOrProvider: Web3Provider | Signer, config?: Partial);
getConfig(): SmartAccountConfig;
getsigner(): Signer;
getSmartAccountAPI(chainId: ChainId): BaseAccountAPI;
getProviderUrl(network: ChainConfig): string;
getNetworkConfigValues(chainId: ChainId): Promise;
initializeAtChain(chainId: ChainId): Promise;
init(): Promise;
/**
* @description this function will make complete transaction data for updateImplementationTrx
* @param chainId
* @returns
*/
updateImplementationTrx(chainId: ChainId): Promise;
/**
* @description this function will make complete transaction data for updateFallBackHandlerTrx
* @param chainId
* @returns
*/
updateFallBackHandlerTrx(chainId: ChainId): Promise;
/**
* @description this function will let dapp to update Base wallet Implemenation to Latest
* @returns
*/
updateFallbackHandler(): Promise;
/**
* @description this function will let dapp to update FallBackHandler to Latest
* @returns
*/
updateImplementation(): Promise;
sendTransaction(transactionDto: TransactionDto): Promise;
sendTransactionBatch(transactionBatchDto: TransactionBatchDto): Promise;
deployWalletUsingPaymaster(): Promise;
/**
*
* @param smartAccountVersion
* @description // set wallet version to be able to interact with different deployed versions
*/
setSmartAccountVersion(smartAccountVersion: SmartAccountVersion): Promise;
getAlltokenBalances(balancesDto: BalancesDto): Promise;
getTotalBalanceInUsd(balancesDto: BalancesDto): Promise;
getSmartAccountsByOwner(smartAccountByOwnerDto: SmartAccountByOwnerDto): Promise;
getTransactionByAddress(chainId: number, address: string): Promise;
getTransactionByHash(txHash: string): Promise;
/**
* Allows to change default active chain of the Smart Account
* @param chainId
* @returns self/this
*/
setActiveChain(chainId: ChainId): Promise;
/**
*
* @param chainId optional chainId
* @returns Smart Wallet Contract instance attached with current smart account address (proxy)
*/
smartAccount(chainId?: ChainId): SmartWalletContract;
/**
*
* @param address EOA address
* @param chainId optional chainId
* @param index optional index for counterfactual address
* @returns SmartAccount address for given EOA address
*/
getSmartAccountAddress(owner: string, chainId?: ChainId, index?: number): Promise;
/**
*
* @param chainId optional chainId
* @returns Smart Wallet Factory instance for requested chainId
*/
factory(chainId?: ChainId): SmartWalletFactoryContract;
multiSend(chainId?: ChainId): MultiSendContract;
getAddress(addressForCounterFactualWalletDto: AddressForCounterFactualWalletDto): Promise;
/**
* Allows one to check if the smart account is already deployed on requested chainOd
* @notice the check is made on Wallet Factory state with current address in Smart Account state
* @param chainId optional chainId : Default is current active
* @returns
*/
isDeployed(chainId: ChainId): Promise;
/**
* @param chainId requested chain : default is active chain
* @returns object containing infromation (owner, relevant contract addresses, isDeployed) about Smart Account for requested chain
*/
getSmartAccountState(): Promise;
/**
* Serves smart contract instances associated with Smart Account for requested ChainId
* Context is useful when relayer is deploying a wallet
* @param chainId requested chain : default is active chain
* @returns object containing relevant contract instances
*/
getSmartAccountContext(chainId?: ChainId): SmartAccountContext;
}
export default SmartAccount;