@tauri-apps/plugin-stronghold
类
客户端
构造函数
new Client()
new Client(path, name): Client
参数
参数 | 类型 |
---|---|
path | string |
name | ClientPath |
返回值
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L265
属性
方法
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。
参数
参数 | 类型 | 描述 |
---|---|---|
name | VaultPath |
返回值
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L276
位置
构造函数
new Location()
new Location(type, payload): Location
参数
参数 | 类型 |
---|---|
type | string |
payload | Record <string , unknown > |
返回值
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L86
属性
属性 | 类型 | 定义于 |
---|---|---|
payload | Record <string , unknown > | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L84 |
type | string | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L83 |
方法
counter()
static counter(vault, counter): Location
参数
参数 | 类型 |
---|---|
vault | VaultPath |
counter | number |
返回值
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L98
generic()
static generic(vault, record): Location
参数
参数 | 类型 |
---|---|
vault | VaultPath |
record | RecordPath |
返回值
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L91
存储
构造函数
new Store()
new Store(path, client): Store
参数
参数 | 类型 |
---|---|
path | string |
client | ClientPath |
返回值
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L289
属性
方法
get()
get(key): Promise<null | Uint8Array<ArrayBufferLike>>
参数
参数 | 类型 |
---|---|
key | StoreKey |
返回值
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>
参数
参数 | 类型 |
---|---|
key | StoreKey |
value | number [] |
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>>
参数
参数 | 类型 |
---|---|
key | StoreKey |
返回值
Promise
<null
| Uint8Array
<ArrayBufferLike
>>
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L316
Stronghold
表示对 stronghold 的访问。
属性
属性 | 类型 | 定义于 |
---|---|---|
path | string | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L388 |
方法
createClient()
createClient(client): Promise<Client>
参数
参数 | 类型 |
---|---|
client | ClientPath |
返回值
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L428
loadClient()
loadClient(client): Promise<Client>
参数
参数 | 类型 |
---|---|
client | ClientPath |
返回值
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 实例。
参数
参数 | 类型 | 描述 |
---|---|---|
path | string | - |
password | string |
返回值
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
参数
参数 | 类型 |
---|---|
path | string |
client | ClientPath |
name | VaultPath |
返回值
覆盖
ProcedureExecutor.constructor
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L340
属性
属性 | 类型 | 描述 | 继承自 | 定义于 |
---|---|---|---|---|
client | ClientPath | - | - | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L336 |
name | VaultPath | vault 名称。 | - | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L338 |
path | string | vault 路径。 | - | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L335 |
procedureArgs | Record <string , unknown > | - | ProcedureExecutor.procedureArgs | Source: 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 私钥。
参数
参数 | 类型 | 描述 |
---|---|---|
chain | number [] | 链路径。 |
source | "Seed" | "Key" | 源类型,可以是 “Seed” 或 “Key”。 |
sourceLocation | 位置 | 源位置,必须是先前调用 generateSLIP10Seed 或 deriveSLIP10 的 outputLocation 。 |
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 ? | number | SLIP10 种子的字节大小。 |
返回值
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 | 位置 | 私钥的位置。 必须是先前调用 deriveSLIP10 的 outputLocation 。 |
返回值
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 中。
参数
参数 | 类型 |
---|---|
recordPath | RecordPath |
secret | number [] |
返回值
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 助记词。
参数
参数 | 类型 | 描述 |
---|---|---|
mnemonic | string | 助记词字符串。 |
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 | 位置 | 存储私钥的记录的位置。 必须是先前调用 deriveSLIP10 的 outputLocation 。 |
msg | string | 要签名的消息。 |
返回值
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
属性
属性 | 类型 | 定义于 |
---|---|---|
peers | Map <string , PeerAddress > | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L43 |
relays | string [] | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L44 |
ClientAccess
属性
ConnectionLimits
属性
属性 | 类型 | 定义于 |
---|---|---|
maxEstablishedIncoming? | number | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L31 |
maxEstablishedOutgoing? | number | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L32 |
maxEstablishedPerPeer? | number | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L33 |
maxEstablishedTotal? | number | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L34 |
maxPendingIncoming? | number | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L29 |
maxPendingOutgoing? | number | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L30 |
Duration
持续时间定义。
属性
属性 | 类型 | 描述 | 定义于 |
---|---|---|---|
nanos | number | 此 Duration 的小数部分,以纳秒为单位。 必须大于或等于 0 且小于 1e+9(一秒钟内的最大纳秒数) | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L79 |
secs | number | 此 Duration 包含的完整秒数。 | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L77 |
NetworkConfig
属性
PeerAddress
属性
属性 | 类型 | 定义于 |
---|---|---|
known | string [] | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L38 |
use_relay_fallback | boolean | Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/stronghold/guest-js/index.ts#L39 |
权限
属性
类型别名
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