Hethers
  • Documentation
  • Getting Started
  • Application Programming Interface
    • Providers
      • Provider
        • Accounts Methods
        • Logs Methods
        • Network Status Methods
        • Transactions Methods
        • Event Emitter Methods
        • Base Provider
        • HederaProvider
      • Types
    • Contract Interaction
      • Contract
      • ContractFactory
      • Example: ERC-20 Contract
    • Utilities
      • Accounts
      • Addresses
      • Application Binary Interface
        • AbiCoder
        • ABI Formats
        • Fragments
        • Interface
      • BigNumber
      • Byte Manipulation
      • Constants
      • Display Logic and Input
      • Encoding Utilities
      • FixedNumber
      • Hashing Algorithms
      • HD Wallet
      • Logging
      • Property Utilities
      • Signing Key
      • Strings
      • Transactions
      • Web Utilities
      • Wordlists
    • Signers
  • Contributing
  • Other Resources
Powered by GitBook
On this page
  • ConnectionInfo
  • PollOptions
  1. Application Programming Interface
  2. Utilities

Web Utilities

PreviousTransactionsNextWordlists

Last updated 3 years ago

hethers.utils.fetchJson( urlOrConnectionInfo [ , json [ , processFunc ] ] ) ⇒ Promise<any>

Fetch and parse the JSON content from urlOrConnectionInfo, with the optional body json and optionally processing the result with processFun before returning it.

hethers.utils.poll( pollFunc [ , options ] ) ⇒ Promise<any>

Repeatedly call pollFunc using the until it returns a value other than undefined.

ConnectionInfo

connection.url ⇒ string

The URL to connect to.

connection.user ⇒ string

The username to use for . The default is null (i.e. do not use basic authentication)

connection.password ⇒ string

The password to use for . The default is null (i.e. do not use basic authentication)

connection.allowInsecureAuthentication ⇒ boolean

Allow over non-secure HTTP. The default is false.

connection.timeout ⇒ number

How long to wait before rejecting with a timeout error.

connection.headers ⇒ {[key:string]:string}

Additional headers to include in the connection.

PollOptions

options.timeout ⇒ number

The amount of time allowed to elapse before triggering a timeout error.

options.floor ⇒ number

The default is 0s.

options.ceiling ⇒ number

The default is 10s.

options.interval ⇒ number

The default is 250ms.

options.retryLimit ⇒ number

The number of times to retry in the event of an error or undefined is returned.

If this is specified, the polling will wait on new blocks from provider before attempting the pollFunc again.

If this is specified, the polling will occur on each poll cycle of provider before attempting the pollFunc again.

The minimum time limit to allow for .

The maximum time limit to allow for .

The interval used during calculation.

options.onceBlock ⇒

options.oncePoll ⇒

Exponential Backoff
Exponential Backoff
Exponential Backoff
Provider
Provider
Basic Authentication
Basic Authentication
Basic Authentication
PollOptions