@bsv/wallet-toolbox 1.1.60 → 1.1.62
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/.prettierrc +1 -1
- package/docs/client.md +39 -5
- package/docs/services.md +1 -0
- package/docs/setup.md +9 -26
- package/docs/storage.md +35 -0
- package/docs/wallet.md +39 -5
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js +6 -16
- package/out/src/Setup.js.map +1 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +4 -11
- package/out/src/Wallet.js.map +1 -1
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +1 -3
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +2 -10
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskClock.js +1 -1
- package/out/src/monitor/tasks/TaskClock.js.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js +1 -2
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.js +1 -2
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.js +1 -2
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
- package/out/src/sdk/CertOps.d.ts.map +1 -1
- package/out/src/sdk/CertOps.js +4 -12
- package/out/src/sdk/CertOps.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WERR_errors.d.ts.map +1 -1
- package/out/src/sdk/WERR_errors.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +1 -4
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts +2 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/sdk/__test/CertificateLifeCycle.test.js +1 -3
- package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +1 -1
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js +13 -26
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js.map +1 -1
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +2 -10
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/sdk/validationHelpers.d.ts.map +1 -1
- package/out/src/sdk/validationHelpers.js +5 -12
- package/out/src/sdk/validationHelpers.js.map +1 -1
- package/out/src/services/Services.d.ts +1 -0
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +29 -38
- package/out/src/services/Services.js.map +1 -1
- package/out/src/services/__tests/ARC.test.js +9 -0
- package/out/src/services/__tests/ARC.test.js.map +1 -1
- package/out/src/services/__tests/bitrails.test.js.map +1 -1
- package/out/src/services/__tests/getMerklePath.test.js.map +1 -1
- package/out/src/services/__tests/getRawTx.test.js.map +1 -1
- package/out/src/services/__tests/verifyBeef.test.js +2 -1
- package/out/src/services/__tests/verifyBeef.test.js.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +1 -3
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
- package/out/src/services/providers/ARC.d.ts.map +1 -1
- package/out/src/services/providers/ARC.js +2 -3
- package/out/src/services/providers/ARC.js.map +1 -1
- package/out/src/services/providers/Bitails.d.ts.map +1 -1
- package/out/src/services/providers/Bitails.js +62 -134
- package/out/src/services/providers/Bitails.js.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
- package/out/src/services/providers/WhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/WhatsOnChain.js +6 -21
- package/out/src/services/providers/WhatsOnChain.js.map +1 -1
- package/out/src/services/providers/__tests/WhatsOnChain.test.js +1 -2
- package/out/src/services/providers/__tests/WhatsOnChain.test.js.map +1 -1
- package/out/src/services/providers/echangeRates.d.ts.map +1 -1
- package/out/src/services/providers/echangeRates.js.map +1 -1
- package/out/src/signer/WalletSigner.d.ts.map +1 -1
- package/out/src/signer/WalletSigner.js.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.js +1 -3
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.js +3 -11
- package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
- package/out/src/signer/methods/createAction.d.ts.map +1 -1
- package/out/src/signer/methods/createAction.js +3 -10
- package/out/src/signer/methods/createAction.js.map +1 -1
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/signer/methods/internalizeAction.js.map +1 -1
- package/out/src/signer/methods/proveCertificate.d.ts.map +1 -1
- package/out/src/signer/methods/proveCertificate.js.map +1 -1
- package/out/src/signer/methods/signAction.d.ts.map +1 -1
- package/out/src/signer/methods/signAction.js +2 -7
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +15 -44
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +9 -34
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.d.ts.map +1 -1
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +5 -10
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/__test/WalletStorageManager.test.js +2 -8
- package/out/src/storage/__test/WalletStorageManager.test.js.map +1 -1
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js +10 -30
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js.map +1 -1
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.d.ts.map +1 -1
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js +17 -28
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +6 -20
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +4 -9
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.d.ts.map +1 -1
- package/out/src/storage/methods/generateChange.js +7 -18
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +1 -3
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
- package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -1
- package/out/src/storage/methods/getSyncChunk.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +2 -9
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActions.d.ts.map +1 -1
- package/out/src/storage/methods/listActions.js +3 -15
- package/out/src/storage/methods/listActions.js.map +1 -1
- package/out/src/storage/methods/listCertificates.d.ts.map +1 -1
- package/out/src/storage/methods/listCertificates.js.map +1 -1
- package/out/src/storage/methods/listOutputs.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputs.js +5 -12
- package/out/src/storage/methods/listOutputs.js.map +1 -1
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +4 -10
- package/out/src/storage/methods/processAction.js.map +1 -1
- package/out/src/storage/methods/purgeData.d.ts.map +1 -1
- package/out/src/storage/methods/purgeData.js +8 -32
- package/out/src/storage/methods/purgeData.js.map +1 -1
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +1 -3
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClient.js +15 -41
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +2 -5
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +24 -130
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Certificate.js +1 -1
- package/out/src/storage/schema/entities/Certificate.js.map +1 -1
- package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/entities/CertificateField.js +2 -5
- package/out/src/storage/schema/entities/CertificateField.js.map +1 -1
- package/out/src/storage/schema/entities/Commission.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Commission.js +2 -5
- package/out/src/storage/schema/entities/Commission.js.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.js.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.js +14 -9
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -1
- package/out/src/storage/schema/entities/Output.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Output.js +8 -25
- package/out/src/storage/schema/entities/Output.js.map +1 -1
- package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputBasket.js +1 -1
- package/out/src/storage/schema/entities/OutputBasket.js.map +1 -1
- package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputTag.js +1 -1
- package/out/src/storage/schema/entities/OutputTag.js.map +1 -1
- package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputTagMap.js +3 -7
- package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -1
- package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/entities/ProvenTx.js +10 -20
- package/out/src/storage/schema/entities/ProvenTx.js.map +1 -1
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/entities/ProvenTxReq.js +8 -18
- package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -1
- package/out/src/storage/schema/entities/SyncState.d.ts +1 -0
- package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -1
- package/out/src/storage/schema/entities/SyncState.js +41 -6
- package/out/src/storage/schema/entities/SyncState.js.map +1 -1
- package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Transaction.js +4 -13
- package/out/src/storage/schema/entities/Transaction.js.map +1 -1
- package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/entities/TxLabel.js +1 -1
- package/out/src/storage/schema/entities/TxLabel.js.map +1 -1
- package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/TxLabelMap.js +3 -9
- package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -1
- package/out/src/storage/schema/entities/User.d.ts.map +1 -1
- package/out/src/storage/schema/entities/User.js +3 -5
- package/out/src/storage/schema/entities/User.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +1 -2
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +2 -2
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +1 -1
- package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.js +1 -3
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.js +1 -2
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/stampLog.d.ts.map +1 -1
- package/out/src/utility/stampLog.js.map +1 -1
- package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -1
- package/out/src/utility/tscProofToMerklePath.js.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -1
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +1 -3
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/test/Wallet/StorageClient/storageClient.man.test.js.map +1 -1
- package/out/test/Wallet/action/internalizeAction.a.test.js.map +1 -1
- package/out/test/Wallet/certificate/acquireCertificate.test.js.map +1 -1
- package/out/test/Wallet/certificate/listCertificates.test.js.map +1 -1
- package/out/test/Wallet/get/getHeaderForHeight.test.js +2 -6
- package/out/test/Wallet/get/getHeaderForHeight.test.js.map +1 -1
- package/out/test/Wallet/get/getHeight.test.js.map +1 -1
- package/out/test/Wallet/get/getKnownTxids.test.js.map +1 -1
- package/out/test/Wallet/get/getNetwork.test.js.map +1 -1
- package/out/test/Wallet/get/getVersion.test.js.map +1 -1
- package/out/test/Wallet/live/walletLive.man.test.d.ts.map +1 -1
- package/out/test/Wallet/live/walletLive.man.test.js +3 -9
- package/out/test/Wallet/live/walletLive.man.test.js.map +1 -1
- package/out/test/Wallet/local/localWallet.man.test.d.ts.map +1 -1
- package/out/test/Wallet/local/localWallet.man.test.js +39 -31
- package/out/test/Wallet/local/localWallet.man.test.js.map +1 -1
- package/out/test/Wallet/specOps/specOps.man.test.js +1 -4
- package/out/test/Wallet/specOps/specOps.man.test.js.map +1 -1
- package/out/test/Wallet/support/janitor.man.test.js.map +1 -1
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js.map +1 -1
- package/out/test/Wallet/sync/setActive.test.js +73 -50
- package/out/test/Wallet/sync/setActive.test.js.map +1 -1
- package/out/test/checkDB.d.ts.map +1 -1
- package/out/test/checkDB.js.map +1 -1
- package/out/test/examples/backup.man.test.d.ts.map +1 -1
- package/out/test/examples/backup.man.test.js.map +1 -1
- package/out/test/examples/pushdrop.test.d.ts.map +1 -1
- package/out/test/examples/pushdrop.test.js +5 -4
- package/out/test/examples/pushdrop.test.js.map +1 -1
- package/out/test/monitor/Monitor.test.js.map +1 -1
- package/out/test/services/Services.test.js.map +1 -1
- package/out/test/storage/KnexMigrations.test.js.map +1 -1
- package/out/test/storage/StorageMySQLDojoReader.man.test.js +1 -3
- package/out/test/storage/StorageMySQLDojoReader.man.test.js.map +1 -1
- package/out/test/storage/count.test.js.map +1 -1
- package/out/test/storage/find.test.js +5 -10
- package/out/test/storage/find.test.js.map +1 -1
- package/out/test/storage/findLegacy.test.js.map +1 -1
- package/out/test/storage/insert.test.js.map +1 -1
- package/out/test/storage/update.test.js +7 -19
- package/out/test/storage/update.test.js.map +1 -1
- package/out/test/storage/update2.test.js +22 -24
- package/out/test/storage/update2.test.js.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts +3 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.js +52 -76
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
- package/out/test/wallet/action/abortAction.test.js.map +1 -1
- package/out/test/wallet/action/createAction.test.js +1 -2
- package/out/test/wallet/action/createAction.test.js.map +1 -1
- package/out/test/wallet/action/createAction2.test.d.ts.map +1 -1
- package/out/test/wallet/action/createAction2.test.js +6 -16
- package/out/test/wallet/action/createAction2.test.js.map +1 -1
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js.map +1 -1
- package/out/test/wallet/action/internalizeAction.test.js.map +1 -1
- package/out/test/wallet/action/relinquishOutput.test.js.map +1 -1
- package/out/test/wallet/list/listActions.test.js.map +1 -1
- package/out/test/wallet/list/listActions2.test.js.map +1 -1
- package/out/test/wallet/list/listCertificates.test.js +2 -6
- package/out/test/wallet/list/listCertificates.test.js.map +1 -1
- package/out/test/wallet/list/listOutputs.test.js +2 -10
- package/out/test/wallet/list/listOutputs.test.js.map +1 -1
- package/out/test/wallet/sync/Wallet.sync.test.js +4 -6
- package/out/test/wallet/sync/Wallet.sync.test.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Setup.ts +15 -52
- package/src/Wallet.ts +58 -161
- package/src/monitor/Monitor.ts +7 -22
- package/src/monitor/MonitorDaemon.ts +6 -23
- package/src/monitor/tasks/TaskCheckForProofs.ts +4 -23
- package/src/monitor/tasks/TaskClock.ts +1 -3
- package/src/monitor/tasks/TaskFailAbandoned.ts +1 -3
- package/src/monitor/tasks/TaskNewHeader.ts +1 -4
- package/src/monitor/tasks/TaskPurge.ts +1 -2
- package/src/monitor/tasks/TaskReviewStatus.ts +1 -3
- package/src/monitor/tasks/TaskSendWaiting.ts +3 -10
- package/src/sdk/CertOps.ts +31 -103
- package/src/sdk/PrivilegedKeyManager.ts +18 -48
- package/src/sdk/WERR_errors.ts +6 -25
- package/src/sdk/WalletError.ts +5 -21
- package/src/sdk/WalletServices.interfaces.ts +11 -33
- package/src/sdk/WalletStorage.interfaces.ts +25 -91
- package/src/sdk/__test/CertificateLifeCycle.test.ts +9 -27
- package/src/sdk/__test/PrivilegedKeyManager.test.ts +29 -66
- package/src/sdk/types.ts +6 -26
- package/src/sdk/validationHelpers.ts +111 -402
- package/src/services/Services.ts +51 -114
- package/src/services/__tests/ARC.test.ts +14 -1
- package/src/services/__tests/bitrails.test.ts +4 -15
- package/src/services/__tests/getMerklePath.test.ts +1 -2
- package/src/services/__tests/getRawTx.test.ts +1 -3
- package/src/services/__tests/verifyBeef.test.ts +2 -1
- package/src/services/chaintracker/ChaintracksChainTracker.ts +3 -13
- package/src/services/chaintracker/chaintracks/BlockHeaderApi.ts +4 -12
- package/src/services/chaintracker/chaintracks/ChaintracksServiceClient.ts +9 -27
- package/src/services/createDefaultWalletServicesOptions.ts +2 -5
- package/src/services/processingErrors/arcSuccessError.json +76 -0
- package/src/services/providers/ARC.ts +6 -25
- package/src/services/providers/Bitails.ts +61 -159
- package/src/services/providers/SdkWhatsOnChain.ts +4 -17
- package/src/services/providers/WhatsOnChain.ts +31 -100
- package/src/services/providers/__tests/WhatsOnChain.test.ts +5 -15
- package/src/services/providers/echangeRates.ts +7 -22
- package/src/signer/WalletSigner.ts +1 -5
- package/src/signer/methods/acquireDirectCertificate.ts +1 -4
- package/src/signer/methods/buildSignableTransaction.ts +5 -20
- package/src/signer/methods/createAction.ts +15 -54
- package/src/signer/methods/internalizeAction.ts +10 -39
- package/src/signer/methods/proveCertificate.ts +2 -5
- package/src/signer/methods/signAction.ts +9 -39
- package/src/storage/StorageKnex.ts +166 -499
- package/src/storage/StorageProvider.ts +75 -291
- package/src/storage/StorageReader.ts +20 -65
- package/src/storage/StorageReaderWriter.ts +67 -264
- package/src/storage/StorageSyncReader.ts +2 -5
- package/src/storage/WalletStorageManager.ts +33 -108
- package/src/storage/__test/WalletStorageManager.test.ts +6 -23
- package/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.ts +53 -171
- package/src/storage/methods/__test/GenerateChange/randomValsUsed1.ts +17 -28
- package/src/storage/methods/attemptToPostReqsToNetwork.ts +9 -37
- package/src/storage/methods/createAction.ts +45 -181
- package/src/storage/methods/generateChange.ts +33 -114
- package/src/storage/methods/getBeefForTransaction.ts +7 -37
- package/src/storage/methods/getSyncChunk.ts +18 -69
- package/src/storage/methods/internalizeAction.ts +18 -70
- package/src/storage/methods/listActions.ts +6 -23
- package/src/storage/methods/listCertificates.ts +5 -14
- package/src/storage/methods/listOutputs.ts +15 -69
- package/src/storage/methods/processAction.ts +29 -104
- package/src/storage/methods/purgeData.ts +11 -45
- package/src/storage/methods/reviewStatus.ts +3 -9
- package/src/storage/remoting/StorageClient.ts +43 -146
- package/src/storage/remoting/StorageServer.ts +21 -59
- package/src/storage/schema/KnexMigrations.ts +34 -165
- package/src/storage/schema/entities/Certificate.ts +3 -14
- package/src/storage/schema/entities/CertificateField.ts +6 -28
- package/src/storage/schema/entities/Commission.ts +6 -23
- package/src/storage/schema/entities/EntityBase.ts +1 -6
- package/src/storage/schema/entities/MergeEntity.ts +14 -21
- package/src/storage/schema/entities/Output.ts +10 -39
- package/src/storage/schema/entities/OutputBasket.ts +4 -16
- package/src/storage/schema/entities/OutputTag.ts +4 -17
- package/src/storage/schema/entities/OutputTagMap.ts +7 -30
- package/src/storage/schema/entities/ProvenTx.ts +16 -57
- package/src/storage/schema/entities/ProvenTxReq.ts +29 -93
- package/src/storage/schema/entities/SyncState.ts +64 -116
- package/src/storage/schema/entities/Transaction.ts +10 -35
- package/src/storage/schema/entities/TxLabel.ts +4 -17
- package/src/storage/schema/entities/TxLabelMap.ts +6 -28
- package/src/storage/schema/entities/User.ts +8 -31
- package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +23 -54
- package/src/storage/schema/entities/__tests/CertificateTests.test.ts +26 -59
- package/src/storage/schema/entities/__tests/CommissionTests.test.ts +2 -11
- package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +2 -10
- package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +2 -10
- package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +1 -4
- package/src/storage/schema/entities/__tests/OutputTests.test.ts +3 -14
- package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +4 -16
- package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +5 -18
- package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +5 -26
- package/src/storage/schema/entities/__tests/TransactionTests.test.ts +12 -48
- package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +4 -22
- package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +2 -10
- package/src/storage/schema/entities/__tests/stampLogTests.test.ts +3 -10
- package/src/storage/schema/entities/__tests/usersTests.test.ts +4 -7
- package/src/storage/schema/tables/TableSettings.ts +1 -3
- package/src/storage/sync/StorageMySQLDojoReader.ts +47 -148
- package/src/utility/ScriptTemplateBRC29.ts +2 -11
- package/src/utility/stampLog.ts +2 -6
- package/src/utility/tscProofToMerklePath.ts +1 -4
- package/src/utility/utilityHelpers.buffer.ts +3 -12
- package/src/utility/utilityHelpers.ts +14 -49
- package/test/Wallet/StorageClient/storageClient.man.test.ts +2 -8
- package/test/Wallet/action/internalizeAction.a.test.ts +8 -23
- package/test/Wallet/certificate/acquireCertificate.test.ts +10 -24
- package/test/Wallet/certificate/listCertificates.test.ts +8 -18
- package/test/Wallet/get/getHeaderForHeight.test.ts +4 -15
- package/test/Wallet/get/getHeight.test.ts +2 -6
- package/test/Wallet/get/getKnownTxids.test.ts +1 -5
- package/test/Wallet/get/getNetwork.test.ts +1 -2
- package/test/Wallet/get/getVersion.test.ts +1 -2
- package/test/Wallet/live/walletLive.man.test.ts +14 -41
- package/test/Wallet/local/localWallet.man.test.ts +45 -102
- package/test/Wallet/specOps/specOps.man.test.ts +4 -13
- package/test/Wallet/support/janitor.man.test.ts +2 -7
- package/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.ts +11 -34
- package/test/Wallet/sync/setActive.test.ts +75 -61
- package/test/checkDB.ts +2 -8
- package/test/examples/backup.man.test.ts +2 -9
- package/test/examples/pushdrop.test.ts +7 -20
- package/test/monitor/Monitor.test.ts +33 -87
- package/test/services/Services.test.ts +8 -19
- package/test/storage/KnexMigrations.test.ts +3 -18
- package/test/storage/StorageMySQLDojoReader.man.test.ts +4 -15
- package/test/storage/count.test.ts +7 -24
- package/test/storage/find.test.ts +7 -29
- package/test/storage/findLegacy.test.ts +2 -5
- package/test/storage/insert.test.ts +3 -19
- package/test/storage/update.test.ts +47 -179
- package/test/storage/update2.test.ts +54 -176
- package/test/utils/TestUtilsWalletStorage.ts +139 -372
- package/test/wallet/action/abortAction.test.ts +4 -12
- package/test/wallet/action/createAction.test.ts +4 -14
- package/test/wallet/action/createAction2.test.ts +74 -208
- package/test/wallet/action/createActionToGenerateBeefs.man.test.ts +8 -11
- package/test/wallet/action/internalizeAction.test.ts +20 -72
- package/test/wallet/action/relinquishOutput.test.ts +3 -9
- package/test/wallet/list/listActions.test.ts +2 -9
- package/test/wallet/list/listActions2.test.ts +8 -34
- package/test/wallet/list/listCertificates.test.ts +5 -16
- package/test/wallet/list/listOutputs.test.ts +15 -54
- package/test/wallet/sync/Wallet.sync.test.ts +18 -49
package/src/services/Services.ts
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
Beef,
|
|
4
|
-
ChainTracker,
|
|
5
|
-
Utils
|
|
6
|
-
} from '@bsv/sdk'
|
|
7
|
-
import {
|
|
8
|
-
asArray,
|
|
9
|
-
asString,
|
|
10
|
-
doubleSha256BE,
|
|
11
|
-
sdk,
|
|
12
|
-
sha256Hash,
|
|
13
|
-
wait
|
|
14
|
-
} from '../index.client'
|
|
1
|
+
import { Transaction as BsvTransaction, Beef, ChainTracker, Utils } from '@bsv/sdk'
|
|
2
|
+
import { asArray, asString, doubleSha256BE, sdk, sha256Hash, wait } from '../index.client'
|
|
15
3
|
import { ServiceCollection } from './ServiceCollection'
|
|
16
4
|
import { createDefaultWalletServicesOptions } from './createDefaultWalletServicesOptions'
|
|
17
5
|
import { ChaintracksChainTracker } from './chaintracker'
|
|
18
6
|
import { WhatsOnChain } from './providers/WhatsOnChain'
|
|
19
|
-
import {
|
|
20
|
-
updateChaintracksFiatExchangeRates,
|
|
21
|
-
updateExchangeratesapi
|
|
22
|
-
} from './providers/echangeRates'
|
|
7
|
+
import { updateChaintracksFiatExchangeRates, updateExchangeratesapi } from './providers/echangeRates'
|
|
23
8
|
import { ARC } from './providers/ARC'
|
|
24
9
|
import { Bitails } from './providers/Bitails'
|
|
25
10
|
|
|
@@ -42,82 +27,57 @@ export class Services implements sdk.WalletServices {
|
|
|
42
27
|
chain: sdk.Chain
|
|
43
28
|
|
|
44
29
|
constructor(optionsOrChain: sdk.Chain | sdk.WalletServicesOptions) {
|
|
45
|
-
this.chain =
|
|
46
|
-
typeof optionsOrChain === 'string' ? optionsOrChain : optionsOrChain.chain
|
|
30
|
+
this.chain = typeof optionsOrChain === 'string' ? optionsOrChain : optionsOrChain.chain
|
|
47
31
|
|
|
48
|
-
this.options =
|
|
49
|
-
typeof optionsOrChain === 'string'
|
|
50
|
-
? Services.createDefaultOptions(this.chain)
|
|
51
|
-
: optionsOrChain
|
|
32
|
+
this.options = typeof optionsOrChain === 'string' ? Services.createDefaultOptions(this.chain) : optionsOrChain
|
|
52
33
|
|
|
53
|
-
this.whatsonchain = new WhatsOnChain(this.chain, {
|
|
54
|
-
apiKey: this.options.taalApiKey
|
|
55
|
-
})
|
|
34
|
+
this.whatsonchain = new WhatsOnChain(this.chain, { apiKey: this.options.whatsOnChainApiKey })
|
|
56
35
|
|
|
57
36
|
this.arc = new ARC(this.options.arcUrl, this.options.arcConfig)
|
|
58
37
|
|
|
59
38
|
this.bitails = new Bitails(this.chain)
|
|
60
39
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})
|
|
40
|
+
//prettier-ignore
|
|
41
|
+
this.getMerklePathServices = new ServiceCollection<sdk.GetMerklePathService>()
|
|
42
|
+
//.add({ name: 'WhatsOnChain', service: this.whatsonchain.getMerklePath.bind(this.whatsonchain) })
|
|
43
|
+
.add({ name: 'Bitails', service: this.bitails.getMerklePath.bind(this.bitails) })
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
service: this.whatsonchain.getRawTxResult.bind(this.whatsonchain)
|
|
70
|
-
})
|
|
45
|
+
//prettier-ignore
|
|
46
|
+
this.getRawTxServices = new ServiceCollection<sdk.GetRawTxService>()
|
|
47
|
+
.add({ name: 'WhatsOnChain', service: this.whatsonchain.getRawTxResult.bind(this.whatsonchain) })
|
|
71
48
|
|
|
49
|
+
//prettier-ignore
|
|
72
50
|
this.postBeefServices = new ServiceCollection<sdk.PostBeefService>()
|
|
73
51
|
.add({ name: 'TaalArcBeef', service: this.arc.postBeef.bind(this.arc) })
|
|
74
|
-
.add({
|
|
75
|
-
|
|
76
|
-
service: this.whatsonchain.postBeef.bind(this.whatsonchain)
|
|
77
|
-
})
|
|
78
|
-
//.add({ name: 'Bitails', service: this.bitails.postBeef.bind(this.bitails) })
|
|
52
|
+
.add({ name: 'WhatsOnChain', service: this.whatsonchain.postBeef.bind(this.whatsonchain) })
|
|
53
|
+
.add({ name: 'Bitails', service: this.bitails.postBeef.bind(this.bitails) })
|
|
79
54
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
service: this.whatsonchain.getUtxoStatus.bind(this.whatsonchain)
|
|
84
|
-
})
|
|
55
|
+
//prettier-ignore
|
|
56
|
+
this.getUtxoStatusServices = new ServiceCollection<sdk.GetUtxoStatusService>()
|
|
57
|
+
.add({ name: 'WhatsOnChain', service: this.whatsonchain.getUtxoStatus.bind(this.whatsonchain) })
|
|
85
58
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
service: updateChaintracksFiatExchangeRates
|
|
91
|
-
})
|
|
92
|
-
.add({ name: 'exchangeratesapi', service: updateExchangeratesapi })
|
|
59
|
+
//prettier-ignore
|
|
60
|
+
this.updateFiatExchangeRateServices = new ServiceCollection<sdk.UpdateFiatExchangeRateService>()
|
|
61
|
+
.add({ name: 'ChaintracksService', service: updateChaintracksFiatExchangeRates })
|
|
62
|
+
.add({ name: 'exchangeratesapi', service: updateExchangeratesapi })
|
|
93
63
|
}
|
|
94
64
|
|
|
95
65
|
async getChainTracker(): Promise<ChainTracker> {
|
|
96
66
|
if (!this.options.chaintracks)
|
|
97
|
-
throw new sdk.WERR_INVALID_PARAMETER(
|
|
98
|
-
'options.chaintracks',
|
|
99
|
-
`valid to enable 'getChainTracker' service.`
|
|
100
|
-
)
|
|
67
|
+
throw new sdk.WERR_INVALID_PARAMETER('options.chaintracks', `valid to enable 'getChainTracker' service.`)
|
|
101
68
|
return new ChaintracksChainTracker(this.chain, this.options.chaintracks)
|
|
102
69
|
}
|
|
103
70
|
|
|
104
71
|
async getBsvExchangeRate(): Promise<number> {
|
|
105
|
-
this.options.bsvExchangeRate =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
72
|
+
this.options.bsvExchangeRate = await this.whatsonchain.updateBsvExchangeRate(
|
|
73
|
+
this.options.bsvExchangeRate,
|
|
74
|
+
this.options.bsvUpdateMsecs
|
|
75
|
+
)
|
|
110
76
|
return this.options.bsvExchangeRate.rate
|
|
111
77
|
}
|
|
112
78
|
|
|
113
|
-
async getFiatExchangeRate(
|
|
114
|
-
|
|
115
|
-
base?: 'USD' | 'GBP' | 'EUR'
|
|
116
|
-
): Promise<number> {
|
|
117
|
-
const rates = await this.updateFiatExchangeRates(
|
|
118
|
-
this.options.fiatExchangeRates,
|
|
119
|
-
this.options.fiatUpdateMsecs
|
|
120
|
-
)
|
|
79
|
+
async getFiatExchangeRate(currency: 'USD' | 'GBP' | 'EUR', base?: 'USD' | 'GBP' | 'EUR'): Promise<number> {
|
|
80
|
+
const rates = await this.updateFiatExchangeRates(this.options.fiatExchangeRates, this.options.fiatUpdateMsecs)
|
|
121
81
|
|
|
122
82
|
this.options.fiatExchangeRates = rates
|
|
123
83
|
|
|
@@ -171,6 +131,8 @@ export class Services implements sdk.WalletServices {
|
|
|
171
131
|
return r0
|
|
172
132
|
}
|
|
173
133
|
|
|
134
|
+
postBeefCount = 0
|
|
135
|
+
|
|
174
136
|
/**
|
|
175
137
|
*
|
|
176
138
|
* @param beef
|
|
@@ -178,8 +140,14 @@ export class Services implements sdk.WalletServices {
|
|
|
178
140
|
* @returns
|
|
179
141
|
*/
|
|
180
142
|
async postBeef(beef: Beef, txids: string[]): Promise<sdk.PostBeefResult[]> {
|
|
143
|
+
this.postBeefCount++
|
|
144
|
+
const services = [...this.postBeefServices.allServices]
|
|
145
|
+
for (let i = this.postBeefCount % services.length; i > 0; i--) {
|
|
146
|
+
// roll the array of services so the providers aren't always called in the same order.
|
|
147
|
+
services.unshift(services.pop()!)
|
|
148
|
+
}
|
|
181
149
|
let rs = await Promise.all(
|
|
182
|
-
|
|
150
|
+
services.map(async service => {
|
|
183
151
|
const r = await service(beef, txids)
|
|
184
152
|
return r
|
|
185
153
|
})
|
|
@@ -205,9 +173,7 @@ export class Services implements sdk.WalletServices {
|
|
|
205
173
|
r0.error = undefined
|
|
206
174
|
break
|
|
207
175
|
}
|
|
208
|
-
r.error = new sdk.WERR_INTERNAL(
|
|
209
|
-
`computed txid ${hash} doesn't match requested value ${txid}`
|
|
210
|
-
)
|
|
176
|
+
r.error = new sdk.WERR_INTERNAL(`computed txid ${hash} doesn't match requested value ${txid}`)
|
|
211
177
|
r.rawTx = undefined
|
|
212
178
|
}
|
|
213
179
|
if (r.error && !r0.error && !r0.rawTx)
|
|
@@ -221,10 +187,7 @@ export class Services implements sdk.WalletServices {
|
|
|
221
187
|
|
|
222
188
|
async invokeChaintracksWithRetry<R>(method: () => Promise<R>): Promise<R> {
|
|
223
189
|
if (!this.options.chaintracks)
|
|
224
|
-
throw new sdk.WERR_INVALID_PARAMETER(
|
|
225
|
-
'options.chaintracks',
|
|
226
|
-
'valid for this service operation.'
|
|
227
|
-
)
|
|
190
|
+
throw new sdk.WERR_INVALID_PARAMETER('options.chaintracks', 'valid for this service operation.')
|
|
228
191
|
for (let retry = 0; retry < 3; retry++) {
|
|
229
192
|
try {
|
|
230
193
|
const r: R = await method()
|
|
@@ -240,11 +203,7 @@ export class Services implements sdk.WalletServices {
|
|
|
240
203
|
async getHeaderForHeight(height: number): Promise<number[]> {
|
|
241
204
|
const method = async () => {
|
|
242
205
|
const header = await this.options.chaintracks!.findHeaderForHeight(height)
|
|
243
|
-
if (!header)
|
|
244
|
-
throw new sdk.WERR_INVALID_PARAMETER(
|
|
245
|
-
'hash',
|
|
246
|
-
`valid height '${height}' on mined chain ${this.chain}`
|
|
247
|
-
)
|
|
206
|
+
if (!header) throw new sdk.WERR_INVALID_PARAMETER('hash', `valid height '${height}' on mined chain ${this.chain}`)
|
|
248
207
|
return toBinaryBaseBlockHeader(header)
|
|
249
208
|
}
|
|
250
209
|
return this.invokeChaintracksWithRetry(method)
|
|
@@ -259,22 +218,15 @@ export class Services implements sdk.WalletServices {
|
|
|
259
218
|
|
|
260
219
|
async hashToHeader(hash: string): Promise<sdk.BlockHeader> {
|
|
261
220
|
const method = async () => {
|
|
262
|
-
const header =
|
|
263
|
-
await this.options.chaintracks!.findHeaderForBlockHash(hash)
|
|
221
|
+
const header = await this.options.chaintracks!.findHeaderForBlockHash(hash)
|
|
264
222
|
if (!header)
|
|
265
|
-
throw new sdk.WERR_INVALID_PARAMETER(
|
|
266
|
-
'hash',
|
|
267
|
-
`valid blockhash '${hash}' on mined chain ${this.chain}`
|
|
268
|
-
)
|
|
223
|
+
throw new sdk.WERR_INVALID_PARAMETER('hash', `valid blockhash '${hash}' on mined chain ${this.chain}`)
|
|
269
224
|
return header
|
|
270
225
|
}
|
|
271
226
|
return this.invokeChaintracksWithRetry(method)
|
|
272
227
|
}
|
|
273
228
|
|
|
274
|
-
async getMerklePath(
|
|
275
|
-
txid: string,
|
|
276
|
-
useNext?: boolean
|
|
277
|
-
): Promise<sdk.GetMerklePathResult> {
|
|
229
|
+
async getMerklePath(txid: string, useNext?: boolean): Promise<sdk.GetMerklePathResult> {
|
|
278
230
|
if (useNext) this.getMerklePathServices.next()
|
|
279
231
|
|
|
280
232
|
const r0: sdk.GetMerklePathResult = { notes: [] }
|
|
@@ -303,10 +255,7 @@ export class Services implements sdk.WalletServices {
|
|
|
303
255
|
|
|
304
256
|
targetCurrencies = ['USD', 'GBP', 'EUR']
|
|
305
257
|
|
|
306
|
-
async updateFiatExchangeRates(
|
|
307
|
-
rates?: sdk.FiatExchangeRates,
|
|
308
|
-
updateMsecs?: number
|
|
309
|
-
): Promise<sdk.FiatExchangeRates> {
|
|
258
|
+
async updateFiatExchangeRates(rates?: sdk.FiatExchangeRates, updateMsecs?: number): Promise<sdk.FiatExchangeRates> {
|
|
310
259
|
updateMsecs ||= 1000 * 60 * 15
|
|
311
260
|
const freshnessDate = new Date(Date.now() - updateMsecs)
|
|
312
261
|
if (rates) {
|
|
@@ -330,9 +279,7 @@ export class Services implements sdk.WalletServices {
|
|
|
330
279
|
}
|
|
331
280
|
} catch (eu: unknown) {
|
|
332
281
|
const e = sdk.WalletError.fromUnknown(eu)
|
|
333
|
-
console.error(
|
|
334
|
-
`updateFiatExchangeRates servcice name ${service.name} error ${e.message}`
|
|
335
|
-
)
|
|
282
|
+
console.error(`updateFiatExchangeRates servcice name ${service.name} error ${e.message}`)
|
|
336
283
|
}
|
|
337
284
|
services.next()
|
|
338
285
|
}
|
|
@@ -346,9 +293,7 @@ export class Services implements sdk.WalletServices {
|
|
|
346
293
|
return r0
|
|
347
294
|
}
|
|
348
295
|
|
|
349
|
-
async nLockTimeIsFinal(
|
|
350
|
-
tx: string | number[] | BsvTransaction | number
|
|
351
|
-
): Promise<boolean> {
|
|
296
|
+
async nLockTimeIsFinal(tx: string | number[] | BsvTransaction | number): Promise<boolean> {
|
|
352
297
|
const MAXINT = 0xffffffff
|
|
353
298
|
const BLOCK_LIMIT = 500000000
|
|
354
299
|
|
|
@@ -368,9 +313,7 @@ export class Services implements sdk.WalletServices {
|
|
|
368
313
|
}
|
|
369
314
|
nLockTime = tx.lockTime
|
|
370
315
|
} else {
|
|
371
|
-
throw new sdk.WERR_INTERNAL(
|
|
372
|
-
'Should be either @bsv/sdk Transaction or babbage-bsv Transaction'
|
|
373
|
-
)
|
|
316
|
+
throw new sdk.WERR_INTERNAL('Should be either @bsv/sdk Transaction or babbage-bsv Transaction')
|
|
374
317
|
}
|
|
375
318
|
}
|
|
376
319
|
|
|
@@ -384,10 +327,7 @@ export class Services implements sdk.WalletServices {
|
|
|
384
327
|
}
|
|
385
328
|
}
|
|
386
329
|
|
|
387
|
-
export function validateScriptHash(
|
|
388
|
-
output: string,
|
|
389
|
-
outputFormat?: sdk.GetUtxoStatusOutputFormat
|
|
390
|
-
): string {
|
|
330
|
+
export function validateScriptHash(output: string, outputFormat?: sdk.GetUtxoStatusOutputFormat): string {
|
|
391
331
|
let b = asArray(output)
|
|
392
332
|
if (!outputFormat) {
|
|
393
333
|
if (b.length === 32) outputFormat = 'hashLE'
|
|
@@ -403,10 +343,7 @@ export function validateScriptHash(
|
|
|
403
343
|
b = sha256Hash(b).reverse()
|
|
404
344
|
break
|
|
405
345
|
default:
|
|
406
|
-
throw new sdk.WERR_INVALID_PARAMETER(
|
|
407
|
-
'outputFormat',
|
|
408
|
-
`not be ${outputFormat}`
|
|
409
|
-
)
|
|
346
|
+
throw new sdk.WERR_INVALID_PARAMETER('outputFormat', `not be ${outputFormat}`)
|
|
410
347
|
}
|
|
411
348
|
return asString(b)
|
|
412
349
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _tu } from '../../../test/utils/TestUtilsWalletStorage'
|
|
2
2
|
import { sdk, wait } from '../../index.client'
|
|
3
3
|
import { ARC } from '../providers/ARC'
|
|
4
|
-
import { BeefTx } from '@bsv/sdk'
|
|
4
|
+
import { Beef, BeefTx } from '@bsv/sdk'
|
|
5
5
|
import { arcDefaultUrl } from '../createDefaultWalletServicesOptions'
|
|
6
6
|
import { Setup } from '../../index.all'
|
|
7
7
|
|
|
@@ -18,6 +18,16 @@ describe('ARC tests', () => {
|
|
|
18
18
|
apiKey: envMain.taalApiKey
|
|
19
19
|
})
|
|
20
20
|
|
|
21
|
+
test.skip('0 double spend', async () => {
|
|
22
|
+
const arc = arcTest
|
|
23
|
+
|
|
24
|
+
const beef = Beef.fromString(testnetDoubleSpendBeef)
|
|
25
|
+
const txids = [beef.txs.slice(-1)[0].txid]
|
|
26
|
+
const r = await arc.postBeef(beef, txids)
|
|
27
|
+
expect(r.status === 'error').toBe(true)
|
|
28
|
+
expect(r.txidResults[0].doubleSpend).toBe(true)
|
|
29
|
+
})
|
|
30
|
+
|
|
21
31
|
test.skip('7 postRawTx testnet', async () => {
|
|
22
32
|
await postRawTxTest('test', arcTest)
|
|
23
33
|
})
|
|
@@ -108,3 +118,6 @@ async function postRawTxTest(chain: sdk.Chain, arc: ARC): Promise<void> {
|
|
|
108
118
|
expect(rDouble.doubleSpend).toBe(true)
|
|
109
119
|
expect(rDouble.competingTxs![0]).toBe(c.txidUndo)
|
|
110
120
|
}
|
|
121
|
+
|
|
122
|
+
const testnetDoubleSpendBeef =
|
|
123
|
+
'0100beef01fe65631900020200009df812619ae232d2363d91516ab3e811211192933526bbc2aee71b54ccb236d10102462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a361801010076a3297928f6841bcb656e91225540e87c65f67d8ec12bc768d7656eb7561b3d02010000000159617a9d17562f7c9765e5dfa6a9a393aa2809ca6166a3d7a31c09efcc5070141f0000006a47304402200a528145a67ba1879b88a093cb711f79f04413a81d5678f314302e36a7f59e43022010bc4bb3c2574052c50bbdc8a05c31fb39e69280656b34f5dc22e2ceadc3bb4a412102fd4200bf389d16479b3d06f97fee0752f2c3b9dc29fb3ddce2b327d851b8902bffffffff0204000000000000001976a9140df1a69c834bb7d9bb5b2b7d6a34e5a401db3e1688ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac0000000001000100000001462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a3618000000006a47304402204183bbfdcf11d50907b91f5e70ea8f81228501ce84e24af75c8d984682d094dc022029caa8f7e5acb4990bbeafee523a3c4a99b78e98b9e5c41349147b099679d4ae412103b76389eea6494c2c30443cba9d59b9dba05fb04e467bc94272629615b87a429fffffffff0202000000000000001976a91476d851e59fcb4ee0ebe6947496db3a393b08e49c88ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac0000000000'
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
convertProofToMerklePath,
|
|
3
|
-
sdk,
|
|
4
|
-
Services,
|
|
5
|
-
TscMerkleProofApi
|
|
6
|
-
} from '../../index.client'
|
|
1
|
+
import { convertProofToMerklePath, sdk, Services, TscMerkleProofApi } from '../../index.client'
|
|
7
2
|
import { Bitails, BitailsMerkleProof } from '../providers/Bitails'
|
|
8
3
|
|
|
9
4
|
describe('bitrails tests', () => {
|
|
10
5
|
jest.setTimeout(99999999)
|
|
11
6
|
|
|
12
7
|
test('0 verify merkle proof to merkle path', async () => {
|
|
13
|
-
const mp = convertProofToMerklePath(
|
|
14
|
-
|
|
15
|
-
proof2
|
|
16
|
-
)
|
|
17
|
-
const root = mp.computeRoot(
|
|
18
|
-
'068f2ce0d01b5f1e7c7a07c209c3c67d583aeae83e11e92801b51c36f81d6b67'
|
|
19
|
-
)
|
|
8
|
+
const mp = convertProofToMerklePath('068f2ce0d01b5f1e7c7a07c209c3c67d583aeae83e11e92801b51c36f81d6b67', proof2)
|
|
9
|
+
const root = mp.computeRoot('068f2ce0d01b5f1e7c7a07c209c3c67d583aeae83e11e92801b51c36f81d6b67')
|
|
20
10
|
expect(root).toBe(proof2merkleRoot)
|
|
21
11
|
})
|
|
22
12
|
|
|
@@ -37,8 +27,7 @@ describe('bitrails tests', () => {
|
|
|
37
27
|
})
|
|
38
28
|
})
|
|
39
29
|
|
|
40
|
-
const proof2merkleRoot =
|
|
41
|
-
'22b294aac4c3f6f4fdae30dc4f46f68f90feb94f03531c32bcf2ce33be5d4cb0'
|
|
30
|
+
const proof2merkleRoot = '22b294aac4c3f6f4fdae30dc4f46f68f90feb94f03531c32bcf2ce33be5d4cb0'
|
|
42
31
|
|
|
43
32
|
const proof2: TscMerkleProofApi = {
|
|
44
33
|
index: 9443,
|
|
@@ -7,8 +7,7 @@ describe('getRawTx service tests', () => {
|
|
|
7
7
|
const options = Services.createDefaultOptions('main')
|
|
8
8
|
const services = new Services(options)
|
|
9
9
|
|
|
10
|
-
const txid =
|
|
11
|
-
'9cce99686bc8621db439b7150dd5b3b269e4b0628fd75160222c417d6f2b95e4'
|
|
10
|
+
const txid = '9cce99686bc8621db439b7150dd5b3b269e4b0628fd75160222c417d6f2b95e4'
|
|
12
11
|
const r = await services.getMerklePath(txid)
|
|
13
12
|
expect(r.header?.height).toBe(877599)
|
|
14
13
|
expect(r.merklePath).toBeTruthy()
|
|
@@ -7,9 +7,7 @@ describe('getRawTx service tests', () => {
|
|
|
7
7
|
const options = Services.createDefaultOptions('test')
|
|
8
8
|
const services = new Services(options)
|
|
9
9
|
|
|
10
|
-
const r = await services.getRawTx(
|
|
11
|
-
'c3b6ee8b83a4261771ede9b0d2590d2f65853239ee34f84cdda36524ce317d76'
|
|
12
|
-
)
|
|
10
|
+
const r = await services.getRawTx('c3b6ee8b83a4261771ede9b0d2590d2f65853239ee34f84cdda36524ce317d76')
|
|
13
11
|
expect(r).toBeTruthy()
|
|
14
12
|
})
|
|
15
13
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Beef } from '@bsv/sdk'
|
|
2
2
|
import { Services } from '../Services'
|
|
3
|
+
import { logger } from '../../../test/utils/TestUtilsWalletStorage'
|
|
3
4
|
|
|
4
5
|
describe('verifyBeef tests', () => {
|
|
5
6
|
jest.setTimeout(99999999)
|
|
@@ -10,7 +11,7 @@ describe('verifyBeef tests', () => {
|
|
|
10
11
|
const beef = Beef.fromString(bhex)
|
|
11
12
|
const chaintracker = await new Services('main').getChainTracker()
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
logger(beef.toLogString())
|
|
14
15
|
|
|
15
16
|
const ok = await beef.verify(chaintracker, true)
|
|
16
17
|
expect(ok)
|
|
@@ -12,18 +12,11 @@ export class ChaintracksChainTracker implements ChainTracker {
|
|
|
12
12
|
cache: Record<number, string>
|
|
13
13
|
options: ChaintracksChainTrackerOptions
|
|
14
14
|
|
|
15
|
-
constructor(
|
|
16
|
-
chain?: sdk.Chain,
|
|
17
|
-
chaintracks?: ChaintracksServiceClient,
|
|
18
|
-
options?: ChaintracksChainTrackerOptions
|
|
19
|
-
) {
|
|
15
|
+
constructor(chain?: sdk.Chain, chaintracks?: ChaintracksServiceClient, options?: ChaintracksChainTrackerOptions) {
|
|
20
16
|
chain ||= 'main'
|
|
21
17
|
this.chaintracks =
|
|
22
18
|
chaintracks ??
|
|
23
|
-
new ChaintracksServiceClient(
|
|
24
|
-
chain,
|
|
25
|
-
`https://npm-registry.babbage.systems:808${chain === 'main' ? '4' : '3'}`
|
|
26
|
-
)
|
|
19
|
+
new ChaintracksServiceClient(chain, `https://npm-registry.babbage.systems:808${chain === 'main' ? '4' : '3'}`)
|
|
27
20
|
this.cache = {}
|
|
28
21
|
this.options = options || {}
|
|
29
22
|
}
|
|
@@ -62,10 +55,7 @@ export class ChaintracksChainTracker implements ChainTracker {
|
|
|
62
55
|
}
|
|
63
56
|
}
|
|
64
57
|
|
|
65
|
-
if (!header)
|
|
66
|
-
throw new sdk.WERR_INTERNAL(
|
|
67
|
-
'no header should have returned false or thrown an error.'
|
|
68
|
-
)
|
|
58
|
+
if (!header) throw new sdk.WERR_INTERNAL('no header should have returned false or thrown an error.')
|
|
69
59
|
|
|
70
60
|
this.cache[height] = header.merkleRoot
|
|
71
61
|
|
|
@@ -86,9 +86,7 @@ export interface LiveBlockHeader extends BlockHeader {
|
|
|
86
86
|
* Type guard function.
|
|
87
87
|
* @publicbody
|
|
88
88
|
*/
|
|
89
|
-
export function isLive(
|
|
90
|
-
header: BlockHeader | LiveBlockHeader
|
|
91
|
-
): header is LiveBlockHeader {
|
|
89
|
+
export function isLive(header: BlockHeader | LiveBlockHeader): header is LiveBlockHeader {
|
|
92
90
|
return (header as LiveBlockHeader).headerId !== undefined
|
|
93
91
|
}
|
|
94
92
|
|
|
@@ -96,9 +94,7 @@ export function isLive(
|
|
|
96
94
|
* Type guard function.
|
|
97
95
|
* @publicbody
|
|
98
96
|
*/
|
|
99
|
-
export function isBaseBlockHeader(
|
|
100
|
-
header: BaseBlockHeader | BlockHeader | LiveBlockHeader
|
|
101
|
-
): header is BaseBlockHeader {
|
|
97
|
+
export function isBaseBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is BaseBlockHeader {
|
|
102
98
|
return typeof header.previousHash === 'string'
|
|
103
99
|
}
|
|
104
100
|
|
|
@@ -106,9 +102,7 @@ export function isBaseBlockHeader(
|
|
|
106
102
|
* Type guard function.
|
|
107
103
|
* @publicbody
|
|
108
104
|
*/
|
|
109
|
-
export function isBlockHeader(
|
|
110
|
-
header: BaseBlockHeader | BlockHeader | LiveBlockHeader
|
|
111
|
-
): header is LiveBlockHeader {
|
|
105
|
+
export function isBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader {
|
|
112
106
|
return 'height' in header && typeof header.previousHash === 'string'
|
|
113
107
|
}
|
|
114
108
|
|
|
@@ -116,8 +110,6 @@ export function isBlockHeader(
|
|
|
116
110
|
* Type guard function.
|
|
117
111
|
* @publicbody
|
|
118
112
|
*/
|
|
119
|
-
export function isLiveBlockHeader(
|
|
120
|
-
header: BaseBlockHeader | BlockHeader | LiveBlockHeader
|
|
121
|
-
): header is LiveBlockHeader {
|
|
113
|
+
export function isLiveBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader {
|
|
122
114
|
return 'chainwork' in header && typeof header.previousHash === 'string'
|
|
123
115
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import { asString, sdk } from '../../../index.client'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
BaseBlockHeader,
|
|
6
|
-
BlockHeader,
|
|
7
|
-
isBaseBlockHeader
|
|
8
|
-
} from './BlockHeaderApi'
|
|
4
|
+
import { BaseBlockHeader, BlockHeader, isBaseBlockHeader } from './BlockHeaderApi'
|
|
9
5
|
|
|
10
6
|
interface FetchStatus<T> {
|
|
11
7
|
status: 'success' | 'error'
|
|
@@ -37,9 +33,7 @@ export class ChaintracksServiceClient {
|
|
|
37
33
|
public serviceUrl: string,
|
|
38
34
|
options?: ChaintracksServiceClientOptions
|
|
39
35
|
) {
|
|
40
|
-
this.options =
|
|
41
|
-
options ||
|
|
42
|
-
ChaintracksServiceClient.createChaintracksServiceClientOptions()
|
|
36
|
+
this.options = options || ChaintracksServiceClient.createChaintracksServiceClientOptions()
|
|
43
37
|
}
|
|
44
38
|
|
|
45
39
|
async currentHeight(): Promise<number> {
|
|
@@ -71,8 +65,7 @@ export class ChaintracksServiceClient {
|
|
|
71
65
|
|
|
72
66
|
async getJson<T>(path: string): Promise<T> {
|
|
73
67
|
const r = await this.getJsonOrUndefined<T>(path)
|
|
74
|
-
if (r === undefined)
|
|
75
|
-
throw new Error('Value was undefined. Requested object may not exist.')
|
|
68
|
+
if (r === undefined) throw new Error('Value was undefined. Requested object may not exist.')
|
|
76
69
|
return r
|
|
77
70
|
}
|
|
78
71
|
|
|
@@ -135,26 +128,15 @@ export class ChaintracksServiceClient {
|
|
|
135
128
|
return await this.getJson(`/getHeaders?height=${height}&count=${count}`)
|
|
136
129
|
}
|
|
137
130
|
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined> {
|
|
138
|
-
return await this.getJsonOrUndefined(
|
|
139
|
-
`/findHeaderHexForHeight?height=${height}`
|
|
140
|
-
)
|
|
131
|
+
return await this.getJsonOrUndefined(`/findHeaderHexForHeight?height=${height}`)
|
|
141
132
|
}
|
|
142
133
|
async findChainWorkForBlockHash(hash: string): Promise<string | undefined> {
|
|
143
|
-
return await this.getJsonOrUndefined(
|
|
144
|
-
`/findChainWorkHexForBlockHash?hash=${asString(hash)}`
|
|
145
|
-
)
|
|
134
|
+
return await this.getJsonOrUndefined(`/findChainWorkHexForBlockHash?hash=${asString(hash)}`)
|
|
146
135
|
}
|
|
147
136
|
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined> {
|
|
148
|
-
return await this.getJsonOrUndefined(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
async findHeaderForMerkleRoot(
|
|
153
|
-
merkleRoot: string,
|
|
154
|
-
height?: number
|
|
155
|
-
): Promise<BlockHeader | undefined> {
|
|
156
|
-
return await this.getJsonOrUndefined(
|
|
157
|
-
`/findHeaderHexForMerkleRoot?root=${asString(merkleRoot)}&height=${height}`
|
|
158
|
-
)
|
|
137
|
+
return await this.getJsonOrUndefined(`/findHeaderHexForBlockHash?hash=${asString(hash)}`)
|
|
138
|
+
}
|
|
139
|
+
async findHeaderForMerkleRoot(merkleRoot: string, height?: number): Promise<BlockHeader | undefined> {
|
|
140
|
+
return await this.getJsonOrUndefined(`/findHeaderHexForMerkleRoot?root=${asString(merkleRoot)}&height=${height}`)
|
|
159
141
|
}
|
|
160
142
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { randomBytesHex, sdk } from '../index.client'
|
|
2
2
|
import { ChaintracksServiceClient } from './chaintracker'
|
|
3
3
|
|
|
4
|
-
export function createDefaultWalletServicesOptions(
|
|
5
|
-
chain: sdk.Chain
|
|
6
|
-
): sdk.WalletServicesOptions {
|
|
4
|
+
export function createDefaultWalletServicesOptions(chain: sdk.Chain): sdk.WalletServicesOptions {
|
|
7
5
|
const taalApiKey =
|
|
8
6
|
chain === 'main'
|
|
9
7
|
? 'mainnet_9596de07e92300c6287e4393594ae39c' // no plan
|
|
@@ -45,7 +43,6 @@ export function createDefaultWalletServicesOptions(
|
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
export function arcDefaultUrl(chain: sdk.Chain): string {
|
|
48
|
-
const url =
|
|
49
|
-
chain === 'main' ? 'https://api.taal.com/arc' : 'https://arc-test.taal.com'
|
|
46
|
+
const url = chain === 'main' ? 'https://api.taal.com/arc' : 'https://arc-test.taal.com'
|
|
50
47
|
return url
|
|
51
48
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"notes": [
|
|
3
|
+
{
|
|
4
|
+
"what": "status",
|
|
5
|
+
"status_was": "unknown",
|
|
6
|
+
"status_now": "unsent",
|
|
7
|
+
"when": "2025-03-07T20:34:13.168Z"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "BitailsPostBeef",
|
|
11
|
+
"when": "2025-03-07T20:34:25.565Z",
|
|
12
|
+
"what": "postBeef"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "ARCpostBeef",
|
|
16
|
+
"when": "2025-03-07T20:34:25.568Z",
|
|
17
|
+
"what": "postBeefV2ToV1"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "BitailsPostBeef",
|
|
21
|
+
"when": "2025-03-07T20:34:26.070Z",
|
|
22
|
+
"beef": "0100beef01fe65631900020200009df812619ae232d2363d91516ab3e811211192933526bbc2aee71b54ccb236d10102462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a361801010076a3297928f6841bcb656e91225540e87c65f67d8ec12bc768d7656eb7561b3d02010000000159617a9d17562f7c9765e5dfa6a9a393aa2809ca6166a3d7a31c09efcc5070141f0000006a47304402200a528145a67ba1879b88a093cb711f79f04413a81d5678f314302e36a7f59e43022010bc4bb3c2574052c50bbdc8a05c31fb39e69280656b34f5dc22e2ceadc3bb4a412102fd4200bf389d16479b3d06f97fee0752f2c3b9dc29fb3ddce2b327d851b8902bffffffff0204000000000000001976a9140df1a69c834bb7d9bb5b2b7d6a34e5a401db3e1688ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac0000000001000100000001462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a3618000000006a47304402204183bbfdcf11d50907b91f5e70ea8f81228501ce84e24af75c8d984682d094dc022029caa8f7e5acb4990bbeafee523a3c4a99b78e98b9e5c41349147b099679d4ae412103b76389eea6494c2c30443cba9d59b9dba05fb04e467bc94272629615b87a429fffffffff0202000000000000001976a91476d851e59fcb4ee0ebe6947496db3a393b08e49c88ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac0000000000",
|
|
23
|
+
"txids": "f71d25fccb76f619ee2604cd9b5a684f31389a482f6f1bb0bfb2a07610c7681d",
|
|
24
|
+
"what": "postBeefError"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "BitailsPostRawTx",
|
|
28
|
+
"when": "2025-03-07T20:34:26.070Z",
|
|
29
|
+
"raws": "0100000001462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a3618000000006a47304402204183bbfdcf11d50907b91f5e70ea8f81228501ce84e24af75c8d984682d094dc022029caa8f7e5acb4990bbeafee523a3c4a99b78e98b9e5c41349147b099679d4ae412103b76389eea6494c2c30443cba9d59b9dba05fb04e467bc94272629615b87a429fffffffff0202000000000000001976a91476d851e59fcb4ee0ebe6947496db3a393b08e49c88ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac00000000",
|
|
30
|
+
"txids": "f71d25fccb76f619ee2604cd9b5a684f31389a482f6f1bb0bfb2a07610c7681d",
|
|
31
|
+
"url": "https://test-api.bitails.io/tx/broadcast/multi",
|
|
32
|
+
"what": "postRawsError",
|
|
33
|
+
"txid": "f71d25fccb76f619ee2604cd9b5a684f31389a482f6f1bb0bfb2a07610c7681d",
|
|
34
|
+
"code": -25,
|
|
35
|
+
"message": "missing-inputs"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "WoCpostBeef",
|
|
39
|
+
"when": "2025-03-07T20:34:26.086Z",
|
|
40
|
+
"beef": "0100beef01fe65631900020200009df812619ae232d2363d91516ab3e811211192933526bbc2aee71b54ccb236d10102462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a361801010076a3297928f6841bcb656e91225540e87c65f67d8ec12bc768d7656eb7561b3d02010000000159617a9d17562f7c9765e5dfa6a9a393aa2809ca6166a3d7a31c09efcc5070141f0000006a47304402200a528145a67ba1879b88a093cb711f79f04413a81d5678f314302e36a7f59e43022010bc4bb3c2574052c50bbdc8a05c31fb39e69280656b34f5dc22e2ceadc3bb4a412102fd4200bf389d16479b3d06f97fee0752f2c3b9dc29fb3ddce2b327d851b8902bffffffff0204000000000000001976a9140df1a69c834bb7d9bb5b2b7d6a34e5a401db3e1688ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac0000000001000100000001462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a3618000000006a47304402204183bbfdcf11d50907b91f5e70ea8f81228501ce84e24af75c8d984682d094dc022029caa8f7e5acb4990bbeafee523a3c4a99b78e98b9e5c41349147b099679d4ae412103b76389eea6494c2c30443cba9d59b9dba05fb04e467bc94272629615b87a429fffffffff0202000000000000001976a91476d851e59fcb4ee0ebe6947496db3a393b08e49c88ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac0000000000",
|
|
41
|
+
"txids": "f71d25fccb76f619ee2604cd9b5a684f31389a482f6f1bb0bfb2a07610c7681d",
|
|
42
|
+
"what": "postBeefError"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "WoCpostRawTx",
|
|
46
|
+
"when": "2025-03-07T20:34:26.086Z",
|
|
47
|
+
"rawTx": "0100000001462876eec65d9aa26d957421c5cc8dd9119b61177242b9dd814fb190fd0a3618000000006a47304402204183bbfdcf11d50907b91f5e70ea8f81228501ce84e24af75c8d984682d094dc022029caa8f7e5acb4990bbeafee523a3c4a99b78e98b9e5c41349147b099679d4ae412103b76389eea6494c2c30443cba9d59b9dba05fb04e467bc94272629615b87a429fffffffff0202000000000000001976a91476d851e59fcb4ee0ebe6947496db3a393b08e49c88ac01000000000000001976a91423f2562a8092ed24eddc77c74387b44c561692a188ac00000000",
|
|
48
|
+
"txid": "f71d25fccb76f619ee2604cd9b5a684f31389a482f6f1bb0bfb2a07610c7681d",
|
|
49
|
+
"url": "https://api.whatsonchain.com/v1/bsv/test/tx/raw",
|
|
50
|
+
"what": "postRawTxError",
|
|
51
|
+
"data": "unexpected response code 500: Missing inputs",
|
|
52
|
+
"statusText": "unexpected response code 500: Missing inputs",
|
|
53
|
+
"status": "unexpected response code 500: Missing inputs"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "ARCv1tx",
|
|
57
|
+
"when": "2025-03-07T20:34:31.157Z",
|
|
58
|
+
"txid": "f71d25fccb76f619ee2604cd9b5a684f31389a482f6f1bb0bfb2a07610c7681d",
|
|
59
|
+
"extraInfo": "",
|
|
60
|
+
"txStatus": "SEEN_IN_ORPHAN_MEMPOOL",
|
|
61
|
+
"what": "postRawTxSuccess"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"what": "postToNetwork",
|
|
65
|
+
"name": "ARC",
|
|
66
|
+
"status": "success",
|
|
67
|
+
"when": "2025-03-07T20:34:31.168Z"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"what": "status",
|
|
71
|
+
"status_was": "unsent",
|
|
72
|
+
"status_now": "unmined",
|
|
73
|
+
"when": "2025-03-07T20:34:31.168Z"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|