File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @snapshot-labs/snapshot.js" ,
3
- "version" : " 0.12.23 " ,
3
+ "version" : " 0.12.24 " ,
4
4
"repository" : " snapshot-labs/snapshot.js" ,
5
5
"license" : " MIT" ,
6
6
"main" : " dist/snapshot.cjs.js" ,
Original file line number Diff line number Diff line change @@ -36,7 +36,16 @@ const ENS_ABI = [
36
36
'function resolver(bytes32 node) view returns (address)' // ENS registry ABI
37
37
] ;
38
38
const EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000' ;
39
- const STARKNET_NETWORKS = [ '0x534e5f4d41494e' , '0x534e5f5345504f4c4941' ] ;
39
+ const STARKNET_NETWORKS = {
40
+ '0x534e5f4d41494e' : {
41
+ name : 'Starknet' ,
42
+ testnet : false
43
+ } ,
44
+ '0x534e5f5345504f4c4941' : {
45
+ name : 'Starknet Sepolia' ,
46
+ testnet : true
47
+ }
48
+ } ;
40
49
41
50
const scoreApiHeaders = {
42
51
Accept : 'application/json' ,
@@ -170,7 +179,15 @@ ajv.addKeyword({
170
179
ajv . addKeyword ( {
171
180
keyword : 'starknetNetwork' ,
172
181
validate : function ( schema , data ) {
173
- return STARKNET_NETWORKS . includes ( data ) ;
182
+ // @ts -ignore
183
+ const snapshotEnv = this . snapshotEnv || 'default' ;
184
+ if ( snapshotEnv === 'mainnet' ) {
185
+ return Object . keys ( STARKNET_NETWORKS )
186
+ . filter ( ( id ) => ! STARKNET_NETWORKS [ id ] . testnet )
187
+ . includes ( data ) ;
188
+ }
189
+
190
+ return Object . keys ( STARKNET_NETWORKS ) . includes ( data ) ;
174
191
} ,
175
192
error : {
176
193
message : 'network not allowed'
Original file line number Diff line number Diff line change 50
50
"name" : " Mainnet Starknet treasury" ,
51
51
"address" : " 0x05702362b68a350c1cae8f2a529d74fdbb502369ddcebfadac7e91da37636947" ,
52
52
"network" : " 0x534e5f4d41494e"
53
- },
54
- {
55
- "name" : " Sepolia Starknet treasury" ,
56
- "address" : " 0x05702362b68a350c1cae8f2a529d74fdbb502369ddcebfadac7e91da37636947" ,
57
- "network" : " 0x534e5f5345504f4c4941"
58
53
}
59
54
],
60
55
"labels" : [
You can’t perform that action at this time.
0 commit comments