UNPKG

@dappykit/sdk

Version:

Web3 SDK for DApps

50 lines (49 loc) 1.7 kB
import { Client, GetContractReturnType } from 'viem'; import { Abi } from 'abitype'; export type ContractType = GetContractReturnType<Abi, Client, `0x${string}`>; export type FlavoredType<Type, Name> = Type & { __tag__?: Name; }; export type BrandedType<Type, Name> = Type & { __tag__: Name; }; /** * Asserts that the given value is a number */ export declare function assertNumber(value: unknown, customMessage?: string): asserts value is number; /** * Asserts that the given value is an array */ export declare function assertArray(value: unknown): asserts value is []; /** * Asserts that the given value is a string */ export declare function assertString(value: unknown, customMessage?: string): asserts value is string; /** * Checks that value is a string */ export declare function isString(value: unknown): value is string; /** * Checks that value is a number */ export declare function isNumber(value: unknown): value is number; /** * Checks that value is an object */ export declare function isObject(value: unknown): value is object; /** * Checks if the given value is an object and not empty * * @param value The value to check * @returns True if the value is an object and not empty, false otherwise */ export declare function isNotEmptyObject(value: unknown): boolean; /** * Asserts that a given value is a non-empty object, throwing an error if it is not. * * @param {unknown} value - The value to be checked. * @param {string} [customMessage] - An optional custom error message. * * @throws {Error} If the value is not a non-empty object. */ export declare function assertNotEmptyObject(value: unknown, customMessage?: string): asserts value is object;