@snapshot-labs/snapshot.js 0.12.22 → 0.12.23

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.
@@ -716,20 +716,32 @@ var definitions = {
716
716
  },
717
717
  delegationContract: {
718
718
  type: "string",
719
- format: "evmAddress",
720
719
  title: "Contract address",
721
720
  description: "The address of your delegation contract",
722
721
  examples: [
723
722
  "0x3901D0fDe202aF1427216b79f5243f8A022d68cf"
723
+ ],
724
+ anyOf: [
725
+ {
726
+ format: "evmAddress"
727
+ },
728
+ {
729
+ format: "starknetAddress"
730
+ }
724
731
  ]
725
732
  },
726
733
  delegationNetwork: {
727
734
  type: "string",
728
- snapshotNetwork: true,
729
735
  title: "Delegation network",
730
- minLength: 1,
731
- maxLength: 32,
732
- description: "The network of your delegation contract"
736
+ description: "The network of your delegation contract",
737
+ anyOf: [
738
+ {
739
+ snapshotNetwork: true
740
+ },
741
+ {
742
+ starknetNetwork: true
743
+ }
744
+ ]
733
745
  },
734
746
  delegationApi: {
735
747
  type: "string",
@@ -743,6 +755,7 @@ var definitions = {
743
755
  },
744
756
  required: [
745
757
  "delegationType",
758
+ "delegationNetwork",
746
759
  "delegationApi",
747
760
  "delegationContract"
748
761
  ],
@@ -856,9 +869,15 @@ var definitions = {
856
869
  },
857
870
  network: {
858
871
  type: "string",
859
- snapshotNetwork: true,
860
872
  title: "Network",
861
- maxLength: 12
873
+ anyOf: [
874
+ {
875
+ snapshotNetwork: true
876
+ },
877
+ {
878
+ starknetNetwork: true
879
+ }
880
+ ]
862
881
  }
863
882
  },
864
883
  required: [
@@ -3857,6 +3876,7 @@ const ENS_ABI = [
3857
3876
  'function resolver(bytes32 node) view returns (address)' // ENS registry ABI
3858
3877
  ];
3859
3878
  const EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000';
3879
+ const STARKNET_NETWORKS = ['0x534e5f4d41494e', '0x534e5f5345504f4c4941'];
3860
3880
  const scoreApiHeaders = {
3861
3881
  Accept: 'application/json',
3862
3882
  'Content-Type': 'application/json'
@@ -3978,6 +3998,15 @@ ajv.addKeyword({
3978
3998
  message: 'network not allowed'
3979
3999
  }
3980
4000
  });
4001
+ ajv.addKeyword({
4002
+ keyword: 'starknetNetwork',
4003
+ validate: function (schema, data) {
4004
+ return STARKNET_NETWORKS.includes(data);
4005
+ },
4006
+ error: {
4007
+ message: 'network not allowed'
4008
+ }
4009
+ });
3981
4010
  ajv.addKeyword({
3982
4011
  keyword: 'maxLengthWithSpaceType',
3983
4012
  validate: function validate(schema, data) {
@@ -706,20 +706,32 @@ var definitions = {
706
706
  },
707
707
  delegationContract: {
708
708
  type: "string",
709
- format: "evmAddress",
710
709
  title: "Contract address",
711
710
  description: "The address of your delegation contract",
712
711
  examples: [
713
712
  "0x3901D0fDe202aF1427216b79f5243f8A022d68cf"
713
+ ],
714
+ anyOf: [
715
+ {
716
+ format: "evmAddress"
717
+ },
718
+ {
719
+ format: "starknetAddress"
720
+ }
714
721
  ]
715
722
  },
716
723
  delegationNetwork: {
717
724
  type: "string",
718
- snapshotNetwork: true,
719
725
  title: "Delegation network",
720
- minLength: 1,
721
- maxLength: 32,
722
- description: "The network of your delegation contract"
726
+ description: "The network of your delegation contract",
727
+ anyOf: [
728
+ {
729
+ snapshotNetwork: true
730
+ },
731
+ {
732
+ starknetNetwork: true
733
+ }
734
+ ]
723
735
  },
724
736
  delegationApi: {
725
737
  type: "string",
@@ -733,6 +745,7 @@ var definitions = {
733
745
  },
734
746
  required: [
735
747
  "delegationType",
748
+ "delegationNetwork",
736
749
  "delegationApi",
737
750
  "delegationContract"
738
751
  ],
@@ -846,9 +859,15 @@ var definitions = {
846
859
  },
847
860
  network: {
848
861
  type: "string",
849
- snapshotNetwork: true,
850
862
  title: "Network",
851
- maxLength: 12
863
+ anyOf: [
864
+ {
865
+ snapshotNetwork: true
866
+ },
867
+ {
868
+ starknetNetwork: true
869
+ }
870
+ ]
852
871
  }
853
872
  },
854
873
  required: [
@@ -3847,6 +3866,7 @@ const ENS_ABI = [
3847
3866
  'function resolver(bytes32 node) view returns (address)' // ENS registry ABI
3848
3867
  ];
3849
3868
  const EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000';
3869
+ const STARKNET_NETWORKS = ['0x534e5f4d41494e', '0x534e5f5345504f4c4941'];
3850
3870
  const scoreApiHeaders = {
3851
3871
  Accept: 'application/json',
3852
3872
  'Content-Type': 'application/json'
@@ -3968,6 +3988,15 @@ ajv.addKeyword({
3968
3988
  message: 'network not allowed'
3969
3989
  }
3970
3990
  });
3991
+ ajv.addKeyword({
3992
+ keyword: 'starknetNetwork',
3993
+ validate: function (schema, data) {
3994
+ return STARKNET_NETWORKS.includes(data);
3995
+ },
3996
+ error: {
3997
+ message: 'network not allowed'
3998
+ }
3999
+ });
3971
4000
  ajv.addKeyword({
3972
4001
  keyword: 'maxLengthWithSpaceType',
3973
4002
  validate: function validate(schema, data) {