@bsv/wallet-toolbox 1.6.2 → 1.6.4

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 (85) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/docs/client.md +315 -2500
  3. package/docs/services.md +15 -4
  4. package/docs/wallet.md +315 -2500
  5. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.d.ts.map +1 -1
  6. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js +1 -2
  7. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js.map +1 -1
  8. package/mobile/out/src/services/chaintracker/chaintracks/index.client.d.ts +0 -3
  9. package/mobile/out/src/services/chaintracker/chaintracks/index.client.d.ts.map +1 -1
  10. package/mobile/out/src/services/chaintracker/chaintracks/index.client.js +0 -3
  11. package/mobile/out/src/services/chaintracker/chaintracks/index.client.js.map +1 -1
  12. package/mobile/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts.map +1 -1
  13. package/mobile/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +2 -3
  14. package/mobile/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js.map +1 -1
  15. package/mobile/package-lock.json +2 -2
  16. package/mobile/package.json +1 -1
  17. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.d.ts.map +1 -1
  18. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js +1 -2
  19. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js.map +1 -1
  20. package/out/src/services/chaintracker/chaintracks/index.all.d.ts +3 -0
  21. package/out/src/services/chaintracker/chaintracks/index.all.d.ts.map +1 -1
  22. package/out/src/services/chaintracker/chaintracks/index.all.js +3 -0
  23. package/out/src/services/chaintracker/chaintracks/index.all.js.map +1 -1
  24. package/out/src/services/chaintracker/chaintracks/index.client.d.ts +0 -3
  25. package/out/src/services/chaintracker/chaintracks/index.client.d.ts.map +1 -1
  26. package/out/src/services/chaintracker/chaintracks/index.client.js +0 -3
  27. package/out/src/services/chaintracker/chaintracks/index.client.js.map +1 -1
  28. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts.map +1 -1
  29. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +2 -3
  30. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js.map +1 -1
  31. package/out/src/storage/__test/getBeefForTransaction.test.js.map +1 -1
  32. package/out/test/storage/idb/update.test.js +1 -1
  33. package/out/test/storage/idb/update.test.js.map +1 -1
  34. package/out/tsconfig.all.tsbuildinfo +1 -1
  35. package/package.json +1 -1
  36. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.ts +1 -2
  37. package/src/services/chaintracker/chaintracks/index.all.ts +4 -0
  38. package/src/services/chaintracker/chaintracks/index.client.ts +0 -3
  39. package/src/services/chaintracker/chaintracks/util/BulkFileDataManager.ts +2 -3
  40. package/src/storage/__test/getBeefForTransaction.test.ts +2 -5
  41. package/test/storage/idb/update.test.ts +1 -1
  42. package/mobile/out/src/Setup.d.ts +0 -267
  43. package/mobile/out/src/Setup.d.ts.map +0 -1
  44. package/mobile/out/src/Setup.js +0 -408
  45. package/mobile/out/src/Setup.js.map +0 -1
  46. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts +0 -30
  47. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts.map +0 -1
  48. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksService.js +0 -149
  49. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksService.js.map +0 -1
  50. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.d.ts +0 -23
  51. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.d.ts.map +0 -1
  52. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.js +0 -57
  53. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.js.map +0 -1
  54. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.d.ts +0 -16
  55. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.d.ts.map +0 -1
  56. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.js +0 -53
  57. package/mobile/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.js.map +0 -1
  58. package/mobile/out/src/storage/StorageKnex.d.ts +0 -179
  59. package/mobile/out/src/storage/StorageKnex.d.ts.map +0 -1
  60. package/mobile/out/src/storage/StorageKnex.js +0 -1215
  61. package/mobile/out/src/storage/StorageKnex.js.map +0 -1
  62. package/mobile/out/src/storage/methods/listActionsKnex.d.ts +0 -6
  63. package/mobile/out/src/storage/methods/listActionsKnex.d.ts.map +0 -1
  64. package/mobile/out/src/storage/methods/listActionsKnex.js +0 -198
  65. package/mobile/out/src/storage/methods/listActionsKnex.js.map +0 -1
  66. package/mobile/out/src/storage/methods/listOutputsKnex.d.ts +0 -6
  67. package/mobile/out/src/storage/methods/listOutputsKnex.d.ts.map +0 -1
  68. package/mobile/out/src/storage/methods/listOutputsKnex.js +0 -241
  69. package/mobile/out/src/storage/methods/listOutputsKnex.js.map +0 -1
  70. package/mobile/out/src/storage/methods/purgeData.d.ts +0 -4
  71. package/mobile/out/src/storage/methods/purgeData.d.ts.map +0 -1
  72. package/mobile/out/src/storage/methods/purgeData.js +0 -207
  73. package/mobile/out/src/storage/methods/purgeData.js.map +0 -1
  74. package/mobile/out/src/storage/methods/reviewStatus.d.ts +0 -20
  75. package/mobile/out/src/storage/methods/reviewStatus.d.ts.map +0 -1
  76. package/mobile/out/src/storage/methods/reviewStatus.js +0 -84
  77. package/mobile/out/src/storage/methods/reviewStatus.js.map +0 -1
  78. package/mobile/out/src/storage/schema/KnexMigrations.d.ts +0 -39
  79. package/mobile/out/src/storage/schema/KnexMigrations.d.ts.map +0 -1
  80. package/mobile/out/src/storage/schema/KnexMigrations.js +0 -410
  81. package/mobile/out/src/storage/schema/KnexMigrations.js.map +0 -1
  82. package/mobile/out/test/utils/TestUtilsWalletStorage.d.ts +0 -522
  83. package/mobile/out/test/utils/TestUtilsWalletStorage.d.ts.map +0 -1
  84. package/mobile/out/test/utils/TestUtilsWalletStorage.js +0 -1956
  85. package/mobile/out/test/utils/TestUtilsWalletStorage.js.map +0 -1
package/docs/wallet.md CHANGED
@@ -13,91 +13,86 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
13
13
 
14
14
  | | | |
15
15
  | --- | --- | --- |
16
- | [AdminStatsResult](#interface-adminstatsresult) | [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [SyncError](#interface-syncerror) |
17
- | [ArcConfig](#interface-arcconfig) | [GetUtxoStatusResult](#interface-getutxostatusresult) | [SyncMap](#interface-syncmap) |
18
- | [ArcMinerGetTxData](#interface-arcminergettxdata) | [GroupedPermissionRequest](#interface-groupedpermissionrequest) | [TableCertificate](#interface-tablecertificate) |
19
- | [AuthId](#interface-authid) | [GroupedPermissions](#interface-groupedpermissions) | [TableCertificateField](#interface-tablecertificatefield) |
20
- | [AuthPayload](#interface-authpayload) | [HeightRangeApi](#interface-heightrangeapi) | [TableCertificateX](#interface-tablecertificatex) |
21
- | [BaseBlockHeader](#interface-baseblockheader) | [HeightRanges](#interface-heightranges) | [TableCommission](#interface-tablecommission) |
22
- | [BitailsConfig](#interface-bitailsconfig) | [KeyPair](#interface-keypair) | [TableMonitorEvent](#interface-tablemonitorevent) |
23
- | [BitailsMerkleProof](#interface-bitailsmerkleproof) | [KeyPairAddress](#interface-keypairaddress) | [TableOutput](#interface-tableoutput) |
24
- | [BlockHeader](#interface-blockheader) | [ListActionsSpecOp](#interface-listactionsspecop) | [TableOutputBasket](#interface-tableoutputbasket) |
25
- | [BsvExchangeRate](#interface-bsvexchangerate) | [ListOutputsSpecOp](#interface-listoutputsspecop) | [TableOutputTag](#interface-tableoutputtag) |
26
- | [BulkFileDataManagerMergeResult](#interface-bulkfiledatamanagermergeresult) | [LiveBlockHeader](#interface-liveblockheader) | [TableOutputTagMap](#interface-tableoutputtagmap) |
27
- | [BulkFileDataManagerOptions](#interface-bulkfiledatamanageroptions) | [LiveIngestorApi](#interface-liveingestorapi) | [TableOutputX](#interface-tableoutputx) |
28
- | [BulkHeaderFileInfo](#interface-bulkheaderfileinfo) | [LiveIngestorBaseOptions](#interface-liveingestorbaseoptions) | [TableProvenTx](#interface-tableproventx) |
29
- | [BulkHeaderFilesInfo](#interface-bulkheaderfilesinfo) | [LiveIngestorWhatsOnChainOptions](#interface-liveingestorwhatsonchainoptions) | [TableProvenTxReq](#interface-tableproventxreq) |
30
- | [BulkIngestorApi](#interface-bulkingestorapi) | [MockData](#interface-mockdata) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
31
- | [BulkIngestorBaseOptions](#interface-bulkingestorbaseoptions) | [MonitorOptions](#interface-monitoroptions) | [TableSettings](#interface-tablesettings) |
32
- | [BulkIngestorCDNOptions](#interface-bulkingestorcdnoptions) | [OutPoint](#interface-outpoint) | [TableSyncState](#interface-tablesyncstate) |
33
- | [BulkIngestorWhatsOnChainOptions](#interface-bulkingestorwhatsonchainoptions) | [Paged](#interface-paged) | [TableTransaction](#interface-tabletransaction) |
34
- | [BulkStorageApi](#interface-bulkstorageapi) | [PendingSignAction](#interface-pendingsignaction) | [TableTxLabel](#interface-tabletxlabel) |
35
- | [BulkStorageBaseOptions](#interface-bulkstoragebaseoptions) | [PendingStorageInput](#interface-pendingstorageinput) | [TableTxLabelMap](#interface-tabletxlabelmap) |
36
- | [BulkSyncResult](#interface-bulksyncresult) | [PermissionRequest](#interface-permissionrequest) | [TableUser](#interface-tableuser) |
37
- | [CertOpsWallet](#interface-certopswallet) | [PermissionToken](#interface-permissiontoken) | [TaskPurgeParams](#interface-taskpurgeparams) |
38
- | [Certifier](#interface-certifier) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TestSetup1](#interface-testsetup1) |
39
- | [ChaintracksApi](#interface-chaintracksapi) | [PostBeefResult](#interface-postbeefresult) | [TestSetup2](#interface-testsetup2) |
40
- | [ChaintracksAppendableFileApi](#interface-chaintracksappendablefileapi) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TestWallet](#interface-testwallet) |
41
- | [ChaintracksChainTrackerOptions](#interface-chaintrackschaintrackeroptions) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TestWalletOnly](#interface-testwalletonly) |
42
- | [ChaintracksClientApi](#interface-chaintracksclientapi) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TestWalletProvider](#interface-testwalletprovider) |
43
- | [ChaintracksFetchApi](#interface-chaintracksfetchapi) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TrustSettings](#interface-trustsettings) |
44
- | [ChaintracksFsApi](#interface-chaintracksfsapi) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [TrxToken](#interface-trxtoken) |
45
- | [ChaintracksInfoApi](#interface-chaintracksinfoapi) | [PostTxsResult](#interface-posttxsresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
46
- | [ChaintracksManagementApi](#interface-chaintracksmanagementapi) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [TuEnv](#interface-tuenv) |
47
- | [ChaintracksOptions](#interface-chaintracksoptions) | [Profile](#interface-profile) | [TuEnvFlags](#interface-tuenvflags) |
48
- | [ChaintracksPackageInfoApi](#interface-chaintrackspackageinfoapi) | [ProvenOrRawTx](#interface-provenorrawtx) | [TxScriptOffsets](#interface-txscriptoffsets) |
49
- | [ChaintracksReadableFileApi](#interface-chaintracksreadablefileapi) | [ProvenTransactionStatus](#interface-proventransactionstatus) | [UMPToken](#interface-umptoken) |
50
- | [ChaintracksServiceClientOptions](#interface-chaintracksserviceclientoptions) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [UMPTokenInteractor](#interface-umptokeninteractor) |
51
- | [ChaintracksServiceOptions](#interface-chaintracksserviceoptions) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
52
- | [ChaintracksStorageApi](#interface-chaintracksstorageapi) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
53
- | [ChaintracksStorageBaseOptions](#interface-chaintracksstoragebaseoptions) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [ValidAbortActionArgs](#interface-validabortactionargs) |
54
- | [ChaintracksStorageBulkFileApi](#interface-chaintracksstoragebulkfileapi) | [ProviderCallHistory](#interface-providercallhistory) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
55
- | [ChaintracksStorageIngestApi](#interface-chaintracksstorageingestapi) | [PurgeParams](#interface-purgeparams) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
56
- | [ChaintracksStorageNoDbOptions](#interface-chaintracksstoragenodboptions) | [PurgeResults](#interface-purgeresults) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
57
- | [ChaintracksStorageQueryApi](#interface-chaintracksstoragequeryapi) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidBasketInsertion](#interface-validbasketinsertion) |
58
- | [ChaintracksWritableFileApi](#interface-chaintrackswritablefileapi) | [ReviewActionResult](#interface-reviewactionresult) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
59
- | [CommitNewTxResults](#interface-commitnewtxresults) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidCreateActionInput](#interface-validcreateactioninput) |
60
- | [CompleteAuthResponse](#interface-completeauthresponse) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
61
- | [CreateActionResultX](#interface-createactionresultx) | [ServiceCall](#interface-servicecall) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
62
- | [CreateTestWalletArgs](#interface-createtestwalletargs) | [ServiceCall](#interface-servicecall) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
63
- | [EntitySyncMap](#interface-entitysyncmap) | [ServiceCallHistory](#interface-servicecallhistory) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
64
- | [EntityTimeStamp](#interface-entitytimestamp) | [ServiceCallHistoryCounts](#interface-servicecallhistorycounts) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
65
- | [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ServiceToCall](#interface-servicetocall) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
66
- | [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [SetupClientWalletArgs](#interface-setupclientwalletargs) | [ValidListActionsArgs](#interface-validlistactionsargs) |
67
- | [FiatExchangeRates](#interface-fiatexchangerates) | [SetupClientWalletClientArgs](#interface-setupclientwalletclientargs) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
68
- | [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [SetupEnv](#interface-setupenv) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
69
- | [FindCertificatesArgs](#interface-findcertificatesargs) | [SetupWallet](#interface-setupwallet) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
70
- | [FindCommissionsArgs](#interface-findcommissionsargs) | [SetupWalletArgs](#interface-setupwalletargs) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
71
- | [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [SetupWalletClient](#interface-setupwalletclient) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
72
- | [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [SetupWalletClientArgs](#interface-setupwalletclientargs) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
73
- | [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [SetupWalletIdb](#interface-setupwalletidb) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
74
- | [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [SetupWalletIdbArgs](#interface-setupwalletidbargs) | [ValidSignActionArgs](#interface-validsignactionargs) |
75
- | [FindOutputTagsArgs](#interface-findoutputtagsargs) | [SetupWalletKnex](#interface-setupwalletknex) | [ValidSignActionOptions](#interface-validsignactionoptions) |
76
- | [FindOutputsArgs](#interface-findoutputsargs) | [SetupWalletKnexArgs](#interface-setupwalletknexargs) | [ValidWalletPayment](#interface-validwalletpayment) |
77
- | [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [SetupWalletMySQLArgs](#interface-setupwalletmysqlargs) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
78
- | [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [SetupWalletSQLiteArgs](#interface-setupwalletsqliteargs) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
79
- | [FindProvenTxsArgs](#interface-findproventxsargs) | [SignActionResultX](#interface-signactionresultx) | [WalletArgs](#interface-walletargs) |
80
- | [FindSincePagedArgs](#interface-findsincepagedargs) | [StartAuthResponse](#interface-startauthresponse) | [WalletBalance](#interface-walletbalance) |
81
- | [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StatusForTxidResult](#interface-statusfortxidresult) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
82
- | [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageAdminStats](#interface-storageadminstats) | [WalletServices](#interface-walletservices) |
83
- | [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [WalletServicesOptions](#interface-walletservicesoptions) |
84
- | [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [WalletSettings](#interface-walletsettings) |
85
- | [FindUsersArgs](#interface-findusersargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
86
- | [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageFeeModel](#interface-storagefeemodel) | [WalletSigner](#interface-walletsigner) |
87
- | [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [WalletStorage](#interface-walletstorage) |
88
- | [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageIdbOptions](#interface-storageidboptions) | [WalletStorageInfo](#interface-walletstorageinfo) |
89
- | [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageIdbSchema](#interface-storageidbschema) | [WalletStorageProvider](#interface-walletstorageprovider) |
90
- | [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [StorageIdentity](#interface-storageidentity) | [WalletStorageReader](#interface-walletstoragereader) |
91
- | [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [WalletStorageSync](#interface-walletstoragesync) |
92
- | [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StorageKnexOptions](#interface-storageknexoptions) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
93
- | [GetHeaderByteFileLinksResult](#interface-getheaderbytefilelinksresult) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [WalletStorageWriter](#interface-walletstoragewriter) |
94
- | [GetMerklePathResult](#interface-getmerklepathresult) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [WalletTheme](#interface-wallettheme) |
95
- | [GetRawTxResult](#interface-getrawtxresult) | [StorageProvenOrReq](#interface-storageprovenorreq) | [WhatsOnChainServicesOptions](#interface-whatsonchainservicesoptions) |
96
- | [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [StorageProviderOptions](#interface-storageprovideroptions) | [WocChainInfo](#interface-wocchaininfo) |
97
- | [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [StorageReaderOptions](#interface-storagereaderoptions) | [WocGetHeaderByteFileLinks](#interface-wocgetheaderbytefilelinks) |
98
- | [GetScriptHashHistory](#interface-getscripthashhistory) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [WocGetHeadersHeader](#interface-wocgetheadersheader) |
99
- | [GetScriptHashHistoryResult](#interface-getscripthashhistoryresult) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [WocHeader](#interface-wocheader) |
100
- | [GetStatusForTxidsResult](#interface-getstatusfortxidsresult) | [SyncChunk](#interface-syncchunk) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
16
+ | [AdminStatsResult](#interface-adminstatsresult) | [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [SyncError](#interface-syncerror) |
17
+ | [ArcConfig](#interface-arcconfig) | [GetScriptHashHistory](#interface-getscripthashhistory) | [SyncMap](#interface-syncmap) |
18
+ | [ArcMinerGetTxData](#interface-arcminergettxdata) | [GetScriptHashHistoryResult](#interface-getscripthashhistoryresult) | [TableCertificate](#interface-tablecertificate) |
19
+ | [AuthId](#interface-authid) | [GetStatusForTxidsResult](#interface-getstatusfortxidsresult) | [TableCertificateField](#interface-tablecertificatefield) |
20
+ | [AuthPayload](#interface-authpayload) | [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TableCertificateX](#interface-tablecertificatex) |
21
+ | [BaseBlockHeader](#interface-baseblockheader) | [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableCommission](#interface-tablecommission) |
22
+ | [BitailsConfig](#interface-bitailsconfig) | [GroupedPermissionRequest](#interface-groupedpermissionrequest) | [TableMonitorEvent](#interface-tablemonitorevent) |
23
+ | [BitailsMerkleProof](#interface-bitailsmerkleproof) | [GroupedPermissions](#interface-groupedpermissions) | [TableOutput](#interface-tableoutput) |
24
+ | [BlockHeader](#interface-blockheader) | [HeightRangeApi](#interface-heightrangeapi) | [TableOutputBasket](#interface-tableoutputbasket) |
25
+ | [BsvExchangeRate](#interface-bsvexchangerate) | [HeightRanges](#interface-heightranges) | [TableOutputTag](#interface-tableoutputtag) |
26
+ | [BulkFileDataManagerMergeResult](#interface-bulkfiledatamanagermergeresult) | [KeyPair](#interface-keypair) | [TableOutputTagMap](#interface-tableoutputtagmap) |
27
+ | [BulkFileDataManagerOptions](#interface-bulkfiledatamanageroptions) | [KeyPairAddress](#interface-keypairaddress) | [TableOutputX](#interface-tableoutputx) |
28
+ | [BulkHeaderFileInfo](#interface-bulkheaderfileinfo) | [ListActionsSpecOp](#interface-listactionsspecop) | [TableProvenTx](#interface-tableproventx) |
29
+ | [BulkHeaderFilesInfo](#interface-bulkheaderfilesinfo) | [ListOutputsSpecOp](#interface-listoutputsspecop) | [TableProvenTxReq](#interface-tableproventxreq) |
30
+ | [BulkIngestorApi](#interface-bulkingestorapi) | [LiveBlockHeader](#interface-liveblockheader) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
31
+ | [BulkIngestorBaseOptions](#interface-bulkingestorbaseoptions) | [LiveIngestorApi](#interface-liveingestorapi) | [TableSettings](#interface-tablesettings) |
32
+ | [BulkIngestorCDNOptions](#interface-bulkingestorcdnoptions) | [LiveIngestorBaseOptions](#interface-liveingestorbaseoptions) | [TableSyncState](#interface-tablesyncstate) |
33
+ | [BulkIngestorWhatsOnChainOptions](#interface-bulkingestorwhatsonchainoptions) | [LiveIngestorWhatsOnChainOptions](#interface-liveingestorwhatsonchainoptions) | [TableTransaction](#interface-tabletransaction) |
34
+ | [BulkStorageApi](#interface-bulkstorageapi) | [MonitorOptions](#interface-monitoroptions) | [TableTxLabel](#interface-tabletxlabel) |
35
+ | [BulkStorageBaseOptions](#interface-bulkstoragebaseoptions) | [OutPoint](#interface-outpoint) | [TableTxLabelMap](#interface-tabletxlabelmap) |
36
+ | [BulkSyncResult](#interface-bulksyncresult) | [Paged](#interface-paged) | [TableUser](#interface-tableuser) |
37
+ | [CertOpsWallet](#interface-certopswallet) | [PendingSignAction](#interface-pendingsignaction) | [TaskPurgeParams](#interface-taskpurgeparams) |
38
+ | [Certifier](#interface-certifier) | [PendingStorageInput](#interface-pendingstorageinput) | [TrustSettings](#interface-trustsettings) |
39
+ | [ChaintracksApi](#interface-chaintracksapi) | [PermissionRequest](#interface-permissionrequest) | [TrxToken](#interface-trxtoken) |
40
+ | [ChaintracksAppendableFileApi](#interface-chaintracksappendablefileapi) | [PermissionToken](#interface-permissiontoken) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
41
+ | [ChaintracksChainTrackerOptions](#interface-chaintrackschaintrackeroptions) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TxScriptOffsets](#interface-txscriptoffsets) |
42
+ | [ChaintracksClientApi](#interface-chaintracksclientapi) | [PostBeefResult](#interface-postbeefresult) | [UMPToken](#interface-umptoken) |
43
+ | [ChaintracksFetchApi](#interface-chaintracksfetchapi) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [UMPTokenInteractor](#interface-umptokeninteractor) |
44
+ | [ChaintracksFsApi](#interface-chaintracksfsapi) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
45
+ | [ChaintracksInfoApi](#interface-chaintracksinfoapi) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
46
+ | [ChaintracksManagementApi](#interface-chaintracksmanagementapi) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [ValidAbortActionArgs](#interface-validabortactionargs) |
47
+ | [ChaintracksOptions](#interface-chaintracksoptions) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
48
+ | [ChaintracksPackageInfoApi](#interface-chaintrackspackageinfoapi) | [PostTxsResult](#interface-posttxsresult) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
49
+ | [ChaintracksReadableFileApi](#interface-chaintracksreadablefileapi) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
50
+ | [ChaintracksServiceClientOptions](#interface-chaintracksserviceclientoptions) | [Profile](#interface-profile) | [ValidBasketInsertion](#interface-validbasketinsertion) |
51
+ | [ChaintracksServiceOptions](#interface-chaintracksserviceoptions) | [ProvenOrRawTx](#interface-provenorrawtx) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
52
+ | [ChaintracksStorageApi](#interface-chaintracksstorageapi) | [ProvenTransactionStatus](#interface-proventransactionstatus) | [ValidCreateActionInput](#interface-validcreateactioninput) |
53
+ | [ChaintracksStorageBaseOptions](#interface-chaintracksstoragebaseoptions) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
54
+ | [ChaintracksStorageBulkFileApi](#interface-chaintracksstoragebulkfileapi) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
55
+ | [ChaintracksStorageIngestApi](#interface-chaintracksstorageingestapi) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
56
+ | [ChaintracksStorageNoDbOptions](#interface-chaintracksstoragenodboptions) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
57
+ | [ChaintracksStorageQueryApi](#interface-chaintracksstoragequeryapi) | [ProviderCallHistory](#interface-providercallhistory) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
58
+ | [ChaintracksWritableFileApi](#interface-chaintrackswritablefileapi) | [PurgeParams](#interface-purgeparams) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
59
+ | [CommitNewTxResults](#interface-commitnewtxresults) | [PurgeResults](#interface-purgeresults) | [ValidListActionsArgs](#interface-validlistactionsargs) |
60
+ | [CompleteAuthResponse](#interface-completeauthresponse) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
61
+ | [CreateActionResultX](#interface-createactionresultx) | [ReviewActionResult](#interface-reviewactionresult) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
62
+ | [EntitySyncMap](#interface-entitysyncmap) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
63
+ | [EntityTimeStamp](#interface-entitytimestamp) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
64
+ | [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ServiceCall](#interface-servicecall) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
65
+ | [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [ServiceCall](#interface-servicecall) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
66
+ | [FiatExchangeRates](#interface-fiatexchangerates) | [ServiceCallHistory](#interface-servicecallhistory) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
67
+ | [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [ServiceCallHistoryCounts](#interface-servicecallhistorycounts) | [ValidSignActionArgs](#interface-validsignactionargs) |
68
+ | [FindCertificatesArgs](#interface-findcertificatesargs) | [ServiceToCall](#interface-servicetocall) | [ValidSignActionOptions](#interface-validsignactionoptions) |
69
+ | [FindCommissionsArgs](#interface-findcommissionsargs) | [SetupClientWalletArgs](#interface-setupclientwalletargs) | [ValidWalletPayment](#interface-validwalletpayment) |
70
+ | [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [SetupClientWalletClientArgs](#interface-setupclientwalletclientargs) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
71
+ | [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [SetupWallet](#interface-setupwallet) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
72
+ | [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [SetupWalletClient](#interface-setupwalletclient) | [WalletArgs](#interface-walletargs) |
73
+ | [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [SetupWalletIdb](#interface-setupwalletidb) | [WalletBalance](#interface-walletbalance) |
74
+ | [FindOutputTagsArgs](#interface-findoutputtagsargs) | [SetupWalletIdbArgs](#interface-setupwalletidbargs) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
75
+ | [FindOutputsArgs](#interface-findoutputsargs) | [SignActionResultX](#interface-signactionresultx) | [WalletServices](#interface-walletservices) |
76
+ | [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StartAuthResponse](#interface-startauthresponse) | [WalletServicesOptions](#interface-walletservicesoptions) |
77
+ | [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StatusForTxidResult](#interface-statusfortxidresult) | [WalletSettings](#interface-walletsettings) |
78
+ | [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageAdminStats](#interface-storageadminstats) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
79
+ | [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [WalletSigner](#interface-walletsigner) |
80
+ | [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [WalletStorage](#interface-walletstorage) |
81
+ | [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [WalletStorageInfo](#interface-walletstorageinfo) |
82
+ | [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageFeeModel](#interface-storagefeemodel) | [WalletStorageProvider](#interface-walletstorageprovider) |
83
+ | [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [WalletStorageReader](#interface-walletstoragereader) |
84
+ | [FindUsersArgs](#interface-findusersargs) | [StorageIdbOptions](#interface-storageidboptions) | [WalletStorageSync](#interface-walletstoragesync) |
85
+ | [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageIdbSchema](#interface-storageidbschema) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
86
+ | [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageIdentity](#interface-storageidentity) | [WalletStorageWriter](#interface-walletstoragewriter) |
87
+ | [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [WalletTheme](#interface-wallettheme) |
88
+ | [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [WhatsOnChainServicesOptions](#interface-whatsonchainservicesoptions) |
89
+ | [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [WocChainInfo](#interface-wocchaininfo) |
90
+ | [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [StorageProvenOrReq](#interface-storageprovenorreq) | [WocGetHeaderByteFileLinks](#interface-wocgetheaderbytefilelinks) |
91
+ | [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StorageProviderOptions](#interface-storageprovideroptions) | [WocGetHeadersHeader](#interface-wocgetheadersheader) |
92
+ | [GetHeaderByteFileLinksResult](#interface-getheaderbytefilelinksresult) | [StorageReaderOptions](#interface-storagereaderoptions) | [WocHeader](#interface-wocheader) |
93
+ | [GetMerklePathResult](#interface-getmerklepathresult) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
94
+ | [GetRawTxResult](#interface-getrawtxresult) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | |
95
+ | [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [SyncChunk](#interface-syncchunk) | |
101
96
 
102
97
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
103
98
 
@@ -2302,24 +2297,6 @@ See also: [ReviewActionResult](./client.md#interface-reviewactionresult)
2302
2297
 
2303
2298
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
2304
2299
 
2305
- ---
2306
- ##### Interface: CreateTestWalletArgs
2307
-
2308
- ```ts
2309
- export interface CreateTestWalletArgs {
2310
- chain: Chain;
2311
- rootKeyHex: string;
2312
- filePath: string;
2313
- addLocalBackup?: boolean;
2314
- setActiveClient?: boolean;
2315
- useMySQLConnectionForClient?: boolean;
2316
- }
2317
- ```
2318
-
2319
- See also: [Chain](./client.md#type-chain)
2320
-
2321
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
2322
-
2323
2300
  ---
2324
2301
  ##### Interface: EntitySyncMap
2325
2302
 
@@ -3551,19 +3528,6 @@ userAgent: string
3551
3528
 
3552
3529
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3553
3530
 
3554
- ---
3555
- ##### Interface: MockData
3556
-
3557
- ```ts
3558
- export interface MockData {
3559
- inputs?: WalletActionInput[];
3560
- outputs?: WalletActionOutput[];
3561
- actions: WalletAction[];
3562
- }
3563
- ```
3564
-
3565
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3566
-
3567
3531
  ---
3568
3532
  ##### Interface: MonitorOptions
3569
3533
 
@@ -5022,89 +4986,6 @@ endpointUrl?: string
5022
4986
 
5023
4987
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5024
4988
 
5025
- ---
5026
- ##### Interface: SetupEnv
5027
-
5028
- `SetupEnv` provides a starting point for managing secrets that
5029
- must not appear in source code.
5030
-
5031
- The `makeEnv` and `getEnv` functions of the `Setup` and `SetupClient` classes
5032
- provide an easy way to create and import these secrets and related properties.
5033
-
5034
- ```ts
5035
- export interface SetupEnv {
5036
- chain: Chain;
5037
- identityKey: string;
5038
- identityKey2: string;
5039
- filePath: string | undefined;
5040
- taalApiKey: string;
5041
- devKeys: Record<string, string>;
5042
- mySQLConnection: string;
5043
- }
5044
- ```
5045
-
5046
- See also: [Chain](./client.md#type-chain)
5047
-
5048
- ###### Property chain
5049
-
5050
- The chan being accessed: 'main' for mainnet, 'test' for 'testnet'.
5051
-
5052
- ```ts
5053
- chain: Chain
5054
- ```
5055
- See also: [Chain](./client.md#type-chain)
5056
-
5057
- ###### Property devKeys
5058
-
5059
- A map of public keys (identity keys, hex strings) to private keys (hex strings).
5060
-
5061
- ```ts
5062
- devKeys: Record<string, string>
5063
- ```
5064
-
5065
- ###### Property filePath
5066
-
5067
- Filepath to sqlite file to be used for identityKey wallet.
5068
-
5069
- ```ts
5070
- filePath: string | undefined
5071
- ```
5072
-
5073
- ###### Property identityKey
5074
-
5075
- The user's primary identity key (public key).
5076
-
5077
- ```ts
5078
- identityKey: string
5079
- ```
5080
-
5081
- ###### Property identityKey2
5082
-
5083
- A secondary identity key (public key), used to test exchanges with other users.
5084
-
5085
- ```ts
5086
- identityKey2: string
5087
- ```
5088
-
5089
- ###### Property mySQLConnection
5090
-
5091
- A MySQL connection string including user and password properties.
5092
- Must be valid to make use of MySQL `Setup` class support.
5093
-
5094
- ```ts
5095
- mySQLConnection: string
5096
- ```
5097
-
5098
- ###### Property taalApiKey
5099
-
5100
- A vaild TAAL API key for use by `Services`
5101
-
5102
- ```ts
5103
- taalApiKey: string
5104
- ```
5105
-
5106
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5107
-
5108
4989
  ---
5109
4990
  ##### Interface: SetupWallet
5110
4991
 
@@ -5208,78 +5089,6 @@ See also: [Wallet](./client.md#class-wallet)
5208
5089
 
5209
5090
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5210
5091
 
5211
- ---
5212
- ##### Interface: SetupWalletArgs
5213
-
5214
- Arguments used by `createWallet` to construct a `SetupWallet`.
5215
-
5216
- Extension `SetupWalletClientArgs` used by `createWalletClient` to construct a `SetupWalletClient`.
5217
-
5218
- Extension `SetupWalletKnexArgs` used by `createWalletKnex` to construct a `SetupWalletKnex`.
5219
-
5220
- Extension `SetupWalletMySQLArgs` used by `createWalletMySQL` to construct a `SetupWalletKnex`.
5221
-
5222
- Extension `SetupWalletSQLiteArgs` used by `createWalletSQLite` to construct a `SetupWalletKnex`.
5223
-
5224
- ```ts
5225
- export interface SetupWalletArgs {
5226
- env: SetupEnv;
5227
- rootKeyHex?: string;
5228
- privilegedKeyGetter?: () => Promise<PrivateKey>;
5229
- active?: WalletStorageProvider;
5230
- backups?: WalletStorageProvider[];
5231
- }
5232
- ```
5233
-
5234
- See also: [SetupEnv](./setup.md#interface-setupenv), [WalletStorageProvider](./client.md#interface-walletstorageprovider)
5235
-
5236
- ###### Property active
5237
-
5238
- Optional. Active wallet storage. Can be added later.
5239
-
5240
- ```ts
5241
- active?: WalletStorageProvider
5242
- ```
5243
- See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
5244
-
5245
- ###### Property backups
5246
-
5247
- Optional. One or more storage providers managed as backup destinations. Can be added later.
5248
-
5249
- ```ts
5250
- backups?: WalletStorageProvider[]
5251
- ```
5252
- See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
5253
-
5254
- ###### Property env
5255
-
5256
- Configuration "secrets" typically obtained by `Setup.makeEnv` and `Setup.getEnv` functions.
5257
-
5258
- ```ts
5259
- env: SetupEnv
5260
- ```
5261
- See also: [SetupEnv](./setup.md#interface-setupenv)
5262
-
5263
- ###### Property privilegedKeyGetter
5264
-
5265
- Optional. The privileged private key getter used to initialize the `PrivilegedKeyManager`.
5266
- Defaults to undefined.
5267
-
5268
- ```ts
5269
- privilegedKeyGetter?: () => Promise<PrivateKey>
5270
- ```
5271
-
5272
- ###### Property rootKeyHex
5273
-
5274
- Optional. The non-privileged private key used to initialize the `KeyDeriver` and determine the `identityKey`.
5275
- Defaults to `env.devKeys[env.identityKey]
5276
-
5277
- ```ts
5278
- rootKeyHex?: string
5279
- ```
5280
-
5281
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5282
-
5283
5092
  ---
5284
5093
  ##### Interface: SetupWalletClient
5285
5094
 
@@ -5305,32 +5114,6 @@ endpointUrl: string
5305
5114
 
5306
5115
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5307
5116
 
5308
- ---
5309
- ##### Interface: SetupWalletClientArgs
5310
-
5311
- Extension `SetupWalletClientArgs` of `SetupWalletArgs` is used by `createWalletClient`
5312
- to construct a `SetupWalletClient`.
5313
-
5314
- ```ts
5315
- export interface SetupWalletClientArgs extends SetupWalletArgs {
5316
- endpointUrl?: string;
5317
- }
5318
- ```
5319
-
5320
- See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
5321
-
5322
- ###### Property endpointUrl
5323
-
5324
- The endpoint URL of a service hosting the `StorageServer` JSON-RPC service to
5325
- which a `StorageClient` instance should connect to function as
5326
- the active storage provider of the newly created wallet.
5327
-
5328
- ```ts
5329
- endpointUrl?: string
5330
- ```
5331
-
5332
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5333
-
5334
5117
  ---
5335
5118
  ##### Interface: SetupWalletIdb
5336
5119
 
@@ -5366,69 +5149,6 @@ See also: [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs)
5366
5149
 
5367
5150
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5368
5151
 
5369
- ---
5370
- ##### Interface: SetupWalletKnex
5371
-
5372
- ```ts
5373
- export interface SetupWalletKnex extends SetupWallet {
5374
- activeStorage: StorageKnex;
5375
- userId: number;
5376
- rootKey: PrivateKey;
5377
- identityKey: string;
5378
- keyDeriver: KeyDeriverApi;
5379
- chain: Chain;
5380
- storage: WalletStorageManager;
5381
- services: Services;
5382
- monitor: Monitor;
5383
- wallet: Wallet;
5384
- }
5385
- ```
5386
-
5387
- See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [SetupWallet](./setup.md#interface-setupwallet), [StorageKnex](./storage.md#class-storageknex), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
5388
-
5389
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5390
-
5391
- ---
5392
- ##### Interface: SetupWalletKnexArgs
5393
-
5394
- ```ts
5395
- export interface SetupWalletKnexArgs extends SetupWalletArgs {
5396
- knex: Knex<any, any[]>;
5397
- databaseName: string;
5398
- }
5399
- ```
5400
-
5401
- See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
5402
-
5403
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5404
-
5405
- ---
5406
- ##### Interface: SetupWalletMySQLArgs
5407
-
5408
- ```ts
5409
- export interface SetupWalletMySQLArgs extends SetupWalletArgs {
5410
- databaseName: string;
5411
- }
5412
- ```
5413
-
5414
- See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
5415
-
5416
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5417
-
5418
- ---
5419
- ##### Interface: SetupWalletSQLiteArgs
5420
-
5421
- ```ts
5422
- export interface SetupWalletSQLiteArgs extends SetupWalletArgs {
5423
- filePath: string;
5424
- databaseName: string;
5425
- }
5426
- ```
5427
-
5428
- See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
5429
-
5430
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5431
-
5432
5152
  ---
5433
5153
  ##### Interface: SignActionResultX
5434
5154
 
@@ -5987,27 +5707,6 @@ txid: string
5987
5707
 
5988
5708
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5989
5709
 
5990
- ---
5991
- ##### Interface: StorageKnexOptions
5992
-
5993
- ```ts
5994
- export interface StorageKnexOptions extends StorageProviderOptions {
5995
- knex: Knex;
5996
- }
5997
- ```
5998
-
5999
- See also: [StorageProviderOptions](./storage.md#interface-storageprovideroptions)
6000
-
6001
- ###### Property knex
6002
-
6003
- Knex database interface initialized with valid connection configuration.
6004
-
6005
- ```ts
6006
- knex: Knex
6007
- ```
6008
-
6009
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6010
-
6011
5710
  ---
6012
5711
  ##### Interface: StorageProcessActionArgs
6013
5712
 
@@ -6784,241 +6483,46 @@ See also: [PurgeParams](./client.md#interface-purgeparams)
6784
6483
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6785
6484
 
6786
6485
  ---
6787
- ##### Interface: TestSetup1
6486
+ ##### Interface: TrustSettings
6788
6487
 
6789
6488
  ```ts
6790
- export interface TestSetup1 {
6791
- u1: TableUser;
6792
- u1basket1: TableOutputBasket;
6793
- u1basket2: TableOutputBasket;
6794
- u1label1: TableTxLabel;
6795
- u1label2: TableTxLabel;
6796
- u1tag1: TableOutputTag;
6797
- u1tag2: TableOutputTag;
6798
- u1tx1: TableTransaction;
6799
- u1comm1: TableCommission;
6800
- u1tx1label1: TableTxLabelMap;
6801
- u1tx1label2: TableTxLabelMap;
6802
- u1tx1o0: TableOutput;
6803
- u1o0tag1: TableOutputTagMap;
6804
- u1o0tag2: TableOutputTagMap;
6805
- u1tx1o1: TableOutput;
6806
- u1o1tag1: TableOutputTagMap;
6807
- u1cert1: TableCertificate;
6808
- u1cert1field1: TableCertificateField;
6809
- u1cert1field2: TableCertificateField;
6810
- u1cert2: TableCertificate;
6811
- u1cert2field1: TableCertificateField;
6812
- u1cert3: TableCertificate;
6813
- u1sync1: TableSyncState;
6814
- u2: TableUser;
6815
- u2basket1: TableOutputBasket;
6816
- u2label1: TableTxLabel;
6817
- u2tx1: TableTransaction;
6818
- u2comm1: TableCommission;
6819
- u2tx1label1: TableTxLabelMap;
6820
- u2tx1o0: TableOutput;
6821
- u2tx2: TableTransaction;
6822
- u2comm2: TableCommission;
6823
- proven1: TableProvenTx;
6824
- req1: TableProvenTxReq;
6825
- req2: TableProvenTxReq;
6826
- we1: TableMonitorEvent;
6489
+ export interface TrustSettings {
6490
+ trustLevel: number;
6491
+ trustedCertifiers: Certifier[];
6827
6492
  }
6828
6493
  ```
6829
6494
 
6830
- See also: [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser)
6495
+ See also: [Certifier](./client.md#interface-certifier)
6831
6496
 
6832
6497
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6833
6498
 
6834
6499
  ---
6835
- ##### Interface: TestSetup2
6500
+ ##### Interface: TrxToken
6501
+
6502
+ Place holder for the transaction control object used by actual storage provider implementation.
6836
6503
 
6837
6504
  ```ts
6838
- export interface TestSetup2 extends MockData {
6505
+ export interface TrxToken {
6839
6506
  }
6840
6507
  ```
6841
6508
 
6842
- See also: [MockData](./client.md#interface-mockdata)
6843
-
6844
6509
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6845
6510
 
6846
6511
  ---
6847
- ##### Interface: TestWallet
6512
+ ##### Interface: TscMerkleProofApi
6848
6513
 
6849
6514
  ```ts
6850
- export interface TestWallet<T> extends TestWalletOnly {
6851
- activeStorage: StorageKnex;
6852
- setup?: T;
6853
- userId: number;
6854
- rootKey: PrivateKey;
6855
- identityKey: string;
6856
- keyDeriver: KeyDeriverApi;
6857
- chain: Chain;
6858
- storage: WalletStorageManager;
6859
- services: Services;
6860
- monitor: Monitor;
6861
- wallet: Wallet;
6862
- localStorageIdentityKey?: string;
6863
- clientStorageIdentityKey?: string;
6864
- localBackupStorageIdentityKey?: string;
6515
+ export interface TscMerkleProofApi {
6516
+ height: number;
6517
+ index: number;
6518
+ nodes: string[];
6865
6519
  }
6866
6520
  ```
6867
6521
 
6868
- See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [StorageKnex](./storage.md#class-storageknex), [TestWalletOnly](./client.md#interface-testwalletonly), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
6869
-
6870
6522
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6871
6523
 
6872
6524
  ---
6873
- ##### Interface: TestWalletOnly
6874
-
6875
- ```ts
6876
- export interface TestWalletOnly {
6877
- rootKey: PrivateKey;
6878
- identityKey: string;
6879
- keyDeriver: KeyDeriverApi;
6880
- chain: Chain;
6881
- storage: WalletStorageManager;
6882
- services: Services;
6883
- monitor: Monitor;
6884
- wallet: Wallet;
6885
- }
6886
- ```
6887
-
6888
- See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
6889
-
6890
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6891
-
6892
- ---
6893
- ##### Interface: TestWalletProvider
6894
-
6895
- ```ts
6896
- export interface TestWalletProvider<T> extends TestWalletOnly {
6897
- activeStorage: StorageProvider;
6898
- setup?: T;
6899
- userId: number;
6900
- rootKey: PrivateKey;
6901
- identityKey: string;
6902
- keyDeriver: KeyDeriverApi;
6903
- chain: Chain;
6904
- storage: WalletStorageManager;
6905
- services: Services;
6906
- monitor: Monitor;
6907
- wallet: Wallet;
6908
- localStorageIdentityKey?: string;
6909
- clientStorageIdentityKey?: string;
6910
- localBackupStorageIdentityKey?: string;
6911
- }
6912
- ```
6913
-
6914
- See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [StorageProvider](./storage.md#class-storageprovider), [TestWalletOnly](./client.md#interface-testwalletonly), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
6915
-
6916
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6917
-
6918
- ---
6919
- ##### Interface: TrustSettings
6920
-
6921
- ```ts
6922
- export interface TrustSettings {
6923
- trustLevel: number;
6924
- trustedCertifiers: Certifier[];
6925
- }
6926
- ```
6927
-
6928
- See also: [Certifier](./client.md#interface-certifier)
6929
-
6930
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6931
-
6932
- ---
6933
- ##### Interface: TrxToken
6934
-
6935
- Place holder for the transaction control object used by actual storage provider implementation.
6936
-
6937
- ```ts
6938
- export interface TrxToken {
6939
- }
6940
- ```
6941
-
6942
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6943
-
6944
- ---
6945
- ##### Interface: TscMerkleProofApi
6946
-
6947
- ```ts
6948
- export interface TscMerkleProofApi {
6949
- height: number;
6950
- index: number;
6951
- nodes: string[];
6952
- }
6953
- ```
6954
-
6955
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6956
-
6957
- ---
6958
- ##### Interface: TuEnv
6959
-
6960
- ```ts
6961
- export interface TuEnv extends TuEnvFlags {
6962
- chain: Chain;
6963
- identityKey: string;
6964
- identityKey2: string;
6965
- taalApiKey: string;
6966
- bitailsApiKey: string;
6967
- whatsonchainApiKey: string;
6968
- devKeys: Record<string, string>;
6969
- filePath?: string;
6970
- testIdentityKey?: string;
6971
- testFilePath?: string;
6972
- cloudMySQLConnection?: string;
6973
- }
6974
- ```
6975
-
6976
- See also: [Chain](./client.md#type-chain), [TuEnvFlags](./client.md#interface-tuenvflags)
6977
-
6978
- ###### Property filePath
6979
-
6980
- file path to local sqlite file for identityKey
6981
-
6982
- ```ts
6983
- filePath?: string
6984
- ```
6985
-
6986
- ###### Property testFilePath
6987
-
6988
- file path to local sqlite file for testIdentityKey
6989
-
6990
- ```ts
6991
- testFilePath?: string
6992
- ```
6993
-
6994
- ###### Property testIdentityKey
6995
-
6996
- identityKey for automated test wallet on this chain
6997
-
6998
- ```ts
6999
- testIdentityKey?: string
7000
- ```
7001
-
7002
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7003
-
7004
- ---
7005
- ##### Interface: TuEnvFlags
7006
-
7007
- ```ts
7008
- export interface TuEnvFlags {
7009
- chain: Chain;
7010
- runMySQL: boolean;
7011
- runSlowTests: boolean;
7012
- logTests: boolean;
7013
- }
7014
- ```
7015
-
7016
- See also: [Chain](./client.md#type-chain)
7017
-
7018
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7019
-
7020
- ---
7021
- ##### Interface: TxScriptOffsets
6525
+ ##### Interface: TxScriptOffsets
7022
6526
 
7023
6527
  ```ts
7024
6528
  export interface TxScriptOffsets {
@@ -8522,42 +8026,40 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
8522
8026
 
8523
8027
  | | | |
8524
8028
  | --- | --- | --- |
8525
- | [ARC](#class-arc) | [EntityProvenTxReq](#class-entityproventxreq) | [TaskMonitorCallHistory](#class-taskmonitorcallhistory) |
8526
- | [AuthMethodInteractor](#class-authmethodinteractor) | [EntitySyncState](#class-entitysyncstate) | [TaskNewHeader](#class-tasknewheader) |
8527
- | [BHServiceClient](#class-bhserviceclient) | [EntityTransaction](#class-entitytransaction) | [TaskPurge](#class-taskpurge) |
8528
- | [Bitails](#class-bitails) | [EntityTxLabel](#class-entitytxlabel) | [TaskReviewStatus](#class-taskreviewstatus) |
8529
- | [BulkFileDataManager](#class-bulkfiledatamanager) | [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskSendWaiting](#class-tasksendwaiting) |
8530
- | [BulkFileDataReader](#class-bulkfiledatareader) | [EntityUser](#class-entityuser) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) |
8531
- | [BulkFilesReader](#class-bulkfilesreader) | [HeightRange](#class-heightrange) | [TaskUnFail](#class-taskunfail) |
8532
- | [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [KnexMigrations](#class-knexmigrations) | [TestUtilsWalletStorage](#class-testutilswalletstorage) |
8533
- | [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [LiveIngestorBase](#class-liveingestorbase) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) |
8534
- | [BulkHeaderFile](#class-bulkheaderfile) | [LiveIngestorWhatsOnChainPoll](#class-liveingestorwhatsonchainpoll) | [WABClient](#class-wabclient) |
8535
- | [BulkHeaderFileFs](#class-bulkheaderfilefs) | [LiveIngestorWhatsOnChainWs](#class-liveingestorwhatsonchainws) | [WERR_BAD_REQUEST](#class-werr_bad_request) |
8536
- | [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [MergeEntity](#class-mergeentity) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
8537
- | [BulkHeaderFiles](#class-bulkheaderfiles) | [Monitor](#class-monitor) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
8538
- | [BulkIngestorBase](#class-bulkingestorbase) | [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [WERR_INTERNAL](#class-werr_internal) |
8539
- | [BulkIngestorCDN](#class-bulkingestorcdn) | [PersonaIDInteractor](#class-personaidinteractor) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
8540
- | [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
8541
- | [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [ReaderUint8Array](#class-readeruint8array) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
8542
- | [BulkIngestorWhatsOnChainWs](#class-bulkingestorwhatsonchainws) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
8543
- | [BulkStorageBase](#class-bulkstoragebase) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
8544
- | [CWIStyleWalletManager](#class-cwistylewalletmanager) | [ServiceCollection](#class-servicecollection) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
8545
- | [Chaintracks](#class-chaintracks) | [Services](#class-services) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
8546
- | [ChaintracksChainTracker](#class-chaintrackschaintracker) | [Setup](#class-setup) | [WERR_REVIEW_ACTIONS](#class-werr_review_actions) |
8029
+ | [ARC](#class-arc) | [EntityOutputTagMap](#class-entityoutputtagmap) | [TaskFailAbandoned](#class-taskfailabandoned) |
8030
+ | [AuthMethodInteractor](#class-authmethodinteractor) | [EntityProvenTx](#class-entityproventx) | [TaskMonitorCallHistory](#class-taskmonitorcallhistory) |
8031
+ | [BHServiceClient](#class-bhserviceclient) | [EntityProvenTxReq](#class-entityproventxreq) | [TaskNewHeader](#class-tasknewheader) |
8032
+ | [Bitails](#class-bitails) | [EntitySyncState](#class-entitysyncstate) | [TaskPurge](#class-taskpurge) |
8033
+ | [BulkFileDataManager](#class-bulkfiledatamanager) | [EntityTransaction](#class-entitytransaction) | [TaskReviewStatus](#class-taskreviewstatus) |
8034
+ | [BulkFileDataReader](#class-bulkfiledatareader) | [EntityTxLabel](#class-entitytxlabel) | [TaskSendWaiting](#class-tasksendwaiting) |
8035
+ | [BulkFilesReader](#class-bulkfilesreader) | [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) |
8036
+ | [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [EntityUser](#class-entityuser) | [TaskUnFail](#class-taskunfail) |
8037
+ | [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [HeightRange](#class-heightrange) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) |
8038
+ | [BulkHeaderFile](#class-bulkheaderfile) | [LiveIngestorBase](#class-liveingestorbase) | [WABClient](#class-wabclient) |
8039
+ | [BulkHeaderFileFs](#class-bulkheaderfilefs) | [LiveIngestorWhatsOnChainPoll](#class-liveingestorwhatsonchainpoll) | [WERR_BAD_REQUEST](#class-werr_bad_request) |
8040
+ | [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [LiveIngestorWhatsOnChainWs](#class-liveingestorwhatsonchainws) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
8041
+ | [BulkHeaderFiles](#class-bulkheaderfiles) | [MergeEntity](#class-mergeentity) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
8042
+ | [BulkIngestorBase](#class-bulkingestorbase) | [Monitor](#class-monitor) | [WERR_INTERNAL](#class-werr_internal) |
8043
+ | [BulkIngestorCDN](#class-bulkingestorcdn) | [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
8044
+ | [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [PersonaIDInteractor](#class-personaidinteractor) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
8045
+ | [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
8046
+ | [BulkIngestorWhatsOnChainWs](#class-bulkingestorwhatsonchainws) | [ReaderUint8Array](#class-readeruint8array) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
8047
+ | [BulkStorageBase](#class-bulkstoragebase) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
8048
+ | [CWIStyleWalletManager](#class-cwistylewalletmanager) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
8049
+ | [Chaintracks](#class-chaintracks) | [ServiceCollection](#class-servicecollection) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
8050
+ | [ChaintracksChainTracker](#class-chaintrackschaintracker) | [Services](#class-services) | [WERR_REVIEW_ACTIONS](#class-werr_review_actions) |
8547
8051
  | [ChaintracksFetch](#class-chaintracksfetch) | [SetupClient](#class-setupclient) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
8548
8052
  | [ChaintracksService](#class-chaintracksservice) | [SimpleWalletManager](#class-simplewalletmanager) | [Wallet](#class-wallet) |
8549
8053
  | [ChaintracksServiceClient](#class-chaintracksserviceclient) | [SingleWriterMultiReaderLock](#class-singlewritermultireaderlock) | [WalletAuthenticationManager](#class-walletauthenticationmanager) |
8550
8054
  | [ChaintracksStorageBase](#class-chaintracksstoragebase) | [StorageClient](#class-storageclient) | [WalletError](#class-walleterror) |
8551
8055
  | [ChaintracksStorageNoDb](#class-chaintracksstoragenodb) | [StorageIdb](#class-storageidb) | [WalletMonitorTask](#class-walletmonitortask) |
8552
- | [EntityBase](#class-entitybase) | [StorageKnex](#class-storageknex) | [WalletPermissionsManager](#class-walletpermissionsmanager) |
8553
- | [EntityCertificate](#class-entitycertificate) | [StorageProvider](#class-storageprovider) | [WalletSettingsManager](#class-walletsettingsmanager) |
8554
- | [EntityCertificateField](#class-entitycertificatefield) | [StorageReader](#class-storagereader) | [WalletSigner](#class-walletsigner) |
8555
- | [EntityCommission](#class-entitycommission) | [StorageReaderWriter](#class-storagereaderwriter) | [WalletStorageManager](#class-walletstoragemanager) |
8556
- | [EntityOutput](#class-entityoutput) | [StorageSyncReader](#class-storagesyncreader) | [WhatsOnChain](#class-whatsonchain) |
8557
- | [EntityOutputBasket](#class-entityoutputbasket) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WhatsOnChainNoServices](#class-whatsonchainnoservices) |
8558
- | [EntityOutputTag](#class-entityoutputtag) | [TaskCheckNoSends](#class-taskchecknosends) | [WhatsOnChainServices](#class-whatsonchainservices) |
8559
- | [EntityOutputTagMap](#class-entityoutputtagmap) | [TaskClock](#class-taskclock) | [_tu](#class-_tu) |
8560
- | [EntityProvenTx](#class-entityproventx) | [TaskFailAbandoned](#class-taskfailabandoned) | |
8056
+ | [EntityBase](#class-entitybase) | [StorageProvider](#class-storageprovider) | [WalletPermissionsManager](#class-walletpermissionsmanager) |
8057
+ | [EntityCertificate](#class-entitycertificate) | [StorageReader](#class-storagereader) | [WalletSettingsManager](#class-walletsettingsmanager) |
8058
+ | [EntityCertificateField](#class-entitycertificatefield) | [StorageReaderWriter](#class-storagereaderwriter) | [WalletSigner](#class-walletsigner) |
8059
+ | [EntityCommission](#class-entitycommission) | [StorageSyncReader](#class-storagesyncreader) | [WalletStorageManager](#class-walletstoragemanager) |
8060
+ | [EntityOutput](#class-entityoutput) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WhatsOnChain](#class-whatsonchain) |
8061
+ | [EntityOutputBasket](#class-entityoutputbasket) | [TaskCheckNoSends](#class-taskchecknosends) | [WhatsOnChainNoServices](#class-whatsonchainnoservices) |
8062
+ | [EntityOutputTag](#class-entityoutputtag) | [TaskClock](#class-taskclock) | [WhatsOnChainServices](#class-whatsonchainservices) |
8561
8063
 
8562
8064
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
8563
8065
 
@@ -11217,40 +10719,6 @@ See also: [HeightRange](./services.md#class-heightrange)
11217
10719
 
11218
10720
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11219
10721
 
11220
- ---
11221
- ##### Class: KnexMigrations
11222
-
11223
- ```ts
11224
- export class KnexMigrations implements MigrationSource<string> {
11225
- migrations: Record<string, Migration> = {};
11226
- constructor(public chain: Chain, public storageName: string, public storageIdentityKey: string, public maxOutputScriptLength: number)
11227
- async getMigrations(): Promise<string[]>
11228
- getMigrationName(migration: string)
11229
- async getMigration(migration: string): Promise<Migration>
11230
- async getLatestMigration(): Promise<string>
11231
- static async latestMigration(): Promise<string>
11232
- setupMigrations(chain: string, storageName: string, storageIdentityKey: string, maxOutputScriptLength: number): Record<string, Migration>
11233
- }
11234
- ```
11235
-
11236
- See also: [Chain](./client.md#type-chain)
11237
-
11238
- ###### Constructor
11239
-
11240
- ```ts
11241
- constructor(public chain: Chain, public storageName: string, public storageIdentityKey: string, public maxOutputScriptLength: number)
11242
- ```
11243
- See also: [Chain](./client.md#type-chain)
11244
-
11245
- Argument Details
11246
-
11247
- + **storageName**
11248
- + human readable name for this storage instance
11249
- + **maxOutputScriptLength**
11250
- + limit for scripts kept in outputs table, longer scripts will be pulled from rawTx
11251
-
11252
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11253
-
11254
10722
  ---
11255
10723
  ##### Class: LiveIngestorBase
11256
10724
 
@@ -11981,7 +11449,7 @@ Argument Details
11981
11449
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11982
11450
 
11983
11451
  ---
11984
- ##### Class: Setup
11452
+ ##### Class: SetupClient
11985
11453
 
11986
11454
  The 'Setup` class provides static setup functions to construct BRC-100 compatible
11987
11455
  wallets in a variety of configurations.
@@ -11989,58 +11457,9 @@ wallets in a variety of configurations.
11989
11457
  It serves as a starting point for experimentation and customization.
11990
11458
 
11991
11459
  ```ts
11992
- export abstract class Setup {
11993
- static noEnv(chain: Chain): boolean
11994
- static makeEnv(): string {
11995
- const testPrivKey1 = PrivateKey.fromRandom();
11996
- const testIdentityKey1 = testPrivKey1.toPublicKey().toString();
11997
- const testPrivKey2 = PrivateKey.fromRandom();
11998
- const testIdentityKey2 = testPrivKey2.toPublicKey().toString();
11999
- const mainPrivKey1 = PrivateKey.fromRandom();
12000
- const mainIdentityKey1 = mainPrivKey1.toPublicKey().toString();
12001
- const mainPrivKey2 = PrivateKey.fromRandom();
12002
- const mainIdentityKey2 = mainPrivKey2.toPublicKey().toString();
12003
- const log = `
12004
- # .env file template for working with wallet-toolbox Setup functions.
12005
- MY_TEST_IDENTITY = '${testIdentityKey1}'
12006
- MY_TEST_IDENTITY2 = '${testIdentityKey2}'
12007
- MY_MAIN_IDENTITY = '${mainIdentityKey1}'
12008
- MY_MAIN_IDENTITY2 = '${mainIdentityKey2}'
12009
- MAIN_TAAL_API_KEY='mainnet_9596de07e92300c6287e4393594ae39c'
12010
- TEST_TAAL_API_KEY='testnet_0e6cf72133b43ea2d7861da2a38684e3'
12011
- MYSQL_CONNECTION='{"port":3306,"host":"127.0.0.1","user":"root","password":"your_password","database":"your_database", "timezone": "Z"}'
12012
- DEV_KEYS = '{
12013
- "${testIdentityKey1}": "${testPrivKey1.toString()}",
12014
- "${testIdentityKey2}": "${testPrivKey2.toString()}",
12015
- "${mainIdentityKey1}": "${mainPrivKey1.toString()}",
12016
- "${mainIdentityKey2}": "${mainPrivKey2.toString()}"
12017
- }'
12018
- `;
12019
- console.log(log);
12020
- return log;
12021
- }
12022
- static getEnv(chain: Chain): SetupEnv {
12023
- const identityKey = chain === "main" ? process.env.MY_MAIN_IDENTITY : process.env.MY_TEST_IDENTITY;
12024
- const identityKey2 = chain === "main" ? process.env.MY_MAIN_IDENTITY2 : process.env.MY_TEST_IDENTITY2;
12025
- const filePath = chain === "main" ? process.env.MY_MAIN_FILEPATH : process.env.MY_TEST_FILEPATH;
12026
- const DEV_KEYS = process.env.DEV_KEYS || "{}";
12027
- const mySQLConnection = process.env.MYSQL_CONNECTION || "{}";
12028
- const taalApiKey = verifyTruthy(chain === "main" ? process.env.MAIN_TAAL_API_KEY : process.env.TEST_TAAL_API_KEY, `.env value for '${chain.toUpperCase()}_TAAL_API_KEY' is required.`);
12029
- if (!identityKey || !identityKey2)
12030
- throw new WERR_INVALID_OPERATION(".env is not a valid SetupEnv configuration.");
12031
- return {
12032
- chain,
12033
- identityKey,
12034
- identityKey2,
12035
- filePath,
12036
- taalApiKey,
12037
- devKeys: JSON.parse(DEV_KEYS) as Record<string, string>,
12038
- mySQLConnection
12039
- };
12040
- }
12041
- static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
12042
- const chain = args.env.chain;
12043
- args.rootKeyHex ||= args.env.devKeys[args.env.identityKey];
11460
+ export abstract class SetupClient {
11461
+ static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
11462
+ const chain = args.chain;
12044
11463
  const rootKey = PrivateKey.fromHex(args.rootKeyHex);
12045
11464
  const identityKey = rootKey.toPublicKey().toString();
12046
11465
  const keyDeriver = new CachedKeyDeriver(rootKey);
@@ -12048,7 +11467,7 @@ DEV_KEYS = '{
12048
11467
  if (storage.canMakeAvailable())
12049
11468
  await storage.makeAvailable();
12050
11469
  const serviceOptions = Services.createDefaultOptions(chain);
12051
- serviceOptions.taalApiKey = args.env.taalApiKey;
11470
+ serviceOptions.taalApiKey = args.taalApiKey;
12052
11471
  const services = new Services(serviceOptions);
12053
11472
  const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
12054
11473
  const monitor = new Monitor(monopts);
@@ -12082,9 +11501,9 @@ DEV_KEYS = '{
12082
11501
  storageUrl?: string;
12083
11502
  privilegedKeyGetter?: () => Promise<PrivateKey>;
12084
11503
  }): Promise<Wallet>
12085
- static async createWalletClient(args: SetupWalletClientArgs): Promise<SetupWalletClient> {
12086
- const wo = await Setup.createWallet(args);
12087
- const endpointUrl = args.endpointUrl || `https://${args.env.chain !== "main" ? "staging-" : ""}storage.babbage.systems`;
11504
+ static async createWalletClient(args: SetupClientWalletClientArgs): Promise<SetupWalletClient> {
11505
+ const wo = await SetupClient.createWallet(args);
11506
+ const endpointUrl = args.endpointUrl || `https://${args.chain !== "main" ? "staging-" : ""}storage.babbage.systems`;
12088
11507
  const client = new StorageClient(wo.wallet, endpointUrl);
12089
11508
  await wo.storage.addWalletStorageProvider(client);
12090
11509
  await wo.storage.makeAvailable();
@@ -12109,7 +11528,7 @@ DEV_KEYS = '{
12109
11528
  }
12110
11529
  static getUnlockP2PKH(priv: PrivateKey, satoshis: number): ScriptTemplateUnlock {
12111
11530
  const p2pkh = new P2PKH();
12112
- const lock = Setup.getLockP2PKH(Setup.getKeyPair(priv).address);
11531
+ const lock = SetupClient.getLockP2PKH(SetupClient.getKeyPair(priv).address);
12113
11532
  const unlock = p2pkh.unlock(priv, "all", false, satoshis, lock);
12114
11533
  return unlock;
12115
11534
  }
@@ -12128,7 +11547,7 @@ DEV_KEYS = '{
12128
11547
  basket: o.basket,
12129
11548
  tags: o.tags,
12130
11549
  satoshis: o.satoshis,
12131
- lockingScript: Setup.getLockP2PKH(o.address).toHex(),
11550
+ lockingScript: SetupClient.getLockP2PKH(o.address).toHex(),
12132
11551
  outputDescription: o.outputDescription || `p2pkh ${i}`
12133
11552
  });
12134
11553
  }
@@ -12144,7 +11563,7 @@ DEV_KEYS = '{
12144
11563
  cr: CreateActionResult;
12145
11564
  outpoints: string[] | undefined;
12146
11565
  }> {
12147
- const os = Setup.createP2PKHOutputs(outputs);
11566
+ const os = SetupClient.createP2PKHOutputs(outputs);
12148
11567
  const createArgs: CreateActionArgs = {
12149
11568
  description: `createP2PKHOutputs`,
12150
11569
  outputs: os,
@@ -12162,66 +11581,31 @@ DEV_KEYS = '{
12162
11581
  }
12163
11582
  static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF) {
12164
11583
  }
12165
- static async createWalletKnex(args: SetupWalletKnexArgs): Promise<SetupWalletKnex> {
12166
- const wo = await Setup.createWallet(args);
12167
- const activeStorage = await Setup.createStorageKnex(args);
11584
+ static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
11585
+ const wo = await SetupClient.createWallet(args);
11586
+ const activeStorage = await SetupClient.createStorageIdb(args);
12168
11587
  await wo.storage.addWalletStorageProvider(activeStorage);
12169
11588
  const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
12170
11589
  const userId = user.userId;
12171
- const r: SetupWalletKnex = {
11590
+ const r: SetupWalletIdb = {
12172
11591
  ...wo,
12173
11592
  activeStorage,
12174
11593
  userId
12175
11594
  };
12176
11595
  return r;
12177
11596
  }
12178
- static async createStorageKnex(args: SetupWalletKnexArgs): Promise<StorageKnex>
12179
- static createSQLiteKnex(filename: string): Knex {
12180
- const config: Knex.Config = {
12181
- client: "sqlite3",
12182
- connection: { filename },
12183
- useNullAsDefault: true
12184
- };
12185
- const knex = makeKnex(config);
12186
- return knex;
12187
- }
12188
- static createMySQLKnex(connection: string, database?: string): Knex {
12189
- const c: Knex.MySql2ConnectionConfig = JSON.parse(connection);
12190
- if (database) {
12191
- c.database = database;
12192
- }
12193
- const config: Knex.Config = {
12194
- client: "mysql2",
12195
- connection: c,
12196
- useNullAsDefault: true,
12197
- pool: { min: 0, max: 7, idleTimeoutMillis: 15000 }
12198
- };
12199
- const knex = makeKnex(config);
12200
- return knex;
12201
- }
12202
- static async createWalletMySQL(args: SetupWalletMySQLArgs): Promise<SetupWalletKnex> {
12203
- return await this.createWalletKnex({
12204
- ...args,
12205
- knex: Setup.createMySQLKnex(args.env.mySQLConnection, args.databaseName)
12206
- });
12207
- }
12208
- static async createWalletSQLite(args: SetupWalletSQLiteArgs): Promise<SetupWalletKnex> {
12209
- return await this.createWalletKnex({
12210
- ...args,
12211
- knex: Setup.createSQLiteKnex(args.filePath)
12212
- });
12213
- }
11597
+ static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
12214
11598
  }
12215
11599
  ```
12216
11600
 
12217
- See also: [Chain](./client.md#type-chain), [KeyPairAddress](./setup.md#interface-keypairaddress), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [ScriptTemplateUnlock](./client.md#interface-scripttemplateunlock), [Services](./services.md#class-services), [SetupEnv](./setup.md#interface-setupenv), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletArgs](./setup.md#interface-setupwalletargs), [SetupWalletClient](./setup.md#interface-setupwalletclient), [SetupWalletClientArgs](./setup.md#interface-setupwalletclientargs), [SetupWalletKnex](./setup.md#interface-setupwalletknex), [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs), [SetupWalletMySQLArgs](./setup.md#interface-setupwalletmysqlargs), [SetupWalletSQLiteArgs](./setup.md#interface-setupwalletsqliteargs), [StorageClient](./storage.md#class-storageclient), [StorageKnex](./storage.md#class-storageknex), [WERR_INVALID_OPERATION](./client.md#class-werr_invalid_operation), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction), [verifyTruthy](./client.md#function-verifytruthy)
11601
+ See also: [Chain](./client.md#type-chain), [KeyPairAddress](./setup.md#interface-keypairaddress), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [ScriptTemplateUnlock](./client.md#interface-scripttemplateunlock), [Services](./services.md#class-services), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupClientWalletClientArgs](./setup.md#interface-setupclientwalletclientargs), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletClient](./setup.md#interface-setupwalletclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageClient](./storage.md#class-storageclient), [StorageIdb](./storage.md#class-storageidb), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction)
12218
11602
 
12219
- ###### Method createStorageKnex
11603
+ ###### Method createStorageIdb
12220
11604
 
12221
11605
  ```ts
12222
- static async createStorageKnex(args: SetupWalletKnexArgs): Promise<StorageKnex>
11606
+ static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
12223
11607
  ```
12224
- See also: [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs), [StorageKnex](./storage.md#class-storageknex)
11608
+ See also: [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageIdb](./storage.md#class-storageidb)
12225
11609
 
12226
11610
  Returns
12227
11611
 
@@ -12235,9 +11619,8 @@ The following components are configured: KeyDeriver, WalletStorageManager, Walle
12235
11619
  Optionally, PrivilegedKeyManager is also configured.
12236
11620
 
12237
11621
  ```ts
12238
- static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
12239
- const chain = args.env.chain;
12240
- args.rootKeyHex ||= args.env.devKeys[args.env.identityKey];
11622
+ static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
11623
+ const chain = args.chain;
12241
11624
  const rootKey = PrivateKey.fromHex(args.rootKeyHex);
12242
11625
  const identityKey = rootKey.toPublicKey().toString();
12243
11626
  const keyDeriver = new CachedKeyDeriver(rootKey);
@@ -12245,7 +11628,7 @@ static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
12245
11628
  if (storage.canMakeAvailable())
12246
11629
  await storage.makeAvailable();
12247
11630
  const serviceOptions = Services.createDefaultOptions(chain);
12248
- serviceOptions.taalApiKey = args.env.taalApiKey;
11631
+ serviceOptions.taalApiKey = args.taalApiKey;
12249
11632
  const services = new Services(serviceOptions);
12250
11633
  const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
12251
11634
  const monitor = new Monitor(monopts);
@@ -12274,7 +11657,7 @@ static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
12274
11657
  return r;
12275
11658
  }
12276
11659
  ```
12277
- See also: [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [Services](./services.md#class-services), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletArgs](./setup.md#interface-setupwalletargs), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
11660
+ See also: [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [Services](./services.md#class-services), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupWallet](./setup.md#interface-setupwallet), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
12278
11661
 
12279
11662
  ###### Method createWalletClientNoEnv
12280
11663
 
@@ -12301,18 +11684,18 @@ Argument Details
12301
11684
  + **args.privilegedKeyGetter**
12302
11685
  + Optional. Method that will return the privileged `PrivateKey`, on demand.
12303
11686
 
12304
- ###### Method createWalletKnex
11687
+ ###### Method createWalletIdb
12305
11688
 
12306
- Adds `Knex` based storage to a `Wallet` configured by `Setup.createWalletOnly`
11689
+ Adds `indexedDB` based storage to a `Wallet` configured by `SetupClient.createWalletOnly`
12307
11690
 
12308
11691
  ```ts
12309
- static async createWalletKnex(args: SetupWalletKnexArgs): Promise<SetupWalletKnex> {
12310
- const wo = await Setup.createWallet(args);
12311
- const activeStorage = await Setup.createStorageKnex(args);
11692
+ static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
11693
+ const wo = await SetupClient.createWallet(args);
11694
+ const activeStorage = await SetupClient.createStorageIdb(args);
12312
11695
  await wo.storage.addWalletStorageProvider(activeStorage);
12313
11696
  const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
12314
11697
  const userId = user.userId;
12315
- const r: SetupWalletKnex = {
11698
+ const r: SetupWalletIdb = {
12316
11699
  ...wo,
12317
11700
  activeStorage,
12318
11701
  userId
@@ -12320,467 +11703,105 @@ static async createWalletKnex(args: SetupWalletKnexArgs): Promise<SetupWalletKne
12320
11703
  return r;
12321
11704
  }
12322
11705
  ```
12323
- See also: [Setup](./setup.md#class-setup), [SetupWalletKnex](./setup.md#interface-setupwalletknex), [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs)
11706
+ See also: [SetupClient](./setup.md#class-setupclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs)
12324
11707
 
12325
11708
  Argument Details
12326
11709
 
12327
- + **args.knex**
12328
- + `Knex` object configured for either MySQL or SQLite database access.
12329
- Schema will be created and migrated as needed.
12330
- For MySQL, a schema corresponding to databaseName must exist with full access permissions.
12331
11710
  + **args.databaseName**
12332
11711
  + Name for this storage. For MySQL, the schema name within the MySQL instance.
12333
11712
  + **args.chain**
12334
11713
  + Which chain this wallet is on: 'main' or 'test'. Defaults to 'test'.
12335
11714
 
12336
- ###### Method getEnv
11715
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
12337
11716
 
12338
- Reads a .env file of the format created by `makeEnv`.
11717
+ ---
11718
+ ##### Class: SimpleWalletManager
12339
11719
 
12340
- Returns values for designated `chain`.
11720
+ SimpleWalletManager is a slimmed-down wallet manager that only requires two things to authenticate:
11721
+ 1. A primary key (32 bytes), which represents the core secret for the wallet.
11722
+ 2. A privileged key manager (an instance of `PrivilegedKeyManager`), responsible for
11723
+ more sensitive operations.
12341
11724
 
12342
- Access private keys through the `devKeys` object: `devKeys[identityKey]`
11725
+ Once both pieces are provided (or if a snapshot containing the primary key is loaded,
11726
+ and the privileged key manager is provided separately), the wallet becomes authenticated.
12343
11727
 
12344
- ```ts
12345
- static getEnv(chain: Chain): SetupEnv {
12346
- const identityKey = chain === "main" ? process.env.MY_MAIN_IDENTITY : process.env.MY_TEST_IDENTITY;
12347
- const identityKey2 = chain === "main" ? process.env.MY_MAIN_IDENTITY2 : process.env.MY_TEST_IDENTITY2;
12348
- const filePath = chain === "main" ? process.env.MY_MAIN_FILEPATH : process.env.MY_TEST_FILEPATH;
12349
- const DEV_KEYS = process.env.DEV_KEYS || "{}";
12350
- const mySQLConnection = process.env.MYSQL_CONNECTION || "{}";
12351
- const taalApiKey = verifyTruthy(chain === "main" ? process.env.MAIN_TAAL_API_KEY : process.env.TEST_TAAL_API_KEY, `.env value for '${chain.toUpperCase()}_TAAL_API_KEY' is required.`);
12352
- if (!identityKey || !identityKey2)
12353
- throw new WERR_INVALID_OPERATION(".env is not a valid SetupEnv configuration.");
12354
- return {
12355
- chain,
12356
- identityKey,
12357
- identityKey2,
12358
- filePath,
12359
- taalApiKey,
12360
- devKeys: JSON.parse(DEV_KEYS) as Record<string, string>,
12361
- mySQLConnection
12362
- };
12363
- }
12364
- ```
12365
- See also: [Chain](./client.md#type-chain), [SetupEnv](./setup.md#interface-setupenv), [WERR_INVALID_OPERATION](./client.md#class-werr_invalid_operation), [verifyTruthy](./client.md#function-verifytruthy)
11728
+ After authentication, calls to the standard wallet methods (`createAction`, `signAction`, etc.)
11729
+ are proxied to an underlying `WalletInterface` instance returned by a user-supplied `walletBuilder`.
12366
11730
 
12367
- Returns
11731
+ **Important**: This manager does not handle user password flows, recovery, or on-chain
11732
+ token management. It is a straightforward wrapper that ensures the user has provided
11733
+ both their main secret (primary key) and a privileged key manager before allowing usage.
12368
11734
 
12369
- with configuration environment secrets used by `Setup` functions.
11735
+ It also prevents calls from the special "admin originator" from being used externally.
11736
+ (Any call that tries to use the admin originator as its originator, other than the manager itself,
11737
+ will result in an error, ensuring that only internal operations can use that originator.)
12370
11738
 
12371
- Argument Details
11739
+ The manager can also save and load snapshots of its state. In this simplified version,
11740
+ the snapshot only contains the primary key. If you load a snapshot, you still need to
11741
+ re-provide the privileged key manager to complete authentication.
12372
11742
 
12373
- + **chain**
12374
- + Which chain to use: 'test' or 'main'
12375
-
12376
- ###### Method makeEnv
12377
-
12378
- Creates content for .env file with some private keys, identity keys, sample API keys, and sample MySQL connection string.
12379
-
12380
- Two new, random private keys are generated each time, with their associated public identity keys.
12381
-
12382
- Loading secrets from a .env file is intended only for experimentation and getting started.
12383
- Private keys should never be included directly in your source code.
12384
-
12385
- ```ts
12386
- static makeEnv(): string {
12387
- const testPrivKey1 = PrivateKey.fromRandom();
12388
- const testIdentityKey1 = testPrivKey1.toPublicKey().toString();
12389
- const testPrivKey2 = PrivateKey.fromRandom();
12390
- const testIdentityKey2 = testPrivKey2.toPublicKey().toString();
12391
- const mainPrivKey1 = PrivateKey.fromRandom();
12392
- const mainIdentityKey1 = mainPrivKey1.toPublicKey().toString();
12393
- const mainPrivKey2 = PrivateKey.fromRandom();
12394
- const mainIdentityKey2 = mainPrivKey2.toPublicKey().toString();
12395
- const log = `
12396
- # .env file template for working with wallet-toolbox Setup functions.
12397
- MY_TEST_IDENTITY = '${testIdentityKey1}'
12398
- MY_TEST_IDENTITY2 = '${testIdentityKey2}'
12399
- MY_MAIN_IDENTITY = '${mainIdentityKey1}'
12400
- MY_MAIN_IDENTITY2 = '${mainIdentityKey2}'
12401
- MAIN_TAAL_API_KEY='mainnet_9596de07e92300c6287e4393594ae39c'
12402
- TEST_TAAL_API_KEY='testnet_0e6cf72133b43ea2d7861da2a38684e3'
12403
- MYSQL_CONNECTION='{"port":3306,"host":"127.0.0.1","user":"root","password":"your_password","database":"your_database", "timezone": "Z"}'
12404
- DEV_KEYS = '{
12405
- "${testIdentityKey1}": "${testPrivKey1.toString()}",
12406
- "${testIdentityKey2}": "${testPrivKey2.toString()}",
12407
- "${mainIdentityKey1}": "${mainPrivKey1.toString()}",
12408
- "${mainIdentityKey2}": "${mainPrivKey2.toString()}"
12409
- }'
12410
- `;
12411
- console.log(log);
12412
- return log;
11743
+ ```ts
11744
+ export class SimpleWalletManager implements WalletInterface {
11745
+ authenticated: boolean;
11746
+ constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
11747
+ async providePrimaryKey(key: number[]): Promise<void>
11748
+ async providePrivilegedKeyManager(manager: PrivilegedKeyManager): Promise<void>
11749
+ destroy(): void
11750
+ saveSnapshot(): number[]
11751
+ async loadSnapshot(snapshot: number[]): Promise<void>
11752
+ async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
11753
+ async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
11754
+ async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
11755
+ async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
11756
+ async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
11757
+ async encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
11758
+ async decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
11759
+ async createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
11760
+ async verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
11761
+ async createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
11762
+ async verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
11763
+ async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
11764
+ async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
11765
+ async abortAction(args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AbortActionResult>
11766
+ async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
11767
+ async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<InternalizeActionResult>
11768
+ async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
11769
+ async relinquishOutput(args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishOutputResult>
11770
+ async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
11771
+ async listCertificates(args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
11772
+ async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
11773
+ async relinquishCertificate(args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishCertificateResult>
11774
+ async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
11775
+ async discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
11776
+ async getHeight(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeightResult>
11777
+ async getHeaderForHeight(args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeaderResult>
11778
+ async getNetwork(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetNetworkResult>
11779
+ async getVersion(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetVersionResult>
12413
11780
  }
12414
11781
  ```
12415
- See also: [Setup](./setup.md#class-setup)
12416
11782
 
12417
- ###### Method noEnv
11783
+ See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
11784
+
11785
+ ###### Constructor
11786
+
11787
+ Constructs a new `SimpleWalletManager`.
12418
11788
 
12419
11789
  ```ts
12420
- static noEnv(chain: Chain): boolean
11790
+ constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
12421
11791
  ```
12422
- See also: [Chain](./client.md#type-chain)
11792
+ See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager)
12423
11793
 
12424
- Returns
11794
+ Argument Details
12425
11795
 
12426
- true if .env is not valid for chain
12427
-
12428
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
12429
-
12430
- ---
12431
- ##### Class: SetupClient
12432
-
12433
- The 'Setup` class provides static setup functions to construct BRC-100 compatible
12434
- wallets in a variety of configurations.
12435
-
12436
- It serves as a starting point for experimentation and customization.
12437
-
12438
- ```ts
12439
- export abstract class SetupClient {
12440
- static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
12441
- const chain = args.chain;
12442
- const rootKey = PrivateKey.fromHex(args.rootKeyHex);
12443
- const identityKey = rootKey.toPublicKey().toString();
12444
- const keyDeriver = new CachedKeyDeriver(rootKey);
12445
- const storage = new WalletStorageManager(identityKey, args.active, args.backups);
12446
- if (storage.canMakeAvailable())
12447
- await storage.makeAvailable();
12448
- const serviceOptions = Services.createDefaultOptions(chain);
12449
- serviceOptions.taalApiKey = args.taalApiKey;
12450
- const services = new Services(serviceOptions);
12451
- const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
12452
- const monitor = new Monitor(monopts);
12453
- monitor.addDefaultTasks();
12454
- const privilegedKeyManager = args.privilegedKeyGetter
12455
- ? new PrivilegedKeyManager(args.privilegedKeyGetter)
12456
- : undefined;
12457
- const wallet = new Wallet({
12458
- chain,
12459
- keyDeriver,
12460
- storage,
12461
- services,
12462
- monitor,
12463
- privilegedKeyManager
12464
- });
12465
- const r: SetupWallet = {
12466
- rootKey,
12467
- identityKey,
12468
- keyDeriver,
12469
- chain,
12470
- storage,
12471
- services,
12472
- monitor,
12473
- wallet
12474
- };
12475
- return r;
12476
- }
12477
- static async createWalletClientNoEnv(args: {
12478
- chain: Chain;
12479
- rootKeyHex: string;
12480
- storageUrl?: string;
12481
- privilegedKeyGetter?: () => Promise<PrivateKey>;
12482
- }): Promise<Wallet>
12483
- static async createWalletClient(args: SetupClientWalletClientArgs): Promise<SetupWalletClient> {
12484
- const wo = await SetupClient.createWallet(args);
12485
- const endpointUrl = args.endpointUrl || `https://${args.chain !== "main" ? "staging-" : ""}storage.babbage.systems`;
12486
- const client = new StorageClient(wo.wallet, endpointUrl);
12487
- await wo.storage.addWalletStorageProvider(client);
12488
- await wo.storage.makeAvailable();
12489
- return {
12490
- ...wo,
12491
- endpointUrl
12492
- };
12493
- }
12494
- static getKeyPair(priv?: string | PrivateKey): KeyPairAddress {
12495
- if (priv === undefined)
12496
- priv = PrivateKey.fromRandom();
12497
- else if (typeof priv === "string")
12498
- priv = new PrivateKey(priv, "hex");
12499
- const pub = PublicKey.fromPrivateKey(priv);
12500
- const address = pub.toAddress();
12501
- return { privateKey: priv, publicKey: pub, address };
12502
- }
12503
- static getLockP2PKH(address: string): LockingScript {
12504
- const p2pkh = new P2PKH();
12505
- const lock = p2pkh.lock(address);
12506
- return lock;
12507
- }
12508
- static getUnlockP2PKH(priv: PrivateKey, satoshis: number): ScriptTemplateUnlock {
12509
- const p2pkh = new P2PKH();
12510
- const lock = SetupClient.getLockP2PKH(SetupClient.getKeyPair(priv).address);
12511
- const unlock = p2pkh.unlock(priv, "all", false, satoshis, lock);
12512
- return unlock;
12513
- }
12514
- static createP2PKHOutputs(outputs: {
12515
- address: string;
12516
- satoshis: number;
12517
- outputDescription?: string;
12518
- basket?: string;
12519
- tags?: string[];
12520
- }[]): CreateActionOutput[] {
12521
- const os: CreateActionOutput[] = [];
12522
- const count = outputs.length;
12523
- for (let i = 0; i < count; i++) {
12524
- const o = outputs[i];
12525
- os.push({
12526
- basket: o.basket,
12527
- tags: o.tags,
12528
- satoshis: o.satoshis,
12529
- lockingScript: SetupClient.getLockP2PKH(o.address).toHex(),
12530
- outputDescription: o.outputDescription || `p2pkh ${i}`
12531
- });
12532
- }
12533
- return os;
12534
- }
12535
- static async createP2PKHOutputsAction(wallet: WalletInterface, outputs: {
12536
- address: string;
12537
- satoshis: number;
12538
- outputDescription?: string;
12539
- basket?: string;
12540
- tags?: string[];
12541
- }[], options?: CreateActionOptions): Promise<{
12542
- cr: CreateActionResult;
12543
- outpoints: string[] | undefined;
12544
- }> {
12545
- const os = SetupClient.createP2PKHOutputs(outputs);
12546
- const createArgs: CreateActionArgs = {
12547
- description: `createP2PKHOutputs`,
12548
- outputs: os,
12549
- options: {
12550
- ...options,
12551
- randomizeOutputs: false
12552
- }
12553
- };
12554
- const cr = await wallet.createAction(createArgs);
12555
- let outpoints: string[] | undefined;
12556
- if (cr.txid) {
12557
- outpoints = os.map((o, i) => `${cr.txid}.${i}`);
12558
- }
12559
- return { cr, outpoints };
12560
- }
12561
- static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF) {
12562
- }
12563
- static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
12564
- const wo = await SetupClient.createWallet(args);
12565
- const activeStorage = await SetupClient.createStorageIdb(args);
12566
- await wo.storage.addWalletStorageProvider(activeStorage);
12567
- const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
12568
- const userId = user.userId;
12569
- const r: SetupWalletIdb = {
12570
- ...wo,
12571
- activeStorage,
12572
- userId
12573
- };
12574
- return r;
12575
- }
12576
- static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
12577
- }
12578
- ```
12579
-
12580
- See also: [Chain](./client.md#type-chain), [KeyPairAddress](./setup.md#interface-keypairaddress), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [ScriptTemplateUnlock](./client.md#interface-scripttemplateunlock), [Services](./services.md#class-services), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupClientWalletClientArgs](./setup.md#interface-setupclientwalletclientargs), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletClient](./setup.md#interface-setupwalletclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageClient](./storage.md#class-storageclient), [StorageIdb](./storage.md#class-storageidb), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction)
12581
-
12582
- ###### Method createStorageIdb
12583
-
12584
- ```ts
12585
- static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
12586
- ```
12587
- See also: [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageIdb](./storage.md#class-storageidb)
12588
-
12589
- Returns
12590
-
12591
- - `Knex` based storage provider for a wallet. May be used for either active storage or backup storage.
12592
-
12593
- ###### Method createWallet
12594
-
12595
- Create a `Wallet`. Storage can optionally be provided or configured later.
12596
-
12597
- The following components are configured: KeyDeriver, WalletStorageManager, WalletService, WalletStorage.
12598
- Optionally, PrivilegedKeyManager is also configured.
12599
-
12600
- ```ts
12601
- static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
12602
- const chain = args.chain;
12603
- const rootKey = PrivateKey.fromHex(args.rootKeyHex);
12604
- const identityKey = rootKey.toPublicKey().toString();
12605
- const keyDeriver = new CachedKeyDeriver(rootKey);
12606
- const storage = new WalletStorageManager(identityKey, args.active, args.backups);
12607
- if (storage.canMakeAvailable())
12608
- await storage.makeAvailable();
12609
- const serviceOptions = Services.createDefaultOptions(chain);
12610
- serviceOptions.taalApiKey = args.taalApiKey;
12611
- const services = new Services(serviceOptions);
12612
- const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
12613
- const monitor = new Monitor(monopts);
12614
- monitor.addDefaultTasks();
12615
- const privilegedKeyManager = args.privilegedKeyGetter
12616
- ? new PrivilegedKeyManager(args.privilegedKeyGetter)
12617
- : undefined;
12618
- const wallet = new Wallet({
12619
- chain,
12620
- keyDeriver,
12621
- storage,
12622
- services,
12623
- monitor,
12624
- privilegedKeyManager
12625
- });
12626
- const r: SetupWallet = {
12627
- rootKey,
12628
- identityKey,
12629
- keyDeriver,
12630
- chain,
12631
- storage,
12632
- services,
12633
- monitor,
12634
- wallet
12635
- };
12636
- return r;
12637
- }
12638
- ```
12639
- See also: [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [Services](./services.md#class-services), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupWallet](./setup.md#interface-setupwallet), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
12640
-
12641
- ###### Method createWalletClientNoEnv
12642
-
12643
- Setup a new `Wallet` without requiring a .env file.
12644
-
12645
- ```ts
12646
- static async createWalletClientNoEnv(args: {
12647
- chain: Chain;
12648
- rootKeyHex: string;
12649
- storageUrl?: string;
12650
- privilegedKeyGetter?: () => Promise<PrivateKey>;
12651
- }): Promise<Wallet>
12652
- ```
12653
- See also: [Chain](./client.md#type-chain), [Wallet](./client.md#class-wallet)
12654
-
12655
- Argument Details
12656
-
12657
- + **args.chain**
12658
- + 'main' or 'test'
12659
- + **args.rootKeyHex**
12660
- + Root private key for wallet's key deriver.
12661
- + **args.storageUrl**
12662
- + Optional. `StorageClient` and `chain` compatible endpoint URL.
12663
- + **args.privilegedKeyGetter**
12664
- + Optional. Method that will return the privileged `PrivateKey`, on demand.
12665
-
12666
- ###### Method createWalletIdb
12667
-
12668
- Adds `indexedDB` based storage to a `Wallet` configured by `SetupClient.createWalletOnly`
12669
-
12670
- ```ts
12671
- static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
12672
- const wo = await SetupClient.createWallet(args);
12673
- const activeStorage = await SetupClient.createStorageIdb(args);
12674
- await wo.storage.addWalletStorageProvider(activeStorage);
12675
- const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
12676
- const userId = user.userId;
12677
- const r: SetupWalletIdb = {
12678
- ...wo,
12679
- activeStorage,
12680
- userId
12681
- };
12682
- return r;
12683
- }
12684
- ```
12685
- See also: [SetupClient](./setup.md#class-setupclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs)
12686
-
12687
- Argument Details
12688
-
12689
- + **args.databaseName**
12690
- + Name for this storage. For MySQL, the schema name within the MySQL instance.
12691
- + **args.chain**
12692
- + Which chain this wallet is on: 'main' or 'test'. Defaults to 'test'.
12693
-
12694
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
12695
-
12696
- ---
12697
- ##### Class: SimpleWalletManager
12698
-
12699
- SimpleWalletManager is a slimmed-down wallet manager that only requires two things to authenticate:
12700
- 1. A primary key (32 bytes), which represents the core secret for the wallet.
12701
- 2. A privileged key manager (an instance of `PrivilegedKeyManager`), responsible for
12702
- more sensitive operations.
12703
-
12704
- Once both pieces are provided (or if a snapshot containing the primary key is loaded,
12705
- and the privileged key manager is provided separately), the wallet becomes authenticated.
12706
-
12707
- After authentication, calls to the standard wallet methods (`createAction`, `signAction`, etc.)
12708
- are proxied to an underlying `WalletInterface` instance returned by a user-supplied `walletBuilder`.
12709
-
12710
- **Important**: This manager does not handle user password flows, recovery, or on-chain
12711
- token management. It is a straightforward wrapper that ensures the user has provided
12712
- both their main secret (primary key) and a privileged key manager before allowing usage.
12713
-
12714
- It also prevents calls from the special "admin originator" from being used externally.
12715
- (Any call that tries to use the admin originator as its originator, other than the manager itself,
12716
- will result in an error, ensuring that only internal operations can use that originator.)
12717
-
12718
- The manager can also save and load snapshots of its state. In this simplified version,
12719
- the snapshot only contains the primary key. If you load a snapshot, you still need to
12720
- re-provide the privileged key manager to complete authentication.
12721
-
12722
- ```ts
12723
- export class SimpleWalletManager implements WalletInterface {
12724
- authenticated: boolean;
12725
- constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
12726
- async providePrimaryKey(key: number[]): Promise<void>
12727
- async providePrivilegedKeyManager(manager: PrivilegedKeyManager): Promise<void>
12728
- destroy(): void
12729
- saveSnapshot(): number[]
12730
- async loadSnapshot(snapshot: number[]): Promise<void>
12731
- async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
12732
- async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
12733
- async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
12734
- async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
12735
- async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
12736
- async encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
12737
- async decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
12738
- async createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
12739
- async verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
12740
- async createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
12741
- async verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
12742
- async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
12743
- async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
12744
- async abortAction(args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AbortActionResult>
12745
- async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
12746
- async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<InternalizeActionResult>
12747
- async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
12748
- async relinquishOutput(args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishOutputResult>
12749
- async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
12750
- async listCertificates(args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
12751
- async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
12752
- async relinquishCertificate(args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishCertificateResult>
12753
- async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
12754
- async discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
12755
- async getHeight(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeightResult>
12756
- async getHeaderForHeight(args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeaderResult>
12757
- async getNetwork(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetNetworkResult>
12758
- async getVersion(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetVersionResult>
12759
- }
12760
- ```
12761
-
12762
- See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
12763
-
12764
- ###### Constructor
12765
-
12766
- Constructs a new `SimpleWalletManager`.
12767
-
12768
- ```ts
12769
- constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
12770
- ```
12771
- See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager)
12772
-
12773
- Argument Details
12774
-
12775
- + **adminOriginator**
12776
- + The domain name of the administrative originator.
12777
- + **walletBuilder**
12778
- + A function that, given a primary key and privileged key manager,
12779
- returns a fully functional `WalletInterface`.
12780
- + **stateSnapshot**
12781
- + If provided, a previously saved snapshot of the wallet's state.
12782
- If the snapshot contains a primary key, it will be loaded immediately
12783
- (though you will still need to provide a privileged key manager to authenticate).
11796
+ + **adminOriginator**
11797
+ + The domain name of the administrative originator.
11798
+ + **walletBuilder**
11799
+ + A function that, given a primary key and privileged key manager,
11800
+ returns a fully functional `WalletInterface`.
11801
+ + **stateSnapshot**
11802
+ + If provided, a previously saved snapshot of the wallet's state.
11803
+ If the snapshot contains a primary key, it will be loaded immediately
11804
+ (though you will still need to provide a privileged key manager to authenticate).
12784
11805
 
12785
11806
  ###### Property authenticated
12786
11807
 
@@ -13819,466 +12840,6 @@ Throws
13819
12840
 
13820
12841
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
13821
12842
 
13822
- ---
13823
- ##### Class: StorageKnex
13824
-
13825
- ```ts
13826
- export class StorageKnex extends StorageProvider implements WalletStorageProvider {
13827
- knex: Knex;
13828
- constructor(options: StorageKnexOptions)
13829
- async readSettings(): Promise<TableSettings>
13830
- override async getProvenOrRawTx(txid: string, trx?: TrxToken): Promise<ProvenOrRawTx>
13831
- dbTypeSubstring(source: string, fromOffset: number, forLength?: number)
13832
- override async getRawTxOfKnownValidTransaction(txid?: string, offset?: number, length?: number, trx?: TrxToken): Promise<number[] | undefined>
13833
- getProvenTxsForUserQuery(args: FindForUserSincePagedArgs): Knex.QueryBuilder
13834
- override async getProvenTxsForUser(args: FindForUserSincePagedArgs): Promise<TableProvenTx[]>
13835
- getProvenTxReqsForUserQuery(args: FindForUserSincePagedArgs): Knex.QueryBuilder
13836
- override async getProvenTxReqsForUser(args: FindForUserSincePagedArgs): Promise<TableProvenTxReq[]>
13837
- getTxLabelMapsForUserQuery(args: FindForUserSincePagedArgs): Knex.QueryBuilder
13838
- override async getTxLabelMapsForUser(args: FindForUserSincePagedArgs): Promise<TableTxLabelMap[]>
13839
- getOutputTagMapsForUserQuery(args: FindForUserSincePagedArgs): Knex.QueryBuilder
13840
- override async getOutputTagMapsForUser(args: FindForUserSincePagedArgs): Promise<TableOutputTagMap[]>
13841
- override async listActions(auth: AuthId, vargs: ValidListActionsArgs): Promise<ListActionsResult>
13842
- override async listOutputs(auth: AuthId, vargs: ValidListOutputsArgs): Promise<ListOutputsResult>
13843
- override async insertProvenTx(tx: TableProvenTx, trx?: TrxToken): Promise<number>
13844
- override async insertProvenTxReq(tx: TableProvenTxReq, trx?: TrxToken): Promise<number>
13845
- override async insertUser(user: TableUser, trx?: TrxToken): Promise<number>
13846
- override async insertCertificateAuth(auth: AuthId, certificate: TableCertificateX): Promise<number>
13847
- override async insertCertificate(certificate: TableCertificateX, trx?: TrxToken): Promise<number>
13848
- override async insertCertificateField(certificateField: TableCertificateField, trx?: TrxToken): Promise<void>
13849
- override async insertOutputBasket(basket: TableOutputBasket, trx?: TrxToken): Promise<number>
13850
- override async insertTransaction(tx: TableTransaction, trx?: TrxToken): Promise<number>
13851
- override async insertCommission(commission: TableCommission, trx?: TrxToken): Promise<number>
13852
- override async insertOutput(output: TableOutput, trx?: TrxToken): Promise<number>
13853
- override async insertOutputTag(tag: TableOutputTag, trx?: TrxToken): Promise<number>
13854
- override async insertOutputTagMap(tagMap: TableOutputTagMap, trx?: TrxToken): Promise<void>
13855
- override async insertTxLabel(label: TableTxLabel, trx?: TrxToken): Promise<number>
13856
- override async insertTxLabelMap(labelMap: TableTxLabelMap, trx?: TrxToken): Promise<void>
13857
- override async insertMonitorEvent(event: TableMonitorEvent, trx?: TrxToken): Promise<number>
13858
- override async insertSyncState(syncState: TableSyncState, trx?: TrxToken): Promise<number>
13859
- override async updateCertificateField(certificateId: number, fieldName: string, update: Partial<TableCertificateField>, trx?: TrxToken): Promise<number>
13860
- override async updateCertificate(id: number, update: Partial<TableCertificate>, trx?: TrxToken): Promise<number>
13861
- override async updateCommission(id: number, update: Partial<TableCommission>, trx?: TrxToken): Promise<number>
13862
- override async updateOutputBasket(id: number, update: Partial<TableOutputBasket>, trx?: TrxToken): Promise<number>
13863
- override async updateOutput(id: number, update: Partial<TableOutput>, trx?: TrxToken): Promise<number>
13864
- override async updateOutputTagMap(outputId: number, tagId: number, update: Partial<TableOutputTagMap>, trx?: TrxToken): Promise<number>
13865
- override async updateOutputTag(id: number, update: Partial<TableOutputTag>, trx?: TrxToken): Promise<number>
13866
- override async updateProvenTxReq(id: number | number[], update: Partial<TableProvenTxReq>, trx?: TrxToken): Promise<number>
13867
- override async updateProvenTx(id: number, update: Partial<TableProvenTx>, trx?: TrxToken): Promise<number>
13868
- override async updateSyncState(id: number, update: Partial<TableSyncState>, trx?: TrxToken): Promise<number>
13869
- override async updateTransaction(id: number | number[], update: Partial<TableTransaction>, trx?: TrxToken): Promise<number>
13870
- override async updateTxLabelMap(transactionId: number, txLabelId: number, update: Partial<TableTxLabelMap>, trx?: TrxToken): Promise<number>
13871
- override async updateTxLabel(id: number, update: Partial<TableTxLabel>, trx?: TrxToken): Promise<number>
13872
- override async updateUser(id: number, update: Partial<TableUser>, trx?: TrxToken): Promise<number>
13873
- override async updateMonitorEvent(id: number, update: Partial<TableMonitorEvent>, trx?: TrxToken): Promise<number>
13874
- setupQuery<T extends object>(table: string, args: FindPartialSincePagedArgs<T>): Knex.QueryBuilder
13875
- findCertificateFieldsQuery(args: FindCertificateFieldsArgs): Knex.QueryBuilder
13876
- findCertificatesQuery(args: FindCertificatesArgs): Knex.QueryBuilder
13877
- findCommissionsQuery(args: FindCommissionsArgs): Knex.QueryBuilder
13878
- findOutputBasketsQuery(args: FindOutputBasketsArgs): Knex.QueryBuilder
13879
- findOutputsQuery(args: FindOutputsArgs, count?: boolean): Knex.QueryBuilder
13880
- findOutputTagMapsQuery(args: FindOutputTagMapsArgs): Knex.QueryBuilder
13881
- findOutputTagsQuery(args: FindOutputTagsArgs): Knex.QueryBuilder
13882
- findProvenTxReqsQuery(args: FindProvenTxReqsArgs): Knex.QueryBuilder
13883
- findProvenTxsQuery(args: FindProvenTxsArgs): Knex.QueryBuilder
13884
- findSyncStatesQuery(args: FindSyncStatesArgs): Knex.QueryBuilder
13885
- findTransactionsQuery(args: FindTransactionsArgs, count?: boolean): Knex.QueryBuilder
13886
- findTxLabelMapsQuery(args: FindTxLabelMapsArgs): Knex.QueryBuilder
13887
- findTxLabelsQuery(args: FindTxLabelsArgs): Knex.QueryBuilder
13888
- findUsersQuery(args: FindUsersArgs): Knex.QueryBuilder
13889
- findMonitorEventsQuery(args: FindMonitorEventsArgs): Knex.QueryBuilder
13890
- override async findCertificatesAuth(auth: AuthId, args: FindCertificatesArgs): Promise<TableCertificateX[]>
13891
- override async findOutputBasketsAuth(auth: AuthId, args: FindOutputBasketsArgs): Promise<TableOutputBasket[]>
13892
- override async findOutputsAuth(auth: AuthId, args: FindOutputsArgs): Promise<TableOutput[]>
13893
- override async findCertificateFields(args: FindCertificateFieldsArgs): Promise<TableCertificateField[]>
13894
- override async findCertificates(args: FindCertificatesArgs): Promise<TableCertificateX[]>
13895
- override async findCommissions(args: FindCommissionsArgs): Promise<TableCommission[]>
13896
- override async findOutputBaskets(args: FindOutputBasketsArgs): Promise<TableOutputBasket[]>
13897
- override async findOutputs(args: FindOutputsArgs): Promise<TableOutput[]>
13898
- override async findOutputTagMaps(args: FindOutputTagMapsArgs): Promise<TableOutputTagMap[]>
13899
- override async findOutputTags(args: FindOutputTagsArgs): Promise<TableOutputTag[]>
13900
- override async findProvenTxReqs(args: FindProvenTxReqsArgs): Promise<TableProvenTxReq[]>
13901
- override async findProvenTxs(args: FindProvenTxsArgs): Promise<TableProvenTx[]>
13902
- override async findSyncStates(args: FindSyncStatesArgs): Promise<TableSyncState[]>
13903
- override async findTransactions(args: FindTransactionsArgs): Promise<TableTransaction[]>
13904
- override async findTxLabelMaps(args: FindTxLabelMapsArgs): Promise<TableTxLabelMap[]>
13905
- override async findTxLabels(args: FindTxLabelsArgs): Promise<TableTxLabel[]>
13906
- override async findUsers(args: FindUsersArgs): Promise<TableUser[]>
13907
- override async findMonitorEvents(args: FindMonitorEventsArgs): Promise<TableMonitorEvent[]>
13908
- async getCount<T extends object>(q: Knex.QueryBuilder<T, T[]>): Promise<number>
13909
- override async countCertificateFields(args: FindCertificateFieldsArgs): Promise<number>
13910
- override async countCertificates(args: FindCertificatesArgs): Promise<number>
13911
- override async countCommissions(args: FindCommissionsArgs): Promise<number>
13912
- override async countOutputBaskets(args: FindOutputBasketsArgs): Promise<number>
13913
- override async countOutputs(args: FindOutputsArgs): Promise<number>
13914
- override async countOutputTagMaps(args: FindOutputTagMapsArgs): Promise<number>
13915
- override async countOutputTags(args: FindOutputTagsArgs): Promise<number>
13916
- override async countProvenTxReqs(args: FindProvenTxReqsArgs): Promise<number>
13917
- override async countProvenTxs(args: FindProvenTxsArgs): Promise<number>
13918
- override async countSyncStates(args: FindSyncStatesArgs): Promise<number>
13919
- override async countTransactions(args: FindTransactionsArgs): Promise<number>
13920
- override async countTxLabelMaps(args: FindTxLabelMapsArgs): Promise<number>
13921
- override async countTxLabels(args: FindTxLabelsArgs): Promise<number>
13922
- override async countUsers(args: FindUsersArgs): Promise<number>
13923
- override async countMonitorEvents(args: FindMonitorEventsArgs): Promise<number>
13924
- override async destroy(): Promise<void>
13925
- override async migrate(storageName: string, storageIdentityKey: string): Promise<string>
13926
- override async dropAllData(): Promise<void>
13927
- override async transaction<T>(scope: (trx: TrxToken) => Promise<T>, trx?: TrxToken): Promise<T>
13928
- toDb(trx?: TrxToken)
13929
- async validateRawTransaction(t: TableTransaction, trx?: TrxToken): Promise<void>
13930
- _verifiedReadyForDatabaseAccess: boolean = false;
13931
- async verifyReadyForDatabaseAccess(trx?: TrxToken): Promise<DBType>
13932
- validatePartialForUpdate<T extends EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
13933
- async validateEntityForInsert<T extends EntityTimeStamp>(entity: T, trx?: TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
13934
- override async getLabelsForTransactionId(transactionId?: number, trx?: TrxToken): Promise<TableTxLabel[]>
13935
- override async getTagsForOutputId(outputId: number, trx?: TrxToken): Promise<TableOutputTag[]>
13936
- override async purgeData(params: PurgeParams, trx?: TrxToken): Promise<PurgeResults>
13937
- override async reviewStatus(args: {
13938
- agedLimit: Date;
13939
- trx?: TrxToken;
13940
- }): Promise<{
13941
- log: string;
13942
- }>
13943
- async countChangeInputs(userId: number, basketId: number, excludeSending: boolean): Promise<number>
13944
- async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<TableOutput | undefined> {
13945
- const status: TransactionStatus[] = ["completed", "unproven"];
13946
- if (!excludeSending)
13947
- status.push("sending");
13948
- const statusText = status.map(s => `'${s}'`).join(",");
13949
- const r: TableOutput | undefined = await this.knex.transaction(async (trx) => {
13950
- const txStatusCondition = `AND (SELECT status FROM transactions WHERE outputs.transactionId = transactions.transactionId) in (${statusText})`;
13951
- let outputId: number | undefined;
13952
- const setOutputId = async (rawQuery: string): Promise<void> => {
13953
- let oidr = await trx.raw(rawQuery);
13954
- outputId = undefined;
13955
- if (!oidr["outputId"] && oidr.length > 0)
13956
- oidr = oidr[0];
13957
- if (!oidr["outputId"] && oidr.length > 0)
13958
- oidr = oidr[0];
13959
- if (oidr["outputId"])
13960
- outputId = Number(oidr["outputId"]);
13961
- };
13962
- if (exactSatoshis !== undefined) {
13963
- await setOutputId(`
13964
- SELECT outputId
13965
- FROM outputs
13966
- WHERE userId = ${userId}
13967
- AND spendable = 1
13968
- AND basketId = ${basketId}
13969
- ${txStatusCondition}
13970
- AND satoshis = ${exactSatoshis}
13971
- LIMIT 1;
13972
- `);
13973
- }
13974
- if (outputId === undefined) {
13975
- await setOutputId(`
13976
- SELECT outputId
13977
- FROM outputs
13978
- WHERE userId = ${userId}
13979
- AND spendable = 1
13980
- AND basketId = ${basketId}
13981
- ${txStatusCondition}
13982
- AND satoshis - ${targetSatoshis} = (
13983
- SELECT MIN(satoshis - ${targetSatoshis})
13984
- FROM outputs
13985
- WHERE userId = ${userId}
13986
- AND spendable = 1
13987
- AND basketId = ${basketId}
13988
- ${txStatusCondition}
13989
- AND satoshis - ${targetSatoshis} >= 0
13990
- )
13991
- LIMIT 1;
13992
- `);
13993
- }
13994
- if (outputId === undefined) {
13995
- await setOutputId(`
13996
- SELECT outputId
13997
- FROM outputs
13998
- WHERE userId = ${userId}
13999
- AND spendable = 1
14000
- AND basketId = ${basketId}
14001
- ${txStatusCondition}
14002
- AND satoshis - ${targetSatoshis} = (
14003
- SELECT MAX(satoshis - ${targetSatoshis})
14004
- FROM outputs
14005
- WHERE userId = ${userId}
14006
- AND spendable = 1
14007
- AND basketId = ${basketId}
14008
- ${txStatusCondition}
14009
- AND satoshis - ${targetSatoshis} < 0
14010
- )
14011
- LIMIT 1;
14012
- `);
14013
- }
14014
- if (outputId === undefined)
14015
- return undefined;
14016
- await this.updateOutput(outputId, {
14017
- spendable: false,
14018
- spentBy: transactionId
14019
- }, trx);
14020
- const r = verifyTruthy(await this.findOutputById(outputId, trx));
14021
- return r;
14022
- });
14023
- return r;
14024
- }
14025
- validateEntity<T extends EntityTimeStamp>(entity: T, dateFields?: string[], booleanFields?: string[]): T
14026
- validateEntities<T extends EntityTimeStamp>(entities: T[], dateFields?: string[], booleanFields?: string[]): T[]
14027
- async adminStats(adminIdentityKey: string): Promise<AdminStatsResult> {
14028
- if (this.dbtype !== "MySQL")
14029
- throw new WERR_NOT_IMPLEMENTED("adminStats, only MySQL is supported");
14030
- const monitorEvent = verifyOneOrNone(await this.findMonitorEvents({
14031
- partial: { event: "MonitorCallHistory" },
14032
- orderDescending: true,
14033
- paged: { limit: 1 }
14034
- }));
14035
- const monitorStats: ServicesCallHistory | undefined = monitorEvent ? JSON.parse(monitorEvent.details!) : undefined;
14036
- const servicesStats = this.getServices().getServicesCallHistory(true);
14037
- await this.insertMonitorEvent({
14038
- event: "ServicesCallHistory",
14039
- details: JSON.stringify(servicesStats),
14040
- created_at: new Date(),
14041
- updated_at: new Date(),
14042
- id: 0
14043
- });
14044
- const one_day_ago = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
14045
- const one_week_ago = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString();
14046
- const one_month_ago = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString();
14047
- const [[{ usersDay, usersMonth, usersWeek, usersTotal, transactionsDay, transactionsMonth, transactionsWeek, transactionsTotal, txCompletedDay, txCompletedMonth, txCompletedWeek, txCompletedTotal, txFailedDay, txFailedMonth, txFailedWeek, txFailedTotal, txUnprocessedDay, txUnprocessedMonth, txUnprocessedWeek, txUnprocessedTotal, txSendingDay, txSendingMonth, txSendingWeek, txSendingTotal, txUnprovenDay, txUnprovenMonth, txUnprovenWeek, txUnprovenTotal, txUnsignedDay, txUnsignedMonth, txUnsignedWeek, txUnsignedTotal, txNosendDay, txNosendMonth, txNosendWeek, txNosendTotal, txNonfinalDay, txNonfinalMonth, txNonfinalWeek, txNonfinalTotal, txUnfailDay, txUnfailMonth, txUnfailWeek, txUnfailTotal, satoshisDefaultDay, satoshisDefaultMonth, satoshisDefaultWeek, satoshisDefaultTotal, satoshisOtherDay, satoshisOtherMonth, satoshisOtherWeek, satoshisOtherTotal, basketsDay, basketsMonth, basketsWeek, basketsTotal, labelsDay, labelsMonth, labelsWeek, labelsTotal, tagsDay, tagsMonth, tagsWeek, tagsTotal }]] = await this.knex.raw(`
14048
- select
14049
- (select count(*) from users where created_at > '${one_day_ago}') as usersDay,
14050
- (select count(*) from users where created_at > '${one_week_ago}') as usersWeek,
14051
- (select count(*) from users where created_at > '${one_month_ago}') as usersMonth,
14052
- (select count(*) from users) as usersTotal,
14053
- (select count(*) from transactions where created_at > '${one_day_ago}') as transactionsDay,
14054
- (select count(*) from transactions where created_at > '${one_week_ago}') as transactionsWeek,
14055
- (select count(*) from transactions where created_at > '${one_month_ago}') as transactionsMonth,
14056
- (select count(*) from transactions) as transactionsTotal,
14057
- (select count(*) from transactions where status = 'completed' and created_at > '${one_day_ago}') as txCompletedDay,
14058
- (select count(*) from transactions where status = 'completed' and created_at > '${one_week_ago}') as txCompletedWeek,
14059
- (select count(*) from transactions where status = 'completed' and created_at > '${one_month_ago}') as txCompletedMonth,
14060
- (select count(*) from transactions where status = 'completed') as txCompletedTotal,
14061
- (select count(*) from transactions where status = 'failed' and created_at > '${one_day_ago}') as txFailedDay,
14062
- (select count(*) from transactions where status = 'failed' and created_at > '${one_week_ago}') as txFailedWeek,
14063
- (select count(*) from transactions where status = 'failed' and created_at > '${one_month_ago}') as txFailedMonth,
14064
- (select count(*) from transactions where status = 'failed') as txFailedTotal,
14065
- (select count(*) from transactions where status = 'unprocessed' and created_at > '${one_day_ago}') as txUnprocessedDay,
14066
- (select count(*) from transactions where status = 'unprocessed' and created_at > '${one_week_ago}') as txUnprocessedWeek,
14067
- (select count(*) from transactions where status = 'unprocessed' and created_at > '${one_month_ago}') as txUnprocessedMonth,
14068
- (select count(*) from transactions where status = 'unprocessed') as txUnprocessedTotal,
14069
- (select count(*) from transactions where status = 'sending' and created_at > '${one_day_ago}') as txSendingDay,
14070
- (select count(*) from transactions where status = 'sending' and created_at > '${one_week_ago}') as txSendingWeek,
14071
- (select count(*) from transactions where status = 'sending' and created_at > '${one_month_ago}') as txSendingMonth,
14072
- (select count(*) from transactions where status = 'sending') as txSendingTotal,
14073
- (select count(*) from transactions where status = 'unproven' and created_at > '${one_day_ago}') as txUnprovenDay,
14074
- (select count(*) from transactions where status = 'unproven' and created_at > '${one_week_ago}') as txUnprovenWeek,
14075
- (select count(*) from transactions where status = 'unproven' and created_at > '${one_month_ago}') as txUnprovenMonth,
14076
- (select count(*) from transactions where status = 'unproven') as txUnprovenTotal,
14077
- (select count(*) from transactions where status = 'unsigned' and created_at > '${one_day_ago}') as txUnsignedDay,
14078
- (select count(*) from transactions where status = 'unsigned' and created_at > '${one_week_ago}') as txUnsignedWeek,
14079
- (select count(*) from transactions where status = 'unsigned' and created_at > '${one_month_ago}') as txUnsignedMonth,
14080
- (select count(*) from transactions where status = 'unsigned') as txUnsignedTotal,
14081
- (select count(*) from transactions where status = 'nosend' and created_at > '${one_day_ago}') as txNosendDay,
14082
- (select count(*) from transactions where status = 'nosend' and created_at > '${one_week_ago}') as txNosendWeek,
14083
- (select count(*) from transactions where status = 'nosend' and created_at > '${one_month_ago}') as txNosendMonth,
14084
- (select count(*) from transactions where status = 'nosend') as txNosendTotal,
14085
- (select count(*) from transactions where status = 'nonfinal' and created_at > '${one_day_ago}') as txNonfinalDay,
14086
- (select count(*) from transactions where status = 'nonfinal' and created_at > '${one_week_ago}') as txNonfinalWeek,
14087
- (select count(*) from transactions where status = 'nonfinal' and created_at > '${one_month_ago}') as txNonfinalMonth,
14088
- (select count(*) from transactions where status = 'nonfinal') as txNonfinalTotal,
14089
- (select count(*) from transactions where status = 'unfail' and created_at > '${one_day_ago}') as txUnfailDay,
14090
- (select count(*) from transactions where status = 'unfail' and created_at > '${one_week_ago}') as txUnfailWeek,
14091
- (select count(*) from transactions where status = 'unfail' and created_at > '${one_month_ago}') as txUnfailMonth,
14092
- (select count(*) from transactions where status = 'unfail') as txUnfailTotal,
14093
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 1 and created_at > '${one_day_ago}') as satoshisDefaultDay,
14094
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 1 and created_at > '${one_week_ago}') as satoshisDefaultWeek,
14095
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 1 and created_at > '${one_month_ago}') as satoshisDefaultMonth,
14096
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 1) as satoshisDefaultTotal,
14097
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 0 and not basketId is null and created_at > '${one_day_ago}') as satoshisOtherDay,
14098
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 0 and not basketId is null and created_at > '${one_week_ago}') as satoshisOtherWeek,
14099
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 0 and not basketId is null and created_at > '${one_month_ago}') as satoshisOtherMonth,
14100
- (select sum(satoshis) from outputs where spendable = 1 and \`change\` = 0 and not basketId is null) as satoshisOtherTotal,
14101
- (select count(*) from output_baskets where created_at > '${one_day_ago}') as basketsDay,
14102
- (select count(*) from output_baskets where created_at > '${one_week_ago}') as basketsWeek,
14103
- (select count(*) from output_baskets where created_at > '${one_month_ago}') as basketsMonth,
14104
- (select count(*) from output_baskets) as basketsTotal,
14105
- (select count(*) from tx_labels where created_at > '${one_day_ago}') as labelsDay,
14106
- (select count(*) from tx_labels where created_at > '${one_week_ago}') as labelsWeek,
14107
- (select count(*) from tx_labels where created_at > '${one_month_ago}') as labelsMonth,
14108
- (select count(*) from tx_labels) as labelsTotal,
14109
- (select count(*) from output_tags where created_at > '${one_day_ago}') as tagsDay,
14110
- (select count(*) from output_tags where created_at > '${one_week_ago}') as tagsWeek,
14111
- (select count(*) from output_tags where created_at > '${one_month_ago}') as tagsMonth,
14112
- (select count(*) from output_tags) as tagsTotal
14113
- `);
14114
- const r: AdminStatsResult = {
14115
- monitorStats,
14116
- servicesStats,
14117
- requestedBy: adminIdentityKey,
14118
- when: new Date().toISOString(),
14119
- usersDay,
14120
- usersWeek,
14121
- usersMonth,
14122
- usersTotal,
14123
- transactionsDay,
14124
- transactionsWeek,
14125
- transactionsMonth,
14126
- transactionsTotal,
14127
- txCompletedDay,
14128
- txCompletedWeek,
14129
- txCompletedMonth,
14130
- txCompletedTotal,
14131
- txFailedDay,
14132
- txFailedWeek,
14133
- txFailedMonth,
14134
- txFailedTotal,
14135
- txUnprocessedDay,
14136
- txUnprocessedWeek,
14137
- txUnprocessedMonth,
14138
- txUnprocessedTotal,
14139
- txSendingDay,
14140
- txSendingWeek,
14141
- txSendingMonth,
14142
- txSendingTotal,
14143
- txUnprovenDay,
14144
- txUnprovenWeek,
14145
- txUnprovenMonth,
14146
- txUnprovenTotal,
14147
- txUnsignedDay,
14148
- txUnsignedWeek,
14149
- txUnsignedMonth,
14150
- txUnsignedTotal,
14151
- txNosendDay,
14152
- txNosendWeek,
14153
- txNosendMonth,
14154
- txNosendTotal,
14155
- txNonfinalDay,
14156
- txNonfinalWeek,
14157
- txNonfinalMonth,
14158
- txNonfinalTotal,
14159
- txUnfailDay,
14160
- txUnfailWeek,
14161
- txUnfailMonth,
14162
- txUnfailTotal,
14163
- satoshisDefaultDay: Number(satoshisDefaultDay),
14164
- satoshisDefaultWeek: Number(satoshisDefaultWeek),
14165
- satoshisDefaultMonth: Number(satoshisDefaultMonth),
14166
- satoshisDefaultTotal: Number(satoshisDefaultTotal),
14167
- satoshisOtherDay: Number(satoshisOtherDay),
14168
- satoshisOtherWeek: Number(satoshisOtherWeek),
14169
- satoshisOtherMonth: Number(satoshisOtherMonth),
14170
- satoshisOtherTotal: Number(satoshisOtherTotal),
14171
- basketsDay,
14172
- basketsWeek,
14173
- basketsMonth,
14174
- basketsTotal,
14175
- labelsDay,
14176
- labelsWeek,
14177
- labelsMonth,
14178
- labelsTotal,
14179
- tagsDay,
14180
- tagsWeek,
14181
- tagsMonth,
14182
- tagsTotal
14183
- };
14184
- return r;
14185
- }
14186
- }
14187
- ```
14188
-
14189
- See also: [AdminStatsResult](./storage.md#interface-adminstatsresult), [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindPartialSincePagedArgs](./client.md#interface-findpartialsincepagedargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [ServicesCallHistory](./client.md#type-servicescallhistory), [StorageKnexOptions](./storage.md#interface-storageknexoptions), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TransactionStatus](./client.md#type-transactionstatus), [TrxToken](./client.md#interface-trxtoken), [ValidListActionsArgs](./client.md#interface-validlistactionsargs), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs), [WERR_NOT_IMPLEMENTED](./client.md#class-werr_not_implemented), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [listActions](./storage.md#function-listactions), [listOutputs](./storage.md#function-listoutputs), [purgeData](./storage.md#function-purgedata), [reviewStatus](./storage.md#function-reviewstatus), [verifyOneOrNone](./client.md#function-verifyoneornone), [verifyTruthy](./client.md#function-verifytruthy)
14190
-
14191
- ###### Method allocateChangeInput
14192
-
14193
- Finds closest matching available change output to use as input for new transaction.
14194
-
14195
- Transactionally allocate the output such that
14196
-
14197
- ```ts
14198
- async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<TableOutput | undefined>
14199
- ```
14200
- See also: [TableOutput](./storage.md#interface-tableoutput)
14201
-
14202
- ###### Method countChangeInputs
14203
-
14204
- Counts the outputs for userId in basketId that are spendable: true
14205
- AND whose transaction status is one of:
14206
- - completed
14207
- - unproven
14208
- - sending (if excludeSending is false)
14209
-
14210
- ```ts
14211
- async countChangeInputs(userId: number, basketId: number, excludeSending: boolean): Promise<number>
14212
- ```
14213
-
14214
- ###### Method toDb
14215
-
14216
- Convert the standard optional `TrxToken` parameter into either a direct knex database instance,
14217
- or a Knex.Transaction as appropriate.
14218
-
14219
- ```ts
14220
- toDb(trx?: TrxToken)
14221
- ```
14222
- See also: [TrxToken](./client.md#interface-trxtoken)
14223
-
14224
- ###### Method validateEntities
14225
-
14226
- Helper to force uniform behavior across database engines.
14227
- Use to process all arrays of records with time stamps retreived from database.
14228
-
14229
- ```ts
14230
- validateEntities<T extends EntityTimeStamp>(entities: T[], dateFields?: string[], booleanFields?: string[]): T[]
14231
- ```
14232
- See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
14233
-
14234
- Returns
14235
-
14236
- input `entities` array with contained values validated.
14237
-
14238
- ###### Method validateEntity
14239
-
14240
- Helper to force uniform behavior across database engines.
14241
- Use to process all individual records with time stamps retreived from database.
14242
-
14243
- ```ts
14244
- validateEntity<T extends EntityTimeStamp>(entity: T, dateFields?: string[], booleanFields?: string[]): T
14245
- ```
14246
- See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
14247
-
14248
- ###### Method validateEntityForInsert
14249
-
14250
- Helper to force uniform behavior across database engines.
14251
- Use to process new entities being inserted into the database.
14252
-
14253
- ```ts
14254
- async validateEntityForInsert<T extends EntityTimeStamp>(entity: T, trx?: TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
14255
- ```
14256
- See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [TrxToken](./client.md#interface-trxtoken)
14257
-
14258
- ###### Method validatePartialForUpdate
14259
-
14260
- Helper to force uniform behavior across database engines.
14261
- Use to process the update template for entities being updated.
14262
-
14263
- ```ts
14264
- validatePartialForUpdate<T extends EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
14265
- ```
14266
- See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
14267
-
14268
- ###### Method verifyReadyForDatabaseAccess
14269
-
14270
- Make sure database is ready for access:
14271
-
14272
- - dateScheme is known
14273
- - foreign key constraints are enabled
14274
-
14275
- ```ts
14276
- async verifyReadyForDatabaseAccess(trx?: TrxToken): Promise<DBType>
14277
- ```
14278
- See also: [DBType](./storage.md#type-dbtype), [TrxToken](./client.md#interface-trxtoken)
14279
-
14280
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
14281
-
14282
12843
  ---
14283
12844
  ##### Class: StorageProvider
14284
12845
 
@@ -15028,273 +13589,6 @@ See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq)
15028
13589
 
15029
13590
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
15030
13591
 
15031
- ---
15032
- ##### Class: TestUtilsWalletStorage
15033
-
15034
- ```ts
15035
- export abstract class TestUtilsWalletStorage {
15036
- static noEnv(chain: Chain): boolean
15037
- static noTestEnv(chain: Chain): boolean
15038
- static getEnvFlags(chain: Chain): TuEnvFlags
15039
- static getEnv(chain: Chain): TuEnv
15040
- static async createMainReviewSetup(): Promise<{
15041
- env: TuEnv;
15042
- storage: StorageKnex;
15043
- services: Services;
15044
- }>
15045
- static async createNoSendP2PKHTestOutpoint(address: string, satoshis: number, noSendChange: string[] | undefined, wallet: WalletInterface): Promise<{
15046
- noSendChange: string[];
15047
- txid: string;
15048
- cr: CreateActionResult;
15049
- sr: SignActionResult;
15050
- }>
15051
- static async createNoSendP2PKHTestOutpoints(count: number, address: string, satoshis: number, noSendChange: string[] | undefined, wallet: WalletInterface): Promise<{
15052
- noSendChange: string[];
15053
- txid: string;
15054
- cr: CreateActionResult;
15055
- sr: SignActionResult;
15056
- }>
15057
- static getKeyPair(priv?: string | PrivateKey): TestKeyPair
15058
- static getLockP2PKH(address: string)
15059
- static getUnlockP2PKH(priv: PrivateKey, satoshis: number)
15060
- static async createWalletOnly(args: {
15061
- chain?: Chain;
15062
- rootKeyHex?: string;
15063
- active?: WalletStorageProvider;
15064
- backups?: WalletStorageProvider[];
15065
- privKeyHex?: string;
15066
- }): Promise<TestWalletOnly>
15067
- static async createTestWallet(args: Chain | CreateTestWalletArgs): Promise<TestWalletNoSetup>
15068
- static async createTestWalletWithStorageClient(args: {
15069
- rootKeyHex?: string;
15070
- endpointUrl?: string;
15071
- chain?: Chain;
15072
- }): Promise<TestWalletOnly>
15073
- static async createKnexTestWalletWithSetup<T>(args: {
15074
- knex: Knex<any, any[]>;
15075
- databaseName: string;
15076
- chain?: Chain;
15077
- rootKeyHex?: string;
15078
- dropAll?: boolean;
15079
- privKeyHex?: string;
15080
- insertSetup: (storage: StorageKnex, identityKey: string) => Promise<T>;
15081
- }): Promise<TestWallet<T>>
15082
- static async newTmpFile(filename = "", tryToDelete = false, copyToTmp = false, reuseExisting = false): Promise<string>
15083
- static async copyFile(srcPath: string, dstPath: string): Promise<void>
15084
- static async existingDataFile(filename: string): Promise<string>
15085
- static createLocalSQLite(filename: string): Knex
15086
- static createMySQLFromConnection(connection: object): Knex
15087
- static createLocalMySQL(database: string): Knex
15088
- static async createMySQLTestWallet(args: {
15089
- databaseName: string;
15090
- chain?: Chain;
15091
- rootKeyHex?: string;
15092
- dropAll?: boolean;
15093
- }): Promise<TestWallet<{}>>
15094
- static async createMySQLTestSetup1Wallet(args: {
15095
- databaseName: string;
15096
- chain?: Chain;
15097
- rootKeyHex?: string;
15098
- }): Promise<TestWallet<TestSetup1>>
15099
- static async createMySQLTestSetup2Wallet(args: {
15100
- databaseName: string;
15101
- mockData: MockData;
15102
- chain?: Chain;
15103
- rootKeyHex?: string;
15104
- }): Promise<TestWallet<TestSetup2>>
15105
- static async createSQLiteTestWallet(args: {
15106
- filePath?: string;
15107
- databaseName: string;
15108
- chain?: Chain;
15109
- rootKeyHex?: string;
15110
- dropAll?: boolean;
15111
- privKeyHex?: string;
15112
- }): Promise<TestWalletNoSetup>
15113
- static async createSQLiteTestSetup1Wallet(args: {
15114
- databaseName: string;
15115
- chain?: Chain;
15116
- rootKeyHex?: string;
15117
- }): Promise<TestWallet<TestSetup1>>
15118
- static async createSQLiteTestSetup2Wallet(args: {
15119
- databaseName: string;
15120
- mockData: MockData;
15121
- chain?: Chain;
15122
- rootKeyHex?: string;
15123
- }): Promise<TestWallet<TestSetup2>>
15124
- static async createKnexTestWallet(args: {
15125
- knex: Knex<any, any[]>;
15126
- databaseName: string;
15127
- chain?: Chain;
15128
- rootKeyHex?: string;
15129
- dropAll?: boolean;
15130
- privKeyHex?: string;
15131
- }): Promise<TestWalletNoSetup>
15132
- static async createKnexTestSetup1Wallet(args: {
15133
- knex: Knex<any, any[]>;
15134
- databaseName: string;
15135
- chain?: Chain;
15136
- rootKeyHex?: string;
15137
- dropAll?: boolean;
15138
- }): Promise<TestWallet<TestSetup1>>
15139
- static async createKnexTestSetup2Wallet(args: {
15140
- knex: Knex<any, any[]>;
15141
- databaseName: string;
15142
- mockData: MockData;
15143
- chain?: Chain;
15144
- rootKeyHex?: string;
15145
- dropAll?: boolean;
15146
- }): Promise<TestWallet<TestSetup2>>
15147
- static async fileExists(file: string): Promise<boolean>
15148
- static async createLegacyWalletSQLiteCopy(databaseName: string): Promise<TestWalletNoSetup>
15149
- static async createLegacyWalletMySQLCopy(databaseName: string): Promise<TestWalletNoSetup>
15150
- static async createLiveWalletSQLiteWARNING(databaseFullPath: string = "./test/data/walletLiveTestData.sqlite"): Promise<TestWalletNoSetup>
15151
- static async createWalletSQLite(databaseFullPath: string = "./test/data/tmp/walletNewTestData.sqlite", databaseName: string = "walletNewTestData"): Promise<TestWalletNoSetup>
15152
- static legacyRootKeyHex = "153a3df216" + "686f55b253991c" + "7039da1f648" + "ffc5bfe93d6ac2c25ac" + "2d4070918d";
15153
- static async createLegacyWalletCopy(databaseName: string, walletKnex: Knex<any, any[]>, tryCopyToPath?: string): Promise<TestWalletNoSetup>
15154
- static wrapProfiling(o: Object, name: string): Record<string, {
15155
- count: number;
15156
- totalMsecs: number;
15157
- }>
15158
- static async createIdbLegacyWalletCopy(databaseName: string): Promise<TestWalletProviderNoSetup>
15159
- static makeSampleCert(subject?: string): {
15160
- cert: WalletCertificate;
15161
- subject: string;
15162
- certifier: PrivateKey;
15163
- }
15164
- static async insertTestProvenTx(storage: StorageProvider, txid?: string, trx?: TrxToken)
15165
- static async insertTestProvenTxReq(storage: StorageProvider, txid?: string, provenTxId?: number, onlyRequired?: boolean)
15166
- static async insertTestUser(storage: StorageProvider, identityKey?: string)
15167
- static async insertTestCertificate(storage: StorageProvider, u?: TableUser)
15168
- static async insertTestCertificateField(storage: StorageProvider, c: TableCertificate, name: string, value: string)
15169
- static async insertTestOutputBasket(storage: StorageProvider, u?: TableUser | number, partial?: Partial<TableOutputBasket>)
15170
- static async insertTestTransaction(storage: StorageProvider, u?: TableUser, onlyRequired?: boolean, partial?: Partial<TableTransaction>)
15171
- static async insertTestOutput(storage: StorageProvider, t: TableTransaction, vout: number, satoshis: number, basket?: TableOutputBasket, requiredOnly?: boolean, partial?: Partial<TableOutput>)
15172
- static async insertTestOutputTag(storage: StorageProvider, u: TableUser, partial?: Partial<TableOutputTag>)
15173
- static async insertTestOutputTagMap(storage: StorageProvider, o: TableOutput, tag: TableOutputTag)
15174
- static async insertTestTxLabel(storage: StorageProvider, u: TableUser, partial?: Partial<TableTxLabel>)
15175
- static async insertTestTxLabelMap(storage: StorageProvider, tx: TableTransaction, label: TableTxLabel, partial?: Partial<TableTxLabelMap>)
15176
- static async insertTestSyncState(storage: StorageProvider, u: TableUser)
15177
- static async insertTestMonitorEvent(storage: StorageProvider)
15178
- static async insertTestCommission(storage: StorageProvider, t: TableTransaction)
15179
- static async createTestSetup1(storage: StorageProvider, u1IdentityKey?: string): Promise<TestSetup1>
15180
- static async createTestSetup2(storage: StorageProvider, identityKey: string, mockData: MockData = { actions: [] }): Promise<TestSetup2>
15181
- static mockPostServicesAsSuccess(ctxs: TestWalletOnly[]): void
15182
- static mockPostServicesAsError(ctxs: TestWalletOnly[]): void
15183
- static mockPostServicesAsCallback(ctxs: TestWalletOnly[], callback: (beef: Beef, txids: string[]) => "success" | "error"): void
15184
- static mockMerklePathServicesAsCallback(ctxs: TestWalletOnly[], callback: (txid: string) => Promise<GetMerklePathResult>): void
15185
- static async createWalletSetupEnv(chain: Chain): Promise<TestWalletOnly>
15186
- static async createNoSendTxPair(wallet: Wallet | Chain, satoshis = 41): Promise<{
15187
- txidDo: string;
15188
- txidUndo: string;
15189
- beef: Beef;
15190
- doubleSpendTx: Transaction;
15191
- }>
15192
- }
15193
- ```
15194
-
15195
- See also: [Chain](./client.md#type-chain), [CreateTestWalletArgs](./client.md#interface-createtestwalletargs), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [MockData](./client.md#interface-mockdata), [Services](./services.md#class-services), [StorageKnex](./storage.md#class-storageknex), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TestKeyPair](./client.md#type-testkeypair), [TestSetup1](./client.md#interface-testsetup1), [TestSetup2](./client.md#interface-testsetup2), [TestWallet](./client.md#interface-testwallet), [TestWalletNoSetup](./client.md#type-testwalletnosetup), [TestWalletOnly](./client.md#interface-testwalletonly), [TestWalletProviderNoSetup](./client.md#type-testwalletprovidernosetup), [TrxToken](./client.md#interface-trxtoken), [TuEnv](./client.md#interface-tuenv), [TuEnvFlags](./client.md#interface-tuenvflags), [Wallet](./client.md#class-wallet), [WalletStorageProvider](./client.md#interface-walletstorageprovider)
15196
-
15197
- ###### Method createNoSendTxPair
15198
-
15199
- Create a pair of transacitons that cancel out, other than the transaciton fees.
15200
- Both created transactions are left with status 'noSend'.
15201
- This allows the transactions to either be broadcast by an external party,
15202
- or they may be aborted.
15203
-
15204
- `doubleSpendTx` should only be used for double spend testing.
15205
- It attempts to forward the txidDo input, which should already have been reclaimed by txidUndo, to a random private key output.
15206
-
15207
- ```ts
15208
- static async createNoSendTxPair(wallet: Wallet | Chain, satoshis = 41): Promise<{
15209
- txidDo: string;
15210
- txidUndo: string;
15211
- beef: Beef;
15212
- doubleSpendTx: Transaction;
15213
- }>
15214
- ```
15215
- See also: [Chain](./client.md#type-chain), [Wallet](./client.md#class-wallet)
15216
-
15217
- Returns
15218
-
15219
- : string, txidUndo: string, beef: Beef, doubleSpendTx: transaction }
15220
-
15221
- Argument Details
15222
-
15223
- + **wallet**
15224
- + the wallet that will create both transactions, or Chain and createWalletEnv is used to create a wallet.
15225
- + **satoshis**
15226
- + amount of new output created and consumed. Defaults to 41.
15227
-
15228
- ###### Method createTestWallet
15229
-
15230
- Creates a wallet with both local sqlite and cloud stores, the local store is left active.
15231
-
15232
- Requires a valid .env file with chain matching testIdentityKey and testFilePath properties valid.
15233
- Or `args` with those properties.
15234
-
15235
- Verifies wallet has at least 1000 satoshis in at least 10 change utxos.
15236
-
15237
- ```ts
15238
- static async createTestWallet(args: Chain | CreateTestWalletArgs): Promise<TestWalletNoSetup>
15239
- ```
15240
- See also: [Chain](./client.md#type-chain), [CreateTestWalletArgs](./client.md#interface-createtestwalletargs), [TestWalletNoSetup](./client.md#type-testwalletnosetup)
15241
-
15242
- ###### Method newTmpFile
15243
-
15244
- Returns path to temporary file in project's './test/data/tmp/' folder.
15245
-
15246
- Creates any missing folders.
15247
-
15248
- Optionally tries to delete any existing file. This may fail if the file file is locked
15249
- by another process.
15250
-
15251
- Optionally copies filename (or if filename has no dir component, a file of the same filename from the project's './test/data' folder) to initialize file's contents.
15252
-
15253
- CAUTION: returned file path will include four random hex digits unless tryToDelete is true. Files must be purged periodically.
15254
-
15255
- ```ts
15256
- static async newTmpFile(filename = "", tryToDelete = false, copyToTmp = false, reuseExisting = false): Promise<string>
15257
- ```
15258
-
15259
- Returns
15260
-
15261
- path in './test/data/tmp' folder.
15262
-
15263
- Argument Details
15264
-
15265
- + **filename**
15266
- + target filename without path, optionally just extension in which case random name is used
15267
- + **tryToDelete**
15268
- + true to attempt to delete an existing file at the returned file path.
15269
- + **copyToTmp**
15270
- + true to copy file of same filename from './test/data' (or elsewhere if filename has path) to tmp folder
15271
- + **reuseExisting**
15272
- + true to use existing file if found, otherwise a random string is added to filename.
15273
-
15274
- ###### Method noEnv
15275
-
15276
- ```ts
15277
- static noEnv(chain: Chain): boolean
15278
- ```
15279
- See also: [Chain](./client.md#type-chain)
15280
-
15281
- Returns
15282
-
15283
- true if .env has truthy idenityKey, idenityKey2 values for chain
15284
-
15285
- ###### Method noTestEnv
15286
-
15287
- ```ts
15288
- static noTestEnv(chain: Chain): boolean
15289
- ```
15290
- See also: [Chain](./client.md#type-chain)
15291
-
15292
- Returns
15293
-
15294
- true if .env is not valid for chain or testIdentityKey or testFilePath are undefined or empty.
15295
-
15296
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
15297
-
15298
13592
  ---
15299
13593
  ##### Class: TwilioPhoneInteractor
15300
13594
 
@@ -17129,80 +15423,64 @@ returns the last 10 block headers including height, size, chainwork...
17129
15423
 
17130
15424
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17131
15425
 
17132
- ---
17133
- ##### Class: _tu
17134
-
17135
- ```ts
17136
- export abstract class _tu extends TestUtilsWalletStorage {
17137
- }
17138
- ```
17139
-
17140
- See also: [TestUtilsWalletStorage](./client.md#class-testutilswalletstorage)
17141
-
17142
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17143
-
17144
15426
  ---
17145
15427
  #### Functions
17146
15428
 
17147
15429
  | | | |
17148
15430
  | --- | --- | --- |
17149
- | [WocHeadersBulkListener](#function-wocheadersbulklistener) | [isBlockHeader](#function-isblockheader) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) |
17150
- | [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [isCreateActionSpecOp](#function-iscreateactionspecop) | [validateAbortActionArgs](#function-validateabortactionargs) |
17151
- | [WocHeadersLiveListener](#function-wocheaderslivelistener) | [isHexString](#function-ishexstring) | [validateAcquireCertificateArgs](#function-validateacquirecertificateargs) |
17152
- | [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [isKnownValidBulkHeaderFile](#function-isknownvalidbulkheaderfile) | [validateAcquireDirectCertificateArgs](#function-validateacquiredirectcertificateargs) |
17153
- | [acquireDirectCertificate](#function-acquiredirectcertificate) | [isListActionsSpecOp](#function-islistactionsspecop) | [validateAcquireIssuanceCertificateArgs](#function-validateacquireissuancecertificateargs) |
17154
- | [addWork](#function-addwork) | [isListOutputsSpecOp](#function-islistoutputsspecop) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
17155
- | [arcDefaultUrl](#function-arcdefaulturl) | [isLive](#function-islive) | [validateBasketInsertion](#function-validatebasketinsertion) |
17156
- | [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [isLiveBlockHeader](#function-isliveblockheader) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
17157
- | [arraysEqual](#function-arraysequal) | [isMoreWork](#function-ismorework) | [validateBulkFileData](#function-validatebulkfiledata) |
17158
- | [asArray](#function-asarray) | [listActions](#function-listactions) | [validateCreateActionArgs](#function-validatecreateactionargs) |
17159
- | [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [listActionsIdb](#function-listactionsidb) | [validateCreateActionInput](#function-validatecreateactioninput) |
17160
- | [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [listCertificates](#function-listcertificates) | [validateCreateActionOptions](#function-validatecreateactionoptions) |
17161
- | [asBsvSdkScript](#function-asbsvsdkscript) | [listOutputs](#function-listoutputs) | [validateCreateActionOutput](#function-validatecreateactionoutput) |
17162
- | [asBsvSdkTx](#function-asbsvsdktx) | [listOutputsIdb](#function-listoutputsidb) | [validateDiscoverByAttributesArgs](#function-validatediscoverbyattributesargs) |
17163
- | [asString](#function-asstring) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [validateDiscoverByIdentityKeyArgs](#function-validatediscoverbyidentitykeyargs) |
17164
- | [asUint8Array](#function-asuint8array) | [logBasket](#function-logbasket) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
17165
- | [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [logInput](#function-loginput) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
17166
- | [blockHash](#function-blockhash) | [logOutput](#function-logoutput) | [validateGenesisHeader](#function-validategenesisheader) |
17167
- | [buildSignableTransaction](#function-buildsignabletransaction) | [logTransaction](#function-logtransaction) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
17168
- | [cleanUnprocessedTransactionsUsingAbort](#function-cleanunprocessedtransactionsusingabort) | [makeAtomicBeef](#function-makeatomicbeef) | [validateHeaderFormat](#function-validateheaderformat) |
17169
- | [cleanUnsentTransactionsUsingAbort](#function-cleanunsenttransactionsusingabort) | [makeChangeLock](#function-makechangelock) | [validateInteger](#function-validateinteger) |
17170
- | [cleanUnsignedTransactionsUsingAbort](#function-cleanunsignedtransactionsusingabort) | [maxDate](#function-maxdate) | [validateInternalizeActionArgs](#function-validateinternalizeactionargs) |
17171
- | [completeSignedTransaction](#function-completesignedtransaction) | [offsetPubKey](#function-offsetpubkey) | [validateInternalizeOutput](#function-validateinternalizeoutput) |
17172
- | [convertBitsToTarget](#function-convertbitstotarget) | [optionalArraysEqual](#function-optionalarraysequal) | [validateListActionsArgs](#function-validatelistactionsargs) |
17173
- | [convertBitsToWork](#function-convertbitstowork) | [parseTxScriptOffsets](#function-parsetxscriptoffsets) | [validateListCertificatesArgs](#function-validatelistcertificatesargs) |
17174
- | [convertBufferToUint32](#function-convertbuffertouint32) | [parseWalletOutpoint](#function-parsewalletoutpoint) | [validateListOutputsArgs](#function-validatelistoutputsargs) |
17175
- | [convertProofToMerklePath](#function-convertprooftomerklepath) | [processAction](#function-processaction) | [validateOptionalInteger](#function-validateoptionalinteger) |
17176
- | [convertUint32ToBuffer](#function-convertuint32tobuffer) | [processAction](#function-processaction) | [validateOptionalOutpointString](#function-validateoptionaloutpointstring) |
17177
- | [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [proveCertificate](#function-provecertificate) | [validateOriginator](#function-validateoriginator) |
17178
- | [createAction](#function-createaction) | [purgeData](#function-purgedata) | [validateOutpointString](#function-validateoutpointstring) |
17179
- | [createAction](#function-createaction) | [purgeDataIdb](#function-purgedataidb) | [validatePositiveIntegerOrZero](#function-validatepositiveintegerorzero) |
17180
- | [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [randomBytes](#function-randombytes) | [validateProveCertificateArgs](#function-validateprovecertificateargs) |
17181
- | [createNoDbChaintracksOptions](#function-createnodbchaintracksoptions) | [randomBytesBase64](#function-randombytesbase64) | [validateRelinquishCertificateArgs](#function-validaterelinquishcertificateargs) |
17182
- | [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [randomBytesHex](#function-randombyteshex) | [validateRelinquishOutputArgs](#function-validaterelinquishoutputargs) |
17183
- | [createSyncMap](#function-createsyncmap) | [readUInt32BE](#function-readuint32be) | [validateSatoshis](#function-validatesatoshis) |
17184
- | [deserializeBaseBlockHeader](#function-deserializebaseblockheader) | [readUInt32LE](#function-readuint32le) | [validateScriptHash](#function-validatescripthash) |
17185
- | [deserializeBaseBlockHeaders](#function-deserializebaseblockheaders) | [reviewStatus](#function-reviewstatus) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
17186
- | [deserializeBlockHeader](#function-deserializeblockheader) | [reviewStatusIdb](#function-reviewstatusidb) | [validateSignActionArgs](#function-validatesignactionargs) |
17187
- | [deserializeBlockHeaders](#function-deserializeblockheaders) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) | [validateSignActionOptions](#function-validatesignactionoptions) |
17188
- | [determineDBType](#function-determinedbtype) | [serializeBaseBlockHeader](#function-serializebaseblockheader) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
17189
- | [doubleSha256BE](#function-doublesha256be) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) | [validateStringLength](#function-validatestringlength) |
17190
- | [doubleSha256LE](#function-doublesha256le) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | [validateWalletPayment](#function-validatewalletpayment) |
17191
- | [expectToThrowWERR](#function-expecttothrowwerr) | [sha256Hash](#function-sha256hash) | [varUintSize](#function-varuintsize) |
17192
- | [generateChangeSdk](#function-generatechangesdk) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) | [verifyHexString](#function-verifyhexstring) |
17193
- | [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [shareReqsWithWorld](#function-sharereqswithworld) | [verifyId](#function-verifyid) |
17194
- | [genesisBuffer](#function-genesisbuffer) | [signAction](#function-signaction) | [verifyInteger](#function-verifyinteger) |
17195
- | [genesisHeader](#function-genesisheader) | [stampLog](#function-stamplog) | [verifyNumber](#function-verifynumber) |
17196
- | [getBeefForTransaction](#function-getbeeffortransaction) | [stampLogFormat](#function-stamplogformat) | [verifyOne](#function-verifyone) |
17197
- | [getBeefForTxid](#function-getbeeffortxid) | [subWork](#function-subwork) | [verifyOneOrNone](#function-verifyoneornone) |
17198
- | [getExchangeRatesIo](#function-getexchangeratesio) | [swapByteOrder](#function-swapbyteorder) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
17199
- | [getIdentityKey](#function-getidentitykey) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) | [verifyTruthy](#function-verifytruthy) |
17200
- | [getProofs](#function-getproofs) | [toWalletNetwork](#function-towalletnetwork) | [verifyUnlockScripts](#function-verifyunlockscripts) |
17201
- | [getSyncChunk](#function-getsyncchunk) | [transactionInputSize](#function-transactioninputsize) | [wait](#function-wait) |
17202
- | [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [transactionOutputSize](#function-transactionoutputsize) | [workBNtoBuffer](#function-workbntobuffer) |
17203
- | [internalizeAction](#function-internalizeaction) | [transactionSize](#function-transactionsize) | [writeUInt32BE](#function-writeuint32be) |
17204
- | [internalizeAction](#function-internalizeaction) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) | [writeUInt32LE](#function-writeuint32le) |
17205
- | [isBaseBlockHeader](#function-isbaseblockheader) | [updateExchangeratesapi](#function-updateexchangeratesapi) | |
15431
+ | [WocHeadersBulkListener](#function-wocheadersbulklistener) | [isCreateActionSpecOp](#function-iscreateactionspecop) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
15432
+ | [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [isHexString](#function-ishexstring) | [validateBasketInsertion](#function-validatebasketinsertion) |
15433
+ | [WocHeadersLiveListener](#function-wocheaderslivelistener) | [isKnownValidBulkHeaderFile](#function-isknownvalidbulkheaderfile) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
15434
+ | [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [isListActionsSpecOp](#function-islistactionsspecop) | [validateBulkFileData](#function-validatebulkfiledata) |
15435
+ | [acquireDirectCertificate](#function-acquiredirectcertificate) | [isListOutputsSpecOp](#function-islistoutputsspecop) | [validateCreateActionArgs](#function-validatecreateactionargs) |
15436
+ | [addWork](#function-addwork) | [isLive](#function-islive) | [validateCreateActionInput](#function-validatecreateactioninput) |
15437
+ | [arcDefaultUrl](#function-arcdefaulturl) | [isLiveBlockHeader](#function-isliveblockheader) | [validateCreateActionOptions](#function-validatecreateactionoptions) |
15438
+ | [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [isMoreWork](#function-ismorework) | [validateCreateActionOutput](#function-validatecreateactionoutput) |
15439
+ | [arraysEqual](#function-arraysequal) | [listActionsIdb](#function-listactionsidb) | [validateDiscoverByAttributesArgs](#function-validatediscoverbyattributesargs) |
15440
+ | [asArray](#function-asarray) | [listCertificates](#function-listcertificates) | [validateDiscoverByIdentityKeyArgs](#function-validatediscoverbyidentitykeyargs) |
15441
+ | [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [listOutputsIdb](#function-listoutputsidb) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
15442
+ | [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
15443
+ | [asBsvSdkScript](#function-asbsvsdkscript) | [makeAtomicBeef](#function-makeatomicbeef) | [validateGenesisHeader](#function-validategenesisheader) |
15444
+ | [asBsvSdkTx](#function-asbsvsdktx) | [makeChangeLock](#function-makechangelock) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
15445
+ | [asString](#function-asstring) | [maxDate](#function-maxdate) | [validateHeaderFormat](#function-validateheaderformat) |
15446
+ | [asUint8Array](#function-asuint8array) | [offsetPubKey](#function-offsetpubkey) | [validateInteger](#function-validateinteger) |
15447
+ | [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [optionalArraysEqual](#function-optionalarraysequal) | [validateInternalizeActionArgs](#function-validateinternalizeactionargs) |
15448
+ | [blockHash](#function-blockhash) | [parseTxScriptOffsets](#function-parsetxscriptoffsets) | [validateInternalizeOutput](#function-validateinternalizeoutput) |
15449
+ | [buildSignableTransaction](#function-buildsignabletransaction) | [parseWalletOutpoint](#function-parsewalletoutpoint) | [validateListActionsArgs](#function-validatelistactionsargs) |
15450
+ | [completeSignedTransaction](#function-completesignedtransaction) | [processAction](#function-processaction) | [validateListCertificatesArgs](#function-validatelistcertificatesargs) |
15451
+ | [convertBitsToTarget](#function-convertbitstotarget) | [processAction](#function-processaction) | [validateListOutputsArgs](#function-validatelistoutputsargs) |
15452
+ | [convertBitsToWork](#function-convertbitstowork) | [proveCertificate](#function-provecertificate) | [validateOptionalInteger](#function-validateoptionalinteger) |
15453
+ | [convertBufferToUint32](#function-convertbuffertouint32) | [purgeDataIdb](#function-purgedataidb) | [validateOptionalOutpointString](#function-validateoptionaloutpointstring) |
15454
+ | [convertProofToMerklePath](#function-convertprooftomerklepath) | [randomBytes](#function-randombytes) | [validateOriginator](#function-validateoriginator) |
15455
+ | [convertUint32ToBuffer](#function-convertuint32tobuffer) | [randomBytesBase64](#function-randombytesbase64) | [validateOutpointString](#function-validateoutpointstring) |
15456
+ | [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [randomBytesHex](#function-randombyteshex) | [validatePositiveIntegerOrZero](#function-validatepositiveintegerorzero) |
15457
+ | [createAction](#function-createaction) | [readUInt32BE](#function-readuint32be) | [validateProveCertificateArgs](#function-validateprovecertificateargs) |
15458
+ | [createAction](#function-createaction) | [readUInt32LE](#function-readuint32le) | [validateRelinquishCertificateArgs](#function-validaterelinquishcertificateargs) |
15459
+ | [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [reviewStatusIdb](#function-reviewstatusidb) | [validateRelinquishOutputArgs](#function-validaterelinquishoutputargs) |
15460
+ | [createNoDbChaintracksOptions](#function-createnodbchaintracksoptions) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) | [validateSatoshis](#function-validatesatoshis) |
15461
+ | [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [serializeBaseBlockHeader](#function-serializebaseblockheader) | [validateScriptHash](#function-validatescripthash) |
15462
+ | [createSyncMap](#function-createsyncmap) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
15463
+ | [deserializeBaseBlockHeader](#function-deserializebaseblockheader) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | [validateSignActionArgs](#function-validatesignactionargs) |
15464
+ | [deserializeBaseBlockHeaders](#function-deserializebaseblockheaders) | [sha256Hash](#function-sha256hash) | [validateSignActionOptions](#function-validatesignactionoptions) |
15465
+ | [deserializeBlockHeader](#function-deserializeblockheader) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
15466
+ | [deserializeBlockHeaders](#function-deserializeblockheaders) | [shareReqsWithWorld](#function-sharereqswithworld) | [validateStringLength](#function-validatestringlength) |
15467
+ | [doubleSha256BE](#function-doublesha256be) | [signAction](#function-signaction) | [validateWalletPayment](#function-validatewalletpayment) |
15468
+ | [doubleSha256LE](#function-doublesha256le) | [stampLog](#function-stamplog) | [varUintSize](#function-varuintsize) |
15469
+ | [generateChangeSdk](#function-generatechangesdk) | [stampLogFormat](#function-stamplogformat) | [verifyHexString](#function-verifyhexstring) |
15470
+ | [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [subWork](#function-subwork) | [verifyId](#function-verifyid) |
15471
+ | [genesisBuffer](#function-genesisbuffer) | [swapByteOrder](#function-swapbyteorder) | [verifyInteger](#function-verifyinteger) |
15472
+ | [genesisHeader](#function-genesisheader) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) | [verifyNumber](#function-verifynumber) |
15473
+ | [getBeefForTransaction](#function-getbeeffortransaction) | [toWalletNetwork](#function-towalletnetwork) | [verifyOne](#function-verifyone) |
15474
+ | [getBeefForTxid](#function-getbeeffortxid) | [transactionInputSize](#function-transactioninputsize) | [verifyOneOrNone](#function-verifyoneornone) |
15475
+ | [getExchangeRatesIo](#function-getexchangeratesio) | [transactionOutputSize](#function-transactionoutputsize) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
15476
+ | [getIdentityKey](#function-getidentitykey) | [transactionSize](#function-transactionsize) | [verifyTruthy](#function-verifytruthy) |
15477
+ | [getProofs](#function-getproofs) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) | [verifyUnlockScripts](#function-verifyunlockscripts) |
15478
+ | [getSyncChunk](#function-getsyncchunk) | [updateExchangeratesapi](#function-updateexchangeratesapi) | [wait](#function-wait) |
15479
+ | [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) | [wocGetHeadersHeaderToBlockHeader](#function-wocgetheadersheadertoblockheader) |
15480
+ | [internalizeAction](#function-internalizeaction) | [validateAbortActionArgs](#function-validateabortactionargs) | [workBNtoBuffer](#function-workbntobuffer) |
15481
+ | [internalizeAction](#function-internalizeaction) | [validateAcquireCertificateArgs](#function-validateacquirecertificateargs) | [writeUInt32BE](#function-writeuint32be) |
15482
+ | [isBaseBlockHeader](#function-isbaseblockheader) | [validateAcquireDirectCertificateArgs](#function-validateacquiredirectcertificateargs) | [writeUInt32LE](#function-writeuint32le) |
15483
+ | [isBlockHeader](#function-isblockheader) | [validateAcquireIssuanceCertificateArgs](#function-validateacquireissuancecertificateargs) | |
17206
15484
 
17207
15485
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17208
15486
 
@@ -17582,80 +15860,8 @@ export function buildSignableTransaction(dctr: StorageCreateActionResult, args:
17582
15860
  }
17583
15861
  ```
17584
15862
 
17585
- See also: [PendingStorageInput](./client.md#interface-pendingstorageinput), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs), [Wallet](./client.md#class-wallet)
17586
-
17587
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17588
-
17589
- ---
17590
- ##### Function: cleanUnprocessedTransactionsUsingAbort
17591
-
17592
- Aborts all transactions with the status `'unprocessed'` in the storage and verifies success.
17593
-
17594
- ```ts
17595
- export async function cleanUnprocessedTransactionsUsingAbort(wallet: Wallet, storage: StorageKnex): Promise<boolean>
17596
- ```
17597
-
17598
- See also: [StorageKnex](./storage.md#class-storageknex), [Wallet](./client.md#class-wallet)
17599
-
17600
- Returns
17601
-
17602
- - Resolves to `true` if all `'unprocessed'` transactions were successfully aborted.
17603
-
17604
- Argument Details
17605
-
17606
- + **wallet**
17607
- + The wallet instance used to abort actions.
17608
- + **storage**
17609
- + The storage instance to query transactions from.
17610
-
17611
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17612
-
17613
- ---
17614
- ##### Function: cleanUnsentTransactionsUsingAbort
17615
-
17616
- Aborts all transactions with the status `'nosend'` in the storage and verifies success.
17617
-
17618
- ```ts
17619
- export async function cleanUnsentTransactionsUsingAbort(wallet: Wallet, storage: StorageKnex): Promise<boolean>
17620
- ```
17621
-
17622
- See also: [StorageKnex](./storage.md#class-storageknex), [Wallet](./client.md#class-wallet)
17623
-
17624
- Returns
17625
-
17626
- - Resolves to `true` if all `'nosend'` transactions were successfully aborted.
17627
-
17628
- Argument Details
17629
-
17630
- + **wallet**
17631
- + The wallet instance used to abort actions.
17632
- + **storage**
17633
- + The storage instance to query transactions from.
17634
-
17635
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17636
-
17637
- ---
17638
- ##### Function: cleanUnsignedTransactionsUsingAbort
17639
-
17640
- Aborts all transactions with the status `'unsigned'` in the storage and verifies success.
17641
-
17642
- ```ts
17643
- export async function cleanUnsignedTransactionsUsingAbort(wallet: Wallet, storage: StorageKnex): Promise<boolean>
17644
- ```
17645
-
17646
- See also: [StorageKnex](./storage.md#class-storageknex), [Wallet](./client.md#class-wallet)
17647
-
17648
- Returns
17649
-
17650
- - Resolves to `true` if all `'unsigned'` transactions were successfully aborted.
17651
-
17652
- Argument Details
17653
-
17654
- + **wallet**
17655
- + The wallet instance used to abort actions.
17656
- + **storage**
17657
- + The storage instance to query transactions from.
17658
-
15863
+ See also: [PendingStorageInput](./client.md#interface-pendingstorageinput), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [ValidCreateActionArgs](./client.md#interface-validcreateactionargs), [Wallet](./client.md#class-wallet)
15864
+
17659
15865
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17660
15866
 
17661
15867
  ---
@@ -17907,21 +16113,6 @@ See also: [BlockHeader](./client.md#interface-blockheader)
17907
16113
 
17908
16114
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17909
16115
 
17910
- ---
17911
- ##### Function: determineDBType
17912
-
17913
- ```ts
17914
- export async function determineDBType(knex: Knex<any, any[]>): Promise<DBType>
17915
- ```
17916
-
17917
- See also: [DBType](./storage.md#type-dbtype)
17918
-
17919
- Returns
17920
-
17921
- connected database engine variant
17922
-
17923
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17924
-
17925
16116
  ---
17926
16117
  ##### Function: doubleSha256BE
17927
16118
 
@@ -17975,15 +16166,6 @@ Argument Details
17975
16166
 
17976
16167
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17977
16168
 
17978
- ---
17979
- ##### Function: expectToThrowWERR
17980
-
17981
- ```ts
17982
- export async function expectToThrowWERR<R>(expectedClass: new (...args: any[]) => any, fn: () => Promise<R>): Promise<void>
17983
- ```
17984
-
17985
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17986
-
17987
16169
  ---
17988
16170
  ##### Function: generateChangeSdk
17989
16171
 
@@ -18401,17 +16583,6 @@ export function isMoreWork(work1: string, work2: string): boolean
18401
16583
 
18402
16584
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18403
16585
 
18404
- ---
18405
- ##### Function: listActions
18406
-
18407
- ```ts
18408
- export async function listActions(storage: StorageKnex, auth: AuthId, vargs: ValidListActionsArgs): Promise<ListActionsResult>
18409
- ```
18410
-
18411
- See also: [AuthId](./client.md#interface-authid), [StorageKnex](./storage.md#class-storageknex), [ValidListActionsArgs](./client.md#interface-validlistactionsargs)
18412
-
18413
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18414
-
18415
16586
  ---
18416
16587
  ##### Function: listActionsIdb
18417
16588
 
@@ -18434,17 +16605,6 @@ See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md
18434
16605
 
18435
16606
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18436
16607
 
18437
- ---
18438
- ##### Function: listOutputs
18439
-
18440
- ```ts
18441
- export async function listOutputs(dsk: StorageKnex, auth: AuthId, vargs: ValidListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
18442
- ```
18443
-
18444
- See also: [AuthId](./client.md#interface-authid), [StorageKnex](./storage.md#class-storageknex), [ValidListOutputsArgs](./client.md#interface-validlistoutputsargs)
18445
-
18446
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18447
-
18448
16608
  ---
18449
16609
  ##### Function: listOutputsIdb
18450
16610
 
@@ -18468,50 +16628,6 @@ export function lockScriptWithKeyOffsetFromPubKey(pubKey: string, keyOffset?: st
18468
16628
 
18469
16629
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18470
16630
 
18471
- ---
18472
- ##### Function: logBasket
18473
-
18474
- ```ts
18475
- export function logBasket(basket: TableOutputBasket): string
18476
- ```
18477
-
18478
- See also: [TableOutputBasket](./storage.md#interface-tableoutputbasket)
18479
-
18480
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18481
-
18482
- ---
18483
- ##### Function: logInput
18484
-
18485
- ```ts
18486
- export async function logInput(storage: StorageKnex, prevOutputTxid: HexString, prevOutputVout: number, indentLevel = 1): Promise<string>
18487
- ```
18488
-
18489
- See also: [StorageKnex](./storage.md#class-storageknex)
18490
-
18491
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18492
-
18493
- ---
18494
- ##### Function: logOutput
18495
-
18496
- ```ts
18497
- export async function logOutput(storage: StorageKnex, output: TableOutput): Promise<string>
18498
- ```
18499
-
18500
- See also: [StorageKnex](./storage.md#class-storageknex), [TableOutput](./storage.md#interface-tableoutput)
18501
-
18502
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18503
-
18504
- ---
18505
- ##### Function: logTransaction
18506
-
18507
- ```ts
18508
- export async function logTransaction(storage: StorageKnex, txid: HexString): Promise<string>
18509
- ```
18510
-
18511
- See also: [StorageKnex](./storage.md#class-storageknex)
18512
-
18513
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18514
-
18515
16631
  ---
18516
16632
  ##### Function: makeAtomicBeef
18517
16633
 
@@ -18620,17 +16736,6 @@ See also: [AuthId](./client.md#interface-authid), [ValidProveCertificateArgs](./
18620
16736
 
18621
16737
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18622
16738
 
18623
- ---
18624
- ##### Function: purgeData
18625
-
18626
- ```ts
18627
- export async function purgeData(storage: StorageKnex, params: PurgeParams, trx?: TrxToken): Promise<PurgeResults>
18628
- ```
18629
-
18630
- See also: [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageKnex](./storage.md#class-storageknex), [TrxToken](./client.md#interface-trxtoken)
18631
-
18632
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18633
-
18634
16739
  ---
18635
16740
  ##### Function: purgeDataIdb
18636
16741
 
@@ -18699,28 +16804,6 @@ export function readUInt32LE(a: number[] | Uint8Array, offset: number): number
18699
16804
 
18700
16805
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18701
16806
 
18702
- ---
18703
- ##### Function: reviewStatus
18704
-
18705
- Looks for unpropagated state:
18706
-
18707
- 1. set transactions to 'failed' if not already failed and provenTxReq with matching txid has status of 'invalid'.
18708
- 2. sets outputs to spendable true, spentBy undefined if spentBy is a transaction with status 'failed'.
18709
- 3. sets transactions to 'completed' if provenTx with matching txid exists and current provenTxId is null.
18710
-
18711
- ```ts
18712
- export async function reviewStatus(storage: StorageKnex, args: {
18713
- agedLimit: Date;
18714
- trx?: TrxToken;
18715
- }): Promise<{
18716
- log: string;
18717
- }>
18718
- ```
18719
-
18720
- See also: [StorageKnex](./storage.md#class-storageknex), [TrxToken](./client.md#interface-trxtoken)
18721
-
18722
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18723
-
18724
16807
  ---
18725
16808
  ##### Function: reviewStatusIdb
18726
16809
 
@@ -19851,6 +17934,17 @@ Must be greater than zero and less than 2 minutes (120,000 msecs)
19851
17934
 
19852
17935
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
19853
17936
 
17937
+ ---
17938
+ ##### Function: wocGetHeadersHeaderToBlockHeader
17939
+
17940
+ ```ts
17941
+ export function wocGetHeadersHeaderToBlockHeader(h: WocGetHeadersHeader): BlockHeader
17942
+ ```
17943
+
17944
+ See also: [BlockHeader](./client.md#interface-blockheader), [WocGetHeadersHeader](./services.md#interface-wocgetheadersheader)
17945
+
17946
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
17947
+
19854
17948
  ---
19855
17949
  ##### Function: workBNtoBuffer
19856
17950
 
@@ -19892,19 +17986,17 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
19892
17986
 
19893
17987
  | | | |
19894
17988
  | --- | --- | --- |
19895
- | [Chain](#type-chain) | [HeaderListener](#type-headerlistener) | [StopListenerToken](#type-stoplistenertoken) |
19896
- | [DBType](#type-dbtype) | [InsertHeaderResult](#type-insertheaderresult) | [StorageProvidedBy](#type-storageprovidedby) |
19897
- | [DescriptionString5to2000Bytes](#type-descriptionstring5to2000bytes) | [MonitorStorage](#type-monitorstorage) | [SyncProtocolVersion](#type-syncprotocolversion) |
19898
- | [EnqueueHandler](#type-enqueuehandler) | [PermissionEventHandler](#type-permissioneventhandler) | [SyncStatus](#type-syncstatus) |
19899
- | [EntityStorage](#type-entitystorage) | [PostBeefService](#type-postbeefservice) | [TestKeyPair](#type-testkeypair) |
19900
- | [ErrorHandler](#type-errorhandler) | [PostReqsToNetworkDetailsStatus](#type-postreqstonetworkdetailsstatus) | [TestSetup1Wallet](#type-testsetup1wallet) |
19901
- | [GetMerklePathService](#type-getmerklepathservice) | [PostTxsService](#type-posttxsservice) | [TestSetup2Wallet](#type-testsetup2wallet) |
19902
- | [GetRawTxService](#type-getrawtxservice) | [ProvenTxReqStatus](#type-proventxreqstatus) | [TestWalletNoSetup](#type-testwalletnosetup) |
19903
- | [GetScriptHashHistoryService](#type-getscripthashhistoryservice) | [ReorgListener](#type-reorglistener) | [TestWalletProviderNoSetup](#type-testwalletprovidernosetup) |
19904
- | [GetStatusForTxidsService](#type-getstatusfortxidsservice) | [ReqHistoryNote](#type-reqhistorynote) | [TransactionStatus](#type-transactionstatus) |
19905
- | [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [ReviewActionResultStatus](#type-reviewactionresultstatus) | [UpdateFiatExchangeRateService](#type-updatefiatexchangerateservice) |
19906
- | [GetUtxoStatusService](#type-getutxostatusservice) | [ScriptHashFormat](#type-scripthashformat) | |
19907
- | [GroupedPermissionEventHandler](#type-groupedpermissioneventhandler) | [ServicesCallHistory](#type-servicescallhistory) | |
17989
+ | [Chain](#type-chain) | [GetUtxoStatusService](#type-getutxostatusservice) | [ReqHistoryNote](#type-reqhistorynote) |
17990
+ | [DBType](#type-dbtype) | [GroupedPermissionEventHandler](#type-groupedpermissioneventhandler) | [ReviewActionResultStatus](#type-reviewactionresultstatus) |
17991
+ | [DescriptionString5to2000Bytes](#type-descriptionstring5to2000bytes) | [HeaderListener](#type-headerlistener) | [ScriptHashFormat](#type-scripthashformat) |
17992
+ | [EnqueueHandler](#type-enqueuehandler) | [InsertHeaderResult](#type-insertheaderresult) | [ServicesCallHistory](#type-servicescallhistory) |
17993
+ | [EntityStorage](#type-entitystorage) | [MonitorStorage](#type-monitorstorage) | [StopListenerToken](#type-stoplistenertoken) |
17994
+ | [ErrorHandler](#type-errorhandler) | [PermissionEventHandler](#type-permissioneventhandler) | [StorageProvidedBy](#type-storageprovidedby) |
17995
+ | [GetMerklePathService](#type-getmerklepathservice) | [PostBeefService](#type-postbeefservice) | [SyncProtocolVersion](#type-syncprotocolversion) |
17996
+ | [GetRawTxService](#type-getrawtxservice) | [PostReqsToNetworkDetailsStatus](#type-postreqstonetworkdetailsstatus) | [SyncStatus](#type-syncstatus) |
17997
+ | [GetScriptHashHistoryService](#type-getscripthashhistoryservice) | [PostTxsService](#type-posttxsservice) | [TransactionStatus](#type-transactionstatus) |
17998
+ | [GetStatusForTxidsService](#type-getstatusfortxidsservice) | [ProvenTxReqStatus](#type-proventxreqstatus) | [UpdateFiatExchangeRateService](#type-updatefiatexchangerateservice) |
17999
+ | [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [ReorgListener](#type-reorglistener) | |
19908
18000
 
19909
18001
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
19910
18002
 
@@ -20307,63 +18399,6 @@ export type SyncStatus = "success" | "error" | "identified" | "updated" | "unkno
20307
18399
 
20308
18400
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20309
18401
 
20310
- ---
20311
- ##### Type: TestKeyPair
20312
-
20313
- ```ts
20314
- export type TestKeyPair = {
20315
- privateKey: PrivateKey;
20316
- publicKey: PublicKey;
20317
- address: string;
20318
- }
20319
- ```
20320
-
20321
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20322
-
20323
- ---
20324
- ##### Type: TestSetup1Wallet
20325
-
20326
- ```ts
20327
- export type TestSetup1Wallet = TestWallet<TestSetup1>
20328
- ```
20329
-
20330
- See also: [TestSetup1](./client.md#interface-testsetup1), [TestWallet](./client.md#interface-testwallet)
20331
-
20332
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20333
-
20334
- ---
20335
- ##### Type: TestSetup2Wallet
20336
-
20337
- ```ts
20338
- export type TestSetup2Wallet = TestWallet<TestSetup2>
20339
- ```
20340
-
20341
- See also: [TestSetup2](./client.md#interface-testsetup2), [TestWallet](./client.md#interface-testwallet)
20342
-
20343
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20344
-
20345
- ---
20346
- ##### Type: TestWalletNoSetup
20347
-
20348
- ```ts
20349
- export type TestWalletNoSetup = TestWallet<{}>
20350
- ```
20351
-
20352
- See also: [TestWallet](./client.md#interface-testwallet)
20353
-
20354
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20355
-
20356
- ---
20357
- ##### Type: TestWalletProviderNoSetup
20358
-
20359
- ```ts
20360
- export type TestWalletProviderNoSetup = TestWalletProvider<{}>
20361
- ```
20362
-
20363
- See also: [TestWalletProvider](./client.md#interface-testwalletprovider)
20364
-
20365
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20366
-
20367
18402
  ---
20368
18403
  ##### Type: TransactionStatus
20369
18404
 
@@ -20389,18 +18424,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
20389
18424
 
20390
18425
  | | | |
20391
18426
  | --- | --- | --- |
20392
- | [DEFAULT_PROFILE_ID](#variable-default_profile_id) | [logger](#variable-logger) | [specOpThrowReviewActions](#variable-specopthrowreviewactions) |
20393
- | [DEFAULT_SETTINGS](#variable-default_settings) | [logger](#variable-logger) | [specOpWalletBalance](#variable-specopwalletbalance) |
20394
- | [PBKDF2_NUM_ROUNDS](#variable-pbkdf2_num_rounds) | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
20395
- | [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [normalizeDate](#variable-normalizedate) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
20396
- | [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | [triggerForeignKeyConstraintError](#variable-triggerforeignkeyconstrainterror) |
20397
- | [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [parseResults](#variable-parseresults) | [triggerUniqueConstraintError](#variable-triggeruniqueconstrainterror) |
20398
- | [aggregateActionResults](#variable-aggregateactionresults) | [queryOverlay](#variable-queryoverlay) | [updateTable](#variable-updatetable) |
20399
- | [brc29ProtocolID](#variable-brc29protocolid) | [setLogging](#variable-setlogging) | [validBulkHeaderFiles](#variable-validbulkheaderfiles) |
20400
- | [dirtyHashes](#variable-dirtyhashes) | [specOpFailedActions](#variable-specopfailedactions) | [validateUpdateTime](#variable-validateupdatetime) |
20401
- | [getBasketToSpecOp](#variable-getbaskettospecop) | [specOpInvalidChange](#variable-specopinvalidchange) | [verifyValues](#variable-verifyvalues) |
20402
- | [getLabelToSpecOp](#variable-getlabeltospecop) | [specOpNoSendActions](#variable-specopnosendactions) | |
20403
- | [logUniqueConstraintError](#variable-loguniqueconstrainterror) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) | |
18427
+ | [DEFAULT_PROFILE_ID](#variable-default_profile_id) | [getBasketToSpecOp](#variable-getbaskettospecop) | [specOpNoSendActions](#variable-specopnosendactions) |
18428
+ | [DEFAULT_SETTINGS](#variable-default_settings) | [getLabelToSpecOp](#variable-getlabeltospecop) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
18429
+ | [PBKDF2_NUM_ROUNDS](#variable-pbkdf2_num_rounds) | [logger](#variable-logger) | [specOpThrowReviewActions](#variable-specopthrowreviewactions) |
18430
+ | [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [specOpWalletBalance](#variable-specopwalletbalance) |
18431
+ | [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
18432
+ | [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [parseResults](#variable-parseresults) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
18433
+ | [aggregateActionResults](#variable-aggregateactionresults) | [queryOverlay](#variable-queryoverlay) | [validBulkHeaderFiles](#variable-validbulkheaderfiles) |
18434
+ | [brc29ProtocolID](#variable-brc29protocolid) | [specOpFailedActions](#variable-specopfailedactions) | |
18435
+ | [dirtyHashes](#variable-dirtyhashes) | [specOpInvalidChange](#variable-specopinvalidchange) | |
20404
18436
 
20405
18437
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20406
18438
 
@@ -20696,32 +18728,6 @@ See also: [AuthId](./client.md#interface-authid), [ListActionsSpecOp](./storage.
20696
18728
 
20697
18729
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20698
18730
 
20699
- ---
20700
- ##### Variable: logUniqueConstraintError
20701
-
20702
- ```ts
20703
- logUniqueConstraintError = (error: any, tableName: string, columnNames: string[], logEnabled: boolean = false): void => {
20704
- if (logEnabled) {
20705
- const expectedErrorString = `SQLITE_CONSTRAINT: UNIQUE constraint failed: ${columnNames.map(col => `${tableName}.${col}`).join(", ")}`;
20706
- logger("expectedErrorString=", expectedErrorString);
20707
- if (error.message.includes(expectedErrorString)) {
20708
- console.log(`Unique constraint error for columns ${columnNames.join(", ")} caught as expected:`, error.message);
20709
- }
20710
- else {
20711
- console.log("Unexpected error message:", error.message);
20712
- }
20713
- }
20714
- if (!error.message.includes(`SQLITE_CONSTRAINT: UNIQUE constraint failed: ${columnNames.map(col => `${tableName}.${col}`).join(", ")}`)) {
20715
- console.log("Unexpected error:", error.message);
20716
- throw new Error(`Unexpected error: ${error.message}`);
20717
- }
20718
- }
20719
- ```
20720
-
20721
- See also: [logger](./client.md#variable-logger)
20722
-
20723
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20724
-
20725
18731
  ---
20726
18732
  ##### Variable: logger
20727
18733
 
@@ -20736,20 +18742,6 @@ logger = (message: string, ...optionalParams: any[]): void => {
20736
18742
 
20737
18743
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20738
18744
 
20739
- ---
20740
- ##### Variable: logger
20741
-
20742
- ```ts
20743
- logger = (message: string, ...optionalParams: any[]): void => {
20744
- const isSingleTest = process.argv.some(arg => arg === "--testNamePattern" || arg === "-t");
20745
- if (logEnabled || isSingleTest) {
20746
- console.log(message, ...optionalParams);
20747
- }
20748
- }
20749
- ```
20750
-
20751
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20752
-
20753
18745
  ---
20754
18746
  ##### Variable: maxPossibleSatoshis
20755
18747
 
@@ -20759,23 +18751,6 @@ maxPossibleSatoshis = 2099999999999999
20759
18751
 
20760
18752
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20761
18753
 
20762
- ---
20763
- ##### Variable: normalizeDate
20764
-
20765
- ```ts
20766
- normalizeDate = (value: any): string | null => {
20767
- if (value instanceof Date) {
20768
- return value.toISOString();
20769
- }
20770
- else if (typeof value === "string" && !isNaN(Date.parse(value))) {
20771
- return new Date(value).toISOString();
20772
- }
20773
- return null;
20774
- }
20775
- ```
20776
-
20777
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20778
-
20779
18754
  ---
20780
18755
  ##### Variable: outputColumnsWithoutLockingScript
20781
18756
 
@@ -20857,17 +18832,6 @@ See also: [parseResults](./client.md#variable-parseresults)
20857
18832
 
20858
18833
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20859
18834
 
20860
- ---
20861
- ##### Variable: setLogging
20862
-
20863
- ```ts
20864
- setLogging = (enabled: boolean): void => {
20865
- logEnabled = enabled;
20866
- }
20867
- ```
20868
-
20869
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
20870
-
20871
18835
  ---
20872
18836
  ##### Variable: specOpFailedActions
20873
18837
 
@@ -20999,95 +18963,6 @@ See also: [Certifier](./client.md#interface-certifier), [ExtendedVerifiableCerti
20999
18963
 
21000
18964
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
21001
18965
 
21002
- ---
21003
- ##### Variable: triggerForeignKeyConstraintError
21004
-
21005
- ```ts
21006
- triggerForeignKeyConstraintError = async (storage: any, findMethod: string, updateMethod: string, tableName: string, columnName: string, invalidValue: any, id: number = 1, logEnabled: boolean = false): Promise<boolean> => {
21007
- setLogging(logEnabled);
21008
- const rows = await storage[findMethod]({});
21009
- if (!rows || rows.length < 2) {
21010
- throw new Error(`Expected at least two rows in the table "${tableName}", but found only ${rows.length}. Please add more rows for the test.`);
21011
- }
21012
- if (!(columnName in rows[0])) {
21013
- throw new Error(`Column "${columnName}" does not exist in the table "${tableName}".`);
21014
- }
21015
- if (id === invalidValue[columnName]) {
21016
- throw new Error(`Failed to update "${columnName}" in the table "${tableName}" as id ${id} is same as update value ${invalidValue[columnName]}".`);
21017
- }
21018
- try {
21019
- const r = await storage[updateMethod](id, invalidValue);
21020
- logger("r=", r);
21021
- return false;
21022
- }
21023
- catch (error: any) {
21024
- logForeignConstraintError(error, tableName, columnName, logEnabled);
21025
- return true;
21026
- }
21027
- }
21028
- ```
21029
-
21030
- See also: [setLogging](./client.md#variable-setlogging)
21031
-
21032
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
21033
-
21034
- ---
21035
- ##### Variable: triggerUniqueConstraintError
21036
-
21037
- ```ts
21038
- triggerUniqueConstraintError = async (storage: any, findMethod: string, updateMethod: string, tableName: string, columnName: string, invalidValue: any, id: number = 1, logEnabled: boolean = false): Promise<boolean> => {
21039
- setLogging(logEnabled);
21040
- const rows = await storage[findMethod]({});
21041
- if (logEnabled) {
21042
- logger("rows=", rows);
21043
- }
21044
- if (!rows || rows.length < 2) {
21045
- throw new Error(`Expected at least two rows in the table "${tableName}", but found only ${rows.length}. Please add more rows for the test.`);
21046
- }
21047
- if (!(columnName in rows[0])) {
21048
- throw new Error(`Column "${columnName}" does not exist in the table "${tableName}".`);
21049
- }
21050
- if (id === invalidValue[columnName]) {
21051
- throw new Error(`Failed to update "${columnName}" in the table "${tableName}" as id ${id} is same as update value ${invalidValue[columnName]}".`);
21052
- }
21053
- if (logEnabled) {
21054
- logger("invalidValue=", invalidValue);
21055
- }
21056
- const columnNames = Object.keys(invalidValue);
21057
- try {
21058
- if (logEnabled) {
21059
- logger("update id=", id);
21060
- }
21061
- await storage[updateMethod](id, invalidValue);
21062
- return false;
21063
- }
21064
- catch (error: any) {
21065
- logUniqueConstraintError(error, tableName, columnNames, logEnabled);
21066
- return true;
21067
- }
21068
- }
21069
- ```
21070
-
21071
- See also: [logUniqueConstraintError](./client.md#variable-loguniqueconstrainterror), [logger](./client.md#variable-logger), [setLogging](./client.md#variable-setlogging)
21072
-
21073
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
21074
-
21075
- ---
21076
- ##### Variable: updateTable
21077
-
21078
- ```ts
21079
- updateTable = async (updateFunction, id, testValues) => {
21080
- for (const [key, value] of Object.entries(testValues)) {
21081
- logger("id=", id, "[key]=", [key], "value=", value);
21082
- await updateFunction(id, { [key]: value });
21083
- }
21084
- }
21085
- ```
21086
-
21087
- See also: [logger](./client.md#variable-logger)
21088
-
21089
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
21090
-
21091
18966
  ---
21092
18967
  ##### Variable: validBulkHeaderFiles
21093
18968
 
@@ -21449,66 +19324,6 @@ See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo)
21449
19324
 
21450
19325
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
21451
19326
 
21452
- ---
21453
- ##### Variable: validateUpdateTime
21454
-
21455
- ```ts
21456
- validateUpdateTime = (actualTime: Date, expectedTime: Date, referenceTime: Date, toleranceMs: number = 10, logEnabled: boolean = false): boolean => {
21457
- const actualTimestamp = actualTime.getTime();
21458
- const expectedTimestamp = expectedTime.getTime();
21459
- const referenceTimestamp = referenceTime.getTime();
21460
- if (logEnabled) {
21461
- logger(`Validation inputs:\n`, `Actual Time: ${actualTime.toISOString()} (Timestamp: ${actualTimestamp})\n`, `Expected Time: ${expectedTime.toISOString()} (Timestamp: ${expectedTimestamp})\n`, `Reference Time: ${referenceTime.toISOString()} (Timestamp: ${referenceTimestamp})`);
21462
- }
21463
- const isWithinTolerance = Math.abs(actualTimestamp - expectedTimestamp) <= toleranceMs;
21464
- const isGreaterThanReference = actualTimestamp > referenceTimestamp;
21465
- const isoMatch = actualTime.toISOString() === expectedTime.toISOString();
21466
- const utcMatch = actualTime.toUTCString() === expectedTime.toUTCString();
21467
- const humanReadableMatch = actualTime.toDateString() === expectedTime.toDateString();
21468
- if (!isWithinTolerance && Math.abs(actualTimestamp - expectedTimestamp) > 100000000) {
21469
- if (logEnabled) {
21470
- logger(`Skipping validation failure: The difference is unusually large (${Math.abs(actualTimestamp - expectedTimestamp)}ms). Validation passed for extreme outliers.`);
21471
- }
21472
- return true;
21473
- }
21474
- const isValid = isWithinTolerance || isGreaterThanReference || isoMatch || utcMatch || humanReadableMatch;
21475
- if (!isValid) {
21476
- console.error(`Validation failed:\n`, `Actual Time: ${actualTime.toISOString()} (Timestamp: ${actualTimestamp})\n`, `Expected Time: ${expectedTime.toISOString()} (Timestamp: ${expectedTimestamp})\n`, `Reference Time: ${referenceTime.toISOString()} (Timestamp: ${referenceTimestamp})\n`, `Tolerance: ±${toleranceMs}ms\n`, `Within Tolerance: ${isWithinTolerance}\n`, `Greater Than Reference: ${isGreaterThanReference}\n`, `ISO Match: ${isoMatch}\n`, `UTC Match: ${utcMatch}\n`, `Human-Readable Match: ${humanReadableMatch}`);
21477
- }
21478
- else {
21479
- if (logEnabled) {
21480
- logger(`Validation succeeded:\n`, `Actual Time: ${actualTime.toISOString()} (Timestamp: ${actualTimestamp})`);
21481
- }
21482
- }
21483
- return isValid;
21484
- }
21485
- ```
21486
-
21487
- See also: [logger](./client.md#variable-logger)
21488
-
21489
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
21490
-
21491
- ---
21492
- ##### Variable: verifyValues
21493
-
21494
- ```ts
21495
- verifyValues = (targetObject: Record<string, any>, testValues: Record<string, any>, referenceTime: Date) => {
21496
- Object.entries(testValues).forEach(([key, expectedValue]) => {
21497
- const actualValue = targetObject[key];
21498
- if (expectedValue instanceof Date) {
21499
- expect(validateUpdateTime(actualValue, expectedValue, referenceTime)).toBe(true);
21500
- }
21501
- else {
21502
- expect(actualValue).toStrictEqual(expectedValue);
21503
- }
21504
- });
21505
- }
21506
- ```
21507
-
21508
- See also: [validateUpdateTime](./client.md#variable-validateupdatetime)
21509
-
21510
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
21511
-
21512
19327
  ---
21513
19328
 
21514
19329
  <!--#endregion ts2md-api-merged-here-->