Add To Whitelist

Using this API call we can whitelisting the address.

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

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

   // initializating Paymaster service using the apiKey...
   const paymasterService = new Paymaster(apiKey);
   
   // Add a whitelist paymaster using the specified accountAddress and chainId
   const response = await paymasterService.addWhitelist(accountAddress, chainId);

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

Last updated