import type { Account as TokenAccount } from "@solana/spl-token"; import { Commitment, ConfirmOptions, PublicKey } from "@solana/web3.js"; import { HolderAccount, HolderStatus, HplCurrency } from "."; /** * HplHolderAccount class represents the holder account of HplCurrency. * @category Modules */ export declare class HplHolderAccount { private _currency; readonly address: PublicKey; private _holderAccount; private _tokenAccount; private _perceivedAmount; constructor(_currency: HplCurrency, address: PublicKey, _holderAccount: HolderAccount, _tokenAccount: TokenAccount); /** * Creates an HplHolderAccount instance from the given address. * @param currency The `HplCurrency` instance. * @param address The address of the holderAccount. */ static fromAddress(currency: HplCurrency, address: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Creates an HplHolderAccount instance from the given address. * @param currency The `HplCurrency` instance. * @param wallet The wallet of the owner. */ static of(currency: HplCurrency, wallet: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Gets the total amount (including perceived amount) of the holder account. */ get amount(): number; /** * Gets the delegate of the holder account. */ get delegate(): PublicKey; /** * Gets the delegated amount of the holder account. */ get delegatedAmount(): bigint; /** * Gets the owner of the holder account. */ get owner(): PublicKey; /** * Gets the associated token account of the holder account. */ get tokenAccount(): PublicKey; /** * Gets the status of the holder account. */ get status(): HolderStatus; /** * Checks if the holder account is active. */ get isActive(): boolean; /** * Gets the associated HplCurrency instance. */ currency(): HplCurrency; /** * Modify the perceived amount of the holder account. */ modifyPerceivedAmount(amount: number): void; /** * Mints new tokens for the holder account. * @param amount The amount to mint. * @param confirmOptions Optional confirm options for the transaction. */ mint(amount: number, confirmOptions?: ConfirmOptions): Promise; /** * Funds tokens to the holder account. * @param amount The amount to fund. * @param confirmOptions Optional confirm options for the transaction. */ fund(amount: number, confirmOptions?: ConfirmOptions): Promise; /** * Burns tokens from the holder account. * @param amount The amount to burn. * @param confirmOptions Optional confirm options for the transaction. */ burn(amount: number, confirmOptions?: ConfirmOptions): Promise; /** * Transfers tokens to another holder account. * @param amount The amount to transfer. * @param to The destination holder account or its public key. * @param confirmOptions Optional confirm options for the transaction. */ transfer(amount: number, to: HplHolderAccount | PublicKey, confirmOptions?: ConfirmOptions): Promise; /** * Approves a delegate for the holder account. * @param amount The amount to approve for delegation. * @param delegate The delegate to approve. * @param confirmOptions Optional confirm options for the transaction. */ approveDelegate(amount: number, delegate: PublicKey, confirmOptions?: ConfirmOptions): Promise; /** * Revokes the delegate approval for the holder account. * @param confirmOptions Optional confirm options for the transaction. */ revokeDelegate(confirmOptions?: ConfirmOptions): Promise; /** * Sets the status of the holder account. * @param status The new status to set. * @param confirmOptions Optional confirm options for the transaction. */ setHolderStatus(status: HolderStatus, confirmOptions?: ConfirmOptions): Promise; }