npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

golem-base-sdk

v0.1.16

Published

This is part of the [Golem Base](https://github.com/Golem-Base) project, which is which is designed as a Layer2 Network deployed on Ethereum, acting as a gateway to various Layer 3 Database Chains (DB-Chains).

Readme

🚀 Golem Base

This is part of the Golem Base project, which is which is designed as a Layer2 Network deployed on Ethereum, acting as a gateway to various Layer 3 Database Chains (DB-Chains).

For an overview of Golem Base, check out our Litepaper.

🌌GolemBase SDK for TypeScript

This SDK allows you to use GolemBase from TypeScript. It is available on NPM.

We also publish generated documentation.

The repo also contains an example application to showcase how you can use this SDK.

Tip: For getting up and running quickly, we recommend the following two steps:

  1. Start golembase-op-geth through its docker-compose.

  2. Install the demo CLI and create a user.

(Note: As an alternative to installing the demo CLI, you can build the actual CLI as it's included in the golembase-op-geth repo.)

When you create a user, it will generate a private key file called private.key and store it in:

  • ~/.config/golembase/ on Linux
  • ~/Library/Application Support/golembase/ on macOS
  • %LOCALAPPDATA%\golembase\ on Windows

(This is a standard folder as per the XDG specification.)

You will also need to fund the account. You can do so by typing:

golembase-demo-cli account fund 10

🧭 Getting Started: Backend

Here's how you can get going with the SDK. First, create a new folder to hold your project:

mkdir golem-sdk-practice
cd golem-sdk-practice

Then create a new package.json file by typing:

npm init -y

Next, add TypeScript as a development dependency:

npm install --save-dev typescript

And now add the golem TypeScript SDK to your package by typing:

npm i golem-base-sdk

Now update your package.json file, changing the type member to "type": "module", and adding the two script lines for build and start. (Be sure to add a comma after the first script line called test. Also, you can leave the name member set to whatever it is. And the order of the members doesn't matter.)

{
  "name": "myapp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "tsc",
    "start": "node dist/index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "type": "module",
  "devDependencies": {
    "typescript": "^5.8.3"
  },
  "dependencies": {
    "golem-base-sdk": "^0.1.8"
  }
}

And next, create a file called tsconfig.json, and add the following to it:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "Node",
    "strict": true,
    "esModuleInterop": true,
    "outDir": "dist",
    "rootDir": "src"
  },
  "include": ["src"]
}

Finally, create a folder called src, where you'll put the index.ts file as described next.

golem-sdk-practice/
├──src
    ├── index.ts

🧱 Base Code

You can find some base starter code here; copy the index.ts into your own src folder.

This is a basic TypeScript application that:

  1. Imports several items from the SDK (called "golem-base-sdk") including:

    • createClient: A function that creates a client to interact with GolemBase
    • type GolemBaseClient: A type that represents the base client for interacting with Golem
    • type GolemBaseCreate: A type representing a create transaction in GolemBase
    • Annotation: A type representing an annotation with a key and a value, used for efficient lookups
  2. Reads the private key, which it locates through the xdg-portable module.

  3. Create a logger using the tslog TypeScript Logger

  4. The main follows, which is where the bulk of the demo code lives.

The main function demonstrates how to create, modify, and delete entities:

  1. Creates a client object that connects to the local Geth installation. You supply it two URLs, one http and one ws. You also supply it the data read in from the private key, as well as a reference to the logger.

  2. The code then does some initial housekeeping, including subscribing to logging events.

  3. Next it creates three demo entities:

    • One with data "foo" and a time to live of 25 and a numeric annotation of 1
    • One with data "bar" and a time to live of 2, and a numeric annotation of 2
    • One with data "qux" and a time to live of 50, and a numeric annotation also of 2

    Notice that the type of each is GolemBaseCreate.

  4. It then calls client.createEntities to create the entities within Golem. Notice that this returns a promise of an array of items, each of which contain an entityKey and an expirationBlock.

  5. Next, it prints out various information about the current state.

  6. It then makes some modifications:

    • It deletes the first entity by calling client.deleteEntities, passing in an array of one element, the first entityKey.
    • It modifies the third entity by calling client.updateEntities, passing in the modified data
  7. And finally it deletes all the entities. Note that this code demonstrates how to query the entities; it then retrieves the entities, and uses the JavaScript map function to build a list of entityKeys to delete.

🏃‍♂️ Building and Running

To build your app, type:

npm run build

This will compile the TypeScript code and place the compiled JavaScript code in a folder called dist.

To run your app, type:

npm run start

This will run the code found in the dist folder.

🖥️ Front End

The SDK also supports running inside the browser as a module. Documentation coming soon!

🛠️ Manually building

If you wish to manually build the library from TypeScript, simply type:

pnpm build