@bsv/wallet-toolbox 2.3.3 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +4 -0
  3. package/docs/client.md +232 -74
  4. package/docs/managed-change-policy.md +79 -0
  5. package/docs/services.md +11 -0
  6. package/docs/storage.md +86 -29
  7. package/docs/wallet.md +207 -62
  8. package/out/src/Wallet.d.ts +4 -0
  9. package/out/src/Wallet.d.ts.map +1 -1
  10. package/out/src/Wallet.js +6 -1
  11. package/out/src/Wallet.js.map +1 -1
  12. package/out/src/WalletPermissionsManager.d.ts +19 -0
  13. package/out/src/WalletPermissionsManager.d.ts.map +1 -1
  14. package/out/src/WalletPermissionsManager.js +55 -0
  15. package/out/src/WalletPermissionsManager.js.map +1 -1
  16. package/out/src/monitor/tasks/TaskArcSSE.d.ts.map +1 -1
  17. package/out/src/monitor/tasks/TaskArcSSE.js +39 -15
  18. package/out/src/monitor/tasks/TaskArcSSE.js.map +1 -1
  19. package/out/src/sdk/types.d.ts +9 -0
  20. package/out/src/sdk/types.d.ts.map +1 -1
  21. package/out/src/sdk/types.js +16 -2
  22. package/out/src/sdk/types.js.map +1 -1
  23. package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +1 -0
  24. package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -1
  25. package/out/src/services/chaintracker/ChaintracksChainTracker.js +9 -6
  26. package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -1
  27. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
  28. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +8 -0
  29. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
  30. package/out/src/services/providers/Arcade.d.ts +1 -0
  31. package/out/src/services/providers/Arcade.d.ts.map +1 -1
  32. package/out/src/services/providers/Arcade.js +40 -13
  33. package/out/src/services/providers/Arcade.js.map +1 -1
  34. package/out/src/signer/methods/buildSignableTransaction.d.ts +54 -0
  35. package/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -1
  36. package/out/src/signer/methods/buildSignableTransaction.js +118 -2
  37. package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
  38. package/out/src/signer/methods/internalizeAction.d.ts +6 -4
  39. package/out/src/signer/methods/internalizeAction.d.ts.map +1 -1
  40. package/out/src/signer/methods/internalizeAction.js +12 -7
  41. package/out/src/signer/methods/internalizeAction.js.map +1 -1
  42. package/out/src/storage/StorageIdb.d.ts +2 -1
  43. package/out/src/storage/StorageIdb.d.ts.map +1 -1
  44. package/out/src/storage/StorageIdb.js +12 -5
  45. package/out/src/storage/StorageIdb.js.map +1 -1
  46. package/out/src/storage/StorageKnex.d.ts +2 -1
  47. package/out/src/storage/StorageKnex.d.ts.map +1 -1
  48. package/out/src/storage/StorageKnex.js +27 -2
  49. package/out/src/storage/StorageKnex.js.map +1 -1
  50. package/out/src/storage/index.all.d.ts +1 -0
  51. package/out/src/storage/index.all.d.ts.map +1 -1
  52. package/out/src/storage/index.all.js +1 -0
  53. package/out/src/storage/index.all.js.map +1 -1
  54. package/out/src/storage/index.client.d.ts +1 -0
  55. package/out/src/storage/index.client.d.ts.map +1 -1
  56. package/out/src/storage/index.client.js +1 -0
  57. package/out/src/storage/index.client.js.map +1 -1
  58. package/out/src/storage/methods/ListOutputsSpecOp.d.ts +2 -0
  59. package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
  60. package/out/src/storage/methods/ListOutputsSpecOp.js +13 -1
  61. package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
  62. package/out/src/storage/methods/createAction.d.ts.map +1 -1
  63. package/out/src/storage/methods/createAction.js +6 -6
  64. package/out/src/storage/methods/createAction.js.map +1 -1
  65. package/out/src/storage/methods/internalizeAction.d.ts +6 -4
  66. package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
  67. package/out/src/storage/methods/internalizeAction.js +23 -12
  68. package/out/src/storage/methods/internalizeAction.js.map +1 -1
  69. package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -1
  70. package/out/src/storage/methods/listOutputsIdb.js +21 -3
  71. package/out/src/storage/methods/listOutputsIdb.js.map +1 -1
  72. package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -1
  73. package/out/src/storage/methods/listOutputsKnex.js +14 -0
  74. package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
  75. package/out/src/storage/methods/managedChange.d.ts +26 -0
  76. package/out/src/storage/methods/managedChange.d.ts.map +1 -0
  77. package/out/src/storage/methods/managedChange.js +43 -0
  78. package/out/src/storage/methods/managedChange.js.map +1 -0
  79. package/out/src/storage/methods/processAction.d.ts.map +1 -1
  80. package/out/src/storage/methods/processAction.js +38 -1
  81. package/out/src/storage/methods/processAction.js.map +1 -1
  82. package/package.json +1 -1
package/docs/storage.md CHANGED
@@ -462,6 +462,7 @@ export interface ListOutputsSpecOp {
462
462
  includeOutputScripts?: boolean;
463
463
  includeSpent?: boolean;
464
464
  totalOutputsIsSumOfSatoshis?: boolean;
465
+ managedChangeOnly?: boolean;
465
466
  resultFromTags?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListOutputsArgs, specOpTags: string[]) => Promise<ListOutputsResult>;
466
467
  resultFromOutputs?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]) => Promise<ListOutputsResult>;
467
468
  filterOutputs?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]) => Promise<TableOutput[]>;
@@ -472,6 +473,14 @@ export interface ListOutputsSpecOp {
472
473
 
473
474
  See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md#class-storageprovider), [TableOutput](./storage.md#interface-tableoutput)
474
475
 
476
+ ###### Property managedChangeOnly
477
+
478
+ Restrict the operation to wallet-managed, BRC-29-signable change.
479
+
480
+ ```ts
481
+ managedChangeOnly?: boolean
482
+ ```
483
+
475
484
  ###### Property tagsParamsCount
476
485
 
477
486
  How many positional tags to intercept.
@@ -3669,7 +3678,8 @@ Proceeds in three stages:
3669
3678
  3. Find an output that comes as close to funding as possible (targetSatoshis).
3670
3679
  4. Return undefined if no output is found.
3671
3680
 
3672
- Outputs must belong to userId and basketId and have spendable true.
3681
+ Outputs must belong to userId and basketId and satisfy the wallet-managed
3682
+ BRC-29 change policy.
3673
3683
  Their corresponding transaction must have status of 'completed', 'unproven', or 'sending' (if excludeSending is false).
3674
3684
 
3675
3685
  ```ts
@@ -4089,7 +4099,8 @@ See also: [TableOutput](./storage.md#interface-tableoutput)
4089
4099
 
4090
4100
  ###### Method countChangeInputs
4091
4101
 
4092
- Counts the outputs for userId in basketId that are spendable: true
4102
+ Counts wallet-managed BRC-29 change outputs for userId in basketId that
4103
+ are currently eligible for automatic allocation
4093
4104
  AND whose transaction status is one of:
4094
4105
  - completed
4095
4106
  - unproven
@@ -4902,26 +4913,28 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
4902
4913
 
4903
4914
  | | | |
4904
4915
  | --- | --- | --- |
4905
- | [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [matchesCertificatePartial](#function-matchescertificatepartial) | [transactionInputSize](#function-transactioninputsize) |
4906
- | [classifyReqStatus](#function-classifyreqstatus) | [matchesCommissionPartial](#function-matchescommissionpartial) | [transactionOutputSize](#function-transactionoutputsize) |
4907
- | [createAction](#function-createaction) | [matchesMonitorEventPartial](#function-matchesmonitoreventpartial) | [transactionSize](#function-transactionsize) |
4908
- | [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [matchesOutputBasketPartial](#function-matchesoutputbasketpartial) | [updateReqsFromAggregateResults](#function-updatereqsfromaggregateresults) |
4909
- | [createSyncMap](#function-createsyncmap) | [matchesOutputPartial](#function-matchesoutputpartial) | [upgradeAllStoresV1](#function-upgradeallstoresv1) |
4910
- | [dateMatches](#function-datematches) | [matchesOutputTagMapPartial](#function-matchesoutputtagmappartial) | [upgradeCertificateFields](#function-upgradecertificatefields) |
4911
- | [decryptBRC39](#function-decryptbrc39) | [matchesOutputTagPartial](#function-matchesoutputtagpartial) | [upgradeCertificates](#function-upgradecertificates) |
4912
- | [determineDBType](#function-determinedbtype) | [matchesProvenTxPartial](#function-matchesproventxpartial) | [upgradeCommissions](#function-upgradecommissions) |
4913
- | [encryptBRC39](#function-encryptbrc39) | [matchesProvenTxReqPartial](#function-matchesproventxreqpartial) | [upgradeMonitorEvents](#function-upgrademonitorevents) |
4914
- | [exportBRC38](#function-exportbrc38) | [matchesSyncStatePartial](#function-matchessyncstatepartial) | [upgradeOutputBaskets](#function-upgradeoutputbaskets) |
4915
- | [exportBRC38Json](#function-exportbrc38json) | [matchesTransactionPartial](#function-matchestransactionpartial) | [upgradeOutputTags](#function-upgradeoutputtags) |
4916
- | [exportBRC39](#function-exportbrc39) | [matchesTxLabelMapPartial](#function-matchestxlabelmappartial) | [upgradeOutputTagsMap](#function-upgradeoutputtagsmap) |
4917
- | [generateChangeSdk](#function-generatechangesdk) | [matchesTxLabelPartial](#function-matchestxlabelpartial) | [upgradeOutputs](#function-upgradeoutputs) |
4918
- | [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [mergeInputBeefs](#function-mergeinputbeefs) | [upgradeProvenTxReqs](#function-upgradeproventxreqs) |
4919
- | [getBeefForTransaction](#function-getbeeffortransaction) | [mergeInputsIntoBeef](#function-mergeinputsintobeef) | [upgradeProvenTxs](#function-upgradeproventxs) |
4920
- | [getListOutputsSpecOp](#function-getlistoutputsspecop) | [notifyTransactionsOfProof](#function-notifytransactionsofproof) | [upgradeSyncStates](#function-upgradesyncstates) |
4921
- | [getSyncChunk](#function-getsyncchunk) | [offsetPrivKey](#function-offsetprivkey) | [upgradeTransactions](#function-upgradetransactions) |
4922
- | [importBRC38](#function-importbrc38) | [offsetPubKey](#function-offsetpubkey) | [upgradeTxLabels](#function-upgradetxlabels) |
4923
- | [importBRC39](#function-importbrc39) | [parseBRC38Json](#function-parsebrc38json) | [upgradeTxLabelsMap](#function-upgradetxlabelsmap) |
4924
- | [internalizeAction](#function-internalizeaction) | [partitionActionLabels](#function-partitionactionlabels) | [upgradeUsers](#function-upgradeusers) |
4916
+ | [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [markUserInputsSpent](#function-markuserinputsspent) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) |
4917
+ | [classifyReqStatus](#function-classifyreqstatus) | [matchesCertificateFieldPartial](#function-matchescertificatefieldpartial) | [shareReqsWithWorld](#function-sharereqswithworld) |
4918
+ | [createAction](#function-createaction) | [matchesCertificatePartial](#function-matchescertificatepartial) | [transactionInputSize](#function-transactioninputsize) |
4919
+ | [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [matchesCommissionPartial](#function-matchescommissionpartial) | [transactionOutputSize](#function-transactionoutputsize) |
4920
+ | [createSyncMap](#function-createsyncmap) | [matchesMonitorEventPartial](#function-matchesmonitoreventpartial) | [transactionSize](#function-transactionsize) |
4921
+ | [dateMatches](#function-datematches) | [matchesOutputBasketPartial](#function-matchesoutputbasketpartial) | [updateReqsFromAggregateResults](#function-updatereqsfromaggregateresults) |
4922
+ | [decryptBRC39](#function-decryptbrc39) | [matchesOutputPartial](#function-matchesoutputpartial) | [upgradeAllStoresV1](#function-upgradeallstoresv1) |
4923
+ | [determineDBType](#function-determinedbtype) | [matchesOutputTagMapPartial](#function-matchesoutputtagmappartial) | [upgradeCertificateFields](#function-upgradecertificatefields) |
4924
+ | [encryptBRC39](#function-encryptbrc39) | [matchesOutputTagPartial](#function-matchesoutputtagpartial) | [upgradeCertificates](#function-upgradecertificates) |
4925
+ | [exportBRC38](#function-exportbrc38) | [matchesProvenTxPartial](#function-matchesproventxpartial) | [upgradeCommissions](#function-upgradecommissions) |
4926
+ | [exportBRC38Json](#function-exportbrc38json) | [matchesProvenTxReqPartial](#function-matchesproventxreqpartial) | [upgradeMonitorEvents](#function-upgrademonitorevents) |
4927
+ | [exportBRC39](#function-exportbrc39) | [matchesSyncStatePartial](#function-matchessyncstatepartial) | [upgradeOutputBaskets](#function-upgradeoutputbaskets) |
4928
+ | [generateChangeSdk](#function-generatechangesdk) | [matchesTransactionPartial](#function-matchestransactionpartial) | [upgradeOutputTags](#function-upgradeoutputtags) |
4929
+ | [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [matchesTxLabelMapPartial](#function-matchestxlabelmappartial) | [upgradeOutputTagsMap](#function-upgradeoutputtagsmap) |
4930
+ | [getBeefForTransaction](#function-getbeeffortransaction) | [matchesTxLabelPartial](#function-matchestxlabelpartial) | [upgradeOutputs](#function-upgradeoutputs) |
4931
+ | [getListOutputsSpecOp](#function-getlistoutputsspecop) | [mergeInputBeefs](#function-mergeinputbeefs) | [upgradeProvenTxReqs](#function-upgradeproventxreqs) |
4932
+ | [getSyncChunk](#function-getsyncchunk) | [mergeInputsIntoBeef](#function-mergeinputsintobeef) | [upgradeProvenTxs](#function-upgradeproventxs) |
4933
+ | [importBRC38](#function-importbrc38) | [notifyTransactionsOfProof](#function-notifytransactionsofproof) | [upgradeSyncStates](#function-upgradesyncstates) |
4934
+ | [importBRC39](#function-importbrc39) | [offsetPrivKey](#function-offsetprivkey) | [upgradeTransactions](#function-upgradetransactions) |
4935
+ | [internalizeAction](#function-internalizeaction) | [offsetPubKey](#function-offsetpubkey) | [upgradeTxLabels](#function-upgradetxlabels) |
4936
+ | [isAutoSpendableChangeOutput](#function-isautospendablechangeoutput) | [parseBRC38Json](#function-parsebrc38json) | [upgradeTxLabelsMap](#function-upgradetxlabelsmap) |
4937
+ | [isManagedChangeOutput](#function-ismanagedchangeoutput) | [partitionActionLabels](#function-partitionactionlabels) | [upgradeUsers](#function-upgradeusers) |
4925
4938
  | [keyOffsetToHashedSecret](#function-keyoffsettohashedsecret) | [processAction](#function-processaction) | [validateDate](#function-validatedate) |
4926
4939
  | [listActions](#function-listactions) | [purgeData](#function-purgedata) | [validateEntities](#function-validateentities) |
4927
4940
  | [listActionsIdb](#function-listactionsidb) | [purgeDataIdb](#function-purgedataidb) | [validateEntity](#function-validateentity) |
@@ -4930,8 +4943,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
4930
4943
  | [listOutputsIdb](#function-listoutputsidb) | [restoreInputsToSpendable](#function-restoreinputstospendable) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
4931
4944
  | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [reviewStatus](#function-reviewstatus) | [validateSyncChunkEntities](#function-validatesyncchunkentities) |
4932
4945
  | [markStaleInputsAsSpent](#function-markstaleinputsasspent) | [reviewStatusIdb](#function-reviewstatusidb) | [varUintSize](#function-varuintsize) |
4933
- | [markUserInputsSpent](#function-markuserinputsspent) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | |
4934
- | [matchesCertificateFieldPartial](#function-matchescertificatefieldpartial) | [shareReqsWithWorld](#function-sharereqswithworld) | |
4935
4946
 
4936
4947
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4937
4948
 
@@ -5225,12 +5236,14 @@ When the transaction already exists, the description is updated. The isOutgoing
5225
5236
 
5226
5237
  "basket insertion" Merge Rules:
5227
5238
  1. The "default" basket may not be specified as the insertion basket.
5228
- 2. A change output in the "default" basket may not be target of an insertion into a different basket.
5229
- 3. These baskets do not affect the wallet's balance and are typed "custom".
5239
+ 2. Managed change may not be reclassified as a basket insertion.
5240
+ 3. Basket insertions do not affect wallet balance and are typed "custom".
5230
5241
 
5231
5242
  "wallet payment" Merge Rules:
5232
- 1. Targetting an existing change "default" basket output results in a no-op. No error. No alterations made.
5233
- 2. Targetting a previously "custom" non-change output converts it into a change output. This alters the transaction's `satoshis`, and the wallet balance.
5243
+ 1. Targeting an existing managed output is idempotent.
5244
+ 2. Targeting an existing custom output converts it to managed BRC-29
5245
+ change and increases wallet balance. This includes verified recovery of
5246
+ a legacy custom row that was incorrectly placed in the default basket.
5234
5247
 
5235
5248
  ```ts
5236
5249
  export async function internalizeAction(storage: StorageProvider, auth: AuthId, args: InternalizeActionArgs): Promise<StorageInternalizeActionResult>
@@ -5240,6 +5253,35 @@ See also: [AuthId](./client.md#interface-authid), [StorageInternalizeActionResul
5240
5253
 
5241
5254
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5242
5255
 
5256
+ ---
5257
+ ##### Function: isAutoSpendableChangeOutput
5258
+
5259
+ True when managed change is currently eligible for automatic allocation.
5260
+
5261
+ ```ts
5262
+ export function isAutoSpendableChangeOutput(output: TableOutput | undefined): output is TableOutput
5263
+ ```
5264
+
5265
+ See also: [TableOutput](./storage.md#interface-tableoutput)
5266
+
5267
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5268
+
5269
+ ---
5270
+ ##### Function: isManagedChangeOutput
5271
+
5272
+ True when an output has all metadata required to use the wallet-managed
5273
+ BRC-29 signing path. `senderIdentityKey` is optional: wallet-created change
5274
+ uses the client's change public key when it is absent, while received
5275
+ BRC-29 payments record the sender's identity key.
5276
+
5277
+ ```ts
5278
+ export function isManagedChangeOutput(output: TableOutput | undefined): output is TableOutput
5279
+ ```
5280
+
5281
+ See also: [TableOutput](./storage.md#interface-tableoutput)
5282
+
5283
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5284
+
5243
5285
  ---
5244
5286
  ##### Function: keyOffsetToHashedSecret
5245
5287
 
@@ -6218,6 +6260,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
6218
6260
  | |
6219
6261
  | --- |
6220
6262
  | [getLabelToSpecOp](#variable-getlabeltospecop) |
6263
+ | [managedChangeOutputFields](#variable-managedchangeoutputfields) |
6221
6264
  | [maxChangeOutputsPerTransaction](#variable-maxchangeoutputspertransaction) |
6222
6265
  | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) |
6223
6266
  | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) |
@@ -6292,6 +6335,20 @@ See also: [AuthId](./client.md#interface-authid), [ListActionsSpecOp](./storage.
6292
6335
 
6293
6336
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6294
6337
 
6338
+ ---
6339
+ ##### Variable: managedChangeOutputFields
6340
+
6341
+ ```ts
6342
+ managedChangeOutputFields = {
6343
+ type: "P2PKH",
6344
+ change: true,
6345
+ providedBy: "storage",
6346
+ purpose: "change"
6347
+ } as const
6348
+ ```
6349
+
6350
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6351
+
6295
6352
  ---
6296
6353
  ##### Variable: maxChangeOutputsPerTransaction
6297
6354
 
@@ -6369,4 +6426,4 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
6369
6426
 
6370
6427
  ---
6371
6428
 
6372
- <!--#endregion ts2md-api-merged-here-->
6429
+ <!--#endregion ts2md-api-merged-here-->
package/docs/wallet.md CHANGED
@@ -783,6 +783,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
783
783
  ```ts
784
784
  export interface ChaintracksChainTrackerOptions {
785
785
  maxRetries?: number;
786
+ retryDelayMs?: number;
786
787
  }
787
788
  ```
788
789
 
@@ -10988,6 +10989,10 @@ sum of output satoshis
10988
10989
  Uses `listOutputs` to iterate over chunks of up to 1000 outputs to
10989
10990
  compute the sum of output satoshis.
10990
10991
 
10992
+ For `default`, only wallet-managed BRC-29 change is included. Raw
10993
+ administrative `listOutputs({ basket: 'default' })` remains available to
10994
+ discover legacy incompatible rows for recovery.
10995
+
10991
10996
  ```ts
10992
10997
  async balanceAndUtxos(basket: string = "default"): Promise<WalletBalance>
10993
10998
  ```
@@ -11754,16 +11759,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
11754
11759
 
11755
11760
  | | | |
11756
11761
  | --- | --- | --- |
11757
- | [WalletErrorFromJson](#function-walleterrorfromjson) | [handlePostRawTxErrorResponse](#function-handlepostrawtxerrorresponse) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) |
11758
- | [acquireDirectCertificate](#function-acquiredirectcertificate) | [handleScriptHashHistoryCatch](#function-handlescripthashhistorycatch) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) |
11759
- | [addWork](#function-addwork) | [handleScriptHashHistoryResponse](#function-handlescripthashhistoryresponse) | [sha256Hash](#function-sha256hash) |
11760
- | [arcDefaultUrl](#function-arcdefaulturl) | [handleUtxoConnReset](#function-handleutxoconnreset) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) |
11762
+ | [WalletErrorFromJson](#function-walleterrorfromjson) | [handleScriptHashHistoryCatch](#function-handlescripthashhistorycatch) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) |
11763
+ | [acquireDirectCertificate](#function-acquiredirectcertificate) | [handleScriptHashHistoryResponse](#function-handlescripthashhistoryresponse) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) |
11764
+ | [addWork](#function-addwork) | [handleUtxoConnReset](#function-handleutxoconnreset) | [sha256Hash](#function-sha256hash) |
11765
+ | [arcDefaultUrl](#function-arcdefaulturl) | [internalizeAction](#function-internalizeaction) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) |
11761
11766
  | [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [internalizeAction](#function-internalizeaction) | [shareReqsWithWorld](#function-sharereqswithworld) |
11762
- | [arcadeDefaultUrl](#function-arcadedefaulturl) | [internalizeAction](#function-internalizeaction) | [signAction](#function-signaction) |
11763
- | [arraysEqual](#function-arraysequal) | [isArcAcceptedTxStatus](#function-isarcacceptedtxstatus) | [stampLog](#function-stamplog) |
11764
- | [asArray](#function-asarray) | [isArcDoubleSpendTxStatus](#function-isarcdoublespendtxstatus) | [stampLogFormat](#function-stamplogformat) |
11765
- | [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [isArcInvalidTxStatus](#function-isarcinvalidtxstatus) | [subWork](#function-subwork) |
11766
- | [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [isArcServiceErrorStatus](#function-isarcserviceerrorstatus) | [swapByteOrder](#function-swapbyteorder) |
11767
+ | [arcadeDefaultUrl](#function-arcadedefaulturl) | [isArcAcceptedTxStatus](#function-isarcacceptedtxstatus) | [signAction](#function-signaction) |
11768
+ | [arraysEqual](#function-arraysequal) | [isArcDoubleSpendTxStatus](#function-isarcdoublespendtxstatus) | [stampLog](#function-stamplog) |
11769
+ | [asArray](#function-asarray) | [isArcInvalidTxStatus](#function-isarcinvalidtxstatus) | [stampLogFormat](#function-stamplogformat) |
11770
+ | [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [isArcServiceErrorStatus](#function-isarcserviceerrorstatus) | [subWork](#function-subwork) |
11771
+ | [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [isAutoSpendableChangeOutput](#function-isautospendablechangeoutput) | [swapByteOrder](#function-swapbyteorder) |
11767
11772
  | [asBsvSdkScript](#function-asbsvsdkscript) | [isBaseBlockHeader](#function-isbaseblockheader) | [throwDummyReviewActions](#function-throwdummyreviewactions) |
11768
11773
  | [asBsvSdkTx](#function-asbsvsdktx) | [isBlockHeader](#function-isblockheader) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) |
11769
11774
  | [asString](#function-asstring) | [isCreateActionSpecOp](#function-iscreateactionspecop) | [toLookupNetworkPreset](#function-tolookupnetworkpreset) |
@@ -11772,39 +11777,40 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
11772
11777
  | [blockHash](#function-blockhash) | [isListOutputsSpecOp](#function-islistoutputsspecop) | [transactionOutputSize](#function-transactionoutputsize) |
11773
11778
  | [buildSignableTransaction](#function-buildsignabletransaction) | [isLive](#function-islive) | [transactionSize](#function-transactionsize) |
11774
11779
  | [classifyMerklePathResponse](#function-classifymerklepathresponse) | [isLiveBlockHeader](#function-isliveblockheader) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) |
11775
- | [classifyReqStatus](#function-classifyreqstatus) | [isMoreWork](#function-ismorework) | [updateExchangeratesapi](#function-updateexchangeratesapi) |
11776
- | [completeSignedTransaction](#function-completesignedtransaction) | [keyOffsetToHashedSecret](#function-keyoffsettohashedsecret) | [updateReqsFromAggregateResults](#function-updatereqsfromaggregateresults) |
11777
- | [computeMerklePath](#function-computemerklepath) | [listCertificates](#function-listcertificates) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) |
11778
- | [computeMerkleRoot](#function-computemerkleroot) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
11779
- | [convertBitsToTarget](#function-convertbitstotarget) | [logCreateActionArgs](#function-logcreateactionargs) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
11780
- | [convertBitsToWork](#function-convertbitstowork) | [logWalletError](#function-logwalleterror) | [validateBulkFileData](#function-validatebulkfiledata) |
11781
- | [convertBufferToUint32](#function-convertbuffertouint32) | [makeAtomicBeef](#function-makeatomicbeef) | [validateDate](#function-validatedate) |
11782
- | [convertProofToMerklePath](#function-convertprooftomerklepath) | [makeChangeLock](#function-makechangelock) | [validateEntities](#function-validateentities) |
11783
- | [convertUint32ToBuffer](#function-convertuint32tobuffer) | [makeMerklePathNote](#function-makemerklepathnote) | [validateEntity](#function-validateentity) |
11784
- | [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [markStaleInputsAsSpent](#function-markstaleinputsasspent) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
11785
- | [createAction](#function-createaction) | [markUserInputsSpent](#function-markuserinputsspent) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
11786
- | [createAction](#function-createaction) | [maxDate](#function-maxdate) | [validateGenesisHeader](#function-validategenesisheader) |
11787
- | [createCoinbaseTransaction](#function-createcoinbasetransaction) | [mergeInputBeefs](#function-mergeinputbeefs) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
11788
- | [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [mergeInputsIntoBeef](#function-mergeinputsintobeef) | [validateHeaderFormat](#function-validateheaderformat) |
11789
- | [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [notifyTransactionsOfProof](#function-notifytransactionsofproof) | [validateScriptHash](#function-validatescripthash) |
11790
- | [createSyncMap](#function-createsyncmap) | [offsetPrivKey](#function-offsetprivkey) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
11791
- | [deserializeBaseBlockHeader](#function-deserializebaseblockheader) | [offsetPubKey](#function-offsetpubkey) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
11792
- | [deserializeBaseBlockHeaders](#function-deserializebaseblockheaders) | [optionalArraysEqual](#function-optionalarraysequal) | [validateSyncChunkEntities](#function-validatesyncchunkentities) |
11793
- | [deserializeBlockHeader](#function-deserializeblockheader) | [parseResults$](#function-parseresults$) | [varUintSize](#function-varuintsize) |
11794
- | [deserializeBlockHeaders](#function-deserializeblockheaders) | [parseTxScriptOffsets](#function-parsetxscriptoffsets) | [verifyHexString](#function-verifyhexstring) |
11795
- | [doubleSha256BE](#function-doublesha256be) | [populateUtxoDetails](#function-populateutxodetails) | [verifyId](#function-verifyid) |
11796
- | [doubleSha256LE](#function-doublesha256le) | [processAction](#function-processaction) | [verifyInteger](#function-verifyinteger) |
11780
+ | [classifyReqStatus](#function-classifyreqstatus) | [isManagedChangeOutput](#function-ismanagedchangeoutput) | [updateExchangeratesapi](#function-updateexchangeratesapi) |
11781
+ | [completeSignedTransaction](#function-completesignedtransaction) | [isMoreWork](#function-ismorework) | [updateReqsFromAggregateResults](#function-updatereqsfromaggregateresults) |
11782
+ | [computeMerklePath](#function-computemerklepath) | [keyOffsetToHashedSecret](#function-keyoffsettohashedsecret) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) |
11783
+ | [computeMerkleRoot](#function-computemerkleroot) | [listCertificates](#function-listcertificates) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
11784
+ | [convertBitsToTarget](#function-convertbitstotarget) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
11785
+ | [convertBitsToWork](#function-convertbitstowork) | [logCreateActionArgs](#function-logcreateactionargs) | [validateBulkFileData](#function-validatebulkfiledata) |
11786
+ | [convertBufferToUint32](#function-convertbuffertouint32) | [logWalletError](#function-logwalleterror) | [validateDate](#function-validatedate) |
11787
+ | [convertProofToMerklePath](#function-convertprooftomerklepath) | [makeAtomicBeef](#function-makeatomicbeef) | [validateEntities](#function-validateentities) |
11788
+ | [convertUint32ToBuffer](#function-convertuint32tobuffer) | [makeChangeLock](#function-makechangelock) | [validateEntity](#function-validateentity) |
11789
+ | [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [makeMerklePathNote](#function-makemerklepathnote) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
11790
+ | [createAction](#function-createaction) | [markStaleInputsAsSpent](#function-markstaleinputsasspent) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
11791
+ | [createAction](#function-createaction) | [markUserInputsSpent](#function-markuserinputsspent) | [validateGenesisHeader](#function-validategenesisheader) |
11792
+ | [createCoinbaseTransaction](#function-createcoinbasetransaction) | [maxDate](#function-maxdate) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
11793
+ | [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [mergeInputBeefs](#function-mergeinputbeefs) | [validateHeaderFormat](#function-validateheaderformat) |
11794
+ | [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [mergeInputsIntoBeef](#function-mergeinputsintobeef) | [validateScriptHash](#function-validatescripthash) |
11795
+ | [createSyncMap](#function-createsyncmap) | [notifyTransactionsOfProof](#function-notifytransactionsofproof) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
11796
+ | [deserializeBaseBlockHeader](#function-deserializebaseblockheader) | [offsetPrivKey](#function-offsetprivkey) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
11797
+ | [deserializeBaseBlockHeaders](#function-deserializebaseblockheaders) | [offsetPubKey](#function-offsetpubkey) | [validateSyncChunkEntities](#function-validatesyncchunkentities) |
11798
+ | [deserializeBlockHeader](#function-deserializeblockheader) | [optionalArraysEqual](#function-optionalarraysequal) | [varUintSize](#function-varuintsize) |
11799
+ | [deserializeBlockHeaders](#function-deserializeblockheaders) | [parseResults$](#function-parseresults$) | [verifyHexString](#function-verifyhexstring) |
11800
+ | [doubleSha256BE](#function-doublesha256be) | [parseTxScriptOffsets](#function-parsetxscriptoffsets) | [verifyId](#function-verifyid) |
11801
+ | [doubleSha256LE](#function-doublesha256le) | [populateUtxoDetails](#function-populateutxodetails) | [verifyInteger](#function-verifyinteger) |
11797
11802
  | [generateChangeSdk](#function-generatechangesdk) | [processAction](#function-processaction) | [verifyNumber](#function-verifynumber) |
11798
- | [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [proveCertificate](#function-provecertificate) | [verifyOne](#function-verifyone) |
11799
- | [genesisBuffer](#function-genesisbuffer) | [randomBytes](#function-randombytes) | [verifyOneOrNone](#function-verifyoneornone) |
11800
- | [genesisHeader](#function-genesisheader) | [randomBytesBase64](#function-randombytesbase64) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
11801
- | [getBeefForTransaction](#function-getbeeffortransaction) | [randomBytesHex](#function-randombyteshex) | [verifyTruthy](#function-verifytruthy) |
11802
- | [getBeefForTxid](#function-getbeeffortxid) | [readUInt32BE](#function-readuint32be) | [verifyUnlockScripts](#function-verifyunlockscripts) |
11803
- | [getExchangeRatesIo](#function-getexchangeratesio) | [readUInt32LE](#function-readuint32le) | [wait](#function-wait) |
11804
- | [getIdentityKey](#function-getidentitykey) | [redeemServiceCharges](#function-redeemservicecharges) | [workBNtoBuffer](#function-workbntobuffer) |
11805
- | [getProofs](#function-getproofs) | [restoreInputsToSpendable](#function-restoreinputstospendable) | [writeUInt32BE](#function-writeuint32be) |
11806
- | [getSyncChunk](#function-getsyncchunk) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) | [writeUInt32LE](#function-writeuint32le) |
11807
- | [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [serializeBaseBlockHeader](#function-serializebaseblockheader) | |
11803
+ | [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [processAction](#function-processaction) | [verifyOne](#function-verifyone) |
11804
+ | [genesisBuffer](#function-genesisbuffer) | [proveCertificate](#function-provecertificate) | [verifyOneOrNone](#function-verifyoneornone) |
11805
+ | [genesisHeader](#function-genesisheader) | [randomBytes](#function-randombytes) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
11806
+ | [getBeefForTransaction](#function-getbeeffortransaction) | [randomBytesBase64](#function-randombytesbase64) | [verifyRequestedOutputsUnchanged](#function-verifyrequestedoutputsunchanged) |
11807
+ | [getBeefForTxid](#function-getbeeffortxid) | [randomBytesHex](#function-randombyteshex) | [verifyTruthy](#function-verifytruthy) |
11808
+ | [getExchangeRatesIo](#function-getexchangeratesio) | [readUInt32BE](#function-readuint32be) | [verifyUnlockScripts](#function-verifyunlockscripts) |
11809
+ | [getIdentityKey](#function-getidentitykey) | [readUInt32LE](#function-readuint32le) | [verifyUnrequestedOutputsAreChangeOrCommission](#function-verifyunrequestedoutputsarechangeorcommission) |
11810
+ | [getProofs](#function-getproofs) | [redeemServiceCharges](#function-redeemservicecharges) | [wait](#function-wait) |
11811
+ | [getSyncChunk](#function-getsyncchunk) | [restoreInputsToSpendable](#function-restoreinputstospendable) | [workBNtoBuffer](#function-workbntobuffer) |
11812
+ | [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) | [writeUInt32BE](#function-writeuint32be) |
11813
+ | [handlePostRawTxErrorResponse](#function-handlepostrawtxerrorresponse) | [serializeBaseBlockHeader](#function-serializebaseblockheader) | [writeUInt32LE](#function-writeuint32le) |
11808
11814
 
11809
11815
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11810
11816
 
@@ -12788,12 +12794,14 @@ When the transaction already exists, the description is updated. The isOutgoing
12788
12794
 
12789
12795
  "basket insertion" Merge Rules:
12790
12796
  1. The "default" basket may not be specified as the insertion basket.
12791
- 2. A change output in the "default" basket may not be target of an insertion into a different basket.
12792
- 3. These baskets do not affect the wallet's balance and are typed "custom".
12797
+ 2. Managed change may not be reclassified as a basket insertion.
12798
+ 3. Basket insertions do not affect wallet balance and are typed "custom".
12793
12799
 
12794
12800
  "wallet payment" Merge Rules:
12795
- 1. Targetting an existing change "default" basket output results in a no-op. No error. No alterations made.
12796
- 2. Targetting a previously "custom" non-change output converts it into a change output. This alters the transaction's `amount`, and the wallet balance.
12801
+ 1. Targeting an existing managed output is idempotent.
12802
+ 2. Targeting a custom output converts it to managed BRC-29 change after
12803
+ the locking script is verified. This is the only supported in-place
12804
+ recovery path for a misclassified BRC-29 payment.
12797
12805
 
12798
12806
  ```ts
12799
12807
  export async function internalizeAction(wallet: Wallet, auth: AuthId, args: InternalizeActionArgs): Promise<StorageInternalizeActionResult>
@@ -12836,12 +12844,14 @@ When the transaction already exists, the description is updated. The isOutgoing
12836
12844
 
12837
12845
  "basket insertion" Merge Rules:
12838
12846
  1. The "default" basket may not be specified as the insertion basket.
12839
- 2. A change output in the "default" basket may not be target of an insertion into a different basket.
12840
- 3. These baskets do not affect the wallet's balance and are typed "custom".
12847
+ 2. Managed change may not be reclassified as a basket insertion.
12848
+ 3. Basket insertions do not affect wallet balance and are typed "custom".
12841
12849
 
12842
12850
  "wallet payment" Merge Rules:
12843
- 1. Targetting an existing change "default" basket output results in a no-op. No error. No alterations made.
12844
- 2. Targetting a previously "custom" non-change output converts it into a change output. This alters the transaction's `satoshis`, and the wallet balance.
12851
+ 1. Targeting an existing managed output is idempotent.
12852
+ 2. Targeting an existing custom output converts it to managed BRC-29
12853
+ change and increases wallet balance. This includes verified recovery of
12854
+ a legacy custom row that was incorrectly placed in the default basket.
12845
12855
 
12846
12856
  ```ts
12847
12857
  export async function internalizeAction(storage: StorageProvider, auth: AuthId, args: InternalizeActionArgs): Promise<StorageInternalizeActionResult>
@@ -12887,6 +12897,19 @@ export function isArcServiceErrorStatus(status: number | undefined, detail?: str
12887
12897
 
12888
12898
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
12889
12899
 
12900
+ ---
12901
+ ##### Function: isAutoSpendableChangeOutput
12902
+
12903
+ True when managed change is currently eligible for automatic allocation.
12904
+
12905
+ ```ts
12906
+ export function isAutoSpendableChangeOutput(output: TableOutput | undefined): output is TableOutput
12907
+ ```
12908
+
12909
+ See also: [TableOutput](./storage.md#interface-tableoutput)
12910
+
12911
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
12912
+
12890
12913
  ---
12891
12914
  ##### Function: isBaseBlockHeader
12892
12915
 
@@ -13048,6 +13071,22 @@ See also: [AnyBlockHeader](./services.md#type-anyblockheader), [LiveBlockHeader]
13048
13071
 
13049
13072
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
13050
13073
 
13074
+ ---
13075
+ ##### Function: isManagedChangeOutput
13076
+
13077
+ True when an output has all metadata required to use the wallet-managed
13078
+ BRC-29 signing path. `senderIdentityKey` is optional: wallet-created change
13079
+ uses the client's change public key when it is absent, while received
13080
+ BRC-29 payments record the sender's identity key.
13081
+
13082
+ ```ts
13083
+ export function isManagedChangeOutput(output: TableOutput | undefined): output is TableOutput
13084
+ ```
13085
+
13086
+ See also: [TableOutput](./storage.md#interface-tableoutput)
13087
+
13088
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
13089
+
13051
13090
  ---
13052
13091
  ##### Function: isMoreWork
13053
13092
 
@@ -14249,6 +14288,37 @@ export function verifyOptionalHexString(v?: string | null): string | undefined
14249
14288
 
14250
14289
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14251
14290
 
14291
+ ---
14292
+ ##### Function: verifyRequestedOutputsUnchanged
14293
+
14294
+ Verify that the outputs returned by storage for caller-specified outputs match
14295
+ exactly what the caller requested in `args.outputs`.
14296
+
14297
+ The storage response (`StorageCreateActionResult.outputs`) is ordered, by
14298
+ contract, as: the caller's `args.outputs` in their original order, followed by
14299
+ the optional commission output, followed by storage-provided change outputs.
14300
+ Only the `vout` field is randomized when `randomizeOutputs` is set; the array
14301
+ order is stable. Therefore array index `i` (for `i < args.outputs.length`)
14302
+ corresponds to `args.outputs[i]`.
14303
+
14304
+ Because the locking script that is ultimately signed is taken from the storage
14305
+ response, an untrusted storage provider must not be allowed to alter the
14306
+ recipient script (or amount) of a caller-specified output. Any mismatch is a
14307
+ hard error. (GHSA-36f9-7rg5-cpf8)
14308
+
14309
+ ```ts
14310
+ export function verifyRequestedOutputsUnchanged(storageOutputs: StorageCreateTransactionSdkOutput[], args: Validation.ValidCreateActionArgs): void
14311
+ ```
14312
+
14313
+ See also: [StorageCreateTransactionSdkOutput](./client.md#interface-storagecreatetransactionsdkoutput)
14314
+
14315
+ Throws
14316
+
14317
+ WERR_INVALID_PARAMETER if storage omitted, reclassified, or modified
14318
+ any caller-specified output.
14319
+
14320
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14321
+
14252
14322
  ---
14253
14323
  ##### Function: verifyTruthy
14254
14324
 
@@ -14282,6 +14352,42 @@ WERR_INVALID_PARAMETER if any unlocking script is invalid, if sourceTXID is inva
14282
14352
 
14283
14353
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14284
14354
 
14355
+ ---
14356
+ ##### Function: verifyUnrequestedOutputsAreChangeOrCommission
14357
+
14358
+ Verify that every storage output beyond the caller's requested outputs is
14359
+ either a change output or the (single, bounded) commission output.
14360
+
14361
+ The storage response is ordered `[caller outputs][commission?][change...]`;
14362
+ `verifyRequestedOutputsUnchanged` already validates the caller region (indices
14363
+ `< args.outputs.length`). This checks the remainder.
14364
+
14365
+ Change outputs (`providedBy: 'storage', purpose: 'change'`) are safe at any
14366
+ amount: `buildSignableTransaction` ignores the storage-supplied script and
14367
+ re-derives it client-side (`makeChangeLock` / BRC-29 under the client's own
14368
+ change key), so a change output can only ever pay the client. A change output
14369
+ mislabeled by storage is therefore harmless.
14370
+
14371
+ The commission output's script, by contrast, is taken verbatim from storage
14372
+ and cannot be verified client-side. A malicious storage could inject an extra
14373
+ output — or relabel one as commission — to redirect funds to an attacker while
14374
+ the caller/UI only sees the requested recipients. To bound that, at most one
14375
+ commission output is allowed and its amount must not exceed `maxCommission`.
14376
+ Any other unrecognized output is rejected outright.
14377
+
14378
+ ```ts
14379
+ export function verifyUnrequestedOutputsAreChangeOrCommission(storageOutputs: StorageCreateTransactionSdkOutput[], args: Validation.ValidCreateActionArgs, maxCommission: number = MAX_STORAGE_COMMISSION_SATOSHIS): void
14380
+ ```
14381
+
14382
+ See also: [MAX_STORAGE_COMMISSION_SATOSHIS](./client.md#variable-max_storage_commission_satoshis), [StorageCreateTransactionSdkOutput](./client.md#interface-storagecreatetransactionsdkoutput)
14383
+
14384
+ Throws
14385
+
14386
+ WERR_INVALID_PARAMETER if storage returned an unrecognized output, more
14387
+ than one commission output, or a commission exceeding `maxCommission`.
14388
+
14389
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14390
+
14285
14391
  ---
14286
14392
  ##### Function: wait
14287
14393
 
@@ -14760,24 +14866,31 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
14760
14866
  ---
14761
14867
  #### Variables
14762
14868
 
14763
- | | |
14764
- | --- | --- |
14765
- | [DEFAULT_SETTINGS](#variable-default_settings) | [parseResults](#variable-parseresults) |
14766
- | [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [queryOverlay](#variable-queryoverlay) |
14767
- | [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [specOpFailedActions](#variable-specopfailedactions) |
14768
- | [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [specOpInvalidChange](#variable-specopinvalidchange) |
14769
- | [aggregateActionResults](#variable-aggregateactionresults) | [specOpNoSendActions](#variable-specopnosendactions) |
14770
- | [brc29ProtocolID](#variable-brc29protocolid) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
14771
- | [dirtyHashes](#variable-dirtyhashes) | [specOpThrowReviewActions](#variable-specopthrowreviewactions) |
14772
- | [logger](#variable-logger) | [specOpWalletBalance](#variable-specopwalletbalance) |
14773
- | [maxChangeOutputsPerTransaction](#variable-maxchangeoutputspertransaction) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
14774
- | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
14775
- | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | [validBulkHeaderFiles](#variable-validbulkheaderfiles) |
14869
+ | | | |
14870
+ | --- | --- | --- |
14871
+ | [ARCADE_POST_BEEF_CONCURRENCY](#variable-arcade_post_beef_concurrency) | [logger](#variable-logger) | [specOpNoSendActions](#variable-specopnosendactions) |
14872
+ | [DEFAULT_SETTINGS](#variable-default_settings) | [managedChangeOutputFields](#variable-managedchangeoutputfields) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
14873
+ | [MAX_STORAGE_COMMISSION_SATOSHIS](#variable-max_storage_commission_satoshis) | [maxChangeOutputsPerTransaction](#variable-maxchangeoutputspertransaction) | [specOpThrowReviewActions](#variable-specopthrowreviewactions) |
14874
+ | [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [specOpWalletBalance](#variable-specopwalletbalance) |
14875
+ | [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | [specOpWalletManagedUtxos](#variable-specopwalletmanagedutxos) |
14876
+ | [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [parseResults](#variable-parseresults) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
14877
+ | [aggregateActionResults](#variable-aggregateactionresults) | [queryOverlay](#variable-queryoverlay) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
14878
+ | [brc29ProtocolID](#variable-brc29protocolid) | [specOpFailedActions](#variable-specopfailedactions) | [validBulkHeaderFiles](#variable-validbulkheaderfiles) |
14879
+ | [dirtyHashes](#variable-dirtyhashes) | [specOpInvalidChange](#variable-specopinvalidchange) | |
14776
14880
 
14777
14881
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14778
14882
 
14779
14883
  ---
14780
14884
 
14885
+ ##### Variable: ARCADE_POST_BEEF_CONCURRENCY
14886
+
14887
+ ```ts
14888
+ ARCADE_POST_BEEF_CONCURRENCY = 4
14889
+ ```
14890
+
14891
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14892
+
14893
+ ---
14781
14894
  ##### Variable: DEFAULT_SETTINGS
14782
14895
 
14783
14896
  ```ts
@@ -14810,6 +14923,15 @@ See also: [WalletSettings](./client.md#interface-walletsettings)
14810
14923
 
14811
14924
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14812
14925
 
14926
+ ---
14927
+ ##### Variable: MAX_STORAGE_COMMISSION_SATOSHIS
14928
+
14929
+ ```ts
14930
+ MAX_STORAGE_COMMISSION_SATOSHIS = 500000
14931
+ ```
14932
+
14933
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14934
+
14813
14935
  ---
14814
14936
  ##### Variable: ProvenTxReqNonTerminalStatus
14815
14937
 
@@ -14947,6 +15069,20 @@ logger = (message: string, ...optionalParams: any[]): void => {
14947
15069
 
14948
15070
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14949
15071
 
15072
+ ---
15073
+ ##### Variable: managedChangeOutputFields
15074
+
15075
+ ```ts
15076
+ managedChangeOutputFields = {
15077
+ type: "P2PKH",
15078
+ change: true,
15079
+ providedBy: "storage",
15080
+ purpose: "change"
15081
+ } as const
15082
+ ```
15083
+
15084
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
15085
+
14950
15086
  ---
14951
15087
  ##### Variable: maxChangeOutputsPerTransaction
14952
15088
 
@@ -15092,6 +15228,15 @@ specOpWalletBalance = "893b7646de0e1c9f741bd6e9169b76a8847ae34adef7bef1e6a285371
15092
15228
 
15093
15229
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
15094
15230
 
15231
+ ---
15232
+ ##### Variable: specOpWalletManagedUtxos
15233
+
15234
+ ```ts
15235
+ specOpWalletManagedUtxos = "284570a6213a74ba861c38b1cf790e1e400d9cf9324454b76ea98860b6031c1a"
15236
+ ```
15237
+
15238
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
15239
+
15095
15240
  ---
15096
15241
  ##### Variable: transactionColumnsWithoutRawTx
15097
15242
 
@@ -181,6 +181,10 @@ export declare class Wallet implements WalletInterface, ProtoWallet {
181
181
  * Uses `listOutputs` to iterate over chunks of up to 1000 outputs to
182
182
  * compute the sum of output satoshis.
183
183
  *
184
+ * For `default`, only wallet-managed BRC-29 change is included. Raw
185
+ * administrative `listOutputs({ basket: 'default' })` remains available to
186
+ * discover legacy incompatible rows for recovery.
187
+ *
184
188
  * @param {string} basket - Optional. Defaults to 'default', the wallet change basket.
185
189
  * @returns {WalletBalance} total sum of output satoshis and utxo details (satoshis and outpoints)
186
190
  */