@tauri-apps/plugin-stronghold
new Client(path, name): Client| 参数 | 类型 |
|---|---|
path | string |
名称 (name) | ClientPath |
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L265
getStore(): Store来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L280
getVault(name): Vault根据名称获取库(vault)。
| 参数 | 类型 | 描述 |
|---|---|---|
名称 (name) | VaultPath |
来源: 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> |
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L86
| 属性 | 类型 | 定义于 |
|---|---|---|
payload | Record<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 | 数字 |
来源: 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 |
来源: 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 |
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L289
get(key): Promise<null | Uint8Array<ArrayBufferLike>>| 参数 | 类型 |
|---|---|
key | StoreKey |
Promise<null | Uint8Array<ArrayBufferLike>>
来源: 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<ArrayBufferLike>>| 参数 | 类型 |
|---|---|
key | StoreKey |
Promise<null | Uint8Array<ArrayBufferLike>>
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L316
对 Stronghold 的访问的表现形式。
| 属性 | 类型 | 定义于 |
|---|---|---|
path | string | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L388 |
createClient(client): Promise<Client>| 参数 | 类型 |
|---|---|
client | ClientPath |
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L428
loadClient(client): Promise<Client>| 参数 | 类型 |
|---|---|
client | ClientPath |
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L421
save(): Promise<void>将 Stronghold 状态持久化到快照中。
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>加载快照(如果存在,则密码必须匹配),否则启动一个新的 Stronghold 实例。
| 参数 | 类型 | 描述 |
|---|---|---|
path | string | - |
password | string |
来源: 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 |
ProcedureExecutor.constructor
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L340
| 属性 | 类型 | 描述 | 继承自 (Inherited from) | 定义于 |
|---|---|---|---|---|
client | ClientPath | - | - | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L336 |
name | VaultPath | 库(vault)名称。 | - | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L338 |
path | string | 库(vault)路径。 | - | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L335 |
procedureArgs | Record<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<ArrayBufferLike>>使用种子或密钥派生 SLIP10 私钥。
| 参数 | 类型 | 描述 |
|---|---|---|
chain | 数字[] | 链路径。 |
source | "Seed" | "Key" | 源类型,可以是“Seed”或“Key”。 |
sourceLocation | Location | 源位置,必须是之前调用 generateSLIP10Seed 或 deriveSLIP10 时的 outputLocation。 |
outputLocation | Location | 存储私钥的记录位置。 |
Promise<Uint8Array<ArrayBufferLike>>
ProcedureExecutor.deriveSLIP10
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L145
generateBIP39(outputLocation, passphrase?): Promise<Uint8Array<ArrayBufferLike>>生成一个 BIP39 种子。
| 参数 | 类型 | 描述 |
|---|---|---|
outputLocation | Location | 存储 BIP39 种子的记录位置。 |
passphrase? | string | 可选的助记词密码。 |
Promise<Uint8Array<ArrayBufferLike>>
ProcedureExecutor.generateBIP39
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L200
generateSLIP10Seed(outputLocation, sizeBytes?): Promise<Uint8Array<ArrayBufferLike>>为指定位置生成一个 SLIP10 种子。
| 参数 | 类型 | 描述 |
|---|---|---|
outputLocation | Location | 存储种子的记录位置。 |
sizeBytes? | 数字 | SLIP10 种子的大小(字节)。 |
Promise<Uint8Array<ArrayBufferLike>>
ProcedureExecutor.generateSLIP10Seed
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L120
getEd25519PublicKey(privateKeyLocation): Promise<Uint8Array<ArrayBufferLike>>获取 SLIP10 私钥的 Ed25519 公钥。
| 参数 | 类型 | 描述 |
|---|---|---|
privateKeyLocation | Location | 私钥位置。必须是之前调用 deriveSLIP10 时的 outputLocation。 |
Promise<Uint8Array<ArrayBufferLike>>
一个解析为公钥十六进制字符串的 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<ArrayBufferLike>>存储 BIP39 助记词。
| 参数 | 类型 | 描述 |
|---|---|---|
mnemonic | string | 助记词字符串。 |
outputLocation | Location | 存储 BIP39 助记词的记录位置。 |
passphrase? | string | 可选的助记词密码。 |
Promise<Uint8Array<ArrayBufferLike>>
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<ArrayBufferLike>>使用私钥创建 Ed25519 签名。
| 参数 | 类型 | 描述 |
|---|---|---|
privateKeyLocation | Location | 存储私钥的记录位置。必须是之前调用 deriveSLIP10 时的 outputLocation。 |
msg | string | 要签名的消息。 |
Promise<Uint8Array<ArrayBufferLike>>
一个解析为签名十六进制字符串的 Promise。
2.0.0
ProcedureExecutor.signEd25519
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L244
| 属性 | 类型 | 定义于 |
|---|---|---|
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 |
| 属性 | 类型 | 定义于 |
|---|---|---|
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 |
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
© 2026 Tauri 贡献者。CC-BY / MIT