Initial commit

This commit is contained in:
ox42
2026-09-17 00:30:08 +02:00
commit f98608f9e6
6 changed files with 934 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
# Viem Lecture
This project uses [viem](https://viem.sh/) for TypeScript/JavaScript Ethereum interactions.
## Getting started
```bash
npm install
```
## Writing scripts
Put your scripts in the **`scripts/`** directory.
To run a script:
```bash
# If you have a newer version of Node
node scripts/your-script.ts
# TypeScript (using tsx)
npx tsx scripts/your-script.ts
```
## Environment variables
To read variables from a `.env` file when running a script:
```bash
node --env-file=.env scripts/your-script.ts
```
The script will have access to all variables defined in `.env` via `process.env.VARIABLE_NAME`.
## Prompts
To read user input from the console, you can use the prompts library:
```js
const { name } = await prompts([{
name: 'name',
type: 'text',
message: 'Enter your name: '
}])
```