Skip to main content

Module signing

Module signing 

Source
Expand description

Signing flow orchestration for the TxGate signing service.

This module provides the SigningService that orchestrates the complete signing flow: parsing, policy checking, and signing.

§Flow Overview

The signing service performs the following steps:

  1. Parse - Transform raw transaction bytes into a ParsedTx
  2. Check - Evaluate the transaction against policy rules
  3. Sign - If allowed, sign the transaction hash

§Example

use txgate_core::signing::{SigningService, SigningResult};
use txgate_chain::Chain;
use txgate_policy::PolicyEngine;
use txgate_crypto::Signer;

// Create the service with your implementations
let service = SigningService::new(chain, policy, signer);

// Sign a transaction
let result = service.sign(&raw_tx_bytes)?;

// Or just check policy without signing (dry run)
let result = service.check(&raw_tx_bytes)?;

§Thread Safety

SigningService is Send + Sync when all its components are, allowing it to be shared across async tasks.

Structs§

SigningResult
Comprehensive result of a signing operation.
SigningService
Orchestrates the signing flow: parsing, policy checking, and signing.

Enums§

PolicyCheckResult
Detailed result of a policy check operation.
SigningError
Errors that can occur during the signing flow.

Traits§

ChainParser
Trait for chain parsers.
PolicyEngineExt
Trait for policy engines.
SignerExt
Trait for signers.

Type Aliases§

SignatureBytes
Signature as a 64-byte array (r || s without recovery ID).