Account statement context.
Provides access to Longbridge account statement data (daily and monthly statements) and statement file download URLs.
All functions accept a Longbridge.Config struct and return
{:ok, data} | {:error, reason} tuples.
Usage
config = Longbridge.Config.new(...)
{:ok, statements} = Longbridge.AssetContext.statements(config, :daily)
{:ok, url} = Longbridge.AssetContext.download_url(config, "file-key-abc")
Summary
Types
Functions
@spec download_url(Longbridge.Config.t(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
Gets a presigned download URL for a statement file.
file_key comes from the statements/2 response (the "file_key"
field of each list entry).
Endpoint: GET /v1/statement/download?file_key=<key>. The returned
URL is short-lived and points at the Longbridge file store; fetch it
with a regular HTTP client (not Longbridge.HTTPClient) before it
expires.
Returns {:ok, %{"url" => url, "expire_at" => unix_seconds}} or
{:error, reason}.
@spec statements(Longbridge.Config.t(), keyword(), keyword()) :: {:ok, map()} | {:error, term()}
Lists account statements.
Options
:type—:daily(default) or:monthly:page— page cursor for pagination (integer):page_size— results per page (default: 20)
Returns {:ok, %{"list" => [%{"dt" => date_int, "file_key" => key}]}}
or {:error, reason}.