Bourse.PublicAcceptedRequests (bourse v0.1.0)

Copy Markdown View Source

Records and replays provider-accepted public request branches.

Branch inventory comes from the owned unified endpoint routing. Only unauthenticated, non-transactional reads are eligible; every request is sent sequentially and must receive HTTP 200 from the provider.

Summary

Functions

Returns a golden's stable relative fixture path.

Returns the bulk public-acceptance fixture root.

Derives every eligible public request branch from the owned runtime specs.

Derives one venue's eligible public request branches.

Loads and validates the committed bulk manifest and all named goldens.

Builds a complete manifest document from capture results.

Returns manifest completeness and safety errors without raising.

Returns the bulk public-acceptance manifest path.

Records one public request branch, returning a golden or dated exclusion.

Records all branches for one venue without credentials.

Deterministically rebuilds and validates one committed public golden.

Returns structural credential and account-identity leaks in a golden.

Returns the public sign-path slot exercised by a branch.

Validates the committed manifest against the current authored branch inventory.

Types

branch()

@type branch() :: %{
  key: String.t(),
  venue: String.t(),
  method: atom(),
  js_method: String.t(),
  required_params: [atom()],
  branch: String.t(),
  endpoint_index: non_neg_integer(),
  config: map()
}

capture_result()

@type capture_result() :: {:golden, map()} | {:exclusion, map()}

Functions

fixture_relative_path(map)

@spec fixture_relative_path(map()) :: Path.t()

Returns a golden's stable relative fixture path.

fixture_root()

@spec fixture_root() :: Path.t()

Returns the bulk public-acceptance fixture root.

inventory()

@spec inventory() :: [branch()]

Derives every eligible public request branch from the owned runtime specs.

inventory(venue)

@spec inventory(String.t()) :: [branch()]

Derives one venue's eligible public request branches.

load_all!(root \\ "/Users/efries/_DATA/code/ccxt_client/test/fixtures/public_accepted_requests")

@spec load_all!(Path.t()) :: {map(), [{map(), map()}]}

Loads and validates the committed bulk manifest and all named goldens.

manifest(results, generated_at \\ DateTime.utc_now())

@spec manifest([capture_result()], DateTime.t()) :: map()

Builds a complete manifest document from capture results.

manifest_errors(manifest, expected, root \\ nil)

@spec manifest_errors(map(), [branch() | map()], Path.t() | nil) :: [String.t()]

Returns manifest completeness and safety errors without raising.

manifest_path()

@spec manifest_path() :: Path.t()

Returns the bulk public-acceptance manifest path.

record_branch(branch, opts \\ [])

@spec record_branch(
  branch(),
  keyword()
) :: capture_result()

Records one public request branch, returning a golden or dated exclusion.

record_venue(venue, opts \\ [])

@spec record_venue(
  String.t(),
  keyword()
) :: [capture_result()]

Records all branches for one venue without credentials.

replay(golden)

@spec replay(map()) :: :ok | {:error, term()}

Deterministically rebuilds and validates one committed public golden.

scrub_violations(golden)

@spec scrub_violations(term()) :: [String.t()]

Returns structural credential and account-identity leaks in a golden.

sign_path(map)

@spec sign_path(branch() | map()) :: String.t()

Returns the public sign-path slot exercised by a branch.

validate_manifest!(manifest, root \\ "/Users/efries/_DATA/code/ccxt_client/test/fixtures/public_accepted_requests")

@spec validate_manifest!(map(), Path.t()) :: :ok

Validates the committed manifest against the current authored branch inventory.