About this codebase
This repository contains the codebase for a cryptocurrency wallet compatible with the Polkadot, EVM, and TON ecosystems.
It uses dependencies available in the soramitsu/fearless-utils-Android repository and has an iOS equivalent in soramitsu/fearless-iOS.
app/: Android app entry; build typesdebug/release/staging/develop/pr.feature-*/: Split by domain with-apiand-implmodules (e.g.,feature-wallet-api,feature-wallet-impl).core-api/,core-db/,runtime/,runtime-permission/,common/: Shared foundations.test-shared/: Test-only utilities reused across modules.buildSrc/,detekt/,scripts/,docs/: Gradle plugins/config, static analysis, helper scripts, documentation.- Per-module sources:
src/main/java|kotlin, resourcessrc/main/res, unit testssrc/test, instrumentation testssrc/androidTest.
- Build app (APK):
./gradlew :app:assembleDebug(useassembleReleasefor release). - Full build + checks:
./gradlew clean build. - Static analysis:
./gradlew detektAll(auto-fix formatting:./gradlew detektFormat). - Unit tests (aggregated):
./gradlew runTest(runs detekt, unit tests, JaCoCo report). - Per-module unit tests:
./gradlew :core-db:testDebugUnitTest(ortestDevelopDebugUnitTestif present). - Android Lint:
./gradlew :app:lint. - Coverage report:
./gradlew jacocoTestReport(outputs under each module’sbuild/reports/jacoco). - Post-merge validation:
./gradlew postMergeCheckorbash scripts/post_merge_check.sh. - App version:
./gradlew :app:printVersion. - Local validation helper:
bash scripts/validate-local.sh.
- Language: Kotlin 2.1, Java 21 target; Compose enabled where applicable.
- Formatting: Detekt + detekt-formatting; 4-space indent; max line length per
detekt/detekt.yml. - Files: one public class per file; filename matches class (
PascalCase). - Packages: lowercase dot-separated; avoid acronyms.
- Resources: layouts
activity_*.xml,fragment_*.xml; idsbtnX,tvX; stringsfeature_action_label. - KDoc for public APIs; prefer immutable data and explicit visibility.
- Frameworks: JUnit4, AndroidX Test, Room testing, Coroutines test; Mockito/MockK available.
- Structure: unit tests in
src/test, instrumentation insrc/androidTest. - Naming: mirror class under test, e.g.,
AccountRepositoryTest.kt; methodsfun shouldDoX_whenY(). - Run: module
testDebugUnitTest(ortestDevelopDebugUnitTest), or rootrunTest. - Coverage: maintain/raise JaCoCo coverage for changed code.
- New code policy: every time you add a function, create at least one unit test for it (minimum), placed in the corresponding module under
src/test. - Integration (DOT): add instrumentation/integration tests that hit a reachable Polkadot node and log key responses (e.g., runtimeVersion, balances, fees). Guard with assumptions so tests skip when network is unavailable.
- Logs: when testing DOT, log the raw RPC response and parsed model to aid debugging; never log secrets.
- Commits: imperative, concise subject; reference issues (
#123). Prefer Conventional Commits (feat:,fix:,refactor:) when possible. - Before PR: ensure
./gradlew runTestpasses anddetektAllis clean. - PR checklist: clear description, linked issue, screenshots/video for UI, steps to test, notes on config/secrets.
- Use the PR template; CI must be green (Android CI badge above).
- Secrets are read via
scripts/secrets.gradle; set in env vars orlocal.properties(seeREADME.md). - Do not commit keys or
local.properties. Use the provided debug keystore only for local builds. - Polkadot runtime sources: to align with a specific Polkadot SDK release (e.g.,
polkadot-stable2503), you can override chain/type registries without code changes:TYPES_URL_OVERRIDE,DEFAULT_V13_TYPES_URL_OVERRIDE,CHAINS_URL_OVERRIDE- Example in
local.properties:TYPES_URL_OVERRIDE=https://.../all_chains_types_android.jsonCHAINS_URL_OVERRIDE=https://.../chains.json
- After updating, run
./gradlew detektAll runTest :app:lint.
- Library version pinning: to use a specific
shared_featuresversion compatible with a Polkadot SDK release, setSHARED_FEATURES_VERSION_OVERRIDE=1.x.y- Works via
local.propertiesor environment variable.
- Create a root-level
local.propertieswith the required secrets and service credentials. Do NOT commit this file. - See
docs/samples/local.properties.exampleand create a privatelocal.propertiesat the repo root; replace placeholders with your real values. - Typical keys include: MoonPay, PayWings (Sora Card), X1 plugin, Google Web Client IDs, Ethereum providers (Blast, Etherscan/BscScan/PolygonScan/OKLink), WalletConnect, Alchemy, Dwellir, TON API.
- Formats: use
key=valueper line; avoid trailing spaces. Strings may be unquoted; if values contain special characters or spaces, wrap in double quotes. Setsdk.dir=/absolute/path/to/Android/sdkto avoid SDK lookup errors. - Runtime overrides (mirrors recommended for first run):
TYPES_URL_OVERRIDE=https://cdn.jsdelivr.net/gh/soramitsu/shared-features-utils@master/chains/all_chains_types_android.jsonDEFAULT_V13_TYPES_URL_OVERRIDE=https://cdn.jsdelivr.net/gh/soramitsu/shared-features-utils@master/chains/default_v13_types.jsonCHAINS_URL_OVERRIDE=https://cdn.jsdelivr.net/gh/soramitsu/shared-features-utils@master/chains/v13/chains.json
- Verify config:
./gradlew printPolkadotSdkAlignmentprints effective URLs and any shared_features pin before you run the app/tests.
- Gradle maps the GitHub repo
soramitsu/fearless-utils-Androidas a source dependency and buildsjp.co.soramitsu.fearless-utils:fearless-utilsfrom source (requires network). - Building from source requires NDK and Rust toolchain installed (see README for versions).
- This enables rapid testing of utils updates needed for specific Polkadot SDK releases.
- Status: see
docs/status.mdfor current health, coverage, and risks. - Roadmap: see
docs/roadmap.mdfor prioritized tasks, acceptance criteria, and prompts. - Sync policy: update
docs/status.mdanddocs/roadmap.mdwhenever code changes (in the same PR) so they stay in sync with the repository’s current state.