Check Whitelist

Using this API call we can check if an accountAddress is whitelisted for a specific paymaster address.

import 'dotenv/config';
import { Paymaster } from '@kanalabs/mirai';

(async () => {
   
   // Define the accountAddress, sponsorAddress, chainId and apiKey
   const accountAddress = '0x2DA84874572d7F0b80c8375BE5dE438Ff2247805';
   const sponsorAddress = '0x7305B1a9bDD8247DeB288BC2d271626159cB8c4c';
   const chainId = 80001;
   const apiKey = process.env.PAYMASTER_API_KEY || '';

   // initializating Paymaster service using the apiKey...
   const paymasterService = new Paymaster(apiKey);

  // Check a whitelist paymaster using the specified accountAddress, sponsorAddress and chainId
   const response = await paymasterService.checkWhitelist(accountAddress, sponsorAddress, chainId);

   // Log the check whitelist paymaster response
   console.log('response', response);
})()

Last updated