import { ArtifactDeployed, ArtifactNew, IArtifactManager } from './artifact.js'; import { ChainLookup } from './chain.js'; export declare const FeeStrategyType: { readonly linear: "linear"; readonly regressive: "regressive"; readonly progressive: "progressive"; readonly offchainQuotedLinear: "offchainQuotedLinear"; }; export type FeeStrategyType = (typeof FeeStrategyType)[keyof typeof FeeStrategyType]; export interface FeeParams { maxFee: string; halfAmount: string; } export interface LinearFeeStrategy extends FeeParams { type: typeof FeeStrategyType.linear; } export interface RegressiveFeeStrategy extends FeeParams { type: typeof FeeStrategyType.regressive; } export interface ProgressiveFeeStrategy extends FeeParams { type: typeof FeeStrategyType.progressive; } export interface OffchainQuotedLinearFeeStrategy extends FeeParams { type: typeof FeeStrategyType.offchainQuotedLinear; quoteSigners: string[]; } export type FeeStrategy = LinearFeeStrategy | RegressiveFeeStrategy | ProgressiveFeeStrategy | OffchainQuotedLinearFeeStrategy; export declare const FeeType: { readonly linear: "linear"; readonly regressive: "regressive"; readonly progressive: "progressive"; readonly offchainQuotedLinear: "offchainQuotedLinear"; readonly routing: "routing"; readonly crossCollateralRouting: "crossCollateralRouting"; }; export type FeeType = (typeof FeeType)[keyof typeof FeeType]; export type BaseFeeConfig = { owner: string; beneficiary: string; } & T; export interface LinearFeeConfig extends BaseFeeConfig { type: typeof FeeType.linear; } export interface RegressiveFeeConfig extends BaseFeeConfig { type: typeof FeeType.regressive; } export interface ProgressiveFeeConfig extends BaseFeeConfig { type: typeof FeeType.progressive; } export interface OffchainQuotedLinearFeeConfig extends BaseFeeConfig { type: typeof FeeType.offchainQuotedLinear; quoteSigners: string[]; } export interface RoutingFeeConfig extends BaseFeeConfig { type: typeof FeeType.routing; routes: Record; } export interface CrossCollateralRoutingFeeConfig extends BaseFeeConfig { type: typeof FeeType.crossCollateralRouting; routes: Record>; } export type FeeConfig = LinearFeeConfig | RegressiveFeeConfig | ProgressiveFeeConfig | OffchainQuotedLinearFeeConfig | RoutingFeeConfig | CrossCollateralRoutingFeeConfig; export type DerivedFeeConfig = FeeConfig & { address: string; }; export interface RoutingFeeArtifactConfig extends BaseFeeConfig { type: typeof FeeType.routing; routes: Record; } export interface CrossCollateralRoutingFeeArtifactConfig extends BaseFeeConfig { type: typeof FeeType.crossCollateralRouting; routes: Record>; } export interface FeeArtifactConfigs { linear: LinearFeeConfig; regressive: RegressiveFeeConfig; progressive: ProgressiveFeeConfig; offchainQuotedLinear: OffchainQuotedLinearFeeConfig; routing: RoutingFeeArtifactConfig; crossCollateralRouting: CrossCollateralRoutingFeeArtifactConfig; } export type FeeArtifactConfig = FeeArtifactConfigs[FeeType]; export interface DeployedFeeAddress { address: string; } export type DeployedFeeArtifact = ArtifactDeployed; export interface FeeReadContext { knownRoutersPerDomain: Record>; } export interface IRawFeeArtifactManager extends IArtifactManager { readFee(address: string, context: FeeReadContext): Promise; } /** * Converts FeeConfig (Config API) to FeeArtifactConfig (Artifact API). * Chain names are converted to domain IDs for routing/CC routing fee types. * Direct fee types (linear, regressive, progressive) are passed through unchanged. */ export declare function feeConfigToArtifact(config: FeeConfig, chainLookup: ChainLookup): ArtifactNew; /** * Converts a DeployedFeeArtifact to DerivedFeeConfig format. * Domain IDs are converted back to chain names for routing/CC routing fee types. */ export declare function feeArtifactToDerivedConfig(artifact: DeployedFeeArtifact, chainLookup: ChainLookup): DerivedFeeConfig; /** * Determines if a new fee should be deployed instead of updating the existing one. * Deploy new if fee type changed. For direct types (linear, regressive, progressive), * deploy new if config changed (immutable on EVM - constructor-set params). * Routing/CC routing types are mutable and can be updated in-place. */ export declare function shouldDeployNewFee(actual: FeeArtifactConfig, expected: FeeArtifactConfig): boolean; /** * Merges current on-chain fee artifact with expected fee artifact. * Determines whether to deploy a new fee or update/reuse existing one. */ export declare function mergeFeeArtifacts(currentArtifact: DeployedFeeArtifact | undefined, expectedArtifact: ArtifactNew | DeployedFeeArtifact): ArtifactNew | DeployedFeeArtifact; //# sourceMappingURL=fee.d.ts.map