@arkiv-network/sdk 0.8.0-dev.3 → 0.8.0-dev.4

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 (39) hide show
  1. package/README.md +6 -6
  2. package/dist/chains/index.cjs +3 -3
  3. package/dist/chains/index.d.cts +21 -21
  4. package/dist/chains/index.d.cts.map +1 -1
  5. package/dist/chains/index.d.ts +21 -21
  6. package/dist/chains/index.d.ts.map +1 -1
  7. package/dist/chains/index.js +2 -2
  8. package/dist/{chains-Du8tql7I.js → chains-DmrgfF3p.js} +25 -25
  9. package/dist/chains-DmrgfF3p.js.map +1 -0
  10. package/dist/{chains-BfNQliHU.cjs → chains-Etgm64UM.cjs} +27 -27
  11. package/dist/index-CIcHPx2j.d.cts.map +1 -1
  12. package/dist/{index-BKB875Um.d.ts → index-CmEefH8_.d.ts} +3 -3
  13. package/dist/{index-BKB875Um.d.ts.map → index-CmEefH8_.d.ts.map} +1 -1
  14. package/dist/{index-rINthNuU.d.cts → index-DsM7EXu6.d.cts} +3 -3
  15. package/dist/{index-rINthNuU.d.cts.map → index-DsM7EXu6.d.cts.map} +1 -1
  16. package/dist/index.cjs +8 -8
  17. package/dist/index.d.cts +29 -29
  18. package/dist/index.d.ts +29 -29
  19. package/dist/index.js +8 -8
  20. package/dist/index.js.map +1 -1
  21. package/dist/query/index.cjs +1 -1
  22. package/dist/query/index.d.cts +1 -1
  23. package/dist/query/index.d.ts +1 -1
  24. package/dist/query/index.js +1 -1
  25. package/dist/{queryBuilder-DaLxNgeI.cjs → queryBuilder-BmRTaoJ8.cjs} +2 -2
  26. package/dist/{queryBuilder-COWt6aIF.js → queryBuilder-MubNEvA4.js} +3 -3
  27. package/dist/{queryBuilder-COWt6aIF.js.map → queryBuilder-MubNEvA4.js.map} +1 -1
  28. package/package.json +1 -1
  29. package/src/actions/public/watchEntityEvents.ts +2 -2
  30. package/src/chains/index.ts +1 -1
  31. package/src/chains/tiramisu.ts +22 -0
  32. package/src/clients/createPublicClient.ts +2 -2
  33. package/src/clients/createWalletClient.ts +2 -2
  34. package/src/clients/decorators/arkivPublic.ts +14 -14
  35. package/src/clients/decorators/arkivWallet.ts +10 -10
  36. package/src/query/queryBuilder.ts +2 -2
  37. package/src/utils/chains.test.ts +14 -14
  38. package/dist/chains-Du8tql7I.js.map +0 -1
  39. package/src/chains/cheesecake.ts +0 -22
@@ -65,13 +65,13 @@ export type WalletArkivActions<
65
65
  * @example
66
66
  * import { createWalletClient, ExpirationTime, jsonToPayload } from "@arkiv-network/sdk"
67
67
  * import { i32 } from "@arkiv-network/sdk/attr"
68
- * import { cheesecake } from "@arkiv-network/sdk/chains"
68
+ * import { tiramisu } from "@arkiv-network/sdk/chains"
69
69
  * import { http } from "viem"
70
70
  * import { privateKeyToAccount } from "viem/accounts"
71
71
  *
72
72
  * const client = createWalletClient({
73
73
  * account: privateKeyToAccount("0x..."),
74
- * chain: cheesecake,
74
+ * chain: tiramisu,
75
75
  * transport: http(),
76
76
  * })
77
77
  * const { entityKey, txHash, expiresAt } = await client.createEntity({
@@ -104,13 +104,13 @@ export type WalletArkivActions<
104
104
  * @example
105
105
  * import { createWalletClient, jsonToPayload } from "@arkiv-network/sdk"
106
106
  * import { i32 } from "@arkiv-network/sdk/attr"
107
- * import { cheesecake } from "@arkiv-network/sdk/chains"
107
+ * import { tiramisu } from "@arkiv-network/sdk/chains"
108
108
  * import { http } from "viem"
109
109
  * import { privateKeyToAccount } from "viem/accounts"
110
110
  *
111
111
  * const client = createWalletClient({
112
112
  * account: privateKeyToAccount("0x..."),
113
- * chain: cheesecake,
113
+ * chain: tiramisu,
114
114
  * transport: http(),
115
115
  * })
116
116
  * // Publish the entity: one attribute changes, one goes away, the payload is replaced.
@@ -137,13 +137,13 @@ export type WalletArkivActions<
137
137
  *
138
138
  * @example
139
139
  * import { createWalletClient } from "@arkiv-network/sdk"
140
- * import { cheesecake } from "@arkiv-network/sdk/chains"
140
+ * import { tiramisu } from "@arkiv-network/sdk/chains"
141
141
  * import { http } from "viem"
142
142
  * import { privateKeyToAccount } from "viem/accounts"
143
143
  *
144
144
  * const client = createWalletClient({
145
145
  * account: privateKeyToAccount("0x..."),
146
- * chain: cheesecake,
146
+ * chain: tiramisu,
147
147
  * transport: http(),
148
148
  * })
149
149
  * // entityKey is the bytes32 key returned by createEntity.
@@ -173,13 +173,13 @@ export type WalletArkivActions<
173
173
  *
174
174
  * @example
175
175
  * import { createWalletClient, ExpirationTime } from "@arkiv-network/sdk"
176
- * import { cheesecake } from "@arkiv-network/sdk/chains"
176
+ * import { tiramisu } from "@arkiv-network/sdk/chains"
177
177
  * import { http } from "viem"
178
178
  * import { privateKeyToAccount } from "viem/accounts"
179
179
  *
180
180
  * const client = createWalletClient({
181
181
  * account: privateKeyToAccount("0x..."),
182
- * chain: cheesecake,
182
+ * chain: tiramisu,
183
183
  * transport: http(),
184
184
  * })
185
185
  * const { txHash, expiresAt } = await client.extendEntity({
@@ -226,13 +226,13 @@ export type WalletArkivActions<
226
226
  *
227
227
  * @example
228
228
  * import { createWalletClient, ExpirationTime, jsonToPayload } from "@arkiv-network/sdk"
229
- * import { cheesecake } from "@arkiv-network/sdk/chains"
229
+ * import { tiramisu } from "@arkiv-network/sdk/chains"
230
230
  * import { http } from "viem"
231
231
  * import { privateKeyToAccount } from "viem/accounts"
232
232
  *
233
233
  * const client = createWalletClient({
234
234
  * account: privateKeyToAccount("0x..."),
235
- * chain: cheesecake,
235
+ * chain: tiramisu,
236
236
  * transport: http(),
237
237
  * })
238
238
  * const { txHash, createdEntities } = await client.executeBatch({
@@ -24,11 +24,11 @@ import { type SelectArg, toRpcSelect } from "./selection"
24
24
  * @example
25
25
  * import { createPublicClient } from "@arkiv-network/sdk"
26
26
  * import { i32 } from "@arkiv-network/sdk/attr"
27
- * import { cheesecake } from "@arkiv-network/sdk/chains"
27
+ * import { tiramisu } from "@arkiv-network/sdk/chains"
28
28
  * import { eq, gte, or } from "@arkiv-network/sdk/query"
29
29
  * import { http } from "viem"
30
30
  *
31
- * const client = createPublicClient({ chain: cheesecake, transport: http() })
31
+ * const client = createPublicClient({ chain: tiramisu, transport: http() })
32
32
  *
33
33
  * const page = await client
34
34
  * .select({ key: true, attributes: true })
@@ -1,14 +1,14 @@
1
1
  import { describe, expect, test } from "bun:test"
2
- import { cheesecake, localhost } from "../chains"
2
+ import { localhost, tiramisu } from "../chains"
3
3
  import { chainFromName } from "./chains"
4
4
 
5
5
  describe("chainFromName", () => {
6
6
  describe("valid chain names", () => {
7
- test("returns cheesecake chain for 'cheesecake'", () => {
8
- const chain = chainFromName("cheesecake")
9
- expect(chain).toBe(cheesecake)
10
- expect(chain.id).toBe(7733102)
11
- expect(chain.name).toBe("Cheesecake")
7
+ test("returns tiramisu chain for 'tiramisu'", () => {
8
+ const chain = chainFromName("tiramisu")
9
+ expect(chain).toBe(tiramisu)
10
+ expect(chain.id).toBe(7738577)
11
+ expect(chain.name).toBe("Tiramisu")
12
12
  })
13
13
 
14
14
  test("returns localhost chain for 'localhost'", () => {
@@ -21,14 +21,14 @@ describe("chainFromName", () => {
21
21
 
22
22
  describe("case insensitivity", () => {
23
23
  test("handles uppercase chain names", () => {
24
- expect(chainFromName("CHEESECAKE")).toBe(cheesecake)
24
+ expect(chainFromName("TIRAMISU")).toBe(tiramisu)
25
25
  expect(chainFromName("LOCALHOST")).toBe(localhost)
26
26
  })
27
27
 
28
28
  test("handles mixed case chain names", () => {
29
- expect(chainFromName("Cheesecake")).toBe(cheesecake)
29
+ expect(chainFromName("Tiramisu")).toBe(tiramisu)
30
30
  expect(chainFromName("Localhost")).toBe(localhost)
31
- expect(chainFromName("cHeEsEcAkE")).toBe(cheesecake)
31
+ expect(chainFromName("tIrAmIsU")).toBe(tiramisu)
32
32
  })
33
33
  })
34
34
 
@@ -42,12 +42,12 @@ describe("chainFromName", () => {
42
42
  })
43
43
 
44
44
  test("throws error for chain name with whitespace", () => {
45
- expect(() => chainFromName("cheesecake ")).toThrow("Unknown chain: cheesecake ")
46
- expect(() => chainFromName(" cheesecake")).toThrow("Unknown chain: cheesecake")
45
+ expect(() => chainFromName("tiramisu ")).toThrow("Unknown chain: tiramisu ")
46
+ expect(() => chainFromName(" tiramisu")).toThrow("Unknown chain: tiramisu")
47
47
  })
48
48
 
49
49
  test("throws error for similar but incorrect chain names", () => {
50
- expect(() => chainFromName("cheesecakee")).toThrow("Unknown chain: cheesecakee")
50
+ expect(() => chainFromName("tiramisue")).toThrow("Unknown chain: tiramisue")
51
51
  expect(() => chainFromName("cheesecak")).toThrow("Unknown chain: cheesecak")
52
52
  expect(() => chainFromName("mendoza")).toThrow("Unknown chain: mendoza")
53
53
  expect(() => chainFromName("marketplace")).toThrow("Unknown chain: marketplace")
@@ -63,7 +63,7 @@ describe("chainFromName", () => {
63
63
 
64
64
  describe("chain properties", () => {
65
65
  test("returned chain has required viem Chain properties", () => {
66
- const chain = chainFromName("cheesecake")
66
+ const chain = chainFromName("tiramisu")
67
67
 
68
68
  expect(chain).toHaveProperty("id")
69
69
  expect(chain).toHaveProperty("name")
@@ -75,7 +75,7 @@ describe("chainFromName", () => {
75
75
  })
76
76
 
77
77
  test("returned chain has rpcUrls configured", () => {
78
- const chain = chainFromName("cheesecake")
78
+ const chain = chainFromName("tiramisu")
79
79
 
80
80
  expect(chain.rpcUrls).toBeDefined()
81
81
  expect(chain.rpcUrls.default).toBeDefined()
@@ -1 +0,0 @@
1
- {"version":3,"file":"chains-Du8tql7I.js","names":[],"sources":["../src/chains/cheesecake.ts","../src/chains/localhost.ts","../src/chains/index.ts"],"sourcesContent":["import { defineChain } from \"viem\"\n\n/**\n * Cheesecake is Arkiv's testnet.\n */\nexport const cheesecake = defineChain({\n id: 7733102,\n name: \"Cheesecake\",\n network: \"cheesecake\",\n nativeCurrency: {\n name: \"Golem\",\n symbol: \"GLM\",\n decimals: 18,\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.cheesecake.db-chain.devnet.gobas.me\"],\n webSocket: [\"wss://rpc.cheesecake.db-chain.devnet.gobas.me\"],\n },\n },\n testnet: true,\n})\n","import { defineChain } from \"viem\"\n\n/**\n * A node running on the local machine\n */\nexport const localhost = defineChain({\n id: 1337,\n name: \"Localhost\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n rpcUrls: {\n default: { http: [\"http://127.0.0.1:8545\"] },\n },\n})\n","export { cheesecake } from \"./cheesecake\"\nexport { localhost } from \"./localhost\"\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,MAAa,aAAa,YAAY;CACpC,IAAI;CACJ,MAAM;CACN,SAAS;CACT,gBAAgB;EACd,MAAM;EACN,QAAQ;EACR,UAAU;EACX;CACD,SAAS,EACP,SAAS;EACP,MAAM,CAAC,kDAAkD;EACzD,WAAW,CAAC,gDAAgD;EAC7D,EACF;CACD,SAAS;CACV,CAAC;;;;;;;AChBF,MAAa,YAAY,YAAY;CACnC,IAAI;CACJ,MAAM;CACN,gBAAgB;EACd,UAAU;EACV,MAAM;EACN,QAAQ;EACT;CACD,SAAS,EACP,SAAS,EAAE,MAAM,CAAC,wBAAwB,EAAE,EAC7C;CACF,CAAC"}
@@ -1,22 +0,0 @@
1
- import { defineChain } from "viem"
2
-
3
- /**
4
- * Cheesecake is Arkiv's testnet.
5
- */
6
- export const cheesecake = defineChain({
7
- id: 7733102,
8
- name: "Cheesecake",
9
- network: "cheesecake",
10
- nativeCurrency: {
11
- name: "Golem",
12
- symbol: "GLM",
13
- decimals: 18,
14
- },
15
- rpcUrls: {
16
- default: {
17
- http: ["https://rpc.cheesecake.db-chain.devnet.gobas.me"],
18
- webSocket: ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"],
19
- },
20
- },
21
- testnet: true,
22
- })