export class CouponAPI extends Base { /** * Redeems coupon from the the the archive. Throws an error if the coupon * password is invalid or if provided archive is not a valid. * * @param {Uint8Array} archive * @param {object} [options] * @param {string} [options.password] */ redeem(archive: Uint8Array, options?: { password?: string | undefined; }): Promise; /** * Issues a coupon for the given delegation. * * @param {Omit} options */ issue({ proofs, ...options }: Omit): Promise; } export function extract(archive: Uint8Array): Promise>; export function archive(coupon: Model): Promise, Error>>; export function issue({ password, ...options }: CouponOptions): Promise; export function redeem(coupon: Model, { agent, password }: { agent: API.Agent; password?: string | undefined; }): Promise>; export class Coupon { /** * @param {Model} model */ constructor(model: Model); model: Model; get proofs(): [API.Delegation]; /** * * @param {API.Agent} agent * @param {object} [options] * @param {string} [options.password] */ redeem(agent: API.Agent, options?: { password?: string | undefined; }): Promise>; archive(): Promise, Error>>; } /** * Issues a coupon for the given delegation. */ export type CouponOptions = Omit, "audience"> & { password?: string; }; export type Model = { proofs: [API.Delegation]; }; import { Base } from './base.js'; import { GrantedAccess } from '@storacha/access/access'; import * as API from '@storacha/access/types'; //# sourceMappingURL=coupon.d.ts.map