💸Paymaster Support

Instance banana using with paymaster

Paymasters

Banana SDK enables gasless transactions with the help of Paymaster which acts as a middleman for sponsoring user transactions.

To enable Paymaster using Banana SDK you will be required to pass an array containing the paymaster url Along with the chainid of the chain the Paymaster is supporting.

Usage:

// importing Banana and Chains module from sdk
import { Banana, Chains } from '@rize-labs/banana-wallet-sdk';

const paymasterOptions = [
  {
     chainId: '80001', // for mumbai
     paymasterUrl: '<paymaster url>'
  },
  {
     chainId: '420', // for optimism goerli
     paymasterUrl: '<paymaster url>'
  }
];

const bananaInstance = new Banana(Chains.mumbai, paymasterOptions);

For now, if you had passed paymasterOptions while creating a banana instance all the transactions for which the paymaster Url is provided would get sponsored.

Last updated