@graphprotocol/grc-20 0.31.0 → 0.32.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 (363) hide show
  1. package/README.md +4 -0
  2. package/dist/constants.d.ts +7 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/constants.js +8 -0
  5. package/dist/constants.js.map +1 -0
  6. package/dist/convert-ids.d.ts +2 -0
  7. package/dist/convert-ids.d.ts.map +1 -0
  8. package/dist/convert-ids.js +42 -0
  9. package/dist/convert-ids.js.map +1 -0
  10. package/dist/examples/ranks/create-ordinal-rank.js +4 -4
  11. package/dist/examples/ranks/create-ordinal-rank.js.map +1 -1
  12. package/dist/examples/ranks/create-weighted-rank.js +4 -4
  13. package/dist/examples/ranks/create-weighted-rank.js.map +1 -1
  14. package/dist/proto.d.ts +4 -8
  15. package/dist/proto.d.ts.map +1 -1
  16. package/dist/proto.js +4 -8
  17. package/dist/proto.js.map +1 -1
  18. package/dist/protov2.d.ts +11 -0
  19. package/dist/protov2.d.ts.map +1 -0
  20. package/dist/protov2.js +11 -0
  21. package/dist/protov2.js.map +1 -0
  22. package/dist/scripts/setup-rank-types.d.ts +2 -2
  23. package/dist/scripts/setup-rank-types.d.ts.map +1 -1
  24. package/dist/scripts/setup-rank-types.js.map +1 -1
  25. package/dist/src/codec/convert.d.ts +18 -0
  26. package/dist/src/codec/convert.d.ts.map +1 -0
  27. package/dist/src/codec/convert.js +188 -0
  28. package/dist/src/codec/convert.js.map +1 -0
  29. package/dist/src/core/account.d.ts +2 -2
  30. package/dist/src/core/account.d.ts.map +1 -1
  31. package/dist/src/core/account.js +2 -0
  32. package/dist/src/core/account.js.map +1 -1
  33. package/dist/src/core/account.test.js +69 -22
  34. package/dist/src/core/account.test.js.map +1 -1
  35. package/dist/src/core/blocks/data.d.ts +3 -3
  36. package/dist/src/core/blocks/data.d.ts.map +1 -1
  37. package/dist/src/core/blocks/data.js +2 -1
  38. package/dist/src/core/blocks/data.js.map +1 -1
  39. package/dist/src/core/blocks/data.test.js +74 -36
  40. package/dist/src/core/blocks/data.test.js.map +1 -1
  41. package/dist/src/core/blocks/image.d.ts +15 -0
  42. package/dist/src/core/blocks/image.d.ts.map +1 -0
  43. package/dist/src/core/blocks/image.js +15 -0
  44. package/dist/src/core/blocks/image.js.map +1 -0
  45. package/dist/src/core/blocks/text.d.ts +3 -3
  46. package/dist/src/core/blocks/text.d.ts.map +1 -1
  47. package/dist/src/core/blocks/text.js +2 -1
  48. package/dist/src/core/blocks/text.js.map +1 -1
  49. package/dist/src/core/blocks/text.test.js +79 -15
  50. package/dist/src/core/blocks/text.test.js.map +1 -1
  51. package/dist/src/core/idsv2/content.d.ts +59 -0
  52. package/dist/src/core/idsv2/content.d.ts.map +1 -0
  53. package/dist/src/core/idsv2/content.js +59 -0
  54. package/dist/src/core/idsv2/content.js.map +1 -0
  55. package/dist/src/core/idsv2/network.d.ts +5 -0
  56. package/dist/src/core/idsv2/network.d.ts.map +1 -0
  57. package/dist/src/core/idsv2/network.js +5 -0
  58. package/dist/src/core/idsv2/network.js.map +1 -0
  59. package/dist/src/core/idsv2/system.d.ts +222 -0
  60. package/dist/src/core/idsv2/system.d.ts.map +1 -0
  61. package/dist/src/core/idsv2/system.js +230 -0
  62. package/dist/src/core/idsv2/system.js.map +1 -0
  63. package/dist/src/core/image.d.ts +40 -0
  64. package/dist/src/core/image.d.ts.map +1 -0
  65. package/dist/src/core/image.js +76 -0
  66. package/dist/src/core/image.js.map +1 -0
  67. package/dist/src/core/image.test.d.ts +2 -0
  68. package/dist/src/core/image.test.d.ts.map +1 -0
  69. package/dist/src/core/image.test.js +52 -0
  70. package/dist/src/core/image.test.js.map +1 -0
  71. package/dist/src/core/relation.d.ts +88 -0
  72. package/dist/src/core/relation.d.ts.map +1 -0
  73. package/dist/src/core/relation.js +89 -0
  74. package/dist/src/core/relation.js.map +1 -0
  75. package/dist/src/core/relation.test.d.ts +2 -0
  76. package/dist/src/core/relation.test.d.ts.map +1 -0
  77. package/dist/src/core/relation.test.js +45 -0
  78. package/dist/src/core/relation.test.js.map +1 -0
  79. package/dist/src/core/triple.d.ts +50 -0
  80. package/dist/src/core/triple.d.ts.map +1 -0
  81. package/dist/src/core/triple.js +56 -0
  82. package/dist/src/core/triple.js.map +1 -0
  83. package/dist/src/core/triple.test.d.ts +2 -0
  84. package/dist/src/core/triple.test.d.ts.map +1 -0
  85. package/dist/src/core/triple.test.js +37 -0
  86. package/dist/src/core/triple.test.js.map +1 -0
  87. package/dist/src/encoding.d.ts +2 -1
  88. package/dist/src/encoding.d.ts.map +1 -1
  89. package/dist/src/encoding.js +2 -2
  90. package/dist/src/encoding.js.map +1 -1
  91. package/dist/src/encoding.test.d.ts +2 -0
  92. package/dist/src/encoding.test.d.ts.map +1 -0
  93. package/dist/src/encoding.test.js +644 -0
  94. package/dist/src/encoding.test.js.map +1 -0
  95. package/dist/src/encodings/get-register-space-calldata.d.ts +32 -0
  96. package/dist/src/encodings/get-register-space-calldata.d.ts.map +1 -0
  97. package/dist/src/encodings/get-register-space-calldata.js +39 -0
  98. package/dist/src/encodings/get-register-space-calldata.js.map +1 -0
  99. package/dist/src/encodings/get-register-space-calldata.test.d.ts +2 -0
  100. package/dist/src/encodings/get-register-space-calldata.test.d.ts.map +1 -0
  101. package/dist/src/encodings/get-register-space-calldata.test.js +15 -0
  102. package/dist/src/encodings/get-register-space-calldata.test.js.map +1 -0
  103. package/dist/src/full-flow-test.test.js +125 -37
  104. package/dist/src/full-flow-test.test.js.map +1 -1
  105. package/dist/src/graph/constants.d.ts +4 -0
  106. package/dist/src/graph/constants.d.ts.map +1 -1
  107. package/dist/src/graph/constants.js +14 -0
  108. package/dist/src/graph/constants.js.map +1 -1
  109. package/dist/src/graph/create-entity.d.ts +0 -1
  110. package/dist/src/graph/create-entity.d.ts.map +1 -1
  111. package/dist/src/graph/create-entity.js +155 -111
  112. package/dist/src/graph/create-entity.js.map +1 -1
  113. package/dist/src/graph/create-entity.test.js +339 -206
  114. package/dist/src/graph/create-entity.test.js.map +1 -1
  115. package/dist/src/graph/create-image.d.ts.map +1 -1
  116. package/dist/src/graph/create-image.js +15 -14
  117. package/dist/src/graph/create-image.js.map +1 -1
  118. package/dist/src/graph/create-image.test.js +109 -50
  119. package/dist/src/graph/create-image.test.js.map +1 -1
  120. package/dist/src/graph/create-property.d.ts.map +1 -1
  121. package/dist/src/graph/create-property.js +10 -19
  122. package/dist/src/graph/create-property.js.map +1 -1
  123. package/dist/src/graph/create-property.test.js +129 -19
  124. package/dist/src/graph/create-property.test.js.map +1 -1
  125. package/dist/src/graph/create-relation.d.ts +1 -3
  126. package/dist/src/graph/create-relation.d.ts.map +1 -1
  127. package/dist/src/graph/create-relation.js +21 -37
  128. package/dist/src/graph/create-relation.js.map +1 -1
  129. package/dist/src/graph/create-relation.test.js +186 -200
  130. package/dist/src/graph/create-relation.test.js.map +1 -1
  131. package/dist/src/graph/create-space.d.ts +4 -3
  132. package/dist/src/graph/create-space.d.ts.map +1 -1
  133. package/dist/src/graph/create-space.js +2 -2
  134. package/dist/src/graph/create-space.js.map +1 -1
  135. package/dist/src/graph/create-type.d.ts.map +1 -1
  136. package/dist/src/graph/create-type.js +16 -21
  137. package/dist/src/graph/create-type.js.map +1 -1
  138. package/dist/src/graph/create-type.test.js +76 -67
  139. package/dist/src/graph/create-type.test.js.map +1 -1
  140. package/dist/src/graph/delete-entity.d.ts +14 -0
  141. package/dist/src/graph/delete-entity.d.ts.map +1 -0
  142. package/dist/src/graph/delete-entity.js +21 -0
  143. package/dist/src/graph/delete-entity.js.map +1 -0
  144. package/dist/src/graph/delete-entity.test.d.ts +2 -0
  145. package/dist/src/graph/delete-entity.test.d.ts.map +1 -0
  146. package/dist/src/graph/delete-entity.test.js +23 -0
  147. package/dist/src/graph/delete-entity.test.js.map +1 -0
  148. package/dist/src/graph/delete-relation.d.ts.map +1 -1
  149. package/dist/src/graph/delete-relation.js +3 -6
  150. package/dist/src/graph/delete-relation.js.map +1 -1
  151. package/dist/src/graph/delete-relation.test.js +6 -8
  152. package/dist/src/graph/delete-relation.test.js.map +1 -1
  153. package/dist/src/graph/graph.test.d.ts +2 -0
  154. package/dist/src/graph/graph.test.d.ts.map +1 -0
  155. package/dist/src/graph/graph.test.js +46 -0
  156. package/dist/src/graph/graph.test.js.map +1 -0
  157. package/dist/src/graph/helpers/create-default-properties.d.ts +5 -0
  158. package/dist/src/graph/helpers/create-default-properties.d.ts.map +1 -0
  159. package/dist/src/graph/helpers/create-default-properties.js +44 -0
  160. package/dist/src/graph/helpers/create-default-properties.js.map +1 -0
  161. package/dist/src/graph/helpers/create-properties.d.ts +8 -0
  162. package/dist/src/graph/helpers/create-properties.d.ts.map +1 -0
  163. package/dist/src/graph/helpers/create-properties.js +53 -0
  164. package/dist/src/graph/helpers/create-properties.js.map +1 -0
  165. package/dist/src/graph/index.d.ts +1 -4
  166. package/dist/src/graph/index.d.ts.map +1 -1
  167. package/dist/src/graph/index.js +1 -4
  168. package/dist/src/graph/index.js.map +1 -1
  169. package/dist/src/graph/update-entity.d.ts.map +1 -1
  170. package/dist/src/graph/update-entity.js +109 -57
  171. package/dist/src/graph/update-entity.js.map +1 -1
  172. package/dist/src/graph/update-entity.test.js +167 -40
  173. package/dist/src/graph/update-entity.test.js.map +1 -1
  174. package/dist/src/graph/update-relation.d.ts +1 -2
  175. package/dist/src/graph/update-relation.d.ts.map +1 -1
  176. package/dist/src/graph/update-relation.js +12 -16
  177. package/dist/src/graph/update-relation.js.map +1 -1
  178. package/dist/src/graph/update-relation.test.js +75 -109
  179. package/dist/src/graph/update-relation.test.js.map +1 -1
  180. package/dist/src/graphv2/constants.d.ts +2 -0
  181. package/dist/src/graphv2/constants.d.ts.map +1 -0
  182. package/dist/src/graphv2/constants.js +2 -0
  183. package/dist/src/graphv2/constants.js.map +1 -0
  184. package/dist/src/graphv2/create-entity.d.ts +52 -0
  185. package/dist/src/graphv2/create-entity.d.ts.map +1 -0
  186. package/dist/src/graphv2/create-entity.js +140 -0
  187. package/dist/src/graphv2/create-entity.js.map +1 -0
  188. package/dist/src/graphv2/create-entity.test.d.ts +2 -0
  189. package/dist/src/graphv2/create-entity.test.d.ts.map +1 -0
  190. package/dist/src/graphv2/create-entity.test.js +158 -0
  191. package/dist/src/graphv2/create-entity.test.js.map +1 -0
  192. package/dist/src/graphv2/create-image.d.ts +28 -0
  193. package/dist/src/graphv2/create-image.d.ts.map +1 -0
  194. package/dist/src/graphv2/create-image.js +71 -0
  195. package/dist/src/graphv2/create-image.js.map +1 -0
  196. package/dist/src/graphv2/create-image.test.d.ts +2 -0
  197. package/dist/src/graphv2/create-image.test.d.ts.map +1 -0
  198. package/dist/src/graphv2/create-image.test.js +142 -0
  199. package/dist/src/graphv2/create-image.test.js.map +1 -0
  200. package/dist/src/graphv2/create-property.d.ts +22 -0
  201. package/dist/src/graphv2/create-property.d.ts.map +1 -0
  202. package/dist/src/graphv2/create-property.js +129 -0
  203. package/dist/src/graphv2/create-property.js.map +1 -0
  204. package/dist/src/graphv2/create-property.test.d.ts +2 -0
  205. package/dist/src/graphv2/create-property.test.d.ts.map +1 -0
  206. package/dist/src/graphv2/create-property.test.js +82 -0
  207. package/dist/src/graphv2/create-property.test.js.map +1 -0
  208. package/dist/src/graphv2/create-relation.d.ts +33 -0
  209. package/dist/src/graphv2/create-relation.d.ts.map +1 -0
  210. package/dist/src/graphv2/create-relation.js +66 -0
  211. package/dist/src/graphv2/create-relation.js.map +1 -0
  212. package/dist/src/graphv2/create-relation.test.d.ts +2 -0
  213. package/dist/src/graphv2/create-relation.test.d.ts.map +1 -0
  214. package/dist/src/graphv2/create-relation.test.js +208 -0
  215. package/dist/src/graphv2/create-relation.test.js.map +1 -0
  216. package/dist/src/graphv2/create-space.d.ts +13 -0
  217. package/dist/src/graphv2/create-space.d.ts.map +1 -0
  218. package/dist/src/graphv2/create-space.js +21 -0
  219. package/dist/src/graphv2/create-space.js.map +1 -0
  220. package/dist/src/graphv2/create-type.d.ts +22 -0
  221. package/dist/src/graphv2/create-type.d.ts.map +1 -0
  222. package/dist/src/graphv2/create-type.js +64 -0
  223. package/dist/src/graphv2/create-type.js.map +1 -0
  224. package/dist/src/graphv2/create-type.test.d.ts +2 -0
  225. package/dist/src/graphv2/create-type.test.d.ts.map +1 -0
  226. package/dist/src/graphv2/create-type.test.js +109 -0
  227. package/dist/src/graphv2/create-type.test.js.map +1 -0
  228. package/dist/src/graphv2/delete-entity.d.ts +14 -0
  229. package/dist/src/graphv2/delete-entity.d.ts.map +1 -0
  230. package/dist/src/graphv2/delete-entity.js +21 -0
  231. package/dist/src/graphv2/delete-entity.js.map +1 -0
  232. package/dist/src/graphv2/delete-entity.test.d.ts +2 -0
  233. package/dist/src/graphv2/delete-entity.test.d.ts.map +1 -0
  234. package/dist/src/graphv2/delete-entity.test.js +24 -0
  235. package/dist/src/graphv2/delete-entity.test.js.map +1 -0
  236. package/dist/src/graphv2/delete-relation.d.ts +14 -0
  237. package/dist/src/graphv2/delete-relation.d.ts.map +1 -0
  238. package/dist/src/graphv2/delete-relation.js +21 -0
  239. package/dist/src/graphv2/delete-relation.js.map +1 -0
  240. package/dist/src/graphv2/delete-relation.test.d.ts +2 -0
  241. package/dist/src/graphv2/delete-relation.test.d.ts.map +1 -0
  242. package/dist/src/graphv2/delete-relation.test.js +24 -0
  243. package/dist/src/graphv2/delete-relation.test.js.map +1 -0
  244. package/dist/src/graphv2/index.d.ts +12 -0
  245. package/dist/src/graphv2/index.d.ts.map +1 -0
  246. package/dist/src/graphv2/index.js +12 -0
  247. package/dist/src/graphv2/index.js.map +1 -0
  248. package/dist/src/graphv2/remove-entity-properties.d.ts +25 -0
  249. package/dist/src/graphv2/remove-entity-properties.d.ts.map +1 -0
  250. package/dist/src/graphv2/remove-entity-properties.js +24 -0
  251. package/dist/src/graphv2/remove-entity-properties.js.map +1 -0
  252. package/dist/src/graphv2/unset-entity-values.d.ts +21 -0
  253. package/dist/src/graphv2/unset-entity-values.d.ts.map +1 -0
  254. package/dist/src/graphv2/unset-entity-values.js +26 -0
  255. package/dist/src/graphv2/unset-entity-values.js.map +1 -0
  256. package/dist/src/graphv2/unset-entity-values.test.d.ts +2 -0
  257. package/dist/src/graphv2/unset-entity-values.test.d.ts.map +1 -0
  258. package/dist/src/graphv2/unset-entity-values.test.js +40 -0
  259. package/dist/src/graphv2/unset-entity-values.test.js.map +1 -0
  260. package/dist/src/graphv2/unset-relation-fields.d.ts +25 -0
  261. package/dist/src/graphv2/unset-relation-fields.d.ts.map +1 -0
  262. package/dist/src/graphv2/unset-relation-fields.js +34 -0
  263. package/dist/src/graphv2/unset-relation-fields.js.map +1 -0
  264. package/dist/src/graphv2/unset-relation-fields.test.d.ts +2 -0
  265. package/dist/src/graphv2/unset-relation-fields.test.d.ts.map +1 -0
  266. package/dist/src/graphv2/unset-relation-fields.test.js +64 -0
  267. package/dist/src/graphv2/unset-relation-fields.test.js.map +1 -0
  268. package/dist/src/graphv2/update-entity.d.ts +28 -0
  269. package/dist/src/graphv2/update-entity.d.ts.map +1 -0
  270. package/dist/src/graphv2/update-entity.js +73 -0
  271. package/dist/src/graphv2/update-entity.js.map +1 -0
  272. package/dist/src/graphv2/update-entity.test.d.ts +2 -0
  273. package/dist/src/graphv2/update-entity.test.d.ts.map +1 -0
  274. package/dist/src/graphv2/update-entity.test.js +116 -0
  275. package/dist/src/graphv2/update-entity.test.js.map +1 -0
  276. package/dist/src/graphv2/update-relation.d.ts +21 -0
  277. package/dist/src/graphv2/update-relation.d.ts.map +1 -0
  278. package/dist/src/graphv2/update-relation.js +37 -0
  279. package/dist/src/graphv2/update-relation.js.map +1 -0
  280. package/dist/src/id-utils.d.ts +6 -0
  281. package/dist/src/id-utils.d.ts.map +1 -1
  282. package/dist/src/id-utils.js +13 -0
  283. package/dist/src/id-utils.js.map +1 -1
  284. package/dist/src/idv2.d.ts +27 -0
  285. package/dist/src/idv2.d.ts.map +1 -0
  286. package/dist/src/idv2.js +88 -0
  287. package/dist/src/idv2.js.map +1 -0
  288. package/dist/src/idv2.test.d.ts +2 -0
  289. package/dist/src/idv2.test.d.ts.map +1 -0
  290. package/dist/src/idv2.test.js +26 -0
  291. package/dist/src/idv2.test.js.map +1 -0
  292. package/dist/src/image.d.ts +8 -0
  293. package/dist/src/image.d.ts.map +1 -0
  294. package/dist/src/image.js +8 -0
  295. package/dist/src/image.js.map +1 -0
  296. package/dist/src/ipfs.d.ts +7 -6
  297. package/dist/src/ipfs.d.ts.map +1 -1
  298. package/dist/src/ipfs.js +31 -11
  299. package/dist/src/ipfs.js.map +1 -1
  300. package/dist/src/ipfs.test.js +130 -17
  301. package/dist/src/ipfs.test.js.map +1 -1
  302. package/dist/src/ipfsv2.d.ts +96 -0
  303. package/dist/src/ipfsv2.d.ts.map +1 -0
  304. package/dist/src/ipfsv2.js +163 -0
  305. package/dist/src/ipfsv2.js.map +1 -0
  306. package/dist/src/ipfsv2.test.d.ts +2 -0
  307. package/dist/src/ipfsv2.test.d.ts.map +1 -0
  308. package/dist/src/ipfsv2.test.js +22 -0
  309. package/dist/src/ipfsv2.test.js.map +1 -0
  310. package/dist/src/proto/editv2.d.ts +11 -0
  311. package/dist/src/proto/editv2.d.ts.map +1 -0
  312. package/dist/src/proto/editv2.js +81 -0
  313. package/dist/src/proto/editv2.js.map +1 -0
  314. package/dist/src/proto/editv2.test.d.ts +2 -0
  315. package/dist/src/proto/editv2.test.d.ts.map +1 -0
  316. package/dist/src/proto/editv2.test.js +211 -0
  317. package/dist/src/proto/editv2.test.js.map +1 -0
  318. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts +410 -0
  319. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts.map +1 -0
  320. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js +536 -0
  321. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js.map +1 -0
  322. package/dist/src/proto/index.d.ts +7 -1
  323. package/dist/src/proto/index.d.ts.map +1 -1
  324. package/dist/src/proto/index.js +6 -1
  325. package/dist/src/proto/index.js.map +1 -1
  326. package/dist/src/ranks/create-rank.d.ts.map +1 -1
  327. package/dist/src/ranks/create-rank.js +54 -47
  328. package/dist/src/ranks/create-rank.js.map +1 -1
  329. package/dist/src/ranks/create-rank.test.js +181 -94
  330. package/dist/src/ranks/create-rank.test.js.map +1 -1
  331. package/dist/src/relation.d.ts +7 -0
  332. package/dist/src/relation.d.ts.map +1 -0
  333. package/dist/src/relation.js +7 -0
  334. package/dist/src/relation.js.map +1 -0
  335. package/dist/src/smart-wallet-2.test-invalid.d.ts +2 -0
  336. package/dist/src/smart-wallet-2.test-invalid.d.ts.map +1 -0
  337. package/dist/src/smart-wallet-2.test-invalid.js +49 -0
  338. package/dist/src/smart-wallet-2.test-invalid.js.map +1 -0
  339. package/dist/src/smart-wallet-2.test.d.ts +2 -0
  340. package/dist/src/smart-wallet-2.test.d.ts.map +1 -0
  341. package/dist/src/smart-wallet-2.test.js +49 -0
  342. package/dist/src/smart-wallet-2.test.js.map +1 -0
  343. package/dist/src/system-ids-v2.d.ts +7 -0
  344. package/dist/src/system-ids-v2.d.ts.map +1 -0
  345. package/dist/src/system-ids-v2.js +7 -0
  346. package/dist/src/system-ids-v2.js.map +1 -0
  347. package/dist/src/triple.d.ts +7 -0
  348. package/dist/src/triple.d.ts.map +1 -0
  349. package/dist/src/triple.js +7 -0
  350. package/dist/src/triple.js.map +1 -0
  351. package/dist/src/types-backup.d.ts +134 -0
  352. package/dist/src/types-backup.d.ts.map +1 -0
  353. package/dist/src/types-backup.js +13 -0
  354. package/dist/src/types-backup.js.map +1 -0
  355. package/dist/src/types.d.ts +52 -89
  356. package/dist/src/types.d.ts.map +1 -1
  357. package/dist/src/types.js.map +1 -1
  358. package/dist/src/typesv2.d.ts +173 -0
  359. package/dist/src/typesv2.d.ts.map +1 -0
  360. package/dist/src/typesv2.js +8 -0
  361. package/dist/src/typesv2.js.map +1 -0
  362. package/dist/tsconfig.tsbuildinfo +1 -0
  363. package/package.json +2 -5
package/README.md CHANGED
@@ -276,6 +276,7 @@ import { Graph } from '@graphprotocol/grc-20';
276
276
  const spaceId = 'space-id';
277
277
  const cid = 'ipfs://hash';
278
278
 
279
+ // IMPORTANT: this is outdated when working with the new contracts
279
280
  // This returns the correct contract address and calldata depending on the space id
280
281
  // You can also use Graph.MAINNET_API_ORIGIN for mainnet (currently not working)
281
282
  const result = await fetch(`${Graph.TESTNET_API_ORIGIN}/space/${spaceId}/edit/calldata`, {
@@ -358,6 +359,7 @@ import { Graph } from '@graphprotocol/grc-20';
358
359
  const editorAddress = '0x000000000000000000000000000000000000';
359
360
  const spaceName = 'Example-Name';
360
361
 
362
+ // IMPORTANT: this is outdated when working with the new contracts
361
363
  const spaceId = await Graph.createSpace({
362
364
  initialEditorAddress,
363
365
  spaceName,
@@ -385,6 +387,7 @@ console.log('addressPrivateKey', addressPrivateKey);
385
387
  console.log('address', address);
386
388
  // console.log('smartAccountWalletClient', smartAccountWalletClient);
387
389
 
390
+ // IMPORTANT: this is outdated when working with the new contracts
388
391
  const space = await Graph.createSpace({
389
392
  editorAddress: address,
390
393
  name: 'test',
@@ -408,6 +411,7 @@ const { cid } = await Ipfs.publishEdit({
408
411
 
409
412
  console.log('cid', cid);
410
413
 
414
+ // IMPORTANT: this is outdated when working with the new contracts
411
415
  const result = await fetch(`${Graph.TESTNET_API_ORIGIN}/space/${spaceId}/edit/calldata`, {
412
416
  method: 'POST',
413
417
  body: JSON.stringify({ cid }),
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This module provides common constants used in the knowledge graph.
3
+ *
4
+ * @since 0.0.6
5
+ */
6
+ export declare const INITIAL_RELATION_INDEX_VALUE: string;
7
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,4BAA4B,QAA8C,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This module provides common constants used in the knowledge graph.
3
+ *
4
+ * @since 0.0.6
5
+ */
6
+ import { Position, PositionRange } from './src/position.js';
7
+ export const INITIAL_RELATION_INDEX_VALUE = Position.createBetween(PositionRange.FIRST);
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,CAAC,MAAM,4BAA4B,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC"}
@@ -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,SAAS,GAAG,iEAAiE,CAAC;IACpF,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;IAE9D,wBAAwB;IACxB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAElD,uCAAuC;IACvC,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,CAAC,KAAa,EAAE,EAAU,EAAE,EAAE;QAC9F,IAAI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;YACrC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;YAChD,OAAO,OAAO,IAAI,IAAI,CAAC;QACzB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;YACzD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,6CAA6C;IAC7C,MAAM,SAAS,CAAC,QAAQ,EAAE,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"}
@@ -32,11 +32,11 @@ console.log('Vote entity IDs:', ordinalRankResult.voteIds);
32
32
  // The ops array contains all the operations needed to create this rank:
33
33
  console.log('\nOperations breakdown:');
34
34
  for (const op of ordinalRankResult.ops) {
35
- if (op.type === 'UPDATE_ENTITY') {
36
- console.log(` - UPDATE_ENTITY: ${op.entity.id}`);
35
+ if (op.type === 'createEntity') {
36
+ console.log(` - createEntity`);
37
37
  }
38
- else if (op.type === 'CREATE_RELATION') {
39
- console.log(` - CREATE_RELATION: ${op.relation.fromEntity} -> ${op.relation.toEntity}`);
38
+ else if (op.type === 'createRelation') {
39
+ console.log(` - createRelation`);
40
40
  }
41
41
  }
42
42
  //# sourceMappingURL=create-ordinal-rank.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-ordinal-rank.js","sourceRoot":"","sources":["../../../examples/ranks/create-ordinal-rank.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAEtD,uFAAuF;AACvF,uFAAuF;AACvF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AAEpC,gFAAgF;AAChF,qDAAqD;AACrD,gFAAgF;AAChF,uFAAuF;AACvF,qFAAqF;AAErF,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC;IACxC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE;QACL,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,YAAY;QACpC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,YAAY;QACpC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,YAAY;KACrC;CACF,CAAC,CAAC;AAEH,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAC5C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAC9C,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnE,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAE3D,wEAAwE;AACxE,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AACvC,KAAK,MAAM,EAAE,IAAI,iBAAiB,CAAC,G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E,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAC9C,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnE,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAE3D,wEAAwE;AACxE,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AACvC,KAAK,MAAM,EAAE,IAAI,iBAAiB,CAAC,GAAG,EAAE,CAAC;IACvC,IAAI,EAAE,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;SAAM,IAAI,EAAE,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
@@ -32,11 +32,11 @@ console.log('Vote entity IDs:', weightedRankResult.voteIds);
32
32
  // The ops array contains all the operations needed to create this rank:
33
33
  console.log('\nOperations breakdown:');
34
34
  for (const op of weightedRankResult.ops) {
35
- if (op.type === 'UPDATE_ENTITY') {
36
- console.log(` - UPDATE_ENTITY: ${op.entity.id}`);
35
+ if (op.type === 'createEntity') {
36
+ console.log(` - createEntity`);
37
37
  }
38
- else if (op.type === 'CREATE_RELATION') {
39
- console.log(` - CREATE_RELATION: ${op.relation.fromEntity} -> ${op.relation.toEntity}`);
38
+ else if (op.type === 'createRelation') {
39
+ console.log(` - createRelation`);
40
40
  }
41
41
  }
42
42
  //# sourceMappingURL=create-weighted-rank.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-weighted-rank.js","sourceRoot":"","sources":["../../../examples/ranks/create-weighted-rank.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAEtD,uFAAuF;AACvF,uFAAuF;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kB,CAAC,OAAO,CAAC,CAAC;AAE5D,wEAAwE;AACxE,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AACvC,KAAK,MAAM,EAAE,IAAI,kBAAkB,CAAC,GAAG,EAAE,CAAC;IACxC,IAAI,EAAE,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;SAAM,IAAI,EAAE,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
package/dist/proto.d.ts CHANGED
@@ -1,11 +1,7 @@
1
1
  /**
2
- * This module provides utility functions for working with the GRC-20 Edit
3
- * protobuf in TypeScript.
2
+ * This module provides encoding utilities for GRC-20 Edits.
3
+ *
4
+ * Note: As of this version, the encoding has migrated from protobuf to GRC-20 v2 binary format.
4
5
  */
5
- export * as EditProposal from './src/proto/edit.js';
6
- /**
7
- * This module provides utility functions for working with GRC-20 protobufs
8
- * in TypeScript.
9
- */
10
- export * from './src/proto/gen/src/proto/ipfs_pb.js';
6
+ export { decodeEdit, type Edit, type EncodeOptions, encodeEdit } from '@geoprotocol/grc-20';
11
7
  //# sourceMappingURL=proto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD;;;GAGG;AACH,cAAc,sCAAsC,CAAC"}
1
+ {"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,EAAE,KAAK,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/proto.js CHANGED
@@ -1,11 +1,7 @@
1
1
  /**
2
- * This module provides utility functions for working with the GRC-20 Edit
3
- * protobuf in TypeScript.
2
+ * This module provides encoding utilities for GRC-20 Edits.
3
+ *
4
+ * Note: As of this version, the encoding has migrated from protobuf to GRC-20 v2 binary format.
4
5
  */
5
- export * as EditProposal from './src/proto/edit.js';
6
- /**
7
- * This module provides utility functions for working with GRC-20 protobufs
8
- * in TypeScript.
9
- */
10
- export * from './src/proto/gen/src/proto/ipfs_pb.js';
6
+ export { decodeEdit, encodeEdit } from '@geoprotocol/grc-20';
11
7
  //# 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;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD;;;GAGG;AACH,cAAc,sCAAsC,CAAC"}
1
+ {"version":3,"file":"proto.js","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAiC,UAAU,EAAE,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"}
@@ -10,6 +10,6 @@
10
10
  *
11
11
  * Usage: import { ops } from './scripts/setup-rank-types.js'
12
12
  */
13
- import type { Op } from '../src/types.js';
14
- export declare const ops: Op[];
13
+ import type { Op as GrcOp } from '@geoprotocol/grc-20';
14
+ export declare const ops: GrcOp[];
15
15
  //# sourceMappingURL=setup-rank-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-rank-types.d.ts","sourceRoot":"","sources":["../../scripts/setup-rank-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAsD1C,eAAO,MAAM,GAAG,MAAwB,CAAC"}
1
+ {"version":3,"file":"setup-rank-types.d.ts","sourceRoot":"","sources":["../../scripts/setup-rank-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,KAAK,EAAE,MAAM,qBAAqB,CAAC;AA+DvD,eAAO,MAAM,GAAG,SAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"setup-rank-types.js","sourceRoot":"","sources":["../../scripts/setup-rank-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,iC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B;QAC/B,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,uDAAuD;QACpE,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAE1C,gFAAgF;IAChF,MAAM,yBAAyB,GAAG,cAAc,CAAC;QAC/C,EAAE,EAAE,4BAA4B;QAChC,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,yBAAyB,CAAC,GAAG,CAAC,CAAC;IAE3C,0DAA0D;IAC1D,MAAM,QAAQ,GAAG,UAAU,CAAC;QAC1B,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,0EAA0E;QACvF,UAAU,EAAE,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;KAC3D,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE1B,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,8BAA8B;AAC9B,MAAM,CAAC,MAAM,GAAG,GAAG,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Conversion layer between grc-20-ts ops and @geoprotocol/grc-20 ops.
3
+ *
4
+ * This module bridges the high-level grc-20-ts operation types to the
5
+ * low-level @geoprotocol/grc-20 types used for binary encoding.
6
+ */
7
+ import { type Id as GrcId, type Op as GrcOp } from '@geoprotocol/grc-20';
8
+ import type { Op } from '../types.js';
9
+ /**
10
+ * Converts an array of grc-20-ts Ops to @geoprotocol/grc-20 Ops.
11
+ */
12
+ export declare function convertOps(ops: Op[]): GrcOp[];
13
+ /**
14
+ * Converts a hex address string to a GrcId (Uint8Array).
15
+ * Used for converting author addresses.
16
+ */
17
+ export declare function hexToGrcId(hex: `0x${string}`): GrcId;
18
+ //# sourceMappingURL=convert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/codec/convert.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,EAAE,IAAI,KAAK,EAChB,KAAK,EAAE,IAAI,KAAK,EAUjB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,EAAE,EAAqB,MAAM,aAAa,CAAC;AAuKzD;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAE7C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,KAAK,CAcpD"}
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Conversion layer between grc-20-ts ops and @geoprotocol/grc-20 ops.
3
+ *
4
+ * This module bridges the high-level grc-20-ts operation types to the
5
+ * low-level @geoprotocol/grc-20 types used for binary encoding.
6
+ */
7
+ import { createId, } from '@geoprotocol/grc-20';
8
+ import { toBytes } from '../id-utils.js';
9
+ /**
10
+ * Converts a grc-20-ts Id (string) to @geoprotocol/grc-20 Id (Uint8Array).
11
+ */
12
+ function convertId(id) {
13
+ const bytes = toBytes(id);
14
+ return createId(bytes);
15
+ }
16
+ /**
17
+ * Converts a grc-20-ts TypedValue to @geoprotocol/grc-20 Value.
18
+ */
19
+ function convertTypedValue(v) {
20
+ switch (v.type) {
21
+ case 'bool':
22
+ return { type: 'bool', value: v.value };
23
+ case 'float64':
24
+ return {
25
+ type: 'float64',
26
+ value: v.value,
27
+ unit: v.unit ? convertId(v.unit) : undefined,
28
+ };
29
+ case 'text':
30
+ return {
31
+ type: 'text',
32
+ value: v.value,
33
+ language: v.language ? convertId(v.language) : undefined,
34
+ };
35
+ case 'point':
36
+ return {
37
+ type: 'point',
38
+ lon: v.lon,
39
+ lat: v.lat,
40
+ alt: v.alt,
41
+ };
42
+ case 'date':
43
+ return { type: 'date', value: v.value };
44
+ case 'time':
45
+ return { type: 'time', value: v.value };
46
+ case 'datetime':
47
+ return { type: 'datetime', value: v.value };
48
+ case 'schedule':
49
+ return { type: 'schedule', value: v.value };
50
+ default:
51
+ throw new Error(`Unsupported value type: ${v.type}`);
52
+ }
53
+ }
54
+ /**
55
+ * Converts a grc-20-ts Value to @geoprotocol/grc-20 PropertyValue.
56
+ */
57
+ function convertPropertyValue(v) {
58
+ // Extract property and build TypedValue from remaining fields
59
+ const { property, ...typedValue } = v;
60
+ return {
61
+ property: convertId(property),
62
+ value: convertTypedValue(typedValue),
63
+ };
64
+ }
65
+ /**
66
+ * Converts a single grc-20-ts Op to @geoprotocol/grc-20 Op.
67
+ */
68
+ function convertOp(op) {
69
+ switch (op.type) {
70
+ case 'UPDATE_ENTITY': {
71
+ // In grc-20-ts, UPDATE_ENTITY is used for both create and update
72
+ // In @geoprotocol/grc-20, we use createEntity for new entities
73
+ // Since we can't know if it's a new entity, we use createEntity
74
+ // which acts as an upsert in the spec
75
+ const createEntity = {
76
+ type: 'createEntity',
77
+ id: convertId(op.entity.id),
78
+ values: op.entity.values.map(convertPropertyValue),
79
+ };
80
+ return createEntity;
81
+ }
82
+ case 'CREATE_RELATION': {
83
+ const createRelation = {
84
+ type: 'createRelation',
85
+ id: convertId(op.relation.id),
86
+ relationType: convertId(op.relation.type),
87
+ from: convertId(op.relation.fromEntity),
88
+ to: convertId(op.relation.toEntity),
89
+ entity: op.relation.entity ? convertId(op.relation.entity) : undefined,
90
+ position: op.relation.position,
91
+ fromSpace: op.relation.fromSpace ? convertId(op.relation.fromSpace) : undefined,
92
+ fromVersion: op.relation.fromVersion ? convertId(op.relation.fromVersion) : undefined,
93
+ toSpace: op.relation.toSpace ? convertId(op.relation.toSpace) : undefined,
94
+ toVersion: op.relation.toVersion ? convertId(op.relation.toVersion) : undefined,
95
+ };
96
+ return createRelation;
97
+ }
98
+ case 'DELETE_RELATION': {
99
+ const deleteRelation = {
100
+ type: 'deleteRelation',
101
+ id: convertId(op.id),
102
+ };
103
+ return deleteRelation;
104
+ }
105
+ case 'UPDATE_RELATION': {
106
+ // Build unset array from boolean flags
107
+ const unset = [];
108
+ // Note: grc-20-ts doesn't have unset flags in UPDATE_RELATION,
109
+ // those are in UNSET_RELATION_FIELDS. So we pass empty unset array.
110
+ const updateRelation = {
111
+ type: 'updateRelation',
112
+ id: convertId(op.relation.id),
113
+ position: op.relation.position,
114
+ fromSpace: op.relation.fromSpace ? convertId(op.relation.fromSpace) : undefined,
115
+ fromVersion: op.relation.fromVersion ? convertId(op.relation.fromVersion) : undefined,
116
+ toSpace: op.relation.toSpace ? convertId(op.relation.toSpace) : undefined,
117
+ toVersion: op.relation.toVersion ? convertId(op.relation.toVersion) : undefined,
118
+ unset,
119
+ };
120
+ return updateRelation;
121
+ }
122
+ case 'UNSET_ENTITY_VALUES': {
123
+ // Convert to UpdateEntity with unset values
124
+ const unsetValues = op.unsetEntityValues.properties.map(propertyId => ({
125
+ property: convertId(propertyId),
126
+ language: { type: 'all' },
127
+ }));
128
+ const updateEntity = {
129
+ type: 'updateEntity',
130
+ id: convertId(op.unsetEntityValues.id),
131
+ set: [],
132
+ unset: unsetValues,
133
+ };
134
+ return updateEntity;
135
+ }
136
+ case 'UNSET_RELATION_FIELDS': {
137
+ const unset = [];
138
+ if (op.unsetRelationFields.fromSpace)
139
+ unset.push('fromSpace');
140
+ if (op.unsetRelationFields.fromVersion)
141
+ unset.push('fromVersion');
142
+ if (op.unsetRelationFields.toSpace)
143
+ unset.push('toSpace');
144
+ if (op.unsetRelationFields.toVersion)
145
+ unset.push('toVersion');
146
+ if (op.unsetRelationFields.position)
147
+ unset.push('position');
148
+ const updateRelation = {
149
+ type: 'updateRelation',
150
+ id: convertId(op.unsetRelationFields.id),
151
+ unset,
152
+ };
153
+ return updateRelation;
154
+ }
155
+ case 'CREATE_PROPERTY': {
156
+ // CREATE_PROPERTY is not directly supported in GRC-20 v2 as an op type
157
+ // Properties are implicitly created when used. We skip this op.
158
+ // For now, throw an error to make it explicit.
159
+ throw new Error('CREATE_PROPERTY is not supported in GRC-20 v2 binary format. Properties are created implicitly.');
160
+ }
161
+ default:
162
+ throw new Error(`Unknown op type: ${op.type}`);
163
+ }
164
+ }
165
+ /**
166
+ * Converts an array of grc-20-ts Ops to @geoprotocol/grc-20 Ops.
167
+ */
168
+ export function convertOps(ops) {
169
+ return ops.filter(op => op.type !== 'CREATE_PROPERTY').map(convertOp);
170
+ }
171
+ /**
172
+ * Converts a hex address string to a GrcId (Uint8Array).
173
+ * Used for converting author addresses.
174
+ */
175
+ export function hexToGrcId(hex) {
176
+ let hexString = hex;
177
+ if (hexString.startsWith('0x')) {
178
+ hexString = hexString.slice(2);
179
+ }
180
+ // Pad to 32 hex chars (16 bytes) if shorter
181
+ const paddedHex = hexString.padStart(32, '0');
182
+ const bytes = new Uint8Array(16);
183
+ for (let i = 0; i < 16; i++) {
184
+ bytes[i] = Number.parseInt(paddedHex.slice(i * 2, i * 2 + 2), 16);
185
+ }
186
+ return createId(bytes);
187
+ }
188
+ //# sourceMappingURL=convert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/codec/convert.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,QAAQ,GAYT,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC;;GAEG;AACH,SAAS,SAAS,CAAC,EAAe;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,EAAQ,CAAC,CAAC;IAChC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,CAAa;IACtC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAA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ACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC"}
@@ -4,10 +4,10 @@
4
4
  *
5
5
  * @since 0.0.6
6
6
  */
7
- import type { Op } from '../types.js';
7
+ import type { Op as GrcOp } from '@geoprotocol/grc-20';
8
8
  type MakeAccountReturnType = {
9
9
  accountId: string;
10
- ops: Op[];
10
+ ops: GrcOp[];
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;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,CA0C3D"}
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/core/account.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAQvD,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,KAAK,EAAE,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CA4C3D"}
@@ -33,10 +33,12 @@ export function make(address) {
33
33
  values: [
34
34
  {
35
35
  property: ADDRESS_PROPERTY,
36
+ type: 'text',
36
37
  value: checkedAddress,
37
38
  },
38
39
  {
39
40
  property: NAME_PROPERTY,
41
+ type: 'text',
40
42
  value: checkedAddress,
41
43
  },
42
44
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/core/account.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,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,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;gBACE,QAAQ,EAAE,gBAAgB;gBAC1B,KAAK,EAAE,cAAc;aACtB;YACD;gBACE,QAAQ,EAAE,aAAa;gBACvB,KAAK,EAAE,cAAc;aACtB;SACF;KACF,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAEvB,mBAAmB;IACnB,MAAM,EAAE,GA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