Skip to content

Commit be8a0bf

Browse files
committed
support for bip32, bip39, script, address
1 parent 4202a32 commit be8a0bf

File tree

119 files changed

+6605
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+6605
-119
lines changed

.gitignore

Lines changed: 106 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,107 @@
1-
# Created by https://www.gitignore.io/api/macos
2-
3-
### macOS ###
4-
# General
1+
# Created by https://www.toptal.com/developers/gitignore/api/android
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=android
3+
4+
### Android ###
5+
# Built application files
6+
*.apk
7+
*.ap_
8+
*.aab
9+
10+
# Files for the ART/Dalvik VM
11+
*.dex
12+
13+
# Java class files
14+
*.class
15+
16+
# Generated files
17+
bin/
18+
gen/
19+
out/
20+
# Uncomment the following line in case you need and you don't have the release build type files in your app
21+
# release/
22+
23+
# Gradle files
24+
.gradle/
25+
build/
26+
27+
# Local configuration file (sdk path, etc)
28+
local.properties
29+
30+
# Proguard folder generated by Eclipse
31+
proguard/
32+
33+
# Log Files
34+
*.log
35+
36+
# Android Studio Navigation editor temp files
37+
.navigation/
38+
39+
# Android Studio captures folder
40+
captures/
41+
42+
# IntelliJ
43+
*.iml
44+
.idea/workspace.xml
45+
.idea/tasks.xml
46+
.idea/gradle.xml
47+
.idea/assetWizardSettings.xml
48+
.idea/dictionaries
49+
.idea/libraries
50+
# Android Studio 3 in .gitignore file.
51+
.idea/caches
52+
.idea/modules.xml
53+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
54+
.idea/navEditor.xml
55+
56+
# Keystore files
57+
# Uncomment the following lines if you do not want to check your keystore files in.
58+
#*.jks
59+
#*.keystore
60+
61+
# External native build folder generated in Android Studio 2.2 and later
62+
.externalNativeBuild
63+
.cxx/
64+
65+
# Google Services (e.g. APIs or Firebase)
66+
# google-services.json
67+
68+
# Freeline
69+
freeline.py
70+
freeline/
71+
freeline_project_description.json
72+
73+
# fastlane
74+
fastlane/report.xml
75+
fastlane/Preview.html
76+
fastlane/screenshots
77+
fastlane/test_output
78+
fastlane/readme.md
79+
80+
# Version control
81+
vcs.xml
82+
83+
# lint
84+
lint/intermediates/
85+
lint/generated/
86+
lint/outputs/
87+
lint/tmp/
88+
# lint/reports/
89+
90+
### Android Patch ###
91+
gen-external-apklibs
92+
output.json
93+
94+
# Replacement of .externalNativeBuild directories introduced
95+
# with Android Studio 3.5.
96+
97+
# End of https://www.toptal.com/developers/gitignore/api/android
98+
99+
# Specific for project
100+
101+
.idea
5102
.DS_Store
6-
.AppleDouble
7-
.LSOverride
8-
9-
# Icon must end with two \r
10-
Icon
11-
12-
# Thumbnails
13-
._*
14-
15-
# Files that might appear in the root of a volume
16-
.DocumentRevisions-V100
17-
.fseventsd
18-
.Spotlight-V100
19-
.TemporaryItems
20-
.Trashes
21-
.VolumeIcon.icns
22-
.com.apple.timemachine.donotpresent
23-
24-
# Directories potentially created on remote AFP share
25-
.AppleDB
26-
.AppleDesktop
27-
Network Trash Folder
28-
Temporary Items
29-
.apdisk
30-
31-
# End of https://www.gitignore.io/api/macos
32-
33-
# Created by https://www.gitignore.io/api/c
34-
35-
### C ###
36-
# Prerequisites
37-
*.d
38-
39-
# Object files
40-
*.o
41-
*.ko
42-
*.obj
43-
*.elf
44-
45-
# Linker output
46-
*.ilk
47-
*.map
48-
*.exp
49-
50-
# Precompiled Headers
51-
*.gch
52-
*.pch
53-
54-
# Libraries
55-
*.lib
56-
*.a
57-
*.la
58-
*.lo
59-
60-
# Shared objects (inc. Windows DLLs)
61-
*.dll
62-
*.so
63-
*.so.*
64-
*.dylib
65-
66-
# Executables
67-
*.exe
68-
*.out
69-
*.app
70-
*.i*86
71-
*.x86_64
72-
*.hex
73-
74-
# Debug files
75-
*.dSYM/
76-
*.su
77-
*.idb
78-
*.pdb
79-
80-
# Kernel Module Compile Results
81-
*.mod*
82-
*.cmd
83-
.tmp_versions/
84-
modules.order
85-
Module.symvers
86-
Mkfile.old
87-
dkms.conf
88-
89-
# End of https://www.gitignore.io/api/c
103+
android/app/src/main/jniLibs
104+
java/src/main/libs
105+
local.properties
106+
107+
# End of Specific for project

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "deps/libwally-core"]
2+
path = deps/libwally-core
3+
url = [email protected]:ElementsProject/libwally-core.git
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
-----BEGIN PGP SIGNED MESSAGE-----
2+
Hash: SHA256
3+
4+
# Contributor License Agreement
5+
6+
Version 1.0
7+
8+
Name: Hieu Pham
9+
10+
11+
12+
Legal Jurisdiction: Wyoming, United States of America
13+
14+
Project: https://github.com/BlockchainCommons/bc-libwally-java
15+
16+
Date: Dec-4-2020
17+
18+
## Purpose
19+
20+
This agreement gives Blockchain Commons, LLC the permission it needs in order to accept my contributions into its open software project and to manage the intellectual property in that project over time.
21+
22+
## License
23+
24+
I hereby license Blockchain Commons, LLC to:
25+
26+
1. do anything with my contributions that would otherwise infringe my copyright in them
27+
28+
2. do anything with my contributions that would otherwise infringe patents that I can or become able to license
29+
30+
3. sublicense these rights to others on any terms they like
31+
32+
## Reliability
33+
34+
I understand that Blockchain Commons will rely on this license. I may not revoke this license.
35+
36+
## Awareness
37+
38+
I promise that I am familiar with legal rules, like ["work made for hire" rules](http://worksmadeforhire.com), that can give employers and clients ownership of intellectual property in work that I do. I am also aware that legal agreements I might sign, like confidential information and invention assignment agreements, will usually give ownership of intellectual property in my work to employers, clients, and companies that I found. If someone else owns intellectual property in my work, I need their permission to license it.
39+
40+
## Copyright Guarantee
41+
42+
I promise not to offer contributions to the project that contain copyrighted work that I do not have legally binding permission to contribute under these terms. When I offer a contribution with permission, I promise to document in the contribution who owns copyright in what work, and how they gave permission to contribute it. If I later become aware that one of my contributions may have copyrighted work of others that I did not have permission to contribute, I will notify Blockchain Commons, in confidence, immediately.
43+
44+
## Patent Guarantee
45+
46+
I promise not to offer contributions to the project that I know infringe patents of others that I do not have permission to contribute under these terms.
47+
48+
## Open Source Guarantee
49+
50+
I promise not to offer contributions that contain or depend on the work of others, unless that work is available under a license that [Blue Oak Council rates bronze or better](https://blueoakconcil.org/list), such as the MIT License, two- or three-clause BSD License, the Apache License Version 2.0, or the Blue Oak Model License 1.0.0. When I offer a contribution containing or depending on others' work, I promise to document in the contribution who licenses that work, along with copies of their license terms.
51+
52+
## Disclaimers
53+
54+
***As far as the law allows, my contributions come as is, without any warranty or condition. Other than under [Copyright Guarantee](#copyright-guarantee), [Patent Guarantee](#patent-guarantee), or [Open Source Guarantee](#open-source-guarantee), I will not be liable to anyone for any damages related to my contributions or this contributor license agreement, under any kind of legal claim.***
55+
56+
- ---
57+
58+
To sign this Contributor License Agreement, fill in `$name`, `$email`, and `$date` above. Then sign using GPG using the following command `gpg --armor --clearsign --output ./CLA-signed/CLA.YOURGITHUBNAME.YOURGPGFINGERPRINT.asc CLA.md`, then either submit your signed Contributor License Agreement to this repo as a GPG signed Pull Request or email it to [[email protected]](mailto:[email protected]).
59+
-----BEGIN PGP SIGNATURE-----
60+
61+
iQIzBAEBCAAdFiEE0U5WaWeZbGlLIuE6foCKxQOSrToFAl/KEQ8ACgkQfoCKxQOS
62+
rTrFZRAAyS+hEeESO7XlDt8NpBChjaidMfNiHWJPJTftHLrZSA56NLIIHB971HUi
63+
PIUGBC+/dMnydXC3jFPtiRLT0GRDApdaH/MBZfyICsKe/7wvHTSolM+L5FSxZFPZ
64+
bBoj8roAsprjXt/MFAsIXeC8lqxuNuLOr9PasNI2AzCkF4qHF8b9bsllONMBJgFk
65+
r6kfBhNLKDXdjjIPZTrsxoKOG9bkZmjvfF522HpTM7arGqCW5fzelzUAp5E6U1yA
66+
X4/VvFxq3NlxvUqy2akofb/hEJWxenCbORi4m0kb2OeAnyWyT2nEziuzSHrTp+M1
67+
I/6nFa/rW1GHLuCnsiIXjZ1U1KUMPciU56uoBddPUwbNTAYQLAGjtJpZ46WjyRX0
68+
Fp2SFlcV3nvye0RbvNMfYaVOcMPwVuO4zGf31Y8KlTxHsW6sR0p6WVmcGIlziBMV
69+
NpdTnGXpqUVvOd9AfutDxWooJc/BIRXavJ70d/U6nHoZy0hqrFQyOKchbJhhQa/I
70+
UsgJSyTr8oh8HmvI037dMHTi8N+O0dZdpteCDHTPcroGIhuUcBY4ofM6yOpSP66w
71+
DV+6Vg+hdvYPrhDUy3ccFaljdM6fby+qX8vKK/zJ3lSw/XYXOubEx/7qMc6vjI7O
72+
sUsDj5E1H9WxfUtfqN8bCTLakOK1UAxbpDD8n7tB4J4VDvSz2qs=
73+
=xfsA
74+
-----END PGP SIGNATURE-----

CLA.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ E-Mail: `$email`
88

99
Legal Jurisdiction: Wyoming, United States of America
1010

11-
Project: https://github.com/BlockchainCommons/bc-lethe-kit
11+
Project: https://github.com/BlockchainCommons/bc-libwally-java
1212

1313
Date: `$date`
1414

@@ -52,4 +52,4 @@ I promise not to offer contributions that contain or depend on the work of other
5252

5353
---
5454

55-
To sign this Contributor License Agreement, fill in `$name`, `$email`, and `$date` above. Then sign using GPG using the following command `gpg --armor --clearsign --output ./CLA-signed/CLA.YOURGITHUBNAME.YOURGPGFINGERPRINT.asc CLA.md`, then either submit your signed Contributor License Agreement to this repo as a GPG signed Pull Request or email it to [[email protected]](mailto:[email protected]).
55+
To sign this Contributor License Agreement, fill in `$name`, `$email`, and `$date` above. Then sign using GPG using the following command `gpg --armor --clearsign --output ./CLA-signed/CLA.YOURGITHUBNAME.YOURGPGFINGERPRINT.asc CLA.md`, then either submit your signed Contributor License Agreement to this repo as a GPG signed Pull Request or email it to [[email protected]](mailto:[email protected]).

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These owners will be the default owners for everything in this repo.
22

3-
* @ChristopherA
3+
* @ChristopherA @jollyjoker992

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ In short, when you submit code changes, your submissions are understood to be av
6262

6363
Portions of this CONTRIBUTING.md document were adopted from best practices of a number of open source projects, including:
6464
* [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
65-
* [IPFS Contributing](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
65+
* [IPFS Contributing](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

INSTALLATION.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Installation for Blockchain Commons Libwally Java library
2+
This document gives the instruction for installing the Blockchain Commons Libwally Java library.
3+
4+
## Dependencies
5+
> We add utility script for installing all system dependencies, you can find it at `<platform>/scripts/install_deps.sh`
6+
If you want to do it manually by yourself, make sure all of following dependencies are installed correctly.
7+
8+
[Adopt Open JDK 1.8](https://github.com/AdoptOpenJDK/openjdk8-binaries/releases) is recommended for both MacOS and Linux.
9+
10+
### Linux (Well tested on Ubuntu 16.04 and above)
11+
> Following packages can be installed via `apt-get`
12+
13+
- automake
14+
- make
15+
- libtool
16+
- wget
17+
- sudo
18+
- clang
19+
- unzip
20+
21+
### MacOS
22+
> Following packages can be installed via `brew`
23+
24+
- automake
25+
- make
26+
- libtool
27+
- gnu-sed
28+
29+
## Build native libraries
30+
> Native libraries for this project includes `libwallycore` and the other jni wrapper libraries.
31+
You only need to build `libwallycore` once since it's not frequently changed but you have to rebuild the jni libraries each time there is any changes in the jni codes.
32+
33+
Build `libwallycore` only
34+
```console
35+
$ sudo ./scripts/build-host.sh
36+
```
37+
38+
Build jni libraries only
39+
```console
40+
$ sudo ./scripts/build-jni.sh
41+
```
42+
43+
Run following command for building all native libraries, includes `libwallycore` and jni libraries
44+
```console
45+
$ sudo ./scripts/build.sh
46+
```
47+
48+
## Android
49+
> Working directory: `/android`
50+
51+
### Testing
52+
```console
53+
$ ./gradlew clean connectedDebugAndroidTest
54+
```
55+
56+
### Bundling
57+
```console
58+
$ ./gradlew clean assembleRelease
59+
```
60+
61+
> The `app-release.aar` file would be found in `app/build/outputs/aar`. You can compile it as a library in your project.
62+
63+
64+
## Java (Web app/ Desktop app)
65+
> Working directory: `/java`
66+
67+
> You need to install native libraries into `java.library.path` for JVM can load it at runtime.
68+
69+
### Testing
70+
The test tasks automatically points JVM `java.library.path` to native libraries path so make sure you already built the native libraries before executing the tests.
71+
72+
Run following command for executing test cases.
73+
```console
74+
$ ./gradlew test
75+
```
76+
77+
### Bundling
78+
The `jar` file will be bundled by running
79+
```console
80+
$ ./gradlew assemble
81+
```
82+
83+
> `jar` file just contain all `.class` files for running pure Java, no dynamic library is carried with.

0 commit comments

Comments
 (0)