Getting Started

Quick Start

Install dependencies, configure addresses, initialize Nox, and submit a first encrypted deal.
  1. 01

    Install dependencies

    Install Nox Handle SDK, Wagmi, Viem, and React Query.

  2. 02

    Set environment variables

    Configure contract addresses, chain ID, RPC URL, and ChainGPT key.

  3. 03

    Initialize Nox handle client

    Create the Nox client from the active Wagmi wallet client.

  4. 04

    Submit your first deal

    Encrypt valuation and equity immediately before writing to the contract.

terminal
npm install @iexec-nox/handle wagmi viem @tanstack/react-query
.env.local
NEXT_PUBLIC_DEAL_ROOM_ADDRESS=0x809Ad39e12360C3073B2AB2913D238287DB540c5
NEXT_PUBLIC_CONFIDENTIAL_TOKEN_ADDRESS=0x...
NEXT_PUBLIC_NOX_CONTRACT_ADDRESS=0xd464B198f06756a1d00be223634b85E0a731c229
NEXT_PUBLIC_CHAIN_ID=421614
ARBITRUM_SEPOLIA_RPC_URL=https://sepolia-rollup.arbitrum.io/rpc
CHAINGPT_API_KEY=your_key_here
nox-client.ts
import { createViemHandleClient } from "@iexec-nox/handle";
import { getWalletClient } from "wagmi/actions";

const walletClient = await getWalletClient(wagmiConfig);
const handleClient = await createViemHandleClient(walletClient);
submit-deal.ts
const { handle, handleProof } = await handleClient.encryptInput(
  1_000_000n, // $1M valuation
  "uint256",
  DEAL_ROOM_ADDRESS
);

await writeContractAsync({
  functionName: "createDeal",
  args: [valuationHandle, valuationProof, equityHandle, equityProof],
  gas: 800_000n,
});