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

@web3-storage/access

Package Overview
Dependencies
Maintainers
7
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3-storage/access - npm Package Compare versions

Comparing version 12.0.1 to 12.0.2

2

package.json
{
"name": "@web3-storage/access",
"version": "12.0.1",
"version": "12.0.2",
"description": "w3access client",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/web3-storage/w3-protocol/tree/main/packages/access-client",

@@ -118,38 +118,15 @@ import { addSpacesFromDelegations, Agent as AccessAgent } from './agent.js'

const interval = opts?.interval || 250
/** @type {ReturnType<typeof setTimeout>} */
let pollingTimeoutId
const claimed = await new Promise((resolve, reject) => {
opts?.signal?.addEventListener('abort', (e) => {
pollingTimeoutId && clearTimeout(pollingTimeoutId)
reject(
new Error('pollAccessClaimUntilSessionProof aborted', { cause: e })
)
while (true) {
if (opts?.signal?.aborted)
throw opts.signal.reason ?? new Error('operation aborted')
const res = await access.invokeAndExecute(w3caps.Access.claim, {
with: delegee,
})
poll(interval)
/**
* @param {number} retryAfter
*/
async function poll(retryAfter) {
const pollClaimResult = await access.invokeAndExecute(
w3caps.Access.claim,
{ with: delegee }
)
if (pollClaimResult.error) {
return reject(pollClaimResult)
}
try {
const claimedDelegations = Object.values(
pollClaimResult.delegations
).flatMap((d) => bytesToDelegations(d))
if (delegationsMatch(claimedDelegations)) {
resolve(claimedDelegations)
} else {
pollingTimeoutId = setTimeout(() => poll(retryAfter), retryAfter)
}
} catch (error) {
reject(error)
}
}
})
return claimed
if (res.error) throw res
const claims = Object.values(res.delegations).flatMap((d) =>
bytesToDelegations(d)
)
if (delegationsMatch(claims)) return claims
await new Promise((resolve) => setTimeout(resolve, interval))
}
}

@@ -156,0 +133,0 @@

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