Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing paymaster params to paymaster example #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rookmate
Copy link

Add missing paymaster params to paymaster example on the collapsible in page:

Before:

import { agwClient } from "./config";
import { parseAbi } from "viem";

const transactionHash = await agwClient.writeContract({
  abi: parseAbi(["function mint(address,uint256) external"]),
  address: "0xC4822AbB9F05646A9Ce44EFa6dDcda0Bf45595AA",
  functionName: "mint",
  args: ["0x273B3527BF5b607dE86F504fED49e1582dD2a1C6", BigInt(1)],
});

After:

import { agwClient } from "./config";
import { parseAbi } from "viem";

const transactionHash = await agwClient.writeContract({
  abi: parseAbi(["function mint(address,uint256) external"]),
  address: "0xC4822AbB9F05646A9Ce44EFa6dDcda0Bf45595AA",
  functionName: "mint",
  args: ["0x273B3527BF5b607dE86F504fED49e1582dD2a1C6", BigInt(1)],
  paymaster: "0x5407B5040dec3D339A9247f3654E59EEccbb6391",
  paymasterInput: getGeneralPaymasterInput({
    innerInput: "0x",
  }),
});

@jarrodwatts
Copy link
Collaborator

Are these fields meant to be supported on this method @coffeexcoin

@rookmate
Copy link
Author

Just as a note, they are currently working if you pass them on the method. They are just not type checked.
image

@coffeexcoin
Copy link
Contributor

It technically works but there isn't a great way to type it properly since we are overriding the existing WriteContract method.

I've been suggesting people put the paymaster params in an object and then use the spread operator (or use writeContractSponsored)

@rookmate
Copy link
Author

I don't think writeContractSponsored works with the session client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants