summarizeActivity
Add up the matching local activity per asset, overall and for each requested period, without returning its rows. Amounts are summed as recorded whatever their direction: filter by kind to keep incoming and outgoing apart. It reads through iterateActivity, so the same global deduplication, bounded hydration and cancellation apply, and nothing is acknowledged or sent anywhere.
Import
import { summarizeActivity } from "@0xcurvy/curvy-sdk/actions";Usage
const result = await summarizeActivity({ config });Signature
function summarizeActivity(parameters?: SummarizeActivityParameters): Promise<ActivitySummary>Returns
Promise<ActivitySummary>
The action resolves or returns the value shown in the signature.
Parameters
accountId
- Type:
string - Required: no
The account whose activity is summarized. Defaults to the active account.
const result = await summarizeActivity({
accountId,
});filters
- Type:
ActivityFilters - Required: no
Restrict the summary by free-text query, kinds, network slug or vault token id.
const result = await summarizeActivity({
filters,
});excludeStatuses
- Type:
readonly ActivityItem["status"][] - Required: no
Entries in these states are left out, for example failed or reorged ones.
const result = await summarizeActivity({
excludeStatuses,
});periods
- Type:
readonly number[] - Required: no
Period starts in Unix milliseconds, strictly ascending. A period runs to the next start and the last has no end. Entries before the first start are in no period.
const result = await summarizeActivity({
periods,
});batchSize
- Type:
number - Required: no
Maximum rich history rows hydrated together; defaults to 100.
const result = await summarizeActivity({
batchSize,
});signal
- Type:
AbortSignal - Required: no
Aborts the summary before later batches are hydrated.
const result = await summarizeActivity({
signal,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
const result = await summarizeActivity({
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
Source
packages/@0xcurvy/sdk/src/actions/views/summarizeActivity.ts