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