@@ -6,36 +6,62 @@ export const evmAddressSchema = z.string().regex(/^0x[a-fA-F0-9]{40}$/, 'Must be
6
6
7
7
export const evmIdSchema = z . string ( ) . regex ( / ^ 0 x [ a - f A - F 0 - 9 ] { 64 } $ / , 'Must be a valid EVM hash' ) ;
8
8
9
- export const providerSchema = z . object ( {
10
- url : z . string ( ) . url ( ) ,
11
- } ) ;
9
+ export const providerSchema = z
10
+ . object ( {
11
+ url : z . string ( ) . url ( ) ,
12
+ } )
13
+ . strict ( ) ;
12
14
13
15
export type Provider = z . infer < typeof providerSchema > ;
14
16
15
17
// Contracts are optional. If unspecified, they will be loaded from "airnode-protocol-v1" or error out during
16
18
// validation. We need a chain ID from parent schema to load the contracts.
17
- export const optionalContractsSchema = z . object ( {
18
- Api3ServerV1 : evmAddressSchema . optional ( ) ,
19
- } ) ;
19
+ export const optionalContractsSchema = z
20
+ . object ( {
21
+ Api3ServerV1 : evmAddressSchema . optional ( ) ,
22
+ } )
23
+ . strict ( ) ;
20
24
21
25
// The contracts are guaraneteed to exist after the configuration is passed, but the inferred type would be optional so
22
26
// we create a new schema just to infer the type correctly.
23
27
const contractsSchema = optionalContractsSchema . required ( ) ;
24
28
25
29
export type Contracts = z . infer < typeof contractsSchema > ;
26
30
31
+ export const temporaryBeaconDataSchema = z . object ( {
32
+ airnode : evmAddressSchema ,
33
+ templateId : evmIdSchema ,
34
+ } ) ;
35
+
36
+ export type TemporaryBeaconData = z . infer < typeof temporaryBeaconDataSchema > ;
37
+
38
+ // The DapiDataRegistry should live on-chain and Airseeker will query the contract for information. However, the
39
+ // contract does not exist as of now, so the data is hardcoded.
40
+ export const temporaryDapiDataRegistrySchema = z . object ( {
41
+ airnodeToSignedApiUrl : z . record ( z . string ( ) ) ,
42
+ dataFeedIdToBeacons : z . record ( z . array ( temporaryBeaconDataSchema ) ) ,
43
+ activeDapiNames : z . array ( z . string ( ) ) ,
44
+ } ) ;
45
+
46
+ export type TemporaryDapiDataRegistry = z . infer < typeof temporaryDapiDataRegistrySchema > ;
47
+
27
48
// Contracts are optional. If unspecified, they will be loaded from "airnode-protocol-v1" or error out during
28
49
// validation. We need a chain ID from parent schema to load the contracts.
29
- export const optionalChainSchema = z . object ( {
30
- providers : z . record ( providerSchema ) , // The record key is the provider "nickname"
31
- contracts : optionalContractsSchema . optional ( ) ,
32
- } ) ;
50
+ export const optionalChainSchema = z
51
+ . object ( {
52
+ providers : z . record ( providerSchema ) , // The record key is the provider "nickname"
53
+ __Temporary__DapiDataRegistry : temporaryDapiDataRegistrySchema ,
54
+ contracts : optionalContractsSchema . optional ( ) ,
55
+ } )
56
+ . strict ( ) ;
33
57
34
58
// The contracts are guaraneteed to exist after the configuration is passed, but the inferred type would be optional so
35
59
// we create a new schema just to infer the type correctly.
36
- const chainSchema = optionalChainSchema . extend ( {
37
- contracts : contractsSchema ,
38
- } ) ;
60
+ const chainSchema = optionalChainSchema
61
+ . extend ( {
62
+ contracts : contractsSchema ,
63
+ } )
64
+ . strict ( ) ;
39
65
40
66
export type Chain = z . infer < typeof chainSchema > ;
41
67
0 commit comments