react-native-monero 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1 +1,19 @@
1
1
  # react-native-monero
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.3.0 (2026-07-03)
6
+
7
+ - added: `getPendingTransactions`, a paged view of the not-yet-mined transactions. `getAllTransactions` sorts pending entries behind all confirmed ones, so a cursor-based scan of confirmed history never reaches them; this exposes the pending set directly.
8
+ - fixed: LWS wallets sync again. The 0.2.0 https change passed `use_ssl=true` to `wallet->init` for https daemons; wallet2 (monerod) ignores that flag, but lwsf honors it and switches from tolerant `ssl_support_autodetect` to `ssl_support_enabled`, whose certificate verification always fails on iOS/Android (no OpenSSL system CA store in the app sandbox). Every LWS connection was silently dropped at the TLS handshake, so LWS wallets polled forever at height 0 with no transactions or balance. Revert to `use_ssl=false` (TLS still autodetected from the `https://` scheme); the Nym scheme fix is unaffected since it derives https from the port inside NymHttpClient.
9
+ - fixed: Monero Full Node (monerod) sends no longer fail with "Failed to load transaction from file". `createTransaction` now retains the signed transaction natively and `broadcastTransaction` commits it directly, instead of saving it to a file and reloading it: on the full-node (wallet2) backend `save_tx` writes an unsigned tx set while `submitTransaction`'s `load_tx` requires a signed one, so the file round-trip always failed. Retained transactions are capped at 50 per wallet (oldest disposed first) and cleared when the wallet closes. Method signatures are unchanged, but the semantics narrow: `signedTxHex` is now an opaque token (the txid) identifying the retained transaction rather than serialized bytes, a signed transaction can no longer be broadcast after its wallet closes or the app restarts (`broadcastTransaction` reports that it must be recreated), and payments the wallet would split into multiple on-chain transactions are rejected at creation so a broadcast is atomic.
10
+
11
+ ## 0.2.0 (2026-06-29)
12
+
13
+ - changed: Switch the package manager from yarn to npm (package-lock.json + `.npmrc` legacy-peer-deps), matching the other Edge currency repos.
14
+ - fixed: Monero Full Node (monerod) wallets now sync, calculate max, and send when the Nym mixnet is enabled. The Nym HTTP client rebuilt request URLs from an unreliable SSL flag and emitted `http://` on port 443, so every monerod RPC failed under Nym while the same wallet worked with Nym off. Derive the scheme from the daemon address (and treat port 443 as https).
15
+ - fixed: `getWalletStatus` now reads the live wallet balance on every call instead of only recomputing it when the synced block height changes, so a pending incoming transaction (or pending change after a send) is reflected immediately rather than after the next block.
16
+
17
+ ## 0.1.0 (2026-06-15)
18
+
19
+ - Initial release
@@ -82,9 +82,27 @@ export declare class CppBridge {
82
82
  * @returns Paginated transactions with metadata
83
83
  */
84
84
  getAllTransactions(walletId: string, page: number, pageSize: number, sort?: 'asc' | 'desc'): Promise<TransactionsPage>;
85
+ /**
86
+ * Get not-yet-mined transactions with pagination. Same shape as
87
+ * getAllTransactions, filtered to pending entries. Pending transactions sort
88
+ * behind all confirmed ones in getAllTransactions, so a cursor-based scan of
89
+ * confirmed history never reaches them; use this to read the pending set
90
+ * directly. The set can include entries the backend reports as permanently
91
+ * failed (isFailed: true); callers decide how to label those.
92
+ * @param walletId - Unique identifier for the wallet
93
+ * @param page - Page number (0-indexed)
94
+ * @param pageSize - Number of transactions per page
95
+ * @returns Paginated pending transactions with metadata
96
+ */
97
+ getPendingTransactions(walletId: string, page: number, pageSize: number): Promise<TransactionsPage>;
85
98
  /**
86
99
  * Create a transaction (supports multiple recipients).
87
- * The transaction is created and signed but not broadcast yet.
100
+ * The transaction is created and signed but not broadcast yet: it is retained
101
+ * natively for a later broadcastTransaction call. At most 50 transactions are
102
+ * retained per wallet (oldest disposed first; broadcasting an evicted one
103
+ * reports that it must be recreated), and all are released when the wallet
104
+ * closes. Payments the wallet would split into multiple on-chain
105
+ * transactions are rejected, so a later broadcast is atomic.
88
106
  * @param walletId - Unique identifier for the wallet
89
107
  * @param recipients - Array of recipients with addresses and amounts (atomic units)
90
108
  * @param priority - Transaction priority (0=Default, 1=Low, 2=Medium, 3=High)
@@ -92,11 +110,13 @@ export declare class CppBridge {
92
110
  */
93
111
  createTransaction(walletId: string, recipients: Recipient[], priority: TransactionPriority): Promise<SignedTransaction>;
94
112
  /**
95
- * Broadcast a previously created transaction.
113
+ * Broadcast a previously created transaction. `signedTx` identifies the
114
+ * natively retained transaction to broadcast.
96
115
  * @param walletId - Unique identifier for the wallet
97
- * @param signedTx - The signed transaction string from createTransaction
98
- * @returns The transaction hash
99
- * @throws Error if broadcast fails
116
+ * @param signedTx - The signedTxHex returned by createTransaction
117
+ * @returns "success"
118
+ * @throws Error if the transaction is no longer retained (evicted, or the
119
+ * wallet was closed since creation) or the broadcast fails
100
120
  */
101
121
  broadcastTransaction(walletId: string, signedTx: string): Promise<string>;
102
122
  /**
@@ -129,9 +129,34 @@ class CppBridge {
129
129
  ]);
130
130
  return JSON.parse(response);
131
131
  }
132
+ /**
133
+ * Get not-yet-mined transactions with pagination. Same shape as
134
+ * getAllTransactions, filtered to pending entries. Pending transactions sort
135
+ * behind all confirmed ones in getAllTransactions, so a cursor-based scan of
136
+ * confirmed history never reaches them; use this to read the pending set
137
+ * directly. The set can include entries the backend reports as permanently
138
+ * failed (isFailed: true); callers decide how to label those.
139
+ * @param walletId - Unique identifier for the wallet
140
+ * @param page - Page number (0-indexed)
141
+ * @param pageSize - Number of transactions per page
142
+ * @returns Paginated pending transactions with metadata
143
+ */
144
+ async getPendingTransactions(walletId, page, pageSize) {
145
+ const response = await this.module.callMonero('getPendingTransactions', [
146
+ walletId,
147
+ page.toString(),
148
+ pageSize.toString()
149
+ ]);
150
+ return JSON.parse(response);
151
+ }
132
152
  /**
133
153
  * Create a transaction (supports multiple recipients).
134
- * The transaction is created and signed but not broadcast yet.
154
+ * The transaction is created and signed but not broadcast yet: it is retained
155
+ * natively for a later broadcastTransaction call. At most 50 transactions are
156
+ * retained per wallet (oldest disposed first; broadcasting an evicted one
157
+ * reports that it must be recreated), and all are released when the wallet
158
+ * closes. Payments the wallet would split into multiple on-chain
159
+ * transactions are rejected, so a later broadcast is atomic.
135
160
  * @param walletId - Unique identifier for the wallet
136
161
  * @param recipients - Array of recipients with addresses and amounts (atomic units)
137
162
  * @param priority - Transaction priority (0=Default, 1=Low, 2=Medium, 3=High)
@@ -150,11 +175,13 @@ class CppBridge {
150
175
  return JSON.parse(response);
151
176
  }
152
177
  /**
153
- * Broadcast a previously created transaction.
178
+ * Broadcast a previously created transaction. `signedTx` identifies the
179
+ * natively retained transaction to broadcast.
154
180
  * @param walletId - Unique identifier for the wallet
155
- * @param signedTx - The signed transaction string from createTransaction
156
- * @returns The transaction hash
157
- * @throws Error if broadcast fails
181
+ * @param signedTx - The signedTxHex returned by createTransaction
182
+ * @returns "success"
183
+ * @throws Error if the transaction is no longer retained (evicted, or the
184
+ * wallet was closed since creation) or the broadcast fails
158
185
  */
159
186
  async broadcastTransaction(walletId, signedTx) {
160
187
  const response = await this.module.callMonero('broadcastTransaction', [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-monero",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "React Native bindings for the monero-lwsf library",
5
5
  "homepage": "https://github.com/EdgeApp/react-native-monero",
6
6
  "repository": {