Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d780ed9
add example monero_c static lib build script
sneurlax Oct 10, 2024
2a31615
add example rust binding
sneurlax Oct 10, 2024
eb7cc58
support building other archs, copy file to correct path
sneurlax Oct 10, 2024
440f6c3
Merge branch 'master' into rust
sneurlax Oct 10, 2024
a42cbbe
prove integration
sneurlax Oct 10, 2024
4694bb9
convert to lib
sneurlax Oct 11, 2024
c2c2f2c
allow lib to be loaded by consumer crates
sneurlax Oct 11, 2024
3ceeecc
/monero_rust -> /monero.rs
sneurlax Oct 11, 2024
d3059b8
remove LICENSE
sneurlax Oct 11, 2024
85590d6
refer to correct repository
sneurlax Oct 11, 2024
1e85aff
remove system exports from bindings.rs
sneurlax Oct 11, 2024
2bdb7f9
support loading lib from /lib or same dir as bin
sneurlax Oct 11, 2024
a81f173
add ../../release as first lib location candidate
sneurlax Oct 11, 2024
aff9176
remove impls/monero.rs/scripts/build_monero_c.sh
sneurlax Oct 12, 2024
4f52286
update docs re: supported library paths
sneurlax Oct 12, 2024
aab9ea7
fix android lib
sneurlax Oct 12, 2024
44c1676
deduplicate wallet manager pointer and library reference
sneurlax Oct 12, 2024
dc103c8
refactor library loading
sneurlax Oct 12, 2024
a046d90
replace main.rs demo with integration tests
sneurlax Oct 12, 2024
774091b
do not use libloading
sneurlax Oct 15, 2024
0d9b372
silence naming-related warnings
sneurlax Oct 15, 2024
c7d7cf6
add unit tests
sneurlax Oct 15, 2024
9df600a
add Doc-tests
sneurlax Oct 15, 2024
78b1aef
NetworkType enum
sneurlax Oct 15, 2024
b556f50
Merge branch 'master' into rust
sneurlax Oct 15, 2024
6260fed
Merge branch 'master' into rust
sneurlax Oct 16, 2024
edfe554
make seed_offset an Option
sneurlax Oct 17, 2024
0a57eb4
add get_status fn for error-handling
sneurlax Oct 17, 2024
824a829
handle null wallet ptr case
sneurlax Oct 17, 2024
ff39a28
add open_wallet
sneurlax Oct 17, 2024
7a90b8f
add get_balance
sneurlax Oct 17, 2024
73c486e
make error handling in line with monero.ts example
sneurlax Oct 17, 2024
fa7fa68
add test cases for open_wallet
sneurlax Oct 17, 2024
0c0c413
add create_account
sneurlax Oct 18, 2024
6f04d70
add get_accounts
sneurlax Oct 18, 2024
39ff302
add close_wallet
sneurlax Oct 19, 2024
0bd5ae9
add get_height
sneurlax Oct 19, 2024
dce42cf
add init
sneurlax Oct 19, 2024
0114449
add refresh
sneurlax Oct 19, 2024
3b09a94
add untested transfer
sneurlax Oct 19, 2024
3d51547
add untested sweep_all
sneurlax Oct 19, 2024
e112ca4
WIP generate_from_keys
sneurlax Oct 19, 2024
be9cc33
add TODO
sneurlax Oct 19, 2024
57dce1e
clean up gitignore
sneurlax Oct 19, 2024
230d29a
add set_seed_language and use it to fix the generate_from_keys tests
sneurlax Oct 19, 2024
8f830af
add MONERO_Wallet_checkTxKey to wallet2_api_c.cpp
sneurlax Oct 20, 2024
5e9a878
add throw_if_error test, standardize docs comments
sneurlax Oct 20, 2024
4d339e8
add WIP check_tx_key
sneurlax Oct 20, 2024
8c25f0d
Update impls/monero.rs/example/Cargo.toml
sneurlax Oct 21, 2024
755749e
add restore_mnemonic
sneurlax Oct 21, 2024
1c1e0f2
add restore_polyseed
sneurlax Oct 21, 2024
06beb39
update example
sneurlax Oct 21, 2024
1d6dc08
WIP scanning example
sneurlax Oct 21, 2024
c166316
WIP example docs
sneurlax Oct 21, 2024
039ea32
update MONERO_Wallet_checkTxKey IAW feedback
sneurlax Oct 22, 2024
779ac9a
update header to match impl
sneurlax Oct 22, 2024
a66f82b
WIP check_tx_key with failing tests
sneurlax Oct 29, 2024
510cb14
add watch only (viewkey only) generate_from_keys integration test
sneurlax Oct 29, 2024
8e7bc59
update docs re: lib placement
sneurlax Oct 29, 2024
8121647
Merge branch 'develop' into rust
MrCyjaneK Jan 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
release/
build/
build/
3 changes: 3 additions & 0 deletions impls/monero.rs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target/
scripts/monero_c
lib/
288 changes: 288 additions & 0 deletions impls/monero.rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions impls/monero.rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "monero_rust"
version = "0.0.1"
edition = "2021"
description = "monero_c Rust bindings."
repository = "https://github.com/ManyMath/monero_rust"
license = "MIT"
build = "build.rs"

[lib]
name = "monero_rust"
path = "src/lib.rs"
crate-type = ["lib", "cdylib"]

[dependencies]
libc = "0.2"
libloading = "0.8.5"

[build-dependencies]
bindgen = "0.70.1"

22 changes: 22 additions & 0 deletions impls/monero.rs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2024 Joshua Babb

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

46 changes: 46 additions & 0 deletions impls/monero.rs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# `monero_rust`
Proof of concept `monero_c` bindings for Rust.

## Getting started
<!--
### Prerequisites
You may need
```
sudo apt-get install libhidapi-dev
```
-->
### Build `monero_c`
Build the monero_c library for your architecture. Follow the upstream docs at
https://github.com/MrCyjaneK/monero_c <!-- TODO: use example CMakeLists --> and
place the library at `monero_c/impls/monero_rust/lib/libwallet2_api_c.so` or use
the provided script:
```
cd scripts
./build_monero_c.sh
```

or build it manually as in:
```
git clone https://git.mrcyjanek.net/MrCyjaneK/monero_c --branch rust
cd monero_c
git submodule update --init --recursive
rm -rf monero wownero release # Clean any previous builds.
git submodule update --init --recursive --force
./apply_patches.sh monero
./build_single.sh monero x86_64-linux-gnu -j$(nproc)

# Adjust the commands below for your arch.
unxz -f release/monero/x86_64-linux-gnu_libwallet2_api_c.so.xz
mv release/monero/x86_64-linux-gnu_libwallet2_api_c.so ../lib/libwallet2_api_c.so
# The library should be at monero_c/impls/monero_rust/lib/libwallet2_api_c.so.
```

### Run `monero_rust` demo
From `monero_c/impls/monero_rust`:
```
cargo run
```

## Using `monero_rust` in your own crate
Refer to the `example` folder. `libwallet2_api_c.so` must be in the same
directory as the binary (*eg.* at `example/target/debug/libwallet2_api_c.so`).
Loading