EIP-1193 is a standard interface for Ethereum providers, such as MetaMask or hardware wallets, where the key material is hosted externally rather than on the local client.
Copy import { ENTRYPOINT_ADDRESS_V07, createSafeSmartAccount,
createSmartAccountClient } from "@cometh/connect-sdk-4337";
import { http } from "viem"
import { providerToSmartAccountSigner } from "permissionless";
const apiKey = process.env.COMETH_API_KEY;
const bundlerUrl = process.env.4337_BUNDLER_URL;
const rpcUrl = process.env.RPC_URL;
const signer = await providerToSmartAccountSigner(
window.ethereum
);
const smartAccount = await createSafeSmartAccount({
apiKey,
rpcUrl,
chain: arbitrumSepolia,
entryPoint: ENTRYPOINT_ADDRESS_V07,
signer
});
const walletAddress = smartAccount.address
const smartAccountClient = createSmartAccountClient({
account: smartAccount,
entryPoint: ENTRYPOINT_ADDRESS_V07,
chain: arbitrumSepolia,
bundlerTransport: http(bundlerUrl)
})
Copy import { ENTRYPOINT_ADDRESS_V07, createSafeSmartAccount,
createSmartAccountClient } from "@cometh/connect-sdk-4337";
import { http } from "viem"
import { walletClientToSmartAccountSigner } from "permissionless";
const apiKey = process.env.COMETH_API_KEY;
const bundlerUrl = process.env.4337_BUNDLER_URL;
const rpcUrl = process.env.RPC_URL;
const signer = walletClientToSmartAccountSigner(walletClient);
const smartAccount = await createSafeSmartAccount({
apiKey,
rpcUrl,
chain: arbitrumSepolia,
entryPoint: ENTRYPOINT_ADDRESS_V07,
signer
});
const walletAddress = smartAccount.address
const smartAccountClient = createSmartAccountClient({
account: smartAccount,
entryPoint: ENTRYPOINT_ADDRESS_V07,
chain: arbitrumSepolia,
bundlerTransport: http(bundlerUrl)
})