Skip to content

Commit 3efee42

Browse files
committed
Add java helpers a-la python helpers
1 parent 968fc5d commit 3efee42

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/swig_java/jni_extra.java_in

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@
55
return aes(jarg1, jarg2, jarg3, null);
66
}
77

8+
public final static String base58check_from_bytes(byte[] bytes) {
9+
return base58_from_bytes(bytes, BASE58_FLAG_CHECKSUM);
10+
}
11+
12+
private final static byte[] base58_to_bytes(String base58, long flags) {
13+
final byte buf[] = new byte[base58_get_length(base58)];
14+
final int len = base58_to_bytes(base58, flags, buf);
15+
return trimBuffer(buf, len);
16+
}
17+
18+
public final static byte[] base58_to_bytes(String base58) {
19+
return base58_to_bytes(base58, 0);
20+
}
21+
22+
public final static byte[] base58check_to_bytes(String base58) {
23+
return base58_to_bytes(base58, BASE58_FLAG_CHECKSUM);
24+
}
25+
26+
public final static Object bip32_pub_key_init(final int version, final int depth, final int childNum,
27+
final byte[] chainCode, final byte[] pubKey) {
28+
return Wally.bip32_key_init(version, depth, childNum, chainCode, pubKey, null, null, null);
29+
}
30+
31+
public final static Object bip32_priv_key_init(final int version, final int depth, final int childNum,
32+
final byte[] chainCode, final byte[] privateKey) {
33+
return Wally.bip32_key_init(version, depth, childNum, chainCode, null, privateKey, null, null);
34+
}
35+
836
public final static byte[] bip32_key_get_chain_code(Object jarg1) {
937
return bip32_key_get_chain_code(jarg1, null);
1038
}

0 commit comments

Comments
 (0)