@bsv/wallet-toolbox 2.1.28 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/client.md +327 -152
- package/docs/storage.md +340 -58
- package/docs/wallet.md +699 -27
- package/out/src/CWIStyleWalletManager.js +107 -41
- package/out/src/CWIStyleWalletManager.js.map +1 -1
- package/out/src/Setup.js +3 -3
- package/out/src/Setup.js.map +1 -1
- package/out/src/SetupClient.js +1 -1
- package/out/src/SetupClient.js.map +1 -1
- package/out/src/ShamirWalletManager.d.ts +2 -2
- package/out/src/ShamirWalletManager.js +10 -3
- package/out/src/ShamirWalletManager.js.map +1 -1
- package/out/src/SimpleWalletManager.js +29 -0
- package/out/src/SimpleWalletManager.js.map +1 -1
- package/out/src/Wallet.js +84 -66
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletAuthenticationManager.js +6 -3
- package/out/src/WalletAuthenticationManager.js.map +1 -1
- package/out/src/WalletLogger.js +6 -4
- package/out/src/WalletLogger.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +158 -167
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/WalletSettingsManager.js +3 -0
- package/out/src/WalletSettingsManager.js.map +1 -1
- package/out/src/entropy/EntropyCollector.js +9 -9
- package/out/src/entropy/EntropyCollector.js.map +1 -1
- package/out/src/fundWalletP2PKH.js +5 -6
- package/out/src/fundWalletP2PKH.js.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.js +1 -0
- package/out/src/mockchain/MockChainStorage.js.map +1 -1
- package/out/src/mockchain/MockChainTracker.js +2 -0
- package/out/src/mockchain/MockChainTracker.js.map +1 -1
- package/out/src/mockchain/MockMiner.js +2 -2
- package/out/src/mockchain/MockMiner.js.map +1 -1
- package/out/src/mockchain/MockServices.js +21 -25
- package/out/src/mockchain/MockServices.js.map +1 -1
- package/out/src/monitor/Monitor.js +45 -33
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +12 -10
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/tasks/TaskArcSSE.js +10 -13
- package/out/src/monitor/tasks/TaskArcSSE.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +10 -11
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.js +22 -22
- package/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -1
- package/out/src/monitor/tasks/TaskClock.js +3 -1
- package/out/src/monitor/tasks/TaskClock.js.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.js +3 -2
- package/out/src/monitor/tasks/TaskMineBlock.js.map +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.js +2 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.js.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js +12 -1
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.js +7 -5
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -1
- package/out/src/monitor/tasks/TaskReorg.js +4 -2
- package/out/src/monitor/tasks/TaskReorg.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.js +12 -9
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewProvenTxs.js +8 -3
- package/out/src/monitor/tasks/TaskReviewProvenTxs.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.js +7 -5
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.js +6 -2
- package/out/src/monitor/tasks/TaskReviewUtxos.js.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.js +9 -2
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js +2 -1
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.js +6 -5
- package/out/src/monitor/tasks/TaskUnFail.js.map +1 -1
- package/out/src/monitor/tasks/WalletMonitorTask.js +7 -4
- package/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js +44 -27
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WERR_errors.js +23 -8
- package/out/src/sdk/WERR_errors.js.map +1 -1
- package/out/src/sdk/WalletError.js +7 -7
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/services/ServiceCollection.js +9 -2
- package/out/src/services/ServiceCollection.js.map +1 -1
- package/out/src/services/Services.js +58 -54
- package/out/src/services/Services.js.map +1 -1
- package/out/src/services/chaintracker/BHServiceClient.js +8 -2
- package/out/src/services/chaintracker/BHServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.js +5 -2
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js +27 -21
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js +10 -5
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +4 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js +8 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js +7 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js +5 -3
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js.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.js +3 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js +3 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js.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.js +1 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js +8 -5
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js +3 -1
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js +2 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js +12 -6
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js +8 -7
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js +8 -8
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js +15 -16
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js +3 -3
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js +1 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.js +1 -1
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.js +1 -1
- package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +19 -16
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js +4 -0
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js +17 -4
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js +21 -0
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js +1 -3
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js +9 -3
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.js +7 -5
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.js.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.js +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js +8 -8
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.js +8 -8
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
- package/out/src/services/providers/ARC.js +13 -5
- package/out/src/services/providers/ARC.js.map +1 -1
- package/out/src/services/providers/ArcSSEClient.js +9 -8
- package/out/src/services/providers/ArcSSEClient.js.map +1 -1
- package/out/src/services/providers/Bitails.js +6 -2
- package/out/src/services/providers/Bitails.js.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.js +6 -2
- package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
- package/out/src/services/providers/WhatsOnChain.js +2 -1
- package/out/src/services/providers/WhatsOnChain.js.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/signer/WalletSigner.js +4 -1
- package/out/src/signer/WalletSigner.js.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.js +1 -2
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.js +1 -2
- package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
- package/out/src/signer/methods/completeSignedTransaction.js +4 -5
- package/out/src/signer/methods/completeSignedTransaction.js.map +1 -1
- package/out/src/signer/methods/createAction.js +9 -11
- package/out/src/signer/methods/createAction.js.map +1 -1
- package/out/src/signer/methods/signAction.js +5 -6
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/src/storage/StorageIdb.js +84 -99
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +22 -29
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +4 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +45 -33
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.js +4 -2
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageSyncReader.js +2 -0
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.js +47 -25
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/adminServer/adminServer.js +35 -48
- package/out/src/storage/adminServer/adminServer.js.map +1 -1
- package/out/src/storage/idbHelpers.js +1 -2
- package/out/src/storage/idbHelpers.js.map +1 -1
- package/out/src/storage/methods/ListActionsSpecOp.js +2 -2
- package/out/src/storage/methods/ListActionsSpecOp.js.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.js +5 -2
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +10 -12
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +87 -59
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.js +2 -3
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +2 -4
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +27 -2
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActionsIdb.js +7 -9
- package/out/src/storage/methods/listActionsIdb.js.map +1 -1
- package/out/src/storage/methods/listActionsKnex.js +7 -9
- package/out/src/storage/methods/listActionsKnex.js.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.js +5 -7
- package/out/src/storage/methods/listOutputsIdb.js.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.js +9 -10
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +12 -11
- package/out/src/storage/methods/processAction.js.map +1 -1
- package/out/src/storage/methods/reviewStatus.d.ts +3 -2
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +34 -2
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/methods/reviewStatusIdb.d.ts +2 -2
- 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/portable/index.js +11 -15
- package/out/src/storage/portable/index.js.map +1 -1
- package/out/src/storage/remoting/StorageClient.js +2 -3
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/remoting/StorageClientBase.js +6 -3
- package/out/src/storage/remoting/StorageClientBase.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +17 -11
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +5 -1
- package/out/src/storage/schema/KnexMigrations.js.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/EntityOutputBasket.js +1 -1
- package/out/src/storage/schema/entities/EntityOutputBasket.js.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTx.js +12 -13
- package/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTxReq.js +7 -9
- package/out/src/storage/schema/entities/EntityProvenTxReq.js.map +1 -1
- package/out/src/storage/schema/entities/EntitySyncState.js +6 -3
- package/out/src/storage/schema/entities/EntitySyncState.js.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.js +4 -0
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -1
- package/out/src/storage/storageProviderHelpers.js +2 -3
- package/out/src/storage/storageProviderHelpers.js.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.js +2 -2
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
- package/out/src/utility/Format.js +4 -5
- package/out/src/utility/Format.js.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.js +7 -6
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js.map +1 -1
- package/out/src/utility/identityUtils.js +2 -4
- package/out/src/utility/identityUtils.js.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.js +2 -2
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/src/utility/utilityHelpers.noBuffer.js +4 -4
- package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -1
- package/out/src/wab-client/WABClient.js +1 -0
- package/out/src/wab-client/WABClient.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.js +1 -4
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -1
- package/package.json +26 -18
- 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 -810
- 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 -303
- 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 -365
- 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 -86
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +0 -280
- 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 -585
- 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 -416
- 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 -60
- 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 -181
- 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 -24
- 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 -80
- 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 -61
- 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 -61
- 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 -57
- 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 -41
- 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 -109
- 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 -88
- 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 -76
- 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 -44
- 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 -165
- 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 -66
- 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 -55
- 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/remoting/__tests__/entityValidationHelpers.test.d.ts +0 -2
- package/out/src/storage/remoting/__tests__/entityValidationHelpers.test.d.ts.map +0 -1
- package/out/src/storage/remoting/__tests__/entityValidationHelpers.test.js +0 -268
- package/out/src/storage/remoting/__tests__/entityValidationHelpers.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 -331
- 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,1111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const sdk_1 = require("@bsv/sdk");
|
|
5
|
-
const randomValsUsed1_1 = require("./randomValsUsed1");
|
|
6
|
-
const index_client_1 = require("../../../../index.client");
|
|
7
|
-
const generateChange_1 = require("../../generateChange");
|
|
8
|
-
describe('generateChange tests', () => {
|
|
9
|
-
jest.setTimeout(99999999);
|
|
10
|
-
test('0 two outputs', async () => {
|
|
11
|
-
const params = {
|
|
12
|
-
...defParams,
|
|
13
|
-
fixedOutputs: [
|
|
14
|
-
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
15
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
16
|
-
]
|
|
17
|
-
};
|
|
18
|
-
const availableChange = [...defAvailableChange()];
|
|
19
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
20
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
21
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":6323,"outputId":15005,"spendable":false}],"changeOutputs":[{"satoshis":1608,"lockingScriptLength":25}],"size":1739330,"fee":3479,"satsPerKb":2}');
|
|
22
|
-
expectTransactionSize(params, r);
|
|
23
|
-
});
|
|
24
|
-
test('0a two outputs exact input', async () => {
|
|
25
|
-
const params = {
|
|
26
|
-
...defParams,
|
|
27
|
-
fixedOutputs: [
|
|
28
|
-
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
29
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
30
|
-
]
|
|
31
|
-
};
|
|
32
|
-
const availableChange = [...defAvailableChange()];
|
|
33
|
-
availableChange[5].satoshis = 4715;
|
|
34
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
35
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
36
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":4715,"outputId":15027,"spendable":false}],"changeOutputs":[],"size":1739296,"fee":3479,"satsPerKb":2}');
|
|
37
|
-
expectTransactionSize(params, r);
|
|
38
|
-
});
|
|
39
|
-
test('0b two outputs 666666 200 ', async () => {
|
|
40
|
-
const params = {
|
|
41
|
-
...defParams,
|
|
42
|
-
fixedOutputs: [
|
|
43
|
-
{ satoshis: 666666, lockingScriptLength: 197 },
|
|
44
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
const availableChange = [...defAvailableChange()];
|
|
48
|
-
availableChange[5].satoshis = 4715;
|
|
49
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
50
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
51
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1575097,"outputId":15101,"spendable":false}],"changeOutputs":[{"satoshis":908230,"lockingScriptLength":25}],"size":432,"fee":1,"satsPerKb":2}');
|
|
52
|
-
expectTransactionSize(params, r);
|
|
53
|
-
});
|
|
54
|
-
test('0c two outputs 666666 200 two change inputs ', async () => {
|
|
55
|
-
const params = {
|
|
56
|
-
...defParams,
|
|
57
|
-
fixedOutputs: [
|
|
58
|
-
{ satoshis: 666666, lockingScriptLength: 197 },
|
|
59
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
60
|
-
]
|
|
61
|
-
};
|
|
62
|
-
const availableChange = [
|
|
63
|
-
{ satoshis: 191051, outputId: 14101 },
|
|
64
|
-
{ satoshis: 129470, outputId: 14106 },
|
|
65
|
-
{ satoshis: 273356, outputId: 14110 },
|
|
66
|
-
{ satoshis: 65612, outputId: 14120 },
|
|
67
|
-
{ satoshis: 44778, outputId: 14126 },
|
|
68
|
-
{ satoshis: 58732, outputId: 14141 },
|
|
69
|
-
{ satoshis: 160865, outputId: 14142 },
|
|
70
|
-
{ satoshis: 535280, outputId: 14146 },
|
|
71
|
-
{ satoshis: 1006, outputId: 14177 },
|
|
72
|
-
{ satoshis: 1000, outputId: 14178 }
|
|
73
|
-
];
|
|
74
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
75
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
76
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":535280,"outputId":14146,"spendable":false},{"satoshis":160865,"outputId":14142,"spendable":false}],"changeOutputs":[{"satoshis":29277,"lockingScriptLength":25}],"size":580,"fee":2,"satsPerKb":2}');
|
|
77
|
-
expectTransactionSize(params, r);
|
|
78
|
-
});
|
|
79
|
-
test('1 two outputs four change outputs', async () => {
|
|
80
|
-
const params = {
|
|
81
|
-
...defParams,
|
|
82
|
-
fixedOutputs: [
|
|
83
|
-
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
84
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
85
|
-
],
|
|
86
|
-
targetNetCount: 4
|
|
87
|
-
};
|
|
88
|
-
const availableChange = [...defAvailableChange()];
|
|
89
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
90
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
91
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":10735,"outputId":15106,"spendable":false}],"changeOutputs":[{"satoshis":1237,"lockingScriptLength":25},{"satoshis":1334,"lockingScriptLength":25},{"satoshis":1369,"lockingScriptLength":25},{"satoshis":1008,"lockingScriptLength":25},{"satoshis":1072,"lockingScriptLength":25}],"size":1739466,"fee":3479,"satsPerKb":2}');
|
|
92
|
-
expectTransactionSize(params, r);
|
|
93
|
-
});
|
|
94
|
-
test('2 WERR_INSUFFICIENT_FUNDS', async () => {
|
|
95
|
-
const params = {
|
|
96
|
-
...defParams,
|
|
97
|
-
fixedOutputs: [
|
|
98
|
-
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
99
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
100
|
-
],
|
|
101
|
-
targetNetCount: 4
|
|
102
|
-
};
|
|
103
|
-
const availableChange = defAvailableChange().slice(1, 4);
|
|
104
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
105
|
-
expectToThrowWERR(index_client_1.sdk.WERR_INSUFFICIENT_FUNDS, async () => await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput));
|
|
106
|
-
});
|
|
107
|
-
test('2a WERR_INSUFFICIENT_FUNDS no inputs', async () => {
|
|
108
|
-
const params = {
|
|
109
|
-
...defParams,
|
|
110
|
-
fixedOutputs: [
|
|
111
|
-
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
112
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
113
|
-
],
|
|
114
|
-
targetNetCount: 4
|
|
115
|
-
};
|
|
116
|
-
const availableChange = [];
|
|
117
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
118
|
-
expectToThrowWERR(index_client_1.sdk.WERR_INSUFFICIENT_FUNDS, async () => await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput));
|
|
119
|
-
});
|
|
120
|
-
test('3 allocate all', async () => {
|
|
121
|
-
const params = {
|
|
122
|
-
...defParams,
|
|
123
|
-
fixedOutputs: [
|
|
124
|
-
{ satoshis: 1234, lockingScriptLength: 39091 },
|
|
125
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
126
|
-
],
|
|
127
|
-
targetNetCount: 4
|
|
128
|
-
};
|
|
129
|
-
const availableChange = defAvailableChange().slice(1, 4);
|
|
130
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
131
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
132
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1004,"outputId":15011,"spendable":false},{"satoshis":1000,"outputId":15017,"spendable":false}],"changeOutputs":[{"satoshis":689,"lockingScriptLength":25}],"size":39476,"fee":79,"satsPerKb":2}');
|
|
133
|
-
expectTransactionSize(params, r);
|
|
134
|
-
});
|
|
135
|
-
test('4 feeModel 5 sat per kb', async () => {
|
|
136
|
-
const params = {
|
|
137
|
-
...defParams,
|
|
138
|
-
fixedOutputs: [
|
|
139
|
-
{ satoshis: 1234, lockingScriptLength: 39091 },
|
|
140
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
141
|
-
],
|
|
142
|
-
feeModel: { value: 5, model: 'sat/kb' },
|
|
143
|
-
targetNetCount: 4
|
|
144
|
-
};
|
|
145
|
-
const availableChange = defAvailableChange().slice(1, 4);
|
|
146
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
147
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
148
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1004,"outputId":15011,"spendable":false},{"satoshis":1000,"outputId":15017,"spendable":false}],"changeOutputs":[{"satoshis":570,"lockingScriptLength":25}],"size":39476,"fee":198,"satsPerKb":5}');
|
|
149
|
-
expectTransactionSize(params, r);
|
|
150
|
-
});
|
|
151
|
-
test('4a feeModel 1 sat per kb', async () => {
|
|
152
|
-
const params = {
|
|
153
|
-
...defParams,
|
|
154
|
-
fixedOutputs: [
|
|
155
|
-
{ satoshis: 1234, lockingScriptLength: 39091 },
|
|
156
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
157
|
-
],
|
|
158
|
-
feeModel: { value: 1, model: 'sat/kb' },
|
|
159
|
-
targetNetCount: 4
|
|
160
|
-
};
|
|
161
|
-
const availableChange = defAvailableChange().slice(1, 4);
|
|
162
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
163
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
164
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1004,"outputId":15011,"spendable":false},{"satoshis":1000,"outputId":15017,"spendable":false}],"changeOutputs":[{"satoshis":728,"lockingScriptLength":25}],"size":39476,"fee":40,"satsPerKb":1}');
|
|
165
|
-
expectTransactionSize(params, r);
|
|
166
|
-
});
|
|
167
|
-
test('5 one fixedInput', async () => {
|
|
168
|
-
const params = {
|
|
169
|
-
...defParams,
|
|
170
|
-
fixedInputs: [{ satoshis: 1234, unlockingScriptLength: 42 }],
|
|
171
|
-
fixedOutputs: [
|
|
172
|
-
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
173
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
174
|
-
],
|
|
175
|
-
targetNetCount: 4
|
|
176
|
-
};
|
|
177
|
-
const availableChange = [...defAvailableChange()];
|
|
178
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
179
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
180
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":10735,"outputId":15106,"spendable":false}],"changeOutputs":[{"satoshis":1526,"lockingScriptLength":25},{"satoshis":1738,"lockingScriptLength":25},{"satoshis":1816,"lockingScriptLength":25},{"satoshis":1016,"lockingScriptLength":25},{"satoshis":1157,"lockingScriptLength":25}],"size":1739549,"fee":3480,"satsPerKb":2}');
|
|
181
|
-
expectTransactionSize(params, r);
|
|
182
|
-
});
|
|
183
|
-
test('5a one larger fixedInput', async () => {
|
|
184
|
-
const params = {
|
|
185
|
-
...defParams,
|
|
186
|
-
fixedInputs: [{ satoshis: 1234, unlockingScriptLength: 242 }],
|
|
187
|
-
fixedOutputs: [
|
|
188
|
-
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
189
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
190
|
-
],
|
|
191
|
-
targetNetCount: 4
|
|
192
|
-
};
|
|
193
|
-
const availableChange = [...defAvailableChange()];
|
|
194
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
195
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
196
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":10735,"outputId":15106,"spendable":false}],"changeOutputs":[{"satoshis":1526,"lockingScriptLength":25},{"satoshis":1738,"lockingScriptLength":25},{"satoshis":1816,"lockingScriptLength":25},{"satoshis":1016,"lockingScriptLength":25},{"satoshis":1157,"lockingScriptLength":25}],"size":1739749,"fee":3480,"satsPerKb":2}');
|
|
197
|
-
expectTransactionSize(params, r);
|
|
198
|
-
});
|
|
199
|
-
test('5b one fixedInput 1001 73', async () => {
|
|
200
|
-
const params = {
|
|
201
|
-
...defParams,
|
|
202
|
-
fixedInputs: [{ satoshis: 1001, unlockingScriptLength: 73 }]
|
|
203
|
-
};
|
|
204
|
-
const availableChange = [...defAvailableChange()];
|
|
205
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
206
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
207
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[],"changeOutputs":[{"satoshis":1000,"lockingScriptLength":25}],"size":158,"fee":1,"satsPerKb":2}');
|
|
208
|
-
expectTransactionSize(params, r);
|
|
209
|
-
});
|
|
210
|
-
test('6 no fixedOutputs one fixedInput', async () => {
|
|
211
|
-
const params = {
|
|
212
|
-
...defParams,
|
|
213
|
-
fixedInputs: [{ satoshis: 1234, unlockingScriptLength: 42 }],
|
|
214
|
-
fixedOutputs: [],
|
|
215
|
-
targetNetCount: 4
|
|
216
|
-
};
|
|
217
|
-
const availableChange = [...defAvailableChange()];
|
|
218
|
-
const { allocateChangeInput, releaseChangeInput, getLog } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
219
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
220
|
-
// console.log(getLog())
|
|
221
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":6323,"outputId":15005,"spendable":false}],"changeOutputs":[{"satoshis":1597,"lockingScriptLength":25},{"satoshis":1837,"lockingScriptLength":25},{"satoshis":1925,"lockingScriptLength":25},{"satoshis":1019,"lockingScriptLength":25},{"satoshis":1178,"lockingScriptLength":25}],"size":411,"fee":1,"satsPerKb":2}');
|
|
222
|
-
expectTransactionSize(params, r);
|
|
223
|
-
});
|
|
224
|
-
test('6a no fixedOutputs no fixedInput', async () => {
|
|
225
|
-
const params = {
|
|
226
|
-
...defParams,
|
|
227
|
-
fixedInputs: [],
|
|
228
|
-
fixedOutputs: [],
|
|
229
|
-
targetNetCount: 4
|
|
230
|
-
};
|
|
231
|
-
const availableChange = [...defAvailableChange()];
|
|
232
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
233
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
234
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":6323,"outputId":15005,"spendable":false}],"changeOutputs":[{"satoshis":1309,"lockingScriptLength":25},{"satoshis":1433,"lockingScriptLength":25},{"satoshis":1478,"lockingScriptLength":25},{"satoshis":1009,"lockingScriptLength":25},{"satoshis":1093,"lockingScriptLength":25}],"size":328,"fee":1,"satsPerKb":2}');
|
|
235
|
-
expectTransactionSize(params, r);
|
|
236
|
-
});
|
|
237
|
-
test('7 paramsText4 d4', async () => {
|
|
238
|
-
const params = {
|
|
239
|
-
...defParams,
|
|
240
|
-
fixedOutputs: [
|
|
241
|
-
{ satoshis: 309000, lockingScriptLength: 198 },
|
|
242
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
243
|
-
]
|
|
244
|
-
};
|
|
245
|
-
const availableChange = [
|
|
246
|
-
{ satoshis: 7130, outputId: 15142 },
|
|
247
|
-
{ satoshis: 474866, outputId: 15332 },
|
|
248
|
-
{ satoshis: 16411, outputId: 15355 },
|
|
249
|
-
{ satoshis: 763632, outputId: 15368 },
|
|
250
|
-
{ satoshis: 18894, outputId: 15371 },
|
|
251
|
-
{ satoshis: 1574590, outputId: 15420 },
|
|
252
|
-
{ satoshis: 43207, outputId: 15480 },
|
|
253
|
-
{ satoshis: 12342, outputId: 15541 },
|
|
254
|
-
{ satoshis: 123453, outputId: 15548 },
|
|
255
|
-
{ satoshis: 7890, outputId: 16020 },
|
|
256
|
-
{ satoshis: 1073, outputId: 16026 }
|
|
257
|
-
];
|
|
258
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
259
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
260
|
-
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":474866,"outputId":15332,"spendable":false}],"changeOutputs":[{"satoshis":165863,"lockingScriptLength":25}],"size":433,"fee":1,"satsPerKb":2}');
|
|
261
|
-
expectTransactionSize(params, r);
|
|
262
|
-
});
|
|
263
|
-
const d5 = {
|
|
264
|
-
p: {
|
|
265
|
-
fixedInputs: [{ satoshis: 1000, unlockingScriptLength: 72 }],
|
|
266
|
-
fixedOutputs: [{ satoshis: 200, lockingScriptLength: 25 }],
|
|
267
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
268
|
-
changeInitialSatoshis: 1000,
|
|
269
|
-
changeFirstSatoshis: 285,
|
|
270
|
-
changeLockingScriptLength: 25,
|
|
271
|
-
changeUnlockingScriptLength: 107
|
|
272
|
-
},
|
|
273
|
-
availableChange: [
|
|
274
|
-
{ satoshis: 191051, outputId: 14101 },
|
|
275
|
-
{ satoshis: 273356, outputId: 14110 },
|
|
276
|
-
{ satoshis: 65612, outputId: 14120 },
|
|
277
|
-
{ satoshis: 44778, outputId: 14126 },
|
|
278
|
-
{ satoshis: 58732, outputId: 14141 },
|
|
279
|
-
{ satoshis: 160865, outputId: 14142 },
|
|
280
|
-
{ satoshis: 1006, outputId: 14177 },
|
|
281
|
-
{ satoshis: 1000, outputId: 14178 },
|
|
282
|
-
{ satoshis: 1000, outputId: 14180 },
|
|
283
|
-
{ satoshis: 1000, outputId: 14181 },
|
|
284
|
-
{ satoshis: 1000, outputId: 14183 },
|
|
285
|
-
{ satoshis: 1000, outputId: 14185 },
|
|
286
|
-
{ satoshis: 1000, outputId: 14186 },
|
|
287
|
-
{ satoshis: 1001, outputId: 14188 },
|
|
288
|
-
{ satoshis: 1000, outputId: 14189 },
|
|
289
|
-
{ satoshis: 1000, outputId: 14190 },
|
|
290
|
-
{ satoshis: 1001, outputId: 14192 },
|
|
291
|
-
{ satoshis: 1000, outputId: 14195 },
|
|
292
|
-
{ satoshis: 1000, outputId: 14196 },
|
|
293
|
-
{ satoshis: 1000, outputId: 14197 },
|
|
294
|
-
{ satoshis: 1000, outputId: 14198 },
|
|
295
|
-
{ satoshis: 1000, outputId: 14199 },
|
|
296
|
-
{ satoshis: 1000, outputId: 14200 },
|
|
297
|
-
{ satoshis: 1000, outputId: 14201 },
|
|
298
|
-
{ satoshis: 1000, outputId: 14202 },
|
|
299
|
-
{ satoshis: 1000, outputId: 14203 },
|
|
300
|
-
{ satoshis: 1000, outputId: 14204 },
|
|
301
|
-
{ satoshis: 1000, outputId: 14205 },
|
|
302
|
-
{ satoshis: 1000, outputId: 14206 },
|
|
303
|
-
{ satoshis: 1003, outputId: 14207 },
|
|
304
|
-
{ satoshis: 1001, outputId: 14208 },
|
|
305
|
-
{ satoshis: 1000, outputId: 14209 },
|
|
306
|
-
{ satoshis: 1000, outputId: 14210 },
|
|
307
|
-
{ satoshis: 1006, outputId: 14211 },
|
|
308
|
-
{ satoshis: 1020, outputId: 14212 },
|
|
309
|
-
{ satoshis: 1000, outputId: 14213 },
|
|
310
|
-
{ satoshis: 1000, outputId: 14214 },
|
|
311
|
-
{ satoshis: 1000, outputId: 14215 },
|
|
312
|
-
{ satoshis: 1000, outputId: 14216 },
|
|
313
|
-
{ satoshis: 1002, outputId: 14217 },
|
|
314
|
-
{ satoshis: 1046, outputId: 14218 },
|
|
315
|
-
{ satoshis: 1103, outputId: 14219 },
|
|
316
|
-
{ satoshis: 1001, outputId: 14221 },
|
|
317
|
-
{ satoshis: 1000, outputId: 14222 },
|
|
318
|
-
{ satoshis: 1000, outputId: 14223 },
|
|
319
|
-
{ satoshis: 1000, outputId: 14224 },
|
|
320
|
-
{ satoshis: 31311, outputId: 14321 },
|
|
321
|
-
{ satoshis: 1042, outputId: 14656 },
|
|
322
|
-
{ satoshis: 1099, outputId: 14661 },
|
|
323
|
-
{ satoshis: 1100, outputId: 14675 },
|
|
324
|
-
{ satoshis: 1019, outputId: 14676 },
|
|
325
|
-
{ satoshis: 1040, outputId: 14677 },
|
|
326
|
-
{ satoshis: 1000, outputId: 14679 },
|
|
327
|
-
{ satoshis: 1000, outputId: 14680 },
|
|
328
|
-
{ satoshis: 1001, outputId: 14681 },
|
|
329
|
-
{ satoshis: 1000, outputId: 14682 },
|
|
330
|
-
{ satoshis: 1001, outputId: 14683 },
|
|
331
|
-
{ satoshis: 1002, outputId: 14684 },
|
|
332
|
-
{ satoshis: 1005, outputId: 14685 },
|
|
333
|
-
{ satoshis: 1000, outputId: 14686 },
|
|
334
|
-
{ satoshis: 1007, outputId: 14687 },
|
|
335
|
-
{ satoshis: 1000, outputId: 14802 },
|
|
336
|
-
{ satoshis: 1069, outputId: 14803 },
|
|
337
|
-
{ satoshis: 1231, outputId: 15465 },
|
|
338
|
-
{ satoshis: 2386, outputId: 15468 },
|
|
339
|
-
{ satoshis: 1267, outputId: 15471 },
|
|
340
|
-
{ satoshis: 1283, outputId: 15472 },
|
|
341
|
-
{ satoshis: 1054, outputId: 15473 },
|
|
342
|
-
{ satoshis: 2031, outputId: 15475 },
|
|
343
|
-
{ satoshis: 1065, outputId: 15478 },
|
|
344
|
-
{ satoshis: 1268, outputId: 15479 },
|
|
345
|
-
{ satoshis: 1066, outputId: 15480 },
|
|
346
|
-
{ satoshis: 1065, outputId: 15481 },
|
|
347
|
-
{ satoshis: 1006, outputId: 15482 },
|
|
348
|
-
{ satoshis: 999799, outputId: 16338 },
|
|
349
|
-
{ satoshis: 2021, outputId: 16339 },
|
|
350
|
-
{ satoshis: 666465, outputId: 16340 },
|
|
351
|
-
{ satoshis: 5354, outputId: 16341 },
|
|
352
|
-
{ satoshis: 3132, outputId: 16342 }
|
|
353
|
-
]
|
|
354
|
-
};
|
|
355
|
-
const d6 = {
|
|
356
|
-
p: {
|
|
357
|
-
fixedInputs: [],
|
|
358
|
-
fixedOutputs: [
|
|
359
|
-
{ satoshis: 500, lockingScriptLength: 436 },
|
|
360
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
361
|
-
],
|
|
362
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
363
|
-
changeInitialSatoshis: 1000,
|
|
364
|
-
changeFirstSatoshis: 285,
|
|
365
|
-
changeLockingScriptLength: 25,
|
|
366
|
-
changeUnlockingScriptLength: 107
|
|
367
|
-
},
|
|
368
|
-
availableChange: [
|
|
369
|
-
{ satoshis: 1040, outputId: 16345 },
|
|
370
|
-
{ satoshis: 1000, outputId: 16346 },
|
|
371
|
-
{ satoshis: 1023, outputId: 16348 },
|
|
372
|
-
{ satoshis: 1054, outputId: 16350 },
|
|
373
|
-
{ satoshis: 1118, outputId: 16353 },
|
|
374
|
-
{ satoshis: 1000, outputId: 16354 },
|
|
375
|
-
{ satoshis: 1001, outputId: 16355 },
|
|
376
|
-
{ satoshis: 1000, outputId: 16356 },
|
|
377
|
-
{ satoshis: 1005, outputId: 16360 },
|
|
378
|
-
{ satoshis: 1000, outputId: 16361 },
|
|
379
|
-
{ satoshis: 375235, outputId: 16362 },
|
|
380
|
-
{ satoshis: 1000, outputId: 16363 },
|
|
381
|
-
{ satoshis: 1000, outputId: 16364 },
|
|
382
|
-
{ satoshis: 45658, outputId: 16365 },
|
|
383
|
-
{ satoshis: 286834, outputId: 16367 },
|
|
384
|
-
{ satoshis: 1001, outputId: 16368 },
|
|
385
|
-
{ satoshis: 1001, outputId: 16369 },
|
|
386
|
-
{ satoshis: 57051, outputId: 16370 },
|
|
387
|
-
{ satoshis: 1036, outputId: 16371 },
|
|
388
|
-
{ satoshis: 16508, outputId: 16372 },
|
|
389
|
-
{ satoshis: 1000, outputId: 16373 },
|
|
390
|
-
{ satoshis: 64213, outputId: 16374 },
|
|
391
|
-
{ satoshis: 1000, outputId: 16376 },
|
|
392
|
-
{ satoshis: 1000, outputId: 16377 },
|
|
393
|
-
{ satoshis: 1154, outputId: 16378 },
|
|
394
|
-
{ satoshis: 1000, outputId: 16380 },
|
|
395
|
-
{ satoshis: 1008, outputId: 16381 },
|
|
396
|
-
{ satoshis: 1064, outputId: 16382 },
|
|
397
|
-
{ satoshis: 1234, outputId: 16383 },
|
|
398
|
-
{ satoshis: 119205, outputId: 16395 },
|
|
399
|
-
{ satoshis: 582, outputId: 16397 },
|
|
400
|
-
{ satoshis: 2384, outputId: 16399 },
|
|
401
|
-
{ satoshis: 4391, outputId: 16401 },
|
|
402
|
-
{ satoshis: 600, outputId: 16406 },
|
|
403
|
-
{ satoshis: 2599799, outputId: 16407 }
|
|
404
|
-
]
|
|
405
|
-
};
|
|
406
|
-
const d7 = {
|
|
407
|
-
p: {
|
|
408
|
-
fixedInputs: [],
|
|
409
|
-
fixedOutputs: [
|
|
410
|
-
{ satoshis: 1570, lockingScriptLength: 25 },
|
|
411
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
412
|
-
],
|
|
413
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
414
|
-
changeInitialSatoshis: 1000,
|
|
415
|
-
changeFirstSatoshis: 285,
|
|
416
|
-
changeLockingScriptLength: 25,
|
|
417
|
-
changeUnlockingScriptLength: 107
|
|
418
|
-
},
|
|
419
|
-
availableChange: [
|
|
420
|
-
{ satoshis: 23082, outputId: 14734 },
|
|
421
|
-
{ satoshis: 16496, outputId: 14742 },
|
|
422
|
-
{ satoshis: 270789, outputId: 14744 },
|
|
423
|
-
{ satoshis: 81520, outputId: 14763 },
|
|
424
|
-
{ satoshis: 14759, outputId: 14770 },
|
|
425
|
-
{ satoshis: 390625, outputId: 14774 },
|
|
426
|
-
{ satoshis: 674234, outputId: 14790 },
|
|
427
|
-
{ satoshis: 999799, outputId: 14794 },
|
|
428
|
-
{ satoshis: 1000, outputId: 15583 },
|
|
429
|
-
{ satoshis: 1000, outputId: 15584 },
|
|
430
|
-
{ satoshis: 1000, outputId: 15585 },
|
|
431
|
-
{ satoshis: 1000, outputId: 15586 },
|
|
432
|
-
{ satoshis: 1000, outputId: 15587 },
|
|
433
|
-
{ satoshis: 1000, outputId: 15588 },
|
|
434
|
-
{ satoshis: 1025, outputId: 15589 },
|
|
435
|
-
{ satoshis: 1000, outputId: 15590 },
|
|
436
|
-
{ satoshis: 1000, outputId: 15591 },
|
|
437
|
-
{ satoshis: 1000, outputId: 15593 },
|
|
438
|
-
{ satoshis: 1000, outputId: 15594 },
|
|
439
|
-
{ satoshis: 1000, outputId: 15595 },
|
|
440
|
-
{ satoshis: 1000, outputId: 15596 },
|
|
441
|
-
{ satoshis: 1000, outputId: 15597 },
|
|
442
|
-
{ satoshis: 1316, outputId: 15598 },
|
|
443
|
-
{ satoshis: 1000, outputId: 15599 },
|
|
444
|
-
{ satoshis: 1000, outputId: 15600 },
|
|
445
|
-
{ satoshis: 1000, outputId: 15601 },
|
|
446
|
-
{ satoshis: 1426, outputId: 15602 },
|
|
447
|
-
{ satoshis: 1000, outputId: 15603 },
|
|
448
|
-
{ satoshis: 1000, outputId: 15604 },
|
|
449
|
-
{ satoshis: 1000, outputId: 15605 },
|
|
450
|
-
{ satoshis: 1000, outputId: 15606 },
|
|
451
|
-
{ satoshis: 1000, outputId: 15607 },
|
|
452
|
-
{ satoshis: 1000, outputId: 15608 },
|
|
453
|
-
{ satoshis: 1000, outputId: 15609 },
|
|
454
|
-
{ satoshis: 1004, outputId: 15610 },
|
|
455
|
-
{ satoshis: 1000, outputId: 15611 },
|
|
456
|
-
{ satoshis: 1013, outputId: 15612 },
|
|
457
|
-
{ satoshis: 1001, outputId: 15614 },
|
|
458
|
-
{ satoshis: 1000, outputId: 15615 },
|
|
459
|
-
{ satoshis: 1000, outputId: 15616 },
|
|
460
|
-
{ satoshis: 1000, outputId: 15617 },
|
|
461
|
-
{ satoshis: 1000, outputId: 15618 },
|
|
462
|
-
{ satoshis: 1000, outputId: 15619 },
|
|
463
|
-
{ satoshis: 1006, outputId: 15620 },
|
|
464
|
-
{ satoshis: 1000, outputId: 15621 },
|
|
465
|
-
{ satoshis: 1000, outputId: 15622 },
|
|
466
|
-
{ satoshis: 1000, outputId: 15623 },
|
|
467
|
-
{ satoshis: 1000, outputId: 15624 },
|
|
468
|
-
{ satoshis: 1032, outputId: 15625 },
|
|
469
|
-
{ satoshis: 4571, outputId: 15626 },
|
|
470
|
-
{ satoshis: 1000, outputId: 15628 },
|
|
471
|
-
{ satoshis: 1000, outputId: 15629 },
|
|
472
|
-
{ satoshis: 1087, outputId: 15630 },
|
|
473
|
-
{ satoshis: 1000, outputId: 15631 },
|
|
474
|
-
{ satoshis: 1000, outputId: 15632 },
|
|
475
|
-
{ satoshis: 1001, outputId: 15633 },
|
|
476
|
-
{ satoshis: 1001, outputId: 15634 },
|
|
477
|
-
{ satoshis: 1000, outputId: 15635 },
|
|
478
|
-
{ satoshis: 1000, outputId: 15637 },
|
|
479
|
-
{ satoshis: 1001, outputId: 15638 },
|
|
480
|
-
{ satoshis: 1000, outputId: 15639 },
|
|
481
|
-
{ satoshis: 1000, outputId: 15640 },
|
|
482
|
-
{ satoshis: 1000, outputId: 15641 },
|
|
483
|
-
{ satoshis: 1000, outputId: 15642 },
|
|
484
|
-
{ satoshis: 1000, outputId: 15643 },
|
|
485
|
-
{ satoshis: 1036, outputId: 15644 },
|
|
486
|
-
{ satoshis: 1000, outputId: 15645 },
|
|
487
|
-
{ satoshis: 1000, outputId: 15646 },
|
|
488
|
-
{ satoshis: 1000, outputId: 15647 },
|
|
489
|
-
{ satoshis: 1000, outputId: 15648 },
|
|
490
|
-
{ satoshis: 1001, outputId: 15649 },
|
|
491
|
-
{ satoshis: 1000, outputId: 15650 },
|
|
492
|
-
{ satoshis: 1050, outputId: 15651 },
|
|
493
|
-
{ satoshis: 1273, outputId: 15653 },
|
|
494
|
-
{ satoshis: 1029, outputId: 15654 },
|
|
495
|
-
{ satoshis: 1524, outputId: 15655 },
|
|
496
|
-
{ satoshis: 1817, outputId: 15658 },
|
|
497
|
-
{ satoshis: 1041, outputId: 16409 }
|
|
498
|
-
]
|
|
499
|
-
};
|
|
500
|
-
const d8 = {
|
|
501
|
-
p: {
|
|
502
|
-
fixedInputs: [],
|
|
503
|
-
fixedOutputs: [
|
|
504
|
-
{ satoshis: 1564, lockingScriptLength: 25 },
|
|
505
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
506
|
-
],
|
|
507
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
508
|
-
changeInitialSatoshis: 1000,
|
|
509
|
-
changeFirstSatoshis: 285,
|
|
510
|
-
changeLockingScriptLength: 25,
|
|
511
|
-
changeUnlockingScriptLength: 107
|
|
512
|
-
},
|
|
513
|
-
availableChange: [
|
|
514
|
-
{ satoshis: 23082, outputId: 14734 },
|
|
515
|
-
{ satoshis: 16496, outputId: 14742 },
|
|
516
|
-
{ satoshis: 270789, outputId: 14744 },
|
|
517
|
-
{ satoshis: 81520, outputId: 14763 },
|
|
518
|
-
{ satoshis: 14759, outputId: 14770 },
|
|
519
|
-
{ satoshis: 390625, outputId: 14774 },
|
|
520
|
-
{ satoshis: 674234, outputId: 14790 },
|
|
521
|
-
{ satoshis: 999799, outputId: 14794 },
|
|
522
|
-
{ satoshis: 1000, outputId: 15583 },
|
|
523
|
-
{ satoshis: 1000, outputId: 15584 },
|
|
524
|
-
{ satoshis: 1000, outputId: 15585 },
|
|
525
|
-
{ satoshis: 1000, outputId: 15586 },
|
|
526
|
-
{ satoshis: 1000, outputId: 15587 },
|
|
527
|
-
{ satoshis: 1000, outputId: 15588 },
|
|
528
|
-
{ satoshis: 1025, outputId: 15589 },
|
|
529
|
-
{ satoshis: 1000, outputId: 15590 },
|
|
530
|
-
{ satoshis: 1000, outputId: 15591 },
|
|
531
|
-
{ satoshis: 1000, outputId: 15593 },
|
|
532
|
-
{ satoshis: 1000, outputId: 15594 },
|
|
533
|
-
{ satoshis: 1000, outputId: 15595 },
|
|
534
|
-
{ satoshis: 1000, outputId: 15596 },
|
|
535
|
-
{ satoshis: 1000, outputId: 15597 },
|
|
536
|
-
{ satoshis: 1316, outputId: 15598 },
|
|
537
|
-
{ satoshis: 1000, outputId: 15599 },
|
|
538
|
-
{ satoshis: 1000, outputId: 15600 },
|
|
539
|
-
{ satoshis: 1000, outputId: 15601 },
|
|
540
|
-
{ satoshis: 1426, outputId: 15602 },
|
|
541
|
-
{ satoshis: 1000, outputId: 15603 },
|
|
542
|
-
{ satoshis: 1000, outputId: 15604 },
|
|
543
|
-
{ satoshis: 1000, outputId: 15605 },
|
|
544
|
-
{ satoshis: 1000, outputId: 15606 },
|
|
545
|
-
{ satoshis: 1000, outputId: 15607 },
|
|
546
|
-
{ satoshis: 1000, outputId: 15608 },
|
|
547
|
-
{ satoshis: 1000, outputId: 15609 },
|
|
548
|
-
{ satoshis: 1004, outputId: 15610 },
|
|
549
|
-
{ satoshis: 1000, outputId: 15611 },
|
|
550
|
-
{ satoshis: 1013, outputId: 15612 },
|
|
551
|
-
{ satoshis: 1001, outputId: 15614 },
|
|
552
|
-
{ satoshis: 1000, outputId: 15615 },
|
|
553
|
-
{ satoshis: 1000, outputId: 15616 },
|
|
554
|
-
{ satoshis: 1000, outputId: 15617 },
|
|
555
|
-
{ satoshis: 1000, outputId: 15618 },
|
|
556
|
-
{ satoshis: 1000, outputId: 15619 },
|
|
557
|
-
{ satoshis: 1006, outputId: 15620 },
|
|
558
|
-
{ satoshis: 1000, outputId: 15621 },
|
|
559
|
-
{ satoshis: 1000, outputId: 15622 },
|
|
560
|
-
{ satoshis: 1000, outputId: 15623 },
|
|
561
|
-
{ satoshis: 1000, outputId: 15624 },
|
|
562
|
-
{ satoshis: 1032, outputId: 15625 },
|
|
563
|
-
{ satoshis: 4571, outputId: 15626 },
|
|
564
|
-
{ satoshis: 1000, outputId: 15628 },
|
|
565
|
-
{ satoshis: 1000, outputId: 15629 },
|
|
566
|
-
{ satoshis: 1087, outputId: 15630 },
|
|
567
|
-
{ satoshis: 1000, outputId: 15631 },
|
|
568
|
-
{ satoshis: 1000, outputId: 15632 },
|
|
569
|
-
{ satoshis: 1001, outputId: 15633 },
|
|
570
|
-
{ satoshis: 1001, outputId: 15634 },
|
|
571
|
-
{ satoshis: 1000, outputId: 15635 },
|
|
572
|
-
{ satoshis: 1000, outputId: 15637 },
|
|
573
|
-
{ satoshis: 1001, outputId: 15638 },
|
|
574
|
-
{ satoshis: 1000, outputId: 15639 },
|
|
575
|
-
{ satoshis: 1000, outputId: 15640 },
|
|
576
|
-
{ satoshis: 1000, outputId: 15641 },
|
|
577
|
-
{ satoshis: 1000, outputId: 15642 },
|
|
578
|
-
{ satoshis: 1000, outputId: 15643 },
|
|
579
|
-
{ satoshis: 1036, outputId: 15644 },
|
|
580
|
-
{ satoshis: 1000, outputId: 15645 },
|
|
581
|
-
{ satoshis: 1000, outputId: 15646 },
|
|
582
|
-
{ satoshis: 1000, outputId: 15647 },
|
|
583
|
-
{ satoshis: 1000, outputId: 15648 },
|
|
584
|
-
{ satoshis: 1001, outputId: 15649 },
|
|
585
|
-
{ satoshis: 1000, outputId: 15650 },
|
|
586
|
-
{ satoshis: 1050, outputId: 15651 },
|
|
587
|
-
{ satoshis: 1273, outputId: 15653 },
|
|
588
|
-
{ satoshis: 1029, outputId: 15654 },
|
|
589
|
-
{ satoshis: 1524, outputId: 15655 },
|
|
590
|
-
{ satoshis: 1817, outputId: 15658 },
|
|
591
|
-
{ satoshis: 1041, outputId: 16409 }
|
|
592
|
-
]
|
|
593
|
-
};
|
|
594
|
-
const d9 = {
|
|
595
|
-
p: {
|
|
596
|
-
fixedInputs: [],
|
|
597
|
-
fixedOutputs: [
|
|
598
|
-
{ satoshis: 1000, lockingScriptLength: 1136 },
|
|
599
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
600
|
-
],
|
|
601
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
602
|
-
changeInitialSatoshis: 1000,
|
|
603
|
-
changeFirstSatoshis: 285,
|
|
604
|
-
changeLockingScriptLength: 25,
|
|
605
|
-
changeUnlockingScriptLength: 107
|
|
606
|
-
},
|
|
607
|
-
availableChange: [
|
|
608
|
-
{ satoshis: 23082, outputId: 14734 },
|
|
609
|
-
{ satoshis: 270789, outputId: 14744 },
|
|
610
|
-
{ satoshis: 81520, outputId: 14763 },
|
|
611
|
-
{ satoshis: 14759, outputId: 14770 },
|
|
612
|
-
{ satoshis: 390625, outputId: 14774 },
|
|
613
|
-
{ satoshis: 674234, outputId: 14790 },
|
|
614
|
-
{ satoshis: 999799, outputId: 14794 },
|
|
615
|
-
{ satoshis: 1000, outputId: 15583 },
|
|
616
|
-
{ satoshis: 1000, outputId: 15584 },
|
|
617
|
-
{ satoshis: 1000, outputId: 15585 },
|
|
618
|
-
{ satoshis: 1000, outputId: 15586 },
|
|
619
|
-
{ satoshis: 1000, outputId: 15587 },
|
|
620
|
-
{ satoshis: 1000, outputId: 15588 },
|
|
621
|
-
{ satoshis: 1000, outputId: 15590 },
|
|
622
|
-
{ satoshis: 1000, outputId: 15591 },
|
|
623
|
-
{ satoshis: 1000, outputId: 15593 },
|
|
624
|
-
{ satoshis: 1000, outputId: 15594 },
|
|
625
|
-
{ satoshis: 1000, outputId: 15595 },
|
|
626
|
-
{ satoshis: 1000, outputId: 15596 },
|
|
627
|
-
{ satoshis: 1000, outputId: 15597 },
|
|
628
|
-
{ satoshis: 1000, outputId: 15599 },
|
|
629
|
-
{ satoshis: 1000, outputId: 15600 },
|
|
630
|
-
{ satoshis: 1000, outputId: 15601 },
|
|
631
|
-
{ satoshis: 1000, outputId: 15603 },
|
|
632
|
-
{ satoshis: 1000, outputId: 15604 },
|
|
633
|
-
{ satoshis: 1000, outputId: 15605 },
|
|
634
|
-
{ satoshis: 1000, outputId: 15606 },
|
|
635
|
-
{ satoshis: 1000, outputId: 15607 },
|
|
636
|
-
{ satoshis: 1000, outputId: 15608 },
|
|
637
|
-
{ satoshis: 1000, outputId: 15609 },
|
|
638
|
-
{ satoshis: 1004, outputId: 15610 },
|
|
639
|
-
{ satoshis: 1000, outputId: 15611 },
|
|
640
|
-
{ satoshis: 1001, outputId: 15614 },
|
|
641
|
-
{ satoshis: 1000, outputId: 15615 },
|
|
642
|
-
{ satoshis: 1000, outputId: 15616 },
|
|
643
|
-
{ satoshis: 1000, outputId: 15617 },
|
|
644
|
-
{ satoshis: 1000, outputId: 15618 },
|
|
645
|
-
{ satoshis: 1000, outputId: 15619 },
|
|
646
|
-
{ satoshis: 1006, outputId: 15620 },
|
|
647
|
-
{ satoshis: 1000, outputId: 15621 },
|
|
648
|
-
{ satoshis: 1000, outputId: 15622 },
|
|
649
|
-
{ satoshis: 1000, outputId: 15623 },
|
|
650
|
-
{ satoshis: 1000, outputId: 15624 },
|
|
651
|
-
{ satoshis: 4571, outputId: 15626 },
|
|
652
|
-
{ satoshis: 1000, outputId: 15628 },
|
|
653
|
-
{ satoshis: 1000, outputId: 15629 },
|
|
654
|
-
{ satoshis: 1000, outputId: 15631 },
|
|
655
|
-
{ satoshis: 1000, outputId: 15632 },
|
|
656
|
-
{ satoshis: 1001, outputId: 15633 },
|
|
657
|
-
{ satoshis: 1001, outputId: 15634 },
|
|
658
|
-
{ satoshis: 1000, outputId: 15635 },
|
|
659
|
-
{ satoshis: 1000, outputId: 15637 },
|
|
660
|
-
{ satoshis: 1001, outputId: 15638 },
|
|
661
|
-
{ satoshis: 1000, outputId: 15639 },
|
|
662
|
-
{ satoshis: 1000, outputId: 15640 },
|
|
663
|
-
{ satoshis: 1000, outputId: 15641 },
|
|
664
|
-
{ satoshis: 1000, outputId: 15642 },
|
|
665
|
-
{ satoshis: 1000, outputId: 15643 },
|
|
666
|
-
{ satoshis: 1000, outputId: 15645 },
|
|
667
|
-
{ satoshis: 1000, outputId: 15646 },
|
|
668
|
-
{ satoshis: 1000, outputId: 15647 },
|
|
669
|
-
{ satoshis: 1000, outputId: 15648 },
|
|
670
|
-
{ satoshis: 1001, outputId: 15649 },
|
|
671
|
-
{ satoshis: 1000, outputId: 15650 },
|
|
672
|
-
{ satoshis: 604, outputId: 16421 },
|
|
673
|
-
{ satoshis: 958, outputId: 16429 },
|
|
674
|
-
{ satoshis: 724, outputId: 16431 },
|
|
675
|
-
{ satoshis: 413, outputId: 16433 },
|
|
676
|
-
{ satoshis: 915, outputId: 16439 },
|
|
677
|
-
{ satoshis: 842, outputId: 16441 },
|
|
678
|
-
{ satoshis: 348, outputId: 16451 },
|
|
679
|
-
{ satoshis: 339, outputId: 16453 },
|
|
680
|
-
{ satoshis: 334, outputId: 16455 },
|
|
681
|
-
{ satoshis: 331, outputId: 16457 },
|
|
682
|
-
{ satoshis: 330, outputId: 16459 },
|
|
683
|
-
{ satoshis: 327, outputId: 16461 },
|
|
684
|
-
{ satoshis: 323, outputId: 16463 },
|
|
685
|
-
{ satoshis: 311, outputId: 16465 }
|
|
686
|
-
]
|
|
687
|
-
};
|
|
688
|
-
const d10 = {
|
|
689
|
-
p: {
|
|
690
|
-
fixedInputs: [],
|
|
691
|
-
fixedOutputs: [
|
|
692
|
-
{ satoshis: 1, lockingScriptLength: 25 },
|
|
693
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
694
|
-
],
|
|
695
|
-
feeModel: { model: 'sat/kb', value: 110 },
|
|
696
|
-
changeInitialSatoshis: 1000,
|
|
697
|
-
changeFirstSatoshis: 285,
|
|
698
|
-
changeLockingScriptLength: 25,
|
|
699
|
-
changeUnlockingScriptLength: 107
|
|
700
|
-
},
|
|
701
|
-
availableChange: [
|
|
702
|
-
{ satoshis: 268076, outputId: 16671 },
|
|
703
|
-
{ satoshis: 2999799, outputId: 16677 },
|
|
704
|
-
{ satoshis: 14030, outputId: 21194 },
|
|
705
|
-
{ satoshis: 100925, outputId: 21224 }
|
|
706
|
-
]
|
|
707
|
-
};
|
|
708
|
-
const d11 = {
|
|
709
|
-
p: {
|
|
710
|
-
fixedInputs: [],
|
|
711
|
-
fixedOutputs: [
|
|
712
|
-
{ satoshis: 1, lockingScriptLength: 25 },
|
|
713
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
714
|
-
],
|
|
715
|
-
feeModel: { model: 'sat/kb', value: 110 },
|
|
716
|
-
changeInitialSatoshis: 1000,
|
|
717
|
-
changeFirstSatoshis: 285,
|
|
718
|
-
changeLockingScriptLength: 25,
|
|
719
|
-
changeUnlockingScriptLength: 107
|
|
720
|
-
},
|
|
721
|
-
availableChange: [
|
|
722
|
-
{ satoshis: 268076, outputId: 16671 },
|
|
723
|
-
{ satoshis: 2999799, outputId: 16677 },
|
|
724
|
-
{ satoshis: 1396, outputId: 21307 },
|
|
725
|
-
{ satoshis: 1023, outputId: 21308 },
|
|
726
|
-
{ satoshis: 1000, outputId: 21309 },
|
|
727
|
-
{ satoshis: 1000, outputId: 21310 },
|
|
728
|
-
{ satoshis: 1000, outputId: 21311 },
|
|
729
|
-
{ satoshis: 1220, outputId: 21312 },
|
|
730
|
-
{ satoshis: 5573, outputId: 21313 },
|
|
731
|
-
{ satoshis: 1000, outputId: 21314 },
|
|
732
|
-
{ satoshis: 1000, outputId: 21315 },
|
|
733
|
-
{ satoshis: 5926, outputId: 21316 },
|
|
734
|
-
{ satoshis: 30814, outputId: 21317 },
|
|
735
|
-
{ satoshis: 24441, outputId: 21318 },
|
|
736
|
-
{ satoshis: 285, outputId: 21319 },
|
|
737
|
-
{ satoshis: 1325, outputId: 21320 },
|
|
738
|
-
{ satoshis: 1000, outputId: 21321 },
|
|
739
|
-
{ satoshis: 1002, outputId: 21322 },
|
|
740
|
-
{ satoshis: 1000, outputId: 21324 },
|
|
741
|
-
{ satoshis: 1057, outputId: 21325 },
|
|
742
|
-
{ satoshis: 1000, outputId: 21326 },
|
|
743
|
-
{ satoshis: 1159, outputId: 21327 },
|
|
744
|
-
{ satoshis: 1061, outputId: 21328 },
|
|
745
|
-
{ satoshis: 1000, outputId: 21329 },
|
|
746
|
-
{ satoshis: 1000, outputId: 21330 },
|
|
747
|
-
{ satoshis: 1000, outputId: 21331 },
|
|
748
|
-
{ satoshis: 8873, outputId: 21332 },
|
|
749
|
-
{ satoshis: 1001, outputId: 21333 },
|
|
750
|
-
{ satoshis: 1011, outputId: 21334 },
|
|
751
|
-
{ satoshis: 1000, outputId: 21335 },
|
|
752
|
-
{ satoshis: 13699, outputId: 21336 }
|
|
753
|
-
]
|
|
754
|
-
};
|
|
755
|
-
const d12 = {
|
|
756
|
-
p: {
|
|
757
|
-
fixedInputs: [],
|
|
758
|
-
fixedOutputs: [
|
|
759
|
-
{ satoshis: 1, lockingScriptLength: 25 },
|
|
760
|
-
{ satoshis: 200, lockingScriptLength: 25 }
|
|
761
|
-
],
|
|
762
|
-
feeModel: { model: 'sat/kb', value: 110 },
|
|
763
|
-
changeInitialSatoshis: 1000,
|
|
764
|
-
changeFirstSatoshis: 285,
|
|
765
|
-
changeLockingScriptLength: 25,
|
|
766
|
-
changeUnlockingScriptLength: 107
|
|
767
|
-
},
|
|
768
|
-
availableChange: [
|
|
769
|
-
{ satoshis: 268076, outputId: 16671 },
|
|
770
|
-
{ satoshis: 2999799, outputId: 16677 },
|
|
771
|
-
{ satoshis: 14030, outputId: 21194 },
|
|
772
|
-
{ satoshis: 100925, outputId: 21224 }
|
|
773
|
-
]
|
|
774
|
-
};
|
|
775
|
-
const d13 = {
|
|
776
|
-
p: {
|
|
777
|
-
fixedInputs: [],
|
|
778
|
-
fixedOutputs: [
|
|
779
|
-
{ satoshis: 500, lockingScriptLength: 194 },
|
|
780
|
-
{ satoshis: 2, lockingScriptLength: 25 }
|
|
781
|
-
],
|
|
782
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
783
|
-
changeInitialSatoshis: 1000,
|
|
784
|
-
changeFirstSatoshis: 285,
|
|
785
|
-
changeLockingScriptLength: 25,
|
|
786
|
-
changeUnlockingScriptLength: 107
|
|
787
|
-
},
|
|
788
|
-
availableChange: [
|
|
789
|
-
{ satoshis: 285, outputId: 16190 },
|
|
790
|
-
{ satoshis: 1012, outputId: 18487 },
|
|
791
|
-
{ satoshis: 1013, outputId: 18488 },
|
|
792
|
-
{ satoshis: 1000, outputId: 18489 },
|
|
793
|
-
{ satoshis: 1087, outputId: 18490 },
|
|
794
|
-
{ satoshis: 290, outputId: 18491 },
|
|
795
|
-
{ satoshis: 1034, outputId: 18492 }
|
|
796
|
-
]
|
|
797
|
-
};
|
|
798
|
-
const d14 = {
|
|
799
|
-
p: {
|
|
800
|
-
fixedInputs: [],
|
|
801
|
-
fixedOutputs: [{ satoshis: 3, lockingScriptLength: 141 }],
|
|
802
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
803
|
-
changeInitialSatoshis: 1000,
|
|
804
|
-
changeFirstSatoshis: 285,
|
|
805
|
-
changeLockingScriptLength: 25,
|
|
806
|
-
changeUnlockingScriptLength: 107,
|
|
807
|
-
targetNetCount: 22
|
|
808
|
-
},
|
|
809
|
-
availableChange: [
|
|
810
|
-
{ satoshis: 995, outputId: 16190 },
|
|
811
|
-
{ satoshis: 1000, outputId: 18487 },
|
|
812
|
-
{ satoshis: 1000, outputId: 18488 },
|
|
813
|
-
{ satoshis: 1000, outputId: 18489 },
|
|
814
|
-
{ satoshis: 1000, outputId: 18490 },
|
|
815
|
-
{ satoshis: 1000, outputId: 18491 },
|
|
816
|
-
{ satoshis: 1000, outputId: 18492 },
|
|
817
|
-
{ satoshis: 1000, outputId: 18493 },
|
|
818
|
-
{ satoshis: 1000, outputId: 18494 },
|
|
819
|
-
{ satoshis: 1000, outputId: 18495 },
|
|
820
|
-
{ satoshis: 100, outputId: 18496 }
|
|
821
|
-
]
|
|
822
|
-
};
|
|
823
|
-
const test8Cases = [
|
|
824
|
-
{
|
|
825
|
-
n: 14,
|
|
826
|
-
d: d14,
|
|
827
|
-
// targetNetCount=22 is capped to maxChangeOutputsPerTransaction=8; algorithm now
|
|
828
|
-
// allocates 8 inputs and creates 8 change outputs rather than starvation-reducing
|
|
829
|
-
// to 1 input / 1 output.
|
|
830
|
-
er: '{"allocatedChangeInputs":[{"satoshis":1000,"outputId":18495,"spendable":false},{"satoshis":1000,"outputId":18494,"spendable":false},{"satoshis":1000,"outputId":18493,"spendable":false},{"satoshis":1000,"outputId":18492,"spendable":false},{"satoshis":1000,"outputId":18491,"spendable":false},{"satoshis":1000,"outputId":18490,"spendable":false},{"satoshis":1000,"outputId":18489,"spendable":false},{"satoshis":995,"outputId":16190,"spendable":false}],"changeOutputs":[{"satoshis":988,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25}],"size":1616,"fee":4,"satsPerKb":2}'
|
|
831
|
-
},
|
|
832
|
-
{
|
|
833
|
-
n: 13,
|
|
834
|
-
d: d13,
|
|
835
|
-
er: '{"allocatedChangeInputs":[{"satoshis":1000,"outputId":18489,"spendable":false}],"changeOutputs":[{"satoshis":497,"lockingScriptLength":25}],"size":429,"fee":1,"satsPerKb":2}'
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
n: 12,
|
|
839
|
-
d: d12,
|
|
840
|
-
er: '{"allocatedChangeInputs":[{"satoshis":14030,"outputId":21194,"spendable":false}],"changeOutputs":[{"satoshis":13800,"lockingScriptLength":25}],"size":260,"fee":29,"satsPerKb":110}'
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
n: 11,
|
|
844
|
-
d: d11,
|
|
845
|
-
er: '{"allocatedChangeInputs":[{"satoshis":285,"outputId":21319,"spendable":false},{"satoshis":1000,"outputId":21309,"spendable":false}],"changeOutputs":[{"satoshis":1039,"lockingScriptLength":25}],"size":408,"fee":45,"satsPerKb":110}'
|
|
846
|
-
},
|
|
847
|
-
{
|
|
848
|
-
n: 10,
|
|
849
|
-
d: d10,
|
|
850
|
-
er: '{"allocatedChangeInputs":[{"satoshis":14030,"outputId":21194,"spendable":false}],"changeOutputs":[{"satoshis":13800,"lockingScriptLength":25}],"size":260,"fee":29,"satsPerKb":110}'
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
n: 9,
|
|
854
|
-
d: d9,
|
|
855
|
-
er: '{"allocatedChangeInputs":[{"satoshis":4571,"outputId":15626,"spendable":false}],"changeOutputs":[{"satoshis":3368,"lockingScriptLength":25}],"size":1373,"fee":3,"satsPerKb":2}'
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
n: 8,
|
|
859
|
-
d: d8,
|
|
860
|
-
er: '{"allocatedChangeInputs":[{"satoshis":1817,"outputId":15658,"spendable":false}],"changeOutputs":[{"satoshis":52,"lockingScriptLength":25}],"size":260,"fee":1,"satsPerKb":2}'
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
n: 7,
|
|
864
|
-
d: d7,
|
|
865
|
-
er: '{"allocatedChangeInputs":[{"satoshis":1817,"outputId":15658,"spendable":false}],"changeOutputs":[{"satoshis":46,"lockingScriptLength":25}],"size":260,"fee":1,"satsPerKb":2}'
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
n: 6,
|
|
869
|
-
d: d6,
|
|
870
|
-
er: '{"allocatedChangeInputs":[{"satoshis":1000,"outputId":16346,"spendable":false}],"changeOutputs":[{"satoshis":298,"lockingScriptLength":25}],"size":673,"fee":2,"satsPerKb":2}'
|
|
871
|
-
},
|
|
872
|
-
{
|
|
873
|
-
n: 5,
|
|
874
|
-
d: d5,
|
|
875
|
-
er: '{"allocatedChangeInputs":[],"changeOutputs":[{"satoshis":799,"lockingScriptLength":25}],"size":191,"fee":1,"satsPerKb":2}'
|
|
876
|
-
}
|
|
877
|
-
];
|
|
878
|
-
test('8 paramsText d5 d6 d7 d8 d9 d10 d11 d12 d13 d14', async () => {
|
|
879
|
-
for (const { n, d, er } of test8Cases) {
|
|
880
|
-
const params = { ...d.p };
|
|
881
|
-
const availableChange = [...d.availableChange];
|
|
882
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
883
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
884
|
-
expect(JSON.stringify(r)).toBe(er);
|
|
885
|
-
expectTransactionSize(params, r);
|
|
886
|
-
}
|
|
887
|
-
});
|
|
888
|
-
// ── New tests for maxChangeOutputs cap and dust floor ───────────────────
|
|
889
|
-
test('9 maxChangeOutputs cap: large targetNetCount limited to maxChangeOutputsPerTransaction', async () => {
|
|
890
|
-
// targetNetCount of 50 should be capped to maxChangeOutputsPerTransaction (8)
|
|
891
|
-
const params = {
|
|
892
|
-
...defParams,
|
|
893
|
-
fixedInputs: [],
|
|
894
|
-
fixedOutputs: [],
|
|
895
|
-
targetNetCount: 50
|
|
896
|
-
};
|
|
897
|
-
// Provide plenty of funding (one large UTXO simulating a fresh import)
|
|
898
|
-
const availableChange = [
|
|
899
|
-
{ satoshis: 100000000, outputId: 1 } // 1 BSV
|
|
900
|
-
];
|
|
901
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
902
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
903
|
-
// Must not exceed the cap regardless of how large targetNetCount is
|
|
904
|
-
expect(r.changeOutputs.length).toBeLessThanOrEqual(generateChange_1.maxChangeOutputsPerTransaction);
|
|
905
|
-
// Should be exactly the cap since we have plenty of funds
|
|
906
|
-
expect(r.changeOutputs.length).toBe(generateChange_1.maxChangeOutputsPerTransaction);
|
|
907
|
-
// Sanity: transaction must balance
|
|
908
|
-
expectTransactionSize(params, r);
|
|
909
|
-
});
|
|
910
|
-
test('9a maxChangeOutputs cap: custom override via params', async () => {
|
|
911
|
-
// Caller can raise or lower the cap via the maxChangeOutputs param
|
|
912
|
-
const params = {
|
|
913
|
-
...defParams,
|
|
914
|
-
fixedInputs: [],
|
|
915
|
-
fixedOutputs: [],
|
|
916
|
-
targetNetCount: 50,
|
|
917
|
-
maxChangeOutputs: 3 // override to a smaller value
|
|
918
|
-
};
|
|
919
|
-
const availableChange = [{ satoshis: 100000000, outputId: 1 }];
|
|
920
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
921
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
922
|
-
expect(r.changeOutputs.length).toBeLessThanOrEqual(3);
|
|
923
|
-
expectTransactionSize(params, r);
|
|
924
|
-
});
|
|
925
|
-
test('9b maxChangeOutputs cap: gradual pool build-up over multiple transactions', async () => {
|
|
926
|
-
// Simulates a user importing one large UTXO and making sequential actions.
|
|
927
|
-
// Each action should add at most maxChangeOutputsPerTransaction net new outputs.
|
|
928
|
-
// After N rounds, the UTXO pool should equal N * maxChangeOutputsPerTransaction.
|
|
929
|
-
let nextId = 1;
|
|
930
|
-
// Start with a single large imported UTXO
|
|
931
|
-
let utxoPool = [{ satoshis: 100000000, outputId: nextId++ }];
|
|
932
|
-
const rounds = 3;
|
|
933
|
-
for (let round = 0; round < rounds; round++) {
|
|
934
|
-
const currentCount = utxoPool.length - 1; // one will be consumed as input
|
|
935
|
-
const params = {
|
|
936
|
-
...defParams,
|
|
937
|
-
fixedInputs: [],
|
|
938
|
-
fixedOutputs: [{ satoshis: 1000, lockingScriptLength: 25 }],
|
|
939
|
-
targetNetCount: 144 - currentCount, // always trying to reach 144
|
|
940
|
-
randomVals: undefined // use real random for this test
|
|
941
|
-
};
|
|
942
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)([...utxoPool]);
|
|
943
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
944
|
-
// Net new outputs per transaction must respect the cap
|
|
945
|
-
const netNew = r.changeOutputs.length - r.allocatedChangeInputs.length;
|
|
946
|
-
expect(netNew).toBeLessThanOrEqual(generateChange_1.maxChangeOutputsPerTransaction);
|
|
947
|
-
expectTransactionSize(params, r);
|
|
948
|
-
// Simulate the transaction confirming: remove spent inputs, add new outputs
|
|
949
|
-
const spentIds = new Set(r.allocatedChangeInputs.map(i => i.outputId));
|
|
950
|
-
utxoPool = utxoPool.filter(u => !spentIds.has(u.outputId));
|
|
951
|
-
// Add new change outputs to the pool (with fresh unique outputIds)
|
|
952
|
-
for (const o of r.changeOutputs) {
|
|
953
|
-
utxoPool.push({ satoshis: o.satoshis, outputId: nextId++ });
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
// After `rounds` transactions, we should have grown by at most
|
|
957
|
-
// rounds * maxChangeOutputsPerTransaction UTXOs net of the spent ones.
|
|
958
|
-
// (The initial large UTXO is consumed in round 0.)
|
|
959
|
-
expect(utxoPool.length).toBeLessThanOrEqual(rounds * generateChange_1.maxChangeOutputsPerTransaction);
|
|
960
|
-
});
|
|
961
|
-
test('10 dust floor: no change output below economically viable minimum', async () => {
|
|
962
|
-
// At 110 sat/kb the dust floor is:
|
|
963
|
-
// minSpendTxSize = transactionSize([107], [25]) = 4 + 1 + 148 + 1 + 34 + 4 = 192 bytes
|
|
964
|
-
// dustFloor = max(1, ceil(192/1000 * 110) * 2) = max(1, ceil(21.12) * 2) = 44 sats
|
|
965
|
-
const params = {
|
|
966
|
-
...defParams,
|
|
967
|
-
fixedInputs: [],
|
|
968
|
-
fixedOutputs: [{ satoshis: 1, lockingScriptLength: 25 }],
|
|
969
|
-
feeModel: { model: 'sat/kb', value: 110 },
|
|
970
|
-
changeInitialSatoshis: 1000,
|
|
971
|
-
changeFirstSatoshis: 285,
|
|
972
|
-
targetNetCount: 4
|
|
973
|
-
};
|
|
974
|
-
const availableChange = [
|
|
975
|
-
{ satoshis: 268076, outputId: 16671 },
|
|
976
|
-
{ satoshis: 2999799, outputId: 16677 },
|
|
977
|
-
{ satoshis: 14030, outputId: 21194 },
|
|
978
|
-
{ satoshis: 100925, outputId: 21224 }
|
|
979
|
-
];
|
|
980
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
981
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
982
|
-
// Every change output must be at or above the dust floor for 110 sat/kb
|
|
983
|
-
const expectedDustFloor = Math.max(1, Math.ceil((192 / 1000) * 110) * 2);
|
|
984
|
-
for (const o of r.changeOutputs) {
|
|
985
|
-
expect(o.satoshis).toBeGreaterThanOrEqual(expectedDustFloor);
|
|
986
|
-
}
|
|
987
|
-
expectTransactionSize(params, r);
|
|
988
|
-
});
|
|
989
|
-
test('10a dust floor: changeFirstSatoshis below floor is raised to floor', async () => {
|
|
990
|
-
// At 500 sat/kb:
|
|
991
|
-
// dustFloor = max(1, ceil(192/1000 * 500) * 2) = max(1, ceil(96) * 2) = 192 sats
|
|
992
|
-
// changeFirstSatoshis=10 and changeInitialSatoshis=30 are both below the floor.
|
|
993
|
-
const params = {
|
|
994
|
-
...defParams,
|
|
995
|
-
fixedInputs: [],
|
|
996
|
-
fixedOutputs: [{ satoshis: 100, lockingScriptLength: 25 }],
|
|
997
|
-
feeModel: { model: 'sat/kb', value: 500 },
|
|
998
|
-
changeInitialSatoshis: 30, // below dust floor at this fee rate
|
|
999
|
-
changeFirstSatoshis: 10, // below dust floor at this fee rate
|
|
1000
|
-
targetNetCount: 3,
|
|
1001
|
-
randomVals: undefined
|
|
1002
|
-
};
|
|
1003
|
-
const availableChange = [{ satoshis: 100000, outputId: 1 }];
|
|
1004
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
1005
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
1006
|
-
const expectedDustFloor = Math.max(1, Math.ceil((192 / 1000) * 500) * 2);
|
|
1007
|
-
for (const o of r.changeOutputs) {
|
|
1008
|
-
expect(o.satoshis).toBeGreaterThanOrEqual(expectedDustFloor);
|
|
1009
|
-
}
|
|
1010
|
-
expectTransactionSize(params, r);
|
|
1011
|
-
});
|
|
1012
|
-
test('10b dust floor: excess distribution sweep removes sub-floor outputs', async () => {
|
|
1013
|
-
// Use a very low fee rate so a single change input is enough to fund the
|
|
1014
|
-
// transaction, then use a high fee rate to make the changeFirstSatoshis
|
|
1015
|
-
// dangerously small. We want the sweep-after-distribution to kick in.
|
|
1016
|
-
// At 200 sat/kb: dustFloor = max(1, ceil(192/1000 * 200) * 2) = max(1, ceil(38.4)*2) = 78 sats.
|
|
1017
|
-
// With changeFirstSatoshis=50 (< 78) the first change output will be raised to 78.
|
|
1018
|
-
const params = {
|
|
1019
|
-
...defParams,
|
|
1020
|
-
fixedInputs: [],
|
|
1021
|
-
fixedOutputs: [{ satoshis: 500, lockingScriptLength: 25 }],
|
|
1022
|
-
feeModel: { model: 'sat/kb', value: 200 },
|
|
1023
|
-
changeInitialSatoshis: 1000,
|
|
1024
|
-
changeFirstSatoshis: 50, // below dust floor for 200 sat/kb
|
|
1025
|
-
targetNetCount: 2,
|
|
1026
|
-
randomVals: undefined
|
|
1027
|
-
};
|
|
1028
|
-
const availableChange = [{ satoshis: 50000, outputId: 1 }];
|
|
1029
|
-
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
1030
|
-
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
1031
|
-
const expectedDustFloor = Math.max(1, Math.ceil((192 / 1000) * 200) * 2);
|
|
1032
|
-
for (const o of r.changeOutputs) {
|
|
1033
|
-
expect(o.satoshis).toBeGreaterThanOrEqual(expectedDustFloor);
|
|
1034
|
-
}
|
|
1035
|
-
expectTransactionSize(params, r);
|
|
1036
|
-
});
|
|
1037
|
-
});
|
|
1038
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1039
|
-
async function expectToThrowWERR(expectedClass, fn) {
|
|
1040
|
-
try {
|
|
1041
|
-
await fn();
|
|
1042
|
-
}
|
|
1043
|
-
catch (eu) {
|
|
1044
|
-
const e = index_client_1.sdk.WalletError.fromUnknown(eu);
|
|
1045
|
-
expect(e.name).toBe(expectedClass.name);
|
|
1046
|
-
expect(e.isError).toBe(true);
|
|
1047
|
-
return;
|
|
1048
|
-
}
|
|
1049
|
-
throw new Error(`${expectedClass.name} was not thrown`);
|
|
1050
|
-
}
|
|
1051
|
-
function makeTransaction(params, results) {
|
|
1052
|
-
const tx = new sdk_1.Transaction();
|
|
1053
|
-
for (const i of params.fixedInputs) {
|
|
1054
|
-
tx.inputs.push({
|
|
1055
|
-
unlockingScript: sdk_1.Script.fromBinary(Array(i.unlockingScriptLength).fill(0)),
|
|
1056
|
-
sourceOutputIndex: 0,
|
|
1057
|
-
sourceTXID: '00'.repeat(32)
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
for (const i of results.allocatedChangeInputs) {
|
|
1061
|
-
tx.inputs.push({
|
|
1062
|
-
unlockingScript: sdk_1.Script.fromBinary(Array(params.changeUnlockingScriptLength).fill(0)),
|
|
1063
|
-
sourceOutputIndex: 0,
|
|
1064
|
-
sourceTXID: '00'.repeat(32)
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
for (const o of params.fixedOutputs) {
|
|
1068
|
-
tx.outputs.push({
|
|
1069
|
-
lockingScript: sdk_1.Script.fromBinary(Array(o.lockingScriptLength).fill(0)),
|
|
1070
|
-
satoshis: o.satoshis
|
|
1071
|
-
});
|
|
1072
|
-
}
|
|
1073
|
-
for (const o of results.changeOutputs) {
|
|
1074
|
-
tx.outputs.push({
|
|
1075
|
-
lockingScript: sdk_1.Script.fromBinary(Array(o.lockingScriptLength).fill(0)),
|
|
1076
|
-
satoshis: o.satoshis
|
|
1077
|
-
});
|
|
1078
|
-
}
|
|
1079
|
-
return tx;
|
|
1080
|
-
}
|
|
1081
|
-
function expectTransactionSize(params, results) {
|
|
1082
|
-
const tx = makeTransaction(params, results);
|
|
1083
|
-
const size = tx.toBinary().length;
|
|
1084
|
-
if (size !== results.size)
|
|
1085
|
-
throw new index_client_1.sdk.WERR_INTERNAL(`expectTransaction actual ${size} expected ${results.size}`);
|
|
1086
|
-
}
|
|
1087
|
-
const defParams = {
|
|
1088
|
-
fixedInputs: [],
|
|
1089
|
-
fixedOutputs: [],
|
|
1090
|
-
feeModel: { model: 'sat/kb', value: 2 },
|
|
1091
|
-
changeInitialSatoshis: 1000,
|
|
1092
|
-
changeFirstSatoshis: 285,
|
|
1093
|
-
changeLockingScriptLength: 25,
|
|
1094
|
-
changeUnlockingScriptLength: 107,
|
|
1095
|
-
randomVals: [...randomValsUsed1_1.randomValsUsed1]
|
|
1096
|
-
};
|
|
1097
|
-
const _defAvailableChange = [
|
|
1098
|
-
{ satoshis: 6323, outputId: 15005 },
|
|
1099
|
-
{ satoshis: 1004, outputId: 15011 },
|
|
1100
|
-
{ satoshis: 1000, outputId: 15013 },
|
|
1101
|
-
{ satoshis: 1000, outputId: 15017 },
|
|
1102
|
-
{ satoshis: 1000, outputId: 15023 },
|
|
1103
|
-
{ satoshis: 1000, outputId: 15027 },
|
|
1104
|
-
{ satoshis: 1000, outputId: 15034 },
|
|
1105
|
-
{ satoshis: 1575097, outputId: 15101 },
|
|
1106
|
-
{ satoshis: 16417, outputId: 15103 },
|
|
1107
|
-
{ satoshis: 3377, outputId: 15104 },
|
|
1108
|
-
{ satoshis: 10735, outputId: 15106 }
|
|
1109
|
-
];
|
|
1110
|
-
const defAvailableChange = () => JSON.parse(JSON.stringify(_defAvailableChange));
|
|
1111
|
-
//# sourceMappingURL=generateChangeSdk.test.js.map
|