Skip to content

Commit ed56e06

Browse files
committed
chore: rename to GolemDB
1 parent 5620909 commit ed56e06

File tree

7 files changed

+112
-112
lines changed

7 files changed

+112
-112
lines changed

example/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Wallet, getBytes } from "ethers"
1111
import {
1212
createClient,
1313
formatEther,
14-
type GolemBaseCreate,
14+
type GolemDBCreate,
1515
Annotation,
1616
Tagged,
1717
type AccountData,
@@ -39,7 +39,7 @@ async function readPassword(prompt: string = "Enter wallet password: "): Promise
3939
resolve(password.trim());
4040
});
4141
// Hide input for security
42-
(rl as any)._writeToOutput = () => {};
42+
(rl as any)._writeToOutput = () => { };
4343
});
4444
} else {
4545
// Input is piped
@@ -135,7 +135,7 @@ async function main() {
135135
log.info("*********************")
136136
log.info("")
137137

138-
const creates: GolemBaseCreate[] = [
138+
const creates: GolemDBCreate[] = [
139139
{
140140
data: encoder.encode("foo"),
141141
btl: 25,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "golem-base-sdk",
3-
"version": "0.1.16",
3+
"version": "0.2.0",
44
"description": "",
55
"homepage": "https://golem-base.github.io/typescript-sdk/",
66
"repository": {

src/client.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66

77
import {
88
type Hex,
9-
type GolemBaseCreate,
10-
type GolemBaseUpdate,
11-
type GolemBaseExtend,
9+
type GolemDBCreate,
10+
type GolemDBUpdate,
11+
type GolemDBExtend,
1212
type EntityMetaData,
1313
type AccountData,
1414
golemBaseABI,
@@ -52,17 +52,17 @@ interface GenericClient<Internal> {
5252
getRawClient(): Internal
5353

5454
/**
55-
* Get the total count of entities in GolemBase
55+
* Get the total count of entities in GolemDB
5656
*/
5757
getEntityCount(): Promise<number>
5858

5959
/**
60-
* Get the entity keys of all entities in GolemBase
60+
* Get the entity keys of all entities in GolemDB
6161
*/
6262
getAllEntityKeys(): Promise<Hex[]>
6363

6464
/**
65-
* Get the entity keys of all entities in GolemBase owned by the given address
65+
* Get the entity keys of all entities in GolemDB owned by the given address
6666
*
6767
* @returns Array of the entity keys
6868
*/
@@ -78,7 +78,7 @@ interface GenericClient<Internal> {
7878
getStorageValue(key: Hex): Promise<Uint8Array>
7979

8080
/**
81-
* Query entities in GolemBase based on annotations
81+
* Query entities in GolemDB based on annotations
8282
*
8383
* @param query - The query to look up entities with
8484
*
@@ -105,7 +105,7 @@ interface GenericClient<Internal> {
105105
getEntityMetaData(key: Hex): Promise<EntityMetaData>
106106

107107
/**
108-
* Install callbacks that will be invoked for every GolemBase transaction
108+
* Install callbacks that will be invoked for every GolemDB transaction
109109
*
110110
* @param args.fromBlock - The starting block, events trigger the callbacks starting from this block
111111
* @param args.onCreated - A callback that's invoked whenever entities are created
@@ -131,9 +131,9 @@ interface GenericClient<Internal> {
131131
}): () => void
132132
}
133133

134-
export interface GolemBaseROClient extends GenericClient<internal.GolemBaseROClient> { }
134+
export interface GolemDBROClient extends GenericClient<internal.GolemDBROClient> { }
135135

136-
export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient> {
136+
export interface GolemDBClient extends GenericClient<internal.GolemDBClient> {
137137
/**
138138
* Get the ethereum address of the owner of the ethereum account used by this client
139139
*/
@@ -149,10 +149,10 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
149149
* @param args.maxPriorityFeePerGas - Sets the max priority fee per gas manually
150150
*/
151151
sendTransaction(
152-
creates?: GolemBaseCreate[],
153-
updates?: GolemBaseUpdate[],
152+
creates?: GolemDBCreate[],
153+
updates?: GolemDBUpdate[],
154154
deletes?: Hex[],
155-
extensions?: GolemBaseExtend[],
155+
extensions?: GolemDBExtend[],
156156
args?: {
157157
txHashCallback?: (txHash: Hex) => void,
158158
gas?: bigint,
@@ -167,7 +167,7 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
167167
}>
168168

169169
/**
170-
* Create one or more new entities in GolemBase
170+
* Create one or more new entities in GolemDB
171171
*
172172
* @param creates - The entities to create
173173
* @param args - Optional parameters, see {@link sendTransaction}
@@ -176,7 +176,7 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
176176
* together with the number of the block at which they will expire
177177
*/
178178
createEntities(
179-
creates: GolemBaseCreate[],
179+
creates: GolemDBCreate[],
180180
args?: {
181181
txHashCallback?: (txHash: Hex) => void,
182182
gas?: bigint,
@@ -186,7 +186,7 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
186186
): Promise<CreateEntityReceipt[]>
187187

188188
/**
189-
* Update one or more new entities in GolemBase
189+
* Update one or more new entities in GolemDB
190190
*
191191
* @param updates - The entities to update
192192
* @param args - Optional parameters, see {@link sendTransaction}
@@ -195,7 +195,7 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
195195
* together with the number of the block at which they will expire
196196
*/
197197
updateEntities(
198-
updates: GolemBaseUpdate[],
198+
updates: GolemDBUpdate[],
199199
args?: {
200200
txHashCallback?: (txHash: Hex) => void,
201201
gas?: bigint,
@@ -205,7 +205,7 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
205205
): Promise<UpdateEntityReceipt[]>
206206

207207
/**
208-
* Delete one or more new entities in GolemBase
208+
* Delete one or more new entities in GolemDB
209209
*
210210
* @param deletes - The entity keys of the entities to delete
211211
* @param args - Optional parameters, see {@link sendTransaction}
@@ -223,7 +223,7 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
223223
): Promise<DeleteEntityReceipt[]>
224224

225225
/**
226-
* Extend the BTL of one or more new entities in GolemBase
226+
* Extend the BTL of one or more new entities in GolemDB
227227
*
228228
* @param extensions - The entities to extend the BTL of
229229
* @param args - Optional parameters, see {@link sendTransaction}
@@ -233,7 +233,7 @@ export interface GolemBaseClient extends GenericClient<internal.GolemBaseClient>
233233
* entities expire
234234
*/
235235
extendEntities(
236-
extensions: GolemBaseExtend[],
236+
extensions: GolemDBExtend[],
237237
args?: {
238238
txHashCallback?: (txHash: Hex) => void,
239239
gas?: bigint,
@@ -321,7 +321,7 @@ function parseTransactionLogs(
321321
)
322322
}
323323

324-
function createGenericClient<Internal extends internal.GolemBaseROClient>(
324+
function createGenericClient<Internal extends internal.GolemDBROClient>(
325325
client: Internal,
326326
logger: Logger<ILogObj>
327327
): GenericClient<Internal> {
@@ -413,7 +413,7 @@ function createGenericClient<Internal extends internal.GolemBaseROClient>(
413413
}
414414

415415
/**
416-
* Create a read-only client to interact with GolemBase
416+
* Create a read-only client to interact with GolemDB
417417
* @param chainId - The ID of the chain you are connecting to
418418
* @param rpcUrl - JSON-RPC URL to talk to
419419
* @param wsUrl - WebSocket URL to talk to
@@ -429,20 +429,20 @@ export function createROClient(
429429
type: "hidden",
430430
hideLogPositionForProduction: true,
431431
})
432-
): GolemBaseROClient {
432+
): GolemDBROClient {
433433
const iClient = internal.createROClient(chainId, rpcUrl, wsUrl, logger)
434434
const baseClient = createGenericClient(iClient, logger)
435435

436436
return {
437437
...baseClient,
438-
getRawClient(): internal.GolemBaseROClient {
438+
getRawClient(): internal.GolemDBROClient {
439439
return iClient
440440
},
441441
}
442442
}
443443

444444
/**
445-
* Create a client to interact with GolemBase
445+
* Create a client to interact with GolemDB
446446
* @param chainId - The ID of the chain you are connecting to
447447
* @param accountData - Either a private key or a wallet provider for the user's account
448448
* @param rpcUrl - JSON-RPC URL to talk to
@@ -460,7 +460,7 @@ export async function createClient(
460460
type: "hidden",
461461
hideLogPositionForProduction: true,
462462
})
463-
): Promise<GolemBaseClient> {
463+
): Promise<GolemDBClient> {
464464

465465
const iClient = await internal.createClient(chainId, accountData, rpcUrl, wsUrl, logger)
466466
const baseClient = createGenericClient(iClient, logger)
@@ -479,11 +479,11 @@ export async function createClient(
479479
},
480480

481481
async sendTransaction(
482-
this: GolemBaseClient,
483-
creates: GolemBaseCreate[] = [],
484-
updates: GolemBaseUpdate[] = [],
482+
this: GolemDBClient,
483+
creates: GolemDBCreate[] = [],
484+
updates: GolemDBUpdate[] = [],
485485
deletes: Hex[] = [],
486-
extensions: GolemBaseExtend[] = [],
486+
extensions: GolemDBExtend[] = [],
487487
args: {
488488
txHashCallback?: (txHash: Hex) => void,
489489
gas?: bigint,
@@ -496,7 +496,7 @@ export async function createClient(
496496
deleteEntitiesReceipts: DeleteEntityReceipt[],
497497
extendEntitiesReceipts: ExtendEntityReceipt[],
498498
}> {
499-
const receipt = await iClient.walletClient.sendGolemBaseTransactionAndWaitForReceipt(
499+
const receipt = await iClient.walletClient.sendGolemDBTransactionAndWaitForReceipt(
500500
creates, updates, deletes, extensions, args
501501
)
502502
log.debug("Got receipt:", receipt)
@@ -507,8 +507,8 @@ export async function createClient(
507507
},
508508

509509
async createEntities(
510-
this: GolemBaseClient,
511-
creates: GolemBaseCreate[],
510+
this: GolemDBClient,
511+
creates: GolemDBCreate[],
512512
args: {
513513
txHashCallback?: (txHash: Hex) => void,
514514
gas?: bigint,
@@ -522,8 +522,8 @@ export async function createClient(
522522
},
523523

524524
async updateEntities(
525-
this: GolemBaseClient,
526-
updates: GolemBaseUpdate[],
525+
this: GolemDBClient,
526+
updates: GolemDBUpdate[],
527527
args: {
528528
txHashCallback?: (txHash: Hex) => void,
529529
gas?: bigint,
@@ -537,7 +537,7 @@ export async function createClient(
537537
},
538538

539539
async deleteEntities(
540-
this: GolemBaseClient,
540+
this: GolemDBClient,
541541
deletes: Hex[],
542542
args: {
543543
txHashCallback?: (txHash: Hex) => void,
@@ -552,8 +552,8 @@ export async function createClient(
552552
},
553553

554554
async extendEntities(
555-
this: GolemBaseClient,
556-
extensions: GolemBaseExtend[],
555+
this: GolemDBClient,
556+
extensions: GolemDBExtend[],
557557
args: {
558558
txHashCallback?: (txHash: Hex) => void,
559559
gas?: bigint,

src/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,43 +63,43 @@ export type AccountData =
6363
export type Hex = `0x${string}`
6464

6565
/**
66-
* Type representing a create transaction in GolemBase
66+
* Type representing a create transaction in GolemDB
6767
*/
68-
export type GolemBaseCreate = {
68+
export type GolemDBCreate = {
6969
readonly data: Uint8Array,
7070
readonly btl: number,
7171
readonly stringAnnotations: StringAnnotation[]
7272
readonly numericAnnotations: NumericAnnotation[],
7373
}
7474
/**
75-
* Type representing an update transaction in GolemBase
75+
* Type representing an update transaction in GolemDB
7676
*/
77-
export type GolemBaseUpdate = {
77+
export type GolemDBUpdate = {
7878
readonly entityKey: Hex,
7979
readonly data: Uint8Array,
8080
readonly btl: number,
8181
readonly stringAnnotations: StringAnnotation[]
8282
readonly numericAnnotations: NumericAnnotation[],
8383
}
8484
/**
85-
* Type representing an extend transaction in GolemBase
85+
* Type representing an extend transaction in GolemDB
8686
*/
87-
export type GolemBaseExtend = {
87+
export type GolemDBExtend = {
8888
readonly entityKey: Hex,
8989
readonly numberOfBlocks: number,
9090
}
9191
/**
92-
* Type representing a delete transaction in GolemBase
92+
* Type representing a delete transaction in GolemDB
9393
*/
94-
export type GolemBaseTransaction = {
95-
readonly creates?: GolemBaseCreate[],
96-
readonly updates?: GolemBaseUpdate[],
94+
export type GolemDBTransaction = {
95+
readonly creates?: GolemDBCreate[],
96+
readonly updates?: GolemDBUpdate[],
9797
readonly deletes?: Hex[],
98-
readonly extensions?: GolemBaseExtend[],
98+
readonly extensions?: GolemDBExtend[],
9999
}
100100

101101
/**
102-
* Type representing the metadata of a entity stored in GolemBase
102+
* Type representing the metadata of a entity stored in GolemDB
103103
*/
104104
export type EntityMetaData = {
105105
readonly expiresAtBlock: bigint,

0 commit comments

Comments
 (0)