@web3-storage/aggregate-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published


web3.storage

The aggregate client for https://web3.storage

About

The @web3-storage/aggregate-client package provides the "low level" client API for aggregating data uploaded with the w3up platform. It is based on [web3-storage/specs/w3-aggregation.md])https://github.com/web3-storage/specs/blob/feat/filecoin-spec/w3-aggregation.md) and is not intended for web3.storage end users.

Install

Install the package using npm:

npm install @web3-storage/aggregate-client

Usage

aggregateOffer

function aggregateOffer(
  conf: InvocationConfig,
  piece: Piece,
  offer: Piece[],
): Promise<{ status: string }>

Ask the service to create an aggregate offer and put it available for Storage Providers.

More information: InvocationConfig

aggregateGet

function aggregateGet(
  conf: InvocationConfig,
  subject: PieceCID,
): Promise<unkown>

Ask the service to get deal details of an aggregate.

More information: InvocationConfig

Types

Piece

An offered CAR to be part of an Aggregate.

export interface Piece {
  link: PieceCID
  size: number
}

export type PieceCID = ReturnType<typeof CommP.toCID>

InvocationConfig

This is the configuration for the UCAN invocation. It is an object with issuer, audience, resource and proofs:

  • The issuer is the signing authority that is issuing the UCAN invocation(s).
  • The audience is the principal authority that the UCAN is delegated to.
  • The resource (with field) points to a storage space.
  • The proofs are a set of capability delegations that prove the issuer has the capability to perform the action. These might not be required.

Contributing

Feel free to join in. All welcome. Please open an issue!

License

Dual-licensed under MIT + Apache 2.0

Readme

Keywords

none

Package Sidebar

Install

npm i @web3-storage/aggregate-client

Weekly Downloads

1

Version

1.0.0

License

Apache-2.0 OR MIT

Unpacked Size

15.4 kB

Total Files

14

Last publish

Collaborators

  • it-dag-house
  • gozala
  • olizilla
  • vascosantos
  • alanshaw