getAnsRules inspects ANS rule snapshots powering moderation workflows—supply cached identifiers when you already fetched governance artifacts earlier.
Setup
import { Canton } from '@fairmint/canton-node-sdk';
const canton = new Canton({
network: 'devnet',
provider: '5n',
partyId: 'OWN_PARTY_ID',
});
Import and receiver
import { Canton } from '@fairmint/canton-node-sdk';
Receiver: canton.validator.getAnsRules.
Minimal example
const rules = await canton.validator.getAnsRules({
cached_ans_rules_contract_id: '<prior-contract-id>',
cached_ans_rules_domain_id: '<sync-domain>',
});
Parameters
Both optional hints forwarded verbatim:
cached_ans_rules_contract_idcached_ans_rules_domain_id
Returns
Scan-proxy JSON documenting wrapped governance contracts controlling ANS evolution.
Errors and pitfalls
- Omit hints entirely when performing cold reads—the validator computes freshest identifiers automatically.
Auth and party
Bearer token capable of hitting validator scan-proxy POST endpoints.
See also
Source
src/clients/validator-api/operations/v0/ans/get-rules.ts on GitHub.