Feature request: let mini-apps stake NIM that's in transit through HTLC contracts
Summary
@nimiq/mini-app-sdk exposes staking methods (sendNewStakerTransaction, sendStakeTransaction, ...) that are forwarded to the Nimiq Pay wallet, which decides how to fund them. We discovered (and verified on-chain, 2026-09-10) that Pay's wallet CAN fund a stake from an HTLC swap contract — but only if the mini-app asks it to. The SDK gives no way to express "stake from my in-transit funds", and the app-side balance APIs give no way to know it's possible.
What we verified
- Nimiq Pay routes transfers through HTLC contracts (sender = the app-facing relay address, recipient = Pay's swap service,
hashRoot all-zeros = timelock-only custody, no preimage).
- The relay's basic balance is effectively always 0 — every settlement is re-locked into a fresh contract within seconds.
- Calling
sendStakeTransaction anyway (with the app's stake ceiling set to basic + in-transit) worked: the wallet redeemed 100 NIM directly from the HTLC contract to fund the stake. Contract balance dropped exactly 100 NIM, staker record went active, basic balance stayed 0.
- This is the only way a mini-app can stake from inside Pay — and it's currently undocumented and undiscoverable.
What would help
- Document the behavior: "staking requests may be funded from HTLC in-transit funds at the wallet's discretion" — so mini-apps can set their stake ceilings to basic + in-transit without guessing.
- A balance API that includes in-transit funds (e.g.
getBalances() returning { basic, htlcInTransit, staked, ... }) so apps don't have to crawl contracts themselves.
- An explicit funding hint on staking requests (e.g.
allowInTransitFunding: boolean) so the wallet can confirm with the user when it redeems a contract.
Context
- Competition entry: NimBooks (https://nimbooks.subimpact.net) — shipped the workaround (stake ceiling = basic + in-transit) and verified it live.
- Related: #293 (nimiq/wallet) — HTLC transaction methods timeline; "NIM core parity (send/receive/stake/HTLC in Pay)" per the Nov 2025 roadmap reply.
Happy to provide the on-chain tx evidence or test a proposed API on-device.
Feature request: let mini-apps stake NIM that's in transit through HTLC contracts
Summary
@nimiq/mini-app-sdkexposes staking methods (sendNewStakerTransaction,sendStakeTransaction, ...) that are forwarded to the Nimiq Pay wallet, which decides how to fund them. We discovered (and verified on-chain, 2026-09-10) that Pay's wallet CAN fund a stake from an HTLC swap contract — but only if the mini-app asks it to. The SDK gives no way to express "stake from my in-transit funds", and the app-side balance APIs give no way to know it's possible.What we verified
hashRootall-zeros = timelock-only custody, no preimage).sendStakeTransactionanyway (with the app's stake ceiling set to basic + in-transit) worked: the wallet redeemed 100 NIM directly from the HTLC contract to fund the stake. Contract balance dropped exactly 100 NIM, staker record went active, basic balance stayed 0.What would help
getBalances()returning{ basic, htlcInTransit, staked, ... }) so apps don't have to crawl contracts themselves.allowInTransitFunding: boolean) so the wallet can confirm with the user when it redeems a contract.Context
Happy to provide the on-chain tx evidence or test a proposed API on-device.