Skip to content

Commit e51131e

Browse files
docs(kotlin-sdk): correct the drain-scope note on buildSignedPayment
Two errors in the paragraph added by the previous commit, both caught in review. It linked to `CoreTransactionBuilder.AccountType` and offered a CoinJoin sweep as the single-family example. But `buildSignedPayment` takes `ManagedPlatformWallet.AccountType`, whose only variants are BIP44, BIP32 and ALL_SPENDABLE -- there is no CoinJoin variant, so the advice named a scope the method cannot express. It now references the method's own enum and offers BIP44 / BIP32, noting that a CoinJoin sweep goes through the dedicated send-all path. It also said change returns to BIP44. That is true of pooled funding in general and false of a drain, which is the one case the paragraph is about: `SelectionStrategy.ALL` leaves no change at all. Saying otherwise contradicts the reason a drain needs documenting -- no change means no wallet-owned output. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 5148368 commit e51131e

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/wallet/ManagedPlatformWallet.kt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,18 @@ class ManagedPlatformWallet internal constructor(
386386
* what a swap quote must be taken from.
387387
*
388388
* **A drain's scope is [accountType], which defaults to
389-
* [CoreTransactionBuilder.AccountType.ALL_SPENDABLE].** Combined with
390-
* `ALL`, a call that does not name an account type sweeps BIP44, BIP32
391-
* AND every DashPay contact-receiving account into one transaction,
392-
* change returning to BIP44. That is the intended shape: "send
393-
* everything" means everything the wallet can sign for, which before
394-
* the pooled selector required sweeping accounts together on-chain
395-
* first. Name a single [CoreTransactionBuilder.AccountType] only for a
396-
* drain genuinely scoped to one family, such as a CoinJoin sweep that
397-
* must not leave its privacy domain.
389+
* [AccountType.ALL_SPENDABLE].** Combined with `ALL`, a call that does
390+
* not name an account type sweeps BIP44, BIP32 AND every DashPay
391+
* contact-receiving account into one transaction — and, being a drain,
392+
* leaves no change: every selected input becomes the destination output
393+
* plus fee. That is the intended shape: "send everything" means
394+
* everything the wallet can sign for, which before the pooled selector
395+
* required sweeping accounts together on-chain first.
396+
*
397+
* Name [AccountType.BIP44] or [AccountType.BIP32] to confine the drain
398+
* to one family. Those are the only single-family scopes this method
399+
* can express — its [AccountType] has no CoinJoin variant, and a
400+
* CoinJoin sweep goes through the dedicated send-all path instead.
398401
*/
399402
suspend fun buildSignedPayment(
400403
recipients: List<Pair<String, Long>>,

0 commit comments

Comments
 (0)