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)。
[](https://github.com/trustwallet/wallet-core/actions/workflows/ios-ci.yml)
[](https://github.com/trustwallet/wallet-core/actions/workflows/android-ci.yml)
[](https://github.com/trustwallet/wallet-core/actions/workflows/linux-ci.yml)
[](https://github.com/trustwallet/wallet-core/actions/workflows/linux-ci-rust.yml)
[](https://github.com/trustwallet/wallet-core/actions/workflows/wasm-ci.yml)
[](https://github.com/trustwallet/wallet-core/actions/workflows/kotlin-ci.yml)
[](https://github.com/trustwallet/wallet-core/actions/workflows/docker.yml)
[](https://sonarcloud.io/summary/new_code?id=TrustWallet_wallet-core)
[](https://gitpod.io/#https://github.com/trustwallet/wallet-core)




# 文档
完整的文档请参考 [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`。
不要忘记将代码中的版本替换为最新版本:
## 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 的项目列表。欢迎补充您的项目:
[标签:Android, C++, DSL, iOS, JS文件枚举, Kotlin, Rust, SEO, Swift, Trust Wallet, Wasm, 低层级加密, 加密货币, 区块链, 区块链开发, 可视化界面, 多语言支持, 安全测试框架, 开源, 开源框架, 持续集成, 数字钱包, 数据擦除, 核心库, 移动优先, 移动端钱包, 网络流量审计, 请求拦截, 跨链, 钱包库