Commit 5148368
docs(kotlin-sdk): a drain's scope is the account type, which defaults to pooled
`SelectionStrategy.ALL` was documented as "drains the account" -- written
when a drain could only mean one account. Since #4329 the send APIs default
`accountType` to `ALL_SPENDABLE`, so `ALL` on a call that does not name an
account type drains BIP44 AND BIP32 AND every DashPay contact-receiving
account in one transaction, change returning to BIP44.
That is the intended shape rather than a hazard: "send everything" means
everything the wallet can sign for, and achieving it before the pooled
selector meant sweeping accounts together on-chain first. Document it on
the strategy enum and again on `buildSignedPayment`, where the two
parameters meet and where the scope is inherited rather than typed, so a
reader can see what a defaulted drain reaches. Naming a single account type
is for drains genuinely scoped to one family -- a CoinJoin sweep that must
not leave its privacy domain.
A test pins the sweep scope per selector, so anything later added to
SEND_FUNDING_SOURCES -- which would enlarge every defaulted drain -- fails
there first.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent d571d3e commit 5148368
3 files changed
Lines changed: 71 additions & 2 deletions
File tree
- packages
- kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/wallet
- rs-platform-wallet-ffi/src/core_wallet
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
| |||
packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/wallet/ManagedPlatformWallet.kt
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
387 | 398 | | |
388 | 399 | | |
389 | 400 | | |
| |||
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
926 | | - | |
| 926 | + | |
927 | 927 | | |
928 | 928 | | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
929 | 963 | | |
930 | 964 | | |
931 | 965 | | |
| |||
0 commit comments