Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@manifoldxyz/frontend-provider-utils
Advanced tools
A tiny utility for detecting the Manifold Ethereum provider, an injected `window.ManifoldEthereumProvider` object
A tiny utility for detecting the Manifold Ethereum provider, an injected window.ManifoldEthereumProvider
object
Install this package using npm:
npm install @manifoldxyz/frontend-provider-utils
Or using yarn:
yarn add @manifoldxyz/frontend-provider-utils
Node.js
import { detectManifoldEthereumProvider } from '@manifoldxyz/frontend-provider-utils'
const manifoldProvider = await detectManifoldEthereumProvider()
if (provider) {
console.log('Manifold Ethereum successfully detected!')
// From now on, this should always be true:
// provider === window.ManifoldEthereumProvider
const oAuthToken = await manifoldProvider.getOAuth({
appName,
clientId,
grantType,
strictAuth
});
} else {
// if the provider is not detected, detectManifoldEthereumProvider resolves to null
}
Options
The exported function takes an optional options object. If invalid options are provided, an error will be thrown. All options have default values.
options.silent
Type: boolean
Default: false
Whether error messages should be logged to the console. Does not affect errors thrown due to invalid options.
options.timeout
Type: number
Default: 3000
How many milliseconds to wait for asynchronously injected manifold provider.
The Manifold Ethereum Provider is synchronously injected.
To notify sites of the injection, Manifold Ethereum Provider dispatches the 'manifold-ethereum-initialized' event on window immediately after the provider has been set as window.ManifoldEthereumProvider. This package relies on that event to detect the injection.
Overwriting or Modifying window.ManifoldEthereumProvider.
The detected provider object returned by this package will strictly equal (===) window.ManifoldEthereumProvider for the entire page lifecycle, unless window.ManifoldEthereumProvider is overwritten. Consumers should never overwrite window.ManifoldEthereumProvider or attempt to modify the provider object.
Contributions are welcome. Please open an issue or submit a pull request on our GitHub repository.
FAQs
A tiny utility for detecting the Manifold Ethereum provider, an injected `window.ManifoldEthereumProvider` object
The npm package @manifoldxyz/frontend-provider-utils receives a total of 49 weekly downloads. As such, @manifoldxyz/frontend-provider-utils popularity was classified as not popular.
We found that @manifoldxyz/frontend-provider-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.