https://github.com/zeriontech/wallet-core-android
This repository contains Wallet Core used by Zerion Android.
https://github.com/zeriontech/wallet-core-android
Last synced: about 1 year ago
JSON representation
This repository contains Wallet Core used by Zerion Android.
- Host: GitHub
- URL: https://github.com/zeriontech/wallet-core-android
- Owner: zeriontech
- License: apache-2.0
- Created: 2022-04-22T01:57:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-22T12:22:24.000Z (almost 3 years ago)
- Last Synced: 2025-05-07T04:43:22.649Z (about 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 96.7 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zerion Wallet Core
This repository contains Wallet Core used by Zerion Android app.
## Examples
> Check androidTests to see all examples.
Define wallet data source, repository and cipherManager:
```kotlin
val cipherManager = CipherManager(context)
val dataSource = WalletDataSourceImpl(cipherManager, "com.mywallet")
val repository = WalletRepositoryImpl(dataSource)
```
Import or create wallet:
```kotlin
val walletContainer = repository.importWalletPersist(mnemonic, password, "My wallet")
// or
val walletContainer = repository.importWalletPersist(privateKey, password, "My wallet")
//
val walletContainer = repository.createWallet(password, "My wallet")
```
Derive accounts with index or derivation path:
```kotlin
val account0 = walletContainer.deriveAccount(0, password)
val account1 = walletContainer.deriveAccount("m/44'/60'/0'/0/0", password)
```
Access private key via index or derivation path:
```kotlin
val privateKey0 = walletContainer.decryptPrivateKey(0, password).toHex()
val privateKey1 = walletContainer.decryptPrivateKey("m/44'/60'/0'/0/0", password).toHex()
```
Access seed phrase:
```kotlin
val mnemonic = walletContainer.decryptMnemonic(password)
```
Sign transaction:
```kotlin
val transaction = TransactionInput(
chainID = ...,
gasPrice = ...,
nonce = ...,
gas = ...,
toAddress = ...,
data = ...,
amount = ...,
)
val signed = Signer.sign(Transaction(transaction), privateKey).toHex()
```
## Dependencies
[TrustWalletCore](https://github.com/trustwallet/wallet-core) - low level wallet cryptography functionality, written in C++ with Java wrappers.
## License
Zerion Wallet Core is available under the Apache 2.0 license. See the [LICENSE](LICENSE) file for more info.