Class: ApiModule
moralis-monorepo / @moralisweb3/common-core / ApiModule
Class: ApiModule
@moralisweb3/common-core.ApiModule
The base class of every Moralis Api class that gets registered as a module via MoralisModules It should always be created with:
name
: name of the module (should be unique)core
: the Core instancebaseUrlProvider
: the provider of the base URL.
Hierarchy
↳
ApiModule
Table of contents
Accessors
Methods
Constructors
Properties
Accessors
baseUrl
• get
baseUrl(): string
Description
The base URL of the API.
Returns
string
Methods
cleanUp
▸ cleanUp(): void
Any cleanup that needs to be done for removing this module.
It also should remove the module via this.core.modules.remove(this.name)
Returns
void
Inherited from
setup
▸ Abstract
setup(): void
Returns
void
Inherited from
start
▸ Abstract
start(): void
| Promise
<void
>
Start the module (if needed). This function can be used to initialize variables etc.
Returns
void
| Promise
<void
>
Inherited from
Constructors
constructor
• new ApiModule(name
, core
, baseUrlProvider
)
Parameters
Name | Type |
---|---|
name | string |
core | Core |
baseUrlProvider | () => string |
Overrides
Properties
name
• Readonly
name: string
Inherited from
type
• Readonly
type: ModuleType
= ModuleType.DEFAULT
Inherited from
core
• Protected
Readonly
core: Core
Inherited from
logger
• Protected
Readonly
logger: LoggerController