@glif/filecoin-message-confirmer
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.21latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.21
3.0.01
2.0.441
2.0.431
2.0.81
2.0.71
2.0.11
2.0.0-beta.121
2.0.0-beta.81
2.0.0-beta.71
2.0.0-beta.41
2.0.0-beta.01
2.0.0-alpha.131
2.0.0-alpha.111
2.0.0-alpha.101
2.0.0-alpha.91
1.1.11
1.1.1-alpha.51
1.1.1-alpha.01
1.1.01
1.1.0-beta.191
1.1.0-beta.171
1.1.0-beta.161
1.1.0-beta.141
1.1.0-beta.111
1.1.0-beta.101
1.1.0-beta.71
1.1.0-beta.11
1.1.0-beta.01
1.0.0-beta.51
1.0.0-beta.41
1.0.0-beta.31
1.0.0-beta.21
1.0.0-beta.11
1.0.0-beta.01

Package Sidebar

Install

npm i @glif/filecoin-message-confirmer

Weekly Downloads

35

Version

3.0.2

License

(Apache-2.0 OR MIT)

Unpacked Size

69.2 kB

Total Files

12

Last publish

Collaborators

  • schwartzz8990
  • bret
  • glifbot