Skip to content

Commit

Permalink
Add solver information
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Aug 5, 2024
1 parent a276a53 commit a4a1a78
Show file tree
Hide file tree
Showing 7 changed files with 4,340 additions and 1,530 deletions.
6 changes: 6 additions & 0 deletions src/api/network/content-types/network/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
},
"chainId": {
"type": "integer"
},
"solvers": {
"type": "relation",
"relation": "manyToMany",
"target": "api::solver.solver",
"mappedBy": "networks"
}
}
}
56 changes: 56 additions & 0 deletions src/api/solver/content-types/solver/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"kind": "collectionType",
"collectionName": "solvers",
"info": {
"singularName": "solver",
"pluralName": "solvers",
"displayName": "Solver"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string",
"required": true
},
"address": {
"type": "string",
"regex": "^(0x)?[0-9a-fA-F]{40}$",
"required": true
},
"payoutAddress": {
"type": "string",
"regex": "^(0x)?[0-9a-fA-F]{40}$"
},
"networks": {
"type": "relation",
"relation": "manyToMany",
"target": "api::network.network",
"inversedBy": "solvers"
},
"active": {
"type": "boolean",
"default": true,
"required": true
},
"image": {
"allowedTypes": [
"images"
],
"type": "media",
"multiple": false
},
"organization": {
"type": "string"
},
"website": {
"type": "string",
"regex": "^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)"
},
"description": {
"type": "string"
}
}
}
7 changes: 7 additions & 0 deletions src/api/solver/controllers/solver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* solver controller
*/

import { factories } from '@strapi/strapi'

export default factories.createCoreController('api::solver.solver');
Loading

0 comments on commit a4a1a78

Please sign in to comment.