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
1import { SignumClient } from "@signum-tech/sdk";
2
3const signum = new SignumClient({
4 apiKey: process.env.SIGNUM_API_KEY,
5});

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
1const policy = await signum.orgs.assets.compliancePolicy.set(
2 orgId,
3 assetId,
4 {
5 regulation_type: "reg_d",
6 min_kyc_level: 2,
7 accredited_investor_required: true,
8 blocked_countries: ["IRN", "PRK", "CUB"],
9 max_holders: 2000,
10 lockup_period_days: 365,
11 transfer_restricted: false,
12 chain_eid: 30101,
13 }
14);
15
16console.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
1const current = await signum.orgs.assets.compliancePolicy.get(orgId, assetId);
2
3console.log(current.regulationType); // "reg_d"
4console.log(current.requiresAccreditation); // true
5console.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
1const check = await signum.compliance.check({
2 wallet: "0xabc...def",
3 chainEid: 30101,
4 assetId: assetId,
5});
6
7console.log(check.accepted); // true
8console.log(check.checkId); // "chk_abc123"
9console.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