@snapshot-labs/snapshot.js 0.12.44 → 0.12.46

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.
@@ -539,7 +539,6 @@ var definitions = {
539
539
  symbol: {
540
540
  type: "string",
541
541
  title: "symbol",
542
- minLength: 1,
543
542
  maxLength: 16
544
543
  },
545
544
  skin: {
@@ -567,10 +566,6 @@ var definitions = {
567
566
  strategies: {
568
567
  type: "array",
569
568
  minItems: 1,
570
- maxItemsWithSpaceType: {
571
- "default": 8,
572
- turbo: 10
573
- },
574
569
  uniqueItems: true,
575
570
  items: {
576
571
  type: "object",
@@ -978,6 +973,57 @@ var definitions = {
978
973
  "bribeEnabled"
979
974
  ],
980
975
  additionalProperties: false
976
+ },
977
+ skinSettings: {
978
+ type: "object",
979
+ properties: {
980
+ bg_color: {
981
+ type: "string",
982
+ format: "color"
983
+ },
984
+ link_color: {
985
+ type: "string",
986
+ format: "color"
987
+ },
988
+ text_color: {
989
+ type: "string",
990
+ format: "color"
991
+ },
992
+ content_color: {
993
+ type: "string",
994
+ format: "color"
995
+ },
996
+ border_color: {
997
+ type: "string",
998
+ format: "color"
999
+ },
1000
+ heading_color: {
1001
+ type: "string",
1002
+ format: "color"
1003
+ },
1004
+ primary_color: {
1005
+ type: "string",
1006
+ format: "color"
1007
+ },
1008
+ header_color: {
1009
+ type: "string",
1010
+ format: "color"
1011
+ },
1012
+ theme: {
1013
+ type: "string",
1014
+ "enum": [
1015
+ "light",
1016
+ "dark"
1017
+ ]
1018
+ },
1019
+ logo: {
1020
+ type: "string",
1021
+ title: "logo",
1022
+ format: "customUrl",
1023
+ maxLength: 256
1024
+ }
1025
+ },
1026
+ additionalProperties: false
981
1027
  }
982
1028
  },
983
1029
  required: [
@@ -1010,11 +1056,7 @@ var definitions$1 = {
1010
1056
  body: {
1011
1057
  type: "string",
1012
1058
  title: "body",
1013
- minLength: 0,
1014
- maxLengthWithSpaceType: {
1015
- "default": 10000,
1016
- turbo: 40000
1017
- }
1059
+ minLength: 0
1018
1060
  },
1019
1061
  discussion: {
1020
1062
  type: "string",
@@ -1025,11 +1067,7 @@ var definitions$1 = {
1025
1067
  choices: {
1026
1068
  type: "array",
1027
1069
  title: "choices",
1028
- minItems: 1,
1029
- maxLengthWithSpaceType: {
1030
- "default": 500,
1031
- turbo: 1000
1032
- }
1070
+ minItems: 1
1033
1071
  },
1034
1072
  labels: {
1035
1073
  type: "array",
@@ -1125,11 +1163,7 @@ var definitions$2 = {
1125
1163
  body: {
1126
1164
  type: "string",
1127
1165
  title: "body",
1128
- minLength: 0,
1129
- maxLengthWithSpaceType: {
1130
- "default": 10000,
1131
- turbo: 20000
1132
- }
1166
+ minLength: 0
1133
1167
  },
1134
1168
  discussion: {
1135
1169
  type: "string",
@@ -1140,11 +1174,7 @@ var definitions$2 = {
1140
1174
  choices: {
1141
1175
  type: "array",
1142
1176
  title: "choices",
1143
- minItems: 1,
1144
- maxLengthWithSpaceType: {
1145
- "default": 500,
1146
- turbo: 1000
1147
- }
1177
+ minItems: 1
1148
1178
  },
1149
1179
  labels: {
1150
1180
  type: "array",
@@ -1519,12 +1549,13 @@ function getSnapshots(network_1, snapshot_1, provider_1, networks_1) {
1519
1549
 
1520
1550
  const providers = {};
1521
1551
  const DEFAULT_BROVIDER_URL = 'https://rpc.snapshot.org';
1522
- function getProvider(network, { broviderUrl = DEFAULT_BROVIDER_URL } = {}) {
1552
+ const DEFAULT_TIMEOUT = 25000;
1553
+ function getProvider(network, { broviderUrl = DEFAULT_BROVIDER_URL, timeout = DEFAULT_TIMEOUT } = {}) {
1523
1554
  const url = `${broviderUrl}/${network}`;
1524
1555
  if (!providers[network])
1525
1556
  providers[network] = new providers$1.StaticJsonRpcProvider({
1526
1557
  url,
1527
- timeout: 25000,
1558
+ timeout,
1528
1559
  allowGzip: true
1529
1560
  }, Number(network));
1530
1561
  return providers[network];
@@ -4204,46 +4235,6 @@ ajv.addKeyword({
4204
4235
  message: 'network not allowed'
4205
4236
  }
4206
4237
  });
4207
- ajv.addKeyword({
4208
- keyword: 'maxLengthWithSpaceType',
4209
- validate: function validate(schema, data) {
4210
- // @ts-ignore
4211
- const spaceType = this.spaceType || 'default';
4212
- const isValid = data.length <= schema[spaceType];
4213
- if (!isValid) {
4214
- // @ts-ignore
4215
- validate.errors = [
4216
- {
4217
- keyword: 'maxLengthWithSpaceType',
4218
- message: `must not have more than ${schema[spaceType]}`,
4219
- params: { limit: schema[spaceType] }
4220
- }
4221
- ];
4222
- }
4223
- return isValid;
4224
- },
4225
- errors: true
4226
- });
4227
- ajv.addKeyword({
4228
- keyword: 'maxItemsWithSpaceType',
4229
- validate: function validate(schema, data) {
4230
- // @ts-ignore
4231
- const spaceType = this.spaceType || 'default';
4232
- const isValid = data.length <= schema[spaceType];
4233
- if (!isValid) {
4234
- // @ts-ignore
4235
- validate.errors = [
4236
- {
4237
- keyword: 'maxItemsWithSpaceType',
4238
- message: `must NOT have more than ${schema[spaceType]} items`,
4239
- params: { limit: schema[spaceType] }
4240
- }
4241
- ];
4242
- }
4243
- return isValid;
4244
- },
4245
- errors: true
4246
- });
4247
4238
  // Custom URL format to allow empty string values
4248
4239
  // https://github.com/snapshot-labs/snapshot.js/pull/541/files
4249
4240
  ajv.addFormat('customUrl', {
@@ -529,7 +529,6 @@ var definitions = {
529
529
  symbol: {
530
530
  type: "string",
531
531
  title: "symbol",
532
- minLength: 1,
533
532
  maxLength: 16
534
533
  },
535
534
  skin: {
@@ -557,10 +556,6 @@ var definitions = {
557
556
  strategies: {
558
557
  type: "array",
559
558
  minItems: 1,
560
- maxItemsWithSpaceType: {
561
- "default": 8,
562
- turbo: 10
563
- },
564
559
  uniqueItems: true,
565
560
  items: {
566
561
  type: "object",
@@ -968,6 +963,57 @@ var definitions = {
968
963
  "bribeEnabled"
969
964
  ],
970
965
  additionalProperties: false
966
+ },
967
+ skinSettings: {
968
+ type: "object",
969
+ properties: {
970
+ bg_color: {
971
+ type: "string",
972
+ format: "color"
973
+ },
974
+ link_color: {
975
+ type: "string",
976
+ format: "color"
977
+ },
978
+ text_color: {
979
+ type: "string",
980
+ format: "color"
981
+ },
982
+ content_color: {
983
+ type: "string",
984
+ format: "color"
985
+ },
986
+ border_color: {
987
+ type: "string",
988
+ format: "color"
989
+ },
990
+ heading_color: {
991
+ type: "string",
992
+ format: "color"
993
+ },
994
+ primary_color: {
995
+ type: "string",
996
+ format: "color"
997
+ },
998
+ header_color: {
999
+ type: "string",
1000
+ format: "color"
1001
+ },
1002
+ theme: {
1003
+ type: "string",
1004
+ "enum": [
1005
+ "light",
1006
+ "dark"
1007
+ ]
1008
+ },
1009
+ logo: {
1010
+ type: "string",
1011
+ title: "logo",
1012
+ format: "customUrl",
1013
+ maxLength: 256
1014
+ }
1015
+ },
1016
+ additionalProperties: false
971
1017
  }
972
1018
  },
973
1019
  required: [
@@ -1000,11 +1046,7 @@ var definitions$1 = {
1000
1046
  body: {
1001
1047
  type: "string",
1002
1048
  title: "body",
1003
- minLength: 0,
1004
- maxLengthWithSpaceType: {
1005
- "default": 10000,
1006
- turbo: 40000
1007
- }
1049
+ minLength: 0
1008
1050
  },
1009
1051
  discussion: {
1010
1052
  type: "string",
@@ -1015,11 +1057,7 @@ var definitions$1 = {
1015
1057
  choices: {
1016
1058
  type: "array",
1017
1059
  title: "choices",
1018
- minItems: 1,
1019
- maxLengthWithSpaceType: {
1020
- "default": 500,
1021
- turbo: 1000
1022
- }
1060
+ minItems: 1
1023
1061
  },
1024
1062
  labels: {
1025
1063
  type: "array",
@@ -1115,11 +1153,7 @@ var definitions$2 = {
1115
1153
  body: {
1116
1154
  type: "string",
1117
1155
  title: "body",
1118
- minLength: 0,
1119
- maxLengthWithSpaceType: {
1120
- "default": 10000,
1121
- turbo: 20000
1122
- }
1156
+ minLength: 0
1123
1157
  },
1124
1158
  discussion: {
1125
1159
  type: "string",
@@ -1130,11 +1164,7 @@ var definitions$2 = {
1130
1164
  choices: {
1131
1165
  type: "array",
1132
1166
  title: "choices",
1133
- minItems: 1,
1134
- maxLengthWithSpaceType: {
1135
- "default": 500,
1136
- turbo: 1000
1137
- }
1167
+ minItems: 1
1138
1168
  },
1139
1169
  labels: {
1140
1170
  type: "array",
@@ -1509,12 +1539,13 @@ function getSnapshots(network_1, snapshot_1, provider_1, networks_1) {
1509
1539
 
1510
1540
  const providers = {};
1511
1541
  const DEFAULT_BROVIDER_URL = 'https://rpc.snapshot.org';
1512
- function getProvider(network, { broviderUrl = DEFAULT_BROVIDER_URL } = {}) {
1542
+ const DEFAULT_TIMEOUT = 25000;
1543
+ function getProvider(network, { broviderUrl = DEFAULT_BROVIDER_URL, timeout = DEFAULT_TIMEOUT } = {}) {
1513
1544
  const url = `${broviderUrl}/${network}`;
1514
1545
  if (!providers[network])
1515
1546
  providers[network] = new StaticJsonRpcProvider({
1516
1547
  url,
1517
- timeout: 25000,
1548
+ timeout,
1518
1549
  allowGzip: true
1519
1550
  }, Number(network));
1520
1551
  return providers[network];
@@ -4194,46 +4225,6 @@ ajv.addKeyword({
4194
4225
  message: 'network not allowed'
4195
4226
  }
4196
4227
  });
4197
- ajv.addKeyword({
4198
- keyword: 'maxLengthWithSpaceType',
4199
- validate: function validate(schema, data) {
4200
- // @ts-ignore
4201
- const spaceType = this.spaceType || 'default';
4202
- const isValid = data.length <= schema[spaceType];
4203
- if (!isValid) {
4204
- // @ts-ignore
4205
- validate.errors = [
4206
- {
4207
- keyword: 'maxLengthWithSpaceType',
4208
- message: `must not have more than ${schema[spaceType]}`,
4209
- params: { limit: schema[spaceType] }
4210
- }
4211
- ];
4212
- }
4213
- return isValid;
4214
- },
4215
- errors: true
4216
- });
4217
- ajv.addKeyword({
4218
- keyword: 'maxItemsWithSpaceType',
4219
- validate: function validate(schema, data) {
4220
- // @ts-ignore
4221
- const spaceType = this.spaceType || 'default';
4222
- const isValid = data.length <= schema[spaceType];
4223
- if (!isValid) {
4224
- // @ts-ignore
4225
- validate.errors = [
4226
- {
4227
- keyword: 'maxItemsWithSpaceType',
4228
- message: `must NOT have more than ${schema[spaceType]} items`,
4229
- params: { limit: schema[spaceType] }
4230
- }
4231
- ];
4232
- }
4233
- return isValid;
4234
- },
4235
- errors: true
4236
- });
4237
4228
  // Custom URL format to allow empty string values
4238
4229
  // https://github.com/snapshot-labs/snapshot.js/pull/541/files
4239
4230
  ajv.addFormat('customUrl', {