UNPKG

@flaunch/sdk

Version:

Flaunch SDK to easily interact with the Flaunch protocol

60 lines 2.53 kB
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter } from "@delvtech/drift"; import { TreasuryManagerAbi } from "../abi/TreasuryManager"; export type TreasuryManagerABI = typeof TreasuryManagerAbi; export type FlaunchToken = { flaunch: Address; tokenId: bigint; }; /** * Client for interacting with the TreasuryManager contract in read-only mode * Provides methods to query permissions and manager owner */ export declare class ReadTreasuryManager { readonly contract: ReadContract<TreasuryManagerABI>; /** * Creates a new ReadTreasuryManager instance * @param address - The address of the TreasuryManager contract * @param drift - Optional drift instance for contract interactions (creates new instance if not provided) * @throws Error if address is not provided */ constructor(address: Address, drift?: Drift); /** * Gets the permissions contract address * @returns Promise<Address> - The address of the permissions contract */ permissions(): Promise<`0x${string}`>; /** * Gets the manager owner address * @returns Promise<Address> - The address of the manager owner */ managerOwner(): Promise<`0x${string}`>; } /** * Extended client for interacting with the TreasuryManager contract with write capabilities * Provides methods to deposit tokens, set permissions, and transfer ownership */ export declare class ReadWriteTreasuryManager extends ReadTreasuryManager { contract: ReadWriteContract<TreasuryManagerABI>; constructor(address: Address, drift?: Drift<ReadWriteAdapter>); /** * Deposits a flaunch token to the treasury * @param flaunchToken - The flaunch token to deposit * @param creator - The address of the creator * @param data - Additional data for the deposit * @returns Promise<void> */ deposit(flaunchToken: FlaunchToken, creator: Address, data: `0x${string}`): Promise<`0x${string}`>; /** * Sets the permissions contract address * @param permissions - The address of the new permissions contract * @returns Promise<void> */ setPermissions(permissions: Address): Promise<`0x${string}`>; /** * Transfers the manager ownership to a new address * @param newManagerOwner - The address of the new manager owner * @returns Promise<void> */ transferManagerOwnership(newManagerOwner: Address): Promise<`0x${string}`>; } //# sourceMappingURL=TreasuryManagerClient.d.ts.map