publishPolicyVersion
functionPolicy versioning (HCS-2)Publish the current config as a new immutable policy version on the registry.
signature
publishPolicyVersion(client, cfg, registryTopicId, reason): Promise<PolicySnapshot>Parameters
NameTypeDescription
clientreqClientOperator client (must hold the registry’s submit key).cfgreqCurbConfigThe policy to publish (caps + currency).registryTopicIdreqstringThe HCS-2 registry topic.reasonreqstringWhy the policy changed (stored with the version).Returns
Promise<PolicySnapshot>The published policy snapshot.
Example
example
await publishPolicyVersion(client, { ...cfg, perDay: 50 }, policyTopicId, 'raise daily cap');