@arkiv-network/sdk 0.6.8 → 0.7.0-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/README.md +52 -16
- package/dist/consts-Bz0LZQZY.js +7 -0
- package/dist/consts-Bz0LZQZY.js.map +1 -0
- package/dist/consts-CxT1-RXU.cjs +18 -0
- package/dist/entity-BhSXaB23.cjs +81 -0
- package/dist/{query-CO6f35AE.d.cts → entity-CN41IOrq.d.cts} +125 -59
- package/dist/entity-CN41IOrq.d.cts.map +1 -0
- package/dist/entity-DGfVyB-a.js +71 -0
- package/dist/entity-DGfVyB-a.js.map +1 -0
- package/dist/{query-BhdmAzYg.d.ts → entity-NnEVlePN.d.ts} +125 -59
- package/dist/entity-NnEVlePN.d.ts.map +1 -0
- package/dist/index-ClkpS6s_.d.ts +481 -0
- package/dist/index-ClkpS6s_.d.ts.map +1 -0
- package/dist/index-w4qop0Pe.d.cts +481 -0
- package/dist/index-w4qop0Pe.d.cts.map +1 -0
- package/dist/index.cjs +285 -233
- package/dist/index.d.cts +100 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +101 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +280 -230
- package/dist/index.js.map +1 -1
- package/dist/payload-BpNUPOnY.js +13 -0
- package/dist/payload-BpNUPOnY.js.map +1 -0
- package/dist/{payload-Da9gJMG5.d.ts → payload-C2KHOUoj.d.ts} +1 -1
- package/dist/{payload-Da9gJMG5.d.ts.map → payload-C2KHOUoj.d.ts.map} +1 -1
- package/dist/{payload-vwU3Rc6P.cjs → payload-D8YLKcJj.cjs} +1 -18
- package/dist/query/index.cjs +11 -28
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +8 -28
- package/dist/query/index.js.map +1 -1
- package/dist/{queryBuilder-DonAg1aq.js → queryBuilder-BE_XhLLa.js} +303 -152
- package/dist/queryBuilder-BE_XhLLa.js.map +1 -0
- package/dist/{queryBuilder-DM-YO1Y7.cjs → queryBuilder-J37buGCi.cjs} +372 -149
- package/dist/types/index.cjs +4 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +4 -1
- package/dist/utils/index.cjs +4 -10
- package/dist/utils/index.d.cts +0 -1
- package/dist/utils/index.d.cts.map +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +11 -15
- package/src/actions/public/buildQuery.ts +4 -0
- package/src/actions/public/query.ts +10 -0
- package/src/actions/public/subscribeEntityEvents.ts +25 -51
- package/src/actions/wallet/changeOwnership.ts +6 -6
- package/src/actions/wallet/createEntity.ts +19 -6
- package/src/actions/wallet/deleteEntity.ts +2 -3
- package/src/actions/wallet/extendEntity.ts +9 -5
- package/src/actions/wallet/mutateEntities.ts +11 -54
- package/src/actions/wallet/updateEntity.ts +15 -6
- package/src/clients/createPublicClient.test.ts +2 -0
- package/src/clients/decorators/arkivPublic.ts +67 -2
- package/src/clients/decorators/arkivWallet.ts +23 -1
- package/src/consts.ts +2 -1
- package/src/errors.ts +46 -0
- package/src/index.ts +0 -3
- package/src/query/engine.test.ts +45 -0
- package/src/query/engine.ts +28 -14
- package/src/query/index.ts +1 -0
- package/src/query/predicate.test.ts +43 -0
- package/src/query/predicate.ts +14 -10
- package/src/query/queryBuilder.test.ts +22 -0
- package/src/query/queryBuilder.ts +221 -106
- package/src/query/queryResult.ts +13 -7
- package/src/query/selectQueryBuilder.test.ts +213 -0
- package/src/query/selection.test.ts +120 -0
- package/src/query/selection.ts +116 -0
- package/src/types/attributes.ts +25 -1
- package/src/types/entity.ts +12 -2
- package/src/types/events.ts +14 -16
- package/src/types/index.ts +1 -0
- package/src/types/rpcSchema.ts +7 -2
- package/src/utils/arkivTransactions.test.ts +260 -0
- package/src/utils/arkivTransactions.ts +255 -92
- package/src/utils/entities.ts +17 -7
- package/src/utils/index.ts +0 -1
- package/src/utils/payload.ts +4 -2
- package/src/utils/validation.test.ts +106 -0
- package/src/utils/validation.ts +80 -0
- package/dist/accounts/index.cjs +0 -9
- package/dist/accounts/index.d.cts +0 -1
- package/dist/accounts/index.d.ts +0 -1
- package/dist/accounts/index.js +0 -1
- package/dist/payload-DKBYYjeA.js +0 -18
- package/dist/payload-DKBYYjeA.js.map +0 -1
- package/dist/query-BhdmAzYg.d.ts.map +0 -1
- package/dist/query-CO6f35AE.d.cts.map +0 -1
- package/dist/queryBuilder-BvoQXa_u.d.ts +0 -328
- package/dist/queryBuilder-BvoQXa_u.d.ts.map +0 -1
- package/dist/queryBuilder-DonAg1aq.js.map +0 -1
- package/dist/queryBuilder-zTsKXctT.d.cts +0 -328
- package/dist/queryBuilder-zTsKXctT.d.cts.map +0 -1
- package/src/accounts/index.ts +0 -1
- /package/dist/{types-H-TSmRpm.js → types-Ci4BRClw.js} +0 -0
- /package/dist/{types-o3zWarRp.cjs → types-a8gm_IaQ.cjs} +0 -0
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { ArkivRpcSchema, Attribute, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OnEntityCreatedEvent, OnEntityDeletedEvent, OnEntityExpiredEvent, OnEntityExpiresInExtendedEvent, OnEntityOwnerChangedEvent, OnEntityUpdatedEvent, QueryOptions, QueryOptionsIncludeData, QueryOptionsOrderBy, QueryReturnType, RpcEntity, RpcIncludeData, RpcOrderByAttribute, RpcQueryOptions, TxParams, UpdateEntityParameters, UpdateEntityReturnType };
|
|
1
|
+
import { A as RpcEntity, C as QueryOptions, D as GetBlockTimingReturnType, E as QueryReturnType, M as RpcOrderByAttribute, N as RpcQueryOptions, P as MimeType, S as ChangeOwnershipReturnType, T as QueryOptionsOrderBy, _ as DeleteEntityParameters, a as OnEntityDeletedEvent, b as CreateEntityReturnType, c as OnEntityOwnerChangedEvent, d as MutateEntitiesParameters, f as MutateEntitiesReturnType, g as ExtendEntityReturnType, h as ExtendEntityParameters, i as OnEntityCreatedEvent, j as RpcIncludeData, k as ArkivRpcSchema, l as OnEntityUpdatedEvent, m as UpdateEntityReturnType, n as EntityOperationType, o as OnEntityExpiredEvent, p as UpdateEntityParameters, r as TxParams, s as OnEntityExpiresInExtendedEvent, t as Entity, u as Attribute, v as DeleteEntityReturnType, w as QueryOptionsIncludeData, x as ChangeOwnershipParameters, y as CreateEntityParameters } from "../entity-CN41IOrq.cjs";
|
|
2
|
+
export { ArkivRpcSchema, Attribute, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, EntityOperationType, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OnEntityCreatedEvent, OnEntityDeletedEvent, OnEntityExpiredEvent, OnEntityExpiresInExtendedEvent, OnEntityOwnerChangedEvent, OnEntityUpdatedEvent, QueryOptions, QueryOptionsIncludeData, QueryOptionsOrderBy, QueryReturnType, RpcEntity, RpcIncludeData, RpcOrderByAttribute, RpcQueryOptions, TxParams, UpdateEntityParameters, UpdateEntityReturnType };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { ArkivRpcSchema, Attribute, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OnEntityCreatedEvent, OnEntityDeletedEvent, OnEntityExpiredEvent, OnEntityExpiresInExtendedEvent, OnEntityOwnerChangedEvent, OnEntityUpdatedEvent, QueryOptions, QueryOptionsIncludeData, QueryOptionsOrderBy, QueryReturnType, RpcEntity, RpcIncludeData, RpcOrderByAttribute, RpcQueryOptions, TxParams, UpdateEntityParameters, UpdateEntityReturnType };
|
|
1
|
+
import { A as RpcEntity, C as QueryOptions, D as GetBlockTimingReturnType, E as QueryReturnType, M as RpcOrderByAttribute, N as RpcQueryOptions, P as MimeType, S as ChangeOwnershipReturnType, T as QueryOptionsOrderBy, _ as DeleteEntityParameters, a as OnEntityDeletedEvent, b as CreateEntityReturnType, c as OnEntityOwnerChangedEvent, d as MutateEntitiesParameters, f as MutateEntitiesReturnType, g as ExtendEntityReturnType, h as ExtendEntityParameters, i as OnEntityCreatedEvent, j as RpcIncludeData, k as ArkivRpcSchema, l as OnEntityUpdatedEvent, m as UpdateEntityReturnType, n as EntityOperationType, o as OnEntityExpiredEvent, p as UpdateEntityParameters, r as TxParams, s as OnEntityExpiresInExtendedEvent, t as Entity, u as Attribute, v as DeleteEntityReturnType, w as QueryOptionsIncludeData, x as ChangeOwnershipParameters, y as CreateEntityParameters } from "../entity-NnEVlePN.js";
|
|
2
|
+
export { ArkivRpcSchema, Attribute, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, EntityOperationType, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OnEntityCreatedEvent, OnEntityDeletedEvent, OnEntityExpiredEvent, OnEntityExpiresInExtendedEvent, OnEntityOwnerChangedEvent, OnEntityUpdatedEvent, QueryOptions, QueryOptionsIncludeData, QueryOptionsOrderBy, QueryReturnType, RpcEntity, RpcIncludeData, RpcOrderByAttribute, RpcQueryOptions, TxParams, UpdateEntityParameters, UpdateEntityReturnType };
|
package/dist/types/index.js
CHANGED
package/dist/utils/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_consts = require('../consts-CxT1-RXU.cjs');
|
|
2
|
+
const require_payload = require('../payload-D8YLKcJj.cjs');
|
|
2
3
|
|
|
3
4
|
//#region src/utils/expirationTime.ts
|
|
4
5
|
const ExpirationTime = {
|
|
@@ -9,18 +10,11 @@ const ExpirationTime = {
|
|
|
9
10
|
fromWeeks: (weeks) => weeks * 7 * 24 * 60 * 60,
|
|
10
11
|
fromMonths: (months) => months * 30 * 24 * 60 * 60,
|
|
11
12
|
fromYears: (years) => years * 365 * 24 * 60 * 60,
|
|
12
|
-
fromBlocks: (blocks) => blocks *
|
|
13
|
+
fromBlocks: (blocks) => blocks * require_consts.BLOCK_TIME,
|
|
13
14
|
fromDate: (date) => Math.floor(date.getTime() / 1e3) - Math.floor(Date.now() / 1e3)
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
//#endregion
|
|
17
18
|
exports.ExpirationTime = ExpirationTime;
|
|
18
19
|
exports.jsonToPayload = require_payload.jsonToPayload;
|
|
19
|
-
exports.stringToPayload = require_payload.stringToPayload;
|
|
20
|
-
var viem_utils = require("viem/utils");
|
|
21
|
-
Object.keys(viem_utils).forEach(function (k) {
|
|
22
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function () { return viem_utils[k]; }
|
|
25
|
-
});
|
|
26
|
-
});
|
|
20
|
+
exports.stringToPayload = require_payload.stringToPayload;
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/utils/expirationTime.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/utils/expirationTime.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;EAAA,SAAA,EAAA,CAAA,KAUZ,EAAA,MAAA,EAAA,GADkB,MAAI;;;;;;mBAAJ"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as stringToPayload, t as jsonToPayload } from "../payload-
|
|
2
|
-
export * from "viem/utils";
|
|
1
|
+
import { n as stringToPayload, t as jsonToPayload } from "../payload-C2KHOUoj.js";
|
|
3
2
|
|
|
4
3
|
//#region src/utils/expirationTime.d.ts
|
|
5
4
|
declare const ExpirationTime: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/utils/expirationTime.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/utils/expirationTime.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;EAAA,SAAA,EAAA,CAAA,KAUZ,EAAA,MAAA,EAAA,GADkB,MAAI;;;;;;mBAAJ"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export * from "viem/utils"
|
|
1
|
+
import { n as BLOCK_TIME } from "../consts-Bz0LZQZY.js";
|
|
2
|
+
import { n as stringToPayload, t as jsonToPayload } from "../payload-BpNUPOnY.js";
|
|
4
3
|
|
|
5
4
|
//#region src/utils/expirationTime.ts
|
|
6
5
|
const ExpirationTime = {
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/utils/expirationTime.ts"],"sourcesContent":["import { BLOCK_TIME } from \"../consts\"\n\nexport const ExpirationTime = {\n fromSeconds: (seconds: number) => seconds,\n fromMinutes: (minutes: number) => minutes * 60,\n fromHours: (hours: number) => hours * 60 * 60,\n fromDays: (days: number) => days * 24 * 60 * 60,\n fromWeeks: (weeks: number) => weeks * 7 * 24 * 60 * 60,\n fromMonths: (months: number) => months * 30 * 24 * 60 * 60,\n fromYears: (years: number) => years * 365 * 24 * 60 * 60,\n fromBlocks: (blocks: number) => blocks * BLOCK_TIME,\n fromDate: (date: Date) => Math.floor(date.getTime() / 1000) - Math.floor(Date.now() / 1000),\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/utils/expirationTime.ts"],"sourcesContent":["import { BLOCK_TIME } from \"../consts\"\n\nexport const ExpirationTime = {\n fromSeconds: (seconds: number) => seconds,\n fromMinutes: (minutes: number) => minutes * 60,\n fromHours: (hours: number) => hours * 60 * 60,\n fromDays: (days: number) => days * 24 * 60 * 60,\n fromWeeks: (weeks: number) => weeks * 7 * 24 * 60 * 60,\n fromMonths: (months: number) => months * 30 * 24 * 60 * 60,\n fromYears: (years: number) => years * 365 * 24 * 60 * 60,\n fromBlocks: (blocks: number) => blocks * BLOCK_TIME,\n fromDate: (date: Date) => Math.floor(date.getTime() / 1000) - Math.floor(Date.now() / 1000),\n}\n"],"mappings":";;;;AAEA,MAAa,iBAAiB;CAC5B,cAAc,YAAoB;CAClC,cAAc,YAAoB,UAAU;CAC5C,YAAY,UAAkB,QAAQ,KAAK;CAC3C,WAAW,SAAiB,OAAO,KAAK,KAAK;CAC7C,YAAY,UAAkB,QAAQ,IAAI,KAAK,KAAK;CACpD,aAAa,WAAmB,SAAS,KAAK,KAAK,KAAK;CACxD,YAAY,UAAkB,QAAQ,MAAM,KAAK,KAAK;CACtD,aAAa,WAAmB,SAAS;CACzC,WAAW,SAAe,KAAK,MAAM,KAAK,SAAS,GAAG,IAAK,GAAG,KAAK,MAAM,KAAK,KAAK,GAAG,IAAK;CAC5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkiv-network/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-dev.1",
|
|
4
4
|
"description": "TypeScript client library for Arkiv's blockchains interactions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"target": "esnext",
|
|
@@ -15,12 +15,6 @@
|
|
|
15
15
|
"require": "./dist/index.cjs",
|
|
16
16
|
"default": "./dist/index.js"
|
|
17
17
|
},
|
|
18
|
-
"./accounts": {
|
|
19
|
-
"bun": "./src/accounts/index.ts",
|
|
20
|
-
"import": "./dist/accounts/index.js",
|
|
21
|
-
"require": "./dist/accounts/index.cjs",
|
|
22
|
-
"default": "./dist/accounts/index.js"
|
|
23
|
-
},
|
|
24
18
|
"./chains": {
|
|
25
19
|
"bun": "./src/chains/index.ts",
|
|
26
20
|
"import": "./dist/chains/index.js",
|
|
@@ -52,9 +46,6 @@
|
|
|
52
46
|
"chains": [
|
|
53
47
|
"./dist/_types/chains/index.d.ts"
|
|
54
48
|
],
|
|
55
|
-
"accounts": [
|
|
56
|
-
"./dist/_types/accounts/index.d.ts"
|
|
57
|
-
],
|
|
58
49
|
"utils": [
|
|
59
50
|
"./dist/_types/utils/index.d.ts"
|
|
60
51
|
],
|
|
@@ -90,13 +81,20 @@
|
|
|
90
81
|
"@types/bun": "latest",
|
|
91
82
|
"rimraf": "^6.0.1",
|
|
92
83
|
"tsdown": "^0.16.0",
|
|
93
|
-
"typedoc": "^0.28.14"
|
|
84
|
+
"typedoc": "^0.28.14",
|
|
85
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
86
|
+
"typescript": "^5.9.2",
|
|
87
|
+
"viem": "^2.38.2"
|
|
94
88
|
},
|
|
95
89
|
"peerDependencies": {
|
|
96
|
-
"typescript": "
|
|
90
|
+
"typescript": ">=5.0.0",
|
|
91
|
+
"viem": "^2.0.0"
|
|
97
92
|
},
|
|
98
93
|
"peerDependenciesMeta": {
|
|
99
94
|
"typescript": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"viem": {
|
|
100
98
|
"optional": false
|
|
101
99
|
}
|
|
102
100
|
},
|
|
@@ -118,8 +116,6 @@
|
|
|
118
116
|
},
|
|
119
117
|
"homepage": "https://arkiv.network",
|
|
120
118
|
"dependencies": {
|
|
121
|
-
"brotli-wasm": "^3.0.1"
|
|
122
|
-
"typedoc-plugin-markdown": "^4.9.0",
|
|
123
|
-
"viem": "^2.38.2"
|
|
119
|
+
"brotli-wasm": "^3.0.1"
|
|
124
120
|
}
|
|
125
121
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
2
2
|
import { QueryBuilder } from "../../query/queryBuilder"
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `client.select()` (see SelectQueryBuilder) instead. `buildQuery()` returns
|
|
6
|
+
* only the entity `key` unless data is explicitly opted in to, which is an easy mistake.
|
|
7
|
+
*/
|
|
4
8
|
export async function buildQuery(client: ArkivClient) {
|
|
5
9
|
return new QueryBuilder(client)
|
|
6
10
|
}
|
|
@@ -9,6 +9,11 @@ export type QueryOptionsIncludeData = {
|
|
|
9
9
|
payload?: boolean
|
|
10
10
|
metadata?: boolean
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Server-side ordering is not supported by the network. Sort the fetched
|
|
14
|
+
* entities in JavaScript instead (e.g. `entities.sort(...)`). This type will be removed
|
|
15
|
+
* in a future release.
|
|
16
|
+
*/
|
|
12
17
|
export type QueryOptionsOrderBy = {
|
|
13
18
|
name: string
|
|
14
19
|
type: "string" | "numeric"
|
|
@@ -18,6 +23,11 @@ export type QueryOptionsOrderBy = {
|
|
|
18
23
|
export type QueryOptions = {
|
|
19
24
|
includeData?: QueryOptionsIncludeData
|
|
20
25
|
atBlock?: bigint
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Server-side ordering is not supported by the network, so this option has no
|
|
28
|
+
* effect on the returned order. Sort the fetched entities in JavaScript instead
|
|
29
|
+
* (e.g. `entities.sort(...)`). This option will be removed in a future release.
|
|
30
|
+
*/
|
|
21
31
|
orderBy?: QueryOptionsOrderBy[]
|
|
22
32
|
resultsPerPage?: number | undefined
|
|
23
33
|
cursor?: string | undefined
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { decodeEventLog, type Hex
|
|
1
|
+
import { decodeEventLog, type Hex } from "viem"
|
|
2
2
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
3
3
|
import type { PublicArkivClient } from "../../clients/createPublicClient"
|
|
4
|
+
import { EntityOperationType } from "../../types/entity"
|
|
4
5
|
import type {
|
|
5
6
|
OnEntityCreatedEvent,
|
|
6
7
|
OnEntityDeletedEvent,
|
|
@@ -9,18 +10,12 @@ import type {
|
|
|
9
10
|
OnEntityOwnerChangedEvent,
|
|
10
11
|
OnEntityUpdatedEvent,
|
|
11
12
|
} from "../../types/events"
|
|
13
|
+
import { ENTITY_OPERATION_EVENT_ABI } from "../../utils/arkivTransactions"
|
|
12
14
|
import { getLogger } from "../../utils/logger"
|
|
13
15
|
|
|
14
16
|
const logger = getLogger("actions:public:subscribe-entity-events")
|
|
15
17
|
|
|
16
|
-
export const arkivABI =
|
|
17
|
-
"event ArkivEntityCreated(uint256 indexed entityKey, address indexed ownerAddress, uint256 expirationBlock, uint256 cost)",
|
|
18
|
-
"event ArkivEntityUpdated(uint256 indexed entityKey, address indexed ownerAddress, uint256 oldExpirationBlock, uint256 newExpirationBlock, uint256 cost)",
|
|
19
|
-
"event ArkivEntityExpired(uint256 indexed entityKey, address indexed ownerAddress)",
|
|
20
|
-
"event ArkivEntityDeleted(uint256 indexed entityKey, address indexed ownerAddress)",
|
|
21
|
-
"event ArkivEntityBTLExtended(uint256 indexed entityKey, address indexed ownerAddress, uint256 oldExpirationBlock, uint256 newExpirationBlock, uint256 cost)",
|
|
22
|
-
"event ArkivEntityOwnerChanged(uint256 indexed entityKey, address indexed oldOwnerAddress, address indexed newOwnerAddress)",
|
|
23
|
-
])
|
|
18
|
+
export const arkivABI = ENTITY_OPERATION_EVENT_ABI
|
|
24
19
|
|
|
25
20
|
export async function subscribeEntityEvents(
|
|
26
21
|
client: ArkivClient,
|
|
@@ -57,54 +52,33 @@ export async function subscribeEntityEvents(
|
|
|
57
52
|
data: log.data,
|
|
58
53
|
})
|
|
59
54
|
logger("event from subscribeEntityEvents %o", event)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
owner: event.args.ownerAddress,
|
|
73
|
-
oldExpirationBlock: Number(event.args.oldExpirationBlock),
|
|
74
|
-
newExpirationBlock: Number(event.args.newExpirationBlock),
|
|
75
|
-
cost: event.args.cost,
|
|
76
|
-
})
|
|
55
|
+
|
|
56
|
+
if (event.eventName !== "EntityOperation") continue
|
|
57
|
+
|
|
58
|
+
const entityKey = event.args.entityKey as Hex
|
|
59
|
+
const owner = event.args.owner
|
|
60
|
+
const expiresAt = event.args.expiresAt
|
|
61
|
+
const entityHash = event.args.entityHash as Hex
|
|
62
|
+
const opType = Number(event.args.operationType)
|
|
63
|
+
|
|
64
|
+
switch (opType) {
|
|
65
|
+
case EntityOperationType.Create:
|
|
66
|
+
onEntityCreated?.({ entityKey, owner, expiresAt, entityHash })
|
|
77
67
|
break
|
|
78
|
-
case
|
|
79
|
-
|
|
80
|
-
entityKey: toHex(event.args.entityKey, { size: 32 }),
|
|
81
|
-
owner: event.args.ownerAddress,
|
|
82
|
-
})
|
|
68
|
+
case EntityOperationType.Update:
|
|
69
|
+
onEntityUpdated?.({ entityKey, owner, expiresAt, entityHash })
|
|
83
70
|
break
|
|
84
|
-
case
|
|
85
|
-
onEntityExpiresInExtended?.({
|
|
86
|
-
entityKey: toHex(event.args.entityKey, { size: 32 }),
|
|
87
|
-
owner: event.args.ownerAddress,
|
|
88
|
-
oldExpirationBlock: Number(event.args.oldExpirationBlock),
|
|
89
|
-
newExpirationBlock: Number(event.args.newExpirationBlock),
|
|
90
|
-
cost: event.args.cost,
|
|
91
|
-
})
|
|
71
|
+
case EntityOperationType.Extend:
|
|
72
|
+
onEntityExpiresInExtended?.({ entityKey, owner, expiresAt, entityHash })
|
|
92
73
|
break
|
|
93
|
-
case
|
|
94
|
-
|
|
95
|
-
entityKey: toHex(event.args.entityKey, { size: 32 }),
|
|
96
|
-
owner: event.args.ownerAddress,
|
|
97
|
-
})
|
|
74
|
+
case EntityOperationType.Transfer:
|
|
75
|
+
onEntityOwnerChanged?.({ entityKey, owner, entityHash })
|
|
98
76
|
break
|
|
99
|
-
case
|
|
100
|
-
|
|
101
|
-
entityKey: toHex(event.args.entityKey, { size: 32 }),
|
|
102
|
-
oldOwner: event.args.oldOwnerAddress,
|
|
103
|
-
newOwner: event.args.newOwnerAddress,
|
|
104
|
-
})
|
|
77
|
+
case EntityOperationType.Delete:
|
|
78
|
+
onEntityDeleted?.({ entityKey, owner })
|
|
105
79
|
break
|
|
106
80
|
default:
|
|
107
|
-
|
|
81
|
+
onEntityExpired?.({ entityKey, owner })
|
|
108
82
|
break
|
|
109
83
|
}
|
|
110
84
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { Hex } from "viem"
|
|
2
2
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
3
3
|
import type { TxParams } from "../../types"
|
|
4
|
-
import {
|
|
4
|
+
import { sendArkivTransaction } from "../../utils/arkivTransactions"
|
|
5
5
|
import { getLogger } from "../../utils/logger"
|
|
6
6
|
|
|
7
7
|
const logger = getLogger("actions:wallet:change-ownership")
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Parameters for the
|
|
11
|
-
* - entityKey: The key of the entity
|
|
10
|
+
* Parameters for the changeOwnership function.
|
|
11
|
+
* - entityKey: The key of the entity.
|
|
12
|
+
* - newOwner: The address of the new owner.
|
|
12
13
|
*/
|
|
13
14
|
export type ChangeOwnershipParameters = {
|
|
14
15
|
entityKey: Hex
|
|
@@ -16,7 +17,7 @@ export type ChangeOwnershipParameters = {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
|
-
* Return type for the
|
|
20
|
+
* Return type for the changeOwnership function.
|
|
20
21
|
* - entityKey: The key of the entity.
|
|
21
22
|
* - txHash: The transaction hash.
|
|
22
23
|
*/
|
|
@@ -31,8 +32,7 @@ export async function changeOwnership(
|
|
|
31
32
|
txParams?: TxParams,
|
|
32
33
|
): Promise<ChangeOwnershipReturnType> {
|
|
33
34
|
logger("changeOwnership %o", data)
|
|
34
|
-
const
|
|
35
|
-
const receipt = await sendArkivTransaction(client, txData, txParams)
|
|
35
|
+
const { receipt } = await sendArkivTransaction(client, { ownershipChanges: [data] }, txParams)
|
|
36
36
|
|
|
37
37
|
logger("Receipt from changeOwnership %o", receipt)
|
|
38
38
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash, Hex } from "viem"
|
|
2
2
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
3
3
|
import type { Attribute, MimeType, TxParams } from "../../types"
|
|
4
|
-
import {
|
|
4
|
+
import { sendArkivTransaction } from "../../utils/arkivTransactions"
|
|
5
5
|
import { getLogger } from "../../utils/logger"
|
|
6
6
|
|
|
7
7
|
const logger = getLogger("actions:wallet:create-entity")
|
|
@@ -9,14 +9,24 @@ const logger = getLogger("actions:wallet:create-entity")
|
|
|
9
9
|
/**
|
|
10
10
|
* Parameters for the createEntity function.
|
|
11
11
|
* - payload: The payload of the entity.
|
|
12
|
-
* - attributes: The attributes of the entity.
|
|
12
|
+
* - attributes: The attributes of the entity. Attribute values may be strings
|
|
13
|
+
* or numbers, but numeric values **must be integers**. To store a non-integer,
|
|
14
|
+
* scale it to an integer (e.g. `1.5` -> `1500`) to preserve numeric ordering,
|
|
15
|
+
* or pass it as a string (e.g. `"1.5"`). A non-integer numeric value throws an
|
|
16
|
+
* {@link InvalidAttributeError}.
|
|
13
17
|
* - contentType: The content type of the entity.
|
|
14
|
-
* - expiresIn:
|
|
18
|
+
* - expiresIn: How long until the entity expires, in seconds. Because Arkiv
|
|
19
|
+
* measures expiration in blocks (1 block = 2 seconds), this **must be a
|
|
20
|
+
* positive integer and a multiple of the block time (2 seconds)**
|
|
21
|
+
* Invalid values throw an {@link InvalidExpirationError}.
|
|
15
22
|
*/
|
|
16
23
|
export type CreateEntityParameters = {
|
|
17
24
|
payload: Uint8Array
|
|
25
|
+
/** Entity attributes. Numeric values must be integers (scale non-integers, e.g. `1.5` -> `1500`, or use a string). Throws {@link InvalidAttributeError} otherwise. */
|
|
18
26
|
attributes: Attribute[]
|
|
19
27
|
contentType: MimeType | string
|
|
28
|
+
/** Seconds until expiry. Must be a positive integer and a multiple of the 2s block time.
|
|
29
|
+
* Throws {@link InvalidExpirationError} otherwise. */
|
|
20
30
|
expiresIn: number
|
|
21
31
|
}
|
|
22
32
|
|
|
@@ -36,13 +46,16 @@ export async function createEntity(
|
|
|
36
46
|
txParams?: TxParams,
|
|
37
47
|
): Promise<CreateEntityReturnType> {
|
|
38
48
|
logger("createEntity %o", data)
|
|
39
|
-
const
|
|
40
|
-
|
|
49
|
+
const { receipt, createdEntityKeys } = await sendArkivTransaction(
|
|
50
|
+
client,
|
|
51
|
+
{ creates: [data] },
|
|
52
|
+
txParams,
|
|
53
|
+
)
|
|
41
54
|
|
|
42
55
|
logger("Receipt from createEntity %o", receipt)
|
|
43
56
|
|
|
44
57
|
return {
|
|
45
58
|
txHash: receipt.transactionHash as Hash,
|
|
46
|
-
entityKey:
|
|
59
|
+
entityKey: createdEntityKeys[0],
|
|
47
60
|
}
|
|
48
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash, Hex } from "viem"
|
|
2
2
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
3
3
|
import type { TxParams } from "../../types"
|
|
4
|
-
import {
|
|
4
|
+
import { sendArkivTransaction } from "../../utils/arkivTransactions"
|
|
5
5
|
import { getLogger } from "../../utils/logger"
|
|
6
6
|
|
|
7
7
|
const logger = getLogger("actions:wallet:delete-entity")
|
|
@@ -30,8 +30,7 @@ export async function deleteEntity(
|
|
|
30
30
|
txParams?: TxParams,
|
|
31
31
|
): Promise<DeleteEntityReturnType> {
|
|
32
32
|
logger("deleteEntity %o", data)
|
|
33
|
-
const
|
|
34
|
-
const receipt = await sendArkivTransaction(client, txData, txParams)
|
|
33
|
+
const { receipt } = await sendArkivTransaction(client, { deletes: [data] }, txParams)
|
|
35
34
|
|
|
36
35
|
logger("Receipt from deleteEntity %o", receipt)
|
|
37
36
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash, Hex } from "viem"
|
|
2
2
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
3
3
|
import type { TxParams } from "../../types"
|
|
4
|
-
import {
|
|
4
|
+
import { sendArkivTransaction } from "../../utils/arkivTransactions"
|
|
5
5
|
import { getLogger } from "../../utils/logger"
|
|
6
6
|
|
|
7
7
|
const logger = getLogger("actions:wallet:extend-entity")
|
|
@@ -9,10 +9,15 @@ const logger = getLogger("actions:wallet:extend-entity")
|
|
|
9
9
|
/**
|
|
10
10
|
* Parameters for the extendEntity function.
|
|
11
11
|
* - entityKey: The key of the entity to extend.
|
|
12
|
-
* - expiresIn:
|
|
12
|
+
* - expiresIn: How long to extend the entity by, in seconds. Because Arkiv
|
|
13
|
+
* measures expiration in blocks (1 block = 2 seconds), this **must be a
|
|
14
|
+
* positive integer and a multiple of the block time (2 seconds)**.
|
|
15
|
+
* Invalid values throw an {@link InvalidExpirationError}.
|
|
13
16
|
*/
|
|
14
17
|
export type ExtendEntityParameters = {
|
|
15
18
|
entityKey: Hex
|
|
19
|
+
/** Seconds to extend by. Must be a positive integer and a multiple of the 2s block time.
|
|
20
|
+
* Throws {@link InvalidExpirationError} otherwise. */
|
|
16
21
|
expiresIn: number
|
|
17
22
|
}
|
|
18
23
|
|
|
@@ -32,13 +37,12 @@ export async function extendEntity(
|
|
|
32
37
|
txParams?: TxParams,
|
|
33
38
|
): Promise<ExtendEntityReturnType> {
|
|
34
39
|
logger("extendEntity %o", data)
|
|
35
|
-
const
|
|
36
|
-
const receipt = await sendArkivTransaction(client, txData, txParams)
|
|
40
|
+
const { receipt } = await sendArkivTransaction(client, { extensions: [data] }, txParams)
|
|
37
41
|
|
|
38
42
|
logger("Receipt from extendEntity %o", receipt)
|
|
39
43
|
|
|
40
44
|
return {
|
|
41
45
|
txHash: receipt.transactionHash as Hash,
|
|
42
|
-
entityKey:
|
|
46
|
+
entityKey: data.entityKey,
|
|
43
47
|
}
|
|
44
48
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { Hash, Hex
|
|
1
|
+
import type { Hash, Hex } from "viem"
|
|
2
2
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
3
3
|
import type { TxParams } from "../../types"
|
|
4
|
-
import {
|
|
4
|
+
import { sendArkivTransaction } from "../../utils/arkivTransactions"
|
|
5
5
|
import { getLogger } from "../../utils/logger"
|
|
6
6
|
import type { ChangeOwnershipParameters } from "./changeOwnership"
|
|
7
|
-
|
|
8
|
-
const logger = getLogger("actions:wallet:mutate-entities")
|
|
9
|
-
|
|
10
7
|
import type { CreateEntityParameters } from "./createEntity"
|
|
11
8
|
import type { DeleteEntityParameters } from "./deleteEntity"
|
|
12
9
|
import type { ExtendEntityParameters } from "./extendEntity"
|
|
13
10
|
import type { UpdateEntityParameters } from "./updateEntity"
|
|
14
11
|
|
|
12
|
+
const logger = getLogger("actions:wallet:mutate-entities")
|
|
13
|
+
|
|
15
14
|
/**
|
|
16
15
|
* Parameters for the mutateEntities function.
|
|
17
16
|
* - creates: The creates to perform.
|
|
@@ -27,39 +26,6 @@ export type MutateEntitiesParameters = {
|
|
|
27
26
|
ownershipChanges?: ChangeOwnershipParameters[]
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
function parseReceipt(receipt: TransactionReceipt, params: MutateEntitiesParameters) {
|
|
31
|
-
const createdEntities: Hex[] = []
|
|
32
|
-
const updatedEntities: Hex[] = []
|
|
33
|
-
const deletedEntities: Hex[] = []
|
|
34
|
-
const extendedEntities: Hex[] = []
|
|
35
|
-
const ownershipChanges: Hex[] = []
|
|
36
|
-
|
|
37
|
-
const totalCreates = params.creates?.length ?? 0
|
|
38
|
-
const totalUpdates = params.updates?.length ?? 0
|
|
39
|
-
const totalDeletes = params.deletes?.length ?? 0
|
|
40
|
-
const totalExtensions = params.extensions?.length ?? 0
|
|
41
|
-
|
|
42
|
-
// iterate over all logs and parse the event
|
|
43
|
-
// logs go in the following order: creates, deleted, updates, extends, ownership changes
|
|
44
|
-
for (let index = 0; index < receipt.logs.length; index++) {
|
|
45
|
-
const log = receipt.logs[index]
|
|
46
|
-
|
|
47
|
-
if (index < totalCreates) {
|
|
48
|
-
createdEntities.push(log.topics[1] as Hex)
|
|
49
|
-
} else if (index < totalCreates + totalDeletes) {
|
|
50
|
-
deletedEntities.push(log.topics[1] as Hex)
|
|
51
|
-
} else if (index < totalCreates + totalUpdates + totalDeletes) {
|
|
52
|
-
updatedEntities.push(log.topics[1] as Hex)
|
|
53
|
-
} else if (index < totalCreates + totalUpdates + totalDeletes + totalExtensions) {
|
|
54
|
-
extendedEntities.push(log.topics[1] as Hex)
|
|
55
|
-
} else {
|
|
56
|
-
ownershipChanges.push(log.topics[1] as Hex)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return { createdEntities, updatedEntities, deletedEntities, extendedEntities, ownershipChanges }
|
|
61
|
-
}
|
|
62
|
-
|
|
63
29
|
/**
|
|
64
30
|
* Return type for the mutateEntities function.
|
|
65
31
|
* - txHash: The transaction hash.
|
|
@@ -77,6 +43,7 @@ export type MutateEntitiesReturnType = {
|
|
|
77
43
|
extendedEntities: Hex[]
|
|
78
44
|
ownershipChanges: Hex[]
|
|
79
45
|
}
|
|
46
|
+
|
|
80
47
|
export async function mutateEntities(
|
|
81
48
|
client: ArkivClient,
|
|
82
49
|
data: MutateEntitiesParameters,
|
|
@@ -86,26 +53,16 @@ export async function mutateEntities(
|
|
|
86
53
|
throw new Error("No operations to perform")
|
|
87
54
|
}
|
|
88
55
|
|
|
89
|
-
const
|
|
90
|
-
creates: data.creates ?? [],
|
|
91
|
-
updates: data.updates ?? [],
|
|
92
|
-
deletes: data.deletes ?? [],
|
|
93
|
-
extensions: data.extensions ?? [],
|
|
94
|
-
ownershipChanges: data.ownershipChanges ?? [],
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
const receipt = await sendArkivTransaction(client, txData, txParams)
|
|
56
|
+
const { receipt, createdEntityKeys } = await sendArkivTransaction(client, data, txParams)
|
|
98
57
|
|
|
99
58
|
logger("Receipt from mutateEntities %o", receipt)
|
|
100
59
|
|
|
101
|
-
const { createdEntities, updatedEntities, deletedEntities, extendedEntities, ownershipChanges } =
|
|
102
|
-
parseReceipt(receipt, data)
|
|
103
60
|
return {
|
|
104
61
|
txHash: receipt.transactionHash as Hash,
|
|
105
|
-
createdEntities,
|
|
106
|
-
updatedEntities,
|
|
107
|
-
deletedEntities,
|
|
108
|
-
extendedEntities,
|
|
109
|
-
ownershipChanges,
|
|
62
|
+
createdEntities: createdEntityKeys,
|
|
63
|
+
updatedEntities: (data.updates ?? []).map((u) => u.entityKey),
|
|
64
|
+
deletedEntities: (data.deletes ?? []).map((d) => d.entityKey),
|
|
65
|
+
extendedEntities: (data.extensions ?? []).map((e) => e.entityKey),
|
|
66
|
+
ownershipChanges: (data.ownershipChanges ?? []).map((o) => o.entityKey),
|
|
110
67
|
}
|
|
111
68
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash, Hex } from "viem"
|
|
2
2
|
import type { ArkivClient } from "../../clients/baseClient"
|
|
3
3
|
import type { Attribute, MimeType, TxParams } from "../../types"
|
|
4
|
-
import {
|
|
4
|
+
import { sendArkivTransaction } from "../../utils/arkivTransactions"
|
|
5
5
|
import { getLogger } from "../../utils/logger"
|
|
6
6
|
|
|
7
7
|
const logger = getLogger("actions:wallet:update-entity")
|
|
@@ -10,15 +10,25 @@ const logger = getLogger("actions:wallet:update-entity")
|
|
|
10
10
|
* Parameters for the updateEntity function.
|
|
11
11
|
* - entityKey: The key of the entity to update.
|
|
12
12
|
* - payload: The payload of the entity.
|
|
13
|
-
* - attributes: The attributes of the entity.
|
|
13
|
+
* - attributes: The attributes of the entity. Attribute values may be strings
|
|
14
|
+
* or numbers, but numeric values **must be integers**. To store a non-integer,
|
|
15
|
+
* scale it to an integer (e.g. `1.5` -> `1500`) to preserve numeric ordering,
|
|
16
|
+
* or pass it as a string (e.g. `"1.5"`). A non-integer numeric value throws an
|
|
17
|
+
* {@link InvalidAttributeError}.
|
|
14
18
|
* - contentType: The content type of the entity.
|
|
15
|
-
* - expiresIn:
|
|
19
|
+
* - expiresIn: How long until the entity expires, in seconds. Because Arkiv
|
|
20
|
+
* measures expiration in blocks (1 block = 2 seconds), this **must be a
|
|
21
|
+
* positive integer and a multiple of the block time (2 seconds)**.
|
|
22
|
+
* Invalid values throw an {@link InvalidExpirationError}.
|
|
16
23
|
*/
|
|
17
24
|
export type UpdateEntityParameters = {
|
|
18
25
|
entityKey: Hex
|
|
19
26
|
payload: Uint8Array
|
|
27
|
+
/** Entity attributes. Numeric values must be integers (scale non-integers, e.g. `1.5` -> `1500`, or use a string). Throws {@link InvalidAttributeError} otherwise. */
|
|
20
28
|
attributes: Attribute[]
|
|
21
29
|
contentType: MimeType | string
|
|
30
|
+
/** Seconds until expiry. Must be a positive integer and a multiple of the 2s block time.
|
|
31
|
+
* Throws {@link InvalidExpirationError} otherwise. */
|
|
22
32
|
expiresIn: number
|
|
23
33
|
}
|
|
24
34
|
|
|
@@ -38,13 +48,12 @@ export async function updateEntity(
|
|
|
38
48
|
txParams?: TxParams,
|
|
39
49
|
): Promise<UpdateEntityReturnType> {
|
|
40
50
|
logger("updateEntity %o", data)
|
|
41
|
-
const
|
|
42
|
-
const receipt = await sendArkivTransaction(client, txData, txParams)
|
|
51
|
+
const { receipt } = await sendArkivTransaction(client, { updates: [data] }, txParams)
|
|
43
52
|
|
|
44
53
|
logger("Receipt from updateEntity %o", receipt)
|
|
45
54
|
|
|
46
55
|
return {
|
|
47
56
|
txHash: receipt.transactionHash as Hash,
|
|
48
|
-
entityKey:
|
|
57
|
+
entityKey: data.entityKey,
|
|
49
58
|
}
|
|
50
59
|
}
|
|
@@ -20,6 +20,8 @@ test("creates", () => {
|
|
|
20
20
|
expect(typeof client.getEntity).toBe("function")
|
|
21
21
|
expect(client.buildQuery).toBeDefined()
|
|
22
22
|
expect(typeof client.buildQuery).toBe("function")
|
|
23
|
+
expect(client.select).toBeDefined()
|
|
24
|
+
expect(typeof client.select).toBe("function")
|
|
23
25
|
expect(client.query).toBeDefined()
|
|
24
26
|
expect(typeof client.query).toBe("function")
|
|
25
27
|
expect(client.getEntityCount).toBeDefined()
|