@bsv/wallet-toolbox 2.4.0 → 2.4.2
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.
- package/CHANGELOG.md +42 -0
- package/README.md +45 -0
- package/docs/client.md +493 -168
- package/docs/managed-change-policy.md +79 -0
- package/docs/services.md +61 -26
- package/docs/storage.md +417 -69
- package/docs/wallet.md +465 -155
- package/out/src/Wallet.d.ts +5 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +14 -8
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts +18 -0
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +56 -9
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/monitor/tasks/TaskArcSSE.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskArcSSE.js +46 -18
- package/out/src/monitor/tasks/TaskArcSSE.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +10 -10
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.js +7 -2
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.js +2 -57
- package/out/src/monitor/tasks/TaskUnFail.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts +1 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +10 -4
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/sdk/types.d.ts +10 -1
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +16 -2
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +39 -19
- package/out/src/services/Services.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +8 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js +4 -0
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js +2 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js +2 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +1 -0
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.js +17 -3
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
- package/out/src/services/networkConfig.d.ts +29 -0
- package/out/src/services/networkConfig.d.ts.map +1 -0
- package/out/src/services/networkConfig.js +54 -0
- package/out/src/services/networkConfig.js.map +1 -0
- package/out/src/services/providers/Arcade.d.ts +1 -0
- package/out/src/services/providers/Arcade.d.ts.map +1 -1
- package/out/src/services/providers/Arcade.js +45 -14
- package/out/src/services/providers/Arcade.js.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.js +12 -4
- package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.js +3 -1
- package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
- package/out/src/signer/methods/completeSignedTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/completeSignedTransaction.js +5 -3
- package/out/src/signer/methods/completeSignedTransaction.js.map +1 -1
- package/out/src/signer/methods/createAction.d.ts.map +1 -1
- package/out/src/signer/methods/createAction.js +12 -5
- package/out/src/signer/methods/createAction.js.map +1 -1
- package/out/src/signer/methods/internalizeAction.d.ts +6 -4
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/signer/methods/internalizeAction.js +12 -7
- package/out/src/signer/methods/internalizeAction.js.map +1 -1
- package/out/src/signer/methods/resultBeef.d.ts +4 -0
- package/out/src/signer/methods/resultBeef.d.ts.map +1 -0
- package/out/src/signer/methods/resultBeef.js +12 -0
- package/out/src/signer/methods/resultBeef.js.map +1 -0
- package/out/src/signer/methods/signAction.d.ts.map +1 -1
- package/out/src/signer/methods/signAction.js +6 -1
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts +2 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +12 -5
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +2 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +27 -2
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +17 -0
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +206 -13
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/index.all.d.ts +2 -0
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +2 -0
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/index.client.d.ts +1 -0
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +1 -0
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts +2 -0
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.js +13 -1
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +23 -10
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +47 -24
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.d.ts +6 -4
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +26 -15
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.js +21 -3
- package/out/src/storage/methods/listOutputsIdb.js.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.js +14 -0
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/methods/managedChange.d.ts +26 -0
- package/out/src/storage/methods/managedChange.d.ts.map +1 -0
- package/out/src/storage/methods/managedChange.js +43 -0
- package/out/src/storage/methods/managedChange.js.map +1 -0
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +5 -4
- package/out/src/storage/methods/processAction.js.map +1 -1
- package/out/src/storage/remoting/BinaryJson.d.ts +10 -0
- package/out/src/storage/remoting/BinaryJson.d.ts.map +1 -0
- package/out/src/storage/remoting/BinaryJson.js +172 -0
- package/out/src/storage/remoting/BinaryJson.js.map +1 -0
- package/out/src/storage/remoting/KnexSessionManager.d.ts +37 -0
- package/out/src/storage/remoting/KnexSessionManager.d.ts.map +1 -0
- package/out/src/storage/remoting/KnexSessionManager.js +198 -0
- package/out/src/storage/remoting/KnexSessionManager.js.map +1 -0
- package/out/src/storage/remoting/StorageClient.d.ts +2 -2
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClient.js +14 -5
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/remoting/StorageClientBase.d.ts +11 -1
- package/out/src/storage/remoting/StorageClientBase.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClientBase.js +4 -1
- package/out/src/storage/remoting/StorageClientBase.js.map +1 -1
- package/out/src/storage/remoting/StorageMobile.d.ts +2 -2
- package/out/src/storage/remoting/StorageMobile.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageMobile.js +14 -5
- package/out/src/storage/remoting/StorageMobile.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.d.ts +10 -0
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +48 -21
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.d.ts +2 -0
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +34 -1
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/src/storage/schema/tables/TableAuthSession.d.ts +20 -0
- package/out/src/storage/schema/tables/TableAuthSession.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableAuthSession.js +15 -0
- package/out/src/storage/schema/tables/TableAuthSession.js.map +1 -0
- package/out/src/storage/schema/tables/index.d.ts +1 -0
- package/out/src/storage/schema/tables/index.d.ts.map +1 -1
- package/out/src/storage/schema/tables/index.js +1 -0
- package/out/src/storage/schema/tables/index.js.map +1 -1
- package/out/src/storage/storageProviderHelpers.d.ts +5 -4
- package/out/src/storage/storageProviderHelpers.d.ts.map +1 -1
- package/out/src/storage/storageProviderHelpers.js +7 -6
- package/out/src/storage/storageProviderHelpers.js.map +1 -1
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +2 -0
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/package.json +6 -5
package/docs/storage.md
CHANGED
|
@@ -22,27 +22,28 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
22
22
|
|
|
23
23
|
| | | |
|
|
24
24
|
| --- | --- | --- |
|
|
25
|
-
| [AdminStatsResult](#interface-adminstatsresult) | [MonitorAdminContextConfig](#interface-monitoradmincontextconfig) | [
|
|
26
|
-
| [AggregatePostBeefTxResult](#interface-aggregatepostbeeftxresult) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [
|
|
27
|
-
| [BRC38ImportOptions](#interface-brc38importoptions) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [
|
|
28
|
-
| [BRC38ImportResult](#interface-brc38importresult) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [
|
|
29
|
-
| [BRC38Tables](#interface-brc38tables) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [
|
|
30
|
-
| [BRC38WalletData](#interface-brc38walletdata) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [
|
|
31
|
-
| [BRC39Options](#interface-brc39options) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [
|
|
32
|
-
| [CommitNewTxResults](#interface-commitnewtxresults) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [
|
|
33
|
-
| [EntitySyncMap](#interface-entitysyncmap) | [SpentInputTransition](#interface-spentinputtransition) | [
|
|
34
|
-
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageAdminStats](#interface-storageadminstats) | [
|
|
35
|
-
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [
|
|
36
|
-
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [
|
|
37
|
-
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [
|
|
38
|
-
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [
|
|
39
|
-
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [
|
|
40
|
-
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [
|
|
41
|
-
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [
|
|
42
|
-
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [
|
|
25
|
+
| [AdminStatsResult](#interface-adminstatsresult) | [MonitorAdminContextConfig](#interface-monitoradmincontextconfig) | [TableCertificateField](#interface-tablecertificatefield) |
|
|
26
|
+
| [AggregatePostBeefTxResult](#interface-aggregatepostbeeftxresult) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TableCertificateX](#interface-tablecertificatex) |
|
|
27
|
+
| [BRC38ImportOptions](#interface-brc38importoptions) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TableCommission](#interface-tablecommission) |
|
|
28
|
+
| [BRC38ImportResult](#interface-brc38importresult) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TableMonitorEvent](#interface-tablemonitorevent) |
|
|
29
|
+
| [BRC38Tables](#interface-brc38tables) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [TableOutput](#interface-tableoutput) |
|
|
30
|
+
| [BRC38WalletData](#interface-brc38walletdata) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [TableOutputBasket](#interface-tableoutputbasket) |
|
|
31
|
+
| [BRC39Options](#interface-brc39options) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [TableOutputTag](#interface-tableoutputtag) |
|
|
32
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [TableOutputTagMap](#interface-tableoutputtagmap) |
|
|
33
|
+
| [EntitySyncMap](#interface-entitysyncmap) | [SpentInputTransition](#interface-spentinputtransition) | [TableOutputX](#interface-tableoutputx) |
|
|
34
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageAdminStats](#interface-storageadminstats) | [TableProvenTx](#interface-tableproventx) |
|
|
35
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageClientOptions](#interface-storageclientoptions) | [TableProvenTxReq](#interface-tableproventxreq) |
|
|
36
|
+
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageIdbOptions](#interface-storageidboptions) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
|
|
37
|
+
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageIdbSchema](#interface-storageidbschema) | [TableSettings](#interface-tablesettings) |
|
|
38
|
+
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [StorageKnexOptions](#interface-storageknexoptions) | [TableSyncState](#interface-tablesyncstate) |
|
|
39
|
+
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [StorageMySQLDojoReaderOptions](#interface-storagemysqldojoreaderoptions) | [TableTransaction](#interface-tabletransaction) |
|
|
40
|
+
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StorageProviderOptions](#interface-storageprovideroptions) | [TableTxLabel](#interface-tabletxlabel) |
|
|
41
|
+
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [StorageReaderOptions](#interface-storagereaderoptions) | [TableTxLabelMap](#interface-tabletxlabelmap) |
|
|
42
|
+
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [TableUser](#interface-tableuser) |
|
|
43
|
+
| [KnexSessionManagerOptions](#interface-knexsessionmanageroptions) | [SyncError](#interface-syncerror) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
|
|
43
44
|
| [ListActionsSpecOp](#interface-listactionsspecop) | [SyncMap](#interface-syncmap) | [VerifyAndRepairBeefResult](#interface-verifyandrepairbeefresult) |
|
|
44
|
-
| [ListOutputsSpecOp](#interface-listoutputsspecop) | [
|
|
45
|
-
| [MonitorAdminContext](#interface-monitoradmincontext) | [
|
|
45
|
+
| [ListOutputsSpecOp](#interface-listoutputsspecop) | [TableAuthSession](#interface-tableauthsession) | [WalletStorageServerOptions](#interface-walletstorageserveroptions) |
|
|
46
|
+
| [MonitorAdminContext](#interface-monitoradmincontext) | [TableCertificate](#interface-tablecertificate) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
46
47
|
|
|
47
48
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
48
49
|
|
|
@@ -425,6 +426,34 @@ See also: [GetReqsAndBeefDetail](./storage.md#interface-getreqsandbeefdetail)
|
|
|
425
426
|
|
|
426
427
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
427
428
|
|
|
429
|
+
---
|
|
430
|
+
##### Interface: KnexSessionManagerOptions
|
|
431
|
+
|
|
432
|
+
```ts
|
|
433
|
+
export interface KnexSessionManagerOptions {
|
|
434
|
+
ttlMs?: number;
|
|
435
|
+
now?: () => number;
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
###### Property now
|
|
440
|
+
|
|
441
|
+
Testable clock source. Defaults to `Date.now`.
|
|
442
|
+
|
|
443
|
+
```ts
|
|
444
|
+
now?: () => number
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
###### Property ttlMs
|
|
448
|
+
|
|
449
|
+
Session lifetime since its most recent authenticated use. Default: 24 hours.
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
ttlMs?: number
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
456
|
+
|
|
428
457
|
---
|
|
429
458
|
##### Interface: ListActionsSpecOp
|
|
430
459
|
|
|
@@ -462,6 +491,7 @@ export interface ListOutputsSpecOp {
|
|
|
462
491
|
includeOutputScripts?: boolean;
|
|
463
492
|
includeSpent?: boolean;
|
|
464
493
|
totalOutputsIsSumOfSatoshis?: boolean;
|
|
494
|
+
managedChangeOnly?: boolean;
|
|
465
495
|
resultFromTags?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListOutputsArgs, specOpTags: string[]) => Promise<ListOutputsResult>;
|
|
466
496
|
resultFromOutputs?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]) => Promise<ListOutputsResult>;
|
|
467
497
|
filterOutputs?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListOutputsArgs, specOpTags: string[], outputs: TableOutput[]) => Promise<TableOutput[]>;
|
|
@@ -472,6 +502,14 @@ export interface ListOutputsSpecOp {
|
|
|
472
502
|
|
|
473
503
|
See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md#class-storageprovider), [TableOutput](./storage.md#interface-tableoutput)
|
|
474
504
|
|
|
505
|
+
###### Property managedChangeOnly
|
|
506
|
+
|
|
507
|
+
Restrict the operation to wallet-managed, BRC-29-signable change.
|
|
508
|
+
|
|
509
|
+
```ts
|
|
510
|
+
managedChangeOnly?: boolean
|
|
511
|
+
```
|
|
512
|
+
|
|
475
513
|
###### Property tagsParamsCount
|
|
476
514
|
|
|
477
515
|
How many positional tags to intercept.
|
|
@@ -771,6 +809,27 @@ export interface StorageAdminStats {
|
|
|
771
809
|
|
|
772
810
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
773
811
|
|
|
812
|
+
---
|
|
813
|
+
##### Interface: StorageClientOptions
|
|
814
|
+
|
|
815
|
+
```ts
|
|
816
|
+
export interface StorageClientOptions {
|
|
817
|
+
binaryRequests?: boolean;
|
|
818
|
+
}
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
###### Property binaryRequests
|
|
822
|
+
|
|
823
|
+
Send compact tagged binary request values after the server advertises
|
|
824
|
+
support. Leave disabled during rolling deployments where an endpoint may
|
|
825
|
+
still route requests to legacy server instances.
|
|
826
|
+
|
|
827
|
+
```ts
|
|
828
|
+
binaryRequests?: boolean
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
832
|
+
|
|
774
833
|
---
|
|
775
834
|
##### Interface: StorageIdbOptions
|
|
776
835
|
|
|
@@ -1080,6 +1139,30 @@ See also: [EntitySyncMap](./storage.md#interface-entitysyncmap)
|
|
|
1080
1139
|
|
|
1081
1140
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1082
1141
|
|
|
1142
|
+
---
|
|
1143
|
+
##### Interface: TableAuthSession
|
|
1144
|
+
|
|
1145
|
+
Durable representation of a BRC-103 peer session.
|
|
1146
|
+
|
|
1147
|
+
The session nonce is the authoritative key. `lastUpdate` also acts as the
|
|
1148
|
+
optimistic-write version so a delayed request from one replica cannot
|
|
1149
|
+
overwrite newer authentication state written by another replica.
|
|
1150
|
+
|
|
1151
|
+
```ts
|
|
1152
|
+
export interface TableAuthSession {
|
|
1153
|
+
sessionNonce: string;
|
|
1154
|
+
peerNonce?: string | null;
|
|
1155
|
+
peerIdentityKey?: string | null;
|
|
1156
|
+
isAuthenticated: boolean | number;
|
|
1157
|
+
lastUpdate: number | string;
|
|
1158
|
+
certificatesRequired?: boolean | number | null;
|
|
1159
|
+
certificatesValidated?: boolean | number | null;
|
|
1160
|
+
expiresAt: number | string;
|
|
1161
|
+
}
|
|
1162
|
+
```
|
|
1163
|
+
|
|
1164
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1165
|
+
|
|
1083
1166
|
---
|
|
1084
1167
|
##### Interface: TableCertificate
|
|
1085
1168
|
|
|
@@ -1710,11 +1793,30 @@ export interface WalletStorageServerOptions {
|
|
|
1710
1793
|
calculateRequestPrice?: (req: Request) => number | Promise<number>;
|
|
1711
1794
|
adminIdentityKeys?: string[];
|
|
1712
1795
|
makeLogger?: MakeWalletLogger;
|
|
1796
|
+
sessionManager?: AuthMiddlewareOptions["sessionManager"];
|
|
1797
|
+
logRpcRequests?: boolean;
|
|
1713
1798
|
}
|
|
1714
1799
|
```
|
|
1715
1800
|
|
|
1716
1801
|
See also: [Wallet](./client.md#class-wallet)
|
|
1717
1802
|
|
|
1803
|
+
###### Property logRpcRequests
|
|
1804
|
+
|
|
1805
|
+
Emit one JSON log record for each authenticated RPC. Default: true.
|
|
1806
|
+
|
|
1807
|
+
```ts
|
|
1808
|
+
logRpcRequests?: boolean
|
|
1809
|
+
```
|
|
1810
|
+
|
|
1811
|
+
###### Property sessionManager
|
|
1812
|
+
|
|
1813
|
+
Shared BRC-103 session storage for multi-process or multi-replica servers.
|
|
1814
|
+
Defaults to the auth middleware's in-process SessionManager.
|
|
1815
|
+
|
|
1816
|
+
```ts
|
|
1817
|
+
sessionManager?: AuthMiddlewareOptions["sessionManager"]
|
|
1818
|
+
```
|
|
1819
|
+
|
|
1718
1820
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1719
1821
|
|
|
1720
1822
|
---
|
|
@@ -1739,16 +1841,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1739
1841
|
|
|
1740
1842
|
| | | |
|
|
1741
1843
|
| --- | --- | --- |
|
|
1742
|
-
| [AdminServer](#class-adminserver) | [EntityProvenTxReq](#class-entityproventxreq) | [
|
|
1743
|
-
| [EntityBase](#class-entitybase) | [EntitySyncState](#class-entitysyncstate) | [
|
|
1744
|
-
| [EntityCertificate](#class-entitycertificate) | [EntityTransaction](#class-entitytransaction) | [
|
|
1745
|
-
| [EntityCertificateField](#class-entitycertificatefield) | [EntityTxLabel](#class-entitytxlabel) | [
|
|
1746
|
-
| [EntityCommission](#class-entitycommission) | [EntityTxLabelMap](#class-entitytxlabelmap) | [
|
|
1747
|
-
| [EntityOutput](#class-entityoutput) | [EntityUser](#class-entityuser) | [
|
|
1748
|
-
| [EntityOutputBasket](#class-entityoutputbasket) | [KnexMigrations](#class-knexmigrations) | [
|
|
1749
|
-
| [EntityOutputTag](#class-entityoutputtag) | [
|
|
1750
|
-
| [EntityOutputTagMap](#class-entityoutputtagmap) | [
|
|
1751
|
-
| [EntityProvenTx](#class-entityproventx) | [
|
|
1844
|
+
| [AdminServer](#class-adminserver) | [EntityProvenTxReq](#class-entityproventxreq) | [StorageClientBase](#class-storageclientbase) |
|
|
1845
|
+
| [EntityBase](#class-entitybase) | [EntitySyncState](#class-entitysyncstate) | [StorageIdb](#class-storageidb) |
|
|
1846
|
+
| [EntityCertificate](#class-entitycertificate) | [EntityTransaction](#class-entitytransaction) | [StorageKnex](#class-storageknex) |
|
|
1847
|
+
| [EntityCertificateField](#class-entitycertificatefield) | [EntityTxLabel](#class-entitytxlabel) | [StorageMySQLDojoReader](#class-storagemysqldojoreader) |
|
|
1848
|
+
| [EntityCommission](#class-entitycommission) | [EntityTxLabelMap](#class-entitytxlabelmap) | [StorageProvider](#class-storageprovider) |
|
|
1849
|
+
| [EntityOutput](#class-entityoutput) | [EntityUser](#class-entityuser) | [StorageReader](#class-storagereader) |
|
|
1850
|
+
| [EntityOutputBasket](#class-entityoutputbasket) | [KnexMigrations](#class-knexmigrations) | [StorageReaderWriter](#class-storagereaderwriter) |
|
|
1851
|
+
| [EntityOutputTag](#class-entityoutputtag) | [KnexSessionManager](#class-knexsessionmanager) | [StorageServer](#class-storageserver) |
|
|
1852
|
+
| [EntityOutputTagMap](#class-entityoutputtagmap) | [MergeEntity](#class-mergeentity) | [StorageSyncReader](#class-storagesyncreader) |
|
|
1853
|
+
| [EntityProvenTx](#class-entityproventx) | [StorageClient](#class-storageclient) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
1752
1854
|
|
|
1753
1855
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1754
1856
|
|
|
@@ -2794,6 +2896,40 @@ Argument Details
|
|
|
2794
2896
|
|
|
2795
2897
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2796
2898
|
|
|
2899
|
+
---
|
|
2900
|
+
##### Class: KnexSessionManager
|
|
2901
|
+
|
|
2902
|
+
Shared BRC-103 session storage for horizontally scaled StorageServer nodes.
|
|
2903
|
+
|
|
2904
|
+
Every instance must use the same Knex database. The wallet-toolbox migration
|
|
2905
|
+
creates the required `auth_sessions` table. Writes are monotonic by
|
|
2906
|
+
`PeerSession.lastUpdate`, preventing a delayed request on one replica from
|
|
2907
|
+
replacing newer session state written by another replica.
|
|
2908
|
+
|
|
2909
|
+
```ts
|
|
2910
|
+
export class KnexSessionManager implements AsyncSessionManager {
|
|
2911
|
+
constructor(private readonly knex: Knex, options: KnexSessionManagerOptions = {})
|
|
2912
|
+
async addSession(session: PeerSession): Promise<void>
|
|
2913
|
+
async updateSession(session: PeerSession): Promise<void>
|
|
2914
|
+
async getSession(identifier: string): Promise<PeerSession | undefined>
|
|
2915
|
+
async removeSession(session: PeerSession): Promise<void>
|
|
2916
|
+
async hasSession(identifier: string): Promise<boolean>
|
|
2917
|
+
async pruneExpiredSessions(): Promise<number>
|
|
2918
|
+
}
|
|
2919
|
+
```
|
|
2920
|
+
|
|
2921
|
+
See also: [KnexSessionManagerOptions](./storage.md#interface-knexsessionmanageroptions)
|
|
2922
|
+
|
|
2923
|
+
###### Method pruneExpiredSessions
|
|
2924
|
+
|
|
2925
|
+
Delete expired rows. Call from an operator-controlled maintenance task.
|
|
2926
|
+
|
|
2927
|
+
```ts
|
|
2928
|
+
async pruneExpiredSessions(): Promise<number>
|
|
2929
|
+
```
|
|
2930
|
+
|
|
2931
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2932
|
+
|
|
2797
2933
|
---
|
|
2798
2934
|
##### Class: MergeEntity
|
|
2799
2935
|
|
|
@@ -2850,12 +2986,12 @@ For details of the API implemented, follow the "See also" link for the `WalletSt
|
|
|
2850
2986
|
|
|
2851
2987
|
```ts
|
|
2852
2988
|
export class StorageClient extends StorageClientBase {
|
|
2853
|
-
constructor(wallet: WalletInterface, endpointUrl: string)
|
|
2989
|
+
constructor(wallet: WalletInterface, endpointUrl: string, options: StorageClientOptions = {})
|
|
2854
2990
|
protected async rpcCall<T>(method: string, params: unknown[]): Promise<T>
|
|
2855
2991
|
}
|
|
2856
2992
|
```
|
|
2857
2993
|
|
|
2858
|
-
See also: [StorageClientBase](./storage.md#class-storageclientbase)
|
|
2994
|
+
See also: [StorageClientBase](./storage.md#class-storageclientbase), [StorageClientOptions](./storage.md#interface-storageclientoptions)
|
|
2859
2995
|
|
|
2860
2996
|
###### Method rpcCall
|
|
2861
2997
|
|
|
@@ -2888,8 +3024,10 @@ export abstract class StorageClientBase implements WalletStorageProvider {
|
|
|
2888
3024
|
readonly endpointUrl: string;
|
|
2889
3025
|
protected readonly authClient: AuthFetch;
|
|
2890
3026
|
protected nextId = 1;
|
|
3027
|
+
protected serverSupportsBinary = false;
|
|
3028
|
+
protected readonly binaryRequests: boolean;
|
|
2891
3029
|
public settings?: TableSettings;
|
|
2892
|
-
constructor(wallet: WalletInterface, endpointUrl: string)
|
|
3030
|
+
constructor(wallet: WalletInterface, endpointUrl: string, options: StorageClientOptions = {})
|
|
2893
3031
|
isStorageProvider(): boolean
|
|
2894
3032
|
protected abstract rpcCall<T>(method: string, params: unknown[]): Promise<T>;
|
|
2895
3033
|
isAvailable(): boolean
|
|
@@ -2931,7 +3069,7 @@ export abstract class StorageClientBase implements WalletStorageProvider {
|
|
|
2931
3069
|
}
|
|
2932
3070
|
```
|
|
2933
3071
|
|
|
2934
|
-
See also: [AuthId](./client.md#interface-authid), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageInternalizeActionResult](./client.md#interface-storageinternalizeactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableUser](./storage.md#interface-tableuser), [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult), [WalletServices](./client.md#interface-walletservices), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [createAction](./storage.md#function-createaction), [getSyncChunk](./storage.md#function-getsyncchunk), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction), [validateDate](./storage.md#function-validatedate), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity)
|
|
3072
|
+
See also: [AuthId](./client.md#interface-authid), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageClientOptions](./storage.md#interface-storageclientoptions), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageInternalizeActionResult](./client.md#interface-storageinternalizeactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableUser](./storage.md#interface-tableuser), [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult), [WalletServices](./client.md#interface-walletservices), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [createAction](./storage.md#function-createaction), [getSyncChunk](./storage.md#function-getsyncchunk), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction), [validateDate](./storage.md#function-validatedate), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity)
|
|
2935
3073
|
|
|
2936
3074
|
###### Method abortAction
|
|
2937
3075
|
|
|
@@ -3669,7 +3807,8 @@ Proceeds in three stages:
|
|
|
3669
3807
|
3. Find an output that comes as close to funding as possible (targetSatoshis).
|
|
3670
3808
|
4. Return undefined if no output is found.
|
|
3671
3809
|
|
|
3672
|
-
Outputs must belong to userId and basketId and
|
|
3810
|
+
Outputs must belong to userId and basketId and satisfy the wallet-managed
|
|
3811
|
+
BRC-29 change policy.
|
|
3673
3812
|
Their corresponding transaction must have status of 'completed', 'unproven', or 'sending' (if excludeSending is false).
|
|
3674
3813
|
|
|
3675
3814
|
```ts
|
|
@@ -4089,7 +4228,8 @@ See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
|
4089
4228
|
|
|
4090
4229
|
###### Method countChangeInputs
|
|
4091
4230
|
|
|
4092
|
-
Counts
|
|
4231
|
+
Counts wallet-managed BRC-29 change outputs for userId in basketId that
|
|
4232
|
+
are currently eligible for automatic allocation
|
|
4093
4233
|
AND whose transaction status is one of:
|
|
4094
4234
|
- completed
|
|
4095
4235
|
- unproven
|
|
@@ -4322,6 +4462,10 @@ export abstract class StorageProvider extends StorageReaderWriter implements Wal
|
|
|
4322
4462
|
async relinquishOutput(auth: AuthId, args: RelinquishOutputArgs): Promise<number>
|
|
4323
4463
|
async processSyncChunk(args: RequestSyncChunkArgs, chunk: SyncChunk): Promise<ProcessSyncChunkResult>
|
|
4324
4464
|
async updateProvenTxReqWithNewProvenTx(args: UpdateProvenTxReqWithNewProvenTxArgs): Promise<UpdateProvenTxReqWithNewProvenTxResult>
|
|
4465
|
+
async reconcileCompletedProvenTxReqs(): Promise<{
|
|
4466
|
+
log: string;
|
|
4467
|
+
}>
|
|
4468
|
+
async unfailTransactionsForProof(req: EntityProvenTxReq, indent = 0, requestUpdate?: Pick<TableProvenTxReqDynamics, "status" | "attempts">): Promise<string>
|
|
4325
4469
|
async confirmSpendableOutputs(): Promise<{
|
|
4326
4470
|
invalidSpendableOutputs: TableOutput[];
|
|
4327
4471
|
}>
|
|
@@ -4373,6 +4517,31 @@ async getValidBeefForKnownTxid(txid: string, mergeToBeef?: Beef, trustSelf?: Tru
|
|
|
4373
4517
|
```
|
|
4374
4518
|
See also: [TrxToken](./client.md#interface-trxtoken)
|
|
4375
4519
|
|
|
4520
|
+
###### Method reconcileCompletedProvenTxReqs
|
|
4521
|
+
|
|
4522
|
+
Reconcile completed proof requests whose transaction fan-out previously
|
|
4523
|
+
failed or whose durable notification state drifted.
|
|
4524
|
+
|
|
4525
|
+
This is called by TaskReviewStatus so a completed request with
|
|
4526
|
+
`notified = false` is retried and can become eligible for normal purge.
|
|
4527
|
+
|
|
4528
|
+
```ts
|
|
4529
|
+
async reconcileCompletedProvenTxReqs(): Promise<{
|
|
4530
|
+
log: string;
|
|
4531
|
+
}>
|
|
4532
|
+
```
|
|
4533
|
+
|
|
4534
|
+
###### Method unfailTransactionsForProof
|
|
4535
|
+
|
|
4536
|
+
Restore every failed local copy of a transaction before proof completion.
|
|
4537
|
+
Also heals the request's notification set from the authoritative txid
|
|
4538
|
+
lookup so TaskUnFail cannot omit a local copy after notification drift.
|
|
4539
|
+
|
|
4540
|
+
```ts
|
|
4541
|
+
async unfailTransactionsForProof(req: EntityProvenTxReq, indent = 0, requestUpdate?: Pick<TableProvenTxReqDynamics, "status" | "attempts">): Promise<string>
|
|
4542
|
+
```
|
|
4543
|
+
See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq), [TableProvenTxReqDynamics](./storage.md#interface-tableproventxreqdynamics)
|
|
4544
|
+
|
|
4376
4545
|
###### Method updateProvenTxReqWithNewProvenTx
|
|
4377
4546
|
|
|
4378
4547
|
Handles storage changes when a valid MerklePath and mined block header are found for a ProvenTxReq txid.
|
|
@@ -4902,12 +5071,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4902
5071
|
|
|
4903
5072
|
| | | |
|
|
4904
5073
|
| --- | --- | --- |
|
|
4905
|
-
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [
|
|
4906
|
-
| [
|
|
4907
|
-
| [
|
|
4908
|
-
| [
|
|
4909
|
-
| [
|
|
4910
|
-
| [
|
|
5074
|
+
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [markStaleInputsAsSpent](#function-markstaleinputsasspent) | [shareReqsWithWorld](#function-sharereqswithworld) |
|
|
5075
|
+
| [binaryJsonReplacer](#function-binaryjsonreplacer) | [markUserInputsSpent](#function-markuserinputsspent) | [stringifyJsonRpc](#function-stringifyjsonrpc) |
|
|
5076
|
+
| [binaryJsonReviver](#function-binaryjsonreviver) | [matchesCertificateFieldPartial](#function-matchescertificatefieldpartial) | [tableAuthSessionToPeerSession](#function-tableauthsessiontopeersession) |
|
|
5077
|
+
| [classifyReqStatus](#function-classifyreqstatus) | [matchesCertificatePartial](#function-matchescertificatepartial) | [transactionInputSize](#function-transactioninputsize) |
|
|
5078
|
+
| [createAction](#function-createaction) | [matchesCommissionPartial](#function-matchescommissionpartial) | [transactionOutputSize](#function-transactionoutputsize) |
|
|
5079
|
+
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [matchesMonitorEventPartial](#function-matchesmonitoreventpartial) | [transactionSize](#function-transactionsize) |
|
|
5080
|
+
| [createSyncMap](#function-createsyncmap) | [matchesOutputBasketPartial](#function-matchesoutputbasketpartial) | [updateReqsFromAggregateResults](#function-updatereqsfromaggregateresults) |
|
|
5081
|
+
| [dateMatches](#function-datematches) | [matchesOutputPartial](#function-matchesoutputpartial) | [upgradeAllStoresV1](#function-upgradeallstoresv1) |
|
|
5082
|
+
| [decodeBinaryJsonValue](#function-decodebinaryjsonvalue) | [matchesOutputTagMapPartial](#function-matchesoutputtagmappartial) | [upgradeCertificateFields](#function-upgradecertificatefields) |
|
|
4911
5083
|
| [decryptBRC39](#function-decryptbrc39) | [matchesOutputTagPartial](#function-matchesoutputtagpartial) | [upgradeCertificates](#function-upgradecertificates) |
|
|
4912
5084
|
| [determineDBType](#function-determinedbtype) | [matchesProvenTxPartial](#function-matchesproventxpartial) | [upgradeCommissions](#function-upgradecommissions) |
|
|
4913
5085
|
| [encryptBRC39](#function-encryptbrc39) | [matchesProvenTxReqPartial](#function-matchesproventxreqpartial) | [upgradeMonitorEvents](#function-upgrademonitorevents) |
|
|
@@ -4921,17 +5093,17 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4921
5093
|
| [getSyncChunk](#function-getsyncchunk) | [offsetPrivKey](#function-offsetprivkey) | [upgradeTransactions](#function-upgradetransactions) |
|
|
4922
5094
|
| [importBRC38](#function-importbrc38) | [offsetPubKey](#function-offsetpubkey) | [upgradeTxLabels](#function-upgradetxlabels) |
|
|
4923
5095
|
| [importBRC39](#function-importbrc39) | [parseBRC38Json](#function-parsebrc38json) | [upgradeTxLabelsMap](#function-upgradetxlabelsmap) |
|
|
4924
|
-
| [internalizeAction](#function-internalizeaction) | [
|
|
4925
|
-
| [
|
|
4926
|
-
| [
|
|
4927
|
-
| [
|
|
4928
|
-
| [
|
|
4929
|
-
| [
|
|
4930
|
-
| [
|
|
4931
|
-
| [
|
|
4932
|
-
| [
|
|
4933
|
-
| [
|
|
4934
|
-
| [
|
|
5096
|
+
| [internalizeAction](#function-internalizeaction) | [parseJsonRpc](#function-parsejsonrpc) | [upgradeUsers](#function-upgradeusers) |
|
|
5097
|
+
| [isAutoSpendableChangeOutput](#function-isautospendablechangeoutput) | [partitionActionLabels](#function-partitionactionlabels) | [validateDate](#function-validatedate) |
|
|
5098
|
+
| [isManagedChangeOutput](#function-ismanagedchangeoutput) | [processAction](#function-processaction) | [validateEntities](#function-validateentities) |
|
|
5099
|
+
| [keyOffsetToHashedSecret](#function-keyoffsettohashedsecret) | [purgeData](#function-purgedata) | [validateEntity](#function-validateentity) |
|
|
5100
|
+
| [legacyBinaryJsonReplacer](#function-legacybinaryjsonreplacer) | [purgeDataIdb](#function-purgedataidb) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
|
|
5101
|
+
| [listActions](#function-listactions) | [redeemServiceCharges](#function-redeemservicecharges) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
|
|
5102
|
+
| [listActionsIdb](#function-listactionsidb) | [renderAdminPage](#function-renderadminpage) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
|
|
5103
|
+
| [listCertificates](#function-listcertificates) | [restoreInputsToSpendable](#function-restoreinputstospendable) | [validateSyncChunkEntities](#function-validatesyncchunkentities) |
|
|
5104
|
+
| [listOutputs](#function-listoutputs) | [reviewStatus](#function-reviewstatus) | [varUintSize](#function-varuintsize) |
|
|
5105
|
+
| [listOutputsIdb](#function-listoutputsidb) | [reviewStatusIdb](#function-reviewstatusidb) | |
|
|
5106
|
+
| [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | |
|
|
4935
5107
|
|
|
4936
5108
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4937
5109
|
|
|
@@ -4950,6 +5122,24 @@ See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq), [PostReqsTo
|
|
|
4950
5122
|
|
|
4951
5123
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4952
5124
|
|
|
5125
|
+
---
|
|
5126
|
+
##### Function: binaryJsonReplacer
|
|
5127
|
+
|
|
5128
|
+
```ts
|
|
5129
|
+
export function binaryJsonReplacer(this: Record<string, unknown>, key: string, value: unknown): unknown
|
|
5130
|
+
```
|
|
5131
|
+
|
|
5132
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5133
|
+
|
|
5134
|
+
---
|
|
5135
|
+
##### Function: binaryJsonReviver
|
|
5136
|
+
|
|
5137
|
+
```ts
|
|
5138
|
+
export function binaryJsonReviver(_key: string, value: unknown): unknown
|
|
5139
|
+
```
|
|
5140
|
+
|
|
5141
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5142
|
+
|
|
4953
5143
|
---
|
|
4954
5144
|
##### Function: classifyReqStatus
|
|
4955
5145
|
|
|
@@ -5007,6 +5197,15 @@ export function dateMatches(a: Date | undefined, b: Date | undefined): boolean
|
|
|
5007
5197
|
|
|
5008
5198
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5009
5199
|
|
|
5200
|
+
---
|
|
5201
|
+
##### Function: decodeBinaryJsonValue
|
|
5202
|
+
|
|
5203
|
+
```ts
|
|
5204
|
+
export function decodeBinaryJsonValue(value: unknown): unknown
|
|
5205
|
+
```
|
|
5206
|
+
|
|
5207
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5208
|
+
|
|
5010
5209
|
---
|
|
5011
5210
|
##### Function: decryptBRC39
|
|
5012
5211
|
|
|
@@ -5225,12 +5424,14 @@ When the transaction already exists, the description is updated. The isOutgoing
|
|
|
5225
5424
|
|
|
5226
5425
|
"basket insertion" Merge Rules:
|
|
5227
5426
|
1. The "default" basket may not be specified as the insertion basket.
|
|
5228
|
-
2.
|
|
5229
|
-
3.
|
|
5427
|
+
2. Managed change may not be reclassified as a basket insertion.
|
|
5428
|
+
3. Basket insertions do not affect wallet balance and are typed "custom".
|
|
5230
5429
|
|
|
5231
5430
|
"wallet payment" Merge Rules:
|
|
5232
|
-
1.
|
|
5233
|
-
2.
|
|
5431
|
+
1. Targeting an existing managed output is idempotent.
|
|
5432
|
+
2. Targeting an existing custom output converts it to managed BRC-29
|
|
5433
|
+
change and increases wallet balance. This includes verified recovery of
|
|
5434
|
+
a legacy custom row that was incorrectly placed in the default basket.
|
|
5234
5435
|
|
|
5235
5436
|
```ts
|
|
5236
5437
|
export async function internalizeAction(storage: StorageProvider, auth: AuthId, args: InternalizeActionArgs): Promise<StorageInternalizeActionResult>
|
|
@@ -5240,6 +5441,35 @@ See also: [AuthId](./client.md#interface-authid), [StorageInternalizeActionResul
|
|
|
5240
5441
|
|
|
5241
5442
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5242
5443
|
|
|
5444
|
+
---
|
|
5445
|
+
##### Function: isAutoSpendableChangeOutput
|
|
5446
|
+
|
|
5447
|
+
True when managed change is currently eligible for automatic allocation.
|
|
5448
|
+
|
|
5449
|
+
```ts
|
|
5450
|
+
export function isAutoSpendableChangeOutput(output: TableOutput | undefined): output is TableOutput
|
|
5451
|
+
```
|
|
5452
|
+
|
|
5453
|
+
See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
5454
|
+
|
|
5455
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5456
|
+
|
|
5457
|
+
---
|
|
5458
|
+
##### Function: isManagedChangeOutput
|
|
5459
|
+
|
|
5460
|
+
True when an output has all metadata required to use the wallet-managed
|
|
5461
|
+
BRC-29 signing path. `senderIdentityKey` is optional: wallet-created change
|
|
5462
|
+
uses the client's change public key when it is absent, while received
|
|
5463
|
+
BRC-29 payments record the sender's identity key.
|
|
5464
|
+
|
|
5465
|
+
```ts
|
|
5466
|
+
export function isManagedChangeOutput(output: TableOutput | undefined): output is TableOutput
|
|
5467
|
+
```
|
|
5468
|
+
|
|
5469
|
+
See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
5470
|
+
|
|
5471
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5472
|
+
|
|
5243
5473
|
---
|
|
5244
5474
|
##### Function: keyOffsetToHashedSecret
|
|
5245
5475
|
|
|
@@ -5252,6 +5482,15 @@ export function keyOffsetToHashedSecret(pub: PublicKey, keyOffset?: string): {
|
|
|
5252
5482
|
|
|
5253
5483
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5254
5484
|
|
|
5485
|
+
---
|
|
5486
|
+
##### Function: legacyBinaryJsonReplacer
|
|
5487
|
+
|
|
5488
|
+
```ts
|
|
5489
|
+
export function legacyBinaryJsonReplacer(_key: string, value: unknown): unknown
|
|
5490
|
+
```
|
|
5491
|
+
|
|
5492
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5493
|
+
|
|
5255
5494
|
---
|
|
5256
5495
|
##### Function: listActions
|
|
5257
5496
|
|
|
@@ -5574,14 +5813,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5574
5813
|
Notify each transaction that a proof has been found.
|
|
5575
5814
|
Mutates `req` history notes in place.
|
|
5576
5815
|
|
|
5577
|
-
The `addNote`
|
|
5578
|
-
|
|
5816
|
+
The `addNote` callback avoids coupling this helper to a specific entity type.
|
|
5817
|
+
Returns false if any transaction update failed so callers can retain the
|
|
5818
|
+
request for later status repair.
|
|
5579
5819
|
|
|
5580
5820
|
```ts
|
|
5581
|
-
export async function notifyTransactionsOfProof(ids: number[], provenTxId: number, addNote: (note: ReqHistoryNote) => void,
|
|
5821
|
+
export async function notifyTransactionsOfProof(ids: number[], provenTxId: number, addNote: (note: ReqHistoryNote) => void, updateTransaction: (id: number, update: {
|
|
5582
5822
|
provenTxId: number;
|
|
5583
5823
|
status: "completed";
|
|
5584
|
-
}) => Promise<unknown>): Promise<
|
|
5824
|
+
}) => Promise<unknown>): Promise<boolean>
|
|
5585
5825
|
```
|
|
5586
5826
|
|
|
5587
5827
|
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
@@ -5623,6 +5863,15 @@ See also: [BRC38WalletData](./storage.md#interface-brc38walletdata)
|
|
|
5623
5863
|
|
|
5624
5864
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5625
5865
|
|
|
5866
|
+
---
|
|
5867
|
+
##### Function: parseJsonRpc
|
|
5868
|
+
|
|
5869
|
+
```ts
|
|
5870
|
+
export function parseJsonRpc(text: string, binary: boolean = false): any
|
|
5871
|
+
```
|
|
5872
|
+
|
|
5873
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5874
|
+
|
|
5626
5875
|
---
|
|
5627
5876
|
##### Function: partitionActionLabels
|
|
5628
5877
|
|
|
@@ -5770,6 +6019,26 @@ See also: [GetReqsAndBeefResult](./storage.md#interface-getreqsandbeefresult), [
|
|
|
5770
6019
|
|
|
5771
6020
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5772
6021
|
|
|
6022
|
+
---
|
|
6023
|
+
##### Function: stringifyJsonRpc
|
|
6024
|
+
|
|
6025
|
+
```ts
|
|
6026
|
+
export function stringifyJsonRpc(value: unknown, binary: boolean): string
|
|
6027
|
+
```
|
|
6028
|
+
|
|
6029
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6030
|
+
|
|
6031
|
+
---
|
|
6032
|
+
##### Function: tableAuthSessionToPeerSession
|
|
6033
|
+
|
|
6034
|
+
```ts
|
|
6035
|
+
export function tableAuthSessionToPeerSession(row: TableAuthSession): PeerSession
|
|
6036
|
+
```
|
|
6037
|
+
|
|
6038
|
+
See also: [TableAuthSession](./storage.md#interface-tableauthsession)
|
|
6039
|
+
|
|
6040
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6041
|
+
|
|
5773
6042
|
---
|
|
5774
6043
|
##### Function: transactionInputSize
|
|
5775
6044
|
|
|
@@ -6215,18 +6484,83 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6215
6484
|
---
|
|
6216
6485
|
#### Variables
|
|
6217
6486
|
|
|
6218
|
-
| |
|
|
6219
|
-
| --- |
|
|
6220
|
-
| [getLabelToSpecOp](#variable-getlabeltospecop) |
|
|
6221
|
-
| [
|
|
6222
|
-
| [
|
|
6223
|
-
| [
|
|
6224
|
-
| [
|
|
6487
|
+
| | |
|
|
6488
|
+
| --- | --- |
|
|
6489
|
+
| [AUTH_SESSION_MIGRATION](#variable-auth_session_migration) | [getLabelToSpecOp](#variable-getlabeltospecop) |
|
|
6490
|
+
| [AUTH_SESSION_TABLE](#variable-auth_session_table) | [managedChangeOutputFields](#variable-managedchangeoutputfields) |
|
|
6491
|
+
| [BINARY_ENCODING](#variable-binary_encoding) | [maxChangeOutputsPerTransaction](#variable-maxchangeoutputspertransaction) |
|
|
6492
|
+
| [BINARY_ENCODING_HEADER](#variable-binary_encoding_header) | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) |
|
|
6493
|
+
| [BINARY_REQUEST_ENCODING_HEADER](#variable-binary_request_encoding_header) | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) |
|
|
6494
|
+
| [DEFAULT_AUTH_SESSION_TTL_MS](#variable-default_auth_session_ttl_ms) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
|
|
6495
|
+
| [MONITOR_CREATED_AT_INDEX_MIGRATION](#variable-monitor_created_at_index_migration) | |
|
|
6225
6496
|
|
|
6226
6497
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6227
6498
|
|
|
6228
6499
|
---
|
|
6229
6500
|
|
|
6501
|
+
##### Variable: AUTH_SESSION_MIGRATION
|
|
6502
|
+
|
|
6503
|
+
```ts
|
|
6504
|
+
AUTH_SESSION_MIGRATION = "2026-07-14-001 add shared auth sessions"
|
|
6505
|
+
```
|
|
6506
|
+
|
|
6507
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6508
|
+
|
|
6509
|
+
---
|
|
6510
|
+
##### Variable: AUTH_SESSION_TABLE
|
|
6511
|
+
|
|
6512
|
+
```ts
|
|
6513
|
+
AUTH_SESSION_TABLE = "auth_sessions"
|
|
6514
|
+
```
|
|
6515
|
+
|
|
6516
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6517
|
+
|
|
6518
|
+
---
|
|
6519
|
+
##### Variable: BINARY_ENCODING
|
|
6520
|
+
|
|
6521
|
+
```ts
|
|
6522
|
+
BINARY_ENCODING = "base64"
|
|
6523
|
+
```
|
|
6524
|
+
|
|
6525
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6526
|
+
|
|
6527
|
+
---
|
|
6528
|
+
##### Variable: BINARY_ENCODING_HEADER
|
|
6529
|
+
|
|
6530
|
+
```ts
|
|
6531
|
+
BINARY_ENCODING_HEADER = "X-BSV-Binary-Encoding"
|
|
6532
|
+
```
|
|
6533
|
+
|
|
6534
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6535
|
+
|
|
6536
|
+
---
|
|
6537
|
+
##### Variable: BINARY_REQUEST_ENCODING_HEADER
|
|
6538
|
+
|
|
6539
|
+
```ts
|
|
6540
|
+
BINARY_REQUEST_ENCODING_HEADER = "X-BSV-Binary-Request-Encoding"
|
|
6541
|
+
```
|
|
6542
|
+
|
|
6543
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6544
|
+
|
|
6545
|
+
---
|
|
6546
|
+
##### Variable: DEFAULT_AUTH_SESSION_TTL_MS
|
|
6547
|
+
|
|
6548
|
+
```ts
|
|
6549
|
+
DEFAULT_AUTH_SESSION_TTL_MS = 24 * 60 * 60 * 1000
|
|
6550
|
+
```
|
|
6551
|
+
|
|
6552
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6553
|
+
|
|
6554
|
+
---
|
|
6555
|
+
##### Variable: MONITOR_CREATED_AT_INDEX_MIGRATION
|
|
6556
|
+
|
|
6557
|
+
```ts
|
|
6558
|
+
MONITOR_CREATED_AT_INDEX_MIGRATION = "2026-07-14-002 add monitor created index"
|
|
6559
|
+
```
|
|
6560
|
+
|
|
6561
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6562
|
+
|
|
6563
|
+
---
|
|
6230
6564
|
##### Variable: getLabelToSpecOp
|
|
6231
6565
|
|
|
6232
6566
|
```ts
|
|
@@ -6292,6 +6626,20 @@ See also: [AuthId](./client.md#interface-authid), [ListActionsSpecOp](./storage.
|
|
|
6292
6626
|
|
|
6293
6627
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6294
6628
|
|
|
6629
|
+
---
|
|
6630
|
+
##### Variable: managedChangeOutputFields
|
|
6631
|
+
|
|
6632
|
+
```ts
|
|
6633
|
+
managedChangeOutputFields = {
|
|
6634
|
+
type: "P2PKH",
|
|
6635
|
+
change: true,
|
|
6636
|
+
providedBy: "storage",
|
|
6637
|
+
purpose: "change"
|
|
6638
|
+
} as const
|
|
6639
|
+
```
|
|
6640
|
+
|
|
6641
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6642
|
+
|
|
6295
6643
|
---
|
|
6296
6644
|
##### Variable: maxChangeOutputsPerTransaction
|
|
6297
6645
|
|
|
@@ -6369,4 +6717,4 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6369
6717
|
|
|
6370
6718
|
---
|
|
6371
6719
|
|
|
6372
|
-
<!--#endregion ts2md-api-merged-here-->
|
|
6720
|
+
<!--#endregion ts2md-api-merged-here-->
|