import { ContractReceipt, Signer } from "ethers"; import { EventEmitter2 } from "eventemitter2"; import { ISDKOptions, IThirdwebSdk } from "../interfaces"; import { IStorage } from "../interfaces/IStorage"; import { AppModule } from "../modules/app"; import { BundleModule } from "../modules/bundle"; import { BundleDropModule } from "../modules/bundleDrop"; import { CollectionModule } from "../modules/collection"; import { DatastoreModule } from "../modules/datastore"; import { DropModule } from "../modules/drop"; import { MarketModule } from "../modules/market"; import { MarketplaceModule } from "../modules/marketplace"; import { NFTModule } from "../modules/nft"; import { PackModule } from "../modules/pack"; import { SplitsModule } from "../modules/royalty"; import { CurrencyModule, TokenModule } from "../modules/token"; import { VoteModule } from "../modules/vote"; import { ModuleMetadataNoType } from "../types/ModuleMetadata"; import { SnapshotInfo } from "../types/snapshots"; import { IAppModule, RegistryModule } from "./registry"; import { MetadataURIOrObject, ProviderOrSigner, ValidProviderInput } from "./types"; /** * @internal */ export declare type AnyContract = typeof AppModule | typeof BundleModule | typeof NFTModule | typeof CurrencyModule | typeof MarketModule | typeof PackModule | typeof RegistryModule | typeof DropModule | typeof DatastoreModule | typeof SplitsModule | typeof BundleDropModule | typeof MarketplaceModule | typeof VoteModule; /** * The entrypoint to the SDK. * @public */ export declare class ThirdwebSDK implements IThirdwebSdk { private options; private defaultOptions; private modules; private providerOrSigner; private _signer; private _jsonConvert; private storage; event: EventEmitter2; /** * The active Signer, you should not need to access this unless you are deploying new modules. * @internal */ get signer(): Signer | null; private set signer(value); private _registry; private get registry(); private set registry(value); constructor(providerOrNetwork: ValidProviderInput, opts?: Partial); private updateModuleSigners; private getProvider; private getSigner; private getChainID; private getRegistryAddress; /** * * @param address - The contract address of the given Registry module. * @returns The Registry Module. * @internal */ private getRegistryModule; private getOrCreateModule; /** * you should not need this unless you are creating new modules * @returns the active registry module forwarder address * @internal */ getForwarderAddress(): Promise; /** * Call this to get the current apps. * @returns All currently registered apps for the connected wallet */ getApps(address?: string): Promise; /** * Call this to create a new app * @param metadata - metadata URI or a JSON object * @returns The transaction receipt */ createApp(metadata: MetadataURIOrObject): Promise; /** * * @param speed - what speed to prefer, default: "fastest" * @param maxGas - how much gas to use at most, default: 300 * @returns the optiomal gas price */ getGasPrice(speed?: string, maxGasGwei?: number): Promise; /** * * @param providerOrSignerOrNetwork - A valid "ethers" Provider, Signer or a Network address to create a Provider with. * @returns The Provider / Signer that was passed in, or a default ethers provider constructed with the passed Network. */ setProviderOrSigner(providerOrSignerOrNetwork: ValidProviderInput): ProviderOrSigner; /** * * @public * @returns Whether the SDK is in read-only mode. (Meaning it has not been passed a valid "Signer.") */ isReadOnly(): boolean; /** * @public * @returns The contract metadata for the given contract address. */ getContractMetadata(address: string): Promise; /** * * @param address - The contract address of the given App module. * @returns The App Module. */ getAppModule(address: string): AppModule; /** * * @param address - The contract address of the given NFT module. * @returns The NFT Module. */ getNFTModule(address: string): NFTModule; /** * * @param address - The contract address of the given Collection module. * @returns The Bundle Module. * @deprecated Use the new {@link ThirdwebSDK.getBundleModule} function instead. */ getCollectionModule(address: string): CollectionModule; /** * * @param address - The contract address of the given Bundle module. * @returns The Bundle Module. */ getBundleModule(address: string): BundleModule; /** * * @param address - The contract address of the given Pack module. * @returns The Pack Module. */ getPackModule(address: string): PackModule; /** * * @param address - The contract address of the given Currency module. * @returns The Currency Module. * * @deprecated - see {@link TokenModule} */ getCurrencyModule(address: string): CurrencyModule; /** * * @param address - The contract address of the given Token module. * @returns The Token Module. */ getTokenModule(address: string): TokenModule; /** * @alpha * * @param address - The contract address of the given Datastore module. * @returns The Datastore Module. */ getDatastoreModule(address: string): DatastoreModule; /** * * @param address - The contract address of the given Market module. * @returns The Market Module. */ getMarketModule(address: string): MarketModule; /** * * @param address - The contract address of the given Drop module. * @returns The Drop Module. */ getDropModule(address: string): DropModule; /** * @beta * * @param address - The contract address of the given BundleDrop module. * @returns The Drop Module. */ getBundleDropModule(address: string): BundleDropModule; /** * @beta * * @param address - The contract address of the given Marketplace module. * @returns The Marketplace Module. */ getMarketplaceModule(address: string): MarketplaceModule; /** * @alpha * * @param address - The contract address of the given Royalty module. * @returns The Splits Module. */ getSplitsModule(address: string): SplitsModule; /** * @alpha * * @param address - The contract address of the given Vote module. * @returns The Vote Module. */ getVoteModule(address: string): VoteModule; /** * Used for SDK that requires js bridging like Unity SDK. * Convenient function to let the caller calls into the SDK using routing scheme rather than function call. * * @internal * @param route - sdk execution route * @param payload - request arguments for the function * @returns */ invokeRoute(route: string, payload: Record): any; private getModuleByName; private defaultGaslessSendFunction; private biconomySendFunction; private defenderSendFunction; private defaultRelayerSendFunction; createSnapshot(leafs: string[]): Promise; /** * Accessor for the storage instance used by the SDK * * @returns - The Storage instance. */ getStorage(): IStorage; /** * Allows you to override the storage used across the SDK. * * @param storage - The Storage instance to use. */ overrideStorage(storage: IStorage): void; } /** * Deprecated, please use ThirdwebSDK instead. * @public * @deprecated use ThirdwebSDK instead */ export declare const NFTLabsSDK: typeof ThirdwebSDK;