@arkiv-network/sdk 0.3.1 → 0.3.2-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entity-DvQtQL8v.d.ts +246 -0
- package/dist/entity-DvQtQL8v.d.ts.map +1 -0
- package/dist/entity-jTQZmEAd.d.cts +246 -0
- package/dist/entity-jTQZmEAd.d.cts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -143
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +3 -143
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/query/index.cjs +1 -1
- package/dist/query/index.d.cts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +1 -1
- package/dist/{queryBuilder-D38MYG7o.d.ts → queryBuilder-BBtwhH0G.d.ts} +19 -63
- package/dist/queryBuilder-BBtwhH0G.d.ts.map +1 -0
- package/dist/{queryBuilder-n9ocnT4P.cjs → queryBuilder-D-bqHg3w.cjs} +29 -2
- package/dist/{queryBuilder-BueP5de6.js → queryBuilder-D22Tamry.js} +30 -3
- package/dist/queryBuilder-D22Tamry.js.map +1 -0
- package/dist/{queryBuilder-DU4RQa7H.d.cts → queryBuilder-DkhyyeFr.d.cts} +19 -63
- package/dist/queryBuilder-DkhyyeFr.d.cts.map +1 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.d.cts.map +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +28 -6
- package/src/query/engine.test.ts +69 -0
- package/src/query/engine.ts +8 -3
- package/src/query/queryBuilder.test.ts +34 -0
- package/src/query/queryBuilder.ts +33 -0
- package/src/types/index.ts +13 -0
- package/src/types/rpcSchema.ts +7 -0
- package/dist/entity-CMRcjXBK.d.ts +0 -41
- package/dist/entity-CMRcjXBK.d.ts.map +0 -1
- package/dist/entity-Dgf1SSpi.d.cts +0 -41
- package/dist/entity-Dgf1SSpi.d.cts.map +0 -1
- package/dist/queryBuilder-BueP5de6.js.map +0 -1
- package/dist/queryBuilder-D38MYG7o.d.ts.map +0 -1
- package/dist/queryBuilder-DU4RQa7H.d.cts.map +0 -1
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/events.ts","../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/events.ts","../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/clients/decorators/arkivWallet.ts","../src/clients/createWalletClient.ts"],"sourcesContent":[],"mappings":";;;;;KAEY,oBAAA;aACC;SACJ;;EAFG,IAAA,EAAA,MAAA;AAOZ,CAAA;AAQY,KARA,oBAAA,GAQoB;EAKpB,SAAA,EAZC,KAYD;EAKA,KAAA,EAhBH,KAgBG;;;;ACXZ,CAAA;AACoB,KDAR,oBAAA,GCAQ;EAAY,SAAA,EDCnB,KCDmB;EAChB,KAAA,EDCP,KCDO;CAAoB;AAClB,KDGN,oBAAA,GCHM;EAAsB,SAAA,EDI3B,KCJ2B;EAExB,KAAA,EDGP,KCHO;CAAW;AAAO,KDMtB,8BAAA,GCNsB;EAAhC,SAAA,EDOW,KCPX;EADE,KAAA,EDSK,KCTL;EAmCe,kBAAA,EAAA,MAAA;EAAgB,kBAAA,EAAA,MAAA;EAAR,IAAA,EAAA,MAAA;CAsBP;;;KA7DR,qCACQ,cAAY,2BAChB,sBAAoB,qCAClB,wBAAsB,yBACpC,KACF,cAAc,WAAW,OAAO;EDnBtB;AAOZ;AAQA;AAKA;AAKA;;;;ACXA;;;;;;;;;;;;;;EAuC2B,SAAA,EAAA,CAAA,GAAA,EAAR,KAAQ,EAAA,GAAA,OAAA,CAAQ,MAAR,CAAA;EAsBP;;;;;;;;;;;;;;;;;;;;oBAAA;EC9DR;;;;;;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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import {
|
|
1
|
+
import { _ as ArkivRpcSchema, a as MutateEntitiesReturnType, b as RpcQueryOptions, c as ExtendEntityParameters, d as DeleteEntityReturnType, f as CreateEntityParameters, g as ArkivClient, h as ChangeOwnershipReturnType, i as MutateEntitiesParameters, l as ExtendEntityReturnType, m as ChangeOwnershipParameters, n as TxParams, o as UpdateEntityParameters, p as CreateEntityReturnType, r as Attribute, s as UpdateEntityReturnType, t as Entity, u as DeleteEntityParameters, v as RpcEntity, x as MimeType, y as RpcIncludeData } from "./entity-DvQtQL8v.js";
|
|
2
|
+
import { t as QueryBuilder } from "./queryBuilder-BBtwhH0G.js";
|
|
3
3
|
import { Account, Account as Account$1, Address, Address as Address$1, Chain, Chain as Chain$1, Client, Hex, Hex as Hex$1, ParseAccount, Prettify, PublicActions, PublicClientConfig, PublicClientConfig as PublicClientConfig$1, RpcSchema, RpcSchema as RpcSchema$1, Transport, Transport as Transport$1, WalletActions, WalletClientConfig, http, toBytes, toHex, toRlp, webSocket } from "viem";
|
|
4
4
|
|
|
5
5
|
//#region src/types/events.d.ts
|
|
@@ -173,146 +173,6 @@ type PublicArkivClient<transport extends Transport$1 = Transport$1, chain extend
|
|
|
173
173
|
*/
|
|
174
174
|
declare function createPublicClient<transport extends Transport$1, chain extends Chain$1 | undefined = undefined, accountOrAddress extends Account$1 | Address$1 | undefined = undefined, rpcSchema extends RpcSchema$1 | undefined = ArkivRpcSchema>(parameters: PublicClientConfig$1<transport, chain, accountOrAddress, rpcSchema>): PublicArkivClient<transport, chain, ParseAccount<accountOrAddress>, rpcSchema>;
|
|
175
175
|
//#endregion
|
|
176
|
-
//#region src/actions/wallet/changeOwnership.d.ts
|
|
177
|
-
/**
|
|
178
|
-
* Parameters for the deleteEntity function.
|
|
179
|
-
* - entityKey: The key of the entity to delete.
|
|
180
|
-
*/
|
|
181
|
-
type ChangeOwnershipParameters = {
|
|
182
|
-
entityKey: Hex$1;
|
|
183
|
-
newOwner: Hex$1;
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* Return type for the deleteEntity function.
|
|
187
|
-
* - entityKey: The key of the entity.
|
|
188
|
-
* - txHash: The transaction hash.
|
|
189
|
-
*/
|
|
190
|
-
type ChangeOwnershipReturnType = {
|
|
191
|
-
entityKey: Hex$1;
|
|
192
|
-
txHash: string;
|
|
193
|
-
};
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/actions/wallet/createEntity.d.ts
|
|
196
|
-
/**
|
|
197
|
-
* Parameters for the createEntity function.
|
|
198
|
-
* - payload: The payload of the entity.
|
|
199
|
-
* - attributes: The attributes of the entity.
|
|
200
|
-
* - contentType: The content type of the entity.
|
|
201
|
-
* - expiresIn: The expires in of the entity in seconds.
|
|
202
|
-
*/
|
|
203
|
-
type CreateEntityParameters = {
|
|
204
|
-
payload: Uint8Array;
|
|
205
|
-
attributes: Attribute[];
|
|
206
|
-
contentType: MimeType;
|
|
207
|
-
expiresIn: number;
|
|
208
|
-
};
|
|
209
|
-
/**
|
|
210
|
-
* Return type for the createEntity function.
|
|
211
|
-
* - entityKey: The key of the entity.
|
|
212
|
-
* - txHash: The transaction hash.
|
|
213
|
-
*/
|
|
214
|
-
type CreateEntityReturnType = {
|
|
215
|
-
entityKey: Hex$1;
|
|
216
|
-
txHash: string;
|
|
217
|
-
};
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region src/actions/wallet/deleteEntity.d.ts
|
|
220
|
-
/**
|
|
221
|
-
* Parameters for the deleteEntity function.
|
|
222
|
-
* - entityKey: The key of the entity to delete.
|
|
223
|
-
*/
|
|
224
|
-
type DeleteEntityParameters = {
|
|
225
|
-
entityKey: Hex$1;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* Return type for the deleteEntity function.
|
|
229
|
-
* - entityKey: The key of the entity.
|
|
230
|
-
* - txHash: The transaction hash.
|
|
231
|
-
*/
|
|
232
|
-
type DeleteEntityReturnType = {
|
|
233
|
-
entityKey: Hex$1;
|
|
234
|
-
txHash: string;
|
|
235
|
-
};
|
|
236
|
-
//#endregion
|
|
237
|
-
//#region src/actions/wallet/extendEntity.d.ts
|
|
238
|
-
/**
|
|
239
|
-
* Parameters for the extendEntity function.
|
|
240
|
-
* - entityKey: The key of the entity to extend.
|
|
241
|
-
* - expiresIn: The expires in of the entity in seconds.
|
|
242
|
-
*/
|
|
243
|
-
type ExtendEntityParameters = {
|
|
244
|
-
entityKey: Hex$1;
|
|
245
|
-
expiresIn: number;
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* Return type for the extendEntity function.
|
|
249
|
-
* - entityKey: The key of the entity.
|
|
250
|
-
* - txHash: The transaction hash.
|
|
251
|
-
*/
|
|
252
|
-
type ExtendEntityReturnType = {
|
|
253
|
-
entityKey: Hex$1;
|
|
254
|
-
txHash: string;
|
|
255
|
-
};
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/actions/wallet/updateEntity.d.ts
|
|
258
|
-
/**
|
|
259
|
-
* Parameters for the updateEntity function.
|
|
260
|
-
* - entityKey: The key of the entity to update.
|
|
261
|
-
* - payload: The payload of the entity.
|
|
262
|
-
* - attributes: The attributes of the entity.
|
|
263
|
-
* - contentType: The content type of the entity.
|
|
264
|
-
* - expiresIn: The expires in of the entity in seconds.
|
|
265
|
-
*/
|
|
266
|
-
type UpdateEntityParameters = {
|
|
267
|
-
entityKey: Hex$1;
|
|
268
|
-
payload: Uint8Array;
|
|
269
|
-
attributes: Attribute[];
|
|
270
|
-
contentType: MimeType;
|
|
271
|
-
expiresIn: number;
|
|
272
|
-
};
|
|
273
|
-
/**
|
|
274
|
-
* Return type for the updateEntity function.
|
|
275
|
-
* - entityKey: The key of the entity.
|
|
276
|
-
* - txHash: The transaction hash.
|
|
277
|
-
*/
|
|
278
|
-
type UpdateEntityReturnType = {
|
|
279
|
-
entityKey: Hex$1;
|
|
280
|
-
txHash: string;
|
|
281
|
-
};
|
|
282
|
-
//#endregion
|
|
283
|
-
//#region src/actions/wallet/mutateEntities.d.ts
|
|
284
|
-
/**
|
|
285
|
-
* Parameters for the mutateEntities function.
|
|
286
|
-
* - creates: The creates to perform.
|
|
287
|
-
* - updates: The updates to perform.
|
|
288
|
-
* - deletes: The deletes to perform.
|
|
289
|
-
* - extensions: The extensions to perform.
|
|
290
|
-
*/
|
|
291
|
-
type MutateEntitiesParameters = {
|
|
292
|
-
creates?: CreateEntityParameters[];
|
|
293
|
-
updates?: UpdateEntityParameters[];
|
|
294
|
-
deletes?: DeleteEntityParameters[];
|
|
295
|
-
extensions?: ExtendEntityParameters[];
|
|
296
|
-
ownershipChanges?: ChangeOwnershipParameters[];
|
|
297
|
-
};
|
|
298
|
-
/**
|
|
299
|
-
* Return type for the mutateEntities function.
|
|
300
|
-
* - txHash: The transaction hash.
|
|
301
|
-
* - createdEntities: The keys of the created entities.
|
|
302
|
-
* - updatedEntities: The keys of the updated entities.
|
|
303
|
-
* - deletedEntities: The keys of the deleted entities.
|
|
304
|
-
* - extendedEntities: The keys of the extended entities.
|
|
305
|
-
* - ownershipChanges: The keys of the ownership changes.
|
|
306
|
-
*/
|
|
307
|
-
type MutateEntitiesReturnType = {
|
|
308
|
-
txHash: string;
|
|
309
|
-
createdEntities: Hex$1[];
|
|
310
|
-
updatedEntities: Hex$1[];
|
|
311
|
-
deletedEntities: Hex$1[];
|
|
312
|
-
extendedEntities: Hex$1[];
|
|
313
|
-
ownershipChanges: Hex$1[];
|
|
314
|
-
};
|
|
315
|
-
//#endregion
|
|
316
176
|
//#region src/clients/decorators/arkivWallet.d.ts
|
|
317
177
|
type WalletArkivActions<transport extends Transport$1 = Transport$1, chain extends Chain$1 | undefined = Chain$1 | undefined, account extends Account$1 | undefined = Account$1 | undefined> = Pick<PublicActions<transport, chain, account>, "waitForTransactionReceipt"> & Pick<WalletActions<chain, account>, "addChain" | "sendTransaction" | "sendTransactionSync" | "sendRawTransaction" | "sendRawTransactionSync" | "signMessage" | "signTransaction"> & {
|
|
318
178
|
/**
|
|
@@ -497,5 +357,5 @@ type WalletArkivClient<transport extends Transport$1 = Transport$1, chain extend
|
|
|
497
357
|
*/
|
|
498
358
|
declare function createWalletClient<transport extends Transport$1, chain extends Chain$1 | undefined = undefined, accountOrAddress extends Account$1 | Address$1 | undefined = undefined, rpcSchema extends RpcSchema$1 | undefined = ArkivRpcSchema>(parameters: WalletClientConfig<transport, chain, accountOrAddress, rpcSchema>): WalletArkivClient<transport, chain, ParseAccount<accountOrAddress>, rpcSchema>;
|
|
499
359
|
//#endregion
|
|
500
|
-
export { type Account, type Address, type ArkivClient, type ArkivRpcSchema, type Attribute, type Chain, type Entity, type Hex, type PublicArkivClient, type PublicClientConfig, type RpcSchema, type Transport, type WalletArkivClient, createPublicClient, createWalletClient, http, toBytes, toHex, toRlp, webSocket };
|
|
360
|
+
export { type Account, type Address, type ArkivClient, type ArkivRpcSchema, type Attribute, type Chain, type ChangeOwnershipParameters, type ChangeOwnershipReturnType, type CreateEntityParameters, type CreateEntityReturnType, type DeleteEntityParameters, type DeleteEntityReturnType, type Entity, type ExtendEntityParameters, type ExtendEntityReturnType, type Hex, type MimeType, type MutateEntitiesParameters, type MutateEntitiesReturnType, type PublicArkivClient, type PublicClientConfig, type RpcEntity, type RpcIncludeData, type RpcQueryOptions, type RpcSchema, type Transport, type TxParams, type UpdateEntityParameters, type UpdateEntityReturnType, type WalletArkivClient, createPublicClient, createWalletClient, http, toBytes, toHex, toRlp, webSocket };
|
|
501
361
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/events.ts","../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/events.ts","../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/clients/decorators/arkivWallet.ts","../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;;;;;;;;;;AA4BA;;;;;;;;;;;;EAOqB,cAAA,EAAA,CAAA,IAAA,ED+KT,wBC/KS,EAAA,QAAA,CAAA,EDgLJ,QChLI,EAAA,GDiLZ,OCjLY,CDiLJ,wBCjLI,CAAA;CAAW;;;KAnCpB,oCACQ,cAAY,2BAChB,sBAAoB,qCAClB,wBAAsB,yCACpB,0BAAwB,kBACxC,SACF,OAAO,WAAW,OAAO,SAAS,WAAW,mBAAmB,WAAW,OAAO;;AJnBpF;AAOA;AAQA;AAKA;AAKA;;;;ACXA;;;;;;;;;;AAKE,iBGsBc,kBHtBd,CAAA,kBGuBkB,WHvBlB,EAAA,cGwBc,OHxBd,GAAA,SAAA,GAAA,SAAA,EAAA,yBGyByB,SHzBzB,GGyBmC,SHzBnC,GAAA,SAAA,GAAA,SAAA,EAAA,kBG0BkB,WH1BlB,GAAA,SAAA,GG0B0C,cH1B1C,CAAA,CAAA,UAAA,EG4BY,kBH5BZ,CG4B+B,SH5B/B,EG4B0C,KH5B1C,EG4BiD,gBH5BjD,EG4BmE,SH5BnE,CAAA,CAAA,EG6BC,iBH7BD,CG6BmB,SH7BnB,EG6B8B,KH7B9B,EG6BqC,YH7BrC,CG6BkD,gBH7BlD,CAAA,EG6BqE,SH7BrE,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NoEntityFoundError, r as entityFromRpcResult, t as QueryBuilder } from "./queryBuilder-
|
|
1
|
+
import { a as NoEntityFoundError, r as entityFromRpcResult, t as QueryBuilder } from "./queryBuilder-D22Tamry.js";
|
|
2
2
|
import { n as BLOCK_TIME, t as ARKIV_ADDRESS } from "./consts-CHtLBwGd.js";
|
|
3
3
|
import { createClient, decodeEventLog, http, parseAbi, publicActions, toBytes, toBytes as toBytes$1, toHex, toHex as toHex$1, toRlp, toRlp as toRlp$1, walletActions, webSocket } from "viem";
|
|
4
4
|
|
package/dist/query/index.cjs
CHANGED
package/dist/query/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../entity-
|
|
2
|
-
import { a as PredicateType, c as gt, d as lte, f as neq, i as PredicateContainerType, l as gte, m as or, n as QueryResult, o as and, p as not, r as Predicate, s as eq, t as QueryBuilder, u as lt } from "../queryBuilder-
|
|
1
|
+
import "../entity-jTQZmEAd.cjs";
|
|
2
|
+
import { a as PredicateType, c as gt, d as lte, f as neq, i as PredicateContainerType, l as gte, m as or, n as QueryResult, o as and, p as not, r as Predicate, s as eq, t as QueryBuilder, u as lt } from "../queryBuilder-DkhyyeFr.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/query/errors.d.ts
|
|
5
5
|
declare class NoMoreResultsError extends Error {
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../entity-
|
|
2
|
-
import { a as PredicateType, c as gt, d as lte, f as neq, i as PredicateContainerType, l as gte, m as or, n as QueryResult, o as and, p as not, r as Predicate, s as eq, t as QueryBuilder, u as lt } from "../queryBuilder-
|
|
1
|
+
import "../entity-DvQtQL8v.js";
|
|
2
|
+
import { a as PredicateType, c as gt, d as lte, f as neq, i as PredicateContainerType, l as gte, m as or, n as QueryResult, o as and, p as not, r as Predicate, s as eq, t as QueryBuilder, u as lt } from "../queryBuilder-BBtwhH0G.js";
|
|
3
3
|
|
|
4
4
|
//#region src/query/errors.d.ts
|
|
5
5
|
declare class NoMoreResultsError extends Error {
|
package/dist/query/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NoEntityFoundError, i as NoCursorOrLimitError, n as QueryResult, o as NoMoreResultsError, s as OffsetCannotBeLessThanZeroError, t as QueryBuilder } from "../queryBuilder-
|
|
1
|
+
import { a as NoEntityFoundError, i as NoCursorOrLimitError, n as QueryResult, o as NoMoreResultsError, s as OffsetCannotBeLessThanZeroError, t as QueryBuilder } from "../queryBuilder-D22Tamry.js";
|
|
2
2
|
|
|
3
3
|
//#region src/query/predicate.ts
|
|
4
4
|
/**
|
|
@@ -1,65 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { g as ArkivClient, t as Entity } from "./entity-DvQtQL8v.js";
|
|
2
|
+
import { Hex } from "viem";
|
|
3
3
|
|
|
4
|
-
//#region src/types/rpcSchema.d.ts
|
|
5
|
-
type RpcEntity = {
|
|
6
|
-
key: Hex;
|
|
7
|
-
contentType: MimeType;
|
|
8
|
-
value: string;
|
|
9
|
-
expiresAt: bigint;
|
|
10
|
-
owner: Hex;
|
|
11
|
-
stringAttributes?: [{
|
|
12
|
-
key: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}];
|
|
15
|
-
numericAttributes?: [{
|
|
16
|
-
key: string;
|
|
17
|
-
value: number;
|
|
18
|
-
}];
|
|
19
|
-
};
|
|
20
|
-
type RpcQueryOptions = {
|
|
21
|
-
atBlock?: number;
|
|
22
|
-
includeData?: RpcIncludeData;
|
|
23
|
-
resultsPerPage?: number;
|
|
24
|
-
cursor?: string;
|
|
25
|
-
};
|
|
26
|
-
type RpcIncludeData = {
|
|
27
|
-
key: boolean;
|
|
28
|
-
attributes: boolean;
|
|
29
|
-
payload: boolean;
|
|
30
|
-
contentType: boolean;
|
|
31
|
-
expiration: boolean;
|
|
32
|
-
owner: boolean;
|
|
33
|
-
};
|
|
34
|
-
type ArkivRpcSchema = [{
|
|
35
|
-
Method: "golembase_getStorageValue";
|
|
36
|
-
Parameters?: [entityId: Hex];
|
|
37
|
-
ReturnType: string;
|
|
38
|
-
}, {
|
|
39
|
-
Method: "arkiv_query";
|
|
40
|
-
Parameters?: [query: string, queryOptions?: RpcQueryOptions];
|
|
41
|
-
ReturnType: {
|
|
42
|
-
data: [RpcEntity];
|
|
43
|
-
blockNumber: bigint;
|
|
44
|
-
cursor: string;
|
|
45
|
-
};
|
|
46
|
-
}, {
|
|
47
|
-
Method: "arkiv_getBlockTiming";
|
|
48
|
-
Parameters?: [];
|
|
49
|
-
ReturnType: {
|
|
50
|
-
current_block: bigint;
|
|
51
|
-
current_block_time: number;
|
|
52
|
-
duration: number;
|
|
53
|
-
};
|
|
54
|
-
}, {
|
|
55
|
-
Method: "arkiv_getEntityCount";
|
|
56
|
-
Parameters?: [];
|
|
57
|
-
ReturnType: number;
|
|
58
|
-
}];
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region src/clients/baseClient.d.ts
|
|
61
|
-
type ArkivClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | undefined = Account | undefined, rpcSchema extends RpcSchema | undefined = ArkivRpcSchema> = Client<transport, chain, accountOrAddress, rpcSchema>;
|
|
62
|
-
//#endregion
|
|
63
4
|
//#region src/query/predicate.d.ts
|
|
64
5
|
type PredicateType = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "not";
|
|
65
6
|
type PredicateContainerType = "or" | "and";
|
|
@@ -197,6 +138,7 @@ declare class QueryResult {
|
|
|
197
138
|
declare class QueryBuilder {
|
|
198
139
|
private _client;
|
|
199
140
|
private _ownedBy;
|
|
141
|
+
private _orderBy;
|
|
200
142
|
private _validAtBlock;
|
|
201
143
|
private _withAttributes;
|
|
202
144
|
private _withMetadata;
|
|
@@ -215,6 +157,20 @@ declare class QueryBuilder {
|
|
|
215
157
|
* builder.ownedBy("0x1234567890123456789012345678901234567890")
|
|
216
158
|
*/
|
|
217
159
|
ownedBy(ownedBy: Hex): this;
|
|
160
|
+
/**
|
|
161
|
+
* Sets the orderBy for the query.
|
|
162
|
+
* It can be called multiple times to order by multiple attributes.
|
|
163
|
+
* The order of the attributes is important. The first attribute is the primary order by attribute.
|
|
164
|
+
* @param attributeName - The name of the attribute to order by
|
|
165
|
+
* @param attributeType - The type of the attribute to order by (string or number)
|
|
166
|
+
* @param descending - The boolean value to set the order by descending
|
|
167
|
+
* @returns The QueryBuilder instance
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* const builder = new QueryBuilder(client)
|
|
171
|
+
* builder.orderBy("name", "string", true)
|
|
172
|
+
*/
|
|
173
|
+
orderBy(attributeName: string, attributeType: "string" | "number", descending?: boolean | undefined): this;
|
|
218
174
|
/**
|
|
219
175
|
* Sets the withAttributes flag which will return the attributes for the entities if true
|
|
220
176
|
* @param withAttributes - The boolean value to set
|
|
@@ -316,5 +272,5 @@ declare class QueryBuilder {
|
|
|
316
272
|
count(): Promise<1>;
|
|
317
273
|
}
|
|
318
274
|
//#endregion
|
|
319
|
-
export { PredicateType as a, gt as c, lte as d, neq as f,
|
|
320
|
-
//# sourceMappingURL=queryBuilder-
|
|
275
|
+
export { PredicateType as a, gt as c, lte as d, neq as f, PredicateContainerType as i, gte as l, or as m, QueryResult as n, and as o, not as p, Predicate as r, eq as s, QueryBuilder as t, lt as u };
|
|
276
|
+
//# sourceMappingURL=queryBuilder-BBtwhH0G.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryBuilder-BBtwhH0G.d.ts","names":[],"sources":["../src/query/predicate.ts","../src/query/queryResult.ts","../src/query/queryBuilder.ts"],"sourcesContent":[],"mappings":";;;;KAAY,aAAA;KACA,sBAAA;KAEA,SAAA;QAEA;EALA,GAAA,EAAA,MAAA;EACA,KAAA,EAAA,MAAA,GAAA,MAAA;AAEZ,CAAA,GAAY;EAEA,IAAA,EAKA,sBALA;EAKA,UAAA,EACM,SADN,EAAA;CACM;;AAclB;AAeA;AAcA;AAcA;AAcA;AAcA;AAcA;AAcA;AAaA;;iBAhHgB,EAAA,aAAe,cAAc;;ACrB7C;;;;;;;;;;ACUa,iBF0BG,GAAA,CE1BS,UAAA,EF0BO,SE1BP,EAAA,CAAA,EF0BqB,SE1BrB;;;;;;;;;;;iBFwCT,EAAA,uCAAyC;;;;;;;;;;;iBAczC,GAAA,uCAA0C;;;;;;;;;;;iBAc1C,EAAA,uCAAyC;;;;;;;;;;;iBAczC,GAAA,uCAA0C;;;;;;;;;;;iBAc1C,EAAA,uCAAyC;;;;;;;;;;;iBAczC,GAAA,uCAA0C;;;;;;;;;;iBAa1C,GAAA,eAAkB;;;cCrIrB,WAAA;YACD;EDLA,QAAA,eAAa;EACb,QAAA,OAAA;EAEA,QAAA,MAAS;EAET,QAAA,aAAA;EAKA,QAAA,aAAA;EACM,IAAA,YAAA,CAAA,CAAA,ECEI,YDFJ;EAAS,IAAA,MAAA,CAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAcX,WAAE,CAAA,QAAa,ECHjB,MDG+B,EAAA,EAAA,YAAS,ECFpC,YDEoC,EAAA,MAAA,EAAA,MAAA,GAAA,SAAA,EAAA,KAAA,EAAA,MAAA,GAAA,SAAA,EAAA,YAAA,EAAA,MAAA,GAAA,SAAA;EAetC,IAAA,CAAA,CAAG,ECJP,ODIO,CAAA,IAAa,CAAA;EAchB,WAAE,CAAA,CAAA,EAAA,OAAuC;AAczD;;;AApEA;AACA;AAEA;;;;AAQ2B,cEGd,YAAA,CFHc;EAcX,QAAE,OAAA;EAeF,QAAG,QAAA;EAcH,QAAE,QAAA;EAcF,QAAG,aAAuC;EAc1C,QAAE,eAAuC;EAczC,QAAG,aAAuC;EAc1C,QAAE,YAAuC;EAczC,QAAG,MAAA;EAaH,QAAG,OAAA;;sBE/GG;;ADtBtB;;;;;;;;mBCoCmB;;AA1BnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAiKoB,cAAc;;;;;;;;;;;WAmBrB,QAAA;;;;;;;;;;WAgCA"}
|
|
@@ -82,8 +82,8 @@ function processPredicates(predicates) {
|
|
|
82
82
|
}).join(" && ");
|
|
83
83
|
}
|
|
84
84
|
async function processQuery(client, queryParams) {
|
|
85
|
-
const { predicates, limit, cursor, ownedBy, validAtBlock, withAttributes, withMetadata, withPayload } = queryParams;
|
|
86
|
-
console.debug(`Processing query with params: predicates: ${predicates}, cursor: ${cursor}, limit: ${limit}, ownedBy: ${ownedBy}, validAtBlock: ${validAtBlock}, withAttributes: ${withAttributes}, withMetadata: ${withMetadata}, withPayload: ${withPayload}`);
|
|
85
|
+
const { predicates, limit, cursor, ownedBy, orderBy, validAtBlock, withAttributes, withMetadata, withPayload } = queryParams;
|
|
86
|
+
console.debug(`Processing query with params: predicates: ${JSON.stringify(predicates)}, cursor: ${cursor}, limit: ${limit}, ownedBy: ${ownedBy}, orderBy: ${JSON.stringify(orderBy)}, validAtBlock: ${validAtBlock}, withAttributes: ${withAttributes}, withMetadata: ${withMetadata}, withPayload: ${withPayload}`);
|
|
87
87
|
let query = processPredicates(predicates);
|
|
88
88
|
if (ownedBy) query += ` && $owner=${ownedBy}`;
|
|
89
89
|
query = query.trim();
|
|
@@ -99,9 +99,11 @@ async function processQuery(client, queryParams) {
|
|
|
99
99
|
if (validAtBlock !== void 0) queryOptions.atBlock = Number(validAtBlock);
|
|
100
100
|
if (limit !== void 0) queryOptions.resultsPerPage = limit;
|
|
101
101
|
if (cursor !== void 0) queryOptions.cursor = cursor;
|
|
102
|
+
if (orderBy !== void 0) queryOptions.orderBy = orderBy;
|
|
102
103
|
console.debug(`Built query to send: ${query}, queryOptions: ${JSON.stringify({
|
|
103
104
|
includeData: queryOptions.includeData,
|
|
104
105
|
atBlock: queryOptions.atBlock?.toString(),
|
|
106
|
+
orderBy: queryOptions.orderBy,
|
|
105
107
|
resultsPerPage: queryOptions.resultsPerPage,
|
|
106
108
|
cursor: queryOptions.cursor
|
|
107
109
|
})}`);
|
|
@@ -163,6 +165,7 @@ var QueryResult = class {
|
|
|
163
165
|
var QueryBuilder = class {
|
|
164
166
|
_client;
|
|
165
167
|
_ownedBy;
|
|
168
|
+
_orderBy;
|
|
166
169
|
_validAtBlock;
|
|
167
170
|
_withAttributes;
|
|
168
171
|
_withMetadata;
|
|
@@ -188,6 +191,28 @@ var QueryBuilder = class {
|
|
|
188
191
|
return this;
|
|
189
192
|
}
|
|
190
193
|
/**
|
|
194
|
+
* Sets the orderBy for the query.
|
|
195
|
+
* It can be called multiple times to order by multiple attributes.
|
|
196
|
+
* The order of the attributes is important. The first attribute is the primary order by attribute.
|
|
197
|
+
* @param attributeName - The name of the attribute to order by
|
|
198
|
+
* @param attributeType - The type of the attribute to order by (string or number)
|
|
199
|
+
* @param descending - The boolean value to set the order by descending
|
|
200
|
+
* @returns The QueryBuilder instance
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* const builder = new QueryBuilder(client)
|
|
204
|
+
* builder.orderBy("name", "string", true)
|
|
205
|
+
*/
|
|
206
|
+
orderBy(attributeName, attributeType, descending = void 0) {
|
|
207
|
+
if (!this._orderBy) this._orderBy = [];
|
|
208
|
+
this._orderBy.push({
|
|
209
|
+
name: attributeName,
|
|
210
|
+
type: attributeType === "number" ? "numeric" : attributeType,
|
|
211
|
+
desc: !!descending
|
|
212
|
+
});
|
|
213
|
+
return this;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
191
216
|
* Sets the withAttributes flag which will return the attributes for the entities if true
|
|
192
217
|
* @param withAttributes - The boolean value to set
|
|
193
218
|
* @returns The QueryBuilder instance
|
|
@@ -303,6 +328,7 @@ var QueryBuilder = class {
|
|
|
303
328
|
limit: this._limit,
|
|
304
329
|
cursor: this._cursor,
|
|
305
330
|
ownedBy: this._ownedBy,
|
|
331
|
+
orderBy: this._orderBy,
|
|
306
332
|
validAtBlock: this._validAtBlock,
|
|
307
333
|
withAttributes: this._withAttributes,
|
|
308
334
|
withMetadata: this._withMetadata,
|
|
@@ -328,6 +354,7 @@ var QueryBuilder = class {
|
|
|
328
354
|
limit: this._limit,
|
|
329
355
|
cursor: this._cursor,
|
|
330
356
|
ownedBy: this._ownedBy,
|
|
357
|
+
orderBy: void 0,
|
|
331
358
|
validAtBlock: this._validAtBlock,
|
|
332
359
|
withAttributes: false,
|
|
333
360
|
withMetadata: false,
|
|
@@ -82,8 +82,8 @@ function processPredicates(predicates) {
|
|
|
82
82
|
}).join(" && ");
|
|
83
83
|
}
|
|
84
84
|
async function processQuery(client, queryParams) {
|
|
85
|
-
const { predicates, limit, cursor, ownedBy, validAtBlock, withAttributes, withMetadata, withPayload } = queryParams;
|
|
86
|
-
console.debug(`Processing query with params: predicates: ${predicates}, cursor: ${cursor}, limit: ${limit}, ownedBy: ${ownedBy}, validAtBlock: ${validAtBlock}, withAttributes: ${withAttributes}, withMetadata: ${withMetadata}, withPayload: ${withPayload}`);
|
|
85
|
+
const { predicates, limit, cursor, ownedBy, orderBy, validAtBlock, withAttributes, withMetadata, withPayload } = queryParams;
|
|
86
|
+
console.debug(`Processing query with params: predicates: ${JSON.stringify(predicates)}, cursor: ${cursor}, limit: ${limit}, ownedBy: ${ownedBy}, orderBy: ${JSON.stringify(orderBy)}, validAtBlock: ${validAtBlock}, withAttributes: ${withAttributes}, withMetadata: ${withMetadata}, withPayload: ${withPayload}`);
|
|
87
87
|
let query = processPredicates(predicates);
|
|
88
88
|
if (ownedBy) query += ` && $owner=${ownedBy}`;
|
|
89
89
|
query = query.trim();
|
|
@@ -99,9 +99,11 @@ async function processQuery(client, queryParams) {
|
|
|
99
99
|
if (validAtBlock !== void 0) queryOptions.atBlock = Number(validAtBlock);
|
|
100
100
|
if (limit !== void 0) queryOptions.resultsPerPage = limit;
|
|
101
101
|
if (cursor !== void 0) queryOptions.cursor = cursor;
|
|
102
|
+
if (orderBy !== void 0) queryOptions.orderBy = orderBy;
|
|
102
103
|
console.debug(`Built query to send: ${query}, queryOptions: ${JSON.stringify({
|
|
103
104
|
includeData: queryOptions.includeData,
|
|
104
105
|
atBlock: queryOptions.atBlock?.toString(),
|
|
106
|
+
orderBy: queryOptions.orderBy,
|
|
105
107
|
resultsPerPage: queryOptions.resultsPerPage,
|
|
106
108
|
cursor: queryOptions.cursor
|
|
107
109
|
})}`);
|
|
@@ -163,6 +165,7 @@ var QueryResult = class {
|
|
|
163
165
|
var QueryBuilder = class {
|
|
164
166
|
_client;
|
|
165
167
|
_ownedBy;
|
|
168
|
+
_orderBy;
|
|
166
169
|
_validAtBlock;
|
|
167
170
|
_withAttributes;
|
|
168
171
|
_withMetadata;
|
|
@@ -188,6 +191,28 @@ var QueryBuilder = class {
|
|
|
188
191
|
return this;
|
|
189
192
|
}
|
|
190
193
|
/**
|
|
194
|
+
* Sets the orderBy for the query.
|
|
195
|
+
* It can be called multiple times to order by multiple attributes.
|
|
196
|
+
* The order of the attributes is important. The first attribute is the primary order by attribute.
|
|
197
|
+
* @param attributeName - The name of the attribute to order by
|
|
198
|
+
* @param attributeType - The type of the attribute to order by (string or number)
|
|
199
|
+
* @param descending - The boolean value to set the order by descending
|
|
200
|
+
* @returns The QueryBuilder instance
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* const builder = new QueryBuilder(client)
|
|
204
|
+
* builder.orderBy("name", "string", true)
|
|
205
|
+
*/
|
|
206
|
+
orderBy(attributeName, attributeType, descending = void 0) {
|
|
207
|
+
if (!this._orderBy) this._orderBy = [];
|
|
208
|
+
this._orderBy.push({
|
|
209
|
+
name: attributeName,
|
|
210
|
+
type: attributeType === "number" ? "numeric" : attributeType,
|
|
211
|
+
desc: !!descending
|
|
212
|
+
});
|
|
213
|
+
return this;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
191
216
|
* Sets the withAttributes flag which will return the attributes for the entities if true
|
|
192
217
|
* @param withAttributes - The boolean value to set
|
|
193
218
|
* @returns The QueryBuilder instance
|
|
@@ -303,6 +328,7 @@ var QueryBuilder = class {
|
|
|
303
328
|
limit: this._limit,
|
|
304
329
|
cursor: this._cursor,
|
|
305
330
|
ownedBy: this._ownedBy,
|
|
331
|
+
orderBy: this._orderBy,
|
|
306
332
|
validAtBlock: this._validAtBlock,
|
|
307
333
|
withAttributes: this._withAttributes,
|
|
308
334
|
withMetadata: this._withMetadata,
|
|
@@ -328,6 +354,7 @@ var QueryBuilder = class {
|
|
|
328
354
|
limit: this._limit,
|
|
329
355
|
cursor: this._cursor,
|
|
330
356
|
ownedBy: this._ownedBy,
|
|
357
|
+
orderBy: void 0,
|
|
331
358
|
validAtBlock: this._validAtBlock,
|
|
332
359
|
withAttributes: false,
|
|
333
360
|
withMetadata: false,
|
|
@@ -338,4 +365,4 @@ var QueryBuilder = class {
|
|
|
338
365
|
|
|
339
366
|
//#endregion
|
|
340
367
|
export { NoEntityFoundError as a, NoCursorOrLimitError as i, QueryResult as n, NoMoreResultsError as o, entityFromRpcResult as r, OffsetCannotBeLessThanZeroError as s, QueryBuilder as t };
|
|
341
|
-
//# sourceMappingURL=queryBuilder-
|
|
368
|
+
//# sourceMappingURL=queryBuilder-D22Tamry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryBuilder-D22Tamry.js","names":["predicate","queryOptions: RpcQueryOptions"],"sources":["../src/query/errors.ts","../src/types/entity.ts","../src/utils/entities.ts","../src/query/engine.ts","../src/query/queryResult.ts","../src/query/queryBuilder.ts"],"sourcesContent":["export class NoMoreResultsError extends Error {\n constructor() {\n super(\"No more results\")\n }\n}\n\nexport class NoCursorOrLimitError extends Error {\n constructor() {\n super(\"Cursor and limit must be defined to fetch next\")\n }\n}\n\nexport class OffsetCannotBeLessThanZeroError extends Error {\n constructor() {\n super(\"Offset cannot be less than 0\")\n }\n}\n\nexport class NoEntityFoundError extends Error {\n constructor() {\n super(\"No entity found\")\n }\n}\n","import { bytesToString, type Hex } from \"viem\"\nimport type { MimeType } from \"../types\"\nimport type { Attribute } from \"./attributes\"\n\nexport class Entity {\n key: Hex\n owner: Hex\n expiresAtBlock: bigint\n payload: Uint8Array\n attributes: Attribute[]\n contentType: MimeType\n\n constructor(\n key: Hex,\n contentType: MimeType,\n owner: Hex,\n expiresAtBlock: bigint,\n payload: Uint8Array,\n attributes: Attribute[],\n ) {\n this.key = key\n this.owner = owner\n this.expiresAtBlock = expiresAtBlock\n this.payload = payload\n this.attributes = attributes\n this.contentType = contentType\n }\n\n toText(): string {\n return bytesToString(this.payload)\n }\n\n toJson(): any {\n return JSON.parse(bytesToString(this.payload))\n }\n}\n","import { toBytes } from \"viem\"\nimport { Entity } from \"../types/entity\"\nimport type { RpcEntity } from \"../types/rpcSchema\"\n\nexport async function entityFromRpcResult(rpcEntity: RpcEntity) {\n return new Entity(\n rpcEntity.key,\n rpcEntity.contentType,\n rpcEntity.owner,\n rpcEntity.expiresAt,\n toBytes(rpcEntity.value),\n [\n ...(rpcEntity.stringAttributes ?? []).map(({ key, value }) => ({\n key,\n value,\n })),\n ...(rpcEntity.numericAttributes ?? []).map(({ key, value }) => ({\n key,\n value: Number(value),\n })),\n ],\n )\n}\n","import type { Hex } from \"viem\"\nimport type { ArkivClient } from \"../clients/baseClient\"\nimport type { RpcOrderByAttribute, RpcQueryOptions } from \"../types/rpcSchema\"\nimport type { Predicate } from \"./predicate\"\n\nfunction processPredicates(predicates: Predicate[]): string {\n const processValue = (value: string | number) => {\n if (typeof value === \"string\") {\n return `\"${value}\"`\n }\n return value\n }\n return predicates\n .map((predicate) => {\n switch (predicate.type) {\n case \"eq\":\n return `${predicate.key} = ${processValue(predicate.value)}`\n case \"neq\":\n return `${predicate.key} != ${processValue(predicate.value)}`\n case \"gt\":\n return `${predicate.key} > ${processValue(predicate.value)}`\n case \"gte\":\n return `${predicate.key} >= ${processValue(predicate.value)}`\n case \"lt\":\n return `${predicate.key} < ${processValue(predicate.value)}`\n case \"lte\":\n return `${predicate.key} <= ${processValue(predicate.value)}`\n case \"not\":\n return `!${predicate.key}`\n case \"or\":\n return `(${predicate.predicates.map((predicate) => processPredicates([predicate])).join(\" || \")})`\n case \"and\":\n return `(${predicate.predicates.map((predicate) => processPredicates([predicate])).join(\" && \")})`\n default:\n return \"\"\n }\n })\n .join(\" && \")\n}\n\nexport async function processQuery(\n client: ArkivClient,\n queryParams: {\n predicates: Predicate[]\n limit: number | undefined\n cursor: string | undefined\n ownedBy: Hex | undefined\n orderBy: RpcOrderByAttribute[] | undefined\n validAtBlock?: bigint | undefined\n withAttributes?: boolean | undefined\n withMetadata?: boolean | undefined\n withPayload?: boolean | undefined\n },\n) {\n const {\n predicates,\n limit,\n cursor,\n ownedBy,\n orderBy,\n validAtBlock,\n withAttributes,\n withMetadata,\n withPayload,\n } = queryParams\n\n console.debug(\n `Processing query with params: predicates: ${JSON.stringify(predicates)}, cursor: ${cursor}, limit: ${limit}, ownedBy: ${ownedBy}, orderBy: ${JSON.stringify(orderBy)}, validAtBlock: ${validAtBlock}, withAttributes: ${withAttributes}, withMetadata: ${withMetadata}, withPayload: ${withPayload}`,\n )\n\n let query = processPredicates(predicates)\n if (ownedBy) {\n query += ` && $owner=${ownedBy}`\n }\n\n // remove leading and trailing spaces and leading &&\n query = query.trim()\n if (query.startsWith(\"&& \")) {\n query = query.slice(3)\n }\n\n const queryOptions: RpcQueryOptions = {\n includeData: {\n key: true,\n attributes: withAttributes ?? false,\n payload: withPayload ?? false,\n contentType: withMetadata ?? false,\n expiration: withMetadata ?? false,\n owner: withMetadata ?? false,\n },\n }\n\n if (validAtBlock !== undefined) {\n queryOptions.atBlock = Number(validAtBlock)\n }\n if (limit !== undefined) {\n queryOptions.resultsPerPage = limit\n }\n if (cursor !== undefined) {\n queryOptions.cursor = cursor\n }\n if (orderBy !== undefined) {\n queryOptions.orderBy = orderBy\n }\n\n console.debug(\n `Built query to send: ${query}, queryOptions: ${JSON.stringify({ includeData: queryOptions.includeData, atBlock: queryOptions.atBlock?.toString(), orderBy: queryOptions.orderBy, resultsPerPage: queryOptions.resultsPerPage, cursor: queryOptions.cursor })}`,\n )\n\n const result = await client.request({\n method: \"arkiv_query\",\n params: [query, queryOptions],\n })\n console.debug(\"Raw result from query: \", result)\n\n return result\n}\n","import type { Entity } from \"../types/entity\"\nimport { NoCursorOrLimitError, NoMoreResultsError } from \"./errors\"\nimport type { QueryBuilder } from \"./queryBuilder\"\n\nexport class QueryResult {\n entities: Entity[]\n private _endOfIteration: boolean\n private _cursor: string | undefined\n private _limit: number | undefined\n private _validAtBlock: bigint | undefined\n private _queryBuilder: QueryBuilder\n\n // Public getters for internal state\n get queryBuilder(): QueryBuilder {\n return this._queryBuilder\n }\n\n get cursor(): string | undefined {\n return this._cursor\n }\n\n constructor(\n entities: Entity[],\n queryBuilder: QueryBuilder,\n cursor: string | undefined,\n limit: number | undefined,\n validAtBlock: bigint | undefined,\n ) {\n this.entities = entities\n this._queryBuilder = queryBuilder\n this._endOfIteration = !limit || entities.length < limit\n this._cursor = cursor\n this._limit = limit\n this._validAtBlock = validAtBlock\n }\n\n async next() {\n if (this._cursor === undefined || this._limit === undefined) {\n throw new NoCursorOrLimitError()\n }\n if (this._endOfIteration) {\n throw new NoMoreResultsError()\n }\n this._queryBuilder.cursor(this._cursor)\n const result = await this._queryBuilder.fetch()\n this.entities = result.entities\n // Update the query builder reference\n this._queryBuilder = result.queryBuilder\n // Check if we've reached the end (no more cursor or we got fewer entities than limit)\n this._endOfIteration = !result.cursor || result.entities.length < this._limit\n // Update the cursor\n this._cursor = result.cursor\n\n // TODO check current block height and if it is not too old\n console.debug(\"Current block height for next page: \", this._validAtBlock)\n }\n\n hasNextPage() {\n return !this._endOfIteration\n }\n}\n","import type { Hex } from \"viem\"\nimport type { ArkivClient } from \"../clients/baseClient\"\nimport type { RpcOrderByAttribute } from \"../types/rpcSchema\"\nimport { entityFromRpcResult } from \"../utils/entities\"\nimport { processQuery } from \"./engine\"\nimport type { Predicate } from \"./predicate\"\nimport { QueryResult } from \"./queryResult\"\n\n/**\n * QueryBuilder is a helper class to build queries to the Arkiv DBChains.\n * It can be used to fetch entities from the Arkiv DBChains. It follows the Builder pattern allowing chaining of methods.\n * @param client - The Arkiv client\n * @returns The QueryBuilder instance {@link QueryBuilder}\n */\nexport class QueryBuilder {\n private _client: ArkivClient\n private _ownedBy: Hex | undefined\n private _orderBy: RpcOrderByAttribute[] | undefined\n private _validAtBlock: bigint | undefined\n private _withAttributes: boolean | undefined\n private _withMetadata: boolean | undefined\n private _withPayload: boolean | undefined\n private _limit: number | undefined\n private _cursor: string | undefined\n private _predicates: Predicate[]\n\n constructor(client: ArkivClient) {\n this._client = client\n this._predicates = []\n }\n\n /**\n * Sets the ownedBy filter\n * @param ownedBy - The address of the owner\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.ownedBy(\"0x1234567890123456789012345678901234567890\")\n */\n ownedBy(ownedBy: Hex) {\n this._ownedBy = ownedBy\n return this\n }\n\n /**\n * Sets the orderBy for the query.\n * It can be called multiple times to order by multiple attributes.\n * The order of the attributes is important. The first attribute is the primary order by attribute.\n * @param attributeName - The name of the attribute to order by\n * @param attributeType - The type of the attribute to order by (string or number)\n * @param descending - The boolean value to set the order by descending\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.orderBy(\"name\", \"string\", true)\n */\n orderBy(\n attributeName: string,\n attributeType: \"string\" | \"number\",\n descending: boolean | undefined = undefined,\n ) {\n if (!this._orderBy) {\n this._orderBy = []\n }\n this._orderBy.push({\n name: attributeName,\n type: attributeType === \"number\" ? \"numeric\" : attributeType,\n desc: !!descending,\n } as RpcOrderByAttribute)\n return this\n }\n\n /**\n * Sets the withAttributes flag which will return the attributes for the entities if true\n * @param withAttributes - The boolean value to set\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.withAttributes(true)\n */\n withAttributes(withAttributes: boolean = true) {\n this._withAttributes = withAttributes\n return this\n }\n\n /**\n * Sets the withMetadata flag which will return the metadata (like owner, expiredAt, etc.) for the entities if true\n * @param withMetadata - The boolean value to set\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.withMetadata(true)\n */\n withMetadata(withMetadata: boolean = true) {\n this._withMetadata = withMetadata\n return this\n }\n\n /**\n * Sets the withPayload flag which will return the payload for the entities if true\n * @param withPayload - The boolean value to set\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.withPayload(true)\n */\n withPayload(withPayload: boolean = true) {\n this._withPayload = withPayload\n return this\n }\n\n /**\n * Sets the limit for the query\n * @param limit - The number of entities to return\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.limit(10)\n */\n limit(limit: number) {\n this._limit = limit\n return this\n }\n\n /**\n * Sets the cursor for the query - it is advances setting which rather shouldn't be used manually but it is provided from query result if limit is used (pagination).\n * @param cursor - The cursor to set which tells to RPC Query server where to start or continue the query.\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.offset(10)\n */\n cursor(cursor: string) {\n this._cursor = cursor\n return this\n }\n\n /**\n * Sets the validAtBlock for the query which tells at which block height the state we are intested.\n * If not set, the latest block is used.\n * @param validAtBlock - The block number to set\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.validAtBlock(10000)\n */\n validAtBlock(validAtBlock: bigint) {\n this._validAtBlock = validAtBlock\n return this\n }\n\n /**\n * Sets the predicates for the query limiting the results. It can be a single predicate or an array of predicates combined with 'and'.\n * Predicates can be nested using 'or' and 'and' predicates.\n * @param predicates - The predicates to set\n * @returns The QueryBuilder instance\n *\n * @example\n * const builder = new QueryBuilder(client)\n * builder.where(eq(\"name\", \"John\"))\n * builder.where([eq(\"name\", \"John\"), eq(\"age\", 30)])\n * builder.where([eq(\"name\", \"John\"), or([eq(\"age\", 30), eq(\"age\", 31)])])\n * builder.where([eq(\"name\", \"John\"), and([eq(\"age\", 30), eq(\"age\", 31)])])\n * builder.where([eq(\"name\", \"John\"), or([eq(\"age\", 30), and([eq(\"age\", 31), eq(\"age\", 32)])])])\n * builder.where([eq(\"name\", \"John\"), and([eq(\"age\", 30), or([eq(\"age\", 31), eq(\"age\", 32)])])])\n * builder.where([eq(\"name\", \"John\"), and([eq(\"age\", 30), or([eq(\"age\", 31), and([eq(\"age\", 32), eq(\"age\", 33)])])])])\n */\n where(predicates: Predicate[] | Predicate) {\n if (Array.isArray(predicates)) {\n this._predicates.push(...predicates)\n } else {\n this._predicates.push(predicates)\n }\n return this\n }\n\n /**\n * Fetches the entities from the query. Re\n * It will return a QueryResult instance which can be used to fetch the next and previous pages.\n * @returns The QueryResult instance {@link QueryResult}\n *\n * @example\n * const builder = new QueryBuilder(client)\n * const result = await builder.where(eq(\"name\", \"John\")).fetch()\n * // result = { entities: [Entity, Entity, Entity], next: async () => QueryResult, previous: async () => QueryResult }\n */\n async fetch() {\n const queryResult = await processQuery(this._client, {\n predicates: this._predicates,\n limit: this._limit,\n cursor: this._cursor,\n ownedBy: this._ownedBy,\n orderBy: this._orderBy,\n validAtBlock: this._validAtBlock,\n withAttributes: this._withAttributes,\n withMetadata: this._withMetadata,\n withPayload: this._withPayload,\n })\n\n const entities = await Promise.all(\n queryResult.data.map((entity) => entityFromRpcResult(entity)),\n )\n\n this.cursor(queryResult.cursor)\n this.validAtBlock(queryResult.blockNumber)\n\n return new QueryResult(entities, this, this._cursor, this._limit, this._validAtBlock)\n }\n\n /**\n * Counts the entities from the query.\n * @returns The number of entities\n *\n * @example\n * const builder = new QueryBuilder(client)\n * const result = await builder.where(eq(\"name\", \"John\")).count()\n * // result = 10\n */\n async count() {\n const queryResult = await processQuery(this._client, {\n predicates: this._predicates,\n limit: this._limit,\n cursor: this._cursor,\n ownedBy: this._ownedBy,\n orderBy: undefined,\n validAtBlock: this._validAtBlock,\n withAttributes: false,\n withMetadata: false,\n withPayload: false,\n })\n\n return queryResult.data.length ?? 0\n }\n}\n"],"mappings":";;;AAAA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,cAAc;AACZ,QAAM,kBAAkB;;;AAI5B,IAAa,uBAAb,cAA0C,MAAM;CAC9C,cAAc;AACZ,QAAM,iDAAiD;;;AAI3D,IAAa,kCAAb,cAAqD,MAAM;CACzD,cAAc;AACZ,QAAM,+BAA+B;;;AAIzC,IAAa,qBAAb,cAAwC,MAAM;CAC5C,cAAc;AACZ,QAAM,kBAAkB;;;;;;AChB5B,IAAa,SAAb,MAAoB;CAClB;CACA;CACA;CACA;CACA;CACA;CAEA,YACE,KACA,aACA,OACA,gBACA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