Skip to content

Commit

Permalink
refactor!: remove the constructor from KeyPair, use `KeyPair.fromSe…
Browse files Browse the repository at this point in the history
…cretSeed` or `KeyPair.fromAccountId` instead. (#637)
  • Loading branch information
overcat authored Aug 19, 2024
1 parent 65a4fee commit fbdbfc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Pending

### Update
- refactor!: remove the constructor from `KeyPair`, use `KeyPair.fromSecretSeed` or `KeyPair.fromAccountId` instead.

## 1.0.0-alpha0
We are thrilled to announce the release of version 1.0.0-alpha0 for java-stellar-sdk,
which has been in development for nearly a decade. This release marks a significant milestone in our journey,
Expand Down
12 changes: 1 addition & 11 deletions src/main/java/org/stellar/sdk/KeyPair.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,13 @@ public class KeyPair {
Security.addProvider(new BouncyCastleProvider());
}

/**
* Creates a new KeyPair without a private key. Useful to simply verify a signature from a given
* public address.
*
* @param publicKey The public key for this KeyPair.
*/
public KeyPair(@NonNull Ed25519PublicKeyParameters publicKey) {
this(publicKey, null);
}

/**
* Creates a new KeyPair from the given public and private keys.
*
* @param publicKey The public key for this KeyPair.
* @param privateKey The private key for this KeyPair or null if you want a public key only
*/
public KeyPair(
private KeyPair(
@NonNull Ed25519PublicKeyParameters publicKey,
@Nullable Ed25519PrivateKeyParameters privateKey) {
this.publicKey = publicKey;
Expand Down

0 comments on commit fbdbfc3

Please sign in to comment.