@bsv/wallet-toolbox 1.2.32 → 1.2.35
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/docs/client.md +489 -1742
- package/docs/monitor.md +7 -7
- package/docs/services.md +236 -2
- package/docs/wallet.md +489 -1742
- package/out/src/Setup.d.ts +1 -2
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js +17 -18
- package/out/src/Setup.js.map +1 -1
- package/out/src/Wallet.d.ts +4 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +111 -51
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletSettingsManager.d.ts +2 -9
- package/out/src/WalletSettingsManager.d.ts.map +1 -1
- package/out/src/WalletSettingsManager.js +7 -113
- package/out/src/WalletSettingsManager.js.map +1 -1
- package/out/src/index.client.d.ts +5 -6
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +5 -6
- package/out/src/index.client.js.map +1 -1
- package/out/src/monitor/Monitor.d.ts +4 -2
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js +45 -13
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +3 -0
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +6 -4
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.d.ts +3 -3
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.d.ts +2 -2
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts +2 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.js +2 -2
- package/out/src/monitor/tasks/TaskUnFail.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts +19 -18
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
- package/out/src/sdk/WalletSigner.interfaces.d.ts +2 -2
- package/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +57 -53
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/sdk/types.d.ts +12 -0
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +16 -1
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts +3 -1
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +58 -23
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +40 -6
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
- package/out/test/Wallet/local/localWallet.man.test.js +1 -1
- package/out/test/Wallet/local/localWallet.man.test.js.map +1 -1
- package/out/test/Wallet/local/localWallet2.man.test.js +59 -1
- package/out/test/Wallet/local/localWallet2.man.test.js.map +1 -1
- package/out/test/Wallet/specOps/specOps.man.test.js +37 -5
- package/out/test/Wallet/specOps/specOps.man.test.js.map +1 -1
- package/out/test/WalletClient/LocalKVStore.man.test.d.ts +2 -0
- package/out/test/WalletClient/LocalKVStore.man.test.d.ts.map +1 -0
- package/out/test/WalletClient/LocalKVStore.man.test.js +99 -0
- package/out/test/WalletClient/LocalKVStore.man.test.js.map +1 -0
- package/out/test/WalletClient/WERR.man.test.d.ts +2 -0
- package/out/test/WalletClient/WERR.man.test.d.ts.map +1 -0
- package/out/test/WalletClient/WERR.man.test.js +21 -0
- package/out/test/WalletClient/WERR.man.test.js.map +1 -0
- package/out/test/services/Services.test.js +3 -1
- package/out/test/services/Services.test.js.map +1 -1
- package/out/test/{Wallet/local → utils}/localWalletMethods.d.ts +2 -2
- package/out/test/utils/localWalletMethods.d.ts.map +1 -0
- package/out/test/{Wallet/local → utils}/localWalletMethods.js +4 -4
- package/out/test/utils/localWalletMethods.js.map +1 -0
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Setup.ts +2 -2
- package/src/Wallet.ts +41 -9
- package/src/WalletSettingsManager.ts +12 -144
- package/src/index.client.ts +5 -6
- package/src/monitor/Monitor.ts +10 -9
- package/src/monitor/MonitorDaemon.ts +4 -0
- package/src/monitor/tasks/TaskCheckForProofs.ts +6 -2
- package/src/monitor/tasks/TaskCheckNoSends.ts +0 -1
- package/src/monitor/tasks/TaskNewHeader.ts +3 -4
- package/src/monitor/tasks/TaskPurge.ts +2 -2
- package/src/monitor/tasks/TaskReviewStatus.ts +0 -1
- package/src/monitor/tasks/TaskUnFail.ts +2 -1
- package/src/sdk/WalletServices.interfaces.ts +19 -18
- package/src/sdk/WalletSigner.interfaces.ts +3 -30
- package/src/sdk/WalletStorage.interfaces.ts +74 -66
- package/src/sdk/types.ts +16 -0
- package/src/storage/StorageKnex.ts +1 -1
- package/src/storage/WalletStorageManager.ts +6 -10
- package/src/storage/methods/attemptToPostReqsToNetwork.ts +2 -1
- package/test/Wallet/local/localWallet.man.test.ts +1 -3
- package/test/Wallet/local/localWallet2.man.test.ts +60 -4
- package/test/Wallet/specOps/specOps.man.test.ts +41 -1
- package/test/WalletClient/LocalKVStore.man.test.ts +114 -0
- package/test/WalletClient/WERR.man.test.ts +20 -0
- package/test/services/Services.test.ts +3 -1
- package/test/{Wallet/local → utils}/localWalletMethods.ts +4 -5
- package/out/test/Wallet/local/localWalletMethods.d.ts.map +0 -1
- package/out/test/Wallet/local/localWalletMethods.js.map +0 -1
package/docs/client.md
CHANGED
|
@@ -14,68 +14,64 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14
14
|
|
|
15
15
|
| | | |
|
|
16
16
|
| --- | --- | --- |
|
|
17
|
-
| [ArcConfig](#interface-arcconfig) | [
|
|
18
|
-
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [
|
|
19
|
-
| [AuthId](#interface-authid) | [
|
|
20
|
-
| [AuthPayload](#interface-authpayload) | [
|
|
21
|
-
| [BaseBlockHeader](#interface-baseblockheader) | [
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
26
|
-
| [
|
|
27
|
-
| [
|
|
28
|
-
| [
|
|
29
|
-
| [
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
32
|
-
| [
|
|
33
|
-
| [
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
40
|
-
| [
|
|
41
|
-
| [
|
|
42
|
-
| [
|
|
43
|
-
| [
|
|
44
|
-
| [
|
|
45
|
-
| [
|
|
46
|
-
| [
|
|
47
|
-
| [
|
|
48
|
-
| [
|
|
49
|
-
| [
|
|
50
|
-
| [
|
|
51
|
-
| [
|
|
52
|
-
| [
|
|
53
|
-
| [
|
|
54
|
-
| [
|
|
55
|
-
| [
|
|
56
|
-
| [
|
|
57
|
-
| [
|
|
58
|
-
| [
|
|
59
|
-
| [
|
|
60
|
-
| [
|
|
61
|
-
| [
|
|
62
|
-
| [
|
|
63
|
-
| [
|
|
64
|
-
| [
|
|
65
|
-
| [
|
|
66
|
-
| [
|
|
67
|
-
| [
|
|
68
|
-
| [
|
|
69
|
-
| [
|
|
70
|
-
| [
|
|
71
|
-
| [
|
|
72
|
-
| [
|
|
73
|
-
| [
|
|
74
|
-
| [
|
|
75
|
-
| [Paged](#interface-paged) | [TableOutputTag](#interface-tableoutputtag) | [WalletTheme](#interface-wallettheme) |
|
|
76
|
-
| [PendingSignAction](#interface-pendingsignaction) | [TableOutputTagMap](#interface-tableoutputtagmap) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
77
|
-
| [PendingStorageInput](#interface-pendingstorageinput) | [TableOutputX](#interface-tableoutputx) | |
|
|
78
|
-
| [PermissionRequest](#interface-permissionrequest) | [TableProvenTx](#interface-tableproventx) | |
|
|
17
|
+
| [ArcConfig](#interface-arcconfig) | [OutPoint](#interface-outpoint) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
|
|
18
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [Paged](#interface-paged) | [TableSettings](#interface-tablesettings) |
|
|
19
|
+
| [AuthId](#interface-authid) | [PendingSignAction](#interface-pendingsignaction) | [TableSyncState](#interface-tablesyncstate) |
|
|
20
|
+
| [AuthPayload](#interface-authpayload) | [PendingStorageInput](#interface-pendingstorageinput) | [TableTransaction](#interface-tabletransaction) |
|
|
21
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [PermissionRequest](#interface-permissionrequest) | [TableTxLabel](#interface-tabletxlabel) |
|
|
22
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [PermissionToken](#interface-permissiontoken) | [TableTxLabelMap](#interface-tabletxlabelmap) |
|
|
23
|
+
| [BitailsConfig](#interface-bitailsconfig) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TableUser](#interface-tableuser) |
|
|
24
|
+
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [PostBeefResult](#interface-postbeefresult) | [TaskPurgeParams](#interface-taskpurgeparams) |
|
|
25
|
+
| [BlockHeader](#interface-blockheader) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TrustSettings](#interface-trustsettings) |
|
|
26
|
+
| [BlockHeader](#interface-blockheader) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TrxToken](#interface-trxtoken) |
|
|
27
|
+
| [BsvExchangeRate](#interface-bsvexchangerate) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
|
|
28
|
+
| [CertOpsWallet](#interface-certopswallet) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TxScriptOffsets](#interface-txscriptoffsets) |
|
|
29
|
+
| [Certifier](#interface-certifier) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [UMPToken](#interface-umptoken) |
|
|
30
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [PostTxsResult](#interface-posttxsresult) | [UMPTokenInteractor](#interface-umptokeninteractor) |
|
|
31
|
+
| [CompleteAuthResponse](#interface-completeauthresponse) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
|
|
32
|
+
| [CreateActionResultX](#interface-createactionresultx) | [ProvenOrRawTx](#interface-provenorrawtx) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
|
|
33
|
+
| [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [ValidAbortActionArgs](#interface-validabortactionargs) |
|
|
34
|
+
| [EntityTimeStamp](#interface-entitytimestamp) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
|
|
35
|
+
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
|
|
36
|
+
| [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
|
|
37
|
+
| [FiatExchangeRates](#interface-fiatexchangerates) | [PurgeParams](#interface-purgeparams) | [ValidBasketInsertion](#interface-validbasketinsertion) |
|
|
38
|
+
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [PurgeResults](#interface-purgeresults) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
|
|
39
|
+
| [FindCertificatesArgs](#interface-findcertificatesargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidCreateActionInput](#interface-validcreateactioninput) |
|
|
40
|
+
| [FindCommissionsArgs](#interface-findcommissionsargs) | [ReviewActionResult](#interface-reviewactionresult) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
|
|
41
|
+
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
|
|
42
|
+
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
|
|
43
|
+
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [SignActionResultX](#interface-signactionresultx) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
|
|
44
|
+
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [StartAuthResponse](#interface-startauthresponse) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
|
|
45
|
+
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [StatusForTxidResult](#interface-statusfortxidresult) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
|
|
46
|
+
| [FindOutputsArgs](#interface-findoutputsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidListActionsArgs](#interface-validlistactionsargs) |
|
|
47
|
+
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
|
|
48
|
+
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
|
|
49
|
+
| [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
|
|
50
|
+
| [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
|
|
51
|
+
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageIdentity](#interface-storageidentity) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
|
|
52
|
+
| [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
|
|
53
|
+
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
|
|
54
|
+
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [ValidSignActionArgs](#interface-validsignactionargs) |
|
|
55
|
+
| [FindUsersArgs](#interface-findusersargs) | [StorageProvenOrReq](#interface-storageprovenorreq) | [ValidSignActionOptions](#interface-validsignactionoptions) |
|
|
56
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageProviderOptions](#interface-storageprovideroptions) | [ValidWalletPayment](#interface-validwalletpayment) |
|
|
57
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageReaderOptions](#interface-storagereaderoptions) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
|
|
58
|
+
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
|
|
59
|
+
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [WalletArgs](#interface-walletargs) |
|
|
60
|
+
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [SyncChunk](#interface-syncchunk) | [WalletBalance](#interface-walletbalance) |
|
|
61
|
+
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [SyncError](#interface-syncerror) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
|
|
62
|
+
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [SyncMap](#interface-syncmap) | [WalletServices](#interface-walletservices) |
|
|
63
|
+
| [GetMerklePathResult](#interface-getmerklepathresult) | [TableCertificate](#interface-tablecertificate) | [WalletServicesOptions](#interface-walletservicesoptions) |
|
|
64
|
+
| [GetRawTxResult](#interface-getrawtxresult) | [TableCertificateField](#interface-tablecertificatefield) | [WalletSettings](#interface-walletsettings) |
|
|
65
|
+
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [TableCertificateX](#interface-tablecertificatex) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
|
|
66
|
+
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [TableCommission](#interface-tablecommission) | [WalletSigner](#interface-walletsigner) |
|
|
67
|
+
| [GetScriptHashHistory](#interface-getscripthashhistory) | [TableMonitorEvent](#interface-tablemonitorevent) | [WalletStorage](#interface-walletstorage) |
|
|
68
|
+
| [GetScriptHashHistoryResult](#interface-getscripthashhistoryresult) | [TableOutput](#interface-tableoutput) | [WalletStorageProvider](#interface-walletstorageprovider) |
|
|
69
|
+
| [GetStatusForTxidsResult](#interface-getstatusfortxidsresult) | [TableOutputBasket](#interface-tableoutputbasket) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
70
|
+
| [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TableOutputTag](#interface-tableoutputtag) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
71
|
+
| [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableOutputTagMap](#interface-tableoutputtagmap) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
|
|
72
|
+
| [KeyPair](#interface-keypair) | [TableOutputX](#interface-tableoutputx) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
73
|
+
| [LiveBlockHeader](#interface-liveblockheader) | [TableProvenTx](#interface-tableproventx) | [WalletTheme](#interface-wallettheme) |
|
|
74
|
+
| [MonitorOptions](#interface-monitoroptions) | [TableProvenTxReq](#interface-tableproventxreq) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
79
75
|
|
|
80
76
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
81
77
|
|
|
@@ -264,6 +260,75 @@ version: number
|
|
|
264
260
|
|
|
265
261
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
266
262
|
|
|
263
|
+
---
|
|
264
|
+
##### Interface: BaseBlockHeader
|
|
265
|
+
|
|
266
|
+
These are fields of 80 byte serialized header in order whose double sha256 hash is a block's hash value
|
|
267
|
+
and the next block's previousHash value.
|
|
268
|
+
|
|
269
|
+
All block hash values and merkleRoot values are 32 byte hex string values with the byte order reversed from the serialized byte order.
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
export interface BaseBlockHeader {
|
|
273
|
+
version: number;
|
|
274
|
+
previousHash: string;
|
|
275
|
+
merkleRoot: string;
|
|
276
|
+
time: number;
|
|
277
|
+
bits: number;
|
|
278
|
+
nonce: number;
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
###### Property bits
|
|
283
|
+
|
|
284
|
+
Block header bits value. Serialized length is 4 bytes.
|
|
285
|
+
|
|
286
|
+
```ts
|
|
287
|
+
bits: number
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
###### Property merkleRoot
|
|
291
|
+
|
|
292
|
+
Root hash of the merkle tree of all transactions in this block. Serialized length is 32 bytes.
|
|
293
|
+
|
|
294
|
+
```ts
|
|
295
|
+
merkleRoot: string
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
###### Property nonce
|
|
299
|
+
|
|
300
|
+
Block header nonce value. Serialized length is 4 bytes.
|
|
301
|
+
|
|
302
|
+
```ts
|
|
303
|
+
nonce: number
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
###### Property previousHash
|
|
307
|
+
|
|
308
|
+
Hash of previous block's block header. Serialized length is 32 bytes.
|
|
309
|
+
|
|
310
|
+
```ts
|
|
311
|
+
previousHash: string
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
###### Property time
|
|
315
|
+
|
|
316
|
+
Block header time value. Serialized length is 4 bytes.
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
time: number
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
###### Property version
|
|
323
|
+
|
|
324
|
+
Block header version value. Serialized length is 4 bytes.
|
|
325
|
+
|
|
326
|
+
```ts
|
|
327
|
+
version: number
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
331
|
+
|
|
267
332
|
---
|
|
268
333
|
##### Interface: BitailsConfig
|
|
269
334
|
|
|
@@ -318,7 +383,39 @@ export interface BlockHeader extends BaseBlockHeader {
|
|
|
318
383
|
}
|
|
319
384
|
```
|
|
320
385
|
|
|
321
|
-
See also: [BaseBlockHeader](./
|
|
386
|
+
See also: [BaseBlockHeader](./services.md#interface-baseblockheader)
|
|
387
|
+
|
|
388
|
+
###### Property hash
|
|
389
|
+
|
|
390
|
+
The double sha256 hash of the serialized `BaseBlockHeader` fields.
|
|
391
|
+
|
|
392
|
+
```ts
|
|
393
|
+
hash: string
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
###### Property height
|
|
397
|
+
|
|
398
|
+
Height of the header, starting from zero.
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
height: number
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
##### Interface: BlockHeader
|
|
408
|
+
|
|
409
|
+
A `BaseBlockHeader` extended with its computed hash and height in its chain.
|
|
410
|
+
|
|
411
|
+
```ts
|
|
412
|
+
export interface BlockHeader extends BaseBlockHeader {
|
|
413
|
+
height: number;
|
|
414
|
+
hash: string;
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
See also: [BaseBlockHeader](./services.md#interface-baseblockheader)
|
|
322
419
|
|
|
323
420
|
###### Property hash
|
|
324
421
|
|
|
@@ -524,7 +621,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
524
621
|
##### Interface: FindCertificateFieldsArgs
|
|
525
622
|
|
|
526
623
|
```ts
|
|
527
|
-
export interface FindCertificateFieldsArgs extends
|
|
624
|
+
export interface FindCertificateFieldsArgs extends FindSincePagedArgs {
|
|
528
625
|
partial: Partial<TableCertificateField>;
|
|
529
626
|
}
|
|
530
627
|
```
|
|
@@ -553,7 +650,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
553
650
|
##### Interface: FindCommissionsArgs
|
|
554
651
|
|
|
555
652
|
```ts
|
|
556
|
-
export interface FindCommissionsArgs extends
|
|
653
|
+
export interface FindCommissionsArgs extends FindSincePagedArgs {
|
|
557
654
|
partial: Partial<TableCommission>;
|
|
558
655
|
}
|
|
559
656
|
```
|
|
@@ -579,7 +676,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
579
676
|
##### Interface: FindMonitorEventsArgs
|
|
580
677
|
|
|
581
678
|
```ts
|
|
582
|
-
export interface FindMonitorEventsArgs extends
|
|
679
|
+
export interface FindMonitorEventsArgs extends FindSincePagedArgs {
|
|
583
680
|
partial: Partial<TableMonitorEvent>;
|
|
584
681
|
}
|
|
585
682
|
```
|
|
@@ -605,7 +702,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
605
702
|
##### Interface: FindOutputTagMapsArgs
|
|
606
703
|
|
|
607
704
|
```ts
|
|
608
|
-
export interface FindOutputTagMapsArgs extends
|
|
705
|
+
export interface FindOutputTagMapsArgs extends FindSincePagedArgs {
|
|
609
706
|
partial: Partial<TableOutputTagMap>;
|
|
610
707
|
tagIds?: number[];
|
|
611
708
|
}
|
|
@@ -619,7 +716,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
619
716
|
##### Interface: FindOutputTagsArgs
|
|
620
717
|
|
|
621
718
|
```ts
|
|
622
|
-
export interface FindOutputTagsArgs extends
|
|
719
|
+
export interface FindOutputTagsArgs extends FindSincePagedArgs {
|
|
623
720
|
partial: Partial<TableOutputTag>;
|
|
624
721
|
}
|
|
625
722
|
```
|
|
@@ -635,7 +732,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
635
732
|
export interface FindOutputsArgs extends FindSincePagedArgs {
|
|
636
733
|
partial: Partial<TableOutput>;
|
|
637
734
|
noScript?: boolean;
|
|
638
|
-
txStatus?:
|
|
735
|
+
txStatus?: TransactionStatus[];
|
|
639
736
|
}
|
|
640
737
|
```
|
|
641
738
|
|
|
@@ -660,9 +757,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
660
757
|
##### Interface: FindProvenTxReqsArgs
|
|
661
758
|
|
|
662
759
|
```ts
|
|
663
|
-
export interface FindProvenTxReqsArgs extends
|
|
760
|
+
export interface FindProvenTxReqsArgs extends FindSincePagedArgs {
|
|
664
761
|
partial: Partial<TableProvenTxReq>;
|
|
665
|
-
status?:
|
|
762
|
+
status?: ProvenTxReqStatus[];
|
|
666
763
|
txids?: string[];
|
|
667
764
|
}
|
|
668
765
|
```
|
|
@@ -675,7 +772,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
675
772
|
##### Interface: FindProvenTxsArgs
|
|
676
773
|
|
|
677
774
|
```ts
|
|
678
|
-
export interface FindProvenTxsArgs extends
|
|
775
|
+
export interface FindProvenTxsArgs extends FindSincePagedArgs {
|
|
679
776
|
partial: Partial<TableProvenTx>;
|
|
680
777
|
}
|
|
681
778
|
```
|
|
@@ -690,8 +787,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
690
787
|
```ts
|
|
691
788
|
export interface FindSincePagedArgs {
|
|
692
789
|
since?: Date;
|
|
693
|
-
paged?:
|
|
694
|
-
trx?:
|
|
790
|
+
paged?: Paged;
|
|
791
|
+
trx?: TrxToken;
|
|
695
792
|
}
|
|
696
793
|
```
|
|
697
794
|
|
|
@@ -703,7 +800,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
703
800
|
##### Interface: FindSyncStatesArgs
|
|
704
801
|
|
|
705
802
|
```ts
|
|
706
|
-
export interface FindSyncStatesArgs extends
|
|
803
|
+
export interface FindSyncStatesArgs extends FindSincePagedArgs {
|
|
707
804
|
partial: Partial<TableSyncState>;
|
|
708
805
|
}
|
|
709
806
|
```
|
|
@@ -716,9 +813,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
716
813
|
##### Interface: FindTransactionsArgs
|
|
717
814
|
|
|
718
815
|
```ts
|
|
719
|
-
export interface FindTransactionsArgs extends
|
|
816
|
+
export interface FindTransactionsArgs extends FindSincePagedArgs {
|
|
720
817
|
partial: Partial<TableTransaction>;
|
|
721
|
-
status?:
|
|
818
|
+
status?: TransactionStatus[];
|
|
722
819
|
noRawTx?: boolean;
|
|
723
820
|
}
|
|
724
821
|
```
|
|
@@ -731,7 +828,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
731
828
|
##### Interface: FindTxLabelMapsArgs
|
|
732
829
|
|
|
733
830
|
```ts
|
|
734
|
-
export interface FindTxLabelMapsArgs extends
|
|
831
|
+
export interface FindTxLabelMapsArgs extends FindSincePagedArgs {
|
|
735
832
|
partial: Partial<TableTxLabelMap>;
|
|
736
833
|
labelIds?: number[];
|
|
737
834
|
}
|
|
@@ -745,7 +842,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
745
842
|
##### Interface: FindTxLabelsArgs
|
|
746
843
|
|
|
747
844
|
```ts
|
|
748
|
-
export interface FindTxLabelsArgs extends
|
|
845
|
+
export interface FindTxLabelsArgs extends FindSincePagedArgs {
|
|
749
846
|
partial: Partial<TableTxLabel>;
|
|
750
847
|
}
|
|
751
848
|
```
|
|
@@ -758,7 +855,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
758
855
|
##### Interface: FindUsersArgs
|
|
759
856
|
|
|
760
857
|
```ts
|
|
761
|
-
export interface FindUsersArgs extends
|
|
858
|
+
export interface FindUsersArgs extends FindSincePagedArgs {
|
|
762
859
|
partial: Partial<TableUser>;
|
|
763
860
|
}
|
|
764
861
|
```
|
|
@@ -929,19 +1026,19 @@ export interface GetMerklePathResult {
|
|
|
929
1026
|
name?: string;
|
|
930
1027
|
merklePath?: MerklePath;
|
|
931
1028
|
header?: BlockHeader;
|
|
932
|
-
error?:
|
|
933
|
-
notes?:
|
|
1029
|
+
error?: WalletError;
|
|
1030
|
+
notes?: ReqHistoryNote[];
|
|
934
1031
|
}
|
|
935
1032
|
```
|
|
936
1033
|
|
|
937
|
-
See also: [BlockHeader](./
|
|
1034
|
+
See also: [BlockHeader](./services.md#interface-blockheader), [ReqHistoryNote](./client.md#type-reqhistorynote), [WalletError](./client.md#class-walleterror)
|
|
938
1035
|
|
|
939
1036
|
###### Property error
|
|
940
1037
|
|
|
941
1038
|
The first exception error that occurred during processing, if any.
|
|
942
1039
|
|
|
943
1040
|
```ts
|
|
944
|
-
error?:
|
|
1041
|
+
error?: WalletError
|
|
945
1042
|
```
|
|
946
1043
|
See also: [WalletError](./client.md#class-walleterror)
|
|
947
1044
|
|
|
@@ -974,7 +1071,7 @@ export interface GetRawTxResult {
|
|
|
974
1071
|
txid: string;
|
|
975
1072
|
name?: string;
|
|
976
1073
|
rawTx?: number[];
|
|
977
|
-
error?:
|
|
1074
|
+
error?: WalletError;
|
|
978
1075
|
}
|
|
979
1076
|
```
|
|
980
1077
|
|
|
@@ -985,7 +1082,7 @@ See also: [WalletError](./client.md#class-walleterror)
|
|
|
985
1082
|
The first exception error that occurred during processing, if any.
|
|
986
1083
|
|
|
987
1084
|
```ts
|
|
988
|
-
error?:
|
|
1085
|
+
error?: WalletError
|
|
989
1086
|
```
|
|
990
1087
|
See also: [WalletError](./client.md#class-walleterror)
|
|
991
1088
|
|
|
@@ -1066,7 +1163,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1066
1163
|
export interface GetScriptHashHistoryResult {
|
|
1067
1164
|
name: string;
|
|
1068
1165
|
status: "success" | "error";
|
|
1069
|
-
error?:
|
|
1166
|
+
error?: WalletError;
|
|
1070
1167
|
history: GetScriptHashHistory[];
|
|
1071
1168
|
}
|
|
1072
1169
|
```
|
|
@@ -1078,7 +1175,7 @@ See also: [GetScriptHashHistory](./client.md#interface-getscripthashhistory), [W
|
|
|
1078
1175
|
When status is 'error', provides code and description
|
|
1079
1176
|
|
|
1080
1177
|
```ts
|
|
1081
|
-
error?:
|
|
1178
|
+
error?: WalletError
|
|
1082
1179
|
```
|
|
1083
1180
|
See also: [WalletError](./client.md#class-walleterror)
|
|
1084
1181
|
|
|
@@ -1117,8 +1214,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1117
1214
|
export interface GetStatusForTxidsResult {
|
|
1118
1215
|
name: string;
|
|
1119
1216
|
status: "success" | "error";
|
|
1120
|
-
error?:
|
|
1121
|
-
results:
|
|
1217
|
+
error?: WalletError;
|
|
1218
|
+
results: StatusForTxidResult[];
|
|
1122
1219
|
}
|
|
1123
1220
|
```
|
|
1124
1221
|
|
|
@@ -1129,7 +1226,7 @@ See also: [StatusForTxidResult](./client.md#interface-statusfortxidresult), [Wal
|
|
|
1129
1226
|
The first exception error that occurred during processing, if any.
|
|
1130
1227
|
|
|
1131
1228
|
```ts
|
|
1132
|
-
error?:
|
|
1229
|
+
error?: WalletError
|
|
1133
1230
|
```
|
|
1134
1231
|
See also: [WalletError](./client.md#class-walleterror)
|
|
1135
1232
|
|
|
@@ -1204,7 +1301,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1204
1301
|
export interface GetUtxoStatusResult {
|
|
1205
1302
|
name: string;
|
|
1206
1303
|
status: "success" | "error";
|
|
1207
|
-
error?:
|
|
1304
|
+
error?: WalletError;
|
|
1208
1305
|
isUtxo?: boolean;
|
|
1209
1306
|
details: GetUtxoStatusDetails[];
|
|
1210
1307
|
}
|
|
@@ -1229,7 +1326,7 @@ See also: [GetUtxoStatusDetails](./client.md#interface-getutxostatusdetails)
|
|
|
1229
1326
|
When status is 'error', provides code and description
|
|
1230
1327
|
|
|
1231
1328
|
```ts
|
|
1232
|
-
error?:
|
|
1329
|
+
error?: WalletError
|
|
1233
1330
|
```
|
|
1234
1331
|
See also: [WalletError](./client.md#class-walleterror)
|
|
1235
1332
|
|
|
@@ -1273,40 +1370,68 @@ export interface KeyPair {
|
|
|
1273
1370
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1274
1371
|
|
|
1275
1372
|
---
|
|
1276
|
-
##### Interface:
|
|
1373
|
+
##### Interface: LiveBlockHeader
|
|
1277
1374
|
|
|
1278
|
-
|
|
1375
|
+
The "live" portion of the block chain is recent history that can conceivably be subject to reorganizations.
|
|
1376
|
+
The additional fields support tracking orphan blocks, chain forks, and chain reorgs.
|
|
1279
1377
|
|
|
1280
1378
|
```ts
|
|
1281
|
-
export interface
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1379
|
+
export interface LiveBlockHeader extends BlockHeader {
|
|
1380
|
+
chainWork: string;
|
|
1381
|
+
isChainTip: boolean;
|
|
1382
|
+
isActive: boolean;
|
|
1383
|
+
headerId: number;
|
|
1384
|
+
previousHeaderId: number | null;
|
|
1285
1385
|
}
|
|
1286
1386
|
```
|
|
1287
1387
|
|
|
1288
|
-
|
|
1388
|
+
See also: [BlockHeader](./services.md#interface-blockheader)
|
|
1289
1389
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1390
|
+
###### Property chainWork
|
|
1391
|
+
|
|
1392
|
+
The cummulative chainwork achieved by the addition of this block to the chain.
|
|
1393
|
+
Chainwork only matters in selecting the active chain.
|
|
1292
1394
|
|
|
1293
1395
|
```ts
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
services?: Services;
|
|
1305
|
-
monitor?: Monitor;
|
|
1306
|
-
}
|
|
1396
|
+
chainWork: string
|
|
1397
|
+
```
|
|
1398
|
+
|
|
1399
|
+
###### Property headerId
|
|
1400
|
+
|
|
1401
|
+
As there may be more than one header with identical height values due to orphan tracking,
|
|
1402
|
+
headers are assigned a unique headerId while part of the "live" portion of the block chain.
|
|
1403
|
+
|
|
1404
|
+
```ts
|
|
1405
|
+
headerId: number
|
|
1307
1406
|
```
|
|
1308
1407
|
|
|
1309
|
-
|
|
1408
|
+
###### Property isActive
|
|
1409
|
+
|
|
1410
|
+
True only if this header is currently on the active chain.
|
|
1411
|
+
|
|
1412
|
+
```ts
|
|
1413
|
+
isActive: boolean
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
###### Property isChainTip
|
|
1417
|
+
|
|
1418
|
+
True only if this header is currently a chain tip. e.g. There is no header that follows it by previousHash or previousHeaderId.
|
|
1419
|
+
|
|
1420
|
+
```ts
|
|
1421
|
+
isChainTip: boolean
|
|
1422
|
+
```
|
|
1423
|
+
|
|
1424
|
+
###### Property previousHeaderId
|
|
1425
|
+
|
|
1426
|
+
Every header in the "live" portion of the block chain is linked to an ancestor header through
|
|
1427
|
+
both its previousHash and previousHeaderId properties.
|
|
1428
|
+
|
|
1429
|
+
Due to forks, there may be multiple headers with identical `previousHash` and `previousHeaderId` values.
|
|
1430
|
+
Of these, only one (the header on the active chain) will have `isActive` === true.
|
|
1431
|
+
|
|
1432
|
+
```ts
|
|
1433
|
+
previousHeaderId: number | null
|
|
1434
|
+
```
|
|
1310
1435
|
|
|
1311
1436
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1312
1437
|
|
|
@@ -1917,7 +2042,7 @@ export interface PostTxResultForTxid {
|
|
|
1917
2042
|
merklePath?: MerklePath;
|
|
1918
2043
|
competingTxs?: string[];
|
|
1919
2044
|
data?: object | string | PostTxResultForTxidError;
|
|
1920
|
-
notes?:
|
|
2045
|
+
notes?: ReqHistoryNote[];
|
|
1921
2046
|
serviceError?: boolean;
|
|
1922
2047
|
}
|
|
1923
2048
|
```
|
|
@@ -1983,10 +2108,10 @@ Properties on array items of result returned from `WalletServices` function `pos
|
|
|
1983
2108
|
export interface PostTxsResult {
|
|
1984
2109
|
name: string;
|
|
1985
2110
|
status: "success" | "error";
|
|
1986
|
-
error?:
|
|
2111
|
+
error?: WalletError;
|
|
1987
2112
|
txidResults: PostTxResultForTxid[];
|
|
1988
2113
|
data?: object;
|
|
1989
|
-
notes?:
|
|
2114
|
+
notes?: ReqHistoryNote[];
|
|
1990
2115
|
}
|
|
1991
2116
|
```
|
|
1992
2117
|
|
|
@@ -2028,7 +2153,7 @@ export interface ProcessSyncChunkResult {
|
|
|
2028
2153
|
maxUpdated_at: Date | undefined;
|
|
2029
2154
|
updates: number;
|
|
2030
2155
|
inserts: number;
|
|
2031
|
-
error?:
|
|
2156
|
+
error?: WalletError;
|
|
2032
2157
|
}
|
|
2033
2158
|
```
|
|
2034
2159
|
|
|
@@ -2282,419 +2407,47 @@ export interface ReviewActionResult {
|
|
|
2282
2407
|
|
|
2283
2408
|
See also: [ReviewActionResultStatus](./client.md#type-reviewactionresultstatus)
|
|
2284
2409
|
|
|
2285
|
-
###### Property competingBeef
|
|
2286
|
-
|
|
2287
|
-
Merged beef of competingTxs, valid when status is 'doubleSpend'.
|
|
2288
|
-
|
|
2289
|
-
```ts
|
|
2290
|
-
competingBeef?: number[]
|
|
2291
|
-
```
|
|
2292
|
-
|
|
2293
|
-
###### Property competingTxs
|
|
2294
|
-
|
|
2295
|
-
Any competing txids reported for this txid, valid when status is 'doubleSpend'.
|
|
2296
|
-
|
|
2297
|
-
```ts
|
|
2298
|
-
competingTxs?: string[]
|
|
2299
|
-
```
|
|
2300
|
-
|
|
2301
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2302
|
-
|
|
2303
|
-
---
|
|
2304
|
-
##### Interface: ScriptTemplateParamsBRC29
|
|
2305
|
-
|
|
2306
|
-
```ts
|
|
2307
|
-
export interface ScriptTemplateParamsBRC29 {
|
|
2308
|
-
derivationPrefix?: string;
|
|
2309
|
-
derivationSuffix?: string;
|
|
2310
|
-
keyDeriver: KeyDeriverApi;
|
|
2311
|
-
}
|
|
2312
|
-
```
|
|
2313
|
-
|
|
2314
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2315
|
-
|
|
2316
|
-
---
|
|
2317
|
-
##### Interface: ScriptTemplateUnlock
|
|
2318
|
-
|
|
2319
|
-
```ts
|
|
2320
|
-
export interface ScriptTemplateUnlock {
|
|
2321
|
-
sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
|
|
2322
|
-
estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
|
|
2323
|
-
}
|
|
2324
|
-
```
|
|
2325
|
-
|
|
2326
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2327
|
-
|
|
2328
|
-
---
|
|
2329
|
-
##### Interface: SetupEnv
|
|
2330
|
-
|
|
2331
|
-
`SetupEnv` provides a starting point for managing secrets that
|
|
2332
|
-
must not appear in source code.
|
|
2333
|
-
|
|
2334
|
-
The `makeEnv` and `getEnv` functions of the `Setup` and `SetupClient` classes
|
|
2335
|
-
provide an easy way to create and import these secrets and related properties.
|
|
2336
|
-
|
|
2337
|
-
```ts
|
|
2338
|
-
export interface SetupEnv {
|
|
2339
|
-
chain: sdk.Chain;
|
|
2340
|
-
identityKey: string;
|
|
2341
|
-
identityKey2: string;
|
|
2342
|
-
filePath: string | undefined;
|
|
2343
|
-
taalApiKey: string;
|
|
2344
|
-
devKeys: Record<string, string>;
|
|
2345
|
-
mySQLConnection: string;
|
|
2346
|
-
}
|
|
2347
|
-
```
|
|
2348
|
-
|
|
2349
|
-
See also: [Chain](./client.md#type-chain)
|
|
2350
|
-
|
|
2351
|
-
###### Property chain
|
|
2352
|
-
|
|
2353
|
-
The chan being accessed: 'main' for mainnet, 'test' for 'testnet'.
|
|
2354
|
-
|
|
2355
|
-
```ts
|
|
2356
|
-
chain: sdk.Chain
|
|
2357
|
-
```
|
|
2358
|
-
See also: [Chain](./client.md#type-chain)
|
|
2359
|
-
|
|
2360
|
-
###### Property devKeys
|
|
2361
|
-
|
|
2362
|
-
A map of public keys (identity keys, hex strings) to private keys (hex strings).
|
|
2363
|
-
|
|
2364
|
-
```ts
|
|
2365
|
-
devKeys: Record<string, string>
|
|
2366
|
-
```
|
|
2367
|
-
|
|
2368
|
-
###### Property filePath
|
|
2369
|
-
|
|
2370
|
-
Filepath to sqlite file to be used for identityKey wallet.
|
|
2371
|
-
|
|
2372
|
-
```ts
|
|
2373
|
-
filePath: string | undefined
|
|
2374
|
-
```
|
|
2375
|
-
|
|
2376
|
-
###### Property identityKey
|
|
2377
|
-
|
|
2378
|
-
The user's primary identity key (public key).
|
|
2379
|
-
|
|
2380
|
-
```ts
|
|
2381
|
-
identityKey: string
|
|
2382
|
-
```
|
|
2383
|
-
|
|
2384
|
-
###### Property identityKey2
|
|
2385
|
-
|
|
2386
|
-
A secondary identity key (public key), used to test exchanges with other users.
|
|
2387
|
-
|
|
2388
|
-
```ts
|
|
2389
|
-
identityKey2: string
|
|
2390
|
-
```
|
|
2391
|
-
|
|
2392
|
-
###### Property mySQLConnection
|
|
2393
|
-
|
|
2394
|
-
A MySQL connection string including user and password properties.
|
|
2395
|
-
Must be valid to make use of MySQL `Setup` class support.
|
|
2396
|
-
|
|
2397
|
-
```ts
|
|
2398
|
-
mySQLConnection: string
|
|
2399
|
-
```
|
|
2400
|
-
|
|
2401
|
-
###### Property taalApiKey
|
|
2402
|
-
|
|
2403
|
-
A vaild TAAL API key for use by `Services`
|
|
2404
|
-
|
|
2405
|
-
```ts
|
|
2406
|
-
taalApiKey: string
|
|
2407
|
-
```
|
|
2408
|
-
|
|
2409
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2410
|
-
|
|
2411
|
-
---
|
|
2412
|
-
##### Interface: SetupWallet
|
|
2413
|
-
|
|
2414
|
-
When creating a BRC-100 compatible `Wallet`, many components come into play.
|
|
2415
|
-
|
|
2416
|
-
All of the `createWallet` functions in the `Setup` and `SetupClient` classes return
|
|
2417
|
-
an object with direct access to each component to facilitate experimentation, testing
|
|
2418
|
-
and customization.
|
|
2419
|
-
|
|
2420
|
-
```ts
|
|
2421
|
-
export interface SetupWallet {
|
|
2422
|
-
rootKey: PrivateKey;
|
|
2423
|
-
identityKey: string;
|
|
2424
|
-
keyDeriver: KeyDeriver;
|
|
2425
|
-
chain: sdk.Chain;
|
|
2426
|
-
storage: WalletStorageManager;
|
|
2427
|
-
services: Services;
|
|
2428
|
-
monitor: Monitor;
|
|
2429
|
-
wallet: Wallet;
|
|
2430
|
-
}
|
|
2431
|
-
```
|
|
2432
|
-
|
|
2433
|
-
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)
|
|
2434
|
-
|
|
2435
|
-
###### Property chain
|
|
2436
|
-
|
|
2437
|
-
The chain ('main' or 'test') which the wallet accesses.
|
|
2438
|
-
|
|
2439
|
-
```ts
|
|
2440
|
-
chain: sdk.Chain
|
|
2441
|
-
```
|
|
2442
|
-
See also: [Chain](./client.md#type-chain)
|
|
2443
|
-
|
|
2444
|
-
###### Property identityKey
|
|
2445
|
-
|
|
2446
|
-
The pubilc key associated with the `rootKey` which also serves as the wallet's identity.
|
|
2447
|
-
|
|
2448
|
-
```ts
|
|
2449
|
-
identityKey: string
|
|
2450
|
-
```
|
|
2451
|
-
|
|
2452
|
-
###### Property keyDeriver
|
|
2453
|
-
|
|
2454
|
-
The `KeyDeriver` component used by the wallet for key derivation and cryptographic functions.
|
|
2455
|
-
|
|
2456
|
-
```ts
|
|
2457
|
-
keyDeriver: KeyDeriver
|
|
2458
|
-
```
|
|
2459
|
-
|
|
2460
|
-
###### Property monitor
|
|
2461
|
-
|
|
2462
|
-
The background task `Monitor` component available to the wallet to offload tasks
|
|
2463
|
-
that speed up wallet operations and maintain data integrity.
|
|
2464
|
-
|
|
2465
|
-
```ts
|
|
2466
|
-
monitor: Monitor
|
|
2467
|
-
```
|
|
2468
|
-
See also: [Monitor](./monitor.md#class-monitor)
|
|
2469
|
-
|
|
2470
|
-
###### Property rootKey
|
|
2471
|
-
|
|
2472
|
-
The rootKey of the `KeyDeriver`. The private key from which other keys are derived.
|
|
2473
|
-
|
|
2474
|
-
```ts
|
|
2475
|
-
rootKey: PrivateKey
|
|
2476
|
-
```
|
|
2477
|
-
|
|
2478
|
-
###### Property services
|
|
2479
|
-
|
|
2480
|
-
The network `Services` component which provides the wallet with access to external services hosted
|
|
2481
|
-
on the public network.
|
|
2482
|
-
|
|
2483
|
-
```ts
|
|
2484
|
-
services: Services
|
|
2485
|
-
```
|
|
2486
|
-
See also: [Services](./services.md#class-services)
|
|
2487
|
-
|
|
2488
|
-
###### Property storage
|
|
2489
|
-
|
|
2490
|
-
The `WalletStorageManager` that manages all the configured storage providers (active and backups)
|
|
2491
|
-
accessed by the wallet.
|
|
2492
|
-
|
|
2493
|
-
```ts
|
|
2494
|
-
storage: WalletStorageManager
|
|
2495
|
-
```
|
|
2496
|
-
See also: [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
2497
|
-
|
|
2498
|
-
###### Property wallet
|
|
2499
|
-
|
|
2500
|
-
The actual BRC-100 `Wallet` to which all the other properties and components contribute.
|
|
2501
|
-
|
|
2502
|
-
Note that internally, the wallet is itself linked to all these properties and components.
|
|
2503
|
-
They are included in this interface to facilitate access after wallet construction for
|
|
2504
|
-
experimentation, testing and customization. Any changes made to the configuration of these
|
|
2505
|
-
components after construction may disrupt the normal operation of the wallet.
|
|
2506
|
-
|
|
2507
|
-
```ts
|
|
2508
|
-
wallet: Wallet
|
|
2509
|
-
```
|
|
2510
|
-
See also: [Wallet](./client.md#class-wallet)
|
|
2511
|
-
|
|
2512
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2513
|
-
|
|
2514
|
-
---
|
|
2515
|
-
##### Interface: SetupWalletArgs
|
|
2516
|
-
|
|
2517
|
-
Arguments used by `createWallet` to construct a `SetupWallet`.
|
|
2518
|
-
|
|
2519
|
-
Extension `SetupWalletClientArgs` used by `createWalletClient` to construct a `SetupWalletClient`.
|
|
2520
|
-
|
|
2521
|
-
Extension `SetupWalletKnexArgs` used by `createWalletKnex` to construct a `SetupWalletKnex`.
|
|
2522
|
-
|
|
2523
|
-
Extension `SetupWalletMySQLArgs` used by `createWalletMySQL` to construct a `SetupWalletKnex`.
|
|
2524
|
-
|
|
2525
|
-
Extension `SetupWalletSQLiteArgs` used by `createWalletSQLite` to construct a `SetupWalletKnex`.
|
|
2526
|
-
|
|
2527
|
-
```ts
|
|
2528
|
-
export interface SetupWalletArgs {
|
|
2529
|
-
env: SetupEnv;
|
|
2530
|
-
rootKeyHex?: string;
|
|
2531
|
-
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
2532
|
-
active?: sdk.WalletStorageProvider;
|
|
2533
|
-
backups?: sdk.WalletStorageProvider[];
|
|
2534
|
-
}
|
|
2535
|
-
```
|
|
2536
|
-
|
|
2537
|
-
See also: [SetupEnv](./setup.md#interface-setupenv), [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2538
|
-
|
|
2539
|
-
###### Property active
|
|
2540
|
-
|
|
2541
|
-
Optional. Active wallet storage. Can be added later.
|
|
2542
|
-
|
|
2543
|
-
```ts
|
|
2544
|
-
active?: sdk.WalletStorageProvider
|
|
2545
|
-
```
|
|
2546
|
-
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2547
|
-
|
|
2548
|
-
###### Property backups
|
|
2549
|
-
|
|
2550
|
-
Optional. One or more storage providers managed as backup destinations. Can be added later.
|
|
2551
|
-
|
|
2552
|
-
```ts
|
|
2553
|
-
backups?: sdk.WalletStorageProvider[]
|
|
2554
|
-
```
|
|
2555
|
-
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
2556
|
-
|
|
2557
|
-
###### Property env
|
|
2558
|
-
|
|
2559
|
-
Configuration "secrets" typically obtained by `Setup.makeEnv` and `Setup.getEnv` functions.
|
|
2560
|
-
|
|
2561
|
-
```ts
|
|
2562
|
-
env: SetupEnv
|
|
2563
|
-
```
|
|
2564
|
-
See also: [SetupEnv](./setup.md#interface-setupenv)
|
|
2565
|
-
|
|
2566
|
-
###### Property privilegedKeyGetter
|
|
2567
|
-
|
|
2568
|
-
Optional. The privileged private key getter used to initialize the `PrivilegedKeyManager`.
|
|
2569
|
-
Defaults to undefined.
|
|
2570
|
-
|
|
2571
|
-
```ts
|
|
2572
|
-
privilegedKeyGetter?: () => Promise<PrivateKey>
|
|
2573
|
-
```
|
|
2574
|
-
|
|
2575
|
-
###### Property rootKeyHex
|
|
2576
|
-
|
|
2577
|
-
Optional. The non-privileged private key used to initialize the `KeyDeriver` and determine the `identityKey`.
|
|
2578
|
-
Defaults to `env.devKeys[env.identityKey]
|
|
2579
|
-
|
|
2580
|
-
```ts
|
|
2581
|
-
rootKeyHex?: string
|
|
2582
|
-
```
|
|
2583
|
-
|
|
2584
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2585
|
-
|
|
2586
|
-
---
|
|
2587
|
-
##### Interface: SetupWalletClient
|
|
2588
|
-
|
|
2589
|
-
Extension `SetupWalletClient` of `SetupWallet` is returned by `createWalletClient`
|
|
2590
|
-
|
|
2591
|
-
```ts
|
|
2592
|
-
export interface SetupWalletClient extends SetupWallet {
|
|
2593
|
-
endpointUrl: string;
|
|
2594
|
-
}
|
|
2595
|
-
```
|
|
2596
|
-
|
|
2597
|
-
See also: [SetupWallet](./setup.md#interface-setupwallet)
|
|
2598
|
-
|
|
2599
|
-
###### Property endpointUrl
|
|
2600
|
-
|
|
2601
|
-
The endpoint URL of the service hosting the `StorageServer` JSON-RPC service to
|
|
2602
|
-
which a `StorageClient` instance is connected to function as
|
|
2603
|
-
the active storage provider of the wallet.
|
|
2604
|
-
|
|
2605
|
-
```ts
|
|
2606
|
-
endpointUrl: string
|
|
2607
|
-
```
|
|
2608
|
-
|
|
2609
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2610
|
-
|
|
2611
|
-
---
|
|
2612
|
-
##### Interface: SetupWalletClientArgs
|
|
2613
|
-
|
|
2614
|
-
Extension `SetupWalletClientArgs` of `SetupWalletArgs` is used by `createWalletClient`
|
|
2615
|
-
to construct a `SetupWalletClient`.
|
|
2616
|
-
|
|
2617
|
-
```ts
|
|
2618
|
-
export interface SetupWalletClientArgs extends SetupWalletArgs {
|
|
2619
|
-
endpointUrl?: string;
|
|
2620
|
-
}
|
|
2621
|
-
```
|
|
2622
|
-
|
|
2623
|
-
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2624
|
-
|
|
2625
|
-
###### Property endpointUrl
|
|
2626
|
-
|
|
2627
|
-
The endpoint URL of a service hosting the `StorageServer` JSON-RPC service to
|
|
2628
|
-
which a `StorageClient` instance should connect to function as
|
|
2629
|
-
the active storage provider of the newly created wallet.
|
|
2630
|
-
|
|
2631
|
-
```ts
|
|
2632
|
-
endpointUrl?: string
|
|
2633
|
-
```
|
|
2634
|
-
|
|
2635
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2410
|
+
###### Property competingBeef
|
|
2636
2411
|
|
|
2637
|
-
|
|
2638
|
-
##### Interface: SetupWalletKnex
|
|
2412
|
+
Merged beef of competingTxs, valid when status is 'doubleSpend'.
|
|
2639
2413
|
|
|
2640
2414
|
```ts
|
|
2641
|
-
|
|
2642
|
-
activeStorage: StorageKnex;
|
|
2643
|
-
userId: number;
|
|
2644
|
-
rootKey: PrivateKey;
|
|
2645
|
-
identityKey: string;
|
|
2646
|
-
keyDeriver: KeyDeriver;
|
|
2647
|
-
chain: sdk.Chain;
|
|
2648
|
-
storage: WalletStorageManager;
|
|
2649
|
-
services: Services;
|
|
2650
|
-
monitor: Monitor;
|
|
2651
|
-
wallet: Wallet;
|
|
2652
|
-
}
|
|
2415
|
+
competingBeef?: number[]
|
|
2653
2416
|
```
|
|
2654
2417
|
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2418
|
+
###### Property competingTxs
|
|
2658
2419
|
|
|
2659
|
-
|
|
2660
|
-
##### Interface: SetupWalletKnexArgs
|
|
2420
|
+
Any competing txids reported for this txid, valid when status is 'doubleSpend'.
|
|
2661
2421
|
|
|
2662
2422
|
```ts
|
|
2663
|
-
|
|
2664
|
-
knex: Knex<any, any[]>;
|
|
2665
|
-
databaseName: string;
|
|
2666
|
-
}
|
|
2423
|
+
competingTxs?: string[]
|
|
2667
2424
|
```
|
|
2668
2425
|
|
|
2669
|
-
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2670
|
-
|
|
2671
2426
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2672
2427
|
|
|
2673
2428
|
---
|
|
2674
|
-
##### Interface:
|
|
2429
|
+
##### Interface: ScriptTemplateParamsBRC29
|
|
2675
2430
|
|
|
2676
2431
|
```ts
|
|
2677
|
-
export interface
|
|
2678
|
-
|
|
2432
|
+
export interface ScriptTemplateParamsBRC29 {
|
|
2433
|
+
derivationPrefix?: string;
|
|
2434
|
+
derivationSuffix?: string;
|
|
2435
|
+
keyDeriver: KeyDeriverApi;
|
|
2679
2436
|
}
|
|
2680
2437
|
```
|
|
2681
2438
|
|
|
2682
|
-
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2683
|
-
|
|
2684
2439
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2685
2440
|
|
|
2686
2441
|
---
|
|
2687
|
-
##### Interface:
|
|
2442
|
+
##### Interface: ScriptTemplateUnlock
|
|
2688
2443
|
|
|
2689
2444
|
```ts
|
|
2690
|
-
export interface
|
|
2691
|
-
|
|
2692
|
-
|
|
2445
|
+
export interface ScriptTemplateUnlock {
|
|
2446
|
+
sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
|
|
2447
|
+
estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
|
|
2693
2448
|
}
|
|
2694
2449
|
```
|
|
2695
2450
|
|
|
2696
|
-
See also: [SetupWalletArgs](./setup.md#interface-setupwalletargs)
|
|
2697
|
-
|
|
2698
2451
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2699
2452
|
|
|
2700
2453
|
---
|
|
@@ -2806,7 +2559,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2806
2559
|
##### Interface: StorageCreateTransactionSdkOutput
|
|
2807
2560
|
|
|
2808
2561
|
```ts
|
|
2809
|
-
export interface StorageCreateTransactionSdkOutput extends
|
|
2562
|
+
export interface StorageCreateTransactionSdkOutput extends ValidCreateActionOutput {
|
|
2810
2563
|
vout: number;
|
|
2811
2564
|
providedBy: StorageProvidedBy;
|
|
2812
2565
|
purpose?: string;
|
|
@@ -2989,27 +2742,6 @@ txid: string
|
|
|
2989
2742
|
|
|
2990
2743
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2991
2744
|
|
|
2992
|
-
---
|
|
2993
|
-
##### Interface: StorageKnexOptions
|
|
2994
|
-
|
|
2995
|
-
```ts
|
|
2996
|
-
export interface StorageKnexOptions extends StorageProviderOptions {
|
|
2997
|
-
knex: Knex;
|
|
2998
|
-
}
|
|
2999
|
-
```
|
|
3000
|
-
|
|
3001
|
-
See also: [StorageProviderOptions](./storage.md#interface-storageprovideroptions)
|
|
3002
|
-
|
|
3003
|
-
###### Property knex
|
|
3004
|
-
|
|
3005
|
-
Knex database interface initialized with valid connection configuration.
|
|
3006
|
-
|
|
3007
|
-
```ts
|
|
3008
|
-
knex: Knex
|
|
3009
|
-
```
|
|
3010
|
-
|
|
3011
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3012
|
-
|
|
3013
2745
|
---
|
|
3014
2746
|
##### Interface: StorageProcessActionArgs
|
|
3015
2747
|
|
|
@@ -3123,7 +2855,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
3123
2855
|
|
|
3124
2856
|
```ts
|
|
3125
2857
|
export interface StorageSyncReaderOptions {
|
|
3126
|
-
chain:
|
|
2858
|
+
chain: Chain;
|
|
3127
2859
|
}
|
|
3128
2860
|
```
|
|
3129
2861
|
|
|
@@ -3776,7 +3508,7 @@ The following purge actions are available to support sustained operation:
|
|
|
3776
3508
|
+ proven_tx_reqs table delete records
|
|
3777
3509
|
|
|
3778
3510
|
```ts
|
|
3779
|
-
export interface TaskPurgeParams extends
|
|
3511
|
+
export interface TaskPurgeParams extends PurgeParams {
|
|
3780
3512
|
}
|
|
3781
3513
|
```
|
|
3782
3514
|
|
|
@@ -4017,7 +3749,7 @@ export interface UpdateProvenTxReqWithNewProvenTxArgs {
|
|
|
4017
3749
|
provenTxReqId: number;
|
|
4018
3750
|
txid: string;
|
|
4019
3751
|
attempts: number;
|
|
4020
|
-
status:
|
|
3752
|
+
status: ProvenTxReqStatus;
|
|
4021
3753
|
history: string;
|
|
4022
3754
|
height: number;
|
|
4023
3755
|
index: number;
|
|
@@ -4036,7 +3768,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4036
3768
|
|
|
4037
3769
|
```ts
|
|
4038
3770
|
export interface UpdateProvenTxReqWithNewProvenTxResult {
|
|
4039
|
-
status:
|
|
3771
|
+
status: ProvenTxReqStatus;
|
|
4040
3772
|
history: string;
|
|
4041
3773
|
provenTxId: number;
|
|
4042
3774
|
log?: string;
|
|
@@ -4589,7 +4321,7 @@ Defines standard interfaces to access functionality implemented by external tran
|
|
|
4589
4321
|
|
|
4590
4322
|
```ts
|
|
4591
4323
|
export interface WalletServices {
|
|
4592
|
-
chain:
|
|
4324
|
+
chain: Chain;
|
|
4593
4325
|
getChainTracker(): Promise<ChainTracker>;
|
|
4594
4326
|
getHeaderForHeight(height: number): Promise<number[]>;
|
|
4595
4327
|
getHeight(): Promise<number>;
|
|
@@ -4599,22 +4331,22 @@ export interface WalletServices {
|
|
|
4599
4331
|
getMerklePath(txid: string, useNext?: boolean): Promise<GetMerklePathResult>;
|
|
4600
4332
|
postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult[]>;
|
|
4601
4333
|
hashOutputScript(script: string): string;
|
|
4602
|
-
getStatusForTxids(txids: string[], useNext?: boolean): Promise<
|
|
4334
|
+
getStatusForTxids(txids: string[], useNext?: boolean): Promise<GetStatusForTxidsResult>;
|
|
4603
4335
|
getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean): Promise<GetUtxoStatusResult>;
|
|
4604
|
-
getScriptHashHistory(hash: string, useNext?: boolean): Promise<
|
|
4605
|
-
hashToHeader(hash: string): Promise<
|
|
4336
|
+
getScriptHashHistory(hash: string, useNext?: boolean): Promise<GetScriptHashHistoryResult>;
|
|
4337
|
+
hashToHeader(hash: string): Promise<BlockHeader>;
|
|
4606
4338
|
nLockTimeIsFinal(txOrLockTime: string | number[] | BsvTransaction | number): Promise<boolean>;
|
|
4607
4339
|
}
|
|
4608
4340
|
```
|
|
4609
4341
|
|
|
4610
|
-
See also: [BlockHeader](./
|
|
4342
|
+
See also: [BlockHeader](./services.md#interface-blockheader), [Chain](./client.md#type-chain), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [GetRawTxResult](./client.md#interface-getrawtxresult), [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult), [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat), [GetUtxoStatusResult](./client.md#interface-getutxostatusresult), [PostBeefResult](./client.md#interface-postbeefresult)
|
|
4611
4343
|
|
|
4612
4344
|
###### Property chain
|
|
4613
4345
|
|
|
4614
4346
|
The chain being serviced.
|
|
4615
4347
|
|
|
4616
4348
|
```ts
|
|
4617
|
-
chain:
|
|
4349
|
+
chain: Chain
|
|
4618
4350
|
```
|
|
4619
4351
|
See also: [Chain](./client.md#type-chain)
|
|
4620
4352
|
|
|
@@ -4735,7 +4467,7 @@ Primarily useful for determining if a recently broadcast transaction is known to
|
|
|
4735
4467
|
Also returns the current depth from chain tip if 'mined'.
|
|
4736
4468
|
|
|
4737
4469
|
```ts
|
|
4738
|
-
getStatusForTxids(txids: string[], useNext?: boolean): Promise<
|
|
4470
|
+
getStatusForTxids(txids: string[], useNext?: boolean): Promise<GetStatusForTxidsResult>
|
|
4739
4471
|
```
|
|
4740
4472
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
4741
4473
|
|
|
@@ -4785,9 +4517,9 @@ Argument Details
|
|
|
4785
4517
|
###### Method hashToHeader
|
|
4786
4518
|
|
|
4787
4519
|
```ts
|
|
4788
|
-
hashToHeader(hash: string): Promise<
|
|
4520
|
+
hashToHeader(hash: string): Promise<BlockHeader>
|
|
4789
4521
|
```
|
|
4790
|
-
See also: [BlockHeader](./
|
|
4522
|
+
See also: [BlockHeader](./services.md#interface-blockheader)
|
|
4791
4523
|
|
|
4792
4524
|
Returns
|
|
4793
4525
|
|
|
@@ -4820,7 +4552,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4820
4552
|
|
|
4821
4553
|
```ts
|
|
4822
4554
|
export interface WalletServicesOptions {
|
|
4823
|
-
chain:
|
|
4555
|
+
chain: Chain;
|
|
4824
4556
|
taalApiKey?: string;
|
|
4825
4557
|
bitailsApiKey?: string;
|
|
4826
4558
|
whatsOnChainApiKey?: string;
|
|
@@ -4875,7 +4607,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4875
4607
|
```ts
|
|
4876
4608
|
export interface WalletSigner {
|
|
4877
4609
|
isWalletSigner: true;
|
|
4878
|
-
chain:
|
|
4610
|
+
chain: Chain;
|
|
4879
4611
|
keyDeriver: KeyDeriverApi;
|
|
4880
4612
|
}
|
|
4881
4613
|
```
|
|
@@ -4900,24 +4632,24 @@ export interface WalletStorage {
|
|
|
4900
4632
|
makeAvailable(): Promise<TableSettings>;
|
|
4901
4633
|
migrate(storageName: string, storageIdentityKey: string): Promise<string>;
|
|
4902
4634
|
destroy(): Promise<void>;
|
|
4903
|
-
setServices(v:
|
|
4904
|
-
getServices():
|
|
4635
|
+
setServices(v: WalletServices): void;
|
|
4636
|
+
getServices(): WalletServices;
|
|
4905
4637
|
getSettings(): TableSettings;
|
|
4906
|
-
getAuth(): Promise<
|
|
4638
|
+
getAuth(): Promise<AuthId>;
|
|
4907
4639
|
findOrInsertUser(identityKey: string): Promise<{
|
|
4908
4640
|
user: TableUser;
|
|
4909
4641
|
isNew: boolean;
|
|
4910
4642
|
}>;
|
|
4911
4643
|
abortAction(args: AbortActionArgs): Promise<AbortActionResult>;
|
|
4912
|
-
createAction(args:
|
|
4913
|
-
processAction(args:
|
|
4644
|
+
createAction(args: ValidCreateActionArgs): Promise<StorageCreateActionResult>;
|
|
4645
|
+
processAction(args: StorageProcessActionArgs): Promise<StorageProcessActionResults>;
|
|
4914
4646
|
internalizeAction(args: InternalizeActionArgs): Promise<InternalizeActionResult>;
|
|
4915
|
-
findCertificates(args:
|
|
4916
|
-
findOutputBaskets(args:
|
|
4917
|
-
findOutputs(args:
|
|
4918
|
-
findProvenTxReqs(args:
|
|
4647
|
+
findCertificates(args: FindCertificatesArgs): Promise<TableCertificateX[]>;
|
|
4648
|
+
findOutputBaskets(args: FindOutputBasketsArgs): Promise<TableOutputBasket[]>;
|
|
4649
|
+
findOutputs(args: FindOutputsArgs): Promise<TableOutput[]>;
|
|
4650
|
+
findProvenTxReqs(args: FindProvenTxReqsArgs): Promise<TableProvenTxReq[]>;
|
|
4919
4651
|
listActions(args: ListActionsArgs): Promise<ListActionsResult>;
|
|
4920
|
-
listCertificates(args:
|
|
4652
|
+
listCertificates(args: ValidListCertificatesArgs): Promise<ListCertificatesResult>;
|
|
4921
4653
|
listOutputs(args: ListOutputsArgs): Promise<ListOutputsResult>;
|
|
4922
4654
|
insertCertificate(certificate: TableCertificateX): Promise<number>;
|
|
4923
4655
|
relinquishCertificate(args: RelinquishCertificateArgs): Promise<number>;
|
|
@@ -4948,7 +4680,7 @@ is the actual minimal interface implemented by storage and remoted storage provi
|
|
|
4948
4680
|
```ts
|
|
4949
4681
|
export interface WalletStorageProvider extends WalletStorageSync {
|
|
4950
4682
|
isStorageProvider(): boolean;
|
|
4951
|
-
setServices(v:
|
|
4683
|
+
setServices(v: WalletServices): void;
|
|
4952
4684
|
}
|
|
4953
4685
|
```
|
|
4954
4686
|
|
|
@@ -4972,15 +4704,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4972
4704
|
```ts
|
|
4973
4705
|
export interface WalletStorageReader {
|
|
4974
4706
|
isAvailable(): boolean;
|
|
4975
|
-
getServices():
|
|
4707
|
+
getServices(): WalletServices;
|
|
4976
4708
|
getSettings(): TableSettings;
|
|
4977
|
-
findCertificatesAuth(auth:
|
|
4978
|
-
findOutputBasketsAuth(auth:
|
|
4979
|
-
findOutputsAuth(auth:
|
|
4980
|
-
findProvenTxReqs(args:
|
|
4981
|
-
listActions(auth:
|
|
4982
|
-
listCertificates(auth:
|
|
4983
|
-
listOutputs(auth:
|
|
4709
|
+
findCertificatesAuth(auth: AuthId, args: FindCertificatesArgs): Promise<TableCertificateX[]>;
|
|
4710
|
+
findOutputBasketsAuth(auth: AuthId, args: FindOutputBasketsArgs): Promise<TableOutputBasket[]>;
|
|
4711
|
+
findOutputsAuth(auth: AuthId, args: FindOutputsArgs): Promise<TableOutput[]>;
|
|
4712
|
+
findProvenTxReqs(args: FindProvenTxReqsArgs): Promise<TableProvenTxReq[]>;
|
|
4713
|
+
listActions(auth: AuthId, vargs: ValidListActionsArgs): Promise<ListActionsResult>;
|
|
4714
|
+
listCertificates(auth: AuthId, vargs: ValidListCertificatesArgs): Promise<ListCertificatesResult>;
|
|
4715
|
+
listOutputs(auth: AuthId, vargs: ValidListOutputsArgs): Promise<ListOutputsResult>;
|
|
4984
4716
|
}
|
|
4985
4717
|
```
|
|
4986
4718
|
|
|
@@ -4988,34 +4720,18 @@ See also: [AuthId](./client.md#interface-authid), [FindCertificatesArgs](./clien
|
|
|
4988
4720
|
|
|
4989
4721
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4990
4722
|
|
|
4991
|
-
---
|
|
4992
|
-
##### Interface: WalletStorageServerOptions
|
|
4993
|
-
|
|
4994
|
-
```ts
|
|
4995
|
-
export interface WalletStorageServerOptions {
|
|
4996
|
-
port: number;
|
|
4997
|
-
wallet: Wallet;
|
|
4998
|
-
monetize: boolean;
|
|
4999
|
-
calculateRequestPrice?: (req: Request) => number | Promise<number>;
|
|
5000
|
-
}
|
|
5001
|
-
```
|
|
5002
|
-
|
|
5003
|
-
See also: [Wallet](./client.md#class-wallet)
|
|
5004
|
-
|
|
5005
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5006
|
-
|
|
5007
4723
|
---
|
|
5008
4724
|
##### Interface: WalletStorageSync
|
|
5009
4725
|
|
|
5010
4726
|
```ts
|
|
5011
4727
|
export interface WalletStorageSync extends WalletStorageWriter {
|
|
5012
|
-
findOrInsertSyncStateAuth(auth:
|
|
4728
|
+
findOrInsertSyncStateAuth(auth: AuthId, storageIdentityKey: string, storageName: string): Promise<{
|
|
5013
4729
|
syncState: TableSyncState;
|
|
5014
4730
|
isNew: boolean;
|
|
5015
4731
|
}>;
|
|
5016
|
-
setActive(auth:
|
|
5017
|
-
getSyncChunk(args:
|
|
5018
|
-
processSyncChunk(args:
|
|
4732
|
+
setActive(auth: AuthId, newActiveStorageIdentityKey: string): Promise<number>;
|
|
4733
|
+
getSyncChunk(args: RequestSyncChunkArgs): Promise<SyncChunk>;
|
|
4734
|
+
processSyncChunk(args: RequestSyncChunkArgs, chunk: SyncChunk): Promise<ProcessSyncChunkResult>;
|
|
5019
4735
|
}
|
|
5020
4736
|
```
|
|
5021
4737
|
|
|
@@ -5026,7 +4742,7 @@ See also: [AuthId](./client.md#interface-authid), [ProcessSyncChunkResult](./cli
|
|
|
5026
4742
|
Updagte the `activeStorage` property of the authenticated user by their `userId`.
|
|
5027
4743
|
|
|
5028
4744
|
```ts
|
|
5029
|
-
setActive(auth:
|
|
4745
|
+
setActive(auth: AuthId, newActiveStorageIdentityKey: string): Promise<number>
|
|
5030
4746
|
```
|
|
5031
4747
|
See also: [AuthId](./client.md#interface-authid)
|
|
5032
4748
|
|
|
@@ -5060,13 +4776,13 @@ export interface WalletStorageWriter extends WalletStorageReader {
|
|
|
5060
4776
|
user: TableUser;
|
|
5061
4777
|
isNew: boolean;
|
|
5062
4778
|
}>;
|
|
5063
|
-
abortAction(auth:
|
|
5064
|
-
createAction(auth:
|
|
5065
|
-
processAction(auth:
|
|
5066
|
-
internalizeAction(auth:
|
|
5067
|
-
insertCertificateAuth(auth:
|
|
5068
|
-
relinquishCertificate(auth:
|
|
5069
|
-
relinquishOutput(auth:
|
|
4779
|
+
abortAction(auth: AuthId, args: AbortActionArgs): Promise<AbortActionResult>;
|
|
4780
|
+
createAction(auth: AuthId, args: ValidCreateActionArgs): Promise<StorageCreateActionResult>;
|
|
4781
|
+
processAction(auth: AuthId, args: StorageProcessActionArgs): Promise<StorageProcessActionResults>;
|
|
4782
|
+
internalizeAction(auth: AuthId, args: InternalizeActionArgs): Promise<InternalizeActionResult>;
|
|
4783
|
+
insertCertificateAuth(auth: AuthId, certificate: TableCertificateX): Promise<number>;
|
|
4784
|
+
relinquishCertificate(auth: AuthId, args: RelinquishCertificateArgs): Promise<number>;
|
|
4785
|
+
relinquishOutput(auth: AuthId, args: RelinquishOutputArgs): Promise<number>;
|
|
5070
4786
|
}
|
|
5071
4787
|
```
|
|
5072
4788
|
|
|
@@ -5107,31 +4823,29 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5107
4823
|
|
|
5108
4824
|
| | | |
|
|
5109
4825
|
| --- | --- | --- |
|
|
5110
|
-
| [ARC](#class-arc) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [
|
|
5111
|
-
| [AuthMethodInteractor](#class-authmethodinteractor) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [
|
|
5112
|
-
| [Bitails](#class-bitails) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [
|
|
5113
|
-
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [ServiceCollection](#class-servicecollection) | [
|
|
5114
|
-
| [EntityBase](#class-entitybase) | [Services](#class-services) | [
|
|
5115
|
-
| [EntityCertificate](#class-entitycertificate) | [
|
|
5116
|
-
| [EntityCertificateField](#class-entitycertificatefield) | [
|
|
5117
|
-
| [EntityCommission](#class-entitycommission) | [
|
|
5118
|
-
| [EntityOutput](#class-entityoutput) | [
|
|
5119
|
-
| [EntityOutputBasket](#class-entityoutputbasket) | [
|
|
5120
|
-
| [EntityOutputTag](#class-entityoutputtag) | [
|
|
5121
|
-
| [EntityOutputTagMap](#class-entityoutputtagmap) | [
|
|
5122
|
-
| [EntityProvenTx](#class-entityproventx) | [
|
|
5123
|
-
| [EntityProvenTxReq](#class-entityproventxreq) | [
|
|
5124
|
-
| [EntitySyncState](#class-entitysyncstate) | [
|
|
5125
|
-
| [EntityTransaction](#class-entitytransaction) | [
|
|
5126
|
-
| [EntityTxLabel](#class-entitytxlabel) | [
|
|
5127
|
-
| [EntityTxLabelMap](#class-entitytxlabelmap) | [
|
|
5128
|
-
| [EntityUser](#class-entityuser) | [
|
|
5129
|
-
| [
|
|
5130
|
-
| [
|
|
5131
|
-
| [
|
|
5132
|
-
| [
|
|
5133
|
-
| [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [TaskUnFail](#class-taskunfail) | |
|
|
5134
|
-
| [PersonaIDInteractor](#class-personaidinteractor) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) | |
|
|
4826
|
+
| [ARC](#class-arc) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
|
|
4827
|
+
| [AuthMethodInteractor](#class-authmethodinteractor) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
|
|
4828
|
+
| [Bitails](#class-bitails) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_INTERNAL](#class-werr_internal) |
|
|
4829
|
+
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [ServiceCollection](#class-servicecollection) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
|
|
4830
|
+
| [EntityBase](#class-entitybase) | [Services](#class-services) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
|
|
4831
|
+
| [EntityCertificate](#class-entitycertificate) | [SimpleWalletManager](#class-simplewalletmanager) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
|
|
4832
|
+
| [EntityCertificateField](#class-entitycertificatefield) | [StorageClient](#class-storageclient) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
|
|
4833
|
+
| [EntityCommission](#class-entitycommission) | [StorageProvider](#class-storageprovider) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
|
|
4834
|
+
| [EntityOutput](#class-entityoutput) | [StorageReader](#class-storagereader) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
|
|
4835
|
+
| [EntityOutputBasket](#class-entityoutputbasket) | [StorageReaderWriter](#class-storagereaderwriter) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
|
|
4836
|
+
| [EntityOutputTag](#class-entityoutputtag) | [StorageSyncReader](#class-storagesyncreader) | [WERR_REVIEW_ACTIONS](#class-werr_review_actions) |
|
|
4837
|
+
| [EntityOutputTagMap](#class-entityoutputtagmap) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
|
|
4838
|
+
| [EntityProvenTx](#class-entityproventx) | [TaskCheckNoSends](#class-taskchecknosends) | [Wallet](#class-wallet) |
|
|
4839
|
+
| [EntityProvenTxReq](#class-entityproventxreq) | [TaskClock](#class-taskclock) | [WalletAuthenticationManager](#class-walletauthenticationmanager) |
|
|
4840
|
+
| [EntitySyncState](#class-entitysyncstate) | [TaskFailAbandoned](#class-taskfailabandoned) | [WalletError](#class-walleterror) |
|
|
4841
|
+
| [EntityTransaction](#class-entitytransaction) | [TaskNewHeader](#class-tasknewheader) | [WalletMonitorTask](#class-walletmonitortask) |
|
|
4842
|
+
| [EntityTxLabel](#class-entitytxlabel) | [TaskPurge](#class-taskpurge) | [WalletPermissionsManager](#class-walletpermissionsmanager) |
|
|
4843
|
+
| [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskReviewStatus](#class-taskreviewstatus) | [WalletSettingsManager](#class-walletsettingsmanager) |
|
|
4844
|
+
| [EntityUser](#class-entityuser) | [TaskSendWaiting](#class-tasksendwaiting) | [WalletSigner](#class-walletsigner) |
|
|
4845
|
+
| [MergeEntity](#class-mergeentity) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
4846
|
+
| [Monitor](#class-monitor) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) | [WhatsOnChain](#class-whatsonchain) |
|
|
4847
|
+
| [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [WABClient](#class-wabclient) | |
|
|
4848
|
+
| [PersonaIDInteractor](#class-personaidinteractor) | [WERR_BAD_REQUEST](#class-werr_bad_request) | |
|
|
5135
4849
|
|
|
5136
4850
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5137
4851
|
|
|
@@ -6569,76 +6283,6 @@ See also: [EntityBase](./storage.md#class-entitybase), [EntityStorage](./storage
|
|
|
6569
6283
|
|
|
6570
6284
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6571
6285
|
|
|
6572
|
-
---
|
|
6573
|
-
##### Class: KnexMigrations
|
|
6574
|
-
|
|
6575
|
-
```ts
|
|
6576
|
-
export class KnexMigrations implements MigrationSource<string> {
|
|
6577
|
-
migrations: Record<string, Migration> = {};
|
|
6578
|
-
constructor(public chain: sdk.Chain, public storageName: string, public storageIdentityKey: string, public maxOutputScriptLength: number)
|
|
6579
|
-
async getMigrations(): Promise<string[]>
|
|
6580
|
-
getMigrationName(migration: string)
|
|
6581
|
-
async getMigration(migration: string): Promise<Migration>
|
|
6582
|
-
async getLatestMigration(): Promise<string>
|
|
6583
|
-
static async latestMigration(): Promise<string>
|
|
6584
|
-
setupMigrations(chain: string, storageName: string, storageIdentityKey: string, maxOutputScriptLength: number): Record<string, Migration>
|
|
6585
|
-
static async dbtype(knex: Knex<any, any[]>): Promise<DBType> {
|
|
6586
|
-
try {
|
|
6587
|
-
const q = `SELECT
|
|
6588
|
-
CASE
|
|
6589
|
-
WHEN (SELECT VERSION() LIKE '%MariaDB%') = 1 THEN 'Unknown'
|
|
6590
|
-
WHEN (SELECT VERSION()) IS NOT NULL THEN 'MySQL'
|
|
6591
|
-
ELSE 'Unknown'
|
|
6592
|
-
END AS database_type;`;
|
|
6593
|
-
let r = await knex.raw(q);
|
|
6594
|
-
if (!r[0]["database_type"])
|
|
6595
|
-
r = r[0];
|
|
6596
|
-
if (r["rows"])
|
|
6597
|
-
r = r.rows;
|
|
6598
|
-
const dbtype: "SQLite" | "MySQL" | "Unknown" = r[0].database_type;
|
|
6599
|
-
if (dbtype === "Unknown")
|
|
6600
|
-
throw new sdk.WERR_NOT_IMPLEMENTED(`Attempting to create database on unsuported engine.`);
|
|
6601
|
-
return dbtype;
|
|
6602
|
-
}
|
|
6603
|
-
catch (eu: unknown) {
|
|
6604
|
-
const e = sdk.WalletError.fromUnknown(eu);
|
|
6605
|
-
if (e.code === "SQLITE_ERROR")
|
|
6606
|
-
return "SQLite";
|
|
6607
|
-
throw new sdk.WERR_NOT_IMPLEMENTED(`Attempting to create database on unsuported engine.`);
|
|
6608
|
-
}
|
|
6609
|
-
}
|
|
6610
|
-
}
|
|
6611
|
-
```
|
|
6612
|
-
|
|
6613
|
-
See also: [Chain](./client.md#type-chain), [DBType](./storage.md#type-dbtype), [WERR_NOT_IMPLEMENTED](./client.md#class-werr_not_implemented), [WalletError](./client.md#class-walleterror)
|
|
6614
|
-
|
|
6615
|
-
###### Constructor
|
|
6616
|
-
|
|
6617
|
-
```ts
|
|
6618
|
-
constructor(public chain: sdk.Chain, public storageName: string, public storageIdentityKey: string, public maxOutputScriptLength: number)
|
|
6619
|
-
```
|
|
6620
|
-
See also: [Chain](./client.md#type-chain)
|
|
6621
|
-
|
|
6622
|
-
Argument Details
|
|
6623
|
-
|
|
6624
|
-
+ **storageName**
|
|
6625
|
-
+ human readable name for this storage instance
|
|
6626
|
-
+ **maxOutputScriptLength**
|
|
6627
|
-
+ limit for scripts kept in outputs table, longer scripts will be pulled from rawTx
|
|
6628
|
-
|
|
6629
|
-
###### Method dbtype
|
|
6630
|
-
|
|
6631
|
-
```ts
|
|
6632
|
-
static async dbtype(knex: Knex<any, any[]>): Promise<DBType>
|
|
6633
|
-
```
|
|
6634
|
-
See also: [DBType](./storage.md#type-dbtype)
|
|
6635
|
-
|
|
6636
|
-
Returns
|
|
6637
|
-
|
|
6638
|
-
connected database engine variant
|
|
6639
|
-
|
|
6640
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6641
|
-
|
|
6642
6286
|
---
|
|
6643
6287
|
##### Class: MergeEntity
|
|
6644
6288
|
|
|
@@ -6727,7 +6371,7 @@ export class Monitor {
|
|
|
6727
6371
|
}
|
|
6728
6372
|
```
|
|
6729
6373
|
|
|
6730
|
-
See also: [BlockHeader](./
|
|
6374
|
+
See also: [BlockHeader](./services.md#interface-blockheader), [Chain](./client.md#type-chain), [MonitorOptions](./monitor.md#interface-monitoroptions), [MonitorStorage](./monitor.md#type-monitorstorage), [Services](./services.md#class-services), [TaskPurgeParams](./monitor.md#interface-taskpurgeparams), [WalletMonitorTask](./monitor.md#class-walletmonitortask)
|
|
6731
6375
|
|
|
6732
6376
|
###### Property _otherTasks
|
|
6733
6377
|
|
|
@@ -6774,7 +6418,7 @@ Kicks processing 'unconfirmed' and 'unmined' request processing.
|
|
|
6774
6418
|
```ts
|
|
6775
6419
|
processNewBlockHeader(header: BlockHeader): void
|
|
6776
6420
|
```
|
|
6777
|
-
See also: [BlockHeader](./
|
|
6421
|
+
See also: [BlockHeader](./services.md#interface-blockheader)
|
|
6778
6422
|
|
|
6779
6423
|
###### Method processReorg
|
|
6780
6424
|
|
|
@@ -6790,29 +6434,7 @@ Coinbase transactions always become invalid.
|
|
|
6790
6434
|
```ts
|
|
6791
6435
|
processReorg(depth: number, oldTip: BlockHeader, newTip: BlockHeader): void
|
|
6792
6436
|
```
|
|
6793
|
-
See also: [BlockHeader](./
|
|
6794
|
-
|
|
6795
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6796
|
-
|
|
6797
|
-
---
|
|
6798
|
-
##### Class: MonitorDaemon
|
|
6799
|
-
|
|
6800
|
-
```ts
|
|
6801
|
-
export class MonitorDaemon {
|
|
6802
|
-
setup?: MonitorDaemonSetup;
|
|
6803
|
-
doneListening?: Promise<void>;
|
|
6804
|
-
doneTasks?: Promise<void>;
|
|
6805
|
-
stopDaemon: boolean = false;
|
|
6806
|
-
constructor(public args: MonitorDaemonSetup, public noRunTasks?: boolean)
|
|
6807
|
-
async createSetup(): Promise<void>
|
|
6808
|
-
async start(): Promise<void>
|
|
6809
|
-
async stop(): Promise<void>
|
|
6810
|
-
async destroy(): Promise<void>
|
|
6811
|
-
async runDaemon(): Promise<void>
|
|
6812
|
-
}
|
|
6813
|
-
```
|
|
6814
|
-
|
|
6815
|
-
See also: [MonitorDaemonSetup](./monitor.md#interface-monitordaemonsetup)
|
|
6437
|
+
See also: [BlockHeader](./services.md#interface-blockheader)
|
|
6816
6438
|
|
|
6817
6439
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6818
6440
|
|
|
@@ -7125,7 +6747,7 @@ export class Services implements sdk.WalletServices {
|
|
|
7125
6747
|
}
|
|
7126
6748
|
```
|
|
7127
6749
|
|
|
7128
|
-
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./
|
|
6750
|
+
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./services.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatExchangeRates](./client.md#interface-fiatexchangerates), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [GetMerklePathService](./client.md#type-getmerklepathservice), [GetRawTxResult](./client.md#interface-getrawtxresult), [GetRawTxService](./client.md#type-getrawtxservice), [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [GetScriptHashHistoryService](./client.md#type-getscripthashhistoryservice), [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult), [GetStatusForTxidsService](./client.md#type-getstatusfortxidsservice), [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat), [GetUtxoStatusResult](./client.md#interface-getutxostatusresult), [GetUtxoStatusService](./client.md#type-getutxostatusservice), [PostBeefResult](./client.md#interface-postbeefresult), [PostBeefService](./client.md#type-postbeefservice), [ServiceCollection](./services.md#class-servicecollection), [UpdateFiatExchangeRateService](./client.md#type-updatefiatexchangerateservice), [WalletServices](./client.md#interface-walletservices), [WalletServicesOptions](./client.md#interface-walletservicesoptions), [WhatsOnChain](./services.md#class-whatsonchain)
|
|
7129
6751
|
|
|
7130
6752
|
###### Method hashOutputScript
|
|
7131
6753
|
|
|
@@ -7144,453 +6766,6 @@ Argument Details
|
|
|
7144
6766
|
|
|
7145
6767
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7146
6768
|
|
|
7147
|
-
---
|
|
7148
|
-
##### Class: Setup
|
|
7149
|
-
|
|
7150
|
-
The 'Setup` class provides static setup functions to construct BRC-100 compatible
|
|
7151
|
-
wallets in a variety of configurations.
|
|
7152
|
-
|
|
7153
|
-
It serves as a starting point for experimentation and customization.
|
|
7154
|
-
|
|
7155
|
-
```ts
|
|
7156
|
-
export abstract class Setup {
|
|
7157
|
-
static noEnv(chain: sdk.Chain): boolean
|
|
7158
|
-
static makeEnv(): string {
|
|
7159
|
-
const testPrivKey1 = PrivateKey.fromRandom();
|
|
7160
|
-
const testIdentityKey1 = testPrivKey1.toPublicKey().toString();
|
|
7161
|
-
const testPrivKey2 = PrivateKey.fromRandom();
|
|
7162
|
-
const testIdentityKey2 = testPrivKey2.toPublicKey().toString();
|
|
7163
|
-
const mainPrivKey1 = PrivateKey.fromRandom();
|
|
7164
|
-
const mainIdentityKey1 = mainPrivKey1.toPublicKey().toString();
|
|
7165
|
-
const mainPrivKey2 = PrivateKey.fromRandom();
|
|
7166
|
-
const mainIdentityKey2 = mainPrivKey2.toPublicKey().toString();
|
|
7167
|
-
const log = `
|
|
7168
|
-
# .env file template for working with wallet-toolbox Setup functions.
|
|
7169
|
-
MY_TEST_IDENTITY = '${testIdentityKey1}'
|
|
7170
|
-
MY_TEST_IDENTITY2 = '${testIdentityKey2}'
|
|
7171
|
-
MY_MAIN_IDENTITY = '${mainIdentityKey1}'
|
|
7172
|
-
MY_MAIN_IDENTITY2 = '${mainIdentityKey2}'
|
|
7173
|
-
MAIN_TAAL_API_KEY='mainnet_9596de07e92300c6287e4393594ae39c'
|
|
7174
|
-
TEST_TAAL_API_KEY='testnet_0e6cf72133b43ea2d7861da2a38684e3'
|
|
7175
|
-
MYSQL_CONNECTION='{"port":3306,"host":"127.0.0.1","user":"root","password":"your_password","database":"your_database", "timezone": "Z"}'
|
|
7176
|
-
DEV_KEYS = '{
|
|
7177
|
-
"${testIdentityKey1}": "${testPrivKey1.toString()}",
|
|
7178
|
-
"${testIdentityKey2}": "${testPrivKey2.toString()}",
|
|
7179
|
-
"${mainIdentityKey1}": "${mainPrivKey1.toString()}",
|
|
7180
|
-
"${mainIdentityKey2}": "${mainPrivKey2.toString()}"
|
|
7181
|
-
}'
|
|
7182
|
-
`;
|
|
7183
|
-
console.log(log);
|
|
7184
|
-
return log;
|
|
7185
|
-
}
|
|
7186
|
-
static getEnv(chain: sdk.Chain): SetupEnv {
|
|
7187
|
-
const identityKey = chain === "main" ? process.env.MY_MAIN_IDENTITY : process.env.MY_TEST_IDENTITY;
|
|
7188
|
-
const identityKey2 = chain === "main" ? process.env.MY_MAIN_IDENTITY2 : process.env.MY_TEST_IDENTITY2;
|
|
7189
|
-
const filePath = chain === "main" ? process.env.MY_MAIN_FILEPATH : process.env.MY_TEST_FILEPATH;
|
|
7190
|
-
const DEV_KEYS = process.env.DEV_KEYS || "{}";
|
|
7191
|
-
const mySQLConnection = process.env.MYSQL_CONNECTION || "{}";
|
|
7192
|
-
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.`);
|
|
7193
|
-
if (!identityKey || !identityKey2)
|
|
7194
|
-
throw new sdk.WERR_INVALID_OPERATION(".env is not a valid SetupEnv configuration.");
|
|
7195
|
-
return {
|
|
7196
|
-
chain,
|
|
7197
|
-
identityKey,
|
|
7198
|
-
identityKey2,
|
|
7199
|
-
filePath,
|
|
7200
|
-
taalApiKey,
|
|
7201
|
-
devKeys: JSON.parse(DEV_KEYS) as Record<string, string>,
|
|
7202
|
-
mySQLConnection
|
|
7203
|
-
};
|
|
7204
|
-
}
|
|
7205
|
-
static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
|
|
7206
|
-
const chain = args.env.chain;
|
|
7207
|
-
args.rootKeyHex ||= args.env.devKeys[args.env.identityKey];
|
|
7208
|
-
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
7209
|
-
const identityKey = rootKey.toPublicKey().toString();
|
|
7210
|
-
const keyDeriver = new KeyDeriver(rootKey);
|
|
7211
|
-
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
7212
|
-
if (storage.canMakeAvailable())
|
|
7213
|
-
await storage.makeAvailable();
|
|
7214
|
-
const serviceOptions = Services.createDefaultOptions(chain);
|
|
7215
|
-
serviceOptions.taalApiKey = args.env.taalApiKey;
|
|
7216
|
-
const services = new Services(serviceOptions);
|
|
7217
|
-
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
7218
|
-
const monitor = new Monitor(monopts);
|
|
7219
|
-
monitor.addDefaultTasks();
|
|
7220
|
-
const privilegedKeyManager = args.privilegedKeyGetter
|
|
7221
|
-
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
7222
|
-
: undefined;
|
|
7223
|
-
const wallet = new Wallet({
|
|
7224
|
-
chain,
|
|
7225
|
-
keyDeriver,
|
|
7226
|
-
storage,
|
|
7227
|
-
services,
|
|
7228
|
-
monitor,
|
|
7229
|
-
privilegedKeyManager
|
|
7230
|
-
});
|
|
7231
|
-
const r: SetupWallet = {
|
|
7232
|
-
rootKey,
|
|
7233
|
-
identityKey,
|
|
7234
|
-
keyDeriver,
|
|
7235
|
-
chain,
|
|
7236
|
-
storage,
|
|
7237
|
-
services,
|
|
7238
|
-
monitor,
|
|
7239
|
-
wallet
|
|
7240
|
-
};
|
|
7241
|
-
return r;
|
|
7242
|
-
}
|
|
7243
|
-
static async createWalletClientNoEnv(args: {
|
|
7244
|
-
chain: sdk.Chain;
|
|
7245
|
-
rootKeyHex: string;
|
|
7246
|
-
storageUrl?: string;
|
|
7247
|
-
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
7248
|
-
}): Promise<Wallet>
|
|
7249
|
-
static async createWalletClient(args: SetupWalletClientArgs): Promise<SetupWalletClient> {
|
|
7250
|
-
const wo = await Setup.createWallet(args);
|
|
7251
|
-
const endpointUrl = args.endpointUrl || `https://${args.env.chain !== "main" ? "staging-" : ""}storage.babbage.systems`;
|
|
7252
|
-
const client = new StorageClient(wo.wallet, endpointUrl);
|
|
7253
|
-
await wo.storage.addWalletStorageProvider(client);
|
|
7254
|
-
await wo.storage.makeAvailable();
|
|
7255
|
-
return {
|
|
7256
|
-
...wo,
|
|
7257
|
-
endpointUrl
|
|
7258
|
-
};
|
|
7259
|
-
}
|
|
7260
|
-
static getKeyPair(priv?: string | PrivateKey): KeyPairAddress {
|
|
7261
|
-
if (priv === undefined)
|
|
7262
|
-
priv = PrivateKey.fromRandom();
|
|
7263
|
-
else if (typeof priv === "string")
|
|
7264
|
-
priv = new PrivateKey(priv, "hex");
|
|
7265
|
-
const pub = PublicKey.fromPrivateKey(priv);
|
|
7266
|
-
const address = pub.toAddress();
|
|
7267
|
-
return { privateKey: priv, publicKey: pub, address };
|
|
7268
|
-
}
|
|
7269
|
-
static getLockP2PKH(address: string): LockingScript {
|
|
7270
|
-
const p2pkh = new P2PKH();
|
|
7271
|
-
const lock = p2pkh.lock(address);
|
|
7272
|
-
return lock;
|
|
7273
|
-
}
|
|
7274
|
-
static getUnlockP2PKH(priv: PrivateKey, satoshis: number): sdk.ScriptTemplateUnlock {
|
|
7275
|
-
const p2pkh = new P2PKH();
|
|
7276
|
-
const lock = Setup.getLockP2PKH(Setup.getKeyPair(priv).address);
|
|
7277
|
-
const unlock = p2pkh.unlock(priv, "all", false, satoshis, lock);
|
|
7278
|
-
return unlock;
|
|
7279
|
-
}
|
|
7280
|
-
static createP2PKHOutputs(outputs: {
|
|
7281
|
-
address: string;
|
|
7282
|
-
satoshis: number;
|
|
7283
|
-
outputDescription?: string;
|
|
7284
|
-
basket?: string;
|
|
7285
|
-
tags?: string[];
|
|
7286
|
-
}[]): CreateActionOutput[] {
|
|
7287
|
-
const os: CreateActionOutput[] = [];
|
|
7288
|
-
const count = outputs.length;
|
|
7289
|
-
for (let i = 0; i < count; i++) {
|
|
7290
|
-
const o = outputs[i];
|
|
7291
|
-
os.push({
|
|
7292
|
-
basket: o.basket,
|
|
7293
|
-
tags: o.tags,
|
|
7294
|
-
satoshis: o.satoshis,
|
|
7295
|
-
lockingScript: Setup.getLockP2PKH(o.address).toHex(),
|
|
7296
|
-
outputDescription: o.outputDescription || `p2pkh ${i}`
|
|
7297
|
-
});
|
|
7298
|
-
}
|
|
7299
|
-
return os;
|
|
7300
|
-
}
|
|
7301
|
-
static async createP2PKHOutputsAction(wallet: WalletInterface, outputs: {
|
|
7302
|
-
address: string;
|
|
7303
|
-
satoshis: number;
|
|
7304
|
-
outputDescription?: string;
|
|
7305
|
-
basket?: string;
|
|
7306
|
-
tags?: string[];
|
|
7307
|
-
}[], options?: CreateActionOptions): Promise<{
|
|
7308
|
-
cr: CreateActionResult;
|
|
7309
|
-
outpoints: string[] | undefined;
|
|
7310
|
-
}> {
|
|
7311
|
-
const os = Setup.createP2PKHOutputs(outputs);
|
|
7312
|
-
const createArgs: CreateActionArgs = {
|
|
7313
|
-
description: `createP2PKHOutputs`,
|
|
7314
|
-
outputs: os,
|
|
7315
|
-
options: {
|
|
7316
|
-
...options,
|
|
7317
|
-
randomizeOutputs: false
|
|
7318
|
-
}
|
|
7319
|
-
};
|
|
7320
|
-
const cr = await wallet.createAction(createArgs);
|
|
7321
|
-
let outpoints: string[] | undefined;
|
|
7322
|
-
if (cr.txid) {
|
|
7323
|
-
outpoints = os.map((o, i) => `${cr.txid}.${i}`);
|
|
7324
|
-
}
|
|
7325
|
-
return { cr, outpoints };
|
|
7326
|
-
}
|
|
7327
|
-
static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF) {
|
|
7328
|
-
}
|
|
7329
|
-
static async createWalletKnex(args: SetupWalletKnexArgs): Promise<SetupWalletKnex> {
|
|
7330
|
-
const wo = await Setup.createWallet(args);
|
|
7331
|
-
const activeStorage = await Setup.createStorageKnex(args);
|
|
7332
|
-
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
7333
|
-
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
7334
|
-
const userId = user.userId;
|
|
7335
|
-
const r: SetupWalletKnex = {
|
|
7336
|
-
...wo,
|
|
7337
|
-
activeStorage,
|
|
7338
|
-
userId
|
|
7339
|
-
};
|
|
7340
|
-
return r;
|
|
7341
|
-
}
|
|
7342
|
-
static async createStorageKnex(args: SetupWalletKnexArgs): Promise<StorageKnex>
|
|
7343
|
-
static createSQLiteKnex(filename: string): Knex {
|
|
7344
|
-
const config: Knex.Config = {
|
|
7345
|
-
client: "sqlite3",
|
|
7346
|
-
connection: { filename },
|
|
7347
|
-
useNullAsDefault: true
|
|
7348
|
-
};
|
|
7349
|
-
const knex = makeKnex(config);
|
|
7350
|
-
return knex;
|
|
7351
|
-
}
|
|
7352
|
-
static createMySQLKnex(connection: string, database?: string): Knex {
|
|
7353
|
-
const c: Knex.MySql2ConnectionConfig = JSON.parse(connection);
|
|
7354
|
-
if (database) {
|
|
7355
|
-
c.database = database;
|
|
7356
|
-
}
|
|
7357
|
-
const config: Knex.Config = {
|
|
7358
|
-
client: "mysql2",
|
|
7359
|
-
connection: c,
|
|
7360
|
-
useNullAsDefault: true,
|
|
7361
|
-
pool: { min: 0, max: 7, idleTimeoutMillis: 15000 }
|
|
7362
|
-
};
|
|
7363
|
-
const knex = makeKnex(config);
|
|
7364
|
-
return knex;
|
|
7365
|
-
}
|
|
7366
|
-
static async createWalletMySQL(args: SetupWalletMySQLArgs): Promise<SetupWalletKnex> {
|
|
7367
|
-
return await this.createWalletKnex({
|
|
7368
|
-
...args,
|
|
7369
|
-
knex: Setup.createMySQLKnex(args.env.mySQLConnection, args.databaseName)
|
|
7370
|
-
});
|
|
7371
|
-
}
|
|
7372
|
-
static async createWalletSQLite(args: SetupWalletSQLiteArgs): Promise<SetupWalletKnex> {
|
|
7373
|
-
return await this.createWalletKnex({
|
|
7374
|
-
...args,
|
|
7375
|
-
knex: Setup.createSQLiteKnex(args.filePath)
|
|
7376
|
-
});
|
|
7377
|
-
}
|
|
7378
|
-
}
|
|
7379
|
-
```
|
|
7380
|
-
|
|
7381
|
-
See also: [Chain](./client.md#type-chain), [KeyPairAddress](./setup.md#interface-keypairaddress), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [ScriptTemplateUnlock](./client.md#interface-scripttemplateunlock), [Services](./services.md#class-services), [SetupEnv](./setup.md#interface-setupenv), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletArgs](./setup.md#interface-setupwalletargs), [SetupWalletClient](./setup.md#interface-setupwalletclient), [SetupWalletClientArgs](./setup.md#interface-setupwalletclientargs), [SetupWalletKnex](./setup.md#interface-setupwalletknex), [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs), [SetupWalletMySQLArgs](./setup.md#interface-setupwalletmysqlargs), [SetupWalletSQLiteArgs](./setup.md#interface-setupwalletsqliteargs), [StorageClient](./storage.md#class-storageclient), [StorageKnex](./storage.md#class-storageknex), [WERR_INVALID_OPERATION](./client.md#class-werr_invalid_operation), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction), [verifyTruthy](./client.md#function-verifytruthy)
|
|
7382
|
-
|
|
7383
|
-
###### Method createStorageKnex
|
|
7384
|
-
|
|
7385
|
-
```ts
|
|
7386
|
-
static async createStorageKnex(args: SetupWalletKnexArgs): Promise<StorageKnex>
|
|
7387
|
-
```
|
|
7388
|
-
See also: [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs), [StorageKnex](./storage.md#class-storageknex)
|
|
7389
|
-
|
|
7390
|
-
Returns
|
|
7391
|
-
|
|
7392
|
-
- `Knex` based storage provider for a wallet. May be used for either active storage or backup storage.
|
|
7393
|
-
|
|
7394
|
-
###### Method createWallet
|
|
7395
|
-
|
|
7396
|
-
Create a `Wallet`. Storage can optionally be provided or configured later.
|
|
7397
|
-
|
|
7398
|
-
The following components are configured: KeyDeriver, WalletStorageManager, WalletService, WalletStorage.
|
|
7399
|
-
Optionally, PrivilegedKeyManager is also configured.
|
|
7400
|
-
|
|
7401
|
-
```ts
|
|
7402
|
-
static async createWallet(args: SetupWalletArgs): Promise<SetupWallet> {
|
|
7403
|
-
const chain = args.env.chain;
|
|
7404
|
-
args.rootKeyHex ||= args.env.devKeys[args.env.identityKey];
|
|
7405
|
-
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
7406
|
-
const identityKey = rootKey.toPublicKey().toString();
|
|
7407
|
-
const keyDeriver = new KeyDeriver(rootKey);
|
|
7408
|
-
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
7409
|
-
if (storage.canMakeAvailable())
|
|
7410
|
-
await storage.makeAvailable();
|
|
7411
|
-
const serviceOptions = Services.createDefaultOptions(chain);
|
|
7412
|
-
serviceOptions.taalApiKey = args.env.taalApiKey;
|
|
7413
|
-
const services = new Services(serviceOptions);
|
|
7414
|
-
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
7415
|
-
const monitor = new Monitor(monopts);
|
|
7416
|
-
monitor.addDefaultTasks();
|
|
7417
|
-
const privilegedKeyManager = args.privilegedKeyGetter
|
|
7418
|
-
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
7419
|
-
: undefined;
|
|
7420
|
-
const wallet = new Wallet({
|
|
7421
|
-
chain,
|
|
7422
|
-
keyDeriver,
|
|
7423
|
-
storage,
|
|
7424
|
-
services,
|
|
7425
|
-
monitor,
|
|
7426
|
-
privilegedKeyManager
|
|
7427
|
-
});
|
|
7428
|
-
const r: SetupWallet = {
|
|
7429
|
-
rootKey,
|
|
7430
|
-
identityKey,
|
|
7431
|
-
keyDeriver,
|
|
7432
|
-
chain,
|
|
7433
|
-
storage,
|
|
7434
|
-
services,
|
|
7435
|
-
monitor,
|
|
7436
|
-
wallet
|
|
7437
|
-
};
|
|
7438
|
-
return r;
|
|
7439
|
-
}
|
|
7440
|
-
```
|
|
7441
|
-
See also: [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [Services](./services.md#class-services), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletArgs](./setup.md#interface-setupwalletargs), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
7442
|
-
|
|
7443
|
-
###### Method createWalletClientNoEnv
|
|
7444
|
-
|
|
7445
|
-
Setup a new `Wallet` without requiring a .env file.
|
|
7446
|
-
|
|
7447
|
-
```ts
|
|
7448
|
-
static async createWalletClientNoEnv(args: {
|
|
7449
|
-
chain: sdk.Chain;
|
|
7450
|
-
rootKeyHex: string;
|
|
7451
|
-
storageUrl?: string;
|
|
7452
|
-
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
7453
|
-
}): Promise<Wallet>
|
|
7454
|
-
```
|
|
7455
|
-
See also: [Chain](./client.md#type-chain), [Wallet](./client.md#class-wallet)
|
|
7456
|
-
|
|
7457
|
-
Argument Details
|
|
7458
|
-
|
|
7459
|
-
+ **args.chain**
|
|
7460
|
-
+ 'main' or 'test'
|
|
7461
|
-
+ **args.rootKeyHex**
|
|
7462
|
-
+ Root private key for wallet's key deriver.
|
|
7463
|
-
+ **args.storageUrl**
|
|
7464
|
-
+ Optional. `StorageClient` and `chain` compatible endpoint URL.
|
|
7465
|
-
+ **args.privilegedKeyGetter**
|
|
7466
|
-
+ Optional. Method that will return the privileged `PrivateKey`, on demand.
|
|
7467
|
-
|
|
7468
|
-
###### Method createWalletKnex
|
|
7469
|
-
|
|
7470
|
-
Adds `Knex` based storage to a `Wallet` configured by `Setup.createWalletOnly`
|
|
7471
|
-
|
|
7472
|
-
```ts
|
|
7473
|
-
static async createWalletKnex(args: SetupWalletKnexArgs): Promise<SetupWalletKnex> {
|
|
7474
|
-
const wo = await Setup.createWallet(args);
|
|
7475
|
-
const activeStorage = await Setup.createStorageKnex(args);
|
|
7476
|
-
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
7477
|
-
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
7478
|
-
const userId = user.userId;
|
|
7479
|
-
const r: SetupWalletKnex = {
|
|
7480
|
-
...wo,
|
|
7481
|
-
activeStorage,
|
|
7482
|
-
userId
|
|
7483
|
-
};
|
|
7484
|
-
return r;
|
|
7485
|
-
}
|
|
7486
|
-
```
|
|
7487
|
-
See also: [Setup](./setup.md#class-setup), [SetupWalletKnex](./setup.md#interface-setupwalletknex), [SetupWalletKnexArgs](./setup.md#interface-setupwalletknexargs)
|
|
7488
|
-
|
|
7489
|
-
Argument Details
|
|
7490
|
-
|
|
7491
|
-
+ **args.knex**
|
|
7492
|
-
+ `Knex` object configured for either MySQL or SQLite database access.
|
|
7493
|
-
Schema will be created and migrated as needed.
|
|
7494
|
-
For MySQL, a schema corresponding to databaseName must exist with full access permissions.
|
|
7495
|
-
+ **args.databaseName**
|
|
7496
|
-
+ Name for this storage. For MySQL, the schema name within the MySQL instance.
|
|
7497
|
-
+ **args.chain**
|
|
7498
|
-
+ Which chain this wallet is on: 'main' or 'test'. Defaults to 'test'.
|
|
7499
|
-
|
|
7500
|
-
###### Method getEnv
|
|
7501
|
-
|
|
7502
|
-
Reads a .env file of the format created by `makeEnv`.
|
|
7503
|
-
|
|
7504
|
-
Returns values for designated `chain`.
|
|
7505
|
-
|
|
7506
|
-
Access private keys through the `devKeys` object: `devKeys[identityKey]`
|
|
7507
|
-
|
|
7508
|
-
```ts
|
|
7509
|
-
static getEnv(chain: sdk.Chain): SetupEnv {
|
|
7510
|
-
const identityKey = chain === "main" ? process.env.MY_MAIN_IDENTITY : process.env.MY_TEST_IDENTITY;
|
|
7511
|
-
const identityKey2 = chain === "main" ? process.env.MY_MAIN_IDENTITY2 : process.env.MY_TEST_IDENTITY2;
|
|
7512
|
-
const filePath = chain === "main" ? process.env.MY_MAIN_FILEPATH : process.env.MY_TEST_FILEPATH;
|
|
7513
|
-
const DEV_KEYS = process.env.DEV_KEYS || "{}";
|
|
7514
|
-
const mySQLConnection = process.env.MYSQL_CONNECTION || "{}";
|
|
7515
|
-
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.`);
|
|
7516
|
-
if (!identityKey || !identityKey2)
|
|
7517
|
-
throw new sdk.WERR_INVALID_OPERATION(".env is not a valid SetupEnv configuration.");
|
|
7518
|
-
return {
|
|
7519
|
-
chain,
|
|
7520
|
-
identityKey,
|
|
7521
|
-
identityKey2,
|
|
7522
|
-
filePath,
|
|
7523
|
-
taalApiKey,
|
|
7524
|
-
devKeys: JSON.parse(DEV_KEYS) as Record<string, string>,
|
|
7525
|
-
mySQLConnection
|
|
7526
|
-
};
|
|
7527
|
-
}
|
|
7528
|
-
```
|
|
7529
|
-
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)
|
|
7530
|
-
|
|
7531
|
-
Returns
|
|
7532
|
-
|
|
7533
|
-
with configuration environment secrets used by `Setup` functions.
|
|
7534
|
-
|
|
7535
|
-
Argument Details
|
|
7536
|
-
|
|
7537
|
-
+ **chain**
|
|
7538
|
-
+ Which chain to use: 'test' or 'main'
|
|
7539
|
-
|
|
7540
|
-
###### Method makeEnv
|
|
7541
|
-
|
|
7542
|
-
Creates content for .env file with some private keys, identity keys, sample API keys, and sample MySQL connection string.
|
|
7543
|
-
|
|
7544
|
-
Two new, random private keys are generated each time, with their associated public identity keys.
|
|
7545
|
-
|
|
7546
|
-
Loading secrets from a .env file is intended only for experimentation and getting started.
|
|
7547
|
-
Private keys should never be included directly in your source code.
|
|
7548
|
-
|
|
7549
|
-
```ts
|
|
7550
|
-
static makeEnv(): string {
|
|
7551
|
-
const testPrivKey1 = PrivateKey.fromRandom();
|
|
7552
|
-
const testIdentityKey1 = testPrivKey1.toPublicKey().toString();
|
|
7553
|
-
const testPrivKey2 = PrivateKey.fromRandom();
|
|
7554
|
-
const testIdentityKey2 = testPrivKey2.toPublicKey().toString();
|
|
7555
|
-
const mainPrivKey1 = PrivateKey.fromRandom();
|
|
7556
|
-
const mainIdentityKey1 = mainPrivKey1.toPublicKey().toString();
|
|
7557
|
-
const mainPrivKey2 = PrivateKey.fromRandom();
|
|
7558
|
-
const mainIdentityKey2 = mainPrivKey2.toPublicKey().toString();
|
|
7559
|
-
const log = `
|
|
7560
|
-
# .env file template for working with wallet-toolbox Setup functions.
|
|
7561
|
-
MY_TEST_IDENTITY = '${testIdentityKey1}'
|
|
7562
|
-
MY_TEST_IDENTITY2 = '${testIdentityKey2}'
|
|
7563
|
-
MY_MAIN_IDENTITY = '${mainIdentityKey1}'
|
|
7564
|
-
MY_MAIN_IDENTITY2 = '${mainIdentityKey2}'
|
|
7565
|
-
MAIN_TAAL_API_KEY='mainnet_9596de07e92300c6287e4393594ae39c'
|
|
7566
|
-
TEST_TAAL_API_KEY='testnet_0e6cf72133b43ea2d7861da2a38684e3'
|
|
7567
|
-
MYSQL_CONNECTION='{"port":3306,"host":"127.0.0.1","user":"root","password":"your_password","database":"your_database", "timezone": "Z"}'
|
|
7568
|
-
DEV_KEYS = '{
|
|
7569
|
-
"${testIdentityKey1}": "${testPrivKey1.toString()}",
|
|
7570
|
-
"${testIdentityKey2}": "${testPrivKey2.toString()}",
|
|
7571
|
-
"${mainIdentityKey1}": "${mainPrivKey1.toString()}",
|
|
7572
|
-
"${mainIdentityKey2}": "${mainPrivKey2.toString()}"
|
|
7573
|
-
}'
|
|
7574
|
-
`;
|
|
7575
|
-
console.log(log);
|
|
7576
|
-
return log;
|
|
7577
|
-
}
|
|
7578
|
-
```
|
|
7579
|
-
See also: [Setup](./setup.md#class-setup)
|
|
7580
|
-
|
|
7581
|
-
###### Method noEnv
|
|
7582
|
-
|
|
7583
|
-
```ts
|
|
7584
|
-
static noEnv(chain: sdk.Chain): boolean
|
|
7585
|
-
```
|
|
7586
|
-
See also: [Chain](./client.md#type-chain)
|
|
7587
|
-
|
|
7588
|
-
Returns
|
|
7589
|
-
|
|
7590
|
-
true if .env is not valid for chain
|
|
7591
|
-
|
|
7592
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7593
|
-
|
|
7594
6769
|
---
|
|
7595
6770
|
##### Class: SimpleWalletManager
|
|
7596
6771
|
|
|
@@ -8363,324 +7538,55 @@ This must match the `AuthFetch` identity securing the remote conneciton.
|
|
|
8363
7538
|
+ **args**
|
|
8364
7539
|
+ original wallet `relinquishOutput` args.
|
|
8365
7540
|
|
|
8366
|
-
###### Method setActive
|
|
8367
|
-
|
|
8368
|
-
Ensures up-to-date wallet data replication to all configured backup storage providers,
|
|
8369
|
-
then promotes one of the configured backups to active,
|
|
8370
|
-
demoting the current active to new backup.
|
|
8371
|
-
|
|
8372
|
-
```ts
|
|
8373
|
-
async setActive(auth: sdk.AuthId, newActiveStorageIdentityKey: string): Promise<number>
|
|
8374
|
-
```
|
|
8375
|
-
See also: [AuthId](./client.md#interface-authid)
|
|
8376
|
-
|
|
8377
|
-
Argument Details
|
|
8378
|
-
|
|
8379
|
-
+ **auth**
|
|
8380
|
-
+ Identifies client by identity key and the storage identity key of their currently active storage.
|
|
8381
|
-
This must match the `AuthFetch` identity securing the remote conneciton.
|
|
8382
|
-
+ **newActiveStorageIdentityKey**
|
|
8383
|
-
+ which must be a currently configured backup storage provider.
|
|
8384
|
-
|
|
8385
|
-
###### Method setServices
|
|
8386
|
-
|
|
8387
|
-
Ignored. Remote storage cannot share `Services` with remote clients.
|
|
8388
|
-
|
|
8389
|
-
```ts
|
|
8390
|
-
setServices(v: sdk.WalletServices): void
|
|
8391
|
-
```
|
|
8392
|
-
See also: [WalletServices](./client.md#interface-walletservices)
|
|
8393
|
-
|
|
8394
|
-
###### Method updateProvenTxReqWithNewProvenTx
|
|
8395
|
-
|
|
8396
|
-
Handles the data received when a new transaction proof is found in response to an outstanding request for proof data:
|
|
8397
|
-
|
|
8398
|
-
- Creates a new `TableProvenTx` record.
|
|
8399
|
-
- Notifies all user transaction records of the new status.
|
|
8400
|
-
- Updates the proof request record to 'completed' status which enables delayed deletion.
|
|
8401
|
-
|
|
8402
|
-
```ts
|
|
8403
|
-
async updateProvenTxReqWithNewProvenTx(args: sdk.UpdateProvenTxReqWithNewProvenTxArgs): Promise<sdk.UpdateProvenTxReqWithNewProvenTxResult>
|
|
8404
|
-
```
|
|
8405
|
-
See also: [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult)
|
|
8406
|
-
|
|
8407
|
-
Returns
|
|
8408
|
-
|
|
8409
|
-
results of updates
|
|
8410
|
-
|
|
8411
|
-
Argument Details
|
|
8412
|
-
|
|
8413
|
-
+ **args**
|
|
8414
|
-
+ proof request and new transaction proof data
|
|
8415
|
-
|
|
8416
|
-
###### Method validateEntities
|
|
8417
|
-
|
|
8418
|
-
Helper to force uniform behavior across database engines.
|
|
8419
|
-
Use to process all arrays of records with time stamps retreived from database.
|
|
8420
|
-
|
|
8421
|
-
```ts
|
|
8422
|
-
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
8423
|
-
```
|
|
8424
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8425
|
-
|
|
8426
|
-
Returns
|
|
8427
|
-
|
|
8428
|
-
input `entities` array with contained values validated.
|
|
8429
|
-
|
|
8430
|
-
###### Method validateEntity
|
|
7541
|
+
###### Method setActive
|
|
8431
7542
|
|
|
8432
|
-
|
|
8433
|
-
|
|
7543
|
+
Ensures up-to-date wallet data replication to all configured backup storage providers,
|
|
7544
|
+
then promotes one of the configured backups to active,
|
|
7545
|
+
demoting the current active to new backup.
|
|
8434
7546
|
|
|
8435
7547
|
```ts
|
|
8436
|
-
|
|
8437
|
-
```
|
|
8438
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8439
|
-
|
|
8440
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8441
|
-
|
|
8442
|
-
---
|
|
8443
|
-
##### Class: StorageKnex
|
|
8444
|
-
|
|
8445
|
-
```ts
|
|
8446
|
-
export class StorageKnex extends StorageProvider implements sdk.WalletStorageProvider {
|
|
8447
|
-
knex: Knex;
|
|
8448
|
-
constructor(options: StorageKnexOptions)
|
|
8449
|
-
async readSettings(): Promise<TableSettings>
|
|
8450
|
-
override async getProvenOrRawTx(txid: string, trx?: sdk.TrxToken): Promise<sdk.ProvenOrRawTx>
|
|
8451
|
-
dbTypeSubstring(source: string, fromOffset: number, forLength?: number)
|
|
8452
|
-
override async getRawTxOfKnownValidTransaction(txid?: string, offset?: number, length?: number, trx?: sdk.TrxToken): Promise<number[] | undefined>
|
|
8453
|
-
getProvenTxsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8454
|
-
override async getProvenTxsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableProvenTx[]>
|
|
8455
|
-
getProvenTxReqsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8456
|
-
override async getProvenTxReqsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableProvenTxReq[]>
|
|
8457
|
-
getTxLabelMapsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8458
|
-
override async getTxLabelMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableTxLabelMap[]>
|
|
8459
|
-
getOutputTagMapsForUserQuery(args: sdk.FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
8460
|
-
override async getOutputTagMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise<TableOutputTagMap[]>
|
|
8461
|
-
override async listActions(auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs): Promise<ListActionsResult>
|
|
8462
|
-
override async listOutputs(auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs): Promise<ListOutputsResult>
|
|
8463
|
-
override async insertProvenTx(tx: TableProvenTx, trx?: sdk.TrxToken): Promise<number>
|
|
8464
|
-
override async insertProvenTxReq(tx: TableProvenTxReq, trx?: sdk.TrxToken): Promise<number>
|
|
8465
|
-
override async insertUser(user: TableUser, trx?: sdk.TrxToken): Promise<number>
|
|
8466
|
-
override async insertCertificateAuth(auth: sdk.AuthId, certificate: TableCertificateX): Promise<number>
|
|
8467
|
-
override async insertCertificate(certificate: TableCertificateX, trx?: sdk.TrxToken): Promise<number>
|
|
8468
|
-
override async insertCertificateField(certificateField: TableCertificateField, trx?: sdk.TrxToken): Promise<void>
|
|
8469
|
-
override async insertOutputBasket(basket: TableOutputBasket, trx?: sdk.TrxToken): Promise<number>
|
|
8470
|
-
override async insertTransaction(tx: TableTransaction, trx?: sdk.TrxToken): Promise<number>
|
|
8471
|
-
override async insertCommission(commission: TableCommission, trx?: sdk.TrxToken): Promise<number>
|
|
8472
|
-
override async insertOutput(output: TableOutput, trx?: sdk.TrxToken): Promise<number>
|
|
8473
|
-
override async insertOutputTag(tag: TableOutputTag, trx?: sdk.TrxToken): Promise<number>
|
|
8474
|
-
override async insertOutputTagMap(tagMap: TableOutputTagMap, trx?: sdk.TrxToken): Promise<void>
|
|
8475
|
-
override async insertTxLabel(label: TableTxLabel, trx?: sdk.TrxToken): Promise<number>
|
|
8476
|
-
override async insertTxLabelMap(labelMap: TableTxLabelMap, trx?: sdk.TrxToken): Promise<void>
|
|
8477
|
-
override async insertMonitorEvent(event: TableMonitorEvent, trx?: sdk.TrxToken): Promise<number>
|
|
8478
|
-
override async insertSyncState(syncState: TableSyncState, trx?: sdk.TrxToken): Promise<number>
|
|
8479
|
-
override async updateCertificateField(certificateId: number, fieldName: string, update: Partial<TableCertificateField>, trx?: sdk.TrxToken): Promise<number>
|
|
8480
|
-
override async updateCertificate(id: number, update: Partial<TableCertificate>, trx?: sdk.TrxToken): Promise<number>
|
|
8481
|
-
override async updateCommission(id: number, update: Partial<TableCommission>, trx?: sdk.TrxToken): Promise<number>
|
|
8482
|
-
override async updateOutputBasket(id: number, update: Partial<TableOutputBasket>, trx?: sdk.TrxToken): Promise<number>
|
|
8483
|
-
override async updateOutput(id: number, update: Partial<TableOutput>, trx?: sdk.TrxToken): Promise<number>
|
|
8484
|
-
override async updateOutputTagMap(outputId: number, tagId: number, update: Partial<TableOutputTagMap>, trx?: sdk.TrxToken): Promise<number>
|
|
8485
|
-
override async updateOutputTag(id: number, update: Partial<TableOutputTag>, trx?: sdk.TrxToken): Promise<number>
|
|
8486
|
-
override async updateProvenTxReq(id: number | number[], update: Partial<TableProvenTxReq>, trx?: sdk.TrxToken): Promise<number>
|
|
8487
|
-
override async updateProvenTx(id: number, update: Partial<TableProvenTx>, trx?: sdk.TrxToken): Promise<number>
|
|
8488
|
-
override async updateSyncState(id: number, update: Partial<TableSyncState>, trx?: sdk.TrxToken): Promise<number>
|
|
8489
|
-
override async updateTransaction(id: number | number[], update: Partial<TableTransaction>, trx?: sdk.TrxToken): Promise<number>
|
|
8490
|
-
override async updateTxLabelMap(transactionId: number, txLabelId: number, update: Partial<TableTxLabelMap>, trx?: sdk.TrxToken): Promise<number>
|
|
8491
|
-
override async updateTxLabel(id: number, update: Partial<TableTxLabel>, trx?: sdk.TrxToken): Promise<number>
|
|
8492
|
-
override async updateUser(id: number, update: Partial<TableUser>, trx?: sdk.TrxToken): Promise<number>
|
|
8493
|
-
override async updateMonitorEvent(id: number, update: Partial<TableMonitorEvent>, trx?: sdk.TrxToken): Promise<number>
|
|
8494
|
-
setupQuery<T extends object>(table: string, args: sdk.FindPartialSincePagedArgs<T>): Knex.QueryBuilder
|
|
8495
|
-
findCertificateFieldsQuery(args: sdk.FindCertificateFieldsArgs): Knex.QueryBuilder
|
|
8496
|
-
findCertificatesQuery(args: sdk.FindCertificatesArgs): Knex.QueryBuilder
|
|
8497
|
-
findCommissionsQuery(args: sdk.FindCommissionsArgs): Knex.QueryBuilder
|
|
8498
|
-
findOutputBasketsQuery(args: sdk.FindOutputBasketsArgs): Knex.QueryBuilder
|
|
8499
|
-
findOutputsQuery(args: sdk.FindOutputsArgs, count?: boolean): Knex.QueryBuilder
|
|
8500
|
-
findOutputTagMapsQuery(args: sdk.FindOutputTagMapsArgs): Knex.QueryBuilder
|
|
8501
|
-
findOutputTagsQuery(args: sdk.FindOutputTagsArgs): Knex.QueryBuilder
|
|
8502
|
-
findProvenTxReqsQuery(args: sdk.FindProvenTxReqsArgs): Knex.QueryBuilder
|
|
8503
|
-
findProvenTxsQuery(args: sdk.FindProvenTxsArgs): Knex.QueryBuilder
|
|
8504
|
-
findSyncStatesQuery(args: sdk.FindSyncStatesArgs): Knex.QueryBuilder
|
|
8505
|
-
findTransactionsQuery(args: sdk.FindTransactionsArgs, count?: boolean): Knex.QueryBuilder
|
|
8506
|
-
findTxLabelMapsQuery(args: sdk.FindTxLabelMapsArgs): Knex.QueryBuilder
|
|
8507
|
-
findTxLabelsQuery(args: sdk.FindTxLabelsArgs): Knex.QueryBuilder
|
|
8508
|
-
findUsersQuery(args: sdk.FindUsersArgs): Knex.QueryBuilder
|
|
8509
|
-
findMonitorEventsQuery(args: sdk.FindMonitorEventsArgs): Knex.QueryBuilder
|
|
8510
|
-
override async findCertificatesAuth(auth: sdk.AuthId, args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
|
|
8511
|
-
override async findOutputBasketsAuth(auth: sdk.AuthId, args: sdk.FindOutputBasketsArgs): Promise<TableOutputBasket[]>
|
|
8512
|
-
override async findOutputsAuth(auth: sdk.AuthId, args: sdk.FindOutputsArgs): Promise<TableOutput[]>
|
|
8513
|
-
override async findCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise<TableCertificateField[]>
|
|
8514
|
-
override async findCertificates(args: sdk.FindCertificatesArgs): Promise<TableCertificateX[]>
|
|
8515
|
-
override async findCommissions(args: sdk.FindCommissionsArgs): Promise<TableCommission[]>
|
|
8516
|
-
override async findOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise<TableOutputBasket[]>
|
|
8517
|
-
override async findOutputs(args: sdk.FindOutputsArgs): Promise<TableOutput[]>
|
|
8518
|
-
override async findOutputTagMaps(args: sdk.FindOutputTagMapsArgs): Promise<TableOutputTagMap[]>
|
|
8519
|
-
override async findOutputTags(args: sdk.FindOutputTagsArgs): Promise<TableOutputTag[]>
|
|
8520
|
-
override async findProvenTxReqs(args: sdk.FindProvenTxReqsArgs): Promise<TableProvenTxReq[]>
|
|
8521
|
-
override async findProvenTxs(args: sdk.FindProvenTxsArgs): Promise<TableProvenTx[]>
|
|
8522
|
-
override async findSyncStates(args: sdk.FindSyncStatesArgs): Promise<TableSyncState[]>
|
|
8523
|
-
override async findTransactions(args: sdk.FindTransactionsArgs): Promise<TableTransaction[]>
|
|
8524
|
-
override async findTxLabelMaps(args: sdk.FindTxLabelMapsArgs): Promise<TableTxLabelMap[]>
|
|
8525
|
-
override async findTxLabels(args: sdk.FindTxLabelsArgs): Promise<TableTxLabel[]>
|
|
8526
|
-
override async findUsers(args: sdk.FindUsersArgs): Promise<TableUser[]>
|
|
8527
|
-
override async findMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise<TableMonitorEvent[]>
|
|
8528
|
-
async getCount<T extends object>(q: Knex.QueryBuilder<T, T[]>): Promise<number>
|
|
8529
|
-
override async countCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise<number>
|
|
8530
|
-
override async countCertificates(args: sdk.FindCertificatesArgs): Promise<number>
|
|
8531
|
-
override async countCommissions(args: sdk.FindCommissionsArgs): Promise<number>
|
|
8532
|
-
override async countOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise<number>
|
|
8533
|
-
override async countOutputs(args: sdk.FindOutputsArgs): Promise<number>
|
|
8534
|
-
override async countOutputTagMaps(args: sdk.FindOutputTagMapsArgs): Promise<number>
|
|
8535
|
-
override async countOutputTags(args: sdk.FindOutputTagsArgs): Promise<number>
|
|
8536
|
-
override async countProvenTxReqs(args: sdk.FindProvenTxReqsArgs): Promise<number>
|
|
8537
|
-
override async countProvenTxs(args: sdk.FindProvenTxsArgs): Promise<number>
|
|
8538
|
-
override async countSyncStates(args: sdk.FindSyncStatesArgs): Promise<number>
|
|
8539
|
-
override async countTransactions(args: sdk.FindTransactionsArgs): Promise<number>
|
|
8540
|
-
override async countTxLabelMaps(args: sdk.FindTxLabelMapsArgs): Promise<number>
|
|
8541
|
-
override async countTxLabels(args: sdk.FindTxLabelsArgs): Promise<number>
|
|
8542
|
-
override async countUsers(args: sdk.FindUsersArgs): Promise<number>
|
|
8543
|
-
override async countMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise<number>
|
|
8544
|
-
override async destroy(): Promise<void>
|
|
8545
|
-
override async migrate(storageName: string, storageIdentityKey: string): Promise<string>
|
|
8546
|
-
override async dropAllData(): Promise<void>
|
|
8547
|
-
override async transaction<T>(scope: (trx: sdk.TrxToken) => Promise<T>, trx?: sdk.TrxToken): Promise<T>
|
|
8548
|
-
toDb(trx?: sdk.TrxToken)
|
|
8549
|
-
async validateRawTransaction(t: TableTransaction, trx?: sdk.TrxToken): Promise<void>
|
|
8550
|
-
async validateOutputScript(o: TableOutput, trx?: sdk.TrxToken): Promise<void>
|
|
8551
|
-
_verifiedReadyForDatabaseAccess: boolean = false;
|
|
8552
|
-
async verifyReadyForDatabaseAccess(trx?: sdk.TrxToken): Promise<DBType>
|
|
8553
|
-
validatePartialForUpdate<T extends sdk.EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
|
|
8554
|
-
async validateEntityForInsert<T extends sdk.EntityTimeStamp>(entity: T, trx?: sdk.TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
|
|
8555
|
-
override async getLabelsForTransactionId(transactionId?: number, trx?: sdk.TrxToken): Promise<TableTxLabel[]>
|
|
8556
|
-
async extendOutput(o: TableOutput, includeBasket = false, includeTags = false, trx?: sdk.TrxToken): Promise<TableOutputX>
|
|
8557
|
-
override async getTagsForOutputId(outputId: number, trx?: sdk.TrxToken): Promise<TableOutputTag[]>
|
|
8558
|
-
override async purgeData(params: sdk.PurgeParams, trx?: sdk.TrxToken): Promise<sdk.PurgeResults>
|
|
8559
|
-
override async reviewStatus(args: {
|
|
8560
|
-
agedLimit: Date;
|
|
8561
|
-
trx?: sdk.TrxToken;
|
|
8562
|
-
}): Promise<{
|
|
8563
|
-
log: string;
|
|
8564
|
-
}>
|
|
8565
|
-
async countChangeInputs(userId: number, basketId: number, excludeSending: boolean): Promise<number>
|
|
8566
|
-
async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<TableOutput | undefined> {
|
|
8567
|
-
const status: sdk.TransactionStatus[] = ["completed", "unproven"];
|
|
8568
|
-
if (!excludeSending)
|
|
8569
|
-
status.push("sending");
|
|
8570
|
-
const statusText = status.map(s => `'${s}'`).join(",");
|
|
8571
|
-
const r: TableOutput | undefined = await this.knex.transaction(async (trx) => {
|
|
8572
|
-
const txStatusCondition = `AND (SELECT status FROM transactions WHERE outputs.transactionId = transactions.transactionId) in (${statusText})`;
|
|
8573
|
-
let outputId: number | undefined;
|
|
8574
|
-
const setOutputId = async (rawQuery: string): Promise<void> => {
|
|
8575
|
-
let oidr = await trx.raw(rawQuery);
|
|
8576
|
-
outputId = undefined;
|
|
8577
|
-
if (!oidr["outputId"] && oidr.length > 0)
|
|
8578
|
-
oidr = oidr[0];
|
|
8579
|
-
if (!oidr["outputId"] && oidr.length > 0)
|
|
8580
|
-
oidr = oidr[0];
|
|
8581
|
-
if (oidr["outputId"])
|
|
8582
|
-
outputId = Number(oidr["outputId"]);
|
|
8583
|
-
};
|
|
8584
|
-
if (exactSatoshis !== undefined) {
|
|
8585
|
-
await setOutputId(`
|
|
8586
|
-
SELECT outputId
|
|
8587
|
-
FROM outputs
|
|
8588
|
-
WHERE userId = ${userId}
|
|
8589
|
-
AND spendable = 1
|
|
8590
|
-
AND basketId = ${basketId}
|
|
8591
|
-
${txStatusCondition}
|
|
8592
|
-
AND satoshis = ${exactSatoshis}
|
|
8593
|
-
LIMIT 1;
|
|
8594
|
-
`);
|
|
8595
|
-
}
|
|
8596
|
-
if (outputId === undefined) {
|
|
8597
|
-
await setOutputId(`
|
|
8598
|
-
SELECT outputId
|
|
8599
|
-
FROM outputs
|
|
8600
|
-
WHERE userId = ${userId}
|
|
8601
|
-
AND spendable = 1
|
|
8602
|
-
AND basketId = ${basketId}
|
|
8603
|
-
${txStatusCondition}
|
|
8604
|
-
AND satoshis - ${targetSatoshis} = (
|
|
8605
|
-
SELECT MIN(satoshis - ${targetSatoshis})
|
|
8606
|
-
FROM outputs
|
|
8607
|
-
WHERE userId = ${userId}
|
|
8608
|
-
AND spendable = 1
|
|
8609
|
-
AND basketId = ${basketId}
|
|
8610
|
-
${txStatusCondition}
|
|
8611
|
-
AND satoshis - ${targetSatoshis} >= 0
|
|
8612
|
-
)
|
|
8613
|
-
LIMIT 1;
|
|
8614
|
-
`);
|
|
8615
|
-
}
|
|
8616
|
-
if (outputId === undefined) {
|
|
8617
|
-
await setOutputId(`
|
|
8618
|
-
SELECT outputId
|
|
8619
|
-
FROM outputs
|
|
8620
|
-
WHERE userId = ${userId}
|
|
8621
|
-
AND spendable = 1
|
|
8622
|
-
AND basketId = ${basketId}
|
|
8623
|
-
${txStatusCondition}
|
|
8624
|
-
AND satoshis - ${targetSatoshis} = (
|
|
8625
|
-
SELECT MAX(satoshis - ${targetSatoshis})
|
|
8626
|
-
FROM outputs
|
|
8627
|
-
WHERE userId = ${userId}
|
|
8628
|
-
AND spendable = 1
|
|
8629
|
-
AND basketId = ${basketId}
|
|
8630
|
-
${txStatusCondition}
|
|
8631
|
-
AND satoshis - ${targetSatoshis} < 0
|
|
8632
|
-
)
|
|
8633
|
-
LIMIT 1;
|
|
8634
|
-
`);
|
|
8635
|
-
}
|
|
8636
|
-
if (outputId === undefined)
|
|
8637
|
-
return undefined;
|
|
8638
|
-
await this.updateOutput(outputId, {
|
|
8639
|
-
spendable: false,
|
|
8640
|
-
spentBy: transactionId
|
|
8641
|
-
}, trx);
|
|
8642
|
-
const r = verifyTruthy(await this.findOutputById(outputId, trx));
|
|
8643
|
-
return r;
|
|
8644
|
-
});
|
|
8645
|
-
return r;
|
|
8646
|
-
}
|
|
8647
|
-
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[], booleanFields?: string[]): T
|
|
8648
|
-
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[], booleanFields?: string[]): T[]
|
|
8649
|
-
}
|
|
7548
|
+
async setActive(auth: sdk.AuthId, newActiveStorageIdentityKey: string): Promise<number>
|
|
8650
7549
|
```
|
|
7550
|
+
See also: [AuthId](./client.md#interface-authid)
|
|
8651
7551
|
|
|
8652
|
-
|
|
7552
|
+
Argument Details
|
|
8653
7553
|
|
|
8654
|
-
|
|
7554
|
+
+ **auth**
|
|
7555
|
+
+ Identifies client by identity key and the storage identity key of their currently active storage.
|
|
7556
|
+
This must match the `AuthFetch` identity securing the remote conneciton.
|
|
7557
|
+
+ **newActiveStorageIdentityKey**
|
|
7558
|
+
+ which must be a currently configured backup storage provider.
|
|
8655
7559
|
|
|
8656
|
-
|
|
7560
|
+
###### Method setServices
|
|
8657
7561
|
|
|
8658
|
-
|
|
7562
|
+
Ignored. Remote storage cannot share `Services` with remote clients.
|
|
8659
7563
|
|
|
8660
7564
|
```ts
|
|
8661
|
-
|
|
7565
|
+
setServices(v: sdk.WalletServices): void
|
|
8662
7566
|
```
|
|
8663
|
-
See also: [
|
|
7567
|
+
See also: [WalletServices](./client.md#interface-walletservices)
|
|
8664
7568
|
|
|
8665
|
-
###### Method
|
|
7569
|
+
###### Method updateProvenTxReqWithNewProvenTx
|
|
8666
7570
|
|
|
8667
|
-
|
|
7571
|
+
Handles the data received when a new transaction proof is found in response to an outstanding request for proof data:
|
|
8668
7572
|
|
|
8669
|
-
|
|
7573
|
+
- Creates a new `TableProvenTx` record.
|
|
7574
|
+
- Notifies all user transaction records of the new status.
|
|
7575
|
+
- Updates the proof request record to 'completed' status which enables delayed deletion.
|
|
8670
7576
|
|
|
8671
7577
|
```ts
|
|
8672
|
-
async
|
|
7578
|
+
async updateProvenTxReqWithNewProvenTx(args: sdk.UpdateProvenTxReqWithNewProvenTxArgs): Promise<sdk.UpdateProvenTxReqWithNewProvenTxResult>
|
|
8673
7579
|
```
|
|
7580
|
+
See also: [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult)
|
|
8674
7581
|
|
|
8675
|
-
|
|
7582
|
+
Returns
|
|
8676
7583
|
|
|
8677
|
-
|
|
8678
|
-
or a Knex.Transaction as appropriate.
|
|
7584
|
+
results of updates
|
|
8679
7585
|
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
7586
|
+
Argument Details
|
|
7587
|
+
|
|
7588
|
+
+ **args**
|
|
7589
|
+
+ proof request and new transaction proof data
|
|
8684
7590
|
|
|
8685
7591
|
###### Method validateEntities
|
|
8686
7592
|
|
|
@@ -8688,7 +7594,7 @@ Helper to force uniform behavior across database engines.
|
|
|
8688
7594
|
Use to process all arrays of records with time stamps retreived from database.
|
|
8689
7595
|
|
|
8690
7596
|
```ts
|
|
8691
|
-
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[]
|
|
7597
|
+
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
8692
7598
|
```
|
|
8693
7599
|
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8694
7600
|
|
|
@@ -8702,42 +7608,10 @@ Helper to force uniform behavior across database engines.
|
|
|
8702
7608
|
Use to process all individual records with time stamps retreived from database.
|
|
8703
7609
|
|
|
8704
7610
|
```ts
|
|
8705
|
-
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[]
|
|
8706
|
-
```
|
|
8707
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8708
|
-
|
|
8709
|
-
###### Method validateEntityForInsert
|
|
8710
|
-
|
|
8711
|
-
Helper to force uniform behavior across database engines.
|
|
8712
|
-
Use to process new entities being inserted into the database.
|
|
8713
|
-
|
|
8714
|
-
```ts
|
|
8715
|
-
async validateEntityForInsert<T extends sdk.EntityTimeStamp>(entity: T, trx?: sdk.TrxToken, dateFields?: string[], booleanFields?: string[]): Promise<any>
|
|
8716
|
-
```
|
|
8717
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [TrxToken](./client.md#interface-trxtoken)
|
|
8718
|
-
|
|
8719
|
-
###### Method validatePartialForUpdate
|
|
8720
|
-
|
|
8721
|
-
Helper to force uniform behavior across database engines.
|
|
8722
|
-
Use to process the update template for entities being updated.
|
|
8723
|
-
|
|
8724
|
-
```ts
|
|
8725
|
-
validatePartialForUpdate<T extends sdk.EntityTimeStamp>(update: Partial<T>, dateFields?: string[], booleanFields?: string[]): Partial<T>
|
|
7611
|
+
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[]): T
|
|
8726
7612
|
```
|
|
8727
7613
|
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
8728
7614
|
|
|
8729
|
-
###### Method verifyReadyForDatabaseAccess
|
|
8730
|
-
|
|
8731
|
-
Make sure database is ready for access:
|
|
8732
|
-
|
|
8733
|
-
- dateScheme is known
|
|
8734
|
-
- foreign key constraints are enabled
|
|
8735
|
-
|
|
8736
|
-
```ts
|
|
8737
|
-
async verifyReadyForDatabaseAccess(trx?: sdk.TrxToken): Promise<DBType>
|
|
8738
|
-
```
|
|
8739
|
-
See also: [DBType](./storage.md#type-dbtype), [TrxToken](./client.md#interface-trxtoken)
|
|
8740
|
-
|
|
8741
7615
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8742
7616
|
|
|
8743
7617
|
---
|
|
@@ -9059,47 +7933,6 @@ See also: [AuthId](./client.md#interface-authid), [FindOutputTagMapsArgs](./clie
|
|
|
9059
7933
|
|
|
9060
7934
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9061
7935
|
|
|
9062
|
-
---
|
|
9063
|
-
##### Class: StorageServer
|
|
9064
|
-
|
|
9065
|
-
```ts
|
|
9066
|
-
export class StorageServer {
|
|
9067
|
-
constructor(storage: StorageProvider, options: WalletStorageServerOptions)
|
|
9068
|
-
public start(): void
|
|
9069
|
-
validateDate(date: Date | string | number): Date
|
|
9070
|
-
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[]): T
|
|
9071
|
-
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
9072
|
-
}
|
|
9073
|
-
```
|
|
9074
|
-
|
|
9075
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [StorageProvider](./storage.md#class-storageprovider), [WalletStorageServerOptions](./storage.md#interface-walletstorageserveroptions)
|
|
9076
|
-
|
|
9077
|
-
###### Method validateEntities
|
|
9078
|
-
|
|
9079
|
-
Helper to force uniform behavior across database engines.
|
|
9080
|
-
Use to process all arrays of records with time stamps retreived from database.
|
|
9081
|
-
|
|
9082
|
-
```ts
|
|
9083
|
-
validateEntities<T extends sdk.EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
9084
|
-
```
|
|
9085
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
9086
|
-
|
|
9087
|
-
Returns
|
|
9088
|
-
|
|
9089
|
-
input `entities` array with contained values validated.
|
|
9090
|
-
|
|
9091
|
-
###### Method validateEntity
|
|
9092
|
-
|
|
9093
|
-
Helper to force uniform behavior across database engines.
|
|
9094
|
-
Use to process all individual records with time stamps retreived from database.
|
|
9095
|
-
|
|
9096
|
-
```ts
|
|
9097
|
-
validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[]): T
|
|
9098
|
-
```
|
|
9099
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
9100
|
-
|
|
9101
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9102
|
-
|
|
9103
7936
|
---
|
|
9104
7937
|
##### Class: StorageSyncReader
|
|
9105
7938
|
|
|
@@ -9271,9 +8104,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
9271
8104
|
```ts
|
|
9272
8105
|
export class TaskNewHeader extends WalletMonitorTask {
|
|
9273
8106
|
static taskName = "NewHeader";
|
|
9274
|
-
header?:
|
|
8107
|
+
header?: BlockHeader;
|
|
9275
8108
|
constructor(monitor: Monitor, public triggerMsecs = 1 * monitor.oneMinute)
|
|
9276
|
-
async getHeader(): Promise<
|
|
8109
|
+
async getHeader(): Promise<BlockHeader>
|
|
9277
8110
|
trigger(nowMsecsSinceEpoch: number): {
|
|
9278
8111
|
run: boolean;
|
|
9279
8112
|
}
|
|
@@ -9281,7 +8114,7 @@ export class TaskNewHeader extends WalletMonitorTask {
|
|
|
9281
8114
|
}
|
|
9282
8115
|
```
|
|
9283
8116
|
|
|
9284
|
-
See also: [BlockHeader](./
|
|
8117
|
+
See also: [BlockHeader](./services.md#interface-blockheader), [Monitor](./monitor.md#class-monitor), [WalletMonitorTask](./monitor.md#class-walletmonitortask)
|
|
9285
8118
|
|
|
9286
8119
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9287
8120
|
|
|
@@ -9407,57 +8240,6 @@ See also: [Monitor](./monitor.md#class-monitor), [WalletMonitorTask](./monitor.m
|
|
|
9407
8240
|
|
|
9408
8241
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9409
8242
|
|
|
9410
|
-
---
|
|
9411
|
-
##### Class: TaskUnFail
|
|
9412
|
-
|
|
9413
|
-
Setting provenTxReq status to 'unfail' when 'invalid' will attempt to find a merklePath, and if successful:
|
|
9414
|
-
|
|
9415
|
-
1. set the req status to 'unmined'
|
|
9416
|
-
2. set the referenced txs to 'unproven'
|
|
9417
|
-
3. determine if any inputs match user's existing outputs and if so update spentBy and spendable of those outputs.
|
|
9418
|
-
4. set the txs outputs to spendable
|
|
9419
|
-
|
|
9420
|
-
If it fails (to find a merklePath), returns the req status to 'invalid'.
|
|
9421
|
-
|
|
9422
|
-
```ts
|
|
9423
|
-
export class TaskUnFail extends WalletMonitorTask {
|
|
9424
|
-
static taskName = "UnFail";
|
|
9425
|
-
static checkNow = false;
|
|
9426
|
-
constructor(monitor: Monitor, public triggerMsecs = monitor.oneMinute * 10)
|
|
9427
|
-
trigger(nowMsecsSinceEpoch: number): {
|
|
9428
|
-
run: boolean;
|
|
9429
|
-
}
|
|
9430
|
-
async runTask(): Promise<string>
|
|
9431
|
-
async unfail(reqs: TableProvenTxReq[], indent = 0): Promise<{
|
|
9432
|
-
log: string;
|
|
9433
|
-
}>
|
|
9434
|
-
async unfailReq(req: EntityProvenTxReq, indent: number): Promise<string>
|
|
9435
|
-
}
|
|
9436
|
-
```
|
|
9437
|
-
|
|
9438
|
-
See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq), [Monitor](./monitor.md#class-monitor), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [WalletMonitorTask](./monitor.md#class-walletmonitortask)
|
|
9439
|
-
|
|
9440
|
-
###### Property checkNow
|
|
9441
|
-
|
|
9442
|
-
Set to true to trigger running this task
|
|
9443
|
-
|
|
9444
|
-
```ts
|
|
9445
|
-
static checkNow = false
|
|
9446
|
-
```
|
|
9447
|
-
|
|
9448
|
-
###### Method unfailReq
|
|
9449
|
-
|
|
9450
|
-
2. set the referenced txs to 'unproven'
|
|
9451
|
-
3. determine if any inputs match user's existing outputs and if so update spentBy and spendable of those outputs.
|
|
9452
|
-
4. set the txs outputs to spendable
|
|
9453
|
-
|
|
9454
|
-
```ts
|
|
9455
|
-
async unfailReq(req: EntityProvenTxReq, indent: number): Promise<string>
|
|
9456
|
-
```
|
|
9457
|
-
See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq)
|
|
9458
|
-
|
|
9459
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
9460
|
-
|
|
9461
8243
|
---
|
|
9462
8244
|
##### Class: TwilioPhoneInteractor
|
|
9463
8245
|
|
|
@@ -10712,6 +9494,7 @@ Manages wallet settings
|
|
|
10712
9494
|
|
|
10713
9495
|
```ts
|
|
10714
9496
|
export class WalletSettingsManager {
|
|
9497
|
+
kv: LocalKVStore;
|
|
10715
9498
|
constructor(private wallet: WalletInterface, private config: WalletSettingsManagerConfig = {
|
|
10716
9499
|
defaultSettings: DEFAULT_SETTINGS
|
|
10717
9500
|
})
|
|
@@ -11151,44 +9934,43 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
11151
9934
|
|
|
11152
9935
|
| | | |
|
|
11153
9936
|
| --- | --- | --- |
|
|
11154
|
-
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [
|
|
11155
|
-
| [arcDefaultUrl](#function-arcdefaulturl) | [
|
|
11156
|
-
| [arraysEqual](#function-arraysequal) | [
|
|
9937
|
+
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [isLiveBlockHeader](#function-isliveblockheader) | [validateCreateActionOutput](#function-validatecreateactionoutput) |
|
|
9938
|
+
| [arcDefaultUrl](#function-arcdefaulturl) | [listCertificates](#function-listcertificates) | [validateDiscoverByAttributesArgs](#function-validatediscoverbyattributesargs) |
|
|
9939
|
+
| [arraysEqual](#function-arraysequal) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [validateDiscoverByIdentityKeyArgs](#function-validatediscoverbyidentitykeyargs) |
|
|
11157
9940
|
| [asArray](#function-asarray) | [makeAtomicBeef](#function-makeatomicbeef) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
|
|
11158
|
-
| [
|
|
11159
|
-
| [
|
|
11160
|
-
| [
|
|
11161
|
-
| [
|
|
11162
|
-
| [
|
|
11163
|
-
| [
|
|
11164
|
-
| [
|
|
11165
|
-
| [
|
|
11166
|
-
| [
|
|
11167
|
-
| [
|
|
11168
|
-
| [
|
|
11169
|
-
| [
|
|
11170
|
-
| [
|
|
11171
|
-
| [
|
|
11172
|
-
| [
|
|
11173
|
-
| [
|
|
11174
|
-
| [
|
|
11175
|
-
| [
|
|
11176
|
-
| [
|
|
11177
|
-
| [
|
|
11178
|
-
| [
|
|
11179
|
-
| [
|
|
11180
|
-
| [
|
|
11181
|
-
| [
|
|
11182
|
-
| [
|
|
11183
|
-
| [
|
|
11184
|
-
| [
|
|
11185
|
-
| [
|
|
11186
|
-
| [
|
|
11187
|
-
| [isHexString](#function-ishexstring) | [
|
|
11188
|
-
| [isListActionsSpecOp](#function-islistactionsspecop) | [
|
|
11189
|
-
| [isListOutputsSpecOp](#function-islistoutputsspecop) | [
|
|
11190
|
-
| [
|
|
11191
|
-
| [listCertificates](#function-listcertificates) | [validateCreateActionOptions](#function-validatecreateactionoptions) | |
|
|
9941
|
+
| [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [makeAtomicBeef](#function-makeatomicbeef) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
|
|
9942
|
+
| [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [makeChangeLock](#function-makechangelock) | [validateInteger](#function-validateinteger) |
|
|
9943
|
+
| [asBsvSdkScript](#function-asbsvsdkscript) | [maxDate](#function-maxdate) | [validateInternalizeActionArgs](#function-validateinternalizeactionargs) |
|
|
9944
|
+
| [asBsvSdkTx](#function-asbsvsdktx) | [offsetPubKey](#function-offsetpubkey) | [validateInternalizeOutput](#function-validateinternalizeoutput) |
|
|
9945
|
+
| [asString](#function-asstring) | [optionalArraysEqual](#function-optionalarraysequal) | [validateListActionsArgs](#function-validatelistactionsargs) |
|
|
9946
|
+
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [parseTxScriptOffsets](#function-parsetxscriptoffsets) | [validateListCertificatesArgs](#function-validatelistcertificatesargs) |
|
|
9947
|
+
| [buildSignableTransaction](#function-buildsignabletransaction) | [parseWalletOutpoint](#function-parsewalletoutpoint) | [validateListOutputsArgs](#function-validatelistoutputsargs) |
|
|
9948
|
+
| [completeSignedTransaction](#function-completesignedtransaction) | [processAction](#function-processaction) | [validateOptionalInteger](#function-validateoptionalinteger) |
|
|
9949
|
+
| [completeSignedTransaction](#function-completesignedtransaction) | [processAction](#function-processaction) | [validateOptionalOutpointString](#function-validateoptionaloutpointstring) |
|
|
9950
|
+
| [convertProofToMerklePath](#function-convertprooftomerklepath) | [proveCertificate](#function-provecertificate) | [validateOriginator](#function-validateoriginator) |
|
|
9951
|
+
| [createAction](#function-createaction) | [randomBytes](#function-randombytes) | [validateOutpointString](#function-validateoutpointstring) |
|
|
9952
|
+
| [createAction](#function-createaction) | [randomBytesBase64](#function-randombytesbase64) | [validatePositiveIntegerOrZero](#function-validatepositiveintegerorzero) |
|
|
9953
|
+
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [randomBytesHex](#function-randombyteshex) | [validateProveCertificateArgs](#function-validateprovecertificateargs) |
|
|
9954
|
+
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | [validateRelinquishCertificateArgs](#function-validaterelinquishcertificateargs) |
|
|
9955
|
+
| [createSyncMap](#function-createsyncmap) | [sha256Hash](#function-sha256hash) | [validateRelinquishOutputArgs](#function-validaterelinquishoutputargs) |
|
|
9956
|
+
| [doubleSha256BE](#function-doublesha256be) | [signAction](#function-signaction) | [validateSatoshis](#function-validatesatoshis) |
|
|
9957
|
+
| [doubleSha256HashLE](#function-doublesha256hashle) | [stampLog](#function-stamplog) | [validateScriptHash](#function-validatescripthash) |
|
|
9958
|
+
| [generateChangeSdk](#function-generatechangesdk) | [stampLogFormat](#function-stamplogformat) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
|
|
9959
|
+
| [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) | [validateSignActionArgs](#function-validatesignactionargs) |
|
|
9960
|
+
| [getBeefForTransaction](#function-getbeeffortransaction) | [toWalletNetwork](#function-towalletnetwork) | [validateSignActionOptions](#function-validatesignactionoptions) |
|
|
9961
|
+
| [getExchangeRatesIo](#function-getexchangeratesio) | [transactionInputSize](#function-transactioninputsize) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
|
|
9962
|
+
| [getIdentityKey](#function-getidentitykey) | [transactionOutputSize](#function-transactionoutputsize) | [validateStringLength](#function-validatestringlength) |
|
|
9963
|
+
| [getProofs](#function-getproofs) | [transactionSize](#function-transactionsize) | [validateWalletPayment](#function-validatewalletpayment) |
|
|
9964
|
+
| [getSyncChunk](#function-getsyncchunk) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) | [varUintSize](#function-varuintsize) |
|
|
9965
|
+
| [internalizeAction](#function-internalizeaction) | [updateExchangeratesapi](#function-updateexchangeratesapi) | [verifyHexString](#function-verifyhexstring) |
|
|
9966
|
+
| [internalizeAction](#function-internalizeaction) | [validateAbortActionArgs](#function-validateabortactionargs) | [verifyId](#function-verifyid) |
|
|
9967
|
+
| [isBaseBlockHeader](#function-isbaseblockheader) | [validateAcquireCertificateArgs](#function-validateacquirecertificateargs) | [verifyInteger](#function-verifyinteger) |
|
|
9968
|
+
| [isBlockHeader](#function-isblockheader) | [validateAcquireDirectCertificateArgs](#function-validateacquiredirectcertificateargs) | [verifyNumber](#function-verifynumber) |
|
|
9969
|
+
| [isCreateActionSpecOp](#function-iscreateactionspecop) | [validateAcquireIssuanceCertificateArgs](#function-validateacquireissuancecertificateargs) | [verifyOne](#function-verifyone) |
|
|
9970
|
+
| [isHexString](#function-ishexstring) | [validateBasketInsertion](#function-validatebasketinsertion) | [verifyOneOrNone](#function-verifyoneornone) |
|
|
9971
|
+
| [isListActionsSpecOp](#function-islistactionsspecop) | [validateCreateActionArgs](#function-validatecreateactionargs) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
|
|
9972
|
+
| [isListOutputsSpecOp](#function-islistoutputsspecop) | [validateCreateActionInput](#function-validatecreateactioninput) | [verifyTruthy](#function-verifytruthy) |
|
|
9973
|
+
| [isLive](#function-islive) | [validateCreateActionOptions](#function-validatecreateactionoptions) | [wait](#function-wait) |
|
|
11192
9974
|
|
|
11193
9975
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11194
9976
|
|
|
@@ -11235,15 +10017,6 @@ export function asArray(val: string | number[]): number[]
|
|
|
11235
10017
|
|
|
11236
10018
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11237
10019
|
|
|
11238
|
-
---
|
|
11239
|
-
##### Function: asArray
|
|
11240
|
-
|
|
11241
|
-
```ts
|
|
11242
|
-
export function asArray(val: Buffer | string | number[], encoding?: BufferEncoding): number[]
|
|
11243
|
-
```
|
|
11244
|
-
|
|
11245
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11246
|
-
|
|
11247
10020
|
---
|
|
11248
10021
|
##### Function: asBsvSdkPrivateKey
|
|
11249
10022
|
|
|
@@ -11312,37 +10085,6 @@ export function asBsvSdkTx(tx: HexString | number[] | Transaction): Transaction
|
|
|
11312
10085
|
|
|
11313
10086
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11314
10087
|
|
|
11315
|
-
---
|
|
11316
|
-
##### Function: asBuffer
|
|
11317
|
-
|
|
11318
|
-
Coerce a value to Buffer if currently encoded as a string or
|
|
11319
|
-
|
|
11320
|
-
```ts
|
|
11321
|
-
export function asBuffer(val: Buffer | string | number[], encoding?: BufferEncoding): Buffer {
|
|
11322
|
-
let b: Buffer;
|
|
11323
|
-
if (Buffer.isBuffer(val))
|
|
11324
|
-
b = val;
|
|
11325
|
-
else if (typeof val === "string")
|
|
11326
|
-
b = Buffer.from(val, encoding ?? "hex");
|
|
11327
|
-
else
|
|
11328
|
-
b = Buffer.from(val);
|
|
11329
|
-
return b;
|
|
11330
|
-
}
|
|
11331
|
-
```
|
|
11332
|
-
|
|
11333
|
-
Returns
|
|
11334
|
-
|
|
11335
|
-
input val if it is a Buffer or new Buffer from string val
|
|
11336
|
-
|
|
11337
|
-
Argument Details
|
|
11338
|
-
|
|
11339
|
-
+ **val**
|
|
11340
|
-
+ Buffer or string or number[]. If string, encoding param applies. If number[], Buffer.from constructor is used.
|
|
11341
|
-
+ **encoding**
|
|
11342
|
-
+ defaults to 'hex'. Only applies to val of type string
|
|
11343
|
-
|
|
11344
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11345
|
-
|
|
11346
10088
|
---
|
|
11347
10089
|
##### Function: asString
|
|
11348
10090
|
|
|
@@ -11367,32 +10109,6 @@ Argument Details
|
|
|
11367
10109
|
|
|
11368
10110
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11369
10111
|
|
|
11370
|
-
---
|
|
11371
|
-
##### Function: asString
|
|
11372
|
-
|
|
11373
|
-
Coerce a value to an encoded string if currently a Buffer or number[]
|
|
11374
|
-
|
|
11375
|
-
```ts
|
|
11376
|
-
export function asString(val: Buffer | string | number[], encoding?: BufferEncoding): string {
|
|
11377
|
-
if (Array.isArray(val))
|
|
11378
|
-
val = Buffer.from(val);
|
|
11379
|
-
return Buffer.isBuffer(val) ? val.toString(encoding ?? "hex") : val;
|
|
11380
|
-
}
|
|
11381
|
-
```
|
|
11382
|
-
|
|
11383
|
-
Returns
|
|
11384
|
-
|
|
11385
|
-
input val if it is a string; or if number[], first converted to Buffer then as Buffer; if Buffer encoded using `encoding`
|
|
11386
|
-
|
|
11387
|
-
Argument Details
|
|
11388
|
-
|
|
11389
|
-
+ **val**
|
|
11390
|
-
+ Buffer or string or number[]. If string, encoding param applies. If number[], Buffer.from constructor is used.
|
|
11391
|
-
+ **encoding**
|
|
11392
|
-
+ defaults to 'hex'
|
|
11393
|
-
|
|
11394
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11395
|
-
|
|
11396
10112
|
---
|
|
11397
10113
|
##### Function: attemptToPostReqsToNetwork
|
|
11398
10114
|
|
|
@@ -11760,6 +10476,54 @@ See also: [AuthId](./client.md#interface-authid), [Wallet](./client.md#class-wal
|
|
|
11760
10476
|
|
|
11761
10477
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11762
10478
|
|
|
10479
|
+
---
|
|
10480
|
+
##### Function: isBaseBlockHeader
|
|
10481
|
+
|
|
10482
|
+
Type guard function.
|
|
10483
|
+
|
|
10484
|
+
```ts
|
|
10485
|
+
export function isBaseBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is BaseBlockHeader {
|
|
10486
|
+
return typeof header.previousHash === "string";
|
|
10487
|
+
}
|
|
10488
|
+
```
|
|
10489
|
+
|
|
10490
|
+
See also: [BaseBlockHeader](./services.md#interface-baseblockheader), [BlockHeader](./services.md#interface-blockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
10491
|
+
|
|
10492
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10493
|
+
|
|
10494
|
+
---
|
|
10495
|
+
##### Function: isBlockHeader
|
|
10496
|
+
|
|
10497
|
+
Type guard function.
|
|
10498
|
+
|
|
10499
|
+
```ts
|
|
10500
|
+
export function isBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader {
|
|
10501
|
+
return "height" in header && typeof header.previousHash === "string";
|
|
10502
|
+
}
|
|
10503
|
+
```
|
|
10504
|
+
|
|
10505
|
+
See also: [BaseBlockHeader](./services.md#interface-baseblockheader), [BlockHeader](./services.md#interface-blockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
10506
|
+
|
|
10507
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10508
|
+
|
|
10509
|
+
---
|
|
10510
|
+
##### Function: isCreateActionSpecOp
|
|
10511
|
+
|
|
10512
|
+
```ts
|
|
10513
|
+
export function isCreateActionSpecOp(label: string): boolean
|
|
10514
|
+
```
|
|
10515
|
+
|
|
10516
|
+
Returns
|
|
10517
|
+
|
|
10518
|
+
true iff the `label` name is a reserved `createAction` special operation identifier.
|
|
10519
|
+
|
|
10520
|
+
Argument Details
|
|
10521
|
+
|
|
10522
|
+
+ **label**
|
|
10523
|
+
+ Action / Transaction label name value.
|
|
10524
|
+
|
|
10525
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10526
|
+
|
|
11763
10527
|
---
|
|
11764
10528
|
##### Function: isHexString
|
|
11765
10529
|
|
|
@@ -11806,35 +10570,43 @@ Argument Details
|
|
|
11806
10570
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11807
10571
|
|
|
11808
10572
|
---
|
|
11809
|
-
##### Function:
|
|
10573
|
+
##### Function: isLive
|
|
10574
|
+
|
|
10575
|
+
Type guard function.
|
|
11810
10576
|
|
|
11811
10577
|
```ts
|
|
11812
|
-
export
|
|
10578
|
+
export function isLive(header: BlockHeader | LiveBlockHeader): header is LiveBlockHeader {
|
|
10579
|
+
return (header as LiveBlockHeader).headerId !== undefined;
|
|
10580
|
+
}
|
|
11813
10581
|
```
|
|
11814
10582
|
|
|
11815
|
-
See also: [
|
|
10583
|
+
See also: [BlockHeader](./services.md#interface-blockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
11816
10584
|
|
|
11817
10585
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11818
10586
|
|
|
11819
10587
|
---
|
|
11820
|
-
##### Function:
|
|
10588
|
+
##### Function: isLiveBlockHeader
|
|
10589
|
+
|
|
10590
|
+
Type guard function.
|
|
11821
10591
|
|
|
11822
10592
|
```ts
|
|
11823
|
-
export
|
|
10593
|
+
export function isLiveBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader {
|
|
10594
|
+
return "chainwork" in header && typeof header.previousHash === "string";
|
|
10595
|
+
}
|
|
11824
10596
|
```
|
|
11825
10597
|
|
|
11826
|
-
See also: [
|
|
10598
|
+
See also: [BaseBlockHeader](./services.md#interface-baseblockheader), [BlockHeader](./services.md#interface-blockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
11827
10599
|
|
|
11828
10600
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11829
10601
|
|
|
11830
10602
|
---
|
|
11831
|
-
##### Function:
|
|
10603
|
+
##### Function: listCertificates
|
|
11832
10604
|
|
|
11833
10605
|
```ts
|
|
11834
|
-
export async function
|
|
10606
|
+
export async function listCertificates(storage: StorageProvider, auth: sdk.AuthId, vargs: sdk.ValidListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
|
|
11835
10607
|
```
|
|
11836
10608
|
|
|
11837
|
-
See also: [AuthId](./client.md#interface-authid), [
|
|
10609
|
+
See also: [AuthId](./client.md#interface-authid), [StorageProvider](./storage.md#class-storageprovider), [ValidListCertificatesArgs](./client.md#interface-validlistcertificatesargs)
|
|
11838
10610
|
|
|
11839
10611
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11840
10612
|
|
|
@@ -11967,17 +10739,6 @@ See also: [AuthId](./client.md#interface-authid), [ValidProveCertificateArgs](./
|
|
|
11967
10739
|
|
|
11968
10740
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11969
10741
|
|
|
11970
|
-
---
|
|
11971
|
-
##### Function: purgeData
|
|
11972
|
-
|
|
11973
|
-
```ts
|
|
11974
|
-
export async function purgeData(storage: StorageKnex, params: sdk.PurgeParams, trx?: sdk.TrxToken): Promise<sdk.PurgeResults>
|
|
11975
|
-
```
|
|
11976
|
-
|
|
11977
|
-
See also: [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageKnex](./storage.md#class-storageknex), [TrxToken](./client.md#interface-trxtoken)
|
|
11978
|
-
|
|
11979
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11980
|
-
|
|
11981
10742
|
---
|
|
11982
10743
|
##### Function: randomBytes
|
|
11983
10744
|
|
|
@@ -12017,22 +10778,6 @@ count cryptographically secure random bytes as hex encoded string
|
|
|
12017
10778
|
|
|
12018
10779
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12019
10780
|
|
|
12020
|
-
---
|
|
12021
|
-
##### Function: reviewStatus
|
|
12022
|
-
|
|
12023
|
-
```ts
|
|
12024
|
-
export async function reviewStatus(storage: StorageKnex, args: {
|
|
12025
|
-
agedLimit: Date;
|
|
12026
|
-
trx?: sdk.TrxToken;
|
|
12027
|
-
}): Promise<{
|
|
12028
|
-
log: string;
|
|
12029
|
-
}>
|
|
12030
|
-
```
|
|
12031
|
-
|
|
12032
|
-
See also: [StorageKnex](./storage.md#class-storageknex), [TrxToken](./client.md#interface-trxtoken)
|
|
12033
|
-
|
|
12034
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12035
|
-
|
|
12036
10781
|
---
|
|
12037
10782
|
##### Function: setDisableDoubleSpendCheckForTest
|
|
12038
10783
|
|
|
@@ -12139,7 +10884,7 @@ export function toBinaryBaseBlockHeader(header: sdk.BaseBlockHeader): number[] {
|
|
|
12139
10884
|
}
|
|
12140
10885
|
```
|
|
12141
10886
|
|
|
12142
|
-
See also: [BaseBlockHeader](./
|
|
10887
|
+
See also: [BaseBlockHeader](./services.md#interface-baseblockheader), [asArray](./client.md#function-asarray)
|
|
12143
10888
|
|
|
12144
10889
|
Returns
|
|
12145
10890
|
|
|
@@ -12895,7 +11640,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
12895
11640
|
##### Type: GetRawTxService
|
|
12896
11641
|
|
|
12897
11642
|
```ts
|
|
12898
|
-
export type GetRawTxService = (txid: string, chain:
|
|
11643
|
+
export type GetRawTxService = (txid: string, chain: Chain) => Promise<GetRawTxResult>
|
|
12899
11644
|
```
|
|
12900
11645
|
|
|
12901
11646
|
See also: [Chain](./client.md#type-chain), [GetRawTxResult](./client.md#interface-getrawtxresult)
|
|
@@ -12917,7 +11662,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
12917
11662
|
##### Type: GetStatusForTxidsService
|
|
12918
11663
|
|
|
12919
11664
|
```ts
|
|
12920
|
-
export type GetStatusForTxidsService = (txids: string[]) => Promise<
|
|
11665
|
+
export type GetStatusForTxidsService = (txids: string[]) => Promise<GetStatusForTxidsResult>
|
|
12921
11666
|
```
|
|
12922
11667
|
|
|
12923
11668
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
@@ -13159,10 +11904,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
13159
11904
|
| [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [specOpInvalidChange](#variable-specopinvalidchange) |
|
|
13160
11905
|
| [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [specOpNoSendActions](#variable-specopnosendactions) |
|
|
13161
11906
|
| [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
|
|
13162
|
-
| [brc29ProtocolID](#variable-brc29protocolid) | [
|
|
13163
|
-
| [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [
|
|
13164
|
-
| [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | [
|
|
13165
|
-
| [parseResults](#variable-parseresults) |
|
|
11907
|
+
| [brc29ProtocolID](#variable-brc29protocolid) | [specOpThrowReviewActions](#variable-specopthrowreviewactions) |
|
|
11908
|
+
| [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [specOpWalletBalance](#variable-specopwalletbalance) |
|
|
11909
|
+
| [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
|
|
11910
|
+
| [parseResults](#variable-parseresults) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
|
|
13166
11911
|
|
|
13167
11912
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
13168
11913
|
|
|
@@ -13176,19 +11921,12 @@ DEFAULT_SETTINGS = {
|
|
|
13176
11921
|
trustLevel: 2,
|
|
13177
11922
|
trustedCertifiers: [
|
|
13178
11923
|
{
|
|
13179
|
-
name: "
|
|
13180
|
-
description: "
|
|
13181
|
-
iconUrl: "https://
|
|
11924
|
+
name: "Metanet Trust Services",
|
|
11925
|
+
description: "Registry for protocols, baskets, and certificates types",
|
|
11926
|
+
iconUrl: "https://bsvblockchain.org/favicon.ico",
|
|
13182
11927
|
identityKey: "03daf815fe38f83da0ad83b5bedc520aa488aef5cbc93a93c67a7fe60406cbffe8",
|
|
13183
11928
|
trust: 4
|
|
13184
11929
|
},
|
|
13185
|
-
{
|
|
13186
|
-
name: "IdentiCert",
|
|
13187
|
-
description: "Certifies legal first and last name, and photos",
|
|
13188
|
-
iconUrl: "https://identicert.me/favicon.ico",
|
|
13189
|
-
trust: 5,
|
|
13190
|
-
identityKey: "0295bf1c7842d14babf60daf2c733956c331f9dcb2c79e41f85fd1dda6a3fa4549"
|
|
13191
|
-
},
|
|
13192
11930
|
{
|
|
13193
11931
|
name: "SocialCert",
|
|
13194
11932
|
description: "Certifies social media handles, phone numbers and emails",
|
|
@@ -13402,6 +12140,15 @@ specOpSetWalletChangeParams = "a4979d28ced8581e9c1c92f1001cc7cb3aabf8ea32e10888a
|
|
|
13402
12140
|
|
|
13403
12141
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
13404
12142
|
|
|
12143
|
+
---
|
|
12144
|
+
##### Variable: specOpThrowReviewActions
|
|
12145
|
+
|
|
12146
|
+
```ts
|
|
12147
|
+
specOpThrowReviewActions = "a496e747fc3ad5fabdd4ae8f91184e71f87539bd3d962aa2548942faaaf0047a"
|
|
12148
|
+
```
|
|
12149
|
+
|
|
12150
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12151
|
+
|
|
13405
12152
|
---
|
|
13406
12153
|
##### Variable: specOpWalletBalance
|
|
13407
12154
|
|