@snapshot-labs/snapshot.js 0.12.24 → 0.12.25
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.
- package/dist/snapshot.cjs.js +9 -10
- package/dist/snapshot.esm.js +9 -10
- package/dist/snapshot.min.js +2 -2
- package/dist/src/index.d.ts +1 -3
- package/dist/src/schemas/index.d.ts +1 -3
- package/package.json +1 -1
- package/src/schemas/space.json +3 -6
- package/src/utils.ts +7 -0
package/dist/src/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/schemas/space.json
CHANGED
|
@@ -103,12 +103,9 @@
|
|
|
103
103
|
},
|
|
104
104
|
"domain": {
|
|
105
105
|
"type": "string",
|
|
106
|
-
"allOf": [
|
|
107
|
-
{ "format": "hostname" },
|
|
108
|
-
{ "format": "lowercase" }
|
|
109
|
-
],
|
|
110
106
|
"title": "domain",
|
|
111
|
-
"maxLength": 64
|
|
107
|
+
"maxLength": 64,
|
|
108
|
+
"format": "domain"
|
|
112
109
|
},
|
|
113
110
|
"strategies": {
|
|
114
111
|
"type": "array",
|
|
@@ -287,7 +284,7 @@
|
|
|
287
284
|
]
|
|
288
285
|
}
|
|
289
286
|
},
|
|
290
|
-
"required": ["delegationType", "
|
|
287
|
+
"required": ["delegationType", "delegationApi", "delegationContract"],
|
|
291
288
|
"additionalProperties": false
|
|
292
289
|
},
|
|
293
290
|
"allowAlias": {
|
package/src/utils.ts
CHANGED
|
@@ -252,6 +252,13 @@ ajv.addFormat('customUrl', {
|
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
|
|
255
|
+
ajv.addFormat('domain', {
|
|
256
|
+
validate: (value: string) => {
|
|
257
|
+
if (!value) return false;
|
|
258
|
+
return !!value.match(/^(https:\/\/)?([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
255
262
|
export async function call(provider, abi: any[], call: any[], options?) {
|
|
256
263
|
const contract = new Contract(call[0], abi, provider);
|
|
257
264
|
try {
|