getRule(config, rulesEngineRulesContract, policyId, ruleId, blockParams?): Promise<Maybe<RuleStruct>>
Defined in: src/modules/rules.ts:438 Retrieves a specific rule from the Rules Engine.

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 for interacting with the Rules Engine Policy.
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 containing 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<RuleStruct>> The retrieved rule as a RuleStruct, or null if retrieval fails.