Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.forterulesengine.io/llms.txt

Use this file to discover all available pages before exploring further.

getRuleMetadata(config, rulesEngineRulesContract, policyId, ruleId, blockParams?): Promise<Maybe<RuleMetadataStruct>>
Defined in: src/modules/rules.ts:559 Retrieves the metadata for a rule from the Rules Engine Rules Contract based on the provided policy ID and rule ID.

Parameters

ParameterTypeDescription
configConfigThe configuration object containing network and wallet information.
rulesEngineRulesContract{ abi: ({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: undefined; inputs: object[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: boolean; inputs: object[]; name: string; outputs: undefined; stateMutability: undefined; type: string; })[]; address: `0x${string}`; }The contract instance containing the address and ABI for interaction.
rulesEngineRulesContract.abi({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: undefined; inputs: object[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: boolean; inputs: object[]; name: string; outputs: undefined; stateMutability: undefined; type: string; })[]-
rulesEngineRulesContract.address`0x${string}`-
policyIdnumberThe ID of the policy associated with the rule.
ruleId?numberThe ID of the rule to retrieve.
blockParams?ContractBlockParametersOptional parameters to specify block number or tag for the contract read operation.

Returns

Promise<Maybe<RuleMetadataStruct>> A promise that resolves to the rule metadata result if successful, or null if an error occurs.

Throws

Will log an error to the console if the contract interaction fails.