import { ethers } from 'ethers'; import { Provider } from '@ethersproject/providers'; import type { VideoPaymentStorage } from 'gotake-contracts/dist/typechain/contracts/VideoPayment'; import type { IVideoPayment } from 'gotake-contracts/dist/typechain/contracts/interfaces/IVideoPayment'; import { BaseTransactionWrapper } from './base-transaction-wrapper'; import { TransactionOptions } from '../types'; /** * Wrapper for VideoPayment contract, providing purchase and content management functionality * Uses TypeChain generated types for full type safety */ export declare class VideoPaymentWrapper extends BaseTransactionWrapper { private _videoPayment; /** * Create VideoPayment wrapper instance * @param provider Provider instance * @param signer Signer instance */ constructor(provider: Provider, signer: ethers.Signer); /** * Get VideoPayment contract instance * @returns VideoPayment contract instance */ private getVideoPayment; /** * Purchase content with unified interface supporting both ERC20 and native tokens * @param contentId Content ID to purchase * @param paymentToken Token address (use ethers.constants.AddressZero for native) * @param amount Token amount to pay * @param options Transaction options * @returns Transaction result */ purchaseContent(contentId: number, paymentToken: string, amount: ethers.BigNumber, options?: TransactionOptions): Promise; /** * Batch purchase multiple content with unified interface * @param contentIds Array of content IDs to purchase * @param paymentToken Token address (use ethers.constants.AddressZero for native) * @param totalAmount Total token amount to pay * @param options Transaction options * @returns Transaction result */ batchPurchase(contentIds: number[], paymentToken: string, totalAmount: ethers.BigNumber, options?: TransactionOptions): Promise; /** * Batch update token prices for multiple content (Admin only) * Note: Use ethers.constants.AddressZero for native token * @param contentIds Array of content IDs * @param token Token address (use AddressZero for native) * @param prices Array of new prices in wei * @param options Transaction options * @returns Transaction result */ batchSetContentPrice(contentIds: number[], token: string, prices: ethers.BigNumber[], options?: TransactionOptions): Promise; /** * Batch consume views for multiple users and content (Admin only) * @param users Array of user addresses * @param contentIds Array of content IDs * @param options Transaction options * @returns Transaction result */ batchConsumeView(users: string[], contentIds: number[], options?: TransactionOptions): Promise; /** * Check if user has view permission for content * @param user User address * @param contentId Content ID * @returns True if user has valid view permission */ hasViewPermission(user: string, contentId: number): Promise; /** * Get detailed permission information for user and content * @param user User address * @param contentId Content ID * @returns View permission details */ getPermissionDetails(user: string, contentId: number): Promise; /** * Get user permissions for multiple content items * @param user User address * @param contentIds Array of content IDs * @returns Array of view permission details */ getUserPermissions(user: string, contentIds: number[]): Promise; /** * Check if content is active * @param contentId Content ID * @returns True if content is active */ isContentActive(contentId: number): Promise; /** * Check if token is supported * @param tokenAddress Token address * @returns True if token is supported */ isSupportedToken(tokenAddress: string): Promise; /** * Get content purchase information including supported tokens and prices * @param contentId Content ID * @returns Content purchase information */ getContentPurchaseInfo(contentId: number): Promise; /** * Consume a view for user (Admin only) * @param user User address * @param contentId Content ID * @param options Transaction options * @returns Transaction result */ consumeView(user: string, contentId: number, options?: TransactionOptions): Promise; /** * Set content configuration (Admin only) * @param contentId Content ID * @param token Token address (use ethers.constants.AddressZero for native) * @param price New price * @param viewCount View count for content * @param isActive Whether content is active * @param options Transaction options * @returns Transaction result */ setContentConfig(contentId: number, token: string, price: ethers.BigNumber, viewCount: number, isActive: boolean, options?: TransactionOptions): Promise; /** * Batch set content configurations (Admin only) * @param contentIds Array of content IDs * @param token Token address (use ethers.constants.AddressZero for native) * @param prices Array of new prices in wei * @param viewCounts Array of view counts * @param isActiveArray Array of active statuses * @param options Transaction options * @returns Transaction result */ batchSetContentConfig(contentIds: number[], token: string, prices: ethers.BigNumber[], viewCounts: number[], isActiveArray: boolean[], options?: TransactionOptions): Promise; /** * Update token price for content (Admin only) * Note: Use ethers.constants.AddressZero for native token * @param contentId Content ID * @param token Token address (use AddressZero for native) * @param price New price * @param options Transaction options * @returns Transaction result */ setContentPrice(contentId: number, token: string, price: ethers.BigNumber, options?: TransactionOptions): Promise; /** * Add supported token (Owner only) * @param tokenAddress Token address to add * @param options Transaction options * @returns Transaction result */ addSupportedToken(tokenAddress: string, options?: TransactionOptions): Promise; /** * Remove supported token (Owner only) * @param tokenAddress Token address to remove * @param options Transaction options * @returns Transaction result */ removeSupportedToken(tokenAddress: string, options?: TransactionOptions): Promise; /** * Add admin (Owner only) * @param adminAddress Admin address to add * @param options Transaction options * @returns Transaction result */ addAdmin(adminAddress: string, options?: TransactionOptions): Promise; /** * Remove admin (Owner only) * @param adminAddress Admin address to remove * @param options Transaction options * @returns Transaction result */ removeAdmin(adminAddress: string, options?: TransactionOptions): Promise; /** * Pause contract (Owner only) * @param options Transaction options * @returns Transaction result */ pause(options?: TransactionOptions): Promise; /** * Unpause contract (Owner only) * @param options Transaction options * @returns Transaction result */ unpause(options?: TransactionOptions): Promise; /** * Update connection when provider or signer changes * @param provider New provider instance * @param signer New signer instance */ updateConnection(provider: Provider, signer: ethers.Signer): void; } //# sourceMappingURL=video-payment-wrapper.d.ts.map