Documentation ¶
Index ¶
- Constants
- func ChangeExternalPassword(_ js.Value, args []js.Value) any
- func CheckAndStoreVersions() error
- func DecrementNumClientsRunning()
- func GetIndexedDbList() (map[string]struct{}, error)
- func GetOldClientSemVersion() string
- func GetOldWasmSemVersion() string
- func GetOrInitPassword(_ js.Value, args []js.Value) any
- func IncrementNumClientsRunning()
- func Purge(_ js.Value, args []js.Value) any
- func StoreIndexedDb(databaseName string) error
- func StoreIndexedDbEncryptionStatus(databaseName string, encryptionStatus bool) (loadedEncryptionStatus bool, err error)
- func VerifyPassword(_ js.Value, args []js.Value) any
Constants ¶
const SEMVER = "0.3.21"
SEMVER is the current semantic version of xxDK WASM.
Variables ¶
This section is empty.
Functions ¶
func ChangeExternalPassword ¶
ChangeExternalPassword allows a user to change their external password.
Parameters:
- args[0] - The user's old password (string).
- args[1] - The user's new password (string).
Returns:
- Throws TypeError on failure.
func CheckAndStoreVersions ¶
func CheckAndStoreVersions() error
CheckAndStoreVersions checks that the stored xxDK WASM version matches the current version and if not, upgrades it. It also stored the current xxDK client to storage.
On first load, only the xxDK WASM and xxDK client versions are stored.
func DecrementNumClientsRunning ¶
func DecrementNumClientsRunning()
DecrementNumClientsRunning decrements the number client tracker. This should be called when stopping the network follower.
func GetIndexedDbList ¶
GetIndexedDbList returns the list of stored indexedDb databases.
func GetOldClientSemVersion ¶ added in v0.3.0
func GetOldClientSemVersion() string
GetOldClientSemVersion returns the old version of xxdk client before being updated.
func GetOldWasmSemVersion ¶ added in v0.3.0
func GetOldWasmSemVersion() string
GetOldWasmSemVersion returns the old version of xxdk WASM before being updated.
func GetOrInitPassword ¶
GetOrInitPassword takes a user-provided password and returns its associated 256-bit internal password.
If the internal password has not previously been created, then it is generated, saved to local storage, and returned. If the internal password has been previously generated, it is retrieved from local storage and returned.
Any password saved to local storage is encrypted using the user-provided password.
Parameters:
- args[0] - The user supplied password (string).
Returns a promise:
- Internal password (Uint8Array).
- Throws TypeError on failure.
func IncrementNumClientsRunning ¶
func IncrementNumClientsRunning()
IncrementNumClientsRunning increments the number client tracker. This should be called when starting the network follower.
func Purge ¶
Purge clears all local storage and indexedDb databases saved by this WASM binary. This can only occur when no cMix followers are running. The user's password is required.
Parameters:
- args[0] - The user-supplied password (string). This is the same password passed into [wasm.NewCmix].
Returns:
- Throws an error if the password is incorrect or if not all cMix followers have been stopped.
func StoreIndexedDb ¶
StoreIndexedDb saved the indexedDb database name to storage.
Types ¶
This section is empty.