@bsv/wallet-toolbox 1.2.36 → 1.2.37
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/.github/pull_request_template.md +0 -2
- package/docs/client.md +244 -169
- package/docs/wallet.md +244 -169
- package/out/src/CWIStyleWalletManager.d.ts +151 -131
- package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
- package/out/src/CWIStyleWalletManager.js +654 -555
- package/out/src/CWIStyleWalletManager.js.map +1 -1
- package/out/src/__tests/CWIStyleWalletManager.test.js +6 -6
- package/out/src/__tests/CWIStyleWalletManager.test.js.map +1 -1
- package/out/test/Wallet/local/localWallet.man.test.js.map +1 -1
- package/out/test/Wallet/local/localWallet2.man.test.js +10 -1
- package/out/test/Wallet/local/localWallet2.man.test.js.map +1 -1
- package/out/test/Wallet/support/opers1.man.test.js +6 -4
- package/out/test/Wallet/support/opers1.man.test.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/CWIStyleWalletManager.ts +821 -663
- package/src/__tests/CWIStyleWalletManager.test.ts +6 -6
- package/test/Wallet/local/localWallet.man.test.ts +1 -5
- package/test/Wallet/local/localWallet2.man.test.ts +13 -3
- package/test/Wallet/support/opers1.man.test.ts +26 -21
package/docs/wallet.md
CHANGED
|
@@ -13,64 +13,65 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
13
13
|
|
|
14
14
|
| | | |
|
|
15
15
|
| --- | --- | --- |
|
|
16
|
-
| [ArcConfig](#interface-arcconfig) | [
|
|
17
|
-
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [
|
|
18
|
-
| [AuthId](#interface-authid) | [
|
|
19
|
-
| [AuthPayload](#interface-authpayload) | [
|
|
20
|
-
| [BaseBlockHeader](#interface-baseblockheader) | [PermissionRequest](#interface-permissionrequest) | [TableTxLabel](#interface-tabletxlabel) |
|
|
16
|
+
| [ArcConfig](#interface-arcconfig) | [Paged](#interface-paged) | [TableSettings](#interface-tablesettings) |
|
|
17
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [PendingSignAction](#interface-pendingsignaction) | [TableSyncState](#interface-tablesyncstate) |
|
|
18
|
+
| [AuthId](#interface-authid) | [PendingStorageInput](#interface-pendingstorageinput) | [TableTransaction](#interface-tabletransaction) |
|
|
19
|
+
| [AuthPayload](#interface-authpayload) | [PermissionRequest](#interface-permissionrequest) | [TableTxLabel](#interface-tabletxlabel) |
|
|
21
20
|
| [BaseBlockHeader](#interface-baseblockheader) | [PermissionToken](#interface-permissiontoken) | [TableTxLabelMap](#interface-tabletxlabelmap) |
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
21
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TableUser](#interface-tableuser) |
|
|
22
|
+
| [BitailsConfig](#interface-bitailsconfig) | [PostBeefResult](#interface-postbeefresult) | [TaskPurgeParams](#interface-taskpurgeparams) |
|
|
23
|
+
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TrustSettings](#interface-trustsettings) |
|
|
25
24
|
| [BlockHeader](#interface-blockheader) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TrxToken](#interface-trxtoken) |
|
|
26
|
-
| [
|
|
27
|
-
| [
|
|
28
|
-
| [
|
|
29
|
-
| [
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
32
|
-
| [
|
|
33
|
-
| [
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
40
|
-
| [
|
|
41
|
-
| [
|
|
42
|
-
| [
|
|
43
|
-
| [
|
|
44
|
-
| [
|
|
45
|
-
| [
|
|
46
|
-
| [
|
|
47
|
-
| [
|
|
48
|
-
| [
|
|
49
|
-
| [
|
|
50
|
-
| [
|
|
51
|
-
| [
|
|
52
|
-
| [
|
|
53
|
-
| [
|
|
54
|
-
| [
|
|
55
|
-
| [
|
|
56
|
-
| [
|
|
57
|
-
| [
|
|
58
|
-
| [
|
|
59
|
-
| [
|
|
60
|
-
| [
|
|
61
|
-
| [
|
|
62
|
-
| [
|
|
63
|
-
| [
|
|
64
|
-
| [
|
|
65
|
-
| [
|
|
66
|
-
| [
|
|
67
|
-
| [
|
|
68
|
-
| [
|
|
69
|
-
| [
|
|
70
|
-
| [
|
|
71
|
-
| [
|
|
72
|
-
| [
|
|
73
|
-
| [
|
|
25
|
+
| [BlockHeader](#interface-blockheader) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
|
|
26
|
+
| [BsvExchangeRate](#interface-bsvexchangerate) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TxScriptOffsets](#interface-txscriptoffsets) |
|
|
27
|
+
| [CertOpsWallet](#interface-certopswallet) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [UMPToken](#interface-umptoken) |
|
|
28
|
+
| [Certifier](#interface-certifier) | [PostTxsResult](#interface-posttxsresult) | [UMPTokenInteractor](#interface-umptokeninteractor) |
|
|
29
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
|
|
30
|
+
| [CompleteAuthResponse](#interface-completeauthresponse) | [Profile](#interface-profile) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
|
|
31
|
+
| [CreateActionResultX](#interface-createactionresultx) | [ProvenOrRawTx](#interface-provenorrawtx) | [ValidAbortActionArgs](#interface-validabortactionargs) |
|
|
32
|
+
| [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
|
|
33
|
+
| [EntityTimeStamp](#interface-entitytimestamp) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
|
|
34
|
+
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
|
|
35
|
+
| [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [ValidBasketInsertion](#interface-validbasketinsertion) |
|
|
36
|
+
| [FiatExchangeRates](#interface-fiatexchangerates) | [PurgeParams](#interface-purgeparams) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
|
|
37
|
+
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [PurgeResults](#interface-purgeresults) | [ValidCreateActionInput](#interface-validcreateactioninput) |
|
|
38
|
+
| [FindCertificatesArgs](#interface-findcertificatesargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
|
|
39
|
+
| [FindCommissionsArgs](#interface-findcommissionsargs) | [ReviewActionResult](#interface-reviewactionresult) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
|
|
40
|
+
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
|
|
41
|
+
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
|
|
42
|
+
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [SignActionResultX](#interface-signactionresultx) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
|
|
43
|
+
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [StartAuthResponse](#interface-startauthresponse) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
|
|
44
|
+
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [StatusForTxidResult](#interface-statusfortxidresult) | [ValidListActionsArgs](#interface-validlistactionsargs) |
|
|
45
|
+
| [FindOutputsArgs](#interface-findoutputsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
|
|
46
|
+
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
|
|
47
|
+
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
|
|
48
|
+
| [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
|
|
49
|
+
| [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
|
|
50
|
+
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageIdentity](#interface-storageidentity) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
|
|
51
|
+
| [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
|
|
52
|
+
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [ValidSignActionArgs](#interface-validsignactionargs) |
|
|
53
|
+
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [ValidSignActionOptions](#interface-validsignactionoptions) |
|
|
54
|
+
| [FindUsersArgs](#interface-findusersargs) | [StorageProvenOrReq](#interface-storageprovenorreq) | [ValidWalletPayment](#interface-validwalletpayment) |
|
|
55
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageProviderOptions](#interface-storageprovideroptions) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
|
|
56
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageReaderOptions](#interface-storagereaderoptions) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
|
|
57
|
+
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [WalletArgs](#interface-walletargs) |
|
|
58
|
+
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [WalletBalance](#interface-walletbalance) |
|
|
59
|
+
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [SyncChunk](#interface-syncchunk) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
|
|
60
|
+
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [SyncError](#interface-syncerror) | [WalletServices](#interface-walletservices) |
|
|
61
|
+
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [SyncMap](#interface-syncmap) | [WalletServicesOptions](#interface-walletservicesoptions) |
|
|
62
|
+
| [GetMerklePathResult](#interface-getmerklepathresult) | [TableCertificate](#interface-tablecertificate) | [WalletSettings](#interface-walletsettings) |
|
|
63
|
+
| [GetRawTxResult](#interface-getrawtxresult) | [TableCertificateField](#interface-tablecertificatefield) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
|
|
64
|
+
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [TableCertificateX](#interface-tablecertificatex) | [WalletSigner](#interface-walletsigner) |
|
|
65
|
+
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [TableCommission](#interface-tablecommission) | [WalletStorage](#interface-walletstorage) |
|
|
66
|
+
| [GetScriptHashHistory](#interface-getscripthashhistory) | [TableMonitorEvent](#interface-tablemonitorevent) | [WalletStorageProvider](#interface-walletstorageprovider) |
|
|
67
|
+
| [GetScriptHashHistoryResult](#interface-getscripthashhistoryresult) | [TableOutput](#interface-tableoutput) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
68
|
+
| [GetStatusForTxidsResult](#interface-getstatusfortxidsresult) | [TableOutputBasket](#interface-tableoutputbasket) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
69
|
+
| [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TableOutputTag](#interface-tableoutputtag) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
|
|
70
|
+
| [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableOutputTagMap](#interface-tableoutputtagmap) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
71
|
+
| [KeyPair](#interface-keypair) | [TableOutputX](#interface-tableoutputx) | [WalletTheme](#interface-wallettheme) |
|
|
72
|
+
| [LiveBlockHeader](#interface-liveblockheader) | [TableProvenTx](#interface-tableproventx) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
73
|
+
| [MonitorOptions](#interface-monitoroptions) | [TableProvenTxReq](#interface-tableproventxreq) | |
|
|
74
|
+
| [OutPoint](#interface-outpoint) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) | |
|
|
74
75
|
|
|
75
76
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
76
77
|
|
|
@@ -2160,6 +2161,63 @@ See also: [WalletError](./client.md#class-walleterror)
|
|
|
2160
2161
|
|
|
2161
2162
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2162
2163
|
|
|
2164
|
+
---
|
|
2165
|
+
##### Interface: Profile
|
|
2166
|
+
|
|
2167
|
+
Describes the structure of a user profile within the wallet.
|
|
2168
|
+
|
|
2169
|
+
```ts
|
|
2170
|
+
export interface Profile {
|
|
2171
|
+
name: string;
|
|
2172
|
+
id: number[];
|
|
2173
|
+
primaryPad: number[];
|
|
2174
|
+
privilegedPad: number[];
|
|
2175
|
+
createdAt: number;
|
|
2176
|
+
}
|
|
2177
|
+
```
|
|
2178
|
+
|
|
2179
|
+
###### Property createdAt
|
|
2180
|
+
|
|
2181
|
+
Timestamp (seconds since epoch) when the profile was created.
|
|
2182
|
+
|
|
2183
|
+
```ts
|
|
2184
|
+
createdAt: number
|
|
2185
|
+
```
|
|
2186
|
+
|
|
2187
|
+
###### Property id
|
|
2188
|
+
|
|
2189
|
+
Unique 16-byte identifier for the profile.
|
|
2190
|
+
|
|
2191
|
+
```ts
|
|
2192
|
+
id: number[]
|
|
2193
|
+
```
|
|
2194
|
+
|
|
2195
|
+
###### Property name
|
|
2196
|
+
|
|
2197
|
+
User-defined name for the profile.
|
|
2198
|
+
|
|
2199
|
+
```ts
|
|
2200
|
+
name: string
|
|
2201
|
+
```
|
|
2202
|
+
|
|
2203
|
+
###### Property primaryPad
|
|
2204
|
+
|
|
2205
|
+
32-byte random pad XOR'd with the root primary key to derive the profile's primary key.
|
|
2206
|
+
|
|
2207
|
+
```ts
|
|
2208
|
+
primaryPad: number[]
|
|
2209
|
+
```
|
|
2210
|
+
|
|
2211
|
+
###### Property privilegedPad
|
|
2212
|
+
|
|
2213
|
+
32-byte random pad XOR'd with the root privileged key to derive the profile's privileged key.
|
|
2214
|
+
|
|
2215
|
+
```ts
|
|
2216
|
+
privilegedPad: number[]
|
|
2217
|
+
```
|
|
2218
|
+
|
|
2219
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2220
|
+
|
|
2163
2221
|
---
|
|
2164
2222
|
##### Interface: ProvenOrRawTx
|
|
2165
2223
|
|
|
@@ -3592,6 +3650,7 @@ export interface UMPToken {
|
|
|
3592
3650
|
presentationKeyEncrypted: number[];
|
|
3593
3651
|
recoveryKeyEncrypted: number[];
|
|
3594
3652
|
passwordKeyEncrypted: number[];
|
|
3653
|
+
profilesEncrypted?: number[];
|
|
3595
3654
|
currentOutpoint?: OutpointString;
|
|
3596
3655
|
}
|
|
3597
3656
|
```
|
|
@@ -3606,7 +3665,7 @@ currentOutpoint?: OutpointString
|
|
|
3606
3665
|
|
|
3607
3666
|
###### Property passwordKeyEncrypted
|
|
3608
3667
|
|
|
3609
|
-
A copy of the password key encrypted with the privileged key.
|
|
3668
|
+
A copy of the password key encrypted with the root privileged key.
|
|
3610
3669
|
|
|
3611
3670
|
```ts
|
|
3612
3671
|
passwordKeyEncrypted: number[]
|
|
@@ -3614,7 +3673,7 @@ passwordKeyEncrypted: number[]
|
|
|
3614
3673
|
|
|
3615
3674
|
###### Property passwordPresentationPrimary
|
|
3616
3675
|
|
|
3617
|
-
Primary key encrypted by the XOR of the password and presentation keys.
|
|
3676
|
+
Root Primary key encrypted by the XOR of the password and presentation keys.
|
|
3618
3677
|
|
|
3619
3678
|
```ts
|
|
3620
3679
|
passwordPresentationPrimary: number[]
|
|
@@ -3622,7 +3681,7 @@ passwordPresentationPrimary: number[]
|
|
|
3622
3681
|
|
|
3623
3682
|
###### Property passwordPrimaryPrivileged
|
|
3624
3683
|
|
|
3625
|
-
Privileged key encrypted by the XOR of the password and primary keys.
|
|
3684
|
+
Root Privileged key encrypted by the XOR of the password and primary keys.
|
|
3626
3685
|
|
|
3627
3686
|
```ts
|
|
3628
3687
|
passwordPrimaryPrivileged: number[]
|
|
@@ -3630,7 +3689,7 @@ passwordPrimaryPrivileged: number[]
|
|
|
3630
3689
|
|
|
3631
3690
|
###### Property passwordRecoveryPrimary
|
|
3632
3691
|
|
|
3633
|
-
Primary key encrypted by the XOR of the password and recovery keys.
|
|
3692
|
+
Root Primary key encrypted by the XOR of the password and recovery keys.
|
|
3634
3693
|
|
|
3635
3694
|
```ts
|
|
3636
3695
|
passwordRecoveryPrimary: number[]
|
|
@@ -3654,7 +3713,7 @@ presentationHash: number[]
|
|
|
3654
3713
|
|
|
3655
3714
|
###### Property presentationKeyEncrypted
|
|
3656
3715
|
|
|
3657
|
-
A copy of the presentation key encrypted with the privileged key.
|
|
3716
|
+
A copy of the presentation key encrypted with the root privileged key.
|
|
3658
3717
|
|
|
3659
3718
|
```ts
|
|
3660
3719
|
presentationKeyEncrypted: number[]
|
|
@@ -3662,7 +3721,7 @@ presentationKeyEncrypted: number[]
|
|
|
3662
3721
|
|
|
3663
3722
|
###### Property presentationRecoveryPrimary
|
|
3664
3723
|
|
|
3665
|
-
Primary key encrypted by the XOR of the presentation and recovery keys.
|
|
3724
|
+
Root Primary key encrypted by the XOR of the presentation and recovery keys.
|
|
3666
3725
|
|
|
3667
3726
|
```ts
|
|
3668
3727
|
presentationRecoveryPrimary: number[]
|
|
@@ -3670,12 +3729,21 @@ presentationRecoveryPrimary: number[]
|
|
|
3670
3729
|
|
|
3671
3730
|
###### Property presentationRecoveryPrivileged
|
|
3672
3731
|
|
|
3673
|
-
Privileged key encrypted by the XOR of the presentation and recovery keys.
|
|
3732
|
+
Root Privileged key encrypted by the XOR of the presentation and recovery keys.
|
|
3674
3733
|
|
|
3675
3734
|
```ts
|
|
3676
3735
|
presentationRecoveryPrivileged: number[]
|
|
3677
3736
|
```
|
|
3678
3737
|
|
|
3738
|
+
###### Property profilesEncrypted
|
|
3739
|
+
|
|
3740
|
+
Optional field containing the encrypted profile data.
|
|
3741
|
+
JSON string -> Encrypted Bytes using root privileged key.
|
|
3742
|
+
|
|
3743
|
+
```ts
|
|
3744
|
+
profilesEncrypted?: number[]
|
|
3745
|
+
```
|
|
3746
|
+
|
|
3679
3747
|
###### Property recoveryHash
|
|
3680
3748
|
|
|
3681
3749
|
Hash of the recovery key.
|
|
@@ -3686,7 +3754,7 @@ recoveryHash: number[]
|
|
|
3686
3754
|
|
|
3687
3755
|
###### Property recoveryKeyEncrypted
|
|
3688
3756
|
|
|
3689
|
-
A copy of the recovery key encrypted with the privileged key.
|
|
3757
|
+
A copy of the recovery key encrypted with the root privileged key.
|
|
3690
3758
|
|
|
3691
3759
|
```ts
|
|
3692
3760
|
recoveryKeyEncrypted: number[]
|
|
@@ -5027,24 +5095,34 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5027
5095
|
##### Class: CWIStyleWalletManager
|
|
5028
5096
|
|
|
5029
5097
|
Manages a "CWI-style" wallet that uses a UMP token and a
|
|
5030
|
-
multi-key authentication scheme (password, presentation key, and recovery key)
|
|
5098
|
+
multi-key authentication scheme (password, presentation key, and recovery key),
|
|
5099
|
+
supporting multiple user profiles under a single account.
|
|
5031
5100
|
|
|
5032
5101
|
```ts
|
|
5033
5102
|
export class CWIStyleWalletManager implements WalletInterface {
|
|
5034
5103
|
authenticated: boolean;
|
|
5035
5104
|
authenticationMode: "presentation-key-and-password" | "presentation-key-and-recovery-key" | "recovery-key-and-password" = "presentation-key-and-password";
|
|
5036
5105
|
authenticationFlow: "new-user" | "existing-user" = "new-user";
|
|
5037
|
-
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (
|
|
5106
|
+
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (profilePrimaryKey: number[], profilePrivilegedKeyManager: PrivilegedKeyManager, profileId: number[]) => Promise<WalletInterface>, interactor: UMPTokenInteractor = new OverlayUMPTokenInteractor(), recoveryKeySaver: (key: number[]) => Promise<true>, passwordRetriever: (reason: string, test: (passwordCandidate: string) => boolean) => Promise<string>, newWalletFunder?: (presentationKey: number[], wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes) => Promise<void>, stateSnapshot?: number[])
|
|
5038
5107
|
async providePresentationKey(key: number[]): Promise<void>
|
|
5039
5108
|
async providePassword(password: string): Promise<void>
|
|
5040
5109
|
async provideRecoveryKey(recoveryKey: number[]): Promise<void>
|
|
5041
5110
|
saveSnapshot(): number[]
|
|
5042
5111
|
async loadSnapshot(snapshot: number[]): Promise<void>
|
|
5043
5112
|
destroy(): void
|
|
5113
|
+
listProfiles(): Array<{
|
|
5114
|
+
id: number[];
|
|
5115
|
+
name: string;
|
|
5116
|
+
createdAt: number | null;
|
|
5117
|
+
active: boolean;
|
|
5118
|
+
}>
|
|
5119
|
+
async addProfile(name: string): Promise<number[]>
|
|
5120
|
+
async deleteProfile(profileId: number[]): Promise<void>
|
|
5121
|
+
async switchProfile(profileId: number[]): Promise<void>
|
|
5044
5122
|
async changePassword(newPassword: string): Promise<void>
|
|
5045
5123
|
async getRecoveryKey(): Promise<number[]>
|
|
5046
5124
|
async changeRecoveryKey(): Promise<void>
|
|
5047
|
-
async changePresentationKey(
|
|
5125
|
+
async changePresentationKey(newPresentationKey: number[]): Promise<void>
|
|
5048
5126
|
async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
|
|
5049
5127
|
async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
|
|
5050
5128
|
async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
|
|
@@ -5083,7 +5161,7 @@ See also: [OverlayUMPTokenInteractor](./client.md#class-overlayumptokeninteracto
|
|
|
5083
5161
|
Constructs a new CWIStyleWalletManager.
|
|
5084
5162
|
|
|
5085
5163
|
```ts
|
|
5086
|
-
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (
|
|
5164
|
+
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (profilePrimaryKey: number[], profilePrivilegedKeyManager: PrivilegedKeyManager, profileId: number[]) => Promise<WalletInterface>, interactor: UMPTokenInteractor = new OverlayUMPTokenInteractor(), recoveryKeySaver: (key: number[]) => Promise<true>, passwordRetriever: (reason: string, test: (passwordCandidate: string) => boolean) => Promise<string>, newWalletFunder?: (presentationKey: number[], wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes) => Promise<void>, stateSnapshot?: number[])
|
|
5087
5165
|
```
|
|
5088
5166
|
See also: [OverlayUMPTokenInteractor](./client.md#class-overlayumptokeninteractor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [UMPTokenInteractor](./client.md#interface-umptokeninteractor)
|
|
5089
5167
|
|
|
@@ -5092,22 +5170,21 @@ Argument Details
|
|
|
5092
5170
|
+ **adminOriginator**
|
|
5093
5171
|
+ The domain name of the administrative originator.
|
|
5094
5172
|
+ **walletBuilder**
|
|
5095
|
-
+ A function that can build an underlying wallet instance
|
|
5096
|
-
from a primary key and a privileged key manager
|
|
5173
|
+
+ A function that can build an underlying wallet instance for a profile.
|
|
5097
5174
|
+ **interactor**
|
|
5098
|
-
+ An instance of UMPTokenInteractor
|
|
5175
|
+
+ An instance of UMPTokenInteractor.
|
|
5099
5176
|
+ **recoveryKeySaver**
|
|
5100
|
-
+ A function
|
|
5177
|
+
+ A function to persist a new recovery key.
|
|
5101
5178
|
+ **passwordRetriever**
|
|
5102
|
-
+ A function to request the user's password
|
|
5179
|
+
+ A function to request the user's password.
|
|
5103
5180
|
+ **newWalletFunder**
|
|
5104
|
-
+
|
|
5181
|
+
+ Optional function to fund a new wallet.
|
|
5105
5182
|
+ **stateSnapshot**
|
|
5106
|
-
+
|
|
5183
|
+
+ Optional previously saved state snapshot.
|
|
5107
5184
|
|
|
5108
5185
|
###### Property authenticated
|
|
5109
5186
|
|
|
5110
|
-
Whether the user is currently authenticated.
|
|
5187
|
+
Whether the user is currently authenticated (i.e., root keys are available).
|
|
5111
5188
|
|
|
5112
5189
|
```ts
|
|
5113
5190
|
authenticated: boolean
|
|
@@ -5115,9 +5192,7 @@ authenticated: boolean
|
|
|
5115
5192
|
|
|
5116
5193
|
###### Property authenticationFlow
|
|
5117
5194
|
|
|
5118
|
-
Indicates
|
|
5119
|
-
- 'new-user'
|
|
5120
|
-
- 'existing-user'
|
|
5195
|
+
Indicates new user or existing user flow.
|
|
5121
5196
|
|
|
5122
5197
|
```ts
|
|
5123
5198
|
authenticationFlow: "new-user" | "existing-user" = "new-user"
|
|
@@ -5125,64 +5200,73 @@ authenticationFlow: "new-user" | "existing-user" = "new-user"
|
|
|
5125
5200
|
|
|
5126
5201
|
###### Property authenticationMode
|
|
5127
5202
|
|
|
5128
|
-
|
|
5129
|
-
- 'presentation-key-and-password'
|
|
5130
|
-
- 'presentation-key-and-recovery-key'
|
|
5131
|
-
- 'recovery-key-and-password'
|
|
5203
|
+
Current mode of authentication.
|
|
5132
5204
|
|
|
5133
5205
|
```ts
|
|
5134
5206
|
authenticationMode: "presentation-key-and-password" | "presentation-key-and-recovery-key" | "recovery-key-and-password" = "presentation-key-and-password"
|
|
5135
5207
|
```
|
|
5136
5208
|
|
|
5137
|
-
###### Method
|
|
5209
|
+
###### Method addProfile
|
|
5138
5210
|
|
|
5139
|
-
|
|
5211
|
+
Adds a new profile with the given name.
|
|
5212
|
+
Generates necessary pads and updates the UMP token.
|
|
5213
|
+
Does not switch to the new profile automatically.
|
|
5140
5214
|
|
|
5141
5215
|
```ts
|
|
5142
|
-
async
|
|
5216
|
+
async addProfile(name: string): Promise<number[]>
|
|
5143
5217
|
```
|
|
5144
5218
|
|
|
5219
|
+
Returns
|
|
5220
|
+
|
|
5221
|
+
The ID of the newly created profile.
|
|
5222
|
+
|
|
5145
5223
|
Argument Details
|
|
5146
5224
|
|
|
5147
|
-
+ **
|
|
5148
|
-
+ The
|
|
5225
|
+
+ **name**
|
|
5226
|
+
+ The desired name for the new profile.
|
|
5149
5227
|
|
|
5150
|
-
|
|
5228
|
+
###### Method changePassword
|
|
5151
5229
|
|
|
5152
|
-
|
|
5230
|
+
Changes the user's password. Re-wraps keys and updates the UMP token.
|
|
5231
|
+
|
|
5232
|
+
```ts
|
|
5233
|
+
async changePassword(newPassword: string): Promise<void>
|
|
5234
|
+
```
|
|
5153
5235
|
|
|
5154
5236
|
###### Method changePresentationKey
|
|
5155
5237
|
|
|
5156
5238
|
Changes the user's presentation key.
|
|
5157
5239
|
|
|
5158
5240
|
```ts
|
|
5159
|
-
async changePresentationKey(
|
|
5241
|
+
async changePresentationKey(newPresentationKey: number[]): Promise<void>
|
|
5160
5242
|
```
|
|
5161
5243
|
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
+ **presentationKey**
|
|
5165
|
-
+ The new presentation key (32 bytes).
|
|
5244
|
+
###### Method changeRecoveryKey
|
|
5166
5245
|
|
|
5167
|
-
|
|
5246
|
+
Changes the user's recovery key. Prompts user to save the new key.
|
|
5168
5247
|
|
|
5169
|
-
|
|
5248
|
+
```ts
|
|
5249
|
+
async changeRecoveryKey(): Promise<void>
|
|
5250
|
+
```
|
|
5170
5251
|
|
|
5171
|
-
###### Method
|
|
5252
|
+
###### Method deleteProfile
|
|
5172
5253
|
|
|
5173
|
-
|
|
5254
|
+
Deletes a profile by its ID.
|
|
5255
|
+
Cannot delete the default profile. If the active profile is deleted,
|
|
5256
|
+
it switches back to the default profile.
|
|
5174
5257
|
|
|
5175
5258
|
```ts
|
|
5176
|
-
async
|
|
5259
|
+
async deleteProfile(profileId: number[]): Promise<void>
|
|
5177
5260
|
```
|
|
5178
5261
|
|
|
5179
|
-
|
|
5262
|
+
Argument Details
|
|
5180
5263
|
|
|
5181
|
-
|
|
5264
|
+
+ **profileId**
|
|
5265
|
+
+ The 16-byte ID of the profile to delete.
|
|
5182
5266
|
|
|
5183
5267
|
###### Method destroy
|
|
5184
5268
|
|
|
5185
|
-
Destroys the
|
|
5269
|
+
Destroys the wallet state, clearing keys, tokens, and profiles.
|
|
5186
5270
|
|
|
5187
5271
|
```ts
|
|
5188
5272
|
destroy(): void
|
|
@@ -5190,20 +5274,33 @@ destroy(): void
|
|
|
5190
5274
|
|
|
5191
5275
|
###### Method getRecoveryKey
|
|
5192
5276
|
|
|
5193
|
-
Retrieves the current recovery key.
|
|
5277
|
+
Retrieves the current recovery key. Requires privileged access.
|
|
5194
5278
|
|
|
5195
5279
|
```ts
|
|
5196
5280
|
async getRecoveryKey(): Promise<number[]>
|
|
5197
5281
|
```
|
|
5198
5282
|
|
|
5199
|
-
|
|
5283
|
+
###### Method listProfiles
|
|
5200
5284
|
|
|
5201
|
-
|
|
5285
|
+
Lists all available profiles, including the default profile.
|
|
5286
|
+
|
|
5287
|
+
```ts
|
|
5288
|
+
listProfiles(): Array<{
|
|
5289
|
+
id: number[];
|
|
5290
|
+
name: string;
|
|
5291
|
+
createdAt: number | null;
|
|
5292
|
+
active: boolean;
|
|
5293
|
+
}>
|
|
5294
|
+
```
|
|
5295
|
+
|
|
5296
|
+
Returns
|
|
5297
|
+
|
|
5298
|
+
Array of profile info objects, including an 'active' flag.
|
|
5202
5299
|
|
|
5203
5300
|
###### Method loadSnapshot
|
|
5204
5301
|
|
|
5205
|
-
Loads a previously saved state snapshot
|
|
5206
|
-
|
|
5302
|
+
Loads a previously saved state snapshot. Restores root key, UMP token, profiles, and active profile.
|
|
5303
|
+
Handles Version 1 (legacy) and Version 2 formats.
|
|
5207
5304
|
|
|
5208
5305
|
```ts
|
|
5209
5306
|
async loadSnapshot(snapshot: number[]): Promise<void>
|
|
@@ -5212,78 +5309,37 @@ async loadSnapshot(snapshot: number[]): Promise<void>
|
|
|
5212
5309
|
Argument Details
|
|
5213
5310
|
|
|
5214
5311
|
+ **snapshot**
|
|
5215
|
-
+
|
|
5216
|
-
|
|
5217
|
-
Throws
|
|
5218
|
-
|
|
5219
|
-
If the snapshot format is invalid or decryption fails.
|
|
5312
|
+
+ Encrypted snapshot bytes.
|
|
5220
5313
|
|
|
5221
5314
|
###### Method providePassword
|
|
5222
5315
|
|
|
5223
|
-
Provides the password
|
|
5224
|
-
|
|
5225
|
-
- **Existing user**:
|
|
5226
|
-
Decrypts the primary key using the provided password (and either the presentation key or recovery key, depending on the mode).
|
|
5227
|
-
Then builds the underlying wallet, marking the user as authenticated.
|
|
5228
|
-
|
|
5229
|
-
- **New user**:
|
|
5230
|
-
Generates a new UMP token with fresh keys (primary, privileged, recovery). Publishes it on-chain and builds the wallet.
|
|
5316
|
+
Provides the password.
|
|
5231
5317
|
|
|
5232
5318
|
```ts
|
|
5233
5319
|
async providePassword(password: string): Promise<void>
|
|
5234
5320
|
```
|
|
5235
5321
|
|
|
5236
|
-
Argument Details
|
|
5237
|
-
|
|
5238
|
-
+ **password**
|
|
5239
|
-
+ The user's password as a string.
|
|
5240
|
-
|
|
5241
|
-
Throws
|
|
5242
|
-
|
|
5243
|
-
If the user is already authenticated, if the mode does not use a password, or if required keys are missing.
|
|
5244
|
-
|
|
5245
5322
|
###### Method providePresentationKey
|
|
5246
5323
|
|
|
5247
|
-
Provides the presentation key
|
|
5248
|
-
If a UMP token is found based on the key's hash, this is an existing-user flow.
|
|
5249
|
-
Otherwise, it is treated as a new-user flow.
|
|
5324
|
+
Provides the presentation key.
|
|
5250
5325
|
|
|
5251
5326
|
```ts
|
|
5252
5327
|
async providePresentationKey(key: number[]): Promise<void>
|
|
5253
5328
|
```
|
|
5254
5329
|
|
|
5255
|
-
Argument Details
|
|
5256
|
-
|
|
5257
|
-
+ **key**
|
|
5258
|
-
+ The user's presentation key (32 bytes).
|
|
5259
|
-
|
|
5260
|
-
Throws
|
|
5261
|
-
|
|
5262
|
-
if user is already authenticated, or if the current mode does not require a presentation key.
|
|
5263
|
-
|
|
5264
5330
|
###### Method provideRecoveryKey
|
|
5265
5331
|
|
|
5266
|
-
Provides the recovery key
|
|
5332
|
+
Provides the recovery key.
|
|
5267
5333
|
|
|
5268
5334
|
```ts
|
|
5269
5335
|
async provideRecoveryKey(recoveryKey: number[]): Promise<void>
|
|
5270
5336
|
```
|
|
5271
5337
|
|
|
5272
|
-
Argument Details
|
|
5273
|
-
|
|
5274
|
-
+ **recoveryKey**
|
|
5275
|
-
+ The user's recovery key (32 bytes).
|
|
5276
|
-
|
|
5277
|
-
Throws
|
|
5278
|
-
|
|
5279
|
-
if user is already authenticated, if the mode does not use a recovery key,
|
|
5280
|
-
or if a required presentation key is missing in "presentation-key-and-recovery-key" mode.
|
|
5281
|
-
|
|
5282
5338
|
###### Method saveSnapshot
|
|
5283
5339
|
|
|
5284
|
-
Saves the current wallet state (
|
|
5285
|
-
|
|
5286
|
-
|
|
5340
|
+
Saves the current wallet state (root key, UMP token, active profile) into an encrypted snapshot.
|
|
5341
|
+
Version 2 format: [1 byte version=2] + [32 byte snapshot key] + [16 byte activeProfileId] + [encrypted payload]
|
|
5342
|
+
Encrypted Payload: [32 byte rootPrimaryKey] + [varint token length + serialized UMP token]
|
|
5287
5343
|
|
|
5288
5344
|
```ts
|
|
5289
5345
|
saveSnapshot(): number[]
|
|
@@ -5291,11 +5347,20 @@ saveSnapshot(): number[]
|
|
|
5291
5347
|
|
|
5292
5348
|
Returns
|
|
5293
5349
|
|
|
5294
|
-
|
|
5350
|
+
Encrypted snapshot bytes.
|
|
5295
5351
|
|
|
5296
|
-
|
|
5352
|
+
###### Method switchProfile
|
|
5353
|
+
|
|
5354
|
+
Switches the active profile. This re-derives keys and rebuilds the underlying wallet.
|
|
5355
|
+
|
|
5356
|
+
```ts
|
|
5357
|
+
async switchProfile(profileId: number[]): Promise<void>
|
|
5358
|
+
```
|
|
5359
|
+
|
|
5360
|
+
Argument Details
|
|
5297
5361
|
|
|
5298
|
-
|
|
5362
|
+
+ **profileId**
|
|
5363
|
+
+ The 16-byte ID of the profile to switch to (use DEFAULT_PROFILE_ID for default).
|
|
5299
5364
|
|
|
5300
5365
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5301
5366
|
|
|
@@ -6485,7 +6550,7 @@ The outpoint of the newly created UMP token (e.g. "abcd1234...ef.0").
|
|
|
6485
6550
|
Argument Details
|
|
6486
6551
|
|
|
6487
6552
|
+ **wallet**
|
|
6488
|
-
+ The wallet used to build and sign the transaction.
|
|
6553
|
+
+ The wallet used to build and sign the transaction (MUST be operating under the DEFAULT profile).
|
|
6489
6554
|
+ **adminOriginator**
|
|
6490
6555
|
+ The domain/FQDN of the administrative originator (wallet operator).
|
|
6491
6556
|
+ **token**
|
|
@@ -11898,20 +11963,30 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
11898
11963
|
|
|
11899
11964
|
| | |
|
|
11900
11965
|
| --- | --- |
|
|
11901
|
-
| [
|
|
11902
|
-
| [
|
|
11903
|
-
| [
|
|
11904
|
-
| [
|
|
11905
|
-
| [
|
|
11906
|
-
| [
|
|
11907
|
-
| [
|
|
11908
|
-
| [
|
|
11909
|
-
| [
|
|
11966
|
+
| [DEFAULT_PROFILE_ID](#variable-default_profile_id) | [queryOverlay](#variable-queryoverlay) |
|
|
11967
|
+
| [DEFAULT_SETTINGS](#variable-default_settings) | [specOpFailedActions](#variable-specopfailedactions) |
|
|
11968
|
+
| [PBKDF2_NUM_ROUNDS](#variable-pbkdf2_num_rounds) | [specOpInvalidChange](#variable-specopinvalidchange) |
|
|
11969
|
+
| [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [specOpNoSendActions](#variable-specopnosendactions) |
|
|
11970
|
+
| [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
|
|
11971
|
+
| [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [specOpThrowReviewActions](#variable-specopthrowreviewactions) |
|
|
11972
|
+
| [brc29ProtocolID](#variable-brc29protocolid) | [specOpWalletBalance](#variable-specopwalletbalance) |
|
|
11973
|
+
| [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
|
|
11974
|
+
| [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
|
|
11975
|
+
| [parseResults](#variable-parseresults) | |
|
|
11910
11976
|
|
|
11911
11977
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11912
11978
|
|
|
11913
11979
|
---
|
|
11914
11980
|
|
|
11981
|
+
##### Variable: DEFAULT_PROFILE_ID
|
|
11982
|
+
|
|
11983
|
+
```ts
|
|
11984
|
+
DEFAULT_PROFILE_ID = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
11985
|
+
```
|
|
11986
|
+
|
|
11987
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11988
|
+
|
|
11989
|
+
---
|
|
11915
11990
|
##### Variable: DEFAULT_SETTINGS
|
|
11916
11991
|
|
|
11917
11992
|
```ts
|