Skip to content

Commit

Permalink
release: 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Aug 17, 2024
1 parent c3d0f70 commit 8544f87
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

## 0.1.1
- improve: add `@JvmOverloads` annotation to `toSeed()` and `toHdMasterKey()`
- improve: add `@JvmOverloads` annotation to `toSeed()` and `toHdMasterKey()` methods.

## 0.1.0
- Initial release.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# mnemonic4j

[![Test and Deploy](https://github.com/lightsail-network/mnemonic4j/actions/workflows/test-deploy.yml/badge.svg?branch=main)](https://github.com/lightsail-network/mnemonic4j/actions/workflows/test-deploy.yml)
[![Maven Central Version](https://img.shields.io/maven-central/v/network.lightsail/mnemonic4j)](https://central.sonatype.com/artifact/network.lightsail/mnemonic4j)
[![javadoc](https://javadoc.io/badge2/network.lightsail/mnemonic4j/javadoc.svg)](https://javadoc.io/doc/network.lightsail/mnemonic4j)

Java implementation of [BIP-0039](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki): Mnemonic code for
generating deterministic keys.

Expand All @@ -16,20 +20,27 @@ To use this library in your Java project, add the following dependency to your `
```xml

<dependency>
<groupId>org.lightsail</groupId>
<groupId>network.lightsail</groupId>
<artifactId>mnemonic4j</artifactId>
<version>{version}</version>
<version>0.1.1</version>
</dependency>
```

If you are using Gradle, add the following dependency to your `build.gradle` file:

```kotlin
dependencies {
implementation("org.lightsail:mnemonic4j:{version}")
implementation("network.lightsail:mnemonic4j:0.1.1")
}
```

## Documentation

Full documentation for this library can be found on:

- [Javadoc](https://javadoc.io/doc/network.lightsail/mnemonic4j)
- [GitHub Pages (latest release)](https://lightsail-network.github.io/mnemonic4j/)

## Usage

### Generating Mnemonic Sentence
Expand All @@ -52,6 +63,15 @@ Mnemonic mnemonic = new Mnemonic();
byte[] seed = Mnemonic.toSeed(words, "");
```

### Checking Mnemonic Validity

To check if a mnemonic sentence is valid, use the `isValid` method:

```java
String words = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
boolean valid = new Mnemonic().check(words);
```

### Retrieving Original Entropy

To retrieve the original entropy from a mnemonic sentence, use the toEntropy method:
Expand All @@ -71,7 +91,7 @@ Mnemonic mnemonic = new Mnemonic(Language.CHINESE_SIMPLIFIED, null);
String words = mnemonic.generate();
```

To use a custom word list, pass the list of words as an array of strings:
To use a custom word list, pass the list of words as a `List<String>` to the `Mnemonic` constructor:

```java
List<String> customWords = Arrays.asList("word0", "word2", "word3", ...);
Expand Down
9 changes: 3 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "network.lightsail"
version = "0.1.0"
version = "0.1.1"

repositories {
mavenCentral()
Expand All @@ -19,8 +19,6 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.0")
}



tasks {
test {
useJUnitPlatform()
Expand All @@ -33,8 +31,8 @@ tasks {

val javadocJar by creating(Jar::class) {
archiveClassifier = "javadoc"
dependsOn(javadoc)
from(javadoc.get().destinationDir) // It needs to be placed after the javadoc task, otherwise it cannot read the path we set.
dependsOn(dokkaJavadoc)
from(dokkaJavadoc)
}
}

Expand All @@ -53,7 +51,6 @@ publishing {
create<MavenPublication>("mavenJava") {
artifactId = "mnemonic4j"
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom {
name.set("mnemonic4j")
Expand Down

0 comments on commit 8544f87

Please sign in to comment.