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
46 changes: 23 additions & 23 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 = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "090faea22494b2b9d6d3995e78f87b8e2a3bd5be" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "a5d7ea0b84694a3d097209a2c1647b86eee0fec0" }

tokio-metrics = "0.5"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,61 @@ internal object WalletManagerNative {
/** Balance as `long[4]` = {confirmed, unconfirmed, immature, locked}. */
external fun walletGetBalance(walletHandle: Long): LongArray

/**
* One bounded page of the engine's UTXO inventory for one wallet,
* across every account, as JSON
* `{"utxos":[...],"errors":[...],"cursor":<string|null>,"hasMore":<bool>}`
* — the source of truth the TXO-store reconciler
* ([PlatformWalletManager.reconcileTxoStore]) diffs against the Room
* `txos` mirror.
*
* 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. [limit] caps the rows in
* one page; non-positive means the native default, and oversized
* values are clamped natively.
*
* Each `utxos` row carries the owning account tags, the txid hex in
* the same byte order the changeset path hands
* [PlatformWalletPersistenceHandler] (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.
* Per-account read failures land in `errors` instead of failing the
* page. `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