LazorKit LogoLazorKit
SDK (web3.js v1)

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.js v1 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:

npmVersionProtocolWhere it works
@lazorkit/sdk-legacy@next1.4.0v2devnet today; mainnet once v2 is deployed there
@lazorkit/sdk-legacy (latest)0.3.2v1mainnet today, and devnet v1
npm install @lazorkit/sdk-legacy@next @solana/web3.js   # 1.x — protocol v2, what these pages document

A 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

AreaMethods
Wallet managementcreateWallet, addAuthority, removeAuthority, transferOwnership (+ prepare* / finalize* for passkeys)
Executionexecute, transferSol, prepareExecute, finalizeExecute
Session keyscreateSession, prepareCreateSession, finalizeCreateSession, revokeSession, prepareRevokeSession
Deferred executionauthorize, prepareAuthorize, finalizeAuthorize, executeDeferredFromPayload, reclaimDeferred
LookupsfindOwnPasskeyWallet, findPasskeyWalletCandidates, describeWalletCandidates (1.2.0+); findAuthoritiesByWallet, getRecoveryStatus, readCounter; findWalletsByAuthority (raw)
Passkey keysresolvePasskeyPublicKey, recoverPasskeyPublicKeys (1.3.0+, module functions)
Passkey challengescreateTaggedOwnershipChallenge, signedMessageChallenge, OWNERSHIP_PROOF_DOMAIN, SIGNED_MESSAGE_DOMAIN (1.4.0+); see Passkey signing
v1 migrationmigrateV1Wallet, findV1WalletsByOwner, vetMigrationDestination (1.2.0+)
ProtocolregisterPayer (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 explicit

Without 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