cycles-quartz/examples/transfers/frontend
dusterbloom 864da77405
devX: Docker compose for neutron + quartz cli (#248)
Co-authored-by: Juan Enrique Alcaraz <juanenrisley@gmail.com>
2024-10-10 14:41:16 +02:00
..
public refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
src Neutron client in pure rust (#234) 2024-10-03 13:50:54 -04:00
tests devX: Docker compose for neutron + quartz cli (#248) 2024-10-10 14:41:16 +02:00
.env.example devX: Docker compose for neutron + quartz cli (#248) 2024-10-10 14:41:16 +02:00
.eslintrc.json refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
.gitignore refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
.prettierrc refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
env.d.ts refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
next.config.mjs refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
package-lock.json refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
package.json refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
playwright.config.ts Run transfers app E2E tests in an Action, and backend with docker compose (#203) 2024-10-01 16:13:39 -04:00
postcss.config.mjs refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
README.md refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
tailwind.config.ts refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00
tsconfig.json refactor: refactor repo as standard rust monorepo (#222) 2024-09-30 23:33:22 +04:00

Transfer App

This is an example frontend that illustrates how to interact with a Quartz app.

This example offers the ability to:

  • Deposit amounts into a balance
  • Withdraw the whole deposit
  • Transfer amounts between wallets in a private-preserving way
  • Query your encrypted balance
  • Switch between Keplr wallets

Requirements

In order to get started, you will need:

Development

Install dependencies:

npm ci

The app requires some environment variables to fully work. Be sure to set up those accordingly to your local environment.

You should start from the template:

cp .env.example .env.local

Required environment variables:

# Choose target chain configuration
NEXT_PUBLIC_TARGET_CHAIN=<localWasm | localNeutron | doWasm>
# Enclave public key to encrypt transfers
NEXT_PUBLIC_ENCLAVE_PUBLIC_KEY=<public_key>
# Target transfers contract
NEXT_PUBLIC_TRANSFERS_CONTRACT_ADDRESS=<contract_address>

Run the app:

npm run dev

App will be running on http://localhost:3000/ and now everything is up & running 🎉

E2E Testing

For tests to work, you need to set up the following required environment variables:

# Frontend base url
TEST_BASE_URL=<url>
# Keplr browser extension version
TEST_KEPLR_EXTENSION_VERSION=<version>
# Main wallet mnemonic (Use only funded wallets)
TEST_WALLET_MNEMONIC=<mnemonic>
# Secondary wallet mnemonic (Use only funded wallets)
TEST_SECONDARY_WALLET_MNEMONIC=<mnemonic>
# Secondary wallet address
TEST_SECONDARY_WALLET_ADDRESS=<wallet_address>
# Keplr wallet password. It can be whatever
TEST_WALLET_PASSWORD=<password>

Run all E2E tests:

npm run test

If want to run the tests with the Playwright dedicated interface, run:

npm run test:ui