currentPolicy
functionPolicy versioning (HCS-2)The current (latest) policy version on the registry, or null if empty.
signature
currentPolicy(registryTopicId, mirrorBaseUrl, trustedPayer?): Promise<PolicyVersion | null>Parameters
NameTypeDescription
registryTopicIdreqstringThe HCS-2 registry topic.mirrorBaseUrlreqstringMirror node REST base.trustedPayeroptstringOnly trust versions from this account.Returns
Promise<PolicyVersion | null>The latest version, or null.
Example
example
const policy = await currentPolicy(policyTopicId, MIRROR, ownerAccountId);
// → { version: 2, perTask: 20, perDay: 50, reason: 'raise daily cap', ... }