Koi Paymaster Service
Integrate the Mute Paymaster into your dApp
Integration
const PAYMASTER_ADDRESS = '0x4ae2Ba9A5C653038C6d2F5D9F80B28011A454597'
...
// approve the token for spending via the paymaster
...
const greeting = "a new greeting";
const tx = await greeter.populateTransaction.setGreeting(greeting);
const gasPrice = await sender.provider.getGasPrice();
const gasLimit = await greeter.estimateGas.setGreeting(greeting);
const paymasterParams = utils.getPaymasterParams(testnetPaymaster, {
type: "ApprovalBased",
TOKEN_ADDRESS,
minimalAllowance: ethers.BigNumber.from(1),,
innerInput: new Uint8Array(),
});
const sentTx = await sender.sendTransaction({
...tx,
maxFeePerGas: gasPrice,
maxPriorityFeePerGas: BigNumber.from(0),
gasLimit,
customData: {
gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
paymasterParams,
},
});Supported Tokens
Last updated