/** * @dev Assortment of helper methods */ import { BigNumber, Contract, ContractInterface, Overrides } from '../ethers'; import { EthersProvider } from '../types'; export declare const lengths: { address: number; txHash: number; privateKey: number; publicKey: number; }; export declare const blockedStealthAddresses: string[]; /** * @notice Given a transaction hash, return the public key of the transaction's sender * @dev See https://github.com/ethers-io/ethers.js/issues/700 for an example of * recovering public key from a transaction with ethers * @param txHash Transaction hash to recover public key from * @param provider ethers provider instance */ export declare function recoverPublicKeyFromTransaction(txHash: string, provider: EthersProvider): Promise; /** * @notice Returns the transaction hash of the first transaction sent by an address, or * undefined if none was found * @param address Address to lookup * @param provider ethers provider instance */ export declare function getSentTransaction(address: string, ethersProvider: EthersProvider): Promise; export declare function toAddress(name: string, provider: EthersProvider): Promise; /** * @notice Returns public keys from the recipientId * @dev When providing a public key, transaction hash, or address with advanced mode, the spending and viewing * public keys will be the same. Only keys retrieved from the StealthKeyRegistry will have different spending * and viewing keys * @param id Recipient identifier, must be an ENS name, CNS name, address, transaction hash, or public key * @param provider ethers provider to use * @param options Object containing lookup options: * advanced: looks for public keys in StealthKeyRegistry when false, recovers them from on-chain transaction when true * supportPubKey: default false, when true allows a public key to be provided directly * supportTxHash: default false, when true allows public key to be recovered from the specified transaction hash */ export declare function lookupRecipient(id: string, provider: EthersProvider, { advanced, supportPubKey, supportTxHash, }?: { advanced?: boolean; supportPubKey?: boolean; supportTxHash?: boolean; }): Promise<{ spendingPublicKey: string; viewingPublicKey: string; }>; /** * @notice Creates and returns a contract instance * @param address Contract address * @param abi Contract ABI * @param provider ethers provider instance */ export declare function createContract(address: string, abi: ContractInterface, provider: EthersProvider): Contract; /** * @notice Throws if provided public key is not on the secp256k1 curve * @param point Uncompressed public key as hex string */ export declare function assertValidPoint(point: string): void; /** * @notice Returns the public keys associated with the provided name, using the legacy lookup approach * @param name Name or domain to test * @param provider ethers provider instance */ export declare function getPublicKeysLegacy(name: string, provider: EthersProvider): Promise<{ spendingPublicKey: string; viewingPublicKey: string; }>; /** * @notice Returns true if the provided name is a valid domain, without the protocol identifier such as https:// * @param name Name or domain to test */ export declare function isDomain(name: string): boolean; /** * @notice Given a from address, to address, and provider, return parameters needed to sweep all ETH * @dev The intent of this method is to facilitate sweeping ETH from a stealth address (EOA) to another * account. As a result, we don't consider the chance of the sender being a contract wallet that * results in extra gas costs. * @param from Address sending ETH * @param to Address receiving ETH * @param provider Provider to use for querying data * @param overrides Optional overrides for gasLimit and gasPrice */ export declare function getEthSweepGasInfo(from: string, to: string, provider: EthersProvider, overrides?: Overrides): Promise<{ gasPrice: BigNumber; gasLimit: BigNumber; txCost: BigNumber; fromBalance: BigNumber; ethToSend: BigNumber; chainId: number; }>; export declare function assertSupportedAddress(recipientId: string): Promise;