import { ethers } from 'ethers'; import { Provider } from '@ethersproject/providers'; import { NetworkId, GoTakeSDKOptions } from './utils'; import { AccountApi, ContentNFTApi, VideoApi, VideoPaymentApi } from './api'; import { VideoMetadata, StatusCallback, Subscription, MintResult, PollController, TransactionOptions } from './types'; interface ExtendedGoTakeSDKOptions extends GoTakeSDKOptions { apiEndpoint?: string; apiKey?: string; } /** * GoTake SDK - Main SDK class for interacting with GoTake contracts and services */ export declare class GoTakeSDK { private _provider; private _signer; private _networkId; private _networkConfig; private _apiConfig; private _statusTracker; readonly account: AccountApi; readonly contentNFT: ContentNFTApi; readonly video: VideoApi; readonly videoPayment: VideoPaymentApi; /** * Create SDK instance * @param options Initialization options */ constructor(options?: ExtendedGoTakeSDKOptions); /** * Get current network ID */ get networkId(): NetworkId; /** * Get Provider */ get provider(): Provider; /** * Get Signer */ get signer(): ethers.Signer; /** * Get current user address */ getAddress(): Promise; /** * Get contract address for a specific network and contract name * @param network Network ID or name * @param contractName Contract name * @returns Contract address */ getContractAddress(network: NetworkId | string, contractName: string): string; /** * Get all contract addresses for a specific network * @param network Network ID or name * @returns Record of contract name to address mappings */ getNetworkAddresses(network: NetworkId | string): Record; /** * Get all contract addresses for all supported networks * @returns Record of network key to contract addresses mappings */ getAllAddresses(): Record>; /** * Get network information including contracts and tokens * @param network Network ID or name * @returns Network information with contracts and tokens */ getNetworkInfo(network: NetworkId | string): any; /** * Get all network information including contracts and tokens * @returns Record of network key to network information mappings */ getAllNetworkInfo(): any; /** * Check if user has a TBA and create one if not exists * @param options Transaction options * @returns Promise resolving to TBA address and whether it was newly created */ checkAndCreateTBA(options?: TransactionOptions): Promise<{ tbaAddress: string; isNew: boolean; }>; /** * Upload video to the platform * @param file Video file to upload * @param metadata Video metadata * @returns Promise resolving to video ID */ uploadVideo(file: File, metadata: VideoMetadata): Promise; /** * Get video status * @param videoId Video ID * @returns Promise resolving to video status information */ getVideoStatus(videoId: string): Promise; /** * Subscribe to video status updates * @param videoId Video ID * @param callback Function to be called when status updates * @returns Subscription object */ subscribeToVideoStatus(videoId: string, callback: StatusCallback): Subscription; /** * Poll video status at regular intervals * @param videoId Video ID * @param options Poll options * @returns Poll controller */ pollVideoStatus(videoId: string, options: { interval?: number; stopCondition?: (status: any) => boolean; callback: StatusCallback; }): PollController; /** * Mint Content NFT for a video * @param videoId Video ID * @param options Transaction options * @returns Promise resolving to mint result */ mintContentNFT(videoId: string, options?: TransactionOptions): Promise; /** * Upload video and mint NFT when ready * @param file Video file to upload * @param metadata Video metadata * @param options Options including status callback and auto-mint flag * @returns Promise resolving to video ID */ uploadAndMintWhenReady(file: File, metadata: VideoMetadata, options?: { statusCallback?: StatusCallback; autoMint?: boolean; transactionOptions?: TransactionOptions; }): Promise; /** * Purchase content with simplified interface * @param contentId Content ID to purchase * @param paymentMethod Payment method (ETH or ERC20) * @param tokenAddress Token address (required for ERC20 payments) * @param options Transaction options * @returns Purchase result */ purchaseContent(contentId: number, paymentMethod: 'ETH' | 'ERC20', tokenAddress?: string, options?: TransactionOptions): Promise; /** * Check if current user has view permission for content * @param contentId Content ID * @returns True if user has valid view permission */ hasViewPermission(contentId: number): Promise; /** * Get current user's permission details for content * @param contentId Content ID * @returns View permission details */ getMyPermissions(contentId: number): Promise; /** * Get content information including pricing * @param contentId Content ID * @returns Content information */ getContentInfo(contentId: number): Promise; /** * Switch network * @param network Network ID or name */ switchNetwork(network: NetworkId | string): Promise; /** * Resolve network configuration * @param network Network ID or name * @returns Network configuration */ private _resolveNetwork; /** * Resolve Provider * @param provider Provider or RPC URL * @param networkConfig Network configuration * @returns Provider instance */ private _resolveProvider; /** * Resolve Signer * @param signer Signer, private key, or environment variable name * @returns Signer instance */ private _resolveSigner; /** * Get current gas price recommendations * @param options Optional configuration * @returns Gas price data including maxFeePerGas and maxPriorityFeePerGas */ getGasPrice(options?: { multiplier?: number; priorityMultiplier?: number; }): Promise<{ baseFeePerGas?: ethers.BigNumber; maxFeePerGas: ethers.BigNumber; maxPriorityFeePerGas?: ethers.BigNumber; gasPrice?: ethers.BigNumber; }>; } export { NetworkId, getNetworkById, getNetworkByName, getContractAddressFromConfig, getNetworkContractAddresses, getAllNetworkAddresses, getNetworkInfo, getAllNetworkInfo } from './utils'; export { NetworkInfo, AllNetworkInfo } from './types'; export { getContractAddress, CONTRACT_ADDRESSES, getNetworkConfig } from 'gotake-contracts'; export { GasConfig, VideoStatus, VideoStatusInfo, VideoMetadata, StatusCallback, Subscription, MintResult, PollController, TransactionOptions } from './types'; export { TokenUtils, TokenInfo } from './utils/token-utils'; export * from './api'; export * from './wrappers'; //# sourceMappingURL=index.d.ts.map