Developers
window.krayWallet
The Chrome extension injects a provider API for approved origins. The mobile PWA does not expose this API — it is a standalone wallet client.
Listen for krayWalletReady, then call requestAccounts() from a user gesture. On page load use getAccounts() (silent) — never auto-popup requestAccounts() on every refresh.
Availability
- Chrome / Brave / Edge with KrayWallet extension installed.
- Unknown origins require a one-time Connection Request approval.
kray.spacesubdomains andlocalhostare auto-approved.
Public API
requestAccounts()
Connect with popup (recommended for Connect button).
const result = await window.krayWallet.requestAccounts();
// { address, ... }
getAccounts()
Silent session restore. Returns [] if revoked or locked out.
const accounts = await window.krayWallet.getAccounts();
connect()
Silent connect when already unlocked and approved.
getPublicKey()
x-only public key (hex). Prefer getAccounts() for the bc1p… address.
getExtensionInfo()
// { signature, version, build, isKrayWallet: true }
getBalance() · getInscriptions(offset?, limit?) · getRunes() · getFullWalletData()
Read public wallet inventory for the connected account.
signMessage(message) use with caution
Schnorr sign. May auto-sign non-sensitive messages while unlocked. Sensitive prefixes always force a popup.
signMessageWithConfirmation(message) recommended
Always opens the confirmation UI so the user sees exactly what they sign. Prefer this for payments, admin actions, and L2 auth.
const { signature, address } = await window.krayWallet.signMessageWithConfirmation(message);
Chat session
activateChatSession(), encryptChatMessage(msg, theirPubKey), decryptChatMessage(enc, theirPubKey), isChatSessionActive(), clearChatSession().
getNetwork() / getActiveNetwork()
Network helpers (livenet, mainnet / kray-l2).
Partner / advanced
PSBT signing, pushTx, marketplace helpers (createOffer, buyNow, buyAtomicSwap, …) exist in the extension for ecosystem partners. Documented access: partners@kray.space.
L2 from third-party apps
L2 transfers typically use kray.space REST plus a wallet signature — not a separate send method on the provider. Full platform reference: kray.space/developers.
Canonical message formats
- Marketplace cancel:
KRAY:cancel-listing:<address>:<order_id>:<nonce>:<timestamp> - L2: structured JSON or
from:to:amount:noncepatterns as documented on kray.space