{"id":37776706,"url":"https://github.com/crypto-com/defi-wallet-core-rs","last_synced_at":"2026-01-16T15:00:48.866Z","repository":{"id":37099147,"uuid":"433285446","full_name":"crypto-com/defi-wallet-core-rs","owner":"crypto-com","description":"Cross-platform, cross-blockchain wallet library in Rust for DeFi Wallet and other applications.","archived":false,"fork":false,"pushed_at":"2024-07-30T10:53:09.000Z","size":3245,"stargazers_count":48,"open_issues_count":71,"forks_count":17,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-07-22T04:59:21.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crypto-com.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-11-30T03:55:20.000Z","updated_at":"2025-06-10T02:44:41.000Z","dependencies_parsed_at":"2023-11-27T17:48:11.217Z","dependency_job_id":"7ac3bf4f-c84e-4254-a2e2-83a83277d6b5","html_url":"https://github.com/crypto-com/defi-wallet-core-rs","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/crypto-com/defi-wallet-core-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-com%2Fdefi-wallet-core-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-com%2Fdefi-wallet-core-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-com%2Fdefi-wallet-core-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-com%2Fdefi-wallet-core-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crypto-com","download_url":"https://codeload.github.com/crypto-com/defi-wallet-core-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-com%2Fdefi-wallet-core-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T15:00:33.589Z","updated_at":"2026-01-16T15:00:48.689Z","avatar_url":"https://github.com/crypto-com.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeFi Wallet Core\n[![Main Build Status][build-image]][build-link]\n[![Audit Status][audit-image]][audit-link]\n[![Apache 2.0 Licensed][license-image]][license-link]\n![Rust Stable][rustc-image]\n\nDeFi Wallet Core is an open-source cross-platform library that implements low-level cryptographic wallet functionality\nfor Cosmos SDK-based (such as Crypto.org Chain) and Ethereum-based (such as Cronos) blockchain networks.\nIt is leveraged in DeFi Wallet-related projects as well as in Cronos Play and other projects.\nThe codebase is primarily in Rust and provides cross-language bindings using multiple tools:\n\n- [UniFFI] is used to generate bindings for both Kotlin (for Android apps) and Swift (for iOS apps); it could also be used to generate bindings for Python and Ruby.\n- [wasm-bindgen] is used to generate bindings for JavaScript and TypeScript to facilitate interactions with the Wasm modules (for web browser extensions or other web-related apps).\n- [CXX] is used to generate bindings for C++.\n\n## Pre-requisites\n\nNaturally, you will need the [Rust toolchain] installed.\nBesides that, for [UniFFI] language bindings, you will need the corresponding language formatters:\n\n```bash\nbrew install ktlint\nbrew install swiftformat\n```\n\nFor the JavaScript-Wasm bindings, you will need the `wasm-pack` to be installed:\n```bash\ncurl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh\n```\n\nDepending on your target platform, you may also need additional tooling for a given platform (e.g. Android NDK).\n\n## Generate bindings\n\nYou can generate the language bindings for different platforms using the commands below.\n\n### Android\n```bash\ncargo run --features=uniffi-bindgen -p defi-wallet-core-common --bin uniffi-bindgen -- generate common/src/common.udl --config common/uniffi.toml --language kotlin --out-dir bindings/android\n```\n\n### iOS\n```bash\ncargo run --features=uniffi-bindgen -p defi-wallet-core-common --bin uniffi-bindgen -- generate common/src/common.udl --config common/uniffi.toml --language swift --out-dir bindings/ios\n```\n\n### JavaScript-Wasm\n```bash\nwasm-pack build --scope crypto-com bindings/wasm\n```\n\n### Python\n```bash\ncargo run --features=uniffi-bindgen -p defi-wallet-core-common --bin uniffi-bindgen -- generate common/src/common.udl --config common/uniffi.toml --language python --out-dir bindings/python\n```\n\n## Building\n\n## Building Proto files from source\n\nThe single `proto-build` crate in this repo clones and rebuilds proto files for\nall other crates, simply make the required edits in [main.rs](proto-build/src/main.rs), then\n\n```bash\ncd proto-build # enter `proto-build`, so that we can clone repos and build proto files relative to it\ncargo run # build proto files and output to `../proto/src/prost` folder\n```\n\nor simply run `make proto`.\n\n### Android\nBuilding for Android is currently supported on macOS and Linux.\n\nIt requires Android SDK (e.g. via [Android Studio]), [Android NDK] ([the suggestion version is r22]), and Java SDK (e.g. OpenJDK) to be installed.\n\nFirst, you need to set the required environment variables `ANDROID_SDK_ROOT`, `NDK_HOME`, and `JAVA_HOME`. For example:\n\n```bash\nexport ANDROID_SDK_ROOT={DIR}/Android/sdk\nexport NDK_HOME=$ANDROID_SDK_ROOT/ndk/22.1.7171670\nexport JAVA_HOME={DIR}/openjdk/17.0.1_1/\n```\n\nThen you can build the project as follows:\n\n```bash\nmake android\n```\n\n### iOS\n\nBuilding for iOS is currently supported on macOS.\n\nIt requires Xcode 13 or newer to be installed.\n\nThen you can build the project as follows:\n```bash\nmake ios\n```\n\n### C++\nBuild `bindings/cpp` and `example/cpp_example` as follows:\n```bash\nmake build_cpp\n```\n\nBuild `bindings/cpp` and `example/cpp_example`, and run the example programs. Please note that errors could happen if devnets (chainmain and cronos) are not running.\n```bash\nmake cpp\n```\n\n## Examples\nThere are two sample programs for a web app as well as for a web browser extension.\n\n### Wasm\nThis sample shows how the generated package can be used in JavaScript.\n\n1. generate the bindings as above\n2. `cd example/js-example`\n3. `npm install`\n4. `npm start`\n\n### web browser extension example\nThis sample shows how the generated package can be used in a web browser extension.\n1. make wasmweb\n2. `cd example/extension-example`\n3. `npm install`\n\n## Unit and Integration Tests\nThere are several unit and integration tests for different target platforms. Here are the instructions how to run them.\n\n### Wasm\n#### Without nix\nPlease install `pystarport`, `supervisord`, `chain-maind v3.3.3` or newer before running this test.\n\n``` bash\nmake wasm-tests\n```\n#### With nix\nPlease install `nix` before running this test.\n\n``` bash\nmake wasm-ci-tests\n```\n\n#### Cargo test\nThe recommended way to use `wasm-bindgen-test` is with `wasm-pack`, since it will handle installing the test runner, installing a WebDriver client for your browser, and informing cargo how to use the custom test runner. However, you can also manage those tasks yourself, if you wish.\n\nIt is also possible to use `cargo test` instead of `wasm-pack`\n\n1. Install wasm-bindgen-cli\n    ``` bash\n    cargo install wasm-bindgen-cli\n    ```\n\n2. Install chromdriver (for chrome)\n    ``` bash\n    brew install --cask chromedriver\n    ```\n\n3. Run the test in binding/wasm folder\n    ``` bash\n    cargo test\n    ```\n### C++\n``` bash\nmake cpp-ci-tests # build bindings and examples, then run the test\n# or\nmake cpp-tests # run the test without building bindings and examples\n```\n\n##### References\n- [Testing in headless browsers without wasm-pack](https://rustwasm.github.io/docs/wasm-bindgen/wasm-bindgen-test/browsers.html#appendix-testing-in-headless-browsers-without-wasm-pack)\n- [Using wasm-bindgen-test without wasm-pack](https://rustwasm.github.io/docs/wasm-bindgen/wasm-bindgen-test/usage.html#appendix-using-wasm-bindgen-test-without-wasm-pack)\n\n### Python\n#### With nix\nPlease install `nix` before running this test.\n\n``` bash\nmake python-tests\n```\n\n\n## Documentation\n### C++\n``` bash\nmake cpp-docs\n```\nFor a more detailed setup, check the [DeFi Wallet Core Cpp Documents Generation Guide](./docs/cpp/README.md)\n\n[//]: # (badges)\n\n[build-image]: https://github.com/crypto-com/defi-wallet-core-rs/actions/workflows/ci.yml/badge.svg\n[build-link]: https://github.com/crypto-com/defi-wallet-core-rs/actions/workflows/ci.yml\n[audit-image]: https://github.com/crypto-com/defi-wallet-core-rs/actions/workflows/audit.yml/badge.svg\n[audit-link]: https://github.com/crypto-com/defi-wallet-core-rs/actions/workflows/audit.yml\n[license-image]: https://img.shields.io/badge/license-Apache2.0-blue.svg\n[license-link]: https://github.com/crypto-com/defi-wallet-core-rs/blob/master/LICENSE\n[rustc-image]: https://img.shields.io/badge/rustc-stable-blue.svg\n\n[//]: # (general links)\n\n[UniFFI]: https://github.com/mozilla/uniffi-rs\n[wasm-bindgen]: https://github.com/rustwasm/wasm-bindgen\n[CXX]: https://cxx.rs\n[Rust toolchain]: https://rustup.rs\n[Android NDK]: https://developer.android.com/ndk\n[the suggestion version is r22]: https://github.com/android/ndk/wiki/Unsupported-Downloads\n[Android Studio]: https://developer.android.com/studio\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrypto-com%2Fdefi-wallet-core-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrypto-com%2Fdefi-wallet-core-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrypto-com%2Fdefi-wallet-core-rs/lists"}