@bsv/wallet-toolbox 1.1.0
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/.env.template +22 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
- package/.github/ISSUE_TEMPLATE/discussion.md +24 -0
- package/.github/pull_request_template.md +24 -0
- package/.github/workflows/push.yaml +66 -0
- package/.prettierrc +10 -0
- package/CONTRIBUTING.md +89 -0
- package/LICENSE.txt +28 -0
- package/README.md +124 -0
- package/dev.sqlite3 +0 -0
- package/docs/README.md +15 -0
- package/docs/client.md +6812 -0
- package/docs/monitor.md +648 -0
- package/docs/services.md +496 -0
- package/docs/storage.md +1884 -0
- package/docs/wallet.md +6812 -0
- package/jest.config.ts +29 -0
- package/knexfile.js +9 -0
- package/license.md +1 -0
- package/out/src/Wallet.d.ts +83 -0
- package/out/src/Wallet.d.ts.map +1 -0
- package/out/src/Wallet.js +415 -0
- package/out/src/Wallet.js.map +1 -0
- package/out/src/index.all.d.ts +9 -0
- package/out/src/index.all.d.ts.map +1 -0
- package/out/src/index.all.js +48 -0
- package/out/src/index.all.js.map +1 -0
- package/out/src/index.client.d.ts +8 -0
- package/out/src/index.client.d.ts.map +1 -0
- package/out/src/index.client.js +47 -0
- package/out/src/index.client.js.map +1 -0
- package/out/src/index.d.ts +3 -0
- package/out/src/index.d.ts.map +1 -0
- package/out/src/index.js +42 -0
- package/out/src/index.js.map +1 -0
- package/out/src/monitor/Monitor.d.ts +89 -0
- package/out/src/monitor/Monitor.d.ts.map +1 -0
- package/out/src/monitor/Monitor.js +253 -0
- package/out/src/monitor/Monitor.js.map +1 -0
- package/out/src/monitor/MonitorDaemon.d.ts +30 -0
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -0
- package/out/src/monitor/MonitorDaemon.js +135 -0
- package/out/src/monitor/MonitorDaemon.js.map +1 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.d.ts +2 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.d.ts.map +1 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.js +50 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.js.map +1 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +53 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.js +197 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -0
- package/out/src/monitor/tasks/TaskClock.d.ts +14 -0
- package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskClock.js +27 -0
- package/out/src/monitor/tasks/TaskClock.js.map +1 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts +20 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.js +52 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -0
- package/out/src/monitor/tasks/TaskNewHeader.d.ts +15 -0
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskNewHeader.js +45 -0
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -0
- package/out/src/monitor/tasks/TaskPurge.d.ts +45 -0
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskPurge.js +35 -0
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -0
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts +26 -0
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskReviewStatus.js +44 -0
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -0
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts +32 -0
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskSendWaiting.js +99 -0
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +12 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js +22 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -0
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts +40 -0
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -0
- package/out/src/monitor/tasks/WalletMonitorTask.js +37 -0
- package/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -0
- package/out/src/sdk/CertOps.d.ts +66 -0
- package/out/src/sdk/CertOps.d.ts.map +1 -0
- package/out/src/sdk/CertOps.js +198 -0
- package/out/src/sdk/CertOps.js.map +1 -0
- package/out/src/sdk/PrivilegedKeyManager.d.ts +125 -0
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -0
- package/out/src/sdk/PrivilegedKeyManager.js +293 -0
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -0
- package/out/src/sdk/StorageSyncReader.d.ts +121 -0
- package/out/src/sdk/StorageSyncReader.d.ts.map +1 -0
- package/out/src/sdk/StorageSyncReader.js +3 -0
- package/out/src/sdk/StorageSyncReader.js.map +1 -0
- package/out/src/sdk/StorageSyncReaderWriter.d.ts +89 -0
- package/out/src/sdk/StorageSyncReaderWriter.d.ts.map +1 -0
- package/out/src/sdk/StorageSyncReaderWriter.js +3 -0
- package/out/src/sdk/StorageSyncReaderWriter.js.map +1 -0
- package/out/src/sdk/WERR_errors.d.ts +90 -0
- package/out/src/sdk/WERR_errors.d.ts.map +1 -0
- package/out/src/sdk/WERR_errors.js +128 -0
- package/out/src/sdk/WERR_errors.js.map +1 -0
- package/out/src/sdk/WalletError.d.ts +45 -0
- package/out/src/sdk/WalletError.d.ts.map +1 -0
- package/out/src/sdk/WalletError.js +122 -0
- package/out/src/sdk/WalletError.js.map +1 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts +325 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletServices.interfaces.js +3 -0
- package/out/src/sdk/WalletServices.interfaces.js.map +1 -0
- package/out/src/sdk/WalletSigner.interfaces.d.ts +10 -0
- package/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletSigner.interfaces.js +3 -0
- package/out/src/sdk/WalletSigner.interfaces.js.map +1 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts +299 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletStorage.interfaces.js +3 -0
- package/out/src/sdk/WalletStorage.interfaces.js.map +1 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.d.ts +2 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.d.ts.map +1 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.js +125 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +1 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.d.ts +2 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.d.ts.map +1 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js +660 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js.map +1 -0
- package/out/src/sdk/index.d.ts +12 -0
- package/out/src/sdk/index.d.ts.map +1 -0
- package/out/src/sdk/index.js +28 -0
- package/out/src/sdk/index.js.map +1 -0
- package/out/src/sdk/types.d.ts +74 -0
- package/out/src/sdk/types.d.ts.map +1 -0
- package/out/src/sdk/types.js +20 -0
- package/out/src/sdk/types.js.map +1 -0
- package/out/src/sdk/validationHelpers.d.ts +288 -0
- package/out/src/sdk/validationHelpers.d.ts.map +1 -0
- package/out/src/sdk/validationHelpers.js +630 -0
- package/out/src/sdk/validationHelpers.js.map +1 -0
- package/out/src/services/ServiceCollection.d.ts +25 -0
- package/out/src/services/ServiceCollection.d.ts.map +1 -0
- package/out/src/services/ServiceCollection.js +43 -0
- package/out/src/services/ServiceCollection.js.map +1 -0
- package/out/src/services/Services.d.ts +60 -0
- package/out/src/services/Services.d.ts.map +1 -0
- package/out/src/services/Services.js +342 -0
- package/out/src/services/Services.js.map +1 -0
- package/out/src/services/__tests/getMerklePath.test.d.ts +2 -0
- package/out/src/services/__tests/getMerklePath.test.d.ts.map +1 -0
- package/out/src/services/__tests/getMerklePath.test.js +16 -0
- package/out/src/services/__tests/getMerklePath.test.js.map +1 -0
- package/out/src/services/__tests/getRawTx.test.d.ts +2 -0
- package/out/src/services/__tests/getRawTx.test.d.ts.map +1 -0
- package/out/src/services/__tests/getRawTx.test.js +13 -0
- package/out/src/services/__tests/getRawTx.test.js.map +1 -0
- package/out/src/services/__tests/postBeef.test.d.ts +2 -0
- package/out/src/services/__tests/postBeef.test.d.ts.map +1 -0
- package/out/src/services/__tests/postBeef.test.js +18 -0
- package/out/src/services/__tests/postBeef.test.js.map +1 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.d.ts +2 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.d.ts.map +1 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.js +479 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.js.map +1 -0
- package/out/src/services/__tests/postTxs.test.d.ts +2 -0
- package/out/src/services/__tests/postTxs.test.d.ts.map +1 -0
- package/out/src/services/__tests/postTxs.test.js +19 -0
- package/out/src/services/__tests/postTxs.test.js.map +1 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +15 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.js +51 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.d.ts +2 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.d.ts.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js +19 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.d.ts +2 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.d.ts.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js +29 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +98 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +38 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +36 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +130 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/index.d.ts +3 -0
- package/out/src/services/chaintracker/chaintracks/index.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/index.js +19 -0
- package/out/src/services/chaintracker/chaintracks/index.js.map +1 -0
- package/out/src/services/chaintracker/index.d.ts +3 -0
- package/out/src/services/chaintracker/index.d.ts.map +1 -0
- package/out/src/services/chaintracker/index.js +19 -0
- package/out/src/services/chaintracker/index.js.map +1 -0
- package/out/src/services/createDefaultWalletServicesOptions.d.ts +3 -0
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -0
- package/out/src/services/createDefaultWalletServicesOptions.js +34 -0
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -0
- package/out/src/services/index.d.ts +2 -0
- package/out/src/services/index.d.ts.map +1 -0
- package/out/src/services/index.js +18 -0
- package/out/src/services/index.js.map +1 -0
- package/out/src/services/providers/arcServices.d.ts +62 -0
- package/out/src/services/providers/arcServices.d.ts.map +1 -0
- package/out/src/services/providers/arcServices.js +368 -0
- package/out/src/services/providers/arcServices.js.map +1 -0
- package/out/src/services/providers/echangeRates.d.ts +12 -0
- package/out/src/services/providers/echangeRates.d.ts.map +1 -0
- package/out/src/services/providers/echangeRates.js +237 -0
- package/out/src/services/providers/echangeRates.js.map +1 -0
- package/out/src/services/providers/whatsonchain.d.ts +17 -0
- package/out/src/services/providers/whatsonchain.d.ts.map +1 -0
- package/out/src/services/providers/whatsonchain.js +130 -0
- package/out/src/services/providers/whatsonchain.js.map +1 -0
- package/out/src/signer/WalletSigner.d.ts +11 -0
- package/out/src/signer/WalletSigner.d.ts.map +1 -0
- package/out/src/signer/WalletSigner.js +13 -0
- package/out/src/signer/WalletSigner.js.map +1 -0
- package/out/src/signer/methods/acquireDirectCertificate.d.ts +4 -0
- package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -0
- package/out/src/signer/methods/acquireDirectCertificate.js +47 -0
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -0
- package/out/src/signer/methods/createAction.d.ts +7 -0
- package/out/src/signer/methods/createAction.d.ts.map +1 -0
- package/out/src/signer/methods/createAction.js +250 -0
- package/out/src/signer/methods/createAction.js.map +1 -0
- package/out/src/signer/methods/internalizeAction.d.ts +31 -0
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -0
- package/out/src/signer/methods/internalizeAction.js +95 -0
- package/out/src/signer/methods/internalizeAction.js.map +1 -0
- package/out/src/signer/methods/proveCertificate.d.ts +4 -0
- package/out/src/signer/methods/proveCertificate.d.ts.map +1 -0
- package/out/src/signer/methods/proveCertificate.js +45 -0
- package/out/src/signer/methods/proveCertificate.js.map +1 -0
- package/out/src/signer/methods/signAction.d.ts +6 -0
- package/out/src/signer/methods/signAction.d.ts.map +1 -0
- package/out/src/signer/methods/signAction.js +79 -0
- package/out/src/signer/methods/signAction.js.map +1 -0
- package/out/src/storage/StorageKnex.d.ts +176 -0
- package/out/src/storage/StorageKnex.d.ts.map +1 -0
- package/out/src/storage/StorageKnex.js +1035 -0
- package/out/src/storage/StorageKnex.js.map +1 -0
- package/out/src/storage/StorageProvider.d.ts +140 -0
- package/out/src/storage/StorageProvider.d.ts.map +1 -0
- package/out/src/storage/StorageProvider.js +539 -0
- package/out/src/storage/StorageProvider.js.map +1 -0
- package/out/src/storage/StorageReader.d.ts +76 -0
- package/out/src/storage/StorageReader.d.ts.map +1 -0
- package/out/src/storage/StorageReader.js +124 -0
- package/out/src/storage/StorageReader.js.map +1 -0
- package/out/src/storage/StorageReaderWriter.d.ts +87 -0
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -0
- package/out/src/storage/StorageReaderWriter.js +337 -0
- package/out/src/storage/StorageReaderWriter.js.map +1 -0
- package/out/src/storage/StorageSyncReader.d.ts +33 -0
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -0
- package/out/src/storage/StorageSyncReader.js +142 -0
- package/out/src/storage/StorageSyncReader.js.map +1 -0
- package/out/src/storage/WalletStorageManager.d.ts +103 -0
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -0
- package/out/src/storage/WalletStorageManager.js +408 -0
- package/out/src/storage/WalletStorageManager.js.map +1 -0
- package/out/src/storage/__test/WalletStorageManager.test.d.ts +2 -0
- package/out/src/storage/__test/WalletStorageManager.test.d.ts.map +1 -0
- package/out/src/storage/__test/WalletStorageManager.test.js +260 -0
- package/out/src/storage/__test/WalletStorageManager.test.js.map +1 -0
- package/out/src/storage/index.all.d.ts +11 -0
- package/out/src/storage/index.all.d.ts.map +1 -0
- package/out/src/storage/index.all.js +50 -0
- package/out/src/storage/index.all.js.map +1 -0
- package/out/src/storage/index.client.d.ts +7 -0
- package/out/src/storage/index.client.d.ts.map +1 -0
- package/out/src/storage/index.client.js +46 -0
- package/out/src/storage/index.client.js.map +1 -0
- package/out/src/storage/index.db.d.ts +1 -0
- package/out/src/storage/index.db.d.ts.map +1 -0
- package/out/src/storage/index.db.js +2 -0
- package/out/src/storage/index.db.js.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.d.ts +2 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.d.ts.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js +948 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.d.ts +2 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.d.ts.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js +35 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js.map +1 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +27 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +148 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -0
- package/out/src/storage/methods/createAction.d.ts +23 -0
- package/out/src/storage/methods/createAction.d.ts.map +1 -0
- package/out/src/storage/methods/createAction.js +663 -0
- package/out/src/storage/methods/createAction.js.map +1 -0
- package/out/src/storage/methods/generateChange.d.ts +108 -0
- package/out/src/storage/methods/generateChange.d.ts.map +1 -0
- package/out/src/storage/methods/generateChange.js +422 -0
- package/out/src/storage/methods/generateChange.js.map +1 -0
- package/out/src/storage/methods/getBeefForTransaction.d.ts +22 -0
- package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -0
- package/out/src/storage/methods/getBeefForTransaction.js +94 -0
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -0
- package/out/src/storage/methods/getSyncChunk.d.ts +10 -0
- package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -0
- package/out/src/storage/methods/getSyncChunk.js +271 -0
- package/out/src/storage/methods/getSyncChunk.js.map +1 -0
- package/out/src/storage/methods/internalizeAction.d.ts +38 -0
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -0
- package/out/src/storage/methods/internalizeAction.js +378 -0
- package/out/src/storage/methods/internalizeAction.js.map +1 -0
- package/out/src/storage/methods/listActions.d.ts +5 -0
- package/out/src/storage/methods/listActions.d.ts.map +1 -0
- package/out/src/storage/methods/listActions.js +174 -0
- package/out/src/storage/methods/listActions.js.map +1 -0
- package/out/src/storage/methods/listCertificates.d.ts +5 -0
- package/out/src/storage/methods/listCertificates.d.ts.map +1 -0
- package/out/src/storage/methods/listCertificates.js +68 -0
- package/out/src/storage/methods/listCertificates.js.map +1 -0
- package/out/src/storage/methods/listOutputs.d.ts +5 -0
- package/out/src/storage/methods/listOutputs.d.ts.map +1 -0
- package/out/src/storage/methods/listOutputs.js +189 -0
- package/out/src/storage/methods/listOutputs.js.map +1 -0
- package/out/src/storage/methods/processAction.d.ts +35 -0
- package/out/src/storage/methods/processAction.d.ts.map +1 -0
- package/out/src/storage/methods/processAction.js +271 -0
- package/out/src/storage/methods/processAction.js.map +1 -0
- package/out/src/storage/methods/purgeData.d.ts +4 -0
- package/out/src/storage/methods/purgeData.d.ts.map +1 -0
- package/out/src/storage/methods/purgeData.js +229 -0
- package/out/src/storage/methods/purgeData.js.map +1 -0
- package/out/src/storage/methods/reviewStatus.d.ts +9 -0
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -0
- package/out/src/storage/methods/reviewStatus.js +75 -0
- package/out/src/storage/methods/reviewStatus.js.map +1 -0
- package/out/src/storage/remoting/StorageClient.d.ts +56 -0
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageClient.js +181 -0
- package/out/src/storage/remoting/StorageClient.js.map +1 -0
- package/out/src/storage/remoting/StorageServer.d.ts +26 -0
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageServer.js +144 -0
- package/out/src/storage/remoting/StorageServer.js.map +1 -0
- package/out/src/storage/schema/KnexMigrations.d.ts +39 -0
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -0
- package/out/src/storage/schema/KnexMigrations.js +442 -0
- package/out/src/storage/schema/KnexMigrations.js.map +1 -0
- package/out/src/storage/schema/entities/Certificate.d.ts +43 -0
- package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Certificate.js +162 -0
- package/out/src/storage/schema/entities/Certificate.js.map +1 -0
- package/out/src/storage/schema/entities/CertificateField.d.ts +32 -0
- package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -0
- package/out/src/storage/schema/entities/CertificateField.js +114 -0
- package/out/src/storage/schema/entities/CertificateField.js.map +1 -0
- package/out/src/storage/schema/entities/Commission.d.ts +37 -0
- package/out/src/storage/schema/entities/Commission.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Commission.js +130 -0
- package/out/src/storage/schema/entities/Commission.js.map +1 -0
- package/out/src/storage/schema/entities/EntityBase.d.ts +105 -0
- package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -0
- package/out/src/storage/schema/entities/EntityBase.js +100 -0
- package/out/src/storage/schema/entities/EntityBase.js.map +1 -0
- package/out/src/storage/schema/entities/MergeEntity.d.ts +34 -0
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -0
- package/out/src/storage/schema/entities/MergeEntity.js +57 -0
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -0
- package/out/src/storage/schema/entities/Output.d.ts +67 -0
- package/out/src/storage/schema/entities/Output.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Output.js +281 -0
- package/out/src/storage/schema/entities/Output.js.map +1 -0
- package/out/src/storage/schema/entities/OutputBasket.d.ts +35 -0
- package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputBasket.js +133 -0
- package/out/src/storage/schema/entities/OutputBasket.js.map +1 -0
- package/out/src/storage/schema/entities/OutputTag.d.ts +31 -0
- package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputTag.js +104 -0
- package/out/src/storage/schema/entities/OutputTag.js.map +1 -0
- package/out/src/storage/schema/entities/OutputTagMap.d.ts +28 -0
- package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputTagMap.js +101 -0
- package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -0
- package/out/src/storage/schema/entities/ProvenTx.d.ts +84 -0
- package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -0
- package/out/src/storage/schema/entities/ProvenTx.js +283 -0
- package/out/src/storage/schema/entities/ProvenTx.js.map +1 -0
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts +130 -0
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -0
- package/out/src/storage/schema/entities/ProvenTxReq.js +521 -0
- package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -0
- package/out/src/storage/schema/entities/SyncState.d.ts +66 -0
- package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -0
- package/out/src/storage/schema/entities/SyncState.js +284 -0
- package/out/src/storage/schema/entities/SyncState.js.map +1 -0
- package/out/src/storage/schema/entities/Transaction.d.ts +67 -0
- package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Transaction.js +264 -0
- package/out/src/storage/schema/entities/Transaction.js.map +1 -0
- package/out/src/storage/schema/entities/TxLabel.d.ts +31 -0
- package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -0
- package/out/src/storage/schema/entities/TxLabel.js +104 -0
- package/out/src/storage/schema/entities/TxLabel.js.map +1 -0
- package/out/src/storage/schema/entities/TxLabelMap.d.ts +28 -0
- package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -0
- package/out/src/storage/schema/entities/TxLabelMap.js +103 -0
- package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -0
- package/out/src/storage/schema/entities/User.d.ts +29 -0
- package/out/src/storage/schema/entities/User.d.ts.map +1 -0
- package/out/src/storage/schema/entities/User.js +100 -0
- package/out/src/storage/schema/entities/User.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js +588 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js +449 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js +602 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js +515 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js +478 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js +440 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js +626 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js +585 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +628 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js +307 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +823 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js +442 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js +313 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js +81 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.js +418 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/index.d.ts +17 -0
- package/out/src/storage/schema/entities/index.d.ts.map +1 -0
- package/out/src/storage/schema/entities/index.js +33 -0
- package/out/src/storage/schema/entities/index.js.map +1 -0
- package/out/src/storage/schema/tables/Certificate.d.ts +20 -0
- package/out/src/storage/schema/tables/Certificate.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Certificate.js +3 -0
- package/out/src/storage/schema/tables/Certificate.js.map +1 -0
- package/out/src/storage/schema/tables/CertificateField.d.ts +12 -0
- package/out/src/storage/schema/tables/CertificateField.d.ts.map +1 -0
- package/out/src/storage/schema/tables/CertificateField.js +3 -0
- package/out/src/storage/schema/tables/CertificateField.js.map +1 -0
- package/out/src/storage/schema/tables/Commission.d.ts +13 -0
- package/out/src/storage/schema/tables/Commission.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Commission.js +3 -0
- package/out/src/storage/schema/tables/Commission.js.map +1 -0
- package/out/src/storage/schema/tables/MonitorEvent.d.ts +9 -0
- package/out/src/storage/schema/tables/MonitorEvent.d.ts.map +1 -0
- package/out/src/storage/schema/tables/MonitorEvent.js +3 -0
- package/out/src/storage/schema/tables/MonitorEvent.js.map +1 -0
- package/out/src/storage/schema/tables/Output.d.ts +36 -0
- package/out/src/storage/schema/tables/Output.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Output.js +31 -0
- package/out/src/storage/schema/tables/Output.js.map +1 -0
- package/out/src/storage/schema/tables/OutputBasket.d.ts +12 -0
- package/out/src/storage/schema/tables/OutputBasket.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputBasket.js +3 -0
- package/out/src/storage/schema/tables/OutputBasket.js.map +1 -0
- package/out/src/storage/schema/tables/OutputTag.d.ts +10 -0
- package/out/src/storage/schema/tables/OutputTag.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputTag.js +3 -0
- package/out/src/storage/schema/tables/OutputTag.js.map +1 -0
- package/out/src/storage/schema/tables/OutputTagMap.d.ts +9 -0
- package/out/src/storage/schema/tables/OutputTagMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputTagMap.js +3 -0
- package/out/src/storage/schema/tables/OutputTagMap.js.map +1 -0
- package/out/src/storage/schema/tables/ProvenTx.d.ts +14 -0
- package/out/src/storage/schema/tables/ProvenTx.d.ts.map +1 -0
- package/out/src/storage/schema/tables/ProvenTx.js +3 -0
- package/out/src/storage/schema/tables/ProvenTx.js.map +1 -0
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts +64 -0
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts.map +1 -0
- package/out/src/storage/schema/tables/ProvenTxReq.js +3 -0
- package/out/src/storage/schema/tables/ProvenTxReq.js.map +1 -0
- package/out/src/storage/schema/tables/Settings.d.ts +17 -0
- package/out/src/storage/schema/tables/Settings.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Settings.js +3 -0
- package/out/src/storage/schema/tables/Settings.js.map +1 -0
- package/out/src/storage/schema/tables/SyncState.d.ts +18 -0
- package/out/src/storage/schema/tables/SyncState.d.ts.map +1 -0
- package/out/src/storage/schema/tables/SyncState.js +3 -0
- package/out/src/storage/schema/tables/SyncState.js.map +1 -0
- package/out/src/storage/schema/tables/Transaction.d.ts +37 -0
- package/out/src/storage/schema/tables/Transaction.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Transaction.js +21 -0
- package/out/src/storage/schema/tables/Transaction.js.map +1 -0
- package/out/src/storage/schema/tables/TxLabel.d.ts +10 -0
- package/out/src/storage/schema/tables/TxLabel.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TxLabel.js +3 -0
- package/out/src/storage/schema/tables/TxLabel.js.map +1 -0
- package/out/src/storage/schema/tables/TxLabelMap.d.ts +9 -0
- package/out/src/storage/schema/tables/TxLabelMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TxLabelMap.js +3 -0
- package/out/src/storage/schema/tables/TxLabelMap.js.map +1 -0
- package/out/src/storage/schema/tables/User.d.ts +16 -0
- package/out/src/storage/schema/tables/User.d.ts.map +1 -0
- package/out/src/storage/schema/tables/User.js +3 -0
- package/out/src/storage/schema/tables/User.js.map +1 -0
- package/out/src/storage/schema/tables/index.d.ts +17 -0
- package/out/src/storage/schema/tables/index.d.ts.map +1 -0
- package/out/src/storage/schema/tables/index.js +33 -0
- package/out/src/storage/schema/tables/index.js.map +1 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts +71 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.js +612 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -0
- package/out/src/storage/sync/index.d.ts +2 -0
- package/out/src/storage/sync/index.d.ts.map +1 -0
- package/out/src/storage/sync/index.js +18 -0
- package/out/src/storage/sync/index.js.map +1 -0
- package/out/src/utility/ScriptTemplateSABPPP.d.ts +25 -0
- package/out/src/utility/ScriptTemplateSABPPP.d.ts.map +1 -0
- package/out/src/utility/ScriptTemplateSABPPP.js +46 -0
- package/out/src/utility/ScriptTemplateSABPPP.js.map +1 -0
- package/out/src/utility/index.all.d.ts +7 -0
- package/out/src/utility/index.all.d.ts.map +1 -0
- package/out/src/utility/index.all.js +23 -0
- package/out/src/utility/index.all.js.map +1 -0
- package/out/src/utility/index.client.d.ts +7 -0
- package/out/src/utility/index.client.d.ts.map +1 -0
- package/out/src/utility/index.client.js +23 -0
- package/out/src/utility/index.client.js.map +1 -0
- package/out/src/utility/parseTxScriptOffsets.d.ts +14 -0
- package/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -0
- package/out/src/utility/parseTxScriptOffsets.js +26 -0
- package/out/src/utility/parseTxScriptOffsets.js.map +1 -0
- package/out/src/utility/stampLog.d.ts +18 -0
- package/out/src/utility/stampLog.d.ts.map +1 -0
- package/out/src/utility/stampLog.js +72 -0
- package/out/src/utility/stampLog.js.map +1 -0
- package/out/src/utility/tscProofToMerklePath.d.ts +8 -0
- package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -0
- package/out/src/utility/tscProofToMerklePath.js +41 -0
- package/out/src/utility/tscProofToMerklePath.js.map +1 -0
- package/out/src/utility/utilityHelpers.buffer.d.ts +18 -0
- package/out/src/utility/utilityHelpers.buffer.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.buffer.js +45 -0
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -0
- package/out/src/utility/utilityHelpers.d.ts +129 -0
- package/out/src/utility/utilityHelpers.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.js +268 -0
- package/out/src/utility/utilityHelpers.js.map +1 -0
- package/out/src/utility/utilityHelpers.noBuffer.d.ts +9 -0
- package/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.noBuffer.js +23 -0
- package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.d.ts +2 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.d.ts.map +1 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.js +45 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.js.map +1 -0
- package/out/test/Wallet/action/internalizeAction.a.test.d.ts +2 -0
- package/out/test/Wallet/action/internalizeAction.a.test.d.ts.map +1 -0
- package/out/test/Wallet/action/internalizeAction.a.test.js +243 -0
- package/out/test/Wallet/action/internalizeAction.a.test.js.map +1 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.d.ts +2 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.d.ts.map +1 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.js +213 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.js.map +1 -0
- package/out/test/Wallet/certificate/listCertificates.test.d.ts +2 -0
- package/out/test/Wallet/certificate/listCertificates.test.d.ts.map +1 -0
- package/out/test/Wallet/certificate/listCertificates.test.js +305 -0
- package/out/test/Wallet/certificate/listCertificates.test.js.map +1 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.d.ts +2 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.js +68 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.js.map +1 -0
- package/out/test/Wallet/get/getHeight.test.d.ts +2 -0
- package/out/test/Wallet/get/getHeight.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getHeight.test.js +45 -0
- package/out/test/Wallet/get/getHeight.test.js.map +1 -0
- package/out/test/Wallet/get/getKnownTxids.test.d.ts +2 -0
- package/out/test/Wallet/get/getKnownTxids.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getKnownTxids.test.js +73 -0
- package/out/test/Wallet/get/getKnownTxids.test.js.map +1 -0
- package/out/test/Wallet/get/getNetwork.test.d.ts +2 -0
- package/out/test/Wallet/get/getNetwork.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getNetwork.test.js +26 -0
- package/out/test/Wallet/get/getNetwork.test.js.map +1 -0
- package/out/test/Wallet/get/getVersion.test.d.ts +2 -0
- package/out/test/Wallet/get/getVersion.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getVersion.test.js +25 -0
- package/out/test/Wallet/get/getVersion.test.js.map +1 -0
- package/out/test/Wallet/live/walletLive.man.test.d.ts +26 -0
- package/out/test/Wallet/live/walletLive.man.test.d.ts.map +1 -0
- package/out/test/Wallet/live/walletLive.man.test.js +389 -0
- package/out/test/Wallet/live/walletLive.man.test.js.map +1 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.d.ts +2 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.d.ts.map +1 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js +153 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js.map +1 -0
- package/out/test/checkDB.d.ts +4 -0
- package/out/test/checkDB.d.ts.map +1 -0
- package/out/test/checkDB.js +55 -0
- package/out/test/checkDB.js.map +1 -0
- package/out/test/examples/README.man.test.d.ts +2 -0
- package/out/test/examples/README.man.test.d.ts.map +1 -0
- package/out/test/examples/README.man.test.js +46 -0
- package/out/test/examples/README.man.test.js.map +1 -0
- package/out/test/monitor/Monitor.test.d.ts +2 -0
- package/out/test/monitor/Monitor.test.d.ts.map +1 -0
- package/out/test/monitor/Monitor.test.js +446 -0
- package/out/test/monitor/Monitor.test.js.map +1 -0
- package/out/test/services/Services.test.d.ts +2 -0
- package/out/test/services/Services.test.d.ts.map +1 -0
- package/out/test/services/Services.test.js +128 -0
- package/out/test/services/Services.test.js.map +1 -0
- package/out/test/storage/KnexMigrations.test.d.ts +2 -0
- package/out/test/storage/KnexMigrations.test.d.ts.map +1 -0
- package/out/test/storage/KnexMigrations.test.js +81 -0
- package/out/test/storage/KnexMigrations.test.js.map +1 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.d.ts +2 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.d.ts.map +1 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.js +88 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.js.map +1 -0
- package/out/test/storage/count.test.d.ts +2 -0
- package/out/test/storage/count.test.d.ts.map +1 -0
- package/out/test/storage/count.test.js +141 -0
- package/out/test/storage/count.test.js.map +1 -0
- package/out/test/storage/find.test.d.ts +2 -0
- package/out/test/storage/find.test.d.ts.map +1 -0
- package/out/test/storage/find.test.js +148 -0
- package/out/test/storage/find.test.js.map +1 -0
- package/out/test/storage/findLegacy.test.d.ts +2 -0
- package/out/test/storage/findLegacy.test.d.ts.map +1 -0
- package/out/test/storage/findLegacy.test.js +52 -0
- package/out/test/storage/findLegacy.test.js.map +1 -0
- package/out/test/storage/insert.test.d.ts +2 -0
- package/out/test/storage/insert.test.d.ts.map +1 -0
- package/out/test/storage/insert.test.js +256 -0
- package/out/test/storage/insert.test.js.map +1 -0
- package/out/test/storage/update.test.d.ts +2 -0
- package/out/test/storage/update.test.d.ts.map +1 -0
- package/out/test/storage/update.test.js +926 -0
- package/out/test/storage/update.test.js.map +1 -0
- package/out/test/storage/update2.test.d.ts +2 -0
- package/out/test/storage/update2.test.d.ts.map +1 -0
- package/out/test/storage/update2.test.js +766 -0
- package/out/test/storage/update2.test.js.map +1 -0
- package/out/test/utils/TestUtilsWalletStorage.d.ts +399 -0
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -0
- package/out/test/utils/TestUtilsWalletStorage.js +1337 -0
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -0
- package/out/test/wallet/action/abortAction.test.d.ts +2 -0
- package/out/test/wallet/action/abortAction.test.d.ts.map +1 -0
- package/out/test/wallet/action/abortAction.test.js +44 -0
- package/out/test/wallet/action/abortAction.test.js.map +1 -0
- package/out/test/wallet/action/createAction.test.d.ts +2 -0
- package/out/test/wallet/action/createAction.test.d.ts.map +1 -0
- package/out/test/wallet/action/createAction.test.js +230 -0
- package/out/test/wallet/action/createAction.test.js.map +1 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.d.ts +2 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.d.ts.map +1 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js +273 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js.map +1 -0
- package/out/test/wallet/action/internalizeAction.test.d.ts +2 -0
- package/out/test/wallet/action/internalizeAction.test.d.ts.map +1 -0
- package/out/test/wallet/action/internalizeAction.test.js +603 -0
- package/out/test/wallet/action/internalizeAction.test.js.map +1 -0
- package/out/test/wallet/action/relinquishOutput.test.d.ts +2 -0
- package/out/test/wallet/action/relinquishOutput.test.d.ts.map +1 -0
- package/out/test/wallet/action/relinquishOutput.test.js +31 -0
- package/out/test/wallet/action/relinquishOutput.test.js.map +1 -0
- package/out/test/wallet/construct/Wallet.constructor.test.d.ts +2 -0
- package/out/test/wallet/construct/Wallet.constructor.test.d.ts.map +1 -0
- package/out/test/wallet/construct/Wallet.constructor.test.js +49 -0
- package/out/test/wallet/construct/Wallet.constructor.test.js.map +1 -0
- package/out/test/wallet/list/listActions.test.d.ts +2 -0
- package/out/test/wallet/list/listActions.test.d.ts.map +1 -0
- package/out/test/wallet/list/listActions.test.js +265 -0
- package/out/test/wallet/list/listActions.test.js.map +1 -0
- package/out/test/wallet/list/listActions2.test.d.ts +2 -0
- package/out/test/wallet/list/listActions2.test.d.ts.map +1 -0
- package/out/test/wallet/list/listActions2.test.js +423 -0
- package/out/test/wallet/list/listActions2.test.js.map +1 -0
- package/out/test/wallet/list/listCertificates.test.d.ts +2 -0
- package/out/test/wallet/list/listCertificates.test.d.ts.map +1 -0
- package/out/test/wallet/list/listCertificates.test.js +115 -0
- package/out/test/wallet/list/listCertificates.test.js.map +1 -0
- package/out/test/wallet/list/listOutputs.test.d.ts +2 -0
- package/out/test/wallet/list/listOutputs.test.d.ts.map +1 -0
- package/out/test/wallet/list/listOutputs.test.js +521 -0
- package/out/test/wallet/list/listOutputs.test.js.map +1 -0
- package/out/test/wallet/sync/Wallet.sync.test.d.ts +2 -0
- package/out/test/wallet/sync/Wallet.sync.test.d.ts.map +1 -0
- package/out/test/wallet/sync/Wallet.sync.test.js +142 -0
- package/out/test/wallet/sync/Wallet.sync.test.js.map +1 -0
- package/out/tsconfig.all.tsbuildinfo +1 -0
- package/package.json +63 -0
- package/src/Wallet.ts +771 -0
- package/src/index.all.ts +8 -0
- package/src/index.client.ts +7 -0
- package/src/index.ts +2 -0
- package/src/monitor/Monitor.ts +317 -0
- package/src/monitor/MonitorDaemon.ts +197 -0
- package/src/monitor/README.md +3 -0
- package/src/monitor/__test/MonitorDaemon.man.test.ts +17 -0
- package/src/monitor/tasks/TaskCheckForProofs.ts +235 -0
- package/src/monitor/tasks/TaskClock.ts +35 -0
- package/src/monitor/tasks/TaskFailAbandoned.ts +56 -0
- package/src/monitor/tasks/TaskNewHeader.ts +48 -0
- package/src/monitor/tasks/TaskPurge.ts +69 -0
- package/src/monitor/tasks/TaskReviewStatus.ts +51 -0
- package/src/monitor/tasks/TaskSendWaiting.ts +107 -0
- package/src/monitor/tasks/TaskSyncWhenIdle.ts +26 -0
- package/src/monitor/tasks/WalletMonitorTask.ts +47 -0
- package/src/sdk/CertOps.ts +346 -0
- package/src/sdk/PrivilegedKeyManager.ts +402 -0
- package/src/sdk/README.md +13 -0
- package/src/sdk/StorageSyncReader.ts +155 -0
- package/src/sdk/StorageSyncReaderWriter.ts +263 -0
- package/src/sdk/WERR_errors.ts +152 -0
- package/src/sdk/WalletError.ts +136 -0
- package/src/sdk/WalletServices.interfaces.ts +399 -0
- package/src/sdk/WalletSigner.interfaces.ts +38 -0
- package/src/sdk/WalletStorage.interfaces.ts +416 -0
- package/src/sdk/__test/CertificateLifeCycle.test.ts +194 -0
- package/src/sdk/__test/PrivilegedKeyManager.test.ts +775 -0
- package/src/sdk/index.ts +11 -0
- package/src/sdk/types.ts +115 -0
- package/src/sdk/validationHelpers.ts +1248 -0
- package/src/services/README.md +11 -0
- package/src/services/ServiceCollection.ts +50 -0
- package/src/services/Services.ts +461 -0
- package/src/services/__tests/getMerklePath.test.ts +16 -0
- package/src/services/__tests/getRawTx.test.ts +15 -0
- package/src/services/__tests/postBeef.test.ts +19 -0
- package/src/services/__tests/postBeefToArcTaal.test.ts +487 -0
- package/src/services/__tests/postTxs.test.ts +20 -0
- package/src/services/chaintracker/ChaintracksChainTracker.ts +78 -0
- package/src/services/chaintracker/__tests/ChaintracksChainTracker.test.ts +25 -0
- package/src/services/chaintracker/__tests/ChaintracksServiceClient.test.ts +32 -0
- package/src/services/chaintracker/chaintracks/BlockHeaderApi.ts +123 -0
- package/src/services/chaintracker/chaintracks/ChaintracksServiceClient.ts +160 -0
- package/src/services/chaintracker/chaintracks/index.ts +2 -0
- package/src/services/chaintracker/index.ts +2 -0
- package/src/services/createDefaultWalletServicesOptions.ts +38 -0
- package/src/services/index.ts +1 -0
- package/src/services/providers/arcServices.ts +570 -0
- package/src/services/providers/echangeRates.ts +276 -0
- package/src/services/providers/whatsonchain.ts +170 -0
- package/src/signer/README.md +5 -0
- package/src/signer/WalletSigner.ts +21 -0
- package/src/signer/methods/acquireDirectCertificate.ts +53 -0
- package/src/signer/methods/createAction.ts +364 -0
- package/src/signer/methods/internalizeAction.ts +142 -0
- package/src/signer/methods/proveCertificate.ts +51 -0
- package/src/signer/methods/signAction.ts +121 -0
- package/src/storage/README.md +14 -0
- package/src/storage/StorageKnex.ts +1449 -0
- package/src/storage/StorageProvider.ts +853 -0
- package/src/storage/StorageReader.ts +222 -0
- package/src/storage/StorageReaderWriter.ts +623 -0
- package/src/storage/StorageSyncReader.ts +143 -0
- package/src/storage/WalletStorageManager.ts +532 -0
- package/src/storage/__test/WalletStorageManager.test.ts +292 -0
- package/src/storage/index.all.ts +10 -0
- package/src/storage/index.client.ts +6 -0
- package/src/storage/index.db.ts +0 -0
- package/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.ts +1143 -0
- package/src/storage/methods/__test/GenerateChange/randomValsUsed1.ts +31 -0
- package/src/storage/methods/attemptToPostReqsToNetwork.ts +185 -0
- package/src/storage/methods/createAction.ts +997 -0
- package/src/storage/methods/generateChange.ts +629 -0
- package/src/storage/methods/getBeefForTransaction.ts +143 -0
- package/src/storage/methods/getSyncChunk.ts +330 -0
- package/src/storage/methods/internalizeAction.ts +538 -0
- package/src/storage/methods/listActions.ts +203 -0
- package/src/storage/methods/listCertificates.ts +81 -0
- package/src/storage/methods/listOutputs.ts +219 -0
- package/src/storage/methods/processAction.ts +477 -0
- package/src/storage/methods/purgeData.ts +276 -0
- package/src/storage/methods/reviewStatus.ts +95 -0
- package/src/storage/remoting/StorageClient.ts +306 -0
- package/src/storage/remoting/StorageServer.ts +179 -0
- package/src/storage/schema/KnexMigrations.ts +488 -0
- package/src/storage/schema/entities/Certificate.ts +199 -0
- package/src/storage/schema/entities/CertificateField.ts +157 -0
- package/src/storage/schema/entities/Commission.ts +169 -0
- package/src/storage/schema/entities/EntityBase.ts +214 -0
- package/src/storage/schema/entities/MergeEntity.ts +79 -0
- package/src/storage/schema/entities/Output.ts +323 -0
- package/src/storage/schema/entities/OutputBasket.ts +165 -0
- package/src/storage/schema/entities/OutputTag.ts +138 -0
- package/src/storage/schema/entities/OutputTagMap.ts +146 -0
- package/src/storage/schema/entities/ProvenTx.ts +349 -0
- package/src/storage/schema/entities/ProvenTxReq.ts +646 -0
- package/src/storage/schema/entities/SyncState.ts +429 -0
- package/src/storage/schema/entities/Transaction.ts +334 -0
- package/src/storage/schema/entities/TxLabel.ts +135 -0
- package/src/storage/schema/entities/TxLabelMap.ts +148 -0
- package/src/storage/schema/entities/User.ts +138 -0
- package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +663 -0
- package/src/storage/schema/entities/__tests/CertificateTests.test.ts +527 -0
- package/src/storage/schema/entities/__tests/CommissionTests.test.ts +658 -0
- package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +567 -0
- package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +530 -0
- package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +504 -0
- package/src/storage/schema/entities/__tests/OutputTests.test.ts +689 -0
- package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +669 -0
- package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +700 -0
- package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +376 -0
- package/src/storage/schema/entities/__tests/TransactionTests.test.ts +920 -0
- package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +512 -0
- package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +350 -0
- package/src/storage/schema/entities/__tests/stampLogTests.test.ts +97 -0
- package/src/storage/schema/entities/__tests/usersTests.test.ts +485 -0
- package/src/storage/schema/entities/index.ts +16 -0
- package/src/storage/schema/tables/Certificate.ts +21 -0
- package/src/storage/schema/tables/CertificateField.ts +12 -0
- package/src/storage/schema/tables/Commission.ts +13 -0
- package/src/storage/schema/tables/MonitorEvent.ts +9 -0
- package/src/storage/schema/tables/Output.ts +64 -0
- package/src/storage/schema/tables/OutputBasket.ts +12 -0
- package/src/storage/schema/tables/OutputTag.ts +10 -0
- package/src/storage/schema/tables/OutputTagMap.ts +9 -0
- package/src/storage/schema/tables/ProvenTx.ts +14 -0
- package/src/storage/schema/tables/ProvenTxReq.ts +65 -0
- package/src/storage/schema/tables/Settings.ts +17 -0
- package/src/storage/schema/tables/SyncState.ts +18 -0
- package/src/storage/schema/tables/Transaction.ts +54 -0
- package/src/storage/schema/tables/TxLabel.ts +10 -0
- package/src/storage/schema/tables/TxLabelMap.ts +9 -0
- package/src/storage/schema/tables/User.ts +16 -0
- package/src/storage/schema/tables/index.ts +16 -0
- package/src/storage/sync/StorageMySQLDojoReader.ts +771 -0
- package/src/storage/sync/index.ts +1 -0
- package/src/utility/README.md +3 -0
- package/src/utility/ScriptTemplateSABPPP.ts +79 -0
- package/src/utility/index.all.ts +7 -0
- package/src/utility/index.client.ts +7 -0
- package/src/utility/parseTxScriptOffsets.ts +29 -0
- package/src/utility/stampLog.ts +73 -0
- package/src/utility/tscProofToMerklePath.ts +51 -0
- package/src/utility/utilityHelpers.buffer.ts +43 -0
- package/src/utility/utilityHelpers.noBuffer.ts +18 -0
- package/src/utility/utilityHelpers.ts +283 -0
- package/test/Wallet/StorageClient/storageClient.man.test.ts +55 -0
- package/test/Wallet/action/internalizeAction.a.test.ts +301 -0
- package/test/Wallet/certificate/acquireCertificate.test.ts +253 -0
- package/test/Wallet/certificate/listCertificates.test.ts +352 -0
- package/test/Wallet/get/getHeaderForHeight.test.ts +79 -0
- package/test/Wallet/get/getHeight.test.ts +52 -0
- package/test/Wallet/get/getKnownTxids.test.ts +90 -0
- package/test/Wallet/get/getNetwork.test.ts +28 -0
- package/test/Wallet/get/getVersion.test.ts +28 -0
- package/test/Wallet/live/walletLive.man.test.ts +510 -0
- package/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.ts +155 -0
- package/test/checkDB.ts +63 -0
- package/test/checkdb +0 -0
- package/test/examples/README.man.test.ts +53 -0
- package/test/monitor/Monitor.test.ts +536 -0
- package/test/services/Services.test.ts +149 -0
- package/test/storage/KnexMigrations.test.ts +100 -0
- package/test/storage/StorageMySQLDojoReader.man.test.ts +71 -0
- package/test/storage/count.test.ts +193 -0
- package/test/storage/find.test.ts +216 -0
- package/test/storage/findLegacy.test.ts +70 -0
- package/test/storage/insert.test.ts +294 -0
- package/test/storage/update.test.ts +1146 -0
- package/test/storage/update2.test.ts +1017 -0
- package/test/utils/TestUtilsWalletStorage.ts +1923 -0
- package/test/utils/removeFailedFromDatabase.sql +17 -0
- package/test/wallet/action/abortAction.test.ts +55 -0
- package/test/wallet/action/createAction.test.ts +266 -0
- package/test/wallet/action/createActionToGenerateBeefs.man.test.ts +297 -0
- package/test/wallet/action/internalizeAction.test.ts +729 -0
- package/test/wallet/action/relinquishOutput.test.ts +43 -0
- package/test/wallet/construct/Wallet.constructor.test.ts +57 -0
- package/test/wallet/list/listActions.test.ts +282 -0
- package/test/wallet/list/listActions2.test.ts +570 -0
- package/test/wallet/list/listCertificates.test.ts +129 -0
- package/test/wallet/list/listOutputs.test.ts +573 -0
- package/test/wallet/sync/Wallet.sync.test.ts +226 -0
- package/ts2md.json +32 -0
- package/tsconfig.all.json +29 -0
- package/tsconfig.client.json +22 -0
- package/tsconfig.json +14 -0
- package/unlock-migrations.sh +41 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { MerklePath } from '@bsv/sdk'
|
|
2
|
+
import {
|
|
3
|
+
arraysEqual,
|
|
4
|
+
entity,
|
|
5
|
+
sdk,
|
|
6
|
+
table,
|
|
7
|
+
verifyId,
|
|
8
|
+
verifyOneOrNone
|
|
9
|
+
} from '../../../index.client'
|
|
10
|
+
import { EntityBase } from '.'
|
|
11
|
+
|
|
12
|
+
export class OutputBasket extends EntityBase<table.OutputBasket> {
|
|
13
|
+
constructor(api?: table.OutputBasket) {
|
|
14
|
+
const now = new Date()
|
|
15
|
+
super(
|
|
16
|
+
api || {
|
|
17
|
+
basketId: 0,
|
|
18
|
+
created_at: now,
|
|
19
|
+
updated_at: now,
|
|
20
|
+
userId: 0,
|
|
21
|
+
name: '',
|
|
22
|
+
numberOfDesiredUTXOs: 0,
|
|
23
|
+
minimumDesiredUTXOValue: 0,
|
|
24
|
+
isDeleted: false
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get basketId() {
|
|
30
|
+
return this.api.basketId
|
|
31
|
+
}
|
|
32
|
+
set basketId(v: number) {
|
|
33
|
+
this.api.basketId = v
|
|
34
|
+
}
|
|
35
|
+
get created_at() {
|
|
36
|
+
return this.api.created_at
|
|
37
|
+
}
|
|
38
|
+
set created_at(v: Date) {
|
|
39
|
+
this.api.created_at = v
|
|
40
|
+
}
|
|
41
|
+
get updated_at() {
|
|
42
|
+
return this.api.updated_at
|
|
43
|
+
}
|
|
44
|
+
set updated_at(v: Date) {
|
|
45
|
+
this.api.updated_at = v
|
|
46
|
+
}
|
|
47
|
+
get userId() {
|
|
48
|
+
return this.api.userId
|
|
49
|
+
}
|
|
50
|
+
set userId(v: number) {
|
|
51
|
+
this.api.userId = v
|
|
52
|
+
}
|
|
53
|
+
get name() {
|
|
54
|
+
return this.api.name
|
|
55
|
+
}
|
|
56
|
+
set name(v: string) {
|
|
57
|
+
this.api.name = v
|
|
58
|
+
}
|
|
59
|
+
get numberOfDesiredUTXOs() {
|
|
60
|
+
return this.api.numberOfDesiredUTXOs
|
|
61
|
+
}
|
|
62
|
+
set numberOfDesiredUTXOs(v: number) {
|
|
63
|
+
this.api.numberOfDesiredUTXOs = v
|
|
64
|
+
}
|
|
65
|
+
get minimumDesiredUTXOValue() {
|
|
66
|
+
return this.api.minimumDesiredUTXOValue
|
|
67
|
+
}
|
|
68
|
+
set minimumDesiredUTXOValue(v: number) {
|
|
69
|
+
this.api.minimumDesiredUTXOValue = v
|
|
70
|
+
}
|
|
71
|
+
get isDeleted() {
|
|
72
|
+
return this.api.isDeleted
|
|
73
|
+
}
|
|
74
|
+
set isDeleted(v: boolean) {
|
|
75
|
+
this.api.isDeleted = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
override get id() {
|
|
79
|
+
return this.api.basketId
|
|
80
|
+
}
|
|
81
|
+
override set id(v: number) {
|
|
82
|
+
this.api.basketId = v
|
|
83
|
+
}
|
|
84
|
+
override get entityName(): string {
|
|
85
|
+
return 'OutputBasket'
|
|
86
|
+
}
|
|
87
|
+
override get entityTable(): string {
|
|
88
|
+
return 'output_baskets'
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
override updateApi(): void {
|
|
92
|
+
/* nothing needed yet... */
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
override equals(ei: table.OutputBasket, syncMap?: entity.SyncMap): boolean {
|
|
96
|
+
const eo = this.api
|
|
97
|
+
if (
|
|
98
|
+
eo.name != ei.name ||
|
|
99
|
+
eo.numberOfDesiredUTXOs != ei.numberOfDesiredUTXOs ||
|
|
100
|
+
eo.minimumDesiredUTXOValue != ei.minimumDesiredUTXOValue
|
|
101
|
+
)
|
|
102
|
+
return false
|
|
103
|
+
if (syncMap) {
|
|
104
|
+
if (eo.basketId !== syncMap.outputBasket.idMap[verifyId(ei.basketId)])
|
|
105
|
+
return false
|
|
106
|
+
} else {
|
|
107
|
+
if (eo.basketId !== ei.basketId || eo.userId !== ei.userId) return false
|
|
108
|
+
}
|
|
109
|
+
return true
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static async mergeFind(
|
|
113
|
+
storage: entity.EntityStorage,
|
|
114
|
+
userId: number,
|
|
115
|
+
ei: table.OutputBasket,
|
|
116
|
+
syncMap: entity.SyncMap,
|
|
117
|
+
trx?: sdk.TrxToken
|
|
118
|
+
): Promise<{ found: boolean; eo: OutputBasket; eiId: number }> {
|
|
119
|
+
const ef = verifyOneOrNone(
|
|
120
|
+
await storage.findOutputBaskets({
|
|
121
|
+
partial: { name: ei.name, userId },
|
|
122
|
+
trx
|
|
123
|
+
})
|
|
124
|
+
)
|
|
125
|
+
return {
|
|
126
|
+
found: !!ef,
|
|
127
|
+
eo: new OutputBasket(ef || { ...ei }),
|
|
128
|
+
eiId: verifyId(ei.basketId)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
133
|
+
override async mergeNew(
|
|
134
|
+
storage: entity.EntityStorage,
|
|
135
|
+
userId: number,
|
|
136
|
+
syncMap: entity.SyncMap,
|
|
137
|
+
trx?: sdk.TrxToken
|
|
138
|
+
): Promise<void> {
|
|
139
|
+
this.userId = userId
|
|
140
|
+
this.name ||= 'default'
|
|
141
|
+
this.basketId = 0
|
|
142
|
+
this.basketId = await storage.insertOutputBasket(this.toApi(), trx)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
146
|
+
override async mergeExisting(
|
|
147
|
+
storage: entity.EntityStorage,
|
|
148
|
+
since: Date | undefined,
|
|
149
|
+
ei: table.OutputBasket,
|
|
150
|
+
syncMap: entity.SyncMap,
|
|
151
|
+
trx?: sdk.TrxToken
|
|
152
|
+
): Promise<boolean> {
|
|
153
|
+
let wasMerged = false
|
|
154
|
+
if (ei.updated_at > this.updated_at) {
|
|
155
|
+
// basket name is its identity, should not change
|
|
156
|
+
this.minimumDesiredUTXOValue = ei.minimumDesiredUTXOValue
|
|
157
|
+
this.numberOfDesiredUTXOs = ei.numberOfDesiredUTXOs
|
|
158
|
+
this.isDeleted = ei.isDeleted
|
|
159
|
+
this.updated_at = new Date()
|
|
160
|
+
await storage.updateOutputBasket(this.id, this.toApi(), trx)
|
|
161
|
+
wasMerged = true
|
|
162
|
+
}
|
|
163
|
+
return wasMerged
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import { MerklePath } from '@bsv/sdk'
|
|
3
|
+
import {
|
|
4
|
+
arraysEqual,
|
|
5
|
+
entity,
|
|
6
|
+
sdk,
|
|
7
|
+
table,
|
|
8
|
+
verifyId,
|
|
9
|
+
verifyOneOrNone
|
|
10
|
+
} from '../../../index.client'
|
|
11
|
+
import { EntityBase } from '.'
|
|
12
|
+
|
|
13
|
+
export class OutputTag extends EntityBase<table.OutputTag> {
|
|
14
|
+
constructor(api?: table.OutputTag) {
|
|
15
|
+
const now = new Date()
|
|
16
|
+
super(
|
|
17
|
+
api || {
|
|
18
|
+
outputTagId: 0,
|
|
19
|
+
created_at: now,
|
|
20
|
+
updated_at: now,
|
|
21
|
+
tag: '',
|
|
22
|
+
userId: 0,
|
|
23
|
+
isDeleted: false
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override updateApi(): void {
|
|
29
|
+
/* nothing needed yet... */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get outputTagId() {
|
|
33
|
+
return this.api.outputTagId
|
|
34
|
+
}
|
|
35
|
+
set outputTagId(v: number) {
|
|
36
|
+
this.api.outputTagId = v
|
|
37
|
+
}
|
|
38
|
+
get created_at() {
|
|
39
|
+
return this.api.created_at
|
|
40
|
+
}
|
|
41
|
+
set created_at(v: Date) {
|
|
42
|
+
this.api.created_at = v
|
|
43
|
+
}
|
|
44
|
+
get updated_at() {
|
|
45
|
+
return this.api.updated_at
|
|
46
|
+
}
|
|
47
|
+
set updated_at(v: Date) {
|
|
48
|
+
this.api.updated_at = v
|
|
49
|
+
}
|
|
50
|
+
get tag() {
|
|
51
|
+
return this.api.tag
|
|
52
|
+
}
|
|
53
|
+
set tag(v: string) {
|
|
54
|
+
this.api.tag = v
|
|
55
|
+
}
|
|
56
|
+
get userId() {
|
|
57
|
+
return this.api.userId
|
|
58
|
+
}
|
|
59
|
+
set userId(v: number) {
|
|
60
|
+
this.api.userId = v
|
|
61
|
+
}
|
|
62
|
+
get isDeleted() {
|
|
63
|
+
return this.api.isDeleted
|
|
64
|
+
}
|
|
65
|
+
set isDeleted(v: boolean) {
|
|
66
|
+
this.api.isDeleted = v
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
override get id(): number {
|
|
70
|
+
return this.api.outputTagId
|
|
71
|
+
}
|
|
72
|
+
override set id(v: number) {
|
|
73
|
+
this.api.outputTagId = v
|
|
74
|
+
}
|
|
75
|
+
override get entityName(): string {
|
|
76
|
+
return 'entity.OutputTag'
|
|
77
|
+
}
|
|
78
|
+
override get entityTable(): string {
|
|
79
|
+
return 'output_tags'
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
override equals(
|
|
83
|
+
ei: table.OutputTag,
|
|
84
|
+
syncMap?: entity.SyncMap | undefined
|
|
85
|
+
): boolean {
|
|
86
|
+
const eo = this.toApi()
|
|
87
|
+
if (eo.tag != ei.tag || eo.isDeleted != ei.isDeleted) return false
|
|
88
|
+
if (!syncMap) {
|
|
89
|
+
if (eo.userId !== ei.userId) return false
|
|
90
|
+
}
|
|
91
|
+
return true
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static async mergeFind(
|
|
95
|
+
storage: entity.EntityStorage,
|
|
96
|
+
userId: number,
|
|
97
|
+
ei: table.OutputTag,
|
|
98
|
+
syncMap: entity.SyncMap,
|
|
99
|
+
trx?: sdk.TrxToken
|
|
100
|
+
): Promise<{ found: boolean; eo: entity.OutputTag; eiId: number }> {
|
|
101
|
+
const ef = verifyOneOrNone(
|
|
102
|
+
await storage.findOutputTags({ partial: { tag: ei.tag, userId }, trx })
|
|
103
|
+
)
|
|
104
|
+
return {
|
|
105
|
+
found: !!ef,
|
|
106
|
+
eo: new entity.OutputTag(ef || { ...ei }),
|
|
107
|
+
eiId: verifyId(ei.outputTagId)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
override async mergeNew(
|
|
112
|
+
storage: entity.EntityStorage,
|
|
113
|
+
userId: number,
|
|
114
|
+
syncMap: entity.SyncMap,
|
|
115
|
+
trx?: sdk.TrxToken
|
|
116
|
+
): Promise<void> {
|
|
117
|
+
this.userId = userId
|
|
118
|
+
this.outputTagId = 0
|
|
119
|
+
this.outputTagId = await storage.insertOutputTag(this.toApi(), trx)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
override async mergeExisting(
|
|
123
|
+
storage: entity.EntityStorage,
|
|
124
|
+
since: Date | undefined,
|
|
125
|
+
ei: table.OutputTag,
|
|
126
|
+
syncMap: entity.SyncMap,
|
|
127
|
+
trx?: sdk.TrxToken
|
|
128
|
+
): Promise<boolean> {
|
|
129
|
+
let wasMerged = false
|
|
130
|
+
if (ei.updated_at > this.updated_at) {
|
|
131
|
+
this.isDeleted = ei.isDeleted
|
|
132
|
+
this.updated_at = new Date()
|
|
133
|
+
await storage.updateOutputTag(this.id, this.toApi(), trx)
|
|
134
|
+
wasMerged = true
|
|
135
|
+
}
|
|
136
|
+
return wasMerged
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import { MerklePath } from '@bsv/sdk'
|
|
3
|
+
import {
|
|
4
|
+
arraysEqual,
|
|
5
|
+
entity,
|
|
6
|
+
sdk,
|
|
7
|
+
table,
|
|
8
|
+
verifyId,
|
|
9
|
+
verifyOneOrNone
|
|
10
|
+
} from '../../../index.client'
|
|
11
|
+
import { EntityBase } from '.'
|
|
12
|
+
|
|
13
|
+
export class OutputTagMap extends EntityBase<table.OutputTagMap> {
|
|
14
|
+
constructor(api?: table.OutputTagMap) {
|
|
15
|
+
const now = new Date()
|
|
16
|
+
super(
|
|
17
|
+
api || {
|
|
18
|
+
created_at: now,
|
|
19
|
+
updated_at: now,
|
|
20
|
+
outputId: 0,
|
|
21
|
+
outputTagId: 0,
|
|
22
|
+
isDeleted: false
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
override updateApi(): void {
|
|
28
|
+
/* nothing needed yet... */
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get outputTagId() {
|
|
32
|
+
return this.api.outputTagId
|
|
33
|
+
}
|
|
34
|
+
set outputTagId(v: number) {
|
|
35
|
+
this.api.outputTagId = v
|
|
36
|
+
}
|
|
37
|
+
get outputId() {
|
|
38
|
+
return this.api.outputId
|
|
39
|
+
}
|
|
40
|
+
set outputId(v: number) {
|
|
41
|
+
this.api.outputId = v
|
|
42
|
+
}
|
|
43
|
+
get created_at() {
|
|
44
|
+
return this.api.created_at
|
|
45
|
+
}
|
|
46
|
+
set created_at(v: Date) {
|
|
47
|
+
this.api.created_at = v
|
|
48
|
+
}
|
|
49
|
+
get updated_at() {
|
|
50
|
+
return this.api.updated_at
|
|
51
|
+
}
|
|
52
|
+
set updated_at(v: Date) {
|
|
53
|
+
this.api.updated_at = v
|
|
54
|
+
}
|
|
55
|
+
get isDeleted() {
|
|
56
|
+
return this.api.isDeleted
|
|
57
|
+
}
|
|
58
|
+
set isDeleted(v: boolean) {
|
|
59
|
+
this.api.isDeleted = v
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
override get id(): number {
|
|
63
|
+
throw new sdk.WERR_INVALID_OPERATION('entity has no "id" value')
|
|
64
|
+
}
|
|
65
|
+
override get entityName(): string {
|
|
66
|
+
return 'OutputTagMap'
|
|
67
|
+
}
|
|
68
|
+
override get entityTable(): string {
|
|
69
|
+
return 'output_tags_map'
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
override equals(
|
|
73
|
+
ei: table.OutputTagMap,
|
|
74
|
+
syncMap?: entity.SyncMap | undefined
|
|
75
|
+
): boolean {
|
|
76
|
+
const eo = this.toApi()
|
|
77
|
+
|
|
78
|
+
if (
|
|
79
|
+
eo.outputId !==
|
|
80
|
+
(syncMap ? syncMap.output.idMap[verifyId(ei.outputId)] : ei.outputId) ||
|
|
81
|
+
eo.outputTagId !==
|
|
82
|
+
(syncMap
|
|
83
|
+
? syncMap.outputTag.idMap[verifyId(ei.outputTagId)]
|
|
84
|
+
: ei.outputTagId) ||
|
|
85
|
+
eo.isDeleted !== ei.isDeleted
|
|
86
|
+
)
|
|
87
|
+
return false
|
|
88
|
+
|
|
89
|
+
return true
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static async mergeFind(
|
|
93
|
+
storage: entity.EntityStorage,
|
|
94
|
+
userId: number,
|
|
95
|
+
ei: table.OutputTagMap,
|
|
96
|
+
syncMap: entity.SyncMap,
|
|
97
|
+
trx?: sdk.TrxToken
|
|
98
|
+
): Promise<{ found: boolean; eo: entity.OutputTagMap; eiId: number }> {
|
|
99
|
+
const outputId = syncMap.output.idMap[ei.outputId]
|
|
100
|
+
const outputTagId = syncMap.outputTag.idMap[ei.outputTagId]
|
|
101
|
+
const ef = verifyOneOrNone(
|
|
102
|
+
await storage.findOutputTagMaps({
|
|
103
|
+
partial: { outputId, outputTagId },
|
|
104
|
+
trx
|
|
105
|
+
})
|
|
106
|
+
)
|
|
107
|
+
return {
|
|
108
|
+
found: !!ef,
|
|
109
|
+
eo: new entity.OutputTagMap(ef || { ...ei }),
|
|
110
|
+
eiId: -1
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
override async mergeNew(
|
|
115
|
+
storage: entity.EntityStorage,
|
|
116
|
+
userId: number,
|
|
117
|
+
syncMap: entity.SyncMap,
|
|
118
|
+
trx?: sdk.TrxToken
|
|
119
|
+
): Promise<void> {
|
|
120
|
+
this.outputId = syncMap.output.idMap[this.outputId]
|
|
121
|
+
this.outputTagId = syncMap.outputTag.idMap[this.outputTagId]
|
|
122
|
+
await storage.insertOutputTagMap(this.toApi(), trx)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
override async mergeExisting(
|
|
126
|
+
storage: entity.EntityStorage,
|
|
127
|
+
since: Date | undefined,
|
|
128
|
+
ei: table.OutputTagMap,
|
|
129
|
+
syncMap: entity.SyncMap,
|
|
130
|
+
trx?: sdk.TrxToken
|
|
131
|
+
): Promise<boolean> {
|
|
132
|
+
let wasMerged = false
|
|
133
|
+
if (ei.updated_at > this.updated_at) {
|
|
134
|
+
this.isDeleted = ei.isDeleted
|
|
135
|
+
this.updated_at = new Date()
|
|
136
|
+
await storage.updateOutputTagMap(
|
|
137
|
+
this.outputId,
|
|
138
|
+
this.outputTagId,
|
|
139
|
+
this.toApi(),
|
|
140
|
+
trx
|
|
141
|
+
)
|
|
142
|
+
wasMerged = true
|
|
143
|
+
}
|
|
144
|
+
return wasMerged
|
|
145
|
+
}
|
|
146
|
+
}
|