@api3/airnode-validator
Advanced tools
Comparing version 0.0.0-snapshot-v0.8.0-20220906140908 to 0.0.0-snapshot-v0.9.0-20221003100627
{ | ||
"name": "@api3/airnode-validator", | ||
"license": "MIT", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"private": false, | ||
@@ -26,19 +26,19 @@ "main": "./dist/cjs/src/index.js", | ||
"dependencies": { | ||
"@api3/ois": "^1.1.1", | ||
"@api3/ois": "1.2.0", | ||
"@api3/promise-utils": "^0.3.0", | ||
"dotenv": "^16.0.2", | ||
"ethers": "^5.7.0", | ||
"ethers": "^5.7.1", | ||
"lodash": "^4.17.21", | ||
"ora": "^5.4.1", | ||
"yargs": "^17.5.1", | ||
"zod": "^3.17.3" | ||
"zod": "^3.19.1" | ||
}, | ||
"devDependencies": { | ||
"@types/yargs": "^17.0.12", | ||
"jest": "^29.0.2", | ||
"@types/yargs": "^17.0.13", | ||
"jest": "^29.0.3", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^28.0.8", | ||
"ts-jest": "^29.0.2", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.2" | ||
"typescript": "^4.8.3" | ||
} | ||
} |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.configSchema = exports.apiCredentialsSchema = exports.baseApiCredentialsSchema = exports.nodeSettingsSchema = exports.localOrCloudProviderSchema = exports.cloudProviderSchema = exports.gcpCloudProviderSchema = exports.awsCloudProviderSchema = exports.localProviderSchema = exports.heartbeatSchema = exports.disabledHeartbeatSchema = exports.enabledHeartbeatSchema = exports.gatewaySchema = exports.disabledGatewaySchema = exports.enabledGatewaySchema = exports.corsOriginsSchema = exports.apiKeySchema = exports.chainConfigSchema = exports.chainAuthorizersSchema = exports.chainAuthorizationsSchema = exports.chainOptionsSchema = exports.gasPriceOracleSchema = exports.validateGasPriceOracleStrategies = exports.gasPriceOracleStrategySchema = exports.constantGasPriceStrategySchema = exports.providerRecommendedEip1559GasPriceStrategySchema = exports.providerRecommendedGasPriceStrategySchema = exports.latestBlockPercentileGasPriceStrategySchema = exports.amountSchema = exports.providerSchema = exports.chainContractsSchema = exports.chainTypeSchema = exports.logFormatSchema = exports.logLevelSchema = exports.templateSchema = exports.triggersSchema = exports.rrpTriggerSchema = exports.triggerSchema = exports.endpointIdSchema = exports.evmIdSchema = exports.evmAddressSchema = void 0; | ||
exports.configSchema = exports.apiCredentialsSchema = exports.baseApiCredentialsSchema = exports.nodeSettingsSchema = exports.localOrCloudProviderSchema = exports.cloudProviderSchema = exports.gcpCloudProviderSchema = exports.awsCloudProviderSchema = exports.localProviderSchema = exports.heartbeatSchema = exports.disabledHeartbeatSchema = exports.enabledHeartbeatSchema = exports.gatewaySchema = exports.disabledGatewaySchema = exports.enabledGatewaySchema = exports.corsOriginsSchema = exports.apiKeySchema = exports.chainConfigSchema = exports.maxConcurrencySchema = exports.chainAuthorizersSchema = exports.chainAuthorizationsSchema = exports.chainOptionsSchema = exports.gasPriceOracleSchema = exports.validateGasPriceOracleStrategies = exports.gasPriceOracleStrategySchema = exports.constantGasPriceStrategySchema = exports.providerRecommendedEip1559GasPriceStrategySchema = exports.providerRecommendedGasPriceStrategySchema = exports.latestBlockPercentileGasPriceStrategySchema = exports.amountSchema = exports.providersSchema = exports.providerSchema = exports.chainContractsSchema = exports.chainTypeSchema = exports.logFormatSchema = exports.logLevelSchema = exports.templateSchema = exports.triggersSchema = exports.rrpTriggerSchema = exports.triggerSchema = exports.endpointIdSchema = exports.evmIdSchema = exports.evmAddressSchema = void 0; | ||
const ethers_1 = require("ethers"); | ||
@@ -12,2 +12,4 @@ const zod_1 = require("zod"); | ||
const includes_1 = __importDefault(require("lodash/includes")); | ||
const size_1 = __importDefault(require("lodash/size")); | ||
const promise_utils_1 = require("@api3/promise-utils"); | ||
const package_json_1 = require("../../package.json"); | ||
@@ -60,2 +62,3 @@ const ois_1 = require("../ois"); | ||
.strict(); | ||
exports.providersSchema = zod_1.z.record(zod_1.z.string(), exports.providerSchema); | ||
exports.amountSchema = zod_1.z | ||
@@ -146,2 +149,12 @@ .object({ | ||
}); | ||
exports.maxConcurrencySchema = zod_1.z.number().int().positive(); | ||
const validateMaxConcurrency = (chainConfig, ctx) => { | ||
if (chainConfig.maxConcurrency < (0, size_1.default)(chainConfig.providers)) { | ||
ctx.addIssue({ | ||
code: zod_1.z.ZodIssueCode.custom, | ||
message: `Concurrency limit can't be lower than the number of providers for given chain`, | ||
path: ['maxConcurrency'], | ||
}); | ||
} | ||
}; | ||
exports.chainConfigSchema = zod_1.z | ||
@@ -157,6 +170,7 @@ .object({ | ||
options: exports.chainOptionsSchema, | ||
providers: zod_1.z.record(zod_1.z.string(), exports.providerSchema), | ||
maxConcurrency: zod_1.z.number().int(), | ||
providers: exports.providersSchema, | ||
maxConcurrency: exports.maxConcurrencySchema, | ||
}) | ||
.strict(); | ||
.strict() | ||
.superRefine(validateMaxConcurrency); | ||
exports.apiKeySchema = zod_1.z.string().min(30).max(120); | ||
@@ -168,3 +182,3 @@ exports.corsOriginsSchema = zod_1.z.array(zod_1.z.string()); | ||
apiKey: exports.apiKeySchema, | ||
maxConcurrency: zod_1.z.number().int(), | ||
maxConcurrency: zod_1.z.number().int().positive(), | ||
corsOrigins: exports.corsOriginsSchema, | ||
@@ -226,5 +240,15 @@ }) | ||
]); | ||
const validateMnemonic = (mnemonic, ctx) => { | ||
const goWallet = (0, promise_utils_1.goSync)(() => ethers_1.ethers.Wallet.fromMnemonic(mnemonic)); | ||
if (!goWallet.success) { | ||
ctx.addIssue({ | ||
code: zod_1.z.ZodIssueCode.custom, | ||
message: 'Airnode wallet mnemonic is not a valid mnemonic', | ||
path: [], | ||
}); | ||
} | ||
}; | ||
exports.nodeSettingsSchema = zod_1.z | ||
.object({ | ||
airnodeWalletMnemonic: zod_1.z.string(), | ||
airnodeWalletMnemonic: zod_1.z.string().superRefine(validateMnemonic), | ||
heartbeat: exports.heartbeatSchema, | ||
@@ -231,0 +255,0 @@ httpGateway: exports.gatewaySchema, |
@@ -26,3 +26,2 @@ import { z } from 'zod'; | ||
nodeVersion: z.ZodEffects<z.ZodString, string, string>; | ||
airnodeAddressShort: z.ZodString; | ||
stage: z.ZodString; | ||
@@ -71,3 +70,2 @@ cloudProvider: z.ZodDiscriminatedUnion<"type", z.Primitive, z.ZodObject<{ | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -87,6 +85,5 @@ }, { | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}>; | ||
export declare const receiptSchema: z.ZodEffects<z.ZodObject<{ | ||
export declare const receiptSchema: z.ZodObject<{ | ||
airnodeWallet: z.ZodEffects<z.ZodObject<{ | ||
@@ -115,3 +112,2 @@ airnodeAddress: z.ZodString; | ||
nodeVersion: z.ZodEffects<z.ZodString, string, string>; | ||
airnodeAddressShort: z.ZodString; | ||
stage: z.ZodString; | ||
@@ -160,3 +156,2 @@ cloudProvider: z.ZodDiscriminatedUnion<"type", z.Primitive, z.ZodObject<{ | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -176,3 +171,2 @@ }, { | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -200,3 +194,2 @@ }>; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -224,52 +217,5 @@ }; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}>, { | ||
airnodeWallet: { | ||
airnodeAddress: string; | ||
airnodeAddressShort: string; | ||
airnodeXpub: string; | ||
}; | ||
deployment: { | ||
stage: string; | ||
cloudProvider: { | ||
type: "aws"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
} | { | ||
type: "gcp"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
projectId: string; | ||
}; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}, { | ||
airnodeWallet: { | ||
airnodeAddress: string; | ||
airnodeAddressShort: string; | ||
airnodeXpub: string; | ||
}; | ||
deployment: { | ||
stage: string; | ||
cloudProvider: { | ||
type: "aws"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
} | { | ||
type: "gcp"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
projectId: string; | ||
}; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}>; | ||
@@ -276,0 +222,0 @@ export declare type AirnodeWallet = SchemaType<typeof airnodeWalletSchema>; |
@@ -68,3 +68,2 @@ "use strict"; | ||
}), | ||
airnodeAddressShort: zod_1.z.string(), | ||
stage: zod_1.z.string().regex(/^[a-z0-9-]{1,16}$/), | ||
@@ -81,13 +80,3 @@ cloudProvider: config_1.cloudProviderSchema, | ||
}) | ||
.strict() | ||
.superRefine(({ airnodeWallet, deployment }, ctx) => { | ||
// TODO: There's no need to have Airnode short address twice in the receipt.json | ||
if (airnodeWallet.airnodeAddressShort !== deployment.airnodeAddressShort) { | ||
ctx.addIssue({ | ||
code: zod_1.z.ZodIssueCode.custom, | ||
message: `Airnode short addresses don't match`, | ||
path: ['airnodeWallet', 'airnodeAddressShort'], | ||
}); | ||
} | ||
}); | ||
.strict(); | ||
//# sourceMappingURL=receipt.js.map |
{ | ||
"name": "@api3/airnode-validator", | ||
"license": "MIT", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"private": false, | ||
@@ -26,19 +26,19 @@ "main": "./dist/cjs/src/index.js", | ||
"dependencies": { | ||
"@api3/ois": "^1.1.1", | ||
"@api3/ois": "1.2.0", | ||
"@api3/promise-utils": "^0.3.0", | ||
"dotenv": "^16.0.2", | ||
"ethers": "^5.7.0", | ||
"ethers": "^5.7.1", | ||
"lodash": "^4.17.21", | ||
"ora": "^5.4.1", | ||
"yargs": "^17.5.1", | ||
"zod": "^3.17.3" | ||
"zod": "^3.19.1" | ||
}, | ||
"devDependencies": { | ||
"@types/yargs": "^17.0.12", | ||
"jest": "^29.0.2", | ||
"@types/yargs": "^17.0.13", | ||
"jest": "^29.0.3", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^28.0.8", | ||
"ts-jest": "^29.0.2", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.2" | ||
"typescript": "^4.8.3" | ||
} | ||
} |
@@ -5,2 +5,4 @@ import { ethers } from 'ethers'; | ||
import includes from 'lodash/includes'; | ||
import size from 'lodash/size'; | ||
import { goSync } from '@api3/promise-utils'; | ||
import { version as packageVersion } from '../../package.json'; | ||
@@ -53,2 +55,3 @@ import { oisSchema, RELAY_METADATA_TYPES } from '../ois'; | ||
.strict(); | ||
export const providersSchema = z.record(z.string(), providerSchema); | ||
export const amountSchema = z | ||
@@ -138,2 +141,12 @@ .object({ | ||
}); | ||
export const maxConcurrencySchema = z.number().int().positive(); | ||
const validateMaxConcurrency = (chainConfig, ctx) => { | ||
if (chainConfig.maxConcurrency < size(chainConfig.providers)) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: `Concurrency limit can't be lower than the number of providers for given chain`, | ||
path: ['maxConcurrency'], | ||
}); | ||
} | ||
}; | ||
export const chainConfigSchema = z | ||
@@ -149,6 +162,7 @@ .object({ | ||
options: chainOptionsSchema, | ||
providers: z.record(z.string(), providerSchema), | ||
maxConcurrency: z.number().int(), | ||
providers: providersSchema, | ||
maxConcurrency: maxConcurrencySchema, | ||
}) | ||
.strict(); | ||
.strict() | ||
.superRefine(validateMaxConcurrency); | ||
export const apiKeySchema = z.string().min(30).max(120); | ||
@@ -160,3 +174,3 @@ export const corsOriginsSchema = z.array(z.string()); | ||
apiKey: apiKeySchema, | ||
maxConcurrency: z.number().int(), | ||
maxConcurrency: z.number().int().positive(), | ||
corsOrigins: corsOriginsSchema, | ||
@@ -218,5 +232,15 @@ }) | ||
]); | ||
const validateMnemonic = (mnemonic, ctx) => { | ||
const goWallet = goSync(() => ethers.Wallet.fromMnemonic(mnemonic)); | ||
if (!goWallet.success) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: 'Airnode wallet mnemonic is not a valid mnemonic', | ||
path: [], | ||
}); | ||
} | ||
}; | ||
export const nodeSettingsSchema = z | ||
.object({ | ||
airnodeWalletMnemonic: z.string(), | ||
airnodeWalletMnemonic: z.string().superRefine(validateMnemonic), | ||
heartbeat: heartbeatSchema, | ||
@@ -223,0 +247,0 @@ httpGateway: gatewaySchema, |
@@ -26,3 +26,2 @@ import { z } from 'zod'; | ||
nodeVersion: z.ZodEffects<z.ZodString, string, string>; | ||
airnodeAddressShort: z.ZodString; | ||
stage: z.ZodString; | ||
@@ -71,3 +70,2 @@ cloudProvider: z.ZodDiscriminatedUnion<"type", z.Primitive, z.ZodObject<{ | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -87,6 +85,5 @@ }, { | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}>; | ||
export declare const receiptSchema: z.ZodEffects<z.ZodObject<{ | ||
export declare const receiptSchema: z.ZodObject<{ | ||
airnodeWallet: z.ZodEffects<z.ZodObject<{ | ||
@@ -115,3 +112,2 @@ airnodeAddress: z.ZodString; | ||
nodeVersion: z.ZodEffects<z.ZodString, string, string>; | ||
airnodeAddressShort: z.ZodString; | ||
stage: z.ZodString; | ||
@@ -160,3 +156,2 @@ cloudProvider: z.ZodDiscriminatedUnion<"type", z.Primitive, z.ZodObject<{ | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -176,3 +171,2 @@ }, { | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -200,3 +194,2 @@ }>; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -224,52 +217,5 @@ }; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}>, { | ||
airnodeWallet: { | ||
airnodeAddress: string; | ||
airnodeAddressShort: string; | ||
airnodeXpub: string; | ||
}; | ||
deployment: { | ||
stage: string; | ||
cloudProvider: { | ||
type: "aws"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
} | { | ||
type: "gcp"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
projectId: string; | ||
}; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}, { | ||
airnodeWallet: { | ||
airnodeAddress: string; | ||
airnodeAddressShort: string; | ||
airnodeXpub: string; | ||
}; | ||
deployment: { | ||
stage: string; | ||
cloudProvider: { | ||
type: "aws"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
} | { | ||
type: "gcp"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
projectId: string; | ||
}; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}>; | ||
@@ -276,0 +222,0 @@ export declare type AirnodeWallet = SchemaType<typeof airnodeWalletSchema>; |
@@ -42,3 +42,2 @@ import { z } from 'zod'; | ||
}), | ||
airnodeAddressShort: z.string(), | ||
stage: z.string().regex(/^[a-z0-9-]{1,16}$/), | ||
@@ -55,13 +54,3 @@ cloudProvider: cloudProviderSchema, | ||
}) | ||
.strict() | ||
.superRefine(({ airnodeWallet, deployment }, ctx) => { | ||
// TODO: There's no need to have Airnode short address twice in the receipt.json | ||
if (airnodeWallet.airnodeAddressShort !== deployment.airnodeAddressShort) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: `Airnode short addresses don't match`, | ||
path: ['airnodeWallet', 'airnodeAddressShort'], | ||
}); | ||
} | ||
}); | ||
.strict(); | ||
//# sourceMappingURL=receipt.js.map |
{ | ||
"name": "@api3/airnode-validator", | ||
"license": "MIT", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"private": false, | ||
@@ -26,19 +26,19 @@ "main": "./dist/cjs/src/index.js", | ||
"dependencies": { | ||
"@api3/ois": "^1.1.1", | ||
"@api3/ois": "1.2.0", | ||
"@api3/promise-utils": "^0.3.0", | ||
"dotenv": "^16.0.2", | ||
"ethers": "^5.7.0", | ||
"ethers": "^5.7.1", | ||
"lodash": "^4.17.21", | ||
"ora": "^5.4.1", | ||
"yargs": "^17.5.1", | ||
"zod": "^3.17.3" | ||
"zod": "^3.19.1" | ||
}, | ||
"devDependencies": { | ||
"@types/yargs": "^17.0.12", | ||
"jest": "^29.0.2", | ||
"@types/yargs": "^17.0.13", | ||
"jest": "^29.0.3", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^28.0.8", | ||
"ts-jest": "^29.0.2", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.2" | ||
"typescript": "^4.8.3" | ||
} | ||
} |
@@ -5,2 +5,4 @@ import { ethers } from 'ethers'; | ||
import includes from 'lodash/includes'; | ||
import size from 'lodash/size'; | ||
import { goSync } from '@api3/promise-utils'; | ||
import { version as packageVersion } from '../../package.json'; | ||
@@ -53,2 +55,3 @@ import { oisSchema, RELAY_METADATA_TYPES } from '../ois'; | ||
.strict(); | ||
export const providersSchema = z.record(z.string(), providerSchema); | ||
export const amountSchema = z | ||
@@ -137,2 +140,12 @@ .object({ | ||
}); | ||
export const maxConcurrencySchema = z.number().int().positive(); | ||
const validateMaxConcurrency = (chainConfig, ctx) => { | ||
if (chainConfig.maxConcurrency < size(chainConfig.providers)) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: `Concurrency limit can't be lower than the number of providers for given chain`, | ||
path: ['maxConcurrency'], | ||
}); | ||
} | ||
}; | ||
export const chainConfigSchema = z | ||
@@ -148,6 +161,7 @@ .object({ | ||
options: chainOptionsSchema, | ||
providers: z.record(z.string(), providerSchema), | ||
maxConcurrency: z.number().int(), | ||
providers: providersSchema, | ||
maxConcurrency: maxConcurrencySchema, | ||
}) | ||
.strict(); | ||
.strict() | ||
.superRefine(validateMaxConcurrency); | ||
export const apiKeySchema = z.string().min(30).max(120); | ||
@@ -159,3 +173,3 @@ export const corsOriginsSchema = z.array(z.string()); | ||
apiKey: apiKeySchema, | ||
maxConcurrency: z.number().int(), | ||
maxConcurrency: z.number().int().positive(), | ||
corsOrigins: corsOriginsSchema, | ||
@@ -217,5 +231,15 @@ }) | ||
]); | ||
const validateMnemonic = (mnemonic, ctx) => { | ||
const goWallet = goSync(() => ethers.Wallet.fromMnemonic(mnemonic)); | ||
if (!goWallet.success) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: 'Airnode wallet mnemonic is not a valid mnemonic', | ||
path: [], | ||
}); | ||
} | ||
}; | ||
export const nodeSettingsSchema = z | ||
.object({ | ||
airnodeWalletMnemonic: z.string(), | ||
airnodeWalletMnemonic: z.string().superRefine(validateMnemonic), | ||
heartbeat: heartbeatSchema, | ||
@@ -222,0 +246,0 @@ httpGateway: gatewaySchema, |
@@ -26,3 +26,2 @@ import { z } from 'zod'; | ||
nodeVersion: z.ZodEffects<z.ZodString, string, string>; | ||
airnodeAddressShort: z.ZodString; | ||
stage: z.ZodString; | ||
@@ -71,3 +70,2 @@ cloudProvider: z.ZodDiscriminatedUnion<"type", z.Primitive, z.ZodObject<{ | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -87,6 +85,5 @@ }, { | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}>; | ||
export declare const receiptSchema: z.ZodEffects<z.ZodObject<{ | ||
export declare const receiptSchema: z.ZodObject<{ | ||
airnodeWallet: z.ZodEffects<z.ZodObject<{ | ||
@@ -115,3 +112,2 @@ airnodeAddress: z.ZodString; | ||
nodeVersion: z.ZodEffects<z.ZodString, string, string>; | ||
airnodeAddressShort: z.ZodString; | ||
stage: z.ZodString; | ||
@@ -160,3 +156,2 @@ cloudProvider: z.ZodDiscriminatedUnion<"type", z.Primitive, z.ZodObject<{ | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -176,3 +171,2 @@ }, { | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -200,3 +194,2 @@ }>; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
@@ -224,52 +217,5 @@ }; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}>, { | ||
airnodeWallet: { | ||
airnodeAddress: string; | ||
airnodeAddressShort: string; | ||
airnodeXpub: string; | ||
}; | ||
deployment: { | ||
stage: string; | ||
cloudProvider: { | ||
type: "aws"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
} | { | ||
type: "gcp"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
projectId: string; | ||
}; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}, { | ||
airnodeWallet: { | ||
airnodeAddress: string; | ||
airnodeAddressShort: string; | ||
airnodeXpub: string; | ||
}; | ||
deployment: { | ||
stage: string; | ||
cloudProvider: { | ||
type: "aws"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
} | { | ||
type: "gcp"; | ||
region: string; | ||
disableConcurrencyReservations: boolean; | ||
projectId: string; | ||
}; | ||
nodeVersion: string; | ||
airnodeAddressShort: string; | ||
timestamp: string; | ||
}; | ||
success: boolean; | ||
}>; | ||
@@ -276,0 +222,0 @@ export declare type AirnodeWallet = SchemaType<typeof airnodeWalletSchema>; |
@@ -42,3 +42,2 @@ import { z } from 'zod'; | ||
}), | ||
airnodeAddressShort: z.string(), | ||
stage: z.string().regex(/^[a-z0-9-]{1,16}$/), | ||
@@ -55,13 +54,3 @@ cloudProvider: cloudProviderSchema, | ||
}) | ||
.strict() | ||
.superRefine(({ airnodeWallet, deployment }, ctx) => { | ||
// TODO: There's no need to have Airnode short address twice in the receipt.json | ||
if (airnodeWallet.airnodeAddressShort !== deployment.airnodeAddressShort) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: `Airnode short addresses don't match`, | ||
path: ['airnodeWallet', 'airnodeAddressShort'], | ||
}); | ||
} | ||
}); | ||
.strict(); | ||
//# sourceMappingURL=receipt.js.map |
{ | ||
"name": "@api3/airnode-validator", | ||
"license": "MIT", | ||
"version": "0.0.0-snapshot-v0.8.0-20220906140908", | ||
"version": "0.0.0-snapshot-v0.9.0-20221003100627", | ||
"private": false, | ||
@@ -26,19 +26,19 @@ "main": "./dist/cjs/src/index.js", | ||
"dependencies": { | ||
"@api3/ois": "^1.1.1", | ||
"@api3/ois": "1.2.0", | ||
"@api3/promise-utils": "^0.3.0", | ||
"dotenv": "^16.0.2", | ||
"ethers": "^5.7.0", | ||
"ethers": "^5.7.1", | ||
"lodash": "^4.17.21", | ||
"ora": "^5.4.1", | ||
"yargs": "^17.5.1", | ||
"zod": "^3.17.3" | ||
"zod": "^3.19.1" | ||
}, | ||
"devDependencies": { | ||
"@types/yargs": "^17.0.12", | ||
"jest": "^29.0.2", | ||
"@types/yargs": "^17.0.13", | ||
"jest": "^29.0.3", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^28.0.8", | ||
"ts-jest": "^29.0.2", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.2" | ||
"typescript": "^4.8.3" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
861560
20780
0
+ Added@api3/ois@1.2.0(transitive)
+ Addeddotenv@16.4.5(transitive)
- Removed@api3/ois@1.4.0(transitive)
- Removeddotenv@16.4.6(transitive)
Updated@api3/ois@1.2.0
Updatedethers@^5.7.1
Updatedzod@^3.19.1