@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,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If a log is being kept, add a time stamped line.
|
|
3
|
+
* @param log Optional time stamped log to extend, or an object with a log property to update
|
|
4
|
+
* @param lineToAdd Content to add to line.
|
|
5
|
+
* @returns undefined or log extended by time stamped `lineToAdd` and new line.
|
|
6
|
+
*/
|
|
7
|
+
export declare function stampLog(log: string | undefined | {
|
|
8
|
+
log?: string;
|
|
9
|
+
}, lineToAdd: string): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Replaces individual timestamps with delta msecs.
|
|
12
|
+
* Looks for two network crossings and adjusts clock for clock skew if found.
|
|
13
|
+
* Assumes log built by repeated calls to `stampLog`
|
|
14
|
+
* @param log Each logged event starts with ISO time stamp, space, rest of line, terminated by `\n`.
|
|
15
|
+
* @returns reformated multi-line event log
|
|
16
|
+
*/
|
|
17
|
+
export declare function stampLogFormat(log?: string): string;
|
|
18
|
+
//# sourceMappingURL=stampLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stampLog.d.ts","sourceRoot":"","sources":["../../../../src/utility/stampLog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK1G;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAgDnD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stampLog = stampLog;
|
|
4
|
+
exports.stampLogFormat = stampLogFormat;
|
|
5
|
+
/**
|
|
6
|
+
* If a log is being kept, add a time stamped line.
|
|
7
|
+
* @param log Optional time stamped log to extend, or an object with a log property to update
|
|
8
|
+
* @param lineToAdd Content to add to line.
|
|
9
|
+
* @returns undefined or log extended by time stamped `lineToAdd` and new line.
|
|
10
|
+
*/
|
|
11
|
+
function stampLog(log, lineToAdd) {
|
|
12
|
+
const add = `${new Date().toISOString()} ${lineToAdd}\n`;
|
|
13
|
+
if (typeof log === 'object' && typeof log.log === 'string')
|
|
14
|
+
return (log.log = log.log + add);
|
|
15
|
+
if (typeof log === 'string')
|
|
16
|
+
return log + add;
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Replaces individual timestamps with delta msecs.
|
|
21
|
+
* Looks for two network crossings and adjusts clock for clock skew if found.
|
|
22
|
+
* Assumes log built by repeated calls to `stampLog`
|
|
23
|
+
* @param log Each logged event starts with ISO time stamp, space, rest of line, terminated by `\n`.
|
|
24
|
+
* @returns reformated multi-line event log
|
|
25
|
+
*/
|
|
26
|
+
function stampLogFormat(log) {
|
|
27
|
+
if (typeof log !== 'string')
|
|
28
|
+
return '';
|
|
29
|
+
const logLines = log.split('\n');
|
|
30
|
+
const data = [];
|
|
31
|
+
let last = 0;
|
|
32
|
+
const newClocks = [];
|
|
33
|
+
for (const line of logLines) {
|
|
34
|
+
const spaceAt = line.indexOf(' ');
|
|
35
|
+
if (spaceAt > -1) {
|
|
36
|
+
const when = new Date(line.substring(0, spaceAt)).getTime();
|
|
37
|
+
const rest = line.substring(spaceAt + 1);
|
|
38
|
+
const delta = when - (last || when);
|
|
39
|
+
const newClock = rest.indexOf('**NETWORK**') > -1;
|
|
40
|
+
if (newClock)
|
|
41
|
+
newClocks.push(data.length);
|
|
42
|
+
data.push({ when, rest, delta, newClock });
|
|
43
|
+
last = when;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const total = data[data.length - 1].when - data[0].when;
|
|
47
|
+
if (newClocks.length % 2 === 0) {
|
|
48
|
+
// Adjust for paired network crossing times and clock skew between clocks.
|
|
49
|
+
let network = total;
|
|
50
|
+
let lastNewClock = 0;
|
|
51
|
+
for (const newClock of newClocks) {
|
|
52
|
+
network -= data[newClock - 1].when - data[lastNewClock].when;
|
|
53
|
+
lastNewClock = newClock;
|
|
54
|
+
}
|
|
55
|
+
network -= data[data.length - 1].when - data[lastNewClock].when;
|
|
56
|
+
let networks = newClocks.length;
|
|
57
|
+
for (const newClock of newClocks) {
|
|
58
|
+
const n = networks > 1 ? Math.floor(network / networks) : network;
|
|
59
|
+
data[newClock].delta = n;
|
|
60
|
+
network -= n;
|
|
61
|
+
networks--;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
let log2 = `${new Date(data[0].when).toISOString()} Total = ${total} msecs\n`;
|
|
65
|
+
for (const d of data) {
|
|
66
|
+
let df = d.delta.toString();
|
|
67
|
+
df = `${' '.repeat(8 - df.length)}${df}`;
|
|
68
|
+
log2 += `${df} ${d.rest}\n`;
|
|
69
|
+
}
|
|
70
|
+
return log2;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=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AAO,CAAA;YACjE,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,CAAC,CAAA;YACxB,OAAO,IAAI,CAAC,CAAA;YACZ,QAAQ,EAAE,CAAA;QACZ,CAAC;IACH,CAAC;IACD,IAAI,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,YAAY,KAAK,UAAU,CAAA;IAC7E,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;QAC3B,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAA;QACxC,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,IAAI,CAAA;IAC7B,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MerklePath } from '@bsv/sdk';
|
|
2
|
+
export interface TscMerkleProofApi {
|
|
3
|
+
height: number;
|
|
4
|
+
index: number;
|
|
5
|
+
nodes: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function convertProofToMerklePath(txid: string, proof: TscMerkleProofApi): MerklePath;
|
|
8
|
+
//# sourceMappingURL=tscProofToMerklePath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tscProofToMerklePath.d.ts","sourceRoot":"","sources":["../../../../src/utility/tscProofToMerklePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAuC3F"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertProofToMerklePath = convertProofToMerklePath;
|
|
4
|
+
const sdk_1 = require("@bsv/sdk");
|
|
5
|
+
function convertProofToMerklePath(txid, proof) {
|
|
6
|
+
const blockHeight = proof.height;
|
|
7
|
+
const treeHeight = proof.nodes.length;
|
|
8
|
+
const path = Array(treeHeight)
|
|
9
|
+
.fill(0)
|
|
10
|
+
.map(() => []);
|
|
11
|
+
let index = proof.index;
|
|
12
|
+
for (let level = 0; level < treeHeight; level++) {
|
|
13
|
+
const node = proof.nodes[level];
|
|
14
|
+
const isOdd = index % 2 === 1;
|
|
15
|
+
const offset = isOdd ? index - 1 : index + 1;
|
|
16
|
+
const leaf = { offset };
|
|
17
|
+
if (node === '*' || (level === 0 && node === txid)) {
|
|
18
|
+
leaf.duplicate = true;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
leaf.hash = node;
|
|
22
|
+
}
|
|
23
|
+
path[level].push(leaf);
|
|
24
|
+
if (level === 0) {
|
|
25
|
+
const txidLeaf = {
|
|
26
|
+
offset: proof.index,
|
|
27
|
+
hash: txid,
|
|
28
|
+
txid: true
|
|
29
|
+
};
|
|
30
|
+
if (isOdd) {
|
|
31
|
+
path[0].push(txidLeaf);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
path[0].unshift(txidLeaf);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
index = index >> 1;
|
|
38
|
+
}
|
|
39
|
+
return new sdk_1.MerklePath(blockHeight, path);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=tscProofToMerklePath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tscProofToMerklePath.js","sourceRoot":"","sources":["../../../../src/utility/tscProofToMerkl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AAK,EAAE,CAAC;gBACV,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACxB,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YAC3B,CAAC;QACH,CAAC;QACD,KAAK,GAAG,KAAK,IAAI,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,IAAI,gBAAU,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { HexString, PubKeyHex, WalletNetwork } from '@bsv/sdk';
|
|
2
|
+
import { Beef, PrivateKey, PublicKey, Script, Transaction } from '@bsv/sdk';
|
|
3
|
+
import { Chain } from '../sdk/types';
|
|
4
|
+
import { CertOpsWallet } from '../sdk';
|
|
5
|
+
export declare function getIdentityKey(wallet: CertOpsWallet): Promise<PubKeyHex>;
|
|
6
|
+
export declare function toWalletNetwork(chain: Chain): WalletNetwork;
|
|
7
|
+
export declare function makeAtomicBeef(tx: Transaction, beef: number[] | Beef): number[];
|
|
8
|
+
/**
|
|
9
|
+
* Coerce a bsv transaction encoded as a hex string, serialized array, or Transaction to Transaction
|
|
10
|
+
* If tx is already a Transaction, just return it.
|
|
11
|
+
* @publicbody
|
|
12
|
+
*/
|
|
13
|
+
export declare function asBsvSdkTx(tx: HexString | number[] | Transaction): Transaction;
|
|
14
|
+
/**
|
|
15
|
+
* Coerce a bsv script encoded as a hex string, serialized array, or Script to Script
|
|
16
|
+
* If script is already a Script, just return it.
|
|
17
|
+
* @publicbody
|
|
18
|
+
*/
|
|
19
|
+
export declare function asBsvSdkScript(script: HexString | number[] | Script): Script;
|
|
20
|
+
/**
|
|
21
|
+
* @param privKey bitcoin private key in 32 byte hex string form
|
|
22
|
+
* @returns @bsv/sdk PrivateKey
|
|
23
|
+
*/
|
|
24
|
+
export declare function asBsvSdkPrivateKey(privKey: string): PrivateKey;
|
|
25
|
+
/**
|
|
26
|
+
* @param pubKey bitcoin public key in standard compressed key hex string form
|
|
27
|
+
* @returns @bsv/sdk PublicKey
|
|
28
|
+
*/
|
|
29
|
+
export declare function asBsvSdkPublickKey(pubKey: string): PublicKey;
|
|
30
|
+
/**
|
|
31
|
+
* Helper function.
|
|
32
|
+
*
|
|
33
|
+
* Verifies that a possibly optional value has a value.
|
|
34
|
+
*/
|
|
35
|
+
export declare function verifyTruthy<T>(v: T | null | undefined, description?: string): T;
|
|
36
|
+
/**
|
|
37
|
+
* Helper function.
|
|
38
|
+
*
|
|
39
|
+
* Verifies that a hex string is trimmed and lower case.
|
|
40
|
+
*/
|
|
41
|
+
export declare function verifyHexString(v: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Helper function.
|
|
44
|
+
*
|
|
45
|
+
* Verifies that an optional or null hex string is undefined or a trimmed lowercase string.
|
|
46
|
+
*/
|
|
47
|
+
export declare function verifyOptionalHexString(v?: string | null): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Helper function.
|
|
50
|
+
*
|
|
51
|
+
* Verifies that an optional or null number has a numeric value.
|
|
52
|
+
*/
|
|
53
|
+
export declare function verifyNumber(v: number | null | undefined): number;
|
|
54
|
+
/**
|
|
55
|
+
* Helper function.
|
|
56
|
+
*
|
|
57
|
+
* Verifies that an optional or null number has a numeric value.
|
|
58
|
+
*/
|
|
59
|
+
export declare function verifyInteger(v: number | null | undefined): number;
|
|
60
|
+
/**
|
|
61
|
+
* Helper function.
|
|
62
|
+
*
|
|
63
|
+
* Verifies that a database record identifier is an integer greater than zero.
|
|
64
|
+
*/
|
|
65
|
+
export declare function verifyId(id: number | undefined | null): number;
|
|
66
|
+
/**
|
|
67
|
+
* Helper function.
|
|
68
|
+
*
|
|
69
|
+
* @throws WERR_BAD_REQUEST if results has length greater than one.
|
|
70
|
+
*
|
|
71
|
+
* @returns results[0] or undefined if length is zero.
|
|
72
|
+
*/
|
|
73
|
+
export declare function verifyOneOrNone<T>(results: T[]): T | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Helper function.
|
|
76
|
+
*
|
|
77
|
+
* @throws WERR_BAD_REQUEST if results has length other than one.
|
|
78
|
+
*
|
|
79
|
+
* @returns results[0].
|
|
80
|
+
*/
|
|
81
|
+
export declare function verifyOne<T>(results: T[], errorDescrition?: string): T;
|
|
82
|
+
/**
|
|
83
|
+
* Returns an await'able Promise that resolves in the given number of msecs.
|
|
84
|
+
* @publicbody
|
|
85
|
+
*/
|
|
86
|
+
export declare function wait(msecs: number): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* @returns count cryptographically secure random bytes as array of bytes
|
|
89
|
+
*/
|
|
90
|
+
export declare function randomBytes(count: number): number[];
|
|
91
|
+
/**
|
|
92
|
+
* @returns count cryptographically secure random bytes as hex encoded string
|
|
93
|
+
*/
|
|
94
|
+
export declare function randomBytesHex(count: number): string;
|
|
95
|
+
/**
|
|
96
|
+
* @returns count cryptographically secure random bytes as base64 encoded string
|
|
97
|
+
*/
|
|
98
|
+
export declare function randomBytesBase64(count: number): string;
|
|
99
|
+
export declare function validateSecondsSinceEpoch(time: number): Date;
|
|
100
|
+
/**
|
|
101
|
+
* Compares lengths and direct equality of values.
|
|
102
|
+
* @param arr1
|
|
103
|
+
* @param arr2
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
export declare function arraysEqual(arr1: Number[], arr2: Number[]): boolean;
|
|
107
|
+
export declare function optionalArraysEqual(arr1?: Number[], arr2?: Number[]): boolean;
|
|
108
|
+
export declare function maxDate(d1?: Date, d2?: Date): Date | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Calculate the SHA256 hash of an array of bytes
|
|
111
|
+
* @returns sha256 hash of buffer contents.
|
|
112
|
+
* @publicbody
|
|
113
|
+
*/
|
|
114
|
+
export declare function sha256Hash(data: number[]): number[];
|
|
115
|
+
/**
|
|
116
|
+
* Calculate the SHA256 hash of the SHA256 hash of an array of bytes.
|
|
117
|
+
* @param data an array of bytes
|
|
118
|
+
* @returns double sha256 hash of data, byte 0 of hash first.
|
|
119
|
+
* @publicbody
|
|
120
|
+
*/
|
|
121
|
+
export declare function doubleSha256HashLE(data: number[]): number[];
|
|
122
|
+
/**
|
|
123
|
+
* Calculate the SHA256 hash of the SHA256 hash of an array of bytes.
|
|
124
|
+
* @param data is an array of bytes.
|
|
125
|
+
* @returns reversed (big-endian) double sha256 hash of data, byte 31 of hash first.
|
|
126
|
+
* @publicbody
|
|
127
|
+
*/
|
|
128
|
+
export declare function doubleSha256BE(data: number[]): number[];
|
|
129
|
+
//# sourceMappingURL=utilityHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilityHelpers.d.ts","sourceRoot":"","sources":["../../../../src/utility/utilityHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAmB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAE,IAAI,EAAQ,UAAU,EAAE,SAAS,EAAU,MAAM,EAAE,WAAW,EAAS,MAAM,UAAU,CAAA;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,wBAAsB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAE9E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAE3D;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,EAAE,CAI/E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,WAAW,GAAG,WAAW,CAO9E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,MAAM,GAA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H,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAM5D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAMzD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,WAInE;AAED,wBAAgB,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAQ9D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAGnD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAI3D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEvD"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIdentityKey = getIdentityKey;
|
|
4
|
+
exports.toWalletNetwork = toWalletNetwork;
|
|
5
|
+
exports.makeAtomicBeef = makeAtomicBeef;
|
|
6
|
+
exports.asBsvSdkTx = asBsvSdkTx;
|
|
7
|
+
exports.asBsvSdkScript = asBsvSdkScript;
|
|
8
|
+
exports.asBsvSdkPrivateKey = asBsvSdkPrivateKey;
|
|
9
|
+
exports.asBsvSdkPublickKey = asBsvSdkPublickKey;
|
|
10
|
+
exports.verifyTruthy = verifyTruthy;
|
|
11
|
+
exports.verifyHexString = verifyHexString;
|
|
12
|
+
exports.verifyOptionalHexString = verifyOptionalHexString;
|
|
13
|
+
exports.verifyNumber = verifyNumber;
|
|
14
|
+
exports.verifyInteger = verifyInteger;
|
|
15
|
+
exports.verifyId = verifyId;
|
|
16
|
+
exports.verifyOneOrNone = verifyOneOrNone;
|
|
17
|
+
exports.verifyOne = verifyOne;
|
|
18
|
+
exports.wait = wait;
|
|
19
|
+
exports.randomBytes = randomBytes;
|
|
20
|
+
exports.randomBytesHex = randomBytesHex;
|
|
21
|
+
exports.randomBytesBase64 = randomBytesBase64;
|
|
22
|
+
exports.validateSecondsSinceEpoch = validateSecondsSinceEpoch;
|
|
23
|
+
exports.arraysEqual = arraysEqual;
|
|
24
|
+
exports.optionalArraysEqual = optionalArraysEqual;
|
|
25
|
+
exports.maxDate = maxDate;
|
|
26
|
+
exports.sha256Hash = sha256Hash;
|
|
27
|
+
exports.doubleSha256HashLE = doubleSha256HashLE;
|
|
28
|
+
exports.doubleSha256BE = doubleSha256BE;
|
|
29
|
+
const sdk_1 = require("@bsv/sdk");
|
|
30
|
+
const index_client_1 = require("../index.client");
|
|
31
|
+
async function getIdentityKey(wallet) {
|
|
32
|
+
return (await wallet.getPublicKey({ identityKey: true })).publicKey;
|
|
33
|
+
}
|
|
34
|
+
function toWalletNetwork(chain) {
|
|
35
|
+
return chain === 'main' ? 'mainnet' : 'testnet';
|
|
36
|
+
}
|
|
37
|
+
function makeAtomicBeef(tx, beef) {
|
|
38
|
+
if (Array.isArray(beef))
|
|
39
|
+
beef = sdk_1.Beef.fromBinary(beef);
|
|
40
|
+
beef.mergeTransaction(tx);
|
|
41
|
+
return beef.toBinaryAtomic(tx.id('hex'));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Coerce a bsv transaction encoded as a hex string, serialized array, or Transaction to Transaction
|
|
45
|
+
* If tx is already a Transaction, just return it.
|
|
46
|
+
* @publicbody
|
|
47
|
+
*/
|
|
48
|
+
function asBsvSdkTx(tx) {
|
|
49
|
+
if (Array.isArray(tx)) {
|
|
50
|
+
tx = sdk_1.Transaction.fromBinary(tx);
|
|
51
|
+
}
|
|
52
|
+
else if (typeof tx === 'string') {
|
|
53
|
+
tx = sdk_1.Transaction.fromHex(tx);
|
|
54
|
+
}
|
|
55
|
+
return tx;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Coerce a bsv script encoded as a hex string, serialized array, or Script to Script
|
|
59
|
+
* If script is already a Script, just return it.
|
|
60
|
+
* @publicbody
|
|
61
|
+
*/
|
|
62
|
+
function asBsvSdkScript(script) {
|
|
63
|
+
if (Array.isArray(script)) {
|
|
64
|
+
script = sdk_1.Script.fromBinary(script);
|
|
65
|
+
}
|
|
66
|
+
else if (typeof script === 'string') {
|
|
67
|
+
script = sdk_1.Script.fromHex(script);
|
|
68
|
+
}
|
|
69
|
+
return script;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @param privKey bitcoin private key in 32 byte hex string form
|
|
73
|
+
* @returns @bsv/sdk PrivateKey
|
|
74
|
+
*/
|
|
75
|
+
function asBsvSdkPrivateKey(privKey) {
|
|
76
|
+
return sdk_1.PrivateKey.fromString(privKey, 'hex');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @param pubKey bitcoin public key in standard compressed key hex string form
|
|
80
|
+
* @returns @bsv/sdk PublicKey
|
|
81
|
+
*/
|
|
82
|
+
function asBsvSdkPublickKey(pubKey) {
|
|
83
|
+
return sdk_1.PublicKey.fromString(pubKey);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Helper function.
|
|
87
|
+
*
|
|
88
|
+
* Verifies that a possibly optional value has a value.
|
|
89
|
+
*/
|
|
90
|
+
function verifyTruthy(v, description) {
|
|
91
|
+
if (!v)
|
|
92
|
+
throw new index_client_1.sdk.WERR_INTERNAL(description !== null && description !== void 0 ? description : 'A truthy value is required.');
|
|
93
|
+
return v;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Helper function.
|
|
97
|
+
*
|
|
98
|
+
* Verifies that a hex string is trimmed and lower case.
|
|
99
|
+
*/
|
|
100
|
+
function verifyHexString(v) {
|
|
101
|
+
if (typeof v !== 'string')
|
|
102
|
+
throw new index_client_1.sdk.WERR_INTERNAL('A string is required.');
|
|
103
|
+
v = v.trim().toLowerCase();
|
|
104
|
+
return v;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Helper function.
|
|
108
|
+
*
|
|
109
|
+
* Verifies that an optional or null hex string is undefined or a trimmed lowercase string.
|
|
110
|
+
*/
|
|
111
|
+
function verifyOptionalHexString(v) {
|
|
112
|
+
if (!v)
|
|
113
|
+
return undefined;
|
|
114
|
+
return verifyHexString(v);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Helper function.
|
|
118
|
+
*
|
|
119
|
+
* Verifies that an optional or null number has a numeric value.
|
|
120
|
+
*/
|
|
121
|
+
function verifyNumber(v) {
|
|
122
|
+
if (typeof v !== 'number')
|
|
123
|
+
throw new index_client_1.sdk.WERR_INTERNAL('A number is required.');
|
|
124
|
+
return v;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Helper function.
|
|
128
|
+
*
|
|
129
|
+
* Verifies that an optional or null number has a numeric value.
|
|
130
|
+
*/
|
|
131
|
+
function verifyInteger(v) {
|
|
132
|
+
if (typeof v !== 'number' || !Number.isInteger(v))
|
|
133
|
+
throw new index_client_1.sdk.WERR_INTERNAL('An integer is required.');
|
|
134
|
+
return v;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Helper function.
|
|
138
|
+
*
|
|
139
|
+
* Verifies that a database record identifier is an integer greater than zero.
|
|
140
|
+
*/
|
|
141
|
+
function verifyId(id) {
|
|
142
|
+
id = verifyInteger(id);
|
|
143
|
+
if (id < 1)
|
|
144
|
+
throw new index_client_1.sdk.WERR_INTERNAL(`id must be valid integer greater than zero.`);
|
|
145
|
+
return id;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Helper function.
|
|
149
|
+
*
|
|
150
|
+
* @throws WERR_BAD_REQUEST if results has length greater than one.
|
|
151
|
+
*
|
|
152
|
+
* @returns results[0] or undefined if length is zero.
|
|
153
|
+
*/
|
|
154
|
+
function verifyOneOrNone(results) {
|
|
155
|
+
if (results.length > 1)
|
|
156
|
+
throw new index_client_1.sdk.WERR_BAD_REQUEST('Result must be unique.');
|
|
157
|
+
return results[0];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Helper function.
|
|
161
|
+
*
|
|
162
|
+
* @throws WERR_BAD_REQUEST if results has length other than one.
|
|
163
|
+
*
|
|
164
|
+
* @returns results[0].
|
|
165
|
+
*/
|
|
166
|
+
function verifyOne(results, errorDescrition) {
|
|
167
|
+
if (results.length !== 1)
|
|
168
|
+
throw new index_client_1.sdk.WERR_BAD_REQUEST(errorDescrition !== null && errorDescrition !== void 0 ? errorDescrition : 'Result must exist and be unique.');
|
|
169
|
+
return results[0];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Returns an await'able Promise that resolves in the given number of msecs.
|
|
173
|
+
* @publicbody
|
|
174
|
+
*/
|
|
175
|
+
function wait(msecs) {
|
|
176
|
+
return new Promise(resolve => setTimeout(resolve, msecs));
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* @returns count cryptographically secure random bytes as array of bytes
|
|
180
|
+
*/
|
|
181
|
+
function randomBytes(count) {
|
|
182
|
+
return (0, sdk_1.Random)(count);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @returns count cryptographically secure random bytes as hex encoded string
|
|
186
|
+
*/
|
|
187
|
+
function randomBytesHex(count) {
|
|
188
|
+
return sdk_1.Utils.toHex((0, sdk_1.Random)(count));
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* @returns count cryptographically secure random bytes as base64 encoded string
|
|
192
|
+
*/
|
|
193
|
+
function randomBytesBase64(count) {
|
|
194
|
+
return sdk_1.Utils.toBase64((0, sdk_1.Random)(count));
|
|
195
|
+
}
|
|
196
|
+
function validateSecondsSinceEpoch(time) {
|
|
197
|
+
const date = new Date(time * 1000);
|
|
198
|
+
if (date.getTime() / 1000 !== time || time < 1600000000 || time > 100000000000) {
|
|
199
|
+
throw new index_client_1.sdk.WERR_INVALID_PARAMETER('time', `valid "since epoch" unix time`);
|
|
200
|
+
}
|
|
201
|
+
return date;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Compares lengths and direct equality of values.
|
|
205
|
+
* @param arr1
|
|
206
|
+
* @param arr2
|
|
207
|
+
* @returns
|
|
208
|
+
*/
|
|
209
|
+
function arraysEqual(arr1, arr2) {
|
|
210
|
+
if (arr1.length !== arr2.length)
|
|
211
|
+
return false;
|
|
212
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
213
|
+
if (arr1[i] !== arr2[i])
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
function optionalArraysEqual(arr1, arr2) {
|
|
219
|
+
if (!arr1 && !arr2)
|
|
220
|
+
return true;
|
|
221
|
+
if (!arr1 || !arr2)
|
|
222
|
+
return false;
|
|
223
|
+
return arraysEqual(arr1, arr2);
|
|
224
|
+
}
|
|
225
|
+
function maxDate(d1, d2) {
|
|
226
|
+
if (d1 && d2) {
|
|
227
|
+
if (d1 > d2)
|
|
228
|
+
return d1;
|
|
229
|
+
return d2;
|
|
230
|
+
}
|
|
231
|
+
if (d1)
|
|
232
|
+
return d1;
|
|
233
|
+
if (d2)
|
|
234
|
+
return d2;
|
|
235
|
+
return undefined;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Calculate the SHA256 hash of an array of bytes
|
|
239
|
+
* @returns sha256 hash of buffer contents.
|
|
240
|
+
* @publicbody
|
|
241
|
+
*/
|
|
242
|
+
function sha256Hash(data) {
|
|
243
|
+
const first = new sdk_1.Hash.SHA256().update(data).digest();
|
|
244
|
+
return first;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Calculate the SHA256 hash of the SHA256 hash of an array of bytes.
|
|
248
|
+
* @param data an array of bytes
|
|
249
|
+
* @returns double sha256 hash of data, byte 0 of hash first.
|
|
250
|
+
* @publicbody
|
|
251
|
+
*/
|
|
252
|
+
function doubleSha256HashLE(data) {
|
|
253
|
+
const first = new sdk_1.Hash.SHA256().update(data).digest();
|
|
254
|
+
const second = new sdk_1.Hash.SHA256().update(first).digest();
|
|
255
|
+
return second;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Calculate the SHA256 hash of the SHA256 hash of an array of bytes.
|
|
259
|
+
* @param data is an array of bytes.
|
|
260
|
+
* @returns reversed (big-endian) double sha256 hash of data, byte 31 of hash first.
|
|
261
|
+
* @publicbody
|
|
262
|
+
*/
|
|
263
|
+
function doubleSha256BE(data) {
|
|
264
|
+
return doubleSha256HashLE(data).reverse();
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=utilityHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilityHelpers.js","sourceRoot":"","sources":["../../../../src/utility/utilityHelpers.ts"],"names":[],"mappings":";;AAMA,wCAEC;AAED,0CAEC;AAED,wCAIC;AAOD,gCAOC;AAOD,wCAOC;AAMD,gDAEC;AAMD,gDAEC;AAOD,oCAGC;AAOD,0CAIC;AAOD,0DAGC;AAOD,oCAGC;AAOD,sCAGC;AAOD,4BAIC;AASD,0CAGC;AASD,8BAGC;AAMD,oBAEC;AAKD,kCAEC;AAKD,wCAEC;AAKD,8CAEC;AAED,8DAMC;AAQD,kCAMC;AAED,kDAIC;AAED,0BAQC;AAOD,gCAGC;AAQD,gDAIC;AAQD,wCAEC;AAtPD,kCAAgG;AAChG,kDAAqC;AAI9B,KAAK,UAAU,cAAc,CAAC,MAAqB;IACxD,OAAO,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,WAAW,EAAE,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;AACH,SAAgB,UAAU,CAAC,IAAc;IACvC,MAAM,KAAK,GAAG,IAAI,UAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;IACrD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,IAAc;IAC/C,MAAM,KAAK,GAAG,IAAI,UAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;IACrD,MAAM,MAAM,GAAG,IAAI,UAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAA;IACvD,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,IAAc;IAC3C,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;AAC3C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coerce a value to a hex encoded string if currently a hex encoded string or number[]
|
|
3
|
+
* @param val string or number[]. If string, encoding must be hex. If number[], each value must be 0..255.
|
|
4
|
+
* @returns input val if it is a string; or if number[], converts byte values to hex
|
|
5
|
+
* @publicbody
|
|
6
|
+
*/
|
|
7
|
+
export declare function asString(val: string | number[]): string;
|
|
8
|
+
export declare function asArray(val: string | number[]): number[];
|
|
9
|
+
//# sourceMappingURL=utilityHelpers.noBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilityHelpers.noBuffer.d.ts","sourceRoot":"","sources":["../../../../src/utility/utilityHelpers.noBuffer.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAGvD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAIxD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asString = asString;
|
|
4
|
+
exports.asArray = asArray;
|
|
5
|
+
const sdk_1 = require("@bsv/sdk");
|
|
6
|
+
/**
|
|
7
|
+
* Coerce a value to a hex encoded string if currently a hex encoded string or number[]
|
|
8
|
+
* @param val string or number[]. If string, encoding must be hex. If number[], each value must be 0..255.
|
|
9
|
+
* @returns input val if it is a string; or if number[], converts byte values to hex
|
|
10
|
+
* @publicbody
|
|
11
|
+
*/
|
|
12
|
+
function asString(val) {
|
|
13
|
+
if (typeof val === 'string')
|
|
14
|
+
return val;
|
|
15
|
+
return sdk_1.Utils.toHex(val);
|
|
16
|
+
}
|
|
17
|
+
function asArray(val) {
|
|
18
|
+
if (Array.isArray(val))
|
|
19
|
+
return val;
|
|
20
|
+
let a = sdk_1.Utils.toArray(val, 'hex');
|
|
21
|
+
return a;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=utilityHelpers.noBuffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilityHelpers.noBuffer.js","sourceRoot":"","sources":["../../../../src/utility/utilityHelpers.noBuffer.ts"],"names":[],"mappings":";;AAQA,4BAGC;AAED,0BAIC;AAjBD,kCAAgC;AAEhC;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,GAAsB;IAC7C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IACvC,OAAO,WAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACzB,CAAC;AAED,SAAgB,OAAO,CAAC,GAAsB;IAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAA;IAClC,IAAI,CAAC,GAAa,WAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC3C,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WABClient
|
|
3
|
+
*
|
|
4
|
+
* Provides high-level methods to:
|
|
5
|
+
* - Retrieve server info (supported auth methods, faucet info)
|
|
6
|
+
* - Generate a random presentation key
|
|
7
|
+
* - Start/Complete authentication with a chosen AuthMethodInteractor
|
|
8
|
+
* - Link/unlink methods
|
|
9
|
+
* - Request faucet
|
|
10
|
+
* - Delete user
|
|
11
|
+
*/
|
|
12
|
+
import { AuthMethodInteractor } from './auth-method-interactors/AuthMethodInteractor';
|
|
13
|
+
export declare class WABClient {
|
|
14
|
+
private serverUrl;
|
|
15
|
+
constructor(serverUrl: string);
|
|
16
|
+
/**
|
|
17
|
+
* Return the WAB server info
|
|
18
|
+
*/
|
|
19
|
+
getInfo(): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Generate a random 256-bit presentation key as a hex string (client side).
|
|
22
|
+
*/
|
|
23
|
+
generateRandomPresentationKey(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Start an Auth Method flow
|
|
26
|
+
*/
|
|
27
|
+
startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<import("./auth-method-interactors/AuthMethodInteractor").StartAuthResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Complete an Auth Method flow
|
|
30
|
+
*/
|
|
31
|
+
completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<import("./auth-method-interactors/AuthMethodInteractor").CompleteAuthResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* List user-linked methods
|
|
34
|
+
*/
|
|
35
|
+
listLinkedMethods(presentationKey: string): Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Unlink a given Auth Method by ID
|
|
38
|
+
*/
|
|
39
|
+
unlinkMethod(presentationKey: string, authMethodId: number): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Request faucet
|
|
42
|
+
*/
|
|
43
|
+
requestFaucet(presentationKey: string): Promise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* Delete user
|
|
46
|
+
*/
|
|
47
|
+
deleteUser(presentationKey: string): Promise<any>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=WABClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WABClient.d.ts","sourceRoot":"","sources":["../../../../src/wab-client/WABClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAA;AAGrF,qBAAa,SAAS;IACR,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,MAAM;IAErC;;OAEG;IACU,OAAO;IAKpB;;OAEG;IACI,6BAA6B,IAAI,MAAM;IAI9C;;OAEG;IACU,eAAe,CAAC,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAIpG;;OAEG;IACU,kBAAkB,CAAC,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAIvG;;OAEG;IACU,iBAAiB,CAAC,eAAe,EAAE,MAAM;IAStD;;OAEG;IACU,YAAY,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IASvE;;OAEG;IACU,aAAa,CAAC,eAAe,EAAE,MAAM;IASlD;;OAEG;IACU,UAAU,CAAC,eAAe,EAAE,MAAM;CAQhD"}
|