@bsv/wallet-toolbox 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.template +22 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
- package/.github/ISSUE_TEMPLATE/discussion.md +24 -0
- package/.github/pull_request_template.md +24 -0
- package/.github/workflows/push.yaml +66 -0
- package/.prettierrc +10 -0
- package/CONTRIBUTING.md +89 -0
- package/LICENSE.txt +28 -0
- package/README.md +124 -0
- package/dev.sqlite3 +0 -0
- package/docs/README.md +15 -0
- package/docs/client.md +6812 -0
- package/docs/monitor.md +648 -0
- package/docs/services.md +496 -0
- package/docs/storage.md +1884 -0
- package/docs/wallet.md +6812 -0
- package/jest.config.ts +29 -0
- package/knexfile.js +9 -0
- package/license.md +1 -0
- package/out/src/Wallet.d.ts +83 -0
- package/out/src/Wallet.d.ts.map +1 -0
- package/out/src/Wallet.js +415 -0
- package/out/src/Wallet.js.map +1 -0
- package/out/src/index.all.d.ts +9 -0
- package/out/src/index.all.d.ts.map +1 -0
- package/out/src/index.all.js +48 -0
- package/out/src/index.all.js.map +1 -0
- package/out/src/index.client.d.ts +8 -0
- package/out/src/index.client.d.ts.map +1 -0
- package/out/src/index.client.js +47 -0
- package/out/src/index.client.js.map +1 -0
- package/out/src/index.d.ts +3 -0
- package/out/src/index.d.ts.map +1 -0
- package/out/src/index.js +42 -0
- package/out/src/index.js.map +1 -0
- package/out/src/monitor/Monitor.d.ts +89 -0
- package/out/src/monitor/Monitor.d.ts.map +1 -0
- package/out/src/monitor/Monitor.js +253 -0
- package/out/src/monitor/Monitor.js.map +1 -0
- package/out/src/monitor/MonitorDaemon.d.ts +30 -0
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -0
- package/out/src/monitor/MonitorDaemon.js +135 -0
- package/out/src/monitor/MonitorDaemon.js.map +1 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.d.ts +2 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.d.ts.map +1 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.js +50 -0
- package/out/src/monitor/__test/MonitorDaemon.man.test.js.map +1 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +53 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.js +197 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -0
- package/out/src/monitor/tasks/TaskClock.d.ts +14 -0
- package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskClock.js +27 -0
- package/out/src/monitor/tasks/TaskClock.js.map +1 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts +20 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.js +52 -0
- package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -0
- package/out/src/monitor/tasks/TaskNewHeader.d.ts +15 -0
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskNewHeader.js +45 -0
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -0
- package/out/src/monitor/tasks/TaskPurge.d.ts +45 -0
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskPurge.js +35 -0
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -0
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts +26 -0
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskReviewStatus.js +44 -0
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -0
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts +32 -0
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskSendWaiting.js +99 -0
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +12 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js +22 -0
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -0
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts +40 -0
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -0
- package/out/src/monitor/tasks/WalletMonitorTask.js +37 -0
- package/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -0
- package/out/src/sdk/CertOps.d.ts +66 -0
- package/out/src/sdk/CertOps.d.ts.map +1 -0
- package/out/src/sdk/CertOps.js +198 -0
- package/out/src/sdk/CertOps.js.map +1 -0
- package/out/src/sdk/PrivilegedKeyManager.d.ts +125 -0
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -0
- package/out/src/sdk/PrivilegedKeyManager.js +293 -0
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -0
- package/out/src/sdk/StorageSyncReader.d.ts +121 -0
- package/out/src/sdk/StorageSyncReader.d.ts.map +1 -0
- package/out/src/sdk/StorageSyncReader.js +3 -0
- package/out/src/sdk/StorageSyncReader.js.map +1 -0
- package/out/src/sdk/StorageSyncReaderWriter.d.ts +89 -0
- package/out/src/sdk/StorageSyncReaderWriter.d.ts.map +1 -0
- package/out/src/sdk/StorageSyncReaderWriter.js +3 -0
- package/out/src/sdk/StorageSyncReaderWriter.js.map +1 -0
- package/out/src/sdk/WERR_errors.d.ts +90 -0
- package/out/src/sdk/WERR_errors.d.ts.map +1 -0
- package/out/src/sdk/WERR_errors.js +128 -0
- package/out/src/sdk/WERR_errors.js.map +1 -0
- package/out/src/sdk/WalletError.d.ts +45 -0
- package/out/src/sdk/WalletError.d.ts.map +1 -0
- package/out/src/sdk/WalletError.js +122 -0
- package/out/src/sdk/WalletError.js.map +1 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts +325 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletServices.interfaces.js +3 -0
- package/out/src/sdk/WalletServices.interfaces.js.map +1 -0
- package/out/src/sdk/WalletSigner.interfaces.d.ts +10 -0
- package/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletSigner.interfaces.js +3 -0
- package/out/src/sdk/WalletSigner.interfaces.js.map +1 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts +299 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -0
- package/out/src/sdk/WalletStorage.interfaces.js +3 -0
- package/out/src/sdk/WalletStorage.interfaces.js.map +1 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.d.ts +2 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.d.ts.map +1 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.js +125 -0
- package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +1 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.d.ts +2 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.d.ts.map +1 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js +660 -0
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js.map +1 -0
- package/out/src/sdk/index.d.ts +12 -0
- package/out/src/sdk/index.d.ts.map +1 -0
- package/out/src/sdk/index.js +28 -0
- package/out/src/sdk/index.js.map +1 -0
- package/out/src/sdk/types.d.ts +74 -0
- package/out/src/sdk/types.d.ts.map +1 -0
- package/out/src/sdk/types.js +20 -0
- package/out/src/sdk/types.js.map +1 -0
- package/out/src/sdk/validationHelpers.d.ts +288 -0
- package/out/src/sdk/validationHelpers.d.ts.map +1 -0
- package/out/src/sdk/validationHelpers.js +630 -0
- package/out/src/sdk/validationHelpers.js.map +1 -0
- package/out/src/services/ServiceCollection.d.ts +25 -0
- package/out/src/services/ServiceCollection.d.ts.map +1 -0
- package/out/src/services/ServiceCollection.js +43 -0
- package/out/src/services/ServiceCollection.js.map +1 -0
- package/out/src/services/Services.d.ts +60 -0
- package/out/src/services/Services.d.ts.map +1 -0
- package/out/src/services/Services.js +342 -0
- package/out/src/services/Services.js.map +1 -0
- package/out/src/services/__tests/getMerklePath.test.d.ts +2 -0
- package/out/src/services/__tests/getMerklePath.test.d.ts.map +1 -0
- package/out/src/services/__tests/getMerklePath.test.js +16 -0
- package/out/src/services/__tests/getMerklePath.test.js.map +1 -0
- package/out/src/services/__tests/getRawTx.test.d.ts +2 -0
- package/out/src/services/__tests/getRawTx.test.d.ts.map +1 -0
- package/out/src/services/__tests/getRawTx.test.js +13 -0
- package/out/src/services/__tests/getRawTx.test.js.map +1 -0
- package/out/src/services/__tests/postBeef.test.d.ts +2 -0
- package/out/src/services/__tests/postBeef.test.d.ts.map +1 -0
- package/out/src/services/__tests/postBeef.test.js +18 -0
- package/out/src/services/__tests/postBeef.test.js.map +1 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.d.ts +2 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.d.ts.map +1 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.js +479 -0
- package/out/src/services/__tests/postBeefToArcTaal.test.js.map +1 -0
- package/out/src/services/__tests/postTxs.test.d.ts +2 -0
- package/out/src/services/__tests/postTxs.test.d.ts.map +1 -0
- package/out/src/services/__tests/postTxs.test.js +19 -0
- package/out/src/services/__tests/postTxs.test.js.map +1 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +15 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.js +51 -0
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.d.ts +2 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.d.ts.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js +19 -0
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.d.ts +2 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.d.ts.map +1 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js +29 -0
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +98 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +38 -0
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +36 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +130 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/index.d.ts +3 -0
- package/out/src/services/chaintracker/chaintracks/index.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/index.js +19 -0
- package/out/src/services/chaintracker/chaintracks/index.js.map +1 -0
- package/out/src/services/chaintracker/index.d.ts +3 -0
- package/out/src/services/chaintracker/index.d.ts.map +1 -0
- package/out/src/services/chaintracker/index.js +19 -0
- package/out/src/services/chaintracker/index.js.map +1 -0
- package/out/src/services/createDefaultWalletServicesOptions.d.ts +3 -0
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -0
- package/out/src/services/createDefaultWalletServicesOptions.js +34 -0
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -0
- package/out/src/services/index.d.ts +2 -0
- package/out/src/services/index.d.ts.map +1 -0
- package/out/src/services/index.js +18 -0
- package/out/src/services/index.js.map +1 -0
- package/out/src/services/providers/arcServices.d.ts +62 -0
- package/out/src/services/providers/arcServices.d.ts.map +1 -0
- package/out/src/services/providers/arcServices.js +368 -0
- package/out/src/services/providers/arcServices.js.map +1 -0
- package/out/src/services/providers/echangeRates.d.ts +12 -0
- package/out/src/services/providers/echangeRates.d.ts.map +1 -0
- package/out/src/services/providers/echangeRates.js +237 -0
- package/out/src/services/providers/echangeRates.js.map +1 -0
- package/out/src/services/providers/whatsonchain.d.ts +17 -0
- package/out/src/services/providers/whatsonchain.d.ts.map +1 -0
- package/out/src/services/providers/whatsonchain.js +130 -0
- package/out/src/services/providers/whatsonchain.js.map +1 -0
- package/out/src/signer/WalletSigner.d.ts +11 -0
- package/out/src/signer/WalletSigner.d.ts.map +1 -0
- package/out/src/signer/WalletSigner.js +13 -0
- package/out/src/signer/WalletSigner.js.map +1 -0
- package/out/src/signer/methods/acquireDirectCertificate.d.ts +4 -0
- package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -0
- package/out/src/signer/methods/acquireDirectCertificate.js +47 -0
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -0
- package/out/src/signer/methods/createAction.d.ts +7 -0
- package/out/src/signer/methods/createAction.d.ts.map +1 -0
- package/out/src/signer/methods/createAction.js +250 -0
- package/out/src/signer/methods/createAction.js.map +1 -0
- package/out/src/signer/methods/internalizeAction.d.ts +31 -0
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -0
- package/out/src/signer/methods/internalizeAction.js +95 -0
- package/out/src/signer/methods/internalizeAction.js.map +1 -0
- package/out/src/signer/methods/proveCertificate.d.ts +4 -0
- package/out/src/signer/methods/proveCertificate.d.ts.map +1 -0
- package/out/src/signer/methods/proveCertificate.js +45 -0
- package/out/src/signer/methods/proveCertificate.js.map +1 -0
- package/out/src/signer/methods/signAction.d.ts +6 -0
- package/out/src/signer/methods/signAction.d.ts.map +1 -0
- package/out/src/signer/methods/signAction.js +79 -0
- package/out/src/signer/methods/signAction.js.map +1 -0
- package/out/src/storage/StorageKnex.d.ts +176 -0
- package/out/src/storage/StorageKnex.d.ts.map +1 -0
- package/out/src/storage/StorageKnex.js +1035 -0
- package/out/src/storage/StorageKnex.js.map +1 -0
- package/out/src/storage/StorageProvider.d.ts +140 -0
- package/out/src/storage/StorageProvider.d.ts.map +1 -0
- package/out/src/storage/StorageProvider.js +539 -0
- package/out/src/storage/StorageProvider.js.map +1 -0
- package/out/src/storage/StorageReader.d.ts +76 -0
- package/out/src/storage/StorageReader.d.ts.map +1 -0
- package/out/src/storage/StorageReader.js +124 -0
- package/out/src/storage/StorageReader.js.map +1 -0
- package/out/src/storage/StorageReaderWriter.d.ts +87 -0
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -0
- package/out/src/storage/StorageReaderWriter.js +337 -0
- package/out/src/storage/StorageReaderWriter.js.map +1 -0
- package/out/src/storage/StorageSyncReader.d.ts +33 -0
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -0
- package/out/src/storage/StorageSyncReader.js +142 -0
- package/out/src/storage/StorageSyncReader.js.map +1 -0
- package/out/src/storage/WalletStorageManager.d.ts +103 -0
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -0
- package/out/src/storage/WalletStorageManager.js +408 -0
- package/out/src/storage/WalletStorageManager.js.map +1 -0
- package/out/src/storage/__test/WalletStorageManager.test.d.ts +2 -0
- package/out/src/storage/__test/WalletStorageManager.test.d.ts.map +1 -0
- package/out/src/storage/__test/WalletStorageManager.test.js +260 -0
- package/out/src/storage/__test/WalletStorageManager.test.js.map +1 -0
- package/out/src/storage/index.all.d.ts +11 -0
- package/out/src/storage/index.all.d.ts.map +1 -0
- package/out/src/storage/index.all.js +50 -0
- package/out/src/storage/index.all.js.map +1 -0
- package/out/src/storage/index.client.d.ts +7 -0
- package/out/src/storage/index.client.d.ts.map +1 -0
- package/out/src/storage/index.client.js +46 -0
- package/out/src/storage/index.client.js.map +1 -0
- package/out/src/storage/index.db.d.ts +1 -0
- package/out/src/storage/index.db.d.ts.map +1 -0
- package/out/src/storage/index.db.js +2 -0
- package/out/src/storage/index.db.js.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.d.ts +2 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.d.ts.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js +948 -0
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.d.ts +2 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.d.ts.map +1 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js +35 -0
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js.map +1 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +27 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +148 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -0
- package/out/src/storage/methods/createAction.d.ts +23 -0
- package/out/src/storage/methods/createAction.d.ts.map +1 -0
- package/out/src/storage/methods/createAction.js +663 -0
- package/out/src/storage/methods/createAction.js.map +1 -0
- package/out/src/storage/methods/generateChange.d.ts +108 -0
- package/out/src/storage/methods/generateChange.d.ts.map +1 -0
- package/out/src/storage/methods/generateChange.js +422 -0
- package/out/src/storage/methods/generateChange.js.map +1 -0
- package/out/src/storage/methods/getBeefForTransaction.d.ts +22 -0
- package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -0
- package/out/src/storage/methods/getBeefForTransaction.js +94 -0
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -0
- package/out/src/storage/methods/getSyncChunk.d.ts +10 -0
- package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -0
- package/out/src/storage/methods/getSyncChunk.js +271 -0
- package/out/src/storage/methods/getSyncChunk.js.map +1 -0
- package/out/src/storage/methods/internalizeAction.d.ts +38 -0
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -0
- package/out/src/storage/methods/internalizeAction.js +378 -0
- package/out/src/storage/methods/internalizeAction.js.map +1 -0
- package/out/src/storage/methods/listActions.d.ts +5 -0
- package/out/src/storage/methods/listActions.d.ts.map +1 -0
- package/out/src/storage/methods/listActions.js +174 -0
- package/out/src/storage/methods/listActions.js.map +1 -0
- package/out/src/storage/methods/listCertificates.d.ts +5 -0
- package/out/src/storage/methods/listCertificates.d.ts.map +1 -0
- package/out/src/storage/methods/listCertificates.js +68 -0
- package/out/src/storage/methods/listCertificates.js.map +1 -0
- package/out/src/storage/methods/listOutputs.d.ts +5 -0
- package/out/src/storage/methods/listOutputs.d.ts.map +1 -0
- package/out/src/storage/methods/listOutputs.js +189 -0
- package/out/src/storage/methods/listOutputs.js.map +1 -0
- package/out/src/storage/methods/processAction.d.ts +35 -0
- package/out/src/storage/methods/processAction.d.ts.map +1 -0
- package/out/src/storage/methods/processAction.js +271 -0
- package/out/src/storage/methods/processAction.js.map +1 -0
- package/out/src/storage/methods/purgeData.d.ts +4 -0
- package/out/src/storage/methods/purgeData.d.ts.map +1 -0
- package/out/src/storage/methods/purgeData.js +229 -0
- package/out/src/storage/methods/purgeData.js.map +1 -0
- package/out/src/storage/methods/reviewStatus.d.ts +9 -0
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -0
- package/out/src/storage/methods/reviewStatus.js +75 -0
- package/out/src/storage/methods/reviewStatus.js.map +1 -0
- package/out/src/storage/remoting/StorageClient.d.ts +56 -0
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageClient.js +181 -0
- package/out/src/storage/remoting/StorageClient.js.map +1 -0
- package/out/src/storage/remoting/StorageServer.d.ts +26 -0
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageServer.js +144 -0
- package/out/src/storage/remoting/StorageServer.js.map +1 -0
- package/out/src/storage/schema/KnexMigrations.d.ts +39 -0
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -0
- package/out/src/storage/schema/KnexMigrations.js +442 -0
- package/out/src/storage/schema/KnexMigrations.js.map +1 -0
- package/out/src/storage/schema/entities/Certificate.d.ts +43 -0
- package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Certificate.js +162 -0
- package/out/src/storage/schema/entities/Certificate.js.map +1 -0
- package/out/src/storage/schema/entities/CertificateField.d.ts +32 -0
- package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -0
- package/out/src/storage/schema/entities/CertificateField.js +114 -0
- package/out/src/storage/schema/entities/CertificateField.js.map +1 -0
- package/out/src/storage/schema/entities/Commission.d.ts +37 -0
- package/out/src/storage/schema/entities/Commission.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Commission.js +130 -0
- package/out/src/storage/schema/entities/Commission.js.map +1 -0
- package/out/src/storage/schema/entities/EntityBase.d.ts +105 -0
- package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -0
- package/out/src/storage/schema/entities/EntityBase.js +100 -0
- package/out/src/storage/schema/entities/EntityBase.js.map +1 -0
- package/out/src/storage/schema/entities/MergeEntity.d.ts +34 -0
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -0
- package/out/src/storage/schema/entities/MergeEntity.js +57 -0
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -0
- package/out/src/storage/schema/entities/Output.d.ts +67 -0
- package/out/src/storage/schema/entities/Output.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Output.js +281 -0
- package/out/src/storage/schema/entities/Output.js.map +1 -0
- package/out/src/storage/schema/entities/OutputBasket.d.ts +35 -0
- package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputBasket.js +133 -0
- package/out/src/storage/schema/entities/OutputBasket.js.map +1 -0
- package/out/src/storage/schema/entities/OutputTag.d.ts +31 -0
- package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputTag.js +104 -0
- package/out/src/storage/schema/entities/OutputTag.js.map +1 -0
- package/out/src/storage/schema/entities/OutputTagMap.d.ts +28 -0
- package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -0
- package/out/src/storage/schema/entities/OutputTagMap.js +101 -0
- package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -0
- package/out/src/storage/schema/entities/ProvenTx.d.ts +84 -0
- package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -0
- package/out/src/storage/schema/entities/ProvenTx.js +283 -0
- package/out/src/storage/schema/entities/ProvenTx.js.map +1 -0
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts +130 -0
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -0
- package/out/src/storage/schema/entities/ProvenTxReq.js +521 -0
- package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -0
- package/out/src/storage/schema/entities/SyncState.d.ts +66 -0
- package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -0
- package/out/src/storage/schema/entities/SyncState.js +284 -0
- package/out/src/storage/schema/entities/SyncState.js.map +1 -0
- package/out/src/storage/schema/entities/Transaction.d.ts +67 -0
- package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -0
- package/out/src/storage/schema/entities/Transaction.js +264 -0
- package/out/src/storage/schema/entities/Transaction.js.map +1 -0
- package/out/src/storage/schema/entities/TxLabel.d.ts +31 -0
- package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -0
- package/out/src/storage/schema/entities/TxLabel.js +104 -0
- package/out/src/storage/schema/entities/TxLabel.js.map +1 -0
- package/out/src/storage/schema/entities/TxLabelMap.d.ts +28 -0
- package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -0
- package/out/src/storage/schema/entities/TxLabelMap.js +103 -0
- package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -0
- package/out/src/storage/schema/entities/User.d.ts +29 -0
- package/out/src/storage/schema/entities/User.d.ts.map +1 -0
- package/out/src/storage/schema/entities/User.js +100 -0
- package/out/src/storage/schema/entities/User.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js +588 -0
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js +449 -0
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js +602 -0
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js +515 -0
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js +478 -0
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js +440 -0
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js +626 -0
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js +585 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +628 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js +307 -0
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +823 -0
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js +442 -0
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js +313 -0
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js +81 -0
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.d.ts +2 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.d.ts.map +1 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.js +418 -0
- package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +1 -0
- package/out/src/storage/schema/entities/index.d.ts +17 -0
- package/out/src/storage/schema/entities/index.d.ts.map +1 -0
- package/out/src/storage/schema/entities/index.js +33 -0
- package/out/src/storage/schema/entities/index.js.map +1 -0
- package/out/src/storage/schema/tables/Certificate.d.ts +20 -0
- package/out/src/storage/schema/tables/Certificate.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Certificate.js +3 -0
- package/out/src/storage/schema/tables/Certificate.js.map +1 -0
- package/out/src/storage/schema/tables/CertificateField.d.ts +12 -0
- package/out/src/storage/schema/tables/CertificateField.d.ts.map +1 -0
- package/out/src/storage/schema/tables/CertificateField.js +3 -0
- package/out/src/storage/schema/tables/CertificateField.js.map +1 -0
- package/out/src/storage/schema/tables/Commission.d.ts +13 -0
- package/out/src/storage/schema/tables/Commission.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Commission.js +3 -0
- package/out/src/storage/schema/tables/Commission.js.map +1 -0
- package/out/src/storage/schema/tables/MonitorEvent.d.ts +9 -0
- package/out/src/storage/schema/tables/MonitorEvent.d.ts.map +1 -0
- package/out/src/storage/schema/tables/MonitorEvent.js +3 -0
- package/out/src/storage/schema/tables/MonitorEvent.js.map +1 -0
- package/out/src/storage/schema/tables/Output.d.ts +36 -0
- package/out/src/storage/schema/tables/Output.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Output.js +31 -0
- package/out/src/storage/schema/tables/Output.js.map +1 -0
- package/out/src/storage/schema/tables/OutputBasket.d.ts +12 -0
- package/out/src/storage/schema/tables/OutputBasket.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputBasket.js +3 -0
- package/out/src/storage/schema/tables/OutputBasket.js.map +1 -0
- package/out/src/storage/schema/tables/OutputTag.d.ts +10 -0
- package/out/src/storage/schema/tables/OutputTag.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputTag.js +3 -0
- package/out/src/storage/schema/tables/OutputTag.js.map +1 -0
- package/out/src/storage/schema/tables/OutputTagMap.d.ts +9 -0
- package/out/src/storage/schema/tables/OutputTagMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/OutputTagMap.js +3 -0
- package/out/src/storage/schema/tables/OutputTagMap.js.map +1 -0
- package/out/src/storage/schema/tables/ProvenTx.d.ts +14 -0
- package/out/src/storage/schema/tables/ProvenTx.d.ts.map +1 -0
- package/out/src/storage/schema/tables/ProvenTx.js +3 -0
- package/out/src/storage/schema/tables/ProvenTx.js.map +1 -0
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts +64 -0
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts.map +1 -0
- package/out/src/storage/schema/tables/ProvenTxReq.js +3 -0
- package/out/src/storage/schema/tables/ProvenTxReq.js.map +1 -0
- package/out/src/storage/schema/tables/Settings.d.ts +17 -0
- package/out/src/storage/schema/tables/Settings.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Settings.js +3 -0
- package/out/src/storage/schema/tables/Settings.js.map +1 -0
- package/out/src/storage/schema/tables/SyncState.d.ts +18 -0
- package/out/src/storage/schema/tables/SyncState.d.ts.map +1 -0
- package/out/src/storage/schema/tables/SyncState.js +3 -0
- package/out/src/storage/schema/tables/SyncState.js.map +1 -0
- package/out/src/storage/schema/tables/Transaction.d.ts +37 -0
- package/out/src/storage/schema/tables/Transaction.d.ts.map +1 -0
- package/out/src/storage/schema/tables/Transaction.js +21 -0
- package/out/src/storage/schema/tables/Transaction.js.map +1 -0
- package/out/src/storage/schema/tables/TxLabel.d.ts +10 -0
- package/out/src/storage/schema/tables/TxLabel.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TxLabel.js +3 -0
- package/out/src/storage/schema/tables/TxLabel.js.map +1 -0
- package/out/src/storage/schema/tables/TxLabelMap.d.ts +9 -0
- package/out/src/storage/schema/tables/TxLabelMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TxLabelMap.js +3 -0
- package/out/src/storage/schema/tables/TxLabelMap.js.map +1 -0
- package/out/src/storage/schema/tables/User.d.ts +16 -0
- package/out/src/storage/schema/tables/User.d.ts.map +1 -0
- package/out/src/storage/schema/tables/User.js +3 -0
- package/out/src/storage/schema/tables/User.js.map +1 -0
- package/out/src/storage/schema/tables/index.d.ts +17 -0
- package/out/src/storage/schema/tables/index.d.ts.map +1 -0
- package/out/src/storage/schema/tables/index.js +33 -0
- package/out/src/storage/schema/tables/index.js.map +1 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts +71 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.js +612 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -0
- package/out/src/storage/sync/index.d.ts +2 -0
- package/out/src/storage/sync/index.d.ts.map +1 -0
- package/out/src/storage/sync/index.js +18 -0
- package/out/src/storage/sync/index.js.map +1 -0
- package/out/src/utility/ScriptTemplateSABPPP.d.ts +25 -0
- package/out/src/utility/ScriptTemplateSABPPP.d.ts.map +1 -0
- package/out/src/utility/ScriptTemplateSABPPP.js +46 -0
- package/out/src/utility/ScriptTemplateSABPPP.js.map +1 -0
- package/out/src/utility/index.all.d.ts +7 -0
- package/out/src/utility/index.all.d.ts.map +1 -0
- package/out/src/utility/index.all.js +23 -0
- package/out/src/utility/index.all.js.map +1 -0
- package/out/src/utility/index.client.d.ts +7 -0
- package/out/src/utility/index.client.d.ts.map +1 -0
- package/out/src/utility/index.client.js +23 -0
- package/out/src/utility/index.client.js.map +1 -0
- package/out/src/utility/parseTxScriptOffsets.d.ts +14 -0
- package/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -0
- package/out/src/utility/parseTxScriptOffsets.js +26 -0
- package/out/src/utility/parseTxScriptOffsets.js.map +1 -0
- package/out/src/utility/stampLog.d.ts +18 -0
- package/out/src/utility/stampLog.d.ts.map +1 -0
- package/out/src/utility/stampLog.js +72 -0
- package/out/src/utility/stampLog.js.map +1 -0
- package/out/src/utility/tscProofToMerklePath.d.ts +8 -0
- package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -0
- package/out/src/utility/tscProofToMerklePath.js +41 -0
- package/out/src/utility/tscProofToMerklePath.js.map +1 -0
- package/out/src/utility/utilityHelpers.buffer.d.ts +18 -0
- package/out/src/utility/utilityHelpers.buffer.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.buffer.js +45 -0
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -0
- package/out/src/utility/utilityHelpers.d.ts +129 -0
- package/out/src/utility/utilityHelpers.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.js +268 -0
- package/out/src/utility/utilityHelpers.js.map +1 -0
- package/out/src/utility/utilityHelpers.noBuffer.d.ts +9 -0
- package/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -0
- package/out/src/utility/utilityHelpers.noBuffer.js +23 -0
- package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.d.ts +2 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.d.ts.map +1 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.js +45 -0
- package/out/test/Wallet/StorageClient/storageClient.man.test.js.map +1 -0
- package/out/test/Wallet/action/internalizeAction.a.test.d.ts +2 -0
- package/out/test/Wallet/action/internalizeAction.a.test.d.ts.map +1 -0
- package/out/test/Wallet/action/internalizeAction.a.test.js +243 -0
- package/out/test/Wallet/action/internalizeAction.a.test.js.map +1 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.d.ts +2 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.d.ts.map +1 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.js +213 -0
- package/out/test/Wallet/certificate/acquireCertificate.test.js.map +1 -0
- package/out/test/Wallet/certificate/listCertificates.test.d.ts +2 -0
- package/out/test/Wallet/certificate/listCertificates.test.d.ts.map +1 -0
- package/out/test/Wallet/certificate/listCertificates.test.js +305 -0
- package/out/test/Wallet/certificate/listCertificates.test.js.map +1 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.d.ts +2 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.js +68 -0
- package/out/test/Wallet/get/getHeaderForHeight.test.js.map +1 -0
- package/out/test/Wallet/get/getHeight.test.d.ts +2 -0
- package/out/test/Wallet/get/getHeight.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getHeight.test.js +45 -0
- package/out/test/Wallet/get/getHeight.test.js.map +1 -0
- package/out/test/Wallet/get/getKnownTxids.test.d.ts +2 -0
- package/out/test/Wallet/get/getKnownTxids.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getKnownTxids.test.js +73 -0
- package/out/test/Wallet/get/getKnownTxids.test.js.map +1 -0
- package/out/test/Wallet/get/getNetwork.test.d.ts +2 -0
- package/out/test/Wallet/get/getNetwork.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getNetwork.test.js +26 -0
- package/out/test/Wallet/get/getNetwork.test.js.map +1 -0
- package/out/test/Wallet/get/getVersion.test.d.ts +2 -0
- package/out/test/Wallet/get/getVersion.test.d.ts.map +1 -0
- package/out/test/Wallet/get/getVersion.test.js +25 -0
- package/out/test/Wallet/get/getVersion.test.js.map +1 -0
- package/out/test/Wallet/live/walletLive.man.test.d.ts +26 -0
- package/out/test/Wallet/live/walletLive.man.test.d.ts.map +1 -0
- package/out/test/Wallet/live/walletLive.man.test.js +389 -0
- package/out/test/Wallet/live/walletLive.man.test.js.map +1 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.d.ts +2 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.d.ts.map +1 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js +153 -0
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js.map +1 -0
- package/out/test/checkDB.d.ts +4 -0
- package/out/test/checkDB.d.ts.map +1 -0
- package/out/test/checkDB.js +55 -0
- package/out/test/checkDB.js.map +1 -0
- package/out/test/examples/README.man.test.d.ts +2 -0
- package/out/test/examples/README.man.test.d.ts.map +1 -0
- package/out/test/examples/README.man.test.js +46 -0
- package/out/test/examples/README.man.test.js.map +1 -0
- package/out/test/monitor/Monitor.test.d.ts +2 -0
- package/out/test/monitor/Monitor.test.d.ts.map +1 -0
- package/out/test/monitor/Monitor.test.js +446 -0
- package/out/test/monitor/Monitor.test.js.map +1 -0
- package/out/test/services/Services.test.d.ts +2 -0
- package/out/test/services/Services.test.d.ts.map +1 -0
- package/out/test/services/Services.test.js +128 -0
- package/out/test/services/Services.test.js.map +1 -0
- package/out/test/storage/KnexMigrations.test.d.ts +2 -0
- package/out/test/storage/KnexMigrations.test.d.ts.map +1 -0
- package/out/test/storage/KnexMigrations.test.js +81 -0
- package/out/test/storage/KnexMigrations.test.js.map +1 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.d.ts +2 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.d.ts.map +1 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.js +88 -0
- package/out/test/storage/StorageMySQLDojoReader.man.test.js.map +1 -0
- package/out/test/storage/count.test.d.ts +2 -0
- package/out/test/storage/count.test.d.ts.map +1 -0
- package/out/test/storage/count.test.js +141 -0
- package/out/test/storage/count.test.js.map +1 -0
- package/out/test/storage/find.test.d.ts +2 -0
- package/out/test/storage/find.test.d.ts.map +1 -0
- package/out/test/storage/find.test.js +148 -0
- package/out/test/storage/find.test.js.map +1 -0
- package/out/test/storage/findLegacy.test.d.ts +2 -0
- package/out/test/storage/findLegacy.test.d.ts.map +1 -0
- package/out/test/storage/findLegacy.test.js +52 -0
- package/out/test/storage/findLegacy.test.js.map +1 -0
- package/out/test/storage/insert.test.d.ts +2 -0
- package/out/test/storage/insert.test.d.ts.map +1 -0
- package/out/test/storage/insert.test.js +256 -0
- package/out/test/storage/insert.test.js.map +1 -0
- package/out/test/storage/update.test.d.ts +2 -0
- package/out/test/storage/update.test.d.ts.map +1 -0
- package/out/test/storage/update.test.js +926 -0
- package/out/test/storage/update.test.js.map +1 -0
- package/out/test/storage/update2.test.d.ts +2 -0
- package/out/test/storage/update2.test.d.ts.map +1 -0
- package/out/test/storage/update2.test.js +766 -0
- package/out/test/storage/update2.test.js.map +1 -0
- package/out/test/utils/TestUtilsWalletStorage.d.ts +399 -0
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -0
- package/out/test/utils/TestUtilsWalletStorage.js +1337 -0
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -0
- package/out/test/wallet/action/abortAction.test.d.ts +2 -0
- package/out/test/wallet/action/abortAction.test.d.ts.map +1 -0
- package/out/test/wallet/action/abortAction.test.js +44 -0
- package/out/test/wallet/action/abortAction.test.js.map +1 -0
- package/out/test/wallet/action/createAction.test.d.ts +2 -0
- package/out/test/wallet/action/createAction.test.d.ts.map +1 -0
- package/out/test/wallet/action/createAction.test.js +230 -0
- package/out/test/wallet/action/createAction.test.js.map +1 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.d.ts +2 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.d.ts.map +1 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js +273 -0
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js.map +1 -0
- package/out/test/wallet/action/internalizeAction.test.d.ts +2 -0
- package/out/test/wallet/action/internalizeAction.test.d.ts.map +1 -0
- package/out/test/wallet/action/internalizeAction.test.js +603 -0
- package/out/test/wallet/action/internalizeAction.test.js.map +1 -0
- package/out/test/wallet/action/relinquishOutput.test.d.ts +2 -0
- package/out/test/wallet/action/relinquishOutput.test.d.ts.map +1 -0
- package/out/test/wallet/action/relinquishOutput.test.js +31 -0
- package/out/test/wallet/action/relinquishOutput.test.js.map +1 -0
- package/out/test/wallet/construct/Wallet.constructor.test.d.ts +2 -0
- package/out/test/wallet/construct/Wallet.constructor.test.d.ts.map +1 -0
- package/out/test/wallet/construct/Wallet.constructor.test.js +49 -0
- package/out/test/wallet/construct/Wallet.constructor.test.js.map +1 -0
- package/out/test/wallet/list/listActions.test.d.ts +2 -0
- package/out/test/wallet/list/listActions.test.d.ts.map +1 -0
- package/out/test/wallet/list/listActions.test.js +265 -0
- package/out/test/wallet/list/listActions.test.js.map +1 -0
- package/out/test/wallet/list/listActions2.test.d.ts +2 -0
- package/out/test/wallet/list/listActions2.test.d.ts.map +1 -0
- package/out/test/wallet/list/listActions2.test.js +423 -0
- package/out/test/wallet/list/listActions2.test.js.map +1 -0
- package/out/test/wallet/list/listCertificates.test.d.ts +2 -0
- package/out/test/wallet/list/listCertificates.test.d.ts.map +1 -0
- package/out/test/wallet/list/listCertificates.test.js +115 -0
- package/out/test/wallet/list/listCertificates.test.js.map +1 -0
- package/out/test/wallet/list/listOutputs.test.d.ts +2 -0
- package/out/test/wallet/list/listOutputs.test.d.ts.map +1 -0
- package/out/test/wallet/list/listOutputs.test.js +521 -0
- package/out/test/wallet/list/listOutputs.test.js.map +1 -0
- package/out/test/wallet/sync/Wallet.sync.test.d.ts +2 -0
- package/out/test/wallet/sync/Wallet.sync.test.d.ts.map +1 -0
- package/out/test/wallet/sync/Wallet.sync.test.js +142 -0
- package/out/test/wallet/sync/Wallet.sync.test.js.map +1 -0
- package/out/tsconfig.all.tsbuildinfo +1 -0
- package/package.json +63 -0
- package/src/Wallet.ts +771 -0
- package/src/index.all.ts +8 -0
- package/src/index.client.ts +7 -0
- package/src/index.ts +2 -0
- package/src/monitor/Monitor.ts +317 -0
- package/src/monitor/MonitorDaemon.ts +197 -0
- package/src/monitor/README.md +3 -0
- package/src/monitor/__test/MonitorDaemon.man.test.ts +17 -0
- package/src/monitor/tasks/TaskCheckForProofs.ts +235 -0
- package/src/monitor/tasks/TaskClock.ts +35 -0
- package/src/monitor/tasks/TaskFailAbandoned.ts +56 -0
- package/src/monitor/tasks/TaskNewHeader.ts +48 -0
- package/src/monitor/tasks/TaskPurge.ts +69 -0
- package/src/monitor/tasks/TaskReviewStatus.ts +51 -0
- package/src/monitor/tasks/TaskSendWaiting.ts +107 -0
- package/src/monitor/tasks/TaskSyncWhenIdle.ts +26 -0
- package/src/monitor/tasks/WalletMonitorTask.ts +47 -0
- package/src/sdk/CertOps.ts +346 -0
- package/src/sdk/PrivilegedKeyManager.ts +402 -0
- package/src/sdk/README.md +13 -0
- package/src/sdk/StorageSyncReader.ts +155 -0
- package/src/sdk/StorageSyncReaderWriter.ts +263 -0
- package/src/sdk/WERR_errors.ts +152 -0
- package/src/sdk/WalletError.ts +136 -0
- package/src/sdk/WalletServices.interfaces.ts +399 -0
- package/src/sdk/WalletSigner.interfaces.ts +38 -0
- package/src/sdk/WalletStorage.interfaces.ts +416 -0
- package/src/sdk/__test/CertificateLifeCycle.test.ts +194 -0
- package/src/sdk/__test/PrivilegedKeyManager.test.ts +775 -0
- package/src/sdk/index.ts +11 -0
- package/src/sdk/types.ts +115 -0
- package/src/sdk/validationHelpers.ts +1248 -0
- package/src/services/README.md +11 -0
- package/src/services/ServiceCollection.ts +50 -0
- package/src/services/Services.ts +461 -0
- package/src/services/__tests/getMerklePath.test.ts +16 -0
- package/src/services/__tests/getRawTx.test.ts +15 -0
- package/src/services/__tests/postBeef.test.ts +19 -0
- package/src/services/__tests/postBeefToArcTaal.test.ts +487 -0
- package/src/services/__tests/postTxs.test.ts +20 -0
- package/src/services/chaintracker/ChaintracksChainTracker.ts +78 -0
- package/src/services/chaintracker/__tests/ChaintracksChainTracker.test.ts +25 -0
- package/src/services/chaintracker/__tests/ChaintracksServiceClient.test.ts +32 -0
- package/src/services/chaintracker/chaintracks/BlockHeaderApi.ts +123 -0
- package/src/services/chaintracker/chaintracks/ChaintracksServiceClient.ts +160 -0
- package/src/services/chaintracker/chaintracks/index.ts +2 -0
- package/src/services/chaintracker/index.ts +2 -0
- package/src/services/createDefaultWalletServicesOptions.ts +38 -0
- package/src/services/index.ts +1 -0
- package/src/services/providers/arcServices.ts +570 -0
- package/src/services/providers/echangeRates.ts +276 -0
- package/src/services/providers/whatsonchain.ts +170 -0
- package/src/signer/README.md +5 -0
- package/src/signer/WalletSigner.ts +21 -0
- package/src/signer/methods/acquireDirectCertificate.ts +53 -0
- package/src/signer/methods/createAction.ts +364 -0
- package/src/signer/methods/internalizeAction.ts +142 -0
- package/src/signer/methods/proveCertificate.ts +51 -0
- package/src/signer/methods/signAction.ts +121 -0
- package/src/storage/README.md +14 -0
- package/src/storage/StorageKnex.ts +1449 -0
- package/src/storage/StorageProvider.ts +853 -0
- package/src/storage/StorageReader.ts +222 -0
- package/src/storage/StorageReaderWriter.ts +623 -0
- package/src/storage/StorageSyncReader.ts +143 -0
- package/src/storage/WalletStorageManager.ts +532 -0
- package/src/storage/__test/WalletStorageManager.test.ts +292 -0
- package/src/storage/index.all.ts +10 -0
- package/src/storage/index.client.ts +6 -0
- package/src/storage/index.db.ts +0 -0
- package/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.ts +1143 -0
- package/src/storage/methods/__test/GenerateChange/randomValsUsed1.ts +31 -0
- package/src/storage/methods/attemptToPostReqsToNetwork.ts +185 -0
- package/src/storage/methods/createAction.ts +997 -0
- package/src/storage/methods/generateChange.ts +629 -0
- package/src/storage/methods/getBeefForTransaction.ts +143 -0
- package/src/storage/methods/getSyncChunk.ts +330 -0
- package/src/storage/methods/internalizeAction.ts +538 -0
- package/src/storage/methods/listActions.ts +203 -0
- package/src/storage/methods/listCertificates.ts +81 -0
- package/src/storage/methods/listOutputs.ts +219 -0
- package/src/storage/methods/processAction.ts +477 -0
- package/src/storage/methods/purgeData.ts +276 -0
- package/src/storage/methods/reviewStatus.ts +95 -0
- package/src/storage/remoting/StorageClient.ts +306 -0
- package/src/storage/remoting/StorageServer.ts +179 -0
- package/src/storage/schema/KnexMigrations.ts +488 -0
- package/src/storage/schema/entities/Certificate.ts +199 -0
- package/src/storage/schema/entities/CertificateField.ts +157 -0
- package/src/storage/schema/entities/Commission.ts +169 -0
- package/src/storage/schema/entities/EntityBase.ts +214 -0
- package/src/storage/schema/entities/MergeEntity.ts +79 -0
- package/src/storage/schema/entities/Output.ts +323 -0
- package/src/storage/schema/entities/OutputBasket.ts +165 -0
- package/src/storage/schema/entities/OutputTag.ts +138 -0
- package/src/storage/schema/entities/OutputTagMap.ts +146 -0
- package/src/storage/schema/entities/ProvenTx.ts +349 -0
- package/src/storage/schema/entities/ProvenTxReq.ts +646 -0
- package/src/storage/schema/entities/SyncState.ts +429 -0
- package/src/storage/schema/entities/Transaction.ts +334 -0
- package/src/storage/schema/entities/TxLabel.ts +135 -0
- package/src/storage/schema/entities/TxLabelMap.ts +148 -0
- package/src/storage/schema/entities/User.ts +138 -0
- package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +663 -0
- package/src/storage/schema/entities/__tests/CertificateTests.test.ts +527 -0
- package/src/storage/schema/entities/__tests/CommissionTests.test.ts +658 -0
- package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +567 -0
- package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +530 -0
- package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +504 -0
- package/src/storage/schema/entities/__tests/OutputTests.test.ts +689 -0
- package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +669 -0
- package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +700 -0
- package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +376 -0
- package/src/storage/schema/entities/__tests/TransactionTests.test.ts +920 -0
- package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +512 -0
- package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +350 -0
- package/src/storage/schema/entities/__tests/stampLogTests.test.ts +97 -0
- package/src/storage/schema/entities/__tests/usersTests.test.ts +485 -0
- package/src/storage/schema/entities/index.ts +16 -0
- package/src/storage/schema/tables/Certificate.ts +21 -0
- package/src/storage/schema/tables/CertificateField.ts +12 -0
- package/src/storage/schema/tables/Commission.ts +13 -0
- package/src/storage/schema/tables/MonitorEvent.ts +9 -0
- package/src/storage/schema/tables/Output.ts +64 -0
- package/src/storage/schema/tables/OutputBasket.ts +12 -0
- package/src/storage/schema/tables/OutputTag.ts +10 -0
- package/src/storage/schema/tables/OutputTagMap.ts +9 -0
- package/src/storage/schema/tables/ProvenTx.ts +14 -0
- package/src/storage/schema/tables/ProvenTxReq.ts +65 -0
- package/src/storage/schema/tables/Settings.ts +17 -0
- package/src/storage/schema/tables/SyncState.ts +18 -0
- package/src/storage/schema/tables/Transaction.ts +54 -0
- package/src/storage/schema/tables/TxLabel.ts +10 -0
- package/src/storage/schema/tables/TxLabelMap.ts +9 -0
- package/src/storage/schema/tables/User.ts +16 -0
- package/src/storage/schema/tables/index.ts +16 -0
- package/src/storage/sync/StorageMySQLDojoReader.ts +771 -0
- package/src/storage/sync/index.ts +1 -0
- package/src/utility/README.md +3 -0
- package/src/utility/ScriptTemplateSABPPP.ts +79 -0
- package/src/utility/index.all.ts +7 -0
- package/src/utility/index.client.ts +7 -0
- package/src/utility/parseTxScriptOffsets.ts +29 -0
- package/src/utility/stampLog.ts +73 -0
- package/src/utility/tscProofToMerklePath.ts +51 -0
- package/src/utility/utilityHelpers.buffer.ts +43 -0
- package/src/utility/utilityHelpers.noBuffer.ts +18 -0
- package/src/utility/utilityHelpers.ts +283 -0
- package/test/Wallet/StorageClient/storageClient.man.test.ts +55 -0
- package/test/Wallet/action/internalizeAction.a.test.ts +301 -0
- package/test/Wallet/certificate/acquireCertificate.test.ts +253 -0
- package/test/Wallet/certificate/listCertificates.test.ts +352 -0
- package/test/Wallet/get/getHeaderForHeight.test.ts +79 -0
- package/test/Wallet/get/getHeight.test.ts +52 -0
- package/test/Wallet/get/getKnownTxids.test.ts +90 -0
- package/test/Wallet/get/getNetwork.test.ts +28 -0
- package/test/Wallet/get/getVersion.test.ts +28 -0
- package/test/Wallet/live/walletLive.man.test.ts +510 -0
- package/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.ts +155 -0
- package/test/checkDB.ts +63 -0
- package/test/checkdb +0 -0
- package/test/examples/README.man.test.ts +53 -0
- package/test/monitor/Monitor.test.ts +536 -0
- package/test/services/Services.test.ts +149 -0
- package/test/storage/KnexMigrations.test.ts +100 -0
- package/test/storage/StorageMySQLDojoReader.man.test.ts +71 -0
- package/test/storage/count.test.ts +193 -0
- package/test/storage/find.test.ts +216 -0
- package/test/storage/findLegacy.test.ts +70 -0
- package/test/storage/insert.test.ts +294 -0
- package/test/storage/update.test.ts +1146 -0
- package/test/storage/update2.test.ts +1017 -0
- package/test/utils/TestUtilsWalletStorage.ts +1923 -0
- package/test/utils/removeFailedFromDatabase.sql +17 -0
- package/test/wallet/action/abortAction.test.ts +55 -0
- package/test/wallet/action/createAction.test.ts +266 -0
- package/test/wallet/action/createActionToGenerateBeefs.man.test.ts +297 -0
- package/test/wallet/action/internalizeAction.test.ts +729 -0
- package/test/wallet/action/relinquishOutput.test.ts +43 -0
- package/test/wallet/construct/Wallet.constructor.test.ts +57 -0
- package/test/wallet/list/listActions.test.ts +282 -0
- package/test/wallet/list/listActions2.test.ts +570 -0
- package/test/wallet/list/listCertificates.test.ts +129 -0
- package/test/wallet/list/listOutputs.test.ts +573 -0
- package/test/wallet/sync/Wallet.sync.test.ts +226 -0
- package/ts2md.json +32 -0
- package/tsconfig.all.json +29 -0
- package/tsconfig.client.json +22 -0
- package/tsconfig.json +14 -0
- package/unlock-migrations.sh +41 -0
|
@@ -0,0 +1,948 @@
|
|
|
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 = [
|
|
19
|
+
...defAvailableChange()
|
|
20
|
+
];
|
|
21
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
22
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
23
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":6323,"outputId":15005,"spendable":false}],"changeOutputs":[{"satoshis":1608,"lockingScriptLength":25}],"size":1739330,"fee":3479,"satsPerKb":2}');
|
|
24
|
+
expectTransactionSize(params, r);
|
|
25
|
+
});
|
|
26
|
+
test('0a two outputs exact input', async () => {
|
|
27
|
+
const params = {
|
|
28
|
+
...defParams,
|
|
29
|
+
fixedOutputs: [
|
|
30
|
+
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
31
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
const availableChange = [
|
|
35
|
+
...defAvailableChange()
|
|
36
|
+
];
|
|
37
|
+
availableChange[5].satoshis = 4715;
|
|
38
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
39
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
40
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":4715,"outputId":15027,"spendable":false}],"changeOutputs":[],"size":1739296,"fee":3479,"satsPerKb":2}');
|
|
41
|
+
expectTransactionSize(params, r);
|
|
42
|
+
});
|
|
43
|
+
test('0b two outputs 666666 200 ', async () => {
|
|
44
|
+
const params = {
|
|
45
|
+
...defParams,
|
|
46
|
+
fixedOutputs: [
|
|
47
|
+
{ satoshis: 666666, lockingScriptLength: 197 },
|
|
48
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
const availableChange = [
|
|
52
|
+
...defAvailableChange()
|
|
53
|
+
];
|
|
54
|
+
availableChange[5].satoshis = 4715;
|
|
55
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
56
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
57
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1575097,"outputId":15101,"spendable":false}],"changeOutputs":[{"satoshis":908230,"lockingScriptLength":25}],"size":432,"fee":1,"satsPerKb":2}');
|
|
58
|
+
expectTransactionSize(params, r);
|
|
59
|
+
});
|
|
60
|
+
test('0c two outputs 666666 200 two change inputs ', async () => {
|
|
61
|
+
const params = {
|
|
62
|
+
...defParams,
|
|
63
|
+
fixedOutputs: [
|
|
64
|
+
{ satoshis: 666666, lockingScriptLength: 197 },
|
|
65
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
const availableChange = [
|
|
69
|
+
{ satoshis: 191051, outputId: 14101 },
|
|
70
|
+
{ satoshis: 129470, outputId: 14106 },
|
|
71
|
+
{ satoshis: 273356, outputId: 14110 },
|
|
72
|
+
{ satoshis: 65612, outputId: 14120 },
|
|
73
|
+
{ satoshis: 44778, outputId: 14126 },
|
|
74
|
+
{ satoshis: 58732, outputId: 14141 },
|
|
75
|
+
{ satoshis: 160865, outputId: 14142 },
|
|
76
|
+
{ satoshis: 535280, outputId: 14146 },
|
|
77
|
+
{ satoshis: 1006, outputId: 14177 },
|
|
78
|
+
{ satoshis: 1000, outputId: 14178 }
|
|
79
|
+
];
|
|
80
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
81
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
82
|
+
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}');
|
|
83
|
+
expectTransactionSize(params, r);
|
|
84
|
+
});
|
|
85
|
+
test('1 two outputs four change outputs', async () => {
|
|
86
|
+
const params = {
|
|
87
|
+
...defParams,
|
|
88
|
+
fixedOutputs: [
|
|
89
|
+
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
90
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
91
|
+
],
|
|
92
|
+
targetNetCount: 4
|
|
93
|
+
};
|
|
94
|
+
const availableChange = [
|
|
95
|
+
...defAvailableChange()
|
|
96
|
+
];
|
|
97
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
98
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
99
|
+
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}');
|
|
100
|
+
expectTransactionSize(params, r);
|
|
101
|
+
});
|
|
102
|
+
test('2 WERR_INSUFFICIENT_FUNDS', async () => {
|
|
103
|
+
const params = {
|
|
104
|
+
...defParams,
|
|
105
|
+
fixedOutputs: [
|
|
106
|
+
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
107
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
108
|
+
],
|
|
109
|
+
targetNetCount: 4
|
|
110
|
+
};
|
|
111
|
+
const availableChange = defAvailableChange().slice(1, 4);
|
|
112
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
113
|
+
expectToThrowWERR(index_client_1.sdk.WERR_INSUFFICIENT_FUNDS, () => (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput));
|
|
114
|
+
});
|
|
115
|
+
test('2a WERR_INSUFFICIENT_FUNDS no inputs', async () => {
|
|
116
|
+
const params = {
|
|
117
|
+
...defParams,
|
|
118
|
+
fixedOutputs: [
|
|
119
|
+
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
120
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
121
|
+
],
|
|
122
|
+
targetNetCount: 4
|
|
123
|
+
};
|
|
124
|
+
const availableChange = [];
|
|
125
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
126
|
+
expectToThrowWERR(index_client_1.sdk.WERR_INSUFFICIENT_FUNDS, () => (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput));
|
|
127
|
+
});
|
|
128
|
+
test('3 allocate all', async () => {
|
|
129
|
+
const params = {
|
|
130
|
+
...defParams,
|
|
131
|
+
fixedOutputs: [
|
|
132
|
+
{ satoshis: 1234, lockingScriptLength: 39091 },
|
|
133
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
134
|
+
],
|
|
135
|
+
targetNetCount: 4
|
|
136
|
+
};
|
|
137
|
+
const availableChange = defAvailableChange().slice(1, 4);
|
|
138
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
139
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
140
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1004,"outputId":15011,"spendable":false},{"satoshis":1000,"outputId":15017,"spendable":false},{"satoshis":1000,"outputId":15013,"spendable":false}],"changeOutputs":[{"satoshis":688,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25}],"size":39658,"fee":80,"satsPerKb":2}');
|
|
141
|
+
expectTransactionSize(params, r);
|
|
142
|
+
});
|
|
143
|
+
test('4 feeModel 5 sat per kb', async () => {
|
|
144
|
+
const params = {
|
|
145
|
+
...defParams,
|
|
146
|
+
fixedOutputs: [
|
|
147
|
+
{ satoshis: 1234, lockingScriptLength: 39091 },
|
|
148
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
149
|
+
],
|
|
150
|
+
feeModel: { value: 5, model: 'sat/kb' },
|
|
151
|
+
targetNetCount: 4
|
|
152
|
+
};
|
|
153
|
+
const availableChange = defAvailableChange().slice(1, 4);
|
|
154
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
155
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
156
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1004,"outputId":15011,"spendable":false},{"satoshis":1000,"outputId":15017,"spendable":false},{"satoshis":1000,"outputId":15013,"spendable":false}],"changeOutputs":[{"satoshis":569,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25}],"size":39658,"fee":199,"satsPerKb":5}');
|
|
157
|
+
expectTransactionSize(params, r);
|
|
158
|
+
});
|
|
159
|
+
test('4a feeModel 1 sat per kb', async () => {
|
|
160
|
+
const params = {
|
|
161
|
+
...defParams,
|
|
162
|
+
fixedOutputs: [
|
|
163
|
+
{ satoshis: 1234, lockingScriptLength: 39091 },
|
|
164
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
165
|
+
],
|
|
166
|
+
feeModel: { value: 1, model: 'sat/kb' },
|
|
167
|
+
targetNetCount: 4
|
|
168
|
+
};
|
|
169
|
+
const availableChange = defAvailableChange().slice(1, 4);
|
|
170
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
171
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
172
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":1004,"outputId":15011,"spendable":false},{"satoshis":1000,"outputId":15017,"spendable":false},{"satoshis":1000,"outputId":15013,"spendable":false}],"changeOutputs":[{"satoshis":728,"lockingScriptLength":25},{"satoshis":1000,"lockingScriptLength":25}],"size":39658,"fee":40,"satsPerKb":1}');
|
|
173
|
+
expectTransactionSize(params, r);
|
|
174
|
+
});
|
|
175
|
+
test('5 one fixedInput', async () => {
|
|
176
|
+
const params = {
|
|
177
|
+
...defParams,
|
|
178
|
+
fixedInputs: [{ satoshis: 1234, unlockingScriptLength: 42 }],
|
|
179
|
+
fixedOutputs: [
|
|
180
|
+
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
181
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
182
|
+
],
|
|
183
|
+
targetNetCount: 4
|
|
184
|
+
};
|
|
185
|
+
const availableChange = [
|
|
186
|
+
...defAvailableChange()
|
|
187
|
+
];
|
|
188
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
189
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
190
|
+
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}');
|
|
191
|
+
expectTransactionSize(params, r);
|
|
192
|
+
});
|
|
193
|
+
test('5a one larger fixedInput', async () => {
|
|
194
|
+
const params = {
|
|
195
|
+
...defParams,
|
|
196
|
+
fixedInputs: [{ satoshis: 1234, unlockingScriptLength: 242 }],
|
|
197
|
+
fixedOutputs: [
|
|
198
|
+
{ satoshis: 1234, lockingScriptLength: 1739091 },
|
|
199
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
200
|
+
],
|
|
201
|
+
targetNetCount: 4
|
|
202
|
+
};
|
|
203
|
+
const availableChange = [
|
|
204
|
+
...defAvailableChange()
|
|
205
|
+
];
|
|
206
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
207
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
208
|
+
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}');
|
|
209
|
+
expectTransactionSize(params, r);
|
|
210
|
+
});
|
|
211
|
+
test('5b one fixedInput 1001 73', async () => {
|
|
212
|
+
const params = {
|
|
213
|
+
...defParams,
|
|
214
|
+
fixedInputs: [{ satoshis: 1001, unlockingScriptLength: 73 }]
|
|
215
|
+
};
|
|
216
|
+
const availableChange = [
|
|
217
|
+
...defAvailableChange()
|
|
218
|
+
];
|
|
219
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
220
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
221
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[],"changeOutputs":[{"satoshis":1000,"lockingScriptLength":25}],"size":158,"fee":1,"satsPerKb":2}');
|
|
222
|
+
expectTransactionSize(params, r);
|
|
223
|
+
});
|
|
224
|
+
test('6 no fixedOutputs one fixedInput', async () => {
|
|
225
|
+
const params = {
|
|
226
|
+
...defParams,
|
|
227
|
+
fixedInputs: [{ satoshis: 1234, unlockingScriptLength: 42 }],
|
|
228
|
+
fixedOutputs: [],
|
|
229
|
+
targetNetCount: 4
|
|
230
|
+
};
|
|
231
|
+
const availableChange = [
|
|
232
|
+
...defAvailableChange()
|
|
233
|
+
];
|
|
234
|
+
const { allocateChangeInput, releaseChangeInput, getLog } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
235
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
236
|
+
//console.log(getLog())
|
|
237
|
+
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}');
|
|
238
|
+
expectTransactionSize(params, r);
|
|
239
|
+
});
|
|
240
|
+
test('6a no fixedOutputs no fixedInput', async () => {
|
|
241
|
+
const params = {
|
|
242
|
+
...defParams,
|
|
243
|
+
fixedInputs: [],
|
|
244
|
+
fixedOutputs: [],
|
|
245
|
+
targetNetCount: 4
|
|
246
|
+
};
|
|
247
|
+
const availableChange = [
|
|
248
|
+
...defAvailableChange()
|
|
249
|
+
];
|
|
250
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
251
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
252
|
+
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}');
|
|
253
|
+
expectTransactionSize(params, r);
|
|
254
|
+
});
|
|
255
|
+
test('7 paramsText4 d4', async () => {
|
|
256
|
+
const params = {
|
|
257
|
+
...defParams,
|
|
258
|
+
fixedOutputs: [
|
|
259
|
+
{ satoshis: 309000, lockingScriptLength: 198 },
|
|
260
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
261
|
+
]
|
|
262
|
+
};
|
|
263
|
+
const availableChange = [
|
|
264
|
+
{ satoshis: 7130, outputId: 15142 },
|
|
265
|
+
{ satoshis: 474866, outputId: 15332 },
|
|
266
|
+
{ satoshis: 16411, outputId: 15355 },
|
|
267
|
+
{ satoshis: 763632, outputId: 15368 },
|
|
268
|
+
{ satoshis: 18894, outputId: 15371 },
|
|
269
|
+
{ satoshis: 1574590, outputId: 15420 },
|
|
270
|
+
{ satoshis: 43207, outputId: 15480 },
|
|
271
|
+
{ satoshis: 12342, outputId: 15541 },
|
|
272
|
+
{ satoshis: 123453, outputId: 15548 },
|
|
273
|
+
{ satoshis: 7890, outputId: 16020 },
|
|
274
|
+
{ satoshis: 1073, outputId: 16026 }
|
|
275
|
+
];
|
|
276
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
277
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
278
|
+
expect(JSON.stringify(r)).toBe('{"allocatedChangeInputs":[{"satoshis":474866,"outputId":15332,"spendable":false}],"changeOutputs":[{"satoshis":165863,"lockingScriptLength":25}],"size":433,"fee":1,"satsPerKb":2}');
|
|
279
|
+
expectTransactionSize(params, r);
|
|
280
|
+
});
|
|
281
|
+
const d5 = {
|
|
282
|
+
p: {
|
|
283
|
+
fixedInputs: [{ satoshis: 1000, unlockingScriptLength: 72 }],
|
|
284
|
+
fixedOutputs: [{ satoshis: 200, lockingScriptLength: 25 }],
|
|
285
|
+
feeModel: { model: 'sat/kb', value: 2 },
|
|
286
|
+
changeInitialSatoshis: 1000,
|
|
287
|
+
changeFirstSatoshis: 285,
|
|
288
|
+
changeLockingScriptLength: 25,
|
|
289
|
+
changeUnlockingScriptLength: 107
|
|
290
|
+
},
|
|
291
|
+
availableChange: [
|
|
292
|
+
{ satoshis: 191051, outputId: 14101 },
|
|
293
|
+
{ satoshis: 273356, outputId: 14110 },
|
|
294
|
+
{ satoshis: 65612, outputId: 14120 },
|
|
295
|
+
{ satoshis: 44778, outputId: 14126 },
|
|
296
|
+
{ satoshis: 58732, outputId: 14141 },
|
|
297
|
+
{ satoshis: 160865, outputId: 14142 },
|
|
298
|
+
{ satoshis: 1006, outputId: 14177 },
|
|
299
|
+
{ satoshis: 1000, outputId: 14178 },
|
|
300
|
+
{ satoshis: 1000, outputId: 14180 },
|
|
301
|
+
{ satoshis: 1000, outputId: 14181 },
|
|
302
|
+
{ satoshis: 1000, outputId: 14183 },
|
|
303
|
+
{ satoshis: 1000, outputId: 14185 },
|
|
304
|
+
{ satoshis: 1000, outputId: 14186 },
|
|
305
|
+
{ satoshis: 1001, outputId: 14188 },
|
|
306
|
+
{ satoshis: 1000, outputId: 14189 },
|
|
307
|
+
{ satoshis: 1000, outputId: 14190 },
|
|
308
|
+
{ satoshis: 1001, outputId: 14192 },
|
|
309
|
+
{ satoshis: 1000, outputId: 14195 },
|
|
310
|
+
{ satoshis: 1000, outputId: 14196 },
|
|
311
|
+
{ satoshis: 1000, outputId: 14197 },
|
|
312
|
+
{ satoshis: 1000, outputId: 14198 },
|
|
313
|
+
{ satoshis: 1000, outputId: 14199 },
|
|
314
|
+
{ satoshis: 1000, outputId: 14200 },
|
|
315
|
+
{ satoshis: 1000, outputId: 14201 },
|
|
316
|
+
{ satoshis: 1000, outputId: 14202 },
|
|
317
|
+
{ satoshis: 1000, outputId: 14203 },
|
|
318
|
+
{ satoshis: 1000, outputId: 14204 },
|
|
319
|
+
{ satoshis: 1000, outputId: 14205 },
|
|
320
|
+
{ satoshis: 1000, outputId: 14206 },
|
|
321
|
+
{ satoshis: 1003, outputId: 14207 },
|
|
322
|
+
{ satoshis: 1001, outputId: 14208 },
|
|
323
|
+
{ satoshis: 1000, outputId: 14209 },
|
|
324
|
+
{ satoshis: 1000, outputId: 14210 },
|
|
325
|
+
{ satoshis: 1006, outputId: 14211 },
|
|
326
|
+
{ satoshis: 1020, outputId: 14212 },
|
|
327
|
+
{ satoshis: 1000, outputId: 14213 },
|
|
328
|
+
{ satoshis: 1000, outputId: 14214 },
|
|
329
|
+
{ satoshis: 1000, outputId: 14215 },
|
|
330
|
+
{ satoshis: 1000, outputId: 14216 },
|
|
331
|
+
{ satoshis: 1002, outputId: 14217 },
|
|
332
|
+
{ satoshis: 1046, outputId: 14218 },
|
|
333
|
+
{ satoshis: 1103, outputId: 14219 },
|
|
334
|
+
{ satoshis: 1001, outputId: 14221 },
|
|
335
|
+
{ satoshis: 1000, outputId: 14222 },
|
|
336
|
+
{ satoshis: 1000, outputId: 14223 },
|
|
337
|
+
{ satoshis: 1000, outputId: 14224 },
|
|
338
|
+
{ satoshis: 31311, outputId: 14321 },
|
|
339
|
+
{ satoshis: 1042, outputId: 14656 },
|
|
340
|
+
{ satoshis: 1099, outputId: 14661 },
|
|
341
|
+
{ satoshis: 1100, outputId: 14675 },
|
|
342
|
+
{ satoshis: 1019, outputId: 14676 },
|
|
343
|
+
{ satoshis: 1040, outputId: 14677 },
|
|
344
|
+
{ satoshis: 1000, outputId: 14679 },
|
|
345
|
+
{ satoshis: 1000, outputId: 14680 },
|
|
346
|
+
{ satoshis: 1001, outputId: 14681 },
|
|
347
|
+
{ satoshis: 1000, outputId: 14682 },
|
|
348
|
+
{ satoshis: 1001, outputId: 14683 },
|
|
349
|
+
{ satoshis: 1002, outputId: 14684 },
|
|
350
|
+
{ satoshis: 1005, outputId: 14685 },
|
|
351
|
+
{ satoshis: 1000, outputId: 14686 },
|
|
352
|
+
{ satoshis: 1007, outputId: 14687 },
|
|
353
|
+
{ satoshis: 1000, outputId: 14802 },
|
|
354
|
+
{ satoshis: 1069, outputId: 14803 },
|
|
355
|
+
{ satoshis: 1231, outputId: 15465 },
|
|
356
|
+
{ satoshis: 2386, outputId: 15468 },
|
|
357
|
+
{ satoshis: 1267, outputId: 15471 },
|
|
358
|
+
{ satoshis: 1283, outputId: 15472 },
|
|
359
|
+
{ satoshis: 1054, outputId: 15473 },
|
|
360
|
+
{ satoshis: 2031, outputId: 15475 },
|
|
361
|
+
{ satoshis: 1065, outputId: 15478 },
|
|
362
|
+
{ satoshis: 1268, outputId: 15479 },
|
|
363
|
+
{ satoshis: 1066, outputId: 15480 },
|
|
364
|
+
{ satoshis: 1065, outputId: 15481 },
|
|
365
|
+
{ satoshis: 1006, outputId: 15482 },
|
|
366
|
+
{ satoshis: 999799, outputId: 16338 },
|
|
367
|
+
{ satoshis: 2021, outputId: 16339 },
|
|
368
|
+
{ satoshis: 666465, outputId: 16340 },
|
|
369
|
+
{ satoshis: 5354, outputId: 16341 },
|
|
370
|
+
{ satoshis: 3132, outputId: 16342 }
|
|
371
|
+
]
|
|
372
|
+
};
|
|
373
|
+
const d6 = {
|
|
374
|
+
p: {
|
|
375
|
+
fixedInputs: [],
|
|
376
|
+
fixedOutputs: [
|
|
377
|
+
{ satoshis: 500, lockingScriptLength: 436 },
|
|
378
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
379
|
+
],
|
|
380
|
+
feeModel: { model: 'sat/kb', value: 2 },
|
|
381
|
+
changeInitialSatoshis: 1000,
|
|
382
|
+
changeFirstSatoshis: 285,
|
|
383
|
+
changeLockingScriptLength: 25,
|
|
384
|
+
changeUnlockingScriptLength: 107
|
|
385
|
+
},
|
|
386
|
+
availableChange: [
|
|
387
|
+
{ satoshis: 1040, outputId: 16345 },
|
|
388
|
+
{ satoshis: 1000, outputId: 16346 },
|
|
389
|
+
{ satoshis: 1023, outputId: 16348 },
|
|
390
|
+
{ satoshis: 1054, outputId: 16350 },
|
|
391
|
+
{ satoshis: 1118, outputId: 16353 },
|
|
392
|
+
{ satoshis: 1000, outputId: 16354 },
|
|
393
|
+
{ satoshis: 1001, outputId: 16355 },
|
|
394
|
+
{ satoshis: 1000, outputId: 16356 },
|
|
395
|
+
{ satoshis: 1005, outputId: 16360 },
|
|
396
|
+
{ satoshis: 1000, outputId: 16361 },
|
|
397
|
+
{ satoshis: 375235, outputId: 16362 },
|
|
398
|
+
{ satoshis: 1000, outputId: 16363 },
|
|
399
|
+
{ satoshis: 1000, outputId: 16364 },
|
|
400
|
+
{ satoshis: 45658, outputId: 16365 },
|
|
401
|
+
{ satoshis: 286834, outputId: 16367 },
|
|
402
|
+
{ satoshis: 1001, outputId: 16368 },
|
|
403
|
+
{ satoshis: 1001, outputId: 16369 },
|
|
404
|
+
{ satoshis: 57051, outputId: 16370 },
|
|
405
|
+
{ satoshis: 1036, outputId: 16371 },
|
|
406
|
+
{ satoshis: 16508, outputId: 16372 },
|
|
407
|
+
{ satoshis: 1000, outputId: 16373 },
|
|
408
|
+
{ satoshis: 64213, outputId: 16374 },
|
|
409
|
+
{ satoshis: 1000, outputId: 16376 },
|
|
410
|
+
{ satoshis: 1000, outputId: 16377 },
|
|
411
|
+
{ satoshis: 1154, outputId: 16378 },
|
|
412
|
+
{ satoshis: 1000, outputId: 16380 },
|
|
413
|
+
{ satoshis: 1008, outputId: 16381 },
|
|
414
|
+
{ satoshis: 1064, outputId: 16382 },
|
|
415
|
+
{ satoshis: 1234, outputId: 16383 },
|
|
416
|
+
{ satoshis: 119205, outputId: 16395 },
|
|
417
|
+
{ satoshis: 582, outputId: 16397 },
|
|
418
|
+
{ satoshis: 2384, outputId: 16399 },
|
|
419
|
+
{ satoshis: 4391, outputId: 16401 },
|
|
420
|
+
{ satoshis: 600, outputId: 16406 },
|
|
421
|
+
{ satoshis: 2599799, outputId: 16407 }
|
|
422
|
+
]
|
|
423
|
+
};
|
|
424
|
+
const d7 = {
|
|
425
|
+
p: {
|
|
426
|
+
fixedInputs: [],
|
|
427
|
+
fixedOutputs: [
|
|
428
|
+
{ satoshis: 1570, lockingScriptLength: 25 },
|
|
429
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
430
|
+
],
|
|
431
|
+
feeModel: { model: 'sat/kb', value: 2 },
|
|
432
|
+
changeInitialSatoshis: 1000,
|
|
433
|
+
changeFirstSatoshis: 285,
|
|
434
|
+
changeLockingScriptLength: 25,
|
|
435
|
+
changeUnlockingScriptLength: 107
|
|
436
|
+
},
|
|
437
|
+
availableChange: [
|
|
438
|
+
{ satoshis: 23082, outputId: 14734 },
|
|
439
|
+
{ satoshis: 16496, outputId: 14742 },
|
|
440
|
+
{ satoshis: 270789, outputId: 14744 },
|
|
441
|
+
{ satoshis: 81520, outputId: 14763 },
|
|
442
|
+
{ satoshis: 14759, outputId: 14770 },
|
|
443
|
+
{ satoshis: 390625, outputId: 14774 },
|
|
444
|
+
{ satoshis: 674234, outputId: 14790 },
|
|
445
|
+
{ satoshis: 999799, outputId: 14794 },
|
|
446
|
+
{ satoshis: 1000, outputId: 15583 },
|
|
447
|
+
{ satoshis: 1000, outputId: 15584 },
|
|
448
|
+
{ satoshis: 1000, outputId: 15585 },
|
|
449
|
+
{ satoshis: 1000, outputId: 15586 },
|
|
450
|
+
{ satoshis: 1000, outputId: 15587 },
|
|
451
|
+
{ satoshis: 1000, outputId: 15588 },
|
|
452
|
+
{ satoshis: 1025, outputId: 15589 },
|
|
453
|
+
{ satoshis: 1000, outputId: 15590 },
|
|
454
|
+
{ satoshis: 1000, outputId: 15591 },
|
|
455
|
+
{ satoshis: 1000, outputId: 15593 },
|
|
456
|
+
{ satoshis: 1000, outputId: 15594 },
|
|
457
|
+
{ satoshis: 1000, outputId: 15595 },
|
|
458
|
+
{ satoshis: 1000, outputId: 15596 },
|
|
459
|
+
{ satoshis: 1000, outputId: 15597 },
|
|
460
|
+
{ satoshis: 1316, outputId: 15598 },
|
|
461
|
+
{ satoshis: 1000, outputId: 15599 },
|
|
462
|
+
{ satoshis: 1000, outputId: 15600 },
|
|
463
|
+
{ satoshis: 1000, outputId: 15601 },
|
|
464
|
+
{ satoshis: 1426, outputId: 15602 },
|
|
465
|
+
{ satoshis: 1000, outputId: 15603 },
|
|
466
|
+
{ satoshis: 1000, outputId: 15604 },
|
|
467
|
+
{ satoshis: 1000, outputId: 15605 },
|
|
468
|
+
{ satoshis: 1000, outputId: 15606 },
|
|
469
|
+
{ satoshis: 1000, outputId: 15607 },
|
|
470
|
+
{ satoshis: 1000, outputId: 15608 },
|
|
471
|
+
{ satoshis: 1000, outputId: 15609 },
|
|
472
|
+
{ satoshis: 1004, outputId: 15610 },
|
|
473
|
+
{ satoshis: 1000, outputId: 15611 },
|
|
474
|
+
{ satoshis: 1013, outputId: 15612 },
|
|
475
|
+
{ satoshis: 1001, outputId: 15614 },
|
|
476
|
+
{ satoshis: 1000, outputId: 15615 },
|
|
477
|
+
{ satoshis: 1000, outputId: 15616 },
|
|
478
|
+
{ satoshis: 1000, outputId: 15617 },
|
|
479
|
+
{ satoshis: 1000, outputId: 15618 },
|
|
480
|
+
{ satoshis: 1000, outputId: 15619 },
|
|
481
|
+
{ satoshis: 1006, outputId: 15620 },
|
|
482
|
+
{ satoshis: 1000, outputId: 15621 },
|
|
483
|
+
{ satoshis: 1000, outputId: 15622 },
|
|
484
|
+
{ satoshis: 1000, outputId: 15623 },
|
|
485
|
+
{ satoshis: 1000, outputId: 15624 },
|
|
486
|
+
{ satoshis: 1032, outputId: 15625 },
|
|
487
|
+
{ satoshis: 4571, outputId: 15626 },
|
|
488
|
+
{ satoshis: 1000, outputId: 15628 },
|
|
489
|
+
{ satoshis: 1000, outputId: 15629 },
|
|
490
|
+
{ satoshis: 1087, outputId: 15630 },
|
|
491
|
+
{ satoshis: 1000, outputId: 15631 },
|
|
492
|
+
{ satoshis: 1000, outputId: 15632 },
|
|
493
|
+
{ satoshis: 1001, outputId: 15633 },
|
|
494
|
+
{ satoshis: 1001, outputId: 15634 },
|
|
495
|
+
{ satoshis: 1000, outputId: 15635 },
|
|
496
|
+
{ satoshis: 1000, outputId: 15637 },
|
|
497
|
+
{ satoshis: 1001, outputId: 15638 },
|
|
498
|
+
{ satoshis: 1000, outputId: 15639 },
|
|
499
|
+
{ satoshis: 1000, outputId: 15640 },
|
|
500
|
+
{ satoshis: 1000, outputId: 15641 },
|
|
501
|
+
{ satoshis: 1000, outputId: 15642 },
|
|
502
|
+
{ satoshis: 1000, outputId: 15643 },
|
|
503
|
+
{ satoshis: 1036, outputId: 15644 },
|
|
504
|
+
{ satoshis: 1000, outputId: 15645 },
|
|
505
|
+
{ satoshis: 1000, outputId: 15646 },
|
|
506
|
+
{ satoshis: 1000, outputId: 15647 },
|
|
507
|
+
{ satoshis: 1000, outputId: 15648 },
|
|
508
|
+
{ satoshis: 1001, outputId: 15649 },
|
|
509
|
+
{ satoshis: 1000, outputId: 15650 },
|
|
510
|
+
{ satoshis: 1050, outputId: 15651 },
|
|
511
|
+
{ satoshis: 1273, outputId: 15653 },
|
|
512
|
+
{ satoshis: 1029, outputId: 15654 },
|
|
513
|
+
{ satoshis: 1524, outputId: 15655 },
|
|
514
|
+
{ satoshis: 1817, outputId: 15658 },
|
|
515
|
+
{ satoshis: 1041, outputId: 16409 }
|
|
516
|
+
]
|
|
517
|
+
};
|
|
518
|
+
const d8 = {
|
|
519
|
+
p: {
|
|
520
|
+
fixedInputs: [],
|
|
521
|
+
fixedOutputs: [
|
|
522
|
+
{ satoshis: 1564, lockingScriptLength: 25 },
|
|
523
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
524
|
+
],
|
|
525
|
+
feeModel: { model: 'sat/kb', value: 2 },
|
|
526
|
+
changeInitialSatoshis: 1000,
|
|
527
|
+
changeFirstSatoshis: 285,
|
|
528
|
+
changeLockingScriptLength: 25,
|
|
529
|
+
changeUnlockingScriptLength: 107
|
|
530
|
+
},
|
|
531
|
+
availableChange: [
|
|
532
|
+
{ satoshis: 23082, outputId: 14734 },
|
|
533
|
+
{ satoshis: 16496, outputId: 14742 },
|
|
534
|
+
{ satoshis: 270789, outputId: 14744 },
|
|
535
|
+
{ satoshis: 81520, outputId: 14763 },
|
|
536
|
+
{ satoshis: 14759, outputId: 14770 },
|
|
537
|
+
{ satoshis: 390625, outputId: 14774 },
|
|
538
|
+
{ satoshis: 674234, outputId: 14790 },
|
|
539
|
+
{ satoshis: 999799, outputId: 14794 },
|
|
540
|
+
{ satoshis: 1000, outputId: 15583 },
|
|
541
|
+
{ satoshis: 1000, outputId: 15584 },
|
|
542
|
+
{ satoshis: 1000, outputId: 15585 },
|
|
543
|
+
{ satoshis: 1000, outputId: 15586 },
|
|
544
|
+
{ satoshis: 1000, outputId: 15587 },
|
|
545
|
+
{ satoshis: 1000, outputId: 15588 },
|
|
546
|
+
{ satoshis: 1025, outputId: 15589 },
|
|
547
|
+
{ satoshis: 1000, outputId: 15590 },
|
|
548
|
+
{ satoshis: 1000, outputId: 15591 },
|
|
549
|
+
{ satoshis: 1000, outputId: 15593 },
|
|
550
|
+
{ satoshis: 1000, outputId: 15594 },
|
|
551
|
+
{ satoshis: 1000, outputId: 15595 },
|
|
552
|
+
{ satoshis: 1000, outputId: 15596 },
|
|
553
|
+
{ satoshis: 1000, outputId: 15597 },
|
|
554
|
+
{ satoshis: 1316, outputId: 15598 },
|
|
555
|
+
{ satoshis: 1000, outputId: 15599 },
|
|
556
|
+
{ satoshis: 1000, outputId: 15600 },
|
|
557
|
+
{ satoshis: 1000, outputId: 15601 },
|
|
558
|
+
{ satoshis: 1426, outputId: 15602 },
|
|
559
|
+
{ satoshis: 1000, outputId: 15603 },
|
|
560
|
+
{ satoshis: 1000, outputId: 15604 },
|
|
561
|
+
{ satoshis: 1000, outputId: 15605 },
|
|
562
|
+
{ satoshis: 1000, outputId: 15606 },
|
|
563
|
+
{ satoshis: 1000, outputId: 15607 },
|
|
564
|
+
{ satoshis: 1000, outputId: 15608 },
|
|
565
|
+
{ satoshis: 1000, outputId: 15609 },
|
|
566
|
+
{ satoshis: 1004, outputId: 15610 },
|
|
567
|
+
{ satoshis: 1000, outputId: 15611 },
|
|
568
|
+
{ satoshis: 1013, outputId: 15612 },
|
|
569
|
+
{ satoshis: 1001, outputId: 15614 },
|
|
570
|
+
{ satoshis: 1000, outputId: 15615 },
|
|
571
|
+
{ satoshis: 1000, outputId: 15616 },
|
|
572
|
+
{ satoshis: 1000, outputId: 15617 },
|
|
573
|
+
{ satoshis: 1000, outputId: 15618 },
|
|
574
|
+
{ satoshis: 1000, outputId: 15619 },
|
|
575
|
+
{ satoshis: 1006, outputId: 15620 },
|
|
576
|
+
{ satoshis: 1000, outputId: 15621 },
|
|
577
|
+
{ satoshis: 1000, outputId: 15622 },
|
|
578
|
+
{ satoshis: 1000, outputId: 15623 },
|
|
579
|
+
{ satoshis: 1000, outputId: 15624 },
|
|
580
|
+
{ satoshis: 1032, outputId: 15625 },
|
|
581
|
+
{ satoshis: 4571, outputId: 15626 },
|
|
582
|
+
{ satoshis: 1000, outputId: 15628 },
|
|
583
|
+
{ satoshis: 1000, outputId: 15629 },
|
|
584
|
+
{ satoshis: 1087, outputId: 15630 },
|
|
585
|
+
{ satoshis: 1000, outputId: 15631 },
|
|
586
|
+
{ satoshis: 1000, outputId: 15632 },
|
|
587
|
+
{ satoshis: 1001, outputId: 15633 },
|
|
588
|
+
{ satoshis: 1001, outputId: 15634 },
|
|
589
|
+
{ satoshis: 1000, outputId: 15635 },
|
|
590
|
+
{ satoshis: 1000, outputId: 15637 },
|
|
591
|
+
{ satoshis: 1001, outputId: 15638 },
|
|
592
|
+
{ satoshis: 1000, outputId: 15639 },
|
|
593
|
+
{ satoshis: 1000, outputId: 15640 },
|
|
594
|
+
{ satoshis: 1000, outputId: 15641 },
|
|
595
|
+
{ satoshis: 1000, outputId: 15642 },
|
|
596
|
+
{ satoshis: 1000, outputId: 15643 },
|
|
597
|
+
{ satoshis: 1036, outputId: 15644 },
|
|
598
|
+
{ satoshis: 1000, outputId: 15645 },
|
|
599
|
+
{ satoshis: 1000, outputId: 15646 },
|
|
600
|
+
{ satoshis: 1000, outputId: 15647 },
|
|
601
|
+
{ satoshis: 1000, outputId: 15648 },
|
|
602
|
+
{ satoshis: 1001, outputId: 15649 },
|
|
603
|
+
{ satoshis: 1000, outputId: 15650 },
|
|
604
|
+
{ satoshis: 1050, outputId: 15651 },
|
|
605
|
+
{ satoshis: 1273, outputId: 15653 },
|
|
606
|
+
{ satoshis: 1029, outputId: 15654 },
|
|
607
|
+
{ satoshis: 1524, outputId: 15655 },
|
|
608
|
+
{ satoshis: 1817, outputId: 15658 },
|
|
609
|
+
{ satoshis: 1041, outputId: 16409 }
|
|
610
|
+
]
|
|
611
|
+
};
|
|
612
|
+
const d9 = {
|
|
613
|
+
p: {
|
|
614
|
+
fixedInputs: [],
|
|
615
|
+
fixedOutputs: [
|
|
616
|
+
{ satoshis: 1000, lockingScriptLength: 1136 },
|
|
617
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
618
|
+
],
|
|
619
|
+
feeModel: { model: 'sat/kb', value: 2 },
|
|
620
|
+
changeInitialSatoshis: 1000,
|
|
621
|
+
changeFirstSatoshis: 285,
|
|
622
|
+
changeLockingScriptLength: 25,
|
|
623
|
+
changeUnlockingScriptLength: 107
|
|
624
|
+
},
|
|
625
|
+
availableChange: [
|
|
626
|
+
{ satoshis: 23082, outputId: 14734 },
|
|
627
|
+
{ satoshis: 270789, outputId: 14744 },
|
|
628
|
+
{ satoshis: 81520, outputId: 14763 },
|
|
629
|
+
{ satoshis: 14759, outputId: 14770 },
|
|
630
|
+
{ satoshis: 390625, outputId: 14774 },
|
|
631
|
+
{ satoshis: 674234, outputId: 14790 },
|
|
632
|
+
{ satoshis: 999799, outputId: 14794 },
|
|
633
|
+
{ satoshis: 1000, outputId: 15583 },
|
|
634
|
+
{ satoshis: 1000, outputId: 15584 },
|
|
635
|
+
{ satoshis: 1000, outputId: 15585 },
|
|
636
|
+
{ satoshis: 1000, outputId: 15586 },
|
|
637
|
+
{ satoshis: 1000, outputId: 15587 },
|
|
638
|
+
{ satoshis: 1000, outputId: 15588 },
|
|
639
|
+
{ satoshis: 1000, outputId: 15590 },
|
|
640
|
+
{ satoshis: 1000, outputId: 15591 },
|
|
641
|
+
{ satoshis: 1000, outputId: 15593 },
|
|
642
|
+
{ satoshis: 1000, outputId: 15594 },
|
|
643
|
+
{ satoshis: 1000, outputId: 15595 },
|
|
644
|
+
{ satoshis: 1000, outputId: 15596 },
|
|
645
|
+
{ satoshis: 1000, outputId: 15597 },
|
|
646
|
+
{ satoshis: 1000, outputId: 15599 },
|
|
647
|
+
{ satoshis: 1000, outputId: 15600 },
|
|
648
|
+
{ satoshis: 1000, outputId: 15601 },
|
|
649
|
+
{ satoshis: 1000, outputId: 15603 },
|
|
650
|
+
{ satoshis: 1000, outputId: 15604 },
|
|
651
|
+
{ satoshis: 1000, outputId: 15605 },
|
|
652
|
+
{ satoshis: 1000, outputId: 15606 },
|
|
653
|
+
{ satoshis: 1000, outputId: 15607 },
|
|
654
|
+
{ satoshis: 1000, outputId: 15608 },
|
|
655
|
+
{ satoshis: 1000, outputId: 15609 },
|
|
656
|
+
{ satoshis: 1004, outputId: 15610 },
|
|
657
|
+
{ satoshis: 1000, outputId: 15611 },
|
|
658
|
+
{ satoshis: 1001, outputId: 15614 },
|
|
659
|
+
{ satoshis: 1000, outputId: 15615 },
|
|
660
|
+
{ satoshis: 1000, outputId: 15616 },
|
|
661
|
+
{ satoshis: 1000, outputId: 15617 },
|
|
662
|
+
{ satoshis: 1000, outputId: 15618 },
|
|
663
|
+
{ satoshis: 1000, outputId: 15619 },
|
|
664
|
+
{ satoshis: 1006, outputId: 15620 },
|
|
665
|
+
{ satoshis: 1000, outputId: 15621 },
|
|
666
|
+
{ satoshis: 1000, outputId: 15622 },
|
|
667
|
+
{ satoshis: 1000, outputId: 15623 },
|
|
668
|
+
{ satoshis: 1000, outputId: 15624 },
|
|
669
|
+
{ satoshis: 4571, outputId: 15626 },
|
|
670
|
+
{ satoshis: 1000, outputId: 15628 },
|
|
671
|
+
{ satoshis: 1000, outputId: 15629 },
|
|
672
|
+
{ satoshis: 1000, outputId: 15631 },
|
|
673
|
+
{ satoshis: 1000, outputId: 15632 },
|
|
674
|
+
{ satoshis: 1001, outputId: 15633 },
|
|
675
|
+
{ satoshis: 1001, outputId: 15634 },
|
|
676
|
+
{ satoshis: 1000, outputId: 15635 },
|
|
677
|
+
{ satoshis: 1000, outputId: 15637 },
|
|
678
|
+
{ satoshis: 1001, outputId: 15638 },
|
|
679
|
+
{ satoshis: 1000, outputId: 15639 },
|
|
680
|
+
{ satoshis: 1000, outputId: 15640 },
|
|
681
|
+
{ satoshis: 1000, outputId: 15641 },
|
|
682
|
+
{ satoshis: 1000, outputId: 15642 },
|
|
683
|
+
{ satoshis: 1000, outputId: 15643 },
|
|
684
|
+
{ satoshis: 1000, outputId: 15645 },
|
|
685
|
+
{ satoshis: 1000, outputId: 15646 },
|
|
686
|
+
{ satoshis: 1000, outputId: 15647 },
|
|
687
|
+
{ satoshis: 1000, outputId: 15648 },
|
|
688
|
+
{ satoshis: 1001, outputId: 15649 },
|
|
689
|
+
{ satoshis: 1000, outputId: 15650 },
|
|
690
|
+
{ satoshis: 604, outputId: 16421 },
|
|
691
|
+
{ satoshis: 958, outputId: 16429 },
|
|
692
|
+
{ satoshis: 724, outputId: 16431 },
|
|
693
|
+
{ satoshis: 413, outputId: 16433 },
|
|
694
|
+
{ satoshis: 915, outputId: 16439 },
|
|
695
|
+
{ satoshis: 842, outputId: 16441 },
|
|
696
|
+
{ satoshis: 348, outputId: 16451 },
|
|
697
|
+
{ satoshis: 339, outputId: 16453 },
|
|
698
|
+
{ satoshis: 334, outputId: 16455 },
|
|
699
|
+
{ satoshis: 331, outputId: 16457 },
|
|
700
|
+
{ satoshis: 330, outputId: 16459 },
|
|
701
|
+
{ satoshis: 327, outputId: 16461 },
|
|
702
|
+
{ satoshis: 323, outputId: 16463 },
|
|
703
|
+
{ satoshis: 311, outputId: 16465 }
|
|
704
|
+
]
|
|
705
|
+
};
|
|
706
|
+
const d10 = {
|
|
707
|
+
p: {
|
|
708
|
+
fixedInputs: [],
|
|
709
|
+
fixedOutputs: [
|
|
710
|
+
{ satoshis: 1, lockingScriptLength: 25 },
|
|
711
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
712
|
+
],
|
|
713
|
+
feeModel: { model: 'sat/kb', value: 110 },
|
|
714
|
+
changeInitialSatoshis: 1000,
|
|
715
|
+
changeFirstSatoshis: 285,
|
|
716
|
+
changeLockingScriptLength: 25,
|
|
717
|
+
changeUnlockingScriptLength: 107
|
|
718
|
+
},
|
|
719
|
+
availableChange: [
|
|
720
|
+
{ satoshis: 268076, outputId: 16671 },
|
|
721
|
+
{ satoshis: 2999799, outputId: 16677 },
|
|
722
|
+
{ satoshis: 14030, outputId: 21194 },
|
|
723
|
+
{ satoshis: 100925, outputId: 21224 }
|
|
724
|
+
]
|
|
725
|
+
};
|
|
726
|
+
const d11 = {
|
|
727
|
+
p: {
|
|
728
|
+
fixedInputs: [],
|
|
729
|
+
fixedOutputs: [
|
|
730
|
+
{ satoshis: 1, lockingScriptLength: 25 },
|
|
731
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
732
|
+
],
|
|
733
|
+
feeModel: { model: 'sat/kb', value: 110 },
|
|
734
|
+
changeInitialSatoshis: 1000,
|
|
735
|
+
changeFirstSatoshis: 285,
|
|
736
|
+
changeLockingScriptLength: 25,
|
|
737
|
+
changeUnlockingScriptLength: 107
|
|
738
|
+
},
|
|
739
|
+
availableChange: [
|
|
740
|
+
{ satoshis: 268076, outputId: 16671 },
|
|
741
|
+
{ satoshis: 2999799, outputId: 16677 },
|
|
742
|
+
{ satoshis: 1396, outputId: 21307 },
|
|
743
|
+
{ satoshis: 1023, outputId: 21308 },
|
|
744
|
+
{ satoshis: 1000, outputId: 21309 },
|
|
745
|
+
{ satoshis: 1000, outputId: 21310 },
|
|
746
|
+
{ satoshis: 1000, outputId: 21311 },
|
|
747
|
+
{ satoshis: 1220, outputId: 21312 },
|
|
748
|
+
{ satoshis: 5573, outputId: 21313 },
|
|
749
|
+
{ satoshis: 1000, outputId: 21314 },
|
|
750
|
+
{ satoshis: 1000, outputId: 21315 },
|
|
751
|
+
{ satoshis: 5926, outputId: 21316 },
|
|
752
|
+
{ satoshis: 30814, outputId: 21317 },
|
|
753
|
+
{ satoshis: 24441, outputId: 21318 },
|
|
754
|
+
{ satoshis: 285, outputId: 21319 },
|
|
755
|
+
{ satoshis: 1325, outputId: 21320 },
|
|
756
|
+
{ satoshis: 1000, outputId: 21321 },
|
|
757
|
+
{ satoshis: 1002, outputId: 21322 },
|
|
758
|
+
{ satoshis: 1000, outputId: 21324 },
|
|
759
|
+
{ satoshis: 1057, outputId: 21325 },
|
|
760
|
+
{ satoshis: 1000, outputId: 21326 },
|
|
761
|
+
{ satoshis: 1159, outputId: 21327 },
|
|
762
|
+
{ satoshis: 1061, outputId: 21328 },
|
|
763
|
+
{ satoshis: 1000, outputId: 21329 },
|
|
764
|
+
{ satoshis: 1000, outputId: 21330 },
|
|
765
|
+
{ satoshis: 1000, outputId: 21331 },
|
|
766
|
+
{ satoshis: 8873, outputId: 21332 },
|
|
767
|
+
{ satoshis: 1001, outputId: 21333 },
|
|
768
|
+
{ satoshis: 1011, outputId: 21334 },
|
|
769
|
+
{ satoshis: 1000, outputId: 21335 },
|
|
770
|
+
{ satoshis: 13699, outputId: 21336 }
|
|
771
|
+
]
|
|
772
|
+
};
|
|
773
|
+
const d12 = {
|
|
774
|
+
p: {
|
|
775
|
+
fixedInputs: [],
|
|
776
|
+
fixedOutputs: [
|
|
777
|
+
{ satoshis: 1, lockingScriptLength: 25 },
|
|
778
|
+
{ satoshis: 200, lockingScriptLength: 25 }
|
|
779
|
+
],
|
|
780
|
+
feeModel: { model: 'sat/kb', value: 110 },
|
|
781
|
+
changeInitialSatoshis: 1000,
|
|
782
|
+
changeFirstSatoshis: 285,
|
|
783
|
+
changeLockingScriptLength: 25,
|
|
784
|
+
changeUnlockingScriptLength: 107
|
|
785
|
+
},
|
|
786
|
+
availableChange: [
|
|
787
|
+
{ satoshis: 268076, outputId: 16671 },
|
|
788
|
+
{ satoshis: 2999799, outputId: 16677 },
|
|
789
|
+
{ satoshis: 14030, outputId: 21194 },
|
|
790
|
+
{ satoshis: 100925, outputId: 21224 }
|
|
791
|
+
]
|
|
792
|
+
};
|
|
793
|
+
const d13 = {
|
|
794
|
+
p: {
|
|
795
|
+
fixedInputs: [],
|
|
796
|
+
fixedOutputs: [
|
|
797
|
+
{ satoshis: 500, lockingScriptLength: 194 },
|
|
798
|
+
{ satoshis: 2, lockingScriptLength: 25 }
|
|
799
|
+
],
|
|
800
|
+
feeModel: { model: 'sat/kb', value: 2 },
|
|
801
|
+
changeInitialSatoshis: 1000,
|
|
802
|
+
changeFirstSatoshis: 285,
|
|
803
|
+
changeLockingScriptLength: 25,
|
|
804
|
+
changeUnlockingScriptLength: 107
|
|
805
|
+
},
|
|
806
|
+
availableChange: [
|
|
807
|
+
{ satoshis: 285, outputId: 16190 },
|
|
808
|
+
{ satoshis: 1012, outputId: 18487 },
|
|
809
|
+
{ satoshis: 1013, outputId: 18488 },
|
|
810
|
+
{ satoshis: 1000, outputId: 18489 },
|
|
811
|
+
{ satoshis: 1087, outputId: 18490 },
|
|
812
|
+
{ satoshis: 290, outputId: 18491 },
|
|
813
|
+
{ satoshis: 1034, outputId: 18492 }
|
|
814
|
+
]
|
|
815
|
+
};
|
|
816
|
+
test('8 paramsText d5 d6 d7 d8 d9 d10 d11 d12 d13', async () => {
|
|
817
|
+
for (const { n, d, er } of [
|
|
818
|
+
{
|
|
819
|
+
n: 13,
|
|
820
|
+
d: d13,
|
|
821
|
+
er: '{"allocatedChangeInputs":[{"satoshis":1000,"outputId":18489,"spendable":false}],"changeOutputs":[{"satoshis":497,"lockingScriptLength":25}],"size":429,"fee":1,"satsPerKb":2}'
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
n: 12,
|
|
825
|
+
d: d12,
|
|
826
|
+
er: '{"allocatedChangeInputs":[{"satoshis":14030,"outputId":21194,"spendable":false}],"changeOutputs":[{"satoshis":13800,"lockingScriptLength":25}],"size":260,"fee":29,"satsPerKb":110}'
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
n: 11,
|
|
830
|
+
d: d11,
|
|
831
|
+
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}'
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
n: 10,
|
|
835
|
+
d: d10,
|
|
836
|
+
er: '{"allocatedChangeInputs":[{"satoshis":14030,"outputId":21194,"spendable":false}],"changeOutputs":[{"satoshis":13800,"lockingScriptLength":25}],"size":260,"fee":29,"satsPerKb":110}'
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
n: 9,
|
|
840
|
+
d: d9,
|
|
841
|
+
er: '{"allocatedChangeInputs":[{"satoshis":4571,"outputId":15626,"spendable":false}],"changeOutputs":[{"satoshis":3368,"lockingScriptLength":25}],"size":1373,"fee":3,"satsPerKb":2}'
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
n: 8,
|
|
845
|
+
d: d8,
|
|
846
|
+
er: '{"allocatedChangeInputs":[{"satoshis":1817,"outputId":15658,"spendable":false}],"changeOutputs":[{"satoshis":52,"lockingScriptLength":25}],"size":260,"fee":1,"satsPerKb":2}'
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
n: 7,
|
|
850
|
+
d: d7,
|
|
851
|
+
er: '{"allocatedChangeInputs":[{"satoshis":1817,"outputId":15658,"spendable":false}],"changeOutputs":[{"satoshis":46,"lockingScriptLength":25}],"size":260,"fee":1,"satsPerKb":2}'
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
n: 6,
|
|
855
|
+
d: d6,
|
|
856
|
+
er: '{"allocatedChangeInputs":[{"satoshis":1000,"outputId":16346,"spendable":false}],"changeOutputs":[{"satoshis":298,"lockingScriptLength":25}],"size":673,"fee":2,"satsPerKb":2}'
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
n: 5,
|
|
860
|
+
d: d5,
|
|
861
|
+
er: '{"allocatedChangeInputs":[],"changeOutputs":[{"satoshis":799,"lockingScriptLength":25}],"size":191,"fee":1,"satsPerKb":2}'
|
|
862
|
+
}
|
|
863
|
+
]) {
|
|
864
|
+
const params = { ...d.p };
|
|
865
|
+
const availableChange = [
|
|
866
|
+
...d.availableChange
|
|
867
|
+
];
|
|
868
|
+
const { allocateChangeInput, releaseChangeInput } = (0, generateChange_1.generateChangeSdkMakeStorage)(availableChange);
|
|
869
|
+
const r = await (0, generateChange_1.generateChangeSdk)(params, allocateChangeInput, releaseChangeInput);
|
|
870
|
+
expect(JSON.stringify(r)).toBe(er);
|
|
871
|
+
expectTransactionSize(params, r);
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
});
|
|
875
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
876
|
+
async function expectToThrowWERR(expectedClass, fn) {
|
|
877
|
+
try {
|
|
878
|
+
await fn();
|
|
879
|
+
}
|
|
880
|
+
catch (eu) {
|
|
881
|
+
const e = index_client_1.sdk.WalletError.fromUnknown(eu);
|
|
882
|
+
expect(e.name).toBe(expectedClass.name);
|
|
883
|
+
expect(e.isError).toBe(true);
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
throw new Error(`${expectedClass.name} was not thrown`);
|
|
887
|
+
}
|
|
888
|
+
function makeTransaction(params, results) {
|
|
889
|
+
const tx = new sdk_1.Transaction();
|
|
890
|
+
for (const i of params.fixedInputs) {
|
|
891
|
+
tx.inputs.push({
|
|
892
|
+
unlockingScript: sdk_1.Script.fromBinary(Array(i.unlockingScriptLength).fill(0)),
|
|
893
|
+
sourceOutputIndex: 0,
|
|
894
|
+
sourceTXID: '00'.repeat(32)
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
for (const i of results.allocatedChangeInputs) {
|
|
898
|
+
tx.inputs.push({
|
|
899
|
+
unlockingScript: sdk_1.Script.fromBinary(Array(params.changeUnlockingScriptLength).fill(0)),
|
|
900
|
+
sourceOutputIndex: 0,
|
|
901
|
+
sourceTXID: '00'.repeat(32)
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
for (const o of params.fixedOutputs) {
|
|
905
|
+
tx.outputs.push({
|
|
906
|
+
lockingScript: sdk_1.Script.fromBinary(Array(o.lockingScriptLength).fill(0)),
|
|
907
|
+
satoshis: o.satoshis
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
for (const o of results.changeOutputs) {
|
|
911
|
+
tx.outputs.push({
|
|
912
|
+
lockingScript: sdk_1.Script.fromBinary(Array(o.lockingScriptLength).fill(0)),
|
|
913
|
+
satoshis: o.satoshis
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
return tx;
|
|
917
|
+
}
|
|
918
|
+
function expectTransactionSize(params, results) {
|
|
919
|
+
const tx = makeTransaction(params, results);
|
|
920
|
+
const size = tx.toBinary().length;
|
|
921
|
+
if (size !== results.size)
|
|
922
|
+
throw new index_client_1.sdk.WERR_INTERNAL(`expectTransaction actual ${size} expected ${results.size}`);
|
|
923
|
+
}
|
|
924
|
+
const defParams = {
|
|
925
|
+
fixedInputs: [],
|
|
926
|
+
fixedOutputs: [],
|
|
927
|
+
feeModel: { model: 'sat/kb', value: 2 },
|
|
928
|
+
changeInitialSatoshis: 1000,
|
|
929
|
+
changeFirstSatoshis: 285,
|
|
930
|
+
changeLockingScriptLength: 25,
|
|
931
|
+
changeUnlockingScriptLength: 107,
|
|
932
|
+
randomVals: [...randomValsUsed1_1.randomValsUsed1]
|
|
933
|
+
};
|
|
934
|
+
const _defAvailableChange = [
|
|
935
|
+
{ satoshis: 6323, outputId: 15005 },
|
|
936
|
+
{ satoshis: 1004, outputId: 15011 },
|
|
937
|
+
{ satoshis: 1000, outputId: 15013 },
|
|
938
|
+
{ satoshis: 1000, outputId: 15017 },
|
|
939
|
+
{ satoshis: 1000, outputId: 15023 },
|
|
940
|
+
{ satoshis: 1000, outputId: 15027 },
|
|
941
|
+
{ satoshis: 1000, outputId: 15034 },
|
|
942
|
+
{ satoshis: 1575097, outputId: 15101 },
|
|
943
|
+
{ satoshis: 16417, outputId: 15103 },
|
|
944
|
+
{ satoshis: 3377, outputId: 15104 },
|
|
945
|
+
{ satoshis: 10735, outputId: 15106 }
|
|
946
|
+
];
|
|
947
|
+
const defAvailableChange = () => JSON.parse(JSON.stringify(_defAvailableChange));
|
|
948
|
+
//# sourceMappingURL=generateChangeSdk.test.js.map
|