First, initialize the SDK by importing Facet chains and clients.
import { walletL1FacetActions } from "@0xfacet/sdk/viem";
import { createWalletClient, http } from "viem";
const walletClient = createWalletClient({
chain: mainnet,
transport: http(),
}).extend(FacetViem.walletL1FacetActions);
const params = {
to: "0xReceiverAddress", // Required
data: "0x", // Optional
value: 0n, // Optional
};
const { l1TransactionHash, facetTransactionHash } =
await walletClient.sendFacetTransaction(params);
console.log("L1 Transaction Hash:", l1TransactionHash);
console.log("Facet Transaction Hash:", facetTransactionHash);