Hierarchy

Constructors

Properties

_agent: Agent<Service>
_receiptsEndpoint: string | URL
_serviceConf: ServiceConf
capability: {
    access: AccessClient;
    filecoin: FilecoinClient;
    space: SpaceClient;
    store: StoreClient;
    subscription: SubscriptionClient;
    upload: UploadClient;
    usage: UsageClient;
}

Type declaration

coupon: CouponAPI

Accessors

Methods

  • Parameters

    • email: `${string}@${string}`
    • Optional options: {
          capabilities: undefined | Iterable<{
              can: Ability;
          }>;
          signal: undefined | AbortSignal;
      }
      • capabilities: undefined | Iterable<{
            can: Ability;
        }>
      • signal: undefined | AbortSignal

    Returns Promise<void>

    Deprecated

    • Use client.login instead.

    Authorize the current agent to use capabilities granted to the passed email account.

  • Create a delegation to the passed audience for the given abilities with the current space as the resource.

    Parameters

    • audience: Principal<`did:${string}:${string}`>
    • abilities: ("*" | "provider/add" | "space/*" | "space/info" | "store/add" | "store/remove" | "store/list" | "upload/add" | "upload/remove" | "upload/list" | "upload/*" | "upload/get" | "store/*" | "store/get" | "access/*" | "access/authorize" | "ucan/attest" | "ucan/conclude" | "customer/get" | "consumer/has" | "consumer/get" | "subscription/get" | "subscription/list" | "rate-limit/add" | "rate-limit/remove" | "rate-limit/list" | "filecoin/offer" | "filecoin/submit" | "filecoin/accept" | "filecoin/info" | "piece/offer" | "piece/accept" | "aggregate/offer" | "aggregate/accept" | "deal/info" | "admin/*" | "admin/upload/inspect" | "admin/store/inspect" | "plan/get" | "usage/*" | "usage/report" | "blob/*" | "blob/add" | "blob/remove" | "blob/list" | "web3.storage/blob/*" | "web3.storage/blob/allocate" | "web3.storage/blob/accept" | "http/put" | "index/*" | "index/add")[]
    • Optional options: Omit<UCANOptions, "audience"> & {
          audienceMeta?: AgentMeta;
      } = {}

    Returns Promise<Delegation<Capabilities>>

  • Removes association of a content CID with the space. Optionally, also removes association of CAR shards with space.

    ⚠️ If shards option is true all shards will be deleted even if there is another upload(s) that reference same shards, which in turn could corrupt those uploads.

    Parameters

    • contentCID: UnknownLink
    • Optional options: {
          shards: undefined | boolean;
      } = {}
      • shards: undefined | boolean

    Returns Promise<void>

  • Uploads a CAR file to the service.

    The difference between this function and capability.store.add is that the CAR file is automatically sharded and an "upload" is registered, linking the individual shards (see capability.upload.add).

    Use the onShardStored callback to obtain the CIDs of the CAR file shards.

    Parameters

    Returns Promise<AnyLink>

Generated using TypeDoc