We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I am new to pimlico and permissionless
pimlico
permissionless
I have a working code when we need to bulk transfer out some NFTs from a smart account into a destination wallet, using sendTransactions()
sendTransactions()
https://docs.pimlico.io/permissionless/reference/smart-account-actions/sendTransactions
Wondering how to estimate the gas for these bulk transfers?
working code:
const transactions: { to: Address; data: Hex; }[] = []; selectedNfts.map((nft) => { transactions.push({ to: NFT_CONTRACT_ADDRESS, data: encodeFunctionData({ abi: contractAbi, functionName: "safeTransferFrom", args: [ smartAccountAddress, destinationWallet as `0x${string}`, BigInt(nft.tokenId), ], }), }); });
then
const transactionHash = await smartAccountClient.sendTransactions({ transactions: transactions, });
I saw this https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas but feel like its for single transaction
permissionless: 0.1.44 entry_point: v07
code that setup smartAccountClient:
const safeAccount = await signerToSafeSmartAccount(publicClient, { signer: customSigner, safeVersion: "1.4.1", entryPoint: ENTRYPOINT_ADDRESS_V07, }); const pimlicoPaymaster = createPimlicoPaymasterClient({ chain: networkToUse, transport: http(process.env.NEXT_PUBLIC_PIMLICO_PAYMASTER_URL), entryPoint: ENTRYPOINT_ADDRESS_V07, }); const pimlicoBundler = createPimlicoBundlerClient({ transport: http(process.env.NEXT_PUBLIC_PIMLICO_PAYMASTER_URL), entryPoint: ENTRYPOINT_ADDRESS_V07, }); const smartAccountClient = createSmartAccountClient({ account: safeAccount, entryPoint: ENTRYPOINT_ADDRESS_V07, chain: networkToUse, bundlerTransport: http(process.env.NEXT_PUBLIC_PIMLICO_PAYMASTER_URL), middleware: { sponsorUserOperation: pimlicoPaymaster.sponsorUserOperation, gasPrice: async () => (await pimlicoBundler.getUserOperationGasPrice()).fast, }, });
The text was updated successfully, but these errors were encountered:
You can estimate using estimateUserOperationGas
estimateUserOperationGas
bundlerClient.estimateUserOperationGas({ userOperation: { ...(await smartAccountClient.prepareUserOperationRequest({ userOperation: { callData: await smartAccount.encodeCallData([ { to: zeroAddress, value: 0n, data: "0x" }, { to: zeroAddress, value: 0n, data: "0x" } ]) } })) } })
Sorry, something went wrong.
No branches or pull requests
Hi,
I am new to
pimlico
andpermissionless
I have a working code when we need to bulk transfer out some NFTs from a smart account into a destination wallet, using
sendTransactions()
https://docs.pimlico.io/permissionless/reference/smart-account-actions/sendTransactions
Wondering how to estimate the gas for these bulk transfers?
working code:
then
I saw this https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas but feel like its for single transaction
permissionless: 0.1.44
entry_point: v07
code that setup smartAccountClient:
The text was updated successfully, but these errors were encountered: