@bsv/wallet-toolbox 1.3.21 → 1.3.23
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 +17 -0
- package/mobile/out/src/index.mobile.d.ts.map +1 -0
- package/mobile/out/src/index.mobile.js +56 -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 +209 -0
- package/mobile/out/src/storage/StorageIdb.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageIdb.js +2330 -0
- package/mobile/out/src/storage/StorageIdb.js.map +1 -0
- package/mobile/out/src/storage/StorageProvider.d.ts +210 -0
- package/mobile/out/src/storage/StorageProvider.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageProvider.js +585 -0
- package/mobile/out/src/storage/StorageProvider.js.map +1 -0
- package/mobile/out/src/storage/StorageReader.d.ts +77 -0
- package/mobile/out/src/storage/StorageReader.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageReader.js +163 -0
- package/mobile/out/src/storage/StorageReader.js.map +1 -0
- package/mobile/out/src/storage/StorageReaderWriter.d.ts +88 -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 +18 -0
- package/mobile/out/src/storage/StorageSyncReader.d.ts.map +1 -0
- package/mobile/out/src/storage/StorageSyncReader.js +71 -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/remoting/StorageMobile.d.ts +283 -0
- package/mobile/out/src/storage/remoting/StorageMobile.d.ts.map +1 -0
- package/mobile/out/src/storage/remoting/StorageMobile.js +477 -0
- package/mobile/out/src/storage/remoting/StorageMobile.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 +8 -16
- package/mobile/package.json +1 -1
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/index.mobile.d.ts +0 -2
- package/out/src/index.mobile.d.ts.map +1 -1
- package/out/src/index.mobile.js +0 -2
- package/out/src/index.mobile.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts +2 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +63 -29
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +10 -6
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +2 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +75 -40
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.d.ts +2 -1
- package/out/src/storage/StorageReader.d.ts.map +1 -1
- package/out/src/storage/StorageReader.js +45 -11
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageReaderWriter.d.ts +2 -1
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
- package/out/src/storage/StorageReaderWriter.js +29 -29
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.d.ts +2 -1
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
- package/out/src/storage/StorageSyncReader.js +36 -3
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/index.mobile.d.ts +1 -1
- package/out/src/storage/index.mobile.js +1 -1
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/remoting/StorageMobile.d.ts +283 -0
- package/out/src/storage/remoting/StorageMobile.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageMobile.js +477 -0
- package/out/src/storage/remoting/StorageMobile.js.map +1 -0
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/WalletPermissionsManager.ts +19 -8
- package/src/index.mobile.ts +0 -2
- package/src/storage/StorageIdb.ts +4 -5
- package/src/storage/StorageKnex.ts +7 -6
- package/src/storage/StorageProvider.ts +5 -9
- package/src/storage/StorageReader.ts +4 -7
- package/src/storage/StorageReaderWriter.ts +4 -8
- package/src/storage/StorageSyncReader.ts +2 -19
- package/src/storage/index.mobile.ts +1 -1
- package/src/storage/remoting/StorageClient.ts +0 -1
- package/src/storage/remoting/StorageMobile.ts +527 -0
- package/tsconfig.all.json +2 -1
- package/tsconfig.client.json +6 -0
- package/tsconfig.json +3 -0
- package/tsconfig.mobile.json +28 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityTransaction = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
+
const sdk_1 = require("@bsv/sdk");
|
|
6
|
+
const index_client_1 = require("../../../index.client");
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
class EntityTransaction extends _1.EntityBase {
|
|
9
|
+
/**
|
|
10
|
+
* @returns @bsv/sdk Transaction object from parsed rawTx.
|
|
11
|
+
* If rawTx is undefined, returns undefined.
|
|
12
|
+
*/
|
|
13
|
+
getBsvTx() {
|
|
14
|
+
if (!this.rawTx)
|
|
15
|
+
return undefined;
|
|
16
|
+
return sdk_1.Transaction.fromBinary(this.rawTx);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @returns array of @bsv/sdk TransactionInput objects from parsed rawTx.
|
|
20
|
+
* If rawTx is undefined, an empty array is returned.
|
|
21
|
+
*/
|
|
22
|
+
getBsvTxIns() {
|
|
23
|
+
const tx = this.getBsvTx();
|
|
24
|
+
if (!tx)
|
|
25
|
+
return [];
|
|
26
|
+
return tx.inputs;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns an array of "known" inputs to this transaction which belong to the same userId.
|
|
30
|
+
* Uses both spentBy and rawTx inputs (if available) to locate inputs from among user's outputs.
|
|
31
|
+
* Not all transaction inputs correspond to prior storage outputs.
|
|
32
|
+
*/
|
|
33
|
+
async getInputs(storage, trx) {
|
|
34
|
+
const inputs = await storage.findOutputs({
|
|
35
|
+
partial: { userId: this.userId, spentBy: this.id },
|
|
36
|
+
trx
|
|
37
|
+
});
|
|
38
|
+
// Merge "inputs" by spentBy and userId
|
|
39
|
+
for (const input of this.getBsvTxIns()) {
|
|
40
|
+
//console.log(`getInputs of ${this.id}: ${input.txid()} ${input.txOutNum}`)
|
|
41
|
+
const pso = (0, index_client_1.verifyOneOrNone)(await storage.findOutputs({
|
|
42
|
+
partial: {
|
|
43
|
+
userId: this.userId,
|
|
44
|
+
txid: input.sourceTXID,
|
|
45
|
+
vout: input.sourceOutputIndex
|
|
46
|
+
},
|
|
47
|
+
trx
|
|
48
|
+
}));
|
|
49
|
+
if (pso && !inputs.some(i => i.outputId === pso.outputId))
|
|
50
|
+
inputs.push(pso);
|
|
51
|
+
}
|
|
52
|
+
return inputs;
|
|
53
|
+
}
|
|
54
|
+
constructor(api) {
|
|
55
|
+
const now = new Date();
|
|
56
|
+
super(api || {
|
|
57
|
+
transactionId: 0,
|
|
58
|
+
created_at: now,
|
|
59
|
+
updated_at: now,
|
|
60
|
+
userId: 0,
|
|
61
|
+
txid: '',
|
|
62
|
+
status: 'unprocessed',
|
|
63
|
+
reference: '',
|
|
64
|
+
satoshis: 0,
|
|
65
|
+
description: '',
|
|
66
|
+
isOutgoing: false,
|
|
67
|
+
rawTx: undefined,
|
|
68
|
+
inputBEEF: undefined
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
updateApi() {
|
|
72
|
+
/* nothing needed yet... */
|
|
73
|
+
}
|
|
74
|
+
get transactionId() {
|
|
75
|
+
return this.api.transactionId;
|
|
76
|
+
}
|
|
77
|
+
set transactionId(v) {
|
|
78
|
+
this.api.transactionId = v;
|
|
79
|
+
}
|
|
80
|
+
get created_at() {
|
|
81
|
+
return this.api.created_at;
|
|
82
|
+
}
|
|
83
|
+
set created_at(v) {
|
|
84
|
+
this.api.created_at = v;
|
|
85
|
+
}
|
|
86
|
+
get updated_at() {
|
|
87
|
+
return this.api.updated_at;
|
|
88
|
+
}
|
|
89
|
+
set updated_at(v) {
|
|
90
|
+
this.api.updated_at = v;
|
|
91
|
+
}
|
|
92
|
+
get version() {
|
|
93
|
+
return this.api.version;
|
|
94
|
+
}
|
|
95
|
+
set version(v) {
|
|
96
|
+
this.api.version = v;
|
|
97
|
+
}
|
|
98
|
+
get lockTime() {
|
|
99
|
+
return this.api.lockTime;
|
|
100
|
+
}
|
|
101
|
+
set lockTime(v) {
|
|
102
|
+
this.api.lockTime = v;
|
|
103
|
+
}
|
|
104
|
+
get isOutgoing() {
|
|
105
|
+
return this.api.isOutgoing;
|
|
106
|
+
}
|
|
107
|
+
set isOutgoing(v) {
|
|
108
|
+
this.api.isOutgoing = v;
|
|
109
|
+
}
|
|
110
|
+
get status() {
|
|
111
|
+
return this.api.status;
|
|
112
|
+
}
|
|
113
|
+
set status(v) {
|
|
114
|
+
this.api.status = v;
|
|
115
|
+
}
|
|
116
|
+
get userId() {
|
|
117
|
+
return this.api.userId;
|
|
118
|
+
}
|
|
119
|
+
set userId(v) {
|
|
120
|
+
this.api.userId = v;
|
|
121
|
+
}
|
|
122
|
+
get provenTxId() {
|
|
123
|
+
return this.api.provenTxId;
|
|
124
|
+
}
|
|
125
|
+
set provenTxId(v) {
|
|
126
|
+
this.api.provenTxId = v;
|
|
127
|
+
}
|
|
128
|
+
get satoshis() {
|
|
129
|
+
return this.api.satoshis;
|
|
130
|
+
}
|
|
131
|
+
set satoshis(v) {
|
|
132
|
+
this.api.satoshis = v;
|
|
133
|
+
}
|
|
134
|
+
get txid() {
|
|
135
|
+
return this.api.txid;
|
|
136
|
+
}
|
|
137
|
+
set txid(v) {
|
|
138
|
+
this.api.txid = v;
|
|
139
|
+
}
|
|
140
|
+
get reference() {
|
|
141
|
+
return this.api.reference;
|
|
142
|
+
}
|
|
143
|
+
set reference(v) {
|
|
144
|
+
this.api.reference = v;
|
|
145
|
+
}
|
|
146
|
+
get inputBEEF() {
|
|
147
|
+
return this.api.inputBEEF;
|
|
148
|
+
}
|
|
149
|
+
set inputBEEF(v) {
|
|
150
|
+
this.api.inputBEEF = v;
|
|
151
|
+
}
|
|
152
|
+
get description() {
|
|
153
|
+
return this.api.description;
|
|
154
|
+
}
|
|
155
|
+
set description(v) {
|
|
156
|
+
this.api.description = v;
|
|
157
|
+
}
|
|
158
|
+
get rawTx() {
|
|
159
|
+
return this.api.rawTx;
|
|
160
|
+
}
|
|
161
|
+
set rawTx(v) {
|
|
162
|
+
this.api.rawTx = v;
|
|
163
|
+
}
|
|
164
|
+
// Extended (computed / dependent entity) Properties
|
|
165
|
+
//get labels() { return this.api.labels }
|
|
166
|
+
//set labels(v: string[] | undefined) { this.api.labels = v }
|
|
167
|
+
get id() {
|
|
168
|
+
return this.api.transactionId;
|
|
169
|
+
}
|
|
170
|
+
set id(v) {
|
|
171
|
+
this.api.transactionId = v;
|
|
172
|
+
}
|
|
173
|
+
get entityName() {
|
|
174
|
+
return 'transaction';
|
|
175
|
+
}
|
|
176
|
+
get entityTable() {
|
|
177
|
+
return 'transactions';
|
|
178
|
+
}
|
|
179
|
+
equals(ei, syncMap) {
|
|
180
|
+
const eo = this.toApi();
|
|
181
|
+
// Properties that are never updated
|
|
182
|
+
if (eo.transactionId !== (syncMap ? syncMap.transaction.idMap[(0, index_client_1.verifyId)(ei.transactionId)] : ei.transactionId) ||
|
|
183
|
+
eo.reference !== ei.reference)
|
|
184
|
+
return false;
|
|
185
|
+
if (eo.version !== ei.version ||
|
|
186
|
+
eo.lockTime !== ei.lockTime ||
|
|
187
|
+
eo.isOutgoing !== ei.isOutgoing ||
|
|
188
|
+
eo.status !== ei.status ||
|
|
189
|
+
eo.satoshis !== ei.satoshis ||
|
|
190
|
+
eo.txid !== ei.txid ||
|
|
191
|
+
eo.description !== ei.description ||
|
|
192
|
+
!(0, index_client_1.optionalArraysEqual)(eo.rawTx, ei.rawTx) ||
|
|
193
|
+
!(0, index_client_1.optionalArraysEqual)(eo.inputBEEF, ei.inputBEEF))
|
|
194
|
+
return false;
|
|
195
|
+
if (!eo.provenTxId !== !ei.provenTxId ||
|
|
196
|
+
(ei.provenTxId && eo.provenTxId !== (syncMap ? syncMap.provenTx.idMap[(0, index_client_1.verifyId)(ei.provenTxId)] : ei.provenTxId)))
|
|
197
|
+
return false;
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
201
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findTransactions({
|
|
202
|
+
partial: { reference: ei.reference, userId },
|
|
203
|
+
trx
|
|
204
|
+
}));
|
|
205
|
+
return {
|
|
206
|
+
found: !!ef,
|
|
207
|
+
eo: new EntityTransaction(ef || { ...ei }),
|
|
208
|
+
eiId: (0, index_client_1.verifyId)(ei.transactionId)
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
212
|
+
if (this.provenTxId)
|
|
213
|
+
this.provenTxId = syncMap.provenTx.idMap[this.provenTxId];
|
|
214
|
+
this.userId = userId;
|
|
215
|
+
this.transactionId = 0;
|
|
216
|
+
this.transactionId = await storage.insertTransaction(this.toApi(), trx);
|
|
217
|
+
}
|
|
218
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
219
|
+
let wasMerged = false;
|
|
220
|
+
if (ei.updated_at > this.updated_at) {
|
|
221
|
+
// Properties that are never updated:
|
|
222
|
+
// transactionId
|
|
223
|
+
// userId
|
|
224
|
+
// reference
|
|
225
|
+
// Merged properties
|
|
226
|
+
this.version = ei.version;
|
|
227
|
+
this.lockTime = ei.lockTime;
|
|
228
|
+
this.isOutgoing = ei.isOutgoing;
|
|
229
|
+
this.status = ei.status;
|
|
230
|
+
this.provenTxId = ei.provenTxId ? syncMap.provenTx.idMap[ei.provenTxId] : undefined;
|
|
231
|
+
this.satoshis = ei.satoshis;
|
|
232
|
+
this.txid = ei.txid;
|
|
233
|
+
this.description = ei.description;
|
|
234
|
+
this.rawTx = ei.rawTx;
|
|
235
|
+
this.inputBEEF = ei.inputBEEF;
|
|
236
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()));
|
|
237
|
+
await storage.updateTransaction(this.id, this.toApi(), trx);
|
|
238
|
+
wasMerged = true;
|
|
239
|
+
}
|
|
240
|
+
return wasMerged;
|
|
241
|
+
}
|
|
242
|
+
async getProvenTx(storage, trx) {
|
|
243
|
+
if (!this.provenTxId)
|
|
244
|
+
return undefined;
|
|
245
|
+
const p = (0, index_client_1.verifyOneOrNone)(await storage.findProvenTxs({
|
|
246
|
+
partial: { provenTxId: this.provenTxId },
|
|
247
|
+
trx
|
|
248
|
+
}));
|
|
249
|
+
if (!p)
|
|
250
|
+
return undefined;
|
|
251
|
+
return new _1.EntityProvenTx(p);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
exports.EntityTransaction = EntityTransaction;
|
|
255
|
+
//# sourceMappingURL=EntityTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityTransaction.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityTransaction.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AACtD,kCAA0E;AAC1E,wDAO8B;AAC9B,wBAAsE;AAEtE,MAAa,iBAAkB,SAAQ,aAA4B;IACjE;;;OAGG;IACH,QAAQ;QAC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,GAAG,EAAE,CAAC,IAAI,CAAA;YACnB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,CAAA;YACjC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAA;YACrB,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,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;YAC3D,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAsB,EAAE,GAAkB;QAC1D,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO,SAAS,CAAA;QACtC,MAAM,CAAC,GAAG,IAAA,8BAAe,EACvB,MAAM,OAAO,CAAC,aAAa,CAAC;YAC1B,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;YACxC,GAAG;SACJ,CAAC,CACH,CAAA;QACD,IAAI,CAAC,CAAC;YAAE,OAAO,SAAS,CAAA;QACxB,OAAO,IAAI,iBAAc,CAAC,CAAC,CAAC,CAAA;IAC9B,CAAC;CACF;AAxSD,8CAwSC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { sdk, TableTxLabel } from '../../../index.client';
|
|
2
|
+
import { EntityBase, EntityStorage, SyncMap } from '.';
|
|
3
|
+
export declare class EntityTxLabel extends EntityBase<TableTxLabel> {
|
|
4
|
+
constructor(api?: TableTxLabel);
|
|
5
|
+
updateApi(): void;
|
|
6
|
+
get txLabelId(): number;
|
|
7
|
+
set txLabelId(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 label(): string;
|
|
13
|
+
set label(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: TableTxLabel, syncMap?: SyncMap): boolean;
|
|
23
|
+
static mergeFind(storage: EntityStorage, userId: number, ei: TableTxLabel, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
24
|
+
found: boolean;
|
|
25
|
+
eo: EntityTxLabel;
|
|
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: TableTxLabel, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=EntityTxLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityTxLabel.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityTxLabel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,GAAG,EAAE,YAAY,EAA6B,MAAM,uBAAuB,CAAA;AACjG,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,CAAA;AAEtD,qBAAa,aAAc,SAAQ,UAAU,CAAC,YAAY,CAAC;gBAC7C,GAAG,CAAC,EAAE,YAAY;IAcrB,SAAS,IAAI,IAAI;IAI1B,IAAI,SAAS,IAGI,MAAM,CADtB;IACD,IAAI,SAAS,CAAC,CAAC,E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,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.EntityTxLabel = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class EntityTxLabel extends _1.EntityBase {
|
|
7
|
+
constructor(api) {
|
|
8
|
+
const now = new Date();
|
|
9
|
+
super(api || {
|
|
10
|
+
txLabelId: 0,
|
|
11
|
+
created_at: now,
|
|
12
|
+
updated_at: now,
|
|
13
|
+
label: '',
|
|
14
|
+
userId: 0,
|
|
15
|
+
isDeleted: false
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
updateApi() {
|
|
19
|
+
/* nothing needed yet... */
|
|
20
|
+
}
|
|
21
|
+
get txLabelId() {
|
|
22
|
+
return this.api.txLabelId;
|
|
23
|
+
}
|
|
24
|
+
set txLabelId(v) {
|
|
25
|
+
this.api.txLabelId = 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 label() {
|
|
40
|
+
return this.api.label;
|
|
41
|
+
}
|
|
42
|
+
set label(v) {
|
|
43
|
+
this.api.label = 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.txLabelId;
|
|
59
|
+
}
|
|
60
|
+
set id(v) {
|
|
61
|
+
this.api.txLabelId = v;
|
|
62
|
+
}
|
|
63
|
+
get entityName() {
|
|
64
|
+
return 'txLabel';
|
|
65
|
+
}
|
|
66
|
+
get entityTable() {
|
|
67
|
+
return 'tx_labels';
|
|
68
|
+
}
|
|
69
|
+
equals(ei, syncMap) {
|
|
70
|
+
const eo = this.toApi();
|
|
71
|
+
if (eo.label != ei.label || 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.findTxLabels({ partial: { label: ei.label, userId }, trx }));
|
|
81
|
+
return {
|
|
82
|
+
found: !!ef,
|
|
83
|
+
eo: new EntityTxLabel(ef || { ...ei }),
|
|
84
|
+
eiId: (0, index_client_1.verifyId)(ei.txLabelId)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
88
|
+
this.userId = userId;
|
|
89
|
+
this.txLabelId = 0;
|
|
90
|
+
this.txLabelId = await storage.insertTxLabel(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.updateTxLabel(this.id, this.toApi(), trx);
|
|
98
|
+
wasMerged = true;
|
|
99
|
+
}
|
|
100
|
+
return wasMerged;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.EntityTxLabel = EntityTxLabel;
|
|
104
|
+
//# sourceMappingURL=EntityTxLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityTxLabel.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityTxLabel.ts"],"names":[],"mappings":";;;AAEA,wDAAiG;AACjG,wBAAsD;AAEtD,MAAa,aAAc,SAAQ,aAAwB;IACzD,YAAY,GAAkB;QAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,KAAK,CACH,GAAG,IAAI;YACL,SAAS,EAAE,CAAC;YACZ,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,KAAK;SACjB,CACF,CAAA;IACH,CAAC;IAEQ,SAAS;QAChB,2BAA2B;IAC7B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAA;IAC3B,CAAC;IACD,IAAI,SAAS,CAAC,CAAS;QACrB,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;IACxB,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,KAAK;QACP,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAA;IAC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S,CAAA;IAClB,CAAC;CACF;AAnHD,sCAmHC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { sdk, TableTxLabelMap } from '../../../index.client';
|
|
2
|
+
import { EntityBase, EntityStorage, SyncMap } from '.';
|
|
3
|
+
export declare class EntityTxLabelMap extends EntityBase<TableTxLabelMap> {
|
|
4
|
+
constructor(api?: TableTxLabelMap);
|
|
5
|
+
updateApi(): void;
|
|
6
|
+
get txLabelId(): number;
|
|
7
|
+
set txLabelId(v: number);
|
|
8
|
+
get transactionId(): number;
|
|
9
|
+
set transactionId(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: TableTxLabelMap, syncMap?: SyncMap | undefined): boolean;
|
|
20
|
+
static mergeFind(storage: EntityStorage, userId: number, ei: TableTxLabelMap, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
21
|
+
found: boolean;
|
|
22
|
+
eo: EntityTxLabelMap;
|
|
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: TableTxLabelMap, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=EntityTxLabelMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityTxLabelMap.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityTxLabelMap.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,GAAG,EAAE,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AQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAMrG,aAAa,CAC1B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,EAAE,EAAE,eAAe,EACnB,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.EntityTxLabelMap = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class EntityTxLabelMap extends _1.EntityBase {
|
|
7
|
+
constructor(api) {
|
|
8
|
+
const now = new Date();
|
|
9
|
+
super(api || {
|
|
10
|
+
created_at: now,
|
|
11
|
+
updated_at: now,
|
|
12
|
+
transactionId: 0,
|
|
13
|
+
txLabelId: 0,
|
|
14
|
+
isDeleted: false
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
updateApi() {
|
|
18
|
+
/* nothing needed yet... */
|
|
19
|
+
}
|
|
20
|
+
get txLabelId() {
|
|
21
|
+
return this.api.txLabelId;
|
|
22
|
+
}
|
|
23
|
+
set txLabelId(v) {
|
|
24
|
+
this.api.txLabelId = v;
|
|
25
|
+
}
|
|
26
|
+
get transactionId() {
|
|
27
|
+
return this.api.transactionId;
|
|
28
|
+
}
|
|
29
|
+
set transactionId(v) {
|
|
30
|
+
this.api.transactionId = 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
|
+
} // entity does not have its own id.
|
|
53
|
+
get entityName() {
|
|
54
|
+
return 'txLabelMap';
|
|
55
|
+
}
|
|
56
|
+
get entityTable() {
|
|
57
|
+
return 'tx_labels_map';
|
|
58
|
+
}
|
|
59
|
+
equals(ei, syncMap) {
|
|
60
|
+
const eo = this.toApi();
|
|
61
|
+
if (eo.transactionId !== (syncMap ? syncMap.transaction.idMap[(0, index_client_1.verifyId)(ei.transactionId)] : ei.transactionId) ||
|
|
62
|
+
eo.txLabelId !== (syncMap ? syncMap.txLabel.idMap[(0, index_client_1.verifyId)(ei.txLabelId)] : ei.txLabelId) ||
|
|
63
|
+
eo.isDeleted !== ei.isDeleted)
|
|
64
|
+
return false;
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
68
|
+
const transactionId = syncMap.transaction.idMap[ei.transactionId];
|
|
69
|
+
const txLabelId = syncMap.txLabel.idMap[ei.txLabelId];
|
|
70
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findTxLabelMaps({
|
|
71
|
+
partial: { transactionId, txLabelId },
|
|
72
|
+
trx
|
|
73
|
+
}));
|
|
74
|
+
return {
|
|
75
|
+
found: !!ef,
|
|
76
|
+
eo: new EntityTxLabelMap(ef || { ...ei }),
|
|
77
|
+
eiId: -1
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
81
|
+
this.transactionId = syncMap.transaction.idMap[this.transactionId];
|
|
82
|
+
this.txLabelId = syncMap.txLabel.idMap[this.txLabelId];
|
|
83
|
+
await storage.insertTxLabelMap(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.updateTxLabelMap(this.transactionId, this.txLabelId, this.toApi(), trx);
|
|
91
|
+
wasMerged = true;
|
|
92
|
+
}
|
|
93
|
+
return wasMerged;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.EntityTxLabelMap = EntityTxLabelMap;
|
|
97
|
+
//# sourceMappingURL=EntityTxLabelMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityTxLabelMap.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityTxLabelMap.ts"],"names":[],"mappings":";;;AAEA,wDAAoG;AACpG,wBAAsD;AAEtD,MAAa,gBAAiB,SAAQ,aAA2B;IAC/D,YAAY,GAAqB;QAC/B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,KAAK,CACH,GAAG,IAAI;YACL,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,aAAa,EAAE,CAAC;YAChB,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,KAAK;SACjB,CACF,CAAA;IACH,CAAC;IAEQ,SAAS;QAChB,2BAA2B;IAC7B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAA;IAC3B,CAAC;IACD,IAAI,SAAS,CAAC,CAAS;QACrB,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;IACxB,CAAC;IACD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAA;IAC/B,CAAC;IACD,IAAI,aAAa,CAAC,CAAS;QACzB,IAAI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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,gBAAgB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;YACrF,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AApHD,4CAoHC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { sdk, TableUser } from '../../../index.client';
|
|
2
|
+
import { EntityBase, EntityStorage, SyncMap } from '.';
|
|
3
|
+
export declare class EntityUser extends EntityBase<TableUser> {
|
|
4
|
+
constructor(api?: TableUser);
|
|
5
|
+
updateApi(): void;
|
|
6
|
+
get userId(): number;
|
|
7
|
+
set userId(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 identityKey(): string;
|
|
13
|
+
set identityKey(v: string);
|
|
14
|
+
get activeStorage(): string;
|
|
15
|
+
set activeStorage(v: string);
|
|
16
|
+
get id(): number;
|
|
17
|
+
set id(v: number);
|
|
18
|
+
get entityName(): string;
|
|
19
|
+
get entityTable(): string;
|
|
20
|
+
equals(ei: TableUser, syncMap?: SyncMap | undefined): boolean;
|
|
21
|
+
static mergeFind(storage: EntityStorage, userId: number, ei: TableUser, trx?: sdk.TrxToken): Promise<{
|
|
22
|
+
found: boolean;
|
|
23
|
+
eo: EntityUser;
|
|
24
|
+
eiId: number;
|
|
25
|
+
}>;
|
|
26
|
+
mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
27
|
+
mergeExisting(storage: EntityStorage, since: Date | undefined, ei: TableUser, syncMap?: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=EntityUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityUser.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityUser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,GAAG,EAAE,SAAS,EAA6B,MAAM,uBAAuB,CAAA;AAC9F,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,CAAA;AAEtD,qBAAa,UAAW,SAAQ,UAAU,CAAC,SAAS,CAAC;gBACvC,GAAG,CAAC,EAAE,SAAS;IAalB,SAAS,IAAI,IAAI;IAI1B,IAAI,MAAM,IAGI,MAAM,CADnB;IACD,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM,EAEnB;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,WAAW,IAGI,MAAM,CADxB;IACD,IAAI,WAAW,CAAC,CAAC,EAAE,MAAM,EAExB;IACD,IAAI,aAAa,IAGI,MAAM,CAD1B;IACD,IAAI,aAAa,CAAC,CAAC,EAAE,MAAM,EAE1B;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,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