Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
docs
.npmrc
*.tsbuildinfo
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 🚀 Golem Base
# 🚀 GolemDB

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).
This is part of the [GolemDB](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).

> **For an overview of Golem Base, check out our [Litepaper](https://golem-base.io/wp-content/uploads/2025/03/GolemBase-Litepaper.pdf).**
> **For an overview of GolemDB, check out our [Litepaper](https://golem-base.io/wp-content/uploads/2025/03/GolemDB-Litepaper.pdf).**

# 🌌GolemBase SDK for TypeScript
# 🌌GolemDB SDK for TypeScript

This SDK allows you to use [GolemBase](https://github.com/Golem-Base) from TypeScript. It is available [on NPM](https://www.npmjs.com/package/golem-base-sdk).
This SDK allows you to use [GolemDB](https://github.com/Golem-Base) from TypeScript. It is available [on NPM](https://www.npmjs.com/package/golemdb-sdk).

We also publish [generated documentation](https://golem-base.github.io/typescript-sdk/).

Expand Down Expand Up @@ -58,7 +58,7 @@ npm install --save-dev typescript
And now add the golem TypeScript SDK to your package by typing:

```
npm i golem-base-sdk
npm i golemdb-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.)
Expand All @@ -82,7 +82,7 @@ Now update your package.json file, changing the `type` member to `"type": "modul
"typescript": "^5.8.3"
},
"dependencies": {
"golem-base-sdk": "^0.1.8"
"golemdb-sdk": "^0.1.8"
}
}

Expand Down Expand Up @@ -121,9 +121,9 @@ 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
* `createClient`: A function that creates a client to interact with GolemDB
* `type GolemDBClient`: A type that represents the base client for interacting with Golem
* `type GolemDBCreate`: A type representing a create transaction in GolemDB
* `Annotation`: A type representing an annotation with a key and a value, used for efficient lookups

2. Reads the private key from a wallet, which it locates through the `xdg-portable` module.
Expand All @@ -144,7 +144,7 @@ The `main` function demonstrates how to create, modify, and delete entities:
* 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.
Notice that the type of each is GolemDBCreate.

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`.

Expand Down
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>GolemBase in the browser</title>
<script src="https://unpkg.com/golem-base-sdk/dist/golem-base-sdk.min.js"></script>
<script src="https://unpkg.com/golemdb-sdk/dist/golemdb-sdk.min.js"></script>
<!--
We cannot re-export this from our bundle since we need the browser version
which is slightly different.
Expand Down
8 changes: 4 additions & 4 deletions example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { Wallet, getBytes } from "ethers"
import {
createClient,
formatEther,
type GolemBaseCreate,
type GolemDBCreate,
Annotation,
Tagged,
type AccountData,
} from "golem-base-sdk"
} from "golemdb-sdk"

// Path to a golembase wallet
const walletPath = join(xdg.config(), 'golembase', 'wallet.json');
Expand All @@ -39,7 +39,7 @@ async function readPassword(prompt: string = "Enter wallet password: "): Promise
resolve(password.trim());
});
// Hide input for security
(rl as any)._writeToOutput = () => {};
(rl as any)._writeToOutput = () => { };
});
} else {
// Input is piped
Expand Down Expand Up @@ -135,7 +135,7 @@ async function main() {
log.info("*********************")
log.info("")

const creates: GolemBaseCreate[] = [
const creates: GolemDBCreate[] = [
{
data: encoder.encode("foo"),
btl: 25,
Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"build": "tsc"
},
"dependencies": {
"@types/node": "^22.15.21",
"golem-base-sdk": "link:..",
"@types/node": "^22.18.0",
"golemdb-sdk": "link:..",
"tslog": "^4.9.3",
"xdg-portable": "^10.6.0"
}
Expand Down
12 changes: 6 additions & 6 deletions example/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "golem-base-sdk",
"version": "0.1.16",
"name": "golemdb-sdk",
"version": "0.2.0",
"description": "",
"homepage": "https://golem-base.github.io/typescript-sdk/",
"repository": {
Expand All @@ -23,26 +23,26 @@
"license": "GPL-3.0-only",
"packageManager": "[email protected]",
"dependencies": {
"@types/node": "^22.15.32",
"@types/node": "^22.18.0",
"ethers": "^6.15.0",
"tslog": "^4.9.3",
"viem": "^2.31.3"
"viem": "^2.37.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.3",
"@rollup/plugin-typescript": "^12.1.4",
"@types/chai": "^5.2.2",
"@types/mocha": "^10.0.10",
"chai": "^5.2.0",
"chai": "^5.3.3",
"glob": "^11.0.3",
"mocha": "^11.6.0",
"rollup": "^4.43.0",
"mocha": "^11.7.2",
"rollup": "^4.50.0",
"rollup-plugin-polyfill-node": "^0.13.0",
"ts-mocha": "^11.1.0",
"tslib": "^2.8.1",
"typedoc": "^0.28.5",
"typedoc": "^0.28.12",
"xdg-portable": "^10.6.0"
},
"scripts": {
Expand Down
Loading
Loading