@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.
@@ -104,11 +104,9 @@ declare const _default: {
104
104
  };
105
105
  domain: {
106
106
  type: string;
107
- allOf: {
108
- format: string;
109
- }[];
110
107
  title: string;
111
108
  maxLength: number;
109
+ format: string;
112
110
  };
113
111
  strategies: {
114
112
  type: string;
@@ -100,11 +100,9 @@ declare const _default: {
100
100
  };
101
101
  domain: {
102
102
  type: string;
103
- allOf: {
104
- format: string;
105
- }[];
106
103
  title: string;
107
104
  maxLength: number;
105
+ format: string;
108
106
  };
109
107
  strategies: {
110
108
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapshot-labs/snapshot.js",
3
- "version": "0.12.24",
3
+ "version": "0.12.25",
4
4
  "repository": "snapshot-labs/snapshot.js",
5
5
  "license": "MIT",
6
6
  "main": "dist/snapshot.cjs.js",
@@ -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", "delegationNetwork", "delegationApi", "delegationContract"],
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 {