richtera / lukso-siwe-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This demo uses amongst other thing wagmi + Web3Modal + Vite project bootstrapped with create-wagmi

Demo

A demo implementation of this dapp is deployed at. https://siwe-demo.richtera.app

Getting Started

Get a wallet connect projectId and put it into .env (copy .env.example and fill it in) The app will create a mnemonic for you the first time you launch if it's not defined. You can copy the random one it generates into the .env so your server tokens will be valid during a restart.

Install pnpm and nodejs (use asdf or nvm to get the right) Run pnpm install Run pnpm run typegen (one time to bootstrap the typechain wrappers for lsp-smart-contracts) Run pnpm run dev in your terminal, and then open https://localhost:5173 in your browser.

Once the webpage has loaded, changes made to files inside the src/ and server/ directories (e.g. src/App.tsx) will automatically update the webpage and server. The server is a small fastify server which allows token exchange and verify of JWT tokens.

Requests on server

GET /exchange

Present a SIWE bearer token to exchange it for a server side SIWE token The public address of the server for the server token is available at GET /.well-known/public-key or as a jwks at GET /.well-known/jwks

GET /verify

Present SIWE client or server bearer token to get verified.

Learn more

To learn more about Vite or wagmi, check out the following resources:

About


Languages

Language:TypeScript 93.0%Language:Dockerfile 2.8%Language:HTML 2.8%Language:JavaScript 1.2%Language:CSS 0.2%