FinancialContribution
A ContributionResult with filter helpers.
On this page
A ContributionResult with filter helpers.
Helpers only filter; they never sum across providers or currencies.
JSON.stringify() yields exactly the protocol shape.
import { FinancialContribution } from "@sponsorkit/sdk";
class FinancialContribution implements ContributionResult { … }Class, exported from @sponsorkit/sdk, @sponsorkit/sdk/node, @sponsorkit/sdk/server.
Extends ContributionResult.
Constructors#
new FinancialContribution()#
new FinancialContribution(result: ContributionResult)Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
result | ContributionResult | required | See ContributionResult. |
Properties#
signedIn#
signedIn: booleandisabled#
disabled: booleanmock#
mock: booleantargets#
targets: string[]Canonical target strings, e.g. ["github:octocat"].
supporter#
supporter: Supporter | nullType: Supporter
contributions#
contributions: Contribution[]Type: Contribution
fetchedAt#
fetchedAt: string | nullstale#
stale: booleanSome provider could not be reached; its data (if any) comes from the local cache.
fromCache#
fromCache: booleanThe whole result was served from the local cache.
unavailable#
unavailable?: Provider[]Providers the API could not query (API results only).
Type: Provider
Methods#
active()#
active(): Contribution[]Contributions with status active.
Returns Contribution[] (Contribution)
recurring()#
recurring(): Contribution[]Recurring contributions (any status).
Returns Contribution[] (Contribution)
oneTime()#
oneTime(): Contribution[]One-time contributions (any status).
Returns Contribution[] (Contribution)
byProvider()#
byProvider(provider: Provider): Contribution[]Contributions on one provider.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
provider | Provider | required | See Provider. |
Returns Contribution[] (Contribution)
direct()#
direct(): Contribution[]Contributions made by the user themselves (excludes via: "organization").
Returns Contribution[] (Contribution)
toJSON()#
toJSON(): ContributionResultThe plain protocol object.
Returns ContributionResult (ContributionResult)