Versions in this module Expand all Collapse all v1 v1.0.0 Oct 10, 2026 Changes in this version + const ChainGenesisHash + const LineageTypeBoth + const LineageTypeCredit + const LineageTypeDebit + const LineageTypeShadowCommit + const LineageTypeShadowVoid + const OutboxStatusCompleted + const OutboxStatusFailed + const OutboxStatusPending + const OutboxStatusProcessing + const PreviewRoleDestination + const PreviewRoleSource + const RefundReferenceSuffix + func ApplyPrecision(transaction *Transaction) *big.Int + func ApplyPrecisionChecked(transaction *Transaction) (*big.Int, error) + func ApplyPrecisionWithDBLookup(transaction *Transaction, db *sql.DB) *big.Int + func ApplyPrecisionWithDBLookupChecked(transaction *Transaction, db *sql.DB) (*big.Int, error) + func ApplyRate(preciseAmount *big.Int, rate float64) *big.Int + func CalculateDistributionsPrecise(ctx context.Context, totalPreciseAmount *big.Int, distributions []Distribution, ...) (map[string]*big.Int, error) + func CanonicalChainV2(prevHash string, r ChainRow) []byte + func CanonicalChainV3(prevHash string, r ChainRow) []byte + func ComputeChainHash(prevHash string, r ChainRow) string + func ComputeChainHashVersion(version int, prevHash string, r ChainRow) (string, error) + func DecodeTransactionMetadata(data []byte, t *Transaction) error + func GenerateKey() (string, error) + func GenerateUUIDWithSuffix(module string) string + func Int64ToBigInt(value int64) *big.Int + func ParseAmount(amount string, precision float64) (*big.Int, error) + func PrecisionBankersRound(num float64, precision float64) float64 + func RefundReference(originalTransactionID string) string + func UpdateBalances(transaction *Transaction, source, destination *Balance) error + func ValidateCustomerTransactionMetadata(metadata map[string]interface{}) error + func ValidatePrecision(precision float64) error + type APIKey struct + APIKeyID string + CreatedAt time.Time + ExpiresAt time.Time + IsRevoked bool + Key string + LastUsedAt time.Time + Name string + OwnerID string + ParentAPIKeyID string + RevokedAt *time.Time + Scopes []string + func NewAPIKey(name, ownerID string, scopes []string, expiresAt time.Time) (*APIKey, error) + func (k *APIKey) HasScope(scope string) bool + func (k *APIKey) IsValid() bool + type Account struct + AccountID string + Balance *Balance + BalanceID string + BankName string + CreatedAt time.Time + Currency string + Identity *Identity + IdentityID string + Ledger *Ledger + LedgerID string + MetaData map[string]interface{} + Name string + Number string + type AlertCondition struct + Field string + Operator string + PreciseValue *big.Int + Precision float64 + Value float64 + type Balance struct + AllocationStrategy string + Balance *big.Int + BalanceID string + CreatedAt time.Time + CreditBalance *big.Int + Currency string + CurrencyMultiplier float64 + DebitBalance *big.Int + ID int64 + Identity *Identity + IdentityID string + Indicator string + InflightBalance *big.Int + InflightCreditBalance *big.Int + InflightDebitBalance *big.Int + InflightExpiresAt time.Time + Ledger *Ledger + LedgerID string + MetaData map[string]interface{} + QueuedCreditBalance *big.Int + QueuedDebitBalance *big.Int + TrackFundLineage bool + Version int64 + func (balance *Balance) Clone() *Balance + func (balance *Balance) CommitInflightCredit(transaction *Transaction) error + func (balance *Balance) CommitInflightDebit(transaction *Transaction) error + func (balance *Balance) InitializeBalanceFields() + func (balance *Balance) RollbackInflightCredit(amount *big.Int) error + func (balance *Balance) RollbackInflightDebit(amount *big.Int) error + type BalanceFilter struct + BalanceRange string + CreditBalanceRange string + Currency string + DebitBalanceRange string + From time.Time + ID int64 + LedgerID string + To time.Time + type BalanceMonitor struct + BalanceID string + CallBackURL string + Condition AlertCondition + CreatedAt time.Time + Description string + MonitorID string + func (bm *BalanceMonitor) CheckCondition(b *Balance) bool + type BalanceProjection struct + BalanceID string + Currency string + CurrentAvailable string + CurrentBalance string + CurrentCreditBalance string + CurrentDebitBalance string + CurrentInflightCreditBalance string + CurrentInflightDebitBalance string + ResultingAvailable string + ResultingBalance string + ResultingCreditBalance string + ResultingDebitBalance string + ResultingInflightCreditBalance string + ResultingInflightDebitBalance string + Role string + Virtual bool + type BalanceTracker struct + Balances map[string]*Balance + Frequencies map[string]int + Mutex sync.Mutex + type BulkTransactionPreview struct + Atomic bool + Balances []BalanceProjection + Cumulative bool + DryRun bool + Notes []string + Results []TransactionPreview + WouldApply bool + func (preview *BulkTransactionPreview) AddNote(note string) + func (preview *BulkTransactionPreview) Finalize() + type BulkTransactionRequest struct + Atomic bool + Inflight bool + RunAsync bool + SkipQueue bool + Transactions []*Transaction + type BulkTransactionResult struct + BatchID string + Error string + Status string + TransactionCount int + type ChainCheckpoint struct + Count int64 + CreatedAt time.Time + HeadHash string + Sequence int64 + type ChainIssue struct + Reason string + Sequence int64 + TransactionID string + type ChainRow struct + Amount string + CreatedAt time.Time + Currency string + Destination string + EffectiveDate *time.Time + ExecutionControls string + HistoricalRate string + ID string + OverdraftLimit string + ParentTransaction string + PreciseAmount string + Precision string + QueueAction string + Rate string + Reference string + ScheduledFor *time.Time + Source string + Status string + TransactionID string + type ChainState struct + ChainKey string + GenesisAt time.Time + GenesisHash string + HeadHash string + LastSeq int64 + UpdatedAt time.Time + type ChainVerifyResult struct + BrokenSeq int64 + BrokenTxnID string + HeadHash string + LastSeq int64 + Pending int64 + Reason string + Tampering []ChainIssue + Verified bool + type ChainedTransaction struct + CanonicalVersion int + ChainHash string + ChainPrevHash string + ChainSeq int64 + Row ChainRow + type Distribution struct + Distribution string + Identifier string + PreciseDistribution string + TransactionID string + type ExecutionControls struct + AllowOverdraft bool + Atomic bool + Destinations []Distribution + EconomicVersion int + GroupIDs []string + Inflight bool + InflightCommitDate time.Time + InflightExpiryDate time.Time + ParentKind string + QueueLane string + QueuedParent string + ReservedMetadata map[string]interface{} + ShadowFor string + SkipBalanceUpdate bool + SkipQueue bool + Sources []Distribution + func DecodeExecutionControls(data []byte) (ExecutionControls, error) + func (c ExecutionControls) Apply(t *Transaction) + type ExternalTransaction struct + Amount float64 + Currency string + Date time.Time + Description string + ID string + Reference string + Source string + func (et *ExternalTransaction) ToInternalTransaction() *Transaction + type Identity struct + Category string + City string + Country string + CreatedAt time.Time + DOB time.Time + EmailAddress string + FirstName string + Gender string + IdentityID string + IdentityType string + LastName string + MetaData map[string]interface{} + Nationality string + OrganizationName string + OtherNames string + PhoneNumber string + PostCode string + State string + Street string + func (i *Identity) IsFieldTokenized(fieldName string) bool + func (i *Identity) MarkFieldAsTokenized(fieldName string) + type KeyPolicy struct + APIKeyID string + BalanceIDs []string + DenyAll bool + InheritedFrom []string + LedgerIDs []string + Rules []SpendingRule + Version int64 + type Ledger struct + CreatedAt time.Time + ID int64 + LedgerID string + MetaData map[string]interface{} + Name string + type LedgerFilter struct + From time.Time + ID int64 + To time.Time + type LegProjection struct + Amount float64 + Identifier string + PreciseAmount string + Role string + type LineageMapping struct + AggregateBalanceID string + BalanceID string + CreatedAt time.Time + ID int64 + IdentityID string + Provider string + ShadowBalanceID string + type LineageOutbox struct + Attempts int + CreatedAt time.Time + DestinationBalanceID string + ID int64 + Inflight bool + LastError string + LineageType string + LockedUntil *time.Time + MaxAttempts int + Payload json.RawMessage + ProcessedAt *time.Time + Provider string + SourceBalanceID string + Status string + TransactionID string + type Match struct + Amount float64 + Date time.Time + ExternalTransactionID string + InternalTransactionID string + ReconciliationID string + type MatchingCriteria struct + AllowableDrift float64 + Field string + Operator string + Pattern string + Value string + type MatchingRule struct + CreatedAt time.Time + Criteria []MatchingCriteria + Description string + ID int64 + Name string + RuleID string + UpdatedAt time.Time + type PolicyAdmission struct + APIKeyID string + Day time.Time + DecidedBy string + Decision string + ID string + Identity string + Legs []PolicyLeg + Version int64 + type PolicyBudgetCapacity struct + APIKeyID string + Limit string + Used string + type PolicyCapacity struct + Budgets []PolicyBudgetCapacity + Currency string + Day time.Time + Precision float64 + Remaining *string + Used string + type PolicyLeg struct + Amount string + Currency string + Destination string + DestinationLedger string + Precision float64 + Reference string + Source string + SourceLedger string + TransactionID string + type PreviewRejection struct + Code string + Message string + Reason string + type Reconciliation struct + CompletedAt *time.Time + ID int64 + IsDryRun bool + MatchedTransactions int + ReconciliationID string + StartedAt time.Time + Status string + UnmatchedTransactions int + UploadID string + type ReconciliationProgress struct + LastProcessedExternalTxnID string + ProcessedCount int + type ReconciliationResults struct + CompletedAt *time.Time + MatchedTransactions []Match + ReconciliationID string + StartedAt time.Time + Status string + UnmatchedTransactions []string + type SpendingRule struct + ApprovalAbove string + Currency string + DailyLimit string + MaxTransaction string + Precision float64 + type Transaction struct + AllowOverdraft bool + Amount float64 + AmountString string + Atomic bool + CreatedAt time.Time + Currency string + Description string + Destination string + Destinations []Distribution + EffectiveDate *time.Time + GroupIds []string + Hash string + ID int64 + Inflight bool + InflightCommitDate time.Time + InflightExpiryDate time.Time + MetaData map[string]interface{} + OverdraftLimit float64 + ParentKind string + ParentTransaction string + PreciseAmount *big.Int + Precision float64 + QueueAction string + QueueLane string + QueuedParent string + Rate float64 + Reference string + ReservedMetadata map[string]interface{} + ScheduledFor time.Time + ShadowFor string + SkipBalanceUpdate bool + SkipQueue bool + Source string + Sources []Distribution + Status string + TransactionID string + func (t *Transaction) ExecutionControls() ExecutionControls + func (t *Transaction) ExecutionMetadata() map[string]interface{} + func (t *Transaction) GetEffectiveDate() time.Time + func (transaction *Transaction) Clone() *Transaction + func (transaction *Transaction) HashTxn() string + func (transaction *Transaction) SplitTransactionPrecise(ctx context.Context) ([]*Transaction, error) + func (transaction *Transaction) ToJSON() ([]byte, error) + func (transaction *Transaction) ValidateAmount() error + type TransactionPreview struct + Amount float64 + Balances []BalanceProjection + Currency string + DryRun bool + Legs []LegProjection + Notes []string + Operation string + PreciseAmount string + Precision float64 + Reference string + Rejection *PreviewRejection + Status string + WouldApply bool + func (preview *TransactionPreview) AddNote(note string) + func (preview *TransactionPreview) Finalize()