import type { Address, AvatarRow, ContractRunner, TokenBalanceRow } from '@aboutcircles/sdk-types'; import type { TransactionReceipt } from 'viem'; import type { Core } from '@aboutcircles/sdk-core'; import { CommonAvatar } from './CommonAvatar.js'; /** * OrganisationAvatar class implementation * Provides a simplified, user-friendly wrapper around Circles protocol for organisation avatars * * This class represents an organisation avatar in the Circles ecosystem. * Unlike human avatars, organisations cannot mint personal CRC tokens and do not require invitations. * They can manage trust relationships, make transfers, and interact with group tokens. */ export declare class OrganisationAvatar extends CommonAvatar { constructor(address: Address, core: Core, contractRunner?: ContractRunner, avatarInfo?: AvatarRow); readonly balances: { getTotal: () => Promise; getTokenBalances: () => Promise; getTotalSupply: () => Promise; }; readonly groupToken: { /** * Mint group tokens by transferring collateral to the group's mint handler * Uses pathfinding to transfer tokens along the trust network, including wrapped tokens * * @param group The group address to mint tokens from * @param amount Amount of tokens to transfer to the mint handler (in atto-circles) * @returns Transaction receipt * * @example * ```typescript * // Mint group tokens by sending 100 CRC to the group's mint handler * const receipt = await avatar.groupToken.mint('0xGroupAddress...', BigInt(100e18)); * ``` */ mint: (group: Address, amount: bigint) => Promise; /** * Get the maximum amount that can be minted for a group * This calculates the maximum transferable amount to the group's mint handler * including wrapped token balances * * @param group The group address * @returns Maximum mintable amount in atto-circles * * @example * ```typescript * const maxMintable = await avatar.groupToken.getMaxMintableAmount('0xGroupAddress...'); * console.log('Can mint up to:', maxMintable.toString(), 'atto-circles'); * ``` */ getMaxMintableAmount: (group: Address) => Promise; /** * Automatically redeem collateral tokens from a Base Group's treasury * * Performs automatic redemption by determining trusted collaterals and using pathfinder for optimal flow. * Only supports Base Group types. The function uses pathfinder to determine the optimal redemption path * and validates that sufficient liquidity exists before attempting redemption. * * Note: Organizations don't have personal tokens. This method uses the tokens held by the organization * (which are other avatars' tokens or other group tokens) to redeem from the specified group. * * @param group The address of the Base Group from which to redeem collateral tokens * @param amount The amount of group tokens to redeem for collateral (must be > 0 and <= max redeemable) * @returns A Promise resolving to the transaction receipt upon successful automatic redemption * * @example * ```typescript * // Redeem 100 group tokens for collateral * const receipt = await orgAvatar.groupToken.redeem('0xGroupAddress...', BigInt(100e18)); * ``` */ redeem: (group: Address, amount: bigint) => Promise; properties: { /** * Get the owner of a specific group * @param group The group address * @returns The owner address of the group */ owner: (group: Address) => Promise
; /** * Get the mint handler address of a specific group * @param group The group address * @returns The mint handler address */ mintHandler: (group: Address) => Promise
; /** * Get the treasury (redemption handler) address of a specific group * @param group The group address * @returns The treasury address where redemptions are handled */ treasury: (group: Address) => Promise
; /** * Get the service address of a specific group * @param group The group address * @returns The service address */ service: (group: Address) => Promise
; /** * Get the fee collection address of a specific group * @param group The group address * @returns The fee collection address */ feeCollection: (group: Address) => Promise
; /** * Get all membership conditions for a specific group * @param group The group address * @returns Array of membership condition addresses */ getMembershipConditions: (group: Address) => Promise; }; }; readonly group: { properties: { /** * Get the owner of a specific group * @param group The group address * @returns The owner address of the group */ owner: (group: Address) => Promise
; /** * Get the mint handler address of a specific group * @param group The group address * @returns The mint handler address */ mintHandler: (group: Address) => Promise
; /** * Get the treasury (redemption handler) address of a specific group * @param group The group address * @returns The treasury address where redemptions are handled */ treasury: (group: Address) => Promise
; /** * Get the service address of a specific group * @param group The group address * @returns The service address */ service: (group: Address) => Promise
; /** * Get the fee collection address of a specific group * @param group The group address * @returns The fee collection address */ feeCollection: (group: Address) => Promise
; /** * Get all membership conditions for a specific group * @param group The group address * @returns Array of membership condition addresses */ getMembershipConditions: (group: Address) => Promise; }; }; } //# sourceMappingURL=OrganisationAvatar.d.ts.map