check-whitelist
The "Whitelist SDK" package provides a simple solution for verifying whether a given Ethereum address is whitelisted. It offers features for adding and removing addresses from a whitelist and checking whether an address is included. By installing the package and using its functions, access control can be simplified and made more effective. Further research or consultation with experienced developers may help in utilizing this package.
Getting an API Key
To use this package, you'll need to obtain an API key from the WhitelistSDK website. Follow these steps to get an API key:
- Go to https://whitelistwizard.xyz in your web browser.
- Sign up or log in to your account.
- Once you're logged in, you should see your API key on the main dashboard.
Adding Whitelisted Addresses
To add whitelisted addresses, follow these steps:
- Go to https://whitelistwizard.xyz in your web browser.
- Sign up or log in to your account.
- Enter the Ethereum addresses that you want to whitelist under "Add whitelist addresses" field and click the "Add Addresses" button.
- Congratulations, you have successfully added your whitelisted addresses!
- Please note that only the addresses that you have added will be able to access your app.
Installation
You can install this package using npm:
npm install check-whitelist
or
yarn add check-whitelist
Usage
To use this package, first import the useWhitelist
function:
const apiKey = "YOUR_API_KEY_GENERATED_BY_WHITELISTWIZARD";
const client = new CheckWhitelistClient(apiKey);
Then, call the useWhitelist function with an address and an API key:
const isWhitelisted = await client.isWhitelisted(address);
if (isWhitelisted) {
console.log('The address is whitelisted!');
} else {
console.log('The address is not whitelisted.');
}
API
isWhitelisted(address: string): Promise<boolean>
Checks whether the given address is whitelisted using the API key specified by apiKey. Returns a boolean indicating whether the address is whitelisted.
Contributing
If you find a bug or have a feature request, please open an issue on GitHub. Pull requests are also welcome!
About the Author
Untitled labs empowers businesses and individuals to participate in the decentralized economy with user-friendly Web3 products and services.
Untitled Labs : Twitter