> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lootroute.volvox.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Utilities

> WGG-first API resolution and WoW secret-value unwrapping.

## API resolution — `Util/Api.lua`

WGG exposes some capabilities under multiple names (e.g. `FileRead` vs `ReadFile`). These helpers resolve the first available candidate, checking `WGG[name]` **before** `_G[name]` for each. Both are dot-called (no `self`) and are public framework API consumed by remotely loaded modules — keep them additive and backward compatible.

```lua theme={null}
---@param ... string   -- candidate API names, tried in order
---@return function|nil fn
function volvox.ResolveApiFunction(...)
```

Returns the first candidate that maps to a **function**. Use for callables (file I/O, JSON codecs) where a non-function value is unusable.

```lua theme={null}
---@param ... string   -- candidate API names, tried in order
---@return any value
function volvox.ResolveApi(...)
```

Same WGG-first resolution but returns the first **non-nil value of any type** (also resolves tables/constants such as `C_CombatLog`). Callers must type-check.

```lua theme={null}
local ReadFile = volvox.ResolveApiFunction("FileRead", "ReadFile")
if ReadFile then
  local contents = ReadFile(path)
end
```

## Secret-value unwrapping — `Util/Secure.lua`

Retail WoW wraps some API return values in "secret value" protections. These helpers unwrap them into plain Lua values.

```lua theme={null}
---@param value any
---@return any unwrapped
volvox.UnwrapSecret(value)
```

Recursively unwraps a secret value; non-secret tables are deep-copied with each element unwrapped. Returns `nil` when unwrap is unsupported or fails. Aliases: `volvox.SecretUnwrap`, `volvox.secretunwrap`, `volvox.secretUnwrap`.

```lua theme={null}
---@param ... any
---@return any ...
volvox.UnwrapSecretValues(...)
```

Unwraps a vararg list preserving arity (including trailing nils). Aliases: `volvox.unwrapsecretvalues`, `volvox.UnwrapSecrets`.

```lua theme={null}
---@return any ...
volvox.GetCombatLogEventInfo()
```

`pcall`-wraps the resolved combat-log event-info function (`CombatLogGetCurrentEventInfo` or `C_CombatLog.GetCurrentEventInfo`) and returns up to 30 unwrapped fields; `nil` on failure. This is what [`volvox.EventHandler`](/framework/events) uses to read the combat log.

<Note>
  On retail, the file also self-installs secret-unwrapping wrappers over a curated list of Unit/Spell APIs and `C_Spell` methods (idempotent; originals stashed internally).
</Note>
