updateRule(Defined in: src/modules/rules.ts:240 Updates an existing rule in the Rules Engine Policy Contract.config
,rulesEnginePolicyContract
,rulesEngineRulesContract
,rulesEngineComponentContract
,rulesEngineForeignCallContract
,policyId
,ruleId
,ruleS
,foreignCallNameToID
,trackerNameToID
,confirmationCount
):Promise
<number
>
Parameters
Parameter | Type | Description |
---|---|---|
config | Config | - |
rulesEnginePolicyContract | { abi : ({ anonymous : undefined ; inputs : object []; 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}` ; } | - |
rulesEnginePolicyContract.abi | ({ anonymous : undefined ; inputs : object []; 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 ; })[] | - |
rulesEnginePolicyContract.address | `0x${string}` | - |
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}` | - |
rulesEngineComponentContract | { abi : ({ anonymous : undefined ; inputs : ({ components : undefined ; internalType : string ; name : string ; type : string ; } | { components : object []; 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}` ; } | - |
rulesEngineComponentContract.abi | ({ anonymous : undefined ; inputs : ({ components : undefined ; internalType : string ; name : string ; type : string ; } | { components : object []; 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 ; })[] | - |
rulesEngineComponentContract.address | `0x${string}` | - |
rulesEngineForeignCallContract | { 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 : ({ 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 : boolean ; inputs : object []; name : string ; outputs : undefined ; stateMutability : undefined ; type : string ; })[]; address : `0x${string}` ; } | - |
rulesEngineForeignCallContract.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 : ({ 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 : boolean ; inputs : object []; name : string ; outputs : undefined ; stateMutability : undefined ; type : string ; })[] | - |
rulesEngineForeignCallContract.address | `0x${string}` | - |
policyId | number | The ID of the policy to which the rule belongs. |
ruleId | number | The ID of the rule to be updated. |
ruleS | string | A JSON string representing the rule’s structure and logic. |
foreignCallNameToID | FCNameToID [] | A mapping of foreign call names to their corresponding IDs. |
trackerNameToID | FCNameToID [] | A mapping of tracker names to their corresponding IDs. |
confirmationCount | number | - |
Returns
Promise
<number
>
A promise that resolves to the result of the rule update operation. Returns the result ID if successful, or -1 if the operation fails.