Overview
LazorKit SDK for @solana/web3.js v1 — direct contract access via LazorKitClient.
@lazorkit/sdk-legacy is the TypeScript SDK for direct LazorKit contract interaction on
@solana/web3.js v1. It ships LazorKitClient — a typed wrapper that builds every
on-chain instruction without hiding the transaction flow.
Use this SDK when you need:
- Low-level contract access outside of React (a backend, a relayer, an agent)
- Integration with existing
@solana/web3.jsv1 infrastructure - Protocol operations (
InitializeProtocol,RegisterPayer, etc.) - Full control over signer rotation, prepare/finalize flows, and account indexing
For application code, reach for the React SDK or React Native SDK — both build on this SDK and handle the portal, paymaster, confirmation and sequencing for you.
Install
Two lines of this package are published, one per protocol version:
| npm | Version | Protocol | Where it works |
|---|---|---|---|
@lazorkit/sdk-legacy@next | 1.4.0 | v2 | devnet today; mainnet once v2 is deployed there |
@lazorkit/sdk-legacy (latest) | 0.3.2 | v1 | mainnet today, and devnet v1 |
npm install @lazorkit/sdk-legacy@next @solana/web3.js # 1.x — protocol v2, what these pages documentA plain npm install @lazorkit/sdk-legacy installs 0.3.2, the protocol v1 line, which
has none of the 1.x APIs below. The two are not wire-compatible: the same userSeed
derives a different wallet on each. See Networks & versions.
What it covers
| Area | Methods |
|---|---|
| Wallet management | createWallet, addAuthority, removeAuthority, transferOwnership (+ prepare* / finalize* for passkeys) |
| Execution | execute, transferSol, prepareExecute, finalizeExecute |
| Session keys | createSession, prepareCreateSession, finalizeCreateSession, revokeSession, prepareRevokeSession |
| Deferred execution | authorize, prepareAuthorize, finalizeAuthorize, executeDeferredFromPayload, reclaimDeferred |
| Lookups | findOwnPasskeyWallet, findPasskeyWalletCandidates, describeWalletCandidates (1.2.0+); findAuthoritiesByWallet, getRecoveryStatus, readCounter; findWalletsByAuthority (raw) |
| Passkey keys | resolvePasskeyPublicKey, recoverPasskeyPublicKeys (1.3.0+, module functions) |
| Passkey challenges | createTaggedOwnershipChallenge, signedMessageChallenge, OWNERSHIP_PROOF_DOMAIN, SIGNED_MESSAGE_DOMAIN (1.4.0+); see Passkey signing |
| v1 migration | migrateV1Wallet, findV1WalletsByOwner, vetMigrationDestination (1.2.0+) |
| Protocol | registerPayer (permissionless; added for you), initializeProtocol, updateProtocol, initializeTreasuryShard, withdrawTreasury (admin) |
CloseExpiredSession (anyone may close an expired session and keep its rent) has no
client method, and 1.4.0 does not export its instruction builder; @lazorkit/sdk (kit)
exports createCloseExpiredSessionIx.
Finding a returning passkey user's wallet
Use findOwnPasskeyWallet (1.2.0 and later; not in 0.3.x or 1.1.x). Never adopt the
first result of findWalletsByAuthority(credentialIdHash): the credential-id hash is
public, and anyone can create a wallet that lists it. See
Getting Started › Look up a returning user.
Client setup
import { Connection } from '@solana/web3.js';
import { LazorKitClient, PROGRAM_ID_DEVNET } from '@lazorkit/sdk-legacy';
const connection = new Connection('https://api.devnet.solana.com', 'confirmed');
const client = new LazorKitClient(connection); // program id from the URL
const explicit = new LazorKitClient(connection, PROGRAM_ID_DEVNET); // or explicitWithout a program id, the client reads the cluster from the RPC URL (mainnet, devnet,
localhost / 127.0.0.1) and throws for any other URL; pass the id for your own RPC
proxy or a keyed provider URL. It picks the v2 program for the cluster. The client
keeps a small in-memory cache (the protocol config, payers it has seen registered); create
one per connection and reuse it.
Explore
Getting Started
Create a wallet, execute a transaction, look up returning users.
Passkey signing
prepare / finalize, the WebAuthnResponse, minContextSlot, one flow per authority, key recovery.
Session Keys
Create, execute, and revoke sessions — including deferred execution.
Types
Signer helpers, account readers, PDA derivation, error utilities.
Errors
Error classes and program error codes.