Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ implementation to real Sui SDK / indexer / WSS calls is a contained change.

## Environment variables

The frontend reads exactly three `VITE_`-prefixed variables. **All three have
defaults wired for local dev, so none are strictly required** — set them to
point at a non-local environment. Define them in `frontend/.env.local` (Vite
loads it automatically; not committed).

| Variable | Required | Default | Purpose |
| -------------------- | -------- | ------------------------ | ------- |
| `VITE_ENVIRONMENT` | No | `testnet` | Selects which deployment block to read from `rust-backend/deployments.json`. One of `mainnet` \| `testnet` \| `devnet`. Drives the package / protocol-config / treasury ids (`src/config.ts`) **and** the wallet's default Sui network (`src/main.tsx`). An environment with no published deployment leaves those ids unset and the app falls back to its empty / "no deployment configured" states. |
| `VITE_API_BASE_URL` | No | `http://127.0.0.1:9003` | Base URL of the Rust `api-service` (REST). |
| `VITE_QUOTING_WS_URL`| No | `ws://127.0.0.1:9002/` | WebSocket URL of the quoting service. |
The frontend reads a handful of `VITE_`-prefixed variables. **All have defaults
wired for local dev (or are optional), so none are strictly required** — set
them to point at a non-local environment or to enable social sign-in. Define
them in `frontend/.env.local` (Vite loads it automatically; not committed).

| Variable | Required | Default | Purpose |
| ---------------------- | -------- | ------------------------ | ------- |
| `VITE_ENVIRONMENT` | No | `testnet` | Selects which deployment block to read from `rust-backend/deployments.json`. One of `mainnet` \| `testnet` \| `devnet`. Drives the package / protocol-config / treasury ids (`src/config.ts`) **and** the wallet's default Sui network (`src/main.tsx`). An environment with no published deployment leaves those ids unset and the app falls back to its empty / "no deployment configured" states. |
| `VITE_API_BASE_URL` | No | `http://127.0.0.1:9003` | Base URL of the Rust `api-service` (REST). |
| `VITE_QUOTING_WS_URL` | No | `ws://127.0.0.1:9002/` | WebSocket URL of the quoting service. |
| `VITE_ENOKI_API_KEY` | No | _(unset)_ | Enoki **public** frontend API key (Enoki Developer Portal). Enables zkLogin "Sign in with Google" in the connect modal. When unset, social login is hidden and only browser-extension wallets are offered. |
| `VITE_GOOGLE_CLIENT_ID`| No | _(unset)_ | Google OAuth 2.0 **web** client id. Required alongside `VITE_ENOKI_API_KEY` to register the Enoki Google wallet. Both must be set for social login to appear. Enoki only supports `mainnet`/`testnet` (not `devnet`). |

Contract ids (package, `ProtocolConfig`, `Treasury`) are **not** env vars —
they come from `deployments.json` keyed by `VITE_ENVIRONMENT`.
Expand Down
180 changes: 161 additions & 19 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@mysten/dapp-kit": "^1.0.6",
"@mysten/enoki": "^1.0.8",
"@mysten/sui": "^2.17.0",
"@tanstack/react-query": "^5.100.11",
"react": "^18.3.1",
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ export type SupportedToken = {

export let SUPPORTED_TOKENS: SupportedToken[] = [];

// Enoki zkLogin (social sign-in). Both values are public: `VITE_ENOKI_API_KEY`
// is Enoki's *public* frontend key and the Google client id is a public OAuth
// id — neither is a secret, so they are safe in the bundle. When either is
// unset the Enoki "Sign in with Google" wallet is simply not registered and the
// app falls back to browser-extension wallets only (so local dev needs no
// setup). See `RegisterEnokiWallets` in `main.tsx`.
export const ENOKI_API_KEY: string | undefined = import.meta.env
.VITE_ENOKI_API_KEY as string | undefined;
export const GOOGLE_CLIENT_ID: string | undefined = import.meta.env
.VITE_GOOGLE_CLIENT_ID as string | undefined;

// --- wire shapes returned by token-info -------------------------------------

type PackageInfoDto = {
Expand Down
Loading