@bsv/wallet-toolbox 1.3.20 → 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/.github/workflows/push.yaml +5 -0
- 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 +22 -0
- package/mobile/package.json +25 -0
- package/out/src/index.mobile.d.ts +19 -0
- package/out/src/index.mobile.d.ts.map +1 -0
- package/out/src/index.mobile.js +58 -0
- package/out/src/index.mobile.js.map +1 -0
- package/out/src/storage/index.mobile.d.ts +7 -0
- package/out/src/storage/index.mobile.d.ts.map +1 -0
- package/out/src/storage/index.mobile.js +23 -0
- package/out/src/storage/index.mobile.js.map +1 -0
- package/out/src/wab-client/WABClient.js +2 -5
- package/out/src/wab-client/WABClient.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.mobile.ts +18 -0
- package/src/storage/index.mobile.ts +6 -0
- package/src/wab-client/WABClient.ts +2 -2
- package/tsconfig.json +3 -0
- package/tsconfig.mobile.json +22 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { sdk, TableOutputTag } from '../../../index.client';
|
|
2
|
+
import { EntityBase, EntityStorage, SyncMap } from '.';
|
|
3
|
+
export declare class EntityOutputTag extends EntityBase<TableOutputTag> {
|
|
4
|
+
constructor(api?: TableOutputTag);
|
|
5
|
+
updateApi(): void;
|
|
6
|
+
get outputTagId(): number;
|
|
7
|
+
set outputTagId(v: number);
|
|
8
|
+
get created_at(): Date;
|
|
9
|
+
set created_at(v: Date);
|
|
10
|
+
get updated_at(): Date;
|
|
11
|
+
set updated_at(v: Date);
|
|
12
|
+
get tag(): string;
|
|
13
|
+
set tag(v: string);
|
|
14
|
+
get userId(): number;
|
|
15
|
+
set userId(v: number);
|
|
16
|
+
get isDeleted(): boolean;
|
|
17
|
+
set isDeleted(v: boolean);
|
|
18
|
+
get id(): number;
|
|
19
|
+
set id(v: number);
|
|
20
|
+
get entityName(): string;
|
|
21
|
+
get entityTable(): string;
|
|
22
|
+
equals(ei: TableOutputTag, syncMap?: SyncMap | undefined): boolean;
|
|
23
|
+
static mergeFind(storage: EntityStorage, userId: number, ei: TableOutputTag, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
24
|
+
found: boolean;
|
|
25
|
+
eo: EntityOutputTag;
|
|
26
|
+
eiId: number;
|
|
27
|
+
}>;
|
|
28
|
+
mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
29
|
+
mergeExisting(storage: EntityStorage, since: Date | undefined, ei: TableOutputTag, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=EntityOutputTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityOutputTag.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityOutputTag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,GAAG,EAAE,cAAc,EAA6B,MAAM,uBAAuB,CAAA;AACnG,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,CAAA;AAEtD,qBAAa,eAAgB,SAAQ,UAAU,CAAC,cAAc,CAAC;gBACjD,GAAG,CAAC,EAAE,cAAc;IAcvB,SAAS,IAAI,IAAI;IAI1B,IAAI,WAAW,IAGI,MAAM,CADxB;IACD,IAAI,WAAW,CAAC,CAAC,EAAE,MAAM,EAExB;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,GAAG,IAGI,MAAM,CADhB;IACD,IAAI,GAAG,CAAC,CAAC,EAAE,MAAM,EAEhB;IACD,IAAI,MAAM,IAGI,MAAM,CADnB;IACD,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM,EAEnB;IACD,IAAI,SAAS,IAGI,OAAO,CADvB;IACD,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,EAEvB;IAED,IAAa,EAAE,IAAI,MAAM,CAExB;IACD,IAAa,EAAE,CAAC,CAAC,EAAE,MAAM,EAExB;IACD,IAAa,UAAU,IAAI,MAAM,CAEhC;IACD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAEQ,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO;WAS9D,SAAS,CACpB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,cAAc,EAClB,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,eAAe,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IASlD,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAMrG,aAAa,CAC1B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,EAAE,EAAE,cAAc,EAClB,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,OAAO,CAAC;CAUpB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityOutputTag = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class EntityOutputTag extends _1.EntityBase {
|
|
7
|
+
constructor(api) {
|
|
8
|
+
const now = new Date();
|
|
9
|
+
super(api || {
|
|
10
|
+
outputTagId: 0,
|
|
11
|
+
created_at: now,
|
|
12
|
+
updated_at: now,
|
|
13
|
+
tag: '',
|
|
14
|
+
userId: 0,
|
|
15
|
+
isDeleted: false
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
updateApi() {
|
|
19
|
+
/* nothing needed yet... */
|
|
20
|
+
}
|
|
21
|
+
get outputTagId() {
|
|
22
|
+
return this.api.outputTagId;
|
|
23
|
+
}
|
|
24
|
+
set outputTagId(v) {
|
|
25
|
+
this.api.outputTagId = v;
|
|
26
|
+
}
|
|
27
|
+
get created_at() {
|
|
28
|
+
return this.api.created_at;
|
|
29
|
+
}
|
|
30
|
+
set created_at(v) {
|
|
31
|
+
this.api.created_at = v;
|
|
32
|
+
}
|
|
33
|
+
get updated_at() {
|
|
34
|
+
return this.api.updated_at;
|
|
35
|
+
}
|
|
36
|
+
set updated_at(v) {
|
|
37
|
+
this.api.updated_at = v;
|
|
38
|
+
}
|
|
39
|
+
get tag() {
|
|
40
|
+
return this.api.tag;
|
|
41
|
+
}
|
|
42
|
+
set tag(v) {
|
|
43
|
+
this.api.tag = v;
|
|
44
|
+
}
|
|
45
|
+
get userId() {
|
|
46
|
+
return this.api.userId;
|
|
47
|
+
}
|
|
48
|
+
set userId(v) {
|
|
49
|
+
this.api.userId = v;
|
|
50
|
+
}
|
|
51
|
+
get isDeleted() {
|
|
52
|
+
return this.api.isDeleted;
|
|
53
|
+
}
|
|
54
|
+
set isDeleted(v) {
|
|
55
|
+
this.api.isDeleted = v;
|
|
56
|
+
}
|
|
57
|
+
get id() {
|
|
58
|
+
return this.api.outputTagId;
|
|
59
|
+
}
|
|
60
|
+
set id(v) {
|
|
61
|
+
this.api.outputTagId = v;
|
|
62
|
+
}
|
|
63
|
+
get entityName() {
|
|
64
|
+
return 'outputTag';
|
|
65
|
+
}
|
|
66
|
+
get entityTable() {
|
|
67
|
+
return 'output_tags';
|
|
68
|
+
}
|
|
69
|
+
equals(ei, syncMap) {
|
|
70
|
+
const eo = this.toApi();
|
|
71
|
+
if (eo.tag != ei.tag || eo.isDeleted != ei.isDeleted)
|
|
72
|
+
return false;
|
|
73
|
+
if (!syncMap) {
|
|
74
|
+
if (eo.userId !== ei.userId)
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
80
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findOutputTags({ partial: { tag: ei.tag, userId }, trx }));
|
|
81
|
+
return {
|
|
82
|
+
found: !!ef,
|
|
83
|
+
eo: new EntityOutputTag(ef || { ...ei }),
|
|
84
|
+
eiId: (0, index_client_1.verifyId)(ei.outputTagId)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
88
|
+
this.userId = userId;
|
|
89
|
+
this.outputTagId = 0;
|
|
90
|
+
this.outputTagId = await storage.insertOutputTag(this.toApi(), trx);
|
|
91
|
+
}
|
|
92
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
93
|
+
let wasMerged = false;
|
|
94
|
+
if (ei.updated_at > this.updated_at) {
|
|
95
|
+
this.isDeleted = ei.isDeleted;
|
|
96
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()));
|
|
97
|
+
await storage.updateOutputTag(this.id, this.toApi(), trx);
|
|
98
|
+
wasMerged = true;
|
|
99
|
+
}
|
|
100
|
+
return wasMerged;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.EntityOutputTag = EntityOutputTag;
|
|
104
|
+
//# sourceMappingURL=EntityOutputTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityOutputTag.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityOutputTag.ts"],"names":[],"mappings":";;;AAEA,wDAAmG;AACnG,wBAAsD;AAEtD,MAAa,eAAgB,SAAQ,aAA0B;IAC7D,YAAY,GAAoB;QAC9B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,KAAK,CACH,GAAG,IAAI;YACL,W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AClG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAA;QACpB,IAAI,CAAC,WAAW,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;IACrE,CAAC;IAEQ,KAAK,CAAC,aAAa,CAC1B,OAAsB,EACtB,KAAuB,EACvB,EAAkB,EAClB,OAAgB,EAChB,GAAkB;QAElB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACpC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAA;YAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;YACxF,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;YACzD,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AAnHD,0CAmHC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { sdk, TableOutputTagMap } from '../../../index.client';
|
|
2
|
+
import { EntityBase, EntityStorage, SyncMap } from '.';
|
|
3
|
+
export declare class EntityOutputTagMap extends EntityBase<TableOutputTagMap> {
|
|
4
|
+
constructor(api?: TableOutputTagMap);
|
|
5
|
+
updateApi(): void;
|
|
6
|
+
get outputTagId(): number;
|
|
7
|
+
set outputTagId(v: number);
|
|
8
|
+
get outputId(): number;
|
|
9
|
+
set outputId(v: number);
|
|
10
|
+
get created_at(): Date;
|
|
11
|
+
set created_at(v: Date);
|
|
12
|
+
get updated_at(): Date;
|
|
13
|
+
set updated_at(v: Date);
|
|
14
|
+
get isDeleted(): boolean;
|
|
15
|
+
set isDeleted(v: boolean);
|
|
16
|
+
get id(): number;
|
|
17
|
+
get entityName(): string;
|
|
18
|
+
get entityTable(): string;
|
|
19
|
+
equals(ei: TableOutputTagMap, syncMap?: SyncMap | undefined): boolean;
|
|
20
|
+
static mergeFind(storage: EntityStorage, userId: number, ei: TableOutputTagMap, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
21
|
+
found: boolean;
|
|
22
|
+
eo: EntityOutputTagMap;
|
|
23
|
+
eiId: number;
|
|
24
|
+
}>;
|
|
25
|
+
mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
26
|
+
mergeExisting(storage: EntityStorage, since: Date | undefined, ei: TableOutputTagMap, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=EntityOutputTagMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityOutputTagMap.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityOutputTagMap.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,GAAG,EAAE,iBAAiB,EAA6B,MAAM,uBAAuB,CAAA;AACtG,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,CAAA;AAEtD,qBAAa,kBAAmB,SAAQ,UAAU,CAAC,iBAAiB,CAAC;gBACvD,GAAG,CAAC,EAAE,iBAAiB;IAa1B,SAAS,IAAI,IAAI;IAI1B,IAAI,WAAW,IAGI,MAAM,CADxB;IACD,IAAI,WAAW,CAAC,CAAC,EAAE,MAAM,EAExB;IACD,IAAI,QAAQ,IAGI,MAAM,CADrB;IACD,IAAI,QAAQ,CAAC,CAAC,EAAE,MAAM,EAErB;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,SAAS,IAGI,OAAO,CADvB;IACD,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,EAEvB;IAED,IAAa,EAAE,IAAI,MAAM,CAExB;IACD,IAAa,UAAU,IAAI,MAAM,CAEhC;IACD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAEQ,MAAM,CAAC,EAAE,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO;WAajE,SAAS,CACpB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,iBAAiB,EACrB,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAgBrD,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAMrG,aAAa,CAC1B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,EAAE,EAAE,iBAAiB,EACrB,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,OAAO,CAAC;CAUpB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityOutputTagMap = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class EntityOutputTagMap extends _1.EntityBase {
|
|
7
|
+
constructor(api) {
|
|
8
|
+
const now = new Date();
|
|
9
|
+
super(api || {
|
|
10
|
+
created_at: now,
|
|
11
|
+
updated_at: now,
|
|
12
|
+
outputId: 0,
|
|
13
|
+
outputTagId: 0,
|
|
14
|
+
isDeleted: false
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
updateApi() {
|
|
18
|
+
/* nothing needed yet... */
|
|
19
|
+
}
|
|
20
|
+
get outputTagId() {
|
|
21
|
+
return this.api.outputTagId;
|
|
22
|
+
}
|
|
23
|
+
set outputTagId(v) {
|
|
24
|
+
this.api.outputTagId = v;
|
|
25
|
+
}
|
|
26
|
+
get outputId() {
|
|
27
|
+
return this.api.outputId;
|
|
28
|
+
}
|
|
29
|
+
set outputId(v) {
|
|
30
|
+
this.api.outputId = v;
|
|
31
|
+
}
|
|
32
|
+
get created_at() {
|
|
33
|
+
return this.api.created_at;
|
|
34
|
+
}
|
|
35
|
+
set created_at(v) {
|
|
36
|
+
this.api.created_at = v;
|
|
37
|
+
}
|
|
38
|
+
get updated_at() {
|
|
39
|
+
return this.api.updated_at;
|
|
40
|
+
}
|
|
41
|
+
set updated_at(v) {
|
|
42
|
+
this.api.updated_at = v;
|
|
43
|
+
}
|
|
44
|
+
get isDeleted() {
|
|
45
|
+
return this.api.isDeleted;
|
|
46
|
+
}
|
|
47
|
+
set isDeleted(v) {
|
|
48
|
+
this.api.isDeleted = v;
|
|
49
|
+
}
|
|
50
|
+
get id() {
|
|
51
|
+
throw new index_client_1.sdk.WERR_INVALID_OPERATION('entity has no "id" value');
|
|
52
|
+
}
|
|
53
|
+
get entityName() {
|
|
54
|
+
return 'outputTagMap';
|
|
55
|
+
}
|
|
56
|
+
get entityTable() {
|
|
57
|
+
return 'output_tags_map';
|
|
58
|
+
}
|
|
59
|
+
equals(ei, syncMap) {
|
|
60
|
+
const eo = this.toApi();
|
|
61
|
+
if (eo.outputId !== (syncMap ? syncMap.output.idMap[(0, index_client_1.verifyId)(ei.outputId)] : ei.outputId) ||
|
|
62
|
+
eo.outputTagId !== (syncMap ? syncMap.outputTag.idMap[(0, index_client_1.verifyId)(ei.outputTagId)] : ei.outputTagId) ||
|
|
63
|
+
eo.isDeleted !== ei.isDeleted)
|
|
64
|
+
return false;
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
68
|
+
const outputId = syncMap.output.idMap[ei.outputId];
|
|
69
|
+
const outputTagId = syncMap.outputTag.idMap[ei.outputTagId];
|
|
70
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findOutputTagMaps({
|
|
71
|
+
partial: { outputId, outputTagId },
|
|
72
|
+
trx
|
|
73
|
+
}));
|
|
74
|
+
return {
|
|
75
|
+
found: !!ef,
|
|
76
|
+
eo: new EntityOutputTagMap(ef || { ...ei }),
|
|
77
|
+
eiId: -1
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
81
|
+
this.outputId = syncMap.output.idMap[this.outputId];
|
|
82
|
+
this.outputTagId = syncMap.outputTag.idMap[this.outputTagId];
|
|
83
|
+
await storage.insertOutputTagMap(this.toApi(), trx);
|
|
84
|
+
}
|
|
85
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
86
|
+
let wasMerged = false;
|
|
87
|
+
if (ei.updated_at > this.updated_at) {
|
|
88
|
+
this.isDeleted = ei.isDeleted;
|
|
89
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()));
|
|
90
|
+
await storage.updateOutputTagMap(this.outputId, this.outputTagId, this.toApi(), trx);
|
|
91
|
+
wasMerged = true;
|
|
92
|
+
}
|
|
93
|
+
return wasMerged;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.EntityOutputTagMap = EntityOutputTagMap;
|
|
97
|
+
//# sourceMappingURL=EntityOutputTagMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityOutputTagMap.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityOutputTagMap.ts"],"names":[],"mappings":";;;AAEA,wDAAsG;AACtG,wBAAsD;AAEtD,MAAa,kBAAmB,SAAQ,aAA6B;IACnE,YAAY,GAAuB;QACjC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,KAAK,CACH,GAAG,IAAI;YACL,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,QAAQ,EAAE,CAAC;YACX,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,KAAK;SACjB,CACF,CAAA;IACH,CAAC;IAEQ,SAAS;QAChB,2BAA2B;IAC7B,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAA;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,CAAA;IAC1B,CAAC;IACD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAA;IAC1B,CAAC;IACD,IAAI,QAAQ,CAAC,CAAS;QACpB,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAA;IACvB,CAAC;IACD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAA;IAC5B,CAAC;IACD,IAAI,UAAU,CAAC,CAAO;QACpB,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAA;IACzB,CAAC;IACD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAA;IAC5B,CAAC;IACD,IAAI,UAAU,CAAC,CAAO;QACpB,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAA;IACzB,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAA;IAC3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IAAI,CAAA;QAClB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AApHD,gDAoHC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { MerklePath } from '@bsv/sdk';
|
|
2
|
+
import { sdk, TableProvenTx } from '../../../index.client';
|
|
3
|
+
import { EntityBase, EntityProvenTxReq, EntityStorage, SyncMap } from '.';
|
|
4
|
+
export declare class EntityProvenTx extends EntityBase<TableProvenTx> {
|
|
5
|
+
/**
|
|
6
|
+
* Given a txid and optionally its rawTx, create a new ProvenTx object.
|
|
7
|
+
*
|
|
8
|
+
* rawTx is fetched if not provided.
|
|
9
|
+
*
|
|
10
|
+
* Only succeeds (proven is not undefined) if a proof is confirmed for rawTx,
|
|
11
|
+
* and hash of rawTx is confirmed to match txid
|
|
12
|
+
*
|
|
13
|
+
* The returned ProvenTx and ProvenTxReq objects have not been added to the storage database,
|
|
14
|
+
* this is optional and can be done by the caller if appropriate.
|
|
15
|
+
*
|
|
16
|
+
* @param txid
|
|
17
|
+
* @param services
|
|
18
|
+
* @param rawTx
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
static fromTxid(txid: string, services: sdk.WalletServices, rawTx?: number[]): Promise<ProvenTxFromTxidResult>;
|
|
22
|
+
constructor(api?: TableProvenTx);
|
|
23
|
+
updateApi(): void;
|
|
24
|
+
/**
|
|
25
|
+
* @returns desirialized `MerklePath` object, value is cached.
|
|
26
|
+
*/
|
|
27
|
+
getMerklePath(): MerklePath;
|
|
28
|
+
_mp?: MerklePath;
|
|
29
|
+
get provenTxId(): number;
|
|
30
|
+
set provenTxId(v: number);
|
|
31
|
+
get created_at(): Date;
|
|
32
|
+
set created_at(v: Date);
|
|
33
|
+
get updated_at(): Date;
|
|
34
|
+
set updated_at(v: Date);
|
|
35
|
+
get txid(): string;
|
|
36
|
+
set txid(v: string);
|
|
37
|
+
get height(): number;
|
|
38
|
+
set height(v: number);
|
|
39
|
+
get index(): number;
|
|
40
|
+
set index(v: number);
|
|
41
|
+
get merklePath(): number[];
|
|
42
|
+
set merklePath(v: number[]);
|
|
43
|
+
get rawTx(): number[];
|
|
44
|
+
set rawTx(v: number[]);
|
|
45
|
+
get blockHash(): string;
|
|
46
|
+
set blockHash(v: string);
|
|
47
|
+
get merkleRoot(): string;
|
|
48
|
+
set merkleRoot(v: string);
|
|
49
|
+
get id(): number;
|
|
50
|
+
set id(v: number);
|
|
51
|
+
get entityName(): string;
|
|
52
|
+
get entityTable(): string;
|
|
53
|
+
equals(ei: TableProvenTx, syncMap?: SyncMap | undefined): boolean;
|
|
54
|
+
static mergeFind(storage: EntityStorage, userId: number, ei: TableProvenTx, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
55
|
+
found: boolean;
|
|
56
|
+
eo: EntityProvenTx;
|
|
57
|
+
eiId: number;
|
|
58
|
+
}>;
|
|
59
|
+
mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
60
|
+
mergeExisting(storage: EntityStorage, since: Date | undefined, ei: TableProvenTx, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* How high attempts can go before status is forced to invalid
|
|
63
|
+
*/
|
|
64
|
+
static getProofAttemptsLimit: number;
|
|
65
|
+
/**
|
|
66
|
+
* How many hours we have to try for a poof
|
|
67
|
+
*/
|
|
68
|
+
static getProofMinutes: number;
|
|
69
|
+
/**
|
|
70
|
+
* Try to create a new ProvenTx from a ProvenTxReq and GetMerkleProofResultApi
|
|
71
|
+
*
|
|
72
|
+
* Otherwise it returns undefined and updates req.status to either 'unknown', 'invalid', or 'unconfirmed'
|
|
73
|
+
*
|
|
74
|
+
* @param req
|
|
75
|
+
* @param gmpResult
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
static fromReq(req: EntityProvenTxReq, gmpResult: sdk.GetMerklePathResult, countsAsAttempt: boolean): Promise<EntityProvenTx | undefined>;
|
|
79
|
+
}
|
|
80
|
+
export interface ProvenTxFromTxidResult {
|
|
81
|
+
proven?: EntityProvenTx;
|
|
82
|
+
rawTx?: number[];
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=EntityProvenTx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityProvenTx.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityProvenTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAe,GAAG,EAAE,aAAa,EAA6B,MAAM,uBAAuB,CAAA;AAClG,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,CAAA;AAEzE,qBAAa,cAAe,SAAQ,UAAU,CAAC,aAAa,CAAC;IAC3D;;;;;;;;;;;;;;;OAeG;WACU,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;gBAqCxG,GAAG,CAAC,EAAE,aAAa;IAiBtB,SAAS,IAAI,IAAI;IAI1B;;OAEG;IACH,aAAa,IAAI,UAAU;IAI3B,GAAG,CAAC,EAAE,UAAU,CAAA;IAEhB,IAAI,UAAU,IAGI,MAAM,CADvB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,EAEvB;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,IAAI,IAGI,MAAM,CADjB;IACD,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,EAEjB;IACD,IAAI,MAAM,IAGI,MAAM,CADnB;IACD,IAAI,MAAM,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,EAAE,aAAa,EACjB,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,OAAO,CAAC;IAKnB;;OAEG;IACH,MAAM,CAAC,qBAAqB,SAAI;IAEhC;;OAEG;IACH,MAAM,CAAC,eAAe,SAAK;IAE3B;;;;;;;;OAQG;WACU,OAAO,CAClB,GAAG,EAAE,iBAAiB,EACtB,SAAS,EAAE,GAAG,CAAC,mBAAmB,EAClC,eAAe,EAAE,OAAO,GACvB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;CAmEvC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityProvenTx = void 0;
|
|
4
|
+
const sdk_1 = require("@bsv/sdk");
|
|
5
|
+
const index_client_1 = require("../../../index.client");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
class EntityProvenTx extends _1.EntityBase {
|
|
8
|
+
/**
|
|
9
|
+
* Given a txid and optionally its rawTx, create a new ProvenTx object.
|
|
10
|
+
*
|
|
11
|
+
* rawTx is fetched if not provided.
|
|
12
|
+
*
|
|
13
|
+
* Only succeeds (proven is not undefined) if a proof is confirmed for rawTx,
|
|
14
|
+
* and hash of rawTx is confirmed to match txid
|
|
15
|
+
*
|
|
16
|
+
* The returned ProvenTx and ProvenTxReq objects have not been added to the storage database,
|
|
17
|
+
* this is optional and can be done by the caller if appropriate.
|
|
18
|
+
*
|
|
19
|
+
* @param txid
|
|
20
|
+
* @param services
|
|
21
|
+
* @param rawTx
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
static async fromTxid(txid, services, rawTx) {
|
|
25
|
+
var _a;
|
|
26
|
+
const r = { proven: undefined, rawTx };
|
|
27
|
+
const chain = services.chain;
|
|
28
|
+
if (!r.rawTx) {
|
|
29
|
+
const gr = await services.getRawTx(txid);
|
|
30
|
+
if (!(gr === null || gr === void 0 ? void 0 : gr.rawTx))
|
|
31
|
+
// Failing to find anything...
|
|
32
|
+
return r;
|
|
33
|
+
r.rawTx = gr.rawTx;
|
|
34
|
+
}
|
|
35
|
+
const gmpr = await services.getMerklePath(txid);
|
|
36
|
+
if (gmpr.merklePath && gmpr.header) {
|
|
37
|
+
const index = (_a = gmpr.merklePath.path[0].find(l => l.hash === txid)) === null || _a === void 0 ? void 0 : _a.offset;
|
|
38
|
+
if (index !== undefined) {
|
|
39
|
+
const api = {
|
|
40
|
+
created_at: new Date(),
|
|
41
|
+
updated_at: new Date(),
|
|
42
|
+
provenTxId: 0,
|
|
43
|
+
txid,
|
|
44
|
+
height: gmpr.header.height,
|
|
45
|
+
index,
|
|
46
|
+
merklePath: gmpr.merklePath.toBinary(),
|
|
47
|
+
rawTx: r.rawTx,
|
|
48
|
+
blockHash: gmpr.header.hash,
|
|
49
|
+
merkleRoot: gmpr.header.merkleRoot
|
|
50
|
+
};
|
|
51
|
+
r.proven = new EntityProvenTx(api);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return r;
|
|
55
|
+
}
|
|
56
|
+
constructor(api) {
|
|
57
|
+
const now = new Date();
|
|
58
|
+
super(api || {
|
|
59
|
+
provenTxId: 0,
|
|
60
|
+
created_at: now,
|
|
61
|
+
updated_at: now,
|
|
62
|
+
txid: '',
|
|
63
|
+
height: 0,
|
|
64
|
+
index: 0,
|
|
65
|
+
merklePath: [],
|
|
66
|
+
rawTx: [],
|
|
67
|
+
blockHash: '',
|
|
68
|
+
merkleRoot: ''
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
updateApi() {
|
|
72
|
+
/* nothing needed yet... */
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @returns desirialized `MerklePath` object, value is cached.
|
|
76
|
+
*/
|
|
77
|
+
getMerklePath() {
|
|
78
|
+
if (!this._mp)
|
|
79
|
+
this._mp = sdk_1.MerklePath.fromBinary(this.api.merklePath);
|
|
80
|
+
return this._mp;
|
|
81
|
+
}
|
|
82
|
+
get provenTxId() {
|
|
83
|
+
return this.api.provenTxId;
|
|
84
|
+
}
|
|
85
|
+
set provenTxId(v) {
|
|
86
|
+
this.api.provenTxId = v;
|
|
87
|
+
}
|
|
88
|
+
get created_at() {
|
|
89
|
+
return this.api.created_at;
|
|
90
|
+
}
|
|
91
|
+
set created_at(v) {
|
|
92
|
+
this.api.created_at = v;
|
|
93
|
+
}
|
|
94
|
+
get updated_at() {
|
|
95
|
+
return this.api.updated_at;
|
|
96
|
+
}
|
|
97
|
+
set updated_at(v) {
|
|
98
|
+
this.api.updated_at = v;
|
|
99
|
+
}
|
|
100
|
+
get txid() {
|
|
101
|
+
return this.api.txid;
|
|
102
|
+
}
|
|
103
|
+
set txid(v) {
|
|
104
|
+
this.api.txid = v;
|
|
105
|
+
}
|
|
106
|
+
get height() {
|
|
107
|
+
return this.api.height;
|
|
108
|
+
}
|
|
109
|
+
set height(v) {
|
|
110
|
+
this.api.height = v;
|
|
111
|
+
}
|
|
112
|
+
get index() {
|
|
113
|
+
return this.api.index;
|
|
114
|
+
}
|
|
115
|
+
set index(v) {
|
|
116
|
+
this.api.index = v;
|
|
117
|
+
}
|
|
118
|
+
get merklePath() {
|
|
119
|
+
return this.api.merklePath;
|
|
120
|
+
}
|
|
121
|
+
set merklePath(v) {
|
|
122
|
+
this.api.merklePath = v;
|
|
123
|
+
}
|
|
124
|
+
get rawTx() {
|
|
125
|
+
return this.api.rawTx;
|
|
126
|
+
}
|
|
127
|
+
set rawTx(v) {
|
|
128
|
+
this.api.rawTx = v;
|
|
129
|
+
}
|
|
130
|
+
get blockHash() {
|
|
131
|
+
return this.api.blockHash;
|
|
132
|
+
}
|
|
133
|
+
set blockHash(v) {
|
|
134
|
+
this.api.blockHash = v;
|
|
135
|
+
}
|
|
136
|
+
get merkleRoot() {
|
|
137
|
+
return this.api.merkleRoot;
|
|
138
|
+
}
|
|
139
|
+
set merkleRoot(v) {
|
|
140
|
+
this.api.merkleRoot = v;
|
|
141
|
+
}
|
|
142
|
+
get id() {
|
|
143
|
+
return this.api.provenTxId;
|
|
144
|
+
}
|
|
145
|
+
set id(v) {
|
|
146
|
+
this.api.provenTxId = v;
|
|
147
|
+
}
|
|
148
|
+
get entityName() {
|
|
149
|
+
return 'provenTx';
|
|
150
|
+
}
|
|
151
|
+
get entityTable() {
|
|
152
|
+
return 'proven_txs';
|
|
153
|
+
}
|
|
154
|
+
equals(ei, syncMap) {
|
|
155
|
+
const eo = this.toApi();
|
|
156
|
+
if (eo.txid != ei.txid ||
|
|
157
|
+
eo.height != ei.height ||
|
|
158
|
+
eo.index != ei.index ||
|
|
159
|
+
!(0, index_client_1.arraysEqual)(eo.merklePath, ei.merklePath) ||
|
|
160
|
+
!(0, index_client_1.arraysEqual)(eo.rawTx, ei.rawTx) ||
|
|
161
|
+
eo.blockHash !== ei.blockHash ||
|
|
162
|
+
eo.merkleRoot !== ei.merkleRoot
|
|
163
|
+
// equality does not depend on timestamps.
|
|
164
|
+
// || eo.created_at !== ei.created_at
|
|
165
|
+
// || eo.updated_at !== ei.updated_at
|
|
166
|
+
)
|
|
167
|
+
return false;
|
|
168
|
+
if (syncMap) {
|
|
169
|
+
if (eo.provenTxId !== syncMap.provenTx.idMap[ei.provenTxId])
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
if (eo.provenTxId !== ei.provenTxId)
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
179
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findProvenTxs({ partial: { txid: ei.txid }, trx }));
|
|
180
|
+
return {
|
|
181
|
+
found: !!ef,
|
|
182
|
+
eo: new EntityProvenTx(ef || { ...ei }),
|
|
183
|
+
eiId: (0, index_client_1.verifyId)(ei.provenTxId)
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
187
|
+
this.provenTxId = 0;
|
|
188
|
+
// TODO: Since these records are a shared resource, the record must be validated before accepting it...
|
|
189
|
+
this.provenTxId = await storage.insertProvenTx(this.toApi(), trx);
|
|
190
|
+
}
|
|
191
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
192
|
+
// ProvenTxs are never updated.
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Try to create a new ProvenTx from a ProvenTxReq and GetMerkleProofResultApi
|
|
197
|
+
*
|
|
198
|
+
* Otherwise it returns undefined and updates req.status to either 'unknown', 'invalid', or 'unconfirmed'
|
|
199
|
+
*
|
|
200
|
+
* @param req
|
|
201
|
+
* @param gmpResult
|
|
202
|
+
* @returns
|
|
203
|
+
*/
|
|
204
|
+
static async fromReq(req, gmpResult, countsAsAttempt) {
|
|
205
|
+
if (!req.txid)
|
|
206
|
+
throw new index_client_1.sdk.WERR_MISSING_PARAMETER('req.txid');
|
|
207
|
+
if (!req.rawTx)
|
|
208
|
+
throw new index_client_1.sdk.WERR_MISSING_PARAMETER('req.rawTx');
|
|
209
|
+
if (!req.rawTx)
|
|
210
|
+
throw new index_client_1.sdk.WERR_INTERNAL('rawTx must be valid');
|
|
211
|
+
for (const note of gmpResult.notes || []) {
|
|
212
|
+
req.addHistoryNote(note, true);
|
|
213
|
+
}
|
|
214
|
+
if (!gmpResult.name && !gmpResult.merklePath && !gmpResult.error) {
|
|
215
|
+
// Most likely offline or now services configured.
|
|
216
|
+
// Does not count as a proof attempt.
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
if (!gmpResult.merklePath) {
|
|
220
|
+
if (req.created_at) {
|
|
221
|
+
const ageInMsecs = Date.now() - req.created_at.getTime();
|
|
222
|
+
const ageInMinutes = Math.ceil(ageInMsecs < 1 ? 0 : ageInMsecs / (1000 * 60));
|
|
223
|
+
if (req.attempts > EntityProvenTx.getProofAttemptsLimit && ageInMinutes > EntityProvenTx.getProofMinutes) {
|
|
224
|
+
// Start the process of setting transactions to 'failed'
|
|
225
|
+
const limit = EntityProvenTx.getProofAttemptsLimit;
|
|
226
|
+
const { attempts } = req;
|
|
227
|
+
req.addHistoryNote({ what: 'getMerklePathGiveUp', attempts, limit, ageInMinutes }, true);
|
|
228
|
+
req.notified = false;
|
|
229
|
+
req.status = 'invalid';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
if (countsAsAttempt)
|
|
235
|
+
req.attempts++;
|
|
236
|
+
const merklePaths = Array.isArray(gmpResult.merklePath) ? gmpResult.merklePath : [gmpResult.merklePath];
|
|
237
|
+
for (const proof of merklePaths) {
|
|
238
|
+
try {
|
|
239
|
+
const now = new Date();
|
|
240
|
+
const leaf = proof.path[0].find(leaf => leaf.txid === true && leaf.hash === req.txid);
|
|
241
|
+
if (!leaf) {
|
|
242
|
+
req.addHistoryNote({ what: 'getMerklePathTxidNotFound' }, true);
|
|
243
|
+
throw new index_client_1.sdk.WERR_INTERNAL('merkle path does not contain leaf for txid');
|
|
244
|
+
}
|
|
245
|
+
const proven = new EntityProvenTx({
|
|
246
|
+
created_at: now,
|
|
247
|
+
updated_at: now,
|
|
248
|
+
provenTxId: 0,
|
|
249
|
+
txid: req.txid,
|
|
250
|
+
height: proof.blockHeight,
|
|
251
|
+
index: leaf.offset,
|
|
252
|
+
merklePath: proof.toBinary(),
|
|
253
|
+
rawTx: req.rawTx,
|
|
254
|
+
merkleRoot: gmpResult.header.merkleRoot,
|
|
255
|
+
blockHash: gmpResult.header.hash
|
|
256
|
+
});
|
|
257
|
+
return proven;
|
|
258
|
+
}
|
|
259
|
+
catch (eu) {
|
|
260
|
+
const { code, description } = index_client_1.sdk.WalletError.fromUnknown(eu);
|
|
261
|
+
const { attempts } = req;
|
|
262
|
+
req.addHistoryNote({ what: 'getMerklePathProvenError', attempts, code, description }, true);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.EntityProvenTx = EntityProvenTx;
|
|
268
|
+
/**
|
|
269
|
+
* How high attempts can go before status is forced to invalid
|
|
270
|
+
*/
|
|
271
|
+
EntityProvenTx.getProofAttemptsLimit = 8;
|
|
272
|
+
/**
|
|
273
|
+
* How many hours we have to try for a poof
|
|
274
|
+
*/
|
|
275
|
+
EntityProvenTx.getProofMinutes = 60;
|
|
276
|
+
//# sourceMappingURL=EntityProvenTx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityProvenTx.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityProvenTx.ts"],"names":[],"mappings":";;;AAAA,kCAAqC;AACrC,wDAAkG;AAClG,wBAAyE;AAEzE,MAAa,cAAe,SAAQ,aAAyB;IAC3D;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAY,EAAE,QAA4B,EAAE,KAAgB;;QAChF,MAAM,CAAC,GAA2B,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;QAE9D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAA;QAE5B,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YACb,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;YACxC,IAAI,CAAC,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,KAAK,CAAA;gBACZ,8BAA8B;gBAC9B,OAAO,CAAC,CAAA;YACV,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,KAAM,CAAA;QACrB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CA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