Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ test_wallets
.idea
.codacy
coverage*
.coverage
.coverage
.cache
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A Python library for creating Monero applications using RPC and Python bindings
* Supports wallet and daemon RPC clients.
* Supports client-side wallets using Python bindings.
* Supports multisig, view-only, and offline wallets.
* Wallet types are interchangeable by conforming to a [common interface](https://woodser.github.io/monero-java/javadocs/monero/wallet/MoneroWallet.html).
* Wallet types are interchangeable by conforming to a [common interface](https://everoddandeven.github.io/monero-python/mkdocs/public/api/wallet/).
* Uses a clearly defined [data model and API specification](https://github.com/everoddandeven/monero-python/blob/main/docs/monero-spec.pdf) intended to be intuitive and robust.
* Query wallet transactions, transfers, and outputs by their properties.
* Fetch and process binary data from the daemon (e.g. raw blocks).
Expand All @@ -31,7 +31,7 @@ A Python library for creating Monero applications using RPC and Python bindings
<p align="center">
<img width="85%" height="auto" src="docs/architecture.png"/><br>
<i>Build Python
applications using RPC or Python bindings to <a href="https://github.com/monero-project/monero">monero-project/monero</a>. Wallet implementations are interchangeable by conforming to a common interface, <a href="https://woodser.github.io/monero-java/javadocs/monero/wallet/MoneroWallet.html">MoneroWallet</a>.</i>
applications using RPC or Python bindings to <a href="https://github.com/monero-project/monero">monero-project/monero</a>. Wallet implementations are interchangeable by conforming to a common interface, <a href="https://everoddandeven.github.io/monero-python/mkdocs/public/api/wallet/">MoneroWallet</a>.</i>
</p>


Expand Down
10 changes: 6 additions & 4 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@


def pytest_runtest_call(item: pytest.Item):
# get not_supported marked
marker = item.get_closest_marker("not_supported")
not_implemented = False
# get not_supported marker
marker: pytest.Mark | None = item.get_closest_marker("not_supported")
not_implemented: bool = False

if marker is None:
# get not_implemented marker
marker = item.get_closest_marker("not_implemented")
not_implemented = True

if marker is None:
# marked not found
# marker not found
return

try:
Expand Down
4 changes: 4 additions & 0 deletions docs/mkdocs/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% extends "main.html" %}
{% block content %}
<h1>401 - Unauthorized</h1>
{% endblock %}
8 changes: 8 additions & 0 deletions docs/mkdocs/docs/en/api/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Architecture
---
# Architecture

<p align="center">
<img width="100%" height="auto" src="../../images/architecture.png"/><br>
</p>
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: RPC Connection
---
# RPC Connection

::: monero.MoneroRpcConnection
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/daemon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Daemon Interface
---
# Daemon Interface

::: monero.MoneroDaemon
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/daemon_rpc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Daemon RPC
---
# Daemon RPC

::: monero.MoneroDaemonRpc
10 changes: 10 additions & 0 deletions docs/mkdocs/docs/en/api/data_model/connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Connection Data Model
---
# Connection Data Model

::: monero.MoneroSslOptions

::: monero.MoneroConnectionType

::: monero.MoneroConnectionPriorityComparator
58 changes: 58 additions & 0 deletions docs/mkdocs/docs/en/api/data_model/daemon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Daemon Data Model
---
# Daemon Data Model

::: monero.MoneroNetworkType

::: monero.MoneroVersion

::: monero.MoneroBlockHeader

::: monero.MoneroBlock

::: monero.MoneroTx

::: monero.MoneroKeyImage

::: monero.MoneroOutput

::: monero.MoneroAltChain

::: monero.MoneroBan

::: monero.MoneroPruneResult

::: monero.MoneroMiningStatus

::: monero.MoneroMinerTxSum

::: monero.MoneroBlockTemplate

::: monero.MoneroConnectionSpan

::: monero.MoneroPeer

::: monero.MoneroSubmitTxResult

::: monero.MoneroTxBacklogEntry

::: monero.MoneroOutputDistributionEntry

::: monero.MoneroOutputHistogramEntry

::: monero.MoneroTxPoolStats

::: monero.MoneroDaemonUpdateCheckResult

::: monero.MoneroDaemonUpdateDownloadResult

::: monero.MoneroFeeEstimate

::: monero.MoneroDaemonInfo

::: monero.MoneroDaemonSyncInfo

::: monero.MoneroHardForkInfo

::: monero.MoneroDaemonListener
66 changes: 66 additions & 0 deletions docs/mkdocs/docs/en/api/data_model/wallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Wallet Data Model
---
# Wallet Data Model

::: monero.MoneroWalletConfig

::: monero.MoneroSyncResult

::: monero.MoneroSubaddress

::: monero.MoneroAccount

::: monero.MoneroDestination

::: monero.MoneroTransfer

::: monero.MoneroIncomingTransfer

::: monero.MoneroOutgoingTransfer

::: monero.MoneroTransferQuery

::: monero.MoneroOutputWallet

::: monero.MoneroOutputQuery

::: monero.MoneroTxWallet

::: monero.MoneroTxQuery

::: monero.MoneroTxSet

::: monero.MoneroIntegratedAddress

::: monero.MoneroTxPriority

::: monero.MoneroTxConfig

::: monero.MoneroKeyImageImportResult

::: monero.MoneroMessageSignatureType

::: monero.MoneroMessageSignatureResult

::: monero.MoneroCheck

::: monero.MoneroCheckTx

::: monero.MoneroCheckReserve

::: monero.MoneroMultisigInfo

::: monero.MoneroMultisigInitResult

::: monero.MoneroMultisigSignResult

::: monero.MoneroAddressBookEntry

::: monero.MoneroAddressType

::: monero.MoneroDecodedAddress

::: monero.MoneroAccountTag

::: monero.MoneroWalletListener
7 changes: 7 additions & 0 deletions docs/mkdocs/docs/en/api/serializable_struct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

---
title: Serializable Struct
---
# Serializable Struct

::: monero.SerializableStruct
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Monero Utilities
---
# Monero Utilities

::: monero.MoneroUtils
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/wallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Wallet Interface
---
# Wallet Interface

::: monero.MoneroWallet
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/wallet_full.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Full Wallet
---
# Full Wallet

::: monero.MoneroWalletFull
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/wallet_keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Keys-Only Wallet
---
# Keys-Only Wallet

::: monero.MoneroWalletKeys
6 changes: 6 additions & 0 deletions docs/mkdocs/docs/en/api/wallet_rpc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: RPC Wallet
---
# RPC Wallet

::: monero.MoneroWalletRpc
45 changes: 45 additions & 0 deletions docs/mkdocs/docs/en/examples/connect_to_rpc_server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Connect to RPC Server
---
# Connect to RPC Server

Developers can create and establish a connection to a rpc server conveniently with a `MoneroRpcConnection`:

```python
from monero import MoneroRpcConnection

# connect to a monerod or wallet rpc server
connection = MoneroRpcConnection("http:://rpc_server_uri:18089")

# set connection credentials if needed
connection.set_credentials("rpc_user", "rpc_password")

# check rpc connection
connection.check_connection()

if not connection.is_connected():
raise Exception("Could not connect to RPC server.")

print("Connection established to RPC server.")
```

After successfully connecting to the rpc server, developers can also invoke methods of the JSON-RPC interface directly:

```python
# invoke JSON-RPC method `get_version`
result = connection.send_json_request("get_version")
print(f"get_version JSON-RPC response: {result}")
```

`MoneroRpcConnection` also accepts an optional `proxy_uri` parameter in its constructor, manageable even after a connection has been created. A prime example of use is to route your traffic via TOR:

!!! note
Setting a `proxy_uri` resets `MoneroRpcConnection` status.

```python
# setup TOR proxy uri by instance attribute
connection.proxy_uri = "127.0.0.1:9050"

# must recall `check_connection()` manually
connection.check_connection()
```
33 changes: 33 additions & 0 deletions docs/mkdocs/docs/en/examples/create_local_full_wallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Create Local Full Wallet
---
# Create Local Full Wallet

`MoneroWalletFull` is another `MoneroWallet` implementation that fully wraps [wallet2 API](https://github.com/monero-project/monero/blob/master/src/wallet/wallet2.h). With a full wallet developers can create wallet files and manage them locally.

Creating a `MoneroWalletFull` is very simple:

```python
from monero import MoneroWalletConfig, MoneroWalletFull, MoneroNetworkType

# setup wallet configuration
config = MoneroWalletConfig()

# setup wallet path
config.path = "test_wallet_full"

# setup wallet password
config.password = "supersecretpassword123"

# setup wallet network type
config.network_type = MoneroNetworkType.TESTNET

wallet = MoneroWalletFull.create_wallet(config)
```

Check if a Monero wallet exists at specific path:

```python
if MoneroWalletFull.wallet_exists("test_wallet_full"):
wallet = MoneroWalletFull.open_wallet("test_wallet_full", "supersecretpassword123", MoneroNetworkType.TESTNET)
```
Loading
Loading