import * as web3 from "@solana/web3.js"; import * as splToken from "@solana/spl-token"; import { Honeycomb, HoneycombProject, Module } from "@honeycomb-protocol/hive-control"; import { CreateCurrencyArgs, Currency, UpdateCurrencyArgs } from "./generated"; import { Metadata } from "@metaplex-foundation/mpl-token-metadata"; import { HplHolderAccount } from "."; declare module "@honeycomb-protocol/hive-control" { interface Honeycomb { _currencies: { [key: string]: HplCurrency; }; currency(key?: string | web3.PublicKey): HplCurrency; } } /** * HplCurrency class represents a in-game currency managed by the Honeycomb protocol. * @category Modules */ export declare class HplCurrency extends Module { readonly address: web3.PublicKey; private _currency; private _mint; private _metadata; readonly programId: web3.PublicKey; private _uriData; constructor(address: web3.PublicKey, _currency: Currency, _mint: splToken.Mint, _metadata: Metadata); /** * Creates an HplCurrency instance from the given address. * @param honeycomb The `Honeycomb` instance. * @param address The address of the currency. */ static fromAddress(honeycomb: Honeycomb, address: web3.PublicKey, commitment?: web3.Commitment): Promise; /** * Creates a new HplCurrency instance. * @param honeycomb The Honeycomb instance. * @param args The arguments for creating the currency. * @param confirmOptions Optional confirm options for the transaction. */ static new(honeycomb: Honeycomb, args: CreateCurrencyArgs | { mint: web3.PublicKey; mintAuthority: web3.PublicKey | web3.Keypair; freezeAuthority: web3.PublicKey | web3.Keypair; }, confirmOptions?: web3.ConfirmOptions): Promise; /** * Gets the name of the currency. */ get name(): string; /** * Gets the symbol of the currency. */ get symbol(): string; /** * Gets the URI of the currency. */ get uri(): string; /** * Gets the underlying mint of the currency. */ get mint(): splToken.Mint; /** * Gets the kind of the currency. */ get kind(): import("./generated").CurrencyKind; /** * Fetches URI data for the currency. * @param forceFetch Set to true to force re-fetching of the data. */ uriData(forceFetch?: boolean): Promise; /** * Gets the Honeycomb instance. */ honeycomb(): Honeycomb; /** * Gets the associated HoneycombProject. */ project(): HoneycombProject; /** * Gets the holder account for the given owner. * @param owner The owner of the holder account. If not provided, uses the identity address. * @param commitment The Solana block commitment. * @param forceFetch Set to true to force re-fetching of the holder account data. */ holderAccount(owner?: web3.PublicKey, commitment?: web3.Commitment, forceFetch?: boolean): Promise; /** * Creates a new holder account for the given wallet. * @param wallet The owner of the holder account. If not provided, uses the identity address. * @param confirmOptions Optional confirm options for the transaction. */ newHolderAccount(wallet?: web3.PublicKey, confirmOptions?: web3.ConfirmOptions): Promise; /** * Updates the currency with the given arguments. * @param args The arguments for updating the currency. * @param confirmOptions Optional confirm options for the transaction. */ update(args: UpdateCurrencyArgs, confirmOptions?: web3.ConfirmOptions): Promise; /** * Installs the HplCurrency in the given Honeycomb instance. * @param honeycomb The Honeycomb instance to install the currency. */ install(honeycomb: Honeycomb): Honeycomb; } /** * Factory function to create or fetch an HplCurrency instance from the Honeycomb. * @category Factory * @param honeycomb The Honeycomb instance. * @param args The arguments for creating the currency or the address of the existing currency. */ export declare const currencyModule: (honeycomb: Honeycomb, args: web3.PublicKey | (CreateCurrencyArgs | { mint: web3.PublicKey; mintAuthority: web3.PublicKey | web3.Keypair; freezeAuthority: web3.PublicKey | web3.Keypair; })) => Promise; /** * Finds the currencies associated with the given HoneycombProject. * @category Factory * @param project The HoneycombProject to search for currencies. */ export declare const findProjectCurrencies: (project: HoneycombProject) => Promise;