Lithosphere SDK starter
Starter scaffold for building a custom SDK on top of Lithosphere. Copied verbatim by create-litho-app when you pick the sdk template.
This is not the published @lithosphere/sdk — that package is already a runtime dependency of this scaffold. The scaffold is here to give you the publishing infrastructure (tsup dual-output, vitest, linting, sizing) plus one worked example of layering domain helpers on top of LithoClient.
Quick start
# Inside the scaffolded directory:
pnpm install
pnpm test
pnpm buildWhat you get
src/
index.ts # Re-exports your extension class (rename freely)
extensions.ts # Example: LithosphereExtensions wrapping LithoClient
__tests__/
extensions.test.tsextensions.ts shows the pattern: own a LithoClient, expose your own methods, let the SDK handle retry/backoff/typed errors at the RPC layer. Replace its body with whatever your project actually needs (or delete it entirely — the directory structure is the load-bearing part).
Using the underlying SDK
The SDK is already a dependency, so you can import from it directly:
For the full surface (LEP-100 ABI exports, network registry, error codes, retry config) see @lithosphere/sdk.
Layering on top — the LithosphereExtensions example
Publishing your package
Rename it. Edit
package.json— changename,description,repository,author,keywords,homepage,bugs.url.Drop
"private": truewhen you're ready to publish.Pick an npm scope you control — the scaffold uses
@lithosphere/...placeholders that are reserved for the Lithosphere org.pnpm build→ producesdist/index.{mjs,cjs,d.ts,d.cts}.npm publish --access public(orpnpm publishif you use pnpm's publish flow).
What changed in this scaffold refresh
Prior versions of this scaffold copied @lithosphere/sdk's client.ts, types.ts, and an ABI file directly into the new project. That made the scaffold easy to fork but locked the resulting package onto a frozen snapshot of the SDK — a published @lithosphere/sdk bug fix never reached the user.
Today the scaffold depends on @lithosphere/sdk as a regular npm dependency. Use pnpm update @lithosphere/sdk to pick up upstream fixes; build your domain-specific work in extensions.ts (or your own renamed modules). If you genuinely need to fork the client — e.g. for a non-EVM chain — clone the SDK's Makalu/packages/sdk/ directory instead.
Last updated