Skip to content
Draft
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
53 changes: 28 additions & 25 deletions Cargo.lock

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

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ members = [
]

[workspace.dependencies]
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" }
dashcore = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
dash-network-seeds = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
dash-spv = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
key-wallet = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
key-wallet-ffi = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
key-wallet-manager = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
dash-network = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
dashcore-rpc = { git = "https://github.com/HashEngineering/rust-dashcore", rev = "e5cbb13bea811a65f3a3193defc7168a9054c951" }
tokio-metrics = "0.5"

# Size-tuned profile for the iOS `rs-unified-sdk-ffi` staticlib, which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,63 @@ internal object WalletManagerNative {
gapLimit: Int,
)

/**
* One bounded page of the engine's UTXO inventory for one wallet,
* across every account, as JSON
* `{"utxos":[...],"cursor":<string|null>,"hasMore":<bool>}` — the
* source of truth the TXO-store reconciler
* ([PlatformWalletManager.reconcileTxoStore]) diffs against the Room
* `txos` mirror. A thin shim over one Rust call
* (`platform_wallet_wallet_utxos_page`): account ordering, cursor
* semantics and the page bound live in `platform-wallet`.
*
* Paged, not swept whole: a wallet's UTXO count is chain-controlled
* (anyone who knows a watched address can keep sending dust to it), so
* a full-inventory read would let a remote party decide how much this
* process allocates on every SYNCED transition and every 30-minute
* pass. Pass [cursor] `null` to start, then hand back the returned
* `cursor` verbatim while `hasMore` is true — a cursor this export did
* not produce throws. [limit] caps the rows in one page; non-positive
* means the native default, and oversized values are clamped natively.
*
* Each `utxos` row is a
* [org.dashfoundation.dashsdk.persistence.PlatformWalletPersistenceHandler.EngineUtxoRow]:
* the owning account tuple, the txid hex in the same byte order the
* changeset path hands the handler (so hex→bytes reproduces the
* `txos.txid` blob), vout, amount (duffs), derived address (empty when
* the script has no address form), scriptHex, height and isLocked.
* `network` is [org.dashfoundation.dashsdk.Network.ffiValue].
*/
external fun walletManagerUtxosPageJson(
managerHandle: Long,
walletId: ByteArray,
network: Int,
cursor: String?,
limit: Int,
): String?

/**
* Classify a batch of outpoints against the engine's live state: the
* reverse half of the reconcile transport, and the reason the paged
* inventory above carries no spent-outpoint list. The caller pages its
* OWN mirror rows and asks about them a batch at a time, so neither
* side ever builds a set over the whole engine inventory.
*
* [outpoints] is a flat `n * 36` byte blob in the store's own encoding
* — 32-byte txid in wire order then vout as little-endian `Int`, which
* is exactly the `txos.outpoint` primary key, so callers concatenate
* the column and read the answers back positionally. Returns `n`
* bytes: 0 unknown, 1 unspent, 2 spent.
*
* A 2 means SOME recorded transaction spends the outpoint — possibly
* one still in the mempool. It is not proof of a settled spend.
*/
external fun walletManagerClassifyOutpoints(
managerHandle: Long,
walletId: ByteArray,
outpoints: ByteArray,
): ByteArray?

// ── Core transaction builder (1:1 over `core_wallet_tx_builder_*`) ─
//
// Each step is a thin extern (one export = one FFI call, per
Expand Down
Loading
Loading