Skip to content

Inco-fhevm/nextjs-template

Repository files navigation

Next.js Template

This template provides a Nextjs implementation of @inco/js sdk for encryption and re-encryption.

Getting Started

  1. Clone the repository:
git clone https://github.com/Inco-fhevm/nextjs-template.git
cd nextjs-template
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev

Open http://localhost:3000 to view the application.

Core Functionality

Encryption Utilities

The project includes main functions in src/utils/inco-lite.ts i.e encryptValue and reencryptValue:

1. encryptValue

Encrypts a numeric value for a specific contract and address:

const encryptedData = await encryptValue({
  value: BigInt("1000"), // Value to encrypt
  address: "0x...", // User's wallet address
  contractAddress: "0x...", // Contract address
});

2. reEncryptValue

Re-encrypts a value using a wallet client and handle:

const decryptedValue = await reEncryptValue({
  walletClient: yourWalletClient,
  handle: "0x...", // Encryption handle
});

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •