import type { Op } from '@geoprotocol/grc-20'; import type { VoteOption, VotingMode } from '../dao-space/types.js'; import { type CreateDaoSpaceCalldataParams, type VotingSettingsInput } from '../encodings/get-create-dao-space-calldata.js'; import type { Id } from '../id.js'; import type { GeoClientContext } from './context.js'; export type CreateDaoSpaceParams = Omit & { name: string; author: Id | string; initialMemberSpaceIds?: `0x${string}`[]; ops?: Op[]; }; export type ProposalAction = { to: `0x${string}`; value: bigint; data: `0x${string}`; }; export type CreateProposalParams = { fromSpaceId: string; daoSpaceId: string; proposalId?: string; votingMode?: VotingMode; actions: ProposalAction[]; }; export type ProposeEditParams = { name: string; ops: Op[]; author: Id | string; daoSpaceAddress: `0x${string}`; callerSpaceId: string; daoSpaceId: string; votingMode?: VotingMode; proposalId?: string; }; export type VoteProposalParams = { authorSpaceId: string; spaceId: string; proposalId: string; vote: VoteOption; }; export type ExecuteProposalParams = { authorSpaceId: string; spaceId: string; proposalId: string; }; type DaoSpaceRoleProposalBaseParams = { authorSpaceId: string; spaceId: string; daoSpaceAddress: `0x${string}`; votingMode?: VotingMode; proposalId?: string; }; type SlowDaoSpaceRoleProposalBaseParams = Omit & { votingMode?: 'SLOW'; }; export type ProposeAddMemberParams = DaoSpaceRoleProposalBaseParams & { newMemberSpaceId: string; }; export type ProposeRemoveMemberParams = DaoSpaceRoleProposalBaseParams & { memberToRemoveSpaceId: string; }; export type ProposeAddEditorParams = SlowDaoSpaceRoleProposalBaseParams & { newEditorSpaceId: string; }; export type ProposeRemoveEditorParams = SlowDaoSpaceRoleProposalBaseParams & { editorToRemoveSpaceId: string; }; export type ProposeRequestMembershipParams = { authorSpaceId: string; spaceId: string; proposalId?: string; }; declare function encodePublishEditProposalAction(daoSpaceAddress: `0x${string}`, cid: string): ProposalAction; declare function encodeUpdateVotingSettingsAction(daoSpaceAddress: `0x${string}`, votingSettings: VotingSettingsInput): ProposalAction; /** * Publishes the initial DAO edit and returns calldata for creating a DAO space. * * The helper first validates DAO voting settings and required contract * addresses, then creates the space entity ops, publishes the initial edit, and * encodes `createDAOSpaceProxy` calldata using the resulting CID. Unless * `initialTopicId` is provided, the DAO topic is set to the generated space * entity ID. * * @example * ```ts * const tx = await geo.daoSpaces.create({ * name: 'Research DAO', * author: authorSpaceId, * initialEditorSpaceIds: [authorSpaceId], * votingSettings: { * slowPathPercentageThreshold: 50, * fastPathFlatThreshold: 1, * quorum: 1, * durationInSeconds: 3 * 24 * 60 * 60, * }, * }); * * await walletClient.sendTransaction({ * to: tx.to, * data: tx.calldata, * }); * ``` * * @param context Client context containing network, contract, API, and fetch configuration. * @param params DAO name, author, voting settings, initial editors/members, and optional extra ops. * @returns DAO factory address, calldata, generated space entity ID, and initial edit CID. * @throws When DAO settings are invalid, required contracts are missing, IDs are invalid, or edit publishing fails. */ export declare function create(context: GeoClientContext, params: CreateDaoSpaceParams): Promise<{ to: `0x${string}`; calldata: `0x${string}`; spaceEntityId: Id; cid: `ipfs://${string}`; }>; /** * Builds calldata for creating a DAO proposal from prebuilt proposal actions. * * This uses the configured `SPACE_REGISTRY_ADDRESS` and encodes a * `GOVERNANCE.PROPOSAL_CREATED` `SpaceRegistry.enter(...)` call. * * @example * ```ts * const actions = [ * geo.daoSpaces.proposals.actions.addMember(daoSpaceAddress, memberSpaceId), * geo.daoSpaces.proposals.actions.updateVotingSettings(daoSpaceAddress, { * slowPathPercentageThreshold: 60, * fastPathFlatThreshold: 2, * quorum: 3, * durationInSeconds: 5 * 24 * 60 * 60, * }), * ]; * * const tx = geo.daoSpaces.proposals.create({ * fromSpaceId: authorSpaceId, * daoSpaceId, * votingMode: 'SLOW', * actions, * }); * ``` * * @param context Client context containing the target network configuration. * @param params Caller space, DAO space, voting mode, optional proposal ID, and actions. * @returns Target registry address, calldata, and proposal ID. * @throws When IDs are invalid or the configured network is missing `SPACE_REGISTRY_ADDRESS`. */ export declare function createProposal(context: GeoClientContext, params: CreateProposalParams): { to: `0x${string}`; calldata: `0x${string}`; proposalId: `0x${string}`; }; /** * Publishes an edit and wraps it in a DAO-space proposal. * * This helper validates the proposal shape before upload, publishes the edit * through the configured API, creates a DAO `publish(...)` action with the * resulting CID, and returns calldata for proposal creation. * * @example * ```ts * const proposal = await geo.daoSpaces.proposeEdit({ * name: 'Update entity', * ops, * author: authorSpaceId, * daoSpaceAddress, * callerSpaceId: authorSpaceId, * daoSpaceId, * }); * ``` * * @param context Client context containing network, contract, API, and fetch configuration. * @param params Edit publication params plus DAO proposal target details. * @returns Edit ID, CID, target registry address, calldata, and proposal ID. * @throws When IDs are invalid, required contracts are missing, or edit publishing fails. */ export declare function proposeEdit(context: GeoClientContext, params: ProposeEditParams): Promise<{ to: `0x${string}`; calldata: `0x${string}`; proposalId: `0x${string}`; editId: Id; cid: `ipfs://${string}`; }>; /** * Builds calldata for a DAO proposal that adds a member space. * * `daoSpaceAddress` is required because the proposal action calls the DAO * space contract directly. * * @example * ```ts * const tx = geo.daoSpaces.proposeAddMember({ * authorSpaceId, * spaceId: daoSpaceId, * daoSpaceAddress, * newMemberSpaceId: memberSpaceId, * }); * ``` */ export declare function proposeAddMember(context: GeoClientContext, params: ProposeAddMemberParams): { to: `0x${string}`; calldata: `0x${string}`; proposalId: `0x${string}`; }; /** * Builds calldata for a DAO proposal that removes a member space. * * @example * ```ts * const tx = geo.daoSpaces.proposeRemoveMember({ * authorSpaceId, * spaceId: daoSpaceId, * daoSpaceAddress, * memberToRemoveSpaceId, * }); * ``` */ export declare function proposeRemoveMember(context: GeoClientContext, params: ProposeRemoveMemberParams): { to: `0x${string}`; calldata: `0x${string}`; proposalId: `0x${string}`; }; /** * Builds calldata for a DAO proposal that adds an editor space. * * Editor changes only support SLOW voting. * * @example * ```ts * const tx = geo.daoSpaces.proposeAddEditor({ * authorSpaceId, * spaceId: daoSpaceId, * daoSpaceAddress, * newEditorSpaceId: editorSpaceId, * }); * ``` */ export declare function proposeAddEditor(context: GeoClientContext, params: ProposeAddEditorParams): { to: `0x${string}`; calldata: `0x${string}`; proposalId: `0x${string}`; }; /** * Builds calldata for a DAO proposal that removes an editor space. * * Editor changes only support SLOW voting. * * @example * ```ts * const tx = geo.daoSpaces.proposeRemoveEditor({ * authorSpaceId, * spaceId: daoSpaceId, * daoSpaceAddress, * editorToRemoveSpaceId, * }); * ``` */ export declare function proposeRemoveEditor(context: GeoClientContext, params: ProposeRemoveEditorParams): { to: `0x${string}`; calldata: `0x${string}`; proposalId: `0x${string}`; }; /** * Builds calldata for requesting membership in a DAO space. * * Unlike governance proposals, this emits `GOVERNANCE.MEMBERSHIP_REQUESTED` * and can be submitted by a non-member space. * * @example * ```ts * const tx = geo.daoSpaces.proposeRequestMembership({ * authorSpaceId: requesterSpaceId, * spaceId: daoSpaceId, * }); * ``` */ export declare function proposeRequestMembership(context: GeoClientContext, params: ProposeRequestMembershipParams): { to: `0x${string}`; calldata: `0x${string}`; proposalId: `0x${string}`; }; /** * Builds calldata for voting on a DAO proposal. * * @example * ```ts * const tx = geo.daoSpaces.proposals.vote({ * authorSpaceId, * spaceId: daoSpaceId, * proposalId, * vote: 'YES', * }); * ``` * * @param context Client context containing the target network configuration. * @param params Author space, DAO space, proposal ID, and vote option. * @returns Target registry address and calldata for `GOVERNANCE.PROPOSAL_VOTED`. * @throws When IDs are invalid or the configured network is missing `SPACE_REGISTRY_ADDRESS`. */ export declare function voteProposal(context: GeoClientContext, params: VoteProposalParams): { to: `0x${string}`; calldata: `0x${string}`; }; /** * Builds calldata for executing a passed DAO proposal. * * @example * ```ts * const tx = geo.daoSpaces.proposals.execute({ * authorSpaceId, * spaceId: daoSpaceId, * proposalId, * }); * ``` * * @param context Client context containing the target network configuration. * @param params Author space, DAO space, and proposal ID. * @returns Target registry address and calldata for `GOVERNANCE.PROPOSAL_EXECUTED`. * @throws When IDs are invalid or the configured network is missing `SPACE_REGISTRY_ADDRESS`. */ export declare function executeProposal(context: GeoClientContext, params: ExecuteProposalParams): { to: `0x${string}`; calldata: `0x${string}`; }; /** * Helpers for constructing DAO proposal actions. * * These helpers only encode DAO-space action payloads. Pass their results to * `geo.daoSpaces.proposals.create(...)` when building a proposal from explicit actions. * * @example * ```ts * const action = geo.daoSpaces.proposals.actions.addEditor(daoSpaceAddress, editorSpaceId); * const proposal = geo.daoSpaces.proposals.create({ * fromSpaceId: authorSpaceId, * daoSpaceId, * votingMode: 'SLOW', * actions: [action], * }); * ``` */ export declare const actions: { publishEdit: typeof encodePublishEditProposalAction; addEditor: (daoSpaceAddress: `0x${string}`, spaceId: string) => ProposalAction; removeEditor: (daoSpaceAddress: `0x${string}`, spaceId: string) => ProposalAction; addMember: (daoSpaceAddress: `0x${string}`, spaceId: string) => ProposalAction; removeMember: (daoSpaceAddress: `0x${string}`, spaceId: string) => ProposalAction; updateVotingSettings: typeof encodeUpdateVotingSettingsAction; }; export {}; //# sourceMappingURL=dao-spaces.d.ts.map