@bsv/wallet-toolbox 2.1.25 → 2.1.26
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 +1683 -1111
- package/docs/monitor.md +34 -19
- package/docs/services.md +303 -279
- package/docs/setup.md +24 -24
- package/docs/storage.md +864 -199
- package/docs/wallet.md +5228 -11040
- package/out/src/__tests/CWIStyleWalletManager.test.js +3 -2
- package/out/src/__tests/CWIStyleWalletManager.test.js.map +1 -1
- package/out/src/__tests/ShamirWalletManager.test.js +4 -0
- package/out/src/__tests/ShamirWalletManager.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +9 -17
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.checks.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.checks.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js +8 -8
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +2 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +7 -5
- package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.js +14 -14
- package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js +6 -5
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js +2 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +1 -1
- package/out/src/entropy/EntropyCollector.js.map +1 -1
- package/out/src/mockchain/MockChainMigrations.d.ts.map +1 -1
- package/out/src/mockchain/MockChainStorage.js +3 -3
- package/out/src/mockchain/MockChainStorage.js.map +1 -1
- package/out/src/mockchain/MockMiner.js +1 -1
- package/out/src/mockchain/MockMiner.js.map +1 -1
- package/out/src/mockchain/MockServices.js +14 -13
- package/out/src/mockchain/MockServices.js.map +1 -1
- package/out/src/monitor/Monitor.js +8 -6
- 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 +11 -13
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js +6 -3
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +19 -18
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.js +1 -1
- package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +59 -59
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.js +3 -4
- package/out/src/services/ServiceCollection.js.map +1 -1
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +27 -25
- package/out/src/services/Services.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +99 -94
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +159 -156
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +35 -31
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.js +7 -7
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageReaderWriter.d.ts +0 -1
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
- package/out/src/storage/StorageReaderWriter.js +0 -3
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.js +1 -1
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +22 -21
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/index.all.d.ts +3 -0
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +3 -0
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/index.client.d.ts +3 -0
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +3 -0
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/index.mobile.d.ts +3 -0
- package/out/src/storage/index.mobile.d.ts.map +1 -1
- package/out/src/storage/index.mobile.js +3 -0
- package/out/src/storage/index.mobile.js.map +1 -1
- package/out/src/storage/portable/index.d.ts +55 -0
- package/out/src/storage/portable/index.d.ts.map +1 -0
- package/out/src/storage/portable/index.js +830 -0
- package/out/src/storage/portable/index.js.map +1 -0
- package/out/src/storage/storageProviderHelpers.js +2 -2
- package/out/src/storage/storageProviderHelpers.js.map +1 -1
- package/out/src/utility/Format.d.ts.map +1 -1
- package/out/src/utility/Format.js +10 -45
- package/out/src/utility/Format.js.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.js +3 -2
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js.map +1 -1
- package/out/src/utility/identityUtils.d.ts.map +1 -1
- package/out/src/utility/identityUtils.js +5 -5
- package/out/src/utility/identityUtils.js.map +1 -1
- package/out/src/utility/index.all.d.ts +1 -0
- package/out/src/utility/index.all.d.ts.map +1 -1
- package/out/src/utility/index.all.js +1 -0
- package/out/src/utility/index.all.js.map +1 -1
- package/out/src/utility/index.client.d.ts +1 -0
- package/out/src/utility/index.client.d.ts.map +1 -1
- package/out/src/utility/index.client.js +1 -0
- package/out/src/utility/index.client.js.map +1 -1
- package/out/src/utility/stampLog.js +3 -3
- package/out/src/utility/stampLog.js.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.js +1 -1
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -1
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +2 -2
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/src/wab-client/WABClient.d.ts +2 -2
- package/out/src/wab-client/WABClient.d.ts.map +1 -1
- package/package.json +1 -1
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.js +0 -148
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Backfill.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.test.js +0 -96
- package/out/src/storage/schema/__tests/v7Backfill.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Fsm.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Fsm.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Fsm.test.js +0 -42
- package/out/src/storage/schema/__tests/v7Fsm.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Spendability.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Spendability.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Spendability.test.js +0 -29
- package/out/src/storage/schema/__tests/v7Spendability.test.js.map +0 -1
- package/out/src/storage/schema/tables/TableAction.d.ts +0 -38
- package/out/src/storage/schema/tables/TableAction.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableAction.js +0 -3
- package/out/src/storage/schema/tables/TableAction.js.map +0 -1
- package/out/src/storage/schema/tables/TableChainTip.d.ts +0 -17
- package/out/src/storage/schema/tables/TableChainTip.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableChainTip.js +0 -3
- package/out/src/storage/schema/tables/TableChainTip.js.map +0 -1
- package/out/src/storage/schema/tables/TableMonitorLease.d.ts +0 -23
- package/out/src/storage/schema/tables/TableMonitorLease.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableMonitorLease.js +0 -3
- package/out/src/storage/schema/tables/TableMonitorLease.js.map +0 -1
- package/out/src/storage/schema/tables/TableTransactionV7.d.ts +0 -50
- package/out/src/storage/schema/tables/TableTransactionV7.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableTransactionV7.js +0 -3
- package/out/src/storage/schema/tables/TableTransactionV7.js.map +0 -1
- package/out/src/storage/schema/tables/TableTxAudit.d.ts +0 -26
- package/out/src/storage/schema/tables/TableTxAudit.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableTxAudit.js +0 -3
- package/out/src/storage/schema/tables/TableTxAudit.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.d.ts +0 -35
- package/out/src/storage/schema/v7Backfill.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.idb.d.ts +0 -32
- package/out/src/storage/schema/v7Backfill.idb.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.idb.js +0 -95
- package/out/src/storage/schema/v7Backfill.idb.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.js +0 -147
- package/out/src/storage/schema/v7Backfill.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.knex.d.ts +0 -32
- package/out/src/storage/schema/v7Backfill.knex.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.knex.js +0 -240
- package/out/src/storage/schema/v7Backfill.knex.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.runner.d.ts +0 -63
- package/out/src/storage/schema/v7Backfill.runner.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.runner.js +0 -62
- package/out/src/storage/schema/v7Backfill.runner.js.map +0 -1
- package/out/src/storage/schema/v7Crud.d.ts +0 -39
- package/out/src/storage/schema/v7Crud.d.ts.map +0 -1
- package/out/src/storage/schema/v7Crud.js +0 -203
- package/out/src/storage/schema/v7Crud.js.map +0 -1
- package/out/src/storage/schema/v7Fsm.d.ts +0 -27
- package/out/src/storage/schema/v7Fsm.d.ts.map +0 -1
- package/out/src/storage/schema/v7Fsm.js +0 -108
- package/out/src/storage/schema/v7Fsm.js.map +0 -1
- package/out/src/storage/schema/v7MonitorLease.d.ts +0 -57
- package/out/src/storage/schema/v7MonitorLease.d.ts.map +0 -1
- package/out/src/storage/schema/v7MonitorLease.js +0 -101
- package/out/src/storage/schema/v7MonitorLease.js.map +0 -1
- package/out/src/storage/schema/v7Spendability.d.ts +0 -45
- package/out/src/storage/schema/v7Spendability.d.ts.map +0 -1
- package/out/src/storage/schema/v7Spendability.js +0 -52
- package/out/src/storage/schema/v7Spendability.js.map +0 -1
- package/out/src/storage/schema/v7TxAudit.d.ts +0 -33
- package/out/src/storage/schema/v7TxAudit.d.ts.map +0 -1
- package/out/src/storage/schema/v7TxAudit.js +0 -64
- package/out/src/storage/schema/v7TxAudit.js.map +0 -1
package/docs/client.md
CHANGED
|
@@ -6,84 +6,86 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6
6
|
|
|
7
7
|
| | | |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
-
| [AdminStatsResult](#interface-adminstatsresult) | [
|
|
10
|
-
| [
|
|
11
|
-
| [
|
|
12
|
-
| [
|
|
13
|
-
| [
|
|
14
|
-
| [
|
|
15
|
-
| [
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [
|
|
19
|
-
| [
|
|
20
|
-
| [
|
|
21
|
-
| [
|
|
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
|
-
| [
|
|
76
|
-
| [
|
|
77
|
-
| [
|
|
78
|
-
| [
|
|
79
|
-
| [
|
|
80
|
-
| [
|
|
81
|
-
| [
|
|
82
|
-
| [
|
|
83
|
-
| [
|
|
84
|
-
| [
|
|
85
|
-
| [
|
|
86
|
-
| [
|
|
9
|
+
| [AdminStatsResult](#interface-adminstatsresult) | [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [SetupWalletClient](#interface-setupwalletclient) |
|
|
10
|
+
| [AggregatePostBeefTxResult](#interface-aggregatepostbeeftxresult) | [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [SetupWalletIdb](#interface-setupwalletidb) |
|
|
11
|
+
| [ArcConfig](#interface-arcconfig) | [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [SetupWalletIdbArgs](#interface-setupwalletidbargs) |
|
|
12
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [SignActionResultX](#interface-signactionresultx) |
|
|
13
|
+
| [ArcSSEClientOptions](#interface-arcsseclientoptions) | [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StartAuthResponse](#interface-startauthresponse) |
|
|
14
|
+
| [ArcSSEEvent](#interface-arcsseevent) | [GetHeaderByteFileLinksResult](#interface-getheaderbytefilelinksresult) | [StatusForTxidResult](#interface-statusfortxidresult) |
|
|
15
|
+
| [AuthId](#interface-authid) | [GetMerklePathResult](#interface-getmerklepathresult) | [StopListenerToken](#interface-stoplistenertoken) |
|
|
16
|
+
| [AuthPayload](#interface-authpayload) | [GetRawTxResult](#interface-getrawtxresult) | [StorageAdminStats](#interface-storageadminstats) |
|
|
17
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [StorageCreateActionResult](#interface-storagecreateactionresult) |
|
|
18
|
+
| [BitailsConfig](#interface-bitailsconfig) | [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) |
|
|
19
|
+
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [GetScriptHashHistory](#interface-getscripthashhistory) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) |
|
|
20
|
+
| [BlockHeader](#interface-blockheader) | [GetScriptHashHistoryResult](#interface-getscripthashhistoryresult) | [StorageFeeModel](#interface-storagefeemodel) |
|
|
21
|
+
| [BsvExchangeRate](#interface-bsvexchangerate) | [GetStatusForTxidsResult](#interface-getstatusfortxidsresult) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) |
|
|
22
|
+
| [BulkFileDataManagerMergeResult](#interface-bulkfiledatamanagermergeresult) | [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [StorageIdbOptions](#interface-storageidboptions) |
|
|
23
|
+
| [BulkFileDataManagerOptions](#interface-bulkfiledatamanageroptions) | [GetUtxoStatusResult](#interface-getutxostatusresult) | [StorageIdbSchema](#interface-storageidbschema) |
|
|
24
|
+
| [BulkHeaderFileInfo](#interface-bulkheaderfileinfo) | [GroupedPermissionRequest](#interface-groupedpermissionrequest) | [StorageIdentity](#interface-storageidentity) |
|
|
25
|
+
| [BulkHeaderFilesInfo](#interface-bulkheaderfilesinfo) | [GroupedPermissions](#interface-groupedpermissions) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) |
|
|
26
|
+
| [BulkIngestorApi](#interface-bulkingestorapi) | [HeightRangeApi](#interface-heightrangeapi) | [StorageProcessActionArgs](#interface-storageprocessactionargs) |
|
|
27
|
+
| [BulkIngestorBaseOptions](#interface-bulkingestorbaseoptions) | [HeightRanges](#interface-heightranges) | [StorageProcessActionResults](#interface-storageprocessactionresults) |
|
|
28
|
+
| [BulkIngestorCDNOptions](#interface-bulkingestorcdnoptions) | [KdfConfig](#interface-kdfconfig) | [StorageProvenOrReq](#interface-storageprovenorreq) |
|
|
29
|
+
| [BulkIngestorWhatsOnChainOptions](#interface-bulkingestorwhatsonchainoptions) | [KeyPair](#interface-keypair) | [StorageProviderOptions](#interface-storageprovideroptions) |
|
|
30
|
+
| [BulkStorageApi](#interface-bulkstorageapi) | [KeyPairAddress](#interface-keypairaddress) | [StorageReaderOptions](#interface-storagereaderoptions) |
|
|
31
|
+
| [BulkStorageBaseOptions](#interface-bulkstoragebaseoptions) | [ListActionsSpecOp](#interface-listactionsspecop) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) |
|
|
32
|
+
| [BulkSyncResult](#interface-bulksyncresult) | [ListOutputsSpecOp](#interface-listoutputsspecop) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) |
|
|
33
|
+
| [CertOpsWallet](#interface-certopswallet) | [LiveBlockHeader](#interface-liveblockheader) | [SyncChunk](#interface-syncchunk) |
|
|
34
|
+
| [Certifier](#interface-certifier) | [LiveIngestorApi](#interface-liveingestorapi) | [SyncError](#interface-syncerror) |
|
|
35
|
+
| [ChaintracksApi](#interface-chaintracksapi) | [LiveIngestorBaseOptions](#interface-liveingestorbaseoptions) | [SyncMap](#interface-syncmap) |
|
|
36
|
+
| [ChaintracksAppendableFileApi](#interface-chaintracksappendablefileapi) | [LiveIngestorWhatsOnChainOptions](#interface-liveingestorwhatsonchainoptions) | [TableCertificate](#interface-tablecertificate) |
|
|
37
|
+
| [ChaintracksChainTrackerOptions](#interface-chaintrackschaintrackeroptions) | [MerklePathNote](#interface-merklepathnote) | [TableCertificateField](#interface-tablecertificatefield) |
|
|
38
|
+
| [ChaintracksClientApi](#interface-chaintracksclientapi) | [MockChainBlockHeaderRow](#interface-mockchainblockheaderrow) | [TableCertificateX](#interface-tablecertificatex) |
|
|
39
|
+
| [ChaintracksFetchApi](#interface-chaintracksfetchapi) | [MockChainTransactionRow](#interface-mockchaintransactionrow) | [TableCommission](#interface-tablecommission) |
|
|
40
|
+
| [ChaintracksFsApi](#interface-chaintracksfsapi) | [MockChainUtxoRow](#interface-mockchainutxorow) | [TableMonitorEvent](#interface-tablemonitorevent) |
|
|
41
|
+
| [ChaintracksInfoApi](#interface-chaintracksinfoapi) | [MonitorOptions](#interface-monitoroptions) | [TableOutput](#interface-tableoutput) |
|
|
42
|
+
| [ChaintracksIngestorParams](#interface-chaintracksingestorparams) | [OutPoint](#interface-outpoint) | [TableOutputBasket](#interface-tableoutputbasket) |
|
|
43
|
+
| [ChaintracksManagementApi](#interface-chaintracksmanagementapi) | [Paged](#interface-paged) | [TableOutputTag](#interface-tableoutputtag) |
|
|
44
|
+
| [ChaintracksOptions](#interface-chaintracksoptions) | [ParsedBrc114ActionTimeLabels](#interface-parsedbrc114actiontimelabels) | [TableOutputTagMap](#interface-tableoutputtagmap) |
|
|
45
|
+
| [ChaintracksPackageInfoApi](#interface-chaintrackspackageinfoapi) | [ParsedOutpoint](#interface-parsedoutpoint) | [TableOutputX](#interface-tableoutputx) |
|
|
46
|
+
| [ChaintracksReadableFileApi](#interface-chaintracksreadablefileapi) | [PendingSignAction](#interface-pendingsignaction) | [TableProvenTx](#interface-tableproventx) |
|
|
47
|
+
| [ChaintracksServiceClientOptions](#interface-chaintracksserviceclientoptions) | [PendingStorageInput](#interface-pendingstorageinput) | [TableProvenTxReq](#interface-tableproventxreq) |
|
|
48
|
+
| [ChaintracksStorageApi](#interface-chaintracksstorageapi) | [PermissionRequest](#interface-permissionrequest) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
|
|
49
|
+
| [ChaintracksStorageBaseOptions](#interface-chaintracksstoragebaseoptions) | [PermissionToken](#interface-permissiontoken) | [TableSettings](#interface-tablesettings) |
|
|
50
|
+
| [ChaintracksStorageBulkFileApi](#interface-chaintracksstoragebulkfileapi) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TableSyncState](#interface-tablesyncstate) |
|
|
51
|
+
| [ChaintracksStorageIdbOptions](#interface-chaintracksstorageidboptions) | [PermissionsModule](#interface-permissionsmodule) | [TableTransaction](#interface-tabletransaction) |
|
|
52
|
+
| [ChaintracksStorageIdbSchema](#interface-chaintracksstorageidbschema) | [PostBeefResult](#interface-postbeefresult) | [TableTxLabel](#interface-tabletxlabel) |
|
|
53
|
+
| [ChaintracksStorageIngestApi](#interface-chaintracksstorageingestapi) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TableTxLabelMap](#interface-tabletxlabelmap) |
|
|
54
|
+
| [ChaintracksStorageNoDbOptions](#interface-chaintracksstoragenodboptions) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TableUser](#interface-tableuser) |
|
|
55
|
+
| [ChaintracksStorageQueryApi](#interface-chaintracksstoragequeryapi) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TaskPurgeParams](#interface-taskpurgeparams) |
|
|
56
|
+
| [ChaintracksWritableFileApi](#interface-chaintrackswritablefileapi) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TrustSettings](#interface-trustsettings) |
|
|
57
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [TrxToken](#interface-trxtoken) |
|
|
58
|
+
| [CompleteAuthResponse](#interface-completeauthresponse) | [PostTxsResult](#interface-posttxsresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
|
|
59
|
+
| [CounterpartyPermissionRequest](#interface-counterpartypermissionrequest) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [TxScriptOffsets](#interface-txscriptoffsets) |
|
|
60
|
+
| [CounterpartyPermissions](#interface-counterpartypermissions) | [Profile](#interface-profile) | [UMPToken](#interface-umptoken) |
|
|
61
|
+
| [CreateActionResultX](#interface-createactionresultx) | [ProvenOrRawTx](#interface-provenorrawtx) | [UMPTokenInteractor](#interface-umptokeninteractor) |
|
|
62
|
+
| [DeactivedHeader](#interface-deactivedheader) | [ProvenTransactionStatus](#interface-proventransactionstatus) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
|
|
63
|
+
| [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
|
|
64
|
+
| [EntityTimeStamp](#interface-entitytimestamp) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
|
|
65
|
+
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [VerifyAndRepairBeefResult](#interface-verifyandrepairbeefresult) |
|
|
66
|
+
| [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [WalletArgs](#interface-walletargs) |
|
|
67
|
+
| [FiatExchangeRates](#interface-fiatexchangerates) | [ProviderCallHistory](#interface-providercallhistory) | [WalletBalance](#interface-walletbalance) |
|
|
68
|
+
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [PurgeParams](#interface-purgeparams) | [WalletLoggerArgs](#interface-walletloggerargs) |
|
|
69
|
+
| [FindCertificatesArgs](#interface-findcertificatesargs) | [PurgeResults](#interface-purgeresults) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
|
|
70
|
+
| [FindCommissionsArgs](#interface-findcommissionsargs) | [ReorgResult](#interface-reorgresult) | [WalletServices](#interface-walletservices) |
|
|
71
|
+
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [ReproveHeaderResult](#interface-reproveheaderresult) | [WalletServicesOptions](#interface-walletservicesoptions) |
|
|
72
|
+
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [ReproveProvenResult](#interface-reproveprovenresult) | [WalletSettings](#interface-walletsettings) |
|
|
73
|
+
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [ReqHistoryNote](#interface-reqhistorynote) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
|
|
74
|
+
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [WalletSigner](#interface-walletsigner) |
|
|
75
|
+
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [ReviewActionResult](#interface-reviewactionresult) | [WalletStorage](#interface-walletstorage) |
|
|
76
|
+
| [FindOutputsArgs](#interface-findoutputsargs) | [ReviewHeightRangeResult](#interface-reviewheightrangeresult) | [WalletStorageInfo](#interface-walletstorageinfo) |
|
|
77
|
+
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [ScriptHashHistoryResponse](#interface-scripthashhistoryresponse) | [WalletStorageProvider](#interface-walletstorageprovider) |
|
|
78
|
+
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
79
|
+
| [FindProvenTxsArgs](#interface-findproventxsargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
80
|
+
| [FindSincePagedArgs](#interface-findsincepagedargs) | [ServiceCall](#interface-servicecall) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
|
|
81
|
+
| [FindStaleMerkleRootsArgs](#interface-findstalemerklerootsargs) | [ServiceCall](#interface-servicecall) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
82
|
+
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [ServiceCallHistory](#interface-servicecallhistory) | [WalletTheme](#interface-wallettheme) |
|
|
83
|
+
| [FindTransactionsArgs](#interface-findtransactionsargs) | [ServiceCallHistoryCounts](#interface-servicecallhistorycounts) | [WhatsOnChainServicesOptions](#interface-whatsonchainservicesoptions) |
|
|
84
|
+
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [ServiceToCall](#interface-servicetocall) | [WocChainInfo](#interface-wocchaininfo) |
|
|
85
|
+
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [ServicesCallHistory](#interface-servicescallhistory) | [WocGetHeaderByteFileLinks](#interface-wocgetheaderbytefilelinks) |
|
|
86
|
+
| [FindUsersArgs](#interface-findusersargs) | [SetupClientWalletArgs](#interface-setupclientwalletargs) | [WocGetHeadersHeader](#interface-wocgetheadersheader) |
|
|
87
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [SetupClientWalletClientArgs](#interface-setupclientwalletclientargs) | [WocHeader](#interface-wocheader) |
|
|
88
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [SetupWallet](#interface-setupwallet) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
87
89
|
|
|
88
90
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
89
91
|
|
|
@@ -98,7 +100,36 @@ export interface AdminStatsResult extends StorageAdminStats {
|
|
|
98
100
|
}
|
|
99
101
|
```
|
|
100
102
|
|
|
101
|
-
See also: [ServicesCallHistory](./client.md#
|
|
103
|
+
See also: [ServicesCallHistory](./client.md#interface-servicescallhistory), [StorageAdminStats](./storage.md#interface-storageadminstats)
|
|
104
|
+
|
|
105
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
##### Interface: AggregatePostBeefTxResult
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
export interface AggregatePostBeefTxResult {
|
|
112
|
+
txid: string;
|
|
113
|
+
txidResults: sdk.PostTxResultForTxid[];
|
|
114
|
+
status: AggregateStatus;
|
|
115
|
+
vreq: PostReqsToNetworkDetails;
|
|
116
|
+
successCount: number;
|
|
117
|
+
doubleSpendCount: number;
|
|
118
|
+
statusErrorCount: number;
|
|
119
|
+
serviceErrorCount: number;
|
|
120
|
+
competingTxs: string[];
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
See also: [PostReqsToNetworkDetails](./storage.md#interface-postreqstonetworkdetails), [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
125
|
+
|
|
126
|
+
###### Property competingTxs
|
|
127
|
+
|
|
128
|
+
Any competing double spend txids reported for this txid
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
competingTxs: string[]
|
|
132
|
+
```
|
|
102
133
|
|
|
103
134
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
104
135
|
|
|
@@ -1128,9 +1159,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1128
1159
|
|
|
1129
1160
|
```ts
|
|
1130
1161
|
export interface CertOpsWallet {
|
|
1131
|
-
getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes)
|
|
1132
|
-
encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes)
|
|
1133
|
-
decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes)
|
|
1162
|
+
getPublicKey: (args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetPublicKeyResult>;
|
|
1163
|
+
encrypt: (args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletEncryptResult>;
|
|
1164
|
+
decrypt: (args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletDecryptResult>;
|
|
1134
1165
|
}
|
|
1135
1166
|
```
|
|
1136
1167
|
|
|
@@ -3099,7 +3130,7 @@ export interface GetMerklePathResult {
|
|
|
3099
3130
|
}
|
|
3100
3131
|
```
|
|
3101
3132
|
|
|
3102
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [ReqHistoryNote](./client.md#
|
|
3133
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [ReqHistoryNote](./client.md#interface-reqhistorynote), [WalletError](./client.md#class-walleterror)
|
|
3103
3134
|
|
|
3104
3135
|
###### Property error
|
|
3105
3136
|
|
|
@@ -3591,7 +3622,7 @@ export interface ListActionsSpecOp {
|
|
|
3591
3622
|
name: string;
|
|
3592
3623
|
labelsToIntercept?: string[];
|
|
3593
3624
|
setStatusFilter?: () => TransactionStatus[];
|
|
3594
|
-
postProcess?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction
|
|
3625
|
+
postProcess?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Array<Partial<TableTransaction>>) => Promise<void>;
|
|
3595
3626
|
}
|
|
3596
3627
|
```
|
|
3597
3628
|
|
|
@@ -3861,6 +3892,26 @@ userAgent: string
|
|
|
3861
3892
|
|
|
3862
3893
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3863
3894
|
|
|
3895
|
+
---
|
|
3896
|
+
##### Interface: MerklePathNote
|
|
3897
|
+
|
|
3898
|
+
```ts
|
|
3899
|
+
export interface MerklePathNote {
|
|
3900
|
+
what: MerklePathNoteWhat;
|
|
3901
|
+
name: string;
|
|
3902
|
+
status?: number;
|
|
3903
|
+
statusText?: string;
|
|
3904
|
+
target?: string;
|
|
3905
|
+
code?: string;
|
|
3906
|
+
description?: string;
|
|
3907
|
+
[key: string]: boolean | string | number | undefined;
|
|
3908
|
+
}
|
|
3909
|
+
```
|
|
3910
|
+
|
|
3911
|
+
See also: [MerklePathNoteWhat](./services.md#type-merklepathnotewhat)
|
|
3912
|
+
|
|
3913
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3914
|
+
|
|
3864
3915
|
---
|
|
3865
3916
|
##### Interface: MockChainBlockHeaderRow
|
|
3866
3917
|
|
|
@@ -3932,6 +3983,7 @@ export interface MonitorOptions {
|
|
|
3932
3983
|
abandonedMsecs: number;
|
|
3933
3984
|
unprovenAttemptsLimitTest: number;
|
|
3934
3985
|
unprovenAttemptsLimitMain: number;
|
|
3986
|
+
maxRebroadcastAttempts: number;
|
|
3935
3987
|
callbackToken?: string;
|
|
3936
3988
|
loadLastSSEEventId?: () => Promise<string | undefined>;
|
|
3937
3989
|
saveLastSSEEventId?: (lastEventId: string) => Promise<void>;
|
|
@@ -3971,6 +4023,19 @@ Load persisted SSE lastEventId (e.g. from SQLite) for catchup on startup
|
|
|
3971
4023
|
loadLastSSEEventId?: () => Promise<string | undefined>
|
|
3972
4024
|
```
|
|
3973
4025
|
|
|
4026
|
+
###### Property maxRebroadcastAttempts
|
|
4027
|
+
|
|
4028
|
+
Maximum number of times a broadcast transaction may be reset to 'unsent' for
|
|
4029
|
+
rebroadcast after proof check timeout (circuit breaker).
|
|
4030
|
+
|
|
4031
|
+
Default 0 means unlimited — the tx is rebroadcast indefinitely until a proof
|
|
4032
|
+
is found. Set to a positive integer to cap rebroadcast cycles; once the limit
|
|
4033
|
+
is reached the req is marked 'invalid'.
|
|
4034
|
+
|
|
4035
|
+
```ts
|
|
4036
|
+
maxRebroadcastAttempts: number
|
|
4037
|
+
```
|
|
4038
|
+
|
|
3974
4039
|
###### Property msecsWaitPerMerkleProofServiceReq
|
|
3975
4040
|
|
|
3976
4041
|
How many msecs to wait after each getMerkleProof service request.
|
|
@@ -4040,6 +4105,20 @@ export interface Paged {
|
|
|
4040
4105
|
|
|
4041
4106
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4042
4107
|
|
|
4108
|
+
---
|
|
4109
|
+
##### Interface: ParsedBrc114ActionTimeLabels
|
|
4110
|
+
|
|
4111
|
+
```ts
|
|
4112
|
+
export interface ParsedBrc114ActionTimeLabels {
|
|
4113
|
+
from?: number;
|
|
4114
|
+
to?: number;
|
|
4115
|
+
timeFilterRequested: boolean;
|
|
4116
|
+
remainingLabels: string[];
|
|
4117
|
+
}
|
|
4118
|
+
```
|
|
4119
|
+
|
|
4120
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4121
|
+
|
|
4043
4122
|
---
|
|
4044
4123
|
##### Interface: ParsedOutpoint
|
|
4045
4124
|
|
|
@@ -4122,7 +4201,7 @@ export interface PermissionRequest {
|
|
|
4122
4201
|
spending?: {
|
|
4123
4202
|
satoshis: number;
|
|
4124
4203
|
lineItems?: Array<{
|
|
4125
|
-
type:
|
|
4204
|
+
type: LineItemType;
|
|
4126
4205
|
description: string;
|
|
4127
4206
|
satoshis: number;
|
|
4128
4207
|
}>;
|
|
@@ -4133,7 +4212,7 @@ export interface PermissionRequest {
|
|
|
4133
4212
|
}
|
|
4134
4213
|
```
|
|
4135
4214
|
|
|
4136
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
4215
|
+
See also: [LineItemType](./client.md#type-lineitemtype), [PermissionToken](./client.md#interface-permissiontoken)
|
|
4137
4216
|
|
|
4138
4217
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4139
4218
|
|
|
@@ -4162,7 +4241,7 @@ export interface PermissionToken {
|
|
|
4162
4241
|
expiry: number;
|
|
4163
4242
|
privileged?: boolean;
|
|
4164
4243
|
protocol?: string;
|
|
4165
|
-
securityLevel?:
|
|
4244
|
+
securityLevel?: SecurityLevel;
|
|
4166
4245
|
counterparty?: string;
|
|
4167
4246
|
basketName?: string;
|
|
4168
4247
|
certType?: string;
|
|
@@ -4172,6 +4251,8 @@ export interface PermissionToken {
|
|
|
4172
4251
|
}
|
|
4173
4252
|
```
|
|
4174
4253
|
|
|
4254
|
+
See also: [SecurityLevel](./client.md#type-securitylevel)
|
|
4255
|
+
|
|
4175
4256
|
###### Property authorizedAmount
|
|
4176
4257
|
|
|
4177
4258
|
For DSAP, the maximum authorized spending for the month.
|
|
@@ -4283,8 +4364,9 @@ satoshis: number
|
|
|
4283
4364
|
The security level (0,1,2) for DPACP.
|
|
4284
4365
|
|
|
4285
4366
|
```ts
|
|
4286
|
-
securityLevel?:
|
|
4367
|
+
securityLevel?: SecurityLevel
|
|
4287
4368
|
```
|
|
4369
|
+
See also: [SecurityLevel](./client.md#type-securitylevel)
|
|
4288
4370
|
|
|
4289
4371
|
###### Property tx
|
|
4290
4372
|
|
|
@@ -4564,66 +4646,46 @@ Modules are registered in the config mapped by their scheme ID.
|
|
|
4564
4646
|
|
|
4565
4647
|
```ts
|
|
4566
4648
|
export interface PermissionsModule {
|
|
4567
|
-
onRequest(req: {
|
|
4649
|
+
onRequest: (req: {
|
|
4568
4650
|
method: string;
|
|
4569
4651
|
args: object;
|
|
4570
4652
|
originator: string;
|
|
4571
|
-
})
|
|
4653
|
+
}) => Promise<{
|
|
4572
4654
|
args: object;
|
|
4573
4655
|
}>;
|
|
4574
|
-
onResponse(res: any, context: {
|
|
4656
|
+
onResponse: (res: any, context: {
|
|
4575
4657
|
method: string;
|
|
4576
4658
|
originator: string;
|
|
4577
|
-
})
|
|
4659
|
+
}) => Promise<any>;
|
|
4578
4660
|
}
|
|
4579
4661
|
```
|
|
4580
4662
|
|
|
4581
|
-
######
|
|
4663
|
+
###### Property onRequest
|
|
4582
4664
|
|
|
4583
4665
|
Transforms the request before it's passed to the underlying wallet.
|
|
4584
4666
|
Can check and enforce permissions, throw errors, or modify any arguments as needed prior to invocation.
|
|
4585
4667
|
|
|
4586
4668
|
```ts
|
|
4587
|
-
onRequest(req: {
|
|
4669
|
+
onRequest: (req: {
|
|
4588
4670
|
method: string;
|
|
4589
4671
|
args: object;
|
|
4590
4672
|
originator: string;
|
|
4591
|
-
})
|
|
4673
|
+
}) => Promise<{
|
|
4592
4674
|
args: object;
|
|
4593
4675
|
}>
|
|
4594
4676
|
```
|
|
4595
4677
|
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
Transformed arguments that will be passed to the underlying wallet
|
|
4599
|
-
|
|
4600
|
-
Argument Details
|
|
4601
|
-
|
|
4602
|
-
+ **req**
|
|
4603
|
-
+ The incoming request with method, args, and originator
|
|
4604
|
-
|
|
4605
|
-
###### Method onResponse
|
|
4678
|
+
###### Property onResponse
|
|
4606
4679
|
|
|
4607
4680
|
Transforms the response from the underlying wallet before returning to caller.
|
|
4608
4681
|
|
|
4609
4682
|
```ts
|
|
4610
|
-
onResponse(res: any, context: {
|
|
4683
|
+
onResponse: (res: any, context: {
|
|
4611
4684
|
method: string;
|
|
4612
4685
|
originator: string;
|
|
4613
|
-
})
|
|
4686
|
+
}) => Promise<any>
|
|
4614
4687
|
```
|
|
4615
4688
|
|
|
4616
|
-
Returns
|
|
4617
|
-
|
|
4618
|
-
Transformed response to return to the caller
|
|
4619
|
-
|
|
4620
|
-
Argument Details
|
|
4621
|
-
|
|
4622
|
-
+ **res**
|
|
4623
|
-
+ The response from the underlying wallet
|
|
4624
|
-
+ **context**
|
|
4625
|
-
+ Metadata about the original request (method, originator)
|
|
4626
|
-
|
|
4627
4689
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4628
4690
|
|
|
4629
4691
|
---
|
|
@@ -4733,7 +4795,7 @@ export interface PostTxResultForTxid {
|
|
|
4733
4795
|
}
|
|
4734
4796
|
```
|
|
4735
4797
|
|
|
4736
|
-
See also: [PostTxResultForTxidError](./client.md#interface-posttxresultfortxiderror), [ReqHistoryNote](./client.md#
|
|
4798
|
+
See also: [PostTxResultForTxidError](./client.md#interface-posttxresultfortxiderror), [ReqHistoryNote](./client.md#interface-reqhistorynote), [blockHash](./services.md#function-blockhash)
|
|
4737
4799
|
|
|
4738
4800
|
###### Property alreadyKnown
|
|
4739
4801
|
|
|
@@ -4801,7 +4863,7 @@ export interface PostTxsResult {
|
|
|
4801
4863
|
}
|
|
4802
4864
|
```
|
|
4803
4865
|
|
|
4804
|
-
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid), [ReqHistoryNote](./client.md#
|
|
4866
|
+
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid), [ReqHistoryNote](./client.md#interface-reqhistorynote), [WalletError](./client.md#class-walleterror)
|
|
4805
4867
|
|
|
4806
4868
|
###### Property data
|
|
4807
4869
|
|
|
@@ -4962,7 +5024,7 @@ export interface ProvenTxReqHistory {
|
|
|
4962
5024
|
}
|
|
4963
5025
|
```
|
|
4964
5026
|
|
|
4965
|
-
See also: [ReqHistoryNote](./client.md#
|
|
5027
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
4966
5028
|
|
|
4967
5029
|
###### Property notes
|
|
4968
5030
|
|
|
@@ -4972,7 +5034,7 @@ Values are a description of what happened.
|
|
|
4972
5034
|
```ts
|
|
4973
5035
|
notes?: ReqHistoryNote[]
|
|
4974
5036
|
```
|
|
4975
|
-
See also: [ReqHistoryNote](./client.md#
|
|
5037
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
4976
5038
|
|
|
4977
5039
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4978
5040
|
|
|
@@ -5130,11 +5192,11 @@ Returned results from WalletStorageManager reproveHeader method.
|
|
|
5130
5192
|
```ts
|
|
5131
5193
|
export interface ReproveHeaderResult {
|
|
5132
5194
|
log: string;
|
|
5133
|
-
updated: {
|
|
5195
|
+
updated: Array<{
|
|
5134
5196
|
was: TableProvenTx;
|
|
5135
5197
|
update: Partial<TableProvenTx>;
|
|
5136
5198
|
logUpdate: string;
|
|
5137
|
-
}
|
|
5199
|
+
}>;
|
|
5138
5200
|
unchanged: TableProvenTx[];
|
|
5139
5201
|
unavailable: TableProvenTx[];
|
|
5140
5202
|
}
|
|
@@ -5173,11 +5235,11 @@ See also: [TableProvenTx](./storage.md#interface-tableproventx)
|
|
|
5173
5235
|
List of proven_txs records that were updated with new proof data.
|
|
5174
5236
|
|
|
5175
5237
|
```ts
|
|
5176
|
-
updated: {
|
|
5238
|
+
updated: Array<{
|
|
5177
5239
|
was: TableProvenTx;
|
|
5178
5240
|
update: Partial<TableProvenTx>;
|
|
5179
5241
|
logUpdate: string;
|
|
5180
|
-
}
|
|
5242
|
+
}>
|
|
5181
5243
|
```
|
|
5182
5244
|
See also: [TableProvenTx](./storage.md#interface-tableproventx)
|
|
5183
5245
|
|
|
@@ -5240,6 +5302,19 @@ See also: [TableProvenTx](./storage.md#interface-tableproventx)
|
|
|
5240
5302
|
|
|
5241
5303
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5242
5304
|
|
|
5305
|
+
---
|
|
5306
|
+
##### Interface: ReqHistoryNote
|
|
5307
|
+
|
|
5308
|
+
```ts
|
|
5309
|
+
export interface ReqHistoryNote {
|
|
5310
|
+
when?: string;
|
|
5311
|
+
what: string;
|
|
5312
|
+
[key: string]: boolean | string | number | undefined;
|
|
5313
|
+
}
|
|
5314
|
+
```
|
|
5315
|
+
|
|
5316
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5317
|
+
|
|
5243
5318
|
---
|
|
5244
5319
|
##### Interface: RequestSyncChunkArgs
|
|
5245
5320
|
|
|
@@ -5251,10 +5326,10 @@ export interface RequestSyncChunkArgs {
|
|
|
5251
5326
|
since?: Date;
|
|
5252
5327
|
maxRoughSize: number;
|
|
5253
5328
|
maxItems: number;
|
|
5254
|
-
offsets: {
|
|
5329
|
+
offsets: Array<{
|
|
5255
5330
|
name: string;
|
|
5256
5331
|
offset: number;
|
|
5257
|
-
}
|
|
5332
|
+
}>;
|
|
5258
5333
|
}
|
|
5259
5334
|
```
|
|
5260
5335
|
|
|
@@ -5311,10 +5386,10 @@ The entity order is:
|
|
|
5311
5386
|
11 CertificateFields
|
|
5312
5387
|
|
|
5313
5388
|
```ts
|
|
5314
|
-
offsets: {
|
|
5389
|
+
offsets: Array<{
|
|
5315
5390
|
name: string;
|
|
5316
5391
|
offset: number;
|
|
5317
|
-
}
|
|
5392
|
+
}>
|
|
5318
5393
|
```
|
|
5319
5394
|
|
|
5320
5395
|
###### Property since
|
|
@@ -5385,6 +5460,26 @@ export interface ReviewHeightRangeResult {
|
|
|
5385
5460
|
|
|
5386
5461
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5387
5462
|
|
|
5463
|
+
---
|
|
5464
|
+
##### Interface: ScriptHashHistoryResponse
|
|
5465
|
+
|
|
5466
|
+
```ts
|
|
5467
|
+
export interface ScriptHashHistoryResponse {
|
|
5468
|
+
ok: boolean;
|
|
5469
|
+
status: number;
|
|
5470
|
+
statusText: string;
|
|
5471
|
+
data?: {
|
|
5472
|
+
result: Array<{
|
|
5473
|
+
tx_hash: string;
|
|
5474
|
+
height?: number;
|
|
5475
|
+
}>;
|
|
5476
|
+
error?: string;
|
|
5477
|
+
};
|
|
5478
|
+
}
|
|
5479
|
+
```
|
|
5480
|
+
|
|
5481
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5482
|
+
|
|
5388
5483
|
---
|
|
5389
5484
|
##### Interface: ScriptTemplateParamsBRC29
|
|
5390
5485
|
|
|
@@ -5611,6 +5706,28 @@ See also: [ServiceCall](./services.md#interface-servicecall)
|
|
|
5611
5706
|
|
|
5612
5707
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5613
5708
|
|
|
5709
|
+
---
|
|
5710
|
+
##### Interface: ServicesCallHistory
|
|
5711
|
+
|
|
5712
|
+
Type for the service call history returned by Services.getServicesCallHistory.
|
|
5713
|
+
|
|
5714
|
+
```ts
|
|
5715
|
+
export interface ServicesCallHistory {
|
|
5716
|
+
version: number;
|
|
5717
|
+
getMerklePath: ServiceCallHistory;
|
|
5718
|
+
getRawTx: ServiceCallHistory;
|
|
5719
|
+
postBeef: ServiceCallHistory;
|
|
5720
|
+
getUtxoStatus: ServiceCallHistory;
|
|
5721
|
+
getStatusForTxids: ServiceCallHistory;
|
|
5722
|
+
getScriptHashHistory: ServiceCallHistory;
|
|
5723
|
+
updateFiatExchangeRates: ServiceCallHistory;
|
|
5724
|
+
}
|
|
5725
|
+
```
|
|
5726
|
+
|
|
5727
|
+
See also: [ServiceCallHistory](./client.md#interface-servicecallhistory)
|
|
5728
|
+
|
|
5729
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5730
|
+
|
|
5614
5731
|
---
|
|
5615
5732
|
##### Interface: SetupClientWalletArgs
|
|
5616
5733
|
|
|
@@ -5919,6 +6036,17 @@ status: "mined" | "known" | "unknown"
|
|
|
5919
6036
|
|
|
5920
6037
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5921
6038
|
|
|
6039
|
+
---
|
|
6040
|
+
##### Interface: StopListenerToken
|
|
6041
|
+
|
|
6042
|
+
```ts
|
|
6043
|
+
export interface StopListenerToken {
|
|
6044
|
+
stop: (() => void) | undefined;
|
|
6045
|
+
}
|
|
6046
|
+
```
|
|
6047
|
+
|
|
6048
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6049
|
+
|
|
5922
6050
|
---
|
|
5923
6051
|
##### Interface: StorageAdminStats
|
|
5924
6052
|
|
|
@@ -6874,6 +7002,8 @@ export interface TableProvenTxReq extends TableProvenTxReqDynamics {
|
|
|
6874
7002
|
notify: string;
|
|
6875
7003
|
rawTx: number[];
|
|
6876
7004
|
inputBEEF?: number[];
|
|
7005
|
+
wasBroadcast?: boolean;
|
|
7006
|
+
rebroadcastAttempts?: number;
|
|
6877
7007
|
}
|
|
6878
7008
|
```
|
|
6879
7009
|
|
|
@@ -6921,6 +7051,27 @@ Parses to `ProvenTxReqNotifyApi`.
|
|
|
6921
7051
|
notify: string
|
|
6922
7052
|
```
|
|
6923
7053
|
|
|
7054
|
+
###### Property rebroadcastAttempts
|
|
7055
|
+
|
|
7056
|
+
Count of how many times this req has been reset to 'unsent' for rebroadcast
|
|
7057
|
+
after proof check timeout. Used by the circuit-breaker (maxRebroadcastAttempts).
|
|
7058
|
+
Defaults to 0 (added by migration 2026-04-30-001).
|
|
7059
|
+
|
|
7060
|
+
```ts
|
|
7061
|
+
rebroadcastAttempts?: number
|
|
7062
|
+
```
|
|
7063
|
+
|
|
7064
|
+
###### Property wasBroadcast
|
|
7065
|
+
|
|
7066
|
+
Set to true the first time this req transitions to 'unmined' or 'callback' status,
|
|
7067
|
+
indicating the transaction was successfully broadcast to the network.
|
|
7068
|
+
Used to distinguish rebroadcast candidates from transactions that were never sent.
|
|
7069
|
+
Defaults to false (added by migration 2026-04-30-001).
|
|
7070
|
+
|
|
7071
|
+
```ts
|
|
7072
|
+
wasBroadcast?: boolean
|
|
7073
|
+
```
|
|
7074
|
+
|
|
6924
7075
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6925
7076
|
|
|
6926
7077
|
---
|
|
@@ -6938,6 +7089,8 @@ export interface TableProvenTxReqDynamics extends sdk.EntityTimeStamp {
|
|
|
6938
7089
|
batch?: string;
|
|
6939
7090
|
history: string;
|
|
6940
7091
|
notify: string;
|
|
7092
|
+
wasBroadcast?: boolean;
|
|
7093
|
+
rebroadcastAttempts?: number;
|
|
6941
7094
|
}
|
|
6942
7095
|
```
|
|
6943
7096
|
|
|
@@ -6985,6 +7138,24 @@ Parses to `ProvenTxReqNotifyApi`.
|
|
|
6985
7138
|
notify: string
|
|
6986
7139
|
```
|
|
6987
7140
|
|
|
7141
|
+
###### Property rebroadcastAttempts
|
|
7142
|
+
|
|
7143
|
+
Count of rebroadcast cycles for this req. Used by the circuit-breaker.
|
|
7144
|
+
Defaults to 0 (added by migration 2026-04-30-001).
|
|
7145
|
+
|
|
7146
|
+
```ts
|
|
7147
|
+
rebroadcastAttempts?: number
|
|
7148
|
+
```
|
|
7149
|
+
|
|
7150
|
+
###### Property wasBroadcast
|
|
7151
|
+
|
|
7152
|
+
Set to true the first time this req transitions to 'unmined' or 'callback' status.
|
|
7153
|
+
Defaults to false (added by migration 2026-04-30-001).
|
|
7154
|
+
|
|
7155
|
+
```ts
|
|
7156
|
+
wasBroadcast?: boolean
|
|
7157
|
+
```
|
|
7158
|
+
|
|
6988
7159
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6989
7160
|
|
|
6990
7161
|
---
|
|
@@ -7260,16 +7431,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7260
7431
|
|
|
7261
7432
|
```ts
|
|
7262
7433
|
export interface TxScriptOffsets {
|
|
7263
|
-
inputs: {
|
|
7434
|
+
inputs: Array<{
|
|
7264
7435
|
vin: number;
|
|
7265
7436
|
offset: number;
|
|
7266
7437
|
length: number;
|
|
7267
|
-
}
|
|
7268
|
-
outputs: {
|
|
7438
|
+
}>;
|
|
7439
|
+
outputs: Array<{
|
|
7269
7440
|
vout: number;
|
|
7270
7441
|
offset: number;
|
|
7271
7442
|
length: number;
|
|
7272
|
-
}
|
|
7443
|
+
}>;
|
|
7273
7444
|
}
|
|
7274
7445
|
```
|
|
7275
7446
|
|
|
@@ -7593,10 +7764,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7593
7764
|
```ts
|
|
7594
7765
|
export interface WalletBalance {
|
|
7595
7766
|
total: number;
|
|
7596
|
-
utxos: {
|
|
7767
|
+
utxos: Array<{
|
|
7597
7768
|
satoshis: number;
|
|
7598
7769
|
outpoint: string;
|
|
7599
|
-
}
|
|
7770
|
+
}>;
|
|
7600
7771
|
}
|
|
7601
7772
|
```
|
|
7602
7773
|
|
|
@@ -7694,27 +7865,27 @@ Defines standard interfaces to access functionality implemented by external tran
|
|
|
7694
7865
|
```ts
|
|
7695
7866
|
export interface WalletServices {
|
|
7696
7867
|
chain: Chain;
|
|
7697
|
-
getChainTracker()
|
|
7698
|
-
getHeaderForHeight(height: number)
|
|
7699
|
-
getHeight()
|
|
7700
|
-
getBsvExchangeRate()
|
|
7701
|
-
getFiatExchangeRate(currency: FiatCurrencyCode, base?: FiatCurrencyCode)
|
|
7702
|
-
getRawTx(txid: string, useNext?: boolean)
|
|
7703
|
-
getMerklePath(txid: string, useNext?: boolean)
|
|
7704
|
-
postBeef(beef: Beef, txids: string[], logger?: WalletLoggerInterface)
|
|
7705
|
-
hashOutputScript(script: string)
|
|
7706
|
-
getStatusForTxids(txids: string[], useNext?: boolean)
|
|
7707
|
-
isUtxo(output: TableOutput)
|
|
7708
|
-
getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean)
|
|
7709
|
-
getScriptHashHistory(hash: string, useNext?: boolean, logger?: WalletLoggerInterface)
|
|
7710
|
-
hashToHeader(hash: string)
|
|
7711
|
-
nLockTimeIsFinal(txOrLockTime: string | number[] | BsvTransaction | number)
|
|
7712
|
-
getBeefForTxid(txid: string)
|
|
7713
|
-
getServicesCallHistory(reset?: boolean)
|
|
7714
|
-
}
|
|
7715
|
-
```
|
|
7716
|
-
|
|
7717
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [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), [ServicesCallHistory](./client.md#
|
|
7868
|
+
getChainTracker: () => Promise<ChainTracker>;
|
|
7869
|
+
getHeaderForHeight: (height: number) => Promise<number[]>;
|
|
7870
|
+
getHeight: () => Promise<number>;
|
|
7871
|
+
getBsvExchangeRate: () => Promise<number>;
|
|
7872
|
+
getFiatExchangeRate: (currency: FiatCurrencyCode, base?: FiatCurrencyCode) => Promise<number>;
|
|
7873
|
+
getRawTx: (txid: string, useNext?: boolean) => Promise<GetRawTxResult>;
|
|
7874
|
+
getMerklePath: (txid: string, useNext?: boolean) => Promise<GetMerklePathResult>;
|
|
7875
|
+
postBeef: (beef: Beef, txids: string[], logger?: WalletLoggerInterface) => Promise<PostBeefResult[]>;
|
|
7876
|
+
hashOutputScript: (script: string) => string;
|
|
7877
|
+
getStatusForTxids: (txids: string[], useNext?: boolean) => Promise<GetStatusForTxidsResult>;
|
|
7878
|
+
isUtxo: (output: TableOutput) => Promise<boolean>;
|
|
7879
|
+
getUtxoStatus: (output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean) => Promise<GetUtxoStatusResult>;
|
|
7880
|
+
getScriptHashHistory: (hash: string, useNext?: boolean, logger?: WalletLoggerInterface) => Promise<GetScriptHashHistoryResult>;
|
|
7881
|
+
hashToHeader: (hash: string) => Promise<BlockHeader>;
|
|
7882
|
+
nLockTimeIsFinal: (txOrLockTime: string | number[] | BsvTransaction | number) => Promise<boolean>;
|
|
7883
|
+
getBeefForTxid: (txid: string) => Promise<Beef>;
|
|
7884
|
+
getServicesCallHistory: (reset?: boolean) => ServicesCallHistory;
|
|
7885
|
+
}
|
|
7886
|
+
```
|
|
7887
|
+
|
|
7888
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [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), [ServicesCallHistory](./client.md#interface-servicescallhistory), [TableOutput](./storage.md#interface-tableoutput), [getBeefForTxid](./services.md#function-getbeeffortxid), [logger](./client.md#variable-logger)
|
|
7718
7889
|
|
|
7719
7890
|
###### Property chain
|
|
7720
7891
|
|
|
@@ -7725,7 +7896,7 @@ chain: Chain
|
|
|
7725
7896
|
```
|
|
7726
7897
|
See also: [Chain](./client.md#type-chain)
|
|
7727
7898
|
|
|
7728
|
-
######
|
|
7899
|
+
###### Property getBeefForTxid
|
|
7729
7900
|
|
|
7730
7901
|
Constructs a `Beef` for the given `txid` using only external data retrieval services.
|
|
7731
7902
|
|
|
@@ -7733,64 +7904,29 @@ In most cases, the `getBeefForTransaction` method of the `StorageProvider` class
|
|
|
7733
7904
|
used instead to avoid redundantly retrieving data.
|
|
7734
7905
|
|
|
7735
7906
|
```ts
|
|
7736
|
-
getBeefForTxid(txid: string)
|
|
7907
|
+
getBeefForTxid: (txid: string) => Promise<Beef>
|
|
7737
7908
|
```
|
|
7738
7909
|
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
errors if txid does not correspond to a valid transaction as determined by the
|
|
7742
|
-
configured services.
|
|
7743
|
-
|
|
7744
|
-
###### Method getBsvExchangeRate
|
|
7910
|
+
###### Property getBsvExchangeRate
|
|
7745
7911
|
|
|
7746
7912
|
Approximate exchange rate US Dollar / BSV, USD / BSV
|
|
7747
7913
|
|
|
7748
7914
|
This is the US Dollar price of one BSV
|
|
7749
7915
|
|
|
7750
7916
|
```ts
|
|
7751
|
-
getBsvExchangeRate()
|
|
7752
|
-
```
|
|
7753
|
-
|
|
7754
|
-
###### Method getChainTracker
|
|
7755
|
-
|
|
7756
|
-
```ts
|
|
7757
|
-
getChainTracker(): Promise<ChainTracker>
|
|
7917
|
+
getBsvExchangeRate: () => Promise<number>
|
|
7758
7918
|
```
|
|
7759
7919
|
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
standard `ChainTracker` service which requires `options.chaintracks` be valid.
|
|
7763
|
-
|
|
7764
|
-
###### Method getFiatExchangeRate
|
|
7920
|
+
###### Property getFiatExchangeRate
|
|
7765
7921
|
|
|
7766
7922
|
Approximate exchange rate currency per base.
|
|
7767
7923
|
|
|
7768
7924
|
```ts
|
|
7769
|
-
getFiatExchangeRate(currency: FiatCurrencyCode, base?: FiatCurrencyCode)
|
|
7925
|
+
getFiatExchangeRate: (currency: FiatCurrencyCode, base?: FiatCurrencyCode) => Promise<number>
|
|
7770
7926
|
```
|
|
7771
7927
|
See also: [FiatCurrencyCode](./client.md#type-fiatcurrencycode)
|
|
7772
7928
|
|
|
7773
|
-
######
|
|
7774
|
-
|
|
7775
|
-
```ts
|
|
7776
|
-
getHeaderForHeight(height: number): Promise<number[]>
|
|
7777
|
-
```
|
|
7778
|
-
|
|
7779
|
-
Returns
|
|
7780
|
-
|
|
7781
|
-
serialized block header for height on active chain
|
|
7782
|
-
|
|
7783
|
-
###### Method getHeight
|
|
7784
|
-
|
|
7785
|
-
```ts
|
|
7786
|
-
getHeight(): Promise<number>
|
|
7787
|
-
```
|
|
7788
|
-
|
|
7789
|
-
Returns
|
|
7790
|
-
|
|
7791
|
-
the height of the active chain
|
|
7792
|
-
|
|
7793
|
-
###### Method getMerklePath
|
|
7929
|
+
###### Property getMerklePath
|
|
7794
7930
|
|
|
7795
7931
|
Attempts to obtain the merkle proof associated with a 32 byte transaction hash (txid).
|
|
7796
7932
|
|
|
@@ -7809,18 +7945,11 @@ Result error will be the first error thrown (service name and CwiError), or null
|
|
|
7809
7945
|
Increments to next configured service and tries again until all services have been tried.
|
|
7810
7946
|
|
|
7811
7947
|
```ts
|
|
7812
|
-
getMerklePath(txid: string, useNext?: boolean)
|
|
7948
|
+
getMerklePath: (txid: string, useNext?: boolean) => Promise<GetMerklePathResult>
|
|
7813
7949
|
```
|
|
7814
7950
|
See also: [GetMerklePathResult](./client.md#interface-getmerklepathresult)
|
|
7815
7951
|
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
+ **txid**
|
|
7819
|
-
+ transaction hash for which proof is requested
|
|
7820
|
-
+ **useNext**
|
|
7821
|
-
+ optional, forces skip to next service before starting service requests cycle.
|
|
7822
|
-
|
|
7823
|
-
###### Method getRawTx
|
|
7952
|
+
###### Property getRawTx
|
|
7824
7953
|
|
|
7825
7954
|
Attempts to obtain the raw transaction bytes associated with a 32 byte transaction hash (txid).
|
|
7826
7955
|
|
|
@@ -7839,34 +7968,11 @@ Result error will be the first error thrown (service name and CwiError), or null
|
|
|
7839
7968
|
Increments to next configured service and tries again until all services have been tried.
|
|
7840
7969
|
|
|
7841
7970
|
```ts
|
|
7842
|
-
getRawTx(txid: string, useNext?: boolean)
|
|
7971
|
+
getRawTx: (txid: string, useNext?: boolean) => Promise<GetRawTxResult>
|
|
7843
7972
|
```
|
|
7844
7973
|
See also: [GetRawTxResult](./client.md#interface-getrawtxresult)
|
|
7845
7974
|
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
+ **txid**
|
|
7849
|
-
+ transaction hash for which raw transaction bytes are requested
|
|
7850
|
-
+ **useNext**
|
|
7851
|
-
+ optional, forces skip to next service before starting service requests cycle.
|
|
7852
|
-
|
|
7853
|
-
###### Method getServicesCallHistory
|
|
7854
|
-
|
|
7855
|
-
```ts
|
|
7856
|
-
getServicesCallHistory(reset?: boolean): ServicesCallHistory
|
|
7857
|
-
```
|
|
7858
|
-
See also: [ServicesCallHistory](./client.md#type-servicescallhistory)
|
|
7859
|
-
|
|
7860
|
-
Returns
|
|
7861
|
-
|
|
7862
|
-
a history of service calls made to the configured services.
|
|
7863
|
-
|
|
7864
|
-
Argument Details
|
|
7865
|
-
|
|
7866
|
-
+ **reset**
|
|
7867
|
-
+ if true, ends current interval and starts a new one.
|
|
7868
|
-
|
|
7869
|
-
###### Method getStatusForTxids
|
|
7975
|
+
###### Property getStatusForTxids
|
|
7870
7976
|
|
|
7871
7977
|
For an array of one or more txids, returns for each wether it is a 'known', 'mined', or 'unknown' transaction.
|
|
7872
7978
|
|
|
@@ -7875,98 +7981,31 @@ Primarily useful for determining if a recently broadcast transaction is known to
|
|
|
7875
7981
|
Also returns the current depth from chain tip if 'mined'.
|
|
7876
7982
|
|
|
7877
7983
|
```ts
|
|
7878
|
-
getStatusForTxids(txids: string[], useNext?: boolean)
|
|
7984
|
+
getStatusForTxids: (txids: string[], useNext?: boolean) => Promise<GetStatusForTxidsResult>
|
|
7879
7985
|
```
|
|
7880
7986
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
7881
7987
|
|
|
7882
|
-
######
|
|
7988
|
+
###### Property getUtxoStatus
|
|
7883
7989
|
|
|
7884
7990
|
Attempts to determine the UTXO status of a transaction output.
|
|
7885
7991
|
|
|
7886
7992
|
Cycles through configured transaction processing services attempting to get a valid response.
|
|
7887
7993
|
|
|
7888
7994
|
```ts
|
|
7889
|
-
getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean)
|
|
7995
|
+
getUtxoStatus: (output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean) => Promise<GetUtxoStatusResult>
|
|
7890
7996
|
```
|
|
7891
7997
|
See also: [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat), [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
7892
7998
|
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
+ **output**
|
|
7896
|
-
+ transaction output identifier in format determined by `outputFormat`.
|
|
7897
|
-
+ **chain**
|
|
7898
|
-
+ which chain to post to, all of rawTx's inputs must be unspent on this chain.
|
|
7899
|
-
+ **outputFormat**
|
|
7900
|
-
+ optional, supported values:
|
|
7901
|
-
'hashLE' little-endian sha256 hash of output script
|
|
7902
|
-
'hashBE' big-endian sha256 hash of output script
|
|
7903
|
-
'script' entire transaction output script
|
|
7904
|
-
undefined if length of `output` is 32 hex bytes then 'hashBE`, otherwise 'script'.
|
|
7905
|
-
+ **outpoint**
|
|
7906
|
-
+ if valid, result isUtxo is true only if this txid and vout match an unspent occurance of output script. `${txid}.${vout}` format.
|
|
7907
|
-
+ **useNext**
|
|
7908
|
-
+ optional, forces skip to next service before starting service requests cycle.
|
|
7909
|
-
|
|
7910
|
-
###### Method hashOutputScript
|
|
7911
|
-
|
|
7912
|
-
```ts
|
|
7913
|
-
hashOutputScript(script: string): string
|
|
7914
|
-
```
|
|
7915
|
-
|
|
7916
|
-
Returns
|
|
7917
|
-
|
|
7918
|
-
script hash in 'hashLE' format, which is the default.
|
|
7919
|
-
|
|
7920
|
-
Argument Details
|
|
7921
|
-
|
|
7922
|
-
+ **script**
|
|
7923
|
-
+ Output script to be hashed for `getUtxoStatus` default `outputFormat`
|
|
7924
|
-
|
|
7925
|
-
###### Method hashToHeader
|
|
7926
|
-
|
|
7927
|
-
```ts
|
|
7928
|
-
hashToHeader(hash: string): Promise<BlockHeader>
|
|
7929
|
-
```
|
|
7930
|
-
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
7931
|
-
|
|
7932
|
-
Returns
|
|
7933
|
-
|
|
7934
|
-
a block header
|
|
7935
|
-
|
|
7936
|
-
Argument Details
|
|
7937
|
-
|
|
7938
|
-
+ **hash**
|
|
7939
|
-
+ block hash
|
|
7940
|
-
|
|
7941
|
-
###### Method isUtxo
|
|
7999
|
+
###### Property isUtxo
|
|
7942
8000
|
|
|
7943
8001
|
Calls getUtxoStatus with the hash of the output's lockingScript,
|
|
7944
8002
|
and ensures that the output's outpoint matches an unspent use of that script.
|
|
7945
8003
|
|
|
7946
8004
|
```ts
|
|
7947
|
-
isUtxo(output: TableOutput)
|
|
8005
|
+
isUtxo: (output: TableOutput) => Promise<boolean>
|
|
7948
8006
|
```
|
|
7949
8007
|
See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
7950
8008
|
|
|
7951
|
-
Returns
|
|
7952
|
-
|
|
7953
|
-
true if the output appears to currently be spendable.
|
|
7954
|
-
|
|
7955
|
-
###### Method nLockTimeIsFinal
|
|
7956
|
-
|
|
7957
|
-
```ts
|
|
7958
|
-
nLockTimeIsFinal(txOrLockTime: string | number[] | BsvTransaction | number): Promise<boolean>
|
|
7959
|
-
```
|
|
7960
|
-
|
|
7961
|
-
Returns
|
|
7962
|
-
|
|
7963
|
-
whether the locktime value allows the transaction to be mined at the current chain height
|
|
7964
|
-
|
|
7965
|
-
Argument Details
|
|
7966
|
-
|
|
7967
|
-
+ **txOrLockTime**
|
|
7968
|
-
+ either a bitcoin locktime value or hex, binary, un-encoded Transaction
|
|
7969
|
-
|
|
7970
8009
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7971
8010
|
|
|
7972
8011
|
---
|
|
@@ -8224,49 +8263,39 @@ and it is left to the providers: physical access or remote channel authenticatio
|
|
|
8224
8263
|
|
|
8225
8264
|
```ts
|
|
8226
8265
|
export interface WalletStorage {
|
|
8227
|
-
isStorageProvider()
|
|
8228
|
-
isAvailable()
|
|
8229
|
-
makeAvailable()
|
|
8230
|
-
migrate(storageName: string, storageIdentityKey: string)
|
|
8231
|
-
destroy()
|
|
8232
|
-
setServices(v: WalletServices)
|
|
8233
|
-
getServices()
|
|
8234
|
-
getSettings()
|
|
8235
|
-
getAuth()
|
|
8236
|
-
findOrInsertUser(identityKey: string)
|
|
8266
|
+
isStorageProvider: () => boolean;
|
|
8267
|
+
isAvailable: () => boolean;
|
|
8268
|
+
makeAvailable: () => Promise<TableSettings>;
|
|
8269
|
+
migrate: (storageName: string, storageIdentityKey: string) => Promise<string>;
|
|
8270
|
+
destroy: () => Promise<void>;
|
|
8271
|
+
setServices: (v: WalletServices) => void;
|
|
8272
|
+
getServices: () => WalletServices;
|
|
8273
|
+
getSettings: () => TableSettings;
|
|
8274
|
+
getAuth: () => Promise<AuthId>;
|
|
8275
|
+
findOrInsertUser: (identityKey: string) => Promise<{
|
|
8237
8276
|
user: TableUser;
|
|
8238
8277
|
isNew: boolean;
|
|
8239
8278
|
}>;
|
|
8240
|
-
abortAction(args: AbortActionArgs)
|
|
8241
|
-
createAction(args: Validation.ValidCreateActionArgs)
|
|
8242
|
-
processAction(args: StorageProcessActionArgs)
|
|
8243
|
-
internalizeAction(args: InternalizeActionArgs)
|
|
8244
|
-
findCertificates(args: FindCertificatesArgs)
|
|
8245
|
-
findOutputBaskets(args: FindOutputBasketsArgs)
|
|
8246
|
-
findOutputs(args: FindOutputsArgs)
|
|
8247
|
-
findProvenTxReqs(args: FindProvenTxReqsArgs)
|
|
8248
|
-
listActions(args:
|
|
8249
|
-
listCertificates(args: Validation.ValidListCertificatesArgs)
|
|
8250
|
-
listOutputs(args:
|
|
8251
|
-
insertCertificate(certificate: TableCertificateX)
|
|
8252
|
-
relinquishCertificate(args: RelinquishCertificateArgs)
|
|
8253
|
-
relinquishOutput(args: RelinquishOutputArgs)
|
|
8254
|
-
getStores()
|
|
8279
|
+
abortAction: (args: AbortActionArgs) => Promise<AbortActionResult>;
|
|
8280
|
+
createAction: (args: Validation.ValidCreateActionArgs) => Promise<StorageCreateActionResult>;
|
|
8281
|
+
processAction: (args: StorageProcessActionArgs) => Promise<StorageProcessActionResults>;
|
|
8282
|
+
internalizeAction: (args: InternalizeActionArgs) => Promise<InternalizeActionResult>;
|
|
8283
|
+
findCertificates: (args: FindCertificatesArgs) => Promise<TableCertificateX[]>;
|
|
8284
|
+
findOutputBaskets: (args: FindOutputBasketsArgs) => Promise<TableOutputBasket[]>;
|
|
8285
|
+
findOutputs: (args: FindOutputsArgs) => Promise<TableOutput[]>;
|
|
8286
|
+
findProvenTxReqs: (args: FindProvenTxReqsArgs) => Promise<TableProvenTxReq[]>;
|
|
8287
|
+
listActions: (args: Validation.ValidListActionsArgs) => Promise<ListActionsResult>;
|
|
8288
|
+
listCertificates: (args: Validation.ValidListCertificatesArgs) => Promise<ListCertificatesResult>;
|
|
8289
|
+
listOutputs: (args: Validation.ValidListOutputsArgs) => Promise<ListOutputsResult>;
|
|
8290
|
+
insertCertificate: (certificate: TableCertificateX) => Promise<number>;
|
|
8291
|
+
relinquishCertificate: (args: RelinquishCertificateArgs) => Promise<number>;
|
|
8292
|
+
relinquishOutput: (args: RelinquishOutputArgs) => Promise<number>;
|
|
8293
|
+
getStores: () => WalletStorageInfo[];
|
|
8255
8294
|
}
|
|
8256
8295
|
```
|
|
8257
8296
|
|
|
8258
8297
|
See also: [AuthId](./client.md#interface-authid), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableUser](./storage.md#interface-tableuser), [WalletServices](./client.md#interface-walletservices), [WalletStorageInfo](./client.md#interface-walletstorageinfo), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction)
|
|
8259
8298
|
|
|
8260
|
-
###### Method isStorageProvider
|
|
8261
|
-
|
|
8262
|
-
```ts
|
|
8263
|
-
isStorageProvider(): boolean
|
|
8264
|
-
```
|
|
8265
|
-
|
|
8266
|
-
Returns
|
|
8267
|
-
|
|
8268
|
-
false
|
|
8269
|
-
|
|
8270
8299
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8271
8300
|
|
|
8272
8301
|
---
|
|
@@ -8298,23 +8327,13 @@ is the actual minimal interface implemented by storage and remoted storage provi
|
|
|
8298
8327
|
|
|
8299
8328
|
```ts
|
|
8300
8329
|
export interface WalletStorageProvider extends WalletStorageSync {
|
|
8301
|
-
isStorageProvider()
|
|
8302
|
-
setServices(v: WalletServices)
|
|
8330
|
+
isStorageProvider: () => boolean;
|
|
8331
|
+
setServices: (v: WalletServices) => void;
|
|
8303
8332
|
}
|
|
8304
8333
|
```
|
|
8305
8334
|
|
|
8306
8335
|
See also: [WalletServices](./client.md#interface-walletservices), [WalletStorageSync](./client.md#interface-walletstoragesync)
|
|
8307
8336
|
|
|
8308
|
-
###### Method isStorageProvider
|
|
8309
|
-
|
|
8310
|
-
```ts
|
|
8311
|
-
isStorageProvider(): boolean
|
|
8312
|
-
```
|
|
8313
|
-
|
|
8314
|
-
Returns
|
|
8315
|
-
|
|
8316
|
-
true if this object's interface can be extended to the full `StorageProvider` interface
|
|
8317
|
-
|
|
8318
8337
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8319
8338
|
|
|
8320
8339
|
---
|
|
@@ -8322,16 +8341,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8322
8341
|
|
|
8323
8342
|
```ts
|
|
8324
8343
|
export interface WalletStorageReader {
|
|
8325
|
-
isAvailable()
|
|
8326
|
-
getServices()
|
|
8327
|
-
getSettings()
|
|
8328
|
-
findCertificatesAuth(auth: AuthId, args: FindCertificatesArgs)
|
|
8329
|
-
findOutputBasketsAuth(auth: AuthId, args: FindOutputBasketsArgs)
|
|
8330
|
-
findOutputsAuth(auth: AuthId, args: FindOutputsArgs)
|
|
8331
|
-
findProvenTxReqs(args: FindProvenTxReqsArgs)
|
|
8332
|
-
listActions(auth: AuthId, vargs: Validation.ValidListActionsArgs)
|
|
8333
|
-
listCertificates(auth: AuthId, vargs: Validation.ValidListCertificatesArgs)
|
|
8334
|
-
listOutputs(auth: AuthId, vargs: Validation.ValidListOutputsArgs)
|
|
8344
|
+
isAvailable: () => boolean;
|
|
8345
|
+
getServices: () => WalletServices;
|
|
8346
|
+
getSettings: () => TableSettings;
|
|
8347
|
+
findCertificatesAuth: (auth: AuthId, args: FindCertificatesArgs) => Promise<TableCertificateX[]>;
|
|
8348
|
+
findOutputBasketsAuth: (auth: AuthId, args: FindOutputBasketsArgs) => Promise<TableOutputBasket[]>;
|
|
8349
|
+
findOutputsAuth: (auth: AuthId, args: FindOutputsArgs) => Promise<TableOutput[]>;
|
|
8350
|
+
findProvenTxReqs: (args: FindProvenTxReqsArgs) => Promise<TableProvenTxReq[]>;
|
|
8351
|
+
listActions: (auth: AuthId, vargs: Validation.ValidListActionsArgs) => Promise<ListActionsResult>;
|
|
8352
|
+
listCertificates: (auth: AuthId, vargs: Validation.ValidListCertificatesArgs) => Promise<ListCertificatesResult>;
|
|
8353
|
+
listOutputs: (auth: AuthId, vargs: Validation.ValidListOutputsArgs) => Promise<ListOutputsResult>;
|
|
8335
8354
|
}
|
|
8336
8355
|
```
|
|
8337
8356
|
|
|
@@ -8344,24 +8363,24 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8344
8363
|
|
|
8345
8364
|
```ts
|
|
8346
8365
|
export interface WalletStorageSync extends WalletStorageWriter {
|
|
8347
|
-
findOrInsertSyncStateAuth(auth: AuthId, storageIdentityKey: string, storageName: string)
|
|
8366
|
+
findOrInsertSyncStateAuth: (auth: AuthId, storageIdentityKey: string, storageName: string) => Promise<{
|
|
8348
8367
|
syncState: TableSyncState;
|
|
8349
8368
|
isNew: boolean;
|
|
8350
8369
|
}>;
|
|
8351
|
-
setActive(auth: AuthId, newActiveStorageIdentityKey: string)
|
|
8352
|
-
getSyncChunk(args: RequestSyncChunkArgs)
|
|
8353
|
-
processSyncChunk(args: RequestSyncChunkArgs, chunk: SyncChunk)
|
|
8370
|
+
setActive: (auth: AuthId, newActiveStorageIdentityKey: string) => Promise<number>;
|
|
8371
|
+
getSyncChunk: (args: RequestSyncChunkArgs) => Promise<SyncChunk>;
|
|
8372
|
+
processSyncChunk: (args: RequestSyncChunkArgs, chunk: SyncChunk) => Promise<ProcessSyncChunkResult>;
|
|
8354
8373
|
}
|
|
8355
8374
|
```
|
|
8356
8375
|
|
|
8357
8376
|
See also: [AuthId](./client.md#interface-authid), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [SyncChunk](./client.md#interface-syncchunk), [TableSyncState](./storage.md#interface-tablesyncstate), [WalletStorageWriter](./client.md#interface-walletstoragewriter), [getSyncChunk](./storage.md#function-getsyncchunk)
|
|
8358
8377
|
|
|
8359
|
-
######
|
|
8378
|
+
###### Property setActive
|
|
8360
8379
|
|
|
8361
8380
|
Updagte the `activeStorage` property of the authenticated user by their `userId`.
|
|
8362
8381
|
|
|
8363
8382
|
```ts
|
|
8364
|
-
setActive(auth: AuthId, newActiveStorageIdentityKey: string)
|
|
8383
|
+
setActive: (auth: AuthId, newActiveStorageIdentityKey: string) => Promise<number>
|
|
8365
8384
|
```
|
|
8366
8385
|
See also: [AuthId](./client.md#interface-authid)
|
|
8367
8386
|
|
|
@@ -8374,8 +8393,8 @@ This is the minimal interface required for a WalletStorageProvider to export dat
|
|
|
8374
8393
|
|
|
8375
8394
|
```ts
|
|
8376
8395
|
export interface WalletStorageSyncReader {
|
|
8377
|
-
makeAvailable()
|
|
8378
|
-
getSyncChunk(args: RequestSyncChunkArgs)
|
|
8396
|
+
makeAvailable: () => Promise<TableSettings>;
|
|
8397
|
+
getSyncChunk: (args: RequestSyncChunkArgs) => Promise<SyncChunk>;
|
|
8379
8398
|
}
|
|
8380
8399
|
```
|
|
8381
8400
|
|
|
@@ -8388,20 +8407,20 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8388
8407
|
|
|
8389
8408
|
```ts
|
|
8390
8409
|
export interface WalletStorageWriter extends WalletStorageReader {
|
|
8391
|
-
makeAvailable()
|
|
8392
|
-
migrate(storageName: string, storageIdentityKey: string)
|
|
8393
|
-
destroy()
|
|
8394
|
-
findOrInsertUser(identityKey: string)
|
|
8410
|
+
makeAvailable: () => Promise<TableSettings>;
|
|
8411
|
+
migrate: (storageName: string, storageIdentityKey: string) => Promise<string>;
|
|
8412
|
+
destroy: () => Promise<void>;
|
|
8413
|
+
findOrInsertUser: (identityKey: string) => Promise<{
|
|
8395
8414
|
user: TableUser;
|
|
8396
8415
|
isNew: boolean;
|
|
8397
8416
|
}>;
|
|
8398
|
-
abortAction(auth: AuthId, args: AbortActionArgs)
|
|
8399
|
-
createAction(auth: AuthId, args: Validation.ValidCreateActionArgs)
|
|
8400
|
-
processAction(auth: AuthId, args: StorageProcessActionArgs)
|
|
8401
|
-
internalizeAction(auth: AuthId, args: InternalizeActionArgs)
|
|
8402
|
-
insertCertificateAuth(auth: AuthId, certificate: TableCertificateX)
|
|
8403
|
-
relinquishCertificate(auth: AuthId, args: RelinquishCertificateArgs)
|
|
8404
|
-
relinquishOutput(auth: AuthId, args: RelinquishOutputArgs)
|
|
8417
|
+
abortAction: (auth: AuthId, args: AbortActionArgs) => Promise<AbortActionResult>;
|
|
8418
|
+
createAction: (auth: AuthId, args: Validation.ValidCreateActionArgs) => Promise<StorageCreateActionResult>;
|
|
8419
|
+
processAction: (auth: AuthId, args: StorageProcessActionArgs) => Promise<StorageProcessActionResults>;
|
|
8420
|
+
internalizeAction: (auth: AuthId, args: InternalizeActionArgs) => Promise<StorageInternalizeActionResult>;
|
|
8421
|
+
insertCertificateAuth: (auth: AuthId, certificate: TableCertificateX) => Promise<number>;
|
|
8422
|
+
relinquishCertificate: (auth: AuthId, args: RelinquishCertificateArgs) => Promise<number>;
|
|
8423
|
+
relinquishOutput: (auth: AuthId, args: RelinquishOutputArgs) => Promise<number>;
|
|
8405
8424
|
}
|
|
8406
8425
|
```
|
|
8407
8426
|
|
|
@@ -8595,44 +8614,44 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8595
8614
|
|
|
8596
8615
|
| | | |
|
|
8597
8616
|
| --- | --- | --- |
|
|
8598
|
-
| [ARC](#class-arc) | [EntitySyncState](#class-entitysyncstate) | [
|
|
8599
|
-
| [ArcSSEClient](#class-arcsseclient) | [EntityTransaction](#class-entitytransaction) | [
|
|
8600
|
-
| [AuthMethodInteractor](#class-authmethodinteractor) | [EntityTxLabel](#class-entitytxlabel) | [
|
|
8601
|
-
| [BHServiceClient](#class-bhserviceclient) | [EntityTxLabelMap](#class-entitytxlabelmap) | [
|
|
8602
|
-
| [Bitails](#class-bitails) | [EntityUser](#class-entityuser) | [
|
|
8603
|
-
| [BulkFileDataManager](#class-bulkfiledatamanager) | [HeightRange](#class-heightrange) | [
|
|
8604
|
-
| [BulkFileDataReader](#class-bulkfiledatareader) | [LiveIngestorBase](#class-liveingestorbase) | [
|
|
8605
|
-
| [BulkFilesReader](#class-bulkfilesreader) | [LiveIngestorWhatsOnChainPoll](#class-liveingestorwhatsonchainpoll) | [
|
|
8606
|
-
| [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [MergeEntity](#class-mergeentity) | [
|
|
8607
|
-
| [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [MockChainMigrations](#class-mockchainmigrations) | [
|
|
8608
|
-
| [BulkHeaderFile](#class-bulkheaderfile) | [MockChainStorage](#class-mockchainstorage) | [
|
|
8609
|
-
| [BulkHeaderFileFs](#class-bulkheaderfilefs) | [MockChainTracker](#class-mockchaintracker) | [
|
|
8610
|
-
| [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [MockMiner](#class-mockminer) | [
|
|
8611
|
-
| [BulkHeaderFiles](#class-bulkheaderfiles) | [MockServices](#class-mockservices) | [
|
|
8612
|
-
| [BulkIngestorBase](#class-bulkingestorbase) | [Monitor](#class-monitor) | [
|
|
8613
|
-
| [BulkIngestorCDN](#class-bulkingestorcdn) | [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [
|
|
8614
|
-
| [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [PersonaIDInteractor](#class-personaidinteractor) | [
|
|
8615
|
-
| [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [
|
|
8616
|
-
| [BulkStorageBase](#class-bulkstoragebase) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [
|
|
8617
|
-
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [
|
|
8618
|
-
| [Chaintracks](#class-chaintracks) | [ServiceCollection](#class-servicecollection) | [
|
|
8619
|
-
| [ChaintracksChainTracker](#class-chaintrackschaintracker) | [Services](#class-services) | [
|
|
8620
|
-
| [ChaintracksFetch](#class-chaintracksfetch) | [SetupClient](#class-setupclient) | [
|
|
8621
|
-
| [ChaintracksServiceClient](#class-chaintracksserviceclient) | [SimpleWalletManager](#class-simplewalletmanager) | [
|
|
8622
|
-
| [ChaintracksStorageBase](#class-chaintracksstoragebase) | [SingleWriterMultiReaderLock](#class-singlewritermultireaderlock) | [
|
|
8623
|
-
| [ChaintracksStorageIdb](#class-chaintracksstorageidb) | [StorageClient](#class-storageclient) | [
|
|
8624
|
-
| [ChaintracksStorageNoDb](#class-chaintracksstoragenodb) | [
|
|
8625
|
-
| [DevConsoleInteractor](#class-devconsoleinteractor) | [
|
|
8626
|
-
| [EntityBase](#class-entitybase) | [
|
|
8627
|
-
| [EntityCertificate](#class-entitycertificate) | [
|
|
8628
|
-
| [EntityCertificateField](#class-entitycertificatefield) | [
|
|
8629
|
-
| [EntityCommission](#class-entitycommission) | [
|
|
8630
|
-
| [EntityOutput](#class-entityoutput) | [
|
|
8631
|
-
| [EntityOutputBasket](#class-entityoutputbasket) | [
|
|
8632
|
-
| [EntityOutputTag](#class-entityoutputtag) | [
|
|
8633
|
-
| [EntityOutputTagMap](#class-entityoutputtagmap) | [
|
|
8634
|
-
| [EntityProvenTx](#class-entityproventx) | [
|
|
8635
|
-
| [EntityProvenTxReq](#class-entityproventxreq) | [
|
|
8617
|
+
| [ARC](#class-arc) | [EntitySyncState](#class-entitysyncstate) | [TaskMonitorCallHistory](#class-taskmonitorcallhistory) |
|
|
8618
|
+
| [ArcSSEClient](#class-arcsseclient) | [EntityTransaction](#class-entitytransaction) | [TaskNewHeader](#class-tasknewheader) |
|
|
8619
|
+
| [AuthMethodInteractor](#class-authmethodinteractor) | [EntityTxLabel](#class-entitytxlabel) | [TaskPurge](#class-taskpurge) |
|
|
8620
|
+
| [BHServiceClient](#class-bhserviceclient) | [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskReorg](#class-taskreorg) |
|
|
8621
|
+
| [Bitails](#class-bitails) | [EntityUser](#class-entityuser) | [TaskReviewDoubleSpends](#class-taskreviewdoublespends) |
|
|
8622
|
+
| [BulkFileDataManager](#class-bulkfiledatamanager) | [HeightRange](#class-heightrange) | [TaskReviewProvenTxs](#class-taskreviewproventxs) |
|
|
8623
|
+
| [BulkFileDataReader](#class-bulkfiledatareader) | [LiveIngestorBase](#class-liveingestorbase) | [TaskReviewStatus](#class-taskreviewstatus) |
|
|
8624
|
+
| [BulkFilesReader](#class-bulkfilesreader) | [LiveIngestorWhatsOnChainPoll](#class-liveingestorwhatsonchainpoll) | [TaskReviewUtxos](#class-taskreviewutxos) |
|
|
8625
|
+
| [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [MergeEntity](#class-mergeentity) | [TaskSendWaiting](#class-tasksendwaiting) |
|
|
8626
|
+
| [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [MockChainMigrations](#class-mockchainmigrations) | [TaskUnFail](#class-taskunfail) |
|
|
8627
|
+
| [BulkHeaderFile](#class-bulkheaderfile) | [MockChainStorage](#class-mockchainstorage) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) |
|
|
8628
|
+
| [BulkHeaderFileFs](#class-bulkheaderfilefs) | [MockChainTracker](#class-mockchaintracker) | [WABClient](#class-wabclient) |
|
|
8629
|
+
| [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [MockMiner](#class-mockminer) | [WERR_BAD_REQUEST](#class-werr_bad_request) |
|
|
8630
|
+
| [BulkHeaderFiles](#class-bulkheaderfiles) | [MockServices](#class-mockservices) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
|
|
8631
|
+
| [BulkIngestorBase](#class-bulkingestorbase) | [Monitor](#class-monitor) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
|
|
8632
|
+
| [BulkIngestorCDN](#class-bulkingestorcdn) | [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [WERR_INTERNAL](#class-werr_internal) |
|
|
8633
|
+
| [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [PersonaIDInteractor](#class-personaidinteractor) | [WERR_INVALID_MERKLE_ROOT](#class-werr_invalid_merkle_root) |
|
|
8634
|
+
| [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
|
|
8635
|
+
| [BulkStorageBase](#class-bulkstoragebase) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
|
|
8636
|
+
| [CWIStyleWalletManager](#class-cwistylewalletmanager) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
|
|
8637
|
+
| [Chaintracks](#class-chaintracks) | [ServiceCollection](#class-servicecollection) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
|
|
8638
|
+
| [ChaintracksChainTracker](#class-chaintrackschaintracker) | [Services](#class-services) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
|
|
8639
|
+
| [ChaintracksFetch](#class-chaintracksfetch) | [SetupClient](#class-setupclient) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
|
|
8640
|
+
| [ChaintracksServiceClient](#class-chaintracksserviceclient) | [SimpleWalletManager](#class-simplewalletmanager) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
|
|
8641
|
+
| [ChaintracksStorageBase](#class-chaintracksstoragebase) | [SingleWriterMultiReaderLock](#class-singlewritermultireaderlock) | [WERR_REVIEW_ACTIONS](#class-werr_review_actions) |
|
|
8642
|
+
| [ChaintracksStorageIdb](#class-chaintracksstorageidb) | [StorageClient](#class-storageclient) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
|
|
8643
|
+
| [ChaintracksStorageNoDb](#class-chaintracksstoragenodb) | [StorageClientBase](#class-storageclientbase) | [Wallet](#class-wallet) |
|
|
8644
|
+
| [DevConsoleInteractor](#class-devconsoleinteractor) | [StorageIdb](#class-storageidb) | [WalletAuthenticationManager](#class-walletauthenticationmanager) |
|
|
8645
|
+
| [EntityBase](#class-entitybase) | [StorageProvider](#class-storageprovider) | [WalletError](#class-walleterror) |
|
|
8646
|
+
| [EntityCertificate](#class-entitycertificate) | [StorageReader](#class-storagereader) | [WalletLogger](#class-walletlogger) |
|
|
8647
|
+
| [EntityCertificateField](#class-entitycertificatefield) | [StorageReaderWriter](#class-storagereaderwriter) | [WalletMonitorTask](#class-walletmonitortask) |
|
|
8648
|
+
| [EntityCommission](#class-entitycommission) | [StorageSyncReader](#class-storagesyncreader) | [WalletPermissionsManager](#class-walletpermissionsmanager) |
|
|
8649
|
+
| [EntityOutput](#class-entityoutput) | [TaskArcadeSSE](#class-taskarcadesse) | [WalletSettingsManager](#class-walletsettingsmanager) |
|
|
8650
|
+
| [EntityOutputBasket](#class-entityoutputbasket) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WalletSigner](#class-walletsigner) |
|
|
8651
|
+
| [EntityOutputTag](#class-entityoutputtag) | [TaskCheckNoSends](#class-taskchecknosends) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
8652
|
+
| [EntityOutputTagMap](#class-entityoutputtagmap) | [TaskClock](#class-taskclock) | [WhatsOnChain](#class-whatsonchain) |
|
|
8653
|
+
| [EntityProvenTx](#class-entityproventx) | [TaskFailAbandoned](#class-taskfailabandoned) | [WhatsOnChainNoServices](#class-whatsonchainnoservices) |
|
|
8654
|
+
| [EntityProvenTxReq](#class-entityproventxreq) | [TaskMineBlock](#class-taskmineblock) | [WhatsOnChainServices](#class-whatsonchainservices) |
|
|
8636
8655
|
|
|
8637
8656
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8638
8657
|
|
|
@@ -9124,19 +9143,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
9124
9143
|
|
|
9125
9144
|
```ts
|
|
9126
9145
|
export abstract class BulkHeaderFile implements BulkHeaderFileInfo {
|
|
9127
|
-
chain?: Chain
|
|
9146
|
+
chain?: Chain;
|
|
9128
9147
|
count: number;
|
|
9129
|
-
data?: Uint8Array<ArrayBufferLike
|
|
9148
|
+
data?: Uint8Array<ArrayBufferLike>;
|
|
9130
9149
|
fileHash: string | null;
|
|
9131
|
-
fileId?: number
|
|
9150
|
+
fileId?: number;
|
|
9132
9151
|
fileName: string;
|
|
9133
9152
|
firstHeight: number;
|
|
9134
9153
|
lastChainWork: string;
|
|
9135
9154
|
lastHash: string | null;
|
|
9136
9155
|
prevChainWork: string;
|
|
9137
9156
|
prevHash: string;
|
|
9138
|
-
sourceUrl?: string
|
|
9139
|
-
validated?: boolean
|
|
9157
|
+
sourceUrl?: string;
|
|
9158
|
+
validated?: boolean;
|
|
9140
9159
|
constructor(info: BulkHeaderFileInfo)
|
|
9141
9160
|
abstract readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>;
|
|
9142
9161
|
get heightRange(): HeightRange
|
|
@@ -9433,7 +9452,7 @@ export class BulkIngestorWhatsOnChainCdn extends BulkIngestorBase {
|
|
|
9433
9452
|
}
|
|
9434
9453
|
```
|
|
9435
9454
|
|
|
9436
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](./services.md#class-bulkingestorbase), [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [StopListenerToken](./services.md#
|
|
9455
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](./services.md#class-bulkingestorbase), [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [StopListenerToken](./services.md#interface-stoplistenertoken), [WhatsOnChainServices](./services.md#class-whatsonchainservices)
|
|
9437
9456
|
|
|
9438
9457
|
###### Method createBulkIngestorWhatsOnChainOptions
|
|
9439
9458
|
|
|
@@ -9485,6 +9504,7 @@ supporting multiple user profiles under a single account.
|
|
|
9485
9504
|
```ts
|
|
9486
9505
|
export class CWIStyleWalletManager implements WalletInterface {
|
|
9487
9506
|
authenticated: boolean;
|
|
9507
|
+
get ready(): Promise<void>
|
|
9488
9508
|
authenticationMode: "presentation-key-and-password" | "presentation-key-and-recovery-key" | "recovery-key-and-password" = "presentation-key-and-password";
|
|
9489
9509
|
authenticationFlow: "new-user" | "existing-user" = "new-user";
|
|
9490
9510
|
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (profilePrimaryKey: number[], profilePrivilegedKeyManager: PrivilegedKeyManager, profileId: number[]) => Promise<WalletInterface>, interactor: UMPTokenInteractor = new OverlayUMPTokenInteractor(), recoveryKeySaver: (key: number[]) => Promise<true>, passwordRetriever: (reason: string, test: (passwordCandidate: string) => boolean | Promise<boolean>) => Promise<string>, newWalletFunder?: (presentationKey: number[], wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes) => Promise<void>, stateSnapshot?: number[], kdfConfig?: KdfConfig)
|
|
@@ -9794,45 +9814,17 @@ export class Chaintracks implements ChaintracksManagementApi {
|
|
|
9794
9814
|
let after = before;
|
|
9795
9815
|
let added = HeightRange.empty;
|
|
9796
9816
|
const maxSyncRounds = Math.max(1, this.bulkIngestors.length * 2);
|
|
9797
|
-
let
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
const beforeBulkMax = before.bulk.maxHeight;
|
|
9805
|
-
const beforeLiveRange = HeightRange.from(newLiveHeaders);
|
|
9806
|
-
const r = await bulk.synchronize(presentHeight, before, newLiveHeaders);
|
|
9807
|
-
roundHadSuccess = true;
|
|
9808
|
-
newLiveHeaders = r.liveHeaders;
|
|
9809
|
-
after = await this.storage.getAvailableHeightRanges();
|
|
9810
|
-
added = after.bulk.above(before.bulk);
|
|
9811
|
-
const afterLiveRange = HeightRange.from(newLiveHeaders);
|
|
9812
|
-
if (after.bulk.maxHeight > beforeBulkMax || afterLiveRange.maxHeight > beforeLiveRange.maxHeight) {
|
|
9813
|
-
roundMadeProgress = true;
|
|
9814
|
-
}
|
|
9815
|
-
before = after;
|
|
9816
|
-
this.log(`Bulk Ingestor: ${added.length} added with ${newLiveHeaders.length} live headers from ${bulk.constructor.name}`);
|
|
9817
|
-
if (r.done) {
|
|
9818
|
-
done = true;
|
|
9819
|
-
break;
|
|
9820
|
-
}
|
|
9821
|
-
}
|
|
9822
|
-
catch (eu: unknown) {
|
|
9823
|
-
const e = (bulkSyncError = WalletError.fromUnknown(eu));
|
|
9824
|
-
this.log(`bulk sync error: ${e.message}`);
|
|
9825
|
-
if (!this.available)
|
|
9826
|
-
break;
|
|
9827
|
-
}
|
|
9828
|
-
}
|
|
9829
|
-
if (!this.available && bulkSyncError && !roundHadSuccess) {
|
|
9830
|
-
this.startupError = bulkSyncError;
|
|
9817
|
+
for (let round = 1; round <= maxSyncRounds; round++) {
|
|
9818
|
+
const result = await this.runBulkSyncRound(before, presentHeight, newLiveHeaders);
|
|
9819
|
+
after = result.after;
|
|
9820
|
+
newLiveHeaders = result.newLiveHeaders;
|
|
9821
|
+
added = after.bulk.above(before.bulk);
|
|
9822
|
+
before = after;
|
|
9823
|
+
if (this.startupError != null)
|
|
9831
9824
|
break;
|
|
9832
|
-
|
|
9833
|
-
if (done)
|
|
9825
|
+
if (result.done)
|
|
9834
9826
|
break;
|
|
9835
|
-
if (!
|
|
9827
|
+
if (!result.madeProgress) {
|
|
9836
9828
|
this.log(`Bulk sync stalled after round ${round}. Deferring further bulk sync attempts to continue live header processing.`);
|
|
9837
9829
|
break;
|
|
9838
9830
|
}
|
|
@@ -9840,7 +9832,7 @@ export class Chaintracks implements ChaintracksManagementApi {
|
|
|
9840
9832
|
this.log(`Bulk sync paused after ${maxSyncRounds} rounds to avoid runaway retries. Will retry in a later sync cycle.`);
|
|
9841
9833
|
}
|
|
9842
9834
|
}
|
|
9843
|
-
if (
|
|
9835
|
+
if (this.startupError == null) {
|
|
9844
9836
|
this.liveHeaders.unshift(...newLiveHeaders);
|
|
9845
9837
|
added = after.bulk.above(initialRanges.bulk);
|
|
9846
9838
|
this.log(`syncBulkStorage done
|
|
@@ -9851,151 +9843,32 @@ export class Chaintracks implements ChaintracksManagementApi {
|
|
|
9851
9843
|
`);
|
|
9852
9844
|
}
|
|
9853
9845
|
}
|
|
9854
|
-
private async
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
let
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
try {
|
|
9862
|
-
const now = Date.now();
|
|
9863
|
-
lastSyncCheck = now;
|
|
9864
|
-
const presentHeight = await this.getPresentHeight();
|
|
9865
|
-
const before = await this.storage.getAvailableHeightRanges();
|
|
9866
|
-
let skipBulkSync = !before.live.isEmpty && before.live.maxHeight >= presentHeight - this.addLiveRecursionLimit / 2;
|
|
9867
|
-
if (skipBulkSync && now - lastBulkSync > cdnSyncRepeatMsecs) {
|
|
9868
|
-
skipBulkSync = false;
|
|
9869
|
-
}
|
|
9870
|
-
this.log(`Chaintracks Update Services: Bulk Header Sync Review
|
|
9846
|
+
private async runBulkSyncIfNeeded(now: number, lastBulkSync: number, cdnSyncRepeatMsecs: number): Promise<number> {
|
|
9847
|
+
const presentHeight = await this.getPresentHeight();
|
|
9848
|
+
const before = await this.storage.getAvailableHeightRanges();
|
|
9849
|
+
let skipBulkSync = !before.live.isEmpty && before.live.maxHeight >= presentHeight - this.addLiveRecursionLimit / 2;
|
|
9850
|
+
if (skipBulkSync && now - lastBulkSync > cdnSyncRepeatMsecs)
|
|
9851
|
+
skipBulkSync = false;
|
|
9852
|
+
this.log(`Chaintracks Update Services: Bulk Header Sync Review
|
|
9871
9853
|
presentHeight=${presentHeight} addLiveRecursionLimit=${this.addLiveRecursionLimit}
|
|
9872
9854
|
Before synchronize: bulk ${before.bulk}, live ${before.live}
|
|
9873
9855
|
${skipBulkSync ? "Skipping" : "Starting"} syncBulkStorage.
|
|
9874
9856
|
`);
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
}
|
|
9884
|
-
let count = 0;
|
|
9885
|
-
let liveHeaderDupes = 0;
|
|
9886
|
-
let needSyncCheck = false;
|
|
9887
|
-
for (; !needSyncCheck && !this.stopMainThread;) {
|
|
9888
|
-
let header = this.liveHeaders.shift();
|
|
9889
|
-
if (header) {
|
|
9890
|
-
let recursions = this.addLiveRecursionLimit;
|
|
9891
|
-
for (; !needSyncCheck && !this.stopMainThread;) {
|
|
9892
|
-
const ihr = await this.addLiveHeader(header);
|
|
9893
|
-
if (this.invalidInsertHeaderResult(ihr)) {
|
|
9894
|
-
this.log(`Ignoring liveHeader ${header.height} ${header.hash} due to invalid insert result.`);
|
|
9895
|
-
needSyncCheck = true;
|
|
9896
|
-
}
|
|
9897
|
-
else if (ihr.noPrev) {
|
|
9898
|
-
if (recursions-- <= 0) {
|
|
9899
|
-
this.log(`Ignoring liveHeader ${header.height} ${header.hash} addLiveRecursionLimit=${this.addLiveRecursionLimit} exceeded.`);
|
|
9900
|
-
needSyncCheck = true;
|
|
9901
|
-
}
|
|
9902
|
-
else {
|
|
9903
|
-
const hash = header.previousHash;
|
|
9904
|
-
const prevHeader = await this.getMissingBlockHeader(hash);
|
|
9905
|
-
if (!prevHeader) {
|
|
9906
|
-
this.log(`Ignoring liveHeader ${header.height} ${header.hash} failed to find previous header by hash ${asString(hash)}`);
|
|
9907
|
-
needSyncCheck = true;
|
|
9908
|
-
}
|
|
9909
|
-
else {
|
|
9910
|
-
this.liveHeaders.unshift(header);
|
|
9911
|
-
header = prevHeader;
|
|
9912
|
-
}
|
|
9913
|
-
}
|
|
9914
|
-
}
|
|
9915
|
-
else {
|
|
9916
|
-
if (this.subscriberCallbacksEnabled)
|
|
9917
|
-
this.log(`addLiveHeader ${header.height}${ihr.added ? " added" : ""}${ihr.dupe ? " dupe" : ""}${ihr.isActiveTip ? " isActiveTip" : ""}${ihr.reorgDepth ? " reorg depth " + ihr.reorgDepth : ""}${ihr.noPrev ? " noPrev" : ""}${ihr.noActiveAncestor || ihr.noTip || ihr.badPrev ? " error" : ""}`);
|
|
9918
|
-
if (ihr.dupe) {
|
|
9919
|
-
liveHeaderDupes++;
|
|
9920
|
-
}
|
|
9921
|
-
if (ihr.added) {
|
|
9922
|
-
count++;
|
|
9923
|
-
}
|
|
9924
|
-
break;
|
|
9925
|
-
}
|
|
9926
|
-
}
|
|
9927
|
-
}
|
|
9928
|
-
else {
|
|
9929
|
-
const bheader = this.baseHeaders.shift();
|
|
9930
|
-
if (bheader) {
|
|
9931
|
-
const prev = await this.storage.findLiveHeaderForBlockHash(bheader.previousHash);
|
|
9932
|
-
if (!prev) {
|
|
9933
|
-
this.log(`Ignoring header with unknown previousHash ${bheader.previousHash} in live storage.`);
|
|
9934
|
-
}
|
|
9935
|
-
else {
|
|
9936
|
-
const header: BlockHeader = {
|
|
9937
|
-
...bheader,
|
|
9938
|
-
height: prev.height + 1,
|
|
9939
|
-
hash: blockHash(bheader)
|
|
9940
|
-
};
|
|
9941
|
-
const ihr = await this.addLiveHeader(header);
|
|
9942
|
-
if (this.invalidInsertHeaderResult(ihr)) {
|
|
9943
|
-
this.log(`Ignoring invalid baseHeader ${header.height} ${header.hash}.`);
|
|
9944
|
-
}
|
|
9945
|
-
else {
|
|
9946
|
-
if (this.subscriberCallbacksEnabled)
|
|
9947
|
-
this.log(`addBaseHeader ${header.height}${ihr.added ? " added" : ""}${ihr.dupe ? " dupe" : ""}${ihr.isActiveTip ? " isActiveTip" : ""}${ihr.reorgDepth ? " reorg depth " + ihr.reorgDepth : ""}${ihr.noPrev ? " noPrev" : ""}${ihr.noActiveAncestor || ihr.noTip || ihr.badPrev ? " error" : ""}`);
|
|
9948
|
-
if (ihr.added) {
|
|
9949
|
-
count++;
|
|
9950
|
-
}
|
|
9951
|
-
}
|
|
9952
|
-
}
|
|
9953
|
-
}
|
|
9954
|
-
else {
|
|
9955
|
-
if (count > 0) {
|
|
9956
|
-
if (liveHeaderDupes > 0) {
|
|
9957
|
-
this.log(`${liveHeaderDupes} duplicate headers ignored.`);
|
|
9958
|
-
liveHeaderDupes = 0;
|
|
9959
|
-
}
|
|
9960
|
-
const updated = await this.storage.getAvailableHeightRanges();
|
|
9961
|
-
this.log(`After adding ${count} live headers
|
|
9962
|
-
After live: bulk ${updated.bulk}, live ${updated.live}
|
|
9963
|
-
`);
|
|
9964
|
-
count = 0;
|
|
9965
|
-
}
|
|
9966
|
-
if (!this.subscriberCallbacksEnabled) {
|
|
9967
|
-
const live = await this.storage.findLiveHeightRange();
|
|
9968
|
-
if (!live.isEmpty) {
|
|
9969
|
-
this.subscriberCallbacksEnabled = true;
|
|
9970
|
-
this.log(`listening at height of ${live.maxHeight}`);
|
|
9971
|
-
}
|
|
9972
|
-
}
|
|
9973
|
-
if (!this.available) {
|
|
9974
|
-
this.available = true;
|
|
9975
|
-
}
|
|
9976
|
-
needSyncCheck = Date.now() - lastSyncCheck > syncCheckRepeatMsecs;
|
|
9977
|
-
if (!needSyncCheck)
|
|
9978
|
-
await wait(1000);
|
|
9979
|
-
}
|
|
9980
|
-
}
|
|
9981
|
-
}
|
|
9982
|
-
}
|
|
9983
|
-
catch (eu: unknown) {
|
|
9984
|
-
const e = WalletError.fromUnknown(eu);
|
|
9985
|
-
if (!this.available) {
|
|
9986
|
-
this.startupError = e;
|
|
9987
|
-
this.stopMainThread = true;
|
|
9988
|
-
}
|
|
9989
|
-
else {
|
|
9990
|
-
this.log(`Error occurred during chaintracks main thread processing: ${e.stack || e.message}`);
|
|
9991
|
-
}
|
|
9992
|
-
}
|
|
9857
|
+
if (!skipBulkSync) {
|
|
9858
|
+
if (this.available)
|
|
9859
|
+
await this.syncBulkStorage(presentHeight, before);
|
|
9860
|
+
else
|
|
9861
|
+
await this.syncBulkStorageNoLock(presentHeight, before);
|
|
9862
|
+
if (this.startupError != null)
|
|
9863
|
+
throw this.startupError;
|
|
9864
|
+
return now;
|
|
9993
9865
|
}
|
|
9866
|
+
return lastBulkSync;
|
|
9994
9867
|
}
|
|
9995
9868
|
}
|
|
9996
9869
|
```
|
|
9997
9870
|
|
|
9998
|
-
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksFsApi](./services.md#interface-chaintracksfsapi), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [ChaintracksManagementApi](./services.md#interface-chaintracksmanagementapi), [ChaintracksOptions](./services.md#interface-chaintracksoptions), [HeaderListener](./services.md#type-headerlistener), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [LiveBlockHeader](./services.md#interface-liveblockheader), [ReorgListener](./services.md#type-reorglistener), [Services](./services.md#class-services)
|
|
9871
|
+
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksFsApi](./services.md#interface-chaintracksfsapi), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [ChaintracksManagementApi](./services.md#interface-chaintracksmanagementapi), [ChaintracksOptions](./services.md#interface-chaintracksoptions), [HeaderListener](./services.md#type-headerlistener), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [LiveBlockHeader](./services.md#interface-liveblockheader), [ReorgListener](./services.md#type-reorglistener), [Services](./services.md#class-services)
|
|
9999
9872
|
|
|
10000
9873
|
###### Method addHeader
|
|
10001
9874
|
|
|
@@ -10077,7 +9950,6 @@ using the
|
|
|
10077
9950
|
```ts
|
|
10078
9951
|
export class ChaintracksFetch implements ChaintracksFetchApi {
|
|
10079
9952
|
httpClient: HttpClient = defaultHttpClient();
|
|
10080
|
-
constructor()
|
|
10081
9953
|
async download(url: string): Promise<Uint8Array>
|
|
10082
9954
|
async fetchJson<R>(url: string): Promise<R>
|
|
10083
9955
|
pathJoin(baseUrl: string, subpath: string): string
|
|
@@ -10098,9 +9970,9 @@ export class ChaintracksServiceClient implements ChaintracksClientApi {
|
|
|
10098
9970
|
static createChaintracksServiceClientOptions(): ChaintracksServiceClientOptions
|
|
10099
9971
|
options: ChaintracksServiceClientOptions;
|
|
10100
9972
|
constructor(public chain: Chain, public serviceUrl: string, options?: ChaintracksServiceClientOptions)
|
|
10101
|
-
subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
10102
|
-
subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
10103
|
-
unsubscribe(subscriptionId: string): Promise<boolean>
|
|
9973
|
+
async subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
9974
|
+
async subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
9975
|
+
async unsubscribe(subscriptionId: string): Promise<boolean>
|
|
10104
9976
|
async currentHeight(): Promise<number>
|
|
10105
9977
|
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
10106
9978
|
async getJsonOrUndefined<T>(path: string): Promise<T | undefined>
|
|
@@ -10302,14 +10174,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10302
10174
|
|
|
10303
10175
|
```ts
|
|
10304
10176
|
export class ChaintracksStorageNoDb extends ChaintracksStorageBase {
|
|
10305
|
-
static mainData: ChaintracksNoDbData = {
|
|
10177
|
+
static readonly mainData: ChaintracksNoDbData = {
|
|
10306
10178
|
chain: "main",
|
|
10307
10179
|
liveHeaders: new Map<number, LiveBlockHeader>(),
|
|
10308
10180
|
maxHeaderId: 0,
|
|
10309
10181
|
tipHeaderId: 0,
|
|
10310
10182
|
hashToHeaderId: new Map<string, number>()
|
|
10311
10183
|
};
|
|
10312
|
-
static testData: ChaintracksNoDbData = {
|
|
10184
|
+
static readonly testData: ChaintracksNoDbData = {
|
|
10313
10185
|
chain: "test",
|
|
10314
10186
|
liveHeaders: new Map<number, LiveBlockHeader>(),
|
|
10315
10187
|
maxHeaderId: 0,
|
|
@@ -10813,9 +10685,9 @@ export class EntityProvenTx extends EntityBase<TableProvenTx> {
|
|
|
10813
10685
|
}>
|
|
10814
10686
|
override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: TrxToken): Promise<void>
|
|
10815
10687
|
override async mergeExisting(storage: EntityStorage, since: Date | undefined, ei: TableProvenTx, syncMap: SyncMap, trx?: TrxToken): Promise<boolean>
|
|
10816
|
-
static getProofAttemptsLimit = 8;
|
|
10817
|
-
static getProofMinutes = 60;
|
|
10818
|
-
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean): Promise<EntityProvenTx | undefined>
|
|
10688
|
+
static readonly getProofAttemptsLimit = 8;
|
|
10689
|
+
static readonly getProofMinutes = 60;
|
|
10690
|
+
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean, maxRebroadcastAttempts = 0): Promise<EntityProvenTx | undefined>
|
|
10819
10691
|
}
|
|
10820
10692
|
```
|
|
10821
10693
|
|
|
@@ -10826,7 +10698,7 @@ See also: [EntityBase](./storage.md#class-entitybase), [EntityProvenTxReq](./sto
|
|
|
10826
10698
|
How high attempts can go before status is forced to invalid
|
|
10827
10699
|
|
|
10828
10700
|
```ts
|
|
10829
|
-
static getProofAttemptsLimit = 8
|
|
10701
|
+
static readonly getProofAttemptsLimit = 8
|
|
10830
10702
|
```
|
|
10831
10703
|
|
|
10832
10704
|
###### Property getProofMinutes
|
|
@@ -10834,7 +10706,7 @@ static getProofAttemptsLimit = 8
|
|
|
10834
10706
|
How many hours we have to try for a poof
|
|
10835
10707
|
|
|
10836
10708
|
```ts
|
|
10837
|
-
static getProofMinutes = 60
|
|
10709
|
+
static readonly getProofMinutes = 60
|
|
10838
10710
|
```
|
|
10839
10711
|
|
|
10840
10712
|
###### Method fromReq
|
|
@@ -10844,7 +10716,7 @@ Try to create a new ProvenTx from a ProvenTxReq and GetMerkleProofResultApi
|
|
|
10844
10716
|
Otherwise it returns undefined and updates req.status to either 'unknown', 'invalid', or 'unconfirmed'
|
|
10845
10717
|
|
|
10846
10718
|
```ts
|
|
10847
|
-
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean): Promise<EntityProvenTx | undefined>
|
|
10719
|
+
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean, maxRebroadcastAttempts = 0): Promise<EntityProvenTx | undefined>
|
|
10848
10720
|
```
|
|
10849
10721
|
See also: [EntityProvenTx](./storage.md#class-entityproventx), [EntityProvenTxReq](./storage.md#class-entityproventxreq), [GetMerklePathResult](./client.md#interface-getmerklepathresult)
|
|
10850
10722
|
|
|
@@ -10882,6 +10754,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10882
10754
|
|
|
10883
10755
|
```ts
|
|
10884
10756
|
export class EntityProvenTxReq extends EntityBase<TableProvenTxReq> {
|
|
10757
|
+
static readonly wasBroadcastStatuses: ProvenTxReqStatus[] = ["unmined", "callback", "unconfirmed", "completed"];
|
|
10885
10758
|
static async fromStorageTxid(storage: EntityStorage, txid: string, trx?: TrxToken): Promise<EntityProvenTxReq | undefined>
|
|
10886
10759
|
static async fromStorageId(storage: EntityStorage, id: number, trx?: TrxToken): Promise<EntityProvenTxReq>
|
|
10887
10760
|
static fromTxid(txid: string, rawTx: number[], inputBEEF?: number[]): EntityProvenTxReq
|
|
@@ -10931,6 +10804,14 @@ export class EntityProvenTxReq extends EntityBase<TableProvenTxReq> {
|
|
|
10931
10804
|
set notified(v: boolean)
|
|
10932
10805
|
get batch()
|
|
10933
10806
|
set batch(v: string | undefined)
|
|
10807
|
+
get wasBroadcast(): boolean
|
|
10808
|
+
set wasBroadcast(v: boolean)
|
|
10809
|
+
get rebroadcastAttempts(): number
|
|
10810
|
+
set rebroadcastAttempts(v: number)
|
|
10811
|
+
applyProofTimeout(maxRebroadcastAttempts = 0): {
|
|
10812
|
+
action: "invalid" | "rebroadcast";
|
|
10813
|
+
rebroadcastAttempts: number;
|
|
10814
|
+
}
|
|
10934
10815
|
override get id()
|
|
10935
10816
|
override set id(v: number)
|
|
10936
10817
|
override get entityName(): string
|
|
@@ -10950,7 +10831,7 @@ export class EntityProvenTxReq extends EntityBase<TableProvenTxReq> {
|
|
|
10950
10831
|
}
|
|
10951
10832
|
```
|
|
10952
10833
|
|
|
10953
|
-
See also: [EntityBase](./storage.md#class-entitybase), [EntityStorage](./storage.md#type-entitystorage), [ProvenTxReqHistory](./storage.md#interface-proventxreqhistory), [ProvenTxReqHistorySummaryApi](./storage.md#interface-proventxreqhistorysummaryapi), [ProvenTxReqNotify](./storage.md#interface-proventxreqnotify), [ProvenTxReqStatus](./client.md#type-proventxreqstatus), [ReqHistoryNote](./client.md#
|
|
10834
|
+
See also: [EntityBase](./storage.md#class-entitybase), [EntityStorage](./storage.md#type-entitystorage), [ProvenTxReqHistory](./storage.md#interface-proventxreqhistory), [ProvenTxReqHistorySummaryApi](./storage.md#interface-proventxreqhistorysummaryapi), [ProvenTxReqNotify](./storage.md#interface-proventxreqnotify), [ProvenTxReqStatus](./client.md#type-proventxreqstatus), [ReqHistoryNote](./client.md#interface-reqhistorynote), [StorageProvider](./storage.md#class-storageprovider), [SyncMap](./storage.md#interface-syncmap), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TrxToken](./client.md#interface-trxtoken), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
10954
10835
|
|
|
10955
10836
|
###### Method addHistoryNote
|
|
10956
10837
|
|
|
@@ -10960,7 +10841,7 @@ Notes with identical property values to an existing note are ignored.
|
|
|
10960
10841
|
```ts
|
|
10961
10842
|
addHistoryNote(note: ReqHistoryNote, noDupes?: boolean)
|
|
10962
10843
|
```
|
|
10963
|
-
See also: [ReqHistoryNote](./client.md#
|
|
10844
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
10964
10845
|
|
|
10965
10846
|
Argument Details
|
|
10966
10847
|
|
|
@@ -11086,28 +10967,28 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
11086
10967
|
to storage: ${c.toStorageIdentityKey}
|
|
11087
10968
|
for user: ${c.userIdentityKey}
|
|
11088
10969
|
`;
|
|
11089
|
-
if (c.user)
|
|
10970
|
+
if (c.user != null)
|
|
11090
10971
|
log += ` USER activeStorage ${c.user.activeStorage}\n`;
|
|
11091
|
-
if (
|
|
11092
|
-
log +=
|
|
10972
|
+
if (c.provenTxs != null) {
|
|
10973
|
+
log += " PROVEN_TXS\n";
|
|
11093
10974
|
for (const r of c.provenTxs) {
|
|
11094
10975
|
log += ` ${r.provenTxId} ${r.txid}\n`;
|
|
11095
10976
|
}
|
|
11096
10977
|
}
|
|
11097
|
-
if (
|
|
11098
|
-
log +=
|
|
10978
|
+
if (c.provenTxReqs != null) {
|
|
10979
|
+
log += " PROVEN_TX_REQS\n";
|
|
11099
10980
|
for (const r of c.provenTxReqs) {
|
|
11100
10981
|
log += ` ${r.provenTxReqId} ${r.txid} ${r.status} ${r.provenTxId || ""}\n`;
|
|
11101
10982
|
}
|
|
11102
10983
|
}
|
|
11103
|
-
if (
|
|
11104
|
-
log +=
|
|
10984
|
+
if (c.transactions != null) {
|
|
10985
|
+
log += " TRANSACTIONS\n";
|
|
11105
10986
|
for (const r of c.transactions) {
|
|
11106
10987
|
log += ` ${r.transactionId} ${r.txid} ${r.status} ${r.provenTxId || ""} sats:${r.satoshis}\n`;
|
|
11107
10988
|
}
|
|
11108
10989
|
}
|
|
11109
|
-
if (
|
|
11110
|
-
log +=
|
|
10990
|
+
if (c.outputs != null) {
|
|
10991
|
+
log += " OUTPUTS\n";
|
|
11111
10992
|
for (const r of c.outputs) {
|
|
11112
10993
|
log += ` ${r.outputId} ${r.txid}.${r.vout} ${r.transactionId} ${r.spendable ? "spendable" : ""} sats:${r.satoshis}\n`;
|
|
11113
10994
|
}
|
|
@@ -11648,7 +11529,7 @@ export class MockChainMigrations implements MigrationSource<string> {
|
|
|
11648
11529
|
migrations: Record<string, Migration> = {};
|
|
11649
11530
|
constructor()
|
|
11650
11531
|
async getMigrations(): Promise<string[]>
|
|
11651
|
-
getMigrationName(migration: string)
|
|
11532
|
+
getMigrationName(migration: string): string
|
|
11652
11533
|
async getMigration(migration: string): Promise<Migration>
|
|
11653
11534
|
setupMigrations(): Record<string, Migration>
|
|
11654
11535
|
}
|
|
@@ -11776,7 +11657,7 @@ export class MockServices implements WalletServices {
|
|
|
11776
11657
|
}
|
|
11777
11658
|
```
|
|
11778
11659
|
|
|
11779
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [FiatExchangeRates](./client.md#interface-fiatexchangerates), [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), [MockChainStorage](./client.md#class-mockchainstorage), [MockChainTracker](./client.md#class-mockchaintracker), [MockMiner](./client.md#class-mockminer), [PostBeefResult](./client.md#interface-postbeefresult), [ReorgResult](./client.md#interface-reorgresult), [ServicesCallHistory](./client.md#
|
|
11660
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [FiatExchangeRates](./client.md#interface-fiatexchangerates), [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), [MockChainStorage](./client.md#class-mockchainstorage), [MockChainTracker](./client.md#class-mockchaintracker), [MockMiner](./client.md#class-mockminer), [PostBeefResult](./client.md#interface-postbeefresult), [ReorgResult](./client.md#interface-reorgresult), [ServicesCallHistory](./client.md#interface-servicescallhistory), [TableOutput](./storage.md#interface-tableoutput), [WalletServices](./client.md#interface-walletservices), [getBeefForTxid](./services.md#function-getbeeffortxid)
|
|
11780
11661
|
|
|
11781
11662
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11782
11663
|
|
|
@@ -11800,6 +11681,7 @@ export class Monitor {
|
|
|
11800
11681
|
onTransactionBroadcasted?: (broadcastResult: ReviewActionResult) => Promise<void>;
|
|
11801
11682
|
onTransactionProven?: (txStatus: ProvenTransactionStatus) => Promise<void>;
|
|
11802
11683
|
onTransactionStatusChanged?: (txid: string, newStatus: string) => Promise<void>;
|
|
11684
|
+
get ready(): Promise<void>
|
|
11803
11685
|
constructor(options: MonitorOptions)
|
|
11804
11686
|
async destroy(): Promise<void>
|
|
11805
11687
|
static readonly oneSecond = 1000;
|
|
@@ -12136,7 +12018,7 @@ https://brc.dev/29
|
|
|
12136
12018
|
export class ScriptTemplateBRC29 implements ScriptTemplate {
|
|
12137
12019
|
p2pkh: P2PKH;
|
|
12138
12020
|
constructor(public params: ScriptTemplateParamsBRC29)
|
|
12139
|
-
getKeyID()
|
|
12021
|
+
getKeyID(): string
|
|
12140
12022
|
getKeyDeriver(privKey: PrivateKey | HexString): KeyDeriverApi
|
|
12141
12023
|
lock(lockerPrivKey: string, unlockerPubKey: string): LockingScript
|
|
12142
12024
|
unlock(unlockerPrivKey: string, lockerPubKey: string, sourceSatoshis?: number, lockingScript?: Script): ScriptTemplateUnlock
|
|
@@ -12196,32 +12078,32 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
12196
12078
|
|
|
12197
12079
|
```ts
|
|
12198
12080
|
export class ServiceCollection<T> {
|
|
12199
|
-
services: {
|
|
12081
|
+
services: Array<{
|
|
12200
12082
|
name: string;
|
|
12201
12083
|
service: T;
|
|
12202
|
-
}
|
|
12084
|
+
}>;
|
|
12203
12085
|
_index: number;
|
|
12204
12086
|
readonly since: Date;
|
|
12205
12087
|
_historyByProvider: Record<string, ProviderCallHistory> = {};
|
|
12206
|
-
constructor(public serviceName: string, services?: {
|
|
12088
|
+
constructor(public serviceName: string, services?: Array<{
|
|
12207
12089
|
name: string;
|
|
12208
12090
|
service: T;
|
|
12209
|
-
}
|
|
12091
|
+
}>)
|
|
12210
12092
|
add(s: {
|
|
12211
12093
|
name: string;
|
|
12212
12094
|
service: T;
|
|
12213
|
-
}):
|
|
12095
|
+
}): this
|
|
12214
12096
|
remove(name: string): void
|
|
12215
|
-
get name()
|
|
12216
|
-
get service()
|
|
12097
|
+
get name(): string
|
|
12098
|
+
get service(): T
|
|
12217
12099
|
getServiceToCall(i: number): ServiceToCall<T>
|
|
12218
12100
|
get serviceToCall(): ServiceToCall<T>
|
|
12219
|
-
get allServicesToCall(): ServiceToCall<T
|
|
12220
|
-
moveServiceToLast(stc: ServiceToCall<T>)
|
|
12221
|
-
get allServices()
|
|
12222
|
-
get count()
|
|
12223
|
-
get index()
|
|
12224
|
-
reset()
|
|
12101
|
+
get allServicesToCall(): Array<ServiceToCall<T>>
|
|
12102
|
+
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
12103
|
+
get allServices(): T[]
|
|
12104
|
+
get count(): number
|
|
12105
|
+
get index(): number
|
|
12106
|
+
reset(): void
|
|
12225
12107
|
next(): number
|
|
12226
12108
|
clone(): ServiceCollection<T>
|
|
12227
12109
|
_addServiceCall(providerName: string, call: ServiceCall): ProviderCallHistory
|
|
@@ -12259,7 +12141,7 @@ A copy of current service call history
|
|
|
12259
12141
|
Used to de-prioritize a service call by moving it to the end of the list.
|
|
12260
12142
|
|
|
12261
12143
|
```ts
|
|
12262
|
-
moveServiceToLast(stc: ServiceToCall<T>)
|
|
12144
|
+
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
12263
12145
|
```
|
|
12264
12146
|
See also: [ServiceToCall](./services.md#interface-servicetocall)
|
|
12265
12147
|
|
|
@@ -12291,10 +12173,10 @@ export class Services implements WalletServices {
|
|
|
12291
12173
|
async getBsvExchangeRate(): Promise<number>
|
|
12292
12174
|
async getFiatExchangeRate(currency: FiatCurrencyCode, base?: FiatCurrencyCode): Promise<number>
|
|
12293
12175
|
async getFiatExchangeRates(targetCurrencies: FiatCurrencyCode[]): Promise<FiatExchangeRates>
|
|
12294
|
-
get getProofsCount()
|
|
12295
|
-
get getRawTxsCount()
|
|
12296
|
-
get postBeefServicesCount()
|
|
12297
|
-
get getUtxoStatsCount()
|
|
12176
|
+
get getProofsCount(): number
|
|
12177
|
+
get getRawTxsCount(): number
|
|
12178
|
+
get postBeefServicesCount(): number
|
|
12179
|
+
get getUtxoStatsCount(): number
|
|
12298
12180
|
async getStatusForTxids(txids: string[], useNext?: boolean): Promise<GetStatusForTxidsResult>
|
|
12299
12181
|
hashOutputScript(script: string): string
|
|
12300
12182
|
async isUtxo(output: TableOutput): Promise<boolean>
|
|
@@ -12317,7 +12199,7 @@ export class Services implements WalletServices {
|
|
|
12317
12199
|
}
|
|
12318
12200
|
```
|
|
12319
12201
|
|
|
12320
|
-
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [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), [ServicesCallHistory](./client.md#
|
|
12202
|
+
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [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), [ServicesCallHistory](./client.md#interface-servicescallhistory), [TableOutput](./storage.md#interface-tableoutput), [UpdateFiatExchangeRateService](./client.md#type-updatefiatexchangerateservice), [WalletServices](./client.md#interface-walletservices), [WalletServicesOptions](./client.md#interface-walletservicesoptions), [WhatsOnChain](./services.md#class-whatsonchain), [getBeefForTxid](./services.md#function-getbeeffortxid), [logger](./client.md#variable-logger)
|
|
12321
12203
|
|
|
12322
12204
|
###### Property postBeefUntilSuccessSoftTimeoutMaxMs
|
|
12323
12205
|
|
|
@@ -12385,7 +12267,7 @@ export abstract class SetupClient {
|
|
|
12385
12267
|
const services = new Services(serviceOptions);
|
|
12386
12268
|
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services, undefined, "default");
|
|
12387
12269
|
const monitor = new Monitor(monopts);
|
|
12388
|
-
const privilegedKeyManager = args.privilegedKeyGetter
|
|
12270
|
+
const privilegedKeyManager = (args.privilegedKeyGetter != null)
|
|
12389
12271
|
? new PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
12390
12272
|
: undefined;
|
|
12391
12273
|
const wallet = new Wallet({
|
|
@@ -12445,13 +12327,13 @@ export abstract class SetupClient {
|
|
|
12445
12327
|
const unlock = p2pkh.unlock(priv, "all", false, satoshis, lock);
|
|
12446
12328
|
return unlock;
|
|
12447
12329
|
}
|
|
12448
|
-
static createP2PKHOutputs(outputs: {
|
|
12330
|
+
static createP2PKHOutputs(outputs: Array<{
|
|
12449
12331
|
address: string;
|
|
12450
12332
|
satoshis: number;
|
|
12451
12333
|
outputDescription?: string;
|
|
12452
12334
|
basket?: string;
|
|
12453
12335
|
tags?: string[];
|
|
12454
|
-
}
|
|
12336
|
+
}>): CreateActionOutput[] {
|
|
12455
12337
|
const os: CreateActionOutput[] = [];
|
|
12456
12338
|
const count = outputs.length;
|
|
12457
12339
|
for (let i = 0; i < count; i++) {
|
|
@@ -12466,19 +12348,19 @@ export abstract class SetupClient {
|
|
|
12466
12348
|
}
|
|
12467
12349
|
return os;
|
|
12468
12350
|
}
|
|
12469
|
-
static async createP2PKHOutputsAction(wallet: WalletInterface, outputs: {
|
|
12351
|
+
static async createP2PKHOutputsAction(wallet: WalletInterface, outputs: Array<{
|
|
12470
12352
|
address: string;
|
|
12471
12353
|
satoshis: number;
|
|
12472
12354
|
outputDescription?: string;
|
|
12473
12355
|
basket?: string;
|
|
12474
12356
|
tags?: string[];
|
|
12475
|
-
}
|
|
12357
|
+
}>, options?: CreateActionOptions): Promise<{
|
|
12476
12358
|
cr: CreateActionResult;
|
|
12477
12359
|
outpoints: string[] | undefined;
|
|
12478
12360
|
}> {
|
|
12479
12361
|
const os = SetupClient.createP2PKHOutputs(outputs);
|
|
12480
12362
|
const createArgs: CreateActionArgs = {
|
|
12481
|
-
description:
|
|
12363
|
+
description: "createP2PKHOutputs",
|
|
12482
12364
|
outputs: os,
|
|
12483
12365
|
options: {
|
|
12484
12366
|
...options,
|
|
@@ -12492,19 +12374,19 @@ export abstract class SetupClient {
|
|
|
12492
12374
|
}
|
|
12493
12375
|
return { cr, outpoints };
|
|
12494
12376
|
}
|
|
12495
|
-
static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF): Promise<{
|
|
12377
|
+
static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF): Promise<Array<{
|
|
12496
12378
|
outpoint: string;
|
|
12497
12379
|
txid?: string;
|
|
12498
12380
|
success: boolean;
|
|
12499
12381
|
error?: string;
|
|
12500
|
-
}
|
|
12501
|
-
return _fundWalletFromP2PKHOutpoints(wallet, outpoints, p2pkhKey, SetupClient.getUnlockP2PKH.bind(SetupClient), inputBEEF);
|
|
12382
|
+
}>> {
|
|
12383
|
+
return await _fundWalletFromP2PKHOutpoints(wallet, outpoints, p2pkhKey, SetupClient.getUnlockP2PKH.bind(SetupClient), inputBEEF);
|
|
12502
12384
|
}
|
|
12503
12385
|
static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
|
|
12504
12386
|
const wo = await SetupClient.createWallet(args);
|
|
12505
12387
|
const activeStorage = await SetupClient.createStorageIdb(args);
|
|
12506
12388
|
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
12507
|
-
const { user
|
|
12389
|
+
const { user } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
12508
12390
|
const userId = user.userId;
|
|
12509
12391
|
const r: SetupWalletIdb = {
|
|
12510
12392
|
...wo,
|
|
@@ -12551,7 +12433,7 @@ static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
|
|
|
12551
12433
|
const services = new Services(serviceOptions);
|
|
12552
12434
|
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services, undefined, "default");
|
|
12553
12435
|
const monitor = new Monitor(monopts);
|
|
12554
|
-
const privilegedKeyManager = args.privilegedKeyGetter
|
|
12436
|
+
const privilegedKeyManager = (args.privilegedKeyGetter != null)
|
|
12555
12437
|
? new PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
12556
12438
|
: undefined;
|
|
12557
12439
|
const wallet = new Wallet({
|
|
@@ -12611,7 +12493,7 @@ static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb>
|
|
|
12611
12493
|
const wo = await SetupClient.createWallet(args);
|
|
12612
12494
|
const activeStorage = await SetupClient.createStorageIdb(args);
|
|
12613
12495
|
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
12614
|
-
const { user
|
|
12496
|
+
const { user } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
12615
12497
|
const userId = user.userId;
|
|
12616
12498
|
const r: SetupWalletIdb = {
|
|
12617
12499
|
...wo,
|
|
@@ -12661,6 +12543,7 @@ re-provide the privileged key manager to complete authentication.
|
|
|
12661
12543
|
```ts
|
|
12662
12544
|
export class SimpleWalletManager implements WalletInterface {
|
|
12663
12545
|
authenticated: boolean;
|
|
12546
|
+
get ready(): Promise<void>
|
|
12664
12547
|
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
|
|
12665
12548
|
async providePrimaryKey(key: number[]): Promise<void>
|
|
12666
12549
|
async providePrivilegedKeyManager(manager: PrivilegedKeyManager): Promise<void>
|
|
@@ -12886,11 +12769,49 @@ the party making requests of the remote service.
|
|
|
12886
12769
|
For details of the API implemented, follow the "See also" link for the `WalletStorageProvider` interface.
|
|
12887
12770
|
|
|
12888
12771
|
```ts
|
|
12889
|
-
export class StorageClient
|
|
12772
|
+
export class StorageClient extends StorageClientBase {
|
|
12773
|
+
constructor(wallet: WalletInterface, endpointUrl: string)
|
|
12774
|
+
protected async rpcCall<T>(method: string, params: unknown[]): Promise<T>
|
|
12775
|
+
}
|
|
12776
|
+
```
|
|
12777
|
+
|
|
12778
|
+
See also: [StorageClientBase](./storage.md#class-storageclientbase)
|
|
12779
|
+
|
|
12780
|
+
###### Method rpcCall
|
|
12781
|
+
|
|
12782
|
+
Make a JSON-RPC call to the remote server.
|
|
12783
|
+
|
|
12784
|
+
```ts
|
|
12785
|
+
protected async rpcCall<T>(method: string, params: unknown[]): Promise<T>
|
|
12786
|
+
```
|
|
12787
|
+
|
|
12788
|
+
Argument Details
|
|
12789
|
+
|
|
12790
|
+
+ **method**
|
|
12791
|
+
+ The WalletStorage method name to call.
|
|
12792
|
+
+ **params**
|
|
12793
|
+
+ The array of parameters to pass to the method in order.
|
|
12794
|
+
|
|
12795
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
12796
|
+
|
|
12797
|
+
---
|
|
12798
|
+
##### Class: StorageClientBase
|
|
12799
|
+
|
|
12800
|
+
Abstract base class shared by `StorageClient` and `StorageMobile`.
|
|
12801
|
+
|
|
12802
|
+
Contains all `WalletStorageProvider` method implementations and entity-validation
|
|
12803
|
+
helpers. Subclasses only need to provide `rpcCall`, which differs between
|
|
12804
|
+
the full (logger-aware) and mobile (lightweight) variants.
|
|
12805
|
+
|
|
12806
|
+
```ts
|
|
12807
|
+
export abstract class StorageClientBase implements WalletStorageProvider {
|
|
12890
12808
|
readonly endpointUrl: string;
|
|
12809
|
+
protected readonly authClient: AuthFetch;
|
|
12810
|
+
protected nextId = 1;
|
|
12891
12811
|
public settings?: TableSettings;
|
|
12892
12812
|
constructor(wallet: WalletInterface, endpointUrl: string)
|
|
12893
12813
|
isStorageProvider(): boolean
|
|
12814
|
+
protected abstract rpcCall<T>(method: string, params: unknown[]): Promise<T>;
|
|
12894
12815
|
isAvailable(): boolean
|
|
12895
12816
|
getSettings(): TableSettings
|
|
12896
12817
|
async makeAvailable(): Promise<TableSettings>
|
|
@@ -12930,7 +12851,7 @@ export class StorageClient implements WalletStorageProvider {
|
|
|
12930
12851
|
}
|
|
12931
12852
|
```
|
|
12932
12853
|
|
|
12933
|
-
See also: [AuthId](./client.md#interface-authid), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageInternalizeActionResult](./client.md#interface-storageinternalizeactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableUser](./storage.md#interface-tableuser), [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult), [WalletServices](./client.md#interface-walletservices), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [createAction](./storage.md#function-createaction), [getSyncChunk](./storage.md#function-getsyncchunk), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction)
|
|
12854
|
+
See also: [AuthId](./client.md#interface-authid), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageInternalizeActionResult](./client.md#interface-storageinternalizeactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableUser](./storage.md#interface-tableuser), [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult), [WalletServices](./client.md#interface-walletservices), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [createAction](./storage.md#function-createaction), [getSyncChunk](./storage.md#function-getsyncchunk), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction), [validateDate](./storage.md#function-validatedate), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity)
|
|
12934
12855
|
|
|
12935
12856
|
###### Method abortAction
|
|
12936
12857
|
|
|
@@ -13420,6 +13341,22 @@ This must match the `AuthFetch` identity securing the remote conneciton.
|
|
|
13420
13341
|
+ **args**
|
|
13421
13342
|
+ original wallet `relinquishOutput` args.
|
|
13422
13343
|
|
|
13344
|
+
###### Method rpcCall
|
|
13345
|
+
|
|
13346
|
+
Make a JSON-RPC call to the remote server.
|
|
13347
|
+
Implemented differently by each subclass (with or without logger support).
|
|
13348
|
+
|
|
13349
|
+
```ts
|
|
13350
|
+
protected abstract rpcCall<T>(method: string, params: unknown[]): Promise<T>
|
|
13351
|
+
```
|
|
13352
|
+
|
|
13353
|
+
Argument Details
|
|
13354
|
+
|
|
13355
|
+
+ **method**
|
|
13356
|
+
+ The WalletStorage method name to call.
|
|
13357
|
+
+ **params**
|
|
13358
|
+
+ The array of parameters to pass to the method in order.
|
|
13359
|
+
|
|
13423
13360
|
###### Method setActive
|
|
13424
13361
|
|
|
13425
13362
|
Ensures up-to-date wallet data replication to all configured backup storage providers,
|
|
@@ -13560,7 +13497,7 @@ export class StorageIdb extends StorageProvider implements WalletStorageProvider
|
|
|
13560
13497
|
async insertTxLabelMap(labelMap: TableTxLabelMap, trx?: TrxToken): Promise<void>
|
|
13561
13498
|
async insertUser(user: TableUser, trx?: TrxToken): Promise<number>
|
|
13562
13499
|
async updateIdb<T>(id: number | number[], update: Partial<T>, keyProp: string, storeName: string, trx?: TrxToken): Promise<number>
|
|
13563
|
-
async updateIdbKey<T>(key:
|
|
13500
|
+
async updateIdbKey<T>(key: Array<number | string>, update: Partial<T>, keyProps: string[], storeName: string, trx?: TrxToken): Promise<number>
|
|
13564
13501
|
async updateCertificate(id: number, update: Partial<TableCertificate>, trx?: TrxToken): Promise<number>
|
|
13565
13502
|
async updateCertificateField(certificateId: number, fieldName: string, update: Partial<TableCertificateField>, trx?: TrxToken): Promise<number>
|
|
13566
13503
|
async updateCommission(id: number, update: Partial<TableCommission>, trx?: TrxToken): Promise<number>
|
|
@@ -13642,7 +13579,7 @@ export class StorageIdb extends StorageProvider implements WalletStorageProvider
|
|
|
13642
13579
|
}
|
|
13643
13580
|
```
|
|
13644
13581
|
|
|
13645
|
-
See also: [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageAdminStats](./storage.md#interface-storageadminstats), [StorageIdbOptions](./storage.md#interface-storageidboptions), [StorageIdbSchema](./storage.md#interface-storageidbschema), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [listActions](./storage.md#function-listactions), [listOutputs](./storage.md#function-listoutputs), [purgeData](./storage.md#function-purgedata), [reviewStatus](./storage.md#function-reviewstatus)
|
|
13582
|
+
See also: [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageAdminStats](./storage.md#interface-storageadminstats), [StorageIdbOptions](./storage.md#interface-storageidboptions), [StorageIdbSchema](./storage.md#interface-storageidbschema), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [listActions](./storage.md#function-listactions), [listOutputs](./storage.md#function-listoutputs), [purgeData](./storage.md#function-purgedata), [reviewStatus](./storage.md#function-reviewstatus), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity)
|
|
13646
13583
|
|
|
13647
13584
|
###### Method allocateChangeInput
|
|
13648
13585
|
|
|
@@ -13769,7 +13706,11 @@ export abstract class StorageProvider extends StorageReaderWriter implements Wal
|
|
|
13769
13706
|
commissionSatoshis: number;
|
|
13770
13707
|
commissionPubKeyHex?: PubKeyHex;
|
|
13771
13708
|
maxRecursionDepth?: number;
|
|
13772
|
-
static defaultOptions()
|
|
13709
|
+
static defaultOptions(): {
|
|
13710
|
+
feeModel: StorageFeeModel;
|
|
13711
|
+
commissionSatoshis: number;
|
|
13712
|
+
commissionPubKeyHex: undefined;
|
|
13713
|
+
}
|
|
13773
13714
|
static createStorageBaseOptions(chain: Chain): StorageProviderOptions
|
|
13774
13715
|
constructor(options: StorageProviderOptions)
|
|
13775
13716
|
abstract reviewStatus(args: {
|
|
@@ -13803,7 +13744,7 @@ export abstract class StorageProvider extends StorageReaderWriter implements Wal
|
|
|
13803
13744
|
abstract adminStats(adminIdentityKey: string): Promise<AdminStatsResult>;
|
|
13804
13745
|
async recentlyActiveUsers(limit = 50, trx?: TrxToken): Promise<TableUser[]>
|
|
13805
13746
|
override isStorageProvider(): boolean
|
|
13806
|
-
setServices(v: WalletServices)
|
|
13747
|
+
setServices(v: WalletServices): void
|
|
13807
13748
|
getServices(): WalletServices
|
|
13808
13749
|
async abortAction(auth: AuthId, args: AbortActionArgs): Promise<AbortActionResult>
|
|
13809
13750
|
async internalizeAction(auth: AuthId, args: InternalizeActionArgs): Promise<StorageInternalizeActionResult>
|
|
@@ -13853,21 +13794,6 @@ Returns
|
|
|
13853
13794
|
|
|
13854
13795
|
object with invalidSpendableOutputs array. A good result is an empty array.
|
|
13855
13796
|
|
|
13856
|
-
###### Method getProvenOrReq
|
|
13857
|
-
|
|
13858
|
-
Checks if txid is a known valid ProvenTx and returns it if found.
|
|
13859
|
-
Next checks if txid is a current ProvenTxReq and returns that if found.
|
|
13860
|
-
If `newReq` is provided and an existing ProvenTxReq isn't found,
|
|
13861
|
-
use `newReq` to create a new ProvenTxReq.
|
|
13862
|
-
|
|
13863
|
-
This is safe "findOrInsert" operation using retry if unique index constraint
|
|
13864
|
-
is violated by a race condition insert.
|
|
13865
|
-
|
|
13866
|
-
```ts
|
|
13867
|
-
async getProvenOrReq(txid: string, newReq?: TableProvenTxReq, trx?: TrxToken): Promise<StorageProvenOrReq>
|
|
13868
|
-
```
|
|
13869
|
-
See also: [StorageProvenOrReq](./client.md#interface-storageprovenorreq), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TrxToken](./client.md#interface-trxtoken)
|
|
13870
|
-
|
|
13871
13797
|
###### Method getReqsAndBeefToShareWithWorld
|
|
13872
13798
|
|
|
13873
13799
|
Given an array of transaction txids with current ProvenTxReq ready-to-share status,
|
|
@@ -13987,7 +13913,7 @@ export abstract class StorageReader implements sdk.WalletStorageSyncReader {
|
|
|
13987
13913
|
}
|
|
13988
13914
|
```
|
|
13989
13915
|
|
|
13990
|
-
See also: [Chain](./client.md#type-chain), [DBType](./storage.md#type-dbtype), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReaderOptions](./storage.md#interface-storagereaderoptions), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageSyncReader](./client.md#interface-walletstoragesyncreader), [getSyncChunk](./storage.md#function-getsyncchunk)
|
|
13916
|
+
See also: [Chain](./client.md#type-chain), [DBType](./storage.md#type-dbtype), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReaderOptions](./storage.md#interface-storagereaderoptions), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageSyncReader](./client.md#interface-walletstoragesyncreader), [getSyncChunk](./storage.md#function-getsyncchunk), [validateDate](./storage.md#function-validatedate)
|
|
13991
13917
|
|
|
13992
13918
|
###### Method validateEntityDate
|
|
13993
13919
|
|
|
@@ -14015,7 +13941,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14015
13941
|
|
|
14016
13942
|
```ts
|
|
14017
13943
|
export abstract class StorageReaderWriter extends StorageReader {
|
|
14018
|
-
constructor(options: StorageReaderWriterOptions)
|
|
14019
13944
|
abstract dropAllData(): Promise<void>;
|
|
14020
13945
|
abstract migrate(storageName: string, storageIdentityKey: string): Promise<string>;
|
|
14021
13946
|
abstract findOutputTagMaps(args: FindOutputTagMapsArgs): Promise<TableOutputTagMap[]>;
|
|
@@ -14099,7 +14024,7 @@ export abstract class StorageReaderWriter extends StorageReader {
|
|
|
14099
14024
|
}
|
|
14100
14025
|
```
|
|
14101
14026
|
|
|
14102
|
-
See also: [AuthId](./client.md#interface-authid), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindStaleMerkleRootsArgs](./client.md#interface-findstalemerklerootsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReader](./storage.md#class-storagereader), [
|
|
14027
|
+
See also: [AuthId](./client.md#interface-authid), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindStaleMerkleRootsArgs](./client.md#interface-findstalemerklerootsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReader](./storage.md#class-storagereader), [SyncChunk](./client.md#interface-syncchunk), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken)
|
|
14103
14028
|
|
|
14104
14029
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
14105
14030
|
|
|
@@ -14115,7 +14040,7 @@ and the `StorageBaseReader` to be protected.
|
|
|
14115
14040
|
export class StorageSyncReader implements sdk.WalletStorageSyncReader {
|
|
14116
14041
|
constructor(public auth: sdk.AuthId, public storage: StorageReader)
|
|
14117
14042
|
async makeAvailable(): Promise<TableSettings>
|
|
14118
|
-
destroy(): Promise<void>
|
|
14043
|
+
async destroy(): Promise<void>
|
|
14119
14044
|
async getSyncChunk(args: sdk.RequestSyncChunkArgs): Promise<sdk.SyncChunk>
|
|
14120
14045
|
}
|
|
14121
14046
|
```
|
|
@@ -14133,7 +14058,7 @@ when transactions are MINED.
|
|
|
14133
14058
|
|
|
14134
14059
|
```ts
|
|
14135
14060
|
export class TaskArcadeSSE extends WalletMonitorTask {
|
|
14136
|
-
static taskName = "ArcadeSSE";
|
|
14061
|
+
static readonly taskName = "ArcadeSSE";
|
|
14137
14062
|
sseClient: ArcSSEClient | null = null;
|
|
14138
14063
|
constructor(monitor: Monitor)
|
|
14139
14064
|
override async asyncSetup(): Promise<void>
|
|
@@ -14165,7 +14090,7 @@ the original ProvenTxReq status is advanced to 'notifying'.
|
|
|
14165
14090
|
|
|
14166
14091
|
```ts
|
|
14167
14092
|
export class TaskCheckForProofs extends WalletMonitorTask {
|
|
14168
|
-
static taskName = "CheckForProofs";
|
|
14093
|
+
static readonly taskName = "CheckForProofs";
|
|
14169
14094
|
static checkNow = false;
|
|
14170
14095
|
constructor(monitor: Monitor, public triggerMsecs = 0)
|
|
14171
14096
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14215,7 +14140,7 @@ the original ProvenTxReq status is advanced to 'notifying'.
|
|
|
14215
14140
|
|
|
14216
14141
|
```ts
|
|
14217
14142
|
export class TaskCheckNoSends extends WalletMonitorTask {
|
|
14218
|
-
static taskName = "CheckNoSends";
|
|
14143
|
+
static readonly taskName = "CheckNoSends";
|
|
14219
14144
|
static checkNow = false;
|
|
14220
14145
|
constructor(monitor: Monitor, public triggerMsecs = Monitor.oneDay * 1)
|
|
14221
14146
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14253,7 +14178,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14253
14178
|
|
|
14254
14179
|
```ts
|
|
14255
14180
|
export class TaskClock extends WalletMonitorTask {
|
|
14256
|
-
static taskName = "Clock";
|
|
14181
|
+
static readonly taskName = "Clock";
|
|
14257
14182
|
nextMinute: number;
|
|
14258
14183
|
constructor(monitor: Monitor, public triggerMsecs = 1 * Monitor.oneSecond)
|
|
14259
14184
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14280,7 +14205,7 @@ outputs are not spendable.
|
|
|
14280
14205
|
|
|
14281
14206
|
```ts
|
|
14282
14207
|
export class TaskFailAbandoned extends WalletMonitorTask {
|
|
14283
|
-
static taskName = "FailAbandoned";
|
|
14208
|
+
static readonly taskName = "FailAbandoned";
|
|
14284
14209
|
constructor(monitor: Monitor, public triggerMsecs = 1000 * 60 * 5)
|
|
14285
14210
|
trigger(nowMsecsSinceEpoch: number): {
|
|
14286
14211
|
run: boolean;
|
|
@@ -14298,7 +14223,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14298
14223
|
|
|
14299
14224
|
```ts
|
|
14300
14225
|
export class TaskMineBlock extends WalletMonitorTask {
|
|
14301
|
-
static taskName = "MineBlock";
|
|
14226
|
+
static readonly taskName = "MineBlock";
|
|
14302
14227
|
static mineNow = false;
|
|
14303
14228
|
constructor(monitor: Monitor, public triggerMsecs = 10 * Monitor.oneMinute)
|
|
14304
14229
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14317,7 +14242,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14317
14242
|
|
|
14318
14243
|
```ts
|
|
14319
14244
|
export class TaskMonitorCallHistory extends WalletMonitorTask {
|
|
14320
|
-
static taskName = "MonitorCallHistory";
|
|
14245
|
+
static readonly taskName = "MonitorCallHistory";
|
|
14321
14246
|
constructor(monitor: Monitor, public triggerMsecs = Monitor.oneMinute * 12)
|
|
14322
14247
|
trigger(nowMsecsSinceEpoch: number): {
|
|
14323
14248
|
run: boolean;
|
|
@@ -14346,7 +14271,7 @@ with that header height as the limit for which proofs are accepted.
|
|
|
14346
14271
|
|
|
14347
14272
|
```ts
|
|
14348
14273
|
export class TaskNewHeader extends WalletMonitorTask {
|
|
14349
|
-
static taskName = "NewHeader";
|
|
14274
|
+
static readonly taskName = "NewHeader";
|
|
14350
14275
|
header?: BlockHeader;
|
|
14351
14276
|
queuedHeader?: BlockHeader;
|
|
14352
14277
|
queuedHeaderWhen?: Date;
|
|
@@ -14383,7 +14308,7 @@ See also: [BlockHeader](./client.md#interface-blockheader)
|
|
|
14383
14308
|
|
|
14384
14309
|
###### Method asyncSetup
|
|
14385
14310
|
|
|
14386
|
-
|
|
14311
|
+
This is a temporary incomplete solution for which a full chaintracker
|
|
14387
14312
|
with new header and reorg event notification is required.
|
|
14388
14313
|
|
|
14389
14314
|
New header events drive retrieving merklePaths for newly mined transactions.
|
|
@@ -14406,7 +14331,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14406
14331
|
|
|
14407
14332
|
```ts
|
|
14408
14333
|
export class TaskPurge extends WalletMonitorTask {
|
|
14409
|
-
static taskName = "Purge";
|
|
14334
|
+
static readonly taskName = "Purge";
|
|
14410
14335
|
static checkNow = false;
|
|
14411
14336
|
constructor(monitor: Monitor, public params: TaskPurgeParams, public triggerMsecs = 0)
|
|
14412
14337
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14456,7 +14381,7 @@ createAction fails to verify a generated beef against the chaintracker.
|
|
|
14456
14381
|
|
|
14457
14382
|
```ts
|
|
14458
14383
|
export class TaskReorg extends WalletMonitorTask {
|
|
14459
|
-
static taskName = "Reorg";
|
|
14384
|
+
static readonly taskName = "Reorg";
|
|
14460
14385
|
process: DeactivedHeader[] = [];
|
|
14461
14386
|
constructor(monitor: Monitor, public agedMsecs = Monitor.oneMinute * 10, public maxRetries = 3)
|
|
14462
14387
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14497,7 +14422,7 @@ back to 'unfail' so existing recovery handling can re-process them.
|
|
|
14497
14422
|
|
|
14498
14423
|
```ts
|
|
14499
14424
|
export class TaskReviewDoubleSpends extends WalletMonitorTask {
|
|
14500
|
-
static taskName = "ReviewDoubleSpends";
|
|
14425
|
+
static readonly taskName = "ReviewDoubleSpends";
|
|
14501
14426
|
static checkNow = false;
|
|
14502
14427
|
triggerNextMsecs: number;
|
|
14503
14428
|
constructor(monitor: Monitor, public triggerMsecs = Monitor.oneMinute * 12, public reviewLimit = 100, public minAgeMinutes = 60, public triggerQuickMsecs = Monitor.oneMinute * 1)
|
|
@@ -14527,7 +14452,7 @@ the currently canonical merkleRoot at a height no longer matches stored proven_t
|
|
|
14527
14452
|
|
|
14528
14453
|
```ts
|
|
14529
14454
|
export class TaskReviewProvenTxs extends WalletMonitorTask {
|
|
14530
|
-
static taskName = "ReviewProvenTxs";
|
|
14455
|
+
static readonly taskName = "ReviewProvenTxs";
|
|
14531
14456
|
static checkNow = false;
|
|
14532
14457
|
triggerNextMsecs: number;
|
|
14533
14458
|
constructor(monitor: Monitor, public triggerMsecs = Monitor.oneMinute * 10, public maxHeightsPerRun = 100, public minBlockAge = 100, public triggerQuickMsecs = Monitor.oneMinute * 1)
|
|
@@ -14557,7 +14482,7 @@ Looks for reqs with 'invalid' status that have corresonding transactions with st
|
|
|
14557
14482
|
|
|
14558
14483
|
```ts
|
|
14559
14484
|
export class TaskReviewStatus extends WalletMonitorTask {
|
|
14560
|
-
static taskName = "ReviewStatus";
|
|
14485
|
+
static readonly taskName = "ReviewStatus";
|
|
14561
14486
|
static checkNow = false;
|
|
14562
14487
|
constructor(monitor: Monitor, public triggerMsecs = 1000 * 60 * 15, public agedMsecs = 1000 * 60 * 5)
|
|
14563
14488
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14588,7 +14513,7 @@ The task itself is disabled and will not run on a schedule; review must be trigg
|
|
|
14588
14513
|
|
|
14589
14514
|
```ts
|
|
14590
14515
|
export class TaskReviewUtxos extends WalletMonitorTask {
|
|
14591
|
-
static taskName = "ReviewUtxos";
|
|
14516
|
+
static readonly taskName = "ReviewUtxos";
|
|
14592
14517
|
static checkNow = false;
|
|
14593
14518
|
constructor(monitor: Monitor, public triggerMsecs = 0, public userLimit = 10, public userOffset = 0, public tags: string[] = ["release", "all"])
|
|
14594
14519
|
trigger(_nowMsecsSinceEpoch: number): {
|
|
@@ -14608,7 +14533,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14608
14533
|
|
|
14609
14534
|
```ts
|
|
14610
14535
|
export class TaskSendWaiting extends WalletMonitorTask {
|
|
14611
|
-
static taskName = "SendWaiting";
|
|
14536
|
+
static readonly taskName = "SendWaiting";
|
|
14612
14537
|
lastSendingRunMsecsSinceEpoch: number | undefined;
|
|
14613
14538
|
includeSending: boolean = true;
|
|
14614
14539
|
triggerNextMsecs: number;
|
|
@@ -14682,7 +14607,7 @@ If it fails (to find a merklePath), returns the req status to 'invalid'.
|
|
|
14682
14607
|
|
|
14683
14608
|
```ts
|
|
14684
14609
|
export class TaskUnFail extends WalletMonitorTask {
|
|
14685
|
-
static taskName = "UnFail";
|
|
14610
|
+
static readonly taskName = "UnFail";
|
|
14686
14611
|
static checkNow = false;
|
|
14687
14612
|
constructor(monitor: Monitor, public triggerMsecs = Monitor.oneMinute * 10)
|
|
14688
14613
|
trigger(nowMsecsSinceEpoch: number): {
|
|
@@ -14741,15 +14666,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
14741
14666
|
|
|
14742
14667
|
```ts
|
|
14743
14668
|
export class WABClient {
|
|
14744
|
-
constructor(private serverUrl: string)
|
|
14745
|
-
public async getInfo()
|
|
14669
|
+
constructor(private readonly serverUrl: string)
|
|
14670
|
+
public async getInfo(): Promise<any>
|
|
14746
14671
|
public generateRandomPresentationKey(): string
|
|
14747
|
-
public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
14748
|
-
public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
14749
|
-
public async listLinkedMethods(presentationKey: string)
|
|
14750
|
-
public async unlinkMethod(presentationKey: string, authMethodId: number)
|
|
14751
|
-
public async requestFaucet(presentationKey: string)
|
|
14752
|
-
public async deleteUser(presentationKey: string)
|
|
14672
|
+
public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<any>
|
|
14673
|
+
public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<any>
|
|
14674
|
+
public async listLinkedMethods(presentationKey: string): Promise<any>
|
|
14675
|
+
public async unlinkMethod(presentationKey: string, authMethodId: number): Promise<any>
|
|
14676
|
+
public async requestFaucet(presentationKey: string): Promise<any>
|
|
14677
|
+
public async deleteUser(presentationKey: string): Promise<any>
|
|
14753
14678
|
public async startShareAuth(methodType: string, userIdHash: string, payload: any): Promise<{
|
|
14754
14679
|
success: boolean;
|
|
14755
14680
|
message: string;
|
|
@@ -14783,7 +14708,7 @@ See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
|
|
|
14783
14708
|
Complete an Auth Method flow
|
|
14784
14709
|
|
|
14785
14710
|
```ts
|
|
14786
|
-
public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
14711
|
+
public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<any>
|
|
14787
14712
|
```
|
|
14788
14713
|
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
|
|
14789
14714
|
|
|
@@ -14813,7 +14738,7 @@ Argument Details
|
|
|
14813
14738
|
Delete user
|
|
14814
14739
|
|
|
14815
14740
|
```ts
|
|
14816
|
-
public async deleteUser(presentationKey: string)
|
|
14741
|
+
public async deleteUser(presentationKey: string): Promise<any>
|
|
14817
14742
|
```
|
|
14818
14743
|
|
|
14819
14744
|
###### Method generateRandomPresentationKey
|
|
@@ -14829,7 +14754,7 @@ public generateRandomPresentationKey(): string
|
|
|
14829
14754
|
Return the WAB server info
|
|
14830
14755
|
|
|
14831
14756
|
```ts
|
|
14832
|
-
public async getInfo()
|
|
14757
|
+
public async getInfo(): Promise<any>
|
|
14833
14758
|
```
|
|
14834
14759
|
|
|
14835
14760
|
###### Method listLinkedMethods
|
|
@@ -14837,7 +14762,7 @@ public async getInfo()
|
|
|
14837
14762
|
List user-linked methods
|
|
14838
14763
|
|
|
14839
14764
|
```ts
|
|
14840
|
-
public async listLinkedMethods(presentationKey: string)
|
|
14765
|
+
public async listLinkedMethods(presentationKey: string): Promise<any>
|
|
14841
14766
|
```
|
|
14842
14767
|
|
|
14843
14768
|
###### Method requestFaucet
|
|
@@ -14845,7 +14770,7 @@ public async listLinkedMethods(presentationKey: string)
|
|
|
14845
14770
|
Request faucet
|
|
14846
14771
|
|
|
14847
14772
|
```ts
|
|
14848
|
-
public async requestFaucet(presentationKey: string)
|
|
14773
|
+
public async requestFaucet(presentationKey: string): Promise<any>
|
|
14849
14774
|
```
|
|
14850
14775
|
|
|
14851
14776
|
###### Method retrieveShare
|
|
@@ -14875,7 +14800,7 @@ Argument Details
|
|
|
14875
14800
|
Start an Auth Method flow
|
|
14876
14801
|
|
|
14877
14802
|
```ts
|
|
14878
|
-
public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
14803
|
+
public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<any>
|
|
14879
14804
|
```
|
|
14880
14805
|
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
|
|
14881
14806
|
|
|
@@ -14929,7 +14854,7 @@ Argument Details
|
|
|
14929
14854
|
Unlink a given Auth Method by ID
|
|
14930
14855
|
|
|
14931
14856
|
```ts
|
|
14932
|
-
public async unlinkMethod(presentationKey: string, authMethodId: number)
|
|
14857
|
+
public async unlinkMethod(presentationKey: string, authMethodId: number): Promise<any>
|
|
14933
14858
|
```
|
|
14934
14859
|
|
|
14935
14860
|
###### Method updateShare
|
|
@@ -15252,15 +15177,15 @@ export class Wallet implements WalletInterface, ProtoWallet {
|
|
|
15252
15177
|
async destroy(): Promise<void>
|
|
15253
15178
|
getClientChangeKeyPair(): KeyPair
|
|
15254
15179
|
async getIdentityKey(): Promise<PubKeyHex>
|
|
15255
|
-
getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
|
|
15256
|
-
revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
|
|
15257
|
-
revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
|
|
15258
|
-
encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
|
|
15259
|
-
decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
|
|
15260
|
-
createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
|
|
15261
|
-
verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
|
|
15262
|
-
createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
|
|
15263
|
-
verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
|
|
15180
|
+
async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
|
|
15181
|
+
async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
|
|
15182
|
+
async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
|
|
15183
|
+
async encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
|
|
15184
|
+
async decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
|
|
15185
|
+
async createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
|
|
15186
|
+
async verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
|
|
15187
|
+
async createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
|
|
15188
|
+
async verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
|
|
15264
15189
|
getServices(): WalletServices
|
|
15265
15190
|
getKnownTxids(newKnownTxids?: string[]): string[]
|
|
15266
15191
|
getStorageIdentity(): StorageIdentity
|
|
@@ -15568,7 +15493,7 @@ export class WalletError extends Error implements WalletErrorObject {
|
|
|
15568
15493
|
description: string;
|
|
15569
15494
|
}
|
|
15570
15495
|
protected toJson(): string
|
|
15571
|
-
static unknownToJson(error: unknown
|
|
15496
|
+
static unknownToJson(error: unknown): string
|
|
15572
15497
|
}
|
|
15573
15498
|
```
|
|
15574
15499
|
|
|
@@ -15618,9 +15543,8 @@ Safely serializes a WalletError derived, WERR_REVIEW_ACTIONS (special case), Err
|
|
|
15618
15543
|
Safely means avoiding deep, large, circular issues.
|
|
15619
15544
|
|
|
15620
15545
|
```ts
|
|
15621
|
-
static unknownToJson(error: unknown
|
|
15546
|
+
static unknownToJson(error: unknown): string
|
|
15622
15547
|
```
|
|
15623
|
-
See also: [WalletError](./client.md#class-walleterror)
|
|
15624
15548
|
|
|
15625
15549
|
Returns
|
|
15626
15550
|
|
|
@@ -15775,7 +15699,7 @@ export class WalletPermissionsManager implements WalletInterface {
|
|
|
15775
15699
|
originator: string;
|
|
15776
15700
|
satoshis: number;
|
|
15777
15701
|
lineItems?: Array<{
|
|
15778
|
-
type:
|
|
15702
|
+
type: LineItemType;
|
|
15779
15703
|
description: string;
|
|
15780
15704
|
satoshis: number;
|
|
15781
15705
|
}>;
|
|
@@ -15870,7 +15794,7 @@ export class WalletPermissionsManager implements WalletInterface {
|
|
|
15870
15794
|
}
|
|
15871
15795
|
```
|
|
15872
15796
|
|
|
15873
|
-
See also: [CounterpartyPermissionEventHandler](./client.md#type-counterpartypermissioneventhandler), [CounterpartyPermissions](./client.md#interface-counterpartypermissions), [GroupedPermissionEventHandler](./client.md#type-groupedpermissioneventhandler), [GroupedPermissions](./client.md#interface-groupedpermissions), [PermissionEventHandler](./client.md#type-permissioneventhandler), [PermissionToken](./client.md#interface-permissiontoken), [PermissionsManagerConfig](./client.md#interface-permissionsmanagerconfig), [WalletPermissionsManagerCallbacks](./client.md#interface-walletpermissionsmanagercallbacks), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
|
|
15797
|
+
See also: [CounterpartyPermissionEventHandler](./client.md#type-counterpartypermissioneventhandler), [CounterpartyPermissions](./client.md#interface-counterpartypermissions), [GroupedPermissionEventHandler](./client.md#type-groupedpermissioneventhandler), [GroupedPermissions](./client.md#interface-groupedpermissions), [LineItemType](./client.md#type-lineitemtype), [PermissionEventHandler](./client.md#type-permissioneventhandler), [PermissionToken](./client.md#interface-permissiontoken), [PermissionsManagerConfig](./client.md#interface-permissionsmanagerconfig), [WalletPermissionsManagerCallbacks](./client.md#interface-walletpermissionsmanagercallbacks), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
|
|
15874
15798
|
|
|
15875
15799
|
###### Constructor
|
|
15876
15800
|
|
|
@@ -15910,19 +15834,6 @@ Argument Details
|
|
|
15910
15834
|
+ **handler**
|
|
15911
15835
|
+ A function that handles the event
|
|
15912
15836
|
|
|
15913
|
-
###### Method denyGroupedPermission
|
|
15914
|
-
|
|
15915
|
-
Denies a previously requested grouped permission.
|
|
15916
|
-
|
|
15917
|
-
```ts
|
|
15918
|
-
public async denyGroupedPermission(requestID: string): Promise<void>
|
|
15919
|
-
```
|
|
15920
|
-
|
|
15921
|
-
Argument Details
|
|
15922
|
-
|
|
15923
|
-
+ **requestID**
|
|
15924
|
-
+ The ID of the request being denied.
|
|
15925
|
-
|
|
15926
15837
|
###### Method denyPermission
|
|
15927
15838
|
|
|
15928
15839
|
Denies a previously requested permission.
|
|
@@ -16012,7 +15923,7 @@ public async ensureSpendingAuthorization({ originator, satoshis, lineItems, reas
|
|
|
16012
15923
|
originator: string;
|
|
16013
15924
|
satoshis: number;
|
|
16014
15925
|
lineItems?: Array<{
|
|
16015
|
-
type:
|
|
15926
|
+
type: LineItemType;
|
|
16016
15927
|
description: string;
|
|
16017
15928
|
satoshis: number;
|
|
16018
15929
|
}>;
|
|
@@ -16020,6 +15931,7 @@ public async ensureSpendingAuthorization({ originator, satoshis, lineItems, reas
|
|
|
16020
15931
|
seekPermission?: boolean;
|
|
16021
15932
|
}): Promise<boolean>
|
|
16022
15933
|
```
|
|
15934
|
+
See also: [LineItemType](./client.md#type-lineitemtype)
|
|
16023
15935
|
|
|
16024
15936
|
###### Method grantGroupedPermission
|
|
16025
15937
|
|
|
@@ -16262,7 +16174,7 @@ Manages wallet settings
|
|
|
16262
16174
|
```ts
|
|
16263
16175
|
export class WalletSettingsManager {
|
|
16264
16176
|
kv: LocalKVStore;
|
|
16265
|
-
constructor(private wallet: WalletInterface, private config: WalletSettingsManagerConfig = {
|
|
16177
|
+
constructor(private readonly wallet: WalletInterface, private readonly config: WalletSettingsManagerConfig = {
|
|
16266
16178
|
defaultSettings: DEFAULT_SETTINGS
|
|
16267
16179
|
})
|
|
16268
16180
|
async get(): Promise<WalletSettings>
|
|
@@ -16375,7 +16287,7 @@ export class WalletStorageManager implements sdk.WalletStorage {
|
|
|
16375
16287
|
async runAsStorageProvider<R>(sync: (active: StorageProvider) => Promise<R>): Promise<R>
|
|
16376
16288
|
isActiveStorageProvider(): boolean
|
|
16377
16289
|
async addWalletStorageProvider(provider: sdk.WalletStorageProvider): Promise<void>
|
|
16378
|
-
setServices(v: sdk.WalletServices)
|
|
16290
|
+
setServices(v: sdk.WalletServices): void
|
|
16379
16291
|
getServices(): sdk.WalletServices
|
|
16380
16292
|
getSettings(): TableSettings
|
|
16381
16293
|
async migrate(storageName: string, storageIdentityKey: string): Promise<string>
|
|
@@ -16516,26 +16428,6 @@ Returns
|
|
|
16516
16428
|
|
|
16517
16429
|
true if the active `WalletStorageProvider` also implements `StorageProvider`
|
|
16518
16430
|
|
|
16519
|
-
###### Method makeAvailable
|
|
16520
|
-
|
|
16521
|
-
This async function must be called after construction and before
|
|
16522
|
-
any other async function can proceed.
|
|
16523
|
-
|
|
16524
|
-
Runs through `_stores` validating all properties and partitioning across `_active`, `_backups`, `_conflictingActives`.
|
|
16525
|
-
|
|
16526
|
-
```ts
|
|
16527
|
-
async makeAvailable(): Promise<TableSettings>
|
|
16528
|
-
```
|
|
16529
|
-
See also: [TableSettings](./storage.md#interface-tablesettings)
|
|
16530
|
-
|
|
16531
|
-
Returns
|
|
16532
|
-
|
|
16533
|
-
from the active storage.
|
|
16534
|
-
|
|
16535
|
-
Throws
|
|
16536
|
-
|
|
16537
|
-
WERR_INVALID_PARAMETER if canMakeAvailable returns false.
|
|
16538
|
-
|
|
16539
16431
|
###### Method reproveHeader
|
|
16540
16432
|
|
|
16541
16433
|
For each proven_txs record currently sourcing its transaction merkle proof from the given deactivated header,
|
|
@@ -16564,23 +16456,6 @@ async reproveHeightMerkleRoot(height: number, staleMerkleRoot: string): Promise<
|
|
|
16564
16456
|
```
|
|
16565
16457
|
See also: [ReproveHeaderResult](./client.md#interface-reproveheaderresult)
|
|
16566
16458
|
|
|
16567
|
-
###### Method reproveProven
|
|
16568
|
-
|
|
16569
|
-
Attempt to reprove the transaction against the current chain,
|
|
16570
|
-
If a new valid proof is found and noUpdate is not true,
|
|
16571
|
-
update the proven_txs record with new block and merkle proof data.
|
|
16572
|
-
If noUpdate is true, the update to be applied is available in the returned result.
|
|
16573
|
-
|
|
16574
|
-
```ts
|
|
16575
|
-
async reproveProven(ptx: TableProvenTx, noUpdate?: boolean): Promise<sdk.ReproveProvenResult>
|
|
16576
|
-
```
|
|
16577
|
-
See also: [ReproveProvenResult](./client.md#interface-reproveprovenresult), [TableProvenTx](./storage.md#interface-tableproventx)
|
|
16578
|
-
|
|
16579
|
-
Argument Details
|
|
16580
|
-
|
|
16581
|
-
+ **ptx**
|
|
16582
|
-
+ proven_txs record to reprove
|
|
16583
|
-
|
|
16584
16459
|
###### Method runAsSync
|
|
16585
16460
|
|
|
16586
16461
|
```ts
|
|
@@ -16760,9 +16635,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
16760
16635
|
```ts
|
|
16761
16636
|
export class WhatsOnChainServices {
|
|
16762
16637
|
static createWhatsOnChainServicesOptions(chain: Chain): WhatsOnChainServicesOptions
|
|
16763
|
-
static chainInfo:
|
|
16764
|
-
static chainInfoTime:
|
|
16765
|
-
static chainInfoMsecs: number[] = [];
|
|
16638
|
+
static readonly chainInfo: Array<WocChainInfo | undefined> = [];
|
|
16639
|
+
static readonly chainInfoTime: Array<Date | undefined> = [];
|
|
16640
|
+
static readonly chainInfoMsecs: number[] = [];
|
|
16766
16641
|
chain: Chain;
|
|
16767
16642
|
woc: WhatsOnChain;
|
|
16768
16643
|
constructor(public options: WhatsOnChainServicesOptions)
|
|
@@ -16795,57 +16670,73 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
16795
16670
|
|
|
16796
16671
|
| | | |
|
|
16797
16672
|
| --- | --- | --- |
|
|
16798
|
-
| [WalletErrorFromJson](#function-walleterrorfromjson) | [
|
|
16799
|
-
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [
|
|
16800
|
-
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [
|
|
16801
|
-
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [
|
|
16802
|
-
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [
|
|
16803
|
-
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [
|
|
16804
|
-
| [addWork](#function-addwork) | [
|
|
16805
|
-
| [arcDefaultUrl](#function-arcdefaulturl) | [
|
|
16806
|
-
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [
|
|
16807
|
-
| [arraysEqual](#function-arraysequal) | [
|
|
16808
|
-
| [asArray](#function-asarray) | [
|
|
16809
|
-
| [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [
|
|
16810
|
-
| [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [
|
|
16811
|
-
| [asBsvSdkScript](#function-asbsvsdkscript) | [
|
|
16812
|
-
| [asBsvSdkTx](#function-asbsvsdktx) | [
|
|
16813
|
-
| [asString](#function-asstring) | [
|
|
16814
|
-
| [asUint8Array](#function-asuint8array) | [
|
|
16815
|
-
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [
|
|
16816
|
-
| [blockHash](#function-blockhash) | [
|
|
16817
|
-
| [buildBeefForOutpoints](#function-buildbeefforoutpoints) | [
|
|
16818
|
-
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [
|
|
16819
|
-
| [buildSignableTransaction](#function-buildsignabletransaction) | [
|
|
16820
|
-
| [
|
|
16821
|
-
| [
|
|
16822
|
-
| [
|
|
16823
|
-
| [
|
|
16824
|
-
| [
|
|
16825
|
-
| [
|
|
16826
|
-
| [
|
|
16827
|
-
| [
|
|
16828
|
-
| [
|
|
16829
|
-
| [
|
|
16830
|
-
| [
|
|
16831
|
-
| [
|
|
16832
|
-
| [
|
|
16833
|
-
| [
|
|
16834
|
-
| [
|
|
16835
|
-
| [
|
|
16836
|
-
| [
|
|
16837
|
-
| [
|
|
16838
|
-
| [
|
|
16839
|
-
| [
|
|
16840
|
-
| [
|
|
16841
|
-
| [
|
|
16842
|
-
| [
|
|
16843
|
-
| [
|
|
16844
|
-
| [
|
|
16845
|
-
| [
|
|
16846
|
-
| [
|
|
16847
|
-
| [
|
|
16848
|
-
| [
|
|
16673
|
+
| [WalletErrorFromJson](#function-walleterrorfromjson) | [importSingleOutpoint](#function-importsingleoutpoint) | [sha256Hash](#function-sha256hash) |
|
|
16674
|
+
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [internalizeAction](#function-internalizeaction) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) |
|
|
16675
|
+
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [internalizeAction](#function-internalizeaction) | [shareReqsWithWorld](#function-sharereqswithworld) |
|
|
16676
|
+
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [isBaseBlockHeader](#function-isbaseblockheader) | [signAction](#function-signaction) |
|
|
16677
|
+
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [isBlockHeader](#function-isblockheader) | [signAndComplete](#function-signandcomplete) |
|
|
16678
|
+
| [acquireDirectCertificate](#function-acquiredirectcertificate) | [isCreateActionSpecOp](#function-iscreateactionspecop) | [stampLog](#function-stamplog) |
|
|
16679
|
+
| [addWork](#function-addwork) | [isKnownValidBulkHeaderFile](#function-isknownvalidbulkheaderfile) | [stampLogFormat](#function-stamplogformat) |
|
|
16680
|
+
| [arcDefaultUrl](#function-arcdefaulturl) | [isListActionsSpecOp](#function-islistactionsspecop) | [subWork](#function-subwork) |
|
|
16681
|
+
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [isListOutputsSpecOp](#function-islistoutputsspecop) | [swapByteOrder](#function-swapbyteorder) |
|
|
16682
|
+
| [arraysEqual](#function-arraysequal) | [isLive](#function-islive) | [throwDummyReviewActions](#function-throwdummyreviewactions) |
|
|
16683
|
+
| [asArray](#function-asarray) | [isLiveBlockHeader](#function-isliveblockheader) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) |
|
|
16684
|
+
| [asBsvSdkPrivateKey](#function-asbsvsdkprivatekey) | [isMoreWork](#function-ismorework) | [toLookupNetworkPreset](#function-tolookupnetworkpreset) |
|
|
16685
|
+
| [asBsvSdkPublickKey](#function-asbsvsdkpublickkey) | [keyOffsetToHashedSecret](#function-keyoffsettohashedsecret) | [toWalletNetwork](#function-towalletnetwork) |
|
|
16686
|
+
| [asBsvSdkScript](#function-asbsvsdkscript) | [listActionsIdb](#function-listactionsidb) | [transactionInputSize](#function-transactioninputsize) |
|
|
16687
|
+
| [asBsvSdkTx](#function-asbsvsdktx) | [listCertificates](#function-listcertificates) | [transactionOutputSize](#function-transactionoutputsize) |
|
|
16688
|
+
| [asString](#function-asstring) | [listOutputsIdb](#function-listoutputsidb) | [transactionSize](#function-transactionsize) |
|
|
16689
|
+
| [asUint8Array](#function-asuint8array) | [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) |
|
|
16690
|
+
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [logCreateActionArgs](#function-logcreateactionargs) | [updateExchangeratesapi](#function-updateexchangeratesapi) |
|
|
16691
|
+
| [blockHash](#function-blockhash) | [logWalletError](#function-logwalleterror) | [updateReqsFromAggregateResults](#function-updatereqsfromaggregateresults) |
|
|
16692
|
+
| [buildBeefForOutpoints](#function-buildbeefforoutpoints) | [makeAtomicBeef](#function-makeatomicbeef) | [upgradeAllStoresV1](#function-upgradeallstoresv1) |
|
|
16693
|
+
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [makeBrc114ActionTimeLabel](#function-makebrc114actiontimelabel) | [upgradeCertificateFields](#function-upgradecertificatefields) |
|
|
16694
|
+
| [buildSignableTransaction](#function-buildsignabletransaction) | [makeChangeLock](#function-makechangelock) | [upgradeCertificates](#function-upgradecertificates) |
|
|
16695
|
+
| [classifyMerklePathResponse](#function-classifymerklepathresponse) | [makeMerklePathNote](#function-makemerklepathnote) | [upgradeCommissions](#function-upgradecommissions) |
|
|
16696
|
+
| [classifyReqStatus](#function-classifyreqstatus) | [markStaleInputsAsSpent](#function-markstaleinputsasspent) | [upgradeMonitorEvents](#function-upgrademonitorevents) |
|
|
16697
|
+
| [completeSignedTransaction](#function-completesignedtransaction) | [matchesCertificateFieldPartial](#function-matchescertificatefieldpartial) | [upgradeOutputBaskets](#function-upgradeoutputbaskets) |
|
|
16698
|
+
| [computeMerklePath](#function-computemerklepath) | [matchesCertificatePartial](#function-matchescertificatepartial) | [upgradeOutputTags](#function-upgradeoutputtags) |
|
|
16699
|
+
| [computeMerkleRoot](#function-computemerkleroot) | [matchesCommissionPartial](#function-matchescommissionpartial) | [upgradeOutputTagsMap](#function-upgradeoutputtagsmap) |
|
|
16700
|
+
| [convertBitsToTarget](#function-convertbitstotarget) | [matchesMonitorEventPartial](#function-matchesmonitoreventpartial) | [upgradeOutputs](#function-upgradeoutputs) |
|
|
16701
|
+
| [convertBitsToWork](#function-convertbitstowork) | [matchesOutputBasketPartial](#function-matchesoutputbasketpartial) | [upgradeProvenTxReqs](#function-upgradeproventxreqs) |
|
|
16702
|
+
| [convertBufferToUint32](#function-convertbuffertouint32) | [matchesOutputPartial](#function-matchesoutputpartial) | [upgradeProvenTxs](#function-upgradeproventxs) |
|
|
16703
|
+
| [convertProofToMerklePath](#function-convertprooftomerklepath) | [matchesOutputTagMapPartial](#function-matchesoutputtagmappartial) | [upgradeSyncStates](#function-upgradesyncstates) |
|
|
16704
|
+
| [convertUint32ToBuffer](#function-convertuint32tobuffer) | [matchesOutputTagPartial](#function-matchesoutputtagpartial) | [upgradeTransactions](#function-upgradetransactions) |
|
|
16705
|
+
| [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [matchesProvenTxPartial](#function-matchesproventxpartial) | [upgradeTxLabels](#function-upgradetxlabels) |
|
|
16706
|
+
| [createAction](#function-createaction) | [matchesProvenTxReqPartial](#function-matchesproventxreqpartial) | [upgradeTxLabelsMap](#function-upgradetxlabelsmap) |
|
|
16707
|
+
| [createAction](#function-createaction) | [matchesSyncStatePartial](#function-matchessyncstatepartial) | [upgradeUsers](#function-upgradeusers) |
|
|
16708
|
+
| [createCoinbaseTransaction](#function-createcoinbasetransaction) | [matchesTransactionPartial](#function-matchestransactionpartial) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) |
|
|
16709
|
+
| [createDefaultIdbChaintracksOptions](#function-createdefaultidbchaintracksoptions) | [matchesTxLabelMapPartial](#function-matchestxlabelmappartial) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
|
|
16710
|
+
| [createDefaultNoDbChaintracksOptions](#function-createdefaultnodbchaintracksoptions) | [matchesTxLabelPartial](#function-matchestxlabelpartial) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
|
|
16711
|
+
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [maxDate](#function-maxdate) | [validateBulkFileData](#function-validatebulkfiledata) |
|
|
16712
|
+
| [createIdbChaintracks](#function-createidbchaintracks) | [mergeInputBeefs](#function-mergeinputbeefs) | [validateDate](#function-validatedate) |
|
|
16713
|
+
| [createNoDbChaintracks](#function-createnodbchaintracks) | [mergeInputsIntoBeef](#function-mergeinputsintobeef) | [validateEntities](#function-validateentities) |
|
|
16714
|
+
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [notifyTransactionsOfProof](#function-notifytransactionsofproof) | [validateEntity](#function-validateentity) |
|
|
16715
|
+
| [createSyncMap](#function-createsyncmap) | [offsetPrivKey](#function-offsetprivkey) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
|
|
16716
|
+
| [dateMatches](#function-datematches) | [offsetPubKey](#function-offsetpubkey) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
|
|
16717
|
+
| [deserializeBaseBlockHeader](#function-deserializebaseblockheader) | [optionalArraysEqual](#function-optionalarraysequal) | [validateGenesisHeader](#function-validategenesisheader) |
|
|
16718
|
+
| [deserializeBaseBlockHeaders](#function-deserializebaseblockheaders) | [parseBrc114ActionTimeLabels](#function-parsebrc114actiontimelabels) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
|
|
16719
|
+
| [deserializeBlockHeader](#function-deserializeblockheader) | [parseOutpoint](#function-parseoutpoint) | [validateHeaderFormat](#function-validateheaderformat) |
|
|
16720
|
+
| [deserializeBlockHeaders](#function-deserializeblockheaders) | [parseTxAndAssertId](#function-parsetxandassertid) | [validateScriptHash](#function-validatescripthash) |
|
|
16721
|
+
| [doubleSha256BE](#function-doublesha256be) | [parseTxScriptOffsets](#function-parsetxscriptoffsets) | [validateSecondsSinceEpoch](#function-validatesecondssinceepoch) |
|
|
16722
|
+
| [doubleSha256LE](#function-doublesha256le) | [partitionActionLabels](#function-partitionactionlabels) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
|
|
16723
|
+
| [fundWalletFromP2PKHOutpoints](#function-fundwalletfromp2pkhoutpoints) | [populateUtxoDetails](#function-populateutxodetails) | [validateSyncChunkEntities](#function-validatesyncchunkentities) |
|
|
16724
|
+
| [generateChangeSdk](#function-generatechangesdk) | [processAction](#function-processaction) | [varUintSize](#function-varuintsize) |
|
|
16725
|
+
| [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [processAction](#function-processaction) | [verifyHexString](#function-verifyhexstring) |
|
|
16726
|
+
| [genesisBuffer](#function-genesisbuffer) | [proveCertificate](#function-provecertificate) | [verifyId](#function-verifyid) |
|
|
16727
|
+
| [genesisHeader](#function-genesisheader) | [purgeDataIdb](#function-purgedataidb) | [verifyInteger](#function-verifyinteger) |
|
|
16728
|
+
| [getBeefForTransaction](#function-getbeeffortransaction) | [randomBytes](#function-randombytes) | [verifyNumber](#function-verifynumber) |
|
|
16729
|
+
| [getBeefForTxid](#function-getbeeffortxid) | [randomBytesBase64](#function-randombytesbase64) | [verifyOne](#function-verifyone) |
|
|
16730
|
+
| [getExchangeRatesIo](#function-getexchangeratesio) | [randomBytesHex](#function-randombyteshex) | [verifyOneOrNone](#function-verifyoneornone) |
|
|
16731
|
+
| [getIdentityKey](#function-getidentitykey) | [readUInt32BE](#function-readuint32be) | [verifyOptionalHexString](#function-verifyoptionalhexstring) |
|
|
16732
|
+
| [getListOutputsSpecOp](#function-getlistoutputsspecop) | [readUInt32LE](#function-readuint32le) | [verifyP2PKHOwnership](#function-verifyp2pkhownership) |
|
|
16733
|
+
| [getProofs](#function-getproofs) | [redeemServiceCharges](#function-redeemservicecharges) | [verifyTruthy](#function-verifytruthy) |
|
|
16734
|
+
| [getSyncChunk](#function-getsyncchunk) | [resolveAutoSigned](#function-resolveautosigned) | [verifyUnlockScripts](#function-verifyunlockscripts) |
|
|
16735
|
+
| [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [reviewStatusIdb](#function-reviewstatusidb) | [wait](#function-wait) |
|
|
16736
|
+
| [handlePostRawTxErrorResponse](#function-handlepostrawtxerrorresponse) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) | [wocGetHeadersHeaderToBlockHeader](#function-wocgetheadersheadertoblockheader) |
|
|
16737
|
+
| [handleScriptHashHistoryCatch](#function-handlescripthashhistorycatch) | [serializeBaseBlockHeader](#function-serializebaseblockheader) | [workBNtoBuffer](#function-workbntobuffer) |
|
|
16738
|
+
| [handleScriptHashHistoryResponse](#function-handlescripthashhistoryresponse) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) | [writeUInt32BE](#function-writeuint32be) |
|
|
16739
|
+
| [handleUtxoConnReset](#function-handleutxoconnreset) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | [writeUInt32LE](#function-writeuint32le) |
|
|
16849
16740
|
|
|
16850
16741
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
16851
16742
|
|
|
@@ -16879,7 +16770,7 @@ High speed WebSocket based based old block header listener
|
|
|
16879
16770
|
export async function WocHeadersBulkListener(fromHeight: number, toHeight: number, enqueue: (header: BlockHeader) => void, error: (code: number, message: string) => boolean, stop: StopListenerToken, chain: Chain, logger: (...args: any[]) => void = () => { }, idleWait = 5000): Promise<boolean>
|
|
16880
16771
|
```
|
|
16881
16772
|
|
|
16882
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#
|
|
16773
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken), [logger](./client.md#variable-logger)
|
|
16883
16774
|
|
|
16884
16775
|
Returns
|
|
16885
16776
|
|
|
@@ -16934,7 +16825,7 @@ High speed WebSocket based based new block header listener
|
|
|
16934
16825
|
export async function WocHeadersLiveListener(enqueue: (header: BlockHeader) => void, error: (code: number, message: string) => boolean, stop: StopListenerToken, chain: Chain, logger: (...args: any[]) => void, idleWait = 100000): Promise<boolean>
|
|
16935
16826
|
```
|
|
16936
16827
|
|
|
16937
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#
|
|
16828
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken), [logger](./client.md#variable-logger)
|
|
16938
16829
|
|
|
16939
16830
|
Returns
|
|
16940
16831
|
|
|
@@ -17018,7 +16909,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
17018
16909
|
Compares lengths and direct equality of values.
|
|
17019
16910
|
|
|
17020
16911
|
```ts
|
|
17021
|
-
export function arraysEqual(arr1: Number[], arr2: Number[])
|
|
16912
|
+
export function arraysEqual(arr1: Number[], arr2: Number[]): boolean
|
|
17022
16913
|
```
|
|
17023
16914
|
|
|
17024
16915
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -17029,17 +16920,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
17029
16920
|
Convert a value to number[] if currently an encoded string or number[] or Uint8Array.
|
|
17030
16921
|
|
|
17031
16922
|
```ts
|
|
17032
|
-
export function asArray(val:
|
|
16923
|
+
export function asArray(val: ByteInput, enc?: ByteEncoding): number[] {
|
|
17033
16924
|
if (Array.isArray(val))
|
|
17034
16925
|
return val;
|
|
17035
16926
|
if (typeof val !== "string")
|
|
17036
16927
|
return Array.from(val);
|
|
17037
16928
|
enc ||= "hex";
|
|
17038
|
-
|
|
16929
|
+
const a: number[] = Utils.toArray(val, enc);
|
|
17039
16930
|
return a;
|
|
17040
16931
|
}
|
|
17041
16932
|
```
|
|
17042
16933
|
|
|
16934
|
+
See also: [ByteEncoding](./client.md#type-byteencoding), [ByteInput](./client.md#type-byteinput)
|
|
16935
|
+
|
|
17043
16936
|
Returns
|
|
17044
16937
|
|
|
17045
16938
|
number[] array of byte values representation of val.
|
|
@@ -17127,7 +17020,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
17127
17020
|
Convert a value to an encoded string if currently an encoded string or number[] or Uint8Array.
|
|
17128
17021
|
|
|
17129
17022
|
```ts
|
|
17130
|
-
export function asString(val:
|
|
17023
|
+
export function asString(val: ByteInput, enc?: ByteEncoding, returnEnc?: ByteEncoding): string {
|
|
17131
17024
|
enc ||= "hex";
|
|
17132
17025
|
returnEnc ||= enc;
|
|
17133
17026
|
if (typeof val === "string") {
|
|
@@ -17135,7 +17028,7 @@ export function asString(val: string | number[] | Uint8Array, enc?: "hex" | "utf
|
|
|
17135
17028
|
return val;
|
|
17136
17029
|
val = asUint8Array(val, enc);
|
|
17137
17030
|
}
|
|
17138
|
-
|
|
17031
|
+
const v = Array.isArray(val) ? val : Array.from(val);
|
|
17139
17032
|
switch (returnEnc) {
|
|
17140
17033
|
case "utf8":
|
|
17141
17034
|
return Utils.toUTF8(v);
|
|
@@ -17146,7 +17039,7 @@ export function asString(val: string | number[] | Uint8Array, enc?: "hex" | "utf
|
|
|
17146
17039
|
}
|
|
17147
17040
|
```
|
|
17148
17041
|
|
|
17149
|
-
See also: [asUint8Array](./client.md#function-asuint8array)
|
|
17042
|
+
See also: [ByteEncoding](./client.md#type-byteencoding), [ByteInput](./client.md#type-byteinput), [asUint8Array](./client.md#function-asuint8array)
|
|
17150
17043
|
|
|
17151
17044
|
Returns
|
|
17152
17045
|
|
|
@@ -17169,17 +17062,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
17169
17062
|
Convert a value to Uint8Array if currently an encoded string or number[] or Uint8Array.
|
|
17170
17063
|
|
|
17171
17064
|
```ts
|
|
17172
|
-
export function asUint8Array(val:
|
|
17065
|
+
export function asUint8Array(val: ByteInput, enc?: ByteEncoding): Uint8Array {
|
|
17173
17066
|
if (Array.isArray(val))
|
|
17174
17067
|
return Uint8Array.from(val);
|
|
17175
17068
|
if (typeof val !== "string")
|
|
17176
17069
|
return val;
|
|
17177
17070
|
enc ||= "hex";
|
|
17178
|
-
|
|
17071
|
+
const a: number[] = Utils.toArray(val, enc);
|
|
17179
17072
|
return Uint8Array.from(a);
|
|
17180
17073
|
}
|
|
17181
17074
|
```
|
|
17182
17075
|
|
|
17076
|
+
See also: [ByteEncoding](./client.md#type-byteencoding), [ByteInput](./client.md#type-byteinput)
|
|
17077
|
+
|
|
17183
17078
|
Returns
|
|
17184
17079
|
|
|
17185
17080
|
Uint8Array representation of val.
|
|
@@ -17282,6 +17177,34 @@ See also: [PendingStorageInput](./client.md#interface-pendingstorageinput), [Sto
|
|
|
17282
17177
|
|
|
17283
17178
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17284
17179
|
|
|
17180
|
+
---
|
|
17181
|
+
##### Function: classifyMerklePathResponse
|
|
17182
|
+
|
|
17183
|
+
Classify a non-OK status response for getMerklePath.
|
|
17184
|
+
|
|
17185
|
+
Returns `'retry'` when the request was rate-limited and the caller should retry,
|
|
17186
|
+
`'notFound'` for 404, `'badStatus'` for other non-200 codes.
|
|
17187
|
+
|
|
17188
|
+
```ts
|
|
17189
|
+
export function classifyMerklePathResponse(status: number, statusText: string, retry: number): "retry" | "notFound" | "badStatus" | "ok"
|
|
17190
|
+
```
|
|
17191
|
+
|
|
17192
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17193
|
+
|
|
17194
|
+
---
|
|
17195
|
+
##### Function: classifyReqStatus
|
|
17196
|
+
|
|
17197
|
+
Classify a ProvenTxReq status into beef-sharing lifecycle status.
|
|
17198
|
+
Mutates `d` in place.
|
|
17199
|
+
|
|
17200
|
+
```ts
|
|
17201
|
+
export function classifyReqStatus(d: GetReqsAndBeefDetail, req: TableProvenTxReq): void
|
|
17202
|
+
```
|
|
17203
|
+
|
|
17204
|
+
See also: [GetReqsAndBeefDetail](./storage.md#interface-getreqsandbeefdetail), [TableProvenTxReq](./storage.md#interface-tableproventxreq)
|
|
17205
|
+
|
|
17206
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17207
|
+
|
|
17285
17208
|
---
|
|
17286
17209
|
##### Function: completeSignedTransaction
|
|
17287
17210
|
|
|
@@ -17558,6 +17481,15 @@ See also: [SyncMap](./storage.md#interface-syncmap)
|
|
|
17558
17481
|
|
|
17559
17482
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17560
17483
|
|
|
17484
|
+
---
|
|
17485
|
+
##### Function: dateMatches
|
|
17486
|
+
|
|
17487
|
+
```ts
|
|
17488
|
+
export function dateMatches(a: Date | undefined, b: Date | undefined): boolean
|
|
17489
|
+
```
|
|
17490
|
+
|
|
17491
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17492
|
+
|
|
17561
17493
|
---
|
|
17562
17494
|
##### Function: deserializeBaseBlockHeader
|
|
17563
17495
|
|
|
@@ -17597,7 +17529,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
17597
17529
|
##### Function: deserializeBlockHeader
|
|
17598
17530
|
|
|
17599
17531
|
```ts
|
|
17600
|
-
export function deserializeBlockHeader(buffer: number[] | Uint8Array, offset = 0
|
|
17532
|
+
export function deserializeBlockHeader(buffer: number[] | Uint8Array, height: number, offset = 0): BlockHeader
|
|
17601
17533
|
```
|
|
17602
17534
|
|
|
17603
17535
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -17677,12 +17609,12 @@ Accepts outpoints + a P2PKH key pair, optionally with a pre-built BEEF.
|
|
|
17677
17609
|
If no BEEF is provided, one is built via buildBeefForOutpoints.
|
|
17678
17610
|
|
|
17679
17611
|
```ts
|
|
17680
|
-
export async function fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, getUnlockP2PKH: (priv: KeyPairAddress["privateKey"], satoshis: number) => ScriptTemplateUnlock, inputBEEF?: BEEF): Promise<{
|
|
17612
|
+
export async function fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, getUnlockP2PKH: (priv: KeyPairAddress["privateKey"], satoshis: number) => ScriptTemplateUnlock, inputBEEF?: BEEF): Promise<Array<{
|
|
17681
17613
|
outpoint: string;
|
|
17682
17614
|
txid?: string;
|
|
17683
17615
|
success: boolean;
|
|
17684
17616
|
error?: string;
|
|
17685
|
-
}
|
|
17617
|
+
}>>
|
|
17686
17618
|
```
|
|
17687
17619
|
|
|
17688
17620
|
See also: [KeyPairAddress](./setup.md#interface-keypairaddress), [ScriptTemplateUnlock](./client.md#interface-scripttemplateunlock)
|
|
@@ -17768,7 +17700,7 @@ export function genesisHeader(chain: Chain): BlockHeader {
|
|
|
17768
17700
|
hash: "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"
|
|
17769
17701
|
};
|
|
17770
17702
|
case "mock":
|
|
17771
|
-
throw new Error(
|
|
17703
|
+
throw new Error("genesisHeader does not support 'mock' chain. Mock chain generates its own genesis block.");
|
|
17772
17704
|
}
|
|
17773
17705
|
}
|
|
17774
17706
|
```
|
|
@@ -17873,7 +17805,7 @@ depending on chaintracks succeeding on proof verification.
|
|
|
17873
17805
|
Increments attempts if proofs where requested.
|
|
17874
17806
|
|
|
17875
17807
|
```ts
|
|
17876
|
-
export async function getProofs(task: WalletMonitorTask, reqs: TableProvenTxReq[], indent = 0, countsAsAttempt = false, ignoreStatus = false
|
|
17808
|
+
export async function getProofs(task: WalletMonitorTask, reqs: TableProvenTxReq[], maxAcceptableHeight: number, indent = 0, countsAsAttempt = false, ignoreStatus = false): Promise<{
|
|
17877
17809
|
proven: TableProvenTxReq[];
|
|
17878
17810
|
invalid: TableProvenTxReq[];
|
|
17879
17811
|
log: string;
|
|
@@ -17912,6 +17844,70 @@ See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#
|
|
|
17912
17844
|
|
|
17913
17845
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17914
17846
|
|
|
17847
|
+
---
|
|
17848
|
+
##### Function: handlePostRawTxErrorResponse
|
|
17849
|
+
|
|
17850
|
+
Classify an error-status WoC response and mutate `r` accordingly.
|
|
17851
|
+
|
|
17852
|
+
```ts
|
|
17853
|
+
export function handlePostRawTxErrorResponse(r: PostTxResultForTxid, nne: () => Record<string, unknown>, response: {
|
|
17854
|
+
data?: unknown;
|
|
17855
|
+
statusText?: unknown;
|
|
17856
|
+
status?: unknown;
|
|
17857
|
+
ok?: boolean;
|
|
17858
|
+
}): void
|
|
17859
|
+
```
|
|
17860
|
+
|
|
17861
|
+
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
17862
|
+
|
|
17863
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17864
|
+
|
|
17865
|
+
---
|
|
17866
|
+
##### Function: handleScriptHashHistoryCatch
|
|
17867
|
+
|
|
17868
|
+
Decide whether a caught error is retryable for script-hash history calls.
|
|
17869
|
+
If not retryable, sets `r.error` and returns false.
|
|
17870
|
+
|
|
17871
|
+
```ts
|
|
17872
|
+
export function handleScriptHashHistoryCatch(r: GetScriptHashHistoryResult, error_: unknown, url: string, methodName: string, retry: number, maxRetry: number): boolean
|
|
17873
|
+
```
|
|
17874
|
+
|
|
17875
|
+
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult)
|
|
17876
|
+
|
|
17877
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17878
|
+
|
|
17879
|
+
---
|
|
17880
|
+
##### Function: handleScriptHashHistoryResponse
|
|
17881
|
+
|
|
17882
|
+
Inspect a WoC script-hash history response and update `r` in-place.
|
|
17883
|
+
|
|
17884
|
+
Returns:
|
|
17885
|
+
- `'continue'` — rate-limited, caller should retry
|
|
17886
|
+
- `'return'` — done, caller should return `r`
|
|
17887
|
+
- `'ok'` — response was successful, continue parsing
|
|
17888
|
+
|
|
17889
|
+
```ts
|
|
17890
|
+
export function handleScriptHashHistoryResponse(r: GetScriptHashHistoryResult, response: ScriptHashHistoryResponse, methodName: string, retry: number): "continue" | "return" | "ok"
|
|
17891
|
+
```
|
|
17892
|
+
|
|
17893
|
+
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [ScriptHashHistoryResponse](./services.md#interface-scripthashhistoryresponse)
|
|
17894
|
+
|
|
17895
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17896
|
+
|
|
17897
|
+
---
|
|
17898
|
+
##### Function: handleUtxoConnReset
|
|
17899
|
+
|
|
17900
|
+
Decide whether the ECONNRESET error is retryable and, if not, set `r.error`.
|
|
17901
|
+
Returns true when the caller should retry, false when it should return.
|
|
17902
|
+
|
|
17903
|
+
```ts
|
|
17904
|
+
export function handleUtxoConnReset(r: GetUtxoStatusResult, error_: unknown, url: string, retry: number, maxRetry: number): boolean
|
|
17905
|
+
```
|
|
17906
|
+
|
|
17907
|
+
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
17908
|
+
|
|
17909
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
17910
|
+
|
|
17915
17911
|
---
|
|
17916
17912
|
##### Function: importSingleOutpoint
|
|
17917
17913
|
|
|
@@ -18001,12 +17997,12 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
18001
17997
|
Type guard function.
|
|
18002
17998
|
|
|
18003
17999
|
```ts
|
|
18004
|
-
export function isBaseBlockHeader(header:
|
|
18000
|
+
export function isBaseBlockHeader(header: AnyBlockHeader): header is BaseBlockHeader {
|
|
18005
18001
|
return typeof header.previousHash === "string";
|
|
18006
18002
|
}
|
|
18007
18003
|
```
|
|
18008
18004
|
|
|
18009
|
-
See also: [
|
|
18005
|
+
See also: [AnyBlockHeader](./services.md#type-anyblockheader), [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
18010
18006
|
|
|
18011
18007
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18012
18008
|
|
|
@@ -18016,12 +18012,12 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
18016
18012
|
Type guard function.
|
|
18017
18013
|
|
|
18018
18014
|
```ts
|
|
18019
|
-
export function isBlockHeader(header:
|
|
18015
|
+
export function isBlockHeader(header: AnyBlockHeader): header is LiveBlockHeader {
|
|
18020
18016
|
return "height" in header && typeof header.previousHash === "string";
|
|
18021
18017
|
}
|
|
18022
18018
|
```
|
|
18023
18019
|
|
|
18024
|
-
See also: [
|
|
18020
|
+
See also: [AnyBlockHeader](./services.md#type-anyblockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
18025
18021
|
|
|
18026
18022
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18027
18023
|
|
|
@@ -18066,17 +18062,16 @@ The following properties must match:
|
|
|
18066
18062
|
|
|
18067
18063
|
```ts
|
|
18068
18064
|
export function isKnownValidBulkHeaderFile(vbf: BulkHeaderFileInfo): boolean {
|
|
18069
|
-
if (!vbf
|
|
18065
|
+
if (!vbf?.fileHash)
|
|
18070
18066
|
return false;
|
|
18071
18067
|
const bf = validBulkHeaderFilesByFileHash()[vbf.fileHash];
|
|
18072
|
-
if (
|
|
18073
|
-
bf
|
|
18074
|
-
bf
|
|
18075
|
-
bf
|
|
18076
|
-
bf
|
|
18077
|
-
bf
|
|
18078
|
-
bf
|
|
18079
|
-
bf.chain !== vbf.chain) {
|
|
18068
|
+
if (bf?.firstHeight !== vbf.firstHeight ||
|
|
18069
|
+
bf?.count !== vbf.count ||
|
|
18070
|
+
bf?.prevChainWork !== vbf.prevChainWork ||
|
|
18071
|
+
bf?.prevHash !== vbf.prevHash ||
|
|
18072
|
+
bf?.lastChainWork !== vbf.lastChainWork ||
|
|
18073
|
+
bf?.lastHash !== vbf.lastHash ||
|
|
18074
|
+
bf?.chain !== vbf.chain) {
|
|
18080
18075
|
return false;
|
|
18081
18076
|
}
|
|
18082
18077
|
return true;
|
|
@@ -18148,12 +18143,12 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
18148
18143
|
Type guard function.
|
|
18149
18144
|
|
|
18150
18145
|
```ts
|
|
18151
|
-
export function isLiveBlockHeader(header:
|
|
18146
|
+
export function isLiveBlockHeader(header: AnyBlockHeader): header is LiveBlockHeader {
|
|
18152
18147
|
return "chainwork" in header && typeof header.previousHash === "string";
|
|
18153
18148
|
}
|
|
18154
18149
|
```
|
|
18155
18150
|
|
|
18156
|
-
See also: [
|
|
18151
|
+
See also: [AnyBlockHeader](./services.md#type-anyblockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
18157
18152
|
|
|
18158
18153
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18159
18154
|
|
|
@@ -18277,190 +18272,492 @@ See also: [KeyPair](./client.md#interface-keypair), [StorageCreateActionResult](
|
|
|
18277
18272
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18278
18273
|
|
|
18279
18274
|
---
|
|
18280
|
-
##### Function:
|
|
18275
|
+
##### Function: makeMerklePathNote
|
|
18281
18276
|
|
|
18282
18277
|
```ts
|
|
18283
|
-
export function
|
|
18278
|
+
export function makeMerklePathNote(what: MerklePathNoteWhat, name: string, extra: Partial<MerklePathNote> = {}): MerklePathNote
|
|
18284
18279
|
```
|
|
18285
18280
|
|
|
18281
|
+
See also: [MerklePathNote](./services.md#interface-merklepathnote), [MerklePathNoteWhat](./services.md#type-merklepathnotewhat)
|
|
18282
|
+
|
|
18286
18283
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18287
18284
|
|
|
18288
18285
|
---
|
|
18289
|
-
##### Function:
|
|
18286
|
+
##### Function: markStaleInputsAsSpent
|
|
18290
18287
|
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
```
|
|
18288
|
+
After any failed broadcast (doubleSpend, invalidTx, etc.), query each
|
|
18289
|
+
consumed-input outpoint of the failed transaction against on-chain
|
|
18290
|
+
UTXO state. For inputs the chain authoritatively confirms are spent
|
|
18291
|
+
(i.e. NOT a UTXO), update the corresponding wallet basket entry to
|
|
18292
|
+
spendable=false.
|
|
18297
18293
|
|
|
18298
|
-
|
|
18294
|
+
Background: `updateTransactionStatus(failed)` optimistically restores
|
|
18295
|
+
all consumed-input outputs to spendable=true so the user can retry
|
|
18296
|
+
with the same inputs. For some failures (genuine doubleSpend, or any
|
|
18297
|
+
'missing-inputs' outcome where the input has been spent on chain by
|
|
18298
|
+
a different transaction), restoration is incorrect — the input is
|
|
18299
|
+
gone and restoring it produces an infinite missing-inputs loop on
|
|
18300
|
+
the next createAction → broadcast cycle. Apps cannot evict from the
|
|
18301
|
+
default basket on app-isolated wallets (admin-only policy), so this
|
|
18302
|
+
self-heal must run inside the wallet.
|
|
18299
18303
|
|
|
18300
|
-
|
|
18301
|
-
|
|
18304
|
+
Different broadcasters classify the same on-chain reality differently
|
|
18305
|
+
(ARC → doubleSpend, WhatsOnChain/Bitails → invalidTx via
|
|
18306
|
+
'missing-inputs'); this helper is broadcaster-agnostic because its
|
|
18307
|
+
decision is based on services.isUtxo, not the aggregate failure
|
|
18308
|
+
classification.
|
|
18309
|
+
|
|
18310
|
+
Pre-broadcast races where concurrent createActions reach the same
|
|
18311
|
+
UTXO across separate app processes are out of scope; see PR
|
|
18312
|
+
description.
|
|
18313
|
+
|
|
18314
|
+
Conservatively scoped:
|
|
18315
|
+
- Only inputs found in the failing user's basket are touched.
|
|
18316
|
+
- Inputs whose on-chain UTXO status cannot be determined (service
|
|
18317
|
+
error / inconclusive) are left spendable=true. Eviction is opt-in
|
|
18318
|
+
based on positive evidence of stale state.
|
|
18319
|
+
- Inputs the chain confirms are still UTXOs (e.g. a competing tx
|
|
18320
|
+
itself failed, or a malformed/fee failure where inputs are intact)
|
|
18321
|
+
are left spendable=true — preserving the existing transient-retry
|
|
18322
|
+
semantics callers depend on.
|
|
18323
|
+
|
|
18324
|
+
Returns counts for instrumentation and the set of stale outpoints
|
|
18325
|
+
that were actually evicted (added to history note for diagnostics).
|
|
18302
18326
|
|
|
18303
18327
|
```ts
|
|
18304
|
-
export function
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
|
|
18328
|
+
export async function markStaleInputsAsSpent(ar: AggregatePostBeefTxResult, storage: StorageProvider, services: sdk.WalletServices, trx?: sdk.TrxToken, logger?: WalletLoggerInterface): Promise<{
|
|
18329
|
+
checked: number;
|
|
18330
|
+
staleConfirmed: number;
|
|
18331
|
+
staleOutpoints: string[];
|
|
18332
|
+
}>
|
|
18308
18333
|
```
|
|
18309
18334
|
|
|
18335
|
+
See also: [AggregatePostBeefTxResult](./storage.md#interface-aggregatepostbeeftxresult), [StorageProvider](./storage.md#class-storageprovider), [TrxToken](./client.md#interface-trxtoken), [WalletServices](./client.md#interface-walletservices), [logger](./client.md#variable-logger)
|
|
18336
|
+
|
|
18310
18337
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18311
18338
|
|
|
18312
18339
|
---
|
|
18313
|
-
##### Function:
|
|
18340
|
+
##### Function: matchesCertificateFieldPartial
|
|
18314
18341
|
|
|
18315
18342
|
```ts
|
|
18316
|
-
export function
|
|
18343
|
+
export function matchesCertificateFieldPartial(r: TableCertificateField, partial: Partial<TableCertificateField>): boolean
|
|
18317
18344
|
```
|
|
18318
18345
|
|
|
18346
|
+
See also: [TableCertificateField](./storage.md#interface-tablecertificatefield)
|
|
18347
|
+
|
|
18319
18348
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18320
18349
|
|
|
18321
18350
|
---
|
|
18322
|
-
##### Function:
|
|
18351
|
+
##### Function: matchesCertificatePartial
|
|
18323
18352
|
|
|
18324
18353
|
```ts
|
|
18325
|
-
export function
|
|
18354
|
+
export function matchesCertificatePartial(r: TableCertificate, partial: Partial<TableCertificate>): boolean
|
|
18326
18355
|
```
|
|
18327
18356
|
|
|
18328
|
-
See also: [
|
|
18357
|
+
See also: [TableCertificate](./storage.md#interface-tablecertificate)
|
|
18329
18358
|
|
|
18330
18359
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18331
18360
|
|
|
18332
18361
|
---
|
|
18333
|
-
##### Function:
|
|
18334
|
-
|
|
18335
|
-
Strictly parse an outpoint string into txid and vout components.
|
|
18362
|
+
##### Function: matchesCommissionPartial
|
|
18336
18363
|
|
|
18337
18364
|
```ts
|
|
18338
|
-
export function
|
|
18365
|
+
export function matchesCommissionPartial(r: TableCommission, partial: Partial<TableCommission>): boolean
|
|
18339
18366
|
```
|
|
18340
18367
|
|
|
18341
|
-
See also: [
|
|
18368
|
+
See also: [TableCommission](./storage.md#interface-tablecommission)
|
|
18342
18369
|
|
|
18343
18370
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18344
18371
|
|
|
18345
18372
|
---
|
|
18346
|
-
##### Function:
|
|
18347
|
-
|
|
18348
|
-
Parse raw hex into a Transaction and assert its hash matches the expected txid.
|
|
18373
|
+
##### Function: matchesMonitorEventPartial
|
|
18349
18374
|
|
|
18350
18375
|
```ts
|
|
18351
|
-
export function
|
|
18376
|
+
export function matchesMonitorEventPartial(r: TableMonitorEvent, partial: Partial<TableMonitorEvent>): boolean
|
|
18352
18377
|
```
|
|
18353
18378
|
|
|
18379
|
+
See also: [TableMonitorEvent](./storage.md#interface-tablemonitorevent)
|
|
18380
|
+
|
|
18354
18381
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18355
18382
|
|
|
18356
18383
|
---
|
|
18357
|
-
##### Function:
|
|
18384
|
+
##### Function: matchesOutputBasketPartial
|
|
18358
18385
|
|
|
18359
18386
|
```ts
|
|
18360
|
-
export function
|
|
18387
|
+
export function matchesOutputBasketPartial(r: TableOutputBasket, partial: Partial<TableOutputBasket>): boolean
|
|
18361
18388
|
```
|
|
18362
18389
|
|
|
18363
|
-
See also: [
|
|
18390
|
+
See also: [TableOutputBasket](./storage.md#interface-tableoutputbasket)
|
|
18364
18391
|
|
|
18365
18392
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18366
18393
|
|
|
18367
18394
|
---
|
|
18368
|
-
##### Function:
|
|
18395
|
+
##### Function: matchesOutputPartial
|
|
18369
18396
|
|
|
18370
18397
|
```ts
|
|
18371
|
-
export
|
|
18398
|
+
export function matchesOutputPartial(r: TableOutput, partial: Partial<TableOutput>): boolean
|
|
18372
18399
|
```
|
|
18373
18400
|
|
|
18374
|
-
See also: [
|
|
18401
|
+
See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
18375
18402
|
|
|
18376
18403
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18377
18404
|
|
|
18378
18405
|
---
|
|
18379
|
-
##### Function:
|
|
18406
|
+
##### Function: matchesOutputTagMapPartial
|
|
18380
18407
|
|
|
18381
18408
|
```ts
|
|
18382
|
-
export
|
|
18409
|
+
export function matchesOutputTagMapPartial(r: TableOutputTagMap, partial: Partial<TableOutputTagMap>): boolean
|
|
18383
18410
|
```
|
|
18384
18411
|
|
|
18385
|
-
See also: [
|
|
18412
|
+
See also: [TableOutputTagMap](./storage.md#interface-tableoutputtagmap)
|
|
18386
18413
|
|
|
18387
18414
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18388
18415
|
|
|
18389
18416
|
---
|
|
18390
|
-
##### Function:
|
|
18417
|
+
##### Function: matchesOutputTagPartial
|
|
18391
18418
|
|
|
18392
18419
|
```ts
|
|
18393
|
-
export
|
|
18420
|
+
export function matchesOutputTagPartial(r: TableOutputTag, partial: Partial<TableOutputTag>): boolean
|
|
18394
18421
|
```
|
|
18395
18422
|
|
|
18396
|
-
See also: [
|
|
18423
|
+
See also: [TableOutputTag](./storage.md#interface-tableoutputtag)
|
|
18397
18424
|
|
|
18398
18425
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18399
18426
|
|
|
18400
18427
|
---
|
|
18401
|
-
##### Function:
|
|
18428
|
+
##### Function: matchesProvenTxPartial
|
|
18402
18429
|
|
|
18403
18430
|
```ts
|
|
18404
|
-
export
|
|
18431
|
+
export function matchesProvenTxPartial(r: TableProvenTx, partial: Partial<TableProvenTx>): boolean
|
|
18405
18432
|
```
|
|
18406
18433
|
|
|
18407
|
-
See also: [
|
|
18434
|
+
See also: [TableProvenTx](./storage.md#interface-tableproventx)
|
|
18408
18435
|
|
|
18409
18436
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18410
18437
|
|
|
18411
18438
|
---
|
|
18412
|
-
##### Function:
|
|
18439
|
+
##### Function: matchesProvenTxReqPartial
|
|
18413
18440
|
|
|
18414
18441
|
```ts
|
|
18415
|
-
export function
|
|
18442
|
+
export function matchesProvenTxReqPartial(r: TableProvenTxReq, partial: Partial<TableProvenTxReq>): boolean
|
|
18416
18443
|
```
|
|
18417
18444
|
|
|
18418
|
-
|
|
18419
|
-
|
|
18420
|
-
count cryptographically secure random bytes as array of bytes
|
|
18445
|
+
See also: [TableProvenTxReq](./storage.md#interface-tableproventxreq)
|
|
18421
18446
|
|
|
18422
18447
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18423
18448
|
|
|
18424
18449
|
---
|
|
18425
|
-
##### Function:
|
|
18450
|
+
##### Function: matchesSyncStatePartial
|
|
18426
18451
|
|
|
18427
18452
|
```ts
|
|
18428
|
-
export function
|
|
18453
|
+
export function matchesSyncStatePartial(r: TableSyncState, partial: Partial<TableSyncState>): boolean
|
|
18429
18454
|
```
|
|
18430
18455
|
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
count cryptographically secure random bytes as base64 encoded string
|
|
18456
|
+
See also: [TableSyncState](./storage.md#interface-tablesyncstate)
|
|
18434
18457
|
|
|
18435
18458
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18436
18459
|
|
|
18437
18460
|
---
|
|
18438
|
-
##### Function:
|
|
18461
|
+
##### Function: matchesTransactionPartial
|
|
18439
18462
|
|
|
18440
18463
|
```ts
|
|
18441
|
-
export function
|
|
18464
|
+
export function matchesTransactionPartial(r: TableTransaction, partial: Partial<TableTransaction>): boolean
|
|
18442
18465
|
```
|
|
18443
18466
|
|
|
18444
|
-
|
|
18445
|
-
|
|
18446
|
-
count cryptographically secure random bytes as hex encoded string
|
|
18467
|
+
See also: [TableTransaction](./storage.md#interface-tabletransaction)
|
|
18447
18468
|
|
|
18448
18469
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18449
18470
|
|
|
18450
18471
|
---
|
|
18451
|
-
##### Function:
|
|
18472
|
+
##### Function: matchesTxLabelMapPartial
|
|
18452
18473
|
|
|
18453
18474
|
```ts
|
|
18454
|
-
export function
|
|
18475
|
+
export function matchesTxLabelMapPartial(r: TableTxLabelMap, partial: Partial<TableTxLabelMap>): boolean
|
|
18455
18476
|
```
|
|
18456
18477
|
|
|
18478
|
+
See also: [TableTxLabelMap](./storage.md#interface-tabletxlabelmap)
|
|
18479
|
+
|
|
18457
18480
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18458
18481
|
|
|
18459
18482
|
---
|
|
18460
|
-
##### Function:
|
|
18483
|
+
##### Function: matchesTxLabelPartial
|
|
18461
18484
|
|
|
18462
18485
|
```ts
|
|
18463
|
-
export function
|
|
18486
|
+
export function matchesTxLabelPartial(r: TableTxLabel, partial: Partial<TableTxLabel>): boolean
|
|
18487
|
+
```
|
|
18488
|
+
|
|
18489
|
+
See also: [TableTxLabel](./storage.md#interface-tabletxlabel)
|
|
18490
|
+
|
|
18491
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18492
|
+
|
|
18493
|
+
---
|
|
18494
|
+
##### Function: maxDate
|
|
18495
|
+
|
|
18496
|
+
```ts
|
|
18497
|
+
export function maxDate(d1?: Date, d2?: Date): Date | undefined
|
|
18498
|
+
```
|
|
18499
|
+
|
|
18500
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18501
|
+
|
|
18502
|
+
---
|
|
18503
|
+
##### Function: mergeInputBeefs
|
|
18504
|
+
|
|
18505
|
+
For each input of `rawTx`, ensure the source txid is represented in `beef`.
|
|
18506
|
+
|
|
18507
|
+
When `requiredLevels` is undefined/0 and `knownTxids` contains the source txid,
|
|
18508
|
+
a txid-only stub is merged rather than recursing into storage.
|
|
18509
|
+
|
|
18510
|
+
```ts
|
|
18511
|
+
export async function mergeInputBeefs(rawTx: number[], beef: Beef, trustSelf: "known" | undefined, knownTxids: string[] | undefined, trx: TrxToken | undefined, requiredLevels: number | undefined, getValidBeef: (txid: string, beef: Beef, trustSelf: "known" | undefined, knownTxids: string[] | undefined, trx: TrxToken | undefined, requiredLevels: number | undefined) => Promise<unknown>): Promise<void>
|
|
18512
|
+
```
|
|
18513
|
+
|
|
18514
|
+
See also: [TrxToken](./client.md#interface-trxtoken)
|
|
18515
|
+
|
|
18516
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18517
|
+
|
|
18518
|
+
---
|
|
18519
|
+
##### Function: mergeInputsIntoBeef
|
|
18520
|
+
|
|
18521
|
+
Convenience wrapper for the external-sharing path where `trustSelf` and
|
|
18522
|
+
`requiredLevels` are always absent.
|
|
18523
|
+
|
|
18524
|
+
```ts
|
|
18525
|
+
export async function mergeInputsIntoBeef(rawTx: number[], beef: Beef, knownTxids: string[], trx: TrxToken | undefined, getValidBeef: (txid: string, beef: Beef, trustSelf: undefined, knownTxids: string[], trx: TrxToken | undefined) => Promise<unknown>): Promise<void>
|
|
18526
|
+
```
|
|
18527
|
+
|
|
18528
|
+
See also: [TrxToken](./client.md#interface-trxtoken)
|
|
18529
|
+
|
|
18530
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18531
|
+
|
|
18532
|
+
---
|
|
18533
|
+
##### Function: notifyTransactionsOfProof
|
|
18534
|
+
|
|
18535
|
+
Notify each transaction that a proof has been found.
|
|
18536
|
+
Mutates `req` history notes in place.
|
|
18537
|
+
|
|
18538
|
+
The `addNote` and `flushNotes` callbacks avoid coupling this helper to a
|
|
18539
|
+
specific entity type.
|
|
18540
|
+
|
|
18541
|
+
```ts
|
|
18542
|
+
export async function notifyTransactionsOfProof(ids: number[], provenTxId: number, addNote: (note: ReqHistoryNote) => void, flushNotes: () => Promise<void>, updateTransaction: (id: number, update: {
|
|
18543
|
+
provenTxId: number;
|
|
18544
|
+
status: "completed";
|
|
18545
|
+
}) => Promise<unknown>): Promise<void>
|
|
18546
|
+
```
|
|
18547
|
+
|
|
18548
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
18549
|
+
|
|
18550
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18551
|
+
|
|
18552
|
+
---
|
|
18553
|
+
##### Function: offsetPrivKey
|
|
18554
|
+
|
|
18555
|
+
```ts
|
|
18556
|
+
export function offsetPrivKey(privKey: string, keyOffset?: string): {
|
|
18557
|
+
offsetPrivKey: string;
|
|
18558
|
+
keyOffset: string;
|
|
18559
|
+
}
|
|
18560
|
+
```
|
|
18561
|
+
|
|
18562
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18563
|
+
|
|
18564
|
+
---
|
|
18565
|
+
##### Function: offsetPubKey
|
|
18566
|
+
|
|
18567
|
+
```ts
|
|
18568
|
+
export function offsetPubKey(pubKey: string, keyOffset?: string): {
|
|
18569
|
+
offsetPubKey: string;
|
|
18570
|
+
keyOffset: string;
|
|
18571
|
+
}
|
|
18572
|
+
```
|
|
18573
|
+
|
|
18574
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18575
|
+
|
|
18576
|
+
---
|
|
18577
|
+
##### Function: optionalArraysEqual
|
|
18578
|
+
|
|
18579
|
+
```ts
|
|
18580
|
+
export function optionalArraysEqual(arr1?: Number[], arr2?: Number[]): boolean
|
|
18581
|
+
```
|
|
18582
|
+
|
|
18583
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18584
|
+
|
|
18585
|
+
---
|
|
18586
|
+
##### Function: parseBrc114ActionTimeLabels
|
|
18587
|
+
|
|
18588
|
+
```ts
|
|
18589
|
+
export function parseBrc114ActionTimeLabels(labels: string[] | undefined): ParsedBrc114ActionTimeLabels
|
|
18590
|
+
```
|
|
18591
|
+
|
|
18592
|
+
See also: [ParsedBrc114ActionTimeLabels](./client.md#interface-parsedbrc114actiontimelabels)
|
|
18593
|
+
|
|
18594
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18595
|
+
|
|
18596
|
+
---
|
|
18597
|
+
##### Function: parseOutpoint
|
|
18598
|
+
|
|
18599
|
+
Strictly parse an outpoint string into txid and vout components.
|
|
18600
|
+
|
|
18601
|
+
```ts
|
|
18602
|
+
export function parseOutpoint(s: string): ParsedOutpoint
|
|
18603
|
+
```
|
|
18604
|
+
|
|
18605
|
+
See also: [ParsedOutpoint](./client.md#interface-parsedoutpoint)
|
|
18606
|
+
|
|
18607
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18608
|
+
|
|
18609
|
+
---
|
|
18610
|
+
##### Function: parseTxAndAssertId
|
|
18611
|
+
|
|
18612
|
+
Parse raw hex into a Transaction and assert its hash matches the expected txid.
|
|
18613
|
+
|
|
18614
|
+
```ts
|
|
18615
|
+
export function parseTxAndAssertId(rawHex: string, expectedTxid: string): Transaction
|
|
18616
|
+
```
|
|
18617
|
+
|
|
18618
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18619
|
+
|
|
18620
|
+
---
|
|
18621
|
+
##### Function: parseTxScriptOffsets
|
|
18622
|
+
|
|
18623
|
+
```ts
|
|
18624
|
+
export function parseTxScriptOffsets(rawTx: number[]): TxScriptOffsets
|
|
18625
|
+
```
|
|
18626
|
+
|
|
18627
|
+
See also: [TxScriptOffsets](./client.md#interface-txscriptoffsets)
|
|
18628
|
+
|
|
18629
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18630
|
+
|
|
18631
|
+
---
|
|
18632
|
+
##### Function: partitionActionLabels
|
|
18633
|
+
|
|
18634
|
+
```ts
|
|
18635
|
+
export function partitionActionLabels(ordinaryLabels: string[]): {
|
|
18636
|
+
specOp: ListActionsSpecOp | undefined;
|
|
18637
|
+
specOpLabels: string[];
|
|
18638
|
+
labels: string[];
|
|
18639
|
+
}
|
|
18640
|
+
```
|
|
18641
|
+
|
|
18642
|
+
See also: [ListActionsSpecOp](./storage.md#interface-listactionsspecop)
|
|
18643
|
+
|
|
18644
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18645
|
+
|
|
18646
|
+
---
|
|
18647
|
+
##### Function: populateUtxoDetails
|
|
18648
|
+
|
|
18649
|
+
Populate UTXO details from a WoC result array
|
|
18650
|
+
|
|
18651
|
+
```ts
|
|
18652
|
+
export function populateUtxoDetails(r: GetUtxoStatusResult, result: Array<{
|
|
18653
|
+
tx_hash: string;
|
|
18654
|
+
value: number;
|
|
18655
|
+
height: number;
|
|
18656
|
+
tx_pos: number;
|
|
18657
|
+
}>, outpoint?: string): void
|
|
18658
|
+
```
|
|
18659
|
+
|
|
18660
|
+
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
18661
|
+
|
|
18662
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18663
|
+
|
|
18664
|
+
---
|
|
18665
|
+
##### Function: processAction
|
|
18666
|
+
|
|
18667
|
+
```ts
|
|
18668
|
+
export async function processAction(storage: StorageProvider, auth: AuthId, args: StorageProcessActionArgs): Promise<StorageProcessActionResults>
|
|
18669
|
+
```
|
|
18670
|
+
|
|
18671
|
+
See also: [AuthId](./client.md#interface-authid), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [StorageProvider](./storage.md#class-storageprovider)
|
|
18672
|
+
|
|
18673
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18674
|
+
|
|
18675
|
+
---
|
|
18676
|
+
##### Function: processAction
|
|
18677
|
+
|
|
18678
|
+
```ts
|
|
18679
|
+
export async function processAction(prior: PendingSignAction | undefined, wallet: Wallet, auth: AuthId, vargs: Validation.ValidProcessActionArgs): Promise<StorageProcessActionResults>
|
|
18680
|
+
```
|
|
18681
|
+
|
|
18682
|
+
See also: [AuthId](./client.md#interface-authid), [PendingSignAction](./client.md#interface-pendingsignaction), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [Wallet](./client.md#class-wallet)
|
|
18683
|
+
|
|
18684
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18685
|
+
|
|
18686
|
+
---
|
|
18687
|
+
##### Function: proveCertificate
|
|
18688
|
+
|
|
18689
|
+
```ts
|
|
18690
|
+
export async function proveCertificate(wallet: Wallet, auth: AuthId, vargs: Validation.ValidProveCertificateArgs): Promise<ProveCertificateResult>
|
|
18691
|
+
```
|
|
18692
|
+
|
|
18693
|
+
See also: [AuthId](./client.md#interface-authid), [Wallet](./client.md#class-wallet)
|
|
18694
|
+
|
|
18695
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18696
|
+
|
|
18697
|
+
---
|
|
18698
|
+
##### Function: purgeDataIdb
|
|
18699
|
+
|
|
18700
|
+
```ts
|
|
18701
|
+
export async function purgeDataIdb(storage: StorageIdb, params: PurgeParams, trx?: TrxToken): Promise<PurgeResults>
|
|
18702
|
+
```
|
|
18703
|
+
|
|
18704
|
+
See also: [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageIdb](./storage.md#class-storageidb), [TrxToken](./client.md#interface-trxtoken)
|
|
18705
|
+
|
|
18706
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18707
|
+
|
|
18708
|
+
---
|
|
18709
|
+
##### Function: randomBytes
|
|
18710
|
+
|
|
18711
|
+
```ts
|
|
18712
|
+
export function randomBytes(count: number): number[]
|
|
18713
|
+
```
|
|
18714
|
+
|
|
18715
|
+
Returns
|
|
18716
|
+
|
|
18717
|
+
count cryptographically secure random bytes as array of bytes
|
|
18718
|
+
|
|
18719
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18720
|
+
|
|
18721
|
+
---
|
|
18722
|
+
##### Function: randomBytesBase64
|
|
18723
|
+
|
|
18724
|
+
```ts
|
|
18725
|
+
export function randomBytesBase64(count: number): string
|
|
18726
|
+
```
|
|
18727
|
+
|
|
18728
|
+
Returns
|
|
18729
|
+
|
|
18730
|
+
count cryptographically secure random bytes as base64 encoded string
|
|
18731
|
+
|
|
18732
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18733
|
+
|
|
18734
|
+
---
|
|
18735
|
+
##### Function: randomBytesHex
|
|
18736
|
+
|
|
18737
|
+
```ts
|
|
18738
|
+
export function randomBytesHex(count: number): string
|
|
18739
|
+
```
|
|
18740
|
+
|
|
18741
|
+
Returns
|
|
18742
|
+
|
|
18743
|
+
count cryptographically secure random bytes as hex encoded string
|
|
18744
|
+
|
|
18745
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18746
|
+
|
|
18747
|
+
---
|
|
18748
|
+
##### Function: readUInt32BE
|
|
18749
|
+
|
|
18750
|
+
```ts
|
|
18751
|
+
export function readUInt32BE(a: number[] | Uint8Array, offset: number): number
|
|
18752
|
+
```
|
|
18753
|
+
|
|
18754
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18755
|
+
|
|
18756
|
+
---
|
|
18757
|
+
##### Function: readUInt32LE
|
|
18758
|
+
|
|
18759
|
+
```ts
|
|
18760
|
+
export function readUInt32LE(a: number[] | Uint8Array, offset: number): number
|
|
18464
18761
|
```
|
|
18465
18762
|
|
|
18466
18763
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -18469,7 +18766,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
18469
18766
|
##### Function: redeemServiceCharges
|
|
18470
18767
|
|
|
18471
18768
|
```ts
|
|
18472
|
-
export function redeemServiceCharges(privateKeyWif: string, charges: TableCommission[]): {}
|
|
18769
|
+
export function redeemServiceCharges(privateKeyWif: string, charges: TableCommission[]): Array<{}>
|
|
18473
18770
|
```
|
|
18474
18771
|
|
|
18475
18772
|
See also: [TableCommission](./storage.md#interface-tablecommission)
|
|
@@ -18536,7 +18833,7 @@ export function serializeBaseBlockHeader(header: BaseBlockHeader, buffer?: numbe
|
|
|
18536
18833
|
writer.writeUInt32LE(header.bits);
|
|
18537
18834
|
writer.writeUInt32LE(header.nonce);
|
|
18538
18835
|
const data = writer.toArray();
|
|
18539
|
-
if (buffer) {
|
|
18836
|
+
if (buffer != null) {
|
|
18540
18837
|
offset ||= 0;
|
|
18541
18838
|
for (let i = 0; i < data.length; i++) {
|
|
18542
18839
|
if (offset + i >= buffer.length) {
|
|
@@ -18630,10 +18927,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
18630
18927
|
---
|
|
18631
18928
|
##### Function: shareReqsWithWorld
|
|
18632
18929
|
|
|
18633
|
-
Verifies that all the txids are known reqs with ready-to-share status.
|
|
18634
|
-
Assigns a batch identifier and updates all the provenTxReqs.
|
|
18635
|
-
If not isDelayed, triggers an initial attempt to broadcast the batch and returns the results.
|
|
18636
|
-
|
|
18637
18930
|
```ts
|
|
18638
18931
|
export async function shareReqsWithWorld(storage: StorageProvider, userId: number, txids: string[], isDelayed: boolean, r?: GetReqsAndBeefResult, logger?: WalletLoggerInterface): Promise<{
|
|
18639
18932
|
swr: SendWithResult[];
|
|
@@ -18643,11 +18936,6 @@ export async function shareReqsWithWorld(storage: StorageProvider, userId: numbe
|
|
|
18643
18936
|
|
|
18644
18937
|
See also: [GetReqsAndBeefResult](./storage.md#interface-getreqsandbeefresult), [ReviewActionResult](./client.md#interface-reviewactionresult), [StorageProvider](./storage.md#class-storageprovider), [logger](./client.md#variable-logger)
|
|
18645
18938
|
|
|
18646
|
-
Argument Details
|
|
18647
|
-
|
|
18648
|
-
+ **r**
|
|
18649
|
-
+ Optional. Ignores txids and allows ProvenTxReqs and merged beef to be passed in.
|
|
18650
|
-
|
|
18651
18939
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18652
18940
|
|
|
18653
18941
|
---
|
|
@@ -18697,204 +18985,412 @@ Argument Details
|
|
|
18697
18985
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18698
18986
|
|
|
18699
18987
|
---
|
|
18700
|
-
##### Function: stampLogFormat
|
|
18988
|
+
##### Function: stampLogFormat
|
|
18989
|
+
|
|
18990
|
+
Replaces individual timestamps with delta msecs.
|
|
18991
|
+
Looks for two network crossings and adjusts clock for clock skew if found.
|
|
18992
|
+
Assumes log built by repeated calls to `stampLog`
|
|
18993
|
+
|
|
18994
|
+
```ts
|
|
18995
|
+
export function stampLogFormat(log?: string): string
|
|
18996
|
+
```
|
|
18997
|
+
|
|
18998
|
+
Returns
|
|
18999
|
+
|
|
19000
|
+
reformated multi-line event log
|
|
19001
|
+
|
|
19002
|
+
Argument Details
|
|
19003
|
+
|
|
19004
|
+
+ **log**
|
|
19005
|
+
+ Each logged event starts with ISO time stamp, space, rest of line, terminated by `\n`.
|
|
19006
|
+
|
|
19007
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19008
|
+
|
|
19009
|
+
---
|
|
19010
|
+
##### Function: subWork
|
|
19011
|
+
|
|
19012
|
+
Subtract Buffer encoded chainwork values
|
|
19013
|
+
|
|
19014
|
+
```ts
|
|
19015
|
+
export function subWork(work1: string, work2: string): string
|
|
19016
|
+
```
|
|
19017
|
+
|
|
19018
|
+
Returns
|
|
19019
|
+
|
|
19020
|
+
work1 - work2 as Buffer encoded chainWork value
|
|
19021
|
+
|
|
19022
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19023
|
+
|
|
19024
|
+
---
|
|
19025
|
+
##### Function: swapByteOrder
|
|
19026
|
+
|
|
19027
|
+
Returns a copy of a Buffer with byte order reversed.
|
|
19028
|
+
|
|
19029
|
+
```ts
|
|
19030
|
+
export function swapByteOrder(buffer: number[]): number[] {
|
|
19031
|
+
return buffer.slice().reverse();
|
|
19032
|
+
}
|
|
19033
|
+
```
|
|
19034
|
+
|
|
19035
|
+
Returns
|
|
19036
|
+
|
|
19037
|
+
new buffer with byte order reversed.
|
|
19038
|
+
|
|
19039
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19040
|
+
|
|
19041
|
+
---
|
|
19042
|
+
##### Function: throwDummyReviewActions
|
|
19043
|
+
|
|
19044
|
+
Throws a WERR_REVIEW_ACTIONS with a full set of properties to test data formats and propagation.
|
|
19045
|
+
|
|
19046
|
+
```ts
|
|
19047
|
+
export function throwDummyReviewActions()
|
|
19048
|
+
```
|
|
19049
|
+
|
|
19050
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19051
|
+
|
|
19052
|
+
---
|
|
19053
|
+
##### Function: toBinaryBaseBlockHeader
|
|
19054
|
+
|
|
19055
|
+
Serializes a block header as an 80 byte array.
|
|
19056
|
+
The exact serialized format is defined in the Bitcoin White Paper
|
|
19057
|
+
such that computing a double sha256 hash of the array computes
|
|
19058
|
+
the block hash for the header.
|
|
19059
|
+
|
|
19060
|
+
```ts
|
|
19061
|
+
export function toBinaryBaseBlockHeader(header: BaseBlockHeader): number[] {
|
|
19062
|
+
const writer = new Utils.Writer();
|
|
19063
|
+
writer.writeUInt32LE(header.version);
|
|
19064
|
+
writer.writeReverse(asArray(header.previousHash));
|
|
19065
|
+
writer.writeReverse(asArray(header.merkleRoot));
|
|
19066
|
+
writer.writeUInt32LE(header.time);
|
|
19067
|
+
writer.writeUInt32LE(header.bits);
|
|
19068
|
+
writer.writeUInt32LE(header.nonce);
|
|
19069
|
+
const r = writer.toArray();
|
|
19070
|
+
return r;
|
|
19071
|
+
}
|
|
19072
|
+
```
|
|
19073
|
+
|
|
19074
|
+
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [asArray](./client.md#function-asarray), [writeUInt32LE](./services.md#function-writeuint32le)
|
|
19075
|
+
|
|
19076
|
+
Returns
|
|
19077
|
+
|
|
19078
|
+
80 byte array
|
|
19079
|
+
|
|
19080
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19081
|
+
|
|
19082
|
+
---
|
|
19083
|
+
##### Function: toLookupNetworkPreset
|
|
19084
|
+
|
|
19085
|
+
Maps a Chain to a network preset suitable for LookupResolver / SHIPBroadcaster.
|
|
19086
|
+
Unlike `toWalletNetwork`, this returns `'local'` for `mock` chain.
|
|
19087
|
+
|
|
19088
|
+
```ts
|
|
19089
|
+
export function toLookupNetworkPreset(chain: Chain): "mainnet" | "testnet" | "local"
|
|
19090
|
+
```
|
|
19091
|
+
|
|
19092
|
+
See also: [Chain](./client.md#type-chain)
|
|
19093
|
+
|
|
19094
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19095
|
+
|
|
19096
|
+
---
|
|
19097
|
+
##### Function: toWalletNetwork
|
|
19098
|
+
|
|
19099
|
+
```ts
|
|
19100
|
+
export function toWalletNetwork(chain: Chain): WalletNetwork
|
|
19101
|
+
```
|
|
19102
|
+
|
|
19103
|
+
See also: [Chain](./client.md#type-chain)
|
|
19104
|
+
|
|
19105
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19106
|
+
|
|
19107
|
+
---
|
|
19108
|
+
##### Function: transactionInputSize
|
|
19109
|
+
|
|
19110
|
+
```ts
|
|
19111
|
+
export function transactionInputSize(scriptSize: number): number
|
|
19112
|
+
```
|
|
19113
|
+
|
|
19114
|
+
Returns
|
|
19115
|
+
|
|
19116
|
+
serialized byte length a transaction input
|
|
19117
|
+
|
|
19118
|
+
Argument Details
|
|
19119
|
+
|
|
19120
|
+
+ **scriptSize**
|
|
19121
|
+
+ byte length of input script
|
|
19122
|
+
|
|
19123
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19124
|
+
|
|
19125
|
+
---
|
|
19126
|
+
##### Function: transactionOutputSize
|
|
19127
|
+
|
|
19128
|
+
```ts
|
|
19129
|
+
export function transactionOutputSize(scriptSize: number): number
|
|
19130
|
+
```
|
|
19131
|
+
|
|
19132
|
+
Returns
|
|
19133
|
+
|
|
19134
|
+
serialized byte length a transaction output
|
|
19135
|
+
|
|
19136
|
+
Argument Details
|
|
19137
|
+
|
|
19138
|
+
+ **scriptSize**
|
|
19139
|
+
+ byte length of output script
|
|
19140
|
+
|
|
19141
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19142
|
+
|
|
19143
|
+
---
|
|
19144
|
+
##### Function: transactionSize
|
|
19145
|
+
|
|
19146
|
+
Compute the serialized binary transaction size in bytes
|
|
19147
|
+
given the number of inputs and outputs,
|
|
19148
|
+
and the size of each script.
|
|
19149
|
+
|
|
19150
|
+
```ts
|
|
19151
|
+
export function transactionSize(inputs: number[], outputs: number[]): number
|
|
19152
|
+
```
|
|
19153
|
+
|
|
19154
|
+
Returns
|
|
19155
|
+
|
|
19156
|
+
total transaction size in bytes
|
|
19157
|
+
|
|
19158
|
+
Argument Details
|
|
19159
|
+
|
|
19160
|
+
+ **inputs**
|
|
19161
|
+
+ array of input script lengths, in bytes
|
|
19162
|
+
+ **outputs**
|
|
19163
|
+
+ array of output script lengths, in bytes
|
|
19164
|
+
|
|
19165
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19166
|
+
|
|
19167
|
+
---
|
|
19168
|
+
##### Function: updateChaintracksFiatExchangeRates
|
|
19169
|
+
|
|
19170
|
+
```ts
|
|
19171
|
+
export async function updateChaintracksFiatExchangeRates(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
19172
|
+
```
|
|
19173
|
+
|
|
19174
|
+
See also: [FiatExchangeRates](./client.md#interface-fiatexchangerates), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
19175
|
+
|
|
19176
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19177
|
+
|
|
19178
|
+
---
|
|
19179
|
+
##### Function: updateExchangeratesapi
|
|
19180
|
+
|
|
19181
|
+
```ts
|
|
19182
|
+
export async function updateExchangeratesapi(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
19183
|
+
```
|
|
19184
|
+
|
|
19185
|
+
See also: [FiatExchangeRates](./client.md#interface-fiatexchangerates), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
19186
|
+
|
|
19187
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19188
|
+
|
|
19189
|
+
---
|
|
19190
|
+
##### Function: updateReqsFromAggregateResults
|
|
19191
|
+
|
|
19192
|
+
For each txid in submitted `txids`:
|
|
19193
|
+
|
|
19194
|
+
Based on its aggregate status, and whether broadcast happening in background (isDelayed) or immediately (!isDelayed),
|
|
19195
|
+
and iff current req.status is not 'unproven' or 'completed':
|
|
19196
|
+
|
|
19197
|
+
'success':
|
|
19198
|
+
req.status => 'unmined', tx.status => 'unproven'
|
|
19199
|
+
'doubleSpend':
|
|
19200
|
+
req.status => 'doubleSpend', tx.status => 'failed'
|
|
19201
|
+
'invalidTx':
|
|
19202
|
+
req.status => 'invalid', tx.status => 'failed'
|
|
19203
|
+
'serviceError':
|
|
19204
|
+
increment req.attempts
|
|
19205
|
+
|
|
19206
|
+
```ts
|
|
19207
|
+
export async function updateReqsFromAggregateResults(txids: string[], r: PostReqsToNetworkResult, apbrs: Record<string, AggregatePostBeefTxResult>, storage: StorageProvider, services?: sdk.WalletServices, trx?: sdk.TrxToken, logger?: WalletLoggerInterface): Promise<void>
|
|
19208
|
+
```
|
|
19209
|
+
|
|
19210
|
+
See also: [AggregatePostBeefTxResult](./storage.md#interface-aggregatepostbeeftxresult), [PostReqsToNetworkResult](./storage.md#interface-postreqstonetworkresult), [StorageProvider](./storage.md#class-storageprovider), [TrxToken](./client.md#interface-trxtoken), [WalletServices](./client.md#interface-walletservices), [logger](./client.md#variable-logger)
|
|
19211
|
+
|
|
19212
|
+
Argument Details
|
|
19213
|
+
|
|
19214
|
+
+ **services**
|
|
19215
|
+
+ if valid, doubleSpend results will be verified (but only if not within a trx. e.g. trx must be undefined)
|
|
19216
|
+
|
|
19217
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19218
|
+
|
|
19219
|
+
---
|
|
19220
|
+
##### Function: upgradeAllStoresV1
|
|
18701
19221
|
|
|
18702
|
-
|
|
18703
|
-
Looks for two network crossings and adjusts clock for clock skew if found.
|
|
18704
|
-
Assumes log built by repeated calls to `stampLog`
|
|
19222
|
+
Upgrade handler for every store that existed at schema version 1.
|
|
18705
19223
|
|
|
18706
19224
|
```ts
|
|
18707
|
-
export function
|
|
19225
|
+
export function upgradeAllStoresV1(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18708
19226
|
```
|
|
18709
19227
|
|
|
18710
|
-
|
|
19228
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18711
19229
|
|
|
18712
|
-
|
|
19230
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18713
19231
|
|
|
18714
|
-
|
|
19232
|
+
---
|
|
19233
|
+
##### Function: upgradeCertificateFields
|
|
18715
19234
|
|
|
18716
|
-
|
|
18717
|
-
|
|
19235
|
+
```ts
|
|
19236
|
+
export function upgradeCertificateFields(db: IDBPDatabase<StorageIdbSchema>): void
|
|
19237
|
+
```
|
|
19238
|
+
|
|
19239
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18718
19240
|
|
|
18719
19241
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18720
19242
|
|
|
18721
19243
|
---
|
|
18722
|
-
##### Function:
|
|
18723
|
-
|
|
18724
|
-
Subtract Buffer encoded chainwork values
|
|
19244
|
+
##### Function: upgradeCertificates
|
|
18725
19245
|
|
|
18726
19246
|
```ts
|
|
18727
|
-
export function
|
|
19247
|
+
export function upgradeCertificates(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18728
19248
|
```
|
|
18729
19249
|
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
work1 - work2 as Buffer encoded chainWork value
|
|
19250
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18733
19251
|
|
|
18734
19252
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18735
19253
|
|
|
18736
19254
|
---
|
|
18737
|
-
##### Function:
|
|
18738
|
-
|
|
18739
|
-
Returns a copy of a Buffer with byte order reversed.
|
|
19255
|
+
##### Function: upgradeCommissions
|
|
18740
19256
|
|
|
18741
19257
|
```ts
|
|
18742
|
-
export function
|
|
18743
|
-
return buffer.slice().reverse();
|
|
18744
|
-
}
|
|
19258
|
+
export function upgradeCommissions(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18745
19259
|
```
|
|
18746
19260
|
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
new buffer with byte order reversed.
|
|
19261
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18750
19262
|
|
|
18751
19263
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18752
19264
|
|
|
18753
19265
|
---
|
|
18754
|
-
##### Function:
|
|
18755
|
-
|
|
18756
|
-
Throws a WERR_REVIEW_ACTIONS with a full set of properties to test data formats and propagation.
|
|
19266
|
+
##### Function: upgradeMonitorEvents
|
|
18757
19267
|
|
|
18758
19268
|
```ts
|
|
18759
|
-
export function
|
|
19269
|
+
export function upgradeMonitorEvents(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18760
19270
|
```
|
|
18761
19271
|
|
|
19272
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
19273
|
+
|
|
18762
19274
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18763
19275
|
|
|
18764
19276
|
---
|
|
18765
|
-
##### Function:
|
|
18766
|
-
|
|
18767
|
-
Serializes a block header as an 80 byte array.
|
|
18768
|
-
The exact serialized format is defined in the Bitcoin White Paper
|
|
18769
|
-
such that computing a double sha256 hash of the array computes
|
|
18770
|
-
the block hash for the header.
|
|
19277
|
+
##### Function: upgradeOutputBaskets
|
|
18771
19278
|
|
|
18772
19279
|
```ts
|
|
18773
|
-
export function
|
|
18774
|
-
const writer = new Utils.Writer();
|
|
18775
|
-
writer.writeUInt32LE(header.version);
|
|
18776
|
-
writer.writeReverse(asArray(header.previousHash));
|
|
18777
|
-
writer.writeReverse(asArray(header.merkleRoot));
|
|
18778
|
-
writer.writeUInt32LE(header.time);
|
|
18779
|
-
writer.writeUInt32LE(header.bits);
|
|
18780
|
-
writer.writeUInt32LE(header.nonce);
|
|
18781
|
-
const r = writer.toArray();
|
|
18782
|
-
return r;
|
|
18783
|
-
}
|
|
19280
|
+
export function upgradeOutputBaskets(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18784
19281
|
```
|
|
18785
19282
|
|
|
18786
|
-
See also: [
|
|
18787
|
-
|
|
18788
|
-
Returns
|
|
18789
|
-
|
|
18790
|
-
80 byte array
|
|
19283
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18791
19284
|
|
|
18792
19285
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18793
19286
|
|
|
18794
19287
|
---
|
|
18795
|
-
##### Function:
|
|
18796
|
-
|
|
18797
|
-
Maps a Chain to a network preset suitable for LookupResolver / SHIPBroadcaster.
|
|
18798
|
-
Unlike `toWalletNetwork`, this returns `'local'` for `mock` chain.
|
|
19288
|
+
##### Function: upgradeOutputTags
|
|
18799
19289
|
|
|
18800
19290
|
```ts
|
|
18801
|
-
export function
|
|
19291
|
+
export function upgradeOutputTags(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18802
19292
|
```
|
|
18803
19293
|
|
|
18804
|
-
See also: [
|
|
19294
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18805
19295
|
|
|
18806
19296
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18807
19297
|
|
|
18808
19298
|
---
|
|
18809
|
-
##### Function:
|
|
19299
|
+
##### Function: upgradeOutputTagsMap
|
|
18810
19300
|
|
|
18811
19301
|
```ts
|
|
18812
|
-
export function
|
|
19302
|
+
export function upgradeOutputTagsMap(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18813
19303
|
```
|
|
18814
19304
|
|
|
18815
|
-
See also: [
|
|
19305
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18816
19306
|
|
|
18817
19307
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18818
19308
|
|
|
18819
19309
|
---
|
|
18820
|
-
##### Function:
|
|
19310
|
+
##### Function: upgradeOutputs
|
|
18821
19311
|
|
|
18822
19312
|
```ts
|
|
18823
|
-
export function
|
|
19313
|
+
export function upgradeOutputs(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18824
19314
|
```
|
|
18825
19315
|
|
|
18826
|
-
|
|
19316
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18827
19317
|
|
|
18828
|
-
|
|
19318
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18829
19319
|
|
|
18830
|
-
|
|
19320
|
+
---
|
|
19321
|
+
##### Function: upgradeProvenTxReqs
|
|
18831
19322
|
|
|
18832
|
-
|
|
18833
|
-
|
|
19323
|
+
```ts
|
|
19324
|
+
export function upgradeProvenTxReqs(db: IDBPDatabase<StorageIdbSchema>): void
|
|
19325
|
+
```
|
|
19326
|
+
|
|
19327
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18834
19328
|
|
|
18835
19329
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18836
19330
|
|
|
18837
19331
|
---
|
|
18838
|
-
##### Function:
|
|
19332
|
+
##### Function: upgradeProvenTxs
|
|
18839
19333
|
|
|
18840
19334
|
```ts
|
|
18841
|
-
export function
|
|
19335
|
+
export function upgradeProvenTxs(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18842
19336
|
```
|
|
18843
19337
|
|
|
18844
|
-
|
|
19338
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18845
19339
|
|
|
18846
|
-
|
|
19340
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18847
19341
|
|
|
18848
|
-
|
|
19342
|
+
---
|
|
19343
|
+
##### Function: upgradeSyncStates
|
|
18849
19344
|
|
|
18850
|
-
|
|
18851
|
-
|
|
19345
|
+
```ts
|
|
19346
|
+
export function upgradeSyncStates(db: IDBPDatabase<StorageIdbSchema>): void
|
|
19347
|
+
```
|
|
19348
|
+
|
|
19349
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18852
19350
|
|
|
18853
19351
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18854
19352
|
|
|
18855
19353
|
---
|
|
18856
|
-
##### Function:
|
|
18857
|
-
|
|
18858
|
-
Compute the serialized binary transaction size in bytes
|
|
18859
|
-
given the number of inputs and outputs,
|
|
18860
|
-
and the size of each script.
|
|
19354
|
+
##### Function: upgradeTransactions
|
|
18861
19355
|
|
|
18862
19356
|
```ts
|
|
18863
|
-
export function
|
|
19357
|
+
export function upgradeTransactions(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18864
19358
|
```
|
|
18865
19359
|
|
|
18866
|
-
|
|
19360
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18867
19361
|
|
|
18868
|
-
|
|
19362
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18869
19363
|
|
|
18870
|
-
|
|
19364
|
+
---
|
|
19365
|
+
##### Function: upgradeTxLabels
|
|
18871
19366
|
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
|
|
18875
|
-
|
|
19367
|
+
```ts
|
|
19368
|
+
export function upgradeTxLabels(db: IDBPDatabase<StorageIdbSchema>): void
|
|
19369
|
+
```
|
|
19370
|
+
|
|
19371
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18876
19372
|
|
|
18877
19373
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18878
19374
|
|
|
18879
19375
|
---
|
|
18880
|
-
##### Function:
|
|
19376
|
+
##### Function: upgradeTxLabelsMap
|
|
18881
19377
|
|
|
18882
19378
|
```ts
|
|
18883
|
-
export
|
|
19379
|
+
export function upgradeTxLabelsMap(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18884
19380
|
```
|
|
18885
19381
|
|
|
18886
|
-
See also: [
|
|
19382
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18887
19383
|
|
|
18888
19384
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18889
19385
|
|
|
18890
19386
|
---
|
|
18891
|
-
##### Function:
|
|
19387
|
+
##### Function: upgradeUsers
|
|
18892
19388
|
|
|
18893
19389
|
```ts
|
|
18894
|
-
export
|
|
19390
|
+
export function upgradeUsers(db: IDBPDatabase<StorageIdbSchema>): void
|
|
18895
19391
|
```
|
|
18896
19392
|
|
|
18897
|
-
See also: [
|
|
19393
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
18898
19394
|
|
|
18899
19395
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18900
19396
|
|
|
@@ -18986,6 +19482,55 @@ Argument Details
|
|
|
18986
19482
|
|
|
18987
19483
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
18988
19484
|
|
|
19485
|
+
---
|
|
19486
|
+
##### Function: validateDate
|
|
19487
|
+
|
|
19488
|
+
Shared entity-validation helpers used by both client-side storage remoting
|
|
19489
|
+
(StorageClientBase / StorageMobile) and the server-side StorageServer.
|
|
19490
|
+
|
|
19491
|
+
These helpers normalise records returned from remote calls or database queries:
|
|
19492
|
+
- Coerce date strings / timestamps to `Date` objects.
|
|
19493
|
+
- Replace `null` values with `undefined`.
|
|
19494
|
+
- Replace `Uint8Array` / `Buffer` values with plain `number[]` arrays.
|
|
19495
|
+
|
|
19496
|
+
```ts
|
|
19497
|
+
export function validateDate(date: Date | string | number): Date
|
|
19498
|
+
```
|
|
19499
|
+
|
|
19500
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19501
|
+
|
|
19502
|
+
---
|
|
19503
|
+
##### Function: validateEntities
|
|
19504
|
+
|
|
19505
|
+
Force uniform behaviour across database engines.
|
|
19506
|
+
Use to process all arrays of records with timestamps retrieved from database.
|
|
19507
|
+
|
|
19508
|
+
```ts
|
|
19509
|
+
export function validateEntities<T extends EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
19510
|
+
```
|
|
19511
|
+
|
|
19512
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
19513
|
+
|
|
19514
|
+
Returns
|
|
19515
|
+
|
|
19516
|
+
input `entities` array with contained values validated.
|
|
19517
|
+
|
|
19518
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19519
|
+
|
|
19520
|
+
---
|
|
19521
|
+
##### Function: validateEntity
|
|
19522
|
+
|
|
19523
|
+
Force uniform behaviour across database engines.
|
|
19524
|
+
Use to process all individual records with timestamps retrieved from database.
|
|
19525
|
+
|
|
19526
|
+
```ts
|
|
19527
|
+
export function validateEntity<T extends EntityTimeStamp>(entity: T, dateFields?: string[]): T
|
|
19528
|
+
```
|
|
19529
|
+
|
|
19530
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
19531
|
+
|
|
19532
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19533
|
+
|
|
18989
19534
|
---
|
|
18990
19535
|
##### Function: validateGenerateChangeSdkParams
|
|
18991
19536
|
|
|
@@ -19101,6 +19646,20 @@ See also: [StorageFeeModel](./client.md#interface-storagefeemodel)
|
|
|
19101
19646
|
|
|
19102
19647
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19103
19648
|
|
|
19649
|
+
---
|
|
19650
|
+
##### Function: validateSyncChunkEntities
|
|
19651
|
+
|
|
19652
|
+
Validate all entity arrays within a `SyncChunk` received from a remote storage call.
|
|
19653
|
+
Normalises timestamps, nulls, and binary fields in-place.
|
|
19654
|
+
|
|
19655
|
+
```ts
|
|
19656
|
+
export function validateSyncChunkEntities(r: SyncChunk): SyncChunk
|
|
19657
|
+
```
|
|
19658
|
+
|
|
19659
|
+
See also: [SyncChunk](./client.md#interface-syncchunk)
|
|
19660
|
+
|
|
19661
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19662
|
+
|
|
19104
19663
|
---
|
|
19105
19664
|
##### Function: varUintSize
|
|
19106
19665
|
|
|
@@ -19110,7 +19669,13 @@ Returns the byte size required to encode number as Bitcoin VarUint
|
|
|
19110
19669
|
export function varUintSize(val: number): 1 | 3 | 5 | 9 {
|
|
19111
19670
|
if (val < 0)
|
|
19112
19671
|
throw new WERR_INVALID_PARAMETER("varUint", "non-negative");
|
|
19113
|
-
|
|
19672
|
+
if (val <= 252)
|
|
19673
|
+
return 1;
|
|
19674
|
+
if (val <= 65535)
|
|
19675
|
+
return 3;
|
|
19676
|
+
if (val <= 4294967295)
|
|
19677
|
+
return 5;
|
|
19678
|
+
return 9;
|
|
19114
19679
|
}
|
|
19115
19680
|
```
|
|
19116
19681
|
|
|
@@ -19271,13 +19836,13 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
19271
19836
|
Returns an await'able Promise that resolves in the given number of msecs.
|
|
19272
19837
|
|
|
19273
19838
|
```ts
|
|
19274
|
-
export function wait(msecs: number): Promise<void> {
|
|
19839
|
+
export async function wait(msecs: number): Promise<void> {
|
|
19275
19840
|
const MIN_WAIT = 0;
|
|
19276
19841
|
const MAX_WAIT = 2 * 60 * 1000;
|
|
19277
|
-
if (typeof msecs !== "number" || !Number.isFinite(msecs) || isNaN(msecs) || msecs < MIN_WAIT || msecs > MAX_WAIT) {
|
|
19842
|
+
if (typeof msecs !== "number" || !Number.isFinite(msecs) || Number.isNaN(msecs) || msecs < MIN_WAIT || msecs > MAX_WAIT) {
|
|
19278
19843
|
throw new WERR_INVALID_PARAMETER("msecs", `a number between ${MIN_WAIT} and ${MAX_WAIT} msecs, not ${msecs}.`);
|
|
19279
19844
|
}
|
|
19280
|
-
return new Promise(resolve => setTimeout(resolve, msecs));
|
|
19845
|
+
return await new Promise(resolve => setTimeout(resolve, msecs));
|
|
19281
19846
|
}
|
|
19282
19847
|
```
|
|
19283
19848
|
|
|
@@ -19343,23 +19908,59 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
19343
19908
|
|
|
19344
19909
|
| | | |
|
|
19345
19910
|
| --- | --- | --- |
|
|
19346
|
-
| [
|
|
19347
|
-
| [
|
|
19348
|
-
| [
|
|
19349
|
-
| [
|
|
19350
|
-
| [
|
|
19351
|
-
| [
|
|
19352
|
-
| [
|
|
19353
|
-
| [
|
|
19354
|
-
| [
|
|
19355
|
-
| [
|
|
19356
|
-
| [
|
|
19357
|
-
| [
|
|
19911
|
+
| [AnyBlockHeader](#type-anyblockheader) | [GetStatusForTxidsService](#type-getstatusfortxidsservice) | [PostTxsService](#type-posttxsservice) |
|
|
19912
|
+
| [ByteEncoding](#type-byteencoding) | [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [ProvenTxReqStatus](#type-proventxreqstatus) |
|
|
19913
|
+
| [ByteInput](#type-byteinput) | [GetUtxoStatusService](#type-getutxostatusservice) | [ReorgListener](#type-reorglistener) |
|
|
19914
|
+
| [Chain](#type-chain) | [GroupedPermissionEventHandler](#type-groupedpermissioneventhandler) | [ReviewActionResultStatus](#type-reviewactionresultstatus) |
|
|
19915
|
+
| [CounterpartyPermissionEventHandler](#type-counterpartypermissioneventhandler) | [HeaderListener](#type-headerlistener) | [ScriptHashFormat](#type-scripthashformat) |
|
|
19916
|
+
| [DBType](#type-dbtype) | [InsertHeaderResult](#type-insertheaderresult) | [SecurityLevel](#type-securitylevel) |
|
|
19917
|
+
| [EnqueueHandler](#type-enqueuehandler) | [LineItemType](#type-lineitemtype) | [StorageProvidedBy](#type-storageprovidedby) |
|
|
19918
|
+
| [EntityStorage](#type-entitystorage) | [MerklePathNoteWhat](#type-merklepathnotewhat) | [SyncProtocolVersion](#type-syncprotocolversion) |
|
|
19919
|
+
| [ErrorHandler](#type-errorhandler) | [MonitorStartupTaskMode](#type-monitorstartuptaskmode) | [SyncStatus](#type-syncstatus) |
|
|
19920
|
+
| [FiatCurrencyCode](#type-fiatcurrencycode) | [MonitorStorage](#type-monitorstorage) | [TransactionStatus](#type-transactionstatus) |
|
|
19921
|
+
| [GetMerklePathService](#type-getmerklepathservice) | [PermissionEventHandler](#type-permissioneventhandler) | [UpdateFiatExchangeRateService](#type-updatefiatexchangerateservice) |
|
|
19922
|
+
| [GetRawTxService](#type-getrawtxservice) | [PostBeefService](#type-postbeefservice) | [WalletLoggerLevel](#type-walletloggerlevel) |
|
|
19923
|
+
| [GetScriptHashHistoryService](#type-getscripthashhistoryservice) | [PostReqsToNetworkDetailsStatus](#type-postreqstonetworkdetailsstatus) | |
|
|
19924
|
+
|
|
19925
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19926
|
+
|
|
19927
|
+
---
|
|
19928
|
+
|
|
19929
|
+
##### Type: AnyBlockHeader
|
|
19930
|
+
|
|
19931
|
+
Union of all block header variants
|
|
19932
|
+
|
|
19933
|
+
```ts
|
|
19934
|
+
export type AnyBlockHeader = BaseBlockHeader | BlockHeader | LiveBlockHeader
|
|
19935
|
+
```
|
|
19936
|
+
|
|
19937
|
+
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
19938
|
+
|
|
19939
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19940
|
+
|
|
19941
|
+
---
|
|
19942
|
+
##### Type: ByteEncoding
|
|
19943
|
+
|
|
19944
|
+
Encoding identifier for buffer-coercion helpers
|
|
19945
|
+
|
|
19946
|
+
```ts
|
|
19947
|
+
export type ByteEncoding = "hex" | "utf8" | "base64"
|
|
19948
|
+
```
|
|
19358
19949
|
|
|
19359
19950
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19360
19951
|
|
|
19361
19952
|
---
|
|
19953
|
+
##### Type: ByteInput
|
|
19954
|
+
|
|
19955
|
+
Byte array, string, or Uint8Array accepted by buffer-coercion helpers
|
|
19956
|
+
|
|
19957
|
+
```ts
|
|
19958
|
+
export type ByteInput = string | number[] | Uint8Array
|
|
19959
|
+
```
|
|
19960
|
+
|
|
19961
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19362
19962
|
|
|
19963
|
+
---
|
|
19363
19964
|
##### Type: Chain
|
|
19364
19965
|
|
|
19365
19966
|
```ts
|
|
@@ -19541,37 +20142,43 @@ See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
|
19541
20142
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19542
20143
|
|
|
19543
20144
|
---
|
|
19544
|
-
##### Type:
|
|
20145
|
+
##### Type: LineItemType
|
|
20146
|
+
|
|
20147
|
+
Line item type for spending authorization requests.
|
|
19545
20148
|
|
|
19546
20149
|
```ts
|
|
19547
|
-
export type
|
|
20150
|
+
export type LineItemType = "input" | "output" | "fee"
|
|
19548
20151
|
```
|
|
19549
20152
|
|
|
19550
20153
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19551
20154
|
|
|
19552
20155
|
---
|
|
19553
|
-
##### Type:
|
|
20156
|
+
##### Type: MerklePathNoteWhat
|
|
19554
20157
|
|
|
19555
20158
|
```ts
|
|
19556
|
-
export type
|
|
20159
|
+
export type MerklePathNoteWhat = "getMerklePathRetry" | "getMerklePathNotFound" | "getMerklePathBadStatus" | "getMerklePathNoData" | "getMerklePathSuccess" | "getMerklePathNoHeader" | "getMerklePathError" | "getMerklePathInternal"
|
|
19557
20160
|
```
|
|
19558
20161
|
|
|
19559
|
-
|
|
20162
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
20163
|
+
|
|
20164
|
+
---
|
|
20165
|
+
##### Type: MonitorStartupTaskMode
|
|
20166
|
+
|
|
20167
|
+
```ts
|
|
20168
|
+
export type MonitorStartupTaskMode = "none" | "default" | "multiuser" | "alltoother"
|
|
20169
|
+
```
|
|
19560
20170
|
|
|
19561
20171
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19562
20172
|
|
|
19563
20173
|
---
|
|
19564
|
-
##### Type:
|
|
20174
|
+
##### Type: MonitorStorage
|
|
19565
20175
|
|
|
19566
20176
|
```ts
|
|
19567
|
-
export type
|
|
19568
|
-
from?: number;
|
|
19569
|
-
to?: number;
|
|
19570
|
-
timeFilterRequested: boolean;
|
|
19571
|
-
remainingLabels: string[];
|
|
19572
|
-
}
|
|
20177
|
+
export type MonitorStorage = WalletStorageManager
|
|
19573
20178
|
```
|
|
19574
20179
|
|
|
20180
|
+
See also: [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
20181
|
+
|
|
19575
20182
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19576
20183
|
|
|
19577
20184
|
---
|
|
@@ -19685,19 +20292,6 @@ See also: [BlockHeader](./client.md#interface-blockheader)
|
|
|
19685
20292
|
|
|
19686
20293
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19687
20294
|
|
|
19688
|
-
---
|
|
19689
|
-
##### Type: ReqHistoryNote
|
|
19690
|
-
|
|
19691
|
-
```ts
|
|
19692
|
-
export type ReqHistoryNote = {
|
|
19693
|
-
when?: string;
|
|
19694
|
-
what: string;
|
|
19695
|
-
[key: string]: boolean | string | number | undefined;
|
|
19696
|
-
}
|
|
19697
|
-
```
|
|
19698
|
-
|
|
19699
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19700
|
-
|
|
19701
20295
|
---
|
|
19702
20296
|
##### Type: ReviewActionResultStatus
|
|
19703
20297
|
|
|
@@ -19725,34 +20319,12 @@ export type ScriptHashFormat = "hashLE" | "hashBE" | "script"
|
|
|
19725
20319
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
19726
20320
|
|
|
19727
20321
|
---
|
|
19728
|
-
##### Type:
|
|
19729
|
-
|
|
19730
|
-
Type for the service call history returned by Services.getServicesCallHistory.
|
|
19731
|
-
|
|
19732
|
-
```ts
|
|
19733
|
-
export type ServicesCallHistory = {
|
|
19734
|
-
version: number;
|
|
19735
|
-
getMerklePath: ServiceCallHistory;
|
|
19736
|
-
getRawTx: ServiceCallHistory;
|
|
19737
|
-
postBeef: ServiceCallHistory;
|
|
19738
|
-
getUtxoStatus: ServiceCallHistory;
|
|
19739
|
-
getStatusForTxids: ServiceCallHistory;
|
|
19740
|
-
getScriptHashHistory: ServiceCallHistory;
|
|
19741
|
-
updateFiatExchangeRates: ServiceCallHistory;
|
|
19742
|
-
}
|
|
19743
|
-
```
|
|
19744
|
-
|
|
19745
|
-
See also: [ServiceCallHistory](./client.md#interface-servicecallhistory)
|
|
19746
|
-
|
|
19747
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
20322
|
+
##### Type: SecurityLevel
|
|
19748
20323
|
|
|
19749
|
-
|
|
19750
|
-
##### Type: StopListenerToken
|
|
20324
|
+
Security level for DPACP protocol permissions.
|
|
19751
20325
|
|
|
19752
20326
|
```ts
|
|
19753
|
-
export type
|
|
19754
|
-
stop: (() => void) | undefined;
|
|
19755
|
-
}
|
|
20327
|
+
export type SecurityLevel = 0 | 1 | 2
|
|
19756
20328
|
```
|
|
19757
20329
|
|
|
19758
20330
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -20000,7 +20572,7 @@ aggregateActionResults = async (storage: StorageProvider, sendWithResultReqs: Se
|
|
|
20000
20572
|
for (const ar of sendWithResultReqs) {
|
|
20001
20573
|
const txid = ar.txid;
|
|
20002
20574
|
const d = postToNetworkResult.details.find(d => d.txid === txid);
|
|
20003
|
-
if (
|
|
20575
|
+
if (d == null)
|
|
20004
20576
|
throw new WERR_INTERNAL(`missing details for ${txid}`);
|
|
20005
20577
|
const arNdr: ReviewActionResult = { txid: d.txid, status: "success", competingTxs: d.competingTxs };
|
|
20006
20578
|
switch (d.status) {
|
|
@@ -20010,7 +20582,7 @@ aggregateActionResults = async (storage: StorageProvider, sendWithResultReqs: Se
|
|
|
20010
20582
|
case "doubleSpend":
|
|
20011
20583
|
ar.status = "failed";
|
|
20012
20584
|
arNdr.status = "doubleSpend";
|
|
20013
|
-
if (d.competingTxs)
|
|
20585
|
+
if (d.competingTxs != null)
|
|
20014
20586
|
arNdr.competingBeef = await createMergedBeefOfTxids(d.competingTxs, storage);
|
|
20015
20587
|
break;
|
|
20016
20588
|
case "serviceError":
|
|
@@ -20068,8 +20640,8 @@ getLabelToSpecOp: () => Record<string, ListActionsSpecOp> = () => {
|
|
|
20068
20640
|
name: "noSendActions",
|
|
20069
20641
|
labelsToIntercept: ["abort"],
|
|
20070
20642
|
setStatusFilter: () => ["nosend"],
|
|
20071
|
-
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction
|
|
20072
|
-
if (specOpLabels.
|
|
20643
|
+
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Array<Partial<TableTransaction>>): Promise<void> => {
|
|
20644
|
+
if (specOpLabels.includes("abort")) {
|
|
20073
20645
|
for (const tx of txs) {
|
|
20074
20646
|
if (tx.status === "nosend") {
|
|
20075
20647
|
await s.abortAction(auth, { reference: tx.reference! });
|
|
@@ -20083,8 +20655,8 @@ getLabelToSpecOp: () => Record<string, ListActionsSpecOp> = () => {
|
|
|
20083
20655
|
name: "failedActions",
|
|
20084
20656
|
labelsToIntercept: ["unfail"],
|
|
20085
20657
|
setStatusFilter: () => ["failed"],
|
|
20086
|
-
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction
|
|
20087
|
-
if (specOpLabels.
|
|
20658
|
+
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Array<Partial<TableTransaction>>): Promise<void> => {
|
|
20659
|
+
if (specOpLabels.includes("unfail")) {
|
|
20088
20660
|
for (const tx of txs) {
|
|
20089
20661
|
if (tx.status === "failed") {
|
|
20090
20662
|
await s.updateTransaction(tx.transactionId!, { status: "unfail" });
|
|
@@ -20300,28 +20872,28 @@ transformVerifiableCertificatesWithTrust = (trustSettings: TrustSettings, certif
|
|
|
20300
20872
|
const certifierCache: Record<string, Certifier> = {};
|
|
20301
20873
|
certificates.forEach(cert => {
|
|
20302
20874
|
const { subject, certifier } = cert;
|
|
20303
|
-
if (
|
|
20875
|
+
if (subject === "" || certifier === "")
|
|
20304
20876
|
return;
|
|
20305
|
-
if (
|
|
20877
|
+
if (certifierCache[certifier] == null) {
|
|
20306
20878
|
const found = trustSettings.trustedCertifiers.find(x => x.identityKey === certifier);
|
|
20307
|
-
if (
|
|
20879
|
+
if (found == null)
|
|
20308
20880
|
return;
|
|
20309
20881
|
certifierCache[certifier] = found;
|
|
20310
20882
|
}
|
|
20311
20883
|
const certifierInfo: IdentityCertifier = {
|
|
20312
20884
|
name: certifierCache[certifier].name,
|
|
20313
|
-
iconUrl: certifierCache[certifier].iconUrl
|
|
20885
|
+
iconUrl: certifierCache[certifier].iconUrl ?? "",
|
|
20314
20886
|
description: certifierCache[certifier].description,
|
|
20315
20887
|
trust: certifierCache[certifier].trust
|
|
20316
20888
|
};
|
|
20317
20889
|
const extendedCert: IdentityCertificate = {
|
|
20318
20890
|
...cert,
|
|
20319
|
-
signature: cert.signature
|
|
20891
|
+
signature: cert.signature as string,
|
|
20320
20892
|
decryptedFields: cert.decryptedFields as Record<string, string>,
|
|
20321
20893
|
publiclyRevealedKeyring: cert.keyring,
|
|
20322
20894
|
certifierInfo
|
|
20323
20895
|
};
|
|
20324
|
-
if (
|
|
20896
|
+
if (identityGroups[subject] == null) {
|
|
20325
20897
|
identityGroups[subject] = { totalTrust: 0, members: [] };
|
|
20326
20898
|
}
|
|
20327
20899
|
identityGroups[subject].totalTrust += certifierInfo.trust;
|