跳到内容
Tauri

@tauri-apps/plugin-stronghold

客户端

构造函数

new Client()
new Client(path, name): Client
参数
参数类型
pathstring
nameClientPath
返回值

客户端

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

属性

属性类型定义于
nameClientPathSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L263
pathstringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L262

方法

getStore()
getStore(): Store
返回值

存储

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

getVault()
getVault(name): Vault

通过名称获取 vault。

参数
参数类型描述
nameVaultPath
返回值

Vault

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


位置

构造函数

new Location()
new Location(type, payload): Location
参数
参数类型
typestring
payloadRecord<string, unknown>
返回值

位置

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

属性

属性类型定义于
payloadRecord<string, unknown>Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L84
typestringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L83

方法

counter()
static counter(vault, counter): Location
参数
参数类型
vaultVaultPath
counternumber
返回值

位置

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

generic()
static generic(vault, record): Location
参数
参数类型
vaultVaultPath
recordRecordPath
返回值

位置

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


存储

构造函数

new Store()
new Store(path, client): Store
参数
参数类型
pathstring
clientClientPath
返回值

存储

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

属性

属性类型定义于
clientClientPathSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L287
pathstringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L286

方法

get()
get(key): Promise<null | Uint8Array<ArrayBufferLike>>
参数
参数类型
keyStoreKey
返回值

Promise<null | Uint8Array<ArrayBufferLike>>

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

insert()
insert(
key,
value,
lifetime?): Promise<void>
参数
参数类型
keyStoreKey
valuenumber[]
lifetime?Duration
返回值

Promise<void>

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

remove()
remove(key): Promise<null | Uint8Array<ArrayBufferLike>>
参数
参数类型
keyStoreKey
返回值

Promise<null | Uint8Array<ArrayBufferLike>>

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


Stronghold

表示对 stronghold 的访问。

属性

属性类型定义于
pathstringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L388

方法

createClient()
createClient(client): Promise<Client>
参数
参数类型
clientClientPath
返回值

Promise<Client>

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

loadClient()
loadClient(client): Promise<Client>
参数
参数类型
clientClientPath
返回值

Promise<Client>

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

save()
save(): Promise<void>

将 stronghold 状态持久化到快照。

返回值

Promise<void>

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

unload()
unload(): Promise<void>

从缓存中删除此实例。

返回值

Promise<void>

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

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

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

参数
参数类型描述
pathstring-
passwordstring
返回值

Promise<Stronghold>

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


Vault

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

继承自

  • ProcedureExecutor

构造函数

new Vault()
new Vault(
path,
client,
name): Vault
参数
参数类型
pathstring
clientClientPath
nameVaultPath
返回值

Vault

覆盖

ProcedureExecutor.constructor

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

属性

属性类型描述继承自定义于
clientClientPath--Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L336
nameVaultPathvault 名称。-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L338
pathstringvault 路径。-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L335
procedureArgsRecord<string, unknown>-ProcedureExecutor.procedureArgsSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L107

方法

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

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

参数
参数类型描述
chainnumber[]链路径。
source"Seed" | "Key"源类型,可以是 “Seed” 或 “Key”。
sourceLocation位置源位置,必须是先前调用 generateSLIP10SeedderiveSLIP10outputLocation
outputLocation位置私钥将存储在其中的记录的位置。
返回值

Promise<Uint8Array<ArrayBufferLike>>

继承自

ProcedureExecutor.deriveSLIP10

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

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

生成 BIP39 种子。

参数
参数类型描述
outputLocation位置BIP39 种子将存储在其中的记录的位置。
passphrase?string可选的助记词密码。
返回值

Promise<Uint8Array<ArrayBufferLike>>

继承自

ProcedureExecutor.generateBIP39

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

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

为给定位置生成 SLIP10 种子。

参数
参数类型描述
outputLocation位置种子将存储在其中的记录的位置。
sizeBytes?numberSLIP10 种子的字节大小。
返回值

Promise<Uint8Array<ArrayBufferLike>>

继承自

ProcedureExecutor.generateSLIP10Seed

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

getEd25519PublicKey()
getEd25519PublicKey(privateKeyLocation): Promise<Uint8Array<ArrayBufferLike>>

获取 SLIP10 私钥的 Ed25519 公钥。

参数
参数类型描述
privateKeyLocation位置私钥的位置。 必须是先前调用 deriveSLIP10outputLocation
返回值

Promise<Uint8Array<ArrayBufferLike>>

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

自从

2.0.0

继承自

ProcedureExecutor.getEd25519PublicKey

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

insert()
insert(recordPath, secret): Promise<void>

将记录插入到此 vault 中。

参数
参数类型
recordPathRecordPath
secretnumber[]
返回值

Promise<void>

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

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

存储 BIP39 助记词。

参数
参数类型描述
mnemonicstring助记词字符串。
outputLocation位置BIP39 助记词将存储在其中的记录的位置。
passphrase?string可选的助记词密码。
返回值

Promise<Uint8Array<ArrayBufferLike>>

继承自

ProcedureExecutor.recoverBIP39

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

remove()
remove(location): Promise<void>

从 vault 中删除记录。

参数
参数类型描述
location位置记录位置。
返回值

Promise<void>

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

signEd25519()
signEd25519(privateKeyLocation, msg): Promise<Uint8Array<ArrayBufferLike>>

从私钥创建 Ed25519 签名。

参数
参数类型描述
privateKeyLocation位置存储私钥的记录的位置。 必须是先前调用 deriveSLIP10outputLocation
msgstring要签名的消息。
返回值

Promise<Uint8Array<ArrayBufferLike>>

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

自从

2.0.0

继承自

ProcedureExecutor.signEd25519

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

接口

AddressInfo

属性

属性类型定义于
peersMap<string, PeerAddress>Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L43
relaysstring[]Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L44

ClientAccess

属性

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

ConnectionLimits

属性

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

Duration

持续时间定义。

属性

属性类型描述定义于
nanosnumber此 Duration 的小数部分,以纳秒为单位。 必须大于或等于 0 且小于 1e+9(一秒钟内的最大纳秒数)Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L79
secsnumber此 Duration 包含的完整秒数。Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L77

NetworkConfig

属性

属性类型定义于
addresses?AddressInfoSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L69
connectionsLimit?ConnectionLimitsSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L66
connectionTimeout?DurationSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L65
enableMdns?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L67
enableRelay?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L68
peerPermissions?Map<string, Permissions>Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L70
permissionsDefault?权限Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L71
requestTimeout?DurationSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L64

PeerAddress

属性

属性类型定义于
knownstring[]Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L38
use_relay_fallbackbooleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L39

权限

属性

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

类型别名

ClientPath

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

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


RecordPath

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

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


StoreKey

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

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


VaultPath

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

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


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