# tokencore
**Repository Path**: leaderThree/tokencore
## Basic Information
- **Project Name**: tokencore
- **Description**: 区块链钱包核心组件,支持(BTC,OMNI,ETH,ERC20,TRX,TRC20,BCH,BSV,DOGE,DASH,LTC)
- **Primary Language**: Java
- **License**: GPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 28
- **Created**: 2021-03-17
- **Last Updated**: 2021-03-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
tokencore
-en [English](README_en.md)
-zh_CN [Simplified Chinese](README.md)
# tokencore introduction
##### The core components of the blockchain wallet backend, support BTC, OMNI, ETH, ERC20, TRX, TRC20, BCH, BSV, DOGE, DASH, LTC
# tokencore usage
#### Introducing this library
gradle way
In your build.gradle
```
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.paipaipaipai:tokencore:1.1.0'
}
```
maven way
```
jitpack.io
https://jitpack.io
com.github.paipaipaipai
tokencore
1.1.0
```
#### Initialize identity
```java
try {
Files.createDirectories(Paths.get("${keyStoreProperties.dir}/wallets"))
} catch (Throwable ignored) {
}
//KeystoreStorage is an interface that implements its getdir method
WalletManager.storage = KeystoreStorage();
WalletManager.scanWallets();
String password = "123456";
Identity identity = Identity.GetCurrentIdentity ();
if (identity == null) {
Identity.createIdentity(
"token",
password,
"",
Network.MAINNET,
Metadata.P2WPKH
);
}
```
#### Generate wallet
```java
Identity identity = Identity.GetCurrentIdentity ()
String password ="123456";
List chainTypes = new ArrayList();
chainTypes.add(ChainType.BITCOIN);
List wallets = identity.DeriveWalletsByMnemonics (
chainTypes,
password,
MnemonicUtil.randomMnemonicCodes()
);
```
#### Offline signature
```java
String password ="123456";
String toAddress ="dsadsadsadsa";
int changeIdx =0;
long amount =1000L;
long fee =555L;
//utxos needs to go to the node or external api to get
ArrayList utxos = new ArrayList();
BitcoinTransaction bitcoinTransaction = BitcoinTransaction (
toAddress,
changeIdx,
amount,
fee,
utxos
);
TxSignResult txSignResult = bitcoinTransaction.SignTransaction (
ChainId.BITCOIN_MAINNET.toString(),
password,
wallet
);
```
#### Note: This is just a functional component of a digital currency! ! ! It is only for learning and does not provide complete blockchain business functions.