UNPKG

@flaunch/sdk

Version:

Flaunch SDK to easily interact with the Flaunch protocol

67 lines 2.56 kB
import { type ReadContract, type Address, type Drift, type ReadWriteContract } from "@delvtech/drift"; import { MemecoinAbi } from "../abi/Memecoin"; export type MemecoinABI = typeof MemecoinAbi; /** * Client for interacting with Memecoin (ERC20) contracts in read-only mode * Provides methods to query basic token information and balances */ export declare class ReadMemecoin { readonly contract: ReadContract<MemecoinABI>; /** * Creates a new ReadMemecoin instance * @param address - The address of the Memecoin 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 name of the token * @returns Promise<string> - The name of the token */ name(): Promise<string>; /** * Gets the symbol of the token * @returns Promise<string> - The symbol of the token */ symbol(): Promise<string>; /** * Gets the token URI containing metadata * @returns Promise<string> - The token URI */ tokenURI(): Promise<string>; /** * Gets the decimals of the token * @returns Promise<number> - The decimals of the token */ decimals(): Promise<number>; /** * Gets the total supply of the token * @returns Promise<bigint> - The total supply */ totalSupply(): Promise<bigint>; /** * Gets the token balance of a specific user * @param user - The address of the user to check * @returns Promise<bigint> - The token balance */ balanceOf(user: Address): Promise<bigint>; /** * Gets the allowance of an ERC20 token to a spender * @param owner - The address of the owner to check * @param spender - The address of the spender to check * @returns Promise<bigint> - The allowance of the coin to the spender */ allowance(owner: Address, spender: Address): Promise<bigint>; } export declare class ReadWriteMemecoin extends ReadMemecoin { contract: ReadWriteContract<MemecoinABI>; constructor(address: Address, drift?: Drift); /** * Approves an amount of the token to be spent by another address * @param spender - The address of the spender to approve * @param amount - The amount of the token to approve * @returns Promise<void> - The transaction receipt */ approve(spender: Address, amount: bigint): Promise<`0x${string}`>; } //# sourceMappingURL=MemecoinClient.d.ts.map