@bsv/wallet-toolbox 1.3.21 → 1.3.22
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/mobile/out/src/CWIStyleWalletManager.d.ts +437 -0
- package/mobile/out/src/CWIStyleWalletManager.d.ts.map +1 -0
- package/mobile/out/src/CWIStyleWalletManager.js +1255 -0
- package/mobile/out/src/CWIStyleWalletManager.js.map +1 -0
- package/mobile/out/src/SetupClient.d.ts +126 -0
- package/mobile/out/src/SetupClient.d.ts.map +1 -0
- package/mobile/out/src/SetupClient.js +220 -0
- package/mobile/out/src/SetupClient.js.map +1 -0
- package/mobile/out/src/SetupWallet.d.ts +100 -0
- package/mobile/out/src/SetupWallet.d.ts.map +1 -0
- package/mobile/out/src/SetupWallet.js +3 -0
- package/mobile/out/src/SetupWallet.js.map +1 -0
- package/mobile/out/src/SimpleWalletManager.d.ts +169 -0
- package/mobile/out/src/SimpleWalletManager.d.ts.map +1 -0
- package/mobile/out/src/SimpleWalletManager.js +315 -0
- package/mobile/out/src/SimpleWalletManager.js.map +1 -0
- package/mobile/out/src/Wallet.d.ts +177 -0
- package/mobile/out/src/Wallet.d.ts.map +1 -0
- package/mobile/out/src/Wallet.js +742 -0
- package/mobile/out/src/Wallet.js.map +1 -0
- package/mobile/out/src/WalletAuthenticationManager.d.ts +33 -0
- package/mobile/out/src/WalletAuthenticationManager.d.ts.map +1 -0
- package/mobile/out/src/WalletAuthenticationManager.js +113 -0
- package/mobile/out/src/WalletAuthenticationManager.js.map +1 -0
- package/mobile/out/src/WalletPermissionsManager.d.ts +598 -0
- package/mobile/out/src/WalletPermissionsManager.d.ts.map +1 -0
- package/mobile/out/src/WalletPermissionsManager.js +1868 -0
- package/mobile/out/src/WalletPermissionsManager.js.map +1 -0
- package/mobile/out/src/WalletSettingsManager.d.ts +52 -0
- package/mobile/out/src/WalletSettingsManager.d.ts.map +1 -0
- package/mobile/out/src/WalletSettingsManager.js +82 -0
- package/mobile/out/src/WalletSettingsManager.js.map +1 -0
- package/mobile/out/src/index.client.d.ts +19 -0
- package/mobile/out/src/index.client.d.ts.map +1 -0
- package/mobile/out/src/index.client.js +58 -0
- package/mobile/out/src/index.client.js.map +1 -0
- package/mobile/out/src/index.mobile.d.ts +19 -0
- package/mobile/out/src/index.mobile.d.ts.map +1 -0
- package/mobile/out/src/index.mobile.js +58 -0
- package/mobile/out/src/index.mobile.js.map +1 -0
- package/mobile/out/src/monitor/Monitor.d.ts +91 -0
- package/mobile/out/src/monitor/Monitor.d.ts.map +1 -0
- package/mobile/out/src/monitor/Monitor.js +298 -0
- package/mobile/out/src/monitor/Monitor.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskCheckForProofs.d.ts +53 -0
- package/mobile/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskCheckForProofs.js +194 -0
- package/mobile/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskCheckNoSends.d.ts +33 -0
- package/mobile/out/src/monitor/tasks/TaskCheckNoSends.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskCheckNoSends.js +65 -0
- package/mobile/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskClock.d.ts +14 -0
- package/mobile/out/src/monitor/tasks/TaskClock.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskClock.js +27 -0
- package/mobile/out/src/monitor/tasks/TaskClock.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskFailAbandoned.d.ts +20 -0
- package/mobile/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskFailAbandoned.js +52 -0
- package/mobile/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskNewHeader.d.ts +15 -0
- package/mobile/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskNewHeader.js +43 -0
- package/mobile/out/src/monitor/tasks/TaskNewHeader.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskPurge.d.ts +45 -0
- package/mobile/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskPurge.js +34 -0
- package/mobile/out/src/monitor/tasks/TaskPurge.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskReviewStatus.d.ts +26 -0
- package/mobile/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskReviewStatus.js +43 -0
- package/mobile/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskSendWaiting.d.ts +35 -0
- package/mobile/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskSendWaiting.js +107 -0
- package/mobile/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +12 -0
- package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.js +22 -0
- package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskUnFail.d.ts +41 -0
- package/mobile/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/TaskUnFail.js +144 -0
- package/mobile/out/src/monitor/tasks/TaskUnFail.js.map +1 -0
- package/mobile/out/src/monitor/tasks/WalletMonitorTask.d.ts +40 -0
- package/mobile/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -0
- package/mobile/out/src/monitor/tasks/WalletMonitorTask.js +37 -0
- package/mobile/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -0
- package/mobile/out/src/sdk/CertOpsWallet.d.ts +7 -0
- package/mobile/out/src/sdk/CertOpsWallet.d.ts.map +1 -0
- package/mobile/out/src/sdk/CertOpsWallet.js +3 -0
- package/mobile/out/src/sdk/CertOpsWallet.js.map +1 -0
- package/mobile/out/src/sdk/PrivilegedKeyManager.d.ts +125 -0
- package/mobile/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -0
- package/mobile/out/src/sdk/PrivilegedKeyManager.js +293 -0
- package/mobile/out/src/sdk/PrivilegedKeyManager.js.map +1 -0
- package/mobile/out/src/sdk/WERR_errors.d.ts +115 -0
- package/mobile/out/src/sdk/WERR_errors.d.ts.map +1 -0
- package/mobile/out/src/sdk/WERR_errors.js +158 -0
- package/mobile/out/src/sdk/WERR_errors.js.map +1 -0
- package/mobile/out/src/sdk/WalletError.d.ts +44 -0
- package/mobile/out/src/sdk/WalletError.d.ts.map +1 -0
- package/mobile/out/src/sdk/WalletError.js +118 -0
- package/mobile/out/src/sdk/WalletError.js.map +1 -0
- package/mobile/out/src/sdk/WalletServices.interfaces.d.ts +430 -0
- package/mobile/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -0
- package/mobile/out/src/sdk/WalletServices.interfaces.js +3 -0
- package/mobile/out/src/sdk/WalletServices.interfaces.js.map +1 -0
- package/mobile/out/src/sdk/WalletSigner.interfaces.d.ts +10 -0
- package/mobile/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -0
- package/mobile/out/src/sdk/WalletSigner.interfaces.js +3 -0
- package/mobile/out/src/sdk/WalletSigner.interfaces.js.map +1 -0
- package/mobile/out/src/sdk/WalletStorage.interfaces.d.ts +452 -0
- package/mobile/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -0
- package/mobile/out/src/sdk/WalletStorage.interfaces.js +3 -0
- package/mobile/out/src/sdk/WalletStorage.interfaces.js.map +1 -0
- package/mobile/out/src/sdk/index.d.ts +10 -0
- package/mobile/out/src/sdk/index.d.ts.map +1 -0
- package/mobile/out/src/sdk/index.js +26 -0
- package/mobile/out/src/sdk/index.js.map +1 -0
- package/mobile/out/src/sdk/types.d.ts +158 -0
- package/mobile/out/src/sdk/types.d.ts.map +1 -0
- package/mobile/out/src/sdk/types.js +90 -0
- package/mobile/out/src/sdk/types.js.map +1 -0
- package/mobile/out/src/sdk/validationHelpers.d.ts +301 -0
- package/mobile/out/src/sdk/validationHelpers.d.ts.map +1 -0
- package/mobile/out/src/sdk/validationHelpers.js +629 -0
- package/mobile/out/src/sdk/validationHelpers.js.map +1 -0
- package/mobile/out/src/services/ServiceCollection.d.ts +25 -0
- package/mobile/out/src/services/ServiceCollection.d.ts.map +1 -0
- package/mobile/out/src/services/ServiceCollection.js +43 -0
- package/mobile/out/src/services/ServiceCollection.js.map +1 -0
- package/mobile/out/src/services/Services.d.ts +67 -0
- package/mobile/out/src/services/Services.d.ts.map +1 -0
- package/mobile/out/src/services/Services.js +391 -0
- package/mobile/out/src/services/Services.js.map +1 -0
- package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +15 -0
- package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -0
- package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.js +51 -0
- package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -0
- package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +98 -0
- package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -0
- package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +38 -0
- package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -0
- package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +36 -0
- package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -0
- package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +128 -0
- package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -0
- package/mobile/out/src/services/chaintracker/chaintracks/index.d.ts +3 -0
- package/mobile/out/src/services/chaintracker/chaintracks/index.d.ts.map +1 -0
- package/mobile/out/src/services/chaintracker/chaintracks/index.js +19 -0
- package/mobile/out/src/services/chaintracker/chaintracks/index.js.map +1 -0
- package/mobile/out/src/services/chaintracker/index.d.ts +3 -0
- package/mobile/out/src/services/chaintracker/index.d.ts.map +1 -0
- package/mobile/out/src/services/chaintracker/index.js +19 -0
- package/mobile/out/src/services/chaintracker/index.js.map +1 -0
- package/mobile/out/src/services/createDefaultWalletServicesOptions.d.ts +4 -0
- package/mobile/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -0
- package/mobile/out/src/services/createDefaultWalletServicesOptions.js +46 -0
- package/mobile/out/src/services/createDefaultWalletServicesOptions.js.map +1 -0
- package/mobile/out/src/services/index.d.ts +2 -0
- package/mobile/out/src/services/index.d.ts.map +1 -0
- package/mobile/out/src/services/index.js +18 -0
- package/mobile/out/src/services/index.js.map +1 -0
- package/mobile/out/src/services/providers/ARC.d.ts +91 -0
- package/mobile/out/src/services/providers/ARC.d.ts.map +1 -0
- package/mobile/out/src/services/providers/ARC.js +267 -0
- package/mobile/out/src/services/providers/ARC.js.map +1 -0
- package/mobile/out/src/services/providers/Bitails.d.ts +49 -0
- package/mobile/out/src/services/providers/Bitails.d.ts.map +1 -0
- package/mobile/out/src/services/providers/Bitails.js +222 -0
- package/mobile/out/src/services/providers/Bitails.js.map +1 -0
- package/mobile/out/src/services/providers/SdkWhatsOnChain.d.ts +21 -0
- package/mobile/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -0
- package/mobile/out/src/services/providers/SdkWhatsOnChain.js +67 -0
- package/mobile/out/src/services/providers/SdkWhatsOnChain.js.map +1 -0
- package/mobile/out/src/services/providers/WhatsOnChain.d.ts +71 -0
- package/mobile/out/src/services/providers/WhatsOnChain.d.ts.map +1 -0
- package/mobile/out/src/services/providers/WhatsOnChain.js +582 -0
- package/mobile/out/src/services/providers/WhatsOnChain.js.map +1 -0
- package/mobile/out/src/services/providers/echangeRates.d.ts +12 -0
- package/mobile/out/src/services/providers/echangeRates.d.ts.map +1 -0
- package/mobile/out/src/services/providers/echangeRates.js +237 -0
- package/mobile/out/src/services/providers/echangeRates.js.map +1 -0
- package/mobile/out/src/services/providers/getBeefForTxid.d.ts +4 -0
- package/mobile/out/src/services/providers/getBeefForTxid.d.ts.map +1 -0
- package/mobile/out/src/services/providers/getBeefForTxid.js +286 -0
- package/mobile/out/src/services/providers/getBeefForTxid.js.map +1 -0
- package/mobile/out/src/signer/WalletSigner.d.ts +11 -0
- package/mobile/out/src/signer/WalletSigner.d.ts.map +1 -0
- package/mobile/out/src/signer/WalletSigner.js +13 -0
- package/mobile/out/src/signer/WalletSigner.js.map +1 -0
- package/mobile/out/src/signer/methods/acquireDirectCertificate.d.ts +4 -0
- package/mobile/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -0
- package/mobile/out/src/signer/methods/acquireDirectCertificate.js +45 -0
- package/mobile/out/src/signer/methods/acquireDirectCertificate.js.map +1 -0
- package/mobile/out/src/signer/methods/buildSignableTransaction.d.ts +10 -0
- package/mobile/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -0
- package/mobile/out/src/signer/methods/buildSignableTransaction.js +126 -0
- package/mobile/out/src/signer/methods/buildSignableTransaction.js.map +1 -0
- package/mobile/out/src/signer/methods/createAction.d.ts +20 -0
- package/mobile/out/src/signer/methods/createAction.d.ts.map +1 -0
- package/mobile/out/src/signer/methods/createAction.js +160 -0
- package/mobile/out/src/signer/methods/createAction.js.map +1 -0
- package/mobile/out/src/signer/methods/internalizeAction.d.ts +31 -0
- package/mobile/out/src/signer/methods/internalizeAction.d.ts.map +1 -0
- package/mobile/out/src/signer/methods/internalizeAction.js +95 -0
- package/mobile/out/src/signer/methods/internalizeAction.js.map +1 -0
- package/mobile/out/src/signer/methods/proveCertificate.d.ts +4 -0
- package/mobile/out/src/signer/methods/proveCertificate.d.ts.map +1 -0
- package/mobile/out/src/signer/methods/proveCertificate.js +29 -0
- package/mobile/out/src/signer/methods/proveCertificate.js.map +1 -0
- package/mobile/out/src/signer/methods/signAction.d.ts +13 -0
- package/mobile/out/src/signer/methods/signAction.d.ts.map +1 -0
- package/mobile/out/src/signer/methods/signAction.js +89 -0
- package/mobile/out/src/signer/methods/signAction.js.map +1 -0
- package/mobile/out/src/storage/StorageIdb.d.ts +208 -0
- package/mobile/out/src/storage/StorageIdb.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageIdb.js +2296 -0
- package/mobile/out/src/storage/StorageIdb.js.map +1 -0
- package/mobile/out/src/storage/StorageProvider.d.ts +209 -0
- package/mobile/out/src/storage/StorageProvider.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageProvider.js +550 -0
- package/mobile/out/src/storage/StorageProvider.js.map +1 -0
- package/mobile/out/src/storage/StorageReader.d.ts +76 -0
- package/mobile/out/src/storage/StorageReader.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageReader.js +129 -0
- package/mobile/out/src/storage/StorageReader.js.map +1 -0
- package/mobile/out/src/storage/StorageReaderWriter.d.ts +87 -0
- package/mobile/out/src/storage/StorageReaderWriter.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageReaderWriter.js +338 -0
- package/mobile/out/src/storage/StorageReaderWriter.js.map +1 -0
- package/mobile/out/src/storage/StorageSyncReader.d.ts +17 -0
- package/mobile/out/src/storage/StorageSyncReader.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageSyncReader.js +38 -0
- package/mobile/out/src/storage/StorageSyncReader.js.map +1 -0
- package/mobile/out/src/storage/WalletStorageManager.d.ts +184 -0
- package/mobile/out/src/storage/WalletStorageManager.d.ts.map +1 -0
- package/mobile/out/src/storage/WalletStorageManager.js +665 -0
- package/mobile/out/src/storage/WalletStorageManager.js.map +1 -0
- package/mobile/out/src/storage/index.client.d.ts +8 -0
- package/mobile/out/src/storage/index.client.d.ts.map +1 -0
- package/mobile/out/src/storage/index.client.js +24 -0
- package/mobile/out/src/storage/index.client.js.map +1 -0
- package/mobile/out/src/storage/index.mobile.d.ts +7 -0
- package/mobile/out/src/storage/index.mobile.d.ts.map +1 -0
- package/mobile/out/src/storage/index.mobile.js +23 -0
- package/mobile/out/src/storage/index.mobile.js.map +1 -0
- package/mobile/out/src/storage/methods/ListActionsSpecOp.d.ts +16 -0
- package/mobile/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/ListActionsSpecOp.js +40 -0
- package/mobile/out/src/storage/methods/ListActionsSpecOp.js.map +1 -0
- package/mobile/out/src/storage/methods/ListOutputsSpecOp.d.ts +26 -0
- package/mobile/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/ListOutputsSpecOp.js +71 -0
- package/mobile/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -0
- package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +41 -0
- package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.js +320 -0
- package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -0
- package/mobile/out/src/storage/methods/createAction.d.ts +24 -0
- package/mobile/out/src/storage/methods/createAction.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/createAction.js +705 -0
- package/mobile/out/src/storage/methods/createAction.js.map +1 -0
- package/mobile/out/src/storage/methods/generateChange.d.ts +119 -0
- package/mobile/out/src/storage/methods/generateChange.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/generateChange.js +448 -0
- package/mobile/out/src/storage/methods/generateChange.js.map +1 -0
- package/mobile/out/src/storage/methods/getBeefForTransaction.d.ts +22 -0
- package/mobile/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/getBeefForTransaction.js +92 -0
- package/mobile/out/src/storage/methods/getBeefForTransaction.js.map +1 -0
- package/mobile/out/src/storage/methods/getSyncChunk.d.ts +10 -0
- package/mobile/out/src/storage/methods/getSyncChunk.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/getSyncChunk.js +271 -0
- package/mobile/out/src/storage/methods/getSyncChunk.js.map +1 -0
- package/mobile/out/src/storage/methods/internalizeAction.d.ts +38 -0
- package/mobile/out/src/storage/methods/internalizeAction.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/internalizeAction.js +371 -0
- package/mobile/out/src/storage/methods/internalizeAction.js.map +1 -0
- package/mobile/out/src/storage/methods/listActionsIdb.d.ts +5 -0
- package/mobile/out/src/storage/methods/listActionsIdb.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/listActionsIdb.js +155 -0
- package/mobile/out/src/storage/methods/listActionsIdb.js.map +1 -0
- package/mobile/out/src/storage/methods/listCertificates.d.ts +5 -0
- package/mobile/out/src/storage/methods/listCertificates.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/listCertificates.js +68 -0
- package/mobile/out/src/storage/methods/listCertificates.js.map +1 -0
- package/mobile/out/src/storage/methods/listOutputsIdb.d.ts +5 -0
- package/mobile/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/listOutputsIdb.js +181 -0
- package/mobile/out/src/storage/methods/listOutputsIdb.js.map +1 -0
- package/mobile/out/src/storage/methods/processAction.d.ts +35 -0
- package/mobile/out/src/storage/methods/processAction.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/processAction.js +311 -0
- package/mobile/out/src/storage/methods/processAction.js.map +1 -0
- package/mobile/out/src/storage/methods/purgeDataIdb.d.ts +4 -0
- package/mobile/out/src/storage/methods/purgeDataIdb.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/purgeDataIdb.js +9 -0
- package/mobile/out/src/storage/methods/purgeDataIdb.js.map +1 -0
- package/mobile/out/src/storage/methods/reviewStatusIdb.d.ts +20 -0
- package/mobile/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -0
- package/mobile/out/src/storage/methods/reviewStatusIdb.js +35 -0
- package/mobile/out/src/storage/methods/reviewStatusIdb.js.map +1 -0
- package/mobile/out/src/storage/remoting/StorageClient.d.ts +283 -0
- package/mobile/out/src/storage/remoting/StorageClient.d.ts.map +1 -0
- package/mobile/out/src/storage/remoting/StorageClient.js +477 -0
- package/mobile/out/src/storage/remoting/StorageClient.js.map +1 -0
- package/mobile/out/src/storage/schema/StorageIdbSchema.d.ts +133 -0
- package/mobile/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/StorageIdbSchema.js +3 -0
- package/mobile/out/src/storage/schema/StorageIdbSchema.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityBase.d.ts +105 -0
- package/mobile/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityBase.js +100 -0
- package/mobile/out/src/storage/schema/entities/EntityBase.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificate.d.ts +43 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificate.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificate.js +162 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificate.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificateField.d.ts +32 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificateField.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificateField.js +111 -0
- package/mobile/out/src/storage/schema/entities/EntityCertificateField.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityCommission.d.ts +37 -0
- package/mobile/out/src/storage/schema/entities/EntityCommission.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityCommission.js +127 -0
- package/mobile/out/src/storage/schema/entities/EntityCommission.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutput.d.ts +67 -0
- package/mobile/out/src/storage/schema/entities/EntityOutput.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutput.js +264 -0
- package/mobile/out/src/storage/schema/entities/EntityOutput.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputBasket.d.ts +35 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputBasket.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputBasket.js +133 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputBasket.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTag.d.ts +31 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTag.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTag.js +104 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTag.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.d.ts +28 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.js +97 -0
- package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTx.d.ts +84 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTx.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTx.js +276 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.d.ts +135 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.js +522 -0
- package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntitySyncState.d.ts +67 -0
- package/mobile/out/src/storage/schema/entities/EntitySyncState.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntitySyncState.js +319 -0
- package/mobile/out/src/storage/schema/entities/EntitySyncState.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityTransaction.d.ts +67 -0
- package/mobile/out/src/storage/schema/entities/EntityTransaction.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityTransaction.js +255 -0
- package/mobile/out/src/storage/schema/entities/EntityTransaction.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabel.d.ts +31 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabel.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabel.js +104 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabel.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.d.ts +28 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.js +97 -0
- package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityUser.d.ts +29 -0
- package/mobile/out/src/storage/schema/entities/EntityUser.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/EntityUser.js +98 -0
- package/mobile/out/src/storage/schema/entities/EntityUser.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/MergeEntity.d.ts +33 -0
- package/mobile/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/MergeEntity.js +62 -0
- package/mobile/out/src/storage/schema/entities/MergeEntity.js.map +1 -0
- package/mobile/out/src/storage/schema/entities/index.d.ts +17 -0
- package/mobile/out/src/storage/schema/entities/index.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/entities/index.js +33 -0
- package/mobile/out/src/storage/schema/entities/index.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableCertificate.d.ts +20 -0
- package/mobile/out/src/storage/schema/tables/TableCertificate.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableCertificate.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableCertificate.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableCertificateField.d.ts +12 -0
- package/mobile/out/src/storage/schema/tables/TableCertificateField.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableCertificateField.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableCertificateField.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableCommission.d.ts +13 -0
- package/mobile/out/src/storage/schema/tables/TableCommission.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableCommission.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableCommission.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableMonitorEvent.d.ts +9 -0
- package/mobile/out/src/storage/schema/tables/TableMonitorEvent.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableMonitorEvent.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableMonitorEvent.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutput.d.ts +36 -0
- package/mobile/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutput.js +31 -0
- package/mobile/out/src/storage/schema/tables/TableOutput.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutputBasket.d.ts +12 -0
- package/mobile/out/src/storage/schema/tables/TableOutputBasket.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutputBasket.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableOutputBasket.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTag.d.ts +10 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTag.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTag.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTag.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTagMap.d.ts +9 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTagMap.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTagMap.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableOutputTagMap.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTx.d.ts +14 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTx.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTx.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTx.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTxReq.d.ts +64 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTxReq.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTxReq.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableProvenTxReq.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableSettings.d.ts +17 -0
- package/mobile/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableSettings.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableSettings.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableSyncState.d.ts +18 -0
- package/mobile/out/src/storage/schema/tables/TableSyncState.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableSyncState.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableSyncState.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableTransaction.d.ts +37 -0
- package/mobile/out/src/storage/schema/tables/TableTransaction.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableTransaction.js +21 -0
- package/mobile/out/src/storage/schema/tables/TableTransaction.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabel.d.ts +10 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabel.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabel.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabel.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabelMap.d.ts +9 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabelMap.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabelMap.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableTxLabelMap.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableUser.d.ts +16 -0
- package/mobile/out/src/storage/schema/tables/TableUser.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/TableUser.js +3 -0
- package/mobile/out/src/storage/schema/tables/TableUser.js.map +1 -0
- package/mobile/out/src/storage/schema/tables/index.d.ts +17 -0
- package/mobile/out/src/storage/schema/tables/index.d.ts.map +1 -0
- package/mobile/out/src/storage/schema/tables/index.js +33 -0
- package/mobile/out/src/storage/schema/tables/index.js.map +1 -0
- package/mobile/out/src/utility/ScriptTemplateBRC29.d.ts +25 -0
- package/mobile/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -0
- package/mobile/out/src/utility/ScriptTemplateBRC29.js +48 -0
- package/mobile/out/src/utility/ScriptTemplateBRC29.js.map +1 -0
- package/mobile/out/src/utility/identityUtils.d.ts +31 -0
- package/mobile/out/src/utility/identityUtils.d.ts.map +1 -0
- package/mobile/out/src/utility/identityUtils.js +116 -0
- package/mobile/out/src/utility/identityUtils.js.map +1 -0
- package/mobile/out/src/utility/index.client.d.ts +7 -0
- package/mobile/out/src/utility/index.client.d.ts.map +1 -0
- package/mobile/out/src/utility/index.client.js +23 -0
- package/mobile/out/src/utility/index.client.js.map +1 -0
- package/mobile/out/src/utility/parseTxScriptOffsets.d.ts +14 -0
- package/mobile/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -0
- package/mobile/out/src/utility/parseTxScriptOffsets.js +26 -0
- package/mobile/out/src/utility/parseTxScriptOffsets.js.map +1 -0
- package/mobile/out/src/utility/stampLog.d.ts +18 -0
- package/mobile/out/src/utility/stampLog.d.ts.map +1 -0
- package/mobile/out/src/utility/stampLog.js +72 -0
- package/mobile/out/src/utility/stampLog.js.map +1 -0
- package/mobile/out/src/utility/tscProofToMerklePath.d.ts +8 -0
- package/mobile/out/src/utility/tscProofToMerklePath.d.ts.map +1 -0
- package/mobile/out/src/utility/tscProofToMerklePath.js +41 -0
- package/mobile/out/src/utility/tscProofToMerklePath.js.map +1 -0
- package/mobile/out/src/utility/utilityHelpers.d.ts +129 -0
- package/mobile/out/src/utility/utilityHelpers.d.ts.map +1 -0
- package/mobile/out/src/utility/utilityHelpers.js +266 -0
- package/mobile/out/src/utility/utilityHelpers.js.map +1 -0
- package/mobile/out/src/utility/utilityHelpers.noBuffer.d.ts +9 -0
- package/mobile/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -0
- package/mobile/out/src/utility/utilityHelpers.noBuffer.js +23 -0
- package/mobile/out/src/utility/utilityHelpers.noBuffer.js.map +1 -0
- package/mobile/out/src/wab-client/WABClient.d.ts +49 -0
- package/mobile/out/src/wab-client/WABClient.d.ts.map +1 -0
- package/mobile/out/src/wab-client/WABClient.js +80 -0
- package/mobile/out/src/wab-client/WABClient.js.map +1 -0
- package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +34 -0
- package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -0
- package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +16 -0
- package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -0
- package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts +7 -0
- package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts.map +1 -0
- package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +36 -0
- package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +1 -0
- package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +28 -0
- package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +1 -0
- package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +69 -0
- package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -0
- package/mobile/out/tsconfig.mobile.tsbuildinfo +1 -0
- package/mobile/package-lock.json +5 -12
- package/mobile/package.json +1 -1
- package/package.json +1 -1
- package/tsconfig.json +3 -0
- package/tsconfig.mobile.json +22 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { sdk, StorageProvider, TableProvenTxReq, WalletStorageManager } from '../../../index.client';
|
|
2
|
+
import { EntityBase, EntityStorage, SyncMap } from '.';
|
|
3
|
+
export declare class EntityProvenTxReq extends EntityBase<TableProvenTxReq> {
|
|
4
|
+
static fromStorageTxid(storage: EntityStorage, txid: string, trx?: sdk.TrxToken): Promise<EntityProvenTxReq | undefined>;
|
|
5
|
+
static fromStorageId(storage: EntityStorage, id: number, trx?: sdk.TrxToken): Promise<EntityProvenTxReq>;
|
|
6
|
+
static fromTxid(txid: string, rawTx: number[], inputBEEF?: number[]): EntityProvenTxReq;
|
|
7
|
+
history: ProvenTxReqHistory;
|
|
8
|
+
notify: ProvenTxReqNotify;
|
|
9
|
+
packApiHistory(): void;
|
|
10
|
+
packApiNotify(): void;
|
|
11
|
+
unpackApiHistory(): void;
|
|
12
|
+
unpackApiNotify(): void;
|
|
13
|
+
get apiHistory(): string;
|
|
14
|
+
get apiNotify(): string;
|
|
15
|
+
set apiHistory(v: string);
|
|
16
|
+
set apiNotify(v: string);
|
|
17
|
+
updateApi(): void;
|
|
18
|
+
unpackApi(): void;
|
|
19
|
+
refreshFromStorage(storage: EntityStorage | WalletStorageManager, trx?: sdk.TrxToken): Promise<void>;
|
|
20
|
+
constructor(api?: TableProvenTxReq);
|
|
21
|
+
/**
|
|
22
|
+
* Returns history to only what followed since date.
|
|
23
|
+
*/
|
|
24
|
+
historySince(since: Date): ProvenTxReqHistory;
|
|
25
|
+
historyPretty(since?: Date, indent?: number): string;
|
|
26
|
+
prettyNote(note: sdk.ReqHistoryNote): string;
|
|
27
|
+
getHistorySummary(): ProvenTxReqHistorySummaryApi;
|
|
28
|
+
parseHistoryNote(note: sdk.ReqHistoryNote, summary?: ProvenTxReqHistorySummaryApi): string;
|
|
29
|
+
addNotifyTransactionId(id: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a note to history.
|
|
32
|
+
* Notes with identical property values to an existing note are ignored.
|
|
33
|
+
* @param note Note to add
|
|
34
|
+
* @param noDupes if true, only newest note with same `what` value is retained.
|
|
35
|
+
*/
|
|
36
|
+
addHistoryNote(note: sdk.ReqHistoryNote, noDupes?: boolean): void;
|
|
37
|
+
/**
|
|
38
|
+
* Updates database record with current state of this EntityUser
|
|
39
|
+
|
|
40
|
+
* @param storage
|
|
41
|
+
* @param trx
|
|
42
|
+
*/
|
|
43
|
+
updateStorage(storage: EntityStorage, trx?: sdk.TrxToken): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Update storage with changes to non-static properties:
|
|
46
|
+
* updated_at
|
|
47
|
+
* provenTxId
|
|
48
|
+
* status
|
|
49
|
+
* history
|
|
50
|
+
* notify
|
|
51
|
+
* notified
|
|
52
|
+
* attempts
|
|
53
|
+
* batch
|
|
54
|
+
*
|
|
55
|
+
* @param storage
|
|
56
|
+
* @param trx
|
|
57
|
+
*/
|
|
58
|
+
updateStorageDynamicProperties(storage: WalletStorageManager | StorageProvider, trx?: sdk.TrxToken): Promise<void>;
|
|
59
|
+
insertOrMerge(storage: EntityStorage, trx?: sdk.TrxToken): Promise<EntityProvenTxReq>;
|
|
60
|
+
/**
|
|
61
|
+
* See `ProvenTxReqStatusApi`
|
|
62
|
+
*/
|
|
63
|
+
get status(): sdk.ProvenTxReqStatus;
|
|
64
|
+
set status(v: sdk.ProvenTxReqStatus);
|
|
65
|
+
get provenTxReqId(): number;
|
|
66
|
+
set provenTxReqId(v: number);
|
|
67
|
+
get created_at(): Date;
|
|
68
|
+
set created_at(v: Date);
|
|
69
|
+
get updated_at(): Date;
|
|
70
|
+
set updated_at(v: Date);
|
|
71
|
+
get txid(): string;
|
|
72
|
+
set txid(v: string);
|
|
73
|
+
get inputBEEF(): number[] | undefined;
|
|
74
|
+
set inputBEEF(v: number[] | undefined);
|
|
75
|
+
get rawTx(): number[];
|
|
76
|
+
set rawTx(v: number[]);
|
|
77
|
+
get attempts(): number;
|
|
78
|
+
set attempts(v: number);
|
|
79
|
+
get provenTxId(): number | undefined;
|
|
80
|
+
set provenTxId(v: number | undefined);
|
|
81
|
+
get notified(): boolean;
|
|
82
|
+
set notified(v: boolean);
|
|
83
|
+
get batch(): string | undefined;
|
|
84
|
+
set batch(v: string | undefined);
|
|
85
|
+
get id(): number;
|
|
86
|
+
set id(v: number);
|
|
87
|
+
get entityName(): string;
|
|
88
|
+
get entityTable(): string;
|
|
89
|
+
/**
|
|
90
|
+
* 'convergent' equality must satisfy (A sync B) equals (B sync A)
|
|
91
|
+
*/
|
|
92
|
+
equals(ei: TableProvenTxReq, syncMap?: SyncMap | undefined): boolean;
|
|
93
|
+
static mergeFind(storage: EntityStorage, userId: number, ei: TableProvenTxReq, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
94
|
+
found: boolean;
|
|
95
|
+
eo: EntityProvenTxReq;
|
|
96
|
+
eiId: number;
|
|
97
|
+
}>;
|
|
98
|
+
mapNotifyTransactionIds(syncMap: SyncMap): void;
|
|
99
|
+
mergeNotifyTransactionIds(ei: TableProvenTxReq, syncMap?: SyncMap): void;
|
|
100
|
+
mergeHistory(ei: TableProvenTxReq, syncMap?: SyncMap, noDupes?: boolean): void;
|
|
101
|
+
static isTerminalStatus(status: sdk.ProvenTxReqStatus): boolean;
|
|
102
|
+
mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* When merging `ProvenTxReq`, care is taken to avoid short-cirtuiting notification: `status` must not transition to `completed` without
|
|
105
|
+
* passing through `notifying`. Thus a full convergent merge passes through these sequence steps:
|
|
106
|
+
* 1. Remote storage completes before local storage.
|
|
107
|
+
* 2. The remotely completed req and ProvenTx sync to local storage.
|
|
108
|
+
* 3. The local storage transitions to `notifying`, after merging the remote attempts and history.
|
|
109
|
+
* 4. The local storage notifies, transitioning to `completed`.
|
|
110
|
+
* 5. Having been updated, the local req, but not ProvenTx sync to remote storage, but do not merge because the earlier `completed` wins.
|
|
111
|
+
* 6. Convergent equality is achieved (completing work - history and attempts are equal)
|
|
112
|
+
*
|
|
113
|
+
* On terminal failure: `doubleSpend` trumps `invalid` as it contains more data.
|
|
114
|
+
*/
|
|
115
|
+
mergeExisting(storage: EntityStorage, since: Date | undefined, ei: TableProvenTxReq, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
116
|
+
}
|
|
117
|
+
export interface ProvenTxReqHistorySummaryApi {
|
|
118
|
+
setToCompleted: boolean;
|
|
119
|
+
setToCallback: boolean;
|
|
120
|
+
setToUnmined: boolean;
|
|
121
|
+
setToDoubleSpend: boolean;
|
|
122
|
+
setToSending: boolean;
|
|
123
|
+
setToUnconfirmed: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface ProvenTxReqHistory {
|
|
126
|
+
/**
|
|
127
|
+
* Keys are Date().toISOString()
|
|
128
|
+
* Values are a description of what happened.
|
|
129
|
+
*/
|
|
130
|
+
notes?: sdk.ReqHistoryNote[];
|
|
131
|
+
}
|
|
132
|
+
export interface ProvenTxReqNotify {
|
|
133
|
+
transactionIds?: number[];
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=EntityProvenTxReq.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityProvenTxReq.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityProvenTxReq.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityProvenTxReq = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class EntityProvenTxReq extends _1.EntityBase {
|
|
7
|
+
static async fromStorageTxid(storage, txid, trx) {
|
|
8
|
+
const reqApi = (0, index_client_1.verifyOneOrNone)(await storage.findProvenTxReqs({ partial: { txid }, trx }));
|
|
9
|
+
if (!reqApi)
|
|
10
|
+
return undefined;
|
|
11
|
+
return new EntityProvenTxReq(reqApi);
|
|
12
|
+
}
|
|
13
|
+
static async fromStorageId(storage, id, trx) {
|
|
14
|
+
const reqApi = (0, index_client_1.verifyOneOrNone)(await storage.findProvenTxReqs({ partial: { provenTxReqId: id }, trx }));
|
|
15
|
+
if (!reqApi)
|
|
16
|
+
throw new index_client_1.sdk.WERR_INTERNAL(`proven_tx_reqs with id ${id} is missing.`);
|
|
17
|
+
return new EntityProvenTxReq(reqApi);
|
|
18
|
+
}
|
|
19
|
+
static fromTxid(txid, rawTx, inputBEEF) {
|
|
20
|
+
const now = new Date();
|
|
21
|
+
return new EntityProvenTxReq({
|
|
22
|
+
provenTxReqId: 0,
|
|
23
|
+
created_at: now,
|
|
24
|
+
updated_at: now,
|
|
25
|
+
txid,
|
|
26
|
+
inputBEEF,
|
|
27
|
+
rawTx,
|
|
28
|
+
status: 'unknown',
|
|
29
|
+
history: '{}',
|
|
30
|
+
notify: '{}',
|
|
31
|
+
attempts: 0,
|
|
32
|
+
notified: false
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
packApiHistory() {
|
|
36
|
+
this.api.history = JSON.stringify(this.history);
|
|
37
|
+
}
|
|
38
|
+
packApiNotify() {
|
|
39
|
+
this.api.notify = JSON.stringify(this.notify);
|
|
40
|
+
}
|
|
41
|
+
unpackApiHistory() {
|
|
42
|
+
this.history = JSON.parse(this.api.history);
|
|
43
|
+
}
|
|
44
|
+
unpackApiNotify() {
|
|
45
|
+
this.notify = JSON.parse(this.api.notify);
|
|
46
|
+
}
|
|
47
|
+
get apiHistory() {
|
|
48
|
+
this.packApiHistory();
|
|
49
|
+
return this.api.history;
|
|
50
|
+
}
|
|
51
|
+
get apiNotify() {
|
|
52
|
+
this.packApiNotify();
|
|
53
|
+
return this.api.notify;
|
|
54
|
+
}
|
|
55
|
+
set apiHistory(v) {
|
|
56
|
+
this.api.history = v;
|
|
57
|
+
this.unpackApiHistory();
|
|
58
|
+
}
|
|
59
|
+
set apiNotify(v) {
|
|
60
|
+
this.api.notify = v;
|
|
61
|
+
this.unpackApiNotify();
|
|
62
|
+
}
|
|
63
|
+
updateApi() {
|
|
64
|
+
this.packApiHistory();
|
|
65
|
+
this.packApiNotify();
|
|
66
|
+
}
|
|
67
|
+
unpackApi() {
|
|
68
|
+
this.unpackApiHistory();
|
|
69
|
+
this.unpackApiNotify();
|
|
70
|
+
if (this.notify.transactionIds) {
|
|
71
|
+
// Cleanup null values and duplicates.
|
|
72
|
+
const transactionIds = [];
|
|
73
|
+
for (const id of this.notify.transactionIds) {
|
|
74
|
+
if (Number.isInteger(id) && !transactionIds.some(txid => txid === id))
|
|
75
|
+
transactionIds.push(id);
|
|
76
|
+
}
|
|
77
|
+
this.notify.transactionIds = transactionIds;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async refreshFromStorage(storage, trx) {
|
|
81
|
+
const newApi = (0, index_client_1.verifyOne)(await storage.findProvenTxReqs({ partial: { provenTxReqId: this.id }, trx }));
|
|
82
|
+
this.api = newApi;
|
|
83
|
+
this.unpackApi();
|
|
84
|
+
}
|
|
85
|
+
constructor(api) {
|
|
86
|
+
const now = new Date();
|
|
87
|
+
super(api || {
|
|
88
|
+
provenTxReqId: 0,
|
|
89
|
+
created_at: now,
|
|
90
|
+
updated_at: now,
|
|
91
|
+
txid: '',
|
|
92
|
+
rawTx: [],
|
|
93
|
+
history: '',
|
|
94
|
+
notify: '',
|
|
95
|
+
attempts: 0,
|
|
96
|
+
status: 'unknown',
|
|
97
|
+
notified: false
|
|
98
|
+
});
|
|
99
|
+
this.history = {};
|
|
100
|
+
this.notify = {};
|
|
101
|
+
this.unpackApi();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Returns history to only what followed since date.
|
|
105
|
+
*/
|
|
106
|
+
historySince(since) {
|
|
107
|
+
const fh = { notes: [] };
|
|
108
|
+
const filter = since.toISOString();
|
|
109
|
+
const notes = this.history.notes;
|
|
110
|
+
if (notes && fh.notes) {
|
|
111
|
+
for (const note of notes)
|
|
112
|
+
if (note.when && note.when > filter)
|
|
113
|
+
fh.notes.push(note);
|
|
114
|
+
}
|
|
115
|
+
return fh;
|
|
116
|
+
}
|
|
117
|
+
historyPretty(since, indent = 0) {
|
|
118
|
+
const h = since ? this.historySince(since) : { ...this.history };
|
|
119
|
+
if (!h.notes)
|
|
120
|
+
return '';
|
|
121
|
+
const whenLimit = since ? since.toISOString() : undefined;
|
|
122
|
+
let log = '';
|
|
123
|
+
for (const note of h.notes) {
|
|
124
|
+
if (whenLimit && note.when && note.when < whenLimit)
|
|
125
|
+
continue;
|
|
126
|
+
log += this.prettyNote(note) + '\n';
|
|
127
|
+
}
|
|
128
|
+
return log;
|
|
129
|
+
}
|
|
130
|
+
prettyNote(note) {
|
|
131
|
+
let log = `${note.when}: ${note.what}`;
|
|
132
|
+
for (const [key, val] of Object.entries(note)) {
|
|
133
|
+
if (key !== 'when' && key !== 'what') {
|
|
134
|
+
if (typeof val === 'string')
|
|
135
|
+
log += ' ' + key + ':`' + val + '`';
|
|
136
|
+
else
|
|
137
|
+
log += ' ' + key + ':' + val;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return log;
|
|
141
|
+
}
|
|
142
|
+
getHistorySummary() {
|
|
143
|
+
const summary = {
|
|
144
|
+
setToCompleted: false,
|
|
145
|
+
setToUnmined: false,
|
|
146
|
+
setToCallback: false,
|
|
147
|
+
setToDoubleSpend: false,
|
|
148
|
+
setToSending: false,
|
|
149
|
+
setToUnconfirmed: false
|
|
150
|
+
};
|
|
151
|
+
const h = this.history;
|
|
152
|
+
if (h.notes) {
|
|
153
|
+
for (const note of h.notes) {
|
|
154
|
+
this.parseHistoryNote(note, summary);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return summary;
|
|
158
|
+
}
|
|
159
|
+
parseHistoryNote(note, summary) {
|
|
160
|
+
const c = summary || {
|
|
161
|
+
setToCompleted: false,
|
|
162
|
+
setToUnmined: false,
|
|
163
|
+
setToCallback: false,
|
|
164
|
+
setToDoubleSpend: false,
|
|
165
|
+
setToSending: false,
|
|
166
|
+
setToUnconfirmed: false
|
|
167
|
+
};
|
|
168
|
+
let n = this.prettyNote(note);
|
|
169
|
+
try {
|
|
170
|
+
switch (note.what) {
|
|
171
|
+
case 'status':
|
|
172
|
+
{
|
|
173
|
+
const status = note.status_now;
|
|
174
|
+
switch (status) {
|
|
175
|
+
case 'completed':
|
|
176
|
+
c.setToCompleted = true;
|
|
177
|
+
break;
|
|
178
|
+
case 'unmined':
|
|
179
|
+
c.setToUnmined = true;
|
|
180
|
+
break;
|
|
181
|
+
case 'callback':
|
|
182
|
+
c.setToCallback = true;
|
|
183
|
+
break;
|
|
184
|
+
case 'doubleSpend':
|
|
185
|
+
c.setToDoubleSpend = true;
|
|
186
|
+
break;
|
|
187
|
+
case 'sending':
|
|
188
|
+
c.setToSending = true;
|
|
189
|
+
break;
|
|
190
|
+
case 'unconfirmed':
|
|
191
|
+
c.setToUnconfirmed = true;
|
|
192
|
+
break;
|
|
193
|
+
default:
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
default:
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch (_a) {
|
|
203
|
+
/** */
|
|
204
|
+
}
|
|
205
|
+
return n;
|
|
206
|
+
}
|
|
207
|
+
addNotifyTransactionId(id) {
|
|
208
|
+
if (!Number.isInteger(id))
|
|
209
|
+
throw new index_client_1.sdk.WERR_INVALID_PARAMETER('id', 'integer');
|
|
210
|
+
const s = new Set(this.notify.transactionIds || []);
|
|
211
|
+
s.add(id);
|
|
212
|
+
this.notify.transactionIds = [...s].sort((a, b) => (a > b ? 1 : a < b ? -1 : 0));
|
|
213
|
+
this.notified = false;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Adds a note to history.
|
|
217
|
+
* Notes with identical property values to an existing note are ignored.
|
|
218
|
+
* @param note Note to add
|
|
219
|
+
* @param noDupes if true, only newest note with same `what` value is retained.
|
|
220
|
+
*/
|
|
221
|
+
addHistoryNote(note, noDupes) {
|
|
222
|
+
if (!this.history.notes)
|
|
223
|
+
this.history.notes = [];
|
|
224
|
+
if (!note.when)
|
|
225
|
+
note.when = new Date().toISOString();
|
|
226
|
+
if (noDupes) {
|
|
227
|
+
// Remove any existing notes with same 'what' value and either no 'when' or an earlier 'when'
|
|
228
|
+
this.history.notes = this.history.notes.filter(n => n.what !== note.what || (n.when && n.when > note.when));
|
|
229
|
+
}
|
|
230
|
+
let addNote = true;
|
|
231
|
+
for (const n of this.history.notes) {
|
|
232
|
+
let isEqual = true;
|
|
233
|
+
for (const [k, v] of Object.entries(n)) {
|
|
234
|
+
if (v !== note[k]) {
|
|
235
|
+
isEqual = false;
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (isEqual)
|
|
240
|
+
addNote = false;
|
|
241
|
+
if (!addNote)
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
if (addNote) {
|
|
245
|
+
this.history.notes.push(note);
|
|
246
|
+
const k = (n) => {
|
|
247
|
+
return `${n.when} ${n.what}`;
|
|
248
|
+
};
|
|
249
|
+
this.history.notes.sort((a, b) => (k(a) < k(b) ? -1 : k(a) > k(b) ? 1 : 0));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Updates database record with current state of this EntityUser
|
|
254
|
+
|
|
255
|
+
* @param storage
|
|
256
|
+
* @param trx
|
|
257
|
+
*/
|
|
258
|
+
async updateStorage(storage, trx) {
|
|
259
|
+
this.updated_at = new Date();
|
|
260
|
+
this.updateApi();
|
|
261
|
+
if (this.id === 0) {
|
|
262
|
+
await storage.insertProvenTxReq(this.api);
|
|
263
|
+
}
|
|
264
|
+
const update = { ...this.api };
|
|
265
|
+
await storage.updateProvenTxReq(this.id, update, trx);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Update storage with changes to non-static properties:
|
|
269
|
+
* updated_at
|
|
270
|
+
* provenTxId
|
|
271
|
+
* status
|
|
272
|
+
* history
|
|
273
|
+
* notify
|
|
274
|
+
* notified
|
|
275
|
+
* attempts
|
|
276
|
+
* batch
|
|
277
|
+
*
|
|
278
|
+
* @param storage
|
|
279
|
+
* @param trx
|
|
280
|
+
*/
|
|
281
|
+
async updateStorageDynamicProperties(storage, trx) {
|
|
282
|
+
this.updated_at = new Date();
|
|
283
|
+
this.updateApi();
|
|
284
|
+
const update = {
|
|
285
|
+
updated_at: this.api.updated_at,
|
|
286
|
+
provenTxId: this.api.provenTxId,
|
|
287
|
+
status: this.api.status,
|
|
288
|
+
history: this.api.history,
|
|
289
|
+
notify: this.api.notify,
|
|
290
|
+
notified: this.api.notified,
|
|
291
|
+
attempts: this.api.attempts,
|
|
292
|
+
batch: this.api.batch
|
|
293
|
+
};
|
|
294
|
+
if (storage.isStorageProvider()) {
|
|
295
|
+
const sp = storage;
|
|
296
|
+
await sp.updateProvenTxReqDynamics(this.id, update, trx);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
const wsm = storage;
|
|
300
|
+
await wsm.runAsStorageProvider(async (sp) => {
|
|
301
|
+
await sp.updateProvenTxReqDynamics(this.id, update, trx);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
async insertOrMerge(storage, trx) {
|
|
306
|
+
const req = await storage.transaction(async (trx) => {
|
|
307
|
+
let reqApi0 = this.toApi();
|
|
308
|
+
const { req: reqApi1, isNew } = await storage.findOrInsertProvenTxReq(reqApi0, trx);
|
|
309
|
+
if (isNew) {
|
|
310
|
+
return new EntityProvenTxReq(reqApi1);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
const req = new EntityProvenTxReq(reqApi1);
|
|
314
|
+
req.mergeNotifyTransactionIds(reqApi0);
|
|
315
|
+
req.mergeHistory(reqApi0, undefined, true);
|
|
316
|
+
await req.updateStorage(storage, trx);
|
|
317
|
+
return req;
|
|
318
|
+
}
|
|
319
|
+
}, trx);
|
|
320
|
+
return req;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* See `ProvenTxReqStatusApi`
|
|
324
|
+
*/
|
|
325
|
+
get status() {
|
|
326
|
+
return this.api.status;
|
|
327
|
+
}
|
|
328
|
+
set status(v) {
|
|
329
|
+
if (v !== this.api.status) {
|
|
330
|
+
this.addHistoryNote({ what: 'status', status_was: this.api.status, status_now: v });
|
|
331
|
+
this.api.status = v;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
get provenTxReqId() {
|
|
335
|
+
return this.api.provenTxReqId;
|
|
336
|
+
}
|
|
337
|
+
set provenTxReqId(v) {
|
|
338
|
+
this.api.provenTxReqId = v;
|
|
339
|
+
}
|
|
340
|
+
get created_at() {
|
|
341
|
+
return this.api.created_at;
|
|
342
|
+
}
|
|
343
|
+
set created_at(v) {
|
|
344
|
+
this.api.created_at = v;
|
|
345
|
+
}
|
|
346
|
+
get updated_at() {
|
|
347
|
+
return this.api.updated_at;
|
|
348
|
+
}
|
|
349
|
+
set updated_at(v) {
|
|
350
|
+
this.api.updated_at = v;
|
|
351
|
+
}
|
|
352
|
+
get txid() {
|
|
353
|
+
return this.api.txid;
|
|
354
|
+
}
|
|
355
|
+
set txid(v) {
|
|
356
|
+
this.api.txid = v;
|
|
357
|
+
}
|
|
358
|
+
get inputBEEF() {
|
|
359
|
+
return this.api.inputBEEF;
|
|
360
|
+
}
|
|
361
|
+
set inputBEEF(v) {
|
|
362
|
+
this.api.inputBEEF = v;
|
|
363
|
+
}
|
|
364
|
+
get rawTx() {
|
|
365
|
+
return this.api.rawTx;
|
|
366
|
+
}
|
|
367
|
+
set rawTx(v) {
|
|
368
|
+
this.api.rawTx = v;
|
|
369
|
+
}
|
|
370
|
+
get attempts() {
|
|
371
|
+
return this.api.attempts;
|
|
372
|
+
}
|
|
373
|
+
set attempts(v) {
|
|
374
|
+
this.api.attempts = v;
|
|
375
|
+
}
|
|
376
|
+
get provenTxId() {
|
|
377
|
+
return this.api.provenTxId;
|
|
378
|
+
}
|
|
379
|
+
set provenTxId(v) {
|
|
380
|
+
this.api.provenTxId = v;
|
|
381
|
+
}
|
|
382
|
+
get notified() {
|
|
383
|
+
return this.api.notified;
|
|
384
|
+
}
|
|
385
|
+
set notified(v) {
|
|
386
|
+
this.api.notified = v;
|
|
387
|
+
}
|
|
388
|
+
get batch() {
|
|
389
|
+
return this.api.batch;
|
|
390
|
+
}
|
|
391
|
+
set batch(v) {
|
|
392
|
+
this.api.batch = v;
|
|
393
|
+
}
|
|
394
|
+
get id() {
|
|
395
|
+
return this.api.provenTxReqId;
|
|
396
|
+
}
|
|
397
|
+
set id(v) {
|
|
398
|
+
this.api.provenTxReqId = v;
|
|
399
|
+
}
|
|
400
|
+
get entityName() {
|
|
401
|
+
return 'provenTxReq';
|
|
402
|
+
}
|
|
403
|
+
get entityTable() {
|
|
404
|
+
return 'proven_tx_reqs';
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* 'convergent' equality must satisfy (A sync B) equals (B sync A)
|
|
408
|
+
*/
|
|
409
|
+
equals(ei, syncMap) {
|
|
410
|
+
const eo = this.toApi();
|
|
411
|
+
if (eo.txid != ei.txid ||
|
|
412
|
+
!(0, index_client_1.arraysEqual)(eo.rawTx, ei.rawTx) ||
|
|
413
|
+
(!eo.inputBEEF && ei.inputBEEF) ||
|
|
414
|
+
(eo.inputBEEF && !ei.inputBEEF) ||
|
|
415
|
+
(eo.inputBEEF && ei.inputBEEF && !(0, index_client_1.arraysEqual)(eo.inputBEEF, ei.inputBEEF)) ||
|
|
416
|
+
eo.batch != ei.batch)
|
|
417
|
+
return false;
|
|
418
|
+
if (syncMap) {
|
|
419
|
+
if (
|
|
420
|
+
// attempts doesn't matter for convergent equality
|
|
421
|
+
// history doesn't matter for convergent equality
|
|
422
|
+
// only local transactionIds matter, that cared about this txid in sorted order
|
|
423
|
+
eo.provenTxReqId !== syncMap.provenTxReq.idMap[(0, index_client_1.verifyId)(ei.provenTxReqId)] ||
|
|
424
|
+
(!eo.provenTxId && ei.provenTxId) ||
|
|
425
|
+
(eo.provenTxId && !ei.provenTxId) ||
|
|
426
|
+
(ei.provenTxId && eo.provenTxId !== syncMap.provenTx.idMap[ei.provenTxId])
|
|
427
|
+
// || eo.created_at !== minDate(ei.created_at, eo.created_at)
|
|
428
|
+
// || eo.updated_at !== maxDate(ei.updated_at, eo.updated_at)
|
|
429
|
+
)
|
|
430
|
+
return false;
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
if (eo.attempts != ei.attempts ||
|
|
434
|
+
eo.history != ei.history ||
|
|
435
|
+
eo.notify != ei.notify ||
|
|
436
|
+
eo.provenTxReqId !== ei.provenTxReqId ||
|
|
437
|
+
eo.provenTxId !== ei.provenTxId
|
|
438
|
+
// || eo.created_at !== ei.created_at
|
|
439
|
+
// || eo.updated_at !== ei.updated_at
|
|
440
|
+
)
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
446
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findProvenTxReqs({ partial: { txid: ei.txid }, trx }));
|
|
447
|
+
return {
|
|
448
|
+
found: !!ef,
|
|
449
|
+
eo: new EntityProvenTxReq(ef || { ...ei }),
|
|
450
|
+
eiId: (0, index_client_1.verifyId)(ei.provenTxReqId)
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
mapNotifyTransactionIds(syncMap) {
|
|
454
|
+
// Map external notification transaction ids to local ids
|
|
455
|
+
const externalIds = this.notify.transactionIds || [];
|
|
456
|
+
this.notify.transactionIds = [];
|
|
457
|
+
for (const transactionId of externalIds) {
|
|
458
|
+
const localTxId = syncMap.transaction.idMap[transactionId];
|
|
459
|
+
if (localTxId) {
|
|
460
|
+
this.addNotifyTransactionId(localTxId);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
mergeNotifyTransactionIds(ei, syncMap) {
|
|
465
|
+
var _a;
|
|
466
|
+
// Map external notification transaction ids to local ids and merge them if they exist.
|
|
467
|
+
const eie = new EntityProvenTxReq(ei);
|
|
468
|
+
if (eie.notify.transactionIds) {
|
|
469
|
+
(_a = this.notify).transactionIds || (_a.transactionIds = []);
|
|
470
|
+
for (const transactionId of eie.notify.transactionIds) {
|
|
471
|
+
const localTxId = syncMap ? syncMap.transaction.idMap[transactionId] : transactionId;
|
|
472
|
+
if (localTxId) {
|
|
473
|
+
this.addNotifyTransactionId(localTxId);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
479
|
+
mergeHistory(ei, syncMap, noDupes) {
|
|
480
|
+
const eie = new EntityProvenTxReq(ei);
|
|
481
|
+
if (eie.history.notes) {
|
|
482
|
+
for (const note of eie.history.notes) {
|
|
483
|
+
this.addHistoryNote(note);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
static isTerminalStatus(status) {
|
|
488
|
+
return index_client_1.sdk.ProvenTxReqTerminalStatus.some(s => s === status);
|
|
489
|
+
}
|
|
490
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
491
|
+
if (this.provenTxId)
|
|
492
|
+
this.provenTxId = syncMap.provenTx.idMap[this.provenTxId];
|
|
493
|
+
this.mapNotifyTransactionIds(syncMap);
|
|
494
|
+
this.provenTxReqId = 0;
|
|
495
|
+
this.provenTxReqId = await storage.insertProvenTxReq(this.toApi(), trx);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* When merging `ProvenTxReq`, care is taken to avoid short-cirtuiting notification: `status` must not transition to `completed` without
|
|
499
|
+
* passing through `notifying`. Thus a full convergent merge passes through these sequence steps:
|
|
500
|
+
* 1. Remote storage completes before local storage.
|
|
501
|
+
* 2. The remotely completed req and ProvenTx sync to local storage.
|
|
502
|
+
* 3. The local storage transitions to `notifying`, after merging the remote attempts and history.
|
|
503
|
+
* 4. The local storage notifies, transitioning to `completed`.
|
|
504
|
+
* 5. Having been updated, the local req, but not ProvenTx sync to remote storage, but do not merge because the earlier `completed` wins.
|
|
505
|
+
* 6. Convergent equality is achieved (completing work - history and attempts are equal)
|
|
506
|
+
*
|
|
507
|
+
* On terminal failure: `doubleSpend` trumps `invalid` as it contains more data.
|
|
508
|
+
*/
|
|
509
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
510
|
+
if (!this.batch && ei.batch)
|
|
511
|
+
this.batch = ei.batch;
|
|
512
|
+
else if (this.batch && ei.batch && this.batch !== ei.batch)
|
|
513
|
+
throw new index_client_1.sdk.WERR_INTERNAL('ProvenTxReq merge batch not equal.');
|
|
514
|
+
this.mergeHistory(ei, syncMap, true);
|
|
515
|
+
this.mergeNotifyTransactionIds(ei, syncMap);
|
|
516
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()));
|
|
517
|
+
await storage.updateProvenTxReq(this.id, this.toApi(), trx);
|
|
518
|
+
return false;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
exports.EntityProvenTxReq = EntityProvenTxReq;
|
|
522
|
+
//# sourceMappingURL=EntityProvenTxReq.js.map
|