@bsv/wallet-toolbox 1.1.62 → 1.2.1

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.
Files changed (185) hide show
  1. package/docs/client.md +2339 -182
  2. package/docs/wallet.md +2339 -182
  3. package/out/src/CWIStyleWalletManager.d.ts +417 -0
  4. package/out/src/CWIStyleWalletManager.d.ts.map +1 -0
  5. package/out/src/CWIStyleWalletManager.js +1153 -0
  6. package/out/src/CWIStyleWalletManager.js.map +1 -0
  7. package/out/src/SimpleWalletManager.d.ts +169 -0
  8. package/out/src/SimpleWalletManager.d.ts.map +1 -0
  9. package/out/src/SimpleWalletManager.js +315 -0
  10. package/out/src/SimpleWalletManager.js.map +1 -0
  11. package/out/src/Wallet.d.ts +6 -1
  12. package/out/src/Wallet.d.ts.map +1 -1
  13. package/out/src/Wallet.js +39 -7
  14. package/out/src/Wallet.js.map +1 -1
  15. package/out/src/WalletAuthenticationManager.d.ts +33 -0
  16. package/out/src/WalletAuthenticationManager.d.ts.map +1 -0
  17. package/out/src/WalletAuthenticationManager.js +110 -0
  18. package/out/src/WalletAuthenticationManager.js.map +1 -0
  19. package/out/src/WalletPermissionsManager.d.ts +575 -0
  20. package/out/src/WalletPermissionsManager.d.ts.map +1 -0
  21. package/out/src/WalletPermissionsManager.js +1789 -0
  22. package/out/src/WalletPermissionsManager.js.map +1 -0
  23. package/out/src/WalletSettingsManager.d.ts +59 -0
  24. package/out/src/WalletSettingsManager.d.ts.map +1 -0
  25. package/out/src/WalletSettingsManager.js +189 -0
  26. package/out/src/WalletSettingsManager.js.map +1 -0
  27. package/out/src/__tests/CWIStyleWalletManager.test.d.ts +2 -0
  28. package/out/src/__tests/CWIStyleWalletManager.test.d.ts.map +1 -0
  29. package/out/src/__tests/CWIStyleWalletManager.test.js +471 -0
  30. package/out/src/__tests/CWIStyleWalletManager.test.js.map +1 -0
  31. package/out/src/__tests/WalletPermissionsManager.callbacks.test.d.ts +2 -0
  32. package/out/src/__tests/WalletPermissionsManager.callbacks.test.d.ts.map +1 -0
  33. package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +239 -0
  34. package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +1 -0
  35. package/out/src/__tests/WalletPermissionsManager.checks.test.d.ts +2 -0
  36. package/out/src/__tests/WalletPermissionsManager.checks.test.d.ts.map +1 -0
  37. package/out/src/__tests/WalletPermissionsManager.checks.test.js +637 -0
  38. package/out/src/__tests/WalletPermissionsManager.checks.test.js.map +1 -0
  39. package/out/src/__tests/WalletPermissionsManager.encryption.test.d.ts +2 -0
  40. package/out/src/__tests/WalletPermissionsManager.encryption.test.d.ts.map +1 -0
  41. package/out/src/__tests/WalletPermissionsManager.encryption.test.js +295 -0
  42. package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +1 -0
  43. package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +83 -0
  44. package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -0
  45. package/out/src/__tests/WalletPermissionsManager.fixtures.js +261 -0
  46. package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +1 -0
  47. package/out/src/__tests/WalletPermissionsManager.flows.test.d.ts +2 -0
  48. package/out/src/__tests/WalletPermissionsManager.flows.test.d.ts.map +1 -0
  49. package/out/src/__tests/WalletPermissionsManager.flows.test.js +377 -0
  50. package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +1 -0
  51. package/out/src/__tests/WalletPermissionsManager.initialization.test.d.ts +2 -0
  52. package/out/src/__tests/WalletPermissionsManager.initialization.test.d.ts.map +1 -0
  53. package/out/src/__tests/WalletPermissionsManager.initialization.test.js +227 -0
  54. package/out/src/__tests/WalletPermissionsManager.initialization.test.js.map +1 -0
  55. package/out/src/__tests/WalletPermissionsManager.proxying.test.d.ts +2 -0
  56. package/out/src/__tests/WalletPermissionsManager.proxying.test.d.ts.map +1 -0
  57. package/out/src/__tests/WalletPermissionsManager.proxying.test.js +566 -0
  58. package/out/src/__tests/WalletPermissionsManager.proxying.test.js.map +1 -0
  59. package/out/src/__tests/WalletPermissionsManager.tokens.test.d.ts +2 -0
  60. package/out/src/__tests/WalletPermissionsManager.tokens.test.d.ts.map +1 -0
  61. package/out/src/__tests/WalletPermissionsManager.tokens.test.js +454 -0
  62. package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +1 -0
  63. package/out/src/index.all.d.ts +9 -0
  64. package/out/src/index.all.d.ts.map +1 -1
  65. package/out/src/index.all.js +9 -0
  66. package/out/src/index.all.js.map +1 -1
  67. package/out/src/index.client.d.ts +9 -0
  68. package/out/src/index.client.d.ts.map +1 -1
  69. package/out/src/index.client.js +9 -0
  70. package/out/src/index.client.js.map +1 -1
  71. package/out/src/sdk/CertOpsWallet.d.ts +7 -0
  72. package/out/src/sdk/CertOpsWallet.d.ts.map +1 -0
  73. package/out/src/sdk/CertOpsWallet.js +3 -0
  74. package/out/src/sdk/CertOpsWallet.js.map +1 -0
  75. package/out/src/sdk/__test/CertificateLifeCycle.test.js +19 -82
  76. package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +1 -1
  77. package/out/src/sdk/index.d.ts +1 -1
  78. package/out/src/sdk/index.d.ts.map +1 -1
  79. package/out/src/sdk/index.js +1 -1
  80. package/out/src/sdk/index.js.map +1 -1
  81. package/out/src/sdk/validationHelpers.d.ts.map +1 -1
  82. package/out/src/sdk/validationHelpers.js +13 -12
  83. package/out/src/sdk/validationHelpers.js.map +1 -1
  84. package/out/src/services/__tests/bitrails.test.js +7 -2
  85. package/out/src/services/__tests/bitrails.test.js.map +1 -1
  86. package/out/src/services/providers/__tests/WhatsOnChain.test.js +3 -3
  87. package/out/src/services/providers/__tests/WhatsOnChain.test.js.map +1 -1
  88. package/out/src/signer/methods/proveCertificate.d.ts.map +1 -1
  89. package/out/src/signer/methods/proveCertificate.js +3 -19
  90. package/out/src/signer/methods/proveCertificate.js.map +1 -1
  91. package/out/src/storage/__test/WalletStorageManager.test.js +1 -1
  92. package/out/src/storage/__test/WalletStorageManager.test.js.map +1 -1
  93. package/out/src/storage/remoting/StorageClient.d.ts +2 -2
  94. package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
  95. package/out/src/storage/remoting/StorageClient.js +1 -1
  96. package/out/src/storage/remoting/StorageClient.js.map +1 -1
  97. package/out/src/utility/identityUtils.d.ts +31 -0
  98. package/out/src/utility/identityUtils.d.ts.map +1 -0
  99. package/out/src/utility/identityUtils.js +116 -0
  100. package/out/src/utility/identityUtils.js.map +1 -0
  101. package/out/src/wab-client/WABClient.d.ts +49 -0
  102. package/out/src/wab-client/WABClient.d.ts.map +1 -0
  103. package/out/src/wab-client/WABClient.js +83 -0
  104. package/out/src/wab-client/WABClient.js.map +1 -0
  105. package/out/src/wab-client/__tests/WABClient.man.test.d.ts +2 -0
  106. package/out/src/wab-client/__tests/WABClient.man.test.d.ts.map +1 -0
  107. package/out/src/wab-client/__tests/WABClient.man.test.js +52 -0
  108. package/out/src/wab-client/__tests/WABClient.man.test.js.map +1 -0
  109. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +34 -0
  110. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -0
  111. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +16 -0
  112. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -0
  113. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts +7 -0
  114. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts.map +1 -0
  115. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +36 -0
  116. package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +1 -0
  117. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +28 -0
  118. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +1 -0
  119. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +69 -0
  120. package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -0
  121. package/out/test/Wallet/action/internalizeAction.a.test.js +1 -1
  122. package/out/test/Wallet/action/internalizeAction.a.test.js.map +1 -1
  123. package/out/test/Wallet/certificate/acquireCertificate.test.js +26 -29
  124. package/out/test/Wallet/certificate/acquireCertificate.test.js.map +1 -1
  125. package/out/test/storage/KnexMigrations.test.js +1 -1
  126. package/out/test/storage/KnexMigrations.test.js.map +1 -1
  127. package/out/test/storage/update.test.js +1 -1
  128. package/out/test/storage/update.test.js.map +1 -1
  129. package/out/test/utils/TestUtilsWalletStorage.d.ts +9 -5
  130. package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
  131. package/out/test/utils/TestUtilsWalletStorage.js +15 -9
  132. package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
  133. package/out/test/wallet/action/internalizeAction.test.js +1 -1
  134. package/out/test/wallet/action/internalizeAction.test.js.map +1 -1
  135. package/out/test/wallet/list/listActions2.test.js +1 -1
  136. package/out/test/wallet/list/listActions2.test.js.map +1 -1
  137. package/out/test/wallet/sync/Wallet.sync.test.js +1 -1
  138. package/out/test/wallet/sync/Wallet.sync.test.js.map +1 -1
  139. package/out/tsconfig.all.tsbuildinfo +1 -1
  140. package/package.json +3 -4
  141. package/src/CWIStyleWalletManager.ts +1738 -0
  142. package/src/SimpleWalletManager.ts +526 -0
  143. package/src/Wallet.ts +70 -7
  144. package/src/WalletAuthenticationManager.ts +150 -0
  145. package/src/WalletPermissionsManager.ts +2424 -0
  146. package/src/WalletSettingsManager.ts +243 -0
  147. package/src/__tests/CWIStyleWalletManager.test.ts +604 -0
  148. package/src/__tests/WalletPermissionsManager.callbacks.test.ts +323 -0
  149. package/src/__tests/WalletPermissionsManager.checks.test.ts +839 -0
  150. package/src/__tests/WalletPermissionsManager.encryption.test.ts +370 -0
  151. package/src/__tests/WalletPermissionsManager.fixtures.ts +284 -0
  152. package/src/__tests/WalletPermissionsManager.flows.test.ts +457 -0
  153. package/src/__tests/WalletPermissionsManager.initialization.test.ts +300 -0
  154. package/src/__tests/WalletPermissionsManager.proxying.test.ts +706 -0
  155. package/src/__tests/WalletPermissionsManager.tokens.test.ts +546 -0
  156. package/src/index.all.ts +9 -0
  157. package/src/index.client.ts +9 -0
  158. package/src/sdk/CertOpsWallet.ts +18 -0
  159. package/src/sdk/__test/CertificateLifeCycle.test.ts +66 -113
  160. package/src/sdk/index.ts +1 -1
  161. package/src/sdk/validationHelpers.ts +12 -11
  162. package/src/services/__tests/bitrails.test.ts +7 -2
  163. package/src/services/providers/__tests/WhatsOnChain.test.ts +3 -3
  164. package/src/signer/methods/proveCertificate.ts +14 -21
  165. package/src/storage/__test/WalletStorageManager.test.ts +1 -1
  166. package/src/storage/remoting/StorageClient.ts +4 -4
  167. package/src/utility/identityUtils.ts +159 -0
  168. package/src/wab-client/WABClient.ts +94 -0
  169. package/src/wab-client/__tests/WABClient.man.test.ts +59 -0
  170. package/src/wab-client/auth-method-interactors/AuthMethodInteractor.ts +47 -0
  171. package/src/wab-client/auth-method-interactors/PersonaIDInteractor.ts +35 -0
  172. package/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.ts +72 -0
  173. package/test/Wallet/action/internalizeAction.a.test.ts +1 -1
  174. package/test/Wallet/certificate/acquireCertificate.test.ts +89 -30
  175. package/test/storage/KnexMigrations.test.ts +1 -1
  176. package/test/storage/update.test.ts +1 -1
  177. package/test/utils/TestUtilsWalletStorage.ts +24 -13
  178. package/test/wallet/action/internalizeAction.test.ts +1 -1
  179. package/test/wallet/list/listActions2.test.ts +1 -1
  180. package/test/wallet/sync/Wallet.sync.test.ts +1 -1
  181. package/out/src/sdk/CertOps.d.ts +0 -66
  182. package/out/src/sdk/CertOps.d.ts.map +0 -1
  183. package/out/src/sdk/CertOps.js +0 -190
  184. package/out/src/sdk/CertOps.js.map +0 -1
  185. package/src/sdk/CertOps.ts +0 -274
package/docs/client.md CHANGED
@@ -14,56 +14,61 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
14
14
 
15
15
  | | | |
16
16
  | --- | --- | --- |
17
- | [ArcConfig](#interface-arcconfig) | [PendingStorageInput](#interface-pendingstorageinput) | [TableSyncState](#interface-tablesyncstate) |
18
- | [ArcMinerGetTxData](#interface-arcminergettxdata) | [PostBeefResult](#interface-postbeefresult) | [TableTransaction](#interface-tabletransaction) |
19
- | [AuthId](#interface-authid) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TableTxLabel](#interface-tabletxlabel) |
20
- | [BaseBlockHeader](#interface-baseblockheader) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TableTxLabelMap](#interface-tabletxlabelmap) |
21
- | [BitailsConfig](#interface-bitailsconfig) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TableUser](#interface-tableuser) |
22
- | [BitailsMerkleProof](#interface-bitailsmerkleproof) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TaskPurgeParams](#interface-taskpurgeparams) |
23
- | [BlockHeader](#interface-blockheader) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [TrxToken](#interface-trxtoken) |
24
- | [BsvExchangeRate](#interface-bsvexchangerate) | [PostTxsResult](#interface-posttxsresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
25
- | [CertOpsWallet](#interface-certopswallet) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [TxScriptOffsets](#interface-txscriptoffsets) |
26
- | [CommitNewTxResults](#interface-commitnewtxresults) | [ProvenOrRawTx](#interface-provenorrawtx) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
27
- | [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
28
- | [EntityTimeStamp](#interface-entitytimestamp) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [ValidAbortActionArgs](#interface-validabortactionargs) |
29
- | [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
30
- | [FiatExchangeRates](#interface-fiatexchangerates) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
31
- | [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [PurgeParams](#interface-purgeparams) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
32
- | [FindCertificatesArgs](#interface-findcertificatesargs) | [PurgeResults](#interface-purgeresults) | [ValidBasketInsertion](#interface-validbasketinsertion) |
33
- | [FindCommissionsArgs](#interface-findcommissionsargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
34
- | [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidCreateActionInput](#interface-validcreateactioninput) |
35
- | [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
36
- | [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
37
- | [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
38
- | [FindOutputTagsArgs](#interface-findoutputtagsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
39
- | [FindOutputsArgs](#interface-findoutputsargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
40
- | [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
41
- | [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StorageIdentity](#interface-storageidentity) | [ValidListActionsArgs](#interface-validlistactionsargs) |
42
- | [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
43
- | [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
44
- | [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
45
- | [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageProvenOrReq](#interface-storageprovenorreq) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
46
- | [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageProviderOptions](#interface-storageprovideroptions) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
47
- | [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageReaderOptions](#interface-storagereaderoptions) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
48
- | [FindUsersArgs](#interface-findusersargs) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
49
- | [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [ValidSignActionArgs](#interface-validsignactionargs) |
50
- | [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [SyncChunk](#interface-syncchunk) | [ValidSignActionOptions](#interface-validsignactionoptions) |
51
- | [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [SyncError](#interface-syncerror) | [ValidWalletPayment](#interface-validwalletpayment) |
52
- | [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [SyncMap](#interface-syncmap) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
53
- | [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [TableCertificate](#interface-tablecertificate) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
54
- | [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [TableCertificateField](#interface-tablecertificatefield) | [WalletArgs](#interface-walletargs) |
55
- | [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [TableCertificateX](#interface-tablecertificatex) | [WalletBalance](#interface-walletbalance) |
56
- | [GetMerklePathResult](#interface-getmerklepathresult) | [TableCommission](#interface-tablecommission) | [WalletServices](#interface-walletservices) |
57
- | [GetRawTxResult](#interface-getrawtxresult) | [TableMonitorEvent](#interface-tablemonitorevent) | [WalletServicesOptions](#interface-walletservicesoptions) |
58
- | [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [TableOutput](#interface-tableoutput) | [WalletSigner](#interface-walletsigner) |
59
- | [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [TableOutputBasket](#interface-tableoutputbasket) | [WalletStorage](#interface-walletstorage) |
60
- | [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TableOutputTag](#interface-tableoutputtag) | [WalletStorageProvider](#interface-walletstorageprovider) |
61
- | [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableOutputTagMap](#interface-tableoutputtagmap) | [WalletStorageReader](#interface-walletstoragereader) |
62
- | [KeyPair](#interface-keypair) | [TableOutputX](#interface-tableoutputx) | [WalletStorageSync](#interface-walletstoragesync) |
63
- | [MonitorOptions](#interface-monitoroptions) | [TableProvenTx](#interface-tableproventx) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
64
- | [OutPoint](#interface-outpoint) | [TableProvenTxReq](#interface-tableproventxreq) | [WalletStorageWriter](#interface-walletstoragewriter) |
65
- | [Paged](#interface-paged) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
66
- | [PendingSignAction](#interface-pendingsignaction) | [TableSettings](#interface-tablesettings) | |
17
+ | [ArcConfig](#interface-arcconfig) | [PermissionRequest](#interface-permissionrequest) | [TableTxLabel](#interface-tabletxlabel) |
18
+ | [ArcMinerGetTxData](#interface-arcminergettxdata) | [PermissionToken](#interface-permissiontoken) | [TableTxLabelMap](#interface-tabletxlabelmap) |
19
+ | [AuthId](#interface-authid) | [PermissionsManagerConfig](#interface-permissionsmanagerconfig) | [TableUser](#interface-tableuser) |
20
+ | [AuthPayload](#interface-authpayload) | [PostBeefResult](#interface-postbeefresult) | [TaskPurgeParams](#interface-taskpurgeparams) |
21
+ | [BaseBlockHeader](#interface-baseblockheader) | [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TrustSettings](#interface-trustsettings) |
22
+ | [BitailsConfig](#interface-bitailsconfig) | [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TrxToken](#interface-trxtoken) |
23
+ | [BitailsMerkleProof](#interface-bitailsmerkleproof) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TscMerkleProofApi](#interface-tscmerkleproofapi) |
24
+ | [BlockHeader](#interface-blockheader) | [PostTxResultForTxid](#interface-posttxresultfortxid) | [TxScriptOffsets](#interface-txscriptoffsets) |
25
+ | [BsvExchangeRate](#interface-bsvexchangerate) | [PostTxResultForTxidError](#interface-posttxresultfortxiderror) | [UMPToken](#interface-umptoken) |
26
+ | [CertOpsWallet](#interface-certopswallet) | [PostTxsResult](#interface-posttxsresult) | [UMPTokenInteractor](#interface-umptokeninteractor) |
27
+ | [Certifier](#interface-certifier) | [ProcessSyncChunkResult](#interface-processsyncchunkresult) | [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs) |
28
+ | [CommitNewTxResults](#interface-commitnewtxresults) | [ProvenOrRawTx](#interface-provenorrawtx) | [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult) |
29
+ | [CompleteAuthResponse](#interface-completeauthresponse) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [ValidAbortActionArgs](#interface-validabortactionargs) |
30
+ | [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [ValidAcquireCertificateArgs](#interface-validacquirecertificateargs) |
31
+ | [EntityTimeStamp](#interface-entitytimestamp) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [ValidAcquireDirectCertificateArgs](#interface-validacquiredirectcertificateargs) |
32
+ | [ExchangeRatesIoApi](#interface-exchangeratesioapi) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [ValidAcquireIssuanceCertificateArgs](#interface-validacquireissuancecertificateargs) |
33
+ | [ExtendedVerifiableCertificate](#interface-extendedverifiablecertificate) | [PurgeParams](#interface-purgeparams) | [ValidBasketInsertion](#interface-validbasketinsertion) |
34
+ | [FiatExchangeRates](#interface-fiatexchangerates) | [PurgeResults](#interface-purgeresults) | [ValidCreateActionArgs](#interface-validcreateactionargs) |
35
+ | [FindCertificateFieldsArgs](#interface-findcertificatefieldsargs) | [RequestSyncChunkArgs](#interface-requestsyncchunkargs) | [ValidCreateActionInput](#interface-validcreateactioninput) |
36
+ | [FindCertificatesArgs](#interface-findcertificatesargs) | [ScriptTemplateParamsBRC29](#interface-scripttemplateparamsbrc29) | [ValidCreateActionOptions](#interface-validcreateactionoptions) |
37
+ | [FindCommissionsArgs](#interface-findcommissionsargs) | [ScriptTemplateUnlock](#interface-scripttemplateunlock) | [ValidCreateActionOutput](#interface-validcreateactionoutput) |
38
+ | [FindForUserSincePagedArgs](#interface-findforusersincepagedargs) | [StartAuthResponse](#interface-startauthresponse) | [ValidDiscoverByAttributesArgs](#interface-validdiscoverbyattributesargs) |
39
+ | [FindMonitorEventsArgs](#interface-findmonitoreventsargs) | [StorageCreateActionResult](#interface-storagecreateactionresult) | [ValidDiscoverByIdentityKeyArgs](#interface-validdiscoverbyidentitykeyargs) |
40
+ | [FindOutputBasketsArgs](#interface-findoutputbasketsargs) | [StorageCreateTransactionSdkInput](#interface-storagecreatetransactionsdkinput) | [ValidInternalizeActionArgs](#interface-validinternalizeactionargs) |
41
+ | [FindOutputTagMapsArgs](#interface-findoutputtagmapsargs) | [StorageCreateTransactionSdkOutput](#interface-storagecreatetransactionsdkoutput) | [ValidInternalizeOutput](#interface-validinternalizeoutput) |
42
+ | [FindOutputTagsArgs](#interface-findoutputtagsargs) | [StorageFeeModel](#interface-storagefeemodel) | [ValidListActionsArgs](#interface-validlistactionsargs) |
43
+ | [FindOutputsArgs](#interface-findoutputsargs) | [StorageGetBeefOptions](#interface-storagegetbeefoptions) | [ValidListCertificatesArgs](#interface-validlistcertificatesargs) |
44
+ | [FindPartialSincePagedArgs](#interface-findpartialsincepagedargs) | [StorageIdentity](#interface-storageidentity) | [ValidListOutputsArgs](#interface-validlistoutputsargs) |
45
+ | [FindProvenTxReqsArgs](#interface-findproventxreqsargs) | [StorageInternalizeActionResult](#interface-storageinternalizeactionresult) | [ValidProcessActionArgs](#interface-validprocessactionargs) |
46
+ | [FindProvenTxsArgs](#interface-findproventxsargs) | [StorageProcessActionArgs](#interface-storageprocessactionargs) | [ValidProcessActionOptions](#interface-validprocessactionoptions) |
47
+ | [FindSincePagedArgs](#interface-findsincepagedargs) | [StorageProcessActionResults](#interface-storageprocessactionresults) | [ValidProveCertificateArgs](#interface-validprovecertificateargs) |
48
+ | [FindSyncStatesArgs](#interface-findsyncstatesargs) | [StorageProvenOrReq](#interface-storageprovenorreq) | [ValidRelinquishCertificateArgs](#interface-validrelinquishcertificateargs) |
49
+ | [FindTransactionsArgs](#interface-findtransactionsargs) | [StorageProviderOptions](#interface-storageprovideroptions) | [ValidRelinquishOutputArgs](#interface-validrelinquishoutputargs) |
50
+ | [FindTxLabelMapsArgs](#interface-findtxlabelmapsargs) | [StorageReaderOptions](#interface-storagereaderoptions) | [ValidSignActionArgs](#interface-validsignactionargs) |
51
+ | [FindTxLabelsArgs](#interface-findtxlabelsargs) | [StorageReaderWriterOptions](#interface-storagereaderwriteroptions) | [ValidSignActionOptions](#interface-validsignactionoptions) |
52
+ | [FindUsersArgs](#interface-findusersargs) | [StorageSyncReaderOptions](#interface-storagesyncreaderoptions) | [ValidWalletPayment](#interface-validwalletpayment) |
53
+ | [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [SyncChunk](#interface-syncchunk) | [ValidWalletSignerArgs](#interface-validwalletsignerargs) |
54
+ | [GenerateChangeSdkChangeOutput](#interface-generatechangesdkchangeoutput) | [SyncError](#interface-syncerror) | [ValidateGenerateChangeSdkParamsResult](#interface-validategeneratechangesdkparamsresult) |
55
+ | [GenerateChangeSdkInput](#interface-generatechangesdkinput) | [SyncMap](#interface-syncmap) | [WalletArgs](#interface-walletargs) |
56
+ | [GenerateChangeSdkOutput](#interface-generatechangesdkoutput) | [TableCertificate](#interface-tablecertificate) | [WalletBalance](#interface-walletbalance) |
57
+ | [GenerateChangeSdkParams](#interface-generatechangesdkparams) | [TableCertificateField](#interface-tablecertificatefield) | [WalletPermissionsManagerCallbacks](#interface-walletpermissionsmanagercallbacks) |
58
+ | [GenerateChangeSdkResult](#interface-generatechangesdkresult) | [TableCertificateX](#interface-tablecertificatex) | [WalletServices](#interface-walletservices) |
59
+ | [GenerateChangeSdkStorageChange](#interface-generatechangesdkstoragechange) | [TableCommission](#interface-tablecommission) | [WalletServicesOptions](#interface-walletservicesoptions) |
60
+ | [GetMerklePathResult](#interface-getmerklepathresult) | [TableMonitorEvent](#interface-tablemonitorevent) | [WalletSettings](#interface-walletsettings) |
61
+ | [GetRawTxResult](#interface-getrawtxresult) | [TableOutput](#interface-tableoutput) | [WalletSettingsManagerConfig](#interface-walletsettingsmanagerconfig) |
62
+ | [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail) | [TableOutputBasket](#interface-tableoutputbasket) | [WalletSigner](#interface-walletsigner) |
63
+ | [GetReqsAndBeefResult](#interface-getreqsandbeefresult) | [TableOutputTag](#interface-tableoutputtag) | [WalletStorage](#interface-walletstorage) |
64
+ | [GetUtxoStatusDetails](#interface-getutxostatusdetails) | [TableOutputTagMap](#interface-tableoutputtagmap) | [WalletStorageProvider](#interface-walletstorageprovider) |
65
+ | [GetUtxoStatusResult](#interface-getutxostatusresult) | [TableOutputX](#interface-tableoutputx) | [WalletStorageReader](#interface-walletstoragereader) |
66
+ | [KeyPair](#interface-keypair) | [TableProvenTx](#interface-tableproventx) | [WalletStorageSync](#interface-walletstoragesync) |
67
+ | [MonitorOptions](#interface-monitoroptions) | [TableProvenTxReq](#interface-tableproventxreq) | [WalletStorageSyncReader](#interface-walletstoragesyncreader) |
68
+ | [OutPoint](#interface-outpoint) | [TableProvenTxReqDynamics](#interface-tableproventxreqdynamics) | [WalletStorageWriter](#interface-walletstoragewriter) |
69
+ | [Paged](#interface-paged) | [TableSettings](#interface-tablesettings) | [WalletTheme](#interface-wallettheme) |
70
+ | [PendingSignAction](#interface-pendingsignaction) | [TableSyncState](#interface-tablesyncstate) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
71
+ | [PendingStorageInput](#interface-pendingstorageinput) | [TableTransaction](#interface-tabletransaction) | |
67
72
 
68
73
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
69
74
 
@@ -167,6 +172,22 @@ export interface AuthId {
167
172
 
168
173
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
169
174
 
175
+ ---
176
+ ##### Interface: AuthPayload
177
+
178
+ AuthMethodInteractor
179
+
180
+ A base interface/class for client-side logic to interact with a server
181
+ for a specific Auth Method's flow (start, complete).
182
+
183
+ ```ts
184
+ export interface AuthPayload {
185
+ [key: string]: any;
186
+ }
187
+ ```
188
+
189
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
190
+
170
191
  ---
171
192
  ##### Interface: BaseBlockHeader
172
193
 
@@ -336,6 +357,22 @@ export interface CertOpsWallet {
336
357
 
337
358
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
338
359
 
360
+ ---
361
+ ##### Interface: Certifier
362
+
363
+ ```ts
364
+ export interface Certifier {
365
+ name: string;
366
+ description: string;
367
+ identityKey: PubKeyHex;
368
+ trust: number;
369
+ iconUrl?: string;
370
+ baseURL?: string;
371
+ }
372
+ ```
373
+
374
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
375
+
339
376
  ---
340
377
  ##### Interface: CommitNewTxResults
341
378
 
@@ -350,6 +387,19 @@ See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq)
350
387
 
351
388
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
352
389
 
390
+ ---
391
+ ##### Interface: CompleteAuthResponse
392
+
393
+ ```ts
394
+ export interface CompleteAuthResponse {
395
+ success: boolean;
396
+ message?: string;
397
+ presentationKey?: string;
398
+ }
399
+ ```
400
+
401
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
402
+
353
403
  ---
354
404
  ##### Interface: EntitySyncMap
355
405
 
@@ -420,6 +470,18 @@ export interface ExchangeRatesIoApi {
420
470
 
421
471
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
422
472
 
473
+ ---
474
+ ##### Interface: ExtendedVerifiableCertificate
475
+
476
+ ```ts
477
+ export interface ExtendedVerifiableCertificate extends IdentityCertificate {
478
+ certifierInfo: IdentityCertifier;
479
+ publiclyRevealedKeyring: Record<string, Base64String>;
480
+ }
481
+ ```
482
+
483
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
484
+
423
485
  ---
424
486
  ##### Interface: FiatExchangeRates
425
487
 
@@ -1194,6 +1256,411 @@ export interface PendingStorageInput {
1194
1256
 
1195
1257
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
1196
1258
 
1259
+ ---
1260
+ ##### Interface: PermissionRequest
1261
+
1262
+ Describes a single requested permission that the user must either grant or deny.
1263
+
1264
+ Four categories of permission are supported, each with a unique protocol:
1265
+ 1) protocol - "DPACP" (Domain Protocol Access Control Protocol)
1266
+ 2) basket - "DBAP" (Domain Basket Access Protocol)
1267
+ 3) certificate - "DCAP" (Domain Certificate Access Protocol)
1268
+ 4) spending - "DSAP" (Domain Spending Authorization Protocol)
1269
+
1270
+ This model underpins "requests" made to the user for permission, which the user can
1271
+ either grant or deny. The manager can then create on-chain tokens (PushDrop outputs)
1272
+ if permission is granted. Denying requests cause the underlying operation to throw,
1273
+ and no token is created. An "ephemeral" grant is also possible, denoting a one-time
1274
+ authorization without an associated persistent on-chain token.
1275
+
1276
+ ```ts
1277
+ export interface PermissionRequest {
1278
+ type: "protocol" | "basket" | "certificate" | "spending";
1279
+ originator: string;
1280
+ privileged?: boolean;
1281
+ protocolID?: [
1282
+ 0 | 1 | 2,
1283
+ string
1284
+ ];
1285
+ counterparty?: string;
1286
+ basket?: string;
1287
+ certificate?: {
1288
+ verifier: string;
1289
+ certType: string;
1290
+ fields: string[];
1291
+ };
1292
+ spending?: {
1293
+ satoshis: number;
1294
+ lineItems?: Array<{
1295
+ type: "input" | "output" | "fee";
1296
+ description: string;
1297
+ satoshis: number;
1298
+ }>;
1299
+ };
1300
+ reason?: string;
1301
+ renewal?: boolean;
1302
+ previousToken?: PermissionToken;
1303
+ }
1304
+ ```
1305
+
1306
+ See also: [PermissionToken](./client.md#interface-permissiontoken)
1307
+
1308
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
1309
+
1310
+ ---
1311
+ ##### Interface: PermissionToken
1312
+
1313
+ Data structure representing an on-chain permission token.
1314
+ It is typically stored as a single unspent PushDrop output in a special "internal" admin basket belonging to
1315
+ the user, held in their underlying wallet.
1316
+
1317
+ It can represent any of the four permission categories by having the relevant fields:
1318
+ - DPACP: originator, privileged, protocol, securityLevel, counterparty
1319
+ - DBAP: originator, basketName
1320
+ - DCAP: originator, privileged, verifier, certType, certFields
1321
+ - DSAP: originator, authorizedAmount
1322
+
1323
+ ```ts
1324
+ export interface PermissionToken {
1325
+ txid: string;
1326
+ outputIndex: number;
1327
+ outputScript: string;
1328
+ satoshis: number;
1329
+ originator: string;
1330
+ expiry: number;
1331
+ privileged?: boolean;
1332
+ protocol?: string;
1333
+ securityLevel?: 0 | 1 | 2;
1334
+ counterparty?: string;
1335
+ basketName?: string;
1336
+ certType?: string;
1337
+ certFields?: string[];
1338
+ verifier?: string;
1339
+ authorizedAmount?: number;
1340
+ }
1341
+ ```
1342
+
1343
+ ###### Property authorizedAmount
1344
+
1345
+ For DSAP, the maximum authorized spending for the month.
1346
+
1347
+ ```ts
1348
+ authorizedAmount?: number
1349
+ ```
1350
+
1351
+ ###### Property basketName
1352
+
1353
+ The name of a basket, if this is a DBAP token.
1354
+
1355
+ ```ts
1356
+ basketName?: string
1357
+ ```
1358
+
1359
+ ###### Property certFields
1360
+
1361
+ The certificate fields that this token covers, if DCAP token.
1362
+
1363
+ ```ts
1364
+ certFields?: string[]
1365
+ ```
1366
+
1367
+ ###### Property certType
1368
+
1369
+ The certificate type, if this is a DCAP token.
1370
+
1371
+ ```ts
1372
+ certType?: string
1373
+ ```
1374
+
1375
+ ###### Property counterparty
1376
+
1377
+ The counterparty, for DPACP.
1378
+
1379
+ ```ts
1380
+ counterparty?: string
1381
+ ```
1382
+
1383
+ ###### Property expiry
1384
+
1385
+ The expiration time for this token in UNIX epoch seconds. (0 or omitted for spending authorizations, which are indefinite)
1386
+
1387
+ ```ts
1388
+ expiry: number
1389
+ ```
1390
+
1391
+ ###### Property originator
1392
+
1393
+ The originator domain or FQDN that is allowed to use this permission.
1394
+
1395
+ ```ts
1396
+ originator: string
1397
+ ```
1398
+
1399
+ ###### Property outputIndex
1400
+
1401
+ The output index within that transaction.
1402
+
1403
+ ```ts
1404
+ outputIndex: number
1405
+ ```
1406
+
1407
+ ###### Property outputScript
1408
+
1409
+ The exact script hex for the locking script.
1410
+
1411
+ ```ts
1412
+ outputScript: string
1413
+ ```
1414
+
1415
+ ###### Property privileged
1416
+
1417
+ Whether this token grants privileged usage (for protocol or certificate).
1418
+
1419
+ ```ts
1420
+ privileged?: boolean
1421
+ ```
1422
+
1423
+ ###### Property protocol
1424
+
1425
+ The protocol name, if this is a DPACP token.
1426
+
1427
+ ```ts
1428
+ protocol?: string
1429
+ ```
1430
+
1431
+ ###### Property satoshis
1432
+
1433
+ The amount of satoshis assigned to the permission output (often 1).
1434
+
1435
+ ```ts
1436
+ satoshis: number
1437
+ ```
1438
+
1439
+ ###### Property securityLevel
1440
+
1441
+ The security level (0,1,2) for DPACP.
1442
+
1443
+ ```ts
1444
+ securityLevel?: 0 | 1 | 2
1445
+ ```
1446
+
1447
+ ###### Property txid
1448
+
1449
+ The transaction ID where this token resides.
1450
+
1451
+ ```ts
1452
+ txid: string
1453
+ ```
1454
+
1455
+ ###### Property verifier
1456
+
1457
+ The "verifier" public key string, if DCAP.
1458
+
1459
+ ```ts
1460
+ verifier?: string
1461
+ ```
1462
+
1463
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
1464
+
1465
+ ---
1466
+ ##### Interface: PermissionsManagerConfig
1467
+
1468
+ Configuration object for the WalletPermissionsManager. If a given option is `false`,
1469
+ the manager will skip or alter certain permission checks or behaviors.
1470
+
1471
+ By default, all of these are `true` unless specified otherwise. This is the most secure configuration.
1472
+
1473
+ ```ts
1474
+ export interface PermissionsManagerConfig {
1475
+ seekProtocolPermissionsForSigning?: boolean;
1476
+ seekProtocolPermissionsForEncrypting?: boolean;
1477
+ seekProtocolPermissionsForHMAC?: boolean;
1478
+ seekPermissionsForKeyLinkageRevelation?: boolean;
1479
+ seekPermissionsForPublicKeyRevelation?: boolean;
1480
+ seekPermissionsForIdentityKeyRevelation?: boolean;
1481
+ seekPermissionsForIdentityResolution?: boolean;
1482
+ seekBasketInsertionPermissions?: boolean;
1483
+ seekBasketRemovalPermissions?: boolean;
1484
+ seekBasketListingPermissions?: boolean;
1485
+ seekPermissionWhenApplyingActionLabels?: boolean;
1486
+ seekPermissionWhenListingActionsByLabel?: boolean;
1487
+ seekCertificateDisclosurePermissions?: boolean;
1488
+ seekCertificateAcquisitionPermissions?: boolean;
1489
+ seekCertificateRelinquishmentPermissions?: boolean;
1490
+ seekCertificateListingPermissions?: boolean;
1491
+ encryptWalletMetadata?: boolean;
1492
+ seekSpendingPermissions?: boolean;
1493
+ differentiatePrivilegedOperations?: boolean;
1494
+ }
1495
+ ```
1496
+
1497
+ ###### Property differentiatePrivilegedOperations
1498
+
1499
+ If false, permissions are checked without regard for whether we are in
1500
+ privileged mode. Privileged status is ignored with respect to whether
1501
+ permissions are granted. Internally, they are always sought and checked
1502
+ with privileged=false, regardless of the actual value.
1503
+
1504
+ ```ts
1505
+ differentiatePrivilegedOperations?: boolean
1506
+ ```
1507
+
1508
+ ###### Property encryptWalletMetadata
1509
+
1510
+ Should transaction descriptions, input descriptions, and output descriptions be encrypted
1511
+ when before they are passed to the underlying wallet, and transparently decrypted when retrieved?
1512
+
1513
+ ```ts
1514
+ encryptWalletMetadata?: boolean
1515
+ ```
1516
+
1517
+ ###### Property seekBasketInsertionPermissions
1518
+
1519
+ When we do internalizeAction with `basket insertion`, or include outputs in baskets
1520
+ with `createAction, do we ask for basket permission?
1521
+
1522
+ ```ts
1523
+ seekBasketInsertionPermissions?: boolean
1524
+ ```
1525
+
1526
+ ###### Property seekBasketListingPermissions
1527
+
1528
+ When listOutputs is called, do we ask for basket permission?
1529
+
1530
+ ```ts
1531
+ seekBasketListingPermissions?: boolean
1532
+ ```
1533
+
1534
+ ###### Property seekBasketRemovalPermissions
1535
+
1536
+ When relinquishOutput is called, do we ask for basket permission?
1537
+
1538
+ ```ts
1539
+ seekBasketRemovalPermissions?: boolean
1540
+ ```
1541
+
1542
+ ###### Property seekCertificateAcquisitionPermissions
1543
+
1544
+ If acquiring a certificate (acquireCertificate), do we require a permission check?
1545
+
1546
+ ```ts
1547
+ seekCertificateAcquisitionPermissions?: boolean
1548
+ ```
1549
+
1550
+ ###### Property seekCertificateDisclosurePermissions
1551
+
1552
+ If proving a certificate (proveCertificate) or revealing certificate fields,
1553
+ do we require a "certificate access" permission?
1554
+
1555
+ ```ts
1556
+ seekCertificateDisclosurePermissions?: boolean
1557
+ ```
1558
+
1559
+ ###### Property seekCertificateListingPermissions
1560
+
1561
+ If listing a user's certificates (listCertificates), do we require a permission check?
1562
+
1563
+ ```ts
1564
+ seekCertificateListingPermissions?: boolean
1565
+ ```
1566
+
1567
+ ###### Property seekCertificateRelinquishmentPermissions
1568
+
1569
+ If relinquishing a certificate (relinquishCertificate), do we require a permission check?
1570
+
1571
+ ```ts
1572
+ seekCertificateRelinquishmentPermissions?: boolean
1573
+ ```
1574
+
1575
+ ###### Property seekPermissionWhenApplyingActionLabels
1576
+
1577
+ When createAction is called with labels, do we ask for "label usage" permission?
1578
+
1579
+ ```ts
1580
+ seekPermissionWhenApplyingActionLabels?: boolean
1581
+ ```
1582
+
1583
+ ###### Property seekPermissionWhenListingActionsByLabel
1584
+
1585
+ When listActions is called with labels, do we ask for "label usage" permission?
1586
+
1587
+ ```ts
1588
+ seekPermissionWhenListingActionsByLabel?: boolean
1589
+ ```
1590
+
1591
+ ###### Property seekPermissionsForIdentityKeyRevelation
1592
+
1593
+ If getPublicKey is requested with `identityKey=true`, do we require permission?
1594
+
1595
+ ```ts
1596
+ seekPermissionsForIdentityKeyRevelation?: boolean
1597
+ ```
1598
+
1599
+ ###### Property seekPermissionsForIdentityResolution
1600
+
1601
+ If discoverByIdentityKey / discoverByAttributes are called, do we require permission
1602
+ for "identity resolution" usage?
1603
+
1604
+ ```ts
1605
+ seekPermissionsForIdentityResolution?: boolean
1606
+ ```
1607
+
1608
+ ###### Property seekPermissionsForKeyLinkageRevelation
1609
+
1610
+ For revealing counterparty-level or specific key linkage revelation information,
1611
+ should we require permission?
1612
+
1613
+ ```ts
1614
+ seekPermissionsForKeyLinkageRevelation?: boolean
1615
+ ```
1616
+
1617
+ ###### Property seekPermissionsForPublicKeyRevelation
1618
+
1619
+ For revealing any user public key (getPublicKey) **other** than the identity key,
1620
+ should we require permission?
1621
+
1622
+ ```ts
1623
+ seekPermissionsForPublicKeyRevelation?: boolean
1624
+ ```
1625
+
1626
+ ###### Property seekProtocolPermissionsForEncrypting
1627
+
1628
+ For methods that perform encryption (encrypt/decrypt), require
1629
+ a "protocol usage" permission check?
1630
+
1631
+ ```ts
1632
+ seekProtocolPermissionsForEncrypting?: boolean
1633
+ ```
1634
+
1635
+ ###### Property seekProtocolPermissionsForHMAC
1636
+
1637
+ For methods that perform HMAC creation or verification (createHmac, verifyHmac),
1638
+ require a "protocol usage" permission check?
1639
+
1640
+ ```ts
1641
+ seekProtocolPermissionsForHMAC?: boolean
1642
+ ```
1643
+
1644
+ ###### Property seekProtocolPermissionsForSigning
1645
+
1646
+ For `createSignature` and `verifySignature`,
1647
+ require a "protocol usage" permission check?
1648
+
1649
+ ```ts
1650
+ seekProtocolPermissionsForSigning?: boolean
1651
+ ```
1652
+
1653
+ ###### Property seekSpendingPermissions
1654
+
1655
+ If the originator tries to spend wallet funds (netSpent > 0 in createAction),
1656
+ do we seek spending authorization?
1657
+
1658
+ ```ts
1659
+ seekSpendingPermissions?: boolean
1660
+ ```
1661
+
1662
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
1663
+
1197
1664
  ---
1198
1665
  ##### Interface: PostBeefResult
1199
1666
 
@@ -1656,6 +2123,19 @@ export interface ScriptTemplateUnlock {
1656
2123
 
1657
2124
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
1658
2125
 
2126
+ ---
2127
+ ##### Interface: StartAuthResponse
2128
+
2129
+ ```ts
2130
+ export interface StartAuthResponse {
2131
+ success: boolean;
2132
+ message?: string;
2133
+ data?: any;
2134
+ }
2135
+ ```
2136
+
2137
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
2138
+
1659
2139
  ---
1660
2140
  ##### Interface: StorageCreateActionResult
1661
2141
 
@@ -2659,6 +3139,20 @@ See also: [PurgeParams](./client.md#interface-purgeparams)
2659
3139
 
2660
3140
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
2661
3141
 
3142
+ ---
3143
+ ##### Interface: TrustSettings
3144
+
3145
+ ```ts
3146
+ export interface TrustSettings {
3147
+ trustLevel: number;
3148
+ trustedCertifiers: Certifier[];
3149
+ }
3150
+ ```
3151
+
3152
+ See also: [Certifier](./client.md#interface-certifier)
3153
+
3154
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3155
+
2662
3156
  ---
2663
3157
  ##### Interface: TrxToken
2664
3158
 
@@ -2704,6 +3198,172 @@ export interface TxScriptOffsets {
2704
3198
 
2705
3199
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
2706
3200
 
3201
+ ---
3202
+ ##### Interface: UMPToken
3203
+
3204
+ Describes the structure of a User Management Protocol (UMP) token.
3205
+
3206
+ ```ts
3207
+ export interface UMPToken {
3208
+ passwordPresentationPrimary: number[];
3209
+ passwordRecoveryPrimary: number[];
3210
+ presentationRecoveryPrimary: number[];
3211
+ passwordPrimaryPrivileged: number[];
3212
+ presentationRecoveryPrivileged: number[];
3213
+ presentationHash: number[];
3214
+ passwordSalt: number[];
3215
+ recoveryHash: number[];
3216
+ presentationKeyEncrypted: number[];
3217
+ recoveryKeyEncrypted: number[];
3218
+ passwordKeyEncrypted: number[];
3219
+ currentOutpoint?: OutpointString;
3220
+ }
3221
+ ```
3222
+
3223
+ ###### Property currentOutpoint
3224
+
3225
+ Describes the token's location on-chain, if it's already been published.
3226
+
3227
+ ```ts
3228
+ currentOutpoint?: OutpointString
3229
+ ```
3230
+
3231
+ ###### Property passwordKeyEncrypted
3232
+
3233
+ A copy of the password key encrypted with the privileged key.
3234
+
3235
+ ```ts
3236
+ passwordKeyEncrypted: number[]
3237
+ ```
3238
+
3239
+ ###### Property passwordPresentationPrimary
3240
+
3241
+ Primary key encrypted by the XOR of the password and presentation keys.
3242
+
3243
+ ```ts
3244
+ passwordPresentationPrimary: number[]
3245
+ ```
3246
+
3247
+ ###### Property passwordPrimaryPrivileged
3248
+
3249
+ Privileged key encrypted by the XOR of the password and primary keys.
3250
+
3251
+ ```ts
3252
+ passwordPrimaryPrivileged: number[]
3253
+ ```
3254
+
3255
+ ###### Property passwordRecoveryPrimary
3256
+
3257
+ Primary key encrypted by the XOR of the password and recovery keys.
3258
+
3259
+ ```ts
3260
+ passwordRecoveryPrimary: number[]
3261
+ ```
3262
+
3263
+ ###### Property passwordSalt
3264
+
3265
+ PBKDF2 salt used in conjunction with the password to derive the password key.
3266
+
3267
+ ```ts
3268
+ passwordSalt: number[]
3269
+ ```
3270
+
3271
+ ###### Property presentationHash
3272
+
3273
+ Hash of the presentation key.
3274
+
3275
+ ```ts
3276
+ presentationHash: number[]
3277
+ ```
3278
+
3279
+ ###### Property presentationKeyEncrypted
3280
+
3281
+ A copy of the presentation key encrypted with the privileged key.
3282
+
3283
+ ```ts
3284
+ presentationKeyEncrypted: number[]
3285
+ ```
3286
+
3287
+ ###### Property presentationRecoveryPrimary
3288
+
3289
+ Primary key encrypted by the XOR of the presentation and recovery keys.
3290
+
3291
+ ```ts
3292
+ presentationRecoveryPrimary: number[]
3293
+ ```
3294
+
3295
+ ###### Property presentationRecoveryPrivileged
3296
+
3297
+ Privileged key encrypted by the XOR of the presentation and recovery keys.
3298
+
3299
+ ```ts
3300
+ presentationRecoveryPrivileged: number[]
3301
+ ```
3302
+
3303
+ ###### Property recoveryHash
3304
+
3305
+ Hash of the recovery key.
3306
+
3307
+ ```ts
3308
+ recoveryHash: number[]
3309
+ ```
3310
+
3311
+ ###### Property recoveryKeyEncrypted
3312
+
3313
+ A copy of the recovery key encrypted with the privileged key.
3314
+
3315
+ ```ts
3316
+ recoveryKeyEncrypted: number[]
3317
+ ```
3318
+
3319
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3320
+
3321
+ ---
3322
+ ##### Interface: UMPTokenInteractor
3323
+
3324
+ Describes a system capable of finding and updating UMP tokens on the blockchain.
3325
+
3326
+ ```ts
3327
+ export interface UMPTokenInteractor {
3328
+ findByPresentationKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
3329
+ findByRecoveryKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
3330
+ buildAndSend: (wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken) => Promise<OutpointString>;
3331
+ }
3332
+ ```
3333
+
3334
+ See also: [UMPToken](./client.md#interface-umptoken)
3335
+
3336
+ ###### Property buildAndSend
3337
+
3338
+ Creates (and optionally consumes the previous version of) a UMP token on-chain.
3339
+
3340
+ ```ts
3341
+ buildAndSend: (wallet: WalletInterface, adminOriginator: OriginatorDomainNameStringUnder250Bytes, token: UMPToken, oldTokenToConsume?: UMPToken) => Promise<OutpointString>
3342
+ ```
3343
+ See also: [UMPToken](./client.md#interface-umptoken)
3344
+
3345
+ ###### Property findByPresentationKeyHash
3346
+
3347
+ Locates the latest valid copy of a UMP token (including its outpoint)
3348
+ based on the presentation key hash.
3349
+
3350
+ ```ts
3351
+ findByPresentationKeyHash: (hash: number[]) => Promise<UMPToken | undefined>
3352
+ ```
3353
+ See also: [UMPToken](./client.md#interface-umptoken)
3354
+
3355
+ ###### Property findByRecoveryKeyHash
3356
+
3357
+ Locates the latest valid copy of a UMP token (including its outpoint)
3358
+ based on the recovery key hash.
3359
+
3360
+ ```ts
3361
+ findByRecoveryKeyHash: (hash: number[]) => Promise<UMPToken | undefined>
3362
+ ```
3363
+ See also: [UMPToken](./client.md#interface-umptoken)
3364
+
3365
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3366
+
2707
3367
  ---
2708
3368
  ##### Interface: UpdateProvenTxReqWithNewProvenTxArgs
2709
3369
 
@@ -3234,10 +3894,12 @@ export interface WalletArgs {
3234
3894
  services?: sdk.WalletServices;
3235
3895
  monitor?: Monitor;
3236
3896
  privilegedKeyManager?: sdk.PrivilegedKeyManager;
3897
+ settingsManager?: WalletSettingsManager;
3898
+ lookupResolver?: LookupResolver;
3237
3899
  }
3238
3900
  ```
3239
3901
 
3240
- 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)
3902
+ 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)
3241
3903
 
3242
3904
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3243
3905
 
@@ -3256,6 +3918,25 @@ export interface WalletBalance {
3256
3918
 
3257
3919
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3258
3920
 
3921
+ ---
3922
+ ##### Interface: WalletPermissionsManagerCallbacks
3923
+
3924
+ The set of callbacks that external code can bind to, e.g. to display UI prompts or logs
3925
+ when a permission is requested.
3926
+
3927
+ ```ts
3928
+ export interface WalletPermissionsManagerCallbacks {
3929
+ onProtocolPermissionRequested?: PermissionEventHandler[];
3930
+ onBasketAccessRequested?: PermissionEventHandler[];
3931
+ onCertificateAccessRequested?: PermissionEventHandler[];
3932
+ onSpendingAuthorizationRequested?: PermissionEventHandler[];
3933
+ }
3934
+ ```
3935
+
3936
+ See also: [PermissionEventHandler](./client.md#type-permissioneventhandler)
3937
+
3938
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3939
+
3259
3940
  ---
3260
3941
  ##### Interface: WalletServices
3261
3942
 
@@ -3482,6 +4163,34 @@ See also: [ArcConfig](./services.md#interface-arcconfig), [BsvExchangeRate](./cl
3482
4163
 
3483
4164
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3484
4165
 
4166
+ ---
4167
+ ##### Interface: WalletSettings
4168
+
4169
+ ```ts
4170
+ export interface WalletSettings {
4171
+ trustSettings: TrustSettings;
4172
+ theme?: WalletTheme;
4173
+ currency?: string;
4174
+ }
4175
+ ```
4176
+
4177
+ See also: [TrustSettings](./client.md#interface-trustsettings), [WalletTheme](./client.md#interface-wallettheme)
4178
+
4179
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4180
+
4181
+ ---
4182
+ ##### Interface: WalletSettingsManagerConfig
4183
+
4184
+ ```ts
4185
+ export interface WalletSettingsManagerConfig {
4186
+ defaultSettings: WalletSettings;
4187
+ }
4188
+ ```
4189
+
4190
+ See also: [WalletSettings](./client.md#interface-walletsettings)
4191
+
4192
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4193
+
3485
4194
  ---
3486
4195
  ##### Interface: WalletSigner
3487
4196
 
@@ -3671,6 +4380,17 @@ See also: [AuthId](./client.md#interface-authid), [StorageCreateActionResult](./
3671
4380
 
3672
4381
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3673
4382
 
4383
+ ---
4384
+ ##### Interface: WalletTheme
4385
+
4386
+ ```ts
4387
+ export interface WalletTheme {
4388
+ mode: string;
4389
+ }
4390
+ ```
4391
+
4392
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4393
+
3674
4394
  ---
3675
4395
  ##### Interface: XValidCreateActionOutput
3676
4396
 
@@ -3693,25 +4413,28 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
3693
4413
 
3694
4414
  | | | |
3695
4415
  | --- | --- | --- |
3696
- | [ARC](#class-arc) | [Monitor](#class-monitor) | [WERR_BAD_REQUEST](#class-werr_bad_request) |
3697
- | [Bitails](#class-bitails) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
3698
- | [CertOps](#class-certops) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
3699
- | [EntityBase](#class-entitybase) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_INTERNAL](#class-werr_internal) |
3700
- | [EntityCertificate](#class-entitycertificate) | [ServiceCollection](#class-servicecollection) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
3701
- | [EntityCertificateField](#class-entitycertificatefield) | [Services](#class-services) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
3702
- | [EntityCommission](#class-entitycommission) | [StorageClient](#class-storageclient) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
3703
- | [EntityOutput](#class-entityoutput) | [StorageProvider](#class-storageprovider) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
3704
- | [EntityOutputBasket](#class-entityoutputbasket) | [StorageReader](#class-storagereader) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
3705
- | [EntityOutputTag](#class-entityoutputtag) | [StorageReaderWriter](#class-storagereaderwriter) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
3706
- | [EntityOutputTagMap](#class-entityoutputtagmap) | [StorageSyncReader](#class-storagesyncreader) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
3707
- | [EntityProvenTx](#class-entityproventx) | [TaskCheckForProofs](#class-taskcheckforproofs) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
3708
- | [EntityProvenTxReq](#class-entityproventxreq) | [TaskClock](#class-taskclock) | [Wallet](#class-wallet) |
4416
+ | [ARC](#class-arc) | [PersonaIDInteractor](#class-personaidinteractor) | [WERR_BAD_REQUEST](#class-werr_bad_request) |
4417
+ | [AuthMethodInteractor](#class-authmethodinteractor) | [PrivilegedKeyManager](#class-privilegedkeymanager) | [WERR_BROADCAST_UNAVAILABLE](#class-werr_broadcast_unavailable) |
4418
+ | [Bitails](#class-bitails) | [ScriptTemplateBRC29](#class-scripttemplatebrc29) | [WERR_INSUFFICIENT_FUNDS](#class-werr_insufficient_funds) |
4419
+ | [CWIStyleWalletManager](#class-cwistylewalletmanager) | [SdkWhatsOnChain](#class-sdkwhatsonchain) | [WERR_INTERNAL](#class-werr_internal) |
4420
+ | [EntityBase](#class-entitybase) | [ServiceCollection](#class-servicecollection) | [WERR_INVALID_OPERATION](#class-werr_invalid_operation) |
4421
+ | [EntityCertificate](#class-entitycertificate) | [Services](#class-services) | [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter) |
4422
+ | [EntityCertificateField](#class-entitycertificatefield) | [SimpleWalletManager](#class-simplewalletmanager) | [WERR_INVALID_PUBLIC_KEY](#class-werr_invalid_public_key) |
4423
+ | [EntityCommission](#class-entitycommission) | [StorageClient](#class-storageclient) | [WERR_MISSING_PARAMETER](#class-werr_missing_parameter) |
4424
+ | [EntityOutput](#class-entityoutput) | [StorageProvider](#class-storageprovider) | [WERR_NETWORK_CHAIN](#class-werr_network_chain) |
4425
+ | [EntityOutputBasket](#class-entityoutputbasket) | [StorageReader](#class-storagereader) | [WERR_NOT_ACTIVE](#class-werr_not_active) |
4426
+ | [EntityOutputTag](#class-entityoutputtag) | [StorageReaderWriter](#class-storagereaderwriter) | [WERR_NOT_IMPLEMENTED](#class-werr_not_implemented) |
4427
+ | [EntityOutputTagMap](#class-entityoutputtagmap) | [StorageSyncReader](#class-storagesyncreader) | [WERR_UNAUTHORIZED](#class-werr_unauthorized) |
4428
+ | [EntityProvenTx](#class-entityproventx) | [TaskCheckForProofs](#class-taskcheckforproofs) | [Wallet](#class-wallet) |
4429
+ | [EntityProvenTxReq](#class-entityproventxreq) | [TaskClock](#class-taskclock) | [WalletAuthenticationManager](#class-walletauthenticationmanager) |
3709
4430
  | [EntitySyncState](#class-entitysyncstate) | [TaskFailAbandoned](#class-taskfailabandoned) | [WalletError](#class-walleterror) |
3710
4431
  | [EntityTransaction](#class-entitytransaction) | [TaskNewHeader](#class-tasknewheader) | [WalletMonitorTask](#class-walletmonitortask) |
3711
- | [EntityTxLabel](#class-entitytxlabel) | [TaskPurge](#class-taskpurge) | [WalletSigner](#class-walletsigner) |
3712
- | [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskReviewStatus](#class-taskreviewstatus) | [WalletStorageManager](#class-walletstoragemanager) |
3713
- | [EntityUser](#class-entityuser) | [TaskSendWaiting](#class-tasksendwaiting) | [WhatsOnChain](#class-whatsonchain) |
3714
- | [MergeEntity](#class-mergeentity) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) | |
4432
+ | [EntityTxLabel](#class-entitytxlabel) | [TaskPurge](#class-taskpurge) | [WalletPermissionsManager](#class-walletpermissionsmanager) |
4433
+ | [EntityTxLabelMap](#class-entitytxlabelmap) | [TaskReviewStatus](#class-taskreviewstatus) | [WalletSettingsManager](#class-walletsettingsmanager) |
4434
+ | [EntityUser](#class-entityuser) | [TaskSendWaiting](#class-tasksendwaiting) | [WalletSigner](#class-walletsigner) |
4435
+ | [MergeEntity](#class-mergeentity) | [TaskSyncWhenIdle](#class-tasksyncwhenidle) | [WalletStorageManager](#class-walletstoragemanager) |
4436
+ | [Monitor](#class-monitor) | [TwilioPhoneInteractor](#class-twiliophoneinteractor) | [WhatsOnChain](#class-whatsonchain) |
4437
+ | [OverlayUMPTokenInteractor](#class-overlayumptokeninteractor) | [WABClient](#class-wabclient) | |
3715
4438
 
3716
4439
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3717
4440
 
@@ -3809,6 +4532,41 @@ See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
3809
4532
 
3810
4533
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3811
4534
 
4535
+ ---
4536
+ ##### Class: AuthMethodInteractor
4537
+
4538
+ Abstract client-side interactor for an Auth Method
4539
+
4540
+ ```ts
4541
+ export abstract class AuthMethodInteractor {
4542
+ public abstract methodType: string;
4543
+ public abstract startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>;
4544
+ public abstract completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>;
4545
+ }
4546
+ ```
4547
+
4548
+ See also: [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse), [StartAuthResponse](./client.md#interface-startauthresponse)
4549
+
4550
+ ###### Method completeAuth
4551
+
4552
+ Complete the flow (e.g. confirm OTP).
4553
+
4554
+ ```ts
4555
+ public abstract completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>
4556
+ ```
4557
+ See also: [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse)
4558
+
4559
+ ###### Method startAuth
4560
+
4561
+ Start the flow (e.g. request an OTP or create a session).
4562
+
4563
+ ```ts
4564
+ public abstract startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>
4565
+ ```
4566
+ See also: [AuthPayload](./client.md#interface-authpayload), [StartAuthResponse](./client.md#interface-startauthresponse)
4567
+
4568
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4569
+
3812
4570
  ---
3813
4571
  ##### Class: Bitails
3814
4572
 
@@ -3854,89 +4612,279 @@ Argument Details
3854
4612
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3855
4613
 
3856
4614
  ---
3857
- ##### Class: CertOps
4615
+ ##### Class: CWIStyleWalletManager
4616
+
4617
+ Manages a "CWI-style" wallet that uses a UMP token and a
4618
+ multi-key authentication scheme (password, presentation key, and recovery key).
4619
+
4620
+ ```ts
4621
+ export class CWIStyleWalletManager implements WalletInterface {
4622
+ authenticated: boolean;
4623
+ authenticationMode: "presentation-key-and-password" | "presentation-key-and-recovery-key" | "recovery-key-and-password" = "presentation-key-and-password";
4624
+ authenticationFlow: "new-user" | "existing-user" = "new-user";
4625
+ 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[])
4626
+ async providePresentationKey(key: number[]): Promise<void>
4627
+ async providePassword(password: string): Promise<void>
4628
+ async provideRecoveryKey(recoveryKey: number[]): Promise<void>
4629
+ saveSnapshot(): number[]
4630
+ async loadSnapshot(snapshot: number[]): Promise<void>
4631
+ destroy(): void
4632
+ async changePassword(newPassword: string): Promise<void>
4633
+ async getRecoveryKey(): Promise<number[]>
4634
+ async changeRecoveryKey(): Promise<void>
4635
+ async changePresentationKey(presentationKey: number[]): Promise<void>
4636
+ async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
4637
+ async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
4638
+ async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
4639
+ async encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
4640
+ async decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
4641
+ async createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
4642
+ async verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
4643
+ async createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
4644
+ async verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
4645
+ async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
4646
+ async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
4647
+ async abortAction(args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AbortActionResult>
4648
+ async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
4649
+ async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<InternalizeActionResult>
4650
+ async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
4651
+ async relinquishOutput(args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishOutputResult>
4652
+ async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
4653
+ async listCertificates(args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
4654
+ async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
4655
+ async relinquishCertificate(args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishCertificateResult>
4656
+ async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
4657
+ async discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
4658
+ async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
4659
+ async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
4660
+ async getHeight(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeightResult>
4661
+ async getHeaderForHeight(args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeaderResult>
4662
+ async getNetwork(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetNetworkResult>
4663
+ async getVersion(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetVersionResult>
4664
+ }
4665
+ ```
4666
+
4667
+ 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)
4668
+
4669
+ ###### Constructor
4670
+
4671
+ Constructs a new CWIStyleWalletManager.
3858
4672
 
3859
4673
  ```ts
3860
- export class CertOps extends BsvCertificate {
3861
- _keyring?: Record<CertificateFieldNameUnder50Bytes, string>;
3862
- _encryptedFields?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3863
- _decryptedFields?: Record<CertificateFieldNameUnder50Bytes, string>;
3864
- constructor(public wallet: CertOpsWallet, wc: WalletCertificate)
3865
- static async fromCounterparty(wallet: CertOpsWallet, e: {
3866
- certificate: WalletCertificate;
3867
- keyring: Record<CertificateFieldNameUnder50Bytes, string>;
3868
- counterparty: PubKeyHex;
3869
- }): Promise<CertOps>
3870
- static async fromCertifier(wallet: CertOpsWallet, e: {
3871
- certificate: WalletCertificate;
3872
- keyring: Record<CertificateFieldNameUnder50Bytes, string>;
3873
- }): Promise<CertOps>
3874
- static async fromEncrypted(wallet: CertOpsWallet, wc: WalletCertificate, keyring: Record<CertificateFieldNameUnder50Bytes, string>): Promise<CertOps>
3875
- static async fromDecrypted(wallet: CertOpsWallet, wc: WalletCertificate): Promise<CertOps>
3876
- static copyFields<T>(fields: Record<CertificateFieldNameUnder50Bytes, T>): Record<CertificateFieldNameUnder50Bytes, T>
3877
- static getProtocolForCertificateFieldEncryption(serialNumber: string, fieldName: string): {
3878
- protocolID: WalletProtocol;
3879
- keyID: string;
3880
- }
3881
- exportForSubject(): {
3882
- certificate: WalletCertificate;
3883
- keyring: Record<CertificateFieldNameUnder50Bytes, string>;
3884
- }
3885
- toWalletCertificate(): WalletCertificate
3886
- async encryptFields(counterparty: "self" | PubKeyHex = "self"): Promise<{
3887
- fields: Record<CertificateFieldNameUnder50Bytes, string>;
3888
- keyring: Record<CertificateFieldNameUnder50Bytes, string>;
3889
- }>
3890
- async decryptFields(counterparty?: PubKeyHex, keyring?: Record<CertificateFieldNameUnder50Bytes, string>): Promise<Record<CertificateFieldNameUnder50Bytes, string>>
3891
- async exportForCounterparty(counterparty: PubKeyHex, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<{
3892
- certificate: WalletCertificate;
3893
- keyring: Record<CertificateFieldNameUnder50Bytes, string>;
3894
- counterparty: PubKeyHex;
3895
- }>
3896
- async createKeyringForVerifier(verifierIdentityKey: PubKeyHex, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<Record<CertificateFieldNameUnder50Bytes, Base64String>>
3897
- async encryptAndSignNewCertificate(): Promise<void>
3898
- }
4674
+ 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[])
3899
4675
  ```
4676
+ See also: [OverlayUMPTokenInteractor](./client.md#class-overlayumptokeninteractor), [PrivilegedKeyManager](./client.md#class-privilegedkeymanager), [UMPTokenInteractor](./client.md#interface-umptokeninteractor)
3900
4677
 
3901
- See also: [CertOpsWallet](./client.md#interface-certopswallet)
4678
+ Argument Details
4679
+
4680
+ + **adminOriginator**
4681
+ + The domain name of the administrative originator.
4682
+ + **walletBuilder**
4683
+ + A function that can build an underlying wallet instance
4684
+ from a primary key and a privileged key manager
4685
+ + **interactor**
4686
+ + An instance of UMPTokenInteractor capable of managing UMP tokens.
4687
+ + **recoveryKeySaver**
4688
+ + A function that can persist or display a newly generated recovery key.
4689
+ + **passwordRetriever**
4690
+ + A function to request the user's password, given a reason and a test function.
4691
+ + **newWalletFunder**
4692
+ + An optional function called with the presentation key and a new Wallet post-construction to fund it before use.
4693
+ + **stateSnapshot**
4694
+ + If provided, a previously saved snapshot of the wallet's state.
3902
4695
 
3903
- ###### Method createKeyringForVerifier
4696
+ ###### Property authenticated
3904
4697
 
3905
- Creates a verifiable certificate structure for a specific verifier, allowing them access to specified fields.
3906
- This method decrypts the master field keys for each field specified in `fieldsToReveal` and re-encrypts them
3907
- for the verifier's identity key. The resulting certificate structure includes only the fields intended to be
3908
- revealed and a verifier-specific keyring for field decryption.
4698
+ Whether the user is currently authenticated.
3909
4699
 
3910
4700
  ```ts
3911
- async createKeyringForVerifier(verifierIdentityKey: PubKeyHex, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<Record<CertificateFieldNameUnder50Bytes, Base64String>>
4701
+ authenticated: boolean
3912
4702
  ```
3913
4703
 
3914
- Returns
4704
+ ###### Property authenticationFlow
4705
+
4706
+ Indicates whether this is a new user or an existing user flow:
4707
+ - 'new-user'
4708
+ - 'existing-user'
4709
+
4710
+ ```ts
4711
+ authenticationFlow: "new-user" | "existing-user" = "new-user"
4712
+ ```
4713
+
4714
+ ###### Property authenticationMode
4715
+
4716
+ The current mode of authentication:
4717
+ - 'presentation-key-and-password'
4718
+ - 'presentation-key-and-recovery-key'
4719
+ - 'recovery-key-and-password'
4720
+
4721
+ ```ts
4722
+ authenticationMode: "presentation-key-and-password" | "presentation-key-and-recovery-key" | "recovery-key-and-password" = "presentation-key-and-password"
4723
+ ```
4724
+
4725
+ ###### Method changePassword
4726
+
4727
+ Changes the user's password, re-wrapping the primary and privileged keys with the new password factor.
4728
+
4729
+ ```ts
4730
+ async changePassword(newPassword: string): Promise<void>
4731
+ ```
4732
+
4733
+ Argument Details
4734
+
4735
+ + **newPassword**
4736
+ + The user's new password as a string.
4737
+
4738
+ Throws
4739
+
4740
+ If the user is not authenticated, or if underlying token references are missing.
4741
+
4742
+ ###### Method changePresentationKey
4743
+
4744
+ Changes the user's presentation key.
4745
+
4746
+ ```ts
4747
+ async changePresentationKey(presentationKey: number[]): Promise<void>
4748
+ ```
4749
+
4750
+ Argument Details
4751
+
4752
+ + **presentationKey**
4753
+ + The new presentation key (32 bytes).
4754
+
4755
+ Throws
4756
+
4757
+ If the user is not authenticated, or if underlying token references are missing.
4758
+
4759
+ ###### Method changeRecoveryKey
4760
+
4761
+ Changes the user's recovery key, prompting the user to save the new key.
4762
+
4763
+ ```ts
4764
+ async changeRecoveryKey(): Promise<void>
4765
+ ```
4766
+
4767
+ Throws
4768
+
4769
+ If the user is not authenticated, or if underlying token references are missing.
3915
4770
 
3916
- - A new certificate structure containing the original encrypted fields, the verifier-specific field decryption keyring, and essential certificate metadata.
4771
+ ###### Method destroy
4772
+
4773
+ Destroys the underlying wallet, returning to a default state
4774
+
4775
+ ```ts
4776
+ destroy(): void
4777
+ ```
4778
+
4779
+ ###### Method getRecoveryKey
4780
+
4781
+ Retrieves the current recovery key.
4782
+
4783
+ ```ts
4784
+ async getRecoveryKey(): Promise<number[]>
4785
+ ```
4786
+
4787
+ Throws
4788
+
4789
+ If the user is not authenticated, or if underlying token references are missing.
4790
+
4791
+ ###### Method loadSnapshot
4792
+
4793
+ Loads a previously saved state snapshot (e.g. from `saveSnapshot`).
4794
+ Upon success, the wallet becomes authenticated without needing to re-enter keys.
4795
+
4796
+ ```ts
4797
+ async loadSnapshot(snapshot: number[]): Promise<void>
4798
+ ```
4799
+
4800
+ Argument Details
4801
+
4802
+ + **snapshot**
4803
+ + An array of bytes that was previously produced by `saveSnapshot`.
4804
+
4805
+ Throws
4806
+
4807
+ If the snapshot format is invalid or decryption fails.
4808
+
4809
+ ###### Method providePassword
4810
+
4811
+ Provides the password in an authentication mode that requires it.
4812
+
4813
+ - **Existing user**:
4814
+ Decrypts the primary key using the provided password (and either the presentation key or recovery key, depending on the mode).
4815
+ Then builds the underlying wallet, marking the user as authenticated.
4816
+
4817
+ - **New user**:
4818
+ Generates a new UMP token with fresh keys (primary, privileged, recovery). Publishes it on-chain and builds the wallet.
4819
+
4820
+ ```ts
4821
+ async providePassword(password: string): Promise<void>
4822
+ ```
4823
+
4824
+ Argument Details
4825
+
4826
+ + **password**
4827
+ + The user's password as a string.
4828
+
4829
+ Throws
4830
+
4831
+ If the user is already authenticated, if the mode does not use a password, or if required keys are missing.
4832
+
4833
+ ###### Method providePresentationKey
4834
+
4835
+ Provides the presentation key in an authentication mode that requires it.
4836
+ If a UMP token is found based on the key's hash, this is an existing-user flow.
4837
+ Otherwise, it is treated as a new-user flow.
4838
+
4839
+ ```ts
4840
+ async providePresentationKey(key: number[]): Promise<void>
4841
+ ```
4842
+
4843
+ Argument Details
4844
+
4845
+ + **key**
4846
+ + The user's presentation key (32 bytes).
4847
+
4848
+ Throws
4849
+
4850
+ if user is already authenticated, or if the current mode does not require a presentation key.
4851
+
4852
+ ###### Method provideRecoveryKey
4853
+
4854
+ Provides the recovery key in an authentication flow that requires it.
4855
+
4856
+ ```ts
4857
+ async provideRecoveryKey(recoveryKey: number[]): Promise<void>
4858
+ ```
3917
4859
 
3918
4860
  Argument Details
3919
4861
 
3920
- + **verifierIdentityKey**
3921
- + The public identity key of the verifier who will receive access to the specified fields.
3922
- + **fieldsToReveal**
3923
- + An array of field names to be revealed to the verifier. Must be a subset of the certificate's fields.
4862
+ + **recoveryKey**
4863
+ + The user's recovery key (32 bytes).
3924
4864
 
3925
4865
  Throws
3926
4866
 
3927
- Throws an error if:
3928
- - fieldsToReveal is empty or a field in `fieldsToReveal` does not exist in the certificate.
3929
- - The decrypted master field key fails to decrypt the corresponding field (indicating an invalid key).
4867
+ if user is already authenticated, if the mode does not use a recovery key,
4868
+ or if a required presentation key is missing in "presentation-key-and-recovery-key" mode.
3930
4869
 
3931
- ###### Method encryptAndSignNewCertificate
4870
+ ###### Method saveSnapshot
3932
4871
 
3933
- encrypt plaintext field values for the subject
3934
- update the signature using the certifier's private key.
4872
+ Saves the current wallet state (including the current UMP token and primary key)
4873
+ into an encrypted snapshot. This snapshot can be stored locally and later passed
4874
+ to `loadSnapshot` to restore the wallet state without re-authenticating manually.
3935
4875
 
3936
4876
  ```ts
3937
- async encryptAndSignNewCertificate(): Promise<void>
4877
+ saveSnapshot(): number[]
3938
4878
  ```
3939
4879
 
4880
+ Returns
4881
+
4882
+ An array of bytes representing the encrypted snapshot.
4883
+
4884
+ Throws
4885
+
4886
+ if no primary key or token is currently set.
4887
+
3940
4888
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3941
4889
 
3942
4890
  ---
@@ -5044,36 +5992,147 @@ addDefaultTasks(): void
5044
5992
  Tasks appropriate for multi-user storage
5045
5993
  without sync'ing enabled.
5046
5994
 
5047
- ```ts
5048
- addMultiUserTasks(): void
5049
- ```
5995
+ ```ts
5996
+ addMultiUserTasks(): void
5997
+ ```
5998
+
5999
+ ###### Method processNewBlockHeader
6000
+
6001
+ Process new chain header event received from Chaintracks
6002
+
6003
+ Kicks processing 'unconfirmed' and 'unmined' request processing.
6004
+
6005
+ ```ts
6006
+ processNewBlockHeader(header: BlockHeader): void
6007
+ ```
6008
+ See also: [BlockHeader](./client.md#interface-blockheader)
6009
+
6010
+ ###### Method processReorg
6011
+
6012
+ Process reorg event received from Chaintracks
6013
+
6014
+ Reorgs can move recent transactions to new blocks at new index positions.
6015
+ Affected transaction proofs become invalid and must be updated.
6016
+
6017
+ It is possible for a transaction to become invalid.
6018
+
6019
+ Coinbase transactions always become invalid.
6020
+
6021
+ ```ts
6022
+ processReorg(depth: number, oldTip: BlockHeader, newTip: BlockHeader): void
6023
+ ```
6024
+ See also: [BlockHeader](./client.md#interface-blockheader)
6025
+
6026
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6027
+
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
5050
6099
 
5051
- ###### Method processNewBlockHeader
6100
+ + **hash**
6101
+ + The 32-byte SHA-256 hash of the presentation key.
5052
6102
 
5053
- Process new chain header event received from Chaintracks
6103
+ ###### Method findByRecoveryKeyHash
5054
6104
 
5055
- Kicks processing 'unconfirmed' and 'unmined' request processing.
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.
5056
6107
 
5057
6108
  ```ts
5058
- processNewBlockHeader(header: BlockHeader): void
6109
+ public async findByRecoveryKeyHash(hash: number[]): Promise<UMPToken | undefined>
5059
6110
  ```
5060
- See also: [BlockHeader](./client.md#interface-blockheader)
6111
+ See also: [UMPToken](./client.md#interface-umptoken)
5061
6112
 
5062
- ###### Method processReorg
6113
+ Returns
5063
6114
 
5064
- Process reorg event received from Chaintracks
6115
+ A UMPToken object (including currentOutpoint) if found, otherwise undefined.
5065
6116
 
5066
- Reorgs can move recent transactions to new blocks at new index positions.
5067
- Affected transaction proofs become invalid and must be updated.
6117
+ Argument Details
5068
6118
 
5069
- It is possible for a transaction to become invalid.
6119
+ + **hash**
6120
+ + The 32-byte SHA-256 hash of the recovery key.
5070
6121
 
5071
- Coinbase transactions always become invalid.
6122
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6123
+
6124
+ ---
6125
+ ##### Class: PersonaIDInteractor
5072
6126
 
5073
6127
  ```ts
5074
- processReorg(depth: number, oldTip: BlockHeader, newTip: BlockHeader): void
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
+ }
5075
6133
  ```
5076
- See also: [BlockHeader](./client.md#interface-blockheader)
6134
+
6135
+ See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor), [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse), [StartAuthResponse](./client.md#interface-startauthresponse)
5077
6136
 
5078
6137
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5079
6138
 
@@ -5274,6 +6333,228 @@ See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails)
5274
6333
 
5275
6334
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5276
6335
 
6336
+ ---
6337
+ ##### Class: SimpleWalletManager
6338
+
6339
+ SimpleWalletManager is a slimmed-down wallet manager that only requires two things to authenticate:
6340
+ 1. A primary key (32 bytes), which represents the core secret for the wallet.
6341
+ 2. A privileged key manager (an instance of `PrivilegedKeyManager`), responsible for
6342
+ more sensitive operations.
6343
+
6344
+ Once both pieces are provided (or if a snapshot containing the primary key is loaded,
6345
+ and the privileged key manager is provided separately), the wallet becomes authenticated.
6346
+
6347
+ After authentication, calls to the standard wallet methods (`createAction`, `signAction`, etc.)
6348
+ are proxied to an underlying `WalletInterface` instance returned by a user-supplied `walletBuilder`.
6349
+
6350
+ **Important**: This manager does not handle user password flows, recovery, or on-chain
6351
+ token management. It is a straightforward wrapper that ensures the user has provided
6352
+ both their main secret (primary key) and a privileged key manager before allowing usage.
6353
+
6354
+ It also prevents calls from the special "admin originator" from being used externally.
6355
+ (Any call that tries to use the admin originator as its originator, other than the manager itself,
6356
+ will result in an error, ensuring that only internal operations can use that originator.)
6357
+
6358
+ The manager can also save and load snapshots of its state. In this simplified version,
6359
+ the snapshot only contains the primary key. If you load a snapshot, you still need to
6360
+ re-provide the privileged key manager to complete authentication.
6361
+
6362
+ ```ts
6363
+ export class SimpleWalletManager implements WalletInterface {
6364
+ authenticated: boolean;
6365
+ constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
6366
+ async providePrimaryKey(key: number[]): Promise<void>
6367
+ async providePrivilegedKeyManager(manager: PrivilegedKeyManager): Promise<void>
6368
+ destroy(): void
6369
+ saveSnapshot(): number[]
6370
+ async loadSnapshot(snapshot: number[]): Promise<void>
6371
+ async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
6372
+ async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
6373
+ async getPublicKey(args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetPublicKeyResult>
6374
+ async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealCounterpartyKeyLinkageResult>
6375
+ async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RevealSpecificKeyLinkageResult>
6376
+ async encrypt(args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletEncryptResult>
6377
+ async decrypt(args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<WalletDecryptResult>
6378
+ async createHmac(args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateHmacResult>
6379
+ async verifyHmac(args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifyHmacResult>
6380
+ async createSignature(args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateSignatureResult>
6381
+ async verifySignature(args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<VerifySignatureResult>
6382
+ async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
6383
+ async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
6384
+ async abortAction(args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AbortActionResult>
6385
+ async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
6386
+ async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<InternalizeActionResult>
6387
+ async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
6388
+ async relinquishOutput(args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishOutputResult>
6389
+ async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
6390
+ async listCertificates(args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
6391
+ async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
6392
+ async relinquishCertificate(args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<RelinquishCertificateResult>
6393
+ async discoverByIdentityKey(args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
6394
+ async discoverByAttributes(args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
6395
+ async getHeight(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeightResult>
6396
+ async getHeaderForHeight(args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetHeaderResult>
6397
+ async getNetwork(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetNetworkResult>
6398
+ async getVersion(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<GetVersionResult>
6399
+ }
6400
+ ```
6401
+
6402
+ 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)
6403
+
6404
+ ###### Constructor
6405
+
6406
+ Constructs a new `SimpleWalletManager`.
6407
+
6408
+ ```ts
6409
+ constructor(adminOriginator: OriginatorDomainNameStringUnder250Bytes, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>, stateSnapshot?: number[])
6410
+ ```
6411
+ See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager)
6412
+
6413
+ Argument Details
6414
+
6415
+ + **adminOriginator**
6416
+ + The domain name of the administrative originator.
6417
+ + **walletBuilder**
6418
+ + A function that, given a primary key and privileged key manager,
6419
+ returns a fully functional `WalletInterface`.
6420
+ + **stateSnapshot**
6421
+ + If provided, a previously saved snapshot of the wallet's state.
6422
+ If the snapshot contains a primary key, it will be loaded immediately
6423
+ (though you will still need to provide a privileged key manager to authenticate).
6424
+
6425
+ ###### Property authenticated
6426
+
6427
+ Whether the user is currently authenticated (meaning both the primary key
6428
+ and privileged key manager have been provided).
6429
+
6430
+ ```ts
6431
+ authenticated: boolean
6432
+ ```
6433
+
6434
+ ###### Method destroy
6435
+
6436
+ Destroys the underlying wallet, returning to a default (unauthenticated) state.
6437
+
6438
+ This clears the primary key, the privileged key manager, and the `authenticated` flag.
6439
+
6440
+ ```ts
6441
+ destroy(): void
6442
+ ```
6443
+
6444
+ ###### Method isAuthenticated
6445
+
6446
+ Returns whether the user is currently authenticated (the wallet has a primary key
6447
+ and a privileged key manager). If not authenticated, an error is thrown.
6448
+
6449
+ ```ts
6450
+ async isAuthenticated(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
6451
+ ```
6452
+
6453
+ Argument Details
6454
+
6455
+ + **_**
6456
+ + Not used in this manager.
6457
+ + **originator**
6458
+ + The originator domain, which must not be the admin originator.
6459
+
6460
+ Throws
6461
+
6462
+ If not authenticated, or if the originator is the admin.
6463
+
6464
+ ###### Method loadSnapshot
6465
+
6466
+ Loads a previously saved state snapshot (produced by `saveSnapshot`).
6467
+ This will restore the primary key but will **not** restore the privileged key manager
6468
+ (that must be provided separately to complete authentication).
6469
+
6470
+ ```ts
6471
+ async loadSnapshot(snapshot: number[]): Promise<void>
6472
+ ```
6473
+
6474
+ Argument Details
6475
+
6476
+ + **snapshot**
6477
+ + A byte array that was previously returned by `saveSnapshot`.
6478
+
6479
+ Throws
6480
+
6481
+ If the snapshot format is invalid or decryption fails.
6482
+
6483
+ ###### Method providePrimaryKey
6484
+
6485
+ Provides the primary key (32 bytes) needed for authentication.
6486
+ If a privileged key manager has already been provided, we attempt to build
6487
+ the underlying wallet. Otherwise, we wait until the manager is also provided.
6488
+
6489
+ ```ts
6490
+ async providePrimaryKey(key: number[]): Promise<void>
6491
+ ```
6492
+
6493
+ Argument Details
6494
+
6495
+ + **key**
6496
+ + A 32-byte primary key.
6497
+
6498
+ ###### Method providePrivilegedKeyManager
6499
+
6500
+ Provides the privileged key manager needed for sensitive tasks.
6501
+ If a primary key has already been provided (or loaded from a snapshot),
6502
+ we attempt to build the underlying wallet. Otherwise, we wait until the key is provided.
6503
+
6504
+ ```ts
6505
+ async providePrivilegedKeyManager(manager: PrivilegedKeyManager): Promise<void>
6506
+ ```
6507
+ See also: [PrivilegedKeyManager](./client.md#class-privilegedkeymanager)
6508
+
6509
+ Argument Details
6510
+
6511
+ + **manager**
6512
+ + An instance of `PrivilegedKeyManager`.
6513
+
6514
+ ###### Method saveSnapshot
6515
+
6516
+ Saves the current wallet state (including just the primary key)
6517
+ into an encrypted snapshot. This snapshot can be stored and later
6518
+ passed to `loadSnapshot` to restore the primary key (and partially authenticate).
6519
+
6520
+ **Note**: The snapshot does NOT include the privileged key manager.
6521
+ You must still provide that separately after loading the snapshot
6522
+ in order to complete authentication.
6523
+
6524
+ ```ts
6525
+ saveSnapshot(): number[]
6526
+ ```
6527
+
6528
+ Returns
6529
+
6530
+ A byte array representing the encrypted snapshot.
6531
+
6532
+ Throws
6533
+
6534
+ if no primary key is currently set.
6535
+
6536
+ ###### Method waitForAuthentication
6537
+
6538
+ Blocks until the user is authenticated (by providing primaryKey and privileged manager).
6539
+ If not authenticated yet, it waits until that occurs.
6540
+
6541
+ ```ts
6542
+ async waitForAuthentication(_: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AuthenticatedResult>
6543
+ ```
6544
+
6545
+ Argument Details
6546
+
6547
+ + **_**
6548
+ + Not used in this manager.
6549
+ + **originator**
6550
+ + The originator domain, which must not be the admin originator.
6551
+
6552
+ Throws
6553
+
6554
+ If the originator is the admin.
6555
+
6556
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6557
+
5277
6558
  ---
5278
6559
  ##### Class: StorageClient
5279
6560
 
@@ -6505,6 +7786,158 @@ See also: [Monitor](./monitor.md#class-monitor), [WalletMonitorTask](./monitor.m
6505
7786
 
6506
7787
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6507
7788
 
7789
+ ---
7790
+ ##### Class: TwilioPhoneInteractor
7791
+
7792
+ TwilioPhoneInteractor
7793
+
7794
+ A client-side class that knows how to call the WAB server for Twilio-based phone verification.
7795
+
7796
+ ```ts
7797
+ export class TwilioPhoneInteractor extends AuthMethodInteractor {
7798
+ public methodType = "TwilioPhone";
7799
+ public async startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>
7800
+ public async completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>
7801
+ }
7802
+ ```
7803
+
7804
+ See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor), [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse), [StartAuthResponse](./client.md#interface-startauthresponse)
7805
+
7806
+ ###### Method completeAuth
7807
+
7808
+ Complete the Twilio phone verification on the server.
7809
+ - The server will verify the code with Twilio Verify’s verificationChecks endpoint.
7810
+
7811
+ ```ts
7812
+ public async completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>
7813
+ ```
7814
+ See also: [AuthPayload](./client.md#interface-authpayload), [CompleteAuthResponse](./client.md#interface-completeauthresponse)
7815
+
7816
+ Returns
7817
+
7818
+ - { success, message, presentationKey }
7819
+
7820
+ Argument Details
7821
+
7822
+ + **serverUrl**
7823
+ + The base URL of the WAB server
7824
+ + **presentationKey**
7825
+ + The 256-bit key
7826
+ + **payload**
7827
+ + { phoneNumber: string, otp: string } (the code that was received via SMS)
7828
+
7829
+ ###### Method startAuth
7830
+
7831
+ Start the Twilio phone verification on the server.
7832
+ - The server will send an SMS code to the user’s phone, using Twilio Verify.
7833
+
7834
+ ```ts
7835
+ public async startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>
7836
+ ```
7837
+ See also: [AuthPayload](./client.md#interface-authpayload), [StartAuthResponse](./client.md#interface-startauthresponse)
7838
+
7839
+ Returns
7840
+
7841
+ - { success, message, data }
7842
+
7843
+ Argument Details
7844
+
7845
+ + **serverUrl**
7846
+ + The base URL of the WAB server (e.g. http://localhost:3000)
7847
+ + **presentationKey**
7848
+ + The 256-bit key the client is attempting to authenticate with
7849
+ + **payload**
7850
+ + { phoneNumber: string } (the phone number to verify)
7851
+
7852
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7853
+
7854
+ ---
7855
+ ##### Class: WABClient
7856
+
7857
+ ```ts
7858
+ export class WABClient {
7859
+ constructor(private serverUrl: string)
7860
+ public async getInfo()
7861
+ public generateRandomPresentationKey(): string
7862
+ public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
7863
+ public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
7864
+ public async listLinkedMethods(presentationKey: string)
7865
+ public async unlinkMethod(presentationKey: string, authMethodId: number)
7866
+ public async requestFaucet(presentationKey: string)
7867
+ public async deleteUser(presentationKey: string)
7868
+ }
7869
+ ```
7870
+
7871
+ See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
7872
+
7873
+ ###### Method completeAuthMethod
7874
+
7875
+ Complete an Auth Method flow
7876
+
7877
+ ```ts
7878
+ public async completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
7879
+ ```
7880
+ See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
7881
+
7882
+ ###### Method deleteUser
7883
+
7884
+ Delete user
7885
+
7886
+ ```ts
7887
+ public async deleteUser(presentationKey: string)
7888
+ ```
7889
+
7890
+ ###### Method generateRandomPresentationKey
7891
+
7892
+ Generate a random 256-bit presentation key as a hex string (client side).
7893
+
7894
+ ```ts
7895
+ public generateRandomPresentationKey(): string
7896
+ ```
7897
+
7898
+ ###### Method getInfo
7899
+
7900
+ Return the WAB server info
7901
+
7902
+ ```ts
7903
+ public async getInfo()
7904
+ ```
7905
+
7906
+ ###### Method listLinkedMethods
7907
+
7908
+ List user-linked methods
7909
+
7910
+ ```ts
7911
+ public async listLinkedMethods(presentationKey: string)
7912
+ ```
7913
+
7914
+ ###### Method requestFaucet
7915
+
7916
+ Request faucet
7917
+
7918
+ ```ts
7919
+ public async requestFaucet(presentationKey: string)
7920
+ ```
7921
+
7922
+ ###### Method startAuthMethod
7923
+
7924
+ Start an Auth Method flow
7925
+
7926
+ ```ts
7927
+ public async startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any)
7928
+ ```
7929
+ See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
7930
+
7931
+ ###### Method unlinkMethod
7932
+
7933
+ Unlink a given Auth Method by ID
7934
+
7935
+ ```ts
7936
+ public async unlinkMethod(presentationKey: string, authMethodId: number)
7937
+ ```
7938
+
7939
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7940
+
6508
7941
  ---
6509
7942
  ##### Class: WERR_BAD_REQUEST
6510
7943
 
@@ -6728,6 +8161,8 @@ export class Wallet implements WalletInterface, ProtoWallet {
6728
8161
  chain: sdk.Chain;
6729
8162
  keyDeriver: KeyDeriver;
6730
8163
  storage: WalletStorageManager;
8164
+ settingsManager: WalletSettingsManager;
8165
+ lookupResolver: LookupResolver;
6731
8166
  services?: sdk.WalletServices;
6732
8167
  monitor?: Monitor;
6733
8168
  identityKey: string;
@@ -6784,7 +8219,7 @@ export class Wallet implements WalletInterface, ProtoWallet {
6784
8219
  }
6785
8220
  ```
6786
8221
 
6787
- 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), [WalletBalance](./client.md#interface-walletbalance), [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)
8222
+ 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), [WalletBalance](./client.md#interface-walletbalance), [WalletServices](./client.md#interface-walletservices), [WalletSettingsManager](./client.md#class-walletsettingsmanager), [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)
6788
8223
 
6789
8224
  ###### Property beef
6790
8225
 
@@ -6844,37 +8279,85 @@ Returns
6844
8279
 
6845
8280
  Argument Details
6846
8281
 
6847
- + **basket**
6848
- + Optional. Defaults to 'default', the wallet change basket.
8282
+ + **basket**
8283
+ + Optional. Defaults to 'default', the wallet change basket.
8284
+
8285
+ ###### Method getKnownTxids
8286
+
8287
+ ```ts
8288
+ getKnownTxids(newKnownTxids?: string[]): string[]
8289
+ ```
8290
+
8291
+ Returns
8292
+
8293
+ the full list of txids whose validity this wallet claims to know.
8294
+
8295
+ Argument Details
8296
+
8297
+ + **newKnownTxids**
8298
+ + Optional. Additional new txids known to be valid by the caller to be merged.
8299
+
8300
+ ###### Method sweepTo
8301
+
8302
+ Transfer all possible satoshis held by this wallet to `toWallet`.
8303
+
8304
+ ```ts
8305
+ async sweepTo(toWallet: Wallet): Promise<void>
8306
+ ```
8307
+ See also: [Wallet](./client.md#class-wallet)
8308
+
8309
+ Argument Details
8310
+
8311
+ + **toWallet**
8312
+ + wallet which will receive this wallet's satoshis.
8313
+
8314
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
8315
+
8316
+ ---
8317
+ ##### Class: WalletAuthenticationManager
8318
+
8319
+ WalletAuthenticationManager
6849
8320
 
6850
- ###### Method getKnownTxids
8321
+ A wallet manager that integrates
8322
+ with a WABClient for user authentication flows (e.g. Twilio phone).
6851
8323
 
6852
8324
  ```ts
6853
- getKnownTxids(newKnownTxids?: string[]): string[]
8325
+ export class WalletAuthenticationManager extends CWIStyleWalletManager {
8326
+ 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[])
8327
+ public setAuthMethod(method: AuthMethodInteractor)
8328
+ public async startAuth(payload: any): Promise<void>
8329
+ public async completeAuth(payload: any): Promise<void>
8330
+ }
6854
8331
  ```
6855
8332
 
6856
- Returns
8333
+ 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)
6857
8334
 
6858
- the full list of txids whose validity this wallet claims to know.
8335
+ ###### Method completeAuth
6859
8336
 
6860
- Argument Details
8337
+ Completes the WAB-based flow, retrieving the final presentationKey from WAB if successful.
6861
8338
 
6862
- + **newKnownTxids**
6863
- + Optional. Additional new txids known to be valid by the caller to be merged.
8339
+ ```ts
8340
+ public async completeAuth(payload: any): Promise<void>
8341
+ ```
6864
8342
 
6865
- ###### Method sweepTo
8343
+ ###### Method setAuthMethod
6866
8344
 
6867
- Transfer all possible satoshis held by this wallet to `toWallet`.
8345
+ Sets (or switches) the chosen AuthMethodInteractor at runtime,
8346
+ in case the user changes their mind or picks a new method in the UI.
6868
8347
 
6869
8348
  ```ts
6870
- async sweepTo(toWallet: Wallet): Promise<void>
8349
+ public setAuthMethod(method: AuthMethodInteractor)
6871
8350
  ```
6872
- See also: [Wallet](./client.md#class-wallet)
8351
+ See also: [AuthMethodInteractor](./client.md#class-authmethodinteractor)
6873
8352
 
6874
- Argument Details
8353
+ ###### Method startAuth
6875
8354
 
6876
- + **toWallet**
6877
- + wallet which will receive this wallet's satoshis.
8355
+ Initiate the WAB-based flow, e.g. sending an SMS code or starting an ID check,
8356
+ using the chosen AuthMethodInteractor.
8357
+
8358
+ ```ts
8359
+ public async startAuth(payload: any): Promise<void>
8360
+ ```
6878
8361
 
6879
8362
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6880
8363
 
@@ -6998,6 +8481,497 @@ abstract trigger(nowMsecsSinceEpoch: number): {
6998
8481
 
6999
8482
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7000
8483
 
8484
+ ---
8485
+ ##### Class: WalletPermissionsManager
8486
+
8487
+ ```ts
8488
+ export class WalletPermissionsManager implements WalletInterface {
8489
+ constructor(underlyingWallet: WalletInterface, adminOriginator: string, config: PermissionsManagerConfig = {})
8490
+ public bindCallback(eventName: keyof WalletPermissionsManagerCallbacks, handler: PermissionEventHandler): number
8491
+ public unbindCallback(eventName: keyof WalletPermissionsManagerCallbacks, reference: number | Function): boolean
8492
+ public async grantPermission(params: {
8493
+ requestID: string;
8494
+ expiry?: number;
8495
+ ephemeral?: boolean;
8496
+ amount?: number;
8497
+ }): Promise<void>
8498
+ public async denyPermission(requestID: string): Promise<void>
8499
+ public async ensureProtocolPermission({ originator, privileged, protocolID, counterparty, reason, seekPermission = true, usageType }: {
8500
+ originator: string;
8501
+ privileged: boolean;
8502
+ protocolID: [
8503
+ 0 | 1 | 2,
8504
+ string
8505
+ ];
8506
+ counterparty: string;
8507
+ reason?: string;
8508
+ seekPermission?: boolean;
8509
+ usageType: "signing" | "encrypting" | "hmac" | "publicKey" | "identityKey" | "linkageRevelation" | "generic";
8510
+ }): Promise<boolean>
8511
+ public async ensureBasketAccess({ originator, basket, reason, seekPermission = true, usageType }: {
8512
+ originator: string;
8513
+ basket: string;
8514
+ reason?: string;
8515
+ seekPermission?: boolean;
8516
+ usageType: "insertion" | "removal" | "listing";
8517
+ }): Promise<boolean>
8518
+ public async ensureCertificateAccess({ originator, privileged, verifier, certType, fields, reason, seekPermission = true, usageType }: {
8519
+ originator: string;
8520
+ privileged: boolean;
8521
+ verifier: string;
8522
+ certType: string;
8523
+ fields: string[];
8524
+ reason?: string;
8525
+ seekPermission?: boolean;
8526
+ usageType: "disclosure";
8527
+ }): Promise<boolean>
8528
+ public async ensureSpendingAuthorization({ originator, satoshis, lineItems, reason, seekPermission = true }: {
8529
+ originator: string;
8530
+ satoshis: number;
8531
+ lineItems?: Array<{
8532
+ type: "input" | "output" | "fee";
8533
+ description: string;
8534
+ satoshis: number;
8535
+ }>;
8536
+ reason?: string;
8537
+ seekPermission?: boolean;
8538
+ }): Promise<boolean>
8539
+ public async ensureLabelAccess({ originator, label, reason, seekPermission = true, usageType }: {
8540
+ originator: string;
8541
+ label: string;
8542
+ reason?: string;
8543
+ seekPermission?: boolean;
8544
+ usageType: "apply" | "list";
8545
+ }): Promise<boolean>
8546
+ public async querySpentSince(token: PermissionToken): Promise<number>
8547
+ public async listProtocolPermissions({ originator }: {
8548
+ originator?: string;
8549
+ }): Promise<PermissionToken[]>
8550
+ public async hasProtocolPermission(params: {
8551
+ originator: string;
8552
+ privileged: boolean;
8553
+ protocolID: [
8554
+ 0 | 1 | 2,
8555
+ string
8556
+ ];
8557
+ counterparty: string;
8558
+ }): Promise<boolean>
8559
+ public async listBasketAccess(params: {
8560
+ originator?: string;
8561
+ }): Promise<PermissionToken[]>
8562
+ public async hasBasketAccess(params: {
8563
+ originator: string;
8564
+ basket: string;
8565
+ }): Promise<boolean>
8566
+ public async listSpendingAuthorizations(params: {
8567
+ originator?: string;
8568
+ }): Promise<PermissionToken[]>
8569
+ public async hasSpendingAuthorization(params: {
8570
+ originator: string;
8571
+ satoshis: number;
8572
+ }): Promise<boolean>
8573
+ public async listCertificateAccess(params: {
8574
+ originator?: string;
8575
+ }): Promise<PermissionToken[]>
8576
+ public async hasCertificateAccess(params: {
8577
+ originator: string;
8578
+ privileged: boolean;
8579
+ verifier: string;
8580
+ certType: string;
8581
+ fields: string[];
8582
+ }): Promise<boolean>
8583
+ public async revokePermission(oldToken: PermissionToken): Promise<void>
8584
+ public async createAction(args: Parameters<WalletInterface["createAction"]>[0], originator?: string): ReturnType<WalletInterface["createAction"]>
8585
+ public async signAction(...args: Parameters<WalletInterface["signAction"]>): ReturnType<WalletInterface["signAction"]>
8586
+ public async abortAction(...args: Parameters<WalletInterface["abortAction"]>): ReturnType<WalletInterface["abortAction"]>
8587
+ public async listActions(...args: Parameters<WalletInterface["listActions"]>): ReturnType<WalletInterface["listActions"]>
8588
+ public async internalizeAction(...args: Parameters<WalletInterface["internalizeAction"]>): ReturnType<WalletInterface["internalizeAction"]>
8589
+ public async listOutputs(...args: Parameters<WalletInterface["listOutputs"]>): ReturnType<WalletInterface["listOutputs"]>
8590
+ public async relinquishOutput(...args: Parameters<WalletInterface["relinquishOutput"]>): ReturnType<WalletInterface["relinquishOutput"]>
8591
+ public async getPublicKey(...args: Parameters<WalletInterface["getPublicKey"]>): ReturnType<WalletInterface["getPublicKey"]>
8592
+ public async revealCounterpartyKeyLinkage(...args: Parameters<WalletInterface["revealCounterpartyKeyLinkage"]>): ReturnType<WalletInterface["revealCounterpartyKeyLinkage"]>
8593
+ public async revealSpecificKeyLinkage(...args: Parameters<WalletInterface["revealSpecificKeyLinkage"]>): ReturnType<WalletInterface["revealSpecificKeyLinkage"]>
8594
+ public async encrypt(...args: Parameters<WalletInterface["encrypt"]>): ReturnType<WalletInterface["encrypt"]>
8595
+ public async decrypt(...args: Parameters<WalletInterface["decrypt"]>): ReturnType<WalletInterface["decrypt"]>
8596
+ public async createHmac(...args: Parameters<WalletInterface["createHmac"]>): ReturnType<WalletInterface["createHmac"]>
8597
+ public async verifyHmac(...args: Parameters<WalletInterface["verifyHmac"]>): ReturnType<WalletInterface["verifyHmac"]>
8598
+ public async createSignature(...args: Parameters<WalletInterface["createSignature"]>): ReturnType<WalletInterface["createSignature"]>
8599
+ public async verifySignature(...args: Parameters<WalletInterface["verifySignature"]>): ReturnType<WalletInterface["verifySignature"]>
8600
+ public async acquireCertificate(...args: Parameters<WalletInterface["acquireCertificate"]>): ReturnType<WalletInterface["acquireCertificate"]>
8601
+ public async listCertificates(...args: Parameters<WalletInterface["listCertificates"]>): ReturnType<WalletInterface["listCertificates"]>
8602
+ public async proveCertificate(...args: Parameters<WalletInterface["proveCertificate"]>): ReturnType<WalletInterface["proveCertificate"]>
8603
+ public async relinquishCertificate(...args: Parameters<WalletInterface["relinquishCertificate"]>): ReturnType<WalletInterface["relinquishCertificate"]>
8604
+ public async discoverByIdentityKey(...args: Parameters<WalletInterface["discoverByIdentityKey"]>): ReturnType<WalletInterface["discoverByIdentityKey"]>
8605
+ public async discoverByAttributes(...args: Parameters<WalletInterface["discoverByAttributes"]>): ReturnType<WalletInterface["discoverByAttributes"]>
8606
+ public async isAuthenticated(...args: Parameters<WalletInterface["isAuthenticated"]>): ReturnType<WalletInterface["isAuthenticated"]>
8607
+ public async waitForAuthentication(...args: Parameters<WalletInterface["waitForAuthentication"]>): ReturnType<WalletInterface["waitForAuthentication"]>
8608
+ public async getHeight(...args: Parameters<WalletInterface["getHeight"]>): ReturnType<WalletInterface["getHeight"]>
8609
+ public async getHeaderForHeight(...args: Parameters<WalletInterface["getHeaderForHeight"]>): ReturnType<WalletInterface["getHeaderForHeight"]>
8610
+ public async getNetwork(...args: Parameters<WalletInterface["getNetwork"]>): ReturnType<WalletInterface["getNetwork"]>
8611
+ public async getVersion(...args: Parameters<WalletInterface["getVersion"]>): ReturnType<WalletInterface["getVersion"]>
8612
+ }
8613
+ ```
8614
+
8615
+ 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)
8616
+
8617
+ ###### Constructor
8618
+
8619
+ Constructs a new Permissions Manager instance.
8620
+
8621
+ ```ts
8622
+ constructor(underlyingWallet: WalletInterface, adminOriginator: string, config: PermissionsManagerConfig = {})
8623
+ ```
8624
+ See also: [PermissionsManagerConfig](./client.md#interface-permissionsmanagerconfig)
8625
+
8626
+ Argument Details
8627
+
8628
+ + **underlyingWallet**
8629
+ + The underlying BRC-100 wallet, where requests are forwarded after permission is granted
8630
+ + **adminOriginator**
8631
+ + The domain or FQDN that is automatically allowed everything
8632
+ + **config**
8633
+ + A set of boolean flags controlling how strictly permissions are enforced
8634
+
8635
+ ###### Method bindCallback
8636
+
8637
+ Binds a callback function to a named event, such as `onProtocolPermissionRequested`.
8638
+
8639
+ ```ts
8640
+ public bindCallback(eventName: keyof WalletPermissionsManagerCallbacks, handler: PermissionEventHandler): number
8641
+ ```
8642
+ See also: [PermissionEventHandler](./client.md#type-permissioneventhandler), [WalletPermissionsManagerCallbacks](./client.md#interface-walletpermissionsmanagercallbacks)
8643
+
8644
+ Returns
8645
+
8646
+ A numeric ID you can use to unbind later
8647
+
8648
+ Argument Details
8649
+
8650
+ + **eventName**
8651
+ + The name of the event to listen to
8652
+ + **handler**
8653
+ + A function that handles the event
8654
+
8655
+ ###### Method denyPermission
8656
+
8657
+ Denies a previously requested permission.
8658
+ This method rejects all pending promise calls waiting on that request
8659
+
8660
+ ```ts
8661
+ public async denyPermission(requestID: string): Promise<void>
8662
+ ```
8663
+
8664
+ Argument Details
8665
+
8666
+ + **requestID**
8667
+ + requestID identifying which request to deny
8668
+
8669
+ ###### Method ensureBasketAccess
8670
+
8671
+ Ensures the originator has basket usage permission for the specified basket.
8672
+ If not, triggers a permission request flow.
8673
+
8674
+ ```ts
8675
+ public async ensureBasketAccess({ originator, basket, reason, seekPermission = true, usageType }: {
8676
+ originator: string;
8677
+ basket: string;
8678
+ reason?: string;
8679
+ seekPermission?: boolean;
8680
+ usageType: "insertion" | "removal" | "listing";
8681
+ }): Promise<boolean>
8682
+ ```
8683
+
8684
+ ###### Method ensureCertificateAccess
8685
+
8686
+ Ensures the originator has a valid certificate permission.
8687
+ This is relevant when revealing certificate fields in DCAP contexts.
8688
+
8689
+ ```ts
8690
+ public async ensureCertificateAccess({ originator, privileged, verifier, certType, fields, reason, seekPermission = true, usageType }: {
8691
+ originator: string;
8692
+ privileged: boolean;
8693
+ verifier: string;
8694
+ certType: string;
8695
+ fields: string[];
8696
+ reason?: string;
8697
+ seekPermission?: boolean;
8698
+ usageType: "disclosure";
8699
+ }): Promise<boolean>
8700
+ ```
8701
+
8702
+ ###### Method ensureLabelAccess
8703
+
8704
+ Ensures the originator has label usage permission.
8705
+ If no valid (unexpired) permission token is found, triggers a permission request flow.
8706
+
8707
+ ```ts
8708
+ public async ensureLabelAccess({ originator, label, reason, seekPermission = true, usageType }: {
8709
+ originator: string;
8710
+ label: string;
8711
+ reason?: string;
8712
+ seekPermission?: boolean;
8713
+ usageType: "apply" | "list";
8714
+ }): Promise<boolean>
8715
+ ```
8716
+
8717
+ ###### Method ensureProtocolPermission
8718
+
8719
+ Ensures the originator has protocol usage permission.
8720
+ If no valid (unexpired) permission token is found, triggers a permission request flow.
8721
+
8722
+ ```ts
8723
+ public async ensureProtocolPermission({ originator, privileged, protocolID, counterparty, reason, seekPermission = true, usageType }: {
8724
+ originator: string;
8725
+ privileged: boolean;
8726
+ protocolID: [
8727
+ 0 | 1 | 2,
8728
+ string
8729
+ ];
8730
+ counterparty: string;
8731
+ reason?: string;
8732
+ seekPermission?: boolean;
8733
+ usageType: "signing" | "encrypting" | "hmac" | "publicKey" | "identityKey" | "linkageRevelation" | "generic";
8734
+ }): Promise<boolean>
8735
+ ```
8736
+
8737
+ ###### Method ensureSpendingAuthorization
8738
+
8739
+ Ensures the originator has spending authorization (DSAP) for a certain satoshi amount.
8740
+ If the existing token limit is insufficient, attempts to renew. If no token, attempts to create one.
8741
+
8742
+ ```ts
8743
+ public async ensureSpendingAuthorization({ originator, satoshis, lineItems, reason, seekPermission = true }: {
8744
+ originator: string;
8745
+ satoshis: number;
8746
+ lineItems?: Array<{
8747
+ type: "input" | "output" | "fee";
8748
+ description: string;
8749
+ satoshis: number;
8750
+ }>;
8751
+ reason?: string;
8752
+ seekPermission?: boolean;
8753
+ }): Promise<boolean>
8754
+ ```
8755
+
8756
+ ###### Method grantPermission
8757
+
8758
+ Grants a previously requested permission.
8759
+ This method:
8760
+ 1) Resolves all pending promise calls waiting on this request
8761
+ 2) Optionally creates or renews an on-chain PushDrop token (unless `ephemeral===true`)
8762
+
8763
+ ```ts
8764
+ public async grantPermission(params: {
8765
+ requestID: string;
8766
+ expiry?: number;
8767
+ ephemeral?: boolean;
8768
+ amount?: number;
8769
+ }): Promise<void>
8770
+ ```
8771
+
8772
+ Argument Details
8773
+
8774
+ + **params**
8775
+ + requestID to identify which request is granted, plus optional expiry
8776
+ or `ephemeral` usage, etc.
8777
+
8778
+ ###### Method hasBasketAccess
8779
+
8780
+ Returns `true` if the originator already holds a valid unexpired basket permission for `basket`.
8781
+
8782
+ ```ts
8783
+ public async hasBasketAccess(params: {
8784
+ originator: string;
8785
+ basket: string;
8786
+ }): Promise<boolean>
8787
+ ```
8788
+
8789
+ ###### Method hasCertificateAccess
8790
+
8791
+ Returns `true` if the originator already holds a valid unexpired certificate access
8792
+ for the given certType/fields. Does not prompt the user.
8793
+
8794
+ ```ts
8795
+ public async hasCertificateAccess(params: {
8796
+ originator: string;
8797
+ privileged: boolean;
8798
+ verifier: string;
8799
+ certType: string;
8800
+ fields: string[];
8801
+ }): Promise<boolean>
8802
+ ```
8803
+
8804
+ ###### Method hasProtocolPermission
8805
+
8806
+ Returns true if the originator already holds a valid unexpired protocol permission.
8807
+ This calls `ensureProtocolPermission` with `seekPermission=false`, so it won't prompt.
8808
+
8809
+ ```ts
8810
+ public async hasProtocolPermission(params: {
8811
+ originator: string;
8812
+ privileged: boolean;
8813
+ protocolID: [
8814
+ 0 | 1 | 2,
8815
+ string
8816
+ ];
8817
+ counterparty: string;
8818
+ }): Promise<boolean>
8819
+ ```
8820
+
8821
+ ###### Method hasSpendingAuthorization
8822
+
8823
+ Returns `true` if the originator already holds a valid spending authorization token
8824
+ with enough available monthly spend. We do not prompt (seekPermission=false).
8825
+
8826
+ ```ts
8827
+ public async hasSpendingAuthorization(params: {
8828
+ originator: string;
8829
+ satoshis: number;
8830
+ }): Promise<boolean>
8831
+ ```
8832
+
8833
+ ###### Method listBasketAccess
8834
+
8835
+ Lists basket permission tokens (DBAP) for a given originator (or for all if not specified).
8836
+
8837
+ ```ts
8838
+ public async listBasketAccess(params: {
8839
+ originator?: string;
8840
+ }): Promise<PermissionToken[]>
8841
+ ```
8842
+ See also: [PermissionToken](./client.md#interface-permissiontoken)
8843
+
8844
+ ###### Method listCertificateAccess
8845
+
8846
+ Lists certificate permission tokens (DCAP) for a given originator (or all).
8847
+
8848
+ ```ts
8849
+ public async listCertificateAccess(params: {
8850
+ originator?: string;
8851
+ }): Promise<PermissionToken[]>
8852
+ ```
8853
+ See also: [PermissionToken](./client.md#interface-permissiontoken)
8854
+
8855
+ ###### Method listProtocolPermissions
8856
+
8857
+ Lists all protocol permission tokens (DPACP) for a given originator or for all if originator is undefined.
8858
+ This is a convenience method for UI or debug.
8859
+
8860
+ ```ts
8861
+ public async listProtocolPermissions({ originator }: {
8862
+ originator?: string;
8863
+ }): Promise<PermissionToken[]>
8864
+ ```
8865
+ See also: [PermissionToken](./client.md#interface-permissiontoken)
8866
+
8867
+ ###### Method listSpendingAuthorizations
8868
+
8869
+ Lists spending authorization tokens (DSAP) for a given originator (or all).
8870
+
8871
+ ```ts
8872
+ public async listSpendingAuthorizations(params: {
8873
+ originator?: string;
8874
+ }): Promise<PermissionToken[]>
8875
+ ```
8876
+ See also: [PermissionToken](./client.md#interface-permissiontoken)
8877
+
8878
+ ###### Method querySpentSince
8879
+
8880
+ Returns spending for an originator in the current calendar month.
8881
+
8882
+ ```ts
8883
+ public async querySpentSince(token: PermissionToken): Promise<number>
8884
+ ```
8885
+ See also: [PermissionToken](./client.md#interface-permissiontoken)
8886
+
8887
+ ###### Method revokePermission
8888
+
8889
+ Revokes a permission token by spending it with no replacement output.
8890
+ The manager builds a BRC-100 transaction that consumes the token, effectively invalidating it.
8891
+
8892
+ ```ts
8893
+ public async revokePermission(oldToken: PermissionToken): Promise<void>
8894
+ ```
8895
+ See also: [PermissionToken](./client.md#interface-permissiontoken)
8896
+
8897
+ ###### Method unbindCallback
8898
+
8899
+ Unbinds a previously registered callback by either its numeric ID (returned by `bindCallback`)
8900
+ or by exact function reference.
8901
+
8902
+ ```ts
8903
+ public unbindCallback(eventName: keyof WalletPermissionsManagerCallbacks, reference: number | Function): boolean
8904
+ ```
8905
+ See also: [WalletPermissionsManagerCallbacks](./client.md#interface-walletpermissionsmanagercallbacks)
8906
+
8907
+ Returns
8908
+
8909
+ True if successfully unbound, false otherwise
8910
+
8911
+ Argument Details
8912
+
8913
+ + **eventName**
8914
+ + The event name, e.g. "onProtocolPermissionRequested"
8915
+ + **reference**
8916
+ + Either the numeric ID or the function reference
8917
+
8918
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
8919
+
8920
+ ---
8921
+ ##### Class: WalletSettingsManager
8922
+
8923
+ Manages wallet settings
8924
+
8925
+ ```ts
8926
+ export class WalletSettingsManager {
8927
+ constructor(private wallet: WalletInterface, private config: WalletSettingsManagerConfig = {
8928
+ defaultSettings: DEFAULT_SETTINGS
8929
+ })
8930
+ async get(): Promise<WalletSettings>
8931
+ async set(settings: WalletSettings): Promise<void>
8932
+ async delete(): Promise<void>
8933
+ }
8934
+ ```
8935
+
8936
+ See also: [DEFAULT_SETTINGS](./client.md#variable-default_settings), [WalletSettings](./client.md#interface-walletsettings), [WalletSettingsManagerConfig](./client.md#interface-walletsettingsmanagerconfig)
8937
+
8938
+ ###### Method delete
8939
+
8940
+ Deletes the user's settings token.
8941
+
8942
+ ```ts
8943
+ async delete(): Promise<void>
8944
+ ```
8945
+
8946
+ ###### Method get
8947
+
8948
+ Returns a user's wallet settings
8949
+
8950
+ ```ts
8951
+ async get(): Promise<WalletSettings>
8952
+ ```
8953
+ See also: [WalletSettings](./client.md#interface-walletsettings)
8954
+
8955
+ Returns
8956
+
8957
+ - Wallet settings object
8958
+
8959
+ ###### Method set
8960
+
8961
+ Creates (or updates) the user's settings token.
8962
+
8963
+ ```ts
8964
+ async set(settings: WalletSettings): Promise<void>
8965
+ ```
8966
+ See also: [WalletSettings](./client.md#interface-walletsettings)
8967
+
8968
+ Argument Details
8969
+
8970
+ + **settings**
8971
+ + The wallet settings to be stored.
8972
+
8973
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
8974
+
7001
8975
  ---
7002
8976
  ##### Class: WalletSigner
7003
8977
 
@@ -8857,16 +10831,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
8857
10831
 
8858
10832
  | | |
8859
10833
  | --- | --- |
8860
- | [Chain](#type-chain) | [PostReqsToNetworkDetailsStatus](#type-postreqstonetworkdetailsstatus) |
8861
- | [DBType](#type-dbtype) | [PostTxsService](#type-posttxsservice) |
8862
- | [DescriptionString5to2000Bytes](#type-descriptionstring5to2000bytes) | [ProvenTxReqStatus](#type-proventxreqstatus) |
8863
- | [EntityStorage](#type-entitystorage) | [ReqHistoryNote](#type-reqhistorynote) |
8864
- | [GetMerklePathService](#type-getmerklepathservice) | [StorageProvidedBy](#type-storageprovidedby) |
8865
- | [GetRawTxService](#type-getrawtxservice) | [SyncProtocolVersion](#type-syncprotocolversion) |
8866
- | [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [SyncStatus](#type-syncstatus) |
8867
- | [GetUtxoStatusService](#type-getutxostatusservice) | [TransactionStatus](#type-transactionstatus) |
8868
- | [MonitorStorage](#type-monitorstorage) | [UpdateFiatExchangeRateService](#type-updatefiatexchangerateservice) |
8869
- | [PostBeefService](#type-postbeefservice) | |
10834
+ | [Chain](#type-chain) | [PostBeefService](#type-postbeefservice) |
10835
+ | [DBType](#type-dbtype) | [PostReqsToNetworkDetailsStatus](#type-postreqstonetworkdetailsstatus) |
10836
+ | [DescriptionString5to2000Bytes](#type-descriptionstring5to2000bytes) | [PostTxsService](#type-posttxsservice) |
10837
+ | [EntityStorage](#type-entitystorage) | [ProvenTxReqStatus](#type-proventxreqstatus) |
10838
+ | [GetMerklePathService](#type-getmerklepathservice) | [ReqHistoryNote](#type-reqhistorynote) |
10839
+ | [GetRawTxService](#type-getrawtxservice) | [StorageProvidedBy](#type-storageprovidedby) |
10840
+ | [GetUtxoStatusOutputFormat](#type-getutxostatusoutputformat) | [SyncProtocolVersion](#type-syncprotocolversion) |
10841
+ | [GetUtxoStatusService](#type-getutxostatusservice) | [SyncStatus](#type-syncstatus) |
10842
+ | [MonitorStorage](#type-monitorstorage) | [TransactionStatus](#type-transactionstatus) |
10843
+ | [PermissionEventHandler](#type-permissioneventhandler) | [UpdateFiatExchangeRateService](#type-updatefiatexchangerateservice) |
8870
10844
 
8871
10845
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
8872
10846
 
@@ -8962,6 +10936,21 @@ See also: [WalletStorageManager](./storage.md#class-walletstoragemanager)
8962
10936
 
8963
10937
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
8964
10938
 
10939
+ ---
10940
+ ##### Type: PermissionEventHandler
10941
+
10942
+ Signature for functions that handle a permission request event, e.g. "Please ask the user to allow basket X".
10943
+
10944
+ ```ts
10945
+ export type PermissionEventHandler = (request: PermissionRequest & {
10946
+ requestID: string;
10947
+ }) => void | Promise<void>
10948
+ ```
10949
+
10950
+ See also: [PermissionRequest](./client.md#interface-permissionrequest)
10951
+
10952
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
10953
+
8965
10954
  ---
8966
10955
  ##### Type: PostBeefService
8967
10956
 
@@ -9105,22 +11094,69 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
9105
11094
  ---
9106
11095
  #### Variables
9107
11096
 
9108
- | |
9109
- | --- |
9110
- | [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) |
9111
- | [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) |
9112
- | [brc29ProtocolID](#variable-brc29protocolid) |
9113
- | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) |
9114
- | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) |
9115
- | [specOpInvalidChange](#variable-specopinvalidchange) |
9116
- | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
9117
- | [specOpWalletBalance](#variable-specopwalletbalance) |
9118
- | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
11097
+ | | |
11098
+ | --- | --- |
11099
+ | [DEFAULT_SETTINGS](#variable-default_settings) | [parseResults](#variable-parseresults) |
11100
+ | [PBKDF2_NUM_ROUNDS](#variable-pbkdf2_num_rounds) | [queryOverlay](#variable-queryoverlay) |
11101
+ | [ProvenTxReqNonTerminalStatus](#variable-proventxreqnonterminalstatus) | [specOpInvalidChange](#variable-specopinvalidchange) |
11102
+ | [ProvenTxReqTerminalStatus](#variable-proventxreqterminalstatus) | [specOpSetWalletChangeParams](#variable-specopsetwalletchangeparams) |
11103
+ | [TESTNET_DEFAULT_SETTINGS](#variable-testnet_default_settings) | [specOpWalletBalance](#variable-specopwalletbalance) |
11104
+ | [brc29ProtocolID](#variable-brc29protocolid) | [transactionColumnsWithoutRawTx](#variable-transactioncolumnswithoutrawtx) |
11105
+ | [maxPossibleSatoshis](#variable-maxpossiblesatoshis) | [transformVerifiableCertificatesWithTrust](#variable-transformverifiablecertificateswithtrust) |
11106
+ | [outputColumnsWithoutLockingScript](#variable-outputcolumnswithoutlockingscript) | |
11107
+
11108
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11109
+
11110
+ ---
11111
+
11112
+ ##### Variable: DEFAULT_SETTINGS
11113
+
11114
+ ```ts
11115
+ DEFAULT_SETTINGS = {
11116
+ trustSettings: {
11117
+ trustLevel: 2,
11118
+ trustedCertifiers: [
11119
+ {
11120
+ name: "Babbage Trust Services",
11121
+ description: "Resolves identity information for Babbage-run APIs and Bitcoin infrastructure.",
11122
+ iconUrl: "https://projectbabbage.com/favicon.ico",
11123
+ identityKey: "028703956178067ea7ca405111f1ca698290a0112a3d7cf3d843e195bf58a7cfa6",
11124
+ trust: 4
11125
+ },
11126
+ {
11127
+ name: "IdentiCert",
11128
+ description: "Certifies legal first and last name, and photos",
11129
+ iconUrl: "https://identicert.me/favicon.ico",
11130
+ trust: 5,
11131
+ identityKey: "0295bf1c7842d14babf60daf2c733956c331f9dcb2c79e41f85fd1dda6a3fa4549"
11132
+ },
11133
+ {
11134
+ name: "SocialCert",
11135
+ description: "Certifies social media handles, phone numbers and emails",
11136
+ iconUrl: "https://socialcert.net/favicon.ico",
11137
+ trust: 3,
11138
+ identityKey: "03285263f06139b66fb27f51cf8a92e9dd007c4c4b83876ad6c3e7028db450a4c2"
11139
+ }
11140
+ ]
11141
+ },
11142
+ theme: { mode: "dark" }
11143
+ } as WalletSettings
11144
+ ```
11145
+
11146
+ See also: [WalletSettings](./client.md#interface-walletsettings)
9119
11147
 
9120
11148
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
9121
11149
 
9122
11150
  ---
11151
+ ##### Variable: PBKDF2_NUM_ROUNDS
11152
+
11153
+ ```ts
11154
+ PBKDF2_NUM_ROUNDS = 7777
11155
+ ```
11156
+
11157
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
9123
11158
 
11159
+ ---
9124
11160
  ##### Variable: ProvenTxReqNonTerminalStatus
9125
11161
 
9126
11162
  ```ts
@@ -9152,6 +11188,26 @@ See also: [ProvenTxReqStatus](./client.md#type-proventxreqstatus)
9152
11188
 
9153
11189
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
9154
11190
 
11191
+ ---
11192
+ ##### Variable: TESTNET_DEFAULT_SETTINGS
11193
+
11194
+ ```ts
11195
+ TESTNET_DEFAULT_SETTINGS: WalletSettings = {
11196
+ ...DEFAULT_SETTINGS,
11197
+ trustSettings: {
11198
+ ...DEFAULT_SETTINGS.trustSettings,
11199
+ trustedCertifiers: DEFAULT_SETTINGS.trustSettings.trustedCertifiers.map(certifier => ({
11200
+ ...certifier,
11201
+ identityKey: TESTNET_IDENTITY_KEYS[certifier.name] || certifier.identityKey
11202
+ }))
11203
+ }
11204
+ }
11205
+ ```
11206
+
11207
+ See also: [DEFAULT_SETTINGS](./client.md#variable-default_settings), [WalletSettings](./client.md#interface-walletsettings)
11208
+
11209
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11210
+
9155
11211
  ---
9156
11212
  ##### Variable: brc29ProtocolID
9157
11213
 
@@ -9204,6 +11260,53 @@ outputColumnsWithoutLockingScript = [
9204
11260
 
9205
11261
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
9206
11262
 
11263
+ ---
11264
+ ##### Variable: parseResults
11265
+
11266
+ ```ts
11267
+ parseResults = async (lookupResult: LookupAnswer): Promise<VerifiableCertificate[]> => {
11268
+ if (lookupResult.type === "output-list") {
11269
+ const parsedResults: VerifiableCertificate[] = [];
11270
+ for (const output of lookupResult.outputs) {
11271
+ try {
11272
+ const tx = Transaction.fromBEEF(output.beef);
11273
+ const decodedOutput = PushDrop.decode(tx.outputs[output.outputIndex].lockingScript);
11274
+ const certificate: VerifiableCertificate = JSON.parse(Utils.toUTF8(decodedOutput.fields[0]));
11275
+ const verifiableCert = new VerifiableCertificate(certificate.type, certificate.serialNumber, certificate.subject, certificate.certifier, certificate.revocationOutpoint, certificate.fields, certificate.keyring, certificate.signature);
11276
+ const decryptedFields = await verifiableCert.decryptFields(new ProtoWallet("anyone"));
11277
+ await verifiableCert.verify();
11278
+ verifiableCert.decryptedFields = decryptedFields;
11279
+ parsedResults.push(verifiableCert);
11280
+ }
11281
+ catch (error) {
11282
+ console.error(error);
11283
+ }
11284
+ }
11285
+ return parsedResults;
11286
+ }
11287
+ return [];
11288
+ }
11289
+ ```
11290
+
11291
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11292
+
11293
+ ---
11294
+ ##### Variable: queryOverlay
11295
+
11296
+ ```ts
11297
+ queryOverlay = async (query: unknown, resolver: LookupResolver): Promise<VerifiableCertificate[]> => {
11298
+ const results = await resolver.query({
11299
+ service: "ls_identity",
11300
+ query
11301
+ });
11302
+ return await parseResults(results);
11303
+ }
11304
+ ```
11305
+
11306
+ See also: [parseResults](./client.md#variable-parseresults)
11307
+
11308
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11309
+
9207
11310
  ---
9208
11311
  ##### Variable: specOpInvalidChange
9209
11312
 
@@ -9254,6 +11357,60 @@ transactionColumnsWithoutRawTx = [
9254
11357
 
9255
11358
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
9256
11359
 
11360
+ ---
11361
+ ##### Variable: transformVerifiableCertificatesWithTrust
11362
+
11363
+ ```ts
11364
+ transformVerifiableCertificatesWithTrust = (trustSettings: TrustSettings, certificates: VerifiableCertificate[]): DiscoverCertificatesResult => {
11365
+ const identityGroups: Record<string, IdentityGroup> = {};
11366
+ const certifierCache: Record<string, Certifier> = {};
11367
+ certificates.forEach(cert => {
11368
+ const { subject, certifier } = cert;
11369
+ if (!subject || !certifier)
11370
+ return;
11371
+ if (!certifierCache[certifier]) {
11372
+ const found = trustSettings.trustedCertifiers.find(x => x.identityKey === certifier);
11373
+ if (!found)
11374
+ return;
11375
+ certifierCache[certifier] = found;
11376
+ }
11377
+ const certifierInfo: IdentityCertifier = {
11378
+ name: certifierCache[certifier].name,
11379
+ iconUrl: certifierCache[certifier].iconUrl || "",
11380
+ description: certifierCache[certifier].description,
11381
+ trust: certifierCache[certifier].trust
11382
+ };
11383
+ const extendedCert: IdentityCertificate = {
11384
+ ...cert,
11385
+ signature: cert.signature!,
11386
+ decryptedFields: cert.decryptedFields as Record<string, string>,
11387
+ publiclyRevealedKeyring: cert.keyring,
11388
+ certifierInfo
11389
+ };
11390
+ if (!identityGroups[subject]) {
11391
+ identityGroups[subject] = { totalTrust: 0, members: [] };
11392
+ }
11393
+ identityGroups[subject].totalTrust += certifierInfo.trust;
11394
+ identityGroups[subject].members.push(extendedCert);
11395
+ });
11396
+ const finalResults: ExtendedVerifiableCertificate[] = [];
11397
+ Object.values(identityGroups).forEach(group => {
11398
+ if (group.totalTrust >= trustSettings.trustLevel) {
11399
+ finalResults.push(...group.members);
11400
+ }
11401
+ });
11402
+ finalResults.sort((a, b) => b.certifierInfo.trust - a.certifierInfo.trust);
11403
+ return {
11404
+ totalCertificates: finalResults.length,
11405
+ certificates: finalResults
11406
+ };
11407
+ }
11408
+ ```
11409
+
11410
+ See also: [Certifier](./client.md#interface-certifier), [ExtendedVerifiableCertificate](./client.md#interface-extendedverifiablecertificate), [TrustSettings](./client.md#interface-trustsettings)
11411
+
11412
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
11413
+
9257
11414
  ---
9258
11415
 
9259
11416
  <!--#endregion ts2md-api-merged-here-->