@arkiv-network/sdk 0.6.2 → 0.6.3-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.
Files changed (38) hide show
  1. package/dist/chains/index.d.ts +41 -41
  2. package/dist/chains/index.d.ts.map +1 -1
  3. package/dist/index.cjs +6 -4
  4. package/dist/index.d.cts +2 -2
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +6 -4
  7. package/dist/index.js.map +1 -1
  8. package/dist/query/index.cjs +1 -1
  9. package/dist/query/index.d.cts +2 -2
  10. package/dist/query/index.d.ts +2 -2
  11. package/dist/query/index.js +1 -1
  12. package/dist/{query-fCVivD9L.d.cts → query-BeKsGPR3.d.cts} +5 -2
  13. package/dist/query-BeKsGPR3.d.cts.map +1 -0
  14. package/dist/{query-BOF-ysxw.d.ts → query-DnKI7Fry.d.ts} +5 -2
  15. package/dist/query-DnKI7Fry.d.ts.map +1 -0
  16. package/dist/{queryBuilder-CE7didAc.cjs → queryBuilder-Ba4YtfY4.cjs} +24 -3
  17. package/dist/{queryBuilder-UO2ZKHFN.js → queryBuilder-C22NdvTJ.js} +25 -4
  18. package/dist/queryBuilder-C22NdvTJ.js.map +1 -0
  19. package/dist/{queryBuilder-CAZQmp71.d.ts → queryBuilder-C24NWMmN.d.ts} +13 -2
  20. package/dist/{queryBuilder-CAZQmp71.d.ts.map → queryBuilder-C24NWMmN.d.ts.map} +1 -1
  21. package/dist/{queryBuilder-DSWzci3Y.d.cts → queryBuilder-CqSuICrM.d.cts} +13 -2
  22. package/dist/{queryBuilder-DSWzci3Y.d.cts.map → queryBuilder-CqSuICrM.d.cts.map} +1 -1
  23. package/dist/types/index.d.cts +1 -1
  24. package/dist/types/index.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/src/actions/public/getEntity.ts +1 -0
  27. package/src/actions/public/query.ts +1 -0
  28. package/src/query/engine.test.ts +93 -0
  29. package/src/query/engine.ts +7 -0
  30. package/src/query/queryBuilder.test.ts +43 -0
  31. package/src/query/queryBuilder.ts +17 -0
  32. package/src/types/entity.ts +3 -0
  33. package/src/types/rpcSchema.ts +2 -0
  34. package/src/utils/arkivTransactions.ts +6 -3
  35. package/src/utils/entities.ts +1 -0
  36. package/dist/query-BOF-ysxw.d.ts.map +0 -1
  37. package/dist/query-fCVivD9L.d.cts.map +0 -1
  38. package/dist/queryBuilder-UO2ZKHFN.js.map +0 -1
@@ -16,6 +16,7 @@ describe("processQuery tests", () => {
16
16
  limit: undefined,
17
17
  cursor: undefined,
18
18
  ownedBy: undefined,
19
+ createdBy: undefined,
19
20
  orderBy: undefined,
20
21
  validAtBlock: undefined,
21
22
  withAttributes: undefined,
@@ -35,6 +36,7 @@ describe("processQuery tests", () => {
35
36
  payload: false,
36
37
  expiration: false,
37
38
  owner: false,
39
+ creator: false,
38
40
  createdAtBlock: false,
39
41
  lastModifiedAtBlock: false,
40
42
  transactionIndexInBlock: false,
@@ -59,6 +61,7 @@ describe("processQuery tests", () => {
59
61
  limit: undefined,
60
62
  cursor: undefined,
61
63
  ownedBy: undefined,
64
+ createdBy: undefined,
62
65
  orderBy: undefined,
63
66
  validAtBlock: undefined,
64
67
  withAttributes: undefined,
@@ -77,6 +80,7 @@ describe("processQuery tests", () => {
77
80
  payload: false,
78
81
  expiration: false,
79
82
  owner: false,
83
+ creator: false,
80
84
  createdAtBlock: false,
81
85
  lastModifiedAtBlock: false,
82
86
  transactionIndexInBlock: false,
@@ -103,6 +107,7 @@ describe("processQuery tests", () => {
103
107
  limit: undefined,
104
108
  cursor: undefined,
105
109
  ownedBy: undefined,
110
+ createdBy: undefined,
106
111
  orderBy: undefined,
107
112
  validAtBlock: undefined,
108
113
  withAttributes: undefined,
@@ -121,6 +126,7 @@ describe("processQuery tests", () => {
121
126
  payload: false,
122
127
  expiration: false,
123
128
  owner: false,
129
+ creator: false,
124
130
  createdAtBlock: false,
125
131
  lastModifiedAtBlock: false,
126
132
  transactionIndexInBlock: false,
@@ -147,6 +153,7 @@ describe("processQuery tests", () => {
147
153
  limit: undefined,
148
154
  cursor: undefined,
149
155
  ownedBy: undefined,
156
+ createdBy: undefined,
150
157
  orderBy: undefined,
151
158
  validAtBlock: undefined,
152
159
  withAttributes: undefined,
@@ -165,6 +172,7 @@ describe("processQuery tests", () => {
165
172
  payload: false,
166
173
  expiration: false,
167
174
  owner: false,
175
+ creator: false,
168
176
  createdAtBlock: false,
169
177
  lastModifiedAtBlock: false,
170
178
  transactionIndexInBlock: false,
@@ -197,6 +205,7 @@ describe("processQuery tests", () => {
197
205
  limit: undefined,
198
206
  cursor: undefined,
199
207
  ownedBy: undefined,
208
+ createdBy: undefined,
200
209
  orderBy: undefined,
201
210
  validAtBlock: undefined,
202
211
  withAttributes: undefined,
@@ -215,6 +224,7 @@ describe("processQuery tests", () => {
215
224
  payload: false,
216
225
  expiration: false,
217
226
  owner: false,
227
+ creator: false,
218
228
  createdAtBlock: false,
219
229
  lastModifiedAtBlock: false,
220
230
  transactionIndexInBlock: false,
@@ -233,6 +243,7 @@ describe("processQuery tests", () => {
233
243
  limit: undefined,
234
244
  cursor: undefined,
235
245
  ownedBy: "0x123",
246
+ createdBy: undefined,
236
247
  })
237
248
 
238
249
  expect(client.request).lastCalledWith({
@@ -247,6 +258,7 @@ describe("processQuery tests", () => {
247
258
  payload: false,
248
259
  expiration: false,
249
260
  owner: false,
261
+ creator: false,
250
262
  createdAtBlock: false,
251
263
  lastModifiedAtBlock: false,
252
264
  transactionIndexInBlock: false,
@@ -268,6 +280,7 @@ describe("processQuery tests", () => {
268
280
  withAttributes: undefined,
269
281
  withMetadata: undefined,
270
282
  ownedBy: "0x123",
283
+ createdBy: undefined,
271
284
  })
272
285
 
273
286
  expect(client.request).lastCalledWith({
@@ -282,6 +295,78 @@ describe("processQuery tests", () => {
282
295
  payload: false,
283
296
  expiration: false,
284
297
  owner: false,
298
+ creator: false,
299
+ createdAtBlock: false,
300
+ lastModifiedAtBlock: false,
301
+ transactionIndexInBlock: false,
302
+ operationIndexInTransaction: false,
303
+ },
304
+ },
305
+ ],
306
+ })
307
+ })
308
+
309
+ it("should process simple predicates with createdBy", async () => {
310
+ const predicates = [{ type: "eq" as const, key: "key", value: "value" }]
311
+ await processQuery(client, {
312
+ predicates,
313
+ orderBy: undefined,
314
+ limit: undefined,
315
+ cursor: undefined,
316
+ ownedBy: undefined,
317
+ createdBy: "0x123",
318
+ })
319
+
320
+ expect(client.request).lastCalledWith({
321
+ method: "arkiv_query",
322
+ params: [
323
+ `key = "value" && $creator=0x123`,
324
+ {
325
+ includeData: {
326
+ key: true,
327
+ attributes: false,
328
+ contentType: false,
329
+ payload: false,
330
+ expiration: false,
331
+ owner: false,
332
+ creator: false,
333
+ createdAtBlock: false,
334
+ lastModifiedAtBlock: false,
335
+ transactionIndexInBlock: false,
336
+ operationIndexInTransaction: false,
337
+ },
338
+ },
339
+ ],
340
+ })
341
+ })
342
+
343
+ it("should process only createdBy", async () => {
344
+ const predicates = [] as Predicate[]
345
+ await processQuery(client, {
346
+ predicates,
347
+ limit: undefined,
348
+ cursor: undefined,
349
+ orderBy: undefined,
350
+ validAtBlock: undefined,
351
+ withAttributes: undefined,
352
+ withMetadata: undefined,
353
+ ownedBy: undefined,
354
+ createdBy: "0x123",
355
+ })
356
+
357
+ expect(client.request).lastCalledWith({
358
+ method: "arkiv_query",
359
+ params: [
360
+ `$creator=0x123`,
361
+ {
362
+ includeData: {
363
+ key: true,
364
+ attributes: false,
365
+ contentType: false,
366
+ payload: false,
367
+ expiration: false,
368
+ owner: false,
369
+ creator: false,
285
370
  createdAtBlock: false,
286
371
  lastModifiedAtBlock: false,
287
372
  transactionIndexInBlock: false,
@@ -300,6 +385,7 @@ describe("processQuery tests", () => {
300
385
  limit: undefined,
301
386
  cursor: undefined,
302
387
  ownedBy: undefined,
388
+ createdBy: undefined,
303
389
  })
304
390
 
305
391
  expect(client.request).lastCalledWith({
@@ -315,6 +401,7 @@ describe("processQuery tests", () => {
315
401
  payload: false,
316
402
  expiration: false,
317
403
  owner: false,
404
+ creator: false,
318
405
  createdAtBlock: false,
319
406
  lastModifiedAtBlock: false,
320
407
  transactionIndexInBlock: false,
@@ -332,6 +419,7 @@ describe("processQuery tests", () => {
332
419
  limit: undefined,
333
420
  cursor: undefined,
334
421
  ownedBy: undefined,
422
+ createdBy: undefined,
335
423
  orderBy: [{ name: "key", type: "string", desc: true }],
336
424
  validAtBlock: undefined,
337
425
  withAttributes: undefined,
@@ -351,6 +439,7 @@ describe("processQuery tests", () => {
351
439
  payload: false,
352
440
  expiration: false,
353
441
  owner: false,
442
+ creator: false,
354
443
  createdAtBlock: false,
355
444
  lastModifiedAtBlock: false,
356
445
  transactionIndexInBlock: false,
@@ -370,6 +459,7 @@ describe("processQuery tests", () => {
370
459
  orderBy: undefined,
371
460
  validAtBlock: 123n,
372
461
  ownedBy: "0x123",
462
+ createdBy: undefined,
373
463
  })
374
464
 
375
465
  expect(client.request).lastCalledWith({
@@ -386,6 +476,7 @@ describe("processQuery tests", () => {
386
476
  payload: false,
387
477
  expiration: false,
388
478
  owner: false,
479
+ creator: false,
389
480
  createdAtBlock: false,
390
481
  lastModifiedAtBlock: false,
391
482
  transactionIndexInBlock: false,
@@ -405,6 +496,7 @@ describe("processQuery tests", () => {
405
496
  orderBy: undefined,
406
497
  validAtBlock: undefined,
407
498
  ownedBy: "0x123",
499
+ createdBy: undefined,
408
500
  withMetadata: true,
409
501
  })
410
502
 
@@ -421,6 +513,7 @@ describe("processQuery tests", () => {
421
513
  payload: false,
422
514
  expiration: true,
423
515
  owner: true,
516
+ creator: true,
424
517
  createdAtBlock: true,
425
518
  lastModifiedAtBlock: true,
426
519
  transactionIndexInBlock: true,
@@ -49,6 +49,7 @@ export async function processQuery(
49
49
  limit: number | undefined
50
50
  cursor: string | undefined
51
51
  ownedBy: Hex | undefined
52
+ createdBy: Hex | undefined
52
53
  orderBy: RpcOrderByAttribute[] | undefined
53
54
  validAtBlock?: bigint | undefined
54
55
  withAttributes?: boolean | undefined
@@ -61,6 +62,7 @@ export async function processQuery(
61
62
  limit,
62
63
  cursor,
63
64
  ownedBy,
65
+ createdBy,
64
66
  orderBy,
65
67
  validAtBlock,
66
68
  withAttributes,
@@ -73,6 +75,7 @@ export async function processQuery(
73
75
  cursor,
74
76
  limit,
75
77
  ownedBy,
78
+ createdBy,
76
79
  orderBy,
77
80
  validAtBlock,
78
81
  withAttributes,
@@ -84,6 +87,9 @@ export async function processQuery(
84
87
  if (ownedBy) {
85
88
  query += ` && $owner=${ownedBy}`
86
89
  }
90
+ if (createdBy) {
91
+ query += ` && $creator=${createdBy}`
92
+ }
87
93
 
88
94
  // remove leading and trailing spaces and leading &&
89
95
  query = query.trim()
@@ -99,6 +105,7 @@ export async function processQuery(
99
105
  contentType: withMetadata ?? false,
100
106
  expiration: withMetadata ?? false,
101
107
  owner: withMetadata ?? false,
108
+ creator: withMetadata ?? false,
102
109
  createdAtBlock: withMetadata ?? false,
103
110
  lastModifiedAtBlock: withMetadata ?? false,
104
111
  transactionIndexInBlock: withMetadata ?? false,
@@ -46,6 +46,7 @@ describe("QueryBuilder", () => {
46
46
  limit: undefined,
47
47
  offset: undefined,
48
48
  ownedBy: undefined,
49
+ createdBy: undefined,
49
50
  orderBy: undefined,
50
51
  validBeforeBlock: undefined,
51
52
  withAttributes: undefined,
@@ -68,6 +69,7 @@ describe("QueryBuilder", () => {
68
69
  limit: undefined,
69
70
  offset: undefined,
70
71
  ownedBy: undefined,
72
+ createdBy: undefined,
71
73
  orderBy: undefined,
72
74
  validBeforeBlock: undefined,
73
75
  withAttributes: undefined,
@@ -98,6 +100,7 @@ describe("QueryBuilder", () => {
98
100
  limit: undefined,
99
101
  offset: undefined,
100
102
  ownedBy: undefined,
103
+ createdBy: undefined,
101
104
  orderBy: undefined,
102
105
  validBeforeBlock: undefined,
103
106
  withAttributes: undefined,
@@ -120,6 +123,7 @@ describe("QueryBuilder", () => {
120
123
  limit: undefined,
121
124
  offset: undefined,
122
125
  ownedBy: undefined,
126
+ createdBy: undefined,
123
127
  orderBy: undefined,
124
128
  validBeforeBlock: undefined,
125
129
  withAttributes: undefined,
@@ -145,6 +149,7 @@ describe("QueryBuilder", () => {
145
149
  limit: undefined,
146
150
  offset: undefined,
147
151
  ownedBy: undefined,
152
+ createdBy: undefined,
148
153
  orderBy: undefined,
149
154
  validBeforeBlock: undefined,
150
155
  withAttributes: undefined,
@@ -169,6 +174,30 @@ describe("QueryBuilder", () => {
169
174
  limit: undefined,
170
175
  offset: undefined,
171
176
  ownedBy: owner,
177
+ createdBy: undefined,
178
+ orderBy: undefined,
179
+ validBeforeBlock: undefined,
180
+ withAttributes: undefined,
181
+ withMetadata: undefined,
182
+ withPayload: undefined,
183
+ })
184
+ })
185
+
186
+ test("createdBy() sets creator", async () => {
187
+ mockProcessQuery.mockResolvedValue({
188
+ data: [],
189
+ })
190
+
191
+ const builder = new QueryBuilder(mockClient)
192
+ const creator = "0x1234567890123456789012345678901234567890" as const
193
+ await builder.createdBy(creator).fetch()
194
+
195
+ expect(mockProcessQuery).toHaveBeenCalledWith(mockClient, {
196
+ predicates: [],
197
+ limit: undefined,
198
+ offset: undefined,
199
+ ownedBy: undefined,
200
+ createdBy: creator,
172
201
  orderBy: undefined,
173
202
  validBeforeBlock: undefined,
174
203
  withAttributes: undefined,
@@ -190,6 +219,7 @@ describe("QueryBuilder", () => {
190
219
  limit: undefined,
191
220
  offset: undefined,
192
221
  ownedBy: undefined,
222
+ createdBy: undefined,
193
223
  orderBy: [{ name: "name", type: "string", desc: false }],
194
224
  validAtBlock: undefined,
195
225
  withAttributes: undefined,
@@ -211,6 +241,7 @@ describe("QueryBuilder", () => {
211
241
  limit: undefined,
212
242
  offset: undefined,
213
243
  ownedBy: undefined,
244
+ createdBy: undefined,
214
245
  orderBy: [{ name: "name", type: "string", desc: true }],
215
246
  validAtBlock: undefined,
216
247
  withAttributes: undefined,
@@ -232,6 +263,7 @@ describe("QueryBuilder", () => {
232
263
  limit: undefined,
233
264
  offset: undefined,
234
265
  ownedBy: undefined,
266
+ createdBy: undefined,
235
267
  orderBy: [{ name: "name", type: "string", desc: false }],
236
268
  validAtBlock: undefined,
237
269
  withAttributes: undefined,
@@ -252,6 +284,7 @@ describe("QueryBuilder", () => {
252
284
  limit: 10,
253
285
  offset: undefined,
254
286
  ownedBy: undefined,
287
+ createdBy: undefined,
255
288
  orderBy: undefined,
256
289
  validBeforeBlock: undefined,
257
290
  withAttributes: undefined,
@@ -273,6 +306,7 @@ describe("QueryBuilder", () => {
273
306
  limit: undefined,
274
307
  cursor: "0xABC123",
275
308
  ownedBy: undefined,
309
+ createdBy: undefined,
276
310
  orderBy: undefined,
277
311
  validAtBlock: undefined,
278
312
  withAttributes: undefined,
@@ -294,6 +328,7 @@ describe("QueryBuilder", () => {
294
328
  limit: undefined,
295
329
  offset: undefined,
296
330
  ownedBy: undefined,
331
+ createdBy: undefined,
297
332
  orderBy: undefined,
298
333
  validBeforeBlock: undefined,
299
334
  withAttributes: true,
@@ -315,6 +350,7 @@ describe("QueryBuilder", () => {
315
350
  limit: undefined,
316
351
  cursor: undefined,
317
352
  ownedBy: undefined,
353
+ createdBy: undefined,
318
354
  orderBy: undefined,
319
355
  validBeforeBlock: undefined,
320
356
  withAttributes: false,
@@ -336,6 +372,7 @@ describe("QueryBuilder", () => {
336
372
  limit: undefined,
337
373
  cursor: undefined,
338
374
  ownedBy: undefined,
375
+ createdBy: undefined,
339
376
  orderBy: undefined,
340
377
  validAtBlock: undefined,
341
378
  withAttributes: undefined,
@@ -357,6 +394,7 @@ describe("QueryBuilder", () => {
357
394
  limit: undefined,
358
395
  cursor: undefined,
359
396
  ownedBy: undefined,
397
+ createdBy: undefined,
360
398
  orderBy: undefined,
361
399
  validAtBlock: undefined,
362
400
  withAttributes: undefined,
@@ -378,6 +416,7 @@ describe("QueryBuilder", () => {
378
416
  limit: undefined,
379
417
  cursor: undefined,
380
418
  ownedBy: undefined,
419
+ createdBy: undefined,
381
420
  orderBy: undefined,
382
421
  validAtBlock: undefined,
383
422
  withAttributes: undefined,
@@ -399,6 +438,7 @@ describe("QueryBuilder", () => {
399
438
  limit: undefined,
400
439
  cursor: undefined,
401
440
  ownedBy: undefined,
441
+ createdBy: undefined,
402
442
  validAtBlock: undefined,
403
443
  withAttributes: undefined,
404
444
  withMetadata: undefined,
@@ -429,6 +469,7 @@ describe("QueryBuilder", () => {
429
469
  limit: 10,
430
470
  cursor: "0xABC123",
431
471
  ownedBy: owner,
472
+ createdBy: undefined,
432
473
  validAtBlock: undefined,
433
474
  withAttributes: true,
434
475
  withMetadata: true,
@@ -518,6 +559,7 @@ describe("QueryBuilder", () => {
518
559
  limit: undefined,
519
560
  cursor: undefined,
520
561
  ownedBy: undefined,
562
+ createdBy: undefined,
521
563
  validAtBlock: undefined,
522
564
  withAttributes: false,
523
565
  withMetadata: false,
@@ -559,6 +601,7 @@ describe("QueryBuilder", () => {
559
601
  limit: 50,
560
602
  cursor: "0xABC123",
561
603
  ownedBy: owner,
604
+ createdBy: undefined,
562
605
  validAtBlock: 123n,
563
606
  withAttributes: false,
564
607
  withMetadata: false,
@@ -54,6 +54,7 @@ export function desc(attributeName: string, attributeType: "string" | "number"):
54
54
  export class QueryBuilder {
55
55
  private _client: ArkivClient
56
56
  private _ownedBy: Hex | undefined
57
+ private _createdBy: Hex | undefined
57
58
  private _orderBy: RpcOrderByAttribute[] | undefined
58
59
  private _validAtBlock: bigint | undefined
59
60
  private _withAttributes: boolean | undefined
@@ -82,6 +83,20 @@ export class QueryBuilder {
82
83
  return this
83
84
  }
84
85
 
86
+ /**
87
+ * Sets the createdBy filter
88
+ * @param createdBy - The address of the creator
89
+ * @returns The QueryBuilder instance
90
+ *
91
+ * @example
92
+ * const builder = new QueryBuilder(client)
93
+ * builder.createdBy("0x1234567890123456789012345678901234567890")
94
+ */
95
+ createdBy(createdBy: Hex) {
96
+ this._createdBy = createdBy
97
+ return this
98
+ }
99
+
85
100
  /**
86
101
  * Sets the orderBy for the query.
87
102
  * It can be called multiple times to order by multiple attributes.
@@ -271,6 +286,7 @@ export class QueryBuilder {
271
286
  limit: this._limit,
272
287
  cursor: this._cursor,
273
288
  ownedBy: this._ownedBy,
289
+ createdBy: this._createdBy,
274
290
  orderBy: this._orderBy,
275
291
  validAtBlock: this._validAtBlock,
276
292
  withAttributes: this._withAttributes,
@@ -303,6 +319,7 @@ export class QueryBuilder {
303
319
  limit: this._limit,
304
320
  cursor: this._cursor,
305
321
  ownedBy: this._ownedBy,
322
+ createdBy: this._createdBy,
306
323
  orderBy: undefined,
307
324
  validAtBlock: this._validAtBlock,
308
325
  withAttributes: false,
@@ -6,6 +6,7 @@ export class Entity {
6
6
  key: Hex
7
7
  contentType: MimeType | undefined
8
8
  owner: Hex | undefined
9
+ creator: Hex | undefined
9
10
  expiresAtBlock: bigint | undefined
10
11
  createdAtBlock: bigint | undefined
11
12
  lastModifiedAtBlock: bigint | undefined
@@ -18,6 +19,7 @@ export class Entity {
18
19
  key: Hex,
19
20
  contentType: MimeType | undefined = undefined,
20
21
  owner: Hex | undefined = undefined,
22
+ creator: Hex | undefined = undefined,
21
23
  expiresAtBlock: bigint | undefined = undefined,
22
24
  createdAtBlock: bigint | undefined = undefined,
23
25
  lastModifiedAtBlock: bigint | undefined = undefined,
@@ -28,6 +30,7 @@ export class Entity {
28
30
  ) {
29
31
  this.key = key
30
32
  this.owner = owner
33
+ this.creator = creator
31
34
  this.expiresAtBlock = expiresAtBlock
32
35
  this.createdAtBlock = createdAtBlock
33
36
  this.lastModifiedAtBlock = lastModifiedAtBlock
@@ -11,6 +11,7 @@ export type RpcEntity = {
11
11
  transactionIndexInBlock: Hex
12
12
  operationIndexInTransaction: Hex
13
13
  owner: Hex
14
+ creator: Hex
14
15
  stringAttributes?: [{ key: string; value: string }]
15
16
  numericAttributes?: [{ key: string; value: Hex }]
16
17
  }
@@ -36,6 +37,7 @@ export type RpcIncludeData = {
36
37
  contentType?: boolean
37
38
  expiration?: boolean
38
39
  owner?: boolean
40
+ creator?: boolean
39
41
  createdAtBlock?: boolean
40
42
  lastModifiedAtBlock?: boolean
41
43
  transactionIndexInBlock?: boolean
@@ -40,7 +40,7 @@ export function opsToTxData({
40
40
  const payload = [
41
41
  //creates
42
42
  (creates ?? []).map((item) => [
43
- toHex(item.expiresIn / BLOCK_TIME),
43
+ toHex(Math.ceil(item.expiresIn / BLOCK_TIME)),
44
44
  toHex(item.contentType),
45
45
  toHex(item.payload),
46
46
  item.attributes
@@ -54,7 +54,7 @@ export function opsToTxData({
54
54
  (updates ?? []).map((item) => [
55
55
  item.entityKey,
56
56
  toHex(item.contentType),
57
- toHex(item.expiresIn / BLOCK_TIME),
57
+ toHex(Math.ceil(item.expiresIn / BLOCK_TIME)),
58
58
  toHex(item.payload),
59
59
  item.attributes
60
60
  .filter((attribute) => typeof attribute.value === "string")
@@ -66,7 +66,10 @@ export function opsToTxData({
66
66
  //deletes
67
67
  (deletes ?? []).map((item) => item.entityKey),
68
68
  //extends
69
- (extensions ?? []).map((item) => [item.entityKey, toHex(item.expiresIn / BLOCK_TIME)]),
69
+ (extensions ?? []).map((item) => [
70
+ item.entityKey,
71
+ toHex(Math.ceil(item.expiresIn / BLOCK_TIME)),
72
+ ]),
70
73
  //ownershipChanges TODO
71
74
  (ownershipChanges ?? []).map((item) => [item.entityKey, item.newOwner]),
72
75
  ]
@@ -12,6 +12,7 @@ export async function entityFromRpcResult(rpcEntity: RpcEntity) {
12
12
  rpcEntity.key,
13
13
  rpcEntity.contentType,
14
14
  rpcEntity.owner,
15
+ rpcEntity.creator,
15
16
  rpcEntity.expiresAt !== undefined ? BigInt(rpcEntity.expiresAt) : undefined,
16
17
  rpcEntity.createdAtBlock !== undefined ? BigInt(rpcEntity.createdAtBlock) : undefined,
17
18
  rpcEntity.lastModifiedAtBlock !== undefined ? BigInt(rpcEntity.lastModifiedAtBlock) : undefined,
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-BOF-ysxw.d.ts","names":[],"sources":["../src/types/mimeTypes.ts","../src/types/rpcSchema.ts","../src/clients/baseClient.ts","../src/actions/public/getBlockTiming.ts","../src/actions/wallet/changeOwnership.ts","../src/actions/wallet/createEntity.ts","../src/actions/wallet/deleteEntity.ts","../src/actions/wallet/extendEntity.ts","../src/actions/wallet/updateEntity.ts","../src/actions/wallet/mutateEntities.ts","../src/types/attributes.ts","../src/types/events.ts","../src/types/txParams.ts","../src/types/entity.ts","../src/actions/public/query.ts"],"sourcesContent":[],"mappings":";;;KAAY,QAAA;;;KCGA,SAAA;EDHA,GAAA,ECIL,GDJK;eCKG;;aAEF;EAJD,cAAS,EAKH,GALG;EACd,mBAAA,EAKgB,GALhB;EACQ,uBAAA,EAKY,GALZ;EAEF,2BAAA,EAIkB,GAJlB;EACK,KAAA,EAIT,GAJS;EACK,gBAAA,CAAA,EAAA,CAAA;IACI,GAAA,EAAA,MAAA;IACI,KAAA,EAAA,MAAA;EACtB,CAAA,CAAA;EAEoC,iBAAA,CAAA,EAAA,CAAA;IAAG,GAAA,EAAA,MAAA;IAGpC,KAAA,EAHiC,GAGjC;EAMA,CAAA,CAAA;CACA;AACI,KARJ,mBAAA,GAQI;EACJ,IAAA,EAAA,MAAA;EACO,IAAA,EAAA,QAAA,GAAA,SAAA;EAAG,IAAA,EAAA,OAAA;AAItB,CAAA;AAaY,KArBA,eAAA,GAqBc;YApBd;gBACI;YACJ;ECvBA,cAAW,CAAA,EDwBJ,GCxBI;EACH,MAAA,CAAA,EAAA,MAAA;CAAY;AAChB,KD0BJ,cAAA,GC1BI;EAAoB,GAAA,CAAA,EAAA,OAAA;EACT,UAAA,CAAA,EAAA,OAAA;EAAsB,OAAA,CAAA,EAAA,OAAA;EAC7B,WAAA,CAAA,EAAA,OAAA;EAAwB,UAAA,CAAA,EAAA,OAAA;EACjC,KAAA,CAAA,EAAA,OAAA;EAAW,cAAA,CAAA,EAAA,OAAA;EAAO,mBAAA,CAAA,EAAA,OAAA;EAAkB,uBAAA,CAAA,EAAA,OAAA;EAA3C,2BAAA,CAAA,EAAA,OAAA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R,KaQA,mBAAA,GbRS;EACd,IAAA,EAAA,MAAA;EACQ,IAAA,EAAA,QAAA,GAAA,SAAA;EAEF,IAAA,EAAA,KAAA,GAAA,MAAA;CACK;AACK,KaQX,YAAA,GbRW;EACI,WAAA,CAAA,EaQX,uBbRW;EACI,OAAA,CAAA,EAAA,MAAA;EACtB,OAAA,CAAA,EaQG,mBbRH,EAAA;EAEoC,cAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAG,MAAA,CAAA,EAAA,MAAA,GAAA,SAAA;AAGhD,CAAA;AAMY,KaEA,eAAA,GbFe;EACf,QAAA,EaEA,MbFA,EAAA;EACI,MAAA,EAAA,MAAA,GAAA,SAAA;EACJ,WAAA,EAAA,MAAA,GAAA,SAAA;CACO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-fCVivD9L.d.cts","names":[],"sources":["../src/types/mimeTypes.ts","../src/types/rpcSchema.ts","../src/clients/baseClient.ts","../src/actions/public/getBlockTiming.ts","../src/actions/wallet/changeOwnership.ts","../src/actions/wallet/createEntity.ts","../src/actions/wallet/deleteEntity.ts","../src/actions/wallet/extendEntity.ts","../src/actions/wallet/updateEntity.ts","../src/actions/wallet/mutateEntities.ts","../src/types/attributes.ts","../src/types/events.ts","../src/types/txParams.ts","../src/types/entity.ts","../src/actions/public/query.ts"],"sourcesContent":[],"mappings":";;;KAAY,QAAA;;;KCGA,SAAA;EDHA,GAAA,ECIL,GDJK;eCKG;;aAEF;EAJD,cAAS,EAKH,GALG;EACd,mBAAA,EAKgB,GALhB;EACQ,uBAAA,EAKY,GALZ;EAEF,2BAAA,EAIkB,GAJlB;EACK,KAAA,EAIT,GAJS;EACK,gBAAA,CAAA,EAAA,CAAA;IACI,GAAA,EAAA,MAAA;IACI,KAAA,EAAA,MAAA;EACtB,CAAA,CAAA;EAEoC,iBAAA,CAAA,EAAA,CAAA;IAAG,GAAA,EAAA,MAAA;IAGpC,KAAA,EAHiC,GAGjC;EAMA,CAAA,CAAA;CACA;AACI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