@storacha/client
Version:
Client for the storacha.network w3up api
40 lines • 1.33 kB
TypeScript
/**
* Client for interacting with the `usage/*` capabilities.
*/
export class AccountUsageClient extends Base {
/**
* Get a usage report for the passed space in the given time period.
*
* Required delegated capabilities:
* - `usage/report`
*
* @param {API.AccountDID} account
* @param {object} [options]
* @param {{ from: Date, to: Date }} [options.period]
* @param {import('../../types.js').SpaceDID[]} [options.spaces]
* @param {string} [options.nonce]
*/
get(account: API.AccountDID, options?: {
period?: {
from: Date;
to: Date;
} | undefined;
spaces?: `did:key:${string}`[] | undefined;
nonce?: string | undefined;
}): Promise<API.AccountUsageGetSuccess>;
}
export function get({ agent }: {
agent: API.Agent;
}, { account, spaces, period, nonce, proofs }: {
account: API.AccountDID;
spaces?: `did:key:${string}`[] | undefined;
period?: {
from: Date;
to: Date;
} | undefined;
nonce?: string | undefined;
proofs?: API.Delegation<API.Capabilities>[] | undefined;
}): Promise<API.Result<API.AccountUsageGetSuccess, API.AccountUsageGetFailure>>;
import { Base } from '../../base.js';
import * as API from '../../types.js';
//# sourceMappingURL=usage.d.ts.map