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