@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
按名称获取保险库。
参数 | 类型 | 描述 |
---|---|---|
名称 (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>
参数 | 类型 |
---|---|
键 (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 |
来源: 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>
将要塞状态持久化到快照中。
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) |
来源: 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 | 保险库名称。 | - | 来源: 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 |
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>
使用种子或密钥派生 SLIP10 私钥。
参数 | 类型 | 描述 |
---|---|---|
链 (chain) | 数字 [] | 链路径。 |
来源 (source) | "Seed" | "Key" | 源类型,可以是“Seed”或“Key”。 |
源位置 (sourceLocation) | 位置 (Location) | 源位置,必须是之前调用 generateSLIP10Seed 或 deriveSLIP10 的 outputLocation 。 |
输出位置 (outputLocation) | 位置 (Location) | 私钥将存储在记录中的位置。 |
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) | 可选的助记密码。 |
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 种子的字节大小。 |
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) | 私钥的位置。必须是之前调用 deriveSLIP10 的 outputLocation 。 |
一个解析为公钥十六进制字符串的 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) | 可选的助记密码。 |
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) | 私钥存储在记录中的位置。必须是之前调用 deriveSLIP10 的 outputLocation 。 |
消息 (msg) | 字符串 (string) | 要签名的消息。 |
一个解析为签名十六进制字符串的 Promise。
2.0.0
ProcedureExecutor.signEd25519
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L244
属性 | 类型 | 定义于 |
---|---|---|
peers | Map <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 |
属性 | 类型 | 定义于 |
---|---|---|
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
© 2025 Tauri 贡献者。CC-BY / MIT