Namespace

shared

for-fabric.shared

Hyperledger Fabric Shared Module for Decaf-ts

View Source shared/index.ts, line 2

Interfaces

Checkable

Provides a standard healthcheck method signature to probe liveness/readiness of Fabric contracts or services using a Fabric context

Credentials

Optional username/password pair used when enrolling with a Fabric CA or authenticating in client utilities

Members

# static constant FabricFlavour

Used to tag adapters/repositories that operate against Hyperledger Fabric

String identifier for the Fabric adapter flavour

View Source shared/constants.ts, line 30

string

# static readonly exports.FabricModelKeys

Enumeration of special keys used by the serialization layer to persist Fabric-related flags on models

Keys used to mark Fabric-specific model metadata

View Source shared/constants.ts, line 9

string

# static readonly exports.IdentityType

Enumeration of identity formats recognized by this library

Supported identity types for Fabric credentials

View Source shared/constants.ts, line 25

Methods

# static add(a, b) → {number}

Adds two numbers and verifies no overflow by reverse-checking the operands

Overflow-safe addition operation

Parameters:
Name Type Description
a number

First operand

b number

Second operand

View Source shared/math.ts, line 5

on addition overflow

The sum of a and b

number

# static generateFabricEventName(table, event, owneropt) → {string}

Creates a standardized event name by joining table, event, and optional owner with underscores

Generates a Fabric event name from components

Parameters:
Name Type Attributes Description
table string

The table/collection name

event OperationKeys | BulkCrudOperationKeys | string

The event type

owner string <optional>

Optional owner identifier

View Source shared/events.ts, line 2

The generated event name in format "table_event" or "table_event_owner"

string

# static parseEventName(name) → {Object}

Splits an event name by underscores and extracts table, event, and optional owner

Parses a Fabric event name into its components

sequenceDiagram participant Caller participant Parser as parseEventName Caller->>Parser: parseEventName(name) Parser->>Parser: split name by "_" alt parts length invalid Parser-->>Caller: throw InternalError else Parser-->>Caller: { table, event, owner? } end
Parameters:
Name Type Description
name string

The event name to parse

View Source shared/events.ts, line 18

If the event name format is invalid

InternalError

The parsed components as a structured object

Object

# static safeParseInt(string)

Safe Integer Parse

Parameters:
Name Type Description
string string

View Source shared/math.ts, line 39

if parseInt returns NaN

ValidationError

# static sub(a, b) → {number}

Subtracts b from a and validates no overflow by reverse-checking the operands

Overflow-safe subtraction operation

Parameters:
Name Type Description
a number

Minuend

b number

Subtrahend

View Source shared/math.ts, line 22

on subtaction overflow

The difference a - b

number

Type Definitions

Object

# CAConfig

Contains all the necessary parameters to establish a connection to a Fabric peer and interact with chaincode

Configuration for connecting to a Hyperledger Fabric peer

Properties:
Name Type Attributes Description
url string

Path to the crypto materials

tls TLSOptions

Path to the directory containing private keys

caName string

Path to the directory containing certificates

tlsCertPath string

Path to the TLS certificate

caCert string

Endpoint URL for the peer

caKey string <optional>

Host alias for the peer or directory containing the admin private key

url string
tls TLSOptions <optional>
caName string
caCert string
caKey string <optional>
hsm HSMOptions <optional>

View Source shared/types.ts, line 47

Object

# PeerConfig

Contains all the necessary parameters to establish a connection to a Fabric peer and interact with chaincode

Configuration for connecting to a Hyperledger Fabric peer

Properties:
Name Type Attributes Description
cryptoPath string

Path to the crypto materials

keyCertOrDirectoryPath string

Key file contents or Path to the directory containing private keys

certCertOrDirectoryPath string

Cert file contents or Path to the directory containing certificates

tlsCert string

Path to the TLS certificate

peerEndpoint string

Endpoint URL for the peer

peerHostAlias string

Host alias for the peer

caEndpoint string

Endpoint URL for the certificate authority

caTlsCertificate string

TLS certificate for the certificate authority

caCert string

Certificate for the certificate authority

caKey string

Key for the certificate authority

chaincodeName string

Name of the chaincode to interact with

contractName string <optional>

Optional name of the specific contract within the chaincode

ca string <optional>

Optional certificate authority name

mspId string

Membership Service Provider ID

channel string

Channel name

cryptoPath string
keyCertOrDirectoryPath string | Buffer
certCertOrDirectoryPath string | Buffer
tlsCert string | Buffer
peerEndpoint string
peerHostAlias string
caEndpoint string <optional>
caTlsCertificate string <optional>
caCert string <optional>
caKey string <optional>
chaincodeName string
contractName string <optional>
ca string <optional>
mspId string
channel string
hsm HSMOptions <optional>

View Source shared/types.ts, line 8