Web Utilities
hethers.utils.fetchJson( urlOrConnectionInfo [ , json [ , processFunc ] ] ) ⇒ Promise<any>
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>
hethers.utils.poll( pollFunc [ , options ] ) ⇒ Promise<any>Repeatedly call pollFunc using the PollOptions until it returns a value other than undefined.
ConnectionInfo
connection.url ⇒ string
connection.url ⇒ stringThe URL to connect to.
connection.user ⇒ string
connection.user ⇒ stringThe username to use for Basic Authentication. The default is null (i.e. do not use basic authentication)
connection.password ⇒ string
connection.password ⇒ stringThe password to use for Basic Authentication. The default is null (i.e. do not use basic authentication)
connection.allowInsecureAuthentication ⇒ boolean
connection.allowInsecureAuthentication ⇒ booleanAllow Basic Authentication over non-secure HTTP. The default is false.
connection.timeout ⇒ number
connection.timeout ⇒ numberHow long to wait before rejecting with a timeout error.
connection.headers ⇒ {[key:string]:string}
connection.headers ⇒ {[key:string]:string}Additional headers to include in the connection.
PollOptions
options.timeout ⇒ number
options.timeout ⇒ numberThe amount of time allowed to elapse before triggering a timeout error.
options.floor ⇒ number
options.floor ⇒ numberThe minimum time limit to allow for Exponential Backoff.
The default is 0s.
options.ceiling ⇒ number
options.ceiling ⇒ numberThe maximum time limit to allow for Exponential Backoff.
The default is 10s.
options.interval ⇒ number
options.interval ⇒ numberThe interval used during Exponential Backoff calculation.
The default is 250ms.
options.retryLimit ⇒ number
options.retryLimit ⇒ numberThe 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.
Last updated