@bsv/wallet-toolbox 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/docs/client.md +97 -28
- package/docs/services.md +2 -1
- package/docs/setup.md +404 -14
- package/docs/storage.md +720 -42
- package/docs/wallet.md +97 -28
- package/out/src/Setup.d.ts +2 -69
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js.map +1 -1
- package/out/src/SetupClient.d.ts +126 -0
- package/out/src/SetupClient.d.ts.map +1 -0
- package/out/src/SetupClient.js +220 -0
- package/out/src/SetupClient.js.map +1 -0
- package/out/src/SetupWallet.d.ts +100 -0
- package/out/src/SetupWallet.d.ts.map +1 -0
- package/out/src/{storage/schema/tables/Certificate.js → SetupWallet.js} +1 -1
- package/out/src/SetupWallet.js.map +1 -0
- package/out/src/index.all.d.ts +2 -0
- package/out/src/index.all.d.ts.map +1 -1
- package/out/src/index.all.js +2 -0
- package/out/src/index.all.js.map +1 -1
- package/out/src/index.client.d.ts +1 -0
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +1 -0
- package/out/src/index.client.js.map +1 -1
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js +4 -0
- 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 +0 -3
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.js +1 -2
- package/out/src/monitor/tasks/TaskUnFail.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
- package/out/src/services/__tests/postBeef.test.js +1 -1
- package/out/src/services/__tests/postBeef.test.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts +203 -0
- package/out/src/storage/StorageIdb.d.ts.map +1 -0
- package/out/src/storage/StorageIdb.js +2289 -0
- package/out/src/storage/StorageIdb.js.map +1 -0
- package/out/src/storage/StorageKnex.d.ts +6 -6
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +9 -29
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +3 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +22 -0
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.d.ts +1 -1
- package/out/src/storage/StorageReader.d.ts.map +1 -1
- package/out/src/storage/StorageReader.js +5 -0
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/__test/StorageIdb.test.d.ts +2 -0
- package/out/src/storage/__test/StorageIdb.test.d.ts.map +1 -0
- package/out/src/storage/__test/StorageIdb.test.js +16 -0
- package/out/src/storage/__test/StorageIdb.test.js.map +1 -0
- package/out/src/storage/methods/ListActionsSpecOp.d.ts +16 -0
- package/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -0
- package/out/src/storage/methods/ListActionsSpecOp.js +40 -0
- package/out/src/storage/methods/ListActionsSpecOp.js.map +1 -0
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts +26 -0
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -0
- package/out/src/storage/methods/ListOutputsSpecOp.js +71 -0
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -0
- package/out/src/storage/methods/listActionsIdb.d.ts +5 -0
- package/out/src/storage/methods/listActionsIdb.d.ts.map +1 -0
- package/out/src/storage/methods/listActionsIdb.js +155 -0
- package/out/src/storage/methods/listActionsIdb.js.map +1 -0
- package/out/src/storage/methods/{listActions.d.ts → listActionsKnex.d.ts} +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -0
- package/out/src/storage/methods/{listActions.js → listActionsKnex.js} +3 -34
- package/out/src/storage/methods/listActionsKnex.js.map +1 -0
- package/out/src/storage/methods/listOutputsIdb.d.ts +5 -0
- package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -0
- package/out/src/storage/methods/listOutputsIdb.js +181 -0
- package/out/src/storage/methods/listOutputsIdb.js.map +1 -0
- package/out/src/storage/methods/{listOutputs.d.ts → listOutputsKnex.d.ts} +1 -1
- package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -0
- package/out/src/storage/methods/{listOutputs.js → listOutputsKnex.js} +7 -76
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -0
- package/out/src/storage/methods/purgeDataIdb.d.ts +4 -0
- package/out/src/storage/methods/purgeDataIdb.d.ts.map +1 -0
- package/out/src/storage/methods/purgeDataIdb.js +9 -0
- package/out/src/storage/methods/purgeDataIdb.js.map +1 -0
- package/out/src/storage/methods/reviewStatus.d.ts +11 -0
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +11 -0
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/methods/reviewStatusIdb.d.ts +20 -0
- package/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -0
- package/out/src/storage/methods/reviewStatusIdb.js +35 -0
- package/out/src/storage/methods/reviewStatusIdb.js.map +1 -0
- package/out/src/storage/schema/StorageIdbSchema.d.ts +133 -0
- package/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -0
- package/out/src/storage/schema/{tables/CertificateField.js → StorageIdbSchema.js} +1 -1
- package/out/src/storage/schema/StorageIdbSchema.js.map +1 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -1
- package/out/src/storage/schema/tables/{Certificate.d.ts → TableCertificate.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableCertificate.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableCertificate.js +3 -0
- package/out/src/storage/schema/tables/TableCertificate.js.map +1 -0
- package/out/src/storage/schema/tables/{CertificateField.d.ts → TableCertificateField.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableCertificateField.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableCertificateField.js +3 -0
- package/out/src/storage/schema/tables/TableCertificateField.js.map +1 -0
- package/out/src/storage/schema/tables/{Commission.d.ts → TableCommission.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableCommission.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableCommission.js +3 -0
- package/out/src/storage/schema/tables/TableCommission.js.map +1 -0
- package/out/src/storage/schema/tables/{MonitorEvent.d.ts → TableMonitorEvent.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableMonitorEvent.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableMonitorEvent.js +3 -0
- package/out/src/storage/schema/tables/TableMonitorEvent.js.map +1 -0
- package/out/src/storage/schema/tables/{Output.d.ts → TableOutput.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -0
- package/out/src/storage/schema/tables/{Output.js → TableOutput.js} +1 -1
- package/out/src/storage/schema/tables/TableOutput.js.map +1 -0
- package/out/src/storage/schema/tables/{OutputBasket.d.ts → TableOutputBasket.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableOutputBasket.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableOutputBasket.js +3 -0
- package/out/src/storage/schema/tables/TableOutputBasket.js.map +1 -0
- package/out/src/storage/schema/tables/{OutputTag.d.ts → TableOutputTag.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableOutputTag.d.ts.map +1 -0
- package/out/src/storage/schema/tables/{MonitorEvent.js → TableOutputTag.js} +1 -1
- package/out/src/storage/schema/tables/TableOutputTag.js.map +1 -0
- package/out/src/storage/schema/tables/{OutputTagMap.d.ts → TableOutputTagMap.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableOutputTagMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableOutputTagMap.js +3 -0
- package/out/src/storage/schema/tables/TableOutputTagMap.js.map +1 -0
- package/out/src/storage/schema/tables/{ProvenTx.d.ts → TableProvenTx.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableProvenTx.d.ts.map +1 -0
- package/out/src/storage/schema/tables/{Commission.js → TableProvenTx.js} +1 -1
- package/out/src/storage/schema/tables/TableProvenTx.js.map +1 -0
- package/out/src/storage/schema/tables/{ProvenTxReq.d.ts → TableProvenTxReq.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableProvenTxReq.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableProvenTxReq.js +3 -0
- package/out/src/storage/schema/tables/TableProvenTxReq.js.map +1 -0
- package/out/src/storage/schema/tables/TableSettings.d.ts +1 -1
- package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -1
- package/out/src/storage/schema/tables/{SyncState.d.ts → TableSyncState.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableSyncState.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableSyncState.js +3 -0
- package/out/src/storage/schema/tables/TableSyncState.js.map +1 -0
- package/out/src/storage/schema/tables/{Transaction.d.ts → TableTransaction.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableTransaction.d.ts.map +1 -0
- package/out/src/storage/schema/tables/{Transaction.js → TableTransaction.js} +1 -1
- package/out/src/storage/schema/tables/TableTransaction.js.map +1 -0
- package/out/src/storage/schema/tables/{TxLabel.d.ts → TableTxLabel.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableTxLabel.d.ts.map +1 -0
- package/out/src/storage/schema/tables/{OutputBasket.js → TableTxLabel.js} +1 -1
- package/out/src/storage/schema/tables/TableTxLabel.js.map +1 -0
- package/out/src/storage/schema/tables/{TxLabelMap.d.ts → TableTxLabelMap.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableTxLabelMap.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableTxLabelMap.js +3 -0
- package/out/src/storage/schema/tables/TableTxLabelMap.js.map +1 -0
- package/out/src/storage/schema/tables/{User.d.ts → TableUser.d.ts} +1 -1
- package/out/src/storage/schema/tables/TableUser.d.ts.map +1 -0
- package/out/src/storage/schema/tables/{SyncState.js → TableUser.js} +1 -1
- package/out/src/storage/schema/tables/TableUser.js.map +1 -0
- package/out/src/storage/schema/tables/index.d.ts +15 -15
- package/out/src/storage/schema/tables/index.d.ts.map +1 -1
- package/out/src/storage/schema/tables/index.js +15 -15
- package/out/src/storage/schema/tables/index.js.map +1 -1
- package/out/test/Wallet/local/localWallet2.man.test.js +4 -0
- package/out/test/Wallet/local/localWallet2.man.test.js.map +1 -1
- package/out/test/Wallet/support/operations.man.test.d.ts +2 -0
- package/out/test/Wallet/support/operations.man.test.d.ts.map +1 -0
- package/out/test/Wallet/support/{opers1.man.test.js → operations.man.test.js} +39 -4
- package/out/test/Wallet/support/operations.man.test.js.map +1 -0
- package/out/test/storage/find.test.js +1 -1
- package/out/test/storage/find.test.js.map +1 -1
- package/out/test/storage/idb/allocateChange.test.d.ts +2 -0
- package/out/test/storage/idb/allocateChange.test.d.ts.map +1 -0
- package/out/test/storage/idb/allocateChange.test.js +110 -0
- package/out/test/storage/idb/allocateChange.test.js.map +1 -0
- package/out/test/storage/idb/count.test.d.ts +2 -0
- package/out/test/storage/idb/count.test.d.ts.map +1 -0
- package/out/test/storage/idb/count.test.js +129 -0
- package/out/test/storage/idb/count.test.js.map +1 -0
- package/out/test/storage/idb/find.test.d.ts +2 -0
- package/out/test/storage/idb/find.test.d.ts.map +1 -0
- package/out/test/storage/idb/find.test.js +131 -0
- package/out/test/storage/idb/find.test.js.map +1 -0
- package/out/test/storage/idb/idbSpeed.test.d.ts +2 -0
- package/out/test/storage/idb/idbSpeed.test.d.ts.map +1 -0
- package/out/test/storage/idb/idbSpeed.test.js +29 -0
- package/out/test/storage/idb/idbSpeed.test.js.map +1 -0
- package/out/test/storage/idb/insert.test.d.ts +2 -0
- package/out/test/storage/idb/insert.test.d.ts.map +1 -0
- package/out/test/storage/idb/insert.test.js +242 -0
- package/out/test/storage/idb/insert.test.js.map +1 -0
- package/out/test/storage/idb/transactionAbort.test.d.ts +2 -0
- package/out/test/storage/idb/transactionAbort.test.d.ts.map +1 -0
- package/out/test/storage/idb/transactionAbort.test.js +97 -0
- package/out/test/storage/idb/transactionAbort.test.js.map +1 -0
- package/out/test/storage/idb/update.test.d.ts +2 -0
- package/out/test/storage/idb/update.test.d.ts.map +1 -0
- package/out/test/storage/idb/update.test.js +902 -0
- package/out/test/storage/idb/update.test.js.map +1 -0
- package/out/test/storage/update.test.js +2 -2
- package/out/test/storage/update.test.js.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts +24 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.js +147 -3
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
- package/out/test/wallet/list/listActions.test.d.ts +1 -1
- package/out/test/wallet/list/listActions.test.d.ts.map +1 -1
- package/out/test/wallet/list/listActions.test.js +9 -3
- package/out/test/wallet/list/listActions.test.js.map +1 -1
- package/out/test/wallet/list/listOutputs.test.d.ts +1 -1
- package/out/test/wallet/list/listOutputs.test.d.ts.map +1 -1
- package/out/test/wallet/list/listOutputs.test.js +34 -219
- package/out/test/wallet/list/listOutputs.test.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/src/Setup.ts +1 -71
- package/src/SetupClient.ts +312 -0
- package/src/SetupWallet.ts +105 -0
- package/src/index.all.ts +2 -0
- package/src/index.client.ts +1 -0
- package/src/monitor/Monitor.ts +4 -0
- package/src/monitor/MonitorDaemon.ts +0 -1
- package/src/monitor/tasks/TaskUnFail.ts +3 -4
- package/src/sdk/WalletServices.interfaces.ts +1 -2
- package/src/services/__tests/postBeef.test.ts +1 -1
- package/src/storage/StorageIdb.ts +2298 -0
- package/src/storage/StorageKnex.ts +7 -32
- package/src/storage/StorageProvider.ts +28 -0
- package/src/storage/StorageReader.ts +5 -1
- package/src/storage/__test/StorageIdb.test.ts +15 -0
- package/src/storage/methods/ListActionsSpecOp.ts +68 -0
- package/src/storage/methods/ListOutputsSpecOp.ts +125 -0
- package/src/storage/methods/listActionsIdb.ts +181 -0
- package/src/storage/methods/{listActions.ts → listActionsKnex.ts} +2 -64
- package/src/storage/methods/listOutputsIdb.ts +199 -0
- package/src/storage/methods/{listOutputs.ts → listOutputsKnex.ts} +9 -133
- package/src/storage/methods/purgeDataIdb.ts +15 -0
- package/src/storage/methods/reviewStatus.ts +11 -0
- package/src/storage/methods/reviewStatusIdb.ts +43 -0
- package/src/storage/schema/StorageIdbSchema.ts +150 -0
- package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +1 -1
- package/src/storage/schema/tables/TableSettings.ts +1 -1
- package/src/storage/schema/tables/index.ts +15 -15
- package/test/Wallet/local/localWallet2.man.test.ts +5 -0
- package/test/Wallet/support/{opers1.man.test.ts → operations.man.test.ts} +41 -12
- package/test/storage/find.test.ts +1 -1
- package/test/storage/idb/allocateChange.test.ts +251 -0
- package/test/storage/idb/count.test.ts +158 -0
- package/test/storage/idb/find.test.ts +177 -0
- package/test/storage/idb/idbSpeed.test.ts +34 -0
- package/test/storage/idb/insert.test.ts +268 -0
- package/test/storage/idb/transactionAbort.test.ts +108 -0
- package/test/storage/idb/update.test.ts +1000 -0
- package/test/storage/update.test.ts +2 -2
- package/test/utils/TestUtilsWalletStorage.ts +188 -4
- package/test/wallet/list/listActions.test.ts +15 -5
- package/test/wallet/list/listOutputs.test.ts +29 -214
- package/out/src/storage/methods/listActions.d.ts.map +0 -1
- package/out/src/storage/methods/listActions.js.map +0 -1
- package/out/src/storage/methods/listOutputs.d.ts.map +0 -1
- package/out/src/storage/methods/listOutputs.js.map +0 -1
- package/out/src/storage/schema/tables/Certificate.d.ts.map +0 -1
- package/out/src/storage/schema/tables/Certificate.js.map +0 -1
- package/out/src/storage/schema/tables/CertificateField.d.ts.map +0 -1
- package/out/src/storage/schema/tables/CertificateField.js.map +0 -1
- package/out/src/storage/schema/tables/Commission.d.ts.map +0 -1
- package/out/src/storage/schema/tables/Commission.js.map +0 -1
- package/out/src/storage/schema/tables/MonitorEvent.d.ts.map +0 -1
- package/out/src/storage/schema/tables/MonitorEvent.js.map +0 -1
- package/out/src/storage/schema/tables/Output.d.ts.map +0 -1
- package/out/src/storage/schema/tables/Output.js.map +0 -1
- package/out/src/storage/schema/tables/OutputBasket.d.ts.map +0 -1
- package/out/src/storage/schema/tables/OutputBasket.js.map +0 -1
- package/out/src/storage/schema/tables/OutputTag.d.ts.map +0 -1
- package/out/src/storage/schema/tables/OutputTag.js +0 -3
- package/out/src/storage/schema/tables/OutputTag.js.map +0 -1
- package/out/src/storage/schema/tables/OutputTagMap.d.ts.map +0 -1
- package/out/src/storage/schema/tables/OutputTagMap.js +0 -3
- package/out/src/storage/schema/tables/OutputTagMap.js.map +0 -1
- package/out/src/storage/schema/tables/ProvenTx.d.ts.map +0 -1
- package/out/src/storage/schema/tables/ProvenTx.js +0 -3
- package/out/src/storage/schema/tables/ProvenTx.js.map +0 -1
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts.map +0 -1
- package/out/src/storage/schema/tables/ProvenTxReq.js +0 -3
- package/out/src/storage/schema/tables/ProvenTxReq.js.map +0 -1
- package/out/src/storage/schema/tables/SyncState.d.ts.map +0 -1
- package/out/src/storage/schema/tables/SyncState.js.map +0 -1
- package/out/src/storage/schema/tables/Transaction.d.ts.map +0 -1
- package/out/src/storage/schema/tables/Transaction.js.map +0 -1
- package/out/src/storage/schema/tables/TxLabel.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TxLabel.js +0 -3
- package/out/src/storage/schema/tables/TxLabel.js.map +0 -1
- package/out/src/storage/schema/tables/TxLabelMap.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TxLabelMap.js +0 -3
- package/out/src/storage/schema/tables/TxLabelMap.js.map +0 -1
- package/out/src/storage/schema/tables/User.d.ts.map +0 -1
- package/out/src/storage/schema/tables/User.js +0 -3
- package/out/src/storage/schema/tables/User.js.map +0 -1
- package/out/test/Wallet/support/opers1.man.test.d.ts +0 -2
- package/out/test/Wallet/support/opers1.man.test.d.ts.map +0 -1
- package/out/test/Wallet/support/opers1.man.test.js.map +0 -1
- package/unlock-migrations.sh +0 -41
- /package/src/storage/schema/tables/{Certificate.ts → TableCertificate.ts} +0 -0
- /package/src/storage/schema/tables/{CertificateField.ts → TableCertificateField.ts} +0 -0
- /package/src/storage/schema/tables/{Commission.ts → TableCommission.ts} +0 -0
- /package/src/storage/schema/tables/{MonitorEvent.ts → TableMonitorEvent.ts} +0 -0
- /package/src/storage/schema/tables/{Output.ts → TableOutput.ts} +0 -0
- /package/src/storage/schema/tables/{OutputBasket.ts → TableOutputBasket.ts} +0 -0
- /package/src/storage/schema/tables/{OutputTag.ts → TableOutputTag.ts} +0 -0
- /package/src/storage/schema/tables/{OutputTagMap.ts → TableOutputTagMap.ts} +0 -0
- /package/src/storage/schema/tables/{ProvenTx.ts → TableProvenTx.ts} +0 -0
- /package/src/storage/schema/tables/{ProvenTxReq.ts → TableProvenTxReq.ts} +0 -0
- /package/src/storage/schema/tables/{SyncState.ts → TableSyncState.ts} +0 -0
- /package/src/storage/schema/tables/{Transaction.ts → TableTransaction.ts} +0 -0
- /package/src/storage/schema/tables/{TxLabel.ts → TableTxLabel.ts} +0 -0
- /package/src/storage/schema/tables/{TxLabelMap.ts → TableTxLabelMap.ts} +0 -0
- /package/src/storage/schema/tables/{User.ts → TableUser.ts} +0 -0
package/docs/setup.md
CHANGED
|
@@ -15,18 +15,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
15
15
|
|
|
16
16
|
#### Interfaces
|
|
17
17
|
|
|
18
|
-
| |
|
|
19
|
-
| --- |
|
|
20
|
-
| [KeyPairAddress](#interface-keypairaddress) |
|
|
21
|
-
| [
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
26
|
-
| [
|
|
27
|
-
| [SetupWalletKnexArgs](#interface-setupwalletknexargs) |
|
|
28
|
-
| [SetupWalletMySQLArgs](#interface-setupwalletmysqlargs) |
|
|
29
|
-
| [SetupWalletSQLiteArgs](#interface-setupwalletsqliteargs) |
|
|
18
|
+
| | |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| [KeyPairAddress](#interface-keypairaddress) | [SetupWalletClientArgs](#interface-setupwalletclientargs) |
|
|
21
|
+
| [SetupClientWalletArgs](#interface-setupclientwalletargs) | [SetupWalletIdb](#interface-setupwalletidb) |
|
|
22
|
+
| [SetupClientWalletClientArgs](#interface-setupclientwalletclientargs) | [SetupWalletIdbArgs](#interface-setupwalletidbargs) |
|
|
23
|
+
| [SetupEnv](#interface-setupenv) | [SetupWalletKnex](#interface-setupwalletknex) |
|
|
24
|
+
| [SetupWallet](#interface-setupwallet) | [SetupWalletKnexArgs](#interface-setupwalletknexargs) |
|
|
25
|
+
| [SetupWalletArgs](#interface-setupwalletargs) | [SetupWalletMySQLArgs](#interface-setupwalletmysqlargs) |
|
|
26
|
+
| [SetupWalletClient](#interface-setupwalletclient) | [SetupWalletSQLiteArgs](#interface-setupwalletsqliteargs) |
|
|
30
27
|
|
|
31
28
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
32
29
|
|
|
@@ -34,8 +31,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
34
31
|
|
|
35
32
|
##### Interface: KeyPairAddress
|
|
36
33
|
|
|
37
|
-
A private key and associated public key and address.
|
|
38
|
-
|
|
39
34
|
```ts
|
|
40
35
|
export interface KeyPairAddress {
|
|
41
36
|
privateKey: PrivateKey;
|
|
@@ -46,6 +41,91 @@ export interface KeyPairAddress {
|
|
|
46
41
|
|
|
47
42
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
48
43
|
|
|
44
|
+
---
|
|
45
|
+
##### Interface: SetupClientWalletArgs
|
|
46
|
+
|
|
47
|
+
Arguments used by `createWallet` to construct a `SetupWallet`.
|
|
48
|
+
|
|
49
|
+
Extension `SetupWalletClientArgs` used by `createWalletClient` to construct a `SetupWalletClient`.
|
|
50
|
+
|
|
51
|
+
Extension `SetupWalletIdbArgs` used by `createWalletIdb` to construct a `SetupWalletIdb`.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
export interface SetupClientWalletArgs {
|
|
55
|
+
chain: sdk.Chain;
|
|
56
|
+
rootKeyHex: string;
|
|
57
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
58
|
+
active?: sdk.WalletStorageProvider;
|
|
59
|
+
backups?: sdk.WalletStorageProvider[];
|
|
60
|
+
taalApiKey?: string;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
See also: [Chain](./client.md#type-chain), [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
65
|
+
|
|
66
|
+
###### Property active
|
|
67
|
+
|
|
68
|
+
Optional. Active wallet storage. Can be added later.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
active?: sdk.WalletStorageProvider
|
|
72
|
+
```
|
|
73
|
+
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
74
|
+
|
|
75
|
+
###### Property backups
|
|
76
|
+
|
|
77
|
+
Optional. One or more storage providers managed as backup destinations. Can be added later.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
backups?: sdk.WalletStorageProvider[]
|
|
81
|
+
```
|
|
82
|
+
See also: [WalletStorageProvider](./client.md#interface-walletstorageprovider)
|
|
83
|
+
|
|
84
|
+
###### Property privilegedKeyGetter
|
|
85
|
+
|
|
86
|
+
Optional. The privileged private key getter used to initialize the `PrivilegedKeyManager`.
|
|
87
|
+
Defaults to undefined.
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
###### Property rootKeyHex
|
|
94
|
+
|
|
95
|
+
The non-privileged private key used to initialize the `KeyDeriver` and determine the `identityKey`.
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
rootKeyHex: string
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
##### Interface: SetupClientWalletClientArgs
|
|
105
|
+
|
|
106
|
+
Extension `SetupWalletClientArgs` of `SetupWalletArgs` is used by `createWalletClient`
|
|
107
|
+
to construct a `SetupWalletClient`.
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
export interface SetupClientWalletClientArgs extends SetupClientWalletArgs {
|
|
111
|
+
endpointUrl?: string;
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
See also: [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs)
|
|
116
|
+
|
|
117
|
+
###### Property endpointUrl
|
|
118
|
+
|
|
119
|
+
The endpoint URL of a service hosting the `StorageServer` JSON-RPC service to
|
|
120
|
+
which a `StorageClient` instance should connect to function as
|
|
121
|
+
the active storage provider of the newly created wallet.
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
endpointUrl?: string
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
128
|
+
|
|
49
129
|
---
|
|
50
130
|
##### Interface: SetupEnv
|
|
51
131
|
|
|
@@ -355,6 +435,41 @@ endpointUrl?: string
|
|
|
355
435
|
|
|
356
436
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
357
437
|
|
|
438
|
+
---
|
|
439
|
+
##### Interface: SetupWalletIdb
|
|
440
|
+
|
|
441
|
+
```ts
|
|
442
|
+
export interface SetupWalletIdb extends SetupWallet {
|
|
443
|
+
activeStorage: StorageIdb;
|
|
444
|
+
userId: number;
|
|
445
|
+
rootKey: PrivateKey;
|
|
446
|
+
identityKey: string;
|
|
447
|
+
keyDeriver: KeyDeriver;
|
|
448
|
+
chain: sdk.Chain;
|
|
449
|
+
storage: WalletStorageManager;
|
|
450
|
+
services: Services;
|
|
451
|
+
monitor: Monitor;
|
|
452
|
+
wallet: Wallet;
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [Services](./services.md#class-services), [SetupWallet](./setup.md#interface-setupwallet), [StorageIdb](./storage.md#class-storageidb), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
457
|
+
|
|
458
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
##### Interface: SetupWalletIdbArgs
|
|
462
|
+
|
|
463
|
+
```ts
|
|
464
|
+
export interface SetupWalletIdbArgs extends SetupClientWalletArgs {
|
|
465
|
+
databaseName: string;
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
See also: [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs)
|
|
470
|
+
|
|
471
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
472
|
+
|
|
358
473
|
---
|
|
359
474
|
##### Interface: SetupWalletKnex
|
|
360
475
|
|
|
@@ -421,6 +536,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
421
536
|
---
|
|
422
537
|
#### Classes
|
|
423
538
|
|
|
539
|
+
| |
|
|
540
|
+
| --- |
|
|
541
|
+
| [Setup](#class-setup) |
|
|
542
|
+
| [SetupClient](#class-setupclient) |
|
|
543
|
+
|
|
544
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
545
|
+
|
|
546
|
+
---
|
|
547
|
+
|
|
424
548
|
##### Class: Setup
|
|
425
549
|
|
|
426
550
|
The 'Setup` class provides static setup functions to construct BRC-100 compatible
|
|
@@ -867,6 +991,272 @@ true if .env is not valid for chain
|
|
|
867
991
|
|
|
868
992
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
869
993
|
|
|
994
|
+
---
|
|
995
|
+
##### Class: SetupClient
|
|
996
|
+
|
|
997
|
+
The 'Setup` class provides static setup functions to construct BRC-100 compatible
|
|
998
|
+
wallets in a variety of configurations.
|
|
999
|
+
|
|
1000
|
+
It serves as a starting point for experimentation and customization.
|
|
1001
|
+
|
|
1002
|
+
```ts
|
|
1003
|
+
export abstract class SetupClient {
|
|
1004
|
+
static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
|
|
1005
|
+
const chain = args.chain;
|
|
1006
|
+
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
1007
|
+
const identityKey = rootKey.toPublicKey().toString();
|
|
1008
|
+
const keyDeriver = new KeyDeriver(rootKey);
|
|
1009
|
+
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
1010
|
+
if (storage.canMakeAvailable())
|
|
1011
|
+
await storage.makeAvailable();
|
|
1012
|
+
const serviceOptions = Services.createDefaultOptions(chain);
|
|
1013
|
+
serviceOptions.taalApiKey = args.taalApiKey;
|
|
1014
|
+
const services = new Services(serviceOptions);
|
|
1015
|
+
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
1016
|
+
const monitor = new Monitor(monopts);
|
|
1017
|
+
monitor.addDefaultTasks();
|
|
1018
|
+
const privilegedKeyManager = args.privilegedKeyGetter
|
|
1019
|
+
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
1020
|
+
: undefined;
|
|
1021
|
+
const wallet = new Wallet({
|
|
1022
|
+
chain,
|
|
1023
|
+
keyDeriver,
|
|
1024
|
+
storage,
|
|
1025
|
+
services,
|
|
1026
|
+
monitor,
|
|
1027
|
+
privilegedKeyManager
|
|
1028
|
+
});
|
|
1029
|
+
const r: SetupWallet = {
|
|
1030
|
+
rootKey,
|
|
1031
|
+
identityKey,
|
|
1032
|
+
keyDeriver,
|
|
1033
|
+
chain,
|
|
1034
|
+
storage,
|
|
1035
|
+
services,
|
|
1036
|
+
monitor,
|
|
1037
|
+
wallet
|
|
1038
|
+
};
|
|
1039
|
+
return r;
|
|
1040
|
+
}
|
|
1041
|
+
static async createWalletClientNoEnv(args: {
|
|
1042
|
+
chain: sdk.Chain;
|
|
1043
|
+
rootKeyHex: string;
|
|
1044
|
+
storageUrl?: string;
|
|
1045
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
1046
|
+
}): Promise<Wallet>
|
|
1047
|
+
static async createWalletClient(args: SetupClientWalletClientArgs): Promise<SetupWalletClient> {
|
|
1048
|
+
const wo = await SetupClient.createWallet(args);
|
|
1049
|
+
const endpointUrl = args.endpointUrl || `https://${args.chain !== "main" ? "staging-" : ""}storage.babbage.systems`;
|
|
1050
|
+
const client = new StorageClient(wo.wallet, endpointUrl);
|
|
1051
|
+
await wo.storage.addWalletStorageProvider(client);
|
|
1052
|
+
await wo.storage.makeAvailable();
|
|
1053
|
+
return {
|
|
1054
|
+
...wo,
|
|
1055
|
+
endpointUrl
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
static getKeyPair(priv?: string | PrivateKey): KeyPairAddress {
|
|
1059
|
+
if (priv === undefined)
|
|
1060
|
+
priv = PrivateKey.fromRandom();
|
|
1061
|
+
else if (typeof priv === "string")
|
|
1062
|
+
priv = new PrivateKey(priv, "hex");
|
|
1063
|
+
const pub = PublicKey.fromPrivateKey(priv);
|
|
1064
|
+
const address = pub.toAddress();
|
|
1065
|
+
return { privateKey: priv, publicKey: pub, address };
|
|
1066
|
+
}
|
|
1067
|
+
static getLockP2PKH(address: string): LockingScript {
|
|
1068
|
+
const p2pkh = new P2PKH();
|
|
1069
|
+
const lock = p2pkh.lock(address);
|
|
1070
|
+
return lock;
|
|
1071
|
+
}
|
|
1072
|
+
static getUnlockP2PKH(priv: PrivateKey, satoshis: number): sdk.ScriptTemplateUnlock {
|
|
1073
|
+
const p2pkh = new P2PKH();
|
|
1074
|
+
const lock = SetupClient.getLockP2PKH(SetupClient.getKeyPair(priv).address);
|
|
1075
|
+
const unlock = p2pkh.unlock(priv, "all", false, satoshis, lock);
|
|
1076
|
+
return unlock;
|
|
1077
|
+
}
|
|
1078
|
+
static createP2PKHOutputs(outputs: {
|
|
1079
|
+
address: string;
|
|
1080
|
+
satoshis: number;
|
|
1081
|
+
outputDescription?: string;
|
|
1082
|
+
basket?: string;
|
|
1083
|
+
tags?: string[];
|
|
1084
|
+
}[]): CreateActionOutput[] {
|
|
1085
|
+
const os: CreateActionOutput[] = [];
|
|
1086
|
+
const count = outputs.length;
|
|
1087
|
+
for (let i = 0; i < count; i++) {
|
|
1088
|
+
const o = outputs[i];
|
|
1089
|
+
os.push({
|
|
1090
|
+
basket: o.basket,
|
|
1091
|
+
tags: o.tags,
|
|
1092
|
+
satoshis: o.satoshis,
|
|
1093
|
+
lockingScript: SetupClient.getLockP2PKH(o.address).toHex(),
|
|
1094
|
+
outputDescription: o.outputDescription || `p2pkh ${i}`
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
return os;
|
|
1098
|
+
}
|
|
1099
|
+
static async createP2PKHOutputsAction(wallet: WalletInterface, outputs: {
|
|
1100
|
+
address: string;
|
|
1101
|
+
satoshis: number;
|
|
1102
|
+
outputDescription?: string;
|
|
1103
|
+
basket?: string;
|
|
1104
|
+
tags?: string[];
|
|
1105
|
+
}[], options?: CreateActionOptions): Promise<{
|
|
1106
|
+
cr: CreateActionResult;
|
|
1107
|
+
outpoints: string[] | undefined;
|
|
1108
|
+
}> {
|
|
1109
|
+
const os = SetupClient.createP2PKHOutputs(outputs);
|
|
1110
|
+
const createArgs: CreateActionArgs = {
|
|
1111
|
+
description: `createP2PKHOutputs`,
|
|
1112
|
+
outputs: os,
|
|
1113
|
+
options: {
|
|
1114
|
+
...options,
|
|
1115
|
+
randomizeOutputs: false
|
|
1116
|
+
}
|
|
1117
|
+
};
|
|
1118
|
+
const cr = await wallet.createAction(createArgs);
|
|
1119
|
+
let outpoints: string[] | undefined;
|
|
1120
|
+
if (cr.txid) {
|
|
1121
|
+
outpoints = os.map((o, i) => `${cr.txid}.${i}`);
|
|
1122
|
+
}
|
|
1123
|
+
return { cr, outpoints };
|
|
1124
|
+
}
|
|
1125
|
+
static async fundWalletFromP2PKHOutpoints(wallet: WalletInterface, outpoints: string[], p2pkhKey: KeyPairAddress, inputBEEF?: BEEF) {
|
|
1126
|
+
}
|
|
1127
|
+
static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
|
|
1128
|
+
const wo = await SetupClient.createWallet(args);
|
|
1129
|
+
const activeStorage = await SetupClient.createStorageIdb(args);
|
|
1130
|
+
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
1131
|
+
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
1132
|
+
const userId = user.userId;
|
|
1133
|
+
const r: SetupWalletIdb = {
|
|
1134
|
+
...wo,
|
|
1135
|
+
activeStorage,
|
|
1136
|
+
userId
|
|
1137
|
+
};
|
|
1138
|
+
return r;
|
|
1139
|
+
}
|
|
1140
|
+
static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
|
|
1141
|
+
}
|
|
1142
|
+
```
|
|
1143
|
+
|
|
1144
|
+
See also: [Chain](./client.md#type-chain), [KeyPairAddress](./setup.md#interface-keypairaddress), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [ScriptTemplateUnlock](./client.md#interface-scripttemplateunlock), [Services](./services.md#class-services), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupClientWalletClientArgs](./setup.md#interface-setupclientwalletclientargs), [SetupWallet](./setup.md#interface-setupwallet), [SetupWalletClient](./setup.md#interface-setupwalletclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageClient](./storage.md#class-storageclient), [StorageIdb](./storage.md#class-storageidb), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction)
|
|
1145
|
+
|
|
1146
|
+
###### Method createStorageIdb
|
|
1147
|
+
|
|
1148
|
+
```ts
|
|
1149
|
+
static async createStorageIdb(args: SetupWalletIdbArgs): Promise<StorageIdb>
|
|
1150
|
+
```
|
|
1151
|
+
See also: [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs), [StorageIdb](./storage.md#class-storageidb)
|
|
1152
|
+
|
|
1153
|
+
Returns
|
|
1154
|
+
|
|
1155
|
+
- `Knex` based storage provider for a wallet. May be used for either active storage or backup storage.
|
|
1156
|
+
|
|
1157
|
+
###### Method createWallet
|
|
1158
|
+
|
|
1159
|
+
Create a `Wallet`. Storage can optionally be provided or configured later.
|
|
1160
|
+
|
|
1161
|
+
The following components are configured: KeyDeriver, WalletStorageManager, WalletService, WalletStorage.
|
|
1162
|
+
Optionally, PrivilegedKeyManager is also configured.
|
|
1163
|
+
|
|
1164
|
+
```ts
|
|
1165
|
+
static async createWallet(args: SetupClientWalletArgs): Promise<SetupWallet> {
|
|
1166
|
+
const chain = args.chain;
|
|
1167
|
+
const rootKey = PrivateKey.fromHex(args.rootKeyHex);
|
|
1168
|
+
const identityKey = rootKey.toPublicKey().toString();
|
|
1169
|
+
const keyDeriver = new KeyDeriver(rootKey);
|
|
1170
|
+
const storage = new WalletStorageManager(identityKey, args.active, args.backups);
|
|
1171
|
+
if (storage.canMakeAvailable())
|
|
1172
|
+
await storage.makeAvailable();
|
|
1173
|
+
const serviceOptions = Services.createDefaultOptions(chain);
|
|
1174
|
+
serviceOptions.taalApiKey = args.taalApiKey;
|
|
1175
|
+
const services = new Services(serviceOptions);
|
|
1176
|
+
const monopts = Monitor.createDefaultWalletMonitorOptions(chain, storage, services);
|
|
1177
|
+
const monitor = new Monitor(monopts);
|
|
1178
|
+
monitor.addDefaultTasks();
|
|
1179
|
+
const privilegedKeyManager = args.privilegedKeyGetter
|
|
1180
|
+
? new sdk.PrivilegedKeyManager(args.privilegedKeyGetter)
|
|
1181
|
+
: undefined;
|
|
1182
|
+
const wallet = new Wallet({
|
|
1183
|
+
chain,
|
|
1184
|
+
keyDeriver,
|
|
1185
|
+
storage,
|
|
1186
|
+
services,
|
|
1187
|
+
monitor,
|
|
1188
|
+
privilegedKeyManager
|
|
1189
|
+
});
|
|
1190
|
+
const r: SetupWallet = {
|
|
1191
|
+
rootKey,
|
|
1192
|
+
identityKey,
|
|
1193
|
+
keyDeriver,
|
|
1194
|
+
chain,
|
|
1195
|
+
storage,
|
|
1196
|
+
services,
|
|
1197
|
+
monitor,
|
|
1198
|
+
wallet
|
|
1199
|
+
};
|
|
1200
|
+
return r;
|
|
1201
|
+
}
|
|
1202
|
+
```
|
|
1203
|
+
See also: [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [Services](./services.md#class-services), [SetupClientWalletArgs](./setup.md#interface-setupclientwalletargs), [SetupWallet](./setup.md#interface-setupwallet), [Wallet](./client.md#class-wallet), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
1204
|
+
|
|
1205
|
+
###### Method createWalletClientNoEnv
|
|
1206
|
+
|
|
1207
|
+
Setup a new `Wallet` without requiring a .env file.
|
|
1208
|
+
|
|
1209
|
+
```ts
|
|
1210
|
+
static async createWalletClientNoEnv(args: {
|
|
1211
|
+
chain: sdk.Chain;
|
|
1212
|
+
rootKeyHex: string;
|
|
1213
|
+
storageUrl?: string;
|
|
1214
|
+
privilegedKeyGetter?: () => Promise<PrivateKey>;
|
|
1215
|
+
}): Promise<Wallet>
|
|
1216
|
+
```
|
|
1217
|
+
See also: [Chain](./client.md#type-chain), [Wallet](./client.md#class-wallet)
|
|
1218
|
+
|
|
1219
|
+
Argument Details
|
|
1220
|
+
|
|
1221
|
+
+ **args.chain**
|
|
1222
|
+
+ 'main' or 'test'
|
|
1223
|
+
+ **args.rootKeyHex**
|
|
1224
|
+
+ Root private key for wallet's key deriver.
|
|
1225
|
+
+ **args.storageUrl**
|
|
1226
|
+
+ Optional. `StorageClient` and `chain` compatible endpoint URL.
|
|
1227
|
+
+ **args.privilegedKeyGetter**
|
|
1228
|
+
+ Optional. Method that will return the privileged `PrivateKey`, on demand.
|
|
1229
|
+
|
|
1230
|
+
###### Method createWalletIdb
|
|
1231
|
+
|
|
1232
|
+
Adds `indexedDB` based storage to a `Wallet` configured by `SetupClient.createWalletOnly`
|
|
1233
|
+
|
|
1234
|
+
```ts
|
|
1235
|
+
static async createWalletIdb(args: SetupWalletIdbArgs): Promise<SetupWalletIdb> {
|
|
1236
|
+
const wo = await SetupClient.createWallet(args);
|
|
1237
|
+
const activeStorage = await SetupClient.createStorageIdb(args);
|
|
1238
|
+
await wo.storage.addWalletStorageProvider(activeStorage);
|
|
1239
|
+
const { user, isNew } = await activeStorage.findOrInsertUser(wo.identityKey);
|
|
1240
|
+
const userId = user.userId;
|
|
1241
|
+
const r: SetupWalletIdb = {
|
|
1242
|
+
...wo,
|
|
1243
|
+
activeStorage,
|
|
1244
|
+
userId
|
|
1245
|
+
};
|
|
1246
|
+
return r;
|
|
1247
|
+
}
|
|
1248
|
+
```
|
|
1249
|
+
See also: [SetupClient](./setup.md#class-setupclient), [SetupWalletIdb](./setup.md#interface-setupwalletidb), [SetupWalletIdbArgs](./setup.md#interface-setupwalletidbargs)
|
|
1250
|
+
|
|
1251
|
+
Argument Details
|
|
1252
|
+
|
|
1253
|
+
+ **args.databaseName**
|
|
1254
|
+
+ Name for this storage. For MySQL, the schema name within the MySQL instance.
|
|
1255
|
+
+ **args.chain**
|
|
1256
|
+
+ Which chain this wallet is on: 'main' or 'test'. Defaults to 'test'.
|
|
1257
|
+
|
|
1258
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1259
|
+
|
|
870
1260
|
---
|
|
871
1261
|
#### Functions
|
|
872
1262
|
|