@graphprotocol/grc-20 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.md +153 -0
  2. package/dist/abis.d.ts +2 -0
  3. package/dist/abis.d.ts.map +1 -0
  4. package/dist/abis.js +2 -0
  5. package/dist/abis.js.map +1 -0
  6. package/dist/constants.d.ts +2 -0
  7. package/dist/constants.d.ts.map +1 -0
  8. package/dist/constants.js +3 -0
  9. package/dist/constants.js.map +1 -0
  10. package/dist/contracts.d.ts +7 -0
  11. package/dist/contracts.d.ts.map +1 -0
  12. package/dist/contracts.js +10 -0
  13. package/dist/contracts.js.map +1 -0
  14. package/dist/error.d.ts +2 -0
  15. package/dist/error.d.ts.map +1 -0
  16. package/dist/error.js +8 -0
  17. package/dist/error.js.map +1 -0
  18. package/dist/example.d.ts +2 -0
  19. package/dist/example.d.ts.map +1 -0
  20. package/dist/example.js +27 -0
  21. package/dist/example.js.map +1 -0
  22. package/dist/index.d.ts +14 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +14 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/proto.d.ts +3 -0
  27. package/dist/proto.d.ts.map +1 -0
  28. package/dist/proto.js +3 -0
  29. package/dist/proto.js.map +1 -0
  30. package/dist/run.d.ts +2 -0
  31. package/dist/run.d.ts.map +1 -0
  32. package/dist/run.js +4 -0
  33. package/dist/run.js.map +1 -0
  34. package/dist/src/abis/dao.d.ts +899 -0
  35. package/dist/src/abis/dao.d.ts.map +1 -0
  36. package/dist/src/abis/dao.js +1159 -0
  37. package/dist/src/abis/dao.js.map +1 -0
  38. package/dist/src/abis/governance-setup.d.ts +351 -0
  39. package/dist/src/abis/governance-setup.d.ts.map +1 -0
  40. package/dist/src/abis/governance-setup.js +461 -0
  41. package/dist/src/abis/governance-setup.js.map +1 -0
  42. package/dist/src/abis/index.d.ts +10 -0
  43. package/dist/src/abis/index.d.ts.map +1 -0
  44. package/dist/src/abis/index.js +10 -0
  45. package/dist/src/abis/index.js.map +1 -0
  46. package/dist/src/abis/main-voting.d.ts +1443 -0
  47. package/dist/src/abis/main-voting.d.ts.map +1 -0
  48. package/dist/src/abis/main-voting.js +1866 -0
  49. package/dist/src/abis/main-voting.js.map +1 -0
  50. package/dist/src/abis/member-access.d.ts +567 -0
  51. package/dist/src/abis/member-access.d.ts.map +1 -0
  52. package/dist/src/abis/member-access.js +735 -0
  53. package/dist/src/abis/member-access.js.map +1 -0
  54. package/dist/src/abis/personal-space-admin-setup.d.ts +259 -0
  55. package/dist/src/abis/personal-space-admin-setup.d.ts.map +1 -0
  56. package/dist/src/abis/personal-space-admin-setup.js +340 -0
  57. package/dist/src/abis/personal-space-admin-setup.js.map +1 -0
  58. package/dist/src/abis/personal-space-admin.d.ts +408 -0
  59. package/dist/src/abis/personal-space-admin.d.ts.map +1 -0
  60. package/dist/src/abis/personal-space-admin.js +526 -0
  61. package/dist/src/abis/personal-space-admin.js.map +1 -0
  62. package/dist/src/abis/plugin-setup-processor.d.ts +998 -0
  63. package/dist/src/abis/plugin-setup-processor.d.ts.map +1 -0
  64. package/dist/src/abis/plugin-setup-processor.js +1293 -0
  65. package/dist/src/abis/plugin-setup-processor.js.map +1 -0
  66. package/dist/src/abis/space-setup.d.ts +294 -0
  67. package/dist/src/abis/space-setup.d.ts.map +1 -0
  68. package/dist/src/abis/space-setup.js +387 -0
  69. package/dist/src/abis/space-setup.js.map +1 -0
  70. package/dist/src/abis/space.d.ts +263 -0
  71. package/dist/src/abis/space.d.ts.map +1 -0
  72. package/dist/src/abis/space.js +340 -0
  73. package/dist/src/abis/space.js.map +1 -0
  74. package/dist/src/account.d.ts +2 -0
  75. package/dist/src/account.d.ts.map +1 -0
  76. package/dist/src/account.js +2 -0
  77. package/dist/src/account.js.map +1 -0
  78. package/dist/src/base58.d.ts +36 -0
  79. package/dist/src/base58.d.ts.map +1 -0
  80. package/dist/src/base58.js +62 -0
  81. package/dist/src/base58.js.map +1 -0
  82. package/dist/src/base58.test.d.ts +2 -0
  83. package/dist/src/base58.test.d.ts.map +1 -0
  84. package/dist/src/base58.test.js +2 -0
  85. package/dist/src/base58.test.js.map +1 -0
  86. package/dist/src/blocks.d.ts +4 -0
  87. package/dist/src/blocks.d.ts.map +1 -0
  88. package/dist/src/blocks.js +4 -0
  89. package/dist/src/blocks.js.map +1 -0
  90. package/dist/src/core/account.d.ts +8 -0
  91. package/dist/src/core/account.d.ts.map +1 -0
  92. package/dist/src/core/account.js +50 -0
  93. package/dist/src/core/account.js.map +1 -0
  94. package/dist/src/core/base58.d.ts +37 -0
  95. package/dist/src/core/base58.d.ts.map +1 -0
  96. package/dist/src/core/base58.js +62 -0
  97. package/dist/src/core/base58.js.map +1 -0
  98. package/dist/src/core/base58.test.d.ts +2 -0
  99. package/dist/src/core/base58.test.d.ts.map +1 -0
  100. package/dist/src/core/base58.test.js +15 -0
  101. package/dist/src/core/base58.test.js.map +1 -0
  102. package/dist/src/core/blocks/data.d.ts +11 -0
  103. package/dist/src/core/blocks/data.d.ts.map +1 -0
  104. package/dist/src/core/blocks/data.js +48 -0
  105. package/dist/src/core/blocks/data.js.map +1 -0
  106. package/dist/src/core/blocks/image.d.ts +9 -0
  107. package/dist/src/core/blocks/image.d.ts.map +1 -0
  108. package/dist/src/core/blocks/image.js +9 -0
  109. package/dist/src/core/blocks/image.js.map +1 -0
  110. package/dist/src/core/blocks/text.d.ts +9 -0
  111. package/dist/src/core/blocks/text.d.ts.map +1 -0
  112. package/dist/src/core/blocks/text.js +30 -0
  113. package/dist/src/core/blocks/text.js.map +1 -0
  114. package/dist/src/core/get-checksum-address.d.ts +10 -0
  115. package/dist/src/core/get-checksum-address.d.ts.map +1 -0
  116. package/dist/src/core/get-checksum-address.js +20 -0
  117. package/dist/src/core/get-checksum-address.js.map +1 -0
  118. package/dist/src/core/ids/content.d.ts +59 -0
  119. package/dist/src/core/ids/content.d.ts.map +1 -0
  120. package/dist/src/core/ids/content.js +59 -0
  121. package/dist/src/core/ids/content.js.map +1 -0
  122. package/dist/src/core/ids/generate.d.ts +2 -0
  123. package/dist/src/core/ids/generate.d.ts.map +1 -0
  124. package/dist/src/core/ids/generate.js +4 -0
  125. package/dist/src/core/ids/generate.js.map +1 -0
  126. package/dist/src/core/ids/network.d.ts +4 -0
  127. package/dist/src/core/ids/network.d.ts.map +1 -0
  128. package/dist/src/core/ids/network.js +4 -0
  129. package/dist/src/core/ids/network.js.map +1 -0
  130. package/dist/src/core/ids/system.d.ts +212 -0
  131. package/dist/src/core/ids/system.d.ts.map +1 -0
  132. package/dist/src/core/ids/system.js +220 -0
  133. package/dist/src/core/ids/system.js.map +1 -0
  134. package/dist/src/core/image.d.ts +13 -0
  135. package/dist/src/core/image.d.ts.map +1 -0
  136. package/dist/src/core/image.js +33 -0
  137. package/dist/src/core/image.js.map +1 -0
  138. package/dist/src/core/position-strings/cursors.d.ts +56 -0
  139. package/dist/src/core/position-strings/cursors.d.ts.map +1 -0
  140. package/dist/src/core/position-strings/cursors.js +69 -0
  141. package/dist/src/core/position-strings/cursors.js.map +1 -0
  142. package/dist/src/core/position-strings/find-position.d.ts +24 -0
  143. package/dist/src/core/position-strings/find-position.d.ts.map +1 -0
  144. package/dist/src/core/position-strings/find-position.js +38 -0
  145. package/dist/src/core/position-strings/find-position.js.map +1 -0
  146. package/dist/src/core/position-strings/ids.d.ts +37 -0
  147. package/dist/src/core/position-strings/ids.d.ts.map +1 -0
  148. package/dist/src/core/position-strings/ids.js +79 -0
  149. package/dist/src/core/position-strings/ids.js.map +1 -0
  150. package/dist/src/core/position-strings/index.d.ts +5 -0
  151. package/dist/src/core/position-strings/index.d.ts.map +1 -0
  152. package/dist/src/core/position-strings/index.js +6 -0
  153. package/dist/src/core/position-strings/index.js.map +1 -0
  154. package/dist/src/core/position-strings/position-source.d.ts +128 -0
  155. package/dist/src/core/position-strings/position-source.d.ts.map +1 -0
  156. package/dist/src/core/position-strings/position-source.js +314 -0
  157. package/dist/src/core/position-strings/position-source.js.map +1 -0
  158. package/dist/src/core/position-strings/test/cursors.test.d.ts +2 -0
  159. package/dist/src/core/position-strings/test/cursors.test.d.ts.map +1 -0
  160. package/dist/src/core/position-strings/test/cursors.test.js +104 -0
  161. package/dist/src/core/position-strings/test/cursors.test.js.map +1 -0
  162. package/dist/src/core/position-strings/test/find-position.test.d.ts +2 -0
  163. package/dist/src/core/position-strings/test/find-position.test.d.ts.map +1 -0
  164. package/dist/src/core/position-strings/test/find-position.test.js +48 -0
  165. package/dist/src/core/position-strings/test/find-position.test.js.map +1 -0
  166. package/dist/src/core/position-strings/test/fuzz.test.d.ts +2 -0
  167. package/dist/src/core/position-strings/test/fuzz.test.d.ts.map +1 -0
  168. package/dist/src/core/position-strings/test/fuzz.test.js +78 -0
  169. package/dist/src/core/position-strings/test/fuzz.test.js.map +1 -0
  170. package/dist/src/core/position-strings/test/ids.test.d.ts +2 -0
  171. package/dist/src/core/position-strings/test/ids.test.d.ts.map +1 -0
  172. package/dist/src/core/position-strings/test/ids.test.js +17 -0
  173. package/dist/src/core/position-strings/test/ids.test.js.map +1 -0
  174. package/dist/src/core/position-strings/test/manual.test.d.ts +2 -0
  175. package/dist/src/core/position-strings/test/manual.test.d.ts.map +1 -0
  176. package/dist/src/core/position-strings/test/manual.test.js +307 -0
  177. package/dist/src/core/position-strings/test/manual.test.js.map +1 -0
  178. package/dist/src/core/position-strings/test/util.d.ts +6 -0
  179. package/dist/src/core/position-strings/test/util.d.ts.map +1 -0
  180. package/dist/src/core/position-strings/test/util.js +26 -0
  181. package/dist/src/core/position-strings/test/util.js.map +1 -0
  182. package/dist/src/core/position-strings/util.d.ts +8 -0
  183. package/dist/src/core/position-strings/util.d.ts.map +1 -0
  184. package/dist/src/core/position-strings/util.js +26 -0
  185. package/dist/src/core/position-strings/util.js.map +1 -0
  186. package/dist/src/core/position.d.ts +7 -0
  187. package/dist/src/core/position.d.ts.map +1 -0
  188. package/dist/src/core/position.js +7 -0
  189. package/dist/src/core/position.js.map +1 -0
  190. package/dist/src/core/relation.d.ts +30 -0
  191. package/dist/src/core/relation.d.ts.map +1 -0
  192. package/dist/src/core/relation.js +40 -0
  193. package/dist/src/core/relation.js.map +1 -0
  194. package/dist/src/core/scheme.d.ts +10 -0
  195. package/dist/src/core/scheme.d.ts.map +1 -0
  196. package/dist/src/core/scheme.js +21 -0
  197. package/dist/src/core/scheme.js.map +1 -0
  198. package/dist/src/core/triple.d.ts +14 -0
  199. package/dist/src/core/triple.d.ts.map +1 -0
  200. package/dist/src/core/triple.js +20 -0
  201. package/dist/src/core/triple.js.map +1 -0
  202. package/dist/src/encodings/get-accept-editor-arguments.d.ts +11 -0
  203. package/dist/src/encodings/get-accept-editor-arguments.d.ts.map +1 -0
  204. package/dist/src/encodings/get-accept-editor-arguments.js +23 -0
  205. package/dist/src/encodings/get-accept-editor-arguments.js.map +1 -0
  206. package/dist/src/encodings/get-accept-subspace-arguments.d.ts +11 -0
  207. package/dist/src/encodings/get-accept-subspace-arguments.d.ts.map +1 -0
  208. package/dist/src/encodings/get-accept-subspace-arguments.js +23 -0
  209. package/dist/src/encodings/get-accept-subspace-arguments.js.map +1 -0
  210. package/dist/src/encodings/get-calldata-for-space-governance-type.d.ts +8 -0
  211. package/dist/src/encodings/get-calldata-for-space-governance-type.d.ts.map +1 -0
  212. package/dist/src/encodings/get-calldata-for-space-governance-type.js +19 -0
  213. package/dist/src/encodings/get-calldata-for-space-governance-type.js.map +1 -0
  214. package/dist/src/encodings/get-process-geo-proposal-arguments.d.ts +7 -0
  215. package/dist/src/encodings/get-process-geo-proposal-arguments.d.ts.map +1 -0
  216. package/dist/src/encodings/get-process-geo-proposal-arguments.js +23 -0
  217. package/dist/src/encodings/get-process-geo-proposal-arguments.js.map +1 -0
  218. package/dist/src/encodings/get-remove-editor-arguments.d.ts +11 -0
  219. package/dist/src/encodings/get-remove-editor-arguments.d.ts.map +1 -0
  220. package/dist/src/encodings/get-remove-editor-arguments.js +23 -0
  221. package/dist/src/encodings/get-remove-editor-arguments.js.map +1 -0
  222. package/dist/src/encodings/get-remove-subspace-arguments.d.ts +11 -0
  223. package/dist/src/encodings/get-remove-subspace-arguments.d.ts.map +1 -0
  224. package/dist/src/encodings/get-remove-subspace-arguments.js +23 -0
  225. package/dist/src/encodings/get-remove-subspace-arguments.js.map +1 -0
  226. package/dist/src/encodings/index.d.ts +7 -0
  227. package/dist/src/encodings/index.d.ts.map +1 -0
  228. package/dist/src/encodings/index.js +7 -0
  229. package/dist/src/encodings/index.js.map +1 -0
  230. package/dist/src/id.d.ts +15 -0
  231. package/dist/src/id.d.ts.map +1 -0
  232. package/dist/src/id.js +21 -0
  233. package/dist/src/id.js.map +1 -0
  234. package/dist/src/image.d.ts +2 -0
  235. package/dist/src/image.d.ts.map +1 -0
  236. package/dist/src/image.js +2 -0
  237. package/dist/src/image.js.map +1 -0
  238. package/dist/src/position.d.ts +2 -0
  239. package/dist/src/position.d.ts.map +1 -0
  240. package/dist/src/position.js +2 -0
  241. package/dist/src/position.js.map +1 -0
  242. package/dist/src/proto/create-edit-proposal.d.ts +9 -0
  243. package/dist/src/proto/create-edit-proposal.d.ts.map +1 -0
  244. package/dist/src/proto/create-edit-proposal.js +54 -0
  245. package/dist/src/proto/create-edit-proposal.js.map +1 -0
  246. package/dist/src/proto/create-edit-proposal.test.d.ts +2 -0
  247. package/dist/src/proto/create-edit-proposal.test.d.ts.map +1 -0
  248. package/dist/src/proto/create-edit-proposal.test.js +140 -0
  249. package/dist/src/proto/create-edit-proposal.test.js.map +1 -0
  250. package/dist/src/proto/create-membership-proposal.d.ts +7 -0
  251. package/dist/src/proto/create-membership-proposal.d.ts.map +1 -0
  252. package/dist/src/proto/create-membership-proposal.js +26 -0
  253. package/dist/src/proto/create-membership-proposal.js.map +1 -0
  254. package/dist/src/proto/create-subspace-proposal.d.ts +7 -0
  255. package/dist/src/proto/create-subspace-proposal.d.ts.map +1 -0
  256. package/dist/src/proto/create-subspace-proposal.js +12 -0
  257. package/dist/src/proto/create-subspace-proposal.js.map +1 -0
  258. package/dist/src/proto/edit.d.ts +9 -0
  259. package/dist/src/proto/edit.d.ts.map +1 -0
  260. package/dist/src/proto/edit.js +54 -0
  261. package/dist/src/proto/edit.js.map +1 -0
  262. package/dist/src/proto/edit.test.d.ts +2 -0
  263. package/dist/src/proto/edit.test.d.ts.map +1 -0
  264. package/dist/src/proto/edit.test.js +140 -0
  265. package/dist/src/proto/edit.test.js.map +1 -0
  266. package/dist/src/proto/gen/src/proto/ipfs_pb.d.ts +404 -0
  267. package/dist/src/proto/gen/src/proto/ipfs_pb.d.ts.map +1 -0
  268. package/dist/src/proto/gen/src/proto/ipfs_pb.js +602 -0
  269. package/dist/src/proto/gen/src/proto/ipfs_pb.js.map +1 -0
  270. package/dist/src/proto/index.d.ts +2 -0
  271. package/dist/src/proto/index.d.ts.map +1 -0
  272. package/dist/src/proto/index.js +2 -0
  273. package/dist/src/proto/index.js.map +1 -0
  274. package/dist/src/relation.d.ts +2 -0
  275. package/dist/src/relation.d.ts.map +1 -0
  276. package/dist/src/relation.js +2 -0
  277. package/dist/src/relation.js.map +1 -0
  278. package/dist/src/scheme.d.ts +2 -0
  279. package/dist/src/scheme.d.ts.map +1 -0
  280. package/dist/src/scheme.js +2 -0
  281. package/dist/src/scheme.js.map +1 -0
  282. package/dist/src/system-ids.d.ts +4 -0
  283. package/dist/src/system-ids.d.ts.map +1 -0
  284. package/dist/src/system-ids.js +4 -0
  285. package/dist/src/system-ids.js.map +1 -0
  286. package/dist/src/triple.d.ts +2 -0
  287. package/dist/src/triple.d.ts.map +1 -0
  288. package/dist/src/triple.js +2 -0
  289. package/dist/src/triple.js.map +1 -0
  290. package/dist/src/types.d.ts +86 -0
  291. package/dist/src/types.d.ts.map +1 -0
  292. package/dist/src/types.js +13 -0
  293. package/dist/src/types.js.map +1 -0
  294. package/dist/tsconfig.tsbuildinfo +1 -0
  295. package/package.json +47 -0
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # Knowledge Graph SDK
2
+
3
+ A collection of tools for interacting with the The Graph.
4
+
5
+ ## Installing
6
+
7
+ ```sh
8
+ npm install @geogenesis/sdk
9
+ ```
10
+
11
+ ## Overview
12
+
13
+ ### Data flow
14
+
15
+ Data in The Graph lives both offchain and onchain. This data is written to IPFS, and the resulting content identitifier is then posted onchain before being read by the indexing stack. After the indexer finishes processing the data it's exposed by the API.
16
+ ![CleanShot 2025-01-22 at 10 51 23@2x](https://github.com/user-attachments/assets/f0cee8e0-43f9-4663-a2e7-54de6d962115)
17
+
18
+ ### Spaces
19
+
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
+
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
+ ### Relations
29
+
30
+ 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.
31
+
32
+ ### Entities
33
+
34
+ An entity is a unique identifier representing a person, a place, an idea, a concept, or anything else. Entities are comprised of triples and relations which provide semantic meaning as to what the entity _is_. An entity's data can be composed from multiple spaces at once. This property is what enables pluralism within The Graph.
35
+
36
+ [More about entities and knowledge graphs](https://www.geobrowser.io/space/6tfhqywXtteatMeGUtd5EB/XYo6aR3VqFQSEcf6AeTikW)
37
+
38
+ [More about pluralism](https://www.geobrowser.io/space/6tfhqywXtteatMeGUtd5EB/5WHP8BuoCdSiqtfy87SYWG)
39
+
40
+ ### Ops and edits
41
+
42
+ Data in The Graph is stored as an Op (operation). Ops represent a set of changes applied to entities. A change could be setting or deleting a triple or a relation. Both triples and relations are represented as Ops.
43
+
44
+ When writing data, these ops are grouped into a logical set called an "Edit." An Edit has a name, authors, and other metadata to represent the set of changes. This edit is then encoded into a binary representation for storage efficiency.
45
+
46
+ [Ops and edits in GRC-20](https://github.com/graphprotocol/graph-improvement-proposals/blob/main/grcs/0020-knowledge-graph.md#13-ops)
47
+
48
+ ## Using
49
+
50
+ ### Unique IDs
51
+
52
+ Entities throughout The Graph are referenced via globally unique identifiers. The SDK exposes APIs for creating these IDs.
53
+
54
+ ```ts
55
+ import { ID } from 'geogenesis/sdk';
56
+
57
+ const newId = ID.make();
58
+ ```
59
+
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 '@geogenesis/sdk';
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
+ ### Writing an edit to IPFS
98
+
99
+ Once you have a set of ops ready to publish, you'll need to binary encode them into an Edit and upload the Edit to IPFS.
100
+
101
+ Currently the indexer only supports reading from the [Lighthouse gateway](https://lighthouse.storage/). You should use the Lighthouse gateway to guarantee data availability for your published data while in early access. To write to Lighthouse you'll need an [API key](https://docs.lighthouse.storage/lighthouse-1/quick-start#create-an-api-key).
102
+
103
+ Additionally, the indexer expects that IPFS CIDs be prefixed with `ipfs://` so it knows how to process it correctly.
104
+
105
+ ```ts
106
+ import { EditProposal } from '@geogenesis/sdk/proto';
107
+
108
+ const binaryEncodedEdit = EditProposal.make({
109
+ name: 'Edit name',
110
+ ops: ops,
111
+ author: '0x000000000000000000000000000000000000',
112
+ });
113
+
114
+ // Upload binary via Geo API
115
+ const blob = new Blob([binaryEncodedEdit], { type: 'application/octet-stream' });
116
+ const formData = new FormData();
117
+ formData.append('file', blob);
118
+
119
+ const result = await fetch('https://geobrowser.io/api/ipfs/upload-binary, {
120
+ method: 'POST',
121
+ body: formData,
122
+ });
123
+
124
+ const { cid } = await result.json();
125
+ ```
126
+
127
+ ### Publishing an edit onchain
128
+
129
+ Once you've uploaded the binary encoded Edit to IPFS and have correctly formed `ipfs://hash`, you can write this to a space.
130
+
131
+ The calldata used to write the edit onchain depends on the governance structure of the space. Currently The Graph supports two governance modes, one with voting and one without. The API exposes metadata about each space, its governance structure, and what smart contracts exist for it.
132
+
133
+ We expose an API for fetching the appropriate calldata for the correct contract address based for each space.
134
+
135
+ ```ts
136
+ // You'll need to know your space id ahead of time
137
+ const spaceId = 'space-id';
138
+
139
+ // This returns the correct contract address and calldata depending on the space id
140
+ const result = await fetch(`https://geobrowser.io/api/edit-calldata?spaceId=${spaceId}&cid=${cid}`);
141
+
142
+ const { to, data } = await result.json();
143
+
144
+ const txResult = await walletClient.sendTransaction({
145
+ to: to,
146
+ value: 0n,
147
+ data: data,
148
+ });
149
+ ```
150
+
151
+ ### Deploying a space
152
+
153
+ ### Smart accounts
package/dist/abis.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './src/abis/index.js';
2
+ //# sourceMappingURL=abis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../abis.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
package/dist/abis.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './src/abis/index.js';
2
+ //# sourceMappingURL=abis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.js","sourceRoot":"","sources":["../abis.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const INITIAL_RELATION_INDEX_VALUE: string;
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,QAA8C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Position, PositionRange } from './src/position.js';
2
+ export const INITIAL_RELATION_INDEX_VALUE = Position.createBetween(PositionRange.FIRST);
3
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA,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,7 @@
1
+ export declare const SPACE_PLUGIN_REPO_ADDRESS = "0xd9559df98e4103CDf0A119d4bff1537B383E462c";
2
+ export declare const PERSONAL_SPACE_ADMIN_PLUGIN_REPO_ADDRESS = "0xa00870c6501349E126E71Dc1705fBaa2B5aeac0d";
3
+ export declare const GOVERNANCE_PLUGIN_REPO_ADDRESS = "0x81A45db7E303eED5D8e0B84b39d96DBa23192Eab";
4
+ export declare const DAO_FACTORY_ADDRESS = "0x9012fcc278a860B66e644cE491a1CbabFBb34a72";
5
+ export declare const ENS_REGISTRY_ADDRESS = "0x81C575f78903F8aC1FD73dEC06d20ffdC51c9b4E";
6
+ export declare const PLUGIN_SETUP_PROCESSOR_ADDRESS = "0xfcC0Aba63c1F1f887099EAB0d1A624A5B7A82Fc2";
7
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../contracts.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,+CAA+C,CAAC;AACtF,eAAO,MAAM,wCAAwC,+CAA+C,CAAC;AACrG,eAAO,MAAM,8BAA8B,+CAA+C,CAAC;AAE3F,eAAO,MAAM,mBAAmB,+CAA+C,CAAC;AAChF,eAAO,MAAM,oBAAoB,+CAA+C,CAAC;AACjF,eAAO,MAAM,8BAA8B,+CAA+C,CAAC"}
@@ -0,0 +1,10 @@
1
+ // GOVERNANCE PLUGIN ADDRESSES
2
+ // from the plugin-repo-info.json in geo-contracts after deploying
3
+ // Jul 15, 2024 – L3 Testnet
4
+ export const SPACE_PLUGIN_REPO_ADDRESS = '0xd9559df98e4103CDf0A119d4bff1537B383E462c';
5
+ export const PERSONAL_SPACE_ADMIN_PLUGIN_REPO_ADDRESS = '0xa00870c6501349E126E71Dc1705fBaa2B5aeac0d';
6
+ export const GOVERNANCE_PLUGIN_REPO_ADDRESS = '0x81A45db7E303eED5D8e0B84b39d96DBa23192Eab';
7
+ export const DAO_FACTORY_ADDRESS = '0x9012fcc278a860B66e644cE491a1CbabFBb34a72';
8
+ export const ENS_REGISTRY_ADDRESS = '0x81C575f78903F8aC1FD73dEC06d20ffdC51c9b4E';
9
+ export const PLUGIN_SETUP_PROCESSOR_ADDRESS = '0xfcC0Aba63c1F1f887099EAB0d1A624A5B7A82Fc2';
10
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../contracts.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,kEAAkE;AAClE,4BAA4B;AAC5B,MAAM,CAAC,MAAM,yBAAyB,GAAG,4CAA4C,CAAC;AACtF,MAAM,CAAC,MAAM,wCAAwC,GAAG,4CAA4C,CAAC;AACrG,MAAM,CAAC,MAAM,8BAA8B,GAAG,4CAA4C,CAAC;AAE3F,MAAM,CAAC,MAAM,mBAAmB,GAAG,4CAA4C,CAAC;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG,4CAA4C,CAAC;AACjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,4CAA4C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../error.ts"],"names":[],"mappings":""}
package/dist/error.js ADDED
@@ -0,0 +1,8 @@
1
+ import { decodeErrorResult } from 'viem';
2
+ import { DaoAbi, MainVotingAbi, MemberAccessAbi } from './abis.js';
3
+ const error = decodeErrorResult({
4
+ data: '0xa6a7dbbd0000000000000000000000000000000000000000000000000000000000000000',
5
+ abi: DaoAbi,
6
+ });
7
+ console.log('error', error);
8
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEnE,MAAM,KAAK,GAAG,iBAAiB,CAAC;IAC9B,IAAI,EAAE,4EAA4E;IAClF,GAAG,EAAE,MAAM;CACZ,CAAC,CAAC;AAEH,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../example.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { Relation, Triple, } from '@geogenesis/sdk';
2
+ import { EditProposal } from '@geogenesis/sdk/proto.js';
3
+ const setTripleOp = Triple.make({
4
+ entityId: 'id of entity',
5
+ attributeId: 'id of attribute',
6
+ value: {
7
+ type: 'TEXT', // TEXT | NUMBER | URL | TIME | POINT | CHECKBOX,
8
+ value: 'hello world',
9
+ },
10
+ });
11
+ const deleteTripleOp = Triple.remove({
12
+ entityId: 'id of entity',
13
+ attributeId: 'id of attribute',
14
+ });
15
+ const setRelationOp = Relation.make({
16
+ fromId: 'id of from entity',
17
+ relationTypeId: 'id of relation type',
18
+ toId: 'id of to entity',
19
+ });
20
+ const deleteRelationOp = Relation.remove('id of relation');
21
+ const ops = [setTripleOp, deleteTripleOp, setRelationOp, deleteRelationOp];
22
+ const binaryEncodedEdit = EditProposal.make({
23
+ name: 'Edit name',
24
+ ops: ops,
25
+ author: '0x0000000000000000000000000000000000000000',
26
+ });
27
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","sourceRoot":"","sources":["../example.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,QAAQ,EAER,MAAM,GACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,WAAW,GAAgB,MAAM,CAAC,IAAI,CAAC;IAC3C,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,iBAAiB;IAC9B,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,EAAE,iDAAiD;QAC/D,KAAK,EAAE,aAAa;KACrB;CACF,CAAC,CAAC;AAEH,MAAM,cAAc,GAAmB,MAAM,CAAC,MAAM,CAAC;IACnD,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,iBAAiB;CAC/B,CAAC,CAAC;AAEH,MAAM,aAAa,GAAqB,QAAQ,CAAC,IAAI,CAAC;IACpD,MAAM,EAAE,mBAAmB;IAC3B,cAAc,EAAE,qBAAqB;IACrC,IAAI,EAAE,iBAAiB;CACxB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAqB,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE7E,MAAM,GAAG,GAAS,CAAC,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAEjF,MAAM,iBAAiB,GAAG,YAAY,CAAC,IAAI,CAAC;IAC1C,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,GAAG;IACR,MAAM,EAAE,4CAA4C;CACrD,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export * from './src/types.js';
2
+ export * as ID from './src/id.js';
3
+ export { BASE58_ALLOWED_CHARS, decodeBase58ToUUID, encodeBase58 } from './src/core/base58.js';
4
+ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from './src/encodings/index.js';
5
+ export { Account } from './src/account.js';
6
+ export { TextBlock, DataBlock } from './src/blocks.js';
7
+ export { Image } from './src/image.js';
8
+ export { Position, PositionRange } from './src/position.js';
9
+ export { Triple } from './src/triple.js';
10
+ export { Relation } from './src/relation.js';
11
+ export { GraphUrl } from './src/scheme.js';
12
+ export { SYSTEM_IDS, NETWORK_IDS, CONTENT_IDS } from './src/system-ids.js';
13
+ export { getChecksumAddress } from './src/core/get-checksum-address.js';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ export * from './src/types.js';
2
+ export * as ID from './src/id.js';
3
+ export { BASE58_ALLOWED_CHARS, decodeBase58ToUUID, encodeBase58 } from './src/core/base58.js';
4
+ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from './src/encodings/index.js';
5
+ export { Account } from './src/account.js';
6
+ export { TextBlock, DataBlock } from './src/blocks.js';
7
+ export { Image } from './src/image.js';
8
+ export { Position, PositionRange } from './src/position.js';
9
+ export { Triple } from './src/triple.js';
10
+ export { Relation } from './src/relation.js';
11
+ export { GraphUrl } from './src/scheme.js';
12
+ export { SYSTEM_IDS, NETWORK_IDS, CONTENT_IDS } from './src/system-ids.js';
13
+ export { getChecksumAddress } from './src/core/get-checksum-address.js';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './src/proto/gen/src/proto/ipfs_pb.js';
2
+ export * as EditProposal from './src/proto/edit.js';
3
+ //# sourceMappingURL=proto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC"}
package/dist/proto.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './src/proto/gen/src/proto/ipfs_pb.js';
2
+ export * as EditProposal from './src/proto/edit.js';
3
+ //# sourceMappingURL=proto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto.js","sourceRoot":"","sources":["../proto.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC"}
package/dist/run.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../run.ts"],"names":[],"mappings":""}
package/dist/run.js ADDED
@@ -0,0 +1,4 @@
1
+ import { encodeBase58 } from './src/core/base58.js';
2
+ const next = encodeBase58('f3f790c4c74e4d23a0a91e8ef84e30d9');
3
+ console.log('run', next);
4
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,IAAI,GAAG,YAAY,CAAC,kCAAkC,CAAC,CAAC;AAE9D,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC"}