getAllRules(Defined in: src/modules/rules.ts:520 Retrieves all rules associated with a specific policy ID from the Rules Engine Policy Contract.config
,rulesEngineRulesContract
,policyId
,blockParams
?):Promise
<Maybe
<any
[]>>
Parameters
Parameter | Type | Description |
---|---|---|
config | Config | The 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}` ; } | An object representing the Rules Engine Rules Contract, including its address and ABI (Application Binary Interface). |
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}` | - |
policyId ? | number | The unique identifier of the policy for which rules are to be retrieved. |
blockParams ? | ContractBlockParameters | Optional parameters to specify block number or tag for the contract read operation. |
Returns
Promise
<Maybe
<any
[]>>
A promise that resolves to an array of rules if successful, or null
if an error occurs.