oasisprotocol / wallet

Official non-custodial wallet for the Oasis Network.
https://wallet.oasis.io
Apache License 2.0
110 stars 46 forks source link
android android-app blockchain browser-extension crypto delegation extension extension-chrome ledger mobile mobile-app non-custodial oasis official react rose staking wallet web

ROSE Wallet

CI build status CI test status CI lint status Release status License codecov Renovate enabled

:warning: NEVER use the private keys and mnemonics given as examples in this repository.

demo-video

Deploys

Features

Wallet and Accounts

Transactions

Accessibility

Getting started

Installing and running from source code

You can quickly get started with the following commands:

yarn install
yarn start

Alternatively, to get started with a local network:

docker-compose up --build -d
yarn install
REACT_APP_LOCALNET=1 yarn start

Then go to http://localhost:3000 to access the wallet.

Test accounts

The local single-node network used for development comes built-in with two accounts already having tokens.

Using a private key:
X0jlpvskP1q8E6rHxWRJr7yTvpCuOPEKBGW8gtuVTxfnViTI0s2fBizgMxNzo75Q7w7MxdJXtOLeqDoFUGxxMg==
oasis1qz0k5q8vjqvu4s4nwxyj406ylnflkc4vrcjghuwk

Using a mnemonic:
abuse gown claw final toddler wedding sister parade useful typical spatial skate
decrease bulk student manual cloth shove fat car little swamp tag ginger
oasis1qq5t7f2gecsjsdxmp5zxtwgck6pzpjmkvc657z6l

Architecture

This code needs multiple components to run, all provided in the docker-compose.yml for local development.

Architecture diagram

API that web wallet is using is determined during a build time.

Contributing & development

Running the tests

The repository has two different test strategies:

To run all tests:

# Check typescript errors
yarn checkTs

# Run jest tests
yarn test

# Run playwright tests
yarn start
(cd playwright; yarn; npx playwright install --with-deps)
(cd playwright; yarn test)
# Or `yarn start:prod` and `yarn test:prod` to test production builds.
# Or `xvfb-run yarn test` to prevent browser windows opening.

# Run cypress tests
docker-compose up -d
# Run this in another terminal to keep it open
REACT_APP_LOCALNET=1 REACT_APP_BACKEND=oasismonitor yarn start
yarn cypress:run

# Manually check that content-security-policy in getSecurityHeaders.js doesn't
# break any functionality
yarn start:prod
# Open http://localhost:5000/account/oasis1qq3xrq0urs8qcffhvmhfhz4p0mu7ewc8rscnlwxe/stake
# and switch to testnet. This exercises at least: fonts, grpc, testnet grpc, API,
# and validator logos.

# Update screenshots
(cd playwright; yarn test:screenshots)

Code style

This repository uses prettier as a code formatter and eslint as it's linter. You can use the following commands:

# Lint the whole repository
yarn lint

# Fix linting issues
yarn lint:fix

Git Commit Messages

A quick summary:

A detailed post on Git commit messages: How To Write a Git Commit Message.

Internationalization

Translating: We have Transifex to easily contribute translations.

Development: ROSE Wallet uses react-i18next for internationalization. You can simply use the useTranslation hook inside your components to add additional translation-ready strings. You can then export the new keys to the English translation.json by running yarn run extract-messages.

Updating from Transifex: English translation.json is set as an automatically updating resource in Transifex, so the new translation strings will appear in Transifex a few hours after changes are merged. After they are translated:

  1. click "Download file to translate" on the target languages,
  2. yarn run extract-messages, and
  3. create a new pull request titled "i18n: Update translations from Transifex".

Adding a new language:

  1. first add it to Transifex and translate the strings,
  2. create a folder with the new language code in src/locales and download the translation file there,
  3. add the new language to the list of resources

Mobile app development

Capacitor and Ionic docs

Preparing a Release

Release process doc