Module: @moralisweb3/core

moralis-monorepo / @moralisweb3/core

Module: @moralisweb3/core

Table of contents

Functions

Interfaces

Variables

DataType Classes

Other Classes

Type Aliases

Functions

assertUnreachable

assertUnreachable(x): never

Typesafe check, to make sure that code never reaches a certain point.
Can be used as an exhaustive check in swtich/if-else statements

When used properly with Typescript, this code should never reach, as it is typed as 'never'

If the code does reach this assertion an UnreachableError is thrown

Parameters

NameType
xnever

Returns

never


isApiModule

isApiModule(moralisClass): moralisClass is ApiModule<any>

Verify if the provided class is a api type.
Should be used as a Typescript type-guard

Example

if(isApiModule(module)){
 // module is types as ApiModule here
}

Parameters

NameType
moralisClassModule<any>

Returns

moralisClass is ApiModule<any>


maybe

maybe<Value>(value): Value | undefined

Converts null or undefined values to undefined
Optionally, the value gets transformed by the second argument

Type parameters

Name
Value

Parameters

NameType
valueundefined | null | Value

Returns

Value | undefined

Variables

solNetworkNames

Const solNetworkNames: readonly ["mainnet", "devnet"]

Note this is just an interface, used in the core config.
The implementations are located in the @moralisweb3/sol-utils package.

Type Aliases

BigNumberish

Ƭ BigNumberish: BigNumber | BigNumberPrimitive

Valid input for a new BigNumber instance.
This can be an existing BigNumber or a valid BigNumberPrimitive type


BigNumberPrimitive

Ƭ BigNumberPrimitive: number | string | bigint

Valid input types for a BigNumber. This can be a number, string, or bigint.


Did this page help you?