@@ -5,6 +5,7 @@ import { isUndefined } from ".";
55import { TEMPLATE_REGISTRY } from "consts/arbitration" ;
66import { ItemDetailsFragment , Status } from "src/graphql/graphql" ;
77import { arbitrum } from "viem/chains" ;
8+ import { registrationTemplate , removalTemplate , dataMappings } from "@kleros/curate-v2-templates" ;
89
910export const constructListParams = ( listData : IListData , listMetadata : IListMetadata ) => {
1011 const baseTemplate = { ...listData } as IList ;
@@ -112,96 +113,3 @@ const getMockValueForType = (type: string) => {
112113 return "Ethereum" ;
113114 }
114115} ;
115-
116- const sharedTemplateProperties = `
117- "policyURI": "{{{policyURI}}}",
118- "frontendUrl": "https://curate-v2.kleros.builders/#/lists/item/{{itemID}}",
119- "arbitrableChainID": "421614",
120- "arbitrableAddress": "{{arbitrableAddress}}",
121- "arbitratorChainID": "421614",
122- "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b",
123- "metadata": {
124- "itemName": "{{itemName}}",
125- "itemDescription": "{{itemDescription}}",
126- "registryTitle": "{{registryTitle}}",
127- "registryDescription": "{{registryDescription}}"
128- },
129- "category": "Curated Lists",
130- "version": "1.0"` ;
131-
132- const registrationTemplate = `{
133- "$schema": "../NewDisputeTemplate.schema.json",
134- "title": "Add a {{itemName}} to {{registryTitle}}",
135- "description": "Someone requested to add an {{itemName}} to {{registryTitle}}",
136- "question": "Does the {{itemName}} comply with the required criteria?",
137- "answers": [
138- {
139- "title": "Yes, Add It",
140- "description": "Select this if you think that the {{itemName}} does comply with the required criteria and should be added."
141- },
142- {
143- "title": "No, Don't Add It",
144- "description": "Select this if you think that the {{itemName}} does not comply with the required criteria and should not be added."
145- }
146- ], ${ sharedTemplateProperties }
147- }
148- ` ;
149-
150- const removalTemplate = `{
151- "$schema": "../NewDisputeTemplate.schema.json",
152- "title": "Remove a {{itemName}} from {{registryTitle}}",
153- "description": "Someone requested to remove a {{itemName}} from {{registryTitle}}",
154- "question": "Does the {{itemName}} comply with the required criteria?",
155- "answers": [
156- {
157- "title": "Yes, Remove It",
158- "description": "Select this if you think that the {{itemName}} does not comply with the required criteria and should be removed."
159- },
160- {
161- "title": "No, Don't Remove It",
162- "description": "Select this if you think that the {{itemName}} does comply with the required criteria and should not be removed."
163- }
164- ], ${ sharedTemplateProperties }
165- }
166- ` ;
167-
168- const dataMappings = `[
169- {
170- "type": "graphql",
171- "endpoint": "https://gateway-arbitrum.network.thegraph.com/api/{{{graphApiKey}}}/subgraphs/id/H93eWJbDpYKAtkLmsMn7Su3ZLZwAwLN5VoyvQH4NbGAv",
172- "query": "query SearchRequestByDisputeID($externalDisputeID: BigInt!) { requests(where: { externalDisputeID: $externalDisputeID }) { id disputeID submissionTime resolved requester { id } challenger { id } arbitrator arbitratorExtraData deposit disputeOutcome requestType item { id itemID data status registry { id title description policyURI } } } }",
173- "variables": {
174- "externalDisputeID": "{{externalDisputeID}}"
175- },
176- "seek": [
177- "requests[0].item.registry.title",
178- "requests[0].item.registry.description",
179- "requests[0].item.registry.policyURI",
180- "requests[0].item.id",
181- "requests[0].item.data",
182- "requests[0].item.status",
183- "requests[0].item.registry.id"
184- ],
185- "populate": [
186- "registryTitle",
187- "registryDescription",
188- "policyURI",
189- "itemID",
190- "itemData",
191- "itemStatus",
192- "listAddress"
193- ]
194- },
195- {
196- "type": "json",
197- "value": "{{{itemData}}}",
198- "seek": [
199- "columns[0].label",
200- "columns[0].description"
201- ],
202- "populate": [
203- "itemName",
204- "itemDescription"
205- ]
206- }
207- ]` ;
0 commit comments