@bulla/registry 0.0.0-stage → 1.0.1

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.
@@ -0,0 +1,197 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/bulla-network/bulla-registry/registry.schema.json",
4
+ "title": "Bulla registry",
5
+ "description": "The shape of registry.json, which every consumer depends on. scripts/consolidate.ts checks each consolidation against it before writing, so a run that breaks the shape or drops a required field fails before anything is committed. Rules JSON Schema can't express (network keys match chainId, pools reference known networks and clients, logo files exist, unique pool addresses) are checked in scripts/validate-registry.ts. The pool and client definitions copy factoring-contracts' pools.schema.json on purpose: a change upstream must also change this file, so it gets reviewed here.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["generatedAt", "networks", "clients", "pools"],
9
+ "properties": {
10
+ "$schema": { "type": "string" },
11
+ "generatedAt": { "type": "string", "format": "date-time" },
12
+ "networks": {
13
+ "type": "object",
14
+ "description": "Keyed by chain ID as a decimal string.",
15
+ "minProperties": 1,
16
+ "propertyNames": { "pattern": "^[1-9][0-9]*$" },
17
+ "additionalProperties": { "$ref": "#/definitions/network" }
18
+ },
19
+ "clients": {
20
+ "type": "object",
21
+ "description": "Keyed by client key, e.g. tcs. A client is who a factoring pool factors invoices for; one client can have many pools. From factoring-contracts' pools.json.",
22
+ "minProperties": 1,
23
+ "propertyNames": { "$ref": "#/definitions/key" },
24
+ "additionalProperties": { "$ref": "#/definitions/client" }
25
+ },
26
+ "pools": {
27
+ "type": "array",
28
+ "description": "Every factoring pool on every chain, archived ones included. From factoring-contracts' pools.json.",
29
+ "minItems": 1,
30
+ "items": { "$ref": "#/definitions/pool" }
31
+ }
32
+ },
33
+ "definitions": {
34
+ "address": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" },
35
+ "key": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
36
+ "bps": { "type": "integer", "minimum": 0, "maximum": 10000 },
37
+ "url": { "type": "string", "pattern": "^https://\\S+$" },
38
+ "slug": {
39
+ "type": "string",
40
+ "description": "The network's name in the subgraph (bulla-contracts-<slug>) and in pools.json.",
41
+ "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$"
42
+ },
43
+
44
+ "network": {
45
+ "type": "object",
46
+ "additionalProperties": false,
47
+ "required": ["name", "chainId", "slug", "subgraph", "contracts"],
48
+ "properties": {
49
+ "name": { "type": "string", "minLength": 1, "not": { "pattern": "^Unknown" } },
50
+ "chainId": { "type": "integer", "minimum": 1 },
51
+ "slug": { "$ref": "#/definitions/slug" },
52
+ "subgraph": { "$ref": "#/definitions/subgraphEndpoints" },
53
+ "contracts": {
54
+ "type": "object",
55
+ "description": "Keyed by source repo, then contract name.",
56
+ "minProperties": 1,
57
+ "propertyNames": { "enum": ["bulla-contracts", "bulla-contracts-v2", "factoring-contracts"] },
58
+ "additionalProperties": {
59
+ "type": "object",
60
+ "minProperties": 1,
61
+ "propertyNames": { "pattern": "^[A-Za-z][A-Za-z0-9_]*$" },
62
+ "additionalProperties": { "$ref": "#/definitions/address" }
63
+ }
64
+ }
65
+ }
66
+ },
67
+
68
+ "subgraphEndpoints": {
69
+ "type": "object",
70
+ "description": "One endpoint per Goldsky tag: dev for the dev stage, prod for production. They are constant (the network slug plus a fixed tag) and change only when a network is added; which build a tag serves is set by tagging in the subgraph repo.",
71
+ "additionalProperties": false,
72
+ "required": ["dev", "prod"],
73
+ "properties": {
74
+ "dev": { "$ref": "#/definitions/url" },
75
+ "prod": { "$ref": "#/definitions/url" }
76
+ }
77
+ },
78
+
79
+ "client": {
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": ["displayName"],
83
+ "properties": {
84
+ "displayName": { "type": "string", "minLength": 1 },
85
+ "website": { "$ref": "#/definitions/url" },
86
+ "logo": {
87
+ "type": "string",
88
+ "description": "An https URL, or a path relative to registry.json (e.g. factoring-contracts/logos/tcs.png). Absent: show the Bulla logo.",
89
+ "pattern": "^(https://\\S+|factoring-contracts/logos/[^/]+)$"
90
+ }
91
+ }
92
+ },
93
+
94
+ "category": {
95
+ "type": "string",
96
+ "description": "active: live, including test pools. archived: no longer in use but still resolves, e.g. a pool superseded by a redeploy.",
97
+ "enum": ["active", "archived"]
98
+ },
99
+ "shareToken": {
100
+ "type": "object",
101
+ "description": "The pool's own ERC-20 share token. Its address is the pool address.",
102
+ "additionalProperties": false,
103
+ "required": ["symbol", "name", "decimals"],
104
+ "properties": {
105
+ "symbol": { "type": "string", "minLength": 1 },
106
+ "name": { "type": "string", "minLength": 1 },
107
+ "decimals": { "type": "integer", "minimum": 0, "maximum": 36 }
108
+ }
109
+ },
110
+ "asset": {
111
+ "type": "object",
112
+ "description": "The underlying asset the pool takes deposits in and funds invoices with.",
113
+ "additionalProperties": false,
114
+ "required": ["address", "symbol", "name", "decimals", "kind"],
115
+ "properties": {
116
+ "address": { "$ref": "#/definitions/address" },
117
+ "symbol": { "type": "string", "minLength": 1 },
118
+ "name": { "type": "string", "minLength": 1 },
119
+ "decimals": { "type": "integer", "minimum": 0, "maximum": 36 },
120
+ "kind": { "type": "string", "enum": ["stable", "volatile"] }
121
+ }
122
+ },
123
+ "permissions": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": ["factoring", "deposit"],
127
+ "properties": {
128
+ "factoring": { "$ref": "#/definitions/address" },
129
+ "deposit": { "$ref": "#/definitions/address" },
130
+ "redeem": {
131
+ "$ref": "#/definitions/address",
132
+ "description": "Absent on V0 and V1 pools, which have no redeem permissions; present from V2.1 on."
133
+ }
134
+ }
135
+ },
136
+ "fees": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": ["protocolBps", "adminBps", "targetYieldBps"],
140
+ "properties": {
141
+ "protocolBps": { "$ref": "#/definitions/bps" },
142
+ "adminBps": { "$ref": "#/definitions/bps" },
143
+ "targetYieldBps": { "$ref": "#/definitions/bps" },
144
+ "insuranceBps": {
145
+ "$ref": "#/definitions/bps",
146
+ "description": "Absent before V2.2, which has no insurance fee; present on every V2.2 pool."
147
+ }
148
+ }
149
+ },
150
+ "pool": {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "required": [
154
+ "chainId",
155
+ "network",
156
+ "address",
157
+ "version",
158
+ "client",
159
+ "displayName",
160
+ "category",
161
+ "shareToken",
162
+ "asset",
163
+ "insured",
164
+ "enforceKyc",
165
+ "permissions",
166
+ "underwriter",
167
+ "fees",
168
+ "deployBlock"
169
+ ],
170
+ "properties": {
171
+ "chainId": { "type": "integer", "minimum": 1, "description": "A key of networks." },
172
+ "network": { "$ref": "#/definitions/slug", "description": "The slug of networks[chainId]." },
173
+ "address": { "$ref": "#/definitions/address", "description": "The pool contract, which is also its share token." },
174
+ "version": { "type": "string", "enum": ["V0", "V1", "V2_1", "V2_2"] },
175
+ "client": { "$ref": "#/definitions/key", "description": "A key of clients. Separate from poolKey: tcs-wyoming is client tcs." },
176
+ "poolKey": {
177
+ "$ref": "#/definitions/key",
178
+ "description": "The name factoring-contracts' deploy scripts take, e.g. tcs-wyoming. A redeploy keeps the poolKey, so several pools on a chain can share one, but only one of them is current (no supersededBy). Only pools those scripts manage have one."
179
+ },
180
+ "displayName": { "type": "string", "minLength": 1 },
181
+ "category": { "$ref": "#/definitions/category" },
182
+ "supersededBy": {
183
+ "$ref": "#/definitions/address",
184
+ "description": "The pool on the same chain that replaced this one when it was redeployed."
185
+ },
186
+ "shareToken": { "$ref": "#/definitions/shareToken" },
187
+ "asset": { "$ref": "#/definitions/asset" },
188
+ "insured": { "type": "boolean" },
189
+ "enforceKyc": { "type": "boolean" },
190
+ "permissions": { "$ref": "#/definitions/permissions" },
191
+ "underwriter": { "$ref": "#/definitions/address" },
192
+ "fees": { "$ref": "#/definitions/fees" },
193
+ "deployBlock": { "type": "integer", "minimum": 0, "description": "The block that created the pool; the subgraph's start block for it." }
194
+ }
195
+ }
196
+ }
197
+ }