Deposit

Using this API call we can deposit funds to a paymaster address.

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

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

  // initializating Paymaster service using the apiKey...
   const paymasterService = new Paymaster(apiKey);
   
   // Deposit using the specified amount and chainId
   const response = await paymasterService.deposit(amount, chainId);

   // Log the deposit response
   console.log('response', response);
})()

Last updated