Skip to main content

Crate txgate_policy

Crate txgate_policy 

Source
Expand description

§txgate-policy

Policy engine for transaction approval rules in the TxGate signing service.

§Internal Crate Warning

This crate is an internal implementation detail of txgate.

It is published to crates.io only because Cargo requires all dependencies to be published. The API is unstable and may change without notice between any versions, including patch releases.

Do not depend on this crate directly. Instead:

This crate provides the policy evaluation and rule management system:

§Modules

  • config - Policy configuration types

§Modules (planned)

  • engine - Policy evaluation engine
  • rules - Rule definitions and parsing
  • conditions - Condition types (amount limits, address allowlists, etc.)
  • actions - Policy actions (approve, deny, require_approval)

§Policy Features (planned)

  • Transaction amount limits (per-tx)
  • Address allowlists and blocklists
  • Contract function restrictions
  • Time-based rules (business hours, rate limiting)
  • Multi-signature approval workflows
  • Chain-specific policies

§Policy Format

Policies are defined in YAML/JSON format and can be:

  • Loaded from files
  • Fetched from remote configuration servers
  • Defined programmatically

§Example Policy (conceptual)

policies:
  - name: "high_value_transfer"
    conditions:
      - type: "amount_greater_than"
        value: "10 ETH"
    action: "require_approval"
    approvers: ["admin@company.com"]

Re-exports§

pub use engine::DefaultPolicyEngine;
pub use engine::PolicyCheckResult;
pub use engine::PolicyEngine;

Modules§

config
Policy configuration types for the TxGate signing service.
engine
Policy engine for transaction rule enforcement.

Structs§

PolicyConfig
Policy configuration for transaction approval rules.