trustwallet/wallet-core

GitHub: trustwallet/wallet-core

跨平台区块链钱包库,提供多链底层加密能力,专注移动集成。

Stars: 3498 | Forks: 1939

Trust Wallet Core 是一个开源、跨平台、专注于移动设备的库 实现了针对大量区块链的低级加密钱包功能。 它是流行的 [Trust Wallet](https://trustwallet.com) 及其他项目中的核心部分。 大部分代码使用 C++ 编写,并提供严格的 C 接口,以及支持语言的习惯性接口: Swift(用于 iOS)和 Java(Kotlin,用于 Android)。 [![iOS CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/2b7db5c38d191312.svg)](https://github.com/trustwallet/wallet-core/actions/workflows/ios-ci.yml) [![Android CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/a0a014eb63191313.svg)](https://github.com/trustwallet/wallet-core/actions/workflows/android-ci.yml) [![Linux CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/2b756cdfb8191314.svg)](https://github.com/trustwallet/wallet-core/actions/workflows/linux-ci.yml) [![Rust CI](https://github.com/trustwallet/wallet-core/actions/workflows/linux-ci-rust.yml/badge.svg)](https://github.com/trustwallet/wallet-core/actions/workflows/linux-ci-rust.yml) [![Wasm CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/9a50dab92b191316.svg)](https://github.com/trustwallet/wallet-core/actions/workflows/wasm-ci.yml) [![Kotlin CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/6a73602828191317.svg)](https://github.com/trustwallet/wallet-core/actions/workflows/kotlin-ci.yml) [![Docker CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/f1b834ac7d191319.svg)](https://github.com/trustwallet/wallet-core/actions/workflows/docker.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TrustWallet_wallet-core&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TrustWallet_wallet-core) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/trustwallet/wallet-core) ![GitHub](https://img.shields.io/github/license/TrustWallet/wallet-core.svg) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/trustwallet/wallet-core) ![SPM](https://img.shields.io/badge/SPM-ready-blue) ![Cocoapods](https://img.shields.io/cocoapods/v/TrustWalletCore.svg) # 文档 完整的文档请参考 [developer.trustwallet.com](https://developer.trustwallet.com/wallet-core)。 # 审计报告 安全审计报告位于 [audit](audit) 目录。 # 支持的区块链 Wallet Core 支持超过 **130** 条区块链:Bitcoin、Ethereum、BNB、Cosmos、Solana 以及大多数主流区块链平台。 完整列表请参见 [这里](docs/registry.md)。 # 构建 构建说明请参考 [developer.trustwallet.com/wallet-core/building](https://developer.trustwallet.com/wallet-core/building)。 # 在项目中使用 如果您想在项目中使用钱包核心,请按照以下步骤操作。 ## Android Android 版本发布在 [GitHub packages](https://github.com/trustwallet/wallet-core/packages/700258),您需要添加 GitHub 访问令牌才能安装。请参考 [此安装指南](https://developer.trustwallet.com/wallet-core/integration-guide/android-guide#adding-library-dependency) 或我们 [android 示例项目](https://github.com/trustwallet/wallet-core/blob/master/samples/android/build.gradle) 中的 `build.gradle`。 不要忘记将代码中的版本替换为最新版本:![GitHub release (latest by date)](https://img.shields.io/github/v/release/trustwallet/wallet-core) ## iOS 目前我们支持 Swift Package Manager 和 CocoaPods(未来将不再支持)。 ### SPM 从 [GitHub Releases](https://github.com/trustwallet/wallet-core/releases) 下载最新的 `Package.swift` 并将其放入本地的 `WalletCore` 文件夹中。 在 `Package.swift` 的 `dependencies` 参数中添加以下行: ``` .package(name: "WalletCore", path: "../WalletCore"), ``` 或者添加远程 URL + `master` 分支(它指向最近的二进制发行版,不一定总是最新的): ``` .package(name: "WalletCore", url: "https://github.com/trustwallet/wallet-core", .branchItem("master")), ``` 然后将库添加到目标的 `dependencies` 中: ``` .product(name: "WalletCore", package: "WalletCore"), .product(name: "WalletCoreSwiftProtobuf", package: "WalletCore"), ``` ### CocoaPods 在 Podfile 中添加以下行并运行 `pod install`: ``` pod 'TrustWalletCore' ``` ## NPM(测试版) ``` npm install @trustwallet/wallet-core ``` ## Go(测试版) 请参考 [Go 集成示例](https://github.com/trustwallet/wallet-core/tree/master/samples/go)。 ## Kotlin Multiplatform(测试版) 请参考 [Kotlin Multiplatform 示例](https://github.com/trustwallet/wallet-core/tree/master/samples/kmp) # 项目 使用 Trust Wallet Core 的项目列表。欢迎补充您的项目: [Trust Wallet](https://trustwallet.com) [Coinpaprika](https://coinpaprika.com/) | [crypto.com](https://crypto.com) | [Frontier](https://frontier.xyz/) | [Tokenary](https://tokenary.io/) | [MemesWallet](https://planetmemes.com/) | [xPortal](https://xportal.com/) | [Slingshot](https://slingshot.finance/) | [ECOIN Wallet](https://play.google.com/store/apps/details?id=org.ecoinwallet&pcampaignid=web_share) # 免责声明 Wallet Core 项目由 Trust Wallet 主导并维护,拥有庞大的贡献者社区,并被多个项目积极使用。Wallet Core 的目标是为其他钱包提供便捷的方式以添加链支持。 Trust Wallet 产品依赖 Wallet Core,但由于各自的产品需求,它们可能不会使用 Wallet Core 的所有功能、特性和资产。 # 许可证 Trust Wallet Core 在 Apache 2.0 许可证下可用。详细信息请参考 [LICENSE](LICENSE) 文件。
标签:Android, C++, DSL, iOS, JS文件枚举, Kotlin, Rust, SEO, Swift, Trust Wallet, Wasm, 低层级加密, 加密货币, 区块链, 区块链开发, 可视化界面, 多语言支持, 安全测试框架, 开源, 开源框架, 持续集成, 数字钱包, 数据擦除, 核心库, 移动优先, 移动端钱包, 网络流量审计, 请求拦截, 跨链, 钱包库