import { Auth } from '../Auth/Auth.js'; import type { ClientOptions } from '../types/interfaces/enft.interface.js'; import type { Callback } from '../types/utils/type.utils.js'; import type { TransactionData } from '../types/models/transaction.model.js'; /** * @class * The main class for the ENFT library. **/ export declare class ENFT { private readonly auth; constructor(auth: Auth); /** * * Subscribes to the sales event of an NFT contract. * * @async * @function * @param {ClientOptions} opts - An object containing the options to subscribe to the sales event. * @param {string} opts.contractAddress - The address of the NFT contract (required). * @param {string} opts.transactionHash - The transaction hash only required for debugTransaction (optional). * @param {string} opts.tokenType - The token type (optional). * @param {string} opts.etherscanApiKey - The etherscan api key for eth to usd conversion (optional). * @param {string} opts.discordWebhook - The discord webhook for built-in notification (optional). * @param {TwitterConfig} opts.twitterConfig - The twitter api config for built-in notification (optional). * @param {boolean} opts.test - Test mode (optional). * @param {Callback} callback - An optional callback function to execute after the transaction is debugged. * @throws {Error} If the "opts" parameter is missing required properties. * @returns {Promise<() => void>} Returns a promise that resolves to a function. **/ onItemSold: (opts: ClientOptions, callback?: Callback) => Promise<() => void>; /** * * Debugs a transaction on the Ethereum blockchain using the provided options. * * @async * @function * @param {ClientOptions} opts - An object containing the options for the transaction to debug. * @param {string} opts.contractAddress - The address of the NFT contract (required). * @param {string} opts.transactionHash - The transaction hash only required for debugTransaction (optional). * @param {string} opts.tokenType - The token type (optional). * @param {string} opts.etherscanApiKey - The etherscan api key for eth to usd conversion (optional). * @param {string} opts.discordWebhook - The discord webhook for built-in notification (optional). * @param {TwitterConfig} opts.twitterConfig - The twitter api config for built-in notification (optional). * @param {boolean} opts.test - Test mode (optional). * @param {Callback} callback - An optional callback function to execute after the transaction is debugged. * @throws {Error} If the "opts" parameter is missing required properties. * @throws {Error} If the "transactionHash" property is missing from the "opts" parameter. * @returns {Promise} A promise that resolves with the transaction data if available, otherwise null or undefined. **/ debugTransaction: (opts: ClientOptions, callback?: Callback) => Promise; /** * * Initializes the configuration and options for the client using the provided options. * * @async * @function * @param {ClientOptions} opts - An object containing the options for the client. * @throws {Error} If the contract metadata cannot be obtained or the token type is unknown and no default token type is provided. * @returns {Promise<{ config: Config, options: Options }>} A promise that resolves with an object containing the configuration and options for the client. */ private init; /** * * Checks the token type of the contract metadata. * * @private * @function * @param {ContractMetadata} contractMetadata - The metadata of the contract to check. * @param {TokenType} [tokenType] - An optional token type to use if the contract's token type is unknown. * @throws {Error} If the contract's token type is unknown and no default token type is provided. */ private checkTokenType; /** * * Listens for transfer events on the specified contract and * executes the provided callback function when a new event is detected. * * @private * @async * @function * @param {Config} config - The configuration for the client. * @param {Options} options - The options for the client. * @param {Callback} [callback] - An optional callback function to execute when a new transfer event is detected. * @returns {Promise<() => void>} A promise that resolves with a function to stop listening for events. */ private on; } //# sourceMappingURL=ENFT.d.ts.map