@quantlayer-protocol/sdk

Version 0.1.0. The real protocol implementation, bundled: locally signed bytes are byte-identical to what the API verifies, and missing capabilities throw instead of returning a guessed result.

Configuration

Every section is optional; a module used without its configuration throws a configuration error that says what to pass.
client.ts
const quantlayer = createQuantLayerClient({
  api: { baseUrl, apiKey, timeoutMs: 30_000 },        // platform calls
  network: { network: 'arbitrum-sepolia', rpcUrl },    // on-chain calls
  deployments: [deploymentRecord],                    // addresses, verified before use
  crypto: {
    signatureVerifiers: [createNodePqc().signatureVerifier], // local ML-DSA / SLH-DSA
    zk: await createNodeZkEngine(),                          // local proving
  },
});

Modules

ModuleMethods
identitycreate, resolve, registerKey, rotateKey, revokeKey, linkAccount, unlinkAccount, deactivate, provider
credentialsregisterIssuer, getIssuer, issue, get, statusList, accept (local), present (local), verifyPresentation
revocationrevokeCredential, suspendCredential, reinstateCredential, onChainStatus, revokeAuthorizationKey, revokeAuthorizationRequest
privacycreateTree, getTree, appendLeaf, removeLeaf, path, publishRoot, isNullifierSpent
proofscreateRequest, prove (local), verify (local), proveRemotely, verifyRemotely, getJob, waitForJob, proofOf
quantumgenerateKey, getKey, rotateKey, revokeVersion, sign, decapsulate, verify, verifyLocally, signer
authorizationbuildRequest, sign, signHybrid, decide, message, digest, typedData, publishPolicy, setMinimumPolicyVersion
contractsabi, address, resolve (fingerprint-verified), read, write (simulated first)
networkslist, get, byChainId, current, assertChain, head, discover
transactionssubmit, confirm, confirmSuccess, track, getTracked, waitForTracked, monitor, watch (reorg-aware)

Signers

The SDK never needs a private key: it asks a signer to sign exact protocol bytes.
generateEd25519Signer, ed25519Signer
In process, @noble/curves.
quantum.signer(keyId)
A post-quantum key in QuantLayer Quantum custody; refuses to sign if the key was rotated underneath it.
createLocalPqcSigner (node)
ML-DSA or SLH-DSA in native memory, exportable only sealed under a key-encryption key.
Your own
Any HSM, KMS, wallet or secure enclave that implements QuantLayerSigner.

Errors, retries and validation

QuantLayerSdkError.kind
validation, api (status, reason, requestId), transport, compatibility, configuration, protocol.
Retries
GET requests and a few idempotent POSTs, on network errors and 429/502/503/504, with exponential backoff and Retry-After. Issuance, signing, decisions and transactions are never retried.
Validation
Every input is validated before anything is signed or sent; a failure lists each offending path.
Compatibility
Before the first call the client reads GET /health and refuses an incompatible protocol version.

Entry points and platforms

@quantlayer-protocol/sdk
ESM and CommonJS; Node.js 20.19 or later and browsers.
@quantlayer-protocol/sdk/zk
ESM; Node.js and browsers (WASM backend).
@quantlayer-protocol/sdk/node
ESM; Node.js only; native module for linux-x64 and darwin-arm64.