Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@web3-storage/capabilities

Package Overview
Dependencies
Maintainers
5
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3-storage/capabilities - npm Package Compare versions

Comparing version 9.0.0 to 9.0.1

3

dist/src/types.d.ts

@@ -31,2 +31,5 @@ import type { TupleToUnion } from 'type-fest';

}
/**
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
export type PieceLinkSchema = Schema.Schema<PieceLink>;

@@ -33,0 +36,0 @@ export type Access = InferInvokedCapability<typeof AccessCaps.access>;

4

package.json
{
"name": "@web3-storage/capabilities",
"version": "9.0.0",
"version": "9.0.1",
"description": "Capabilities provided by web3.storage",

@@ -53,3 +53,3 @@ "homepage": "https://github.com/web3-storage/w3protocol/tree/main/packages/capabilities",

"@ucanto/validator": "^8.0.0",
"@web3-storage/data-segment": "^2.2.0"
"@web3-storage/data-segment": "^3.0.1"
},

@@ -56,0 +56,0 @@ "devDependencies": {

@@ -16,10 +16,18 @@ /**

/**
* @see https://github.com/multiformats/go-multihash/blob/dc3bd6897fcd17f6acd8d4d6ffd2cea3d4d3ebeb/multihash.go#L73
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
const SHA2_256_TRUNC254_PADDED = 0x1012
const FR32_SHA2_256_TRUNC254_PADDED_BINARY_TREE = 0x1011
/**
* @see https://github.com/ipfs/go-cid/blob/829c826f6be23320846f4b7318aee4d17bf8e094/cid.go#L104
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
const FilCommitmentUnsealed = 0xf101
const RAW_CODE = 0x55
const PIECE_LINK = Schema.link({
code: RAW_CODE,
version: 1,
multihash: {
code: FR32_SHA2_256_TRUNC254_PADDED_BINARY_TREE,
},
})
/**

@@ -42,12 +50,6 @@ * `filecoin/add` capability allows agent to add a filecoin piece to be aggregated

* CID of the piece.
*
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
piece: /** @type {import('./types').PieceLinkSchema} */ (
Schema.link({
code: FilCommitmentUnsealed,
version: 1,
multihash: {
code: SHA2_256_TRUNC254_PADDED,
},
})
),
piece: /** @type {import('./types').PieceLinkSchema} */ (PIECE_LINK),
}),

@@ -77,12 +79,6 @@ derives: (claim, from) => {

* CID of the piece.
*
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
piece: /** @type {import('./types').PieceLinkSchema} */ (
Schema.link({
code: FilCommitmentUnsealed,
version: 1,
multihash: {
code: SHA2_256_TRUNC254_PADDED,
},
})
),
piece: /** @type {import('./types').PieceLinkSchema} */ (PIECE_LINK),
/**

@@ -126,13 +122,7 @@ * Storefront requestin piece to be aggregated

* Commitment proof for the aggregate being offered.
* https://github.com/filecoin-project/go-state-types/blob/1e6cf0d47cdda75383ef036fc2725d1cf51dbde8/abi/piece.go#L47-L50
*
* @see https://github.com/filecoin-project/go-state-types/blob/1e6cf0d47cdda75383ef036fc2725d1cf51dbde8/abi/piece.go#L47-L50
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
aggregate: /** @type {import('./types').PieceLinkSchema} */ (
Schema.link({
code: FilCommitmentUnsealed,
version: 1,
multihash: {
code: SHA2_256_TRUNC254_PADDED,
},
})
),
aggregate: /** @type {import('./types').PieceLinkSchema} */ (PIECE_LINK),
/**

@@ -171,12 +161,6 @@ * Storefront requesting deal

* CID of the piece.
*
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
piece: /** @type {import('./types').PieceLinkSchema} */ (
Schema.link({
code: FilCommitmentUnsealed,
version: 1,
multihash: {
code: SHA2_256_TRUNC254_PADDED,
},
})
),
piece: /** @type {import('./types').PieceLinkSchema} */ (PIECE_LINK),
}),

@@ -183,0 +167,0 @@ derives: (claim, from) => {

@@ -36,2 +36,5 @@ import type { TupleToUnion } from 'type-fest'

/**
* @see https://github.com/filecoin-project/FIPs/pull/758/files
*/
export type PieceLinkSchema = Schema.Schema<PieceLink>

@@ -38,0 +41,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc