createPolicy(Creates a policy in the Rules Engine, including rules, trackers, and foreign calls.config,rulesEnginePolicyContract,rulesEngineRulesContract,rulesEngineComponentContract,rulesEngineForeignCallContract,policySyntax?):Promise<object>
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Config | - |
rulesEnginePolicyContract | object | The contract instance for interacting with the Rules Engine Policy. |
rulesEnginePolicyContract.abi | (object | object)[] | - |
rulesEnginePolicyContract.address | `0x${string}` | - |
rulesEngineRulesContract | object | The contract instance for interacting with the Rules Engine Rules. |
rulesEngineRulesContract.abi | (object | object | object)[] | - |
rulesEngineRulesContract.address? | `0x${string}` | - |
rulesEngineComponentContract? | object | The contract instance for interacting with the Rules Engine Component. |
rulesEngineComponentContract.abi? | (object | object | object)[] | - |
rulesEngineComponentContract.address? | `0x${string}` | - |
rulesEngineForeignCallContract? | object | - |
rulesEngineForeignCallContract.abi? | (object | object | object)[] | - |
rulesEngineForeignCallContract.address? | `0x${string}` | - |
policySyntax? | string | The JSON string representing the policy syntax. |
Returns
Promise<object>
The ID of the newly created policy.
policyId
policyId: number