getPolicyMetadata(Defined in: src/modules/policy.ts:762 Retrieves the metadata for a policy from the Rules Engine Policy Contract based on the provided policy ID.config
,rulesEnginePolicyContract
,policyId
,blockParams
?):Promise
<Maybe
<PolicyMetadataStruct
>>
Parameters
Parameter | Type | Description |
---|---|---|
config | Config | The configuration object containing network and wallet information. |
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}` ; } | The contract instance containing the address and ABI for interaction. |
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}` | - |
policyId ? | number | The ID of the policy. |
blockParams ? | ContractBlockParameters | Optional parameters to specify block number or tag for the contract read operation. |
Returns
Promise
<Maybe
<PolicyMetadataStruct
>>
A promise that resolves to the policy metadata result if successful, or null
if an error occurs.