Appearance
SDK capability map
@keymaster/connect exposes seven capability groups through one KeymasterConnectClient. This page is the complete operation index: select an SDK method to read its call contract, or select a Params/Result type to inspect every field.
Shared call model
Every named operation delegates to the same type-safe protocol transport:
ts
const result = await keymaster.identityGet(params, options);paramsis specific to the operation.KeymasterRequestOptionsoptionally supplies a request id, timeout, orAbortSignal.- The returned promise resolves to the operation's Result type.
- Except for
connect.loginandconnect.launch, capability requests belong to an existingconnectSessionId.
Connect
Create and manage the persistent session that binds the caller origin to a Keymaster owner identity.
| Operation | Type contract | Purpose |
|---|---|---|
connect.loginlogin() | ConnectLoginParams → ConnectLoginResult | Create a session after the user selects an owner identity. |
connect.resumeresume() | ConnectResumeParams → ConnectResumeResult | Restore the unlock runtime for an existing session. |
connect.logoutlogout() | ConnectLogoutParams → ConnectLogoutResult | Revoke a persistent session. |
connect.launchlaunch() | ConnectLaunchParams → ConnectLaunchResult | Consume an appView launch token and establish its session. |
Identity
Read signed claims or sign caller-provided content as an explicit, human-readable intent.
| Operation | Type contract | Purpose |
|---|---|---|
identity.getidentityGet() | IdentityGetParams → IdentityGetResult | Return a signed identity envelope and requested claims. |
intent.signintentSign() | IntentSignParams → IntentSignResult | Sign application bytes inside a human-readable intent. |
Identity requests include aud, iat, and exp. aud must equal the caller's exact browser origin.
Cipher
Encrypt data for the session owner and exact caller origin, then decrypt it in the same trust context.
| Operation | Type contract | Purpose |
|---|---|---|
cipher.encryptcipherEncrypt() | CipherEncryptParams → CipherEncryptResult | Encrypt typed binary content. |
cipher.decryptcipherDecrypt() | CipherDecryptParams → CipherDecryptResult | Recover the content type and original bytes. |
Use binary(), binaryText(), binaryBytes(), and binaryToText() with the protocol's explicit BinaryField representation.
Transfer
Request a controlled P2PKH transfer or negotiate a persistent fee-pool draft. Confirmation text and spending policy remain under Keymaster control.
| Operation | Type contract | Purpose |
|---|---|---|
p2pkh.transferp2pkhTransfer() | P2pkhTransferParams → P2pkhTransferResult | Build, sign, and broadcast a controlled mainnet BSV transfer. |
feepool.preparefeepoolPrepare() | FeepoolPrepareParams → FeepoolPrepareResult | Prepare the next fee-pool draft operation. |
feepool.commitfeepoolCommit() | FeepoolCommitParams → FeepoolCommitResult | Verify counterparty signatures and commit the prepared draft. |
AppMsg
Send end-to-end sealed application messages and query the session-visible message history.
| Operation | Type contract | Purpose |
|---|---|---|
appmsg.sendappmsgSend() | AppMsgSendParams → AppMsgSendResult | Send a sealed message to an owner and exact recipient endpoint. |
appmsg.listappmsgList() | AppMsgListParams → AppMsgListResult | Incrementally list visible messages. |
appmsg.getappmsgGet() | AppMsgGetParams → AppMsgGetResult | Fetch one visible message. |
AppMsg event
| Event | Payload | Delivery |
|---|---|---|
appmsg.message_received | AppMsgMessageReceivedEventData | KeymasterConnectOptions.onEvent |
The event contains the complete message and does not occupy a request slot or produce a Result message.
Broadcast
Publish owner-signed broadcasts and manage the exact channel set contributed by the current caller.
| Operation | Type contract | Purpose |
|---|---|---|
broadcast.publishbroadcastPublish() | BroadcastPublishParams → BroadcastPublishResult | Publish a message signed by the session owner. |
broadcast.subscription_setbroadcastSubscriptionSet() | BroadcastSubscriptionSetParams → BroadcastSubscriptionSetResult | Replace the caller's exact channel set. |
broadcast.subscription_listbroadcastSubscriptionList() | BroadcastSubscriptionListParams → BroadcastSubscriptionListResult | Read the caller's channel set. |
Broadcast event
| Event | Payload | Delivery |
|---|---|---|
broadcast.message_received | BroadcastMessageReceivedEventData | KeymasterConnectOptions.onEvent |
The event contains the complete verified broadcast body. It does not require a follow-up request.
Storage
Manage directories and objects inside the verified application's namespace. Provider credentials, buckets, and physical object keys are never exposed to the caller.
Storage requires a verified app identity whose requirements include storage. The size and part limits are exported as SDK constants in the API reference.
Lower-level request API
request(method, params) accepts every ProtocolMethod. Its generic MethodParams and MethodResult types provide the same compile-time inference as the named methods.
All server-pushed events use the shared ProtocolEventMessage envelope.