跳到内容
Tauri

@tauri-apps/plugin-stronghold

new Client(path, name): Client
参数类型
path字符串 (string)
名称 (name)ClientPath

客户端 (Client)

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L265

属性类型定义于
nameClientPath来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L263
path字符串 (string)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L262

getStore(): Store

存储 (Store)

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L280

getVault(name): Vault

按名称获取保险库。

参数类型描述
名称 (name)VaultPath

保险库 (Vault)

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L276


new Location(type, payload): Location
参数类型
类型 (type)字符串 (string)
载荷 (payload)Record<string, unknown>

位置 (Location)

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L86

属性类型定义于
payloadRecord<string, unknown>来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L84
type字符串 (string)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L83

static counter(vault, counter): Location
参数类型
保险库 (vault)VaultPath
计数器 (counter)数字

位置 (Location)

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L98

static generic(vault, record): Location
参数类型
保险库 (vault)VaultPath
记录 (record)RecordPath

位置 (Location)

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L91


new Store(path, client): Store
参数类型
path字符串 (string)
客户端 (client)ClientPath

存储 (Store)

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L289

属性类型定义于
clientClientPath来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L287
path字符串 (string)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L286

get(key): Promise<null | Uint8Array>
参数类型
键 (key)StoreKey

Promise<null | Uint8Array>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L294

insert(
key,
value,
lifetime?): Promise<void>
参数类型
键 (key)StoreKey
值 (value)数字[]
生命周期 (lifetime)?Duration

Promise<void>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L302

remove(key): Promise<null | Uint8Array>
参数类型
键 (key)StoreKey

Promise<null | Uint8Array>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L316


要塞访问的表示。

属性类型定义于
path字符串 (string)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L388

createClient(client): Promise<Client>
参数类型
客户端 (client)ClientPath

Promise<客户端 (Client)>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L428

loadClient(client): Promise<Client>
参数类型
客户端 (client)ClientPath

Promise<客户端 (Client)>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L421

save(): Promise<void>

将要塞状态持久化到快照中。

Promise<void>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L439

unload(): Promise<void>

从缓存中移除此实例。

Promise<void>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L415

static load(path, password): Promise<Stronghold>

如果快照存在(密码必须匹配),则加载快照;否则启动一个新的要塞实例。

参数类型描述
path字符串 (string)-
密码 (password)字符串 (string)

Promise<要塞 (Stronghold)>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L405


一个允许创建、更新和删除操作的键值存储。它不允许读取数据,因此必须使用其中一个过程来操作存储的数据,从而实现安全的秘密存储。

  • ProcedureExecutor

new Vault(
path,
client,
name): Vault
参数类型
path字符串 (string)
客户端 (client)ClientPath
名称 (name)VaultPath

保险库 (Vault)

ProcedureExecutor.constructor

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L340

属性类型描述继承自 (Inherited from)定义于
clientClientPath--来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L336
nameVaultPath保险库名称。-来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L338
path字符串 (string)保险库路径。-来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L335
procedureArgsRecord<string, unknown>-ProcedureExecutor.procedureArgs来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L107

deriveSLIP10(
chain,
source,
sourceLocation,
outputLocation): Promise<Uint8Array>

使用种子或密钥派生 SLIP10 私钥。

参数类型描述
链 (chain)数字[]链路径。
来源 (source)"Seed" | "Key"源类型,可以是“Seed”或“Key”。
源位置 (sourceLocation)位置 (Location)源位置,必须是之前调用 generateSLIP10SeedderiveSLIP10outputLocation
输出位置 (outputLocation)位置 (Location)私钥将存储在记录中的位置。

Promise<Uint8Array>

ProcedureExecutor.deriveSLIP10

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L145

generateBIP39(outputLocation, passphrase?): Promise<Uint8Array>

生成一个 BIP39 种子。

参数类型描述
输出位置 (outputLocation)位置 (Location)BIP39 种子将存储在记录中的位置。
密码 (passphrase)?字符串 (string)可选的助记密码。

Promise<Uint8Array>

ProcedureExecutor.generateBIP39

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L200

generateSLIP10Seed(outputLocation, sizeBytes?): Promise<Uint8Array>

为给定位置生成 SLIP10 种子。

参数类型描述
输出位置 (outputLocation)位置 (Location)种子将存储在记录中的位置。
字节大小 (sizeBytes)?数字SLIP10 种子的字节大小。

Promise<Uint8Array>

ProcedureExecutor.generateSLIP10Seed

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L120

getEd25519PublicKey(privateKeyLocation): Promise<Uint8Array>

获取 SLIP10 私钥的 Ed25519 公钥。

参数类型描述
私钥位置 (privateKeyLocation)位置 (Location)私钥的位置。必须是之前调用 deriveSLIP10outputLocation

Promise<Uint8Array>

一个解析为公钥十六进制字符串的 Promise。

2.0.0

ProcedureExecutor.getEd25519PublicKey

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L223

insert(recordPath, secret): Promise<void>

将记录插入此保险库。

参数类型
记录路径 (recordPath)RecordPath
秘密 (secret)数字[]

Promise<void>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L358

recoverBIP39(
mnemonic,
outputLocation,
passphrase?): Promise<Uint8Array>

存储 BIP39 助记词。

参数类型描述
助记词 (mnemonic)字符串 (string)助记字符串。
输出位置 (outputLocation)位置 (Location)BIP39 助记词将存储在记录中的位置。
密码 (passphrase)?字符串 (string)可选的助记密码。

Promise<Uint8Array>

ProcedureExecutor.recoverBIP39

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L175

remove(location): Promise<void>

从保险库中移除一条记录。

参数类型描述
位置 (location)位置 (Location)记录位置。

Promise<void>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L374

signEd25519(privateKeyLocation, msg): Promise<Uint8Array>

从私钥创建 Ed25519 签名。

参数类型描述
私钥位置 (privateKeyLocation)位置 (Location)私钥存储在记录中的位置。必须是之前调用 deriveSLIP10outputLocation
消息 (msg)字符串 (string)要签名的消息。

Promise<Uint8Array>

一个解析为签名十六进制字符串的 Promise。

2.0.0

ProcedureExecutor.signEd25519

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L244

属性类型定义于
peersMap<string, PeerAddress>来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L43
relays字符串 (string)[]来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L44

属性类型定义于
cloneVaultDefault?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L52
cloneVaultExceptions?Map<VaultPath, boolean>来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L53
readStore?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L54
useVaultDefault?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L48
useVaultExceptions?Map<VaultPath, boolean>来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L49
writeStore?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L55
writeVaultDefault?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L50
writeVaultExceptions?Map<VaultPath, boolean>来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L51

属性类型定义于
maxEstablishedIncoming?数字来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L31
maxEstablishedOutgoing?数字来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L32
maxEstablishedPerPeer?数字来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L33
maxEstablishedTotal?数字来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L34
maxPendingIncoming?数字来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L29
maxPendingOutgoing?数字来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L30

持续时间定义。

属性类型描述定义于
nanos数字此持续时间的小数部分,以纳秒为单位。必须大于或等于 0 且小于 1e+9(一秒中纳秒的最大数量)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L79
secs数字此持续时间包含的完整秒数。来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L77

属性类型定义于
addresses?AddressInfo来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L69
connectionTimeout?Duration来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L65
connectionsLimit?ConnectionLimits来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L66
enableMdns?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L67
enableRelay?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L68
peerPermissions?Map<string, Permissions>来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L70
permissionsDefault?Permissions来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L71
requestTimeout?Duration来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L64

属性类型定义于
known字符串 (string)[]来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L38
use_relay_fallback布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L39

属性类型定义于
default?ClientAccess来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L59
exceptions?Map<VaultPath, ClientAccess>来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L60

type ClientPath: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L7


type RecordPath: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L17


type StoreKey: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L22


type VaultPath: string | Iterable<number> | ArrayLike<number> | ArrayBuffer;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L12


© 2025 Tauri 贡献者。CC-BY / MIT