Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/snippets/7702/embeddedSendTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// [!region createSmartAccount]
import { createPublicClient, Hex, http } from "viem";
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
import { to7702KernelSmartAccount, to7702SimpleSmartAccount } from "permissionless/accounts";
import {
to7702KernelSmartAccount,
to7702SimpleSmartAccount,
} from "permissionless/accounts";
import { sepolia } from "viem/chains";

// This is your EOA's private key
Expand All @@ -24,8 +27,7 @@ const simple7702Account = await to7702SimpleSmartAccount({
const kernel7702Account = await to7702KernelSmartAccount({
client,
owner: eoa7702,
})

});

// [!endregion createSmartAccount]

Expand Down Expand Up @@ -55,6 +57,11 @@ const smartAccountClient = createSmartAccountClient({
bundlerTransport: http(
`https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
),
userOperation: {
estimateFeesPerGas: async () => {
return (await pimlicoClient.getUserOperationGasPrice()).fast;
},
},
});
// [!endregion createSmartAccountClient]

Expand Down
Loading