import type { EvmAddress, HexBytes, HexBytes32 } from "./evm.js"; import { roundSubmissionTcrAbi } from "./protocol-abis.js"; import { type ProtocolExecutionPlan } from "./protocol-plans.js"; export declare const TCR_ITEM_STATUS: { readonly absent: 0; readonly registered: 1; readonly registrationRequested: 2; readonly clearingRequested: 3; }; export type TcrItemStatus = (typeof TCR_ITEM_STATUS)[keyof typeof TCR_ITEM_STATUS]; export type TcrRequestType = typeof TCR_ITEM_STATUS.registrationRequested | typeof TCR_ITEM_STATUS.clearingRequested; export declare const TCR_REQUEST_PHASE: { readonly none: 0; readonly challengePeriod: 1; readonly unchallengedExecutable: 2; readonly disputePending: 3; readonly disputeSolvedAwaitingExecution: 4; readonly resolved: 5; }; export type TcrRequestPhase = (typeof TCR_REQUEST_PHASE)[keyof typeof TCR_REQUEST_PHASE]; export declare const ARBITRABLE_PARTY: { readonly none: 0; readonly requester: 1; readonly challenger: 2; }; export type ArbitrableParty = (typeof ARBITRABLE_PARTY)[keyof typeof ARBITRABLE_PARTY]; export declare const ARBITRATOR_DISPUTE_STATUS: { readonly waiting: 0; readonly solved: 1; }; export type ArbitratorDisputeStatus = (typeof ARBITRATOR_DISPUTE_STATUS)[keyof typeof ARBITRATOR_DISPUTE_STATUS]; export type ProtocolRecipientMetadataInput = { title: string; description: string; image: string; tagline?: string; url?: string; }; export type ProtocolRecipientMetadata = { title: string; description: string; image: string; tagline: string; url: string; }; export type BudgetTcrListingInput = { metadata: ProtocolRecipientMetadataInput; fundingDeadline: string | number | bigint; executionDuration: string | number | bigint; activationThreshold: string | number | bigint; runwayCap: string | number | bigint; oracleConfig: { oracleSpecHash: string; assertionPolicyHash: string; }; }; export type BudgetTcrListing = { metadata: ProtocolRecipientMetadata; fundingDeadline: bigint; executionDuration: bigint; activationThreshold: bigint; runwayCap: bigint; oracleConfig: { oracleSpecHash: HexBytes32; assertionPolicyHash: HexBytes32; }; }; export type AllocationMechanismListingInput = { metadata: ProtocolRecipientMetadataInput; duration: string | number | bigint; fundingDeadline: string | number | bigint; minBudgetFunding: string | number | bigint; maxBudgetFunding: string | number | bigint; deploymentConfig: { mechanismFactory: string; mechanismConfig?: string; }; }; export type AllocationMechanismListing = { metadata: ProtocolRecipientMetadata; duration: bigint; fundingDeadline: bigint; minBudgetFunding: bigint; maxBudgetFunding: bigint; deploymentConfig: { mechanismFactory: EvmAddress; mechanismConfig: HexBytes; }; }; export type RoundSubmissionInput = { source: string | number | bigint; postId: string; recipient: string; }; export type RoundSubmission = { source: number; postId: HexBytes32; recipient: EvmAddress; }; export type GeneralizedTcrTotalCostsInput = { addItemCost: string | number | bigint; removeItemCost: string | number | bigint; challengeSubmissionCost: string | number | bigint; challengeRemovalCost: string | number | bigint; arbitrationCost: string | number | bigint; }; export type GeneralizedTcrTotalCosts = { addItemCost: bigint; removeItemCost: bigint; challengeSubmissionCost: bigint; challengeRemovalCost: bigint; arbitrationCost: bigint; }; export declare const TCR_PLAN_ACTIONS: readonly ["addItem", "removeItem", "challengeRequest", "executeRequest", "executeRequestTimeout", "submitEvidence", "withdrawFeesAndRewards"]; export type TcrPlanAction = (typeof TCR_PLAN_ACTIONS)[number]; export declare const ARBITRATOR_PLAN_ACTIONS: readonly ["commitVote", "commitVoteFor", "revealVote", "executeRuling", "withdrawVoterRewards", "withdrawInvalidRoundRewards", "slashVoter", "slashVoters"]; export type ArbitratorPlanAction = (typeof ARBITRATOR_PLAN_ACTIONS)[number]; export type TcrActionPlan = ProtocolExecutionPlan & { family: "tcr"; action: TcrPlanAction; registryAddress: EvmAddress; depositTokenAddress?: EvmAddress; itemId?: HexBytes32; requestType?: TcrRequestType; }; export type ArbitratorActionPlan = ProtocolExecutionPlan & { family: "arbitrator"; action: ArbitratorPlanAction; arbitratorAddress: EvmAddress; disputeId: bigint; round?: bigint; voter?: EvmAddress; commitHash?: HexBytes32; }; type ReceiptEventBase = { contractAddress: EvmAddress; logIndex: number | null; }; export type TcrReceiptEvent = (ReceiptEventBase & { family: "tcr"; eventName: "Dispute"; arbitrator: EvmAddress; disputeId: bigint; metaEvidenceId: bigint; evidenceGroupId: bigint; itemId: HexBytes32; requestIndex: bigint; challenger: EvmAddress; }) | (ReceiptEventBase & { family: "tcr"; eventName: "Evidence"; arbitrator: EvmAddress; evidenceGroupId: bigint; party: EvmAddress; evidence: string; }) | (ReceiptEventBase & { family: "tcr"; eventName: "ItemStatusChange"; itemId: HexBytes32; requestIndex: bigint; roundIndex: bigint; disputed: boolean; resolved: boolean; itemStatus: TcrItemStatus; }) | (ReceiptEventBase & { family: "tcr"; eventName: "ItemSubmitted"; itemId: HexBytes32; submitter: EvmAddress; evidenceGroupId: bigint; data: HexBytes; }) | (ReceiptEventBase & { family: "tcr"; eventName: "RequestEvidenceGroupID"; itemId: HexBytes32; requestIndex: bigint; evidenceGroupId: bigint; }) | (ReceiptEventBase & { family: "tcr"; eventName: "RequestSubmitted"; itemId: HexBytes32; requestIndex: bigint; requestType: TcrRequestType; requester: EvmAddress; }) | (ReceiptEventBase & { family: "tcr"; eventName: "Ruling"; arbitrator: EvmAddress; disputeId: bigint; ruling: ArbitrableParty; }) | (ReceiptEventBase & { family: "tcr"; eventName: "SubmissionDepositPaid"; itemId: HexBytes32; payer: EvmAddress; amount: bigint; }) | (ReceiptEventBase & { family: "tcr"; eventName: "SubmissionDepositTransferred"; itemId: HexBytes32; recipient: EvmAddress; amount: bigint; requestType: TcrItemStatus; ruling: ArbitrableParty; }); export type ArbitratorReceiptEvent = (ReceiptEventBase & { family: "arbitrator"; eventName: "DisputeCreated"; disputeId: bigint; arbitrable: EvmAddress; votingStartTime: bigint; votingEndTime: bigint; revealPeriodEndTime: bigint; creationBlock: bigint; arbitrationCost: bigint; extraData: HexBytes; choices: bigint; }) | (ReceiptEventBase & { family: "arbitrator"; eventName: "DisputeCreation"; disputeId: bigint; arbitrable: EvmAddress; }) | (ReceiptEventBase & { family: "arbitrator"; eventName: "DisputeExecuted"; disputeId: bigint; ruling: ArbitrableParty; }) | (ReceiptEventBase & { family: "arbitrator"; eventName: "RewardWithdrawn"; disputeId: bigint; round: bigint; voter: EvmAddress; amount: bigint; }) | (ReceiptEventBase & { family: "arbitrator"; eventName: "SlashRewardsWithdrawn"; disputeId: bigint; round: bigint; voter: EvmAddress; goalAmount: bigint; cobuildAmount: bigint; }) | (ReceiptEventBase & { family: "arbitrator"; eventName: "VoteCommitted"; voter: EvmAddress; disputeId: bigint; commitHash: HexBytes32; }) | (ReceiptEventBase & { family: "arbitrator"; eventName: "VoteRevealed"; voter: EvmAddress; disputeId: bigint; commitHash: HexBytes32; choice: bigint; reason: string; votes: bigint; }) | (ReceiptEventBase & { family: "arbitrator"; eventName: "VoterSlashed"; disputeId: bigint; round: bigint; voter: EvmAddress; snapshotVotes: bigint; slashWeight: bigint; missedReveal: boolean; recipient: EvmAddress; }); export type GovernanceReceiptEvent = TcrReceiptEvent | ArbitratorReceiptEvent; export declare function normalizeTcrRequestType(value: string | number | bigint, label?: string): TcrRequestType; export declare function normalizeGeneralizedTcrTotalCosts(costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts): GeneralizedTcrTotalCosts; export declare function getTcrRequiredApprovalAmount(params: { action: "addItem" | "removeItem" | "challengeRequest"; costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts; requestType?: TcrRequestType | "registrationRequested" | "clearingRequested"; }): bigint; export declare function normalizeBudgetTcrListing(listing: BudgetTcrListingInput | BudgetTcrListing): BudgetTcrListing; export declare function encodeBudgetTcrListing(listing: BudgetTcrListingInput | BudgetTcrListing): HexBytes; export declare function decodeBudgetTcrListing(itemData: string): BudgetTcrListing; export declare function deriveBudgetTcrItemId(listing: BudgetTcrListingInput | BudgetTcrListing): HexBytes32; export declare function normalizeAllocationMechanismListing(listing: AllocationMechanismListingInput | AllocationMechanismListing): AllocationMechanismListing; export declare function encodeAllocationMechanismListing(listing: AllocationMechanismListingInput | AllocationMechanismListing): HexBytes; export declare function decodeAllocationMechanismListing(itemData: string): AllocationMechanismListing; export declare function deriveAllocationMechanismItemId(listing: AllocationMechanismListingInput | AllocationMechanismListing): HexBytes32; export declare function normalizeRoundSubmission(submission: RoundSubmissionInput | RoundSubmission): RoundSubmission; export declare function encodeRoundSubmission(submission: RoundSubmissionInput | RoundSubmission): HexBytes; export declare function decodeRoundSubmission(itemData: string): RoundSubmission; export declare function deriveRoundSubmissionItemId(submission: RoundSubmissionInput | RoundSubmission): HexBytes32; export declare function buildTcrAddItemPlan(params: { registryAddress: string; depositTokenAddress: string; itemData: string; costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts; expectedItemId?: string; }): TcrActionPlan; export declare function buildBudgetTcrAddListingPlan(params: { registryAddress: string; depositTokenAddress: string; listing: BudgetTcrListingInput | BudgetTcrListing; costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts; }): TcrActionPlan; export declare function buildAllocationMechanismAddListingPlan(params: { registryAddress: string; depositTokenAddress: string; listing: AllocationMechanismListingInput | AllocationMechanismListing; costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts; }): TcrActionPlan; export declare const buildAllocationMechanismTcrAddListingPlan: typeof buildAllocationMechanismAddListingPlan; export declare function buildRoundSubmissionAddItemPlan(params: { registryAddress: string; depositTokenAddress: string; submission: RoundSubmissionInput | RoundSubmission; costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts; }): TcrActionPlan; export declare const buildRoundSubmissionTcrAddSubmissionPlan: typeof buildRoundSubmissionAddItemPlan; export declare function buildTcrRemoveItemPlan(params: { registryAddress: string; depositTokenAddress: string; itemId: string; evidence?: string; costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts; }): TcrActionPlan; export declare function buildTcrChallengeRequestPlan(params: { registryAddress: string; depositTokenAddress: string; itemId: string; evidence?: string; requestType: TcrRequestType | "registrationRequested" | "clearingRequested"; costs: GeneralizedTcrTotalCostsInput | GeneralizedTcrTotalCosts; }): TcrActionPlan; export declare function buildTcrExecuteRequestPlan(params: { registryAddress: string; itemId: string; }): TcrActionPlan; export declare function buildTcrExecuteRequestTimeoutPlan(params: { registryAddress: string; itemId: string; }): TcrActionPlan; export declare function buildTcrSubmitEvidencePlan(params: { registryAddress: string; itemId: string; evidence: string; }): TcrActionPlan; export declare function buildTcrWithdrawFeesAndRewardsPlan(params: { registryAddress: string; beneficiary: string; itemId: string; requestIndex: string | number | bigint; roundIndex: string | number | bigint; }): TcrActionPlan; export declare function computeArbitratorCommitHash(params: { arbitratorAddress: string; disputeId: string | number | bigint; round: string | number | bigint; voterAddress: string; choice: string | number | bigint; reason?: string; salt: string; chainId?: string | number | bigint; }): HexBytes32; export declare function buildArbitratorCommitVotePlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; commitHash?: string; round?: string | number | bigint; voterAddress?: string; choice?: string | number | bigint; reason?: string; salt?: string; chainId?: string | number | bigint; }): ArbitratorActionPlan; export declare function buildArbitratorCommitVoteForPlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; voterAddress: string; commitHash?: string; round?: string | number | bigint; choice?: string | number | bigint; reason?: string; salt?: string; chainId?: string | number | bigint; }): ArbitratorActionPlan; export declare function buildArbitratorRevealVotePlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; voterAddress: string; choice: string | number | bigint; reason?: string; salt: string; }): ArbitratorActionPlan; export declare function buildArbitratorExecuteRulingPlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; }): ArbitratorActionPlan; export declare function buildArbitratorWithdrawVoterRewardsPlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; round: string | number | bigint; voterAddress: string; }): ArbitratorActionPlan; export declare function buildArbitratorWithdrawInvalidRoundRewardsPlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; round: string | number | bigint; }): ArbitratorActionPlan; export declare function buildArbitratorSlashVoterPlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; round: string | number | bigint; voterAddress: string; }): ArbitratorActionPlan; export declare function buildArbitratorSlashVotersPlan(params: { arbitratorAddress: string; disputeId: string | number | bigint; round: string | number | bigint; voterAddresses: readonly string[]; }): ArbitratorActionPlan; export declare function decodeTcrReceiptEvents(logs: readonly unknown[]): TcrReceiptEvent[]; export declare function decodeArbitratorReceiptEvents(logs: readonly unknown[]): ArbitratorReceiptEvent[]; export declare function decodeGovernanceReceiptEvents(logs: readonly unknown[]): GovernanceReceiptEvent[]; export declare function serializeGovernanceReceiptEvents(events: readonly GovernanceReceiptEvent[]): readonly Record[]; export { roundSubmissionTcrAbi };