@graphprotocol/grc-20 0.11.4 → 0.12.0

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 (322) hide show
  1. package/README.md +7 -48
  2. package/dist/convert-ids.d.ts +2 -0
  3. package/dist/convert-ids.d.ts.map +1 -0
  4. package/dist/convert-ids.js +42 -0
  5. package/dist/convert-ids.js.map +1 -0
  6. package/dist/index.d.ts +1 -25
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1 -25
  9. package/dist/index.js.map +1 -1
  10. package/dist/proto.d.ts +0 -4
  11. package/dist/proto.d.ts.map +1 -1
  12. package/dist/proto.js +0 -4
  13. package/dist/proto.js.map +1 -1
  14. package/dist/protov2.d.ts +11 -0
  15. package/dist/protov2.d.ts.map +1 -0
  16. package/dist/protov2.js +11 -0
  17. package/dist/protov2.js.map +1 -0
  18. package/dist/src/blocks.d.ts +0 -7
  19. package/dist/src/blocks.d.ts.map +1 -1
  20. package/dist/src/blocks.js +0 -7
  21. package/dist/src/blocks.js.map +1 -1
  22. package/dist/src/core/account.d.ts +2 -2
  23. package/dist/src/core/account.d.ts.map +1 -1
  24. package/dist/src/core/account.js +27 -38
  25. package/dist/src/core/account.js.map +1 -1
  26. package/dist/src/core/account.test.js +25 -17
  27. package/dist/src/core/account.test.js.map +1 -1
  28. package/dist/src/core/blocks/data.d.ts +2 -2
  29. package/dist/src/core/blocks/data.d.ts.map +1 -1
  30. package/dist/src/core/blocks/data.js +25 -24
  31. package/dist/src/core/blocks/data.js.map +1 -1
  32. package/dist/src/core/blocks/data.test.js +20 -20
  33. package/dist/src/core/blocks/data.test.js.map +1 -1
  34. package/dist/src/core/blocks/text.d.ts.map +1 -1
  35. package/dist/src/core/blocks/text.js +22 -22
  36. package/dist/src/core/blocks/text.js.map +1 -1
  37. package/dist/src/core/blocks/text.test.js +11 -11
  38. package/dist/src/core/blocks/text.test.js.map +1 -1
  39. package/dist/src/core/ids/content.d.ts +1 -37
  40. package/dist/src/core/ids/content.d.ts.map +1 -1
  41. package/dist/src/core/ids/content.js +55 -199
  42. package/dist/src/core/ids/content.js.map +1 -1
  43. package/dist/src/core/ids/network.d.ts.map +1 -1
  44. package/dist/src/core/ids/network.js +3 -3
  45. package/dist/src/core/ids/network.js.map +1 -1
  46. package/dist/src/core/ids/system.d.ts +6 -51
  47. package/dist/src/core/ids/system.d.ts.map +1 -1
  48. package/dist/src/core/ids/system.js +142 -310
  49. package/dist/src/core/ids/system.js.map +1 -1
  50. package/dist/src/core/idsv2/content.d.ts +59 -0
  51. package/dist/src/core/idsv2/content.d.ts.map +1 -0
  52. package/dist/src/core/idsv2/content.js +59 -0
  53. package/dist/src/core/idsv2/content.js.map +1 -0
  54. package/dist/src/core/idsv2/network.d.ts +5 -0
  55. package/dist/src/core/idsv2/network.d.ts.map +1 -0
  56. package/dist/src/core/idsv2/network.js +5 -0
  57. package/dist/src/core/idsv2/network.js.map +1 -0
  58. package/dist/src/core/idsv2/system.d.ts +222 -0
  59. package/dist/src/core/idsv2/system.d.ts.map +1 -0
  60. package/dist/src/core/idsv2/system.js +230 -0
  61. package/dist/src/core/idsv2/system.js.map +1 -0
  62. package/dist/src/core/scheme.d.ts +1 -1
  63. package/dist/src/core/scheme.d.ts.map +1 -1
  64. package/dist/src/graph/create-entity.d.ts +21 -18
  65. package/dist/src/graph/create-entity.d.ts.map +1 -1
  66. package/dist/src/graph/create-entity.js +96 -27
  67. package/dist/src/graph/create-entity.js.map +1 -1
  68. package/dist/src/graph/create-entity.test.js +101 -245
  69. package/dist/src/graph/create-entity.test.js.map +1 -1
  70. package/dist/src/graph/create-image.d.ts +1 -14
  71. package/dist/src/graph/create-image.d.ts.map +1 -1
  72. package/dist/src/graph/create-image.js +34 -7
  73. package/dist/src/graph/create-image.js.map +1 -1
  74. package/dist/src/graph/create-image.test.js +38 -47
  75. package/dist/src/graph/create-image.test.js.map +1 -1
  76. package/dist/src/graph/create-property.d.ts +1 -9
  77. package/dist/src/graph/create-property.d.ts.map +1 -1
  78. package/dist/src/graph/create-property.js +52 -36
  79. package/dist/src/graph/create-property.js.map +1 -1
  80. package/dist/src/graph/create-property.test.js +10 -12
  81. package/dist/src/graph/create-property.test.js.map +1 -1
  82. package/dist/src/graph/create-relation.d.ts +33 -0
  83. package/dist/src/graph/create-relation.d.ts.map +1 -0
  84. package/dist/src/graph/create-relation.js +66 -0
  85. package/dist/src/graph/create-relation.js.map +1 -0
  86. package/dist/src/graph/create-relation.test.d.ts +2 -0
  87. package/dist/src/graph/create-relation.test.d.ts.map +1 -0
  88. package/dist/src/graph/create-relation.test.js +208 -0
  89. package/dist/src/graph/create-relation.test.js.map +1 -0
  90. package/dist/src/graph/create-type.d.ts +3 -8
  91. package/dist/src/graph/create-type.d.ts.map +1 -1
  92. package/dist/src/graph/create-type.js +29 -17
  93. package/dist/src/graph/create-type.js.map +1 -1
  94. package/dist/src/graph/create-type.test.js +37 -35
  95. package/dist/src/graph/create-type.test.js.map +1 -1
  96. package/dist/src/graph/delete-entity.d.ts +4 -10
  97. package/dist/src/graph/delete-entity.d.ts.map +1 -1
  98. package/dist/src/graph/delete-entity.js +10 -35
  99. package/dist/src/graph/delete-entity.js.map +1 -1
  100. package/dist/src/graph/delete-entity.test.js +17 -35
  101. package/dist/src/graph/delete-entity.test.js.map +1 -1
  102. package/dist/src/graph/delete-relation.d.ts +14 -0
  103. package/dist/src/graph/delete-relation.d.ts.map +1 -0
  104. package/dist/src/graph/delete-relation.js +21 -0
  105. package/dist/src/graph/delete-relation.js.map +1 -0
  106. package/dist/src/graph/delete-relation.test.d.ts +2 -0
  107. package/dist/src/graph/delete-relation.test.d.ts.map +1 -0
  108. package/dist/src/graph/delete-relation.test.js +24 -0
  109. package/dist/src/graph/delete-relation.test.js.map +1 -0
  110. package/dist/src/graph/index.d.ts +5 -0
  111. package/dist/src/graph/index.d.ts.map +1 -1
  112. package/dist/src/graph/index.js +5 -0
  113. package/dist/src/graph/index.js.map +1 -1
  114. package/dist/src/graph/unset-entity-values.d.ts +21 -0
  115. package/dist/src/graph/unset-entity-values.d.ts.map +1 -0
  116. package/dist/src/graph/unset-entity-values.js +26 -0
  117. package/dist/src/graph/unset-entity-values.js.map +1 -0
  118. package/dist/src/graph/unset-entity-values.test.d.ts +2 -0
  119. package/dist/src/graph/unset-entity-values.test.d.ts.map +1 -0
  120. package/dist/src/graph/unset-entity-values.test.js +40 -0
  121. package/dist/src/graph/unset-entity-values.test.js.map +1 -0
  122. package/dist/src/graph/unset-relation-fields.d.ts +25 -0
  123. package/dist/src/graph/unset-relation-fields.d.ts.map +1 -0
  124. package/dist/src/graph/unset-relation-fields.js +34 -0
  125. package/dist/src/graph/unset-relation-fields.js.map +1 -0
  126. package/dist/src/graph/unset-relation-fields.test.d.ts +2 -0
  127. package/dist/src/graph/unset-relation-fields.test.d.ts.map +1 -0
  128. package/dist/src/graph/unset-relation-fields.test.js +64 -0
  129. package/dist/src/graph/unset-relation-fields.test.js.map +1 -0
  130. package/dist/src/graph/update-entity.d.ts +28 -0
  131. package/dist/src/graph/update-entity.d.ts.map +1 -0
  132. package/dist/src/graph/update-entity.js +73 -0
  133. package/dist/src/graph/update-entity.js.map +1 -0
  134. package/dist/src/graph/update-entity.test.d.ts +2 -0
  135. package/dist/src/graph/update-entity.test.d.ts.map +1 -0
  136. package/dist/src/graph/update-entity.test.js +116 -0
  137. package/dist/src/graph/update-entity.test.js.map +1 -0
  138. package/dist/src/graph/update-relation.d.ts +21 -0
  139. package/dist/src/graph/update-relation.d.ts.map +1 -0
  140. package/dist/src/graph/update-relation.js +37 -0
  141. package/dist/src/graph/update-relation.js.map +1 -0
  142. package/dist/src/graphv2/constants.d.ts +2 -0
  143. package/dist/src/graphv2/constants.d.ts.map +1 -0
  144. package/dist/src/graphv2/constants.js +2 -0
  145. package/dist/src/graphv2/constants.js.map +1 -0
  146. package/dist/src/graphv2/create-entity.d.ts +52 -0
  147. package/dist/src/graphv2/create-entity.d.ts.map +1 -0
  148. package/dist/src/graphv2/create-entity.js +140 -0
  149. package/dist/src/graphv2/create-entity.js.map +1 -0
  150. package/dist/src/graphv2/create-entity.test.d.ts +2 -0
  151. package/dist/src/graphv2/create-entity.test.d.ts.map +1 -0
  152. package/dist/src/graphv2/create-entity.test.js +158 -0
  153. package/dist/src/graphv2/create-entity.test.js.map +1 -0
  154. package/dist/src/graphv2/create-image.d.ts +28 -0
  155. package/dist/src/graphv2/create-image.d.ts.map +1 -0
  156. package/dist/src/graphv2/create-image.js +71 -0
  157. package/dist/src/graphv2/create-image.js.map +1 -0
  158. package/dist/src/graphv2/create-image.test.d.ts +2 -0
  159. package/dist/src/graphv2/create-image.test.d.ts.map +1 -0
  160. package/dist/src/graphv2/create-image.test.js +142 -0
  161. package/dist/src/graphv2/create-image.test.js.map +1 -0
  162. package/dist/src/graphv2/create-property.d.ts +22 -0
  163. package/dist/src/graphv2/create-property.d.ts.map +1 -0
  164. package/dist/src/graphv2/create-property.js +129 -0
  165. package/dist/src/graphv2/create-property.js.map +1 -0
  166. package/dist/src/graphv2/create-property.test.d.ts +2 -0
  167. package/dist/src/graphv2/create-property.test.d.ts.map +1 -0
  168. package/dist/src/graphv2/create-property.test.js +82 -0
  169. package/dist/src/graphv2/create-property.test.js.map +1 -0
  170. package/dist/src/graphv2/create-relation.d.ts +33 -0
  171. package/dist/src/graphv2/create-relation.d.ts.map +1 -0
  172. package/dist/src/graphv2/create-relation.js +66 -0
  173. package/dist/src/graphv2/create-relation.js.map +1 -0
  174. package/dist/src/graphv2/create-relation.test.d.ts +2 -0
  175. package/dist/src/graphv2/create-relation.test.d.ts.map +1 -0
  176. package/dist/src/graphv2/create-relation.test.js +208 -0
  177. package/dist/src/graphv2/create-relation.test.js.map +1 -0
  178. package/dist/src/graphv2/create-space.d.ts +13 -0
  179. package/dist/src/graphv2/create-space.d.ts.map +1 -0
  180. package/dist/src/graphv2/create-space.js +21 -0
  181. package/dist/src/graphv2/create-space.js.map +1 -0
  182. package/dist/src/graphv2/create-type.d.ts +22 -0
  183. package/dist/src/graphv2/create-type.d.ts.map +1 -0
  184. package/dist/src/graphv2/create-type.js +64 -0
  185. package/dist/src/graphv2/create-type.js.map +1 -0
  186. package/dist/src/graphv2/create-type.test.d.ts +2 -0
  187. package/dist/src/graphv2/create-type.test.d.ts.map +1 -0
  188. package/dist/src/graphv2/create-type.test.js +109 -0
  189. package/dist/src/graphv2/create-type.test.js.map +1 -0
  190. package/dist/src/graphv2/delete-entity.d.ts +14 -0
  191. package/dist/src/graphv2/delete-entity.d.ts.map +1 -0
  192. package/dist/src/graphv2/delete-entity.js +21 -0
  193. package/dist/src/graphv2/delete-entity.js.map +1 -0
  194. package/dist/src/graphv2/delete-entity.test.d.ts +2 -0
  195. package/dist/src/graphv2/delete-entity.test.d.ts.map +1 -0
  196. package/dist/src/graphv2/delete-entity.test.js +24 -0
  197. package/dist/src/graphv2/delete-entity.test.js.map +1 -0
  198. package/dist/src/graphv2/delete-relation.d.ts +14 -0
  199. package/dist/src/graphv2/delete-relation.d.ts.map +1 -0
  200. package/dist/src/graphv2/delete-relation.js +21 -0
  201. package/dist/src/graphv2/delete-relation.js.map +1 -0
  202. package/dist/src/graphv2/delete-relation.test.d.ts +2 -0
  203. package/dist/src/graphv2/delete-relation.test.d.ts.map +1 -0
  204. package/dist/src/graphv2/delete-relation.test.js +24 -0
  205. package/dist/src/graphv2/delete-relation.test.js.map +1 -0
  206. package/dist/src/graphv2/index.d.ts +12 -0
  207. package/dist/src/graphv2/index.d.ts.map +1 -0
  208. package/dist/src/graphv2/index.js +12 -0
  209. package/dist/src/graphv2/index.js.map +1 -0
  210. package/dist/src/graphv2/remove-entity-properties.d.ts +25 -0
  211. package/dist/src/graphv2/remove-entity-properties.d.ts.map +1 -0
  212. package/dist/src/graphv2/remove-entity-properties.js +24 -0
  213. package/dist/src/graphv2/remove-entity-properties.js.map +1 -0
  214. package/dist/src/graphv2/unset-entity-values.d.ts +21 -0
  215. package/dist/src/graphv2/unset-entity-values.d.ts.map +1 -0
  216. package/dist/src/graphv2/unset-entity-values.js +26 -0
  217. package/dist/src/graphv2/unset-entity-values.js.map +1 -0
  218. package/dist/src/graphv2/unset-entity-values.test.d.ts +2 -0
  219. package/dist/src/graphv2/unset-entity-values.test.d.ts.map +1 -0
  220. package/dist/src/graphv2/unset-entity-values.test.js +40 -0
  221. package/dist/src/graphv2/unset-entity-values.test.js.map +1 -0
  222. package/dist/src/graphv2/unset-relation-fields.d.ts +25 -0
  223. package/dist/src/graphv2/unset-relation-fields.d.ts.map +1 -0
  224. package/dist/src/graphv2/unset-relation-fields.js +34 -0
  225. package/dist/src/graphv2/unset-relation-fields.js.map +1 -0
  226. package/dist/src/graphv2/unset-relation-fields.test.d.ts +2 -0
  227. package/dist/src/graphv2/unset-relation-fields.test.d.ts.map +1 -0
  228. package/dist/src/graphv2/unset-relation-fields.test.js +64 -0
  229. package/dist/src/graphv2/unset-relation-fields.test.js.map +1 -0
  230. package/dist/src/graphv2/update-entity.d.ts +28 -0
  231. package/dist/src/graphv2/update-entity.d.ts.map +1 -0
  232. package/dist/src/graphv2/update-entity.js +73 -0
  233. package/dist/src/graphv2/update-entity.js.map +1 -0
  234. package/dist/src/graphv2/update-entity.test.d.ts +2 -0
  235. package/dist/src/graphv2/update-entity.test.d.ts.map +1 -0
  236. package/dist/src/graphv2/update-entity.test.js +116 -0
  237. package/dist/src/graphv2/update-entity.test.js.map +1 -0
  238. package/dist/src/graphv2/update-relation.d.ts +21 -0
  239. package/dist/src/graphv2/update-relation.d.ts.map +1 -0
  240. package/dist/src/graphv2/update-relation.js +37 -0
  241. package/dist/src/graphv2/update-relation.js.map +1 -0
  242. package/dist/src/id.d.ts +9 -2
  243. package/dist/src/id.d.ts.map +1 -1
  244. package/dist/src/id.js +55 -22
  245. package/dist/src/id.js.map +1 -1
  246. package/dist/src/id.test.js +13 -10
  247. package/dist/src/id.test.js.map +1 -1
  248. package/dist/src/idv2.d.ts +27 -0
  249. package/dist/src/idv2.d.ts.map +1 -0
  250. package/dist/src/idv2.js +88 -0
  251. package/dist/src/idv2.js.map +1 -0
  252. package/dist/src/idv2.test.d.ts +2 -0
  253. package/dist/src/idv2.test.d.ts.map +1 -0
  254. package/dist/src/idv2.test.js +26 -0
  255. package/dist/src/idv2.test.js.map +1 -0
  256. package/dist/src/ipfs.d.ts +2 -2
  257. package/dist/src/ipfs.d.ts.map +1 -1
  258. package/dist/src/ipfs.js +2 -2
  259. package/dist/src/ipfs.js.map +1 -1
  260. package/dist/src/ipfs.test.d.ts +2 -0
  261. package/dist/src/ipfs.test.d.ts.map +1 -0
  262. package/dist/src/ipfs.test.js +22 -0
  263. package/dist/src/ipfs.test.js.map +1 -0
  264. package/dist/src/ipfsv2.d.ts +96 -0
  265. package/dist/src/ipfsv2.d.ts.map +1 -0
  266. package/dist/src/ipfsv2.js +163 -0
  267. package/dist/src/ipfsv2.js.map +1 -0
  268. package/dist/src/ipfsv2.test.d.ts +2 -0
  269. package/dist/src/ipfsv2.test.d.ts.map +1 -0
  270. package/dist/src/ipfsv2.test.js +22 -0
  271. package/dist/src/ipfsv2.test.js.map +1 -0
  272. package/dist/src/proto/edit.d.ts +4 -2
  273. package/dist/src/proto/edit.d.ts.map +1 -1
  274. package/dist/src/proto/edit.js +53 -32
  275. package/dist/src/proto/edit.js.map +1 -1
  276. package/dist/src/proto/edit.test.js +139 -152
  277. package/dist/src/proto/edit.test.js.map +1 -1
  278. package/dist/src/proto/editv2.d.ts +11 -0
  279. package/dist/src/proto/editv2.d.ts.map +1 -0
  280. package/dist/src/proto/editv2.js +81 -0
  281. package/dist/src/proto/editv2.js.map +1 -0
  282. package/dist/src/proto/editv2.test.d.ts +2 -0
  283. package/dist/src/proto/editv2.test.d.ts.map +1 -0
  284. package/dist/src/proto/editv2.test.js +211 -0
  285. package/dist/src/proto/editv2.test.js.map +1 -0
  286. package/dist/src/proto/gen/src/proto/ipfs_pb.d.ts +249 -369
  287. package/dist/src/proto/gen/src/proto/ipfs_pb.d.ts.map +1 -1
  288. package/dist/src/proto/gen/src/proto/ipfs_pb.js +244 -484
  289. package/dist/src/proto/gen/src/proto/ipfs_pb.js.map +1 -1
  290. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts +410 -0
  291. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts.map +1 -0
  292. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js +536 -0
  293. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js.map +1 -0
  294. package/dist/src/smart-wallet-2.test-invalid.d.ts +2 -0
  295. package/dist/src/smart-wallet-2.test-invalid.d.ts.map +1 -0
  296. package/dist/src/smart-wallet-2.test-invalid.js +49 -0
  297. package/dist/src/smart-wallet-2.test-invalid.js.map +1 -0
  298. package/dist/src/smart-wallet-2.test.d.ts +2 -0
  299. package/dist/src/smart-wallet-2.test.d.ts.map +1 -0
  300. package/dist/src/smart-wallet-2.test.js +49 -0
  301. package/dist/src/smart-wallet-2.test.js.map +1 -0
  302. package/dist/src/system-ids-v2.d.ts +7 -0
  303. package/dist/src/system-ids-v2.d.ts.map +1 -0
  304. package/dist/src/system-ids-v2.js +7 -0
  305. package/dist/src/system-ids-v2.js.map +1 -0
  306. package/dist/src/system-ids.d.ts +0 -2
  307. package/dist/src/system-ids.d.ts.map +1 -1
  308. package/dist/src/system-ids.js +0 -2
  309. package/dist/src/system-ids.js.map +1 -1
  310. package/dist/src/types-backup.d.ts +134 -0
  311. package/dist/src/types-backup.d.ts.map +1 -0
  312. package/dist/src/types-backup.js +13 -0
  313. package/dist/src/types-backup.js.map +1 -0
  314. package/dist/src/types.d.ts +126 -103
  315. package/dist/src/types.d.ts.map +1 -1
  316. package/dist/src/types.js +0 -5
  317. package/dist/src/types.js.map +1 -1
  318. package/dist/src/typesv2.d.ts +173 -0
  319. package/dist/src/typesv2.d.ts.map +1 -0
  320. package/dist/src/typesv2.js +8 -0
  321. package/dist/src/typesv2.js.map +1 -0
  322. package/package.json +1 -1
package/README.md CHANGED
@@ -19,12 +19,6 @@ Data in The Graph lives both offchain and onchain. This data is written to IPFS,
19
19
 
20
20
  On The Graph, knowledge is organized into spaces. Anyone can create a space for a community, project or individual. Spaces are organized onchain into a set of multiple smart contracts. These smart contracts represent the space itself, its data and its governance process. Depending on which onchain actions you're taking you might be interacting with one or more of these smart contracts.
21
21
 
22
- ### Triple
23
-
24
- The structure of knowledge on The Graph is built on simple primitives that compose to create more complex structures. Triples are the atomic unit. Triples are combined into entities. Entities are linked together to form a graph.
25
-
26
- [Read more about Triples in GRC-20](https://github.com/graphprotocol/graph-improvement-proposals/blob/main/grcs/0020-knowledge-graph.md#4-triples)
27
-
28
22
  ### Relations
29
23
 
30
24
  Relations describe the edges within the graph. Relations are themselves entities that include details about the relationship. For example a Company can have Team Members. Each Team Member relation can have an attribute describing when the person joined the team. This is a model that is commonly called a property graph.
@@ -57,43 +51,6 @@ import { Id } from '@graphprotocol/grc-20';
57
51
  const newId = Id.generate();
58
52
  ```
59
53
 
60
- ### Making ops
61
-
62
- The SDK exports a set of APIs for creating and deleting triple and relation ops.
63
-
64
- ```ts
65
- import {
66
- type CreateRelationOp,
67
- type DeleteRelationOp,
68
- type DeleteTripleOp,
69
- Relation,
70
- type SetTripleOp,
71
- Triple,
72
- } from '@graphprotocol/grc-20';
73
-
74
- const setTripleOp: SetTripleOp = Triple.make({
75
- entityId: 'id of entity',
76
- attributeId: 'id of attribute',
77
- value: {
78
- type: 'TEXT', // TEXT | NUMBER | URL | TIME | POINT | CHECKBOX,
79
- value: 'hello world',
80
- },
81
- });
82
-
83
- const deleteTripleOp: DeleteTripleOp = Triple.remove({
84
- entityId: 'id of entity',
85
- attributeId: 'id of attribute',
86
- });
87
-
88
- const setRelationOp: CreateRelationOp = Relation.make({
89
- fromId: 'id of from entity',
90
- relationTypeId: 'id of relation type',
91
- toId: 'id of to entity',
92
- });
93
-
94
- const deleteRelationOp: DeleteRelationOp = Relation.remove('id of relation');
95
- ```
96
-
97
54
  ### Creating properties, types and entities
98
55
 
99
56
  Working with triple and relations ops is a low level API and give you maximum flexibility. In order to ease the process of creating and updating data, the library also exports APIs for creating properties, types and entities.
@@ -125,18 +82,20 @@ const { id: restaurantId, ops: createRestaurantOps } = Graph.createEntity({
125
82
  description: 'description of the entity',
126
83
  types: […listOfTypeIds],
127
84
  cover: imageId,
128
- properties: {
85
+ values: {
129
86
  // value property like text, number, url, time, point, checkbox
130
87
  [propertyId]: {
131
88
  type: 'TEXT', // TEXT | NUMBER | URL | TIME | POINT | CHECKBOX,
132
89
  value: 'value of the property',
133
90
  },
91
+ },
92
+ relations: {
134
93
  // relation property
135
94
  [propertyId]: {
136
95
  to: 'id of the entity',
137
- relationId: 'id of the relation', // optional
96
+ id: 'id of the relation', // optional
138
97
  position: positionString, // optional
139
- properties: {
98
+ values: {
140
99
  [propertyId]: {
141
100
  type: 'TEXT', // TEXT | NUMBER | URL | TIME | POINT | CHECKBOX,
142
101
  value: 'value of the property',
@@ -189,7 +148,7 @@ const { id: restaurantId, ops: createRestaurantOps } = Graph.createEntity({
189
148
  description: 'A restaurant serving fusion cuisine',
190
149
  cover: restaurantCoverId,
191
150
  types: [restaurantTypeId],
192
- properties: {
151
+ values: {
193
152
  [WEBSITE_PROPERTY]: {
194
153
  type: 'URL',
195
154
  value: 'https://example.com',
@@ -209,7 +168,7 @@ const { id: personId, ops: createPersonOps } = Graph.createEntity({
209
168
  name: 'Jane Doe',
210
169
  types: [personTypeId],
211
170
  cover: personCoverId,
212
- properties: {
171
+ values: {
213
172
  [agePropertyId]: {
214
173
  type: 'NUMBER',
215
174
  value: 42,
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=convert-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-ids.d.ts","sourceRoot":"","sources":["../convert-ids.ts"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ import { readFile, writeFile } from 'node:fs/promises';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { decodeBase58ToUUID } from './src/core/base58.js';
5
+ // Helper function to check if a string is a UUID
6
+ function isUUID(str) {
7
+ const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
8
+ return uuidRegex.test(str);
9
+ }
10
+ async function convertIds() {
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = dirname(__filename);
13
+ const filePath = join(__dirname, 'src/core/idsv2/content.ts');
14
+ // Read the file content
15
+ const content = await readFile(filePath, 'utf-8');
16
+ // Find all Id() calls and convert them
17
+ const updatedContent = content.replace(/Id\(['"]([^'"]+)['"]\)/g, (match, id) => {
18
+ if (isUUID(id)) {
19
+ console.log(`Already a UUID: ${id}`);
20
+ return match;
21
+ }
22
+ try {
23
+ const uuid = decodeBase58ToUUID(id);
24
+ console.log(`Converting ${id} to UUID ${uuid}`);
25
+ return `Id('${uuid}')`;
26
+ }
27
+ catch (error) {
28
+ if (error instanceof Error) {
29
+ console.error(`Error converting ${id}: ${error.message}`);
30
+ }
31
+ else {
32
+ console.error(`Error converting ${id}: Unknown error`);
33
+ }
34
+ return match;
35
+ }
36
+ });
37
+ // Write the updated content back to the file
38
+ await writeFile(filePath, updatedContent, 'utf-8');
39
+ console.log('File has been updated with converted UUIDs');
40
+ }
41
+ convertIds().catch(console.error);
42
+ //# sourceMappingURL=convert-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-ids.js","sourceRoot":"","sources":["../convert-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,iDAAiD;AACjD,SAAS,MAAM,CAAC,GAAW;IACzB,MAAM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AE,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC5D,CAAC;AAED,UAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,11 +6,6 @@ export * from './src/types.js';
6
6
  * @since 0.0.6
7
7
  */
8
8
  export * as Id from './src/id.js';
9
- /**
10
- * This module provides utility functions for working with base58 ids
11
- * in TypeScript.
12
- */
13
- export * as Base58 from './src/core/base58.js';
14
9
  export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from './src/encodings/index.js';
15
10
  /**
16
11
  * This module provides utility functions for working with knowledge graph
@@ -19,17 +14,10 @@ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpa
19
14
  * @since 0.0.6
20
15
  */
21
16
  export { Account } from './src/account.js';
22
- export { DataBlock, ImageBlock, TextBlock } from './src/blocks.js';
17
+ export { DataBlock, TextBlock } from './src/blocks.js';
23
18
  export * as Encoding from './src/encoding.js';
24
19
  export { getChecksumAddress } from './src/core/get-checksum-address.js';
25
20
  export * as Graph from './src/graph/index.js';
26
- /**
27
- * This module provides utility functions for working with knowledge graph
28
- * images in TypeScript.
29
- *
30
- * @since 0.0.6
31
- */
32
- export { Image } from './src/image.js';
33
21
  /**
34
22
  * This module provides utility functions for interacting with the default
35
23
  * IPFS gateway in TypeScript.
@@ -38,12 +26,6 @@ export { Image } from './src/image.js';
38
26
  */
39
27
  export * as Ipfs from './src/ipfs.js';
40
28
  export { Position, PositionRange } from './src/position.js';
41
- /**
42
- * This module provides utility functions for working with Relations in TypeScript.
43
- *
44
- * @since 0.0.6
45
- */
46
- export { Relation } from './src/relation.js';
47
29
  /**
48
30
  * This module provides utility functions for working with Graph URIs in TypeScript.
49
31
  *
@@ -55,10 +37,4 @@ export { getSmartAccountWalletClient } from './src/smart-wallet.js';
55
37
  * Provides ids for commonly used entities across the Knowledge Graph.
56
38
  */
57
39
  export { ContentIds, NetworkIds, SystemIds } from './src/system-ids.js';
58
- /**
59
- * This module provides utility functions for working with Triples in TypeScript.
60
- *
61
- * @since 0.0.6
62
- */
63
- export { Triple } from './src/triple.js';
64
40
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C;;;;;GAKG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -6,11 +6,6 @@ export * from './src/types.js';
6
6
  * @since 0.0.6
7
7
  */
8
8
  export * as Id from './src/id.js';
9
- /**
10
- * This module provides utility functions for working with base58 ids
11
- * in TypeScript.
12
- */
13
- export * as Base58 from './src/core/base58.js';
14
9
  export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from './src/encodings/index.js';
15
10
  /**
16
11
  * This module provides utility functions for working with knowledge graph
@@ -19,17 +14,10 @@ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpa
19
14
  * @since 0.0.6
20
15
  */
21
16
  export { Account } from './src/account.js';
22
- export { DataBlock, ImageBlock, TextBlock } from './src/blocks.js';
17
+ export { DataBlock, TextBlock } from './src/blocks.js';
23
18
  export * as Encoding from './src/encoding.js';
24
19
  export { getChecksumAddress } from './src/core/get-checksum-address.js';
25
20
  export * as Graph from './src/graph/index.js';
26
- /**
27
- * This module provides utility functions for working with knowledge graph
28
- * images in TypeScript.
29
- *
30
- * @since 0.0.6
31
- */
32
- export { Image } from './src/image.js';
33
21
  /**
34
22
  * This module provides utility functions for interacting with the default
35
23
  * IPFS gateway in TypeScript.
@@ -38,12 +26,6 @@ export { Image } from './src/image.js';
38
26
  */
39
27
  export * as Ipfs from './src/ipfs.js';
40
28
  export { Position, PositionRange } from './src/position.js';
41
- /**
42
- * This module provides utility functions for working with Relations in TypeScript.
43
- *
44
- * @since 0.0.6
45
- */
46
- export { Relation } from './src/relation.js';
47
29
  /**
48
30
  * This module provides utility functions for working with Graph URIs in TypeScript.
49
31
  *
@@ -55,10 +37,4 @@ export { getSmartAccountWalletClient } from './src/smart-wallet.js';
55
37
  * Provides ids for commonly used entities across the Knowledge Graph.
56
38
  */
57
39
  export { ContentIds, NetworkIds, SystemIds } from './src/system-ids.js';
58
- /**
59
- * This module provides utility functions for working with Triples in TypeScript.
60
- *
61
- * @since 0.0.6
62
- */
63
- export { Triple } from './src/triple.js';
64
40
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBA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AO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/proto.d.ts CHANGED
@@ -1,15 +1,11 @@
1
1
  /**
2
2
  * This module provides utility functions for working with GRC-20 protobufs
3
3
  * in TypeScript.
4
- *
5
- * @since 0.0.6
6
4
  */
7
5
  export * from './src/proto/gen/src/proto/ipfs_pb.js';
8
6
  /**
9
7
  * This module provides utility functions for working with the GRC-20 Edit
10
8
  * protobuf in TypeScript.
11
- *
12
- * @since 0.0.6
13
9
  */
14
10
  export * as EditProposal from './src/proto/edit.js';
15
11
  //# sourceMappingURL=proto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,sCAAsC,CAAC;AAErD;;;;;GAKG;AACH,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,sCAAsC,CAAC;AAErD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC"}
package/dist/proto.js CHANGED
@@ -1,15 +1,11 @@
1
1
  /**
2
2
  * This module provides utility functions for working with GRC-20 protobufs
3
3
  * in TypeScript.
4
- *
5
- * @since 0.0.6
6
4
  */
7
5
  export * from './src/proto/gen/src/proto/ipfs_pb.js';
8
6
  /**
9
7
  * This module provides utility functions for working with the GRC-20 Edit
10
8
  * protobuf in TypeScript.
11
- *
12
- * @since 0.0.6
13
9
  */
14
10
  export * as EditProposal from './src/proto/edit.js';
15
11
  //# sourceMappingURL=proto.js.map
package/dist/proto.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"proto.js","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,sCAAsC,CAAC;AAErD;;;;;GAKG;AACH,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"proto.js","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,sCAAsC,CAAC;AAErD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This module provides utility functions for working with GRC-20 protobufs
3
+ * in TypeScript.
4
+ */
5
+ export * from './src/proto/gen/src/proto/ipfsv2_pb.js';
6
+ /**
7
+ * This module provides utility functions for working with the GRC-20 Edit
8
+ * protobuf in TypeScript.
9
+ */
10
+ export * as EditProposal from './src/proto/editv2.js';
11
+ //# sourceMappingURL=protov2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protov2.d.ts","sourceRoot":"","sources":["../protov2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,wCAAwC,CAAC;AAEvD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This module provides utility functions for working with GRC-20 protobufs
3
+ * in TypeScript.
4
+ */
5
+ export * from './src/proto/gen/src/proto/ipfsv2_pb.js';
6
+ /**
7
+ * This module provides utility functions for working with the GRC-20 Edit
8
+ * protobuf in TypeScript.
9
+ */
10
+ export * as EditProposal from './src/proto/editv2.js';
11
+ //# sourceMappingURL=protov2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protov2.js","sourceRoot":"","sources":["../protov2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,wCAAwC,CAAC;AAEvD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC"}
@@ -12,11 +12,4 @@ export * as DataBlock from './core/blocks/data.js';
12
12
  * @since 0.0.6
13
13
  */
14
14
  export * as TextBlock from './core/blocks/text.js';
15
- /**
16
- * This module provides utility functions for working with image blocks
17
- * in TypeScript.
18
- *
19
- * @since 0.0.6
20
- */
21
- export * as ImageBlock from './core/blocks/image.js';
22
15
  //# sourceMappingURL=blocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC"}
@@ -12,11 +12,4 @@ export * as DataBlock from './core/blocks/data.js';
12
12
  * @since 0.0.6
13
13
  */
14
14
  export * as TextBlock from './core/blocks/text.js';
15
- /**
16
- * This module provides utility functions for working with image blocks
17
- * in TypeScript.
18
- *
19
- * @since 0.0.6
20
- */
21
- export * as ImageBlock from './core/blocks/image.js';
22
15
  //# sourceMappingURL=blocks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC"}
@@ -4,10 +4,10 @@
4
4
  *
5
5
  * @since 0.0.6
6
6
  */
7
- import type { CreateRelationOp, SetTripleOp } from '../types.js';
7
+ import type { Op } from '../types.js';
8
8
  type MakeAccountReturnType = {
9
9
  accountId: string;
10
- ops: [CreateRelationOp, CreateRelationOp, SetTripleOp, SetTripleOp];
10
+ ops: Op[];
11
11
  };
12
12
  /**
13
13
  * Returns the ops to create an entity representing an Account.
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/core/account.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAKjE,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;CACrE,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CA4C3D"}
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/core/account.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAKtC,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,EAAE,EAAE,CAAC;CACX,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAoC3D"}
@@ -4,8 +4,9 @@
4
4
  *
5
5
  * @since 0.0.6
6
6
  */
7
+ import { createEntity } from '../graph/create-entity.js';
8
+ import { createRelation } from '../graph/create-relation.js';
7
9
  import { generate } from '../id.js';
8
- import { Relation } from '../relation.js';
9
10
  import { getChecksumAddress } from './get-checksum-address.js';
10
11
  import { ETHEREUM } from './ids/network.js';
11
12
  import { ACCOUNT_TYPE, ADDRESS_PROPERTY, NAME_PROPERTY, NETWORK_PROPERTY, TYPES_PROPERTY } from './ids/system.js';
@@ -26,45 +27,33 @@ import { ACCOUNT_TYPE, ADDRESS_PROPERTY, NAME_PROPERTY, NETWORK_PROPERTY, TYPES_
26
27
  export function make(address) {
27
28
  const accountId = generate();
28
29
  const checkedAddress = getChecksumAddress(address);
30
+ const ops = [];
31
+ const { ops: entityOps } = createEntity({
32
+ id: accountId,
33
+ values: {
34
+ [ADDRESS_PROPERTY]: { value: checkedAddress },
35
+ [NAME_PROPERTY]: { value: checkedAddress },
36
+ },
37
+ });
38
+ ops.push(...entityOps);
39
+ // Types -> Account
40
+ const { ops: accountOps } = createRelation({
41
+ fromEntity: accountId,
42
+ type: TYPES_PROPERTY,
43
+ toEntity: ACCOUNT_TYPE,
44
+ });
45
+ ops.push(...accountOps);
46
+ // Network -> Ethereum
47
+ // Signals that the account is for the Ethereum family of chains
48
+ const { ops: networkOps } = createRelation({
49
+ fromEntity: accountId,
50
+ type: NETWORK_PROPERTY,
51
+ toEntity: ETHEREUM,
52
+ });
53
+ ops.push(...networkOps);
29
54
  return {
30
55
  accountId,
31
- ops: [
32
- // Types -> Account
33
- Relation.make({
34
- fromId: accountId,
35
- relationTypeId: TYPES_PROPERTY,
36
- toId: ACCOUNT_TYPE,
37
- }),
38
- // Network -> Ethereum
39
- // Signals that the account is for the Ethereum family of chains
40
- Relation.make({
41
- fromId: accountId,
42
- relationTypeId: NETWORK_PROPERTY,
43
- toId: ETHEREUM,
44
- }),
45
- {
46
- type: 'SET_TRIPLE',
47
- triple: {
48
- entity: accountId,
49
- attribute: ADDRESS_PROPERTY,
50
- value: {
51
- type: 'TEXT',
52
- value: checkedAddress,
53
- },
54
- },
55
- },
56
- {
57
- type: 'SET_TRIPLE',
58
- triple: {
59
- entity: accountId,
60
- attribute: NAME_PROPERTY,
61
- value: {
62
- type: 'TEXT',
63
- value: checkedAddress,
64
- },
65
- },
66
- },
67
- ],
56
+ ops,
68
57
  };
69
58
  }
70
59
  //# sourceMappingURL=account.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/core/account.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOlH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,IAAI,CAAC,OAAe;IAClC,MAAM,SAAS,GAAG,QA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iBAAiB,CAAC;AAOlH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,IAAI,CAAC,OAAe;IAClC,MAAM,SAAS,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAW,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAE3D,MAAM,GAAG,GAAS,EAAE,CAAC;IAErB,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,YAAY,CAAC;QACtC,EAAE,EAAE,SAAS;QACb,MAAM,EAAE;YACN,CAAC,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE;YAC7C,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE;SAC3C;KACF,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAEvB,mBAAmB;IACnB,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC;QACzC,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,YAAY;KACvB,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IAExB,sBAAsB;IACtB,gEAAgE;IAChE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC;QACzC,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IAExB,OAAO;QACL,SAAS;QACT,GAAG;KACJ,CAAC;AACJ,CAAC"}
@@ -1,25 +1,33 @@
1
1
  import { expect, it } from 'vitest';
2
+ import { Id, toBase64 } from '../id.js';
2
3
  import { NetworkIds, SystemIds } from '../system-ids.js';
3
4
  import { make } from './account.js';
4
5
  const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
5
6
  it('should generate ops for an account entity', () => {
6
7
  const { accountId, ops } = make(ZERO_ADDRESS);
7
- const [accountTypeOp, networkOp, addressOp, nameOp] = ops;
8
- expect(accountTypeOp.type).toBe('CREATE_RELATION');
9
- expect(accountTypeOp.relation.type).toBe(SystemIds.TYPES_PROPERTY);
10
- expect(accountTypeOp.relation.toEntity).toBe(SystemIds.ACCOUNT_TYPE);
11
- expect(accountTypeOp.relation.fromEntity).toBe(accountId);
12
- expect(networkOp.type).toBe('CREATE_RELATION');
13
- expect(networkOp.relation.type).toBe(SystemIds.NETWORK_PROPERTY);
14
- expect(networkOp.relation.toEntity).toBe(NetworkIds.ETHEREUM);
15
- expect(networkOp.relation.fromEntity).toBe(accountId);
16
- expect(addressOp.type).toBe('SET_TRIPLE');
17
- expect(addressOp.triple.attribute).toBe(SystemIds.ADDRESS_PROPERTY);
18
- expect(addressOp.triple.value.type).toBe('TEXT');
19
- expect(addressOp.triple.value.value).toBe(ZERO_ADDRESS);
20
- expect(nameOp.type).toBe('SET_TRIPLE');
21
- expect(nameOp.triple.attribute).toBe(SystemIds.NAME_PROPERTY);
22
- expect(nameOp.triple.value.type).toBe('TEXT');
23
- expect(nameOp.triple.value.value).toBe(ZERO_ADDRESS);
8
+ const [entityOp, accountTypeOp, networkOp] = ops;
9
+ expect(entityOp?.type).toBe('UPDATE_ENTITY');
10
+ if (entityOp?.type === 'UPDATE_ENTITY' && entityOp?.entity.values?.[0]) {
11
+ expect(entityOp.entity.values[0].propertyId).toBe(toBase64(SystemIds.ADDRESS_PROPERTY));
12
+ expect(entityOp.entity.values[0].value).toBe(ZERO_ADDRESS);
13
+ expect(entityOp.entity.id).toBe(toBase64(Id(accountId)));
14
+ }
15
+ if (entityOp?.type === 'UPDATE_ENTITY' && entityOp?.entity.values?.[1]) {
16
+ expect(entityOp.entity.values[1].propertyId).toBe(toBase64(SystemIds.NAME_PROPERTY));
17
+ expect(entityOp.entity.values[1].value).toBe(ZERO_ADDRESS);
18
+ expect(entityOp.entity.id).toBe(toBase64(Id(accountId)));
19
+ }
20
+ expect(accountTypeOp?.type).toBe('CREATE_RELATION');
21
+ if (accountTypeOp?.type === 'CREATE_RELATION') {
22
+ expect(accountTypeOp.relation.type).toBe(toBase64(SystemIds.TYPES_PROPERTY));
23
+ expect(accountTypeOp.relation.toEntity).toBe(toBase64(SystemIds.ACCOUNT_TYPE));
24
+ expect(accountTypeOp.relation.fromEntity).toBe(toBase64(Id(accountId)));
25
+ }
26
+ expect(networkOp?.type).toBe('CREATE_RELATION');
27
+ if (networkOp?.type === 'CREATE_RELATION') {
28
+ expect(networkOp.relation.type).toBe(toBase64(SystemIds.NETWORK_PROPERTY));
29
+ expect(networkOp.relation.toEntity).toBe(toBase64(NetworkIds.ETHEREUM));
30
+ expect(networkOp.relation.fromEntity).toBe(toBase64(Id(accountId)));
31
+ }
24
32
  });
25
33
  //# sourceMappingURL=account.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.test.js","sourceRoot":"","sources":["../../../src/core/account.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,YAAY,GAAG,4CAA4C,CAAC;AAElE,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACnD,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,MAAM,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC;IAE1D,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACnD,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACnE,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AS,EAAE,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC1C,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC3E,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @since 0.0.6
6
6
  */
7
- import type { CreateRelationOp, SetTripleOp } from '../../types.js';
7
+ import type { Op } from '../../types.js';
8
8
  type DataBlockSourceType = 'QUERY' | 'COLLECTION' | 'GEO';
9
9
  type DataBlockParams = {
10
10
  fromId: string;
@@ -29,6 +29,6 @@ type DataBlockParams = {
29
29
  * @param param args {@link TextBlockParams}
30
30
  * @returns ops – The ops for the Data Block entity: {@link Op}[]
31
31
  */
32
- export declare function make({ fromId, sourceType, position, name }: DataBlockParams): (SetTripleOp | CreateRelationOp)[];
32
+ export declare function make({ fromId, sourceType, position, name }: DataBlockParams): Op[];
33
33
  export {};
34
34
  //# sourceMappingURL=data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/core/blocks/data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEpE,KAAK,mBAAmB,GAAG,OAAO,GAAG,YAAY,GAAG,KAAK,CAAC;AAa1D,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,CAAC,WAAW,GAAG,gBAAgB,CAAC,EAAE,CAuChH"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/core/blocks/data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAGzC,KAAK,mBAAmB,GAAG,OAAO,GAAG,YAAY,GAAG,KAAK,CAAC;AAa1D,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,EAAE,EAAE,CAqClF"}