### Install Dependencies Source: https://docs.zk.email/zk-email-sdk/running-the-example Navigate to the example directory and install project dependencies using either Yarn or npm. ```bash cd example yarn install | npm install ``` -------------------------------- ### Install DFX (IC SDK CLI) Source: https://docs.zk.email/email-wallet/relayer-infrastructure/icp-account-setup Installs the DFX command-line tool for interacting with the Internet Computer. Verify the installation by checking the version. ```bash sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)" ``` ```bash dfx --version ``` -------------------------------- ### Copy Environment Example File Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Copies the example environment file to be used for configuration. ```bash cp packages/relayer/.env.example packages/relayer/.env ``` -------------------------------- ### Install jwt-tx-builder-helpers Source: https://docs.zk.email/jwt-tx-builder/packages/helpers Install the helper package using yarn. ```bash yarn add @zk-email/jwt-tx-builder-helpers ``` -------------------------------- ### Install Dependencies with npm Source: https://docs.zk.email/jwt-tx-builder/setup Installs the necessary frontend and utility dependencies using npm. Ensure Node.js 16+ and npm or yarn are installed. ```bash npm install @chakra-ui/react @chakra-ui/icons @emotion/react @emotion/styled npm install @zk-email/relayer-utils axios viem framer-motion ``` -------------------------------- ### Install @zk-email/circuits Source: https://docs.zk.email/zk-email-verifier/packages/zk-email-circuits Install the @zk-email/circuits package using yarn. ```bash yarn add @zk-email/circuits ``` -------------------------------- ### Install jwt-tx-builder-circuits Source: https://docs.zk.email/jwt-tx-builder/packages/circuits Install the package using yarn. ```bash yarn add @zk-email/jwt-tx-builder-circuits ``` -------------------------------- ### Start Prover Locally Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Runs the prover service locally using Python. Ensure all prerequisites and Python packages are installed. ```python python3 packages/prover/local.py ``` -------------------------------- ### Install Rust Source: https://docs.zk.email/email-wallet/relayer-infrastructure/icp-account-setup Installs Rust using the official script. Restart your terminal after installation to use Rust commands. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ```bash rustc --version ``` -------------------------------- ### Install ZK Email SDK with bun Source: https://docs.zk.email/zk-email-sdk/setup Use this command to install the SDK using bun. ```bash bun add @zk-email/sdk ``` -------------------------------- ### Install Dependencies Source: https://docs.zk.email/email-tx-builder/quickstart Navigate to the 'ts' directory and install project dependencies using yarn. ```bash cd ts yarn install ``` -------------------------------- ### Start Development Server Source: https://docs.zk.email/jwt-tx-builder/setup Run this command to start the local development server. The application will then be accessible at http://localhost:3000. ```bash npm run dev ``` -------------------------------- ### Install @zk-email/circuits Package Source: https://docs.zk.email/zk-email-verifier/setup Install the @zk-email/circuits package for generating proofs and verifying DKIM signatures. It is recommended to install the latest version for optimal performance. ```bash yarn add @zk-email/circuits ``` -------------------------------- ### Configure Environment Variables Source: https://docs.zk.email/email-tx-builder/quickstart Copy the example environment file and set your private key and relayer URL. ```bash cp .env.example .env ``` -------------------------------- ### Install Dependencies Source: https://docs.zk.email/zk-regex Installs project dependencies using yarn. Ensure yarn v1 is installed or set to classic mode. Circom must also be installed. ```bash yarn install ``` -------------------------------- ### Install ZK Email SDK with yarn Source: https://docs.zk.email/zk-email-sdk/setup Use this command to install the SDK using yarn. ```bash yarn add @zk-email/sdk ``` -------------------------------- ### Install ZK Email SDK with pnpm Source: https://docs.zk.email/zk-email-sdk/setup Use this command to install the SDK using pnpm. ```bash pnpm add @zk-email/sdk ``` -------------------------------- ### Build Documentation with mdbook Source: https://docs.zk.email/email-wallet Installs mdbook to build project documentation. Serve the documentation website locally. ```bash cargo install mdbook ``` ```bash mdbook serve ``` -------------------------------- ### Install JWT-tx-builder-contracts Package Source: https://docs.zk.email/jwt-tx-builder/packages/contracts Install the package in your project using yarn. ```bash yarn add @zk-email/jwt-tx-builder-contracts ``` -------------------------------- ### Install ZK Email SDK with npm Source: https://docs.zk.email/zk-email-sdk/setup Use this command to install the SDK using npm. ```bash npm install @zk-email/sdk ``` -------------------------------- ### Install ZK Email OAuth SDK Source: https://docs.zk.email/login-with-zk-email-oauth-api Install the SDK using npm. This command adds the necessary package to your project. ```bash npm install @zk-email/oauth-sdk ``` -------------------------------- ### Navigate and Copy Environment File Source: https://docs.zk.email/email-tx-builder/quickstart Navigate to the contracts directory and copy the example environment file to .env. Then, source the .env file to load environment variables. ```bash cd contracts cp .env.example .env source .env ``` -------------------------------- ### Install ModuleSDK and Dependencies Source: https://docs.zk.email/account-recovery/module-sdk-guide Install the necessary npm packages for ModuleSDK, permissionless, viem, wagmi, axios, and circomlibjs. ```bash npm install @rhinestone/module-sdk permissionless viem wagmi axios circomlibjs ``` -------------------------------- ### Install Python Requirements Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Installs Python dependencies from the requirements.txt file. Ensure you are in the prover directory before running. ```bash pip install -r requirements.txt ``` -------------------------------- ### Start Prover Service with Modal Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Deploys and runs the prover service using Modal, a serverless computing platform. Ensure Modal tokens are set up. ```bash modal run python packages/prover/local.py ``` -------------------------------- ### Install Dependencies Source: https://docs.zk.email/email-tx-builder/quickstart Install project dependencies using Yarn. If you encounter issues, try clearing the Yarn cache. ```bash yarn ``` -------------------------------- ### Install @zk-email/helpers Package Source: https://docs.zk.email/zk-email-verifier/setup Install the @zk-email/helpers package, which provides utility functions for email verification and cryptographic operations. ```bash yarn add @zk-email/helpers ``` -------------------------------- ### Install Permissionless.js and Dependencies Source: https://docs.zk.email/account-recovery/permissionless-guide Install the necessary packages for permissionless.js, viem, wagmi, axios, and circomlibjs. ```bash npm install permissionless viem wagmi axios circomlibjs ``` -------------------------------- ### Install build-essential on Ubuntu Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Installs the build-essential package on Ubuntu systems, which is a prerequisite for Rust and Cargo. ```bash sudo apt-get update sudo apt-get install build-essential ``` -------------------------------- ### Start PostgreSQL Database Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Launches a PostgreSQL database instance using Docker. This database is used to store account information. ```bash docker run --rm --name email-wallet-db -e POSTGRES_PASSWORD=p@ssw0rd -e POSTGRES_USER=emailwallet -e POSTGRES_DB=emailwallet -p 5432:5432 postgres ``` -------------------------------- ### Acceptance Request Response Example Source: https://docs.zk.email/account-recovery/relayer-api Example of a successful response from the acceptance request endpoint. ```json { "request_id": 12345, "command_params": [{"type":"string","value":"example_param"}] } ``` -------------------------------- ### Initialize JWT Contracts Source: https://docs.zk.email/jwt-tx-builder/packages/contracts Example of initializing JWTRegistry and JwtVerifier contracts in Solidity. ```solidity IVerifier jwtVerifier; JwtRegistry jwtRegistry; // Create jwt registry and set DKIM public key hash jwtRegistry = new JwtRegistry(deployer); jwtRegistry.setDKIMPublicKeyHash( "12345|https://example.com|client-id-12345", publicKeyHash ); // Create JwtVerifier and initialize with proxy { JwtVerifier verifierImpl = new JwtVerifier(); console.log( "JwtVerifier implementation deployed at: %s", address(verifierImpl) ); JwtGroth16Verifier groth16Verifier = new JwtGroth16Verifier(); ERC1967Proxy verifierProxy = new ERC1967Proxy( address(verifierImpl), abi.encodeCall( verifierImpl.initialize, (msg.sender, address(groth16Verifier)) ) ); jwtVerifier = IVerifier(address(verifierProxy)); } ``` -------------------------------- ### Install @zk-email/contracts Package Source: https://docs.zk.email/zk-email-verifier/setup Install the @zk-email/contracts package, which contains Solidity contracts essential for email verification. ```bash yarn add @zk-email/contracts ``` -------------------------------- ### Run the Test Source: https://docs.zk.email/zk-email-sdk/running-the-example Execute the test script using either Yarn or npm to start the witness generation process. ```bash yarn/npm start ``` -------------------------------- ### Example Description for Blueprint Source: https://docs.zk.email/zk-email-sdk/create-blueprint Provide a concise explanation of the proof's purpose. ```text Example: "Prove that you received a devcon confirmation email." ``` -------------------------------- ### Install Xcode Command Line Tools on macOS Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Installs necessary tools for development on macOS, including those required for Rust and Cargo. ```bash xcode-select --install ``` -------------------------------- ### Install Email Recovery Module Source: https://docs.zk.email/account-recovery/module-sdk-guide Installs the configured email recovery module using the smart account client and waits for the user operation receipt. Requires the prepared module configuration. ```typescript const userOpHash = await smartAccountClient.installModule(emailRecoveryModule); const receipt = await pimlicoClient.waitForUserOperationReceipt({ hash: userOpHash, }); ``` -------------------------------- ### Decimals Type Matcher Example Source: https://docs.zk.email/email-tx-builder/architecture/command-templates Provides an example of a command template using the {decimals} matcher for capturing decimal numbers. Note that these are encoded as uint256 after multiplication by 10**18. ```Solidity function commandTemplates() public pure returns (string[][] memory) { string[][] memory templates = new string[][](1); templates[0] = new string[](5); templates[0][0] = "Set"; templates[0][1] = "exchange"; templates[0][2] = "rate"; templates[0][3] = "to"; templates[0][4] = "{decimals}"; return templates; } ``` -------------------------------- ### Example Email Query for Blueprint Source: https://docs.zk.email/zk-email-sdk/create-blueprint Use a valid Gmail search query to help locate the relevant email for proof generation. ```text Example: "from:google.com" ``` -------------------------------- ### Prepare Module Data for Installation Source: https://docs.zk.email/account-recovery/permissionless-guide Encode the necessary parameters for installing the Universal Email Recovery Module. This includes account details, guardian information, and recovery settings like threshold, delay, and expiry. ```typescript const account = safeWalletAddress; const isInstalledContext = toHex(0); const functionSelector = toFunctionSelector( "swapOwner(address,address,address)" ); const guardians = [guardianAddr]; const guardianWeights = [1n]; const threshold = 1n; const delay = 6n * 60n * 60n; // 6 hours const expiry = 2n * 7n * 24n * 60n * 60n; // 2 weeks in seconds const moduleData = encodeAbiParameters( parseAbiParameters( "address, bytes, bytes4, address[], uint256[], uint256, uint256, uint256" ), [ account, isInstalledContext, functionSelector, guardians, guardianWeights, threshold, delay, expiry, ] ); ``` -------------------------------- ### Example Pattern Name for Blueprint Source: https://docs.zk.email/zk-email-sdk/create-blueprint Use a descriptive name that clearly indicates what the blueprint proves to users. ```text Example: "Google Confirmation Proof" ``` -------------------------------- ### Wait for Ephemeral Key Activation Source: https://docs.zk.email/login-with-zk-email-oauth-api Call this function after `setup` to wait until the ephemeral key is activated on-chain. This confirms that the user's email proof has been processed. ```javascript const isActivated = await oauthClient.waitEpheAddrActivated('your-request-id'); ``` -------------------------------- ### Install snarkjs globally Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Installs the latest version of the snarkjs npm package globally. This is required for the prover's local setup. ```bash npm install -g snarkjs@latest ``` -------------------------------- ### Step 1: setup Source: https://docs.zk.email/login-with-zk-email-oauth-api Signs up a new user or signs in an existing user. It initiates an email verification process to activate the user's account and ephemeral key. ```APIDOC ## setup ### Description Signs up a new user or signs in an existing user with the given username and configurations of the ephemeral key. It requests the relayer service to send an email to the given user's email address, allowing the user to sign up or sign in the account by replying to the sent email. This reply email will simultaneously creates a new Email Wallet account if the user has not created it. ### Parameters * `userEmailAddr` (string) - The email address of the user. * `username` (string) - The desired username for the new user. This is mandatory for the sign up and optional for the sign in. If the username taken by the existing user is different from the given one, the relayer service automatically sends an email to sign in the taken username (not the given username). * `expiryTime` (number | null) - The expiry time for the ephemeral key (optional). If you set no time limitation, you can set `expiryTime` to `null`. * `tokenAllowance` (Array<[number, string]> | null) - Array of token allowances that the ephemeral key can consume (optional). Each element in the array is defined as `[number, string]`, where the first and second ones, respectively, denote token amount and names to be displayed in the email subject field. You can set at most three token allowances. ### Returns * `Promise`: A number of request ID that the relayer service issues for each sign-up/sign-in request. ### Example ```javascript // Case 1: the user of 'user@example.com' sign-ups/sign-ins 'newUserName' and activates the ephemeral key forever with no token allowance. const requestId = await oauthClient.setup('user@example.com', 'newUserName', null, null); // Case 2: the user of 'user@example.com' sign-ups/sign-ins 'newUserName' and activates the ephemeral key until timestamp '1720489011' with token allowances up to 3 ETH and 100 USDC. const requestId = await oauthClient.setup('user@example.com', 'newUserName', 1720489011, [[3, "ETH"], [100, "USDC"]]); // Case 3: the user of 'user@example.com' sign-ins the username that the user already took and activates the ephemeral key until timestamp '1720489011' with token allowances up to 3 ETH and 100 USDC. const requestId = await oauthClient.setup('user@example.com', null, 1720489011, [[3, "ETH"], [100, "USDC"]]); ``` ``` -------------------------------- ### Setup Relayer on Chain Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Registers the relayer's details on the blockchain using the cargo command. This is a required step before starting the relayer. ```bash cargo run --release -- setup ``` -------------------------------- ### Deploy Wallet Canister Source: https://docs.zk.email/email-wallet/relayer-infrastructure/icp-account-setup Deploys a wallet canister for your ICP account. This involves getting your principal ID, creating the canister with a specified amount of ICP tokens, and then installing the cycle wallet code to it. ```bash dfx identity --network ic get-principal ``` ```bash dfx ledger --network ic create-canister --amount ``` ```bash dfx identity --network ic deploy-wallet ``` -------------------------------- ### Build Project Source: https://docs.zk.email/jwt-tx-builder/packages/contracts Run this command to build the project. ```bash yarn build ``` -------------------------------- ### String Type Matcher Example Source: https://docs.zk.email/email-tx-builder/architecture/command-templates Demonstrates how to define a command template using the {string} matcher for capturing text input. This is useful for commands that require arbitrary string values. ```Solidity function commandTemplates() public pure returns (string[][] memory) { string[][] memory templates = new string[][](1); templates[0] = new string[](4); templates[0][0] = "Set"; templates[0][1] = "status"; templates[0][2] = "message"; templates[0][3] = "{string}"; return templates; } ``` -------------------------------- ### Int Type Matcher Example Source: https://docs.zk.email/email-tx-builder/architecture/command-templates Shows how to set up a command template with the {int} matcher for capturing signed integer values. Use this when commands might involve positive or negative whole numbers. ```Solidity function commandTemplates() public pure returns (string[][] memory) { string[][] memory templates = new string[][](1); templates[0] = new string[](5); templates[0][0] = "Adjust"; templates[0][1] = "balance"; templates[0][2] = "by"; templates[0][3] = "{int}"; return templates; } ``` -------------------------------- ### Acceptance Request cURL Example Source: https://docs.zk.email/account-recovery/relayer-api Example of how to make an acceptance request using cURL. ```curl curl -X POST 'https://auth-base-sepolia-staging.prove.email/api/acceptanceRequest' -H 'Content-Type: application/json' \ --data-raw '{ \ "controller_eth_addr": "0x29a26b4f4fDA819415Ef2d93255998E8FF864066", \ "guardian_email_addr": "guardian@example.com", \ "account_code": "0x0115da5a2d274f63d10e5e839f08f37336c06828ac6b374ee3b13cacb6f7da43", \ "template_idx": 0, \ "command": "Recover account 0x8951B5df8Cddbdc5dCA967C96B7Fc38d19685478 from old owner 0x778c4f4ccd65A30A074441b9be6475f20de303d3 to new owner 0x6e8CdBE9CB9A90F75Fe4D5B2F08B9181b04f4Ea9" \ }' ``` -------------------------------- ### Health Check Response Example Source: https://docs.zk.email/email-tx-builder/api-reference This is an example of a successful response from the health check endpoint. ```json { "message": "Hello from ZK Email!", "status": "success" } ``` -------------------------------- ### Configure API Keys and URLs Source: https://docs.zk.email/account-recovery/module-sdk-guide Set up your owner addresses, Pimlico API key, and Alchemy RPC API key. Construct the bundler and RPC URLs using these credentials. ```typescript const owner = "YOUR_OWNER_ADDRESS"; const owner2 = "YOUR_OWNER_2_ADDRESS"; const apiKey = "YOUR_PIMLICO_API_KEY"; const rpcApiKey = "YOUR_ALCHEMY_RPC_API_KEY"; const bundlerUrl = `https://api.pimlico.io/v2/basesepolia/rpc?apikey=${apiKey}`; const rpcUrl = `https://base-sepolia.g.alchemy.com/v2/${rpcApiKey}`; ``` -------------------------------- ### Create Public and Pimlico Clients Source: https://docs.zk.email/account-recovery/module-sdk-guide Initialize the viem public client using the RPC URL and the smart account client for the Pimlico bundler. ```typescript const publicClient = createPublicClient({ transport: http(rpcUrl), }); const pimlicoClient = createSmartAccountClient({ transport: http(bundlerUrl), entryPoint: { address: entryPoint07Address, version: "0.7", }, }); ``` -------------------------------- ### Install ZK Email Dependencies Source: https://docs.zk.email/email-tx-builder/setup Install the necessary NPM packages for ZK Email functionalities and OpenZeppelin contracts. ```bash npm install @openzeppelin/contracts@5.0.0 @openzeppelin/contracts-upgradeable@5.0.0 @zk-email/contracts@6.1.5 @zk-email/ether-email-auth-contracts@0.0.2-preview ``` -------------------------------- ### Prepare Parameters for Owner Swapping Source: https://docs.zk.email/account-recovery/permissionless-guide Set up the parameters required for swapping the owner during the recovery process. This involves defining the previous owner in the linked list, the old owner, and the new owner's address, then encoding this data. ```typescript const previousOwnerInLinkedList = "PREVIOUS_OWNER_IN_LINKED_LIST"; const oldOwner = "OLD_OWNER_ADDRESS"; const newOwner = "NEW_OWNER_ADDRESS"; const recoveryCallData = encodeFunctionData({ abi: safeAbi, functionName: "swapOwner", args: [previousOwnerInLinkedList, oldOwner, newOwner], }); const recoveryData = encodeAbiParameters( parseAbiParameters("address, bytes"), [safeWalletAddress, recoveryCallData] ); ``` -------------------------------- ### Deploy All Contracts Using Forge Script Source: https://docs.zk.email/email-wallet/contract-architecture Deploy all contracts at once by first copying the environment sample and then running the deployment script. Ensure your RPC URL and Chain ID are set in the .env file. ```bash cp .env.sample .env ``` ```bash source .env forge script script/DefaultSetupScript.s.sol:Deploy \ --rpc-url $RPC_URL \ --chain-id $CHAIN_ID \ --broadcast \ -vvvv ``` -------------------------------- ### Start the Relayer Service Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Starts the relayer service after it has been set up on the chain. Assumes the relayer is running in a compiled binary environment. ```bash cargo run --release ``` -------------------------------- ### Run Relayer Docker Container with Setup Disabled Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Launches the relayer service in a Docker container, disabling the setup step via an environment variable. ```bash docker run \ -p 80:80 \ -v $(pwd)/.env:/email-wallet/packages/relayer/.env \ -e SETUP=false email_wallet_v1_relayer:latest ``` -------------------------------- ### Example Response for Request Status Source: https://docs.zk.email/email-tx-builder/api-reference This is an example of a successful response when querying the status of a request. It includes details about the request's completion and original transaction parameters. ```JSON { "message": "request status", "request": {"emailTxAuth":{"accountCode":"0x22a2d51a892f866cf3c6cc4e138ba87a8a5059a1d80dea5b8ee8232034a105b7","body":"Sending a hello world!","chain":"sepolia","codeExistsInEmail":true,"commandParams":["testing"],"commandTemplate":"Emit string {string}","contractAddress":"0xefb56bb5771cde84f487391b6c0f9ff1694d2631","dkimContractAddress":"0xc3f15f5cc76a86f97ef8bc2d5070b6725d8992ce","emailAddress":"saul.garces09@gmail.com","functionAbi":{"inputs":[{"components":[{"type":"uint256"},{"type":"bytes[]"},{"type":"uint256"},{"components":[{"type":"string"},{"type":"bytes32"},{"type":"uint256"},{"type":"string"},{"type":"bytes32"},{"type":"bytes32"},{"type":"bool"},{"type":"bytes"}],"type":"tuple"}],"internalType":"struct EmailAuthMsg","name":"emailAuthMsg","type":"tuple"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"templateIdx","type":"uint256"}],"name":"emitEmailCommand","outputs":[],"stateMutability":"nonpayable"},"remainingArgs":[{"Address":"0x9401296121fc9b78f84fc856b1f8dc88f4415b2e"},{"Uint":"0x0"}],"subject":"Hello World","templateId":"0x25d6c3eada7b2926c822bbfebfc3173123afb205cf093a8cae6622a56712f8a"},"id":"fecfac34-3333-4cd3-bdaa-1b349aea0699","status":"Finished","updatedAt":"2024-10-25T09:49:10.922319"} } ``` -------------------------------- ### Implement Custom Email Verifier Circuit Source: https://docs.zk.email/zk-email-verifier/usage-guide Example of setting up a custom circuit using the EmailVerifier component and integrating regex validation. Ensure proper inclusion of necessary circom files and component instantiation. ```circom include "@zk-email/circuits/email-verifier.circom"; include "simple_regex.circom" template MyCircuit() { signal input ...// inputs to your circuit // Witnesses and constraints for regex go here signal output ...// output that is public component emailVerifier = EmailVerifier(__)(_); signal (__, __[__]) <== SimpleRegex(__)(_); } ``` -------------------------------- ### Submit Command API Response Example Source: https://docs.zk.email/email-tx-builder/api-reference An example of a successful response from the Submit Command API. It includes a unique ID, a confirmation message, and the status of the request. ```json { "id": "fecfac34-3333-4cd3-bdaa-1b349aea0699", "message": "email sent", "status": "success" } ``` -------------------------------- ### Environment Variables Configuration Source: https://docs.zk.email/jwt-tx-builder/setup Sets up essential environment variables for the application, including private key and Google Client ID. ```dotenv PRIVATE_KEY=your_private_key_here GOOGLE_CLIENT_ID=your_google_client_id_here ``` -------------------------------- ### Example DKIM DNS Record Source: https://docs.zk.email/architecture/dkim-verification This is an example of a DKIM DNS TXT record. It includes the selector, domain, and public key information necessary for email verification. ```dns selector1._domainkey.example.com IN TXT "v=DKIM1; k=rsa; p=Base64(Public Key)" ``` -------------------------------- ### Account Recovery Response Example Source: https://docs.zk.email/account-recovery/relayer-api Example JSON response received after initiating an account recovery request. It includes a unique request ID, subject parameters, and the status of the request. ```json { "request_id": "fecfac34-3333-4cd3-bdaa-1b349aea0699", "subject_params": {"account_eth_addr":"0x..."}, "status": "success" } ``` -------------------------------- ### Build Docker Image for Production (x86) Source: https://docs.zk.email/email-wallet/relayer-infrastructure/overview Builds a production-ready Docker image for the relayer with x86 compatibility. Requires Modal token credentials and specifies the build platform. ```bash docker buildx build -t email_wallet_v1_relayer:latest -f Relayer.Dockerfile . --build-arg modal_token_id=${MODAL_TOKEN_ID} --build-arg modal_token_secret=${MODAL_TOKEN_SECRET} --platform=linux/arm64 ``` -------------------------------- ### Emit Uint Command Source: https://docs.zk.email/email-tx-builder/quickstart Use the CLI to emit a UintCommand event. Ensure you replace placeholder values with your actual contract address, account code, email, and wallet address. ```bash npx ts-node src/cli.ts \ --emit-email-command-addr YOUR_CONTRACT_ADDRESS \ --account-code YOUR_ACCOUNT_CODE \ --email-addr YOUR_EMAIL \ --owner-addr YOUR_WALLET_ADDRESS \ --template-idx 1 \ --command-value "123" \ --subject "Emit a uint" \ --body "Emit a uint" ``` -------------------------------- ### Install Universal Email Recovery Module Source: https://docs.zk.email/account-recovery/permissionless-guide Install the Universal Email Recovery Module onto the Safe account. This involves sending a transaction via the smart account client and waiting for the receipt. ```typescript const userOpHash = await smartAccountClient.installModule({ type: "executor", address: universalEmailRecoveryModuleAddress, context: moduleData, }); const receipt = await pimlicoClient.waitForUserOperationReceipt({ hash: userOpHash, }); ```