Socket
Socket
Sign inDemoInstall

@glif/filecoin-message-confirmer

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glif/filecoin-message-confirmer

A service for confirming a Filecoin message.


Version published
Maintainers
3
Created
Source

filecoin-message

Install

npm i @glif/filecoin-message-confirmer

Usage

const confirmMessage = require('@glif/filecoin-message-confirmer')

const messageCid =
  'bafy2bzacebnyjf5oxzvts5f4ifqgee2yrqb7epdepnw3y2yk25ju5su2episg'
const optionalConfig = {}
const confirmed = await confirmMessage(messageCid, optionalConfig)
// > true if message is confirmed
// > false if message happened far in the past (just use a block explorer) or if the message isn't yet confirmed after ~7-8 minutes after sending

The confirmer takes an optional config:

interface ConfirmerConfig {
  apiAddress: string
  token?: string
  // the amount of time to timeout the request
  timeoutAfter?: number
  // the number of times this function calls itself, recursively
  totalRetries?: number
}

It's recommended to stick with the default values for timeoutAfter (90000 ms) and totalRetries (5 times)

Test

npm i
npm run test

License

This repository is dual-licensed under Apache 2.0 and MIT terms.

FAQs

Package last updated on 06 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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