@bopen-io/wallet-toolbox 2.1.21-parity-fix.2 → 2.6.2-brc153.2
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/CHANGELOG.md +232 -6
- package/LICENSE.txt +58 -0
- package/README.md +236 -47
- package/docs/README.md +3 -1
- package/docs/action-batch-planning.md +220 -0
- package/docs/authentication-observability.md +106 -0
- package/docs/client.md +55 -14
- package/docs/managed-change-policy.md +79 -0
- package/docs/monitor.md +3 -2
- package/docs/setup.md +24 -4
- package/docs/storage.md +16 -6
- package/docs/wallet.md +55 -14
- package/out/src/CWIStyleWalletManager.d.ts +122 -12
- package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
- package/out/src/CWIStyleWalletManager.js +1006 -461
- package/out/src/CWIStyleWalletManager.js.map +1 -1
- package/out/src/Setup.d.ts +13 -6
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js +15 -16
- package/out/src/Setup.js.map +1 -1
- package/out/src/SetupClient.d.ts +8 -6
- package/out/src/SetupClient.d.ts.map +1 -1
- package/out/src/SetupClient.js +11 -12
- package/out/src/SetupClient.js.map +1 -1
- package/out/src/SetupWallet.d.ts +6 -0
- package/out/src/SetupWallet.d.ts.map +1 -1
- package/out/src/ShamirWalletManager.d.ts +5 -5
- package/out/src/ShamirWalletManager.d.ts.map +1 -1
- package/out/src/ShamirWalletManager.js +16 -9
- package/out/src/ShamirWalletManager.js.map +1 -1
- package/out/src/SimpleWalletManager.d.ts +12 -2
- package/out/src/SimpleWalletManager.d.ts.map +1 -1
- package/out/src/SimpleWalletManager.js +73 -31
- package/out/src/SimpleWalletManager.js.map +1 -1
- package/out/src/Wallet.d.ts +88 -14
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +410 -249
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletAuthenticationManager.d.ts +31 -7
- package/out/src/WalletAuthenticationManager.d.ts.map +1 -1
- package/out/src/WalletAuthenticationManager.js +219 -35
- package/out/src/WalletAuthenticationManager.js.map +1 -1
- package/out/src/WalletLogger.d.ts.map +1 -1
- package/out/src/WalletLogger.js +45 -32
- package/out/src/WalletLogger.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts +163 -19
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +1232 -1180
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/WalletSettingsManager.d.ts +2 -2
- package/out/src/WalletSettingsManager.d.ts.map +1 -1
- package/out/src/WalletSettingsManager.js +3 -0
- package/out/src/WalletSettingsManager.js.map +1 -1
- package/out/src/entropy/EntropyCollector.d.ts +1 -1
- package/out/src/entropy/EntropyCollector.d.ts.map +1 -1
- package/out/src/entropy/EntropyCollector.js +18 -20
- package/out/src/entropy/EntropyCollector.js.map +1 -1
- package/out/src/fundWalletP2PKH.d.ts +2 -2
- package/out/src/fundWalletP2PKH.d.ts.map +1 -1
- package/out/src/fundWalletP2PKH.js +15 -15
- package/out/src/fundWalletP2PKH.js.map +1 -1
- package/out/src/index.all.d.ts +2 -0
- package/out/src/index.all.d.ts.map +1 -1
- package/out/src/index.all.js +2 -0
- package/out/src/index.all.js.map +1 -1
- package/out/src/index.client.d.ts +2 -0
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +2 -0
- package/out/src/index.client.js.map +1 -1
- package/out/src/index.mobile.d.ts +3 -0
- package/out/src/index.mobile.d.ts.map +1 -1
- package/out/src/index.mobile.js +3 -0
- package/out/src/index.mobile.js.map +1 -1
- package/out/src/mockchain/MockChainMigrations.d.ts +3 -3
- package/out/src/mockchain/MockChainMigrations.d.ts.map +1 -1
- package/out/src/mockchain/MockChainMigrations.js +1 -1
- package/out/src/mockchain/MockChainMigrations.js.map +1 -1
- package/out/src/mockchain/MockChainStorage.d.ts.map +1 -1
- package/out/src/mockchain/MockChainStorage.js +9 -8
- package/out/src/mockchain/MockChainStorage.js.map +1 -1
- package/out/src/mockchain/MockChainTracker.d.ts.map +1 -1
- package/out/src/mockchain/MockChainTracker.js +12 -10
- package/out/src/mockchain/MockChainTracker.js.map +1 -1
- package/out/src/mockchain/MockMiner.d.ts.map +1 -1
- package/out/src/mockchain/MockMiner.js +5 -5
- package/out/src/mockchain/MockMiner.js.map +1 -1
- package/out/src/mockchain/MockServices.d.ts +13 -0
- package/out/src/mockchain/MockServices.d.ts.map +1 -1
- package/out/src/mockchain/MockServices.js +232 -283
- package/out/src/mockchain/MockServices.js.map +1 -1
- package/out/src/mockchain/merkleTree.d.ts.map +1 -1
- package/out/src/mockchain/merkleTree.js +61 -57
- package/out/src/mockchain/merkleTree.js.map +1 -1
- package/out/src/monitor/Monitor.d.ts +24 -4
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js +158 -148
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts +5 -2
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +79 -69
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/index.all.js.map +1 -1
- package/out/src/monitor/tasks/TaskArcSSE.d.ts +12 -5
- package/out/src/monitor/tasks/TaskArcSSE.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskArcSSE.js +143 -135
- package/out/src/monitor/tasks/TaskArcSSE.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +6 -4
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +141 -129
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.d.ts +63 -3
- package/out/src/monitor/tasks/TaskCheckNoSends.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.js +103 -13
- package/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -1
- package/out/src/monitor/tasks/TaskCleanupActionBatches.d.ts +13 -0
- package/out/src/monitor/tasks/TaskCleanupActionBatches.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskCleanupActionBatches.js +24 -0
- package/out/src/monitor/tasks/TaskCleanupActionBatches.js.map +1 -0
- package/out/src/monitor/tasks/TaskClock.d.ts +2 -2
- package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskClock.js +4 -3
- package/out/src/monitor/tasks/TaskClock.js.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.js +2 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -1
- package/out/src/monitor/tasks/TaskMineBlock.d.ts +4 -2
- package/out/src/monitor/tasks/TaskMineBlock.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskMineBlock.js +5 -2
- package/out/src/monitor/tasks/TaskMineBlock.js.map +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.d.ts +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.js +3 -2
- package/out/src/monitor/tasks/TaskMonitorCallHistory.js.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.d.ts +5 -4
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js +22 -8
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.d.ts +4 -2
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.js +9 -5
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -1
- package/out/src/monitor/tasks/TaskReorg.d.ts +1 -1
- package/out/src/monitor/tasks/TaskReorg.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReorg.js +6 -4
- package/out/src/monitor/tasks/TaskReorg.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.d.ts +4 -2
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.js +22 -17
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewProvenTxs.d.ts +4 -2
- package/out/src/monitor/tasks/TaskReviewProvenTxs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewProvenTxs.js +12 -5
- package/out/src/monitor/tasks/TaskReviewProvenTxs.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts +4 -2
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.js +16 -7
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.d.ts +4 -2
- package/out/src/monitor/tasks/TaskReviewUtxos.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.js +8 -2
- package/out/src/monitor/tasks/TaskReviewUtxos.js.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts +4 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.js +63 -50
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +2 -2
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js +4 -6
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts +4 -2
- package/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.js +13 -67
- package/out/src/monitor/tasks/TaskUnFail.js.map +1 -1
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -1
- package/out/src/monitor/tasks/WalletMonitorTask.js +10 -5
- package/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -1
- package/out/src/monitor/tasks/index.all.d.ts +1 -0
- package/out/src/monitor/tasks/index.all.d.ts.map +1 -1
- package/out/src/monitor/tasks/index.all.js +1 -0
- package/out/src/monitor/tasks/index.all.js.map +1 -1
- package/out/src/sdk/ActionBatch.interfaces.d.ts +159 -0
- package/out/src/sdk/ActionBatch.interfaces.d.ts.map +1 -0
- package/out/src/sdk/ActionBatch.interfaces.js +3 -0
- package/out/src/sdk/ActionBatch.interfaces.js.map +1 -0
- package/out/src/sdk/CertOpsWallet.d.ts +3 -3
- package/out/src/sdk/CertOpsWallet.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts +3 -3
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js +75 -50
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WERR_errors.d.ts +3 -3
- package/out/src/sdk/WERR_errors.d.ts.map +1 -1
- package/out/src/sdk/WERR_errors.js +29 -14
- package/out/src/sdk/WERR_errors.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts +4 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +63 -58
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.d.ts.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.js +1 -3
- package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts +45 -20
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +92 -64
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/sdk/index.d.ts +1 -0
- package/out/src/sdk/index.d.ts.map +1 -1
- package/out/src/sdk/index.js +1 -0
- package/out/src/sdk/index.js.map +1 -1
- package/out/src/sdk/types.d.ts +14 -5
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +13 -4
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/services/ServiceCollection.d.ts +6 -6
- package/out/src/services/ServiceCollection.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.js +14 -9
- package/out/src/services/ServiceCollection.js.map +1 -1
- package/out/src/services/Services.d.ts +16 -2
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +320 -241
- package/out/src/services/Services.js.map +1 -1
- package/out/src/services/chaintracker/BHServiceClient.d.ts +7 -7
- package/out/src/services/chaintracker/BHServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/BHServiceClient.js +22 -16
- package/out/src/services/chaintracker/BHServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +5 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.js +61 -19
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.d.ts +8 -6
- package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.js +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BulkIngestorApi.d.ts +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BulkStorageApi.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.d.ts +11 -0
- package/out/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts +29 -10
- package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js +369 -259
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts +6 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js +39 -44
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +3 -3
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +24 -15
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts +64 -0
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js +318 -0
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js +9 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.d.ts +1 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js +10 -3
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.d.ts +27 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.js +64 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js +6 -5
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.js +3 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js +4 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.d.ts +24 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js +68 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.d.ts +2 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.js +3 -10
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.d.ts +13 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js +50 -10
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.js +4 -3
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts +14 -4
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js +120 -143
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts +22 -8
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js +106 -54
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js +12 -17
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.d.ts +3 -3
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js +15 -14
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.d.ts +3 -0
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js +85 -66
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.d.ts +4 -0
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js +128 -101
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts +6 -2
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js +170 -158
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.js +0 -21
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts +9 -2
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js +142 -92
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.d.ts +58 -0
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js +143 -28
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/configureKnexChaintracks.d.ts +18 -0
- package/out/src/services/chaintracker/chaintracks/configureKnexChaintracks.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/configureKnexChaintracks.js +24 -0
- package/out/src/services/chaintracker/chaintracks/configureKnexChaintracks.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.d.ts +2 -3
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js +4 -22
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.d.ts +2 -4
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js +14 -29
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.d.ts +2 -3
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js +4 -22
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.d.ts +2 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js +3 -15
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.d.ts +2 -2
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.js +3 -15
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.d.ts +2 -1
- package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.js +3 -15
- package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/index.mobile.d.ts +6 -1
- package/out/src/services/chaintracker/chaintracks/index.mobile.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/index.mobile.js +5 -0
- package/out/src/services/chaintracker/chaintracks/index.mobile.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts +8 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +282 -252
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js +12 -7
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js +53 -29
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.d.ts +5 -5
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js +34 -11
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts +8 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js +54 -13
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.d.ts +10 -12
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js +30 -34
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.js +28 -18
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.d.ts +2 -2
- package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.js +4 -6
- package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts +2 -12
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +72 -63
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.js +4 -2
- package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js +9 -10
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.d.ts +33 -1
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.js +94 -15
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
- package/out/src/services/networkConfig.d.ts +18 -0
- package/out/src/services/networkConfig.d.ts.map +1 -0
- package/out/src/services/networkConfig.js +92 -0
- package/out/src/services/networkConfig.js.map +1 -0
- package/out/src/services/providers/ARC.d.ts +8 -0
- package/out/src/services/providers/ARC.d.ts.map +1 -1
- package/out/src/services/providers/ARC.js +167 -92
- package/out/src/services/providers/ARC.js.map +1 -1
- package/out/src/services/providers/ArcSSEClient.d.ts +1 -0
- package/out/src/services/providers/ArcSSEClient.d.ts.map +1 -1
- package/out/src/services/providers/ArcSSEClient.js +21 -17
- package/out/src/services/providers/ArcSSEClient.js.map +1 -1
- package/out/src/services/providers/Arcade.d.ts +77 -0
- package/out/src/services/providers/Arcade.d.ts.map +1 -0
- package/out/src/services/providers/Arcade.js +356 -0
- package/out/src/services/providers/Arcade.js.map +1 -0
- package/out/src/services/providers/Bitails.d.ts.map +1 -1
- package/out/src/services/providers/Bitails.js +128 -103
- package/out/src/services/providers/Bitails.js.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.js +18 -3
- package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
- package/out/src/services/providers/WhatsOnChain.d.ts +10 -2
- package/out/src/services/providers/WhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/WhatsOnChain.js +145 -236
- package/out/src/services/providers/WhatsOnChain.js.map +1 -1
- package/out/src/services/providers/exchangeRates.d.ts.map +1 -1
- package/out/src/services/providers/exchangeRates.js +4 -4
- package/out/src/services/providers/exchangeRates.js.map +1 -1
- package/out/src/services/providers/getBeefForTxid.d.ts +1 -1
- package/out/src/services/providers/getBeefForTxid.d.ts.map +1 -1
- package/out/src/services/providers/getBeefForTxid.js +2 -1
- package/out/src/services/providers/getBeefForTxid.js.map +1 -1
- package/out/src/services/providers/whatsOnChainHelpers.d.ts +68 -0
- package/out/src/services/providers/whatsOnChainHelpers.d.ts.map +1 -0
- package/out/src/services/providers/whatsOnChainHelpers.js +147 -0
- package/out/src/services/providers/whatsOnChainHelpers.js.map +1 -0
- package/out/src/signer/WalletSigner.d.ts.map +1 -1
- package/out/src/signer/WalletSigner.js +4 -1
- package/out/src/signer/WalletSigner.js.map +1 -1
- package/out/src/signer/actionBatch/ActionBatchPlanner.d.ts +29 -0
- package/out/src/signer/actionBatch/ActionBatchPlanner.d.ts.map +1 -0
- package/out/src/signer/actionBatch/ActionBatchPlanner.js +346 -0
- package/out/src/signer/actionBatch/ActionBatchPlanner.js.map +1 -0
- package/out/src/signer/actionBatch/ActionBatchWorkspace.d.ts +33 -0
- package/out/src/signer/actionBatch/ActionBatchWorkspace.d.ts.map +1 -0
- package/out/src/signer/actionBatch/ActionBatchWorkspace.js +869 -0
- package/out/src/signer/actionBatch/ActionBatchWorkspace.js.map +1 -0
- package/out/src/signer/actionBatch/actionBatchBootstrap.d.ts +11 -0
- package/out/src/signer/actionBatch/actionBatchBootstrap.d.ts.map +1 -0
- package/out/src/signer/actionBatch/actionBatchBootstrap.js +38 -0
- package/out/src/signer/actionBatch/actionBatchBootstrap.js.map +1 -0
- package/out/src/signer/methods/acquireDirectCertificate.js +2 -3
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.d.ts +54 -0
- package/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.js +215 -100
- package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
- package/out/src/signer/methods/completeSignedTransaction.d.ts +3 -7
- package/out/src/signer/methods/completeSignedTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/completeSignedTransaction.js +78 -80
- package/out/src/signer/methods/completeSignedTransaction.js.map +1 -1
- package/out/src/signer/methods/createAction.d.ts.map +1 -1
- package/out/src/signer/methods/createAction.js +81 -41
- package/out/src/signer/methods/createAction.js.map +1 -1
- package/out/src/signer/methods/internalizeAction.d.ts +16 -5
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/signer/methods/internalizeAction.js +34 -18
- package/out/src/signer/methods/internalizeAction.js.map +1 -1
- package/out/src/signer/methods/proveCertificate.js +1 -1
- package/out/src/signer/methods/proveCertificate.js.map +1 -1
- package/out/src/signer/methods/resultBeef.d.ts +4 -0
- package/out/src/signer/methods/resultBeef.d.ts.map +1 -0
- package/out/src/signer/methods/resultBeef.js +12 -0
- package/out/src/signer/methods/resultBeef.js.map +1 -0
- package/out/src/signer/methods/signAction.d.ts.map +1 -1
- package/out/src/signer/methods/signAction.js +42 -15
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/src/signer/methods/verifyUnlockScripts.d.ts +17 -0
- package/out/src/signer/methods/verifyUnlockScripts.d.ts.map +1 -0
- package/out/src/signer/methods/verifyUnlockScripts.js +373 -0
- package/out/src/signer/methods/verifyUnlockScripts.js.map +1 -0
- package/out/src/storage/StorageIdb.d.ts +51 -6
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +929 -1324
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +51 -3
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +751 -314
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +117 -2
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +735 -254
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.d.ts +13 -5
- package/out/src/storage/StorageReader.d.ts.map +1 -1
- package/out/src/storage/StorageReader.js +21 -15
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageReaderWriter.d.ts +0 -1
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
- package/out/src/storage/StorageReaderWriter.js +32 -35
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
- package/out/src/storage/StorageSyncReader.js +6 -4
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts +13 -0
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +179 -103
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/adminServer/adminServer.d.ts +80 -1
- package/out/src/storage/adminServer/adminServer.d.ts.map +1 -1
- package/out/src/storage/adminServer/adminServer.js +90 -72
- package/out/src/storage/adminServer/adminServer.js.map +1 -1
- package/out/src/storage/adminServer/adminUi.d.ts.map +1 -1
- package/out/src/storage/adminServer/adminUi.js.map +1 -1
- package/out/src/storage/idbHelpers.d.ts +44 -0
- package/out/src/storage/idbHelpers.d.ts.map +1 -0
- package/out/src/storage/idbHelpers.js +395 -0
- package/out/src/storage/idbHelpers.js.map +1 -0
- package/out/src/storage/index.all.d.ts +6 -0
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +6 -0
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/index.client.d.ts +4 -0
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +4 -0
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/index.mobile.d.ts +3 -0
- package/out/src/storage/index.mobile.d.ts.map +1 -1
- package/out/src/storage/index.mobile.js +3 -0
- package/out/src/storage/index.mobile.js.map +1 -1
- package/out/src/storage/methods/ListActionsSpecOp.d.ts +6 -1
- package/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListActionsSpecOp.js +75 -9
- package/out/src/storage/methods/ListActionsSpecOp.js.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts +2 -0
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.js +43 -29
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
- package/out/src/storage/methods/actionBatch.d.ts +15 -0
- package/out/src/storage/methods/actionBatch.d.ts.map +1 -0
- package/out/src/storage/methods/actionBatch.js +725 -0
- package/out/src/storage/methods/actionBatch.js.map +1 -0
- package/out/src/storage/methods/actionBatchBlobs.d.ts +15 -0
- package/out/src/storage/methods/actionBatchBlobs.d.ts.map +1 -0
- package/out/src/storage/methods/actionBatchBlobs.js +184 -0
- package/out/src/storage/methods/actionBatchBlobs.js.map +1 -0
- package/out/src/storage/methods/actionBatchValidation.d.ts +17 -0
- package/out/src/storage/methods/actionBatchValidation.d.ts.map +1 -0
- package/out/src/storage/methods/actionBatchValidation.js +416 -0
- package/out/src/storage/methods/actionBatchValidation.js.map +1 -0
- package/out/src/storage/methods/actionPlanning.d.ts +26 -0
- package/out/src/storage/methods/actionPlanning.d.ts.map +1 -0
- package/out/src/storage/methods/actionPlanning.js +103 -0
- package/out/src/storage/methods/actionPlanning.js.map +1 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +63 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +245 -92
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
- package/out/src/storage/methods/availableManagedChange.d.ts +11 -0
- package/out/src/storage/methods/availableManagedChange.d.ts.map +1 -0
- package/out/src/storage/methods/availableManagedChange.js +25 -0
- package/out/src/storage/methods/availableManagedChange.js.map +1 -0
- package/out/src/storage/methods/createAction.d.ts +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +783 -416
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.d.ts +2 -2
- package/out/src/storage/methods/generateChange.d.ts.map +1 -1
- package/out/src/storage/methods/generateChange.js +188 -127
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.d.ts +7 -0
- package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +291 -63
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
- package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -1
- package/out/src/storage/methods/getSyncChunk.js +11 -8
- package/out/src/storage/methods/getSyncChunk.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.d.ts +77 -6
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +372 -139
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActionsIdb.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsIdb.js +87 -110
- package/out/src/storage/methods/listActionsIdb.js.map +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsKnex.js +97 -118
- package/out/src/storage/methods/listActionsKnex.js.map +1 -1
- package/out/src/storage/methods/listCertificates.d.ts +2 -2
- package/out/src/storage/methods/listCertificates.d.ts.map +1 -1
- package/out/src/storage/methods/listCertificates.js +8 -8
- package/out/src/storage/methods/listCertificates.js.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.d.ts +1 -1
- package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.js +144 -150
- package/out/src/storage/methods/listOutputsIdb.js.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.d.ts +2 -2
- package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.js +217 -246
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/methods/managedChange.d.ts +26 -0
- package/out/src/storage/methods/managedChange.d.ts.map +1 -0
- package/out/src/storage/methods/managedChange.js +42 -0
- package/out/src/storage/methods/managedChange.js.map +1 -0
- package/out/src/storage/methods/offsetKey.d.ts +1 -1
- package/out/src/storage/methods/offsetKey.d.ts.map +1 -1
- package/out/src/storage/methods/offsetKey.js +3 -6
- package/out/src/storage/methods/offsetKey.js.map +1 -1
- package/out/src/storage/methods/processAction.d.ts +2 -11
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +173 -106
- package/out/src/storage/methods/processAction.js.map +1 -1
- package/out/src/storage/methods/purgeData.d.ts +1 -1
- package/out/src/storage/methods/purgeData.d.ts.map +1 -1
- package/out/src/storage/methods/purgeData.js +169 -172
- package/out/src/storage/methods/purgeData.js.map +1 -1
- package/out/src/storage/methods/purgeDataIdb.d.ts +1 -1
- package/out/src/storage/methods/purgeDataIdb.d.ts.map +1 -1
- package/out/src/storage/methods/purgeDataIdb.js +2 -2
- package/out/src/storage/methods/purgeDataIdb.js.map +1 -1
- package/out/src/storage/methods/reviewStatus.d.ts +4 -3
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +54 -14
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/methods/reviewStatusIdb.d.ts +3 -3
- package/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatusIdb.js +54 -13
- package/out/src/storage/methods/reviewStatusIdb.js.map +1 -1
- package/out/src/storage/methods/utils.Buffer.d.ts.map +1 -1
- package/out/src/storage/methods/utils.Buffer.js.map +1 -1
- package/out/src/storage/methods/utils.d.ts.map +1 -1
- package/out/src/storage/methods/utils.js +7 -1
- package/out/src/storage/methods/utils.js.map +1 -1
- package/out/src/storage/portable/index.d.ts +55 -0
- package/out/src/storage/portable/index.d.ts.map +1 -0
- package/out/src/storage/portable/index.js +872 -0
- package/out/src/storage/portable/index.js.map +1 -0
- package/out/src/storage/remoting/BinaryJson.d.ts +10 -0
- package/out/src/storage/remoting/BinaryJson.d.ts.map +1 -0
- package/out/src/storage/remoting/BinaryJson.js +218 -0
- package/out/src/storage/remoting/BinaryJson.js.map +1 -0
- package/out/src/storage/remoting/KnexPaymentReplayStore.d.ts +12 -0
- package/out/src/storage/remoting/KnexPaymentReplayStore.d.ts.map +1 -0
- package/out/src/storage/remoting/KnexPaymentReplayStore.js +46 -0
- package/out/src/storage/remoting/KnexPaymentReplayStore.js.map +1 -0
- package/out/src/storage/remoting/KnexSessionManager.d.ts +57 -0
- package/out/src/storage/remoting/KnexSessionManager.d.ts.map +1 -0
- package/out/src/storage/remoting/KnexSessionManager.js +256 -0
- package/out/src/storage/remoting/KnexSessionManager.js.map +1 -0
- package/out/src/storage/remoting/RateLimitPolicy.d.ts +10 -0
- package/out/src/storage/remoting/RateLimitPolicy.d.ts.map +1 -0
- package/out/src/storage/remoting/RateLimitPolicy.js +37 -0
- package/out/src/storage/remoting/RateLimitPolicy.js.map +1 -0
- package/out/src/storage/remoting/StorageClient.d.ts +7 -271
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClient.js +87 -458
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/remoting/StorageClientBase.d.ts +318 -0
- package/out/src/storage/remoting/StorageClientBase.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageClientBase.js +474 -0
- package/out/src/storage/remoting/StorageClientBase.js.map +1 -0
- package/out/src/storage/remoting/StorageMobile.d.ts +8 -276
- package/out/src/storage/remoting/StorageMobile.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageMobile.js +43 -435
- package/out/src/storage/remoting/StorageMobile.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.d.ts +106 -9
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +628 -225
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/remoting/edgePolicy.d.ts +84 -0
- package/out/src/storage/remoting/edgePolicy.d.ts.map +1 -0
- package/out/src/storage/remoting/edgePolicy.js +570 -0
- package/out/src/storage/remoting/edgePolicy.js.map +1 -0
- package/out/src/storage/remoting/entityValidationHelpers.d.ts +29 -0
- package/out/src/storage/remoting/entityValidationHelpers.d.ts.map +1 -0
- package/out/src/storage/remoting/entityValidationHelpers.js +108 -0
- package/out/src/storage/remoting/entityValidationHelpers.js.map +1 -0
- package/out/src/storage/schema/KnexMigrations.d.ts +7 -3
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +173 -11
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/src/storage/schema/StorageIdbSchema.d.ts +27 -1
- package/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.js +1 -0
- package/out/src/storage/schema/entities/EntityBase.js.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificate.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificate.js +5 -4
- package/out/src/storage/schema/entities/EntityCertificate.js.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificateField.js +5 -7
- package/out/src/storage/schema/entities/EntityCertificateField.js.map +1 -1
- package/out/src/storage/schema/entities/EntityCommission.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityCommission.js +6 -8
- package/out/src/storage/schema/entities/EntityCommission.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutput.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutput.js +21 -24
- package/out/src/storage/schema/entities/EntityOutput.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputBasket.js +7 -7
- package/out/src/storage/schema/entities/EntityOutputBasket.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTag.js +2 -2
- package/out/src/storage/schema/entities/EntityOutputTag.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTagMap.js +4 -6
- package/out/src/storage/schema/entities/EntityOutputTagMap.js.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTx.d.ts +8 -4
- package/out/src/storage/schema/entities/EntityProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTx.js +77 -64
- package/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTxReq.d.ts +11 -2
- package/out/src/storage/schema/entities/EntityProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTxReq.js +122 -74
- package/out/src/storage/schema/entities/EntityProvenTxReq.js.map +1 -1
- package/out/src/storage/schema/entities/EntitySyncState.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntitySyncState.js +40 -45
- package/out/src/storage/schema/entities/EntitySyncState.js.map +1 -1
- package/out/src/storage/schema/entities/EntityTransaction.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityTransaction.js +30 -31
- package/out/src/storage/schema/entities/EntityTransaction.js.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabel.js +2 -2
- package/out/src/storage/schema/entities/EntityTxLabel.js.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabelMap.js +4 -6
- package/out/src/storage/schema/entities/EntityTxLabelMap.js.map +1 -1
- package/out/src/storage/schema/entities/EntityUser.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityUser.js +3 -3
- package/out/src/storage/schema/entities/EntityUser.js.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.js +17 -18
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -1
- package/out/src/storage/schema/tables/TableActionBatch.d.ts +26 -0
- package/out/src/storage/schema/tables/TableActionBatch.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableActionBatch.js +3 -0
- package/out/src/storage/schema/tables/TableActionBatch.js.map +1 -0
- package/out/src/storage/schema/tables/TableAuthSession.d.ts +20 -0
- package/out/src/storage/schema/tables/TableAuthSession.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableAuthSession.js +15 -0
- package/out/src/storage/schema/tables/TableAuthSession.js.map +1 -0
- package/out/src/storage/schema/tables/TableCertificate.d.ts +2 -1
- package/out/src/storage/schema/tables/TableCertificate.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableCertificateField.d.ts +1 -1
- package/out/src/storage/schema/tables/TableCertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableCommission.d.ts +1 -1
- package/out/src/storage/schema/tables/TableCommission.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableMonitorEvent.d.ts +1 -1
- package/out/src/storage/schema/tables/TableMonitorEvent.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutput.d.ts +3 -2
- package/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutput.js +1 -1
- package/out/src/storage/schema/tables/TableOutput.js.map +1 -1
- package/out/src/storage/schema/tables/TableOutputBasket.d.ts +1 -1
- package/out/src/storage/schema/tables/TableOutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutputTag.d.ts +1 -1
- package/out/src/storage/schema/tables/TableOutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutputTagMap.d.ts +1 -1
- package/out/src/storage/schema/tables/TableOutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableProvenTx.d.ts +1 -1
- package/out/src/storage/schema/tables/TableProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableProvenTxReq.d.ts +24 -1
- package/out/src/storage/schema/tables/TableProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableSettings.d.ts +1 -1
- package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableSyncState.d.ts +1 -1
- package/out/src/storage/schema/tables/TableSyncState.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableTransaction.d.ts +1 -1
- package/out/src/storage/schema/tables/TableTransaction.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableTxLabel.d.ts +1 -1
- package/out/src/storage/schema/tables/TableTxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableTxLabelMap.d.ts +1 -1
- package/out/src/storage/schema/tables/TableTxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableUser.d.ts +1 -1
- package/out/src/storage/schema/tables/TableUser.d.ts.map +1 -1
- package/out/src/storage/schema/tables/index.d.ts +2 -0
- package/out/src/storage/schema/tables/index.d.ts.map +1 -1
- package/out/src/storage/schema/tables/index.js +2 -0
- package/out/src/storage/schema/tables/index.js.map +1 -1
- package/out/src/storage/storageProviderHelpers.d.ts +35 -0
- package/out/src/storage/storageProviderHelpers.d.ts.map +1 -0
- package/out/src/storage/storageProviderHelpers.js +106 -0
- package/out/src/storage/storageProviderHelpers.js.map +1 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts +4 -2
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.js +65 -46
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
- package/out/src/utility/Format.d.ts.map +1 -1
- package/out/src/utility/Format.js +15 -49
- package/out/src/utility/Format.js.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.d.ts +3 -2
- package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.js +22 -11
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/actionBatchDigest.d.ts +9 -0
- package/out/src/utility/actionBatchDigest.d.ts.map +1 -0
- package/out/src/utility/actionBatchDigest.js +86 -0
- package/out/src/utility/actionBatchDigest.js.map +1 -0
- package/out/src/utility/actionBatchPack.d.ts +16 -0
- package/out/src/utility/actionBatchPack.d.ts.map +1 -0
- package/out/src/utility/actionBatchPack.js +220 -0
- package/out/src/utility/actionBatchPack.js.map +1 -0
- package/out/src/utility/aggregateResults.d.ts +1 -1
- package/out/src/utility/aggregateResults.d.ts.map +1 -1
- package/out/src/utility/aggregateResults.js +2 -2
- package/out/src/utility/aggregateResults.js.map +1 -1
- package/out/src/utility/beefForTxids.d.ts +9 -0
- package/out/src/utility/beefForTxids.d.ts.map +1 -0
- package/out/src/utility/beefForTxids.js +35 -0
- package/out/src/utility/beefForTxids.js.map +1 -0
- package/out/src/utility/brc114ActionTimeLabels.d.ts +2 -2
- package/out/src/utility/brc114ActionTimeLabels.d.ts.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js +31 -28
- package/out/src/utility/brc114ActionTimeLabels.js.map +1 -1
- package/out/src/utility/brc153ReferenceLabels.d.ts +23 -0
- package/out/src/utility/brc153ReferenceLabels.d.ts.map +1 -0
- package/out/src/utility/brc153ReferenceLabels.js +51 -0
- package/out/src/utility/brc153ReferenceLabels.js.map +1 -0
- package/out/src/utility/formatUnknown.d.ts +6 -0
- package/out/src/utility/formatUnknown.d.ts.map +1 -0
- package/out/src/utility/formatUnknown.js +39 -0
- package/out/src/utility/formatUnknown.js.map +1 -0
- package/out/src/utility/hashWasm.d.ts +5 -0
- package/out/src/utility/hashWasm.d.ts.map +1 -0
- package/out/src/utility/hashWasm.js +15 -0
- package/out/src/utility/hashWasm.js.map +1 -0
- package/out/src/utility/identityUtils.d.ts +12 -6
- package/out/src/utility/identityUtils.d.ts.map +1 -1
- package/out/src/utility/identityUtils.js +82 -38
- package/out/src/utility/identityUtils.js.map +1 -1
- package/out/src/utility/index.all.d.ts +2 -0
- package/out/src/utility/index.all.d.ts.map +1 -1
- package/out/src/utility/index.all.js +2 -0
- package/out/src/utility/index.all.js.map +1 -1
- package/out/src/utility/index.client.d.ts +2 -0
- package/out/src/utility/index.client.d.ts.map +1 -1
- package/out/src/utility/index.client.js +2 -0
- package/out/src/utility/index.client.js.map +1 -1
- package/out/src/utility/parseTxScriptOffsets.d.ts +5 -5
- package/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -1
- package/out/src/utility/parseTxScriptOffsets.js +1 -1
- package/out/src/utility/parseTxScriptOffsets.js.map +1 -1
- package/out/src/utility/stampLog.d.ts.map +1 -1
- package/out/src/utility/stampLog.js +53 -44
- package/out/src/utility/stampLog.js.map +1 -1
- package/out/src/utility/traceContext.d.ts +13 -0
- package/out/src/utility/traceContext.d.ts.map +1 -0
- package/out/src/utility/traceContext.js +34 -0
- package/out/src/utility/traceContext.js.map +1 -0
- package/out/src/utility/tscProofToMerklePath.js +1 -1
- package/out/src/utility/tscProofToMerklePath.js.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.d.ts +5 -3
- package/out/src/utility/utilityHelpers.buffer.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.js +3 -3
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -1
- package/out/src/utility/utilityHelpers.d.ts +3 -4
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +24 -16
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/src/utility/utilityHelpers.noBuffer.d.ts +7 -3
- package/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.noBuffer.js +7 -8
- package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -1
- package/out/src/wab-client/WABClient.d.ts +36 -90
- package/out/src/wab-client/WABClient.d.ts.map +1 -1
- package/out/src/wab-client/WABClient.js +103 -150
- package/out/src/wab-client/WABClient.js.map +1 -1
- package/out/src/wab-client/WABTransport.d.ts +81 -0
- package/out/src/wab-client/WABTransport.d.ts.map +1 -0
- package/out/src/wab-client/WABTransport.js +420 -0
- package/out/src/wab-client/WABTransport.js.map +1 -0
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +10 -10
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +16 -21
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js +1 -4
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +1 -4
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +2 -1
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +1 -1
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +14 -3
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -1
- package/package.json +89 -36
- package/license.md +0 -28
- package/out/src/__tests/CWIStyleWalletManager.test.d.ts +0 -2
- package/out/src/__tests/CWIStyleWalletManager.test.d.ts.map +0 -1
- package/out/src/__tests/CWIStyleWalletManager.test.js +0 -809
- package/out/src/__tests/CWIStyleWalletManager.test.js.map +0 -1
- package/out/src/__tests/ShamirWalletManager.test.d.ts +0 -2
- package/out/src/__tests/ShamirWalletManager.test.d.ts.map +0 -1
- package/out/src/__tests/ShamirWalletManager.test.js +0 -299
- package/out/src/__tests/ShamirWalletManager.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +0 -373
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.checks.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.checks.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.checks.test.js +0 -642
- package/out/src/__tests/WalletPermissionsManager.checks.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.encryption.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.encryption.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js +0 -335
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +0 -87
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +0 -290
- package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.flows.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.js +0 -613
- package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.initialization.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.initialization.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js +0 -227
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js +0 -735
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.proxying.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.proxying.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js +0 -584
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.tokens.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js +0 -415
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +0 -1
- package/out/src/entropy/__tests/EntropyCollector.test.d.ts +0 -2
- package/out/src/entropy/__tests/EntropyCollector.test.d.ts.map +0 -1
- package/out/src/entropy/__tests/EntropyCollector.test.js +0 -137
- package/out/src/entropy/__tests/EntropyCollector.test.js.map +0 -1
- package/out/src/monitor/__test/MonitorDaemon.man.test.d.ts +0 -2
- package/out/src/monitor/__test/MonitorDaemon.man.test.d.ts.map +0 -1
- package/out/src/monitor/__test/MonitorDaemon.man.test.js +0 -41
- package/out/src/monitor/__test/MonitorDaemon.man.test.js.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskArcSSE.test.d.ts +0 -2
- package/out/src/monitor/tasks/__tests/TaskArcSSE.test.d.ts.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskArcSSE.test.js +0 -257
- package/out/src/monitor/tasks/__tests/TaskArcSSE.test.js.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskReviewDoubleSpends.test.d.ts +0 -2
- package/out/src/monitor/tasks/__tests/TaskReviewDoubleSpends.test.d.ts.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskReviewDoubleSpends.test.js +0 -161
- package/out/src/monitor/tasks/__tests/TaskReviewDoubleSpends.test.js.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskReviewProvenTxs.test.d.ts +0 -2
- package/out/src/monitor/tasks/__tests/TaskReviewProvenTxs.test.d.ts.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskReviewProvenTxs.test.js +0 -214
- package/out/src/monitor/tasks/__tests/TaskReviewProvenTxs.test.js.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskReviewUtxos.test.d.ts +0 -2
- package/out/src/monitor/tasks/__tests/TaskReviewUtxos.test.d.ts.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskReviewUtxos.test.js +0 -92
- package/out/src/monitor/tasks/__tests/TaskReviewUtxos.test.js.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskSendWaiting.test.d.ts +0 -2
- package/out/src/monitor/tasks/__tests/TaskSendWaiting.test.d.ts.map +0 -1
- package/out/src/monitor/tasks/__tests/TaskSendWaiting.test.js +0 -139
- package/out/src/monitor/tasks/__tests/TaskSendWaiting.test.js.map +0 -1
- package/out/src/sdk/__test/CertificateLifeCycle.test.d.ts +0 -2
- package/out/src/sdk/__test/CertificateLifeCycle.test.d.ts.map +0 -1
- package/out/src/sdk/__test/CertificateLifeCycle.test.js +0 -62
- package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +0 -1
- package/out/src/sdk/__test/PrivilegedKeyManager.test.d.ts +0 -2
- package/out/src/sdk/__test/PrivilegedKeyManager.test.d.ts.map +0 -1
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js +0 -647
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js.map +0 -1
- package/out/src/sdk/__test/WalletError.test.d.ts +0 -2
- package/out/src/sdk/__test/WalletError.test.d.ts.map +0 -1
- package/out/src/sdk/__test/WalletError.test.js +0 -255
- package/out/src/sdk/__test/WalletError.test.js.map +0 -1
- package/out/src/sdk/__test/validationHelpers.test.d.ts +0 -2
- package/out/src/sdk/__test/validationHelpers.test.d.ts.map +0 -1
- package/out/src/sdk/__test/validationHelpers.test.js +0 -20
- package/out/src/sdk/__test/validationHelpers.test.js.map +0 -1
- package/out/src/services/__tests/ARC.man.test.d.ts +0 -2
- package/out/src/services/__tests/ARC.man.test.d.ts.map +0 -1
- package/out/src/services/__tests/ARC.man.test.js +0 -104
- package/out/src/services/__tests/ARC.man.test.js.map +0 -1
- package/out/src/services/__tests/ARC.timeout.man.test.d.ts +0 -2
- package/out/src/services/__tests/ARC.timeout.man.test.d.ts.map +0 -1
- package/out/src/services/__tests/ARC.timeout.man.test.js +0 -74
- package/out/src/services/__tests/ARC.timeout.man.test.js.map +0 -1
- package/out/src/services/__tests/ArcGorillaPool.man.test.d.ts +0 -2
- package/out/src/services/__tests/ArcGorillaPool.man.test.d.ts.map +0 -1
- package/out/src/services/__tests/ArcGorillaPool.man.test.js +0 -93
- package/out/src/services/__tests/ArcGorillaPool.man.test.js.map +0 -1
- package/out/src/services/__tests/arcServices.test.d.ts +0 -2
- package/out/src/services/__tests/arcServices.test.d.ts.map +0 -1
- package/out/src/services/__tests/arcServices.test.js +0 -7
- package/out/src/services/__tests/arcServices.test.js.map +0 -1
- package/out/src/services/__tests/bitrails.test.d.ts +0 -2
- package/out/src/services/__tests/bitrails.test.d.ts.map +0 -1
- package/out/src/services/__tests/bitrails.test.js +0 -59
- package/out/src/services/__tests/bitrails.test.js.map +0 -1
- package/out/src/services/__tests/getFiatExchangeRate.test.d.ts +0 -2
- package/out/src/services/__tests/getFiatExchangeRate.test.d.ts.map +0 -1
- package/out/src/services/__tests/getFiatExchangeRate.test.js +0 -156
- package/out/src/services/__tests/getFiatExchangeRate.test.js.map +0 -1
- package/out/src/services/__tests/getMerklePath.test.d.ts +0 -2
- package/out/src/services/__tests/getMerklePath.test.d.ts.map +0 -1
- package/out/src/services/__tests/getMerklePath.test.js +0 -16
- package/out/src/services/__tests/getMerklePath.test.js.map +0 -1
- package/out/src/services/__tests/getRawTx.test.d.ts +0 -2
- package/out/src/services/__tests/getRawTx.test.d.ts.map +0 -1
- package/out/src/services/__tests/getRawTx.test.js +0 -16
- package/out/src/services/__tests/getRawTx.test.js.map +0 -1
- package/out/src/services/__tests/postBeef.test.d.ts +0 -2
- package/out/src/services/__tests/postBeef.test.d.ts.map +0 -1
- package/out/src/services/__tests/postBeef.test.js +0 -101
- package/out/src/services/__tests/postBeef.test.js.map +0 -1
- package/out/src/services/__tests/verifyBeef.test.d.ts +0 -2
- package/out/src/services/__tests/verifyBeef.test.d.ts.map +0 -1
- package/out/src/services/__tests/verifyBeef.test.js +0 -43
- package/out/src/services/__tests/verifyBeef.test.js.map +0 -1
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.d.ts +0 -2
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js +0 -25
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js.map +0 -1
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.d.ts +0 -2
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js +0 -27
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.js +0 -56
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.js +0 -40
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.js +0 -108
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.js +0 -87
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageKnex.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageKnex.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageKnex.test.js +0 -39
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageKnex.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.js +0 -75
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksCDN.man.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksCDN.man.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksCDN.man.test.js +0 -43
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksCDN.man.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.js +0 -164
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.d.ts +0 -12
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.js +0 -69
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/bulkIngestorFailures.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/__tests/bulkIngestorFailures.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/bulkIngestorFailures.test.js +0 -109
- package/out/src/services/chaintracker/chaintracks/__tests/bulkIngestorFailures.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.js +0 -54
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.js +0 -255
- package/out/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.js +0 -56
- package/out/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/HeightRange.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/util/__tests/HeightRange.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/HeightRange.test.js +0 -69
- package/out/src/services/chaintracker/chaintracks/util/__tests/HeightRange.test.js.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.d.ts +0 -2
- package/out/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.d.ts.map +0 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.js +0 -51
- package/out/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.js.map +0 -1
- package/out/src/services/providers/__tests/ArcSSEClient.test.d.ts +0 -2
- package/out/src/services/providers/__tests/ArcSSEClient.test.d.ts.map +0 -1
- package/out/src/services/providers/__tests/ArcSSEClient.test.js +0 -256
- package/out/src/services/providers/__tests/ArcSSEClient.test.js.map +0 -1
- package/out/src/services/providers/__tests/WhatsOnChain.test.d.ts +0 -2
- package/out/src/services/providers/__tests/WhatsOnChain.test.d.ts.map +0 -1
- package/out/src/services/providers/__tests/WhatsOnChain.test.js +0 -191
- package/out/src/services/providers/__tests/WhatsOnChain.test.js.map +0 -1
- package/out/src/services/providers/__tests/exchangeRates.test.d.ts +0 -2
- package/out/src/services/providers/__tests/exchangeRates.test.d.ts.map +0 -1
- package/out/src/services/providers/__tests/exchangeRates.test.js +0 -23
- package/out/src/services/providers/__tests/exchangeRates.test.js.map +0 -1
- package/out/src/storage/__test/StorageIdb.test.d.ts +0 -2
- package/out/src/storage/__test/StorageIdb.test.d.ts.map +0 -1
- package/out/src/storage/__test/StorageIdb.test.js +0 -44
- package/out/src/storage/__test/StorageIdb.test.js.map +0 -1
- package/out/src/storage/__test/WalletStorageManager.test.d.ts +0 -2
- package/out/src/storage/__test/WalletStorageManager.test.d.ts.map +0 -1
- package/out/src/storage/__test/WalletStorageManager.test.js +0 -254
- package/out/src/storage/__test/WalletStorageManager.test.js.map +0 -1
- package/out/src/storage/__test/adminStats.man.test.d.ts +0 -2
- package/out/src/storage/__test/adminStats.man.test.d.ts.map +0 -1
- package/out/src/storage/__test/adminStats.man.test.js +0 -78
- package/out/src/storage/__test/adminStats.man.test.js.map +0 -1
- package/out/src/storage/__test/findStaleMerkleRoots.test.d.ts +0 -2
- package/out/src/storage/__test/findStaleMerkleRoots.test.d.ts.map +0 -1
- package/out/src/storage/__test/findStaleMerkleRoots.test.js +0 -41
- package/out/src/storage/__test/findStaleMerkleRoots.test.js.map +0 -1
- package/out/src/storage/__test/findStaleMerkleRootsKnex.test.d.ts +0 -2
- package/out/src/storage/__test/findStaleMerkleRootsKnex.test.d.ts.map +0 -1
- package/out/src/storage/__test/findStaleMerkleRootsKnex.test.js +0 -73
- package/out/src/storage/__test/findStaleMerkleRootsKnex.test.js.map +0 -1
- package/out/src/storage/__test/getBeefForTransaction.test.d.ts +0 -2
- package/out/src/storage/__test/getBeefForTransaction.test.d.ts.map +0 -1
- package/out/src/storage/__test/getBeefForTransaction.test.js +0 -347
- package/out/src/storage/__test/getBeefForTransaction.test.js.map +0 -1
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.d.ts +0 -2
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.d.ts.map +0 -1
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js +0 -1111
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js.map +0 -1
- package/out/src/storage/methods/__test/offsetKey.test.d.ts +0 -2
- package/out/src/storage/methods/__test/offsetKey.test.d.ts.map +0 -1
- package/out/src/storage/methods/__test/offsetKey.test.js +0 -229
- package/out/src/storage/methods/__test/offsetKey.test.js.map +0 -1
- package/out/src/storage/remoting/__test/StorageClient.man.test.d.ts +0 -2
- package/out/src/storage/remoting/__test/StorageClient.man.test.d.ts.map +0 -1
- package/out/src/storage/remoting/__test/StorageClient.man.test.js +0 -487
- package/out/src/storage/remoting/__test/StorageClient.man.test.js.map +0 -1
- package/out/src/storage/remoting/__test/StorageClient.test.d.ts +0 -2
- package/out/src/storage/remoting/__test/StorageClient.test.d.ts.map +0 -1
- package/out/src/storage/remoting/__test/StorageClient.test.js +0 -119
- package/out/src/storage/remoting/__test/StorageClient.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js +0 -301
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js +0 -308
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js +0 -316
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js +0 -228
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js +0 -191
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js +0 -226
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/OutputTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js +0 -413
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js +0 -299
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +0 -474
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js +0 -234
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +0 -539
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js +0 -304
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js +0 -170
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js +0 -81
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js.map +0 -1
- package/out/src/storage/schema/entities/__tests/usersTests.test.d.ts +0 -2
- package/out/src/storage/schema/entities/__tests/usersTests.test.d.ts.map +0 -1
- package/out/src/storage/schema/entities/__tests/usersTests.test.js +0 -277
- package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +0 -1
- package/out/src/utility/__tests/utilityHelpers.noBuffer.test.d.ts +0 -2
- package/out/src/utility/__tests/utilityHelpers.noBuffer.test.d.ts.map +0 -1
- package/out/src/utility/__tests/utilityHelpers.noBuffer.test.js +0 -107
- package/out/src/utility/__tests/utilityHelpers.noBuffer.test.js.map +0 -1
- package/out/src/wab-client/__tests/WABClient.man.test.d.ts +0 -2
- package/out/src/wab-client/__tests/WABClient.man.test.d.ts.map +0 -1
- package/out/src/wab-client/__tests/WABClient.man.test.js +0 -52
- package/out/src/wab-client/__tests/WABClient.man.test.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CWIStyleWalletManager = exports.OverlayUMPTokenInteractor = exports.DEFAULT_PROFILE_ID = exports.ARGON2ID_DEFAULT_HASH_LENGTH = exports.ARGON2ID_DEFAULT_PARALLELISM = exports.ARGON2ID_DEFAULT_MEMORY_KIB = exports.ARGON2ID_DEFAULT_ITERATIONS = exports.PBKDF2_NUM_ROUNDS = void 0;
|
|
3
|
+
exports.CWIStyleWalletManager = exports.OverlayUMPTokenInteractor = exports.UMPTokenLookupError = exports.DEFAULT_PROFILE_ID = exports.MAX_STATE_SNAPSHOT_BYTES = exports.PBKDF2_MAX_ITERATIONS = exports.KDF_MAX_HASH_LENGTH = exports.ARGON2ID_MAX_PARALLELISM = exports.ARGON2ID_MAX_MEMORY_KIB = exports.ARGON2ID_MAX_ITERATIONS = exports.ARGON2ID_DEFAULT_HASH_LENGTH = exports.ARGON2ID_DEFAULT_PARALLELISM = exports.ARGON2ID_DEFAULT_MEMORY_KIB = exports.ARGON2ID_DEFAULT_ITERATIONS = exports.PBKDF2_NUM_ROUNDS = void 0;
|
|
4
4
|
const sdk_1 = require("@bsv/sdk");
|
|
5
|
-
const hash_wasm_1 = require("hash-wasm");
|
|
6
5
|
const PrivilegedKeyManager_1 = require("./sdk/PrivilegedKeyManager");
|
|
6
|
+
const hashWasm_1 = require("./utility/hashWasm");
|
|
7
7
|
/**
|
|
8
8
|
* Number of rounds used in PBKDF2 for deriving password keys.
|
|
9
9
|
*/
|
|
@@ -15,6 +15,72 @@ exports.ARGON2ID_DEFAULT_ITERATIONS = 7;
|
|
|
15
15
|
exports.ARGON2ID_DEFAULT_MEMORY_KIB = 131072;
|
|
16
16
|
exports.ARGON2ID_DEFAULT_PARALLELISM = 1;
|
|
17
17
|
exports.ARGON2ID_DEFAULT_HASH_LENGTH = 32;
|
|
18
|
+
exports.ARGON2ID_MAX_ITERATIONS = 20;
|
|
19
|
+
exports.ARGON2ID_MAX_MEMORY_KIB = 262144;
|
|
20
|
+
exports.ARGON2ID_MAX_PARALLELISM = 16;
|
|
21
|
+
exports.KDF_MAX_HASH_LENGTH = 64;
|
|
22
|
+
exports.PBKDF2_MAX_ITERATIONS = 10_000_000;
|
|
23
|
+
exports.MAX_STATE_SNAPSHOT_BYTES = 16 * 1024 * 1024;
|
|
24
|
+
function isPositiveIntegerInRange(value, maximum) {
|
|
25
|
+
return typeof value === 'number' && Number.isInteger(value) && value > 0 && value <= maximum;
|
|
26
|
+
}
|
|
27
|
+
function isValidKdfConfig(kdf) {
|
|
28
|
+
if (kdf == null)
|
|
29
|
+
return false;
|
|
30
|
+
if (!isPositiveIntegerInRange(kdf.iterations, kdf.algorithm === 'argon2id' ? exports.ARGON2ID_MAX_ITERATIONS : exports.PBKDF2_MAX_ITERATIONS)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (kdf.algorithm === 'pbkdf2-sha512') {
|
|
34
|
+
return kdf.hashLength === undefined || isPositiveIntegerInRange(kdf.hashLength, exports.KDF_MAX_HASH_LENGTH);
|
|
35
|
+
}
|
|
36
|
+
if (kdf.algorithm !== 'argon2id')
|
|
37
|
+
return false;
|
|
38
|
+
return (isPositiveIntegerInRange(kdf.memoryKiB, exports.ARGON2ID_MAX_MEMORY_KIB) &&
|
|
39
|
+
isPositiveIntegerInRange(kdf.parallelism, exports.ARGON2ID_MAX_PARALLELISM) &&
|
|
40
|
+
isPositiveIntegerInRange(kdf.hashLength, exports.KDF_MAX_HASH_LENGTH));
|
|
41
|
+
}
|
|
42
|
+
function findKdfVersionFieldIndex(protocolFields) {
|
|
43
|
+
const hasMetadataWithProfiles = protocolFields.length >= 15 &&
|
|
44
|
+
protocolFields[12]?.length === 1 &&
|
|
45
|
+
protocolFields[12][0] === 3;
|
|
46
|
+
if (hasMetadataWithProfiles)
|
|
47
|
+
return 12;
|
|
48
|
+
const hasMetadataWithoutProfiles = protocolFields.length >= 14 &&
|
|
49
|
+
protocolFields[11]?.length === 1 &&
|
|
50
|
+
protocolFields[11][0] === 3;
|
|
51
|
+
return hasMetadataWithoutProfiles ? 11 : -1;
|
|
52
|
+
}
|
|
53
|
+
function addProfilesField(token, protocolFields, kdfVersionFieldIndex) {
|
|
54
|
+
const hasProfilesField = kdfVersionFieldIndex === 12 || (kdfVersionFieldIndex !== 11 && protocolFields[11] != null);
|
|
55
|
+
if (!hasProfilesField || protocolFields[11].length === 0)
|
|
56
|
+
return true;
|
|
57
|
+
if (protocolFields[11].length > exports.MAX_STATE_SNAPSHOT_BYTES)
|
|
58
|
+
return false;
|
|
59
|
+
token.profilesEncrypted = protocolFields[11];
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
function addPasswordKdf(token, protocolFields, kdfVersionFieldIndex) {
|
|
63
|
+
if (kdfVersionFieldIndex === -1)
|
|
64
|
+
return true;
|
|
65
|
+
const kdfAlgorithmField = protocolFields[kdfVersionFieldIndex + 1];
|
|
66
|
+
const kdfParamsField = protocolFields[kdfVersionFieldIndex + 2];
|
|
67
|
+
if (kdfAlgorithmField == null || kdfParamsField == null || kdfParamsField.length > 1024) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const kdfParams = JSON.parse(sdk_1.Utils.toUTF8(kdfParamsField));
|
|
71
|
+
const passwordKdf = {
|
|
72
|
+
algorithm: sdk_1.Utils.toUTF8(kdfAlgorithmField),
|
|
73
|
+
iterations: kdfParams.iterations,
|
|
74
|
+
memoryKiB: kdfParams.memoryKiB,
|
|
75
|
+
parallelism: kdfParams.parallelism,
|
|
76
|
+
hashLength: kdfParams.hashLength
|
|
77
|
+
};
|
|
78
|
+
if (!isValidKdfConfig(passwordKdf))
|
|
79
|
+
return false;
|
|
80
|
+
token.umpVersion = 3;
|
|
81
|
+
token.passwordKdf = passwordKdf;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
18
84
|
function isLikelyDerSignatureField(field) {
|
|
19
85
|
if (!field || field.length < 8 || field.length > 80) {
|
|
20
86
|
return false;
|
|
@@ -39,12 +105,12 @@ function stripVerifiedPushDropSignature(fields, lockingPublicKey) {
|
|
|
39
105
|
for (let i = 0; i < protocolFieldCount; i++) {
|
|
40
106
|
dataLength += fields[i].length;
|
|
41
107
|
}
|
|
42
|
-
const dataToVerify =
|
|
108
|
+
const dataToVerify = Array.from({ length: dataLength }, () => 0);
|
|
43
109
|
let writeOffset = 0;
|
|
44
110
|
for (let i = 0; i < protocolFieldCount; i++) {
|
|
45
111
|
const field = fields[i];
|
|
46
|
-
for (
|
|
47
|
-
dataToVerify[writeOffset++] =
|
|
112
|
+
for (const byte of field) {
|
|
113
|
+
dataToVerify[writeOffset++] = byte;
|
|
48
114
|
}
|
|
49
115
|
}
|
|
50
116
|
const signature = sdk_1.Signature.fromDER(trailingField);
|
|
@@ -52,7 +118,7 @@ function stripVerifiedPushDropSignature(fields, lockingPublicKey) {
|
|
|
52
118
|
return fields.slice(0, protocolFieldCount);
|
|
53
119
|
}
|
|
54
120
|
}
|
|
55
|
-
catch
|
|
121
|
+
catch {
|
|
56
122
|
return fields;
|
|
57
123
|
}
|
|
58
124
|
return fields;
|
|
@@ -68,13 +134,12 @@ function stripVerifiedPushDropSignature(fields, lockingPublicKey) {
|
|
|
68
134
|
* @returns Derived key bytes.
|
|
69
135
|
*/
|
|
70
136
|
async function pbkdf2NativeOrWasm(passwordBytes, salt, iterations, keyLen, hash = 'sha512') {
|
|
71
|
-
var _a;
|
|
72
137
|
// ----- fast-path: WebCrypto (both browser & recent Node expose globalThis.crypto.subtle)
|
|
73
|
-
const subtle =
|
|
74
|
-
if (subtle) {
|
|
138
|
+
const subtle = globalThis?.crypto?.subtle;
|
|
139
|
+
if (subtle != null) {
|
|
75
140
|
try {
|
|
76
141
|
const baseKey = await subtle.importKey('raw', new Uint8Array(passwordBytes), { name: 'PBKDF2' },
|
|
77
|
-
/*extractable*/ false, ['deriveBits']);
|
|
142
|
+
/* extractable */ false, ['deriveBits']);
|
|
78
143
|
const bits = await subtle.deriveBits({
|
|
79
144
|
name: 'PBKDF2',
|
|
80
145
|
salt: new Uint8Array(salt),
|
|
@@ -83,13 +148,13 @@ async function pbkdf2NativeOrWasm(passwordBytes, salt, iterations, keyLen, hash
|
|
|
83
148
|
}, baseKey, keyLen * 8);
|
|
84
149
|
return Array.from(new Uint8Array(bits));
|
|
85
150
|
}
|
|
86
|
-
catch
|
|
87
|
-
//
|
|
88
|
-
|
|
151
|
+
catch {
|
|
152
|
+
// WebCrypto is unavailable or refused the algorithm (e.g. non-secure context, old
|
|
153
|
+
// Safari). Fall through to the pure-JS hash-wasm implementation below.
|
|
89
154
|
}
|
|
90
155
|
}
|
|
91
|
-
const hashFunction = hash === 'sha256' ? (0,
|
|
92
|
-
const derived = await (0,
|
|
156
|
+
const hashFunction = hash === 'sha256' ? (0, hashWasm_1.createSHA256)() : (0, hashWasm_1.createSHA512)();
|
|
157
|
+
const derived = await (0, hashWasm_1.pbkdf2)({
|
|
93
158
|
password: new Uint8Array(passwordBytes),
|
|
94
159
|
salt: new Uint8Array(salt),
|
|
95
160
|
iterations,
|
|
@@ -110,19 +175,21 @@ async function pbkdf2NativeOrWasm(passwordBytes, salt, iterations, keyLen, hash
|
|
|
110
175
|
* @returns Derived password key bytes.
|
|
111
176
|
*/
|
|
112
177
|
async function derivePasswordKey(token, passwordBytes, overrideKdf) {
|
|
113
|
-
var _a, _b, _c, _d, _e;
|
|
114
178
|
const kdf = overrideKdf || token.passwordKdf;
|
|
179
|
+
if (kdf != null && !isValidKdfConfig(kdf)) {
|
|
180
|
+
throw new Error('UMP token contains unsupported or unsafe KDF parameters.');
|
|
181
|
+
}
|
|
115
182
|
// Legacy token or explicit PBKDF2 request
|
|
116
|
-
if (
|
|
117
|
-
return pbkdf2NativeOrWasm(passwordBytes, token.passwordSalt,
|
|
183
|
+
if (kdf == null || kdf.algorithm === 'pbkdf2-sha512') {
|
|
184
|
+
return await pbkdf2NativeOrWasm(passwordBytes, token.passwordSalt, kdf?.iterations ?? exports.PBKDF2_NUM_ROUNDS, 32, 'sha512');
|
|
118
185
|
}
|
|
119
186
|
// Argon2id path (UMP v3)
|
|
120
187
|
if (kdf.algorithm === 'argon2id') {
|
|
121
|
-
const iterations =
|
|
122
|
-
const memorySize =
|
|
123
|
-
const parallelism =
|
|
124
|
-
const hashLength =
|
|
125
|
-
const hash = await (0,
|
|
188
|
+
const iterations = kdf.iterations ?? exports.ARGON2ID_DEFAULT_ITERATIONS;
|
|
189
|
+
const memorySize = kdf.memoryKiB ?? exports.ARGON2ID_DEFAULT_MEMORY_KIB;
|
|
190
|
+
const parallelism = kdf.parallelism ?? exports.ARGON2ID_DEFAULT_PARALLELISM;
|
|
191
|
+
const hashLength = kdf.hashLength ?? exports.ARGON2ID_DEFAULT_HASH_LENGTH;
|
|
192
|
+
const hash = await (0, hashWasm_1.argon2id)({
|
|
126
193
|
password: new Uint8Array(passwordBytes),
|
|
127
194
|
salt: new Uint8Array(token.passwordSalt),
|
|
128
195
|
iterations,
|
|
@@ -139,6 +206,43 @@ async function derivePasswordKey(token, passwordBytes, overrideKdf) {
|
|
|
139
206
|
* Unique Identifier for the default profile (16 zero bytes).
|
|
140
207
|
*/
|
|
141
208
|
exports.DEFAULT_PROFILE_ID = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
209
|
+
function isByteArrayOfLength(value, length) {
|
|
210
|
+
return (Array.isArray(value) &&
|
|
211
|
+
value.length === length &&
|
|
212
|
+
value.every(byte => Number.isInteger(byte) && byte >= 0 && byte <= 255));
|
|
213
|
+
}
|
|
214
|
+
function isValidProfile(value) {
|
|
215
|
+
if (value == null || typeof value !== 'object')
|
|
216
|
+
return false;
|
|
217
|
+
const profile = value;
|
|
218
|
+
return (typeof profile.name === 'string' &&
|
|
219
|
+
profile.name.length > 0 &&
|
|
220
|
+
profile.name.length <= 250 &&
|
|
221
|
+
isByteArrayOfLength(profile.id, 16) &&
|
|
222
|
+
isByteArrayOfLength(profile.primaryPad, 32) &&
|
|
223
|
+
isByteArrayOfLength(profile.privilegedPad, 32) &&
|
|
224
|
+
typeof profile.createdAt === 'number' &&
|
|
225
|
+
Number.isFinite(profile.createdAt) &&
|
|
226
|
+
profile.createdAt >= 0);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Raised when a UMP lookup yields neither a verified token nor a clean empty response.
|
|
230
|
+
*
|
|
231
|
+
* Callers must offer retry/recovery rather than treating this error as a new
|
|
232
|
+
* account. Diagnostics contain counts only and never hashes, keys, or tokens.
|
|
233
|
+
*/
|
|
234
|
+
class UMPTokenLookupError extends Error {
|
|
235
|
+
reason;
|
|
236
|
+
diagnostics;
|
|
237
|
+
code = 'WERR_UMP_LOOKUP_INDETERMINATE';
|
|
238
|
+
constructor(reason, diagnostics, options) {
|
|
239
|
+
super('Unable to determine whether the wallet account already exists. Retry or use account recovery.', options);
|
|
240
|
+
this.reason = reason;
|
|
241
|
+
this.diagnostics = diagnostics;
|
|
242
|
+
this.name = 'UMPTokenLookupError';
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
exports.UMPTokenLookupError = UMPTokenLookupError;
|
|
142
246
|
/**
|
|
143
247
|
* @class OverlayUMPTokenInteractor
|
|
144
248
|
*
|
|
@@ -152,15 +256,26 @@ exports.DEFAULT_PROFILE_ID = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
|
152
256
|
* 3) Consuming (spending) an old token if provided.
|
|
153
257
|
*/
|
|
154
258
|
class OverlayUMPTokenInteractor {
|
|
259
|
+
/**
|
|
260
|
+
* A `LookupResolver` instance used to query overlay networks.
|
|
261
|
+
*/
|
|
262
|
+
resolver;
|
|
263
|
+
/**
|
|
264
|
+
* A SHIP broadcaster that can be used to publish updated UMP tokens
|
|
265
|
+
* under the `tm_users` topic to overlay service peers.
|
|
266
|
+
*/
|
|
267
|
+
broadcaster;
|
|
268
|
+
telemetry;
|
|
155
269
|
/**
|
|
156
270
|
* Construct a new OverlayUMPTokenInteractor.
|
|
157
271
|
*
|
|
158
272
|
* @param resolver A LookupResolver instance for performing overlay queries (ls_users).
|
|
159
273
|
* @param broadcaster A SHIPBroadcaster instance for sharing new or updated tokens across the `tm_users` overlay.
|
|
160
274
|
*/
|
|
161
|
-
constructor(resolver = new sdk_1.LookupResolver(), broadcaster = new sdk_1.SHIPBroadcaster(['tm_users'])) {
|
|
275
|
+
constructor(resolver = new sdk_1.LookupResolver(), broadcaster = new sdk_1.SHIPBroadcaster(['tm_users']), telemetry) {
|
|
162
276
|
this.resolver = resolver;
|
|
163
277
|
this.broadcaster = broadcaster;
|
|
278
|
+
this.telemetry = new sdk_1.Telemetry(telemetry);
|
|
164
279
|
}
|
|
165
280
|
/**
|
|
166
281
|
* Finds a UMP token on-chain by the given presentation key hash, if it exists.
|
|
@@ -170,13 +285,10 @@ class OverlayUMPTokenInteractor {
|
|
|
170
285
|
* @returns A UMPToken object (including currentOutpoint) if found, otherwise undefined.
|
|
171
286
|
*/
|
|
172
287
|
async findByPresentationKeyHash(hash) {
|
|
173
|
-
|
|
174
|
-
const question = {
|
|
288
|
+
return await this.findToken({
|
|
175
289
|
service: 'ls_users',
|
|
176
290
|
query: { presentationHash: sdk_1.Utils.toHex(hash) }
|
|
177
|
-
};
|
|
178
|
-
const answer = await this.resolver.query(question);
|
|
179
|
-
return this.parseLookupAnswer(answer);
|
|
291
|
+
}, 'presentation');
|
|
180
292
|
}
|
|
181
293
|
/**
|
|
182
294
|
* Finds a UMP token on-chain by the given recovery key hash, if it exists.
|
|
@@ -186,12 +298,258 @@ class OverlayUMPTokenInteractor {
|
|
|
186
298
|
* @returns A UMPToken object (including currentOutpoint) if found, otherwise undefined.
|
|
187
299
|
*/
|
|
188
300
|
async findByRecoveryKeyHash(hash) {
|
|
189
|
-
|
|
301
|
+
return await this.findToken({
|
|
190
302
|
service: 'ls_users',
|
|
191
303
|
query: { recoveryHash: sdk_1.Utils.toHex(hash) }
|
|
304
|
+
}, 'recovery');
|
|
305
|
+
}
|
|
306
|
+
async findToken(question, lookupKind) {
|
|
307
|
+
const correlationId = this.telemetry.enabled === true ? this.telemetry.createCorrelationId() : undefined;
|
|
308
|
+
const startedAt = Date.now();
|
|
309
|
+
this.telemetry.capture({
|
|
310
|
+
name: 'wallet-toolbox.ump.lookup.started',
|
|
311
|
+
component: 'wallet-toolbox.ump',
|
|
312
|
+
severity: 'debug',
|
|
313
|
+
correlationId,
|
|
314
|
+
attributes: { lookupKind }
|
|
315
|
+
});
|
|
316
|
+
let resolution;
|
|
317
|
+
try {
|
|
318
|
+
resolution = await this.resolver.queryDetailed(question, undefined, {
|
|
319
|
+
waitForAllHosts: true,
|
|
320
|
+
correlationId
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
catch (error) {
|
|
324
|
+
const diagnostics = this.emptyLookupDiagnostics(correlationId);
|
|
325
|
+
this.captureLookupFailure(lookupKind, 'lookup-unavailable', diagnostics, startedAt, error);
|
|
326
|
+
throw new UMPTokenLookupError('lookup-unavailable', diagnostics, { cause: error });
|
|
327
|
+
}
|
|
328
|
+
const diagnostics = this.toLookupDiagnostics(resolution);
|
|
329
|
+
const tokens = this.parseLookupAnswers(resolution.answer);
|
|
330
|
+
const expectedHash = question.query[lookupKind === 'presentation' ? 'presentationHash' : 'recoveryHash'].toLowerCase();
|
|
331
|
+
const matchingTokens = tokens.filter(token => sdk_1.Utils.toHex(lookupKind === 'presentation' ? token.presentationHash : token.recoveryHash).toLowerCase() ===
|
|
332
|
+
expectedHash);
|
|
333
|
+
// A verified token is positive account-existence evidence. Empty, malformed,
|
|
334
|
+
// rejected, or unavailable peers cannot override it. The resolver de-duplicates
|
|
335
|
+
// identical outputs, so multiple matching tokens represent distinct records.
|
|
336
|
+
// Competing records are usually stale renditions: a token update spends its
|
|
337
|
+
// predecessor's outpoint, so the newest rendition is the sole candidate not
|
|
338
|
+
// spent by another candidate's transaction history. Only unrelated (forked)
|
|
339
|
+
// tokens remain indeterminate.
|
|
340
|
+
if (matchingTokens.length > 1) {
|
|
341
|
+
const newest = this.resolveNewestToken(matchingTokens, resolution.answer.outputs);
|
|
342
|
+
if (newest != null) {
|
|
343
|
+
this.captureLookupCompleted(lookupKind, 'found', diagnostics, startedAt, {
|
|
344
|
+
supersededTokens: matchingTokens.length - 1
|
|
345
|
+
});
|
|
346
|
+
return newest;
|
|
347
|
+
}
|
|
348
|
+
const reason = 'token-ambiguous';
|
|
349
|
+
this.captureLookupFailure(lookupKind, reason, diagnostics, startedAt);
|
|
350
|
+
throw new UMPTokenLookupError(reason, diagnostics);
|
|
351
|
+
}
|
|
352
|
+
if (matchingTokens.length === 1) {
|
|
353
|
+
this.captureLookupCompleted(lookupKind, 'found', diagnostics, startedAt);
|
|
354
|
+
return matchingTokens[0];
|
|
355
|
+
}
|
|
356
|
+
// A clean empty response is sufficient negative evidence once no verified
|
|
357
|
+
// token exists. Malformed outputs and failed peers are ignored so they cannot
|
|
358
|
+
// deny onboarding by advertising corrupt data or remaining unavailable.
|
|
359
|
+
if (resolution.progress.emptyHosts > 0) {
|
|
360
|
+
this.captureLookupCompleted(lookupKind, 'not-found', diagnostics, startedAt);
|
|
361
|
+
return undefined;
|
|
362
|
+
}
|
|
363
|
+
const reason = resolution.answer.outputs.length > 0 ? 'token-malformed' : 'lookup-incomplete';
|
|
364
|
+
this.captureLookupFailure(lookupKind, reason, diagnostics, startedAt);
|
|
365
|
+
throw new UMPTokenLookupError(reason, diagnostics);
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Picks the newest rendition among distinct verified tokens, when possible.
|
|
369
|
+
*
|
|
370
|
+
* The on-chain UMP protocol expresses token updates by consumption: the
|
|
371
|
+
* transaction creating a new rendition spends the previous rendition's
|
|
372
|
+
* outpoint (there is no rendition counter field in the current format).
|
|
373
|
+
* A candidate is therefore superseded when any other candidate's ancestry
|
|
374
|
+
* (available from its BEEF) spends the candidate's outpoint.
|
|
375
|
+
*
|
|
376
|
+
* @returns The single unsuperseded candidate, or undefined when supersession
|
|
377
|
+
* cannot be established for every stale candidate (e.g. forked tokens).
|
|
378
|
+
*/
|
|
379
|
+
resolveNewestToken(matchingTokens, outputs) {
|
|
380
|
+
const candidates = new Map();
|
|
381
|
+
for (const token of matchingTokens) {
|
|
382
|
+
if (token.currentOutpoint == null)
|
|
383
|
+
return undefined;
|
|
384
|
+
candidates.set(token.currentOutpoint, token);
|
|
385
|
+
}
|
|
386
|
+
// Hosts may serve the same token with different BEEF depth, so evidence
|
|
387
|
+
// for a candidate is merged across every copy rather than first-wins: a
|
|
388
|
+
// shallow copy must not mask the supersession proof a deeper copy carries.
|
|
389
|
+
const evidenceByCandidate = new Map();
|
|
390
|
+
for (const output of outputs) {
|
|
391
|
+
try {
|
|
392
|
+
const tx = sdk_1.Transaction.fromBEEF(output.beef);
|
|
393
|
+
const outpoint = `${tx.id('hex')}.${output.outputIndex}`;
|
|
394
|
+
if (!candidates.has(outpoint))
|
|
395
|
+
continue;
|
|
396
|
+
const evidence = evidenceByCandidate.get(outpoint) ?? { txs: [], spent: new Set() };
|
|
397
|
+
evidence.txs.push(tx);
|
|
398
|
+
this.collectSpentOutpoints(tx, evidence.spent, new Set());
|
|
399
|
+
evidenceByCandidate.set(outpoint, evidence);
|
|
400
|
+
}
|
|
401
|
+
catch {
|
|
402
|
+
// Malformed outputs never produced candidates; nothing to correlate.
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
// Without an evidence transaction for every candidate, an unexamined
|
|
406
|
+
// candidate would trivially survive — refuse to guess.
|
|
407
|
+
if (evidenceByCandidate.size !== candidates.size)
|
|
408
|
+
return undefined;
|
|
409
|
+
const survivors = [...candidates.keys()].filter(outpoint => ![...evidenceByCandidate.entries()].some(([other, { spent }]) => other !== outpoint && spent.has(outpoint)));
|
|
410
|
+
if (survivors.length === 1)
|
|
411
|
+
return candidates.get(survivors[0]);
|
|
412
|
+
// Forked candidates: no spend relationship connects them. Updating a token
|
|
413
|
+
// requires unlocking its predecessor, so a candidate whose transaction
|
|
414
|
+
// provably consumed a same-identity token demonstrates continuity of key
|
|
415
|
+
// control; a freshly minted competitor (funding inputs only) is the anomaly
|
|
416
|
+
// — typically a historical erroneous re-onboarding. Prefer the sole proven
|
|
417
|
+
// continuation; anything less decisive stays indeterminate.
|
|
418
|
+
const provenContinuations = survivors.filter(outpoint => {
|
|
419
|
+
const evidence = evidenceByCandidate.get(outpoint);
|
|
420
|
+
const token = candidates.get(outpoint);
|
|
421
|
+
return (evidence != null && token != null && evidence.txs.some(tx => this.consumesSameIdentityToken(tx, token)));
|
|
422
|
+
});
|
|
423
|
+
if (provenContinuations.length !== 1)
|
|
424
|
+
return undefined;
|
|
425
|
+
return candidates.get(provenContinuations[0]);
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Whether `tx` spends an input whose source output (available in the BEEF)
|
|
429
|
+
* decodes as a UMP token sharing the candidate's presentation or recovery
|
|
430
|
+
* hash — on-chain proof that the candidate is an update of a same-identity
|
|
431
|
+
* predecessor rather than an independently minted token.
|
|
432
|
+
*/
|
|
433
|
+
consumesSameIdentityToken(tx, token) {
|
|
434
|
+
const presentationHash = sdk_1.Utils.toHex(token.presentationHash);
|
|
435
|
+
const recoveryHash = sdk_1.Utils.toHex(token.recoveryHash);
|
|
436
|
+
for (const input of tx.inputs) {
|
|
437
|
+
const source = input.sourceTransaction;
|
|
438
|
+
if (source == null || input.sourceOutputIndex == null)
|
|
439
|
+
continue;
|
|
440
|
+
const sourceOutput = source.outputs[input.sourceOutputIndex];
|
|
441
|
+
if (sourceOutput == null)
|
|
442
|
+
continue;
|
|
443
|
+
try {
|
|
444
|
+
const decoded = sdk_1.PushDrop.decode(sourceOutput.lockingScript);
|
|
445
|
+
if (decoded.fields == null)
|
|
446
|
+
continue;
|
|
447
|
+
const fields = stripVerifiedPushDropSignature(decoded.fields, decoded.lockingPublicKey);
|
|
448
|
+
if (fields.length < 11 || fields[6]?.length !== 32 || fields[7]?.length !== 32)
|
|
449
|
+
continue;
|
|
450
|
+
if (sdk_1.Utils.toHex(fields[6]) === presentationHash || sdk_1.Utils.toHex(fields[7]) === recoveryHash) {
|
|
451
|
+
return true;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
catch {
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Accumulates every outpoint spent by `tx` and by the ancestor transactions
|
|
462
|
+
* embedded in its BEEF, so supersession is detected even when intermediate
|
|
463
|
+
* renditions are absent from the lookup answer. Iterative so arbitrarily
|
|
464
|
+
* long update chains cannot exhaust the call stack.
|
|
465
|
+
*/
|
|
466
|
+
collectSpentOutpoints(tx, spent, visited) {
|
|
467
|
+
const pending = [tx];
|
|
468
|
+
while (pending.length > 0) {
|
|
469
|
+
const current = pending.pop();
|
|
470
|
+
const txid = current.id('hex');
|
|
471
|
+
if (visited.has(txid))
|
|
472
|
+
continue;
|
|
473
|
+
visited.add(txid);
|
|
474
|
+
for (const input of current.inputs) {
|
|
475
|
+
const sourceTxid = input.sourceTXID ?? input.sourceTransaction?.id('hex');
|
|
476
|
+
if (sourceTxid == null || input.sourceOutputIndex == null)
|
|
477
|
+
continue;
|
|
478
|
+
spent.add(`${sourceTxid}.${input.sourceOutputIndex}`);
|
|
479
|
+
if (input.sourceTransaction != null) {
|
|
480
|
+
pending.push(input.sourceTransaction);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
emptyLookupDiagnostics(correlationId) {
|
|
486
|
+
return {
|
|
487
|
+
hostCount: 0,
|
|
488
|
+
completedHosts: 0,
|
|
489
|
+
successfulHosts: 0,
|
|
490
|
+
emptyHosts: 0,
|
|
491
|
+
failedHosts: 0,
|
|
492
|
+
rejectedHosts: 0,
|
|
493
|
+
freeformHosts: 0,
|
|
494
|
+
outputCount: 0,
|
|
495
|
+
...(correlationId !== undefined ? { correlationId } : {})
|
|
192
496
|
};
|
|
193
|
-
|
|
194
|
-
|
|
497
|
+
}
|
|
498
|
+
toLookupDiagnostics(resolution) {
|
|
499
|
+
const progress = resolution.progress;
|
|
500
|
+
return {
|
|
501
|
+
hostCount: progress.hostCount,
|
|
502
|
+
completedHosts: progress.completedHosts,
|
|
503
|
+
successfulHosts: progress.successfulHosts,
|
|
504
|
+
emptyHosts: progress.emptyHosts,
|
|
505
|
+
failedHosts: progress.failedHosts,
|
|
506
|
+
rejectedHosts: progress.rejectedHosts,
|
|
507
|
+
freeformHosts: progress.freeformHosts,
|
|
508
|
+
outputCount: resolution.answer.outputs.length,
|
|
509
|
+
...(progress.correlationId !== undefined ? { correlationId: progress.correlationId } : {})
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
lookupDiagnosticAttributes(diagnostics) {
|
|
513
|
+
return {
|
|
514
|
+
hostCount: diagnostics.hostCount,
|
|
515
|
+
completedHosts: diagnostics.completedHosts,
|
|
516
|
+
successfulHosts: diagnostics.successfulHosts,
|
|
517
|
+
emptyHosts: diagnostics.emptyHosts,
|
|
518
|
+
failedHosts: diagnostics.failedHosts,
|
|
519
|
+
rejectedHosts: diagnostics.rejectedHosts,
|
|
520
|
+
freeformHosts: diagnostics.freeformHosts,
|
|
521
|
+
outputCount: diagnostics.outputCount
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
captureLookupCompleted(lookupKind, result, diagnostics, startedAt, extraAttributes = {}) {
|
|
525
|
+
this.telemetry.capture({
|
|
526
|
+
name: 'wallet-toolbox.ump.lookup.completed',
|
|
527
|
+
component: 'wallet-toolbox.ump',
|
|
528
|
+
severity: 'info',
|
|
529
|
+
correlationId: diagnostics.correlationId,
|
|
530
|
+
attributes: {
|
|
531
|
+
lookupKind,
|
|
532
|
+
result,
|
|
533
|
+
durationMs: Date.now() - startedAt,
|
|
534
|
+
...this.lookupDiagnosticAttributes(diagnostics),
|
|
535
|
+
...extraAttributes
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
captureLookupFailure(lookupKind, reason, diagnostics, startedAt, error) {
|
|
540
|
+
this.telemetry.capture({
|
|
541
|
+
name: 'wallet-toolbox.ump.lookup.indeterminate',
|
|
542
|
+
component: 'wallet-toolbox.ump',
|
|
543
|
+
severity: 'warn',
|
|
544
|
+
correlationId: diagnostics.correlationId,
|
|
545
|
+
attributes: {
|
|
546
|
+
lookupKind,
|
|
547
|
+
reason,
|
|
548
|
+
durationMs: Date.now() - startedAt,
|
|
549
|
+
...this.lookupDiagnosticAttributes(diagnostics)
|
|
550
|
+
},
|
|
551
|
+
error
|
|
552
|
+
});
|
|
195
553
|
}
|
|
196
554
|
/**
|
|
197
555
|
* Creates or updates (replaces) a UMP token on-chain. If `oldTokenToConsume` is provided,
|
|
@@ -207,7 +565,38 @@ class OverlayUMPTokenInteractor {
|
|
|
207
565
|
*/
|
|
208
566
|
async buildAndSend(wallet, // This wallet MUST be the one built for the default profile
|
|
209
567
|
adminOriginator, token, oldTokenToConsume) {
|
|
210
|
-
// 1) Construct the data fields for the new UMP token.
|
|
568
|
+
// 1) Construct the data fields and PushDrop locking script for the new UMP token.
|
|
569
|
+
const fields = this.buildUMPTokenFields(token);
|
|
570
|
+
const script = await new sdk_1.PushDrop(wallet, adminOriginator).lock(fields, [2, 'admin user management token'], '1', 'self',
|
|
571
|
+
/* forSelf= */ true,
|
|
572
|
+
/* includeSignature= */ true);
|
|
573
|
+
const tokenOutput = [{ lockingScript: script.toHex(), satoshis: 1, outputDescription: 'New UMP token output' }];
|
|
574
|
+
// 2) Resolve the old-token input (if provided) and create the action.
|
|
575
|
+
const { resolvedOldToken, inputToken } = await this.resolveOldTokenInput(oldTokenToConsume);
|
|
576
|
+
const inputs = resolvedOldToken?.currentOutpoint
|
|
577
|
+
? [
|
|
578
|
+
{
|
|
579
|
+
outpoint: resolvedOldToken.currentOutpoint,
|
|
580
|
+
unlockingScriptLength: 73,
|
|
581
|
+
inputDescription: 'Consume old UMP token'
|
|
582
|
+
}
|
|
583
|
+
]
|
|
584
|
+
: [];
|
|
585
|
+
const createResult = await this.createUMPAction(wallet, adminOriginator, inputs, tokenOutput, inputToken, resolvedOldToken);
|
|
586
|
+
// 3) If the wallet fully processed it (no signable tx), broadcast and return.
|
|
587
|
+
if (!createResult.signableTransaction) {
|
|
588
|
+
return await this.broadcastFinishedUMPAction(createResult);
|
|
589
|
+
}
|
|
590
|
+
// 4) Sign and broadcast: with old token input or without.
|
|
591
|
+
const reference = createResult.signableTransaction.reference;
|
|
592
|
+
const partialTx = sdk_1.Transaction.fromBEEF(createResult.signableTransaction.tx);
|
|
593
|
+
if (resolvedOldToken?.currentOutpoint) {
|
|
594
|
+
return await this.signAndBroadcastWithOldToken(wallet, adminOriginator, reference, partialTx);
|
|
595
|
+
}
|
|
596
|
+
return await this.signAndBroadcastNewToken(wallet, adminOriginator, reference);
|
|
597
|
+
}
|
|
598
|
+
/** Assembles the ordered number[][] fields array from a UMPToken. */
|
|
599
|
+
buildUMPTokenFields(token) {
|
|
211
600
|
const fields = [];
|
|
212
601
|
fields[0] = token.passwordSalt;
|
|
213
602
|
fields[1] = token.passwordPresentationPrimary;
|
|
@@ -220,146 +609,110 @@ class OverlayUMPTokenInteractor {
|
|
|
220
609
|
fields[8] = token.presentationKeyEncrypted;
|
|
221
610
|
fields[9] = token.passwordKeyEncrypted;
|
|
222
611
|
fields[10] = token.recoveryKeyEncrypted;
|
|
223
|
-
|
|
224
|
-
if (token.profilesEncrypted) {
|
|
612
|
+
if (token.profilesEncrypted != null)
|
|
225
613
|
fields[11] = token.profilesEncrypted;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
// Construct kdfParams JSON
|
|
233
|
-
const kdfParams = {
|
|
234
|
-
iterations: token.passwordKdf.iterations
|
|
235
|
-
};
|
|
236
|
-
if (token.passwordKdf.memoryKiB !== undefined) {
|
|
614
|
+
if (token.umpVersion === 3 && token.passwordKdf != null) {
|
|
615
|
+
const vi = token.profilesEncrypted == null ? 11 : 12;
|
|
616
|
+
fields[vi] = [token.umpVersion];
|
|
617
|
+
fields[vi + 1] = sdk_1.Utils.toArray(token.passwordKdf.algorithm, 'utf8');
|
|
618
|
+
const kdfParams = { iterations: token.passwordKdf.iterations };
|
|
619
|
+
if (token.passwordKdf.memoryKiB !== undefined)
|
|
237
620
|
kdfParams.memoryKiB = token.passwordKdf.memoryKiB;
|
|
238
|
-
|
|
239
|
-
if (token.passwordKdf.parallelism !== undefined) {
|
|
621
|
+
if (token.passwordKdf.parallelism !== undefined)
|
|
240
622
|
kdfParams.parallelism = token.passwordKdf.parallelism;
|
|
241
|
-
|
|
242
|
-
if (token.passwordKdf.hashLength !== undefined) {
|
|
623
|
+
if (token.passwordKdf.hashLength !== undefined)
|
|
243
624
|
kdfParams.hashLength = token.passwordKdf.hashLength;
|
|
244
|
-
|
|
245
|
-
fields[versionFieldIndex + 2] = sdk_1.Utils.toArray(JSON.stringify(kdfParams), 'utf8');
|
|
246
|
-
}
|
|
247
|
-
// 2) Create a PushDrop script referencing these fields, locked with the admin key.
|
|
248
|
-
// The signature will be added as trailing metadata by PushDrop (not part of protocol fields).
|
|
249
|
-
const script = await new sdk_1.PushDrop(wallet, adminOriginator).lock(fields, [2, 'admin user management token'], // protocolID
|
|
250
|
-
'1', // keyID
|
|
251
|
-
'self', // counterparty
|
|
252
|
-
/*forSelf=*/ true,
|
|
253
|
-
/*includeSignature=*/ true);
|
|
254
|
-
// 3) Prepare the createAction call. If oldTokenToConsume is provided, gather the outpoint.
|
|
255
|
-
const inputs = [];
|
|
256
|
-
let inputToken;
|
|
257
|
-
if (oldTokenToConsume === null || oldTokenToConsume === void 0 ? void 0 : oldTokenToConsume.currentOutpoint) {
|
|
258
|
-
inputToken = await this.findByOutpoint(oldTokenToConsume.currentOutpoint);
|
|
259
|
-
// If there is no token on the overlay, we can't consume it. Just start over with a new token.
|
|
260
|
-
if (!inputToken) {
|
|
261
|
-
oldTokenToConsume = undefined;
|
|
262
|
-
// Otherwise, add the input
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
inputs.push({
|
|
266
|
-
outpoint: oldTokenToConsume.currentOutpoint,
|
|
267
|
-
unlockingScriptLength: 73, // typical signature length
|
|
268
|
-
inputDescription: 'Consume old UMP token'
|
|
269
|
-
});
|
|
270
|
-
}
|
|
625
|
+
fields[vi + 2] = sdk_1.Utils.toArray(JSON.stringify(kdfParams), 'utf8');
|
|
271
626
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
627
|
+
return fields;
|
|
628
|
+
}
|
|
629
|
+
/** Looks up the old token on the overlay; returns undefined resolved token if not found. */
|
|
630
|
+
async resolveOldTokenInput(oldTokenToConsume) {
|
|
631
|
+
if (!oldTokenToConsume?.currentOutpoint)
|
|
632
|
+
return { resolvedOldToken: undefined, inputToken: undefined };
|
|
633
|
+
const inputToken = await this.findByOutpoint(oldTokenToConsume.currentOutpoint);
|
|
634
|
+
if (inputToken == null) {
|
|
635
|
+
throw new Error('The previous UMP token could not be resolved; refusing to publish a duplicate token.');
|
|
636
|
+
}
|
|
637
|
+
return { resolvedOldToken: oldTokenToConsume, inputToken };
|
|
638
|
+
}
|
|
639
|
+
/** Creates the UMP action without dropping a required old-token input on failure. */
|
|
640
|
+
async createUMPAction(wallet, adminOriginator, inputs, outputs, inputToken, resolvedOldToken) {
|
|
281
641
|
try {
|
|
282
|
-
|
|
283
|
-
description:
|
|
642
|
+
return await wallet.createAction({
|
|
643
|
+
description: resolvedOldToken == null ? 'Create new UMP token' : 'Renew UMP token (consume old, create new)',
|
|
284
644
|
inputs,
|
|
285
645
|
outputs,
|
|
286
|
-
inputBEEF: inputToken
|
|
287
|
-
options: {
|
|
288
|
-
randomizeOutputs: false,
|
|
289
|
-
acceptDelayedBroadcast: false
|
|
290
|
-
}
|
|
291
|
-
}, adminOriginator);
|
|
292
|
-
}
|
|
293
|
-
catch (e) {
|
|
294
|
-
console.error('Error with UMP token update. Attempting a last-ditch effort to get a new one', e);
|
|
295
|
-
createResult = await wallet.createAction({
|
|
296
|
-
description: 'Recover UMP token',
|
|
297
|
-
outputs,
|
|
298
|
-
options: {
|
|
299
|
-
randomizeOutputs: false,
|
|
300
|
-
acceptDelayedBroadcast: false
|
|
301
|
-
}
|
|
646
|
+
inputBEEF: inputToken?.beef,
|
|
647
|
+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
|
|
302
648
|
}, adminOriginator);
|
|
303
649
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
650
|
+
catch (error) {
|
|
651
|
+
this.telemetry.capture({
|
|
652
|
+
name: 'wallet-toolbox.ump.action.failed',
|
|
653
|
+
component: 'wallet-toolbox.ump',
|
|
654
|
+
severity: 'error',
|
|
655
|
+
attributes: {
|
|
656
|
+
operation: resolvedOldToken == null ? 'create' : 'renew',
|
|
657
|
+
oldTokenInputRequired: resolvedOldToken != null
|
|
658
|
+
},
|
|
659
|
+
error
|
|
660
|
+
});
|
|
661
|
+
throw error;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
/** Handles a fully-finalized (no signable tx) createAction result — broadcasts and returns outpoint. */
|
|
665
|
+
async broadcastFinishedUMPAction(createResult) {
|
|
666
|
+
const finalTxid = createResult.txid || (createResult.tx != null ? sdk_1.Transaction.fromAtomicBEEF(createResult.tx).id('hex') : undefined);
|
|
667
|
+
if (!finalTxid)
|
|
668
|
+
throw new Error('No signableTransaction and no final TX found.');
|
|
669
|
+
if (createResult.tx == null)
|
|
670
|
+
throw new Error('No final TX data to broadcast.');
|
|
671
|
+
const broadcastTx = sdk_1.Transaction.fromAtomicBEEF(createResult.tx);
|
|
672
|
+
const result = await this.broadcaster.broadcast(broadcastTx);
|
|
673
|
+
this.assertSuccessfulBroadcast(result, 'create-finalized');
|
|
674
|
+
return `${finalTxid}.0`;
|
|
675
|
+
}
|
|
676
|
+
/** Signs the old-token input and broadcasts — used during UMP token renewal. */
|
|
677
|
+
async signAndBroadcastWithOldToken(wallet, adminOriginator, reference, partialTx) {
|
|
678
|
+
const unlocker = new sdk_1.PushDrop(wallet, adminOriginator).unlock([2, 'admin user management token'], '1', 'self');
|
|
679
|
+
const unlockingScript = await unlocker.sign(partialTx, 0);
|
|
680
|
+
const signResult = await wallet.signAction({ reference, spends: { 0: { unlockingScript: unlockingScript.toHex() } } }, adminOriginator);
|
|
681
|
+
const finalTxid = signResult.txid || (signResult.tx == null ? '' : sdk_1.Transaction.fromAtomicBEEF(signResult.tx).id('hex'));
|
|
682
|
+
if (!finalTxid)
|
|
683
|
+
throw new Error('Could not finalize transaction for renewed UMP token.');
|
|
684
|
+
if (signResult.tx == null)
|
|
685
|
+
throw new Error('Final transaction data missing after signing renewed UMP token.');
|
|
686
|
+
const result = await this.broadcaster.broadcast(sdk_1.Transaction.fromAtomicBEEF(signResult.tx));
|
|
687
|
+
this.assertSuccessfulBroadcast(result, 'renew');
|
|
688
|
+
return `${finalTxid}.0`;
|
|
689
|
+
}
|
|
690
|
+
/** Signs without input spending and broadcasts — used when creating a brand-new UMP token. */
|
|
691
|
+
async signAndBroadcastNewToken(wallet, adminOriginator, reference) {
|
|
692
|
+
const signResult = await wallet.signAction({ reference, spends: {} }, adminOriginator);
|
|
693
|
+
const finalTxid = signResult.txid || (signResult.tx == null ? '' : sdk_1.Transaction.fromAtomicBEEF(signResult.tx).id('hex'));
|
|
694
|
+
if (!finalTxid)
|
|
695
|
+
throw new Error('Failed to finalize new UMP token transaction.');
|
|
696
|
+
if (signResult.tx == null)
|
|
697
|
+
throw new Error('Final transaction data missing after signing new UMP token.');
|
|
698
|
+
const result = await this.broadcaster.broadcast(sdk_1.Transaction.fromAtomicBEEF(signResult.tx));
|
|
699
|
+
this.assertSuccessfulBroadcast(result, 'create');
|
|
700
|
+
return `${finalTxid}.0`;
|
|
701
|
+
}
|
|
702
|
+
assertSuccessfulBroadcast(result, operation) {
|
|
703
|
+
const succeeded = result.status === 'success';
|
|
704
|
+
this.telemetry.capture({
|
|
705
|
+
name: succeeded ? 'wallet-toolbox.ump.broadcast.completed' : 'wallet-toolbox.ump.broadcast.failed',
|
|
706
|
+
component: 'wallet-toolbox.ump',
|
|
707
|
+
severity: succeeded ? 'info' : 'error',
|
|
708
|
+
attributes: {
|
|
709
|
+
operation,
|
|
710
|
+
outcome: result.status,
|
|
711
|
+
...(result.status === 'error' ? { code: result.code } : {})
|
|
358
712
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
return `${finalTxid}.0`;
|
|
713
|
+
});
|
|
714
|
+
if (!succeeded) {
|
|
715
|
+
throw new Error(`UMP token broadcast failed (${result.code}).`);
|
|
363
716
|
}
|
|
364
717
|
}
|
|
365
718
|
/**
|
|
@@ -371,35 +724,36 @@ class OverlayUMPTokenInteractor {
|
|
|
371
724
|
* @returns The parsed UMPToken or `undefined` if none found/decodable.
|
|
372
725
|
*/
|
|
373
726
|
parseLookupAnswer(answer) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
727
|
+
return this.parseLookupAnswers(answer)[0];
|
|
728
|
+
}
|
|
729
|
+
parseLookupAnswers(answer) {
|
|
730
|
+
if (answer.type !== 'output-list' || answer.outputs.length === 0)
|
|
731
|
+
return [];
|
|
732
|
+
const tokens = [];
|
|
733
|
+
for (const output of answer.outputs) {
|
|
734
|
+
const token = this.parseLookupOutput(output);
|
|
735
|
+
if (token != null)
|
|
736
|
+
tokens.push(token);
|
|
380
737
|
}
|
|
381
|
-
|
|
738
|
+
return tokens;
|
|
739
|
+
}
|
|
740
|
+
parseLookupOutput(output) {
|
|
382
741
|
try {
|
|
383
|
-
const tx = sdk_1.Transaction.fromBEEF(beef);
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
742
|
+
const tx = sdk_1.Transaction.fromBEEF(output.beef);
|
|
743
|
+
const txOutput = tx.outputs[output.outputIndex];
|
|
744
|
+
if (txOutput == null)
|
|
745
|
+
return undefined;
|
|
746
|
+
const decoded = sdk_1.PushDrop.decode(txOutput.lockingScript);
|
|
747
|
+
if (decoded.fields == null || decoded.fields.length < 11 || decoded.fields.length > 16) {
|
|
748
|
+
return undefined;
|
|
749
|
+
}
|
|
750
|
+
const protocolFields = stripVerifiedPushDropSignature(decoded.fields, decoded.lockingPublicKey);
|
|
751
|
+
if (protocolFields.length < 11 ||
|
|
752
|
+
protocolFields.slice(0, 11).some(field => field.length === 0 || field.length > exports.MAX_STATE_SNAPSHOT_BYTES)) {
|
|
389
753
|
return undefined;
|
|
390
754
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
let protocolFields = stripVerifiedPushDropSignature(decoded.fields, decoded.lockingPublicKey);
|
|
394
|
-
// Detect v3 token metadata in either layout:
|
|
395
|
-
// - with profilesEncrypted present: [0..10]=core, [11]=profiles, [12]=version, [13]=algorithm, [14]=params
|
|
396
|
-
// - without profilesEncrypted: [0..10]=core, [11]=version, [12]=algorithm, [13]=params
|
|
397
|
-
const hasV3MetadataWithProfiles = protocolFields.length >= 15 && ((_b = protocolFields[12]) === null || _b === void 0 ? void 0 : _b.length) === 1 && protocolFields[12][0] === 3;
|
|
398
|
-
const hasV3MetadataWithoutProfiles = protocolFields.length >= 14 && ((_c = protocolFields[11]) === null || _c === void 0 ? void 0 : _c.length) === 1 && protocolFields[11][0] === 3;
|
|
399
|
-
const kdfVersionFieldIndex = hasV3MetadataWithProfiles ? 12 : hasV3MetadataWithoutProfiles ? 11 : -1;
|
|
400
|
-
// Build the UMP token from these fields, preserving outpoint
|
|
401
|
-
const t = {
|
|
402
|
-
// Core fields (unchanged for all versions)
|
|
755
|
+
const kdfVersionFieldIndex = findKdfVersionFieldIndex(protocolFields);
|
|
756
|
+
const token = {
|
|
403
757
|
passwordSalt: protocolFields[0],
|
|
404
758
|
passwordPresentationPrimary: protocolFields[1],
|
|
405
759
|
passwordRecoveryPrimary: protocolFields[2],
|
|
@@ -411,41 +765,17 @@ class OverlayUMPTokenInteractor {
|
|
|
411
765
|
presentationKeyEncrypted: protocolFields[8],
|
|
412
766
|
passwordKeyEncrypted: protocolFields[9],
|
|
413
767
|
recoveryKeyEncrypted: protocolFields[10],
|
|
414
|
-
currentOutpoint:
|
|
768
|
+
currentOutpoint: `${tx.id('hex')}.${output.outputIndex}`
|
|
415
769
|
};
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
t.umpVersion = protocolFields[kdfVersionFieldIndex][0]; // Single byte value 3
|
|
424
|
-
const kdfAlgorithmField = protocolFields[kdfVersionFieldIndex + 1];
|
|
425
|
-
const kdfParamsField = protocolFields[kdfVersionFieldIndex + 2];
|
|
426
|
-
if (!kdfAlgorithmField || !kdfParamsField) {
|
|
427
|
-
return t;
|
|
428
|
-
}
|
|
429
|
-
const kdfAlgorithm = sdk_1.Utils.toUTF8(kdfAlgorithmField);
|
|
430
|
-
const kdfParamsJson = sdk_1.Utils.toUTF8(kdfParamsField);
|
|
431
|
-
try {
|
|
432
|
-
const kdfParams = JSON.parse(kdfParamsJson);
|
|
433
|
-
t.passwordKdf = {
|
|
434
|
-
algorithm: kdfAlgorithm,
|
|
435
|
-
iterations: kdfParams.iterations,
|
|
436
|
-
memoryKiB: kdfParams.memoryKiB,
|
|
437
|
-
parallelism: kdfParams.parallelism,
|
|
438
|
-
hashLength: kdfParams.hashLength
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
catch (e) {
|
|
442
|
-
console.warn('Failed to parse v3 KDF params:', e);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
return t;
|
|
770
|
+
if (token.presentationHash.length !== 32 || token.recoveryHash.length !== 32)
|
|
771
|
+
return undefined;
|
|
772
|
+
if (!addProfilesField(token, protocolFields, kdfVersionFieldIndex))
|
|
773
|
+
return undefined;
|
|
774
|
+
if (!addPasswordKdf(token, protocolFields, kdfVersionFieldIndex))
|
|
775
|
+
return undefined;
|
|
776
|
+
return token;
|
|
446
777
|
}
|
|
447
|
-
catch
|
|
448
|
-
console.error('Failed to parse or decode UMP token:', e);
|
|
778
|
+
catch {
|
|
449
779
|
return undefined;
|
|
450
780
|
}
|
|
451
781
|
}
|
|
@@ -455,19 +785,35 @@ class OverlayUMPTokenInteractor {
|
|
|
455
785
|
* @returns The result so that we can use it to unlock the transaction
|
|
456
786
|
*/
|
|
457
787
|
async findByOutpoint(outpoint) {
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
788
|
+
const correlationId = this.telemetry.enabled === true ? this.telemetry.createCorrelationId() : undefined;
|
|
789
|
+
const startedAt = Date.now();
|
|
790
|
+
let resolution;
|
|
791
|
+
try {
|
|
792
|
+
resolution = await this.resolver.queryDetailed({
|
|
793
|
+
service: 'ls_users',
|
|
794
|
+
query: {
|
|
795
|
+
outpoint
|
|
796
|
+
}
|
|
797
|
+
}, undefined, {
|
|
798
|
+
waitForAllHosts: true,
|
|
799
|
+
correlationId
|
|
800
|
+
});
|
|
466
801
|
}
|
|
467
|
-
|
|
802
|
+
catch (error) {
|
|
803
|
+
const diagnostics = this.emptyLookupDiagnostics(correlationId);
|
|
804
|
+
this.captureLookupFailure('outpoint', 'lookup-unavailable', diagnostics, startedAt, error);
|
|
805
|
+
throw new UMPTokenLookupError('lookup-unavailable', diagnostics, { cause: error });
|
|
806
|
+
}
|
|
807
|
+
if (resolution.answer.outputs.length === 0) {
|
|
808
|
+
const p = resolution.progress;
|
|
809
|
+
if (p.emptyHosts === 0) {
|
|
810
|
+
const diagnostics = this.toLookupDiagnostics(resolution);
|
|
811
|
+
this.captureLookupFailure('outpoint', 'lookup-incomplete', diagnostics, startedAt);
|
|
812
|
+
throw new UMPTokenLookupError('lookup-incomplete', diagnostics);
|
|
813
|
+
}
|
|
468
814
|
return undefined;
|
|
469
815
|
}
|
|
470
|
-
return
|
|
816
|
+
return resolution.answer.outputs[0];
|
|
471
817
|
}
|
|
472
818
|
}
|
|
473
819
|
exports.OverlayUMPTokenInteractor = OverlayUMPTokenInteractor;
|
|
@@ -477,6 +823,98 @@ exports.OverlayUMPTokenInteractor = OverlayUMPTokenInteractor;
|
|
|
477
823
|
* supporting multiple user profiles under a single account.
|
|
478
824
|
*/
|
|
479
825
|
class CWIStyleWalletManager {
|
|
826
|
+
/**
|
|
827
|
+
* Whether the user is currently authenticated (i.e., root keys are available).
|
|
828
|
+
*/
|
|
829
|
+
authenticated;
|
|
830
|
+
/**
|
|
831
|
+
* Resolves once the optional snapshot (if provided to the constructor) has been
|
|
832
|
+
* fully loaded and the wallet is ready to accept calls.
|
|
833
|
+
* When no snapshot is provided this resolves immediately.
|
|
834
|
+
* Await `ready` before calling wallet methods after constructing with a snapshot.
|
|
835
|
+
*/
|
|
836
|
+
get ready() {
|
|
837
|
+
this._readyInit ??= this._init();
|
|
838
|
+
return this._readyInit;
|
|
839
|
+
}
|
|
840
|
+
_readyInit;
|
|
841
|
+
_initSnapshot;
|
|
842
|
+
/**
|
|
843
|
+
* The domain name of the administrative originator (wallet operator / vendor, or your own).
|
|
844
|
+
*/
|
|
845
|
+
adminOriginator;
|
|
846
|
+
/**
|
|
847
|
+
* The system that locates and publishes UMP tokens on-chain.
|
|
848
|
+
*/
|
|
849
|
+
UMPTokenInteractor;
|
|
850
|
+
/**
|
|
851
|
+
* Privacy-bounded diagnostic channel for wallet state transitions.
|
|
852
|
+
*/
|
|
853
|
+
telemetry;
|
|
854
|
+
/**
|
|
855
|
+
* A function called to persist the newly generated recovery key.
|
|
856
|
+
* It should generally trigger a UI prompt where the user is asked to write it down.
|
|
857
|
+
*/
|
|
858
|
+
recoveryKeySaver;
|
|
859
|
+
/**
|
|
860
|
+
* Asks the user to enter their password, for a given reason.
|
|
861
|
+
* The test function can be used to see if the password is correct before resolving.
|
|
862
|
+
* Only resolve with the correct password or reject with an error.
|
|
863
|
+
* Resolving with an incorrect password will throw an error.
|
|
864
|
+
*/
|
|
865
|
+
passwordRetriever;
|
|
866
|
+
/**
|
|
867
|
+
* Optional function to fund a new Wallet after the new-user flow.
|
|
868
|
+
*/
|
|
869
|
+
newWalletFunder;
|
|
870
|
+
/**
|
|
871
|
+
* Builds the underlying wallet for a specific profile.
|
|
872
|
+
*/
|
|
873
|
+
walletBuilder;
|
|
874
|
+
/**
|
|
875
|
+
* Current mode of authentication.
|
|
876
|
+
*/
|
|
877
|
+
authenticationMode = 'presentation-key-and-password';
|
|
878
|
+
/**
|
|
879
|
+
* Indicates new user or existing user flow.
|
|
880
|
+
*/
|
|
881
|
+
authenticationFlow = 'unknown';
|
|
882
|
+
/**
|
|
883
|
+
* The current UMP token in use.
|
|
884
|
+
*/
|
|
885
|
+
currentUMPToken;
|
|
886
|
+
/**
|
|
887
|
+
* Temporarily retained presentation key.
|
|
888
|
+
*/
|
|
889
|
+
presentationKey;
|
|
890
|
+
/**
|
|
891
|
+
* Temporarily retained recovery key.
|
|
892
|
+
*/
|
|
893
|
+
recoveryKey;
|
|
894
|
+
/**
|
|
895
|
+
* The user's *root* primary key, derived from authentication factors.
|
|
896
|
+
*/
|
|
897
|
+
rootPrimaryKey;
|
|
898
|
+
/**
|
|
899
|
+
* The currently active profile ID (null or DEFAULT_PROFILE_ID means default profile).
|
|
900
|
+
*/
|
|
901
|
+
activeProfileId = exports.DEFAULT_PROFILE_ID;
|
|
902
|
+
/**
|
|
903
|
+
* List of loaded non-default profiles.
|
|
904
|
+
*/
|
|
905
|
+
profiles = [];
|
|
906
|
+
/**
|
|
907
|
+
* The underlying wallet instance for the *active* profile.
|
|
908
|
+
*/
|
|
909
|
+
underlying;
|
|
910
|
+
/**
|
|
911
|
+
* Privileged key manager associated with the *root* keys, aware of the active profile.
|
|
912
|
+
*/
|
|
913
|
+
rootPrivilegedKeyManager;
|
|
914
|
+
/**
|
|
915
|
+
* KDF configuration for new UMP tokens. Defaults to Argon2id for v3 tokens.
|
|
916
|
+
*/
|
|
917
|
+
kdfConfig;
|
|
480
918
|
/**
|
|
481
919
|
* Constructs a new CWIStyleWalletManager.
|
|
482
920
|
*
|
|
@@ -489,49 +927,54 @@ class CWIStyleWalletManager {
|
|
|
489
927
|
* @param stateSnapshot Optional previously saved state snapshot.
|
|
490
928
|
* @param kdfConfig Optional KDF configuration for new UMP tokens.
|
|
491
929
|
*/
|
|
492
|
-
constructor(adminOriginator, walletBuilder, interactor
|
|
493
|
-
var _a, _b, _c, _d, _e;
|
|
494
|
-
/**
|
|
495
|
-
* Current mode of authentication.
|
|
496
|
-
*/
|
|
497
|
-
this.authenticationMode = 'presentation-key-and-password';
|
|
498
|
-
/**
|
|
499
|
-
* Indicates new user or existing user flow.
|
|
500
|
-
*/
|
|
501
|
-
this.authenticationFlow = 'new-user';
|
|
502
|
-
/**
|
|
503
|
-
* The currently active profile ID (null or DEFAULT_PROFILE_ID means default profile).
|
|
504
|
-
*/
|
|
505
|
-
this.activeProfileId = exports.DEFAULT_PROFILE_ID;
|
|
506
|
-
/**
|
|
507
|
-
* List of loaded non-default profiles.
|
|
508
|
-
*/
|
|
509
|
-
this.profiles = [];
|
|
930
|
+
constructor(...[adminOriginator, walletBuilder, interactor, recoveryKeySaver, passwordRetriever, newWalletFunder, stateSnapshot, kdfConfig, telemetry]) {
|
|
510
931
|
this.adminOriginator = adminOriginator;
|
|
511
932
|
this.walletBuilder = walletBuilder;
|
|
512
|
-
this.
|
|
933
|
+
this.telemetry = new sdk_1.Telemetry(telemetry);
|
|
934
|
+
this.UMPTokenInteractor = interactor ?? new OverlayUMPTokenInteractor(undefined, undefined, telemetry);
|
|
513
935
|
this.recoveryKeySaver = recoveryKeySaver;
|
|
514
936
|
this.passwordRetriever = passwordRetriever;
|
|
515
937
|
this.authenticated = false;
|
|
516
938
|
this.newWalletFunder = newWalletFunder;
|
|
517
939
|
// Initialize KDF config with Argon2id defaults for v3 tokens
|
|
940
|
+
const kdfAlgorithm = kdfConfig?.algorithm ?? 'argon2id';
|
|
518
941
|
this.kdfConfig = {
|
|
519
|
-
algorithm:
|
|
520
|
-
iterations:
|
|
521
|
-
memoryKiB:
|
|
522
|
-
parallelism:
|
|
523
|
-
hashLength:
|
|
942
|
+
algorithm: kdfAlgorithm,
|
|
943
|
+
iterations: kdfConfig?.iterations ?? (kdfAlgorithm === 'argon2id' ? exports.ARGON2ID_DEFAULT_ITERATIONS : exports.PBKDF2_NUM_ROUNDS),
|
|
944
|
+
memoryKiB: kdfConfig?.memoryKiB ?? exports.ARGON2ID_DEFAULT_MEMORY_KIB,
|
|
945
|
+
parallelism: kdfConfig?.parallelism ?? exports.ARGON2ID_DEFAULT_PARALLELISM,
|
|
946
|
+
hashLength: kdfConfig?.hashLength ?? exports.ARGON2ID_DEFAULT_HASH_LENGTH
|
|
524
947
|
};
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
//
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
948
|
+
if (!isValidKdfConfig(this.kdfConfig)) {
|
|
949
|
+
throw new Error('Unsupported or unsafe KDF configuration.');
|
|
950
|
+
}
|
|
951
|
+
// Store snapshot for lazy init; callers await ready before calling wallet methods.
|
|
952
|
+
this._initSnapshot = stateSnapshot;
|
|
953
|
+
}
|
|
954
|
+
async _init() {
|
|
955
|
+
if (this._initSnapshot !== undefined) {
|
|
956
|
+
this.telemetry.capture({
|
|
957
|
+
name: 'wallet-toolbox.snapshot.initialization.started',
|
|
958
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
959
|
+
severity: 'debug'
|
|
534
960
|
});
|
|
961
|
+
try {
|
|
962
|
+
await this.loadSnapshot(this._initSnapshot);
|
|
963
|
+
this.telemetry.capture({
|
|
964
|
+
name: 'wallet-toolbox.snapshot.initialization.completed',
|
|
965
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
966
|
+
severity: 'info'
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
catch (error) {
|
|
970
|
+
this.telemetry.capture({
|
|
971
|
+
name: 'wallet-toolbox.snapshot.initialization.failed',
|
|
972
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
973
|
+
severity: 'error',
|
|
974
|
+
error
|
|
975
|
+
});
|
|
976
|
+
throw error;
|
|
977
|
+
}
|
|
535
978
|
}
|
|
536
979
|
}
|
|
537
980
|
// --- Authentication Methods ---
|
|
@@ -545,9 +988,36 @@ class CWIStyleWalletManager {
|
|
|
545
988
|
if (this.authenticationMode === 'recovery-key-and-password') {
|
|
546
989
|
throw new Error('Presentation key is not needed in this mode');
|
|
547
990
|
}
|
|
991
|
+
if (key.length !== 32 || key.some(byte => !Number.isInteger(byte) || byte < 0 || byte > 255)) {
|
|
992
|
+
throw new TypeError('Presentation key must contain exactly 32 bytes.');
|
|
993
|
+
}
|
|
994
|
+
this.authenticationFlow = 'unknown';
|
|
548
995
|
const hash = sdk_1.Hash.sha256(key);
|
|
549
|
-
const
|
|
550
|
-
|
|
996
|
+
const startedAt = Date.now();
|
|
997
|
+
this.telemetry.capture({
|
|
998
|
+
name: 'wallet-toolbox.authentication.account-lookup.started',
|
|
999
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1000
|
+
severity: 'debug',
|
|
1001
|
+
attributes: { lookupKind: 'presentation' }
|
|
1002
|
+
});
|
|
1003
|
+
let token;
|
|
1004
|
+
try {
|
|
1005
|
+
token = await this.UMPTokenInteractor.findByPresentationKeyHash(hash);
|
|
1006
|
+
}
|
|
1007
|
+
catch (error) {
|
|
1008
|
+
this.telemetry.capture({
|
|
1009
|
+
name: 'wallet-toolbox.authentication.account-lookup.failed',
|
|
1010
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1011
|
+
severity: 'warn',
|
|
1012
|
+
attributes: {
|
|
1013
|
+
lookupKind: 'presentation',
|
|
1014
|
+
durationMs: Date.now() - startedAt
|
|
1015
|
+
},
|
|
1016
|
+
error
|
|
1017
|
+
});
|
|
1018
|
+
throw error;
|
|
1019
|
+
}
|
|
1020
|
+
if (token == null) {
|
|
551
1021
|
// No token found -> New user
|
|
552
1022
|
this.authenticationFlow = 'new-user';
|
|
553
1023
|
this.presentationKey = key;
|
|
@@ -558,124 +1028,120 @@ class CWIStyleWalletManager {
|
|
|
558
1028
|
this.presentationKey = key;
|
|
559
1029
|
this.currentUMPToken = token;
|
|
560
1030
|
}
|
|
1031
|
+
this.telemetry.capture({
|
|
1032
|
+
name: 'wallet-toolbox.authentication.account-lookup.completed',
|
|
1033
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1034
|
+
severity: 'info',
|
|
1035
|
+
attributes: {
|
|
1036
|
+
lookupKind: 'presentation',
|
|
1037
|
+
accountStatus: this.authenticationFlow,
|
|
1038
|
+
durationMs: Date.now() - startedAt
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
561
1041
|
}
|
|
562
1042
|
/**
|
|
563
1043
|
* Provides the password.
|
|
564
1044
|
*/
|
|
565
1045
|
async providePassword(password) {
|
|
566
|
-
if (this.authenticated)
|
|
1046
|
+
if (this.authenticated)
|
|
567
1047
|
throw new Error('User is already authenticated');
|
|
568
|
-
}
|
|
569
1048
|
if (this.authenticationMode === 'presentation-key-and-recovery-key') {
|
|
570
1049
|
throw new Error('Password is not needed in this mode');
|
|
571
1050
|
}
|
|
1051
|
+
if (this.authenticationFlow === 'unknown') {
|
|
1052
|
+
throw new Error('Determine account status with a presentation or recovery key before providing a password.');
|
|
1053
|
+
}
|
|
572
1054
|
if (this.authenticationFlow === 'existing-user') {
|
|
573
|
-
|
|
574
|
-
if (!this.currentUMPToken) {
|
|
575
|
-
throw new Error('Provide presentation or recovery key first.');
|
|
576
|
-
}
|
|
577
|
-
// Use token-driven KDF (legacy PBKDF2 or v3 Argon2id)
|
|
578
|
-
const derivedPasswordKey = await derivePasswordKey(this.currentUMPToken, sdk_1.Utils.toArray(password, 'utf8'));
|
|
579
|
-
let rootPrimaryKey;
|
|
580
|
-
let rootPrivilegedKey; // Only needed for recovery mode
|
|
581
|
-
if (this.authenticationMode === 'presentation-key-and-password') {
|
|
582
|
-
if (!this.presentationKey)
|
|
583
|
-
throw new Error('No presentation key found!');
|
|
584
|
-
const xorKey = this.XOR(this.presentationKey, derivedPasswordKey);
|
|
585
|
-
rootPrimaryKey = new sdk_1.SymmetricKey(xorKey).decrypt(this.currentUMPToken.passwordPresentationPrimary);
|
|
586
|
-
}
|
|
587
|
-
else {
|
|
588
|
-
// 'recovery-key-and-password'
|
|
589
|
-
if (!this.recoveryKey)
|
|
590
|
-
throw new Error('No recovery key found!');
|
|
591
|
-
const primaryDecryptionKey = this.XOR(this.recoveryKey, derivedPasswordKey);
|
|
592
|
-
rootPrimaryKey = new sdk_1.SymmetricKey(primaryDecryptionKey).decrypt(this.currentUMPToken.passwordRecoveryPrimary);
|
|
593
|
-
const privilegedDecryptionKey = this.XOR(rootPrimaryKey, derivedPasswordKey);
|
|
594
|
-
rootPrivilegedKey = new sdk_1.SymmetricKey(privilegedDecryptionKey).decrypt(this.currentUMPToken.passwordPrimaryPrivileged);
|
|
595
|
-
}
|
|
596
|
-
// Build root infrastructure, load profiles, and switch to default profile initially
|
|
597
|
-
await this.setupRootInfrastructure(rootPrimaryKey, rootPrivilegedKey);
|
|
598
|
-
await this.switchProfile(this.activeProfileId);
|
|
1055
|
+
await this.handleExistingUserPassword(password);
|
|
599
1056
|
}
|
|
600
1057
|
else {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
await this.
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
1058
|
+
await this.handleNewUserPassword(password);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
/** Handles the password step for an existing user — derives keys, sets up infrastructure. */
|
|
1062
|
+
async handleExistingUserPassword(password) {
|
|
1063
|
+
if (this.currentUMPToken == null)
|
|
1064
|
+
throw new Error('Provide presentation or recovery key first.');
|
|
1065
|
+
const derivedPasswordKey = await derivePasswordKey(this.currentUMPToken, sdk_1.Utils.toArray(password, 'utf8'));
|
|
1066
|
+
let rootPrimaryKey;
|
|
1067
|
+
let rootPrivilegedKey;
|
|
1068
|
+
if (this.authenticationMode === 'presentation-key-and-password') {
|
|
1069
|
+
if (this.presentationKey == null)
|
|
1070
|
+
throw new Error('No presentation key found!');
|
|
1071
|
+
rootPrimaryKey = new sdk_1.SymmetricKey(this.XOR(this.presentationKey, derivedPasswordKey)).decrypt(this.currentUMPToken.passwordPresentationPrimary);
|
|
1072
|
+
}
|
|
1073
|
+
else {
|
|
1074
|
+
// 'recovery-key-and-password'
|
|
1075
|
+
if (this.recoveryKey == null)
|
|
1076
|
+
throw new Error('No recovery key found!');
|
|
1077
|
+
const primaryDecryptionKey = this.XOR(this.recoveryKey, derivedPasswordKey);
|
|
1078
|
+
rootPrimaryKey = new sdk_1.SymmetricKey(primaryDecryptionKey).decrypt(this.currentUMPToken.passwordRecoveryPrimary);
|
|
1079
|
+
rootPrivilegedKey = new sdk_1.SymmetricKey(this.XOR(rootPrimaryKey, derivedPasswordKey)).decrypt(this.currentUMPToken.passwordPrimaryPrivileged);
|
|
1080
|
+
}
|
|
1081
|
+
await this.setupRootInfrastructure(rootPrimaryKey, rootPrivilegedKey);
|
|
1082
|
+
await this.switchProfile(this.activeProfileId);
|
|
1083
|
+
}
|
|
1084
|
+
/** Handles the password step for a new user — generates keys, builds UMP token, publishes on-chain. */
|
|
1085
|
+
async handleNewUserPassword(password) {
|
|
1086
|
+
if (this.authenticationMode !== 'presentation-key-and-password') {
|
|
1087
|
+
throw new Error('New-user flow requires presentation key and password mode.');
|
|
1088
|
+
}
|
|
1089
|
+
if (this.presentationKey == null)
|
|
1090
|
+
throw new Error('No presentation key provided for new-user flow.');
|
|
1091
|
+
// Generate new keys/salt
|
|
1092
|
+
const recoveryKey = (0, sdk_1.Random)(32);
|
|
1093
|
+
await this.recoveryKeySaver(recoveryKey);
|
|
1094
|
+
const passwordSalt = (0, sdk_1.Random)(32);
|
|
1095
|
+
const passwordKey = await derivePasswordKey({ passwordSalt, passwordKdf: this.kdfConfig }, sdk_1.Utils.toArray(password, 'utf8'));
|
|
1096
|
+
const rootPrimaryKey = (0, sdk_1.Random)(32);
|
|
1097
|
+
const rootPrivilegedKey = (0, sdk_1.Random)(32);
|
|
1098
|
+
// Build XOR-combined symmetric keys
|
|
1099
|
+
const presentationPassword = new sdk_1.SymmetricKey(this.XOR(this.presentationKey, passwordKey));
|
|
1100
|
+
const presentationRecovery = new sdk_1.SymmetricKey(this.XOR(this.presentationKey, recoveryKey));
|
|
1101
|
+
const recoveryPassword = new sdk_1.SymmetricKey(this.XOR(recoveryKey, passwordKey));
|
|
1102
|
+
const primaryPassword = new sdk_1.SymmetricKey(this.XOR(rootPrimaryKey, passwordKey));
|
|
1103
|
+
const tempPrivilegedKeyManager = new PrivilegedKeyManager_1.PrivilegedKeyManager(async () => new sdk_1.PrivateKey(rootPrivilegedKey));
|
|
1104
|
+
const wrapKey = async (plaintext) => (await tempPrivilegedKeyManager.encrypt({ plaintext, protocolID: [2, 'admin key wrapping'], keyID: '1' }))
|
|
1105
|
+
.ciphertext;
|
|
1106
|
+
// Build new UMP token (v3 with KDF metadata, no profiles initially)
|
|
1107
|
+
const newToken = {
|
|
1108
|
+
passwordSalt,
|
|
1109
|
+
passwordPresentationPrimary: presentationPassword.encrypt(rootPrimaryKey),
|
|
1110
|
+
passwordRecoveryPrimary: recoveryPassword.encrypt(rootPrimaryKey),
|
|
1111
|
+
presentationRecoveryPrimary: presentationRecovery.encrypt(rootPrimaryKey),
|
|
1112
|
+
passwordPrimaryPrivileged: primaryPassword.encrypt(rootPrivilegedKey),
|
|
1113
|
+
presentationRecoveryPrivileged: presentationRecovery.encrypt(rootPrivilegedKey),
|
|
1114
|
+
presentationHash: sdk_1.Hash.sha256(this.presentationKey),
|
|
1115
|
+
recoveryHash: sdk_1.Hash.sha256(recoveryKey),
|
|
1116
|
+
presentationKeyEncrypted: await wrapKey(this.presentationKey),
|
|
1117
|
+
passwordKeyEncrypted: await wrapKey(passwordKey),
|
|
1118
|
+
recoveryKeyEncrypted: await wrapKey(recoveryKey),
|
|
1119
|
+
profilesEncrypted: undefined,
|
|
1120
|
+
umpVersion: 3,
|
|
1121
|
+
passwordKdf: this.kdfConfig
|
|
1122
|
+
};
|
|
1123
|
+
this.currentUMPToken = newToken;
|
|
1124
|
+
await this.setupRootInfrastructure(rootPrimaryKey);
|
|
1125
|
+
await this.switchProfile(exports.DEFAULT_PROFILE_ID);
|
|
1126
|
+
// Fund the *default* wallet if funder provided
|
|
1127
|
+
if (this.newWalletFunder != null && this.underlying != null) {
|
|
1128
|
+
try {
|
|
1129
|
+
await this.newWalletFunder(this.presentationKey, this.underlying, this.adminOriginator);
|
|
670
1130
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
1131
|
+
catch (error) {
|
|
1132
|
+
this.telemetry.capture({
|
|
1133
|
+
name: 'wallet-toolbox.authentication.new-wallet-funding.failed',
|
|
1134
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1135
|
+
severity: 'error',
|
|
1136
|
+
error: new Error('New wallet funding failed.')
|
|
1137
|
+
});
|
|
1138
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1139
|
+
throw new Error(`Failed to fund new wallet before publishing UMP token: ${message}`, { cause: error });
|
|
675
1140
|
}
|
|
676
|
-
this.currentUMPToken.currentOutpoint = await this.UMPTokenInteractor.buildAndSend(this.underlying, // Use the default profile wallet
|
|
677
|
-
this.adminOriginator, newToken);
|
|
678
1141
|
}
|
|
1142
|
+
if (this.underlying == null)
|
|
1143
|
+
throw new Error('Default profile wallet not built before attempting to publish UMP token.');
|
|
1144
|
+
this.currentUMPToken.currentOutpoint = await this.UMPTokenInteractor.buildAndSend(this.underlying, this.adminOriginator, newToken);
|
|
679
1145
|
}
|
|
680
1146
|
/**
|
|
681
1147
|
* Provides the recovery key.
|
|
@@ -690,11 +1156,14 @@ class CWIStyleWalletManager {
|
|
|
690
1156
|
if (this.authenticationMode === 'presentation-key-and-password') {
|
|
691
1157
|
throw new Error('No recovery key required in this mode');
|
|
692
1158
|
}
|
|
1159
|
+
if (recoveryKey.length !== 32 || recoveryKey.some(byte => !Number.isInteger(byte) || byte < 0 || byte > 255)) {
|
|
1160
|
+
throw new TypeError('Recovery key must contain exactly 32 bytes.');
|
|
1161
|
+
}
|
|
693
1162
|
if (this.authenticationMode === 'recovery-key-and-password') {
|
|
694
1163
|
// Wait for password
|
|
695
1164
|
const hash = sdk_1.Hash.sha256(recoveryKey);
|
|
696
1165
|
const token = await this.UMPTokenInteractor.findByRecoveryKeyHash(hash);
|
|
697
|
-
if (
|
|
1166
|
+
if (token == null)
|
|
698
1167
|
throw new Error('No user found with this recovery key');
|
|
699
1168
|
this.authenticationFlow = 'existing-user';
|
|
700
1169
|
this.recoveryKey = recoveryKey;
|
|
@@ -702,9 +1171,9 @@ class CWIStyleWalletManager {
|
|
|
702
1171
|
}
|
|
703
1172
|
else {
|
|
704
1173
|
// 'presentation-key-and-recovery-key'
|
|
705
|
-
if (
|
|
1174
|
+
if (this.presentationKey == null)
|
|
706
1175
|
throw new Error('Provide the presentation key first');
|
|
707
|
-
if (
|
|
1176
|
+
if (this.currentUMPToken == null)
|
|
708
1177
|
throw new Error('Current UMP token not found');
|
|
709
1178
|
const xorKey = this.XOR(this.presentationKey, recoveryKey);
|
|
710
1179
|
const rootPrimaryKey = new sdk_1.SymmetricKey(xorKey).decrypt(this.currentUMPToken.presentationRecoveryPrimary);
|
|
@@ -723,7 +1192,7 @@ class CWIStyleWalletManager {
|
|
|
723
1192
|
* @returns Encrypted snapshot bytes.
|
|
724
1193
|
*/
|
|
725
1194
|
saveSnapshot() {
|
|
726
|
-
if (
|
|
1195
|
+
if (this.rootPrimaryKey == null || this.currentUMPToken == null) {
|
|
727
1196
|
throw new Error('No root primary key or current UMP token set');
|
|
728
1197
|
}
|
|
729
1198
|
const snapshotKey = (0, sdk_1.Random)(32);
|
|
@@ -746,7 +1215,20 @@ class CWIStyleWalletManager {
|
|
|
746
1215
|
snapshotWriter.write(snapshotKey);
|
|
747
1216
|
snapshotWriter.write(this.activeProfileId); // Active profile ID
|
|
748
1217
|
snapshotWriter.write(snapshotPayload); // Encrypted data
|
|
749
|
-
|
|
1218
|
+
const snapshot = snapshotWriter.toArray();
|
|
1219
|
+
if (snapshot.length > exports.MAX_STATE_SNAPSHOT_BYTES) {
|
|
1220
|
+
throw new Error('Snapshot exceeds the maximum supported size.');
|
|
1221
|
+
}
|
|
1222
|
+
this.telemetry.capture({
|
|
1223
|
+
name: 'wallet-toolbox.snapshot.saved',
|
|
1224
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1225
|
+
severity: 'info',
|
|
1226
|
+
attributes: {
|
|
1227
|
+
formatVersion: 2,
|
|
1228
|
+
profileCount: this.profiles.length
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
return snapshot;
|
|
750
1232
|
}
|
|
751
1233
|
/**
|
|
752
1234
|
* Loads a previously saved state snapshot. Restores root key, UMP token, profiles, and active profile.
|
|
@@ -756,6 +1238,11 @@ class CWIStyleWalletManager {
|
|
|
756
1238
|
*/
|
|
757
1239
|
async loadSnapshot(snapshot) {
|
|
758
1240
|
try {
|
|
1241
|
+
if (snapshot.length === 0 ||
|
|
1242
|
+
snapshot.length > exports.MAX_STATE_SNAPSHOT_BYTES ||
|
|
1243
|
+
snapshot.some(byte => !Number.isInteger(byte) || byte < 0 || byte > 255)) {
|
|
1244
|
+
throw new Error('Snapshot is empty, oversized, or contains invalid bytes.');
|
|
1245
|
+
}
|
|
759
1246
|
const reader = new sdk_1.Utils.Reader(snapshot);
|
|
760
1247
|
const version = reader.readUInt8();
|
|
761
1248
|
let snapshotKey;
|
|
@@ -788,25 +1275,41 @@ class CWIStyleWalletManager {
|
|
|
788
1275
|
await this.setupRootInfrastructure(rootPrimaryKey); // Will automatically load profiles
|
|
789
1276
|
await this.switchProfile(activeProfileId); // Switch to the profile saved in the snapshot
|
|
790
1277
|
this.authenticationFlow = 'existing-user'; // Loading implies existing user
|
|
1278
|
+
this.telemetry.capture({
|
|
1279
|
+
name: 'wallet-toolbox.snapshot.loaded',
|
|
1280
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1281
|
+
severity: 'info',
|
|
1282
|
+
attributes: {
|
|
1283
|
+
formatVersion: version,
|
|
1284
|
+
profileCount: this.profiles.length
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
791
1287
|
}
|
|
792
1288
|
catch (error) {
|
|
793
1289
|
this.destroy(); // Clear state on error
|
|
794
|
-
|
|
1290
|
+
this.telemetry.capture({
|
|
1291
|
+
name: 'wallet-toolbox.snapshot.load-failed',
|
|
1292
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1293
|
+
severity: 'error',
|
|
1294
|
+
error
|
|
1295
|
+
});
|
|
1296
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
1297
|
+
throw new Error(`Failed to load snapshot: ${message}`, { cause: error });
|
|
795
1298
|
}
|
|
796
1299
|
}
|
|
797
1300
|
async syncUMPToken() {
|
|
798
|
-
if (!this.authenticated ||
|
|
1301
|
+
if (!this.authenticated || this.currentUMPToken == null || this.rootPrimaryKey == null) {
|
|
799
1302
|
throw new Error('Wallet not authenticated or missing UMP token.');
|
|
800
1303
|
}
|
|
801
1304
|
const currentToken = this.currentUMPToken;
|
|
802
1305
|
let refreshed;
|
|
803
|
-
if (currentToken.presentationHash && currentToken.presentationHash.length) {
|
|
1306
|
+
if (currentToken.presentationHash && currentToken.presentationHash.length > 0) {
|
|
804
1307
|
refreshed = await this.UMPTokenInteractor.findByPresentationKeyHash(currentToken.presentationHash);
|
|
805
1308
|
}
|
|
806
|
-
if (
|
|
1309
|
+
if (refreshed == null && currentToken.recoveryHash && currentToken.recoveryHash.length > 0) {
|
|
807
1310
|
refreshed = await this.UMPTokenInteractor.findByRecoveryKeyHash(currentToken.recoveryHash);
|
|
808
1311
|
}
|
|
809
|
-
if (
|
|
1312
|
+
if (refreshed == null) {
|
|
810
1313
|
return false;
|
|
811
1314
|
}
|
|
812
1315
|
if (refreshed.currentOutpoint &&
|
|
@@ -833,7 +1336,7 @@ class CWIStyleWalletManager {
|
|
|
833
1336
|
this.profiles = [];
|
|
834
1337
|
this.activeProfileId = exports.DEFAULT_PROFILE_ID;
|
|
835
1338
|
this.authenticationMode = 'presentation-key-and-password';
|
|
836
|
-
this.authenticationFlow = '
|
|
1339
|
+
this.authenticationFlow = 'unknown';
|
|
837
1340
|
}
|
|
838
1341
|
// --- Profile Management Methods ---
|
|
839
1342
|
/**
|
|
@@ -873,7 +1376,10 @@ class CWIStyleWalletManager {
|
|
|
873
1376
|
* @returns The ID of the newly created profile.
|
|
874
1377
|
*/
|
|
875
1378
|
async addProfile(name) {
|
|
876
|
-
if (!this.authenticated ||
|
|
1379
|
+
if (!this.authenticated ||
|
|
1380
|
+
this.rootPrimaryKey == null ||
|
|
1381
|
+
this.currentUMPToken == null ||
|
|
1382
|
+
this.rootPrivilegedKeyManager == null) {
|
|
877
1383
|
throw new Error('Wallet not fully initialized or authenticated.');
|
|
878
1384
|
}
|
|
879
1385
|
// Ensure name is unique (including 'default')
|
|
@@ -904,7 +1410,10 @@ class CWIStyleWalletManager {
|
|
|
904
1410
|
* @param profileId The 16-byte ID of the profile to delete.
|
|
905
1411
|
*/
|
|
906
1412
|
async deleteProfile(profileId) {
|
|
907
|
-
if (!this.authenticated ||
|
|
1413
|
+
if (!this.authenticated ||
|
|
1414
|
+
this.rootPrimaryKey == null ||
|
|
1415
|
+
this.currentUMPToken == null ||
|
|
1416
|
+
this.rootPrivilegedKeyManager == null) {
|
|
908
1417
|
throw new Error('Wallet not fully initialized or authenticated.');
|
|
909
1418
|
}
|
|
910
1419
|
if (profileId.every(x => x === 0)) {
|
|
@@ -931,7 +1440,7 @@ class CWIStyleWalletManager {
|
|
|
931
1440
|
* @param profileId The 16-byte ID of the profile to switch to (use DEFAULT_PROFILE_ID for default).
|
|
932
1441
|
*/
|
|
933
1442
|
async switchProfile(profileId) {
|
|
934
|
-
if (!this.authenticated ||
|
|
1443
|
+
if (!this.authenticated || this.rootPrimaryKey == null || this.rootPrivilegedKeyManager == null) {
|
|
935
1444
|
throw new Error('Cannot switch profile: Wallet not authenticated or root keys missing.');
|
|
936
1445
|
}
|
|
937
1446
|
let profilePrimaryKey;
|
|
@@ -945,7 +1454,7 @@ class CWIStyleWalletManager {
|
|
|
945
1454
|
else {
|
|
946
1455
|
// Switching to a non-default profile
|
|
947
1456
|
const profile = this.profiles.find(p => p.id.every((x, i) => x === profileId[i]));
|
|
948
|
-
if (
|
|
1457
|
+
if (profile == null) {
|
|
949
1458
|
throw new Error('Profile not found.');
|
|
950
1459
|
}
|
|
951
1460
|
profilePrimaryKey = this.XOR(this.rootPrimaryKey, profile.primaryPad);
|
|
@@ -959,9 +1468,7 @@ class CWIStyleWalletManager {
|
|
|
959
1468
|
const rootPrivileged = await this.rootPrivilegedKeyManager.getPrivilegedKey(reason);
|
|
960
1469
|
const rootPrivilegedBytes = rootPrivileged.toArray();
|
|
961
1470
|
// Apply the profile's pad if applicable
|
|
962
|
-
const profilePrivilegedBytes = profilePrivilegedPad
|
|
963
|
-
? this.XOR(rootPrivilegedBytes, profilePrivilegedPad)
|
|
964
|
-
: rootPrivilegedBytes;
|
|
1471
|
+
const profilePrivilegedBytes = profilePrivilegedPad == null ? rootPrivilegedBytes : this.XOR(rootPrivilegedBytes, profilePrivilegedPad);
|
|
965
1472
|
return new sdk_1.PrivateKey(profilePrivilegedBytes);
|
|
966
1473
|
});
|
|
967
1474
|
// Build the underlying wallet for the specific profile
|
|
@@ -974,13 +1481,15 @@ class CWIStyleWalletManager {
|
|
|
974
1481
|
* Changes the user's password. Re-wraps keys and updates the UMP token.
|
|
975
1482
|
*/
|
|
976
1483
|
async changePassword(newPassword) {
|
|
977
|
-
|
|
978
|
-
|
|
1484
|
+
if (!this.authenticated ||
|
|
1485
|
+
this.currentUMPToken == null ||
|
|
1486
|
+
this.rootPrimaryKey == null ||
|
|
1487
|
+
this.rootPrivilegedKeyManager == null) {
|
|
979
1488
|
throw new Error('Not authenticated or missing required data.');
|
|
980
1489
|
}
|
|
981
1490
|
const passwordSalt = (0, sdk_1.Random)(32);
|
|
982
1491
|
// Preserve current token's KDF metadata (or use manager's kdfConfig for legacy tokens)
|
|
983
|
-
const kdfToUse =
|
|
1492
|
+
const kdfToUse = this.currentUMPToken.passwordKdf ?? this.kdfConfig;
|
|
984
1493
|
const tempTokenForKdf = {
|
|
985
1494
|
passwordSalt,
|
|
986
1495
|
passwordKdf: kdfToUse
|
|
@@ -998,16 +1507,19 @@ class CWIStyleWalletManager {
|
|
|
998
1507
|
* Retrieves the current recovery key. Requires privileged access.
|
|
999
1508
|
*/
|
|
1000
1509
|
async getRecoveryKey() {
|
|
1001
|
-
if (!this.authenticated ||
|
|
1510
|
+
if (!this.authenticated || this.currentUMPToken == null || this.rootPrivilegedKeyManager == null) {
|
|
1002
1511
|
throw new Error('Not authenticated or missing required data.');
|
|
1003
1512
|
}
|
|
1004
|
-
return this.getFactor('recoveryKey');
|
|
1513
|
+
return await this.getFactor('recoveryKey');
|
|
1005
1514
|
}
|
|
1006
1515
|
/**
|
|
1007
1516
|
* Changes the user's recovery key. Prompts user to save the new key.
|
|
1008
1517
|
*/
|
|
1009
1518
|
async changeRecoveryKey() {
|
|
1010
|
-
if (!this.authenticated ||
|
|
1519
|
+
if (!this.authenticated ||
|
|
1520
|
+
this.currentUMPToken == null ||
|
|
1521
|
+
this.rootPrimaryKey == null ||
|
|
1522
|
+
this.rootPrivilegedKeyManager == null) {
|
|
1011
1523
|
throw new Error('Not authenticated or missing required data.');
|
|
1012
1524
|
}
|
|
1013
1525
|
// Decrypt existing factors needed
|
|
@@ -1025,7 +1537,10 @@ class CWIStyleWalletManager {
|
|
|
1025
1537
|
* Changes the user's presentation key.
|
|
1026
1538
|
*/
|
|
1027
1539
|
async changePresentationKey(newPresentationKey) {
|
|
1028
|
-
if (!this.authenticated ||
|
|
1540
|
+
if (!this.authenticated ||
|
|
1541
|
+
this.currentUMPToken == null ||
|
|
1542
|
+
this.rootPrimaryKey == null ||
|
|
1543
|
+
this.rootPrivilegedKeyManager == null) {
|
|
1029
1544
|
throw new Error('Not authenticated or missing required data.');
|
|
1030
1545
|
}
|
|
1031
1546
|
if (newPresentationKey.length !== 32) {
|
|
@@ -1039,7 +1554,7 @@ class CWIStyleWalletManager {
|
|
|
1039
1554
|
recoveryKey, this.rootPrimaryKey, rootPrivilegedKey, this.profiles // Preserve profiles
|
|
1040
1555
|
);
|
|
1041
1556
|
// Update the temporarily stored key if it was set
|
|
1042
|
-
if (this.presentationKey) {
|
|
1557
|
+
if (this.presentationKey != null) {
|
|
1043
1558
|
this.presentationKey = newPresentationKey;
|
|
1044
1559
|
}
|
|
1045
1560
|
}
|
|
@@ -1052,7 +1567,7 @@ class CWIStyleWalletManager {
|
|
|
1052
1567
|
// Provide more context in error
|
|
1053
1568
|
throw new Error(`XOR length mismatch: ${n1.length} vs ${n2.length}`);
|
|
1054
1569
|
}
|
|
1055
|
-
const r =
|
|
1570
|
+
const r = Array.from({ length: n1.length }, () => 0);
|
|
1056
1571
|
for (let i = 0; i < n1.length; i++) {
|
|
1057
1572
|
r[i] = n1[i] ^ n2[i];
|
|
1058
1573
|
}
|
|
@@ -1066,7 +1581,7 @@ class CWIStyleWalletManager {
|
|
|
1066
1581
|
* @returns The decrypted key bytes.
|
|
1067
1582
|
*/
|
|
1068
1583
|
async getFactor(factorName) {
|
|
1069
|
-
if (!this.authenticated ||
|
|
1584
|
+
if (!this.authenticated || this.currentUMPToken == null || this.rootPrivilegedKeyManager == null) {
|
|
1070
1585
|
throw new Error(`Cannot get factor "${factorName}": Wallet not ready.`);
|
|
1071
1586
|
}
|
|
1072
1587
|
const protocolID = [2, 'admin key wrapping']; // Protocol used for encrypting factors
|
|
@@ -1103,8 +1618,15 @@ class CWIStyleWalletManager {
|
|
|
1103
1618
|
}
|
|
1104
1619
|
}
|
|
1105
1620
|
catch (error) {
|
|
1106
|
-
|
|
1107
|
-
|
|
1621
|
+
this.telemetry.capture({
|
|
1622
|
+
name: 'wallet-toolbox.authentication.factor-decryption.failed',
|
|
1623
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1624
|
+
severity: 'error',
|
|
1625
|
+
attributes: { factor: factorName },
|
|
1626
|
+
error
|
|
1627
|
+
});
|
|
1628
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
1629
|
+
throw new Error(`Failed to decrypt factor "${factorName}": ${message}`, { cause: error });
|
|
1108
1630
|
}
|
|
1109
1631
|
}
|
|
1110
1632
|
/**
|
|
@@ -1114,7 +1636,7 @@ class CWIStyleWalletManager {
|
|
|
1114
1636
|
async updateAuthFactors(passwordSalt, passwordKey, presentationKey, recoveryKey, rootPrimaryKey, rootPrivilegedKey, // Explicitly pass the root key bytes
|
|
1115
1637
|
profiles // Pass current/new profiles list
|
|
1116
1638
|
) {
|
|
1117
|
-
if (!this.authenticated ||
|
|
1639
|
+
if (!this.authenticated || this.rootPrimaryKey == null || this.currentUMPToken == null) {
|
|
1118
1640
|
throw new Error('Wallet is not properly authenticated or missing data for update.');
|
|
1119
1641
|
}
|
|
1120
1642
|
// Ensure we have the OLD token to consume
|
|
@@ -1131,7 +1653,7 @@ class CWIStyleWalletManager {
|
|
|
1131
1653
|
const tempRootPrivilegedKeyManager = new PrivilegedKeyManager_1.PrivilegedKeyManager(async () => new sdk_1.PrivateKey(rootPrivilegedKey));
|
|
1132
1654
|
// Encrypt profiles if provided
|
|
1133
1655
|
let profilesEncrypted;
|
|
1134
|
-
if (profiles && profiles.length > 0) {
|
|
1656
|
+
if (profiles != null && profiles.length > 0) {
|
|
1135
1657
|
const profilesJson = JSON.stringify(profiles);
|
|
1136
1658
|
const profilesBytes = sdk_1.Utils.toArray(profilesJson, 'utf8');
|
|
1137
1659
|
profilesEncrypted = new sdk_1.SymmetricKey(rootPrimaryKey).encrypt(profilesBytes);
|
|
@@ -1166,12 +1688,12 @@ class CWIStyleWalletManager {
|
|
|
1166
1688
|
keyID: '1'
|
|
1167
1689
|
})).ciphertext,
|
|
1168
1690
|
profilesEncrypted, // Add encrypted profiles
|
|
1169
|
-
...(kdfMetadata
|
|
1170
|
-
? {
|
|
1691
|
+
...(kdfMetadata == null
|
|
1692
|
+
? {}
|
|
1693
|
+
: {
|
|
1171
1694
|
umpVersion: 3,
|
|
1172
1695
|
passwordKdf: kdfMetadata
|
|
1173
|
-
}
|
|
1174
|
-
: {})
|
|
1696
|
+
})
|
|
1175
1697
|
// currentOutpoint will be set after publishing
|
|
1176
1698
|
};
|
|
1177
1699
|
// We need the wallet built for the DEFAULT profile to publish the UMP token.
|
|
@@ -1179,11 +1701,16 @@ class CWIStyleWalletManager {
|
|
|
1179
1701
|
const currentActiveId = this.activeProfileId;
|
|
1180
1702
|
let walletToUse = this.underlying;
|
|
1181
1703
|
if (!currentActiveId.every(x => x === 0)) {
|
|
1182
|
-
|
|
1704
|
+
this.telemetry.capture({
|
|
1705
|
+
name: 'wallet-toolbox.ump.profile-switch.started',
|
|
1706
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1707
|
+
severity: 'debug',
|
|
1708
|
+
attributes: { reason: 'token-update' }
|
|
1709
|
+
});
|
|
1183
1710
|
await this.switchProfile(exports.DEFAULT_PROFILE_ID); // This rebuilds this.underlying
|
|
1184
1711
|
walletToUse = this.underlying;
|
|
1185
1712
|
}
|
|
1186
|
-
if (
|
|
1713
|
+
if (walletToUse == null) {
|
|
1187
1714
|
throw new Error('Default profile wallet could not be activated for UMP token update.');
|
|
1188
1715
|
}
|
|
1189
1716
|
// Publish the new token on-chain, consuming the old one
|
|
@@ -1197,8 +1724,13 @@ class CWIStyleWalletManager {
|
|
|
1197
1724
|
finally {
|
|
1198
1725
|
// Switch back if we temporarily switched
|
|
1199
1726
|
if (!currentActiveId.every(x => x === 0)) {
|
|
1200
|
-
console.log('Switching back to original profile...');
|
|
1201
1727
|
await this.switchProfile(currentActiveId);
|
|
1728
|
+
this.telemetry.capture({
|
|
1729
|
+
name: 'wallet-toolbox.ump.profile-switch.completed',
|
|
1730
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1731
|
+
severity: 'debug',
|
|
1732
|
+
attributes: { reason: 'token-update' }
|
|
1733
|
+
});
|
|
1202
1734
|
}
|
|
1203
1735
|
}
|
|
1204
1736
|
}
|
|
@@ -1230,7 +1762,7 @@ class CWIStyleWalletManager {
|
|
|
1230
1762
|
writeArray(token.passwordKeyEncrypted); // 9
|
|
1231
1763
|
writeArray(token.recoveryKeyEncrypted); // 10
|
|
1232
1764
|
// Write optional profiles field
|
|
1233
|
-
if (token.profilesEncrypted && token.profilesEncrypted.length > 0) {
|
|
1765
|
+
if (token.profilesEncrypted != null && token.profilesEncrypted.length > 0) {
|
|
1234
1766
|
writer.writeUInt8(1); // Flag indicating profiles present
|
|
1235
1767
|
writeArray(token.profilesEncrypted);
|
|
1236
1768
|
}
|
|
@@ -1280,6 +1812,9 @@ class CWIStyleWalletManager {
|
|
|
1280
1812
|
}
|
|
1281
1813
|
const readArray = () => {
|
|
1282
1814
|
const length = reader.readVarIntNum();
|
|
1815
|
+
if (length <= 0 || length > exports.MAX_STATE_SNAPSHOT_BYTES) {
|
|
1816
|
+
throw new Error('UMP token field exceeds allowed bounds.');
|
|
1817
|
+
}
|
|
1283
1818
|
return reader.read(length);
|
|
1284
1819
|
};
|
|
1285
1820
|
// Read standard fields (order matches serialization)
|
|
@@ -1313,18 +1848,16 @@ class CWIStyleWalletManager {
|
|
|
1313
1848
|
const algorithm = sdk_1.Utils.toUTF8(algorithmBytes);
|
|
1314
1849
|
const kdfParamsBytes = readArray();
|
|
1315
1850
|
const kdfParamsJson = sdk_1.Utils.toUTF8(kdfParamsBytes);
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
catch (e) {
|
|
1327
|
-
console.warn('Failed to parse KDF params during deserialization:', e);
|
|
1851
|
+
const kdfParams = JSON.parse(kdfParamsJson);
|
|
1852
|
+
passwordKdf = {
|
|
1853
|
+
algorithm,
|
|
1854
|
+
iterations: kdfParams.iterations,
|
|
1855
|
+
memoryKiB: kdfParams.memoryKiB,
|
|
1856
|
+
parallelism: kdfParams.parallelism,
|
|
1857
|
+
hashLength: kdfParams.hashLength
|
|
1858
|
+
};
|
|
1859
|
+
if (!isValidKdfConfig(passwordKdf)) {
|
|
1860
|
+
throw new Error('Serialized UMP token contains unsupported or unsafe KDF parameters.');
|
|
1328
1861
|
}
|
|
1329
1862
|
}
|
|
1330
1863
|
}
|
|
@@ -1332,6 +1865,9 @@ class CWIStyleWalletManager {
|
|
|
1332
1865
|
const outpointLen = reader.readVarIntNum();
|
|
1333
1866
|
const outpointBytes = reader.read(outpointLen);
|
|
1334
1867
|
const currentOutpoint = sdk_1.Utils.toUTF8(outpointBytes);
|
|
1868
|
+
if (currentOutpoint.length > 128 || !/^[^\s.:]+[.:]\d+$/.test(currentOutpoint)) {
|
|
1869
|
+
throw new Error('Serialized UMP token contains an invalid outpoint.');
|
|
1870
|
+
}
|
|
1335
1871
|
const token = {
|
|
1336
1872
|
passwordSalt,
|
|
1337
1873
|
passwordPresentationPrimary,
|
|
@@ -1360,18 +1896,16 @@ class CWIStyleWalletManager {
|
|
|
1360
1896
|
* @param ephemeralRootPrivilegedKey Optional root privileged key (e.g., during recovery flows).
|
|
1361
1897
|
*/
|
|
1362
1898
|
async setupRootInfrastructure(rootPrimaryKey, ephemeralRootPrivilegedKey) {
|
|
1363
|
-
if (
|
|
1899
|
+
if (this.currentUMPToken == null) {
|
|
1364
1900
|
throw new Error('A UMP token must exist before setting up root infrastructure!');
|
|
1365
1901
|
}
|
|
1366
1902
|
this.rootPrimaryKey = rootPrimaryKey;
|
|
1367
1903
|
// Store ephemeral key if provided, for one-time use by the manager
|
|
1368
|
-
let oneTimePrivilegedKey = ephemeralRootPrivilegedKey
|
|
1369
|
-
? new sdk_1.PrivateKey(ephemeralRootPrivilegedKey)
|
|
1370
|
-
: undefined;
|
|
1904
|
+
let oneTimePrivilegedKey = ephemeralRootPrivilegedKey == null ? undefined : new sdk_1.PrivateKey(ephemeralRootPrivilegedKey);
|
|
1371
1905
|
// Create the ROOT PrivilegedKeyManager
|
|
1372
1906
|
this.rootPrivilegedKeyManager = new PrivilegedKeyManager_1.PrivilegedKeyManager(async (reason) => {
|
|
1373
1907
|
// 1. Use one-time key if available (for recovery)
|
|
1374
|
-
if (oneTimePrivilegedKey) {
|
|
1908
|
+
if (oneTimePrivilegedKey != null) {
|
|
1375
1909
|
const tempKey = oneTimePrivilegedKey;
|
|
1376
1910
|
oneTimePrivilegedKey = undefined; // Consume it
|
|
1377
1911
|
return tempKey;
|
|
@@ -1384,7 +1918,10 @@ class CWIStyleWalletManager {
|
|
|
1384
1918
|
const decryptedPrivileged = new sdk_1.SymmetricKey(privilegedDecryptor).decrypt(this.currentUMPToken.passwordPrimaryPrivileged);
|
|
1385
1919
|
return !!decryptedPrivileged; // Test passes if decryption works
|
|
1386
1920
|
}
|
|
1387
|
-
catch
|
|
1921
|
+
catch {
|
|
1922
|
+
// Decryption failure means the password candidate is wrong — this is the
|
|
1923
|
+
// expected rejection path for an incorrect password. Returning false causes
|
|
1924
|
+
// the password-retriever loop to prompt the user again rather than crashing.
|
|
1388
1925
|
return false;
|
|
1389
1926
|
}
|
|
1390
1927
|
});
|
|
@@ -1396,18 +1933,26 @@ class CWIStyleWalletManager {
|
|
|
1396
1933
|
});
|
|
1397
1934
|
// Decrypt and load profiles if present in the token
|
|
1398
1935
|
this.profiles = []; // Clear existing profiles before loading
|
|
1399
|
-
if (this.currentUMPToken.profilesEncrypted && this.currentUMPToken.profilesEncrypted.length > 0) {
|
|
1936
|
+
if (this.currentUMPToken.profilesEncrypted != null && this.currentUMPToken.profilesEncrypted.length > 0) {
|
|
1400
1937
|
try {
|
|
1401
1938
|
const decryptedProfileBytes = new sdk_1.SymmetricKey(rootPrimaryKey).decrypt(this.currentUMPToken.profilesEncrypted);
|
|
1402
1939
|
const profilesJson = sdk_1.Utils.toUTF8(decryptedProfileBytes);
|
|
1403
|
-
|
|
1940
|
+
const profiles = JSON.parse(profilesJson);
|
|
1941
|
+
if (!Array.isArray(profiles) || profiles.length > 1000 || !profiles.every(isValidProfile)) {
|
|
1942
|
+
throw new Error('Decrypted profile data is invalid or exceeds supported bounds.');
|
|
1943
|
+
}
|
|
1944
|
+
this.profiles = profiles;
|
|
1404
1945
|
}
|
|
1405
1946
|
catch (error) {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1947
|
+
this.profiles = [];
|
|
1948
|
+
this.telemetry.capture({
|
|
1949
|
+
name: 'wallet-toolbox.profile.load-failed',
|
|
1950
|
+
component: 'wallet-toolbox.cwi-manager',
|
|
1951
|
+
severity: 'error',
|
|
1952
|
+
error
|
|
1953
|
+
});
|
|
1954
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
1955
|
+
throw new Error(`Failed to load profiles: ${message}`, { cause: error });
|
|
1411
1956
|
}
|
|
1412
1957
|
}
|
|
1413
1958
|
this.authenticated = true;
|
|
@@ -1424,7 +1969,7 @@ class CWIStyleWalletManager {
|
|
|
1424
1969
|
if (!this.authenticated) {
|
|
1425
1970
|
throw new Error('User is not authenticated.');
|
|
1426
1971
|
}
|
|
1427
|
-
if (
|
|
1972
|
+
if (this.underlying == null) {
|
|
1428
1973
|
// This might happen if authentication succeeded but profile switching failed
|
|
1429
1974
|
throw new Error('Underlying wallet for the active profile is not initialized.');
|
|
1430
1975
|
}
|
|
@@ -1435,91 +1980,91 @@ class CWIStyleWalletManager {
|
|
|
1435
1980
|
// Example proxy method (repeat pattern for all others)
|
|
1436
1981
|
async getPublicKey(args, originator) {
|
|
1437
1982
|
this.checkAuthAndUnderlying(originator);
|
|
1438
|
-
return this.underlying.getPublicKey(args, originator);
|
|
1983
|
+
return await this.underlying.getPublicKey(args, originator);
|
|
1439
1984
|
}
|
|
1440
1985
|
async revealCounterpartyKeyLinkage(args, originator) {
|
|
1441
1986
|
this.checkAuthAndUnderlying(originator);
|
|
1442
|
-
return this.underlying.revealCounterpartyKeyLinkage(args, originator);
|
|
1987
|
+
return await this.underlying.revealCounterpartyKeyLinkage(args, originator);
|
|
1443
1988
|
}
|
|
1444
1989
|
async revealSpecificKeyLinkage(args, originator) {
|
|
1445
1990
|
this.checkAuthAndUnderlying(originator);
|
|
1446
|
-
return this.underlying.revealSpecificKeyLinkage(args, originator);
|
|
1991
|
+
return await this.underlying.revealSpecificKeyLinkage(args, originator);
|
|
1447
1992
|
}
|
|
1448
1993
|
async encrypt(args, originator) {
|
|
1449
1994
|
this.checkAuthAndUnderlying(originator);
|
|
1450
|
-
return this.underlying.encrypt(args, originator);
|
|
1995
|
+
return await this.underlying.encrypt(args, originator);
|
|
1451
1996
|
}
|
|
1452
1997
|
async decrypt(args, originator) {
|
|
1453
1998
|
this.checkAuthAndUnderlying(originator);
|
|
1454
|
-
return this.underlying.decrypt(args, originator);
|
|
1999
|
+
return await this.underlying.decrypt(args, originator);
|
|
1455
2000
|
}
|
|
1456
2001
|
async createHmac(args, originator) {
|
|
1457
2002
|
this.checkAuthAndUnderlying(originator);
|
|
1458
|
-
return this.underlying.createHmac(args, originator);
|
|
2003
|
+
return await this.underlying.createHmac(args, originator);
|
|
1459
2004
|
}
|
|
1460
2005
|
async verifyHmac(args, originator) {
|
|
1461
2006
|
this.checkAuthAndUnderlying(originator);
|
|
1462
|
-
return this.underlying.verifyHmac(args, originator);
|
|
2007
|
+
return await this.underlying.verifyHmac(args, originator);
|
|
1463
2008
|
}
|
|
1464
2009
|
async createSignature(args, originator) {
|
|
1465
2010
|
this.checkAuthAndUnderlying(originator);
|
|
1466
|
-
return this.underlying.createSignature(args, originator);
|
|
2011
|
+
return await this.underlying.createSignature(args, originator);
|
|
1467
2012
|
}
|
|
1468
2013
|
async verifySignature(args, originator) {
|
|
1469
2014
|
this.checkAuthAndUnderlying(originator);
|
|
1470
|
-
return this.underlying.verifySignature(args, originator);
|
|
2015
|
+
return await this.underlying.verifySignature(args, originator);
|
|
1471
2016
|
}
|
|
1472
2017
|
async createAction(args, originator) {
|
|
1473
2018
|
this.checkAuthAndUnderlying(originator);
|
|
1474
|
-
return this.underlying.createAction(args, originator);
|
|
2019
|
+
return await this.underlying.createAction(args, originator);
|
|
1475
2020
|
}
|
|
1476
2021
|
async signAction(args, originator) {
|
|
1477
2022
|
this.checkAuthAndUnderlying(originator);
|
|
1478
|
-
return this.underlying.signAction(args, originator);
|
|
2023
|
+
return await this.underlying.signAction(args, originator);
|
|
1479
2024
|
}
|
|
1480
2025
|
async abortAction(args, originator) {
|
|
1481
2026
|
this.checkAuthAndUnderlying(originator);
|
|
1482
|
-
return this.underlying.abortAction(args, originator);
|
|
2027
|
+
return await this.underlying.abortAction(args, originator);
|
|
1483
2028
|
}
|
|
1484
2029
|
async listActions(args, originator) {
|
|
1485
2030
|
this.checkAuthAndUnderlying(originator);
|
|
1486
|
-
return this.underlying.listActions(args, originator);
|
|
2031
|
+
return await this.underlying.listActions(args, originator);
|
|
1487
2032
|
}
|
|
1488
2033
|
async internalizeAction(args, originator) {
|
|
1489
2034
|
this.checkAuthAndUnderlying(originator);
|
|
1490
|
-
return this.underlying.internalizeAction(args, originator);
|
|
2035
|
+
return await this.underlying.internalizeAction(args, originator);
|
|
1491
2036
|
}
|
|
1492
2037
|
async listOutputs(args, originator) {
|
|
1493
2038
|
this.checkAuthAndUnderlying(originator);
|
|
1494
|
-
return this.underlying.listOutputs(args, originator);
|
|
2039
|
+
return await this.underlying.listOutputs(args, originator);
|
|
1495
2040
|
}
|
|
1496
2041
|
async relinquishOutput(args, originator) {
|
|
1497
2042
|
this.checkAuthAndUnderlying(originator);
|
|
1498
|
-
return this.underlying.relinquishOutput(args, originator);
|
|
2043
|
+
return await this.underlying.relinquishOutput(args, originator);
|
|
1499
2044
|
}
|
|
1500
2045
|
async acquireCertificate(args, originator) {
|
|
1501
2046
|
this.checkAuthAndUnderlying(originator);
|
|
1502
|
-
return this.underlying.acquireCertificate(args, originator);
|
|
2047
|
+
return await this.underlying.acquireCertificate(args, originator);
|
|
1503
2048
|
}
|
|
1504
2049
|
async listCertificates(args, originator) {
|
|
1505
2050
|
this.checkAuthAndUnderlying(originator);
|
|
1506
|
-
return this.underlying.listCertificates(args, originator);
|
|
2051
|
+
return await this.underlying.listCertificates(args, originator);
|
|
1507
2052
|
}
|
|
1508
2053
|
async proveCertificate(args, originator) {
|
|
1509
2054
|
this.checkAuthAndUnderlying(originator);
|
|
1510
|
-
return this.underlying.proveCertificate(args, originator);
|
|
2055
|
+
return await this.underlying.proveCertificate(args, originator);
|
|
1511
2056
|
}
|
|
1512
2057
|
async relinquishCertificate(args, originator) {
|
|
1513
2058
|
this.checkAuthAndUnderlying(originator);
|
|
1514
|
-
return this.underlying.relinquishCertificate(args, originator);
|
|
2059
|
+
return await this.underlying.relinquishCertificate(args, originator);
|
|
1515
2060
|
}
|
|
1516
2061
|
async discoverByIdentityKey(args, originator) {
|
|
1517
2062
|
this.checkAuthAndUnderlying(originator);
|
|
1518
|
-
return this.underlying.discoverByIdentityKey(args, originator);
|
|
2063
|
+
return await this.underlying.discoverByIdentityKey(args, originator);
|
|
1519
2064
|
}
|
|
1520
2065
|
async discoverByAttributes(args, originator) {
|
|
1521
2066
|
this.checkAuthAndUnderlying(originator);
|
|
1522
|
-
return this.underlying.discoverByAttributes(args, originator);
|
|
2067
|
+
return await this.underlying.discoverByAttributes(args, originator);
|
|
1523
2068
|
}
|
|
1524
2069
|
async isAuthenticated(_, originator) {
|
|
1525
2070
|
if (!this.authenticated) {
|
|
@@ -1534,26 +2079,26 @@ class CWIStyleWalletManager {
|
|
|
1534
2079
|
if (originator === this.adminOriginator) {
|
|
1535
2080
|
throw new Error('External applications are not allowed to use the admin originator.');
|
|
1536
2081
|
}
|
|
1537
|
-
while (!this.authenticated ||
|
|
2082
|
+
while (!this.authenticated || this.underlying == null) {
|
|
1538
2083
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
1539
2084
|
}
|
|
1540
2085
|
return await this.underlying.waitForAuthentication({}, originator);
|
|
1541
2086
|
}
|
|
1542
2087
|
async getHeight(_, originator) {
|
|
1543
2088
|
this.checkAuthAndUnderlying(originator);
|
|
1544
|
-
return this.underlying.getHeight({}, originator);
|
|
2089
|
+
return await this.underlying.getHeight({}, originator);
|
|
1545
2090
|
}
|
|
1546
2091
|
async getHeaderForHeight(args, originator) {
|
|
1547
2092
|
this.checkAuthAndUnderlying(originator);
|
|
1548
|
-
return this.underlying.getHeaderForHeight(args, originator);
|
|
2093
|
+
return await this.underlying.getHeaderForHeight(args, originator);
|
|
1549
2094
|
}
|
|
1550
2095
|
async getNetwork(_, originator) {
|
|
1551
2096
|
this.checkAuthAndUnderlying(originator);
|
|
1552
|
-
return this.underlying.getNetwork({}, originator);
|
|
2097
|
+
return await this.underlying.getNetwork({}, originator);
|
|
1553
2098
|
}
|
|
1554
2099
|
async getVersion(_, originator) {
|
|
1555
2100
|
this.checkAuthAndUnderlying(originator);
|
|
1556
|
-
return this.underlying.getVersion({}, originator);
|
|
2101
|
+
return await this.underlying.getVersion({}, originator);
|
|
1557
2102
|
}
|
|
1558
2103
|
}
|
|
1559
2104
|
exports.CWIStyleWalletManager = CWIStyleWalletManager;
|