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