-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update docs but remove inline docs comments until lib is more mature
- Loading branch information
Showing
5 changed files
with
138 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# `monero_c/impls/monero.rs/example` | ||
Refer to the latest documentation at | ||
https://github.com/MrCyjaneK/monero_c/blob/master/README.md and | ||
https://github.com/MrCyjaneK/monero_c/blob/master/impls/monero.rs/README.md for | ||
the latest documentation. | ||
|
||
## `monero_c` library | ||
A `monero_c` library is required to use these bindings. Build or download the | ||
`monero_c` library for your architecture. Follow the upstream docs at | ||
https://github.com/MrCyjaneK/monero_c or download the latest release from | ||
https://github.com/MrCyjaneK/monero_c/releases. The library can be placed in | ||
one of several supported locations relative to the binary in use: | ||
- `.` | ||
that is, if your binary is in `target/debug` or `target/release`, the library | ||
should also be adjacent to the binary in `release` or `debug`, respectively. | ||
If you're distributing your binary, place the library in the same directory. | ||
- `../../lib` | ||
so if your binary gets built to `target/profile`, then your library can be | ||
in `lib`. | ||
- `../../../../release` | ||
which is a holdover from the original `monero_c` bindings and may not be | ||
practical for your project unless it's also structured as a child of the | ||
`monero_c` repository. | ||
|
||
and should match your platform as in: | ||
- Android: `libmonero_libwallet2_api_c.so` | ||
- iOS: `MoneroWallet.framework/MoneroWallet` | ||
- Linux: `monero_libwallet2_api_c.so` | ||
- macOS: `monero_libwallet2_api_c.dylib` | ||
- Windows: `monero_libwallet2_api_c.dll` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
use monero_rust::{WalletError, WalletManager, NETWORK_TYPE_MAINNET}; | ||
use monero_rust::{network, WalletError, WalletManager}; | ||
|
||
fn main() -> Result<(), WalletError> { | ||
let wallet_manager = WalletManager::new(None)?; | ||
|
||
let wallet = wallet_manager.create_wallet( | ||
"wallet", | ||
"wallet_name", | ||
"password", | ||
"English", | ||
NETWORK_TYPE_MAINNET, | ||
network::MAINNET, | ||
)?; | ||
|
||
println!("Wallet created successfully."); | ||
|
||
match wallet.get_seed("") { | ||
Ok(seed) => println!("Seed: {}", seed), | ||
Err(e) => { | ||
eprintln!("Failed to get seed: {:?}", e); | ||
return Err(e); | ||
} | ||
Err(e) => eprintln!("Failed to get seed: {:?}", e), | ||
} | ||
|
||
let address = wallet.get_address(0, 0)?; | ||
println!("Wallet Address: {}", address); | ||
match wallet.get_address(0, 0) { | ||
Ok(address) => println!("Primary address: {}", address), | ||
Err(e) => eprintln!("Failed to get address: {:?}", e), | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.