@bsv/wallet-toolbox-client 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/src/Wallet.d.ts +83 -0
- package/out/src/Wallet.d.ts.map +1 -0
- package/out/src/Wallet.js +415 -0
- package/out/src/Wallet.js.map +1 -0
- package/out/src/index.client.d.ts +8 -0
- package/out/src/index.client.d.ts.map +1 -0
- package/out/src/index.client.js +47 -0
- package/out/src/index.client.js.map +1 -0
- package/out/src/monitor/Monitor.d.ts +89 -0
- package/out/src/monitor/Monitor.d.ts.map +1 -0
- package/out/src/monitor/Monitor.js +253 -0
- package/out/src/monitor/Monitor.js.map +1 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +53 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.js +197 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -0
- package/out/src/monitor/tasks/TaskClock.d.ts +14 -0
- package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskClock.js +27 -0
- package/out/src/monitor/tasks/TaskClock.js.map +1 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts +20 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.js +52 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -0
- package/out/src/monitor/tasks/TaskNewHeader.d.ts +15 -0
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskNewHeader.js +45 -0
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -0
- package/out/src/monitor/tasks/TaskPurge.d.ts +45 -0
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskPurge.js +35 -0
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -0
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts +26 -0
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskReviewStatus.js +44 -0
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -0
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts +32 -0
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskSendWaiting.js +99 -0
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +12 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js +22 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -0
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts +40 -0
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -0
- package/out/src/monitor/tasks/WalletMonitorTask.js +37 -0
- package/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -0
- package/out/src/sdk/CertOps.d.ts +66 -0
- package/out/src/sdk/CertOps.d.ts.map +1 -0
- package/out/src/sdk/CertOps.js +198 -0
- package/out/src/sdk/CertOps.js.map +1 -0
- package/out/src/sdk/PrivilegedKeyManager.d.ts +125 -0
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -0
- package/out/src/sdk/PrivilegedKeyManager.js +293 -0
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -0
- package/out/src/sdk/StorageSyncReader.d.ts +121 -0
- package/out/src/sdk/StorageSyncReader.d.ts.map +1 -0
- package/out/src/sdk/StorageSyncReader.js +3 -0
- package/out/src/sdk/StorageSyncReader.js.map +1 -0
- package/out/src/sdk/StorageSyncReaderWriter.d.ts +89 -0
- package/out/src/sdk/StorageSyncReaderWriter.d.ts.map +1 -0
- package/out/src/sdk/StorageSyncReaderWriter.js +3 -0
- package/out/src/sdk/StorageSyncReaderWriter.js.map +1 -0
- package/out/src/sdk/WERR_errors.d.ts +90 -0
- package/out/src/sdk/WERR_errors.d.ts.map +1 -0
- package/out/src/sdk/WERR_errors.js +128 -0
- package/out/src/sdk/WERR_errors.js.map +1 -0
- package/out/src/sdk/WalletError.d.ts +45 -0
- package/out/src/sdk/WalletError.d.ts.map +1 -0
- package/out/src/sdk/WalletError.js +122 -0
- package/out/src/sdk/WalletError.js.map +1 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts +325 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletServices.interfaces.js +3 -0
- package/out/src/sdk/WalletServices.interfaces.js.map +1 -0
- package/out/src/sdk/WalletSigner.interfaces.d.ts +10 -0
- package/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletSigner.interfaces.js +3 -0
- package/out/src/sdk/WalletSigner.interfaces.js.map +1 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts +299 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletStorage.interfaces.js +3 -0
- package/out/src/sdk/WalletStorage.interfaces.js.map +1 -0
- package/out/src/sdk/index.d.ts +12 -0
- package/out/src/sdk/index.d.ts.map +1 -0
- package/out/src/sdk/index.js +28 -0
- package/out/src/sdk/index.js.map +1 -0
- package/out/src/sdk/types.d.ts +74 -0
- package/out/src/sdk/types.d.ts.map +1 -0
- package/out/src/sdk/types.js +20 -0
- package/out/src/sdk/types.js.map +1 -0
- package/out/src/sdk/validationHelpers.d.ts +288 -0
- package/out/src/sdk/validationHelpers.d.ts.map +1 -0
- package/out/src/sdk/validationHelpers.js +630 -0
- package/out/src/sdk/validationHelpers.js.map +1 -0
- package/out/src/services/ServiceCollection.d.ts +25 -0
- package/out/src/services/ServiceCollection.d.ts.map +1 -0
- package/out/src/services/ServiceCollection.js +43 -0
- package/out/src/services/ServiceCollection.js.map +1 -0
- package/out/src/services/Services.d.ts +60 -0
- package/out/src/services/Services.d.ts.map +1 -0
- package/out/src/services/Services.js +342 -0
- package/out/src/services/Services.js.map +1 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +15 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.js +51 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +98 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +38 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +36 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +130 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/index.d.ts +3 -0
- package/out/src/services/chaintracker/chaintracks/index.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/index.js +19 -0
- package/out/src/services/chaintracker/chaintracks/index.js.map +1 -0
- package/out/src/services/chaintracker/index.d.ts +3 -0
- package/out/src/services/chaintracker/index.d.ts.map +1 -0
- package/out/src/services/chaintracker/index.js +19 -0
- package/out/src/services/chaintracker/index.js.map +1 -0
- package/out/src/services/createDefaultWalletServicesOptions.d.ts +3 -0
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -0
- package/out/src/services/createDefaultWalletServicesOptions.js +34 -0
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -0
- package/out/src/services/providers/arcServices.d.ts +62 -0
- package/out/src/services/providers/arcServices.d.ts.map +1 -0
- package/out/src/services/providers/arcServices.js +368 -0
- package/out/src/services/providers/arcServices.js.map +1 -0
- package/out/src/services/providers/echangeRates.d.ts +12 -0
- package/out/src/services/providers/echangeRates.d.ts.map +1 -0
- package/out/src/services/providers/echangeRates.js +237 -0
- package/out/src/services/providers/echangeRates.js.map +1 -0
- package/out/src/services/providers/whatsonchain.d.ts +17 -0
- package/out/src/services/providers/whatsonchain.d.ts.map +1 -0
- package/out/src/services/providers/whatsonchain.js +130 -0
- package/out/src/services/providers/whatsonchain.js.map +1 -0
- package/out/src/signer/WalletSigner.d.ts +11 -0
- package/out/src/signer/WalletSigner.d.ts.map +1 -0
- package/out/src/signer/WalletSigner.js +13 -0
- package/out/src/signer/WalletSigner.js.map +1 -0
- package/out/src/signer/methods/acquireDirectCertificate.d.ts +4 -0
- package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -0
- package/out/src/signer/methods/acquireDirectCertificate.js +47 -0
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -0
- package/out/src/signer/methods/createAction.d.ts +7 -0
- package/out/src/signer/methods/createAction.d.ts.map +1 -0
- package/out/src/signer/methods/createAction.js +250 -0
- package/out/src/signer/methods/createAction.js.map +1 -0
- package/out/src/signer/methods/internalizeAction.d.ts +31 -0
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -0
- package/out/src/signer/methods/internalizeAction.js +95 -0
- package/out/src/signer/methods/internalizeAction.js.map +1 -0
- package/out/src/signer/methods/proveCertificate.d.ts +4 -0
- package/out/src/signer/methods/proveCertificate.d.ts.map +1 -0
- package/out/src/signer/methods/proveCertificate.js +45 -0
- package/out/src/signer/methods/proveCertificate.js.map +1 -0
- package/out/src/signer/methods/signAction.d.ts +6 -0
- package/out/src/signer/methods/signAction.d.ts.map +1 -0
- package/out/src/signer/methods/signAction.js +79 -0
- package/out/src/signer/methods/signAction.js.map +1 -0
- package/out/src/storage/StorageProvider.d.ts +140 -0
- package/out/src/storage/StorageProvider.d.ts.map +1 -0
- package/out/src/storage/StorageProvider.js +539 -0
- package/out/src/storage/StorageProvider.js.map +1 -0
- package/out/src/storage/StorageReader.d.ts +76 -0
- package/out/src/storage/StorageReader.d.ts.map +1 -0
- package/out/src/storage/StorageReader.js +124 -0
- package/out/src/storage/StorageReader.js.map +1 -0
- package/out/src/storage/StorageReaderWriter.d.ts +87 -0
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -0
- package/out/src/storage/StorageReaderWriter.js +337 -0
- package/out/src/storage/StorageReaderWriter.js.map +1 -0
- package/out/src/storage/StorageSyncReader.d.ts +33 -0
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -0
- package/out/src/storage/StorageSyncReader.js +142 -0
- package/out/src/storage/StorageSyncReader.js.map +1 -0
- package/out/src/storage/WalletStorageManager.d.ts +103 -0
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -0
- package/out/src/storage/WalletStorageManager.js +408 -0
- package/out/src/storage/WalletStorageManager.js.map +1 -0
- package/out/src/storage/index.client.d.ts +7 -0
- package/out/src/storage/index.client.d.ts.map +1 -0
- package/out/src/storage/index.client.js +46 -0
- package/out/src/storage/index.client.js.map +1 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +27 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +148 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -0
- package/out/src/storage/methods/createAction.d.ts +23 -0
- package/out/src/storage/methods/createAction.d.ts.map +1 -0
- package/out/src/storage/methods/createAction.js +663 -0
- package/out/src/storage/methods/createAction.js.map +1 -0
- package/out/src/storage/methods/generateChange.d.ts +108 -0
- package/out/src/storage/methods/generateChange.d.ts.map +1 -0
- package/out/src/storage/methods/generateChange.js +422 -0
- package/out/src/storage/methods/generateChange.js.map +1 -0
- package/out/src/storage/methods/getBeefForTransaction.d.ts +22 -0
- package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -0
- package/out/src/storage/methods/getBeefForTransaction.js +94 -0
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -0
- package/out/src/storage/methods/getSyncChunk.d.ts +10 -0
- package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -0
- package/out/src/storage/methods/getSyncChunk.js +271 -0
- package/out/src/storage/methods/getSyncChunk.js.map +1 -0
- package/out/src/storage/methods/internalizeAction.d.ts +38 -0
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -0
- package/out/src/storage/methods/internalizeAction.js +378 -0
- package/out/src/storage/methods/internalizeAction.js.map +1 -0
- package/out/src/storage/methods/listCertificates.d.ts +5 -0
- package/out/src/storage/methods/listCertificates.d.ts.map +1 -0
- package/out/src/storage/methods/listCertificates.js +68 -0
- package/out/src/storage/methods/listCertificates.js.map +1 -0
- package/out/src/storage/methods/processAction.d.ts +35 -0
- package/out/src/storage/methods/processAction.d.ts.map +1 -0
- package/out/src/storage/methods/processAction.js +271 -0
- package/out/src/storage/methods/processAction.js.map +1 -0
- package/out/src/storage/remoting/StorageClient.d.ts +56 -0
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageClient.js +181 -0
- package/out/src/storage/remoting/StorageClient.js.map +1 -0
- package/out/src/storage/schema/entities/Certificate.d.ts +43 -0
- package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Certificate.js +162 -0
- package/out/src/storage/schema/entities/Certificate.js.map +1 -0
- package/out/src/storage/schema/entities/CertificateField.d.ts +32 -0
- package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -0
- package/out/src/storage/schema/entities/CertificateField.js +114 -0
- package/out/src/storage/schema/entities/CertificateField.js.map +1 -0
- package/out/src/storage/schema/entities/Commission.d.ts +37 -0
- package/out/src/storage/schema/entities/Commission.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Commission.js +130 -0
- package/out/src/storage/schema/entities/Commission.js.map +1 -0
- package/out/src/storage/schema/entities/EntityBase.d.ts +105 -0
- package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -0
- package/out/src/storage/schema/entities/EntityBase.js +100 -0
- package/out/src/storage/schema/entities/EntityBase.js.map +1 -0
- package/out/src/storage/schema/entities/MergeEntity.d.ts +34 -0
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -0
- package/out/src/storage/schema/entities/MergeEntity.js +57 -0
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -0
- package/out/src/storage/schema/entities/Output.d.ts +67 -0
- package/out/src/storage/schema/entities/Output.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Output.js +281 -0
- package/out/src/storage/schema/entities/Output.js.map +1 -0
- package/out/src/storage/schema/entities/OutputBasket.d.ts +35 -0
- package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputBasket.js +133 -0
- package/out/src/storage/schema/entities/OutputBasket.js.map +1 -0
- package/out/src/storage/schema/entities/OutputTag.d.ts +31 -0
- package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputTag.js +104 -0
- package/out/src/storage/schema/entities/OutputTag.js.map +1 -0
- package/out/src/storage/schema/entities/OutputTagMap.d.ts +28 -0
- package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputTagMap.js +101 -0
- package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -0
- package/out/src/storage/schema/entities/ProvenTx.d.ts +84 -0
- package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -0
- package/out/src/storage/schema/entities/ProvenTx.js +283 -0
- package/out/src/storage/schema/entities/ProvenTx.js.map +1 -0
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts +130 -0
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -0
- package/out/src/storage/schema/entities/ProvenTxReq.js +521 -0
- package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -0
- package/out/src/storage/schema/entities/SyncState.d.ts +66 -0
- package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -0
- package/out/src/storage/schema/entities/SyncState.js +284 -0
- package/out/src/storage/schema/entities/SyncState.js.map +1 -0
- package/out/src/storage/schema/entities/Transaction.d.ts +67 -0
- package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Transaction.js +264 -0
- package/out/src/storage/schema/entities/Transaction.js.map +1 -0
- package/out/src/storage/schema/entities/TxLabel.d.ts +31 -0
- package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -0
- package/out/src/storage/schema/entities/TxLabel.js +104 -0
- package/out/src/storage/schema/entities/TxLabel.js.map +1 -0
- package/out/src/storage/schema/entities/TxLabelMap.d.ts +28 -0
- package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -0
- package/out/src/storage/schema/entities/TxLabelMap.js +103 -0
- package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -0
- package/out/src/storage/schema/entities/User.d.ts +29 -0
- package/out/src/storage/schema/entities/User.d.ts.map +1 -0
- package/out/src/storage/schema/entities/User.js +100 -0
- package/out/src/storage/schema/entities/User.js.map +1 -0
- package/out/src/storage/schema/entities/index.d.ts +17 -0
- package/out/src/storage/schema/entities/index.d.ts.map +1 -0
- package/out/src/storage/schema/entities/index.js +33 -0
- package/out/src/storage/schema/entities/index.js.map +1 -0
- package/out/src/storage/schema/tables/Certificate.d.ts +20 -0
- package/out/src/storage/schema/tables/Certificate.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Certificate.js +3 -0
- package/out/src/storage/schema/tables/Certificate.js.map +1 -0
- package/out/src/storage/schema/tables/CertificateField.d.ts +12 -0
- package/out/src/storage/schema/tables/CertificateField.d.ts.map +1 -0
- package/out/src/storage/schema/tables/CertificateField.js +3 -0
- package/out/src/storage/schema/tables/CertificateField.js.map +1 -0
- package/out/src/storage/schema/tables/Commission.d.ts +13 -0
- package/out/src/storage/schema/tables/Commission.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Commission.js +3 -0
- package/out/src/storage/schema/tables/Commission.js.map +1 -0
- package/out/src/storage/schema/tables/MonitorEvent.d.ts +9 -0
- package/out/src/storage/schema/tables/MonitorEvent.d.ts.map +1 -0
- package/out/src/storage/schema/tables/MonitorEvent.js +3 -0
- package/out/src/storage/schema/tables/MonitorEvent.js.map +1 -0
- package/out/src/storage/schema/tables/Output.d.ts +36 -0
- package/out/src/storage/schema/tables/Output.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Output.js +31 -0
- package/out/src/storage/schema/tables/Output.js.map +1 -0
- package/out/src/storage/schema/tables/OutputBasket.d.ts +12 -0
- package/out/src/storage/schema/tables/OutputBasket.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputBasket.js +3 -0
- package/out/src/storage/schema/tables/OutputBasket.js.map +1 -0
- package/out/src/storage/schema/tables/OutputTag.d.ts +10 -0
- package/out/src/storage/schema/tables/OutputTag.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputTag.js +3 -0
- package/out/src/storage/schema/tables/OutputTag.js.map +1 -0
- package/out/src/storage/schema/tables/OutputTagMap.d.ts +9 -0
- package/out/src/storage/schema/tables/OutputTagMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputTagMap.js +3 -0
- package/out/src/storage/schema/tables/OutputTagMap.js.map +1 -0
- package/out/src/storage/schema/tables/ProvenTx.d.ts +14 -0
- package/out/src/storage/schema/tables/ProvenTx.d.ts.map +1 -0
- package/out/src/storage/schema/tables/ProvenTx.js +3 -0
- package/out/src/storage/schema/tables/ProvenTx.js.map +1 -0
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts +64 -0
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts.map +1 -0
- package/out/src/storage/schema/tables/ProvenTxReq.js +3 -0
- package/out/src/storage/schema/tables/ProvenTxReq.js.map +1 -0
- package/out/src/storage/schema/tables/Settings.d.ts +17 -0
- package/out/src/storage/schema/tables/Settings.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Settings.js +3 -0
- package/out/src/storage/schema/tables/Settings.js.map +1 -0
- package/out/src/storage/schema/tables/SyncState.d.ts +18 -0
- package/out/src/storage/schema/tables/SyncState.d.ts.map +1 -0
- package/out/src/storage/schema/tables/SyncState.js +3 -0
- package/out/src/storage/schema/tables/SyncState.js.map +1 -0
- package/out/src/storage/schema/tables/Transaction.d.ts +37 -0
- package/out/src/storage/schema/tables/Transaction.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Transaction.js +21 -0
- package/out/src/storage/schema/tables/Transaction.js.map +1 -0
- package/out/src/storage/schema/tables/TxLabel.d.ts +10 -0
- package/out/src/storage/schema/tables/TxLabel.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TxLabel.js +3 -0
- package/out/src/storage/schema/tables/TxLabel.js.map +1 -0
- package/out/src/storage/schema/tables/TxLabelMap.d.ts +9 -0
- package/out/src/storage/schema/tables/TxLabelMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TxLabelMap.js +3 -0
- package/out/src/storage/schema/tables/TxLabelMap.js.map +1 -0
- package/out/src/storage/schema/tables/User.d.ts +16 -0
- package/out/src/storage/schema/tables/User.d.ts.map +1 -0
- package/out/src/storage/schema/tables/User.js +3 -0
- package/out/src/storage/schema/tables/User.js.map +1 -0
- package/out/src/storage/schema/tables/index.d.ts +17 -0
- package/out/src/storage/schema/tables/index.d.ts.map +1 -0
- package/out/src/storage/schema/tables/index.js +33 -0
- package/out/src/storage/schema/tables/index.js.map +1 -0
- package/out/src/utility/ScriptTemplateSABPPP.d.ts +25 -0
- package/out/src/utility/ScriptTemplateSABPPP.d.ts.map +1 -0
- package/out/src/utility/ScriptTemplateSABPPP.js +46 -0
- package/out/src/utility/ScriptTemplateSABPPP.js.map +1 -0
- package/out/src/utility/index.client.d.ts +7 -0
- package/out/src/utility/index.client.d.ts.map +1 -0
- package/out/src/utility/index.client.js +23 -0
- package/out/src/utility/index.client.js.map +1 -0
- package/out/src/utility/parseTxScriptOffsets.d.ts +14 -0
- package/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -0
- package/out/src/utility/parseTxScriptOffsets.js +26 -0
- package/out/src/utility/parseTxScriptOffsets.js.map +1 -0
- package/out/src/utility/stampLog.d.ts +18 -0
- package/out/src/utility/stampLog.d.ts.map +1 -0
- package/out/src/utility/stampLog.js +72 -0
- package/out/src/utility/stampLog.js.map +1 -0
- package/out/src/utility/tscProofToMerklePath.d.ts +8 -0
- package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -0
- package/out/src/utility/tscProofToMerklePath.js +41 -0
- package/out/src/utility/tscProofToMerklePath.js.map +1 -0
- package/out/src/utility/utilityHelpers.d.ts +129 -0
- package/out/src/utility/utilityHelpers.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.js +268 -0
- package/out/src/utility/utilityHelpers.js.map +1 -0
- package/out/src/utility/utilityHelpers.noBuffer.d.ts +9 -0
- package/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.noBuffer.js +23 -0
- package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -0
- package/out/tsconfig.client.tsbuildinfo +1 -0
- package/package.json +27 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Certificate = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class Certificate extends _1.EntityBase {
|
|
7
|
+
constructor(api) {
|
|
8
|
+
const now = new Date();
|
|
9
|
+
super(api || {
|
|
10
|
+
certificateId: 0,
|
|
11
|
+
created_at: now,
|
|
12
|
+
updated_at: now,
|
|
13
|
+
userId: 0,
|
|
14
|
+
type: '',
|
|
15
|
+
subject: '',
|
|
16
|
+
verifier: undefined,
|
|
17
|
+
serialNumber: '',
|
|
18
|
+
certifier: '',
|
|
19
|
+
revocationOutpoint: '',
|
|
20
|
+
signature: '',
|
|
21
|
+
isDeleted: false
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
updateApi() {
|
|
25
|
+
/* nothing needed yet... */
|
|
26
|
+
}
|
|
27
|
+
get certificateId() {
|
|
28
|
+
return this.api.certificateId;
|
|
29
|
+
}
|
|
30
|
+
set certificateId(v) {
|
|
31
|
+
this.api.certificateId = v;
|
|
32
|
+
}
|
|
33
|
+
get created_at() {
|
|
34
|
+
return this.api.created_at;
|
|
35
|
+
}
|
|
36
|
+
set created_at(v) {
|
|
37
|
+
this.api.created_at = v;
|
|
38
|
+
}
|
|
39
|
+
get updated_at() {
|
|
40
|
+
return this.api.updated_at;
|
|
41
|
+
}
|
|
42
|
+
set updated_at(v) {
|
|
43
|
+
this.api.updated_at = v;
|
|
44
|
+
}
|
|
45
|
+
get userId() {
|
|
46
|
+
return this.api.userId;
|
|
47
|
+
}
|
|
48
|
+
set userId(v) {
|
|
49
|
+
this.api.userId = v;
|
|
50
|
+
}
|
|
51
|
+
get type() {
|
|
52
|
+
return this.api.type;
|
|
53
|
+
}
|
|
54
|
+
set type(v) {
|
|
55
|
+
this.api.type = v;
|
|
56
|
+
}
|
|
57
|
+
get subject() {
|
|
58
|
+
return this.api.subject;
|
|
59
|
+
}
|
|
60
|
+
set subject(v) {
|
|
61
|
+
this.api.subject = v;
|
|
62
|
+
}
|
|
63
|
+
get verifier() {
|
|
64
|
+
return this.api.verifier;
|
|
65
|
+
}
|
|
66
|
+
set verifier(v) {
|
|
67
|
+
this.api.verifier = v;
|
|
68
|
+
}
|
|
69
|
+
get serialNumber() {
|
|
70
|
+
return this.api.serialNumber;
|
|
71
|
+
}
|
|
72
|
+
set serialNumber(v) {
|
|
73
|
+
this.api.serialNumber = v;
|
|
74
|
+
}
|
|
75
|
+
get certifier() {
|
|
76
|
+
return this.api.certifier;
|
|
77
|
+
}
|
|
78
|
+
set certifier(v) {
|
|
79
|
+
this.api.certifier = v;
|
|
80
|
+
}
|
|
81
|
+
get revocationOutpoint() {
|
|
82
|
+
return this.api.revocationOutpoint;
|
|
83
|
+
}
|
|
84
|
+
set revocationOutpoint(v) {
|
|
85
|
+
this.api.revocationOutpoint = v;
|
|
86
|
+
}
|
|
87
|
+
get signature() {
|
|
88
|
+
return this.api.signature;
|
|
89
|
+
}
|
|
90
|
+
set signature(v) {
|
|
91
|
+
this.api.signature = v;
|
|
92
|
+
}
|
|
93
|
+
get isDeleted() {
|
|
94
|
+
return this.api.isDeleted;
|
|
95
|
+
}
|
|
96
|
+
set isDeleted(v) {
|
|
97
|
+
this.api.isDeleted = v;
|
|
98
|
+
}
|
|
99
|
+
//get fields() { return this.api.fields }
|
|
100
|
+
//set fields(v: Record<string, string> | undefined) { this.api.fields = v }
|
|
101
|
+
get id() {
|
|
102
|
+
return this.api.certificateId;
|
|
103
|
+
}
|
|
104
|
+
set id(v) {
|
|
105
|
+
this.api.certificateId = v;
|
|
106
|
+
}
|
|
107
|
+
get entityName() {
|
|
108
|
+
return 'entity.Certificate';
|
|
109
|
+
}
|
|
110
|
+
get entityTable() {
|
|
111
|
+
return 'certificates';
|
|
112
|
+
}
|
|
113
|
+
equals(ei, syncMap) {
|
|
114
|
+
if (this.type !== ei.type ||
|
|
115
|
+
this.subject !== ei.subject ||
|
|
116
|
+
this.serialNumber !== ei.serialNumber ||
|
|
117
|
+
this.revocationOutpoint !== ei.revocationOutpoint ||
|
|
118
|
+
this.signature !== ei.signature ||
|
|
119
|
+
this.verifier !== ei.verifier ||
|
|
120
|
+
this.isDeleted !== ei.isDeleted)
|
|
121
|
+
return false;
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
125
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findCertificates({
|
|
126
|
+
partial: {
|
|
127
|
+
serialNumber: ei.serialNumber,
|
|
128
|
+
certifier: ei.certifier,
|
|
129
|
+
userId
|
|
130
|
+
},
|
|
131
|
+
trx
|
|
132
|
+
}));
|
|
133
|
+
return {
|
|
134
|
+
found: !!ef,
|
|
135
|
+
eo: new index_client_1.entity.Certificate(ef || { ...ei }),
|
|
136
|
+
eiId: (0, index_client_1.verifyId)(ei.certificateId)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
140
|
+
this.userId = userId;
|
|
141
|
+
this.certificateId = 0;
|
|
142
|
+
this.certificateId = await storage.insertCertificate(this.toApi(), trx);
|
|
143
|
+
}
|
|
144
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
145
|
+
let wasMerged = false;
|
|
146
|
+
if (ei.updated_at > this.updated_at) {
|
|
147
|
+
this.type = ei.type;
|
|
148
|
+
this.subject = ei.subject;
|
|
149
|
+
this.serialNumber = ei.serialNumber;
|
|
150
|
+
this.revocationOutpoint = ei.revocationOutpoint;
|
|
151
|
+
this.signature = ei.signature;
|
|
152
|
+
this.verifier = ei.verifier;
|
|
153
|
+
this.isDeleted = ei.isDeleted;
|
|
154
|
+
this.updated_at = new Date();
|
|
155
|
+
await storage.updateCertificate(this.id, this.toApi(), trx);
|
|
156
|
+
wasMerged = true;
|
|
157
|
+
}
|
|
158
|
+
return wasMerged;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.Certificate = Certificate;
|
|
162
|
+
//# sourceMappingURL=Certificate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Certificate.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/Certificate.ts"],"names":[],"mappings":";;;AAEA,wDAO8B;AAC9B,wBAA8B;AAE9B,MAAa,WAAY,SAAQ,aAA6B;IAC5D,YAAY,GAAuB;QACjC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,KAAK,CACH,GAAG,IAAI;YACL,aAAa,EAAE,CAAC;YAChB,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,SA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AM,CAAA;QACpB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,IAAI,CAAC,aAAa,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;IACzE,CAAC;IAEQ,KAAK,CAAC,aAAa,CAC1B,OAA6B,EAC7B,KAAuB,EACvB,EAAqB,EACrB,OAAuB,EACvB,GAAkB;QAElB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;YACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,CAAA;YACzB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,CAAA;YACnC,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAAA;YAC/C,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAA;YAC7B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAA;YAC3B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAA;YAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAA;YAC5B,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;CACF;AA1LD,kCA0LC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { entity, sdk, table } from '../../../index.client';
|
|
2
|
+
import { EntityBase } from '.';
|
|
3
|
+
export declare class CertificateField extends EntityBase<table.CertificateField> {
|
|
4
|
+
constructor(api?: table.CertificateField);
|
|
5
|
+
updateApi(): void;
|
|
6
|
+
get userId(): number;
|
|
7
|
+
set userId(v: number);
|
|
8
|
+
get certificateId(): number;
|
|
9
|
+
set certificateId(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 fieldName(): string;
|
|
15
|
+
set fieldName(v: string);
|
|
16
|
+
get fieldValue(): string;
|
|
17
|
+
set fieldValue(v: string);
|
|
18
|
+
get masterKey(): string;
|
|
19
|
+
set masterKey(v: string);
|
|
20
|
+
get id(): number;
|
|
21
|
+
get entityName(): string;
|
|
22
|
+
get entityTable(): string;
|
|
23
|
+
equals(ei: table.CertificateField, syncMap?: entity.SyncMap | undefined): boolean;
|
|
24
|
+
static mergeFind(storage: entity.EntityStorage, userId: number, ei: table.CertificateField, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
25
|
+
found: boolean;
|
|
26
|
+
eo: entity.CertificateField;
|
|
27
|
+
eiId: number;
|
|
28
|
+
}>;
|
|
29
|
+
mergeNew(storage: entity.EntityStorage, userId: number, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
30
|
+
mergeExisting(storage: entity.EntityStorage, since: Date | undefined, ei: table.CertificateField, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=CertificateField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CertificateField.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/CertificateField.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,MAAM,EACN,GAAG,EACH,KAAK,EAGN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAA;AAE9B,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,KAAK,CAAC,gBAAgB,CAAC;gBAC1D,GAAG,CAAC,EAAE,KAAK,CAA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,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC;IAMD,aAAa,CAC1B,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,EAAE,EAAE,KAAK,CAAC,gBAAgB,EAC1B,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,OAAO,CAAC;CAgBpB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CertificateField = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class CertificateField extends _1.EntityBase {
|
|
7
|
+
constructor(api) {
|
|
8
|
+
const now = new Date();
|
|
9
|
+
super(api || {
|
|
10
|
+
created_at: now,
|
|
11
|
+
updated_at: now,
|
|
12
|
+
userId: 0,
|
|
13
|
+
certificateId: 0,
|
|
14
|
+
fieldName: '',
|
|
15
|
+
fieldValue: '',
|
|
16
|
+
masterKey: ''
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
updateApi() {
|
|
20
|
+
/* nothing needed yet... */
|
|
21
|
+
}
|
|
22
|
+
get userId() {
|
|
23
|
+
return this.api.userId;
|
|
24
|
+
}
|
|
25
|
+
set userId(v) {
|
|
26
|
+
this.api.userId = v;
|
|
27
|
+
}
|
|
28
|
+
get certificateId() {
|
|
29
|
+
return this.api.certificateId;
|
|
30
|
+
}
|
|
31
|
+
set certificateId(v) {
|
|
32
|
+
this.api.certificateId = v;
|
|
33
|
+
}
|
|
34
|
+
get created_at() {
|
|
35
|
+
return this.api.created_at;
|
|
36
|
+
}
|
|
37
|
+
set created_at(v) {
|
|
38
|
+
this.api.created_at = v;
|
|
39
|
+
}
|
|
40
|
+
get updated_at() {
|
|
41
|
+
return this.api.updated_at;
|
|
42
|
+
}
|
|
43
|
+
set updated_at(v) {
|
|
44
|
+
this.api.updated_at = v;
|
|
45
|
+
}
|
|
46
|
+
get fieldName() {
|
|
47
|
+
return this.api.fieldName;
|
|
48
|
+
}
|
|
49
|
+
set fieldName(v) {
|
|
50
|
+
this.api.fieldName = v;
|
|
51
|
+
}
|
|
52
|
+
get fieldValue() {
|
|
53
|
+
return this.api.fieldValue;
|
|
54
|
+
}
|
|
55
|
+
set fieldValue(v) {
|
|
56
|
+
this.api.fieldValue = v;
|
|
57
|
+
}
|
|
58
|
+
get masterKey() {
|
|
59
|
+
return this.api.masterKey;
|
|
60
|
+
}
|
|
61
|
+
set masterKey(v) {
|
|
62
|
+
this.api.masterKey = v;
|
|
63
|
+
}
|
|
64
|
+
get id() {
|
|
65
|
+
throw new index_client_1.sdk.WERR_INVALID_OPERATION('entity has no "id" value');
|
|
66
|
+
}
|
|
67
|
+
get entityName() {
|
|
68
|
+
return 'CertificateField';
|
|
69
|
+
}
|
|
70
|
+
get entityTable() {
|
|
71
|
+
return 'certificate_fields';
|
|
72
|
+
}
|
|
73
|
+
equals(ei, syncMap) {
|
|
74
|
+
if (this.certificateId !==
|
|
75
|
+
(syncMap
|
|
76
|
+
? syncMap.certificate.idMap[ei.certificateId]
|
|
77
|
+
: ei.certificateId) ||
|
|
78
|
+
this.fieldName !== ei.fieldName ||
|
|
79
|
+
this.fieldValue !== ei.fieldValue ||
|
|
80
|
+
this.masterKey !== ei.masterKey)
|
|
81
|
+
return false;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
85
|
+
const certificateId = syncMap.certificate.idMap[ei.certificateId];
|
|
86
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findCertificateFields({
|
|
87
|
+
partial: { certificateId, userId, fieldName: ei.fieldName },
|
|
88
|
+
trx
|
|
89
|
+
}));
|
|
90
|
+
return {
|
|
91
|
+
found: !!ef,
|
|
92
|
+
eo: new index_client_1.entity.CertificateField(ef || { ...ei }),
|
|
93
|
+
eiId: -1
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
97
|
+
this.certificateId = syncMap.certificate.idMap[this.certificateId];
|
|
98
|
+
this.userId = userId;
|
|
99
|
+
await storage.insertCertificateField(this.toApi(), trx);
|
|
100
|
+
}
|
|
101
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
102
|
+
let wasMerged = false;
|
|
103
|
+
if (ei.updated_at > this.updated_at) {
|
|
104
|
+
this.fieldValue = ei.fieldValue;
|
|
105
|
+
this.masterKey = ei.masterKey;
|
|
106
|
+
this.updated_at = new Date();
|
|
107
|
+
await storage.updateCertificateField(this.certificateId, this.fieldName, this.toApi(), trx);
|
|
108
|
+
wasMerged = true;
|
|
109
|
+
}
|
|
110
|
+
return wasMerged;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.CertificateField = CertificateField;
|
|
114
|
+
//# sourceMappingURL=CertificateField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CertificateField.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/CertificateField.ts"],"names":[],"mappings":";;;AACA,wDAO8B;AAC9B,wBAA8B;AAE9B,MAAa,gBAAiB,SAAQ,aAAkC;IACtE,YAAY,GAA4B;QACtC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,KAAK,CACH,GAAG,IAAI;YACL,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,CAAC;YACT,aAAa,EAAE,CAAC;YAChB,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;SACd,CACF,CAAA;IACH,CAAC;IAEQ,SAAS;QAChB,2BAA2B;IAC7B,CAAC;IAED,I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uB,EACvB,GAAkB;QAElB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAClE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,MAAM,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;IACzD,CAAC;IAEQ,KAAK,CAAC,aAAa,CAC1B,OAA6B,EAC7B,KAAuB,EACvB,EAA0B,EAC1B,OAAuB,EACvB,GAAkB;QAElB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAA;YAC/B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAA;YAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAA;YAC5B,MAAM,OAAO,CAAC,sBAAsB,CAClC,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,KAAK,EAAE,EACZ,GAAG,CACJ,CAAA;YACD,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AAjJD,4CAiJC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { entity, sdk, table } from '../../../index.client';
|
|
2
|
+
import { EntityBase } from '.';
|
|
3
|
+
export declare class Commission extends EntityBase<table.Commission> {
|
|
4
|
+
constructor(api?: table.Commission);
|
|
5
|
+
updateApi(): void;
|
|
6
|
+
get commissionId(): number;
|
|
7
|
+
set commissionId(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 transactionId(): number;
|
|
13
|
+
set transactionId(v: number);
|
|
14
|
+
get userId(): number;
|
|
15
|
+
set userId(v: number);
|
|
16
|
+
get isRedeemed(): boolean;
|
|
17
|
+
set isRedeemed(v: boolean);
|
|
18
|
+
get keyOffset(): string;
|
|
19
|
+
set keyOffset(v: string);
|
|
20
|
+
get lockingScript(): number[];
|
|
21
|
+
set lockingScript(v: number[]);
|
|
22
|
+
get satoshis(): number;
|
|
23
|
+
set satoshis(v: number);
|
|
24
|
+
get id(): number;
|
|
25
|
+
set id(v: number);
|
|
26
|
+
get entityName(): string;
|
|
27
|
+
get entityTable(): string;
|
|
28
|
+
equals(ei: table.Commission, syncMap?: entity.SyncMap | undefined): boolean;
|
|
29
|
+
static mergeFind(storage: entity.EntityStorage, userId: number, ei: table.Commission, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<{
|
|
30
|
+
found: boolean;
|
|
31
|
+
eo: entity.Commission;
|
|
32
|
+
eiId: number;
|
|
33
|
+
}>;
|
|
34
|
+
mergeNew(storage: entity.EntityStorage, userId: number, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
35
|
+
mergeExisting(storage: entity.EntityStorage, since: Date | undefined, ei: table.Commission, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=Commission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Commission.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/Commission.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,MAAM,EACN,GAAG,EACH,KAAK,EAGN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAA;AAE9B,qBAAa,UAAW,SAAQ,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC;gBAC9C,GAAG,CAAC,EAAE,KAAK,CAAC,UAAU;IAiBzB,SAAS,IAAI,IAAI;IAI1B,IAAI,YAAY,IAGI,MAAM,CADzB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AAC,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAYpD,QAAQ,CACrB,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC;IAQD,aAAa,CAC1B,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,KAAK,EAAE,IAAI,GAAG,SAAS,EACvB,EAAE,EAAE,KAAK,CAAC,UAAU,EACpB,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,OAAO,CAAC;CAUpB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Commission = void 0;
|
|
4
|
+
const index_client_1 = require("../../../index.client");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
class Commission extends _1.EntityBase {
|
|
7
|
+
constructor(api) {
|
|
8
|
+
const now = new Date();
|
|
9
|
+
super(api || {
|
|
10
|
+
commissionId: 0,
|
|
11
|
+
created_at: now,
|
|
12
|
+
updated_at: now,
|
|
13
|
+
transactionId: 0,
|
|
14
|
+
userId: 0,
|
|
15
|
+
isRedeemed: false,
|
|
16
|
+
keyOffset: '',
|
|
17
|
+
lockingScript: [],
|
|
18
|
+
satoshis: 0
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
updateApi() {
|
|
22
|
+
/* nothing needed yet... */
|
|
23
|
+
}
|
|
24
|
+
get commissionId() {
|
|
25
|
+
return this.api.commissionId;
|
|
26
|
+
}
|
|
27
|
+
set commissionId(v) {
|
|
28
|
+
this.api.commissionId = v;
|
|
29
|
+
}
|
|
30
|
+
get created_at() {
|
|
31
|
+
return this.api.created_at;
|
|
32
|
+
}
|
|
33
|
+
set created_at(v) {
|
|
34
|
+
this.api.created_at = v;
|
|
35
|
+
}
|
|
36
|
+
get updated_at() {
|
|
37
|
+
return this.api.updated_at;
|
|
38
|
+
}
|
|
39
|
+
set updated_at(v) {
|
|
40
|
+
this.api.updated_at = v;
|
|
41
|
+
}
|
|
42
|
+
get transactionId() {
|
|
43
|
+
return this.api.transactionId;
|
|
44
|
+
}
|
|
45
|
+
set transactionId(v) {
|
|
46
|
+
this.api.transactionId = v;
|
|
47
|
+
}
|
|
48
|
+
get userId() {
|
|
49
|
+
return this.api.userId;
|
|
50
|
+
}
|
|
51
|
+
set userId(v) {
|
|
52
|
+
this.api.userId = v;
|
|
53
|
+
}
|
|
54
|
+
get isRedeemed() {
|
|
55
|
+
return this.api.isRedeemed;
|
|
56
|
+
}
|
|
57
|
+
set isRedeemed(v) {
|
|
58
|
+
this.api.isRedeemed = v;
|
|
59
|
+
}
|
|
60
|
+
get keyOffset() {
|
|
61
|
+
return this.api.keyOffset;
|
|
62
|
+
}
|
|
63
|
+
set keyOffset(v) {
|
|
64
|
+
this.api.keyOffset = v;
|
|
65
|
+
}
|
|
66
|
+
get lockingScript() {
|
|
67
|
+
return this.api.lockingScript;
|
|
68
|
+
}
|
|
69
|
+
set lockingScript(v) {
|
|
70
|
+
this.api.lockingScript = v;
|
|
71
|
+
}
|
|
72
|
+
get satoshis() {
|
|
73
|
+
return this.api.satoshis;
|
|
74
|
+
}
|
|
75
|
+
set satoshis(v) {
|
|
76
|
+
this.api.satoshis = v;
|
|
77
|
+
}
|
|
78
|
+
get id() {
|
|
79
|
+
return this.api.commissionId;
|
|
80
|
+
}
|
|
81
|
+
set id(v) {
|
|
82
|
+
this.api.commissionId = v;
|
|
83
|
+
}
|
|
84
|
+
get entityName() {
|
|
85
|
+
return 'Commission';
|
|
86
|
+
}
|
|
87
|
+
get entityTable() {
|
|
88
|
+
return 'commissions';
|
|
89
|
+
}
|
|
90
|
+
equals(ei, syncMap) {
|
|
91
|
+
if (this.isRedeemed !== ei.isRedeemed ||
|
|
92
|
+
this.transactionId !==
|
|
93
|
+
(syncMap
|
|
94
|
+
? syncMap.transaction.idMap[ei.transactionId]
|
|
95
|
+
: ei.transactionId) ||
|
|
96
|
+
this.keyOffset !== ei.keyOffset ||
|
|
97
|
+
!(0, index_client_1.arraysEqual)(this.lockingScript, ei.lockingScript) ||
|
|
98
|
+
this.satoshis !== ei.satoshis)
|
|
99
|
+
return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
static async mergeFind(storage, userId, ei, syncMap, trx) {
|
|
103
|
+
const transactionId = syncMap.transaction.idMap[ei.transactionId];
|
|
104
|
+
const ef = (0, index_client_1.verifyOneOrNone)(await storage.findCommissions({ partial: { transactionId, userId }, trx }));
|
|
105
|
+
return {
|
|
106
|
+
found: !!ef,
|
|
107
|
+
eo: new index_client_1.entity.Commission(ef || { ...ei }),
|
|
108
|
+
eiId: (0, index_client_1.verifyId)(ei.commissionId)
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
async mergeNew(storage, userId, syncMap, trx) {
|
|
112
|
+
if (this.transactionId)
|
|
113
|
+
this.transactionId = syncMap.transaction.idMap[this.transactionId];
|
|
114
|
+
this.userId = userId;
|
|
115
|
+
this.commissionId = 0;
|
|
116
|
+
this.commissionId = await storage.insertCommission(this.toApi(), trx);
|
|
117
|
+
}
|
|
118
|
+
async mergeExisting(storage, since, ei, syncMap, trx) {
|
|
119
|
+
let wasMerged = false;
|
|
120
|
+
if (ei.updated_at > this.updated_at) {
|
|
121
|
+
this.isRedeemed = ei.isRedeemed;
|
|
122
|
+
this.updated_at = new Date();
|
|
123
|
+
await storage.updateCommission(this.id, this.toApi(), trx);
|
|
124
|
+
wasMerged = true;
|
|
125
|
+
}
|
|
126
|
+
return wasMerged;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.Commission = Commission;
|
|
130
|
+
//# sourceMappingURL=Commission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Commission.js","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/Commission.ts"],"names":[],"mappings":";;;AAEA,wDAO8B;AAC9B,wBAA8B;AAE9B,MAAa,UAAW,SAAQ,aAA4B;IAC1D,YAAY,GAAsB;QAChC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,KAAK,CACH,GAAG,IAAI;YACL,YAAY,EAAE,CAAC;YACf,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,aAAa,EAAE,CAAC;YAChB,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,EAAE;YACb,aAAa,EAAE,EAAE;YACjB,QAAQ,EAAE,CAAC;SACZ,CACF,CAAA;IACH,CAAC;IAEQ,SAAS;QAChB,2BAA2B;IAC7B,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAA;IAC9B,CAAC;IACD,IAAI,YAAY,CAAC,CAAS;QACxB,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,CAAA;IAC3B,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,aAAa;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAA;IAC/B,CAAC;IACD,IAAI,aAAa,CAAC,CAAS;QACzB,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,CAAA;IAC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M,CAAA;QACpB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;IACvE,CAAC;IAEQ,KAAK,CAAC,aAAa,CAC1B,OAA6B,EAC7B,KAAuB,EACvB,EAAoB,EACpB,OAAuB,EACvB,GAAkB;QAElB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAA;YAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAA;YAC5B,MAAM,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAA;YAC1D,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AA5JD,gCA4JC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { sdk, StorageProvider } from '../../../index.client';
|
|
2
|
+
export type EntityStorage = StorageProvider;
|
|
3
|
+
export declare abstract class EntityBase<T> {
|
|
4
|
+
api: T;
|
|
5
|
+
constructor(api: T);
|
|
6
|
+
/**
|
|
7
|
+
* Standard property for entity database Id
|
|
8
|
+
*/
|
|
9
|
+
abstract get id(): number;
|
|
10
|
+
/**
|
|
11
|
+
* Name of derived entity class
|
|
12
|
+
*/
|
|
13
|
+
abstract get entityName(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Schema table name of entity
|
|
16
|
+
*/
|
|
17
|
+
abstract get entityTable(): string;
|
|
18
|
+
/**
|
|
19
|
+
* On construction, an entity may decode properties of the `api` object,
|
|
20
|
+
* such as JSON stringified objects.
|
|
21
|
+
*
|
|
22
|
+
* The `updateApi` method must re-encode the current state of those decoded properties
|
|
23
|
+
* into the `api` object.
|
|
24
|
+
*
|
|
25
|
+
* Used by the `toApi` method to return an updated `api` object.
|
|
26
|
+
*/
|
|
27
|
+
abstract updateApi(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Tests for equality or 'merge' / 'convergent' equality if syncMap is provided.
|
|
30
|
+
*
|
|
31
|
+
* 'convergent' equality must satisfy (A sync B) equals (B sync A)
|
|
32
|
+
*
|
|
33
|
+
* @param ei
|
|
34
|
+
* @param syncMap
|
|
35
|
+
*/
|
|
36
|
+
abstract equals(ei: T, syncMap?: SyncMap): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Perform a 'merge' / 'convergent' equality migration of state
|
|
39
|
+
* to this new local entity which was constructed
|
|
40
|
+
* as a copy of the external object.
|
|
41
|
+
*
|
|
42
|
+
* @param userId local userId
|
|
43
|
+
* @param syncMap
|
|
44
|
+
*/
|
|
45
|
+
abstract mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Perform a 'merge' / 'convergent' equality migration of state
|
|
48
|
+
* from external `ei` to this existing local entity.
|
|
49
|
+
*
|
|
50
|
+
* @param ei
|
|
51
|
+
* @param syncMap
|
|
52
|
+
* @returns true iff entity state changed and was updated to storage
|
|
53
|
+
*/
|
|
54
|
+
abstract mergeExisting(storage: EntityStorage, since: Date | undefined, ei: T, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* An entity may decode properties of the underlying Api object on construction.
|
|
57
|
+
*
|
|
58
|
+
* The `toApi` method forces an `updateApi` before returning the underlying,
|
|
59
|
+
* now updated, Api object.
|
|
60
|
+
*
|
|
61
|
+
* @returns The underlying Api object with any entity decoded properties updated.
|
|
62
|
+
*/
|
|
63
|
+
toApi(): T;
|
|
64
|
+
}
|
|
65
|
+
export interface EntitySyncMap {
|
|
66
|
+
entityName: string;
|
|
67
|
+
/**
|
|
68
|
+
* Maps foreign ids to local ids
|
|
69
|
+
* Some entities don't have idMaps (CertificateField, TxLabelMap and OutputTagMap)
|
|
70
|
+
*/
|
|
71
|
+
idMap: Record<number, number>;
|
|
72
|
+
/**
|
|
73
|
+
* the maximum updated_at value seen for this entity over chunks received
|
|
74
|
+
* during this udpate cycle.
|
|
75
|
+
*/
|
|
76
|
+
maxUpdated_at?: Date;
|
|
77
|
+
/**
|
|
78
|
+
* The cummulative count of items of this entity type received over all the `SyncChunk`s
|
|
79
|
+
* since the `since` was last updated.
|
|
80
|
+
*
|
|
81
|
+
* This is the `offset` value to use for the next SyncChunk request.
|
|
82
|
+
*/
|
|
83
|
+
count: number;
|
|
84
|
+
}
|
|
85
|
+
export interface SyncMap {
|
|
86
|
+
provenTx: EntitySyncMap;
|
|
87
|
+
outputBasket: EntitySyncMap;
|
|
88
|
+
transaction: EntitySyncMap;
|
|
89
|
+
provenTxReq: EntitySyncMap;
|
|
90
|
+
txLabel: EntitySyncMap;
|
|
91
|
+
txLabelMap: EntitySyncMap;
|
|
92
|
+
output: EntitySyncMap;
|
|
93
|
+
outputTag: EntitySyncMap;
|
|
94
|
+
outputTagMap: EntitySyncMap;
|
|
95
|
+
certificate: EntitySyncMap;
|
|
96
|
+
certificateField: EntitySyncMap;
|
|
97
|
+
commission: EntitySyncMap;
|
|
98
|
+
}
|
|
99
|
+
export declare function createSyncMap(): SyncMap;
|
|
100
|
+
export interface SyncError {
|
|
101
|
+
code: string;
|
|
102
|
+
description: string;
|
|
103
|
+
stack?: string;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=EntityBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityBase.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/EntityBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,MAAM,aAAa,GAA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