compliance

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package compliance defines the provider-neutral contract for screening a blockchain address before it is trusted with money — the vault allowlist's upstream decision, not the allowlist itself (see pkg/services/vaultwatch and the vault contract's own allow_depositor/disallow_depositor for the enforcement side).

pkg/compliance/elliptic implements Screener against Elliptic's AML API. There is one provider today; this package stays small rather than inventing a registry for it, per pkg/payment/README.md's layering principles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuleHit

type RuleHit struct {
	RuleName   string
	RuleType   string
	Sanctioned bool
}

RuleHit names one provider-configured rule that fired during screening. Rules are configured in the provider's own UI, not by us — this surfaces what a compliance officer already decided, it does not replicate it.

type ScreenRequest

type ScreenRequest struct {
	// Address is the blockchain address to screen (a Stellar G... account
	// for wallet screening today).
	Address string
	// CustomerReference joins the screening to a KYB entity on the
	// provider's side — see the source design doc §4 on why this is the
	// counterparty's own identifier, decided before the first call.
	CustomerReference string
}

ScreenRequest is what a caller submits for screening.

type Screener

type Screener interface {
	ScreenAddress(ctx context.Context, req ScreenRequest) (*Screening, error)
}

Screener screens a blockchain address and reports what is known about it.

type Screening

type Screening struct {
	// AnalysisID and ScreeningID identify this screening for later lookup
	// against the provider directly (an audit trail beyond Raw).
	AnalysisID  string
	ScreeningID string
	Address     string
	Verdict     Verdict

	// RiskScore is a pointer deliberately: the provider can return null,
	// and a zero-valued float would read as "perfectly clean" — the single
	// most dangerous silent default available in this integration.
	RiskScore *float64

	Sanctioned bool
	Rules      []RuleHit
	ScreenedAt time.Time

	// Raw is the provider's full response, kept because a compliance
	// record has to be reproducible years later and a struct designed
	// today will not have a field for whatever the provider adds later.
	Raw json.RawMessage
}

Screening is the provider-neutral result of screening one address.

type Verdict

type Verdict string

Verdict is the policy decision derived from a screening, per the source design doc §10. It is a decision, not a score — Screening carries the score this was derived from.

const (
	// VerdictApproved: complete, no sanctions, score under threshold.
	VerdictApproved Verdict = "approved"
	// VerdictRejected: sanctions hit, or score over the hard threshold.
	// Final until a human overrides it.
	VerdictRejected Verdict = "rejected"
	// VerdictReview: score between the soft and hard thresholds, or a
	// review-worthy rule fired. Not permitted by default.
	VerdictReview Verdict = "review"
	// VerdictUnscreenable: the address has no on-chain history for the
	// provider to judge (Elliptic's 404 NotInBlockchain). Not a pass or a
	// fail — see the source design doc §4's "404 is the case that will
	// actually happen".
	VerdictUnscreenable Verdict = "unscreenable"
	// VerdictPending: the provider has not finished analysing the address,
	// or the call itself failed.
	VerdictPending Verdict = "pending"
)

Directories

Path Synopsis
Package elliptic implements compliance.Screener against Elliptic's AML API — wallet screening for a Stellar depositor address, the verdict policy that turns a risk score into a decision, and Standard Webhooks verification for rescreening callbacks.
Package elliptic implements compliance.Screener against Elliptic's AML API — wallet screening for a Stellar depositor address, the verdict policy that turns a risk score into a decision, and Standard Webhooks verification for rescreening callbacks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL