@bsv/wallet-toolbox 1.1.25 → 1.1.26
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/docs/client.md +78 -2313
- package/docs/wallet.md +78 -2313
- package/out/src/Wallet.d.ts +1 -6
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +2 -29
- package/out/src/Wallet.js.map +1 -1
- package/out/src/index.all.d.ts +0 -9
- package/out/src/index.all.d.ts.map +1 -1
- package/out/src/index.all.js +0 -9
- package/out/src/index.all.js.map +1 -1
- package/out/src/index.client.d.ts +0 -9
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +0 -9
- package/out/src/index.client.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Wallet.ts +3 -47
- package/src/index.all.ts +0 -9
- package/src/index.client.ts +0 -9
- package/out/src/CWIStyleWalletManager.d.ts +0 -411
- package/out/src/CWIStyleWalletManager.d.ts.map +0 -1
- package/out/src/CWIStyleWalletManager.js +0 -1131
- package/out/src/CWIStyleWalletManager.js.map +0 -1
- package/out/src/SetupClient.d.ts +0 -249
- package/out/src/SetupClient.d.ts.map +0 -1
- package/out/src/SetupClient.js +0 -252
- package/out/src/SetupClient.js.map +0 -1
- package/out/src/SimpleWalletManager.d.ts +0 -169
- package/out/src/SimpleWalletManager.d.ts.map +0 -1
- package/out/src/SimpleWalletManager.js +0 -315
- package/out/src/SimpleWalletManager.js.map +0 -1
- package/out/src/WalletAuthenticationManager.d.ts +0 -33
- package/out/src/WalletAuthenticationManager.d.ts.map +0 -1
- package/out/src/WalletAuthenticationManager.js +0 -107
- package/out/src/WalletAuthenticationManager.js.map +0 -1
- package/out/src/WalletPermissionsManager.d.ts +0 -575
- package/out/src/WalletPermissionsManager.d.ts.map +0 -1
- package/out/src/WalletPermissionsManager.js +0 -1807
- package/out/src/WalletPermissionsManager.js.map +0 -1
- package/out/src/WalletSettingsManager.d.ts +0 -59
- package/out/src/WalletSettingsManager.d.ts.map +0 -1
- package/out/src/WalletSettingsManager.js +0 -168
- package/out/src/WalletSettingsManager.js.map +0 -1
- package/out/src/__tests/CWIStyleWalletManager.test.d.ts +0 -2
- package/out/src/__tests/CWIStyleWalletManager.test.d.ts.map +0 -1
- package/out/src/__tests/CWIStyleWalletManager.test.js +0 -472
- package/out/src/__tests/CWIStyleWalletManager.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +0 -239
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.checks.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.checks.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.checks.test.js +0 -644
- package/out/src/__tests/WalletPermissionsManager.checks.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.encryption.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.encryption.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js +0 -295
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +0 -82
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +0 -260
- package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.flows.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.js +0 -389
- package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.initialization.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.initialization.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js +0 -227
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.proxying.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.proxying.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js +0 -566
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.d.ts +0 -2
- package/out/src/__tests/WalletPermissionsManager.tokens.test.d.ts.map +0 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js +0 -460
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +0 -1
- package/out/src/utility/identityUtils.d.ts +0 -31
- package/out/src/utility/identityUtils.d.ts.map +0 -1
- package/out/src/utility/identityUtils.js +0 -114
- package/out/src/utility/identityUtils.js.map +0 -1
- package/out/src/wab-client/WABClient.d.ts +0 -38
- package/out/src/wab-client/WABClient.d.ts.map +0 -1
- package/out/src/wab-client/WABClient.js +0 -95
- package/out/src/wab-client/WABClient.js.map +0 -1
- package/out/src/wab-client/__tests/WABClient.test.d.ts +0 -2
- package/out/src/wab-client/__tests/WABClient.test.d.ts.map +0 -1
- package/out/src/wab-client/__tests/WABClient.test.js +0 -47
- package/out/src/wab-client/__tests/WABClient.test.js.map +0 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +0 -34
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +0 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +0 -16
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +0 -1
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts +0 -7
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts.map +0 -1
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +0 -40
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +0 -1
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +0 -28
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +0 -1
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +0 -73
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +0 -1
- package/src/CWIStyleWalletManager.ts +0 -1891
- package/src/SimpleWalletManager.ts +0 -553
- package/src/WalletAuthenticationManager.ts +0 -183
- package/src/WalletPermissionsManager.ts +0 -2639
- package/src/WalletSettingsManager.ts +0 -241
- package/src/__tests/CWIStyleWalletManager.test.ts +0 -709
- package/src/__tests/WalletPermissionsManager.callbacks.test.ts +0 -328
- package/src/__tests/WalletPermissionsManager.checks.test.ts +0 -857
- package/src/__tests/WalletPermissionsManager.encryption.test.ts +0 -407
- package/src/__tests/WalletPermissionsManager.fixtures.ts +0 -283
- package/src/__tests/WalletPermissionsManager.flows.test.ts +0 -490
- package/src/__tests/WalletPermissionsManager.initialization.test.ts +0 -333
- package/src/__tests/WalletPermissionsManager.proxying.test.ts +0 -753
- package/src/__tests/WalletPermissionsManager.tokens.test.ts +0 -584
- package/src/utility/identityUtils.ts +0 -170
- package/src/wab-client/WABClient.ts +0 -103
- package/src/wab-client/__tests/WABClient.test.ts +0 -58
- package/src/wab-client/auth-method-interactors/AuthMethodInteractor.ts +0 -47
- package/src/wab-client/auth-method-interactors/PersonaIDInteractor.ts +0 -45
- package/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.ts +0 -82
package/docs/client.md
CHANGED
|
@@ -14,60 +14,55 @@ 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
|
-
| [
|
|
21
|
-
| [
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
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
|
-
| [OutPoint](#interface-outpoint) | [TableOutputX](#interface-tableoutputx) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
67
|
-
| [Paged](#interface-paged) | [TableProvenTx](#interface-tableproventx) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
68
|
-
| [PendingSignAction](#interface-pendingsignaction) | [TableProvenTxReq](#interface-tableproventxreq) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
69
|
-
| [PendingStorageInput](#interface-pendingstorageinput) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) | [WalletTheme](#interface-wallettheme) |
|
|
70
|
-
| [PermissionRequest](#interface-permissionrequest) | [TableSettings](#interface-tablesettings) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
17
|
+
| [ArcConfig](#interface-arcconfig) | [PostBeefResult](#interface-postbeefresult) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) |
|
|
18
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TableSettings](#interface-tablesettings) |
|
|
19
|
+
| [AuthId](#interface-authid) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TableSyncState](#interface-tablesyncstate) |
|
|
20
|
+
| [BaseBlockHeader](#interface-baseblockheader) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TableTransaction](#interface-tabletransaction) |
|
|
21
|
+
| [BlockHeader](#interface-blockheader) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TableTxLabel](#interface-tabletxlabel) |
|
|
22
|
+
| [BsvExchangeRate](#interface-bsvexchangerate) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [TableTxLabelMap](#interface-tabletxlabelmap) |
|
|
23
|
+
| [CertOpsWallet](#interface-certopswallet) | [PostTxsResult](#interface-posttxsresult) | [TableUser](#interface-tableuser) |
|
|
24
|
+
| [CommitNewTxResults](#interface-commitnewtxresults) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [TaskPurgeParams](#interface-taskpurgeparams) |
|
|
25
|
+
| [EntitySyncMap](#interface-entitysyncmap) | [ProvenOrRawTx](#interface-provenorrawtx) | [TrxToken](#interface-trxtoken) |
|
|
26
|
+
| [EntityTimeStamp](#interface-entitytimestamp) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
|
|
27
|
+
| [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [TxScriptOffsets](#interface-txscriptoffsets) |
|
|
28
|
+
| [FiatExchangeRates](#interface-fiatexchangerates) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
|
|
29
|
+
| [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
|
|
30
|
+
| [FindCertificatesArgs](#interface-findcertificatesargs) | [PurgeParams](#interface-purgeparams) | [ValidAbortActionArgs](#interface-validabortactionargs) |
|
|
31
|
+
| [FindCommissionsArgs](#interface-findcommissionsargs) | [PurgeResults](#interface-purgeresults) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
|
|
32
|
+
| [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
|
|
33
|
+
| [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
|
|
34
|
+
| [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidBasketInsertion](#interface-validbasketinsertion) |
|
|
35
|
+
| [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
|
|
36
|
+
| [FindOutputTagsArgs](#interface-findoutputtagsargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidCreateActionInput](#interface-validcreateactioninput) |
|
|
37
|
+
| [FindOutputsArgs](#interface-findoutputsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
|
|
38
|
+
| [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
|
|
39
|
+
| [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
|
|
40
|
+
| [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageIdentity](#interface-storageidentity) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
|
|
41
|
+
| [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
|
|
42
|
+
| [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
|
|
43
|
+
| [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [ValidListActionsArgs](#interface-validlistactionsargs) |
|
|
44
|
+
| [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageProvenOrReq](#interface-storageprovenorreq) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
|
|
45
|
+
| [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageProviderOptions](#interface-storageprovideroptions) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
|
|
46
|
+
| [FindUsersArgs](#interface-findusersargs) | [StorageReaderOptions](#interface-storagereaderoptions) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
|
|
47
|
+
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
|
|
48
|
+
| [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [StorageSyncReader](#interface-storagesyncreader) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
|
|
49
|
+
| [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
|
|
50
|
+
| [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [StorageSyncReaderWriter](#interface-storagesyncreaderwriter) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
|
|
51
|
+
| [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [SyncChunk](#interface-syncchunk) | [ValidSignActionArgs](#interface-validsignactionargs) |
|
|
52
|
+
| [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [SyncError](#interface-syncerror) | [ValidSignActionOptions](#interface-validsignactionoptions) |
|
|
53
|
+
| [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [SyncMap](#interface-syncmap) | [ValidWalletPayment](#interface-validwalletpayment) |
|
|
54
|
+
| [GetMerklePathResult](#interface-getmerklepathresult) | [TableCertificate](#interface-tablecertificate) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
|
|
55
|
+
| [GetRawTxResult](#interface-getrawtxresult) | [TableCertificateField](#interface-tablecertificatefield) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
|
|
56
|
+
| [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [TableCertificateX](#interface-tablecertificatex) | [WalletArgs](#interface-walletargs) |
|
|
57
|
+
| [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [TableCommission](#interface-tablecommission) | [WalletServices](#interface-walletservices) |
|
|
58
|
+
| [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TableMonitorEvent](#interface-tablemonitorevent) | [WalletServicesOptions](#interface-walletservicesoptions) |
|
|
59
|
+
| [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableOutput](#interface-tableoutput) | [WalletSigner](#interface-walletsigner) |
|
|
60
|
+
| [KeyPair](#interface-keypair) | [TableOutputBasket](#interface-tableoutputbasket) | [WalletStorage](#interface-walletstorage) |
|
|
61
|
+
| [MonitorOptions](#interface-monitoroptions) | [TableOutputTag](#interface-tableoutputtag) | [WalletStorageProvider](#interface-walletstorageprovider) |
|
|
62
|
+
| [OutPoint](#interface-outpoint) | [TableOutputTagMap](#interface-tableoutputtagmap) | [WalletStorageReader](#interface-walletstoragereader) |
|
|
63
|
+
| [Paged](#interface-paged) | [TableOutputX](#interface-tableoutputx) | [WalletStorageSync](#interface-walletstoragesync) |
|
|
64
|
+
| [PendingSignAction](#interface-pendingsignaction) | [TableProvenTx](#interface-tableproventx) | [WalletStorageWriter](#interface-walletstoragewriter) |
|
|
65
|
+
| [PendingStorageInput](#interface-pendingstorageinput) | [TableProvenTxReq](#interface-tableproventxreq) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
71
66
|
|
|
72
67
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
73
68
|
|
|
@@ -171,22 +166,6 @@ export interface AuthId {
|
|
|
171
166
|
|
|
172
167
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
173
168
|
|
|
174
|
-
---
|
|
175
|
-
##### Interface: AuthPayload
|
|
176
|
-
|
|
177
|
-
AuthMethodInteractor
|
|
178
|
-
|
|
179
|
-
A base interface/class for client-side logic to interact with a server
|
|
180
|
-
for a specific Auth Method's flow (start, complete).
|
|
181
|
-
|
|
182
|
-
```ts
|
|
183
|
-
export interface AuthPayload {
|
|
184
|
-
[key: string]: any;
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
189
|
-
|
|
190
169
|
---
|
|
191
170
|
##### Interface: BaseBlockHeader
|
|
192
171
|
|
|
@@ -314,22 +293,6 @@ export interface CertOpsWallet {
|
|
|
314
293
|
|
|
315
294
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
316
295
|
|
|
317
|
-
---
|
|
318
|
-
##### Interface: Certifier
|
|
319
|
-
|
|
320
|
-
```ts
|
|
321
|
-
export interface Certifier {
|
|
322
|
-
name: string;
|
|
323
|
-
description: string;
|
|
324
|
-
identityKey: PubKeyHex;
|
|
325
|
-
trust: number;
|
|
326
|
-
iconUrl?: string;
|
|
327
|
-
baseURL?: string;
|
|
328
|
-
}
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
332
|
-
|
|
333
296
|
---
|
|
334
297
|
##### Interface: CommitNewTxResults
|
|
335
298
|
|
|
@@ -344,19 +307,6 @@ See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq)
|
|
|
344
307
|
|
|
345
308
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
346
309
|
|
|
347
|
-
---
|
|
348
|
-
##### Interface: CompleteAuthResponse
|
|
349
|
-
|
|
350
|
-
```ts
|
|
351
|
-
export interface CompleteAuthResponse {
|
|
352
|
-
success: boolean;
|
|
353
|
-
message?: string;
|
|
354
|
-
presentationKey?: string;
|
|
355
|
-
}
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
359
|
-
|
|
360
310
|
---
|
|
361
311
|
##### Interface: EntitySyncMap
|
|
362
312
|
|
|
@@ -427,18 +377,6 @@ export interface ExchangeRatesIoApi {
|
|
|
427
377
|
|
|
428
378
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
429
379
|
|
|
430
|
-
---
|
|
431
|
-
##### Interface: ExtendedVerifiableCertificate
|
|
432
|
-
|
|
433
|
-
```ts
|
|
434
|
-
export interface ExtendedVerifiableCertificate extends IdentityCertificate {
|
|
435
|
-
certifierInfo: IdentityCertifier;
|
|
436
|
-
publiclyRevealedKeyring: Record<string, Base64String>;
|
|
437
|
-
}
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
441
|
-
|
|
442
380
|
---
|
|
443
381
|
##### Interface: FiatExchangeRates
|
|
444
382
|
|
|
@@ -1212,411 +1150,6 @@ export interface PendingStorageInput {
|
|
|
1212
1150
|
|
|
1213
1151
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1214
1152
|
|
|
1215
|
-
---
|
|
1216
|
-
##### Interface: PermissionRequest
|
|
1217
|
-
|
|
1218
|
-
Describes a single requested permission that the user must either grant or deny.
|
|
1219
|
-
|
|
1220
|
-
Four categories of permission are supported, each with a unique protocol:
|
|
1221
|
-
1) protocol - "DPACP" (Domain Protocol Access Control Protocol)
|
|
1222
|
-
2) basket - "DBAP" (Domain Basket Access Protocol)
|
|
1223
|
-
3) certificate - "DCAP" (Domain Certificate Access Protocol)
|
|
1224
|
-
4) spending - "DSAP" (Domain Spending Authorization Protocol)
|
|
1225
|
-
|
|
1226
|
-
This model underpins "requests" made to the user for permission, which the user can
|
|
1227
|
-
either grant or deny. The manager can then create on-chain tokens (PushDrop outputs)
|
|
1228
|
-
if permission is granted. Denying requests cause the underlying operation to throw,
|
|
1229
|
-
and no token is created. An "ephemeral" grant is also possible, denoting a one-time
|
|
1230
|
-
authorization without an associated persistent on-chain token.
|
|
1231
|
-
|
|
1232
|
-
```ts
|
|
1233
|
-
export interface PermissionRequest {
|
|
1234
|
-
type: "protocol" | "basket" | "certificate" | "spending";
|
|
1235
|
-
originator: string;
|
|
1236
|
-
privileged?: boolean;
|
|
1237
|
-
protocolID?: [
|
|
1238
|
-
0 | 1 | 2,
|
|
1239
|
-
string
|
|
1240
|
-
];
|
|
1241
|
-
counterparty?: string;
|
|
1242
|
-
basket?: string;
|
|
1243
|
-
certificate?: {
|
|
1244
|
-
verifier: string;
|
|
1245
|
-
certType: string;
|
|
1246
|
-
fields: string[];
|
|
1247
|
-
};
|
|
1248
|
-
spending?: {
|
|
1249
|
-
satoshis: number;
|
|
1250
|
-
lineItems?: Array<{
|
|
1251
|
-
type: "input" | "output" | "fee";
|
|
1252
|
-
description: string;
|
|
1253
|
-
satoshis: number;
|
|
1254
|
-
}>;
|
|
1255
|
-
};
|
|
1256
|
-
reason?: string;
|
|
1257
|
-
renewal?: boolean;
|
|
1258
|
-
previousToken?: PermissionToken;
|
|
1259
|
-
}
|
|
1260
|
-
```
|
|
1261
|
-
|
|
1262
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
1263
|
-
|
|
1264
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1265
|
-
|
|
1266
|
-
---
|
|
1267
|
-
##### Interface: PermissionToken
|
|
1268
|
-
|
|
1269
|
-
Data structure representing an on-chain permission token.
|
|
1270
|
-
It is typically stored as a single unspent PushDrop output in a special "internal" admin basket belonging to
|
|
1271
|
-
the user, held in their underlying wallet.
|
|
1272
|
-
|
|
1273
|
-
It can represent any of the four permission categories by having the relevant fields:
|
|
1274
|
-
- DPACP: originator, privileged, protocol, securityLevel, counterparty
|
|
1275
|
-
- DBAP: originator, basketName
|
|
1276
|
-
- DCAP: originator, privileged, verifier, certType, certFields
|
|
1277
|
-
- DSAP: originator, authorizedAmount
|
|
1278
|
-
|
|
1279
|
-
```ts
|
|
1280
|
-
export interface PermissionToken {
|
|
1281
|
-
txid: string;
|
|
1282
|
-
outputIndex: number;
|
|
1283
|
-
outputScript: string;
|
|
1284
|
-
satoshis: number;
|
|
1285
|
-
originator: string;
|
|
1286
|
-
expiry: number;
|
|
1287
|
-
privileged?: boolean;
|
|
1288
|
-
protocol?: string;
|
|
1289
|
-
securityLevel?: 0 | 1 | 2;
|
|
1290
|
-
counterparty?: string;
|
|
1291
|
-
basketName?: string;
|
|
1292
|
-
certType?: string;
|
|
1293
|
-
certFields?: string[];
|
|
1294
|
-
verifier?: string;
|
|
1295
|
-
authorizedAmount?: number;
|
|
1296
|
-
}
|
|
1297
|
-
```
|
|
1298
|
-
|
|
1299
|
-
###### Property authorizedAmount
|
|
1300
|
-
|
|
1301
|
-
For DSAP, the maximum authorized spending for the month.
|
|
1302
|
-
|
|
1303
|
-
```ts
|
|
1304
|
-
authorizedAmount?: number
|
|
1305
|
-
```
|
|
1306
|
-
|
|
1307
|
-
###### Property basketName
|
|
1308
|
-
|
|
1309
|
-
The name of a basket, if this is a DBAP token.
|
|
1310
|
-
|
|
1311
|
-
```ts
|
|
1312
|
-
basketName?: string
|
|
1313
|
-
```
|
|
1314
|
-
|
|
1315
|
-
###### Property certFields
|
|
1316
|
-
|
|
1317
|
-
The certificate fields that this token covers, if DCAP token.
|
|
1318
|
-
|
|
1319
|
-
```ts
|
|
1320
|
-
certFields?: string[]
|
|
1321
|
-
```
|
|
1322
|
-
|
|
1323
|
-
###### Property certType
|
|
1324
|
-
|
|
1325
|
-
The certificate type, if this is a DCAP token.
|
|
1326
|
-
|
|
1327
|
-
```ts
|
|
1328
|
-
certType?: string
|
|
1329
|
-
```
|
|
1330
|
-
|
|
1331
|
-
###### Property counterparty
|
|
1332
|
-
|
|
1333
|
-
The counterparty, for DPACP.
|
|
1334
|
-
|
|
1335
|
-
```ts
|
|
1336
|
-
counterparty?: string
|
|
1337
|
-
```
|
|
1338
|
-
|
|
1339
|
-
###### Property expiry
|
|
1340
|
-
|
|
1341
|
-
The expiration time for this token in UNIX epoch seconds. (0 or omitted for spending authorizations, which are indefinite)
|
|
1342
|
-
|
|
1343
|
-
```ts
|
|
1344
|
-
expiry: number
|
|
1345
|
-
```
|
|
1346
|
-
|
|
1347
|
-
###### Property originator
|
|
1348
|
-
|
|
1349
|
-
The originator domain or FQDN that is allowed to use this permission.
|
|
1350
|
-
|
|
1351
|
-
```ts
|
|
1352
|
-
originator: string
|
|
1353
|
-
```
|
|
1354
|
-
|
|
1355
|
-
###### Property outputIndex
|
|
1356
|
-
|
|
1357
|
-
The output index within that transaction.
|
|
1358
|
-
|
|
1359
|
-
```ts
|
|
1360
|
-
outputIndex: number
|
|
1361
|
-
```
|
|
1362
|
-
|
|
1363
|
-
###### Property outputScript
|
|
1364
|
-
|
|
1365
|
-
The exact script hex for the locking script.
|
|
1366
|
-
|
|
1367
|
-
```ts
|
|
1368
|
-
outputScript: string
|
|
1369
|
-
```
|
|
1370
|
-
|
|
1371
|
-
###### Property privileged
|
|
1372
|
-
|
|
1373
|
-
Whether this token grants privileged usage (for protocol or certificate).
|
|
1374
|
-
|
|
1375
|
-
```ts
|
|
1376
|
-
privileged?: boolean
|
|
1377
|
-
```
|
|
1378
|
-
|
|
1379
|
-
###### Property protocol
|
|
1380
|
-
|
|
1381
|
-
The protocol name, if this is a DPACP token.
|
|
1382
|
-
|
|
1383
|
-
```ts
|
|
1384
|
-
protocol?: string
|
|
1385
|
-
```
|
|
1386
|
-
|
|
1387
|
-
###### Property satoshis
|
|
1388
|
-
|
|
1389
|
-
The amount of satoshis assigned to the permission output (often 1).
|
|
1390
|
-
|
|
1391
|
-
```ts
|
|
1392
|
-
satoshis: number
|
|
1393
|
-
```
|
|
1394
|
-
|
|
1395
|
-
###### Property securityLevel
|
|
1396
|
-
|
|
1397
|
-
The security level (0,1,2) for DPACP.
|
|
1398
|
-
|
|
1399
|
-
```ts
|
|
1400
|
-
securityLevel?: 0 | 1 | 2
|
|
1401
|
-
```
|
|
1402
|
-
|
|
1403
|
-
###### Property txid
|
|
1404
|
-
|
|
1405
|
-
The transaction ID where this token resides.
|
|
1406
|
-
|
|
1407
|
-
```ts
|
|
1408
|
-
txid: string
|
|
1409
|
-
```
|
|
1410
|
-
|
|
1411
|
-
###### Property verifier
|
|
1412
|
-
|
|
1413
|
-
The "verifier" public key string, if DCAP.
|
|
1414
|
-
|
|
1415
|
-
```ts
|
|
1416
|
-
verifier?: string
|
|
1417
|
-
```
|
|
1418
|
-
|
|
1419
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1420
|
-
|
|
1421
|
-
---
|
|
1422
|
-
##### Interface: PermissionsManagerConfig
|
|
1423
|
-
|
|
1424
|
-
Configuration object for the WalletPermissionsManager. If a given option is `false`,
|
|
1425
|
-
the manager will skip or alter certain permission checks or behaviors.
|
|
1426
|
-
|
|
1427
|
-
By default, all of these are `true` unless specified otherwise. This is the most secure configuration.
|
|
1428
|
-
|
|
1429
|
-
```ts
|
|
1430
|
-
export interface PermissionsManagerConfig {
|
|
1431
|
-
seekProtocolPermissionsForSigning?: boolean;
|
|
1432
|
-
seekProtocolPermissionsForEncrypting?: boolean;
|
|
1433
|
-
seekProtocolPermissionsForHMAC?: boolean;
|
|
1434
|
-
seekPermissionsForKeyLinkageRevelation?: boolean;
|
|
1435
|
-
seekPermissionsForPublicKeyRevelation?: boolean;
|
|
1436
|
-
seekPermissionsForIdentityKeyRevelation?: boolean;
|
|
1437
|
-
seekPermissionsForIdentityResolution?: boolean;
|
|
1438
|
-
seekBasketInsertionPermissions?: boolean;
|
|
1439
|
-
seekBasketRemovalPermissions?: boolean;
|
|
1440
|
-
seekBasketListingPermissions?: boolean;
|
|
1441
|
-
seekPermissionWhenApplyingActionLabels?: boolean;
|
|
1442
|
-
seekPermissionWhenListingActionsByLabel?: boolean;
|
|
1443
|
-
seekCertificateDisclosurePermissions?: boolean;
|
|
1444
|
-
seekCertificateAcquisitionPermissions?: boolean;
|
|
1445
|
-
seekCertificateRelinquishmentPermissions?: boolean;
|
|
1446
|
-
seekCertificateListingPermissions?: boolean;
|
|
1447
|
-
encryptWalletMetadata?: boolean;
|
|
1448
|
-
seekSpendingPermissions?: boolean;
|
|
1449
|
-
differentiatePrivilegedOperations?: boolean;
|
|
1450
|
-
}
|
|
1451
|
-
```
|
|
1452
|
-
|
|
1453
|
-
###### Property differentiatePrivilegedOperations
|
|
1454
|
-
|
|
1455
|
-
If false, permissions are checked without regard for whether we are in
|
|
1456
|
-
privileged mode. Privileged status is ignored with respect to whether
|
|
1457
|
-
permissions are granted. Internally, they are always sought and checked
|
|
1458
|
-
with privileged=false, regardless of the actual value.
|
|
1459
|
-
|
|
1460
|
-
```ts
|
|
1461
|
-
differentiatePrivilegedOperations?: boolean
|
|
1462
|
-
```
|
|
1463
|
-
|
|
1464
|
-
###### Property encryptWalletMetadata
|
|
1465
|
-
|
|
1466
|
-
Should transaction descriptions, input descriptions, and output descriptions be encrypted
|
|
1467
|
-
when before they are passed to the underlying wallet, and transparently decrypted when retrieved?
|
|
1468
|
-
|
|
1469
|
-
```ts
|
|
1470
|
-
encryptWalletMetadata?: boolean
|
|
1471
|
-
```
|
|
1472
|
-
|
|
1473
|
-
###### Property seekBasketInsertionPermissions
|
|
1474
|
-
|
|
1475
|
-
When we do internalizeAction with `basket insertion`, or include outputs in baskets
|
|
1476
|
-
with `createAction, do we ask for basket permission?
|
|
1477
|
-
|
|
1478
|
-
```ts
|
|
1479
|
-
seekBasketInsertionPermissions?: boolean
|
|
1480
|
-
```
|
|
1481
|
-
|
|
1482
|
-
###### Property seekBasketListingPermissions
|
|
1483
|
-
|
|
1484
|
-
When listOutputs is called, do we ask for basket permission?
|
|
1485
|
-
|
|
1486
|
-
```ts
|
|
1487
|
-
seekBasketListingPermissions?: boolean
|
|
1488
|
-
```
|
|
1489
|
-
|
|
1490
|
-
###### Property seekBasketRemovalPermissions
|
|
1491
|
-
|
|
1492
|
-
When relinquishOutput is called, do we ask for basket permission?
|
|
1493
|
-
|
|
1494
|
-
```ts
|
|
1495
|
-
seekBasketRemovalPermissions?: boolean
|
|
1496
|
-
```
|
|
1497
|
-
|
|
1498
|
-
###### Property seekCertificateAcquisitionPermissions
|
|
1499
|
-
|
|
1500
|
-
If acquiring a certificate (acquireCertificate), do we require a permission check?
|
|
1501
|
-
|
|
1502
|
-
```ts
|
|
1503
|
-
seekCertificateAcquisitionPermissions?: boolean
|
|
1504
|
-
```
|
|
1505
|
-
|
|
1506
|
-
###### Property seekCertificateDisclosurePermissions
|
|
1507
|
-
|
|
1508
|
-
If proving a certificate (proveCertificate) or revealing certificate fields,
|
|
1509
|
-
do we require a "certificate access" permission?
|
|
1510
|
-
|
|
1511
|
-
```ts
|
|
1512
|
-
seekCertificateDisclosurePermissions?: boolean
|
|
1513
|
-
```
|
|
1514
|
-
|
|
1515
|
-
###### Property seekCertificateListingPermissions
|
|
1516
|
-
|
|
1517
|
-
If listing a user's certificates (listCertificates), do we require a permission check?
|
|
1518
|
-
|
|
1519
|
-
```ts
|
|
1520
|
-
seekCertificateListingPermissions?: boolean
|
|
1521
|
-
```
|
|
1522
|
-
|
|
1523
|
-
###### Property seekCertificateRelinquishmentPermissions
|
|
1524
|
-
|
|
1525
|
-
If relinquishing a certificate (relinquishCertificate), do we require a permission check?
|
|
1526
|
-
|
|
1527
|
-
```ts
|
|
1528
|
-
seekCertificateRelinquishmentPermissions?: boolean
|
|
1529
|
-
```
|
|
1530
|
-
|
|
1531
|
-
###### Property seekPermissionWhenApplyingActionLabels
|
|
1532
|
-
|
|
1533
|
-
When createAction is called with labels, do we ask for "label usage" permission?
|
|
1534
|
-
|
|
1535
|
-
```ts
|
|
1536
|
-
seekPermissionWhenApplyingActionLabels?: boolean
|
|
1537
|
-
```
|
|
1538
|
-
|
|
1539
|
-
###### Property seekPermissionWhenListingActionsByLabel
|
|
1540
|
-
|
|
1541
|
-
When listActions is called with labels, do we ask for "label usage" permission?
|
|
1542
|
-
|
|
1543
|
-
```ts
|
|
1544
|
-
seekPermissionWhenListingActionsByLabel?: boolean
|
|
1545
|
-
```
|
|
1546
|
-
|
|
1547
|
-
###### Property seekPermissionsForIdentityKeyRevelation
|
|
1548
|
-
|
|
1549
|
-
If getPublicKey is requested with `identityKey=true`, do we require permission?
|
|
1550
|
-
|
|
1551
|
-
```ts
|
|
1552
|
-
seekPermissionsForIdentityKeyRevelation?: boolean
|
|
1553
|
-
```
|
|
1554
|
-
|
|
1555
|
-
###### Property seekPermissionsForIdentityResolution
|
|
1556
|
-
|
|
1557
|
-
If discoverByIdentityKey / discoverByAttributes are called, do we require permission
|
|
1558
|
-
for "identity resolution" usage?
|
|
1559
|
-
|
|
1560
|
-
```ts
|
|
1561
|
-
seekPermissionsForIdentityResolution?: boolean
|
|
1562
|
-
```
|
|
1563
|
-
|
|
1564
|
-
###### Property seekPermissionsForKeyLinkageRevelation
|
|
1565
|
-
|
|
1566
|
-
For revealing counterparty-level or specific key linkage revelation information,
|
|
1567
|
-
should we require permission?
|
|
1568
|
-
|
|
1569
|
-
```ts
|
|
1570
|
-
seekPermissionsForKeyLinkageRevelation?: boolean
|
|
1571
|
-
```
|
|
1572
|
-
|
|
1573
|
-
###### Property seekPermissionsForPublicKeyRevelation
|
|
1574
|
-
|
|
1575
|
-
For revealing any user public key (getPublicKey) **other** than the identity key,
|
|
1576
|
-
should we require permission?
|
|
1577
|
-
|
|
1578
|
-
```ts
|
|
1579
|
-
seekPermissionsForPublicKeyRevelation?: boolean
|
|
1580
|
-
```
|
|
1581
|
-
|
|
1582
|
-
###### Property seekProtocolPermissionsForEncrypting
|
|
1583
|
-
|
|
1584
|
-
For methods that perform encryption (encrypt/decrypt), require
|
|
1585
|
-
a "protocol usage" permission check?
|
|
1586
|
-
|
|
1587
|
-
```ts
|
|
1588
|
-
seekProtocolPermissionsForEncrypting?: boolean
|
|
1589
|
-
```
|
|
1590
|
-
|
|
1591
|
-
###### Property seekProtocolPermissionsForHMAC
|
|
1592
|
-
|
|
1593
|
-
For methods that perform HMAC creation or verification (createHmac, verifyHmac),
|
|
1594
|
-
require a "protocol usage" permission check?
|
|
1595
|
-
|
|
1596
|
-
```ts
|
|
1597
|
-
seekProtocolPermissionsForHMAC?: boolean
|
|
1598
|
-
```
|
|
1599
|
-
|
|
1600
|
-
###### Property seekProtocolPermissionsForSigning
|
|
1601
|
-
|
|
1602
|
-
For `createSignature` and `verifySignature`,
|
|
1603
|
-
require a "protocol usage" permission check?
|
|
1604
|
-
|
|
1605
|
-
```ts
|
|
1606
|
-
seekProtocolPermissionsForSigning?: boolean
|
|
1607
|
-
```
|
|
1608
|
-
|
|
1609
|
-
###### Property seekSpendingPermissions
|
|
1610
|
-
|
|
1611
|
-
If the originator tries to spend wallet funds (netSpent > 0 in createAction),
|
|
1612
|
-
do we seek spending authorization?
|
|
1613
|
-
|
|
1614
|
-
```ts
|
|
1615
|
-
seekSpendingPermissions?: boolean
|
|
1616
|
-
```
|
|
1617
|
-
|
|
1618
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1619
|
-
|
|
1620
1153
|
---
|
|
1621
1154
|
##### Interface: PostBeefResult
|
|
1622
1155
|
|
|
@@ -2075,20 +1608,7 @@ export interface ScriptTemplateUnlock {
|
|
|
2075
1608
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2076
1609
|
|
|
2077
1610
|
---
|
|
2078
|
-
##### Interface:
|
|
2079
|
-
|
|
2080
|
-
```ts
|
|
2081
|
-
export interface StartAuthResponse {
|
|
2082
|
-
success: boolean;
|
|
2083
|
-
message?: string;
|
|
2084
|
-
data?: any;
|
|
2085
|
-
}
|
|
2086
|
-
```
|
|
2087
|
-
|
|
2088
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2089
|
-
|
|
2090
|
-
---
|
|
2091
|
-
##### Interface: StorageCreateActionResult
|
|
1611
|
+
##### Interface: StorageCreateActionResult
|
|
2092
1612
|
|
|
2093
1613
|
```ts
|
|
2094
1614
|
export interface StorageCreateActionResult {
|
|
@@ -3218,20 +2738,6 @@ See also: [PurgeParams](./client.md#interface-purgeparams)
|
|
|
3218
2738
|
|
|
3219
2739
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3220
2740
|
|
|
3221
|
-
---
|
|
3222
|
-
##### Interface: TrustSettings
|
|
3223
|
-
|
|
3224
|
-
```ts
|
|
3225
|
-
export interface TrustSettings {
|
|
3226
|
-
trustLevel: number;
|
|
3227
|
-
trustedCertifiers: Certifier[];
|
|
3228
|
-
}
|
|
3229
|
-
```
|
|
3230
|
-
|
|
3231
|
-
See also: [Certifier](./client.md#interface-certifier)
|
|
3232
|
-
|
|
3233
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3234
|
-
|
|
3235
2741
|
---
|
|
3236
2742
|
##### Interface: TrxToken
|
|
3237
2743
|
|
|
@@ -3277,172 +2783,6 @@ export interface TxScriptOffsets {
|
|
|
3277
2783
|
|
|
3278
2784
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3279
2785
|
|
|
3280
|
-
---
|
|
3281
|
-
##### Interface: UMPToken
|
|
3282
|
-
|
|
3283
|
-
Describes the structure of a User Management Protocol (UMP) token.
|
|
3284
|
-
|
|
3285
|
-
```ts
|
|
3286
|
-
export interface UMPToken {
|
|
3287
|
-
passwordPresentationPrimary: number[];
|
|
3288
|
-
passwordRecoveryPrimary: number[];
|
|
3289
|
-
presentationRecoveryPrimary: number[];
|
|
3290
|
-
passwordPrimaryPrivileged: number[];
|
|
3291
|
-
presentationRecoveryPrivileged: number[];
|
|
3292
|
-
presentationHash: number[];
|
|
3293
|
-
passwordSalt: number[];
|
|
3294
|
-
recoveryHash: number[];
|
|
3295
|
-
presentationKeyEncrypted: number[];
|
|
3296
|
-
recoveryKeyEncrypted: number[];
|
|
3297
|
-
passwordKeyEncrypted: number[];
|
|
3298
|
-
currentOutpoint?: OutpointString;
|
|
3299
|
-
}
|
|
3300
|
-
```
|
|
3301
|
-
|
|
3302
|
-
###### Property currentOutpoint
|
|
3303
|
-
|
|
3304
|
-
Describes the token's location on-chain, if it's already been published.
|
|
3305
|
-
|
|
3306
|
-
```ts
|
|
3307
|
-
currentOutpoint?: OutpointString
|
|
3308
|
-
```
|
|
3309
|
-
|
|
3310
|
-
###### Property passwordKeyEncrypted
|
|
3311
|
-
|
|
3312
|
-
A copy of the password key encrypted with the privileged key.
|
|
3313
|
-
|
|
3314
|
-
```ts
|
|
3315
|
-
passwordKeyEncrypted: number[]
|
|
3316
|
-
```
|
|
3317
|
-
|
|
3318
|
-
###### Property passwordPresentationPrimary
|
|
3319
|
-
|
|
3320
|
-
Primary key encrypted by the XOR of the password and presentation keys.
|
|
3321
|
-
|
|
3322
|
-
```ts
|
|
3323
|
-
passwordPresentationPrimary: number[]
|
|
3324
|
-
```
|
|
3325
|
-
|
|
3326
|
-
###### Property passwordPrimaryPrivileged
|
|
3327
|
-
|
|
3328
|
-
Privileged key encrypted by the XOR of the password and primary keys.
|
|
3329
|
-
|
|
3330
|
-
```ts
|
|
3331
|
-
passwordPrimaryPrivileged: number[]
|
|
3332
|
-
```
|
|
3333
|
-
|
|
3334
|
-
###### Property passwordRecoveryPrimary
|
|
3335
|
-
|
|
3336
|
-
Primary key encrypted by the XOR of the password and recovery keys.
|
|
3337
|
-
|
|
3338
|
-
```ts
|
|
3339
|
-
passwordRecoveryPrimary: number[]
|
|
3340
|
-
```
|
|
3341
|
-
|
|
3342
|
-
###### Property passwordSalt
|
|
3343
|
-
|
|
3344
|
-
PBKDF2 salt used in conjunction with the password to derive the password key.
|
|
3345
|
-
|
|
3346
|
-
```ts
|
|
3347
|
-
passwordSalt: number[]
|
|
3348
|
-
```
|
|
3349
|
-
|
|
3350
|
-
###### Property presentationHash
|
|
3351
|
-
|
|
3352
|
-
Hash of the presentation key.
|
|
3353
|
-
|
|
3354
|
-
```ts
|
|
3355
|
-
presentationHash: number[]
|
|
3356
|
-
```
|
|
3357
|
-
|
|
3358
|
-
###### Property presentationKeyEncrypted
|
|
3359
|
-
|
|
3360
|
-
A copy of the presentation key encrypted with the privileged key.
|
|
3361
|
-
|
|
3362
|
-
```ts
|
|
3363
|
-
presentationKeyEncrypted: number[]
|
|
3364
|
-
```
|
|
3365
|
-
|
|
3366
|
-
###### Property presentationRecoveryPrimary
|
|
3367
|
-
|
|
3368
|
-
Primary key encrypted by the XOR of the presentation and recovery keys.
|
|
3369
|
-
|
|
3370
|
-
```ts
|
|
3371
|
-
presentationRecoveryPrimary: number[]
|
|
3372
|
-
```
|
|
3373
|
-
|
|
3374
|
-
###### Property presentationRecoveryPrivileged
|
|
3375
|
-
|
|
3376
|
-
Privileged key encrypted by the XOR of the presentation and recovery keys.
|
|
3377
|
-
|
|
3378
|
-
```ts
|
|
3379
|
-
presentationRecoveryPrivileged: number[]
|
|
3380
|
-
```
|
|
3381
|
-
|
|
3382
|
-
###### Property recoveryHash
|
|
3383
|
-
|
|
3384
|
-
Hash of the recovery key.
|
|
3385
|
-
|
|
3386
|
-
```ts
|
|
3387
|
-
recoveryHash: number[]
|
|
3388
|
-
```
|
|
3389
|
-
|
|
3390
|
-
###### Property recoveryKeyEncrypted
|
|
3391
|
-
|
|
3392
|
-
A copy of the recovery key encrypted with the privileged key.
|
|
3393
|
-
|
|
3394
|
-
```ts
|
|
3395
|
-
recoveryKeyEncrypted: number[]
|
|
3396
|
-
```
|
|
3397
|
-
|
|
3398
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3399
|
-
|
|
3400
|
-
---
|
|
3401
|
-
##### Interface: UMPTokenInteractor
|
|
3402
|
-
|
|
3403
|
-
Describes a system capable of finding and updating UMP tokens on the blockchain.
|
|
3404
|
-
|
|
3405
|
-
```ts
|
|
3406
|
-
export interface UMPTokenInteractor {
|
|
3407
|
-
findByPresentationKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
|
|
3408
|
-
findByRecoveryKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
|
|
3409
|
-
buildAndSend: (wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken) => Promise<OutpointString>;
|
|
3410
|
-
}
|
|
3411
|
-
```
|
|
3412
|
-
|
|
3413
|
-
See also: [UMPToken](./client.md#interface-umptoken)
|
|
3414
|
-
|
|
3415
|
-
###### Property buildAndSend
|
|
3416
|
-
|
|
3417
|
-
Creates (and optionally consumes the previous version of) a UMP token on-chain.
|
|
3418
|
-
|
|
3419
|
-
```ts
|
|
3420
|
-
buildAndSend: (wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken) => Promise<OutpointString>
|
|
3421
|
-
```
|
|
3422
|
-
See also: [UMPToken](./client.md#interface-umptoken)
|
|
3423
|
-
|
|
3424
|
-
###### Property findByPresentationKeyHash
|
|
3425
|
-
|
|
3426
|
-
Locates the latest valid copy of a UMP token (including its outpoint)
|
|
3427
|
-
based on the presentation key hash.
|
|
3428
|
-
|
|
3429
|
-
```ts
|
|
3430
|
-
findByPresentationKeyHash: (hash: number[]) => Promise<UMPToken | undefined>
|
|
3431
|
-
```
|
|
3432
|
-
See also: [UMPToken](./client.md#interface-umptoken)
|
|
3433
|
-
|
|
3434
|
-
###### Property findByRecoveryKeyHash
|
|
3435
|
-
|
|
3436
|
-
Locates the latest valid copy of a UMP token (including its outpoint)
|
|
3437
|
-
based on the recovery key hash.
|
|
3438
|
-
|
|
3439
|
-
```ts
|
|
3440
|
-
findByRecoveryKeyHash: (hash: number[]) => Promise<UMPToken | undefined>
|
|
3441
|
-
```
|
|
3442
|
-
See also: [UMPToken](./client.md#interface-umptoken)
|
|
3443
|
-
|
|
3444
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3445
|
-
|
|
3446
2786
|
---
|
|
3447
2787
|
##### Interface: UpdateProvenTxReqWithNewProvenTxArgs
|
|
3448
2788
|
|
|
@@ -3959,31 +3299,10 @@ export interface WalletArgs {
|
|
|
3959
3299
|
services?: sdk.WalletServices;
|
|
3960
3300
|
monitor?: Monitor;
|
|
3961
3301
|
privilegedKeyManager?: sdk.PrivilegedKeyManager;
|
|
3962
|
-
settingsManager?: WalletSettingsManager;
|
|
3963
|
-
lookupResolver?: LookupResolver;
|
|
3964
|
-
}
|
|
3965
|
-
```
|
|
3966
|
-
|
|
3967
|
-
See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [WalletServices](./client.md#interface-walletservices), [WalletSettingsManager](./client.md#class-walletsettingsmanager), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
3968
|
-
|
|
3969
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3970
|
-
|
|
3971
|
-
---
|
|
3972
|
-
##### Interface: WalletPermissionsManagerCallbacks
|
|
3973
|
-
|
|
3974
|
-
The set of callbacks that external code can bind to, e.g. to display UI prompts or logs
|
|
3975
|
-
when a permission is requested.
|
|
3976
|
-
|
|
3977
|
-
```ts
|
|
3978
|
-
export interface WalletPermissionsManagerCallbacks {
|
|
3979
|
-
onProtocolPermissionRequested?: PermissionEventHandler[];
|
|
3980
|
-
onBasketAccessRequested?: PermissionEventHandler[];
|
|
3981
|
-
onCertificateAccessRequested?: PermissionEventHandler[];
|
|
3982
|
-
onSpendingAuthorizationRequested?: PermissionEventHandler[];
|
|
3983
3302
|
}
|
|
3984
3303
|
```
|
|
3985
3304
|
|
|
3986
|
-
See also: [
|
|
3305
|
+
See also: [Chain](./client.md#type-chain), [Monitor](./monitor.md#class-monitor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [WalletServices](./client.md#interface-walletservices), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
3987
3306
|
|
|
3988
3307
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3989
3308
|
|
|
@@ -4211,33 +3530,6 @@ See also: [ArcConfig](./services.md#interface-arcconfig), [BsvExchangeRate](./cl
|
|
|
4211
3530
|
|
|
4212
3531
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4213
3532
|
|
|
4214
|
-
---
|
|
4215
|
-
##### Interface: WalletSettings
|
|
4216
|
-
|
|
4217
|
-
```ts
|
|
4218
|
-
export interface WalletSettings {
|
|
4219
|
-
trustSettings: TrustSettings;
|
|
4220
|
-
theme?: WalletTheme;
|
|
4221
|
-
}
|
|
4222
|
-
```
|
|
4223
|
-
|
|
4224
|
-
See also: [TrustSettings](./client.md#interface-trustsettings), [WalletTheme](./client.md#interface-wallettheme)
|
|
4225
|
-
|
|
4226
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4227
|
-
|
|
4228
|
-
---
|
|
4229
|
-
##### Interface: WalletSettingsManagerConfig
|
|
4230
|
-
|
|
4231
|
-
```ts
|
|
4232
|
-
export interface WalletSettingsManagerConfig {
|
|
4233
|
-
defaultSettings: WalletSettings;
|
|
4234
|
-
}
|
|
4235
|
-
```
|
|
4236
|
-
|
|
4237
|
-
See also: [WalletSettings](./client.md#interface-walletsettings)
|
|
4238
|
-
|
|
4239
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4240
|
-
|
|
4241
3533
|
---
|
|
4242
3534
|
##### Interface: WalletSigner
|
|
4243
3535
|
|
|
@@ -4402,17 +3694,6 @@ See also: [AuthId](./client.md#interface-authid), [StorageCreateActionResult](./
|
|
|
4402
3694
|
|
|
4403
3695
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4404
3696
|
|
|
4405
|
-
---
|
|
4406
|
-
##### Interface: WalletTheme
|
|
4407
|
-
|
|
4408
|
-
```ts
|
|
4409
|
-
export interface WalletTheme {
|
|
4410
|
-
mode: string;
|
|
4411
|
-
}
|
|
4412
|
-
```
|
|
4413
|
-
|
|
4414
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4415
|
-
|
|
4416
3697
|
---
|
|
4417
3698
|
##### Interface: XValidCreateActionOutput
|
|
4418
3699
|
|
|
@@ -4435,28 +3716,25 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4435
3716
|
|
|
4436
3717
|
| | | |
|
|
4437
3718
|
| --- | --- | --- |
|
|
4438
|
-
| [ARC](#class-arc) | [
|
|
4439
|
-
| [
|
|
4440
|
-
| [
|
|
4441
|
-
| [
|
|
4442
|
-
| [
|
|
4443
|
-
| [
|
|
4444
|
-
| [
|
|
4445
|
-
| [
|
|
4446
|
-
| [
|
|
4447
|
-
| [
|
|
4448
|
-
| [
|
|
4449
|
-
| [
|
|
4450
|
-
| [EntityProvenTx](#class-entityproventx) | [TaskCheckForProofs](#class-taskcheckforproofs) | [Wallet](#class-wallet) |
|
|
4451
|
-
| [EntityProvenTxReq](#class-entityproventxreq) | [TaskClock](#class-taskclock) | [WalletAuthenticationManager](#class-walletauthenticationmanager) |
|
|
3719
|
+
| [ARC](#class-arc) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
|
|
3720
|
+
| [CertOps](#class-certops) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
|
|
3721
|
+
| [EntityBase](#class-entitybase) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_INTERNAL](#class-werr_internal) |
|
|
3722
|
+
| [EntityCertificate](#class-entitycertificate) | [ServiceCollection](#class-servicecollection) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
|
|
3723
|
+
| [EntityCertificateField](#class-entitycertificatefield) | [Services](#class-services) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
|
|
3724
|
+
| [EntityCommission](#class-entitycommission) | [StorageClient](#class-storageclient) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
|
|
3725
|
+
| [EntityOutput](#class-entityoutput) | [StorageProvider](#class-storageprovider) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
|
|
3726
|
+
| [EntityOutputBasket](#class-entityoutputbasket) | [StorageReader](#class-storagereader) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
|
|
3727
|
+
| [EntityOutputTag](#class-entityoutputtag) | [StorageReaderWriter](#class-storagereaderwriter) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
|
|
3728
|
+
| [EntityOutputTagMap](#class-entityoutputtagmap) | [StorageSyncReader](#class-storagesyncreader) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
|
|
3729
|
+
| [EntityProvenTx](#class-entityproventx) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
|
|
3730
|
+
| [EntityProvenTxReq](#class-entityproventxreq) | [TaskClock](#class-taskclock) | [Wallet](#class-wallet) |
|
|
4452
3731
|
| [EntitySyncState](#class-entitysyncstate) | [TaskFailAbandoned](#class-taskfailabandoned) | [WalletError](#class-walleterror) |
|
|
4453
3732
|
| [EntityTransaction](#class-entitytransaction) | [TaskNewHeader](#class-tasknewheader) | [WalletMonitorTask](#class-walletmonitortask) |
|
|
4454
|
-
| [EntityTxLabel](#class-entitytxlabel) | [TaskPurge](#class-taskpurge) | [
|
|
4455
|
-
| [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskReviewStatus](#class-taskreviewstatus) | [
|
|
4456
|
-
| [EntityUser](#class-entityuser) | [TaskSendWaiting](#class-tasksendwaiting) | [
|
|
4457
|
-
| [MergeEntity](#class-mergeentity) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) |
|
|
4458
|
-
| [Monitor](#class-monitor) | [
|
|
4459
|
-
| [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [WABClient](#class-wabclient) | |
|
|
3733
|
+
| [EntityTxLabel](#class-entitytxlabel) | [TaskPurge](#class-taskpurge) | [WalletSigner](#class-walletsigner) |
|
|
3734
|
+
| [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskReviewStatus](#class-taskreviewstatus) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
3735
|
+
| [EntityUser](#class-entityuser) | [TaskSendWaiting](#class-tasksendwaiting) | [WhatsOnChain](#class-whatsonchain) |
|
|
3736
|
+
| [MergeEntity](#class-mergeentity) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) | |
|
|
3737
|
+
| [Monitor](#class-monitor) | [WERR_BAD_REQUEST](#class-werr_bad_request) | |
|
|
4460
3738
|
|
|
4461
3739
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4462
3740
|
|
|
@@ -4554,304 +3832,6 @@ See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
|
4554
3832
|
|
|
4555
3833
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4556
3834
|
|
|
4557
|
-
---
|
|
4558
|
-
##### Class: AuthMethodInteractor
|
|
4559
|
-
|
|
4560
|
-
Abstract client-side interactor for an Auth Method
|
|
4561
|
-
|
|
4562
|
-
```ts
|
|
4563
|
-
export abstract class AuthMethodInteractor {
|
|
4564
|
-
public abstract methodType: string;
|
|
4565
|
-
public abstract startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>;
|
|
4566
|
-
public abstract completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>;
|
|
4567
|
-
}
|
|
4568
|
-
```
|
|
4569
|
-
|
|
4570
|
-
See also: [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse), [StartAuthResponse](./client.md#interface-startauthresponse)
|
|
4571
|
-
|
|
4572
|
-
###### Method completeAuth
|
|
4573
|
-
|
|
4574
|
-
Complete the flow (e.g. confirm OTP).
|
|
4575
|
-
|
|
4576
|
-
```ts
|
|
4577
|
-
public abstract completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>
|
|
4578
|
-
```
|
|
4579
|
-
See also: [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse)
|
|
4580
|
-
|
|
4581
|
-
###### Method startAuth
|
|
4582
|
-
|
|
4583
|
-
Start the flow (e.g. request an OTP or create a session).
|
|
4584
|
-
|
|
4585
|
-
```ts
|
|
4586
|
-
public abstract startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>
|
|
4587
|
-
```
|
|
4588
|
-
See also: [AuthPayload](./client.md#interface-authpayload), [StartAuthResponse](./client.md#interface-startauthresponse)
|
|
4589
|
-
|
|
4590
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4591
|
-
|
|
4592
|
-
---
|
|
4593
|
-
##### Class: CWIStyleWalletManager
|
|
4594
|
-
|
|
4595
|
-
Manages a "CWI-style" wallet that uses a UMP token and a
|
|
4596
|
-
multi-key authentication scheme (password, presentation key, and recovery key).
|
|
4597
|
-
|
|
4598
|
-
```ts
|
|
4599
|
-
export class CWIStyleWalletManager implements WalletInterface {
|
|
4600
|
-
authenticated: boolean;
|
|
4601
|
-
authenticationMode: "presentation-key-and-password" | "presentation-key-and-recovery-key" | "recovery-key-and-password" = "presentation-key-and-password";
|
|
4602
|
-
authenticationFlow: "new-user" | "existing-user" = "new-user";
|
|
4603
|
-
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => 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[])
|
|
4604
|
-
async providePresentationKey(key: number[]): Promise<void>
|
|
4605
|
-
async providePassword(password: string): Promise<void>
|
|
4606
|
-
async provideRecoveryKey(recoveryKey: number[]): Promise<void>
|
|
4607
|
-
saveSnapshot(): number[]
|
|
4608
|
-
async loadSnapshot(snapshot: number[]): Promise<void>
|
|
4609
|
-
destroy(): void
|
|
4610
|
-
async changePassword(newPassword: string): Promise<void>
|
|
4611
|
-
async changeRecoveryKey(): Promise<void>
|
|
4612
|
-
async changePresentationKey(presentationKey: number[]): Promise<void>
|
|
4613
|
-
async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
|
|
4614
|
-
async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
|
|
4615
|
-
async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
|
|
4616
|
-
async encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
|
|
4617
|
-
async decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
|
|
4618
|
-
async createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
|
|
4619
|
-
async verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
|
|
4620
|
-
async createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
|
|
4621
|
-
async verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
|
|
4622
|
-
async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
|
|
4623
|
-
async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
|
|
4624
|
-
async abortAction(args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AbortActionResult>
|
|
4625
|
-
async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
|
|
4626
|
-
async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<InternalizeActionResult>
|
|
4627
|
-
async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
4628
|
-
async relinquishOutput(args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishOutputResult>
|
|
4629
|
-
async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
|
|
4630
|
-
async listCertificates(args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
|
|
4631
|
-
async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
|
|
4632
|
-
async relinquishCertificate(args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishCertificateResult>
|
|
4633
|
-
async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
4634
|
-
async discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
4635
|
-
async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
|
|
4636
|
-
async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
|
|
4637
|
-
async getHeight(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeightResult>
|
|
4638
|
-
async getHeaderForHeight(args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeaderResult>
|
|
4639
|
-
async getNetwork(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetNetworkResult>
|
|
4640
|
-
async getVersion(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetVersionResult>
|
|
4641
|
-
}
|
|
4642
|
-
```
|
|
4643
|
-
|
|
4644
|
-
See also: [OverlayUMPTokenInteractor](./client.md#class-overlayumptokeninteractor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [UMPTokenInteractor](./client.md#interface-umptokeninteractor), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
|
|
4645
|
-
|
|
4646
|
-
###### Constructor
|
|
4647
|
-
|
|
4648
|
-
Constructs a new CWIStyleWalletManager.
|
|
4649
|
-
|
|
4650
|
-
```ts
|
|
4651
|
-
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => 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[])
|
|
4652
|
-
```
|
|
4653
|
-
See also: [OverlayUMPTokenInteractor](./client.md#class-overlayumptokeninteractor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [UMPTokenInteractor](./client.md#interface-umptokeninteractor)
|
|
4654
|
-
|
|
4655
|
-
Argument Details
|
|
4656
|
-
|
|
4657
|
-
+ **adminOriginator**
|
|
4658
|
-
+ The domain name of the administrative originator.
|
|
4659
|
-
+ **walletBuilder**
|
|
4660
|
-
+ A function that can build an underlying wallet instance
|
|
4661
|
-
from a primary key and a privileged key manager
|
|
4662
|
-
+ **interactor**
|
|
4663
|
-
+ An instance of UMPTokenInteractor capable of managing UMP tokens.
|
|
4664
|
-
+ **recoveryKeySaver**
|
|
4665
|
-
+ A function that can persist or display a newly generated recovery key.
|
|
4666
|
-
+ **passwordRetriever**
|
|
4667
|
-
+ A function to request the user's password, given a reason and a test function.
|
|
4668
|
-
+ **newWalletFunder**
|
|
4669
|
-
+ An optional function called with the presentation key and a new Wallet post-construction to fund it before use.
|
|
4670
|
-
+ **stateSnapshot**
|
|
4671
|
-
+ If provided, a previously saved snapshot of the wallet's state.
|
|
4672
|
-
|
|
4673
|
-
###### Property authenticated
|
|
4674
|
-
|
|
4675
|
-
Whether the user is currently authenticated.
|
|
4676
|
-
|
|
4677
|
-
```ts
|
|
4678
|
-
authenticated: boolean
|
|
4679
|
-
```
|
|
4680
|
-
|
|
4681
|
-
###### Property authenticationFlow
|
|
4682
|
-
|
|
4683
|
-
Indicates whether this is a new user or an existing user flow:
|
|
4684
|
-
- 'new-user'
|
|
4685
|
-
- 'existing-user'
|
|
4686
|
-
|
|
4687
|
-
```ts
|
|
4688
|
-
authenticationFlow: "new-user" | "existing-user" = "new-user"
|
|
4689
|
-
```
|
|
4690
|
-
|
|
4691
|
-
###### Property authenticationMode
|
|
4692
|
-
|
|
4693
|
-
The current mode of authentication:
|
|
4694
|
-
- 'presentation-key-and-password'
|
|
4695
|
-
- 'presentation-key-and-recovery-key'
|
|
4696
|
-
- 'recovery-key-and-password'
|
|
4697
|
-
|
|
4698
|
-
```ts
|
|
4699
|
-
authenticationMode: "presentation-key-and-password" | "presentation-key-and-recovery-key" | "recovery-key-and-password" = "presentation-key-and-password"
|
|
4700
|
-
```
|
|
4701
|
-
|
|
4702
|
-
###### Method changePassword
|
|
4703
|
-
|
|
4704
|
-
Changes the user's password, re-wrapping the primary and privileged keys with the new password factor.
|
|
4705
|
-
|
|
4706
|
-
```ts
|
|
4707
|
-
async changePassword(newPassword: string): Promise<void>
|
|
4708
|
-
```
|
|
4709
|
-
|
|
4710
|
-
Argument Details
|
|
4711
|
-
|
|
4712
|
-
+ **newPassword**
|
|
4713
|
-
+ The user's new password as a string.
|
|
4714
|
-
|
|
4715
|
-
Throws
|
|
4716
|
-
|
|
4717
|
-
If the user is not authenticated, or if underlying token references are missing.
|
|
4718
|
-
|
|
4719
|
-
###### Method changePresentationKey
|
|
4720
|
-
|
|
4721
|
-
Changes the user's presentation key.
|
|
4722
|
-
|
|
4723
|
-
```ts
|
|
4724
|
-
async changePresentationKey(presentationKey: number[]): Promise<void>
|
|
4725
|
-
```
|
|
4726
|
-
|
|
4727
|
-
Argument Details
|
|
4728
|
-
|
|
4729
|
-
+ **presentationKey**
|
|
4730
|
-
+ The new presentation key (32 bytes).
|
|
4731
|
-
|
|
4732
|
-
Throws
|
|
4733
|
-
|
|
4734
|
-
If the user is not authenticated, or if underlying token references are missing.
|
|
4735
|
-
|
|
4736
|
-
###### Method changeRecoveryKey
|
|
4737
|
-
|
|
4738
|
-
Changes the user's recovery key, prompting the user to save the new key.
|
|
4739
|
-
|
|
4740
|
-
```ts
|
|
4741
|
-
async changeRecoveryKey(): Promise<void>
|
|
4742
|
-
```
|
|
4743
|
-
|
|
4744
|
-
Throws
|
|
4745
|
-
|
|
4746
|
-
If the user is not authenticated, or if underlying token references are missing.
|
|
4747
|
-
|
|
4748
|
-
###### Method destroy
|
|
4749
|
-
|
|
4750
|
-
Destroys the underlying wallet, returning to a default state
|
|
4751
|
-
|
|
4752
|
-
```ts
|
|
4753
|
-
destroy(): void
|
|
4754
|
-
```
|
|
4755
|
-
|
|
4756
|
-
###### Method loadSnapshot
|
|
4757
|
-
|
|
4758
|
-
Loads a previously saved state snapshot (e.g. from `saveSnapshot`).
|
|
4759
|
-
Upon success, the wallet becomes authenticated without needing to re-enter keys.
|
|
4760
|
-
|
|
4761
|
-
```ts
|
|
4762
|
-
async loadSnapshot(snapshot: number[]): Promise<void>
|
|
4763
|
-
```
|
|
4764
|
-
|
|
4765
|
-
Argument Details
|
|
4766
|
-
|
|
4767
|
-
+ **snapshot**
|
|
4768
|
-
+ An array of bytes that was previously produced by `saveSnapshot`.
|
|
4769
|
-
|
|
4770
|
-
Throws
|
|
4771
|
-
|
|
4772
|
-
If the snapshot format is invalid or decryption fails.
|
|
4773
|
-
|
|
4774
|
-
###### Method providePassword
|
|
4775
|
-
|
|
4776
|
-
Provides the password in an authentication mode that requires it.
|
|
4777
|
-
|
|
4778
|
-
- **Existing user**:
|
|
4779
|
-
Decrypts the primary key using the provided password (and either the presentation key or recovery key, depending on the mode).
|
|
4780
|
-
Then builds the underlying wallet, marking the user as authenticated.
|
|
4781
|
-
|
|
4782
|
-
- **New user**:
|
|
4783
|
-
Generates a new UMP token with fresh keys (primary, privileged, recovery). Publishes it on-chain and builds the wallet.
|
|
4784
|
-
|
|
4785
|
-
```ts
|
|
4786
|
-
async providePassword(password: string): Promise<void>
|
|
4787
|
-
```
|
|
4788
|
-
|
|
4789
|
-
Argument Details
|
|
4790
|
-
|
|
4791
|
-
+ **password**
|
|
4792
|
-
+ The user's password as a string.
|
|
4793
|
-
|
|
4794
|
-
Throws
|
|
4795
|
-
|
|
4796
|
-
If the user is already authenticated, if the mode does not use a password, or if required keys are missing.
|
|
4797
|
-
|
|
4798
|
-
###### Method providePresentationKey
|
|
4799
|
-
|
|
4800
|
-
Provides the presentation key in an authentication mode that requires it.
|
|
4801
|
-
If a UMP token is found based on the key's hash, this is an existing-user flow.
|
|
4802
|
-
Otherwise, it is treated as a new-user flow.
|
|
4803
|
-
|
|
4804
|
-
```ts
|
|
4805
|
-
async providePresentationKey(key: number[]): Promise<void>
|
|
4806
|
-
```
|
|
4807
|
-
|
|
4808
|
-
Argument Details
|
|
4809
|
-
|
|
4810
|
-
+ **key**
|
|
4811
|
-
+ The user's presentation key (32 bytes).
|
|
4812
|
-
|
|
4813
|
-
Throws
|
|
4814
|
-
|
|
4815
|
-
if user is already authenticated, or if the current mode does not require a presentation key.
|
|
4816
|
-
|
|
4817
|
-
###### Method provideRecoveryKey
|
|
4818
|
-
|
|
4819
|
-
Provides the recovery key in an authentication flow that requires it.
|
|
4820
|
-
|
|
4821
|
-
```ts
|
|
4822
|
-
async provideRecoveryKey(recoveryKey: number[]): Promise<void>
|
|
4823
|
-
```
|
|
4824
|
-
|
|
4825
|
-
Argument Details
|
|
4826
|
-
|
|
4827
|
-
+ **recoveryKey**
|
|
4828
|
-
+ The user's recovery key (32 bytes).
|
|
4829
|
-
|
|
4830
|
-
Throws
|
|
4831
|
-
|
|
4832
|
-
if user is already authenticated, if the mode does not use a recovery key,
|
|
4833
|
-
or if a required presentation key is missing in "presentation-key-and-recovery-key" mode.
|
|
4834
|
-
|
|
4835
|
-
###### Method saveSnapshot
|
|
4836
|
-
|
|
4837
|
-
Saves the current wallet state (including the current UMP token and primary key)
|
|
4838
|
-
into an encrypted snapshot. This snapshot can be stored locally and later passed
|
|
4839
|
-
to `loadSnapshot` to restore the wallet state without re-authenticating manually.
|
|
4840
|
-
|
|
4841
|
-
```ts
|
|
4842
|
-
saveSnapshot(): number[]
|
|
4843
|
-
```
|
|
4844
|
-
|
|
4845
|
-
Returns
|
|
4846
|
-
|
|
4847
|
-
An array of bytes representing the encrypted snapshot.
|
|
4848
|
-
|
|
4849
|
-
Throws
|
|
4850
|
-
|
|
4851
|
-
if no primary key or token is currently set.
|
|
4852
|
-
|
|
4853
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4854
|
-
|
|
4855
3835
|
---
|
|
4856
3836
|
##### Class: CertOps
|
|
4857
3837
|
|
|
@@ -6025,117 +5005,6 @@ See also: [BlockHeader](./client.md#interface-blockheader)
|
|
|
6025
5005
|
|
|
6026
5006
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6027
5007
|
|
|
6028
|
-
---
|
|
6029
|
-
##### Class: OverlayUMPTokenInteractor
|
|
6030
|
-
|
|
6031
|
-
```ts
|
|
6032
|
-
export class OverlayUMPTokenInteractor implements UMPTokenInteractor {
|
|
6033
|
-
constructor(resolver: LookupResolver = new LookupResolver(), broadcaster: SHIPBroadcaster = new SHIPBroadcaster(["tm_users"]))
|
|
6034
|
-
public async findByPresentationKeyHash(hash: number[]): Promise<UMPToken | undefined>
|
|
6035
|
-
public async findByRecoveryKeyHash(hash: number[]): Promise<UMPToken | undefined>
|
|
6036
|
-
public async buildAndSend(wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken): Promise<OutpointString>
|
|
6037
|
-
}
|
|
6038
|
-
```
|
|
6039
|
-
|
|
6040
|
-
See also: [UMPToken](./client.md#interface-umptoken), [UMPTokenInteractor](./client.md#interface-umptokeninteractor)
|
|
6041
|
-
|
|
6042
|
-
###### Constructor
|
|
6043
|
-
|
|
6044
|
-
Construct a new OverlayUMPTokenInteractor.
|
|
6045
|
-
|
|
6046
|
-
```ts
|
|
6047
|
-
constructor(resolver: LookupResolver = new LookupResolver(), broadcaster: SHIPBroadcaster = new SHIPBroadcaster(["tm_users"]))
|
|
6048
|
-
```
|
|
6049
|
-
|
|
6050
|
-
Argument Details
|
|
6051
|
-
|
|
6052
|
-
+ **resolver**
|
|
6053
|
-
+ A LookupResolver instance for performing overlay queries (ls_users).
|
|
6054
|
-
+ **broadcaster**
|
|
6055
|
-
+ A SHIPBroadcaster instance for sharing new or updated tokens across the `tm_users` overlay.
|
|
6056
|
-
|
|
6057
|
-
###### Method buildAndSend
|
|
6058
|
-
|
|
6059
|
-
Creates or updates (replaces) a UMP token on-chain. If `oldTokenToConsume` is provided,
|
|
6060
|
-
it is spent in the same transaction that creates the new token output. The new token is
|
|
6061
|
-
then broadcast and published under the `tm_users` topic using a SHIP broadcast, ensuring
|
|
6062
|
-
overlay participants see the updated token.
|
|
6063
|
-
|
|
6064
|
-
```ts
|
|
6065
|
-
public async buildAndSend(wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken): Promise<OutpointString>
|
|
6066
|
-
```
|
|
6067
|
-
See also: [UMPToken](./client.md#interface-umptoken)
|
|
6068
|
-
|
|
6069
|
-
Returns
|
|
6070
|
-
|
|
6071
|
-
The outpoint of the newly created UMP token (e.g. "abcd1234...ef.0").
|
|
6072
|
-
|
|
6073
|
-
Argument Details
|
|
6074
|
-
|
|
6075
|
-
+ **wallet**
|
|
6076
|
-
+ The wallet used to build and sign the transaction.
|
|
6077
|
-
+ **adminOriginator**
|
|
6078
|
-
+ The domain/FQDN of the administrative originator (wallet operator).
|
|
6079
|
-
+ **token**
|
|
6080
|
-
+ The new UMPToken to create on-chain.
|
|
6081
|
-
+ **oldTokenToConsume**
|
|
6082
|
-
+ Optionally, an existing token to consume/spend in the same transaction.
|
|
6083
|
-
|
|
6084
|
-
###### Method findByPresentationKeyHash
|
|
6085
|
-
|
|
6086
|
-
Finds a UMP token on-chain by the given presentation key hash, if it exists.
|
|
6087
|
-
Uses the ls_users overlay service to perform the lookup.
|
|
6088
|
-
|
|
6089
|
-
```ts
|
|
6090
|
-
public async findByPresentationKeyHash(hash: number[]): Promise<UMPToken | undefined>
|
|
6091
|
-
```
|
|
6092
|
-
See also: [UMPToken](./client.md#interface-umptoken)
|
|
6093
|
-
|
|
6094
|
-
Returns
|
|
6095
|
-
|
|
6096
|
-
A UMPToken object (including currentOutpoint) if found, otherwise undefined.
|
|
6097
|
-
|
|
6098
|
-
Argument Details
|
|
6099
|
-
|
|
6100
|
-
+ **hash**
|
|
6101
|
-
+ The 32-byte SHA-256 hash of the presentation key.
|
|
6102
|
-
|
|
6103
|
-
###### Method findByRecoveryKeyHash
|
|
6104
|
-
|
|
6105
|
-
Finds a UMP token on-chain by the given recovery key hash, if it exists.
|
|
6106
|
-
Uses the ls_users overlay service to perform the lookup.
|
|
6107
|
-
|
|
6108
|
-
```ts
|
|
6109
|
-
public async findByRecoveryKeyHash(hash: number[]): Promise<UMPToken | undefined>
|
|
6110
|
-
```
|
|
6111
|
-
See also: [UMPToken](./client.md#interface-umptoken)
|
|
6112
|
-
|
|
6113
|
-
Returns
|
|
6114
|
-
|
|
6115
|
-
A UMPToken object (including currentOutpoint) if found, otherwise undefined.
|
|
6116
|
-
|
|
6117
|
-
Argument Details
|
|
6118
|
-
|
|
6119
|
-
+ **hash**
|
|
6120
|
-
+ The 32-byte SHA-256 hash of the recovery key.
|
|
6121
|
-
|
|
6122
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6123
|
-
|
|
6124
|
-
---
|
|
6125
|
-
##### Class: PersonaIDInteractor
|
|
6126
|
-
|
|
6127
|
-
```ts
|
|
6128
|
-
export class PersonaIDInteractor extends AuthMethodInteractor {
|
|
6129
|
-
public methodType = "PersonaID";
|
|
6130
|
-
public async startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>
|
|
6131
|
-
public async completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>
|
|
6132
|
-
}
|
|
6133
|
-
```
|
|
6134
|
-
|
|
6135
|
-
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor), [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse), [StartAuthResponse](./client.md#interface-startauthresponse)
|
|
6136
|
-
|
|
6137
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6138
|
-
|
|
6139
5008
|
---
|
|
6140
5009
|
##### Class: PrivilegedKeyManager
|
|
6141
5010
|
|
|
@@ -6331,228 +5200,6 @@ See also: [ARC](./services.md#class-arc), [BlockHeader](./client.md#interface-bl
|
|
|
6331
5200
|
|
|
6332
5201
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6333
5202
|
|
|
6334
|
-
---
|
|
6335
|
-
##### Class: SimpleWalletManager
|
|
6336
|
-
|
|
6337
|
-
SimpleWalletManager is a slimmed-down wallet manager that only requires two things to authenticate:
|
|
6338
|
-
1. A primary key (32 bytes), which represents the core secret for the wallet.
|
|
6339
|
-
2. A privileged key manager (an instance of `PrivilegedKeyManager`), responsible for
|
|
6340
|
-
more sensitive operations.
|
|
6341
|
-
|
|
6342
|
-
Once both pieces are provided (or if a snapshot containing the primary key is loaded,
|
|
6343
|
-
and the privileged key manager is provided separately), the wallet becomes authenticated.
|
|
6344
|
-
|
|
6345
|
-
After authentication, calls to the standard wallet methods (`createAction`, `signAction`, etc.)
|
|
6346
|
-
are proxied to an underlying `WalletInterface` instance returned by a user-supplied `walletBuilder`.
|
|
6347
|
-
|
|
6348
|
-
**Important**: This manager does not handle user password flows, recovery, or on-chain
|
|
6349
|
-
token management. It is a straightforward wrapper that ensures the user has provided
|
|
6350
|
-
both their main secret (primary key) and a privileged key manager before allowing usage.
|
|
6351
|
-
|
|
6352
|
-
It also prevents calls from the special "admin originator" from being used externally.
|
|
6353
|
-
(Any call that tries to use the admin originator as its originator, other than the manager itself,
|
|
6354
|
-
will result in an error, ensuring that only internal operations can use that originator.)
|
|
6355
|
-
|
|
6356
|
-
The manager can also save and load snapshots of its state. In this simplified version,
|
|
6357
|
-
the snapshot only contains the primary key. If you load a snapshot, you still need to
|
|
6358
|
-
re-provide the privileged key manager to complete authentication.
|
|
6359
|
-
|
|
6360
|
-
```ts
|
|
6361
|
-
export class SimpleWalletManager implements WalletInterface {
|
|
6362
|
-
authenticated: boolean;
|
|
6363
|
-
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
|
|
6364
|
-
async providePrimaryKey(key: number[]): Promise<void>
|
|
6365
|
-
async providePrivilegedKeyManager(manager: PrivilegedKeyManager): Promise<void>
|
|
6366
|
-
destroy(): void
|
|
6367
|
-
saveSnapshot(): number[]
|
|
6368
|
-
async loadSnapshot(snapshot: number[]): Promise<void>
|
|
6369
|
-
async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
|
|
6370
|
-
async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
|
|
6371
|
-
async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
|
|
6372
|
-
async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
|
|
6373
|
-
async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
|
|
6374
|
-
async encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
|
|
6375
|
-
async decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
|
|
6376
|
-
async createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
|
|
6377
|
-
async verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
|
|
6378
|
-
async createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
|
|
6379
|
-
async verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
|
|
6380
|
-
async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
|
|
6381
|
-
async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
|
|
6382
|
-
async abortAction(args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AbortActionResult>
|
|
6383
|
-
async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
|
|
6384
|
-
async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<InternalizeActionResult>
|
|
6385
|
-
async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
6386
|
-
async relinquishOutput(args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishOutputResult>
|
|
6387
|
-
async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
|
|
6388
|
-
async listCertificates(args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
|
|
6389
|
-
async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
|
|
6390
|
-
async relinquishCertificate(args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishCertificateResult>
|
|
6391
|
-
async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
6392
|
-
async discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
6393
|
-
async getHeight(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeightResult>
|
|
6394
|
-
async getHeaderForHeight(args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeaderResult>
|
|
6395
|
-
async getNetwork(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetNetworkResult>
|
|
6396
|
-
async getVersion(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetVersionResult>
|
|
6397
|
-
}
|
|
6398
|
-
```
|
|
6399
|
-
|
|
6400
|
-
See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
|
|
6401
|
-
|
|
6402
|
-
###### Constructor
|
|
6403
|
-
|
|
6404
|
-
Constructs a new `SimpleWalletManager`.
|
|
6405
|
-
|
|
6406
|
-
```ts
|
|
6407
|
-
constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
|
|
6408
|
-
```
|
|
6409
|
-
See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager)
|
|
6410
|
-
|
|
6411
|
-
Argument Details
|
|
6412
|
-
|
|
6413
|
-
+ **adminOriginator**
|
|
6414
|
-
+ The domain name of the administrative originator.
|
|
6415
|
-
+ **walletBuilder**
|
|
6416
|
-
+ A function that, given a primary key and privileged key manager,
|
|
6417
|
-
returns a fully functional `WalletInterface`.
|
|
6418
|
-
+ **stateSnapshot**
|
|
6419
|
-
+ If provided, a previously saved snapshot of the wallet's state.
|
|
6420
|
-
If the snapshot contains a primary key, it will be loaded immediately
|
|
6421
|
-
(though you will still need to provide a privileged key manager to authenticate).
|
|
6422
|
-
|
|
6423
|
-
###### Property authenticated
|
|
6424
|
-
|
|
6425
|
-
Whether the user is currently authenticated (meaning both the primary key
|
|
6426
|
-
and privileged key manager have been provided).
|
|
6427
|
-
|
|
6428
|
-
```ts
|
|
6429
|
-
authenticated: boolean
|
|
6430
|
-
```
|
|
6431
|
-
|
|
6432
|
-
###### Method destroy
|
|
6433
|
-
|
|
6434
|
-
Destroys the underlying wallet, returning to a default (unauthenticated) state.
|
|
6435
|
-
|
|
6436
|
-
This clears the primary key, the privileged key manager, and the `authenticated` flag.
|
|
6437
|
-
|
|
6438
|
-
```ts
|
|
6439
|
-
destroy(): void
|
|
6440
|
-
```
|
|
6441
|
-
|
|
6442
|
-
###### Method isAuthenticated
|
|
6443
|
-
|
|
6444
|
-
Returns whether the user is currently authenticated (the wallet has a primary key
|
|
6445
|
-
and a privileged key manager). If not authenticated, an error is thrown.
|
|
6446
|
-
|
|
6447
|
-
```ts
|
|
6448
|
-
async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
|
|
6449
|
-
```
|
|
6450
|
-
|
|
6451
|
-
Argument Details
|
|
6452
|
-
|
|
6453
|
-
+ **_**
|
|
6454
|
-
+ Not used in this manager.
|
|
6455
|
-
+ **originator**
|
|
6456
|
-
+ The originator domain, which must not be the admin originator.
|
|
6457
|
-
|
|
6458
|
-
Throws
|
|
6459
|
-
|
|
6460
|
-
If not authenticated, or if the originator is the admin.
|
|
6461
|
-
|
|
6462
|
-
###### Method loadSnapshot
|
|
6463
|
-
|
|
6464
|
-
Loads a previously saved state snapshot (produced by `saveSnapshot`).
|
|
6465
|
-
This will restore the primary key but will **not** restore the privileged key manager
|
|
6466
|
-
(that must be provided separately to complete authentication).
|
|
6467
|
-
|
|
6468
|
-
```ts
|
|
6469
|
-
async loadSnapshot(snapshot: number[]): Promise<void>
|
|
6470
|
-
```
|
|
6471
|
-
|
|
6472
|
-
Argument Details
|
|
6473
|
-
|
|
6474
|
-
+ **snapshot**
|
|
6475
|
-
+ A byte array that was previously returned by `saveSnapshot`.
|
|
6476
|
-
|
|
6477
|
-
Throws
|
|
6478
|
-
|
|
6479
|
-
If the snapshot format is invalid or decryption fails.
|
|
6480
|
-
|
|
6481
|
-
###### Method providePrimaryKey
|
|
6482
|
-
|
|
6483
|
-
Provides the primary key (32 bytes) needed for authentication.
|
|
6484
|
-
If a privileged key manager has already been provided, we attempt to build
|
|
6485
|
-
the underlying wallet. Otherwise, we wait until the manager is also provided.
|
|
6486
|
-
|
|
6487
|
-
```ts
|
|
6488
|
-
async providePrimaryKey(key: number[]): Promise<void>
|
|
6489
|
-
```
|
|
6490
|
-
|
|
6491
|
-
Argument Details
|
|
6492
|
-
|
|
6493
|
-
+ **key**
|
|
6494
|
-
+ A 32-byte primary key.
|
|
6495
|
-
|
|
6496
|
-
###### Method providePrivilegedKeyManager
|
|
6497
|
-
|
|
6498
|
-
Provides the privileged key manager needed for sensitive tasks.
|
|
6499
|
-
If a primary key has already been provided (or loaded from a snapshot),
|
|
6500
|
-
we attempt to build the underlying wallet. Otherwise, we wait until the key is provided.
|
|
6501
|
-
|
|
6502
|
-
```ts
|
|
6503
|
-
async providePrivilegedKeyManager(manager: PrivilegedKeyManager): Promise<void>
|
|
6504
|
-
```
|
|
6505
|
-
See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager)
|
|
6506
|
-
|
|
6507
|
-
Argument Details
|
|
6508
|
-
|
|
6509
|
-
+ **manager**
|
|
6510
|
-
+ An instance of `PrivilegedKeyManager`.
|
|
6511
|
-
|
|
6512
|
-
###### Method saveSnapshot
|
|
6513
|
-
|
|
6514
|
-
Saves the current wallet state (including just the primary key)
|
|
6515
|
-
into an encrypted snapshot. This snapshot can be stored and later
|
|
6516
|
-
passed to `loadSnapshot` to restore the primary key (and partially authenticate).
|
|
6517
|
-
|
|
6518
|
-
**Note**: The snapshot does NOT include the privileged key manager.
|
|
6519
|
-
You must still provide that separately after loading the snapshot
|
|
6520
|
-
in order to complete authentication.
|
|
6521
|
-
|
|
6522
|
-
```ts
|
|
6523
|
-
saveSnapshot(): number[]
|
|
6524
|
-
```
|
|
6525
|
-
|
|
6526
|
-
Returns
|
|
6527
|
-
|
|
6528
|
-
A byte array representing the encrypted snapshot.
|
|
6529
|
-
|
|
6530
|
-
Throws
|
|
6531
|
-
|
|
6532
|
-
if no primary key is currently set.
|
|
6533
|
-
|
|
6534
|
-
###### Method waitForAuthentication
|
|
6535
|
-
|
|
6536
|
-
Blocks until the user is authenticated (by providing primaryKey and privileged manager).
|
|
6537
|
-
If not authenticated yet, it waits until that occurs.
|
|
6538
|
-
|
|
6539
|
-
```ts
|
|
6540
|
-
async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
|
|
6541
|
-
```
|
|
6542
|
-
|
|
6543
|
-
Argument Details
|
|
6544
|
-
|
|
6545
|
-
+ **_**
|
|
6546
|
-
+ Not used in this manager.
|
|
6547
|
-
+ **originator**
|
|
6548
|
-
+ The originator domain, which must not be the admin originator.
|
|
6549
|
-
|
|
6550
|
-
Throws
|
|
6551
|
-
|
|
6552
|
-
If the originator is the admin.
|
|
6553
|
-
|
|
6554
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6555
|
-
|
|
6556
5203
|
---
|
|
6557
5204
|
##### Class: StorageClient
|
|
6558
5205
|
|
|
@@ -7773,158 +6420,6 @@ See also: [Monitor](./monitor.md#class-monitor), [WalletMonitorTask](./monitor.m
|
|
|
7773
6420
|
|
|
7774
6421
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7775
6422
|
|
|
7776
|
-
---
|
|
7777
|
-
##### Class: TwilioPhoneInteractor
|
|
7778
|
-
|
|
7779
|
-
TwilioPhoneInteractor
|
|
7780
|
-
|
|
7781
|
-
A client-side class that knows how to call the WAB server for Twilio-based phone verification.
|
|
7782
|
-
|
|
7783
|
-
```ts
|
|
7784
|
-
export class TwilioPhoneInteractor extends AuthMethodInteractor {
|
|
7785
|
-
public methodType = "TwilioPhone";
|
|
7786
|
-
public async startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>
|
|
7787
|
-
public async completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>
|
|
7788
|
-
}
|
|
7789
|
-
```
|
|
7790
|
-
|
|
7791
|
-
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor), [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse), [StartAuthResponse](./client.md#interface-startauthresponse)
|
|
7792
|
-
|
|
7793
|
-
###### Method completeAuth
|
|
7794
|
-
|
|
7795
|
-
Complete the Twilio phone verification on the server.
|
|
7796
|
-
- The server will verify the code with Twilio Verify’s verificationChecks endpoint.
|
|
7797
|
-
|
|
7798
|
-
```ts
|
|
7799
|
-
public async completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>
|
|
7800
|
-
```
|
|
7801
|
-
See also: [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse)
|
|
7802
|
-
|
|
7803
|
-
Returns
|
|
7804
|
-
|
|
7805
|
-
- { success, message, presentationKey }
|
|
7806
|
-
|
|
7807
|
-
Argument Details
|
|
7808
|
-
|
|
7809
|
-
+ **serverUrl**
|
|
7810
|
-
+ The base URL of the WAB server
|
|
7811
|
-
+ **presentationKey**
|
|
7812
|
-
+ The 256-bit key
|
|
7813
|
-
+ **payload**
|
|
7814
|
-
+ { phoneNumber: string, otp: string } (the code that was received via SMS)
|
|
7815
|
-
|
|
7816
|
-
###### Method startAuth
|
|
7817
|
-
|
|
7818
|
-
Start the Twilio phone verification on the server.
|
|
7819
|
-
- The server will send an SMS code to the user’s phone, using Twilio Verify.
|
|
7820
|
-
|
|
7821
|
-
```ts
|
|
7822
|
-
public async startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>
|
|
7823
|
-
```
|
|
7824
|
-
See also: [AuthPayload](./client.md#interface-authpayload), [StartAuthResponse](./client.md#interface-startauthresponse)
|
|
7825
|
-
|
|
7826
|
-
Returns
|
|
7827
|
-
|
|
7828
|
-
- { success, message, data }
|
|
7829
|
-
|
|
7830
|
-
Argument Details
|
|
7831
|
-
|
|
7832
|
-
+ **serverUrl**
|
|
7833
|
-
+ The base URL of the WAB server (e.g. http://localhost:3000)
|
|
7834
|
-
+ **presentationKey**
|
|
7835
|
-
+ The 256-bit key the client is attempting to authenticate with
|
|
7836
|
-
+ **payload**
|
|
7837
|
-
+ { phoneNumber: string } (the phone number to verify)
|
|
7838
|
-
|
|
7839
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7840
|
-
|
|
7841
|
-
---
|
|
7842
|
-
##### Class: WABClient
|
|
7843
|
-
|
|
7844
|
-
```ts
|
|
7845
|
-
export class WABClient {
|
|
7846
|
-
constructor(private serverUrl: string)
|
|
7847
|
-
public async getInfo()
|
|
7848
|
-
public generateRandomPresentationKey(): string
|
|
7849
|
-
public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
7850
|
-
public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
7851
|
-
public async listLinkedMethods(presentationKey: string)
|
|
7852
|
-
public async unlinkMethod(presentationKey: string, authMethodId: number)
|
|
7853
|
-
public async requestFaucet(presentationKey: string)
|
|
7854
|
-
public async deleteUser(presentationKey: string)
|
|
7855
|
-
}
|
|
7856
|
-
```
|
|
7857
|
-
|
|
7858
|
-
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
|
|
7859
|
-
|
|
7860
|
-
###### Method completeAuthMethod
|
|
7861
|
-
|
|
7862
|
-
Complete an Auth Method flow
|
|
7863
|
-
|
|
7864
|
-
```ts
|
|
7865
|
-
public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
7866
|
-
```
|
|
7867
|
-
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
|
|
7868
|
-
|
|
7869
|
-
###### Method deleteUser
|
|
7870
|
-
|
|
7871
|
-
Delete user
|
|
7872
|
-
|
|
7873
|
-
```ts
|
|
7874
|
-
public async deleteUser(presentationKey: string)
|
|
7875
|
-
```
|
|
7876
|
-
|
|
7877
|
-
###### Method generateRandomPresentationKey
|
|
7878
|
-
|
|
7879
|
-
Generate a random 256-bit presentation key as a hex string (client side).
|
|
7880
|
-
|
|
7881
|
-
```ts
|
|
7882
|
-
public generateRandomPresentationKey(): string
|
|
7883
|
-
```
|
|
7884
|
-
|
|
7885
|
-
###### Method getInfo
|
|
7886
|
-
|
|
7887
|
-
Return the WAB server info
|
|
7888
|
-
|
|
7889
|
-
```ts
|
|
7890
|
-
public async getInfo()
|
|
7891
|
-
```
|
|
7892
|
-
|
|
7893
|
-
###### Method listLinkedMethods
|
|
7894
|
-
|
|
7895
|
-
List user-linked methods
|
|
7896
|
-
|
|
7897
|
-
```ts
|
|
7898
|
-
public async listLinkedMethods(presentationKey: string)
|
|
7899
|
-
```
|
|
7900
|
-
|
|
7901
|
-
###### Method requestFaucet
|
|
7902
|
-
|
|
7903
|
-
Request faucet
|
|
7904
|
-
|
|
7905
|
-
```ts
|
|
7906
|
-
public async requestFaucet(presentationKey: string)
|
|
7907
|
-
```
|
|
7908
|
-
|
|
7909
|
-
###### Method startAuthMethod
|
|
7910
|
-
|
|
7911
|
-
Start an Auth Method flow
|
|
7912
|
-
|
|
7913
|
-
```ts
|
|
7914
|
-
public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
|
|
7915
|
-
```
|
|
7916
|
-
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
|
|
7917
|
-
|
|
7918
|
-
###### Method unlinkMethod
|
|
7919
|
-
|
|
7920
|
-
Unlink a given Auth Method by ID
|
|
7921
|
-
|
|
7922
|
-
```ts
|
|
7923
|
-
public async unlinkMethod(presentationKey: string, authMethodId: number)
|
|
7924
|
-
```
|
|
7925
|
-
|
|
7926
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7927
|
-
|
|
7928
6423
|
---
|
|
7929
6424
|
##### Class: WERR_BAD_REQUEST
|
|
7930
6425
|
|
|
@@ -8148,8 +6643,6 @@ export class Wallet implements WalletInterface, ProtoWallet {
|
|
|
8148
6643
|
chain: sdk.Chain;
|
|
8149
6644
|
keyDeriver: KeyDeriver;
|
|
8150
6645
|
storage: WalletStorageManager;
|
|
8151
|
-
settingsManager: WalletSettingsManager;
|
|
8152
|
-
lookupResolver: LookupResolver;
|
|
8153
6646
|
services?: sdk.WalletServices;
|
|
8154
6647
|
monitor?: Monitor;
|
|
8155
6648
|
identityKey: string;
|
|
@@ -8200,7 +6693,7 @@ export class Wallet implements WalletInterface, ProtoWallet {
|
|
|
8200
6693
|
}
|
|
8201
6694
|
```
|
|
8202
6695
|
|
|
8203
|
-
See also: [Chain](./client.md#type-chain), [KeyPair](./client.md#interface-keypair), [Monitor](./monitor.md#class-monitor), [PendingSignAction](./client.md#interface-pendingsignaction), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [StorageIdentity](./client.md#interface-storageidentity), [WalletArgs](./client.md#interface-walletargs), [WalletServices](./client.md#interface-walletservices), [
|
|
6696
|
+
See also: [Chain](./client.md#type-chain), [KeyPair](./client.md#interface-keypair), [Monitor](./monitor.md#class-monitor), [PendingSignAction](./client.md#interface-pendingsignaction), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [StorageIdentity](./client.md#interface-storageidentity), [WalletArgs](./client.md#interface-walletargs), [WalletServices](./client.md#interface-walletservices), [WalletSigner](./client.md#class-walletsigner), [WalletStorageManager](./storage.md#class-walletstoragemanager), [createAction](./storage.md#function-createaction), [getIdentityKey](./client.md#function-getidentitykey), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
|
|
8204
6697
|
|
|
8205
6698
|
###### Property beef
|
|
8206
6699
|
|
|
@@ -8256,54 +6749,6 @@ Argument Details
|
|
|
8256
6749
|
|
|
8257
6750
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8258
6751
|
|
|
8259
|
-
---
|
|
8260
|
-
##### Class: WalletAuthenticationManager
|
|
8261
|
-
|
|
8262
|
-
WalletAuthenticationManager
|
|
8263
|
-
|
|
8264
|
-
A wallet manager that integrates
|
|
8265
|
-
with a WABClient for user authentication flows (e.g. Twilio phone).
|
|
8266
|
-
|
|
8267
|
-
```ts
|
|
8268
|
-
export class WalletAuthenticationManager extends CWIStyleWalletManager {
|
|
8269
|
-
constructor(adminOriginator: string, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, interactor: UMPTokenInteractor = new OverlayUMPTokenInteractor(), recoveryKeySaver: (key: number[]) => Promise<true>, passwordRetriever: (reason: string, test: (passwordCandidate: string) => boolean) => Promise<string>, wabClient: WABClient, authMethod?: AuthMethodInteractor, stateSnapshot?: number[])
|
|
8270
|
-
public setAuthMethod(method: AuthMethodInteractor)
|
|
8271
|
-
public async startAuth(payload: any): Promise<void>
|
|
8272
|
-
public async completeAuth(payload: any): Promise<void>
|
|
8273
|
-
}
|
|
8274
|
-
```
|
|
8275
|
-
|
|
8276
|
-
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor), [CWIStyleWalletManager](./client.md#class-cwistylewalletmanager), [OverlayUMPTokenInteractor](./client.md#class-overlayumptokeninteractor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [UMPTokenInteractor](./client.md#interface-umptokeninteractor), [WABClient](./client.md#class-wabclient)
|
|
8277
|
-
|
|
8278
|
-
###### Method completeAuth
|
|
8279
|
-
|
|
8280
|
-
Completes the WAB-based flow, retrieving the final presentationKey from WAB if successful.
|
|
8281
|
-
|
|
8282
|
-
```ts
|
|
8283
|
-
public async completeAuth(payload: any): Promise<void>
|
|
8284
|
-
```
|
|
8285
|
-
|
|
8286
|
-
###### Method setAuthMethod
|
|
8287
|
-
|
|
8288
|
-
Sets (or switches) the chosen AuthMethodInteractor at runtime,
|
|
8289
|
-
in case the user changes their mind or picks a new method in the UI.
|
|
8290
|
-
|
|
8291
|
-
```ts
|
|
8292
|
-
public setAuthMethod(method: AuthMethodInteractor)
|
|
8293
|
-
```
|
|
8294
|
-
See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
|
|
8295
|
-
|
|
8296
|
-
###### Method startAuth
|
|
8297
|
-
|
|
8298
|
-
Initiate the WAB-based flow, e.g. sending an SMS code or starting an ID check,
|
|
8299
|
-
using the chosen AuthMethodInteractor.
|
|
8300
|
-
|
|
8301
|
-
```ts
|
|
8302
|
-
public async startAuth(payload: any): Promise<void>
|
|
8303
|
-
```
|
|
8304
|
-
|
|
8305
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8306
|
-
|
|
8307
6752
|
---
|
|
8308
6753
|
##### Class: WalletError
|
|
8309
6754
|
|
|
@@ -8424,497 +6869,6 @@ abstract trigger(nowMsecsSinceEpoch: number): {
|
|
|
8424
6869
|
|
|
8425
6870
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8426
6871
|
|
|
8427
|
-
---
|
|
8428
|
-
##### Class: WalletPermissionsManager
|
|
8429
|
-
|
|
8430
|
-
```ts
|
|
8431
|
-
export class WalletPermissionsManager implements WalletInterface {
|
|
8432
|
-
constructor(underlyingWallet: WalletInterface, adminOriginator: string, config: PermissionsManagerConfig = {})
|
|
8433
|
-
public bindCallback(eventName: keyof WalletPermissionsManagerCallbacks, handler: PermissionEventHandler): number
|
|
8434
|
-
public unbindCallback(eventName: keyof WalletPermissionsManagerCallbacks, reference: number | Function): boolean
|
|
8435
|
-
public async grantPermission(params: {
|
|
8436
|
-
requestID: string;
|
|
8437
|
-
expiry?: number;
|
|
8438
|
-
ephemeral?: boolean;
|
|
8439
|
-
amount?: number;
|
|
8440
|
-
}): Promise<void>
|
|
8441
|
-
public async denyPermission(requestID: string): Promise<void>
|
|
8442
|
-
public async ensureProtocolPermission({ originator, privileged, protocolID, counterparty, reason, seekPermission = true, usageType }: {
|
|
8443
|
-
originator: string;
|
|
8444
|
-
privileged: boolean;
|
|
8445
|
-
protocolID: [
|
|
8446
|
-
0 | 1 | 2,
|
|
8447
|
-
string
|
|
8448
|
-
];
|
|
8449
|
-
counterparty: string;
|
|
8450
|
-
reason?: string;
|
|
8451
|
-
seekPermission?: boolean;
|
|
8452
|
-
usageType: "signing" | "encrypting" | "hmac" | "publicKey" | "identityKey" | "linkageRevelation" | "generic";
|
|
8453
|
-
}): Promise<boolean>
|
|
8454
|
-
public async ensureBasketAccess({ originator, basket, reason, seekPermission = true, usageType }: {
|
|
8455
|
-
originator: string;
|
|
8456
|
-
basket: string;
|
|
8457
|
-
reason?: string;
|
|
8458
|
-
seekPermission?: boolean;
|
|
8459
|
-
usageType: "insertion" | "removal" | "listing";
|
|
8460
|
-
}): Promise<boolean>
|
|
8461
|
-
public async ensureCertificateAccess({ originator, privileged, verifier, certType, fields, reason, seekPermission = true, usageType }: {
|
|
8462
|
-
originator: string;
|
|
8463
|
-
privileged: boolean;
|
|
8464
|
-
verifier: string;
|
|
8465
|
-
certType: string;
|
|
8466
|
-
fields: string[];
|
|
8467
|
-
reason?: string;
|
|
8468
|
-
seekPermission?: boolean;
|
|
8469
|
-
usageType: "disclosure";
|
|
8470
|
-
}): Promise<boolean>
|
|
8471
|
-
public async ensureSpendingAuthorization({ originator, satoshis, lineItems, reason, seekPermission = true }: {
|
|
8472
|
-
originator: string;
|
|
8473
|
-
satoshis: number;
|
|
8474
|
-
lineItems?: Array<{
|
|
8475
|
-
type: "input" | "output" | "fee";
|
|
8476
|
-
description: string;
|
|
8477
|
-
satoshis: number;
|
|
8478
|
-
}>;
|
|
8479
|
-
reason?: string;
|
|
8480
|
-
seekPermission?: boolean;
|
|
8481
|
-
}): Promise<boolean>
|
|
8482
|
-
public async ensureLabelAccess({ originator, label, reason, seekPermission = true, usageType }: {
|
|
8483
|
-
originator: string;
|
|
8484
|
-
label: string;
|
|
8485
|
-
reason?: string;
|
|
8486
|
-
seekPermission?: boolean;
|
|
8487
|
-
usageType: "apply" | "list";
|
|
8488
|
-
}): Promise<boolean>
|
|
8489
|
-
public async querySpentSince(token: PermissionToken): Promise<number>
|
|
8490
|
-
public async listProtocolPermissions({ originator }: {
|
|
8491
|
-
originator?: string;
|
|
8492
|
-
}): Promise<PermissionToken[]>
|
|
8493
|
-
public async hasProtocolPermission(params: {
|
|
8494
|
-
originator: string;
|
|
8495
|
-
privileged: boolean;
|
|
8496
|
-
protocolID: [
|
|
8497
|
-
0 | 1 | 2,
|
|
8498
|
-
string
|
|
8499
|
-
];
|
|
8500
|
-
counterparty: string;
|
|
8501
|
-
}): Promise<boolean>
|
|
8502
|
-
public async listBasketAccess(params: {
|
|
8503
|
-
originator?: string;
|
|
8504
|
-
}): Promise<PermissionToken[]>
|
|
8505
|
-
public async hasBasketAccess(params: {
|
|
8506
|
-
originator: string;
|
|
8507
|
-
basket: string;
|
|
8508
|
-
}): Promise<boolean>
|
|
8509
|
-
public async listSpendingAuthorizations(params: {
|
|
8510
|
-
originator?: string;
|
|
8511
|
-
}): Promise<PermissionToken[]>
|
|
8512
|
-
public async hasSpendingAuthorization(params: {
|
|
8513
|
-
originator: string;
|
|
8514
|
-
satoshis: number;
|
|
8515
|
-
}): Promise<boolean>
|
|
8516
|
-
public async listCertificateAccess(params: {
|
|
8517
|
-
originator?: string;
|
|
8518
|
-
}): Promise<PermissionToken[]>
|
|
8519
|
-
public async hasCertificateAccess(params: {
|
|
8520
|
-
originator: string;
|
|
8521
|
-
privileged: boolean;
|
|
8522
|
-
verifier: string;
|
|
8523
|
-
certType: string;
|
|
8524
|
-
fields: string[];
|
|
8525
|
-
}): Promise<boolean>
|
|
8526
|
-
public async revokePermission(oldToken: PermissionToken): Promise<void>
|
|
8527
|
-
public async createAction(args: Parameters<WalletInterface["createAction"]>[0], originator?: string): ReturnType<WalletInterface["createAction"]>
|
|
8528
|
-
public async signAction(...args: Parameters<WalletInterface["signAction"]>): ReturnType<WalletInterface["signAction"]>
|
|
8529
|
-
public async abortAction(...args: Parameters<WalletInterface["abortAction"]>): ReturnType<WalletInterface["abortAction"]>
|
|
8530
|
-
public async listActions(...args: Parameters<WalletInterface["listActions"]>): ReturnType<WalletInterface["listActions"]>
|
|
8531
|
-
public async internalizeAction(...args: Parameters<WalletInterface["internalizeAction"]>): ReturnType<WalletInterface["internalizeAction"]>
|
|
8532
|
-
public async listOutputs(...args: Parameters<WalletInterface["listOutputs"]>): ReturnType<WalletInterface["listOutputs"]>
|
|
8533
|
-
public async relinquishOutput(...args: Parameters<WalletInterface["relinquishOutput"]>): ReturnType<WalletInterface["relinquishOutput"]>
|
|
8534
|
-
public async getPublicKey(...args: Parameters<WalletInterface["getPublicKey"]>): ReturnType<WalletInterface["getPublicKey"]>
|
|
8535
|
-
public async revealCounterpartyKeyLinkage(...args: Parameters<WalletInterface["revealCounterpartyKeyLinkage"]>): ReturnType<WalletInterface["revealCounterpartyKeyLinkage"]>
|
|
8536
|
-
public async revealSpecificKeyLinkage(...args: Parameters<WalletInterface["revealSpecificKeyLinkage"]>): ReturnType<WalletInterface["revealSpecificKeyLinkage"]>
|
|
8537
|
-
public async encrypt(...args: Parameters<WalletInterface["encrypt"]>): ReturnType<WalletInterface["encrypt"]>
|
|
8538
|
-
public async decrypt(...args: Parameters<WalletInterface["decrypt"]>): ReturnType<WalletInterface["decrypt"]>
|
|
8539
|
-
public async createHmac(...args: Parameters<WalletInterface["createHmac"]>): ReturnType<WalletInterface["createHmac"]>
|
|
8540
|
-
public async verifyHmac(...args: Parameters<WalletInterface["verifyHmac"]>): ReturnType<WalletInterface["verifyHmac"]>
|
|
8541
|
-
public async createSignature(...args: Parameters<WalletInterface["createSignature"]>): ReturnType<WalletInterface["createSignature"]>
|
|
8542
|
-
public async verifySignature(...args: Parameters<WalletInterface["verifySignature"]>): ReturnType<WalletInterface["verifySignature"]>
|
|
8543
|
-
public async acquireCertificate(...args: Parameters<WalletInterface["acquireCertificate"]>): ReturnType<WalletInterface["acquireCertificate"]>
|
|
8544
|
-
public async listCertificates(...args: Parameters<WalletInterface["listCertificates"]>): ReturnType<WalletInterface["listCertificates"]>
|
|
8545
|
-
public async proveCertificate(...args: Parameters<WalletInterface["proveCertificate"]>): ReturnType<WalletInterface["proveCertificate"]>
|
|
8546
|
-
public async relinquishCertificate(...args: Parameters<WalletInterface["relinquishCertificate"]>): ReturnType<WalletInterface["relinquishCertificate"]>
|
|
8547
|
-
public async discoverByIdentityKey(...args: Parameters<WalletInterface["discoverByIdentityKey"]>): ReturnType<WalletInterface["discoverByIdentityKey"]>
|
|
8548
|
-
public async discoverByAttributes(...args: Parameters<WalletInterface["discoverByAttributes"]>): ReturnType<WalletInterface["discoverByAttributes"]>
|
|
8549
|
-
public async isAuthenticated(...args: Parameters<WalletInterface["isAuthenticated"]>): ReturnType<WalletInterface["isAuthenticated"]>
|
|
8550
|
-
public async waitForAuthentication(...args: Parameters<WalletInterface["waitForAuthentication"]>): ReturnType<WalletInterface["waitForAuthentication"]>
|
|
8551
|
-
public async getHeight(...args: Parameters<WalletInterface["getHeight"]>): ReturnType<WalletInterface["getHeight"]>
|
|
8552
|
-
public async getHeaderForHeight(...args: Parameters<WalletInterface["getHeaderForHeight"]>): ReturnType<WalletInterface["getHeaderForHeight"]>
|
|
8553
|
-
public async getNetwork(...args: Parameters<WalletInterface["getNetwork"]>): ReturnType<WalletInterface["getNetwork"]>
|
|
8554
|
-
public async getVersion(...args: Parameters<WalletInterface["getVersion"]>): ReturnType<WalletInterface["getVersion"]>
|
|
8555
|
-
}
|
|
8556
|
-
```
|
|
8557
|
-
|
|
8558
|
-
See also: [PermissionEventHandler](./client.md#type-permissioneventhandler), [PermissionToken](./client.md#interface-permissiontoken), [PermissionsManagerConfig](./client.md#interface-permissionsmanagerconfig), [WalletPermissionsManagerCallbacks](./client.md#interface-walletpermissionsmanagercallbacks), [createAction](./storage.md#function-createaction), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [proveCertificate](./client.md#function-provecertificate), [signAction](./client.md#function-signaction)
|
|
8559
|
-
|
|
8560
|
-
###### Constructor
|
|
8561
|
-
|
|
8562
|
-
Constructs a new Permissions Manager instance.
|
|
8563
|
-
|
|
8564
|
-
```ts
|
|
8565
|
-
constructor(underlyingWallet: WalletInterface, adminOriginator: string, config: PermissionsManagerConfig = {})
|
|
8566
|
-
```
|
|
8567
|
-
See also: [PermissionsManagerConfig](./client.md#interface-permissionsmanagerconfig)
|
|
8568
|
-
|
|
8569
|
-
Argument Details
|
|
8570
|
-
|
|
8571
|
-
+ **underlyingWallet**
|
|
8572
|
-
+ The underlying BRC-100 wallet, where requests are forwarded after permission is granted
|
|
8573
|
-
+ **adminOriginator**
|
|
8574
|
-
+ The domain or FQDN that is automatically allowed everything
|
|
8575
|
-
+ **config**
|
|
8576
|
-
+ A set of boolean flags controlling how strictly permissions are enforced
|
|
8577
|
-
|
|
8578
|
-
###### Method bindCallback
|
|
8579
|
-
|
|
8580
|
-
Binds a callback function to a named event, such as `onProtocolPermissionRequested`.
|
|
8581
|
-
|
|
8582
|
-
```ts
|
|
8583
|
-
public bindCallback(eventName: keyof WalletPermissionsManagerCallbacks, handler: PermissionEventHandler): number
|
|
8584
|
-
```
|
|
8585
|
-
See also: [PermissionEventHandler](./client.md#type-permissioneventhandler), [WalletPermissionsManagerCallbacks](./client.md#interface-walletpermissionsmanagercallbacks)
|
|
8586
|
-
|
|
8587
|
-
Returns
|
|
8588
|
-
|
|
8589
|
-
A numeric ID you can use to unbind later
|
|
8590
|
-
|
|
8591
|
-
Argument Details
|
|
8592
|
-
|
|
8593
|
-
+ **eventName**
|
|
8594
|
-
+ The name of the event to listen to
|
|
8595
|
-
+ **handler**
|
|
8596
|
-
+ A function that handles the event
|
|
8597
|
-
|
|
8598
|
-
###### Method denyPermission
|
|
8599
|
-
|
|
8600
|
-
Denies a previously requested permission.
|
|
8601
|
-
This method rejects all pending promise calls waiting on that request
|
|
8602
|
-
|
|
8603
|
-
```ts
|
|
8604
|
-
public async denyPermission(requestID: string): Promise<void>
|
|
8605
|
-
```
|
|
8606
|
-
|
|
8607
|
-
Argument Details
|
|
8608
|
-
|
|
8609
|
-
+ **requestID**
|
|
8610
|
-
+ requestID identifying which request to deny
|
|
8611
|
-
|
|
8612
|
-
###### Method ensureBasketAccess
|
|
8613
|
-
|
|
8614
|
-
Ensures the originator has basket usage permission for the specified basket.
|
|
8615
|
-
If not, triggers a permission request flow.
|
|
8616
|
-
|
|
8617
|
-
```ts
|
|
8618
|
-
public async ensureBasketAccess({ originator, basket, reason, seekPermission = true, usageType }: {
|
|
8619
|
-
originator: string;
|
|
8620
|
-
basket: string;
|
|
8621
|
-
reason?: string;
|
|
8622
|
-
seekPermission?: boolean;
|
|
8623
|
-
usageType: "insertion" | "removal" | "listing";
|
|
8624
|
-
}): Promise<boolean>
|
|
8625
|
-
```
|
|
8626
|
-
|
|
8627
|
-
###### Method ensureCertificateAccess
|
|
8628
|
-
|
|
8629
|
-
Ensures the originator has a valid certificate permission.
|
|
8630
|
-
This is relevant when revealing certificate fields in DCAP contexts.
|
|
8631
|
-
|
|
8632
|
-
```ts
|
|
8633
|
-
public async ensureCertificateAccess({ originator, privileged, verifier, certType, fields, reason, seekPermission = true, usageType }: {
|
|
8634
|
-
originator: string;
|
|
8635
|
-
privileged: boolean;
|
|
8636
|
-
verifier: string;
|
|
8637
|
-
certType: string;
|
|
8638
|
-
fields: string[];
|
|
8639
|
-
reason?: string;
|
|
8640
|
-
seekPermission?: boolean;
|
|
8641
|
-
usageType: "disclosure";
|
|
8642
|
-
}): Promise<boolean>
|
|
8643
|
-
```
|
|
8644
|
-
|
|
8645
|
-
###### Method ensureLabelAccess
|
|
8646
|
-
|
|
8647
|
-
Ensures the originator has label usage permission.
|
|
8648
|
-
If no valid (unexpired) permission token is found, triggers a permission request flow.
|
|
8649
|
-
|
|
8650
|
-
```ts
|
|
8651
|
-
public async ensureLabelAccess({ originator, label, reason, seekPermission = true, usageType }: {
|
|
8652
|
-
originator: string;
|
|
8653
|
-
label: string;
|
|
8654
|
-
reason?: string;
|
|
8655
|
-
seekPermission?: boolean;
|
|
8656
|
-
usageType: "apply" | "list";
|
|
8657
|
-
}): Promise<boolean>
|
|
8658
|
-
```
|
|
8659
|
-
|
|
8660
|
-
###### Method ensureProtocolPermission
|
|
8661
|
-
|
|
8662
|
-
Ensures the originator has protocol usage permission.
|
|
8663
|
-
If no valid (unexpired) permission token is found, triggers a permission request flow.
|
|
8664
|
-
|
|
8665
|
-
```ts
|
|
8666
|
-
public async ensureProtocolPermission({ originator, privileged, protocolID, counterparty, reason, seekPermission = true, usageType }: {
|
|
8667
|
-
originator: string;
|
|
8668
|
-
privileged: boolean;
|
|
8669
|
-
protocolID: [
|
|
8670
|
-
0 | 1 | 2,
|
|
8671
|
-
string
|
|
8672
|
-
];
|
|
8673
|
-
counterparty: string;
|
|
8674
|
-
reason?: string;
|
|
8675
|
-
seekPermission?: boolean;
|
|
8676
|
-
usageType: "signing" | "encrypting" | "hmac" | "publicKey" | "identityKey" | "linkageRevelation" | "generic";
|
|
8677
|
-
}): Promise<boolean>
|
|
8678
|
-
```
|
|
8679
|
-
|
|
8680
|
-
###### Method ensureSpendingAuthorization
|
|
8681
|
-
|
|
8682
|
-
Ensures the originator has spending authorization (DSAP) for a certain satoshi amount.
|
|
8683
|
-
If the existing token limit is insufficient, attempts to renew. If no token, attempts to create one.
|
|
8684
|
-
|
|
8685
|
-
```ts
|
|
8686
|
-
public async ensureSpendingAuthorization({ originator, satoshis, lineItems, reason, seekPermission = true }: {
|
|
8687
|
-
originator: string;
|
|
8688
|
-
satoshis: number;
|
|
8689
|
-
lineItems?: Array<{
|
|
8690
|
-
type: "input" | "output" | "fee";
|
|
8691
|
-
description: string;
|
|
8692
|
-
satoshis: number;
|
|
8693
|
-
}>;
|
|
8694
|
-
reason?: string;
|
|
8695
|
-
seekPermission?: boolean;
|
|
8696
|
-
}): Promise<boolean>
|
|
8697
|
-
```
|
|
8698
|
-
|
|
8699
|
-
###### Method grantPermission
|
|
8700
|
-
|
|
8701
|
-
Grants a previously requested permission.
|
|
8702
|
-
This method:
|
|
8703
|
-
1) Resolves all pending promise calls waiting on this request
|
|
8704
|
-
2) Optionally creates or renews an on-chain PushDrop token (unless `ephemeral===true`)
|
|
8705
|
-
|
|
8706
|
-
```ts
|
|
8707
|
-
public async grantPermission(params: {
|
|
8708
|
-
requestID: string;
|
|
8709
|
-
expiry?: number;
|
|
8710
|
-
ephemeral?: boolean;
|
|
8711
|
-
amount?: number;
|
|
8712
|
-
}): Promise<void>
|
|
8713
|
-
```
|
|
8714
|
-
|
|
8715
|
-
Argument Details
|
|
8716
|
-
|
|
8717
|
-
+ **params**
|
|
8718
|
-
+ requestID to identify which request is granted, plus optional expiry
|
|
8719
|
-
or `ephemeral` usage, etc.
|
|
8720
|
-
|
|
8721
|
-
###### Method hasBasketAccess
|
|
8722
|
-
|
|
8723
|
-
Returns `true` if the originator already holds a valid unexpired basket permission for `basket`.
|
|
8724
|
-
|
|
8725
|
-
```ts
|
|
8726
|
-
public async hasBasketAccess(params: {
|
|
8727
|
-
originator: string;
|
|
8728
|
-
basket: string;
|
|
8729
|
-
}): Promise<boolean>
|
|
8730
|
-
```
|
|
8731
|
-
|
|
8732
|
-
###### Method hasCertificateAccess
|
|
8733
|
-
|
|
8734
|
-
Returns `true` if the originator already holds a valid unexpired certificate access
|
|
8735
|
-
for the given certType/fields. Does not prompt the user.
|
|
8736
|
-
|
|
8737
|
-
```ts
|
|
8738
|
-
public async hasCertificateAccess(params: {
|
|
8739
|
-
originator: string;
|
|
8740
|
-
privileged: boolean;
|
|
8741
|
-
verifier: string;
|
|
8742
|
-
certType: string;
|
|
8743
|
-
fields: string[];
|
|
8744
|
-
}): Promise<boolean>
|
|
8745
|
-
```
|
|
8746
|
-
|
|
8747
|
-
###### Method hasProtocolPermission
|
|
8748
|
-
|
|
8749
|
-
Returns true if the originator already holds a valid unexpired protocol permission.
|
|
8750
|
-
This calls `ensureProtocolPermission` with `seekPermission=false`, so it won't prompt.
|
|
8751
|
-
|
|
8752
|
-
```ts
|
|
8753
|
-
public async hasProtocolPermission(params: {
|
|
8754
|
-
originator: string;
|
|
8755
|
-
privileged: boolean;
|
|
8756
|
-
protocolID: [
|
|
8757
|
-
0 | 1 | 2,
|
|
8758
|
-
string
|
|
8759
|
-
];
|
|
8760
|
-
counterparty: string;
|
|
8761
|
-
}): Promise<boolean>
|
|
8762
|
-
```
|
|
8763
|
-
|
|
8764
|
-
###### Method hasSpendingAuthorization
|
|
8765
|
-
|
|
8766
|
-
Returns `true` if the originator already holds a valid spending authorization token
|
|
8767
|
-
with enough available monthly spend. We do not prompt (seekPermission=false).
|
|
8768
|
-
|
|
8769
|
-
```ts
|
|
8770
|
-
public async hasSpendingAuthorization(params: {
|
|
8771
|
-
originator: string;
|
|
8772
|
-
satoshis: number;
|
|
8773
|
-
}): Promise<boolean>
|
|
8774
|
-
```
|
|
8775
|
-
|
|
8776
|
-
###### Method listBasketAccess
|
|
8777
|
-
|
|
8778
|
-
Lists basket permission tokens (DBAP) for a given originator (or for all if not specified).
|
|
8779
|
-
|
|
8780
|
-
```ts
|
|
8781
|
-
public async listBasketAccess(params: {
|
|
8782
|
-
originator?: string;
|
|
8783
|
-
}): Promise<PermissionToken[]>
|
|
8784
|
-
```
|
|
8785
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
8786
|
-
|
|
8787
|
-
###### Method listCertificateAccess
|
|
8788
|
-
|
|
8789
|
-
Lists certificate permission tokens (DCAP) for a given originator (or all).
|
|
8790
|
-
|
|
8791
|
-
```ts
|
|
8792
|
-
public async listCertificateAccess(params: {
|
|
8793
|
-
originator?: string;
|
|
8794
|
-
}): Promise<PermissionToken[]>
|
|
8795
|
-
```
|
|
8796
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
8797
|
-
|
|
8798
|
-
###### Method listProtocolPermissions
|
|
8799
|
-
|
|
8800
|
-
Lists all protocol permission tokens (DPACP) for a given originator or for all if originator is undefined.
|
|
8801
|
-
This is a convenience method for UI or debug.
|
|
8802
|
-
|
|
8803
|
-
```ts
|
|
8804
|
-
public async listProtocolPermissions({ originator }: {
|
|
8805
|
-
originator?: string;
|
|
8806
|
-
}): Promise<PermissionToken[]>
|
|
8807
|
-
```
|
|
8808
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
8809
|
-
|
|
8810
|
-
###### Method listSpendingAuthorizations
|
|
8811
|
-
|
|
8812
|
-
Lists spending authorization tokens (DSAP) for a given originator (or all).
|
|
8813
|
-
|
|
8814
|
-
```ts
|
|
8815
|
-
public async listSpendingAuthorizations(params: {
|
|
8816
|
-
originator?: string;
|
|
8817
|
-
}): Promise<PermissionToken[]>
|
|
8818
|
-
```
|
|
8819
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
8820
|
-
|
|
8821
|
-
###### Method querySpentSince
|
|
8822
|
-
|
|
8823
|
-
Returns spending for an originator in the current calendar month.
|
|
8824
|
-
|
|
8825
|
-
```ts
|
|
8826
|
-
public async querySpentSince(token: PermissionToken): Promise<number>
|
|
8827
|
-
```
|
|
8828
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
8829
|
-
|
|
8830
|
-
###### Method revokePermission
|
|
8831
|
-
|
|
8832
|
-
Revokes a permission token by spending it with no replacement output.
|
|
8833
|
-
The manager builds a BRC-100 transaction that consumes the token, effectively invalidating it.
|
|
8834
|
-
|
|
8835
|
-
```ts
|
|
8836
|
-
public async revokePermission(oldToken: PermissionToken): Promise<void>
|
|
8837
|
-
```
|
|
8838
|
-
See also: [PermissionToken](./client.md#interface-permissiontoken)
|
|
8839
|
-
|
|
8840
|
-
###### Method unbindCallback
|
|
8841
|
-
|
|
8842
|
-
Unbinds a previously registered callback by either its numeric ID (returned by `bindCallback`)
|
|
8843
|
-
or by exact function reference.
|
|
8844
|
-
|
|
8845
|
-
```ts
|
|
8846
|
-
public unbindCallback(eventName: keyof WalletPermissionsManagerCallbacks, reference: number | Function): boolean
|
|
8847
|
-
```
|
|
8848
|
-
See also: [WalletPermissionsManagerCallbacks](./client.md#interface-walletpermissionsmanagercallbacks)
|
|
8849
|
-
|
|
8850
|
-
Returns
|
|
8851
|
-
|
|
8852
|
-
True if successfully unbound, false otherwise
|
|
8853
|
-
|
|
8854
|
-
Argument Details
|
|
8855
|
-
|
|
8856
|
-
+ **eventName**
|
|
8857
|
-
+ The event name, e.g. "onProtocolPermissionRequested"
|
|
8858
|
-
+ **reference**
|
|
8859
|
-
+ Either the numeric ID or the function reference
|
|
8860
|
-
|
|
8861
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8862
|
-
|
|
8863
|
-
---
|
|
8864
|
-
##### Class: WalletSettingsManager
|
|
8865
|
-
|
|
8866
|
-
Manages wallet settings
|
|
8867
|
-
|
|
8868
|
-
```ts
|
|
8869
|
-
export class WalletSettingsManager {
|
|
8870
|
-
constructor(private wallet: WalletInterface, private config: WalletSettingsManagerConfig = {
|
|
8871
|
-
defaultSettings: DEFAULT_SETTINGS
|
|
8872
|
-
})
|
|
8873
|
-
async get(): Promise<WalletSettings>
|
|
8874
|
-
async set(settings: WalletSettings): Promise<void>
|
|
8875
|
-
async delete(): Promise<void>
|
|
8876
|
-
}
|
|
8877
|
-
```
|
|
8878
|
-
|
|
8879
|
-
See also: [DEFAULT_SETTINGS](./client.md#variable-default_settings), [WalletSettings](./client.md#interface-walletsettings), [WalletSettingsManagerConfig](./client.md#interface-walletsettingsmanagerconfig)
|
|
8880
|
-
|
|
8881
|
-
###### Method delete
|
|
8882
|
-
|
|
8883
|
-
Deletes the user's settings token.
|
|
8884
|
-
|
|
8885
|
-
```ts
|
|
8886
|
-
async delete(): Promise<void>
|
|
8887
|
-
```
|
|
8888
|
-
|
|
8889
|
-
###### Method get
|
|
8890
|
-
|
|
8891
|
-
Returns a user's wallet settings
|
|
8892
|
-
|
|
8893
|
-
```ts
|
|
8894
|
-
async get(): Promise<WalletSettings>
|
|
8895
|
-
```
|
|
8896
|
-
See also: [WalletSettings](./client.md#interface-walletsettings)
|
|
8897
|
-
|
|
8898
|
-
Returns
|
|
8899
|
-
|
|
8900
|
-
- Wallet settings object
|
|
8901
|
-
|
|
8902
|
-
###### Method set
|
|
8903
|
-
|
|
8904
|
-
Creates (or updates) the user's settings token.
|
|
8905
|
-
|
|
8906
|
-
```ts
|
|
8907
|
-
async set(settings: WalletSettings): Promise<void>
|
|
8908
|
-
```
|
|
8909
|
-
See also: [WalletSettings](./client.md#interface-walletsettings)
|
|
8910
|
-
|
|
8911
|
-
Argument Details
|
|
8912
|
-
|
|
8913
|
-
+ **settings**
|
|
8914
|
-
+ The wallet settings to be stored.
|
|
8915
|
-
|
|
8916
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8917
|
-
|
|
8918
6872
|
---
|
|
8919
6873
|
##### Class: WalletSigner
|
|
8920
6874
|
|
|
@@ -10602,15 +8556,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10602
8556
|
|
|
10603
8557
|
| | |
|
|
10604
8558
|
| --- | --- |
|
|
10605
|
-
| [Chain](#type-chain) | [
|
|
10606
|
-
| [DBType](#type-dbtype) | [
|
|
10607
|
-
| [EntityStorage](#type-entitystorage) | [
|
|
10608
|
-
| [GetMerklePathService](#type-getmerklepathservice) | [
|
|
10609
|
-
| [GetRawTxService](#type-getrawtxservice) | [
|
|
10610
|
-
| [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [
|
|
10611
|
-
| [GetUtxoStatusService](#type-getutxostatusservice) | [
|
|
10612
|
-
| [MonitorStorage](#type-monitorstorage) | [
|
|
10613
|
-
| [
|
|
8559
|
+
| [Chain](#type-chain) | [PostReqsToNetworkDetailsStatus](#type-postreqstonetworkdetailsstatus) |
|
|
8560
|
+
| [DBType](#type-dbtype) | [PostTxsService](#type-posttxsservice) |
|
|
8561
|
+
| [EntityStorage](#type-entitystorage) | [ProvenTxReqStatus](#type-proventxreqstatus) |
|
|
8562
|
+
| [GetMerklePathService](#type-getmerklepathservice) | [StorageProvidedBy](#type-storageprovidedby) |
|
|
8563
|
+
| [GetRawTxService](#type-getrawtxservice) | [SyncProtocolVersion](#type-syncprotocolversion) |
|
|
8564
|
+
| [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [SyncStatus](#type-syncstatus) |
|
|
8565
|
+
| [GetUtxoStatusService](#type-getutxostatusservice) | [TransactionStatus](#type-transactionstatus) |
|
|
8566
|
+
| [MonitorStorage](#type-monitorstorage) | [UpdateFiatExchangeRateService](#type-updatefiatexchangerateservice) |
|
|
8567
|
+
| [PostBeefService](#type-postbeefservice) | |
|
|
10614
8568
|
|
|
10615
8569
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10616
8570
|
|
|
@@ -10697,21 +8651,6 @@ See also: [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
|
10697
8651
|
|
|
10698
8652
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10699
8653
|
|
|
10700
|
-
---
|
|
10701
|
-
##### Type: PermissionEventHandler
|
|
10702
|
-
|
|
10703
|
-
Signature for functions that handle a permission request event, e.g. "Please ask the user to allow basket X".
|
|
10704
|
-
|
|
10705
|
-
```ts
|
|
10706
|
-
export type PermissionEventHandler = (request: PermissionRequest & {
|
|
10707
|
-
requestID: string;
|
|
10708
|
-
}) => void | Promise<void>
|
|
10709
|
-
```
|
|
10710
|
-
|
|
10711
|
-
See also: [PermissionRequest](./client.md#interface-permissionrequest)
|
|
10712
|
-
|
|
10713
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10714
|
-
|
|
10715
8654
|
---
|
|
10716
8655
|
##### Type: PostBeefService
|
|
10717
8656
|
|
|
@@ -10844,71 +8783,17 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
10844
8783
|
|
|
10845
8784
|
| |
|
|
10846
8785
|
| --- |
|
|
10847
|
-
| [DEFAULT_SETTINGS](#variable-default_settings) |
|
|
10848
|
-
| [PBKDF2_NUM_ROUNDS](#variable-pbkdf2_num_rounds) |
|
|
10849
8786
|
| [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) |
|
|
10850
8787
|
| [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) |
|
|
10851
|
-
| [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) |
|
|
10852
8788
|
| [brc29ProtocolID](#variable-brc29protocolid) |
|
|
10853
8789
|
| [maxPossibleSatoshis](#variable-maxpossiblesatoshis) |
|
|
10854
8790
|
| [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) |
|
|
10855
|
-
| [parseResults](#variable-parseresults) |
|
|
10856
|
-
| [queryOverlay](#variable-queryoverlay) |
|
|
10857
8791
|
| [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
|
|
10858
|
-
| [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
|
|
10859
|
-
|
|
10860
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10861
|
-
|
|
10862
|
-
---
|
|
10863
|
-
|
|
10864
|
-
##### Variable: DEFAULT_SETTINGS
|
|
10865
|
-
|
|
10866
|
-
```ts
|
|
10867
|
-
DEFAULT_SETTINGS = {
|
|
10868
|
-
trustSettings: {
|
|
10869
|
-
trustLevel: 2,
|
|
10870
|
-
trustedCertifiers: [
|
|
10871
|
-
{
|
|
10872
|
-
name: "Babbage Trust Services",
|
|
10873
|
-
description: "Resolves identity information for Babbage-run APIs and Bitcoin infrastructure.",
|
|
10874
|
-
iconUrl: "https://projectbabbage.com/favicon.ico",
|
|
10875
|
-
identityKey: "028703956178067ea7ca405111f1ca698290a0112a3d7cf3d843e195bf58a7cfa6",
|
|
10876
|
-
trust: 4
|
|
10877
|
-
},
|
|
10878
|
-
{
|
|
10879
|
-
name: "IdentiCert",
|
|
10880
|
-
description: "Certifies legal first and last name, and photos",
|
|
10881
|
-
iconUrl: "https://identicert.me/favicon.ico",
|
|
10882
|
-
trust: 5,
|
|
10883
|
-
identityKey: "0295bf1c7842d14babf60daf2c733956c331f9dcb2c79e41f85fd1dda6a3fa4549"
|
|
10884
|
-
},
|
|
10885
|
-
{
|
|
10886
|
-
name: "SocialCert",
|
|
10887
|
-
description: "Certifies social media handles, phone numbers and emails",
|
|
10888
|
-
iconUrl: "https://socialcert.net/favicon.ico",
|
|
10889
|
-
trust: 3,
|
|
10890
|
-
identityKey: "03285263f06139b66fb27f51cf8a92e9dd007c4c4b83876ad6c3e7028db450a4c2"
|
|
10891
|
-
}
|
|
10892
|
-
]
|
|
10893
|
-
},
|
|
10894
|
-
theme: { mode: "dark" }
|
|
10895
|
-
} as WalletSettings
|
|
10896
|
-
```
|
|
10897
|
-
|
|
10898
|
-
See also: [WalletSettings](./client.md#interface-walletsettings)
|
|
10899
8792
|
|
|
10900
8793
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10901
8794
|
|
|
10902
8795
|
---
|
|
10903
|
-
##### Variable: PBKDF2_NUM_ROUNDS
|
|
10904
|
-
|
|
10905
|
-
```ts
|
|
10906
|
-
PBKDF2_NUM_ROUNDS = 7777
|
|
10907
|
-
```
|
|
10908
|
-
|
|
10909
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10910
8796
|
|
|
10911
|
-
---
|
|
10912
8797
|
##### Variable: ProvenTxReqNonTerminalStatus
|
|
10913
8798
|
|
|
10914
8799
|
```ts
|
|
@@ -10944,26 +8829,6 @@ See also: [ProvenTxReqStatus](./client.md#type-proventxreqstatus)
|
|
|
10944
8829
|
|
|
10945
8830
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10946
8831
|
|
|
10947
|
-
---
|
|
10948
|
-
##### Variable: TESTNET_DEFAULT_SETTINGS
|
|
10949
|
-
|
|
10950
|
-
```ts
|
|
10951
|
-
TESTNET_DEFAULT_SETTINGS: WalletSettings = {
|
|
10952
|
-
...DEFAULT_SETTINGS,
|
|
10953
|
-
trustSettings: {
|
|
10954
|
-
...DEFAULT_SETTINGS.trustSettings,
|
|
10955
|
-
trustedCertifiers: DEFAULT_SETTINGS.trustSettings.trustedCertifiers.map(certifier => ({
|
|
10956
|
-
...certifier,
|
|
10957
|
-
identityKey: TESTNET_IDENTITY_KEYS[certifier.name] || certifier.identityKey
|
|
10958
|
-
}))
|
|
10959
|
-
}
|
|
10960
|
-
}
|
|
10961
|
-
```
|
|
10962
|
-
|
|
10963
|
-
See also: [DEFAULT_SETTINGS](./client.md#variable-default_settings), [WalletSettings](./client.md#interface-walletsettings)
|
|
10964
|
-
|
|
10965
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
10966
|
-
|
|
10967
8832
|
---
|
|
10968
8833
|
##### Variable: brc29ProtocolID
|
|
10969
8834
|
|
|
@@ -11016,52 +8881,6 @@ outputColumnsWithoutLockingScript = [
|
|
|
11016
8881
|
|
|
11017
8882
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11018
8883
|
|
|
11019
|
-
---
|
|
11020
|
-
##### Variable: parseResults
|
|
11021
|
-
|
|
11022
|
-
```ts
|
|
11023
|
-
parseResults = async (lookupResult: LookupAnswer): Promise<VerifiableCertificate[]> => {
|
|
11024
|
-
if (lookupResult.type === "output-list") {
|
|
11025
|
-
const parsedResults: VerifiableCertificate[] = [];
|
|
11026
|
-
for (const output of lookupResult.outputs) {
|
|
11027
|
-
try {
|
|
11028
|
-
const tx = Transaction.fromAtomicBEEF(output.beef);
|
|
11029
|
-
const decodedOutput = PushDrop.decode(tx.outputs[OUTPUT_INDEX].lockingScript);
|
|
11030
|
-
const certificate: VerifiableCertificate = JSON.parse(Utils.toUTF8(decodedOutput.fields[0]));
|
|
11031
|
-
const verifiableCert = new VerifiableCertificate(certificate.type, certificate.serialNumber, certificate.subject, certificate.revocationOutpoint, certificate.certifier, certificate.fields, certificate.keyring, certificate.signature);
|
|
11032
|
-
const decryptedFields = await verifiableCert.decryptFields(new ProtoWallet("anyone"));
|
|
11033
|
-
verifiableCert.decryptedFields = decryptedFields;
|
|
11034
|
-
parsedResults.push(verifiableCert);
|
|
11035
|
-
}
|
|
11036
|
-
catch (error) {
|
|
11037
|
-
console.error(error);
|
|
11038
|
-
}
|
|
11039
|
-
}
|
|
11040
|
-
return parsedResults;
|
|
11041
|
-
}
|
|
11042
|
-
return [];
|
|
11043
|
-
}
|
|
11044
|
-
```
|
|
11045
|
-
|
|
11046
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11047
|
-
|
|
11048
|
-
---
|
|
11049
|
-
##### Variable: queryOverlay
|
|
11050
|
-
|
|
11051
|
-
```ts
|
|
11052
|
-
queryOverlay = async (query: unknown, resolver: LookupResolver): Promise<VerifiableCertificate[]> => {
|
|
11053
|
-
const results = await resolver.query({
|
|
11054
|
-
service: "ls_identity",
|
|
11055
|
-
query
|
|
11056
|
-
});
|
|
11057
|
-
return await parseResults(results);
|
|
11058
|
-
}
|
|
11059
|
-
```
|
|
11060
|
-
|
|
11061
|
-
See also: [parseResults](./client.md#variable-parseresults)
|
|
11062
|
-
|
|
11063
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11064
|
-
|
|
11065
8884
|
---
|
|
11066
8885
|
##### Variable: transactionColumnsWithoutRawTx
|
|
11067
8886
|
|
|
@@ -11085,60 +8904,6 @@ transactionColumnsWithoutRawTx = [
|
|
|
11085
8904
|
|
|
11086
8905
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11087
8906
|
|
|
11088
|
-
---
|
|
11089
|
-
##### Variable: transformVerifiableCertificatesWithTrust
|
|
11090
|
-
|
|
11091
|
-
```ts
|
|
11092
|
-
transformVerifiableCertificatesWithTrust = (trustSettings: TrustSettings, certificates: VerifiableCertificate[]): DiscoverCertificatesResult => {
|
|
11093
|
-
const identityGroups: Record<string, IdentityGroup> = {};
|
|
11094
|
-
const certifierCache: Record<string, Certifier> = {};
|
|
11095
|
-
certificates.forEach(cert => {
|
|
11096
|
-
const { subject, certifier } = cert;
|
|
11097
|
-
if (!subject || !certifier)
|
|
11098
|
-
return;
|
|
11099
|
-
if (!certifierCache[certifier]) {
|
|
11100
|
-
const found = trustSettings.trustedCertifiers.find(x => x.identityKey === certifier);
|
|
11101
|
-
if (!found)
|
|
11102
|
-
return;
|
|
11103
|
-
certifierCache[certifier] = found;
|
|
11104
|
-
}
|
|
11105
|
-
const certifierInfo: IdentityCertifier = {
|
|
11106
|
-
name: certifierCache[certifier].name,
|
|
11107
|
-
iconUrl: certifierCache[certifier].iconUrl || "",
|
|
11108
|
-
description: certifierCache[certifier].description,
|
|
11109
|
-
trust: certifierCache[certifier].trust
|
|
11110
|
-
};
|
|
11111
|
-
const extendedCert: IdentityCertificate = {
|
|
11112
|
-
...cert,
|
|
11113
|
-
signature: cert.signature!,
|
|
11114
|
-
decryptedFields: cert.decryptedFields as Record<string, string>,
|
|
11115
|
-
publiclyRevealedKeyring: cert.keyring,
|
|
11116
|
-
certifierInfo
|
|
11117
|
-
};
|
|
11118
|
-
if (!identityGroups[subject]) {
|
|
11119
|
-
identityGroups[subject] = { totalTrust: 0, members: [] };
|
|
11120
|
-
}
|
|
11121
|
-
identityGroups[subject].totalTrust += certifierInfo.trust;
|
|
11122
|
-
identityGroups[subject].members.push(extendedCert);
|
|
11123
|
-
});
|
|
11124
|
-
const finalResults: ExtendedVerifiableCertificate[] = [];
|
|
11125
|
-
Object.values(identityGroups).forEach(group => {
|
|
11126
|
-
if (group.totalTrust >= trustSettings.trustLevel) {
|
|
11127
|
-
finalResults.push(...group.members);
|
|
11128
|
-
}
|
|
11129
|
-
});
|
|
11130
|
-
finalResults.sort((a, b) => b.certifierInfo.trust - a.certifierInfo.trust);
|
|
11131
|
-
return {
|
|
11132
|
-
totalCertificates: finalResults.length,
|
|
11133
|
-
certificates: finalResults
|
|
11134
|
-
};
|
|
11135
|
-
}
|
|
11136
|
-
```
|
|
11137
|
-
|
|
11138
|
-
See also: [Certifier](./client.md#interface-certifier), [ExtendedVerifiableCertificate](./client.md#interface-extendedverifiablecertificate), [TrustSettings](./client.md#interface-trustsettings)
|
|
11139
|
-
|
|
11140
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
11141
|
-
|
|
11142
8907
|
---
|
|
11143
8908
|
|
|
11144
8909
|
<!--#endregion ts2md-api-merged-here-->
|