Deploy a Gated Asset

Create, deploy, and distribute a compliance-gated token

View as Markdown

This guide walks you through the full asset lifecycle — creating a tokenized asset, deploying it to a chain, allocating tokens to users, and optionally bridging cross-chain.

Prerequisites

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. Create the asset

Create a new tokenized asset. The asset_type field accepts: cre, equity, bond, debt, fund, commodity, or other.

create-asset.ts
1const result = await signum.orgs.assets.create(orgId, {
2 name: "Acme Fund I",
3 symbol: "ACME",
4 asset_type: "fund",
5 regulation_type: "reg_d",
6 total_supply: 1000000,
7 decimals: 18,
8});
9
10console.log(result.accepted); // true
11console.log(result.assetId); // "ast_abc123"
12console.log(result.status); // "pending"
13console.log(result.requestId); // For webhook correlation

The API returns 202 Accepted. The asset is registered in the system but not yet deployed on-chain.

3. Attach a compliance policy

Before deploying, attach a compliance policy to define the transfer rules the smart contract will enforce. See Define a Compliance Policy for the full walkthrough.

set-policy.ts
1await signum.orgs.assets.compliancePolicy.set(orgId, result.assetId, {
2 regulation_type: "reg_d",
3 min_kyc_level: 2,
4 accredited_investor_required: true,
5 blocked_countries: ["IRN", "PRK", "CUB"],
6 max_holders: 2000,
7 lockup_period_days: 365,
8 chain_eid: 30101,
9});

4. Deploy to a chain

Deploy the asset as an OFT (Omnichain Fungible Token) smart contract on the target chain:

deploy-asset.ts
1const deploy = await signum.orgs.assets.deploy(orgId, assetId, {
2 chain_eid: 30101,
3});
4
5console.log(deploy.accepted); // true
6console.log(deploy.assetId); // "ast_abc123"
7console.log(deploy.chainEid); // 30101
8console.log(deploy.status); // "pending"
9console.log(deploy.requestId); // For webhook correlation

The API returns 202 Accepted. The deployment is processed asynchronously — the system compiles the contract, deploys it, and registers the compliance policy on-chain.

Deployment can take 30-120 seconds depending on chain congestion. Use the requestId for webhook correlation rather than polling in production integrations.

5. Poll for deployment status

Check the asset status until deployment completes, or use webhook correlation with the requestId from step 4:

poll-deploy.ts
1async function waitForDeploy(orgId: string, assetId: string): Promise<void> {
2 const maxAttempts = 60;
3 const intervalMs = 5000;
4
5 for (let i = 0; i < maxAttempts; i++) {
6 const asset = await signum.orgs.assets.get(orgId, assetId);
7
8 if (asset.status === "deployed") {
9 console.log("Asset deployed:", asset);
10 return;
11 }
12
13 if (asset.status === "failed") {
14 throw new Error("Deployment failed");
15 }
16
17 await new Promise((r) => setTimeout(r, intervalMs));
18 }
19
20 throw new Error("Deployment did not complete within timeout");
21}

See Async Operations for the webhook correlation pattern using requestId.

6. Allocate tokens

Distribute tokens to users. Each allocation is compliance-checked before execution — the recipient must satisfy the asset’s compliance policy.

allocate-tokens.ts
1const allocation = await signum.orgs.assets.allocate(orgId, assetId, {
2 allocations: [
3 { userId: "usr_alice", amount: "50000" },
4 { userId: "usr_bob", amount: "25000" },
5 ],
6 chainEid: 30101,
7});
8
9console.log(allocation.accepted); // true
10console.log(allocation.transferIds); // Array of transfer IDs
11console.log(allocation.requestId); // For webhook correlation

The API returns 202 Accepted. Each allocation triggers an individual compliance check and on-chain transfer.

7. Bridge cross-chain (optional)

Bridge tokens to another chain using LayerZero OFT messaging:

bridge-asset.ts
1const bridge = await signum.orgs.assets.bridge(orgId, assetId, {
2 dst_chain_eid: 30110,
3 amount: "100000",
4});
5
6console.log(bridge.accepted); // true
7console.log(bridge.bridgeId); // Bridge operation ID
8console.log(bridge.srcChainEid); // Source chain
9console.log(bridge.dstChainEid); // 30110
10console.log(bridge.status); // "pending"
11console.log(bridge.requestId); // For webhook correlation

The API returns 202 Accepted. The bridge operation executes through LayerZero’s cross-chain messaging layer.

What you built

You now have a fully deployed, compliance-gated token on-chain. Every transfer is automatically checked against your compliance policy — blocked countries, KYC level, accreditation status, holder limits, and lockup periods are all enforced at the smart contract level.

Reference

Next steps