Skip to navigation

Define & Attach a Compliance Policy

Set transfer rules that the smart contract enforces automatically
View as Markdown

This guide walks you through defining a compliance policy for an asset — setting regulation parameters, reading the policy back, and triggering a compliance check.

Prerequisites

A compliance policy can be attached before or after asset deployment. It is common to create the asset, attach the policy, and then deploy.

1. Install and authenticate

client.ts
import { SignumClient } from "@signum-tech/sdk";
const signum = new SignumClient({
apiKey: process.env.SIGNUM_API_KEY,
});

2. Set the compliance policy

Attach a compliance policy to your asset. This example configures a Regulation D policy with accredited investor requirements:

set-policy.ts
const policy = await signum.orgs.assets.compliancePolicy.set(
orgId,
assetId,
{
regulation_type: "reg_d",
min_kyc_level: 2,
accredited_investor_required: true,
blocked_countries: ["IRN", "PRK", "CUB"],
max_holders: 2000,
lockup_period_days: 365,
transfer_restricted: false,
chain_eid: 30101,
}
);
console.log(policy); // The saved policy

When chain_eid is provided, the API returns 202 Accepted — the policy is saved and queued for on-chain registration. Without chain_eid, it returns 200 with the saved policy. Either way, the response includes policyId and assetId for tracking.

On-chain policy registration is asynchronous. Listen for the signum.compliance.rule_synced event to confirm the policy is live on the smart contract.

Policy fields

FieldTypeDescription
regulation_typestringRegulation framework: reg_d, reg_s, reg_a_plus, reg_cf, or none
min_kyc_levelnumberMinimum KYC level required (0-4)
accredited_investor_requiredbooleanWhether holders must be accredited investors
blocked_countriesstring[]ISO 3166-1 alpha-3 country codes blocked from holding
max_risk_scorenumberMaximum acceptable risk score (0-100)
max_holdersnumberMaximum number of token holders
lockup_period_daysnumberLockup period in days before transfers are allowed
max_transaction_amountstring | nullMaximum single transaction amount
cooling_off_period_hoursnumberCooling-off period in hours between transactions
transfer_restrictedbooleanWhether all transfers are restricted
allow_pepbooleanWhether politically exposed persons may hold
chain_eidnumberTarget chain EID for on-chain policy registration

3. Read the policy back

Retrieve the current compliance policy for an asset:

get-policy.ts
const current = await signum.orgs.assets.compliancePolicy.get(orgId, assetId);
console.log(current.regulationType); // "reg_d"
console.log(current.requiresAccreditation); // true
console.log(current.blockedCountries); // ["IRN", "PRK", "CUB"]

4. Trigger a compliance check

Queue an async compliance check against a wallet to verify it meets the policy requirements:

compliance-check.ts
const check = await signum.compliance.check({
wallet: "0xabc...def",
chainEid: 30101,
assetId: assetId,
});
console.log(check.accepted); // true
console.log(check.checkId); // "chk_abc123"
console.log(check.message); // Guidance on result delivery

The API returns 202 Accepted. The check runs asynchronously — use webhooks or poll for the result.

5. Listen for compliance events

Four compliance event channels notify you of policy and check lifecycle changes:

ChannelFires when
signum.compliance.rule_changedPolicy configuration is modified
signum.compliance.rule_syncedPolicy is synced to the on-chain contract
signum.compliance.check_requestedA compliance check is queued
signum.compliance.check_completedA compliance check finishes

See Subscribe to Webhooks for how to receive these events, or browse the full payload schemas in the API Reference.

Reference

Next steps