mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
fmt
This commit is contained in:
@@ -140,14 +140,14 @@ class ProcedureExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Derive a SLIP10 private key using a seed or key.
|
* Derive a SLIP10 private key using a seed or key.
|
||||||
* @param chain The chain path.
|
* @param chain The chain path.
|
||||||
* @param source The source type, either 'Seed' or 'Key'.
|
* @param source The source type, either 'Seed' or 'Key'.
|
||||||
* @param sourceLocation The source location, must be the `outputLocation` of a previous call to `generateSLIP10Seed` or `deriveSLIP10`.
|
* @param sourceLocation The source location, must be the `outputLocation` of a previous call to `generateSLIP10Seed` or `deriveSLIP10`.
|
||||||
* @param outputLocation Location of the record where the private key will be stored.
|
* @param outputLocation Location of the record where the private key will be stored.
|
||||||
* @param hint The record hint.
|
* @param hint The record hint.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async deriveSLIP10(
|
async deriveSLIP10(
|
||||||
chain: number[],
|
chain: number[],
|
||||||
source: "Seed" | "Key",
|
source: "Seed" | "Key",
|
||||||
@@ -171,13 +171,13 @@ class ProcedureExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a BIP39 mnemonic.
|
* Store a BIP39 mnemonic.
|
||||||
* @param mnemonic The mnemonic string.
|
* @param mnemonic The mnemonic string.
|
||||||
* @param outputLocation The location of the record where the BIP39 mnemonic will be stored.
|
* @param outputLocation The location of the record where the BIP39 mnemonic will be stored.
|
||||||
* @param passphrase The optional mnemonic passphrase.
|
* @param passphrase The optional mnemonic passphrase.
|
||||||
* @param hint The record hint.
|
* @param hint The record hint.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async recoverBIP39(
|
async recoverBIP39(
|
||||||
mnemonic: string,
|
mnemonic: string,
|
||||||
outputLocation: Location,
|
outputLocation: Location,
|
||||||
@@ -197,12 +197,12 @@ class ProcedureExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a BIP39 seed.
|
* Generate a BIP39 seed.
|
||||||
* @param outputLocation The location of the record where the BIP39 seed will be stored.
|
* @param outputLocation The location of the record where the BIP39 seed will be stored.
|
||||||
* @param passphrase The optional mnemonic passphrase.
|
* @param passphrase The optional mnemonic passphrase.
|
||||||
* @param hint The record hint.
|
* @param hint The record hint.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async generateBIP39(
|
async generateBIP39(
|
||||||
outputLocation: Location,
|
outputLocation: Location,
|
||||||
passphrase?: string
|
passphrase?: string
|
||||||
@@ -220,10 +220,10 @@ class ProcedureExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the Ed25519 public key of a SLIP10 private key.
|
* Gets the Ed25519 public key of a SLIP10 private key.
|
||||||
* @param privateKeyLocation The location of the private key. Must be the `outputLocation` of a previous call to `deriveSLIP10`.
|
* @param privateKeyLocation The location of the private key. Must be the `outputLocation` of a previous call to `deriveSLIP10`.
|
||||||
* @returns A promise resolving to the public key hex string.
|
* @returns A promise resolving to the public key hex string.
|
||||||
*/
|
*/
|
||||||
async getEd25519PublicKey(privateKeyLocation: Location): Promise<Uint8Array> {
|
async getEd25519PublicKey(privateKeyLocation: Location): Promise<Uint8Array> {
|
||||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||||
...this.procedureArgs,
|
...this.procedureArgs,
|
||||||
@@ -238,11 +238,11 @@ class ProcedureExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Ed25519 signature from a private key.
|
* Creates a Ed25519 signature from a private key.
|
||||||
* @param privateKeyLocation The location of the record where the private key is stored. Must be the `outputLocation` of a previous call to `deriveSLIP10`.
|
* @param privateKeyLocation The location of the record where the private key is stored. Must be the `outputLocation` of a previous call to `deriveSLIP10`.
|
||||||
* @param msg The message to sign.
|
* @param msg The message to sign.
|
||||||
* @returns A promise resolving to the signature hex string.
|
* @returns A promise resolving to the signature hex string.
|
||||||
*/
|
*/
|
||||||
async signEd25519(
|
async signEd25519(
|
||||||
privateKeyLocation: Location,
|
privateKeyLocation: Location,
|
||||||
msg: string
|
msg: string
|
||||||
@@ -270,11 +270,11 @@ export class Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a vault by name.
|
* Get a vault by name.
|
||||||
* @param name
|
* @param name
|
||||||
* @param flags
|
* @param flags
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getVault(name: VaultPath): Vault {
|
getVault(name: VaultPath): Vault {
|
||||||
return new Vault(this.path, this.name, toBytesDto(name));
|
return new Vault(this.path, this.name, toBytesDto(name));
|
||||||
}
|
}
|
||||||
@@ -351,12 +351,12 @@ export class Vault extends ProcedureExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert a record to this vault.
|
* Insert a record to this vault.
|
||||||
* @param location The record location.
|
* @param location The record location.
|
||||||
* @param record The record data.
|
* @param record The record data.
|
||||||
* @param recordHint The record hint.
|
* @param recordHint The record hint.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async insert(recordPath: RecordPath, secret: number[]): Promise<void> {
|
async insert(recordPath: RecordPath, secret: number[]): Promise<void> {
|
||||||
return await invoke("plugin:stronghold|save_secret", {
|
return await invoke("plugin:stronghold|save_secret", {
|
||||||
snapshotPath: this.path,
|
snapshotPath: this.path,
|
||||||
@@ -414,7 +414,7 @@ export class Stronghold {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove this instance from the cache.
|
* Remove this instance from the cache.
|
||||||
*/
|
*/
|
||||||
async unload(): Promise<void> {
|
async unload(): Promise<void> {
|
||||||
return await invoke("plugin:stronghold|destroy", {
|
return await invoke("plugin:stronghold|destroy", {
|
||||||
snapshotPath: this.path,
|
snapshotPath: this.path,
|
||||||
@@ -436,9 +436,9 @@ export class Stronghold {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persists the stronghold state to the snapshot.
|
* Persists the stronghold state to the snapshot.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async save(): Promise<void> {
|
async save(): Promise<void> {
|
||||||
return await invoke("plugin:stronghold|save", {
|
return await invoke("plugin:stronghold|save", {
|
||||||
snapshotPath: this.path,
|
snapshotPath: this.path,
|
||||||
|
|||||||
Reference in New Issue
Block a user