@bsv/wallet-toolbox 1.1.1 → 1.1.3
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/README.md +12 -74
- package/docs/README.md +69 -6
- package/docs/client.md +158 -51
- package/docs/monitor.md +1 -2
- package/docs/setup.md +219 -0
- package/docs/storage.md +6 -8
- package/docs/wallet.md +158 -51
- package/out/src/Setup.d.ts +59 -0
- package/out/src/Setup.d.ts.map +1 -0
- package/out/src/Setup.js +84 -0
- package/out/src/Setup.js.map +1 -0
- package/out/src/SetupClient.d.ts +67 -0
- package/out/src/SetupClient.d.ts.map +1 -0
- package/out/src/SetupClient.js +188 -0
- package/out/src/SetupClient.js.map +1 -0
- package/out/src/Wallet.d.ts +1 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/index.all.d.ts +2 -0
- package/out/src/index.all.d.ts.map +1 -1
- package/out/src/index.all.js +2 -0
- package/out/src/index.all.js.map +1 -1
- package/out/src/index.client.d.ts +1 -0
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +3 -1
- package/out/src/index.client.js.map +1 -1
- package/out/src/index.d.ts +0 -1
- package/out/src/index.d.ts.map +1 -1
- package/out/src/index.js +0 -24
- package/out/src/index.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts +2 -2
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/__test/CertificateLifeCycle.test.js +11 -9
- package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +1 -1
- package/out/src/services/__tests/postTxs.test.js +11 -2
- package/out/src/services/__tests/postTxs.test.js.map +1 -1
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js +14 -11
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js.map +1 -1
- package/out/src/services/providers/arcServices.d.ts.map +1 -1
- package/out/src/services/providers/arcServices.js +7 -0
- package/out/src/services/providers/arcServices.js.map +1 -1
- package/out/src/signer/methods/proveCertificate.d.ts.map +1 -1
- package/out/test/Wallet/certificate/acquireCertificate.test.js +2 -2
- package/out/test/Wallet/certificate/acquireCertificate.test.js.map +1 -1
- package/out/test/examples/README.man.test.js +1 -1
- package/out/test/examples/README.man.test.js.map +1 -1
- package/out/test/services/Services.test.js +11 -5
- package/out/test/services/Services.test.js.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts +11 -2
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.js +13 -4
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
- package/out/test/wallet/list/listActions2.test.js +129 -150
- package/out/test/wallet/list/listActions2.test.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Setup.ts +143 -0
- package/src/SetupClient.ts +295 -0
- package/src/Wallet.ts +1 -1
- package/src/index.all.ts +2 -0
- package/src/index.client.ts +1 -0
- package/src/index.ts +0 -1
- package/src/sdk/PrivilegedKeyManager.ts +1 -1
- package/src/sdk/__test/CertificateLifeCycle.test.ts +12 -10
- package/src/services/__tests/postTxs.test.ts +10 -2
- package/src/services/chaintracker/__tests/ChaintracksChainTracker.test.ts +22 -17
- package/src/services/providers/arcServices.ts +9 -1
- package/src/signer/methods/proveCertificate.ts +1 -1
- package/test/Wallet/certificate/acquireCertificate.test.ts +3 -3
- package/test/examples/README.man.test.ts +2 -2
- package/test/services/Services.test.ts +9 -5
- package/test/utils/TestUtilsWalletStorage.ts +23 -5
- package/test/wallet/list/listActions2.test.ts +128 -167
- package/ts2md.json +14 -0
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@ The BSV Wallet Toolbox builds on the [SDK](https://bitcoin-sv.github.io/ts-sdk)
|
|
|
9
9
|
|
|
10
10
|
# Table of Contents
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
- [Objective](#objective)
|
|
13
|
+
- [Getting Started](#getting-started)
|
|
14
|
+
- [Features \& Deliverables](#features--deliverables)
|
|
15
|
+
- [Documentation](#documentation)
|
|
16
|
+
- [Contribution Guidelines](#contribution-guidelines)
|
|
17
|
+
- [Support \& Contacts](#support--contacts)
|
|
18
|
+
- [License](#license)
|
|
19
19
|
|
|
20
20
|
## Objective
|
|
21
21
|
|
|
@@ -23,72 +23,6 @@ The BSV Wallet Toolbox Project aims to support building sophisticated applicatio
|
|
|
23
23
|
|
|
24
24
|
By providing interlocking building blocks for persistent storage and protocol based key derivation, it serves as an essential toolbox for developers looking to build on the BSV Blockchain.
|
|
25
25
|
|
|
26
|
-
## Getting Started
|
|
27
|
-
|
|
28
|
-
### Installation
|
|
29
|
-
|
|
30
|
-
To install the toolbox, run:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npm install @bsv/wallet-toolbox
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Basic Usage
|
|
37
|
-
|
|
38
|
-
Here's a simple example of using the toolbox to create and fund a testnet wallet using SQLite for persistent storage:
|
|
39
|
-
|
|
40
|
-
```javascript
|
|
41
|
-
import { InternalizeActionArgs, PrivateKey, Utils } from '@bsv/sdk'
|
|
42
|
-
import { test } from '@bsv/wallet-toolbox'
|
|
43
|
-
|
|
44
|
-
const rootKeyHex = PrivateKey.fromRandom().toString()
|
|
45
|
-
console.log(`MAKE A SECURE COPY OF YOUR WALLET PRIVATE ROOT KEY: ${rootKeyHex}`)
|
|
46
|
-
|
|
47
|
-
const { wallet } = await test._tu.createSQLiteTestWallet({
|
|
48
|
-
filePath: './myTestWallet.sqlite',
|
|
49
|
-
databaseName: 'myTestWallet',
|
|
50
|
-
chain: 'test',
|
|
51
|
-
rootKeyHex
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
// Obtain a Wallet Payment for your new wallet from a testnet funding faucet.
|
|
55
|
-
// Update or replace the values in the following example object with your actual funding payment.
|
|
56
|
-
// Note that the values below will not be accepted as they are not intended for your new wallet.
|
|
57
|
-
const r = {
|
|
58
|
-
senderIdentityKey: '03ac2d10bdb0023f4145cc2eba2fcd2ad3070cb2107b0b48170c46a9440e4cc3fe',
|
|
59
|
-
vout: 0,
|
|
60
|
-
txid: '942f094cee517276182e5857369ea53d64763a327d433489312a9606db188dfb',
|
|
61
|
-
derivationPrefix: 'jSlU588BWkw=',
|
|
62
|
-
derivationSuffix: 'l37vv/Bn4Lw=',
|
|
63
|
-
atomicBEEF: '01010101942f094cee517...a914b29d56273f6c1df90cd8f383c8117680f2bdd05188ac00000000'
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const args: InternalizeActionArgs = {
|
|
67
|
-
tx: Utils.toArray(r.atomicBEEF, 'hex'),
|
|
68
|
-
outputs: [
|
|
69
|
-
{
|
|
70
|
-
outputIndex: r.vout,
|
|
71
|
-
protocol: 'wallet payment',
|
|
72
|
-
paymentRemittance: {
|
|
73
|
-
derivationPrefix: r.derivationPrefix,
|
|
74
|
-
derivationSuffix: r.derivationSuffix,
|
|
75
|
-
senderIdentityKey: r.senderIdentityKey
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
description: 'from faucet'
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const rw = await wallet.internalizeAction(args)
|
|
83
|
-
console.log(rw.accepted)
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
For a more detailed tutorial and advanced examples, check our [Documentation](#documentation).
|
|
87
|
-
|
|
88
|
-
## Features & Deliverables
|
|
89
|
-
|
|
90
|
-
- **Feature1**: Summary of feature1.
|
|
91
|
-
|
|
92
26
|
## Documentation
|
|
93
27
|
|
|
94
28
|
[The Docs](https://bitcoin-sv.github.io/wallet-toolbox) are available here on Github pages.
|
|
@@ -96,6 +30,11 @@ For a more detailed tutorial and advanced examples, check our [Documentation](#d
|
|
|
96
30
|
|
|
97
31
|
The Toolbox is richly documented with code-level annotations. This should show up well within editors like VSCode.
|
|
98
32
|
|
|
33
|
+
|
|
34
|
+
## Features & Deliverables
|
|
35
|
+
|
|
36
|
+
- **Feature1**: Summary of feature1.
|
|
37
|
+
|
|
99
38
|
## Contribution Guidelines
|
|
100
39
|
|
|
101
40
|
We're always looking for contributors to help us improve the SDK. Whether it's bug reports, feature requests, or pull requests - all contributions are welcome.
|
|
@@ -121,4 +60,3 @@ For questions, bug reports, or feature requests, please open an issue on GitHub
|
|
|
121
60
|
The license for the code in this repository is the Open BSV License. Refer to [LICENSE.txt](./LICENSE.txt) for the license text.
|
|
122
61
|
|
|
123
62
|
Thank you for being a part of the BSV Blockchain Libraries Project. Let's build the future of BSV Blockchain together!
|
|
124
|
-
|
package/docs/README.md
CHANGED
|
@@ -2,14 +2,77 @@
|
|
|
2
2
|
|
|
3
3
|
The documentation is split into various pages, each covering a set of related functionality. The pages are as follows:
|
|
4
4
|
|
|
5
|
-
- [
|
|
6
|
-
- [
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
9
|
-
- [
|
|
5
|
+
- [Getting Started](#getting-started) -
|
|
6
|
+
- [Wallet](./wallet.md) —
|
|
7
|
+
- [Client](./client.md) —
|
|
8
|
+
- [Storage](./storage.md) —
|
|
9
|
+
- [Services](./services.md) —
|
|
10
|
+
- [Monitor](./monitor.md) —
|
|
10
11
|
|
|
11
12
|
## Swagger
|
|
12
13
|
|
|
13
14
|
[BRC-100](https://brc.dev/100) defines a Unified, Vendor-Neutral, Unchanging, and Open BSV Blockchain Standard Wallet-to-Application Interface which is implemented in this library within the WalletClient class. The API is laid out here as a swagger openapi document to offer a fast-track to understanding the interface which is implemented across multiple substrates. The JSON api is generally considered a developer friendly introduction to the WalletClient, where an binary equivalent ABI may be preferred for production use cases.
|
|
14
15
|
|
|
15
|
-
- [Wallet JSON API Swagger](https://bitcoin-sv.github.io/ts-sdk/swagger)
|
|
16
|
+
- [Wallet JSON API Swagger](https://bitcoin-sv.github.io/ts-sdk/swagger)
|
|
17
|
+
|
|
18
|
+
## Getting Started
|
|
19
|
+
|
|
20
|
+
### Installation
|
|
21
|
+
|
|
22
|
+
To install the toolbox, run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @bsv/wallet-toolbox
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Basic Usage
|
|
29
|
+
|
|
30
|
+
Here's a simple example of using the toolbox to create and fund a testnet wallet using SQLite for persistent storage:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { InternalizeActionArgs, PrivateKey, Utils } from '@bsv/sdk'
|
|
34
|
+
import { Setup } from '@bsv/wallet-toolbox'
|
|
35
|
+
|
|
36
|
+
const rootKeyHex = PrivateKey.fromRandom().toString()
|
|
37
|
+
console.log(`MAKE A SECURE COPY OF YOUR WALLET PRIVATE ROOT KEY: ${rootKeyHex}`)
|
|
38
|
+
|
|
39
|
+
const { wallet } = await Setup.createSQLiteWallet({
|
|
40
|
+
filePath: './myTestWallet.sqlite',
|
|
41
|
+
databaseName: 'myTestWallet',
|
|
42
|
+
chain: 'test',
|
|
43
|
+
rootKeyHex
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
// Obtain a Wallet Payment for your new wallet from a testnet funding faucet.
|
|
47
|
+
// Update or replace the values in the following example object with your actual funding payment.
|
|
48
|
+
// Note that the values below will not be accepted as they are not intended for your new wallet.
|
|
49
|
+
const r = {
|
|
50
|
+
senderIdentityKey: '03ac2d10bdb0023f4145cc2eba2fcd2ad3070cb2107b0b48170c46a9440e4cc3fe',
|
|
51
|
+
vout: 0,
|
|
52
|
+
txid: '942f094cee517276182e5857369ea53d64763a327d433489312a9606db188dfb',
|
|
53
|
+
derivationPrefix: 'jSlU588BWkw=',
|
|
54
|
+
derivationSuffix: 'l37vv/Bn4Lw=',
|
|
55
|
+
atomicBEEF: '01010101942f094cee517...a914b29d56273f6c1df90cd8f383c8117680f2bdd05188ac00000000'
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const args: InternalizeActionArgs = {
|
|
59
|
+
tx: Utils.toArray(r.atomicBEEF, 'hex'),
|
|
60
|
+
outputs: [
|
|
61
|
+
{
|
|
62
|
+
outputIndex: r.vout,
|
|
63
|
+
protocol: 'wallet payment',
|
|
64
|
+
paymentRemittance: {
|
|
65
|
+
derivationPrefix: r.derivationPrefix,
|
|
66
|
+
derivationSuffix: r.derivationSuffix,
|
|
67
|
+
senderIdentityKey: r.senderIdentityKey
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
description: 'from faucet'
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const rw = await wallet.internalizeAction(args)
|
|
75
|
+
console.log(rw.accepted)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For a more detailed tutorial and advanced examples, check our [Documentation](#documentation).
|
package/docs/client.md
CHANGED
|
@@ -6,46 +6,47 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6
6
|
|
|
7
7
|
| | | |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
-
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [
|
|
10
|
-
| [ArcMinerPostBeefDataApi](#interface-arcminerpostbeefdataapi) | [
|
|
11
|
-
| [ArcMinerPostTxsData](#interface-arcminerposttxsdata) | [
|
|
12
|
-
| [ArcServiceConfig](#interface-arcserviceconfig) | [
|
|
13
|
-
| [AuthId](#interface-authid) | [
|
|
14
|
-
| [BaseBlockHeader](#interface-baseblockheader) | [
|
|
15
|
-
| [BlockHeader](#interface-blockheader) | [
|
|
16
|
-
| [BsvExchangeRate](#interface-bsvexchangerate) | [
|
|
17
|
-
| [CertOpsWallet](#interface-certopswallet) | [
|
|
18
|
-
| [CommitNewTxResults](#interface-commitnewtxresults) | [
|
|
19
|
-
| [EntityTimeStamp](#interface-entitytimestamp) | [
|
|
20
|
-
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [
|
|
21
|
-
| [FiatExchangeRates](#interface-fiatexchangerates) | [
|
|
22
|
-
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [
|
|
23
|
-
| [FindCertificatesArgs](#interface-findcertificatesargs) | [
|
|
24
|
-
| [FindCommissionsArgs](#interface-findcommissionsargs) | [
|
|
25
|
-
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [
|
|
26
|
-
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [
|
|
27
|
-
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [
|
|
28
|
-
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [
|
|
29
|
-
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [
|
|
30
|
-
| [FindOutputsArgs](#interface-findoutputsargs) | [
|
|
31
|
-
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [
|
|
32
|
-
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [
|
|
33
|
-
| [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [
|
|
34
|
-
| [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageFeeModel](#interface-storagefeemodel) | [
|
|
35
|
-
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [
|
|
36
|
-
| [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageIdentity](#interface-storageidentity) | [
|
|
37
|
-
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [
|
|
38
|
-
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [
|
|
39
|
-
| [FindUsersArgs](#interface-findusersargs) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [
|
|
40
|
-
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageProvenOrReq](#interface-storageprovenorreq) | [
|
|
41
|
-
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageProviderOptions](#interface-storageprovideroptions) | [
|
|
42
|
-
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageReaderOptions](#interface-storagereaderoptions) | [
|
|
43
|
-
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [
|
|
44
|
-
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [StorageSyncReader](#interface-storagesyncreader) | [
|
|
45
|
-
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [
|
|
46
|
-
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StorageSyncReaderWriter](#interface-storagesyncreaderwriter) | [
|
|
47
|
-
| [GetMerklePathResult](#interface-getmerklepathresult) | [SyncChunk](#interface-syncchunk) | [
|
|
48
|
-
| [GetRawTxResult](#interface-getrawtxresult) | [TaskPurgeParams](#interface-taskpurgeparams) |
|
|
9
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
|
|
10
|
+
| [ArcMinerPostBeefDataApi](#interface-arcminerpostbeefdataapi) | [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TxScriptOffsets](#interface-txscriptoffsets) |
|
|
11
|
+
| [ArcMinerPostTxsData](#interface-arcminerposttxsdata) | [GetUtxoStatusResult](#interface-getutxostatusresult) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
|
|
12
|
+
| [ArcServiceConfig](#interface-arcserviceconfig) | [KeyPair](#interface-keypair) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
|
|
13
|
+
| [AuthId](#interface-authid) | [MonitorOptions](#interface-monitoroptions) | [ValidAbortActionArgs](#interface-validabortactionargs) |
|
|
14
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [OutPoint](#interface-outpoint) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
|
|
15
|
+
| [BlockHeader](#interface-blockheader) | [Paged](#interface-paged) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
|
|
16
|
+
| [BsvExchangeRate](#interface-bsvexchangerate) | [PendingSignAction](#interface-pendingsignaction) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
|
|
17
|
+
| [CertOpsWallet](#interface-certopswallet) | [PendingStorageInput](#interface-pendingstorageinput) | [ValidBasketInsertion](#interface-validbasketinsertion) |
|
|
18
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [PostBeefResult](#interface-postbeefresult) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
|
|
19
|
+
| [EntityTimeStamp](#interface-entitytimestamp) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [ValidCreateActionInput](#interface-validcreateactioninput) |
|
|
20
|
+
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
|
|
21
|
+
| [FiatExchangeRates](#interface-fiatexchangerates) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
|
|
22
|
+
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
|
|
23
|
+
| [FindCertificatesArgs](#interface-findcertificatesargs) | [PostTxsResult](#interface-posttxsresult) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
|
|
24
|
+
| [FindCommissionsArgs](#interface-findcommissionsargs) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
|
|
25
|
+
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [ProvenOrRawTx](#interface-provenorrawtx) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
|
|
26
|
+
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [PurgeParams](#interface-purgeparams) | [ValidListActionsArgs](#interface-validlistactionsargs) |
|
|
27
|
+
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [PurgeResults](#interface-purgeresults) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
|
|
28
|
+
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
|
|
29
|
+
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [ScriptTemplateParamsSABPPP](#interface-scripttemplateparamssabppp) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
|
|
30
|
+
| [FindOutputsArgs](#interface-findoutputsargs) | [SetupWalletOnly](#interface-setupwalletonly) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
|
|
31
|
+
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
|
|
32
|
+
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
|
|
33
|
+
| [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
|
|
34
|
+
| [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidSignActionArgs](#interface-validsignactionargs) |
|
|
35
|
+
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidSignActionOptions](#interface-validsignactionoptions) |
|
|
36
|
+
| [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageIdentity](#interface-storageidentity) | [ValidWalletPayment](#interface-validwalletpayment) |
|
|
37
|
+
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
|
|
38
|
+
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [WalletArgs](#interface-walletargs) |
|
|
39
|
+
| [FindUsersArgs](#interface-findusersargs) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [WalletServices](#interface-walletservices) |
|
|
40
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageProvenOrReq](#interface-storageprovenorreq) | [WalletServicesOptions](#interface-walletservicesoptions) |
|
|
41
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageProviderOptions](#interface-storageprovideroptions) | [WalletSigner](#interface-walletsigner) |
|
|
42
|
+
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageReaderOptions](#interface-storagereaderoptions) | [WalletStorage](#interface-walletstorage) |
|
|
43
|
+
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [WalletStorageProvider](#interface-walletstorageprovider) |
|
|
44
|
+
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [StorageSyncReader](#interface-storagesyncreader) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
45
|
+
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
46
|
+
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [StorageSyncReaderWriter](#interface-storagesyncreaderwriter) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
47
|
+
| [GetMerklePathResult](#interface-getmerklepathresult) | [SyncChunk](#interface-syncchunk) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
48
|
+
| [GetRawTxResult](#interface-getrawtxresult) | [TaskPurgeParams](#interface-taskpurgeparams) | |
|
|
49
|
+
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [TrxToken](#interface-trxtoken) | |
|
|
49
50
|
|
|
50
51
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
51
52
|
|
|
@@ -1512,6 +1513,26 @@ export interface ScriptTemplateParamsSABPPP {
|
|
|
1512
1513
|
|
|
1513
1514
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1514
1515
|
|
|
1516
|
+
---
|
|
1517
|
+
### Interface: SetupWalletOnly
|
|
1518
|
+
|
|
1519
|
+
```ts
|
|
1520
|
+
export interface SetupWalletOnly {
|
|
1521
|
+
rootKey: PrivateKey;
|
|
1522
|
+
identityKey: string;
|
|
1523
|
+
keyDeriver: KeyDeriver;
|
|
1524
|
+
chain: sdk.Chain;
|
|
1525
|
+
storage: WalletStorageManager;
|
|
1526
|
+
services: Services;
|
|
1527
|
+
monitor: Monitor;
|
|
1528
|
+
wallet: Wallet;
|
|
1529
|
+
}
|
|
1530
|
+
```
|
|
1531
|
+
|
|
1532
|
+
See also: [Chain](#type-chain), [Monitor](#class-monitor), [Services](#class-services), [Wallet](#class-wallet), [WalletStorageManager](#class-walletstoragemanager)
|
|
1533
|
+
|
|
1534
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1535
|
+
|
|
1515
1536
|
---
|
|
1516
1537
|
### Interface: StorageCreateActionResult
|
|
1517
1538
|
|
|
@@ -3081,18 +3102,18 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
3081
3102
|
|
|
3082
3103
|
| | | |
|
|
3083
3104
|
| --- | --- | --- |
|
|
3084
|
-
| [CertOps](#class-certops) | [
|
|
3085
|
-
| [Monitor](#class-monitor) | [
|
|
3086
|
-
| [PrivilegedKeyManager](#class-privilegedkeymanager) | [
|
|
3087
|
-
| [ScriptTemplateSABPPP](#class-scripttemplatesabppp) | [
|
|
3088
|
-
| [ServiceCollection](#class-servicecollection) | [
|
|
3089
|
-
| [Services](#class-services) | [
|
|
3105
|
+
| [CertOps](#class-certops) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
|
|
3106
|
+
| [Monitor](#class-monitor) | [TaskClock](#class-taskclock) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
|
|
3107
|
+
| [PrivilegedKeyManager](#class-privilegedkeymanager) | [TaskFailAbandoned](#class-taskfailabandoned) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
|
|
3108
|
+
| [ScriptTemplateSABPPP](#class-scripttemplatesabppp) | [TaskNewHeader](#class-tasknewheader) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
|
|
3109
|
+
| [ServiceCollection](#class-servicecollection) | [TaskPurge](#class-taskpurge) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
|
|
3110
|
+
| [Services](#class-services) | [TaskReviewStatus](#class-taskreviewstatus) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
|
|
3111
|
+
| [SetupClient](#class-setupclient) | [TaskSendWaiting](#class-tasksendwaiting) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
|
|
3090
3112
|
| [StorageClient](#class-storageclient) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) | [Wallet](#class-wallet) |
|
|
3091
3113
|
| [StorageProvider](#class-storageprovider) | [WERR_BAD_REQUEST](#class-werr_bad_request) | [WalletError](#class-walleterror) |
|
|
3092
3114
|
| [StorageReader](#class-storagereader) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) | [WalletMonitorTask](#class-walletmonitortask) |
|
|
3093
3115
|
| [StorageReaderWriter](#class-storagereaderwriter) | [WERR_INTERNAL](#class-werr_internal) | [WalletSigner](#class-walletsigner) |
|
|
3094
3116
|
| [StorageSyncReader](#class-storagesyncreader) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
3095
|
-
| [TaskCheckForProofs](#class-taskcheckforproofs) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) | |
|
|
3096
3117
|
|
|
3097
3118
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3098
3119
|
|
|
@@ -3327,7 +3348,7 @@ IMPORTANT: While these measures raise the bar for attackers, JavaScript environm
|
|
|
3327
3348
|
do not provide perfect in-memory secrecy.
|
|
3328
3349
|
|
|
3329
3350
|
```ts
|
|
3330
|
-
export class PrivilegedKeyManager {
|
|
3351
|
+
export class PrivilegedKeyManager implements ProtoWallet {
|
|
3331
3352
|
constructor(keyGetter: (reason: string) => Promise<PrivateKey>, retentionPeriod = 120000)
|
|
3332
3353
|
destroyKey(): void
|
|
3333
3354
|
async getPublicKey(args: GetPublicKeyArgs): Promise<{
|
|
@@ -3502,6 +3523,78 @@ See also: [PostTxsResult](#interface-posttxsresult)
|
|
|
3502
3523
|
|
|
3503
3524
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3504
3525
|
|
|
3526
|
+
---
|
|
3527
|
+
### Class: SetupClient
|
|
3528
|
+
|
|
3529
|
+
This class provides static setup functions to construct BRC-100 compatible
|
|
3530
|
+
wallets in a variety of configurations.
|
|
3531
|
+
|
|
3532
|
+
It serves as a starting point for experimentation and customization.
|
|
3533
|
+
|
|
3534
|
+
```ts
|
|
3535
|
+
export abstract class SetupClient {
|
|
3536
|
+
static makeEnv(chain: sdk.Chain): void {
|
|
3537
|
+
const testPrivKey1 = PrivateKey.fromRandom();
|
|
3538
|
+
const testIdentityKey1 = testPrivKey1.toPublicKey().toString();
|
|
3539
|
+
const testPrivKey2 = PrivateKey.fromRandom();
|
|
3540
|
+
const testIdentityKey2 = testPrivKey2.toPublicKey().toString();
|
|
3541
|
+
const mainPrivKey1 = PrivateKey.fromRandom();
|
|
3542
|
+
const mainIdentityKey1 = mainPrivKey1.toPublicKey().toString();
|
|
3543
|
+
const mainPrivKey2 = PrivateKey.fromRandom();
|
|
3544
|
+
const mainIdentityKey2 = mainPrivKey2.toPublicKey().toString();
|
|
3545
|
+
const log = `
|
|
3546
|
+
# Add the following to .env file:
|
|
3547
|
+
MAIN_TAAL_API_KEY='mainnet_9596de07e92300c6287e4393594ae39c'
|
|
3548
|
+
TEST_TAAL_API_KEY='testnet_0e6cf72133b43ea2d7861da2a38684e3'
|
|
3549
|
+
MY_TEST_IDENTITY = '${testIdentityKey1}'
|
|
3550
|
+
MY_TEST_IDENTITY2 = '${testIdentityKey2}'
|
|
3551
|
+
MY_MAIN_IDENTITY = '${mainIdentityKey1}'
|
|
3552
|
+
MY_MAIN_IDENTITY2 = '${mainIdentityKey2}'
|
|
3553
|
+
DEV_KEYS = '{
|
|
3554
|
+
"${testIdentityKey1}": "${testPrivKey1.toString()}",
|
|
3555
|
+
"${testIdentityKey2}": "${testPrivKey2.toString()}"
|
|
3556
|
+
"${mainIdentityKey1}": "${mainPrivKey1.toString()}",
|
|
3557
|
+
"${mainIdentityKey2}": "${mainPrivKey2.toString()}"
|
|
3558
|
+
}'
|
|
3559
|
+
MYSQL_CONNECTION='{"port":3306,"host":"127.0.0.1","user":"root","password":"<your_password>","database":"<your_database>", "timezone": "Z"}'
|
|
3560
|
+
`;
|
|
3561
|
+
console.log(log);
|
|
3562
|
+
}
|
|
3563
|
+
static getEnv(chain: sdk.Chain)
|
|
3564
|
+
static async createNoSendP2PKHOutpoint(basket: string, address: string, satoshis: number, noSendChange: string[] | undefined, wallet: WalletInterface): Promise<{
|
|
3565
|
+
noSendChange: string[];
|
|
3566
|
+
txid: string;
|
|
3567
|
+
cr: CreateActionResult;
|
|
3568
|
+
sr: SignActionResult;
|
|
3569
|
+
}>
|
|
3570
|
+
static async createNoSendP2PKHOutpoints(count: number, basket: string, address: string, satoshis: number, noSendChange: string[] | undefined, wallet: WalletInterface): Promise<{
|
|
3571
|
+
noSendChange: string[];
|
|
3572
|
+
txid: string;
|
|
3573
|
+
cr: CreateActionResult;
|
|
3574
|
+
sr: SignActionResult;
|
|
3575
|
+
}>
|
|
3576
|
+
static getKeyPair(priv?: string | PrivateKey): KeyPairAddress
|
|
3577
|
+
static getLockP2PKH(address: string)
|
|
3578
|
+
static getUnlockP2PKH(priv: PrivateKey, satoshis: number)
|
|
3579
|
+
static async createWalletOnly(args: {
|
|
3580
|
+
chain?: sdk.Chain;
|
|
3581
|
+
rootKeyHex?: string;
|
|
3582
|
+
active?: sdk.WalletStorageProvider;
|
|
3583
|
+
backups?: sdk.WalletStorageProvider[];
|
|
3584
|
+
privKeyHex?: string;
|
|
3585
|
+
}): Promise<SetupWalletOnly>
|
|
3586
|
+
static async createWalletWithStorageClient(args: {
|
|
3587
|
+
rootKeyHex?: string;
|
|
3588
|
+
endpointUrl?: string;
|
|
3589
|
+
chain?: sdk.Chain;
|
|
3590
|
+
}): Promise<SetupWalletOnly>
|
|
3591
|
+
}
|
|
3592
|
+
```
|
|
3593
|
+
|
|
3594
|
+
See also: [Chain](#type-chain), [KeyPairAddress](#type-keypairaddress), [SetupWalletOnly](#interface-setupwalletonly), [WalletStorageProvider](#interface-walletstorageprovider)
|
|
3595
|
+
|
|
3596
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3597
|
+
|
|
3505
3598
|
---
|
|
3506
3599
|
### Class: StorageClient
|
|
3507
3600
|
|
|
@@ -4426,7 +4519,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4426
4519
|
### Class: Wallet
|
|
4427
4520
|
|
|
4428
4521
|
```ts
|
|
4429
|
-
export class Wallet implements WalletInterface {
|
|
4522
|
+
export class Wallet implements WalletInterface, ProtoWallet {
|
|
4430
4523
|
chain: sdk.Chain;
|
|
4431
4524
|
keyDeriver: KeyDeriver;
|
|
4432
4525
|
storage: WalletStorageManager;
|
|
@@ -6548,8 +6641,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6548
6641
|
| [GetRawTxService](#type-getrawtxservice) | [StorageProvidedBy](#type-storageprovidedby) |
|
|
6549
6642
|
| [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [SyncProtocolVersion](#type-syncprotocolversion) |
|
|
6550
6643
|
| [GetUtxoStatusService](#type-getutxostatusservice) | [SyncStatus](#type-syncstatus) |
|
|
6551
|
-
| [
|
|
6552
|
-
| [
|
|
6644
|
+
| [KeyPairAddress](#type-keypairaddress) | [TransactionStatus](#type-transactionstatus) |
|
|
6645
|
+
| [MonitorStorage](#type-monitorstorage) | [UpdateFiatExchangeRateService](#type-updatefiatexchangerateservice) |
|
|
6646
|
+
| [PostBeefService](#type-postbeefservice) | |
|
|
6553
6647
|
|
|
6554
6648
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6555
6649
|
|
|
@@ -6614,6 +6708,19 @@ See also: [Chain](#type-chain), [GetUtxoStatusOutputFormat](#type-getutxostatuso
|
|
|
6614
6708
|
|
|
6615
6709
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6616
6710
|
|
|
6711
|
+
---
|
|
6712
|
+
### Type: KeyPairAddress
|
|
6713
|
+
|
|
6714
|
+
```ts
|
|
6715
|
+
export type KeyPairAddress = {
|
|
6716
|
+
privateKey: PrivateKey;
|
|
6717
|
+
publicKey: PublicKey;
|
|
6718
|
+
address: string;
|
|
6719
|
+
}
|
|
6720
|
+
```
|
|
6721
|
+
|
|
6722
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6723
|
+
|
|
6617
6724
|
---
|
|
6618
6725
|
### Type: MonitorStorage
|
|
6619
6726
|
|
package/docs/monitor.md
CHANGED
|
@@ -303,7 +303,7 @@ export class TaskCheckForProofs extends WalletMonitorTask {
|
|
|
303
303
|
}
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
-
See also: [Monitor](#class-monitor), [WalletMonitorTask](#class-walletmonitortask)
|
|
306
|
+
See also: [Monitor](#class-monitor), [WalletMonitorTask](#class-walletmonitortask)
|
|
307
307
|
|
|
308
308
|
<details>
|
|
309
309
|
|
|
@@ -338,7 +338,6 @@ async getProofs(reqs: table.ProvenTxReq[], indent = 0, countsAsAttempt = false,
|
|
|
338
338
|
log: string;
|
|
339
339
|
}>
|
|
340
340
|
```
|
|
341
|
-
See also: [log](#variable-log)
|
|
342
341
|
|
|
343
342
|
Returns
|
|
344
343
|
|