Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web3-validator

Package Overview
Dependencies
Maintainers
0
Versions
369
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-validator - npm Package Compare versions

Comparing version 2.0.7-dev.70352cd.0 to 2.0.7-dev.7109fb2.0

lib/commonjs/tsconfig.cjs.tsbuildinfo

24

lib/commonjs/types.d.ts
import { AbiParameter } from 'web3-types';
import { ZodIssueBase } from 'zod';
export declare type ValidInputTypes = Uint8Array | bigint | string | number | boolean;
export declare type EthBaseTypes = 'bool' | 'bytes' | 'string' | 'uint' | 'int' | 'address' | 'tuple';
export declare type EthBaseTypesWithMeta = `string${string}` | `string${string}[${number}]` | `bytes${string}` | `bytes${string}[${number}]` | `address[${number}]` | `bool[${number}]` | `int${string}` | `int${string}[${number}]` | `uint${string}` | `uint${string}[${number}]` | `tuple[]` | `tuple[${number}]`;
export declare type EthExtendedTypes = 'hex' | 'number' | 'blockNumber' | 'blockNumberOrTag' | 'filter' | 'bloom';
export declare type FullValidationSchema = ReadonlyArray<AbiParameter>;
export declare type ShortValidationSchema = ReadonlyArray<string | EthBaseTypes | EthExtendedTypes | EthBaseTypesWithMeta | ShortValidationSchema>;
export declare type ValidationSchemaInput = FullValidationSchema | ShortValidationSchema;
export declare type Web3ValidationOptions = {
export type ValidInputTypes = Uint8Array | bigint | string | number | boolean;
export type EthBaseTypes = 'bool' | 'bytes' | 'string' | 'uint' | 'int' | 'address' | 'tuple';
export type EthBaseTypesWithMeta = `string${string}` | `string${string}[${number}]` | `bytes${string}` | `bytes${string}[${number}]` | `address[${number}]` | `bool[${number}]` | `int${string}` | `int${string}[${number}]` | `uint${string}` | `uint${string}[${number}]` | `tuple[]` | `tuple[${number}]`;
export type EthExtendedTypes = 'hex' | 'number' | 'blockNumber' | 'blockNumberOrTag' | 'filter' | 'bloom';
export type FullValidationSchema = ReadonlyArray<AbiParameter>;
export type ShortValidationSchema = ReadonlyArray<string | EthBaseTypes | EthExtendedTypes | EthBaseTypesWithMeta | ShortValidationSchema>;
export type ValidationSchemaInput = FullValidationSchema | ShortValidationSchema;
export type Web3ValidationOptions = {
readonly silent: boolean;
};
export declare type Json = string | number | boolean | Array<Json> | {
export type Json = string | number | boolean | Array<Json> | {
[id: string]: Json;
};
export declare type ValidationError = ZodIssueBase;
export type ValidationError = ZodIssueBase;
export interface Validate {

@@ -21,3 +21,3 @@ (value: Json): boolean;

}
export declare type Schema = {
export type Schema = {
$schema?: string;

@@ -106,2 +106,2 @@ $vocabulary?: string;

};
export declare type JsonSchema = Schema;
export type JsonSchema = Schema;
import { FullValidationSchema, ShortValidationSchema, ValidationSchemaInput, ValidInputTypes } from './types.js';
export declare const parseBaseType: <T = string>(type: string) => {
baseType?: T | undefined;
baseType?: T;
baseTypeSize: number | undefined;

@@ -5,0 +5,0 @@ arraySizes: number[];

@@ -19,3 +19,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureIfUint8Array = exports.hexToUint8Array = exports.uint8ArrayToHexString = exports.padLeft = exports.numberToHex = exports.hexToNumber = exports.codePointToInt = exports.transformJsonDataToAbiFormat = exports.fetchArrayElement = exports.ethAbiToJsonSchema = exports.abiSchemaToJsonSchema = exports.parseBaseType = void 0;
exports.padLeft = exports.numberToHex = exports.hexToNumber = exports.codePointToInt = exports.transformJsonDataToAbiFormat = exports.fetchArrayElement = exports.ethAbiToJsonSchema = exports.abiSchemaToJsonSchema = exports.parseBaseType = void 0;
exports.uint8ArrayToHexString = uint8ArrayToHexString;
exports.hexToUint8Array = hexToUint8Array;
exports.ensureIfUint8Array = ensureIfUint8Array;
const web3_errors_1 = require("web3-errors");

@@ -351,3 +354,2 @@ const constants_js_1 = require("./constants.js");

}
exports.uint8ArrayToHexString = uint8ArrayToHexString;
// for optimized technique for hex to bytes conversion

@@ -393,3 +395,2 @@ const charCodeMap = {

}
exports.hexToUint8Array = hexToUint8Array;
// @TODO: Remove this function and its usages once all sub dependencies uses version 1.3.3 or above of @noble/hashes

@@ -404,3 +405,2 @@ function ensureIfUint8Array(data) {

}
exports.ensureIfUint8Array = ensureIfUint8Array;
//# sourceMappingURL=utils.js.map

@@ -1,2 +0,2 @@

export declare const isNullish: (item: unknown) => item is null | undefined;
export declare const isNullish: (item: unknown) => item is undefined | null;
export declare const isObject: (item: unknown) => item is Record<string, unknown>;

@@ -5,3 +5,3 @@ import { ValidInputTypes } from '../types.js';

*/
export declare const isString: (value: ValidInputTypes) => boolean;
export declare const isString: (value: ValidInputTypes) => value is string;
export declare const isHexStrict: (hex: ValidInputTypes) => boolean;

@@ -8,0 +8,0 @@ /**

@@ -19,3 +19,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.validateNoLeadingZeroes = exports.isHexPrefixed = exports.isHexString32Bytes = exports.isHexString8Bytes = exports.isHex = exports.isHexString = exports.isHexStrict = exports.isString = void 0;
exports.validateNoLeadingZeroes = exports.isHexString32Bytes = exports.isHexString8Bytes = exports.isHex = exports.isHexStrict = exports.isString = void 0;
exports.isHexString = isHexString;
exports.isHexPrefixed = isHexPrefixed;
/**

@@ -42,3 +44,2 @@ * checks input if typeof data is valid string input

}
exports.isHexString = isHexString;
const isHex = (hex) => typeof hex === 'number' ||

@@ -64,3 +65,2 @@ typeof hex === 'bigint' ||

}
exports.isHexPrefixed = isHexPrefixed;
/**

@@ -67,0 +67,0 @@ * Checks provided Uint8Array for leading zeroes and throws if found.

@@ -8,4 +8,4 @@ import { Web3ValidationErrorObject } from 'web3-types';

silent?: boolean;
}): Web3ValidationErrorObject<string, Record<string, any>, unknown>[] | undefined;
}): Web3ValidationErrorObject[] | undefined;
private convertErrors;
}
import { AbiParameter } from 'web3-types';
import { ZodIssueBase } from 'zod';
export declare type ValidInputTypes = Uint8Array | bigint | string | number | boolean;
export declare type EthBaseTypes = 'bool' | 'bytes' | 'string' | 'uint' | 'int' | 'address' | 'tuple';
export declare type EthBaseTypesWithMeta = `string${string}` | `string${string}[${number}]` | `bytes${string}` | `bytes${string}[${number}]` | `address[${number}]` | `bool[${number}]` | `int${string}` | `int${string}[${number}]` | `uint${string}` | `uint${string}[${number}]` | `tuple[]` | `tuple[${number}]`;
export declare type EthExtendedTypes = 'hex' | 'number' | 'blockNumber' | 'blockNumberOrTag' | 'filter' | 'bloom';
export declare type FullValidationSchema = ReadonlyArray<AbiParameter>;
export declare type ShortValidationSchema = ReadonlyArray<string | EthBaseTypes | EthExtendedTypes | EthBaseTypesWithMeta | ShortValidationSchema>;
export declare type ValidationSchemaInput = FullValidationSchema | ShortValidationSchema;
export declare type Web3ValidationOptions = {
export type ValidInputTypes = Uint8Array | bigint | string | number | boolean;
export type EthBaseTypes = 'bool' | 'bytes' | 'string' | 'uint' | 'int' | 'address' | 'tuple';
export type EthBaseTypesWithMeta = `string${string}` | `string${string}[${number}]` | `bytes${string}` | `bytes${string}[${number}]` | `address[${number}]` | `bool[${number}]` | `int${string}` | `int${string}[${number}]` | `uint${string}` | `uint${string}[${number}]` | `tuple[]` | `tuple[${number}]`;
export type EthExtendedTypes = 'hex' | 'number' | 'blockNumber' | 'blockNumberOrTag' | 'filter' | 'bloom';
export type FullValidationSchema = ReadonlyArray<AbiParameter>;
export type ShortValidationSchema = ReadonlyArray<string | EthBaseTypes | EthExtendedTypes | EthBaseTypesWithMeta | ShortValidationSchema>;
export type ValidationSchemaInput = FullValidationSchema | ShortValidationSchema;
export type Web3ValidationOptions = {
readonly silent: boolean;
};
export declare type Json = string | number | boolean | Array<Json> | {
export type Json = string | number | boolean | Array<Json> | {
[id: string]: Json;
};
export declare type ValidationError = ZodIssueBase;
export type ValidationError = ZodIssueBase;
export interface Validate {

@@ -21,3 +21,3 @@ (value: Json): boolean;

}
export declare type Schema = {
export type Schema = {
$schema?: string;

@@ -106,3 +106,3 @@ $vocabulary?: string;

};
export declare type JsonSchema = Schema;
export type JsonSchema = Schema;
//# sourceMappingURL=types.d.ts.map
import { FullValidationSchema, ShortValidationSchema, ValidationSchemaInput, ValidInputTypes } from './types.js';
export declare const parseBaseType: <T = string>(type: string) => {
baseType?: T | undefined;
baseType?: T;
baseTypeSize: number | undefined;

@@ -5,0 +5,0 @@ arraySizes: number[];

@@ -1,3 +0,3 @@

export declare const isNullish: (item: unknown) => item is null | undefined;
export declare const isNullish: (item: unknown) => item is undefined | null;
export declare const isObject: (item: unknown) => item is Record<string, unknown>;
//# sourceMappingURL=object.d.ts.map

@@ -5,3 +5,3 @@ import { ValidInputTypes } from '../types.js';

*/
export declare const isString: (value: ValidInputTypes) => boolean;
export declare const isString: (value: ValidInputTypes) => value is string;
export declare const isHexStrict: (hex: ValidInputTypes) => boolean;

@@ -8,0 +8,0 @@ /**

@@ -8,5 +8,5 @@ import { Web3ValidationErrorObject } from 'web3-types';

silent?: boolean;
}): Web3ValidationErrorObject<string, Record<string, any>, unknown>[] | undefined;
}): Web3ValidationErrorObject[] | undefined;
private convertErrors;
}
//# sourceMappingURL=validator.d.ts.map
{
"name": "web3-validator",
"version": "2.0.7-dev.70352cd.0+70352cd",
"version": "2.0.7-dev.7109fb2.0+7109fb2",
"description": "JSON-Schema compatible validator for web3",

@@ -49,4 +49,4 @@ "main": "./lib/commonjs/index.js",

"util": "^0.12.5",
"web3-errors": "1.3.1-dev.70352cd.0+70352cd",
"web3-types": "1.8.2-dev.70352cd.0+70352cd",
"web3-errors": "1.3.1-dev.7109fb2.0+7109fb2",
"web3-types": "1.9.1-dev.7109fb2.0+7109fb2",
"zod": "^3.21.4"

@@ -66,5 +66,5 @@ },

"ts-jest": "^29.1.1",
"typescript": "^4.7.4"
"typescript": "^5.5.4"
},
"gitHead": "70352cdf6fd6eff92b352ca5d6b3a07507fe5472"
"gitHead": "7109fb281dfe7a170ae0b5f8aace54a63776bcac"
}

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 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 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 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 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 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 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 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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc