createFunctionSignature(config, rulesEngineComponentContract, policyId, functionSignature): Promise<number>

Creates a function signature in the rules engine component contract.

This function parses the provided function signature, maps its arguments to their respective types, and interacts with the smart contract to create the function signature. If the contract interaction fails, it retries with a delay until successful.

Parameters

ParameterTypeDescription
configConfig-
rulesEngineComponentContractobjectThe contract instance containing the address and ABI
rulesEngineComponentContract.abi(object | object | object)[]-
rulesEngineComponentContract.address`0x${string}`-
policyIdnumberThe ID of the policy for which the function signature is being created.
functionSignaturestringThe function signature string to be parsed and added to the contract. of the rules engine component.

Returns

Promise<number>

A promise that resolves to the result of the contract interaction, or -1 if unsuccessful.

Throws

Will retry indefinitely on contract interaction failure, with a delay between attempts.

Defined in

src/modules/function-signatures.ts:50