@proto-kit/protocolDocs


Documentation / @proto-kit/protocol / ContractModule

Class: abstract ContractModule<ContractType, Config>

This module type is used to define a contract module that can be used to construct and inject smart contract instances. It defines a method contractFactory, whose arguments can be configured via the Argument generic. It returns a smart contract class that is a subclass of SmartContract and implements a certain interface as specified by the ContractType generic.

Extends

Extended by

Type Parameters

ContractType

Config = NoConfig

Implements

Constructors

new ContractModule()

new ContractModule<ContractType, Config>(): ContractModule<ContractType, Config>

Returns

ContractModule<ContractType, Config>

Inherited from

ConfigurableModule.constructor

Properties

currentConfig

protected currentConfig: undefined | Config

Store the config separately, so that we can apply additional checks when retrieving it via the getter

Inherited from

ConfigurableModule.currentConfig

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:17

Accessors

config

Get Signature

get config(): Config

Returns

Config

Set Signature

set config(config): void

Parameters

config: Config

Returns

void

Inherited from

ConfigurableModule.config

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:18

Methods

compile()

abstract compile(registry): Promise<undefined | ArtifactRecord>

Parameters

registry: CompileRegistry

Returns

Promise<undefined | ArtifactRecord>

Implementation of

CompilableModule.compile

Defined in

packages/protocol/src/settlement/ContractModule.ts:28


contractFactory()

abstract contractFactory(): SmartContractClassFromInterface<ContractType>

Returns

SmartContractClassFromInterface<ContractType>

Defined in

packages/protocol/src/settlement/ContractModule.ts:26


create()

create(childContainerProvider): void

Parameters

childContainerProvider: ChildContainerProvider

Returns

void

Inherited from

ConfigurableModule.create

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:20