# Deploy and mint equity

Source: https://docs.settlemint.com/docs/developer-guides/runbooks/create-mint-equities
Create an equity token with the DALP TypeScript client, set the required roles,
unpause the token, and mint verified shareholder supply.




Equity issuance connects a priced equity token, wallet verification, token roles, and verified shareholder wallets through DALP APIs.

Use the TypeScript client path below to create the token, grant supply roles, unpause the token, and mint shares. The runbook does not configure collateral, transfer rules, or issuer-specific legal terms.

<Mermaid
  chart="`
flowchart TD
Issuer[&#x22;Equity issuer&#x22;] --> Client[&#x22;TypeScript client&#x22;]
Client --> API[&#x22;DALP asset API&#x22;]
API --> Terms[&#x22;Equity class terms&#x22;]
API --> Roles[&#x22;Asset roles&#x22;]
API --> Compliance[&#x22;Identity and compliance checks&#x22;]
Terms --> Contract[&#x22;Equity token contract&#x22;]
Contract --> Shareholder[&#x22;Shareholder wallet supply&#x22;]
`"
/>

## Prerequisites [#prerequisites]

Before running these commands, you need:

1. A running DALP instance and its platform URL.
2. A DALP API key for your account.
3. A wallet on that account with PINCODE verification enabled.
4. An `admin` operator who can grant the system `tokenManager` role.
5. Registered identities for every wallet that receives minted shares.

Your wallet address is available during onboarding and from the `user.me` response in Step 2.

The equity create request requires `priceCurrency`, `basePrice`, and `countryCode`. `class`, `category`, and `uniqueIdentifier` are optional. Use `class` and `category` when the share class fits DALP's equity taxonomy. Use `uniqueIdentifier` for an ISIN or other approved reporting identifier when the equity has one.

You can use an empty array `[]` for `initialModulePairs` to create the equity without initial compliance modules and configure modules later. To add collateral requirements, see [Configure equity collateral](/docs/developer-guides/runbooks/configure-equity-collateral).

## Quick reference [#quick-reference]

| Step | What                | SDK call                               |
| ---- | ------------------- | -------------------------------------- |
| 1    | Create client       | `createDalpClient`                     |
| 2    | Get user info       | `dalp.user.me`                         |
| 3    | Grant system roles  | Platform role setup                    |
| 4    | Create equity token | `dalp.token.create` (type: `"equity"`) |
| 5    | Grant token roles   | `dalp.token.grantRole`                 |
| 6    | Unpause token       | `dalp.token.unpause`                   |
| 7    | Mint shares         | `dalp.token.mint`                      |
| 8    | Verify holders      | `dalp.token.holders`                   |

## Equity token lifecycle flow [#equity-token-lifecycle-flow]

This diagram shows the complete equity token deployment and minting workflow:

<Mermaid
  chart="`flowchart TB
  Init[Create SDK Client<br/>createDalpClient] --> Auth[Get User Info<br/>dalp.user.me]
  Auth --> Roles[Set Up System Roles<br/>+ Register Identity]
  Roles --> Create[Create Equity Token<br/>POST /token/create]
  Create --> Config[Equity Configuration:<br/>class, category<br/>optional ISIN]
  Config --> Grant[Grant Token Roles<br/>POST /token/:address/grant-role]
  Grant --> Unpause[Unpause Token<br/>PUT /token/:address/unpause]
  Unpause --> Mint[Mint Shares<br/>POST /token/:address/mint]
  Mint --> Verify[Verify Holders<br/>GET /token/:address/holders]
  
  style Init fill:#5fc9bf,stroke:#3a9d96,stroke-width:2px,color:#fff
  style Auth fill:#6ba4d4,stroke:#4a7ba8,stroke-width:2px,color:#fff
  style Roles fill:#6ba4d4,stroke:#4a7ba8,stroke-width:2px,color:#fff
  style Create fill:#8571d9,stroke:#654bad,stroke-width:2px,color:#fff
  style Config fill:#8571d9,stroke:#654bad,stroke-width:2px,color:#fff
  style Grant fill:#8571d9,stroke:#654bad,stroke-width:2px,color:#fff
  style Unpause fill:#8571d9,stroke:#654bad,stroke-width:2px,color:#fff
  style Mint fill:#8571d9,stroke:#654bad,stroke-width:2px,color:#fff
  style Verify fill:#b661d9,stroke:#8a3fb3,stroke-width:2px,color:#fff
`"
/>

Equity-specific controls:

| Control               | What to set                                  | Why it matters                                                              |
| --------------------- | -------------------------------------------- | --------------------------------------------------------------------------- |
| Price                 | `priceCurrency` and `basePrice`              | Stores the reference share price used by the asset metadata and claim flow. |
| Jurisdiction          | `countryCode`                                | Uses the ISO 3166-1 numeric country code for the token jurisdiction.        |
| Classification        | Optional `class` and `category`              | Adds equity taxonomy data when the issuance fits the platform values.       |
| Identifier            | Optional `uniqueIdentifier`                  | Carries an ISIN or approved reporting identifier when one exists.           |
| Wallet verification   | `walletVerification` on state-changing calls | Authorizes token creation, role grants, unpause, and mint operations.       |
| Identity registration | Registered recipient identities              | Minting to an unregistered recipient fails before supply moves.             |
| Token roles           | `supplyManagement` and `emergency`           | `supplyManagement` mints shares. `emergency` unpauses the token.            |

## Step-by-step commands [#step-by-step-commands]

### Step 1: create the client [#step-1-create-the-client]

Create the SDK client with your platform URL and API key.

```ts file=<rootDir>/src/examples/create-mint-equity.ts#L1-L9
import { createDalpClient } from "@settlemint/dalp-sdk";

async function main() {
  // Step 1: Create the SDK client
  const dalp = createDalpClient({
    url: "https://your-platform.example.com",
    apiKey: "YOUR_API_KEY",
  });
  const pincode = "YOUR_PINCODE";
```

### Step 2: check you're logged in [#step-2-check-youre-logged-in]

```ts file=<rootDir>/src/examples/create-mint-equity.ts#L11-L17
  // Step 2: Get your wallet address
  const me = await dalp.user.me({});
  const myWallet = me.data.wallet;
  if (!myWallet) {
    throw new Error("No wallet found. Create a wallet first via the DALP dashboard.");
  }
  console.log("Wallet:", myWallet);
```

Save your wallet address. You need it when you grant token roles, unpause the token, and mint shares.

### Step 3: set up system roles [#step-3-set-up-system-roles]

Grant the roles and identities before you create or mint the equity.

1. Grant `tokenManager` to the operator creating the token.
2. Grant `identityManager` to the operator creating or registering issuer and recipient identities.
3. For a wallet without a system identity, create the identity first. Then register the wallet in the identity registry.
4. Register the issuer wallet identity before minting to it.
5. Register every recipient wallet identity before Step 7.
6. Grant `claimPolicyManager` only when your setup also needs to manage trusted issuers or claim topics.

For the platform setup sequence, see [First Administrator Setup](/docs/developer-guides/platform-setup/first-admin-setup).

If you do not have operator access, ask the platform administrator to grant the required system roles and register the required identities before continuing.

### Step 4: create equity token [#step-4-create-equity-token]

```ts file=<rootDir>/src/examples/create-mint-equity.ts#L22-L48
  // Step 4: Create equity token
  const equity = await dalp.token.create({
    body: {
      type: "equity",
      name: "Series B Voting Shares",
      symbol: "SBVS",
      decimals: 18,
      countryCode: "840",
      priceCurrency: "USD",
      basePrice: "10.00",
      class: "COMMON_EQUITY",
      category: "VOTING_COMMON_STOCK",
      uniqueIdentifier: "US0378331005",
      initialModulePairs: [],
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });

  if ("transactionId" in equity) {
    console.log("Equity creation queued:", equity.transactionId);
    return;
  }
  const tokenAddress = equity.data.id;
  console.log("Equity created:", tokenAddress);
```

Parameters:

* `type`: Must be `"equity"`
* `name`: Equity name (e.g., "Series B Voting Shares")
* `symbol`: Equity symbol (e.g., "SBVS")
* `decimals`: Use `0` for whole-share cap table parity or `18` for fractional ownership.
* `countryCode`: ISO 3166-1 numeric country code as a string, such as `"840"` for the United States, `"056"` for Belgium, or `"276"` for Germany.
* `priceCurrency`: ISO 4217 currency code for the reference share price, such as `"USD"`.
* `basePrice`: Decimal string for the reference price in `priceCurrency`, such as `"10.00"`.
* `class`: Optional equity class from DALP's equity taxonomy, such as `COMMON_EQUITY`, `PREFERRED_EQUITY`, or `SECTOR_INDUSTRY_EQUITY`.
* `category`: Optional equity category from DALP's equity taxonomy, such as `VOTING_COMMON_STOCK`, `DUAL_CLASS_SHARES`, or `RESTRICTED_STOCK`.
* `uniqueIdentifier`: Optional ISIN or approved reporting identifier. Omit it for private or pre-ISIN rounds.
* `initialModulePairs`: Initial compliance modules. Use `[]` when you are creating the token first and adding modules later.
* `walletVerification`: PINCODE or another enabled wallet verification type for the signing wallet.

The call returns the equity data with `id`, which is the token contract address. Save that address for Step 5.

### Step 5: grant token roles [#step-5-grant-token-roles]

Grant `supplyManagement` and `emergency` on the equity contract before minting.

When you create a token, the creator receives the token `admin` role, which can grant other token roles. The mint call requires `supplyManagement`. The unpause call requires `emergency`.

```ts file=<rootDir>/src/examples/create-mint-equity.ts#L50-L73
  // Step 5: Grant token roles
  await dalp.token.grantRole({
    params: { tokenAddress },
    body: {
      accounts: [myWallet],
      role: "supplyManagement",
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  await dalp.token.grantRole({
    params: { tokenAddress },
    body: {
      accounts: [myWallet],
      role: "emergency",
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  console.log("Roles granted");
```

Expected: the role grant transaction completes. Wait for transaction confirmation before proceeding to Step 6.

Note: add `governance` to the roles array if you plan to change compliance modules or ROFR settings via API.

### Step 6: unpause the equity [#step-6-unpause-the-equity]

New tokens start paused. Unpause to enable transfers:

```ts file=<rootDir>/src/examples/create-mint-equity.ts#L75-L85
  // Step 6: Unpause the equity
  await dalp.token.unpause({
    params: { tokenAddress },
    body: {
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  console.log("Equity unpaused");
```

Note: this step requires the `emergency` role from Step 5. Make sure Step 5 completed successfully and the transaction was confirmed before unpausing.

### Step 7: mint shares [#step-7-mint-shares]

The recipient wallet must be registered in the identity registry before minting. If you mint to your own wallet, register your own identity in Step 3. If you mint to investors or employee wallets, register those recipient identities first.

```ts file=<rootDir>/src/examples/create-mint-equity.ts#L87-L99
  // Step 7: Mint shares — 100 shares
  await dalp.token.mint({
    params: { tokenAddress },
    body: {
      recipients: [myWallet],
      amounts: [100_000_000_000_000_000_000n],
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  console.log("Minted shares");
```

Parameters:

* `tokenAddress`: Equity contract address from Step 4.
* `recipients`: Recipient wallet addresses. Every address must be registered in the identity registry.
* `amounts`: Mint amounts in token units. The example mints `100_000_000_000_000_000_000n`, which is 100 shares when the token uses 18 decimals.

The mint call requires the `supplyManagement` role from Step 5. If the platform returns `RecipientNotVerified`, register the recipient identity. Retry the mint after registration completes.

### Step 8: verify holders [#step-8-verify-holders]

```ts file=<rootDir>/src/examples/create-mint-equity.ts#L101-L103
  // Step 8: Verify holders
  const holders = await dalp.token.holders({ params: { tokenAddress }, query: { limit: 200 } });
  console.log("Holders:", holders.data);
```

The response shows holders and balances for the equity token. You should see the recipient wallet with the minted share balance.

For cap table, tax, shareholder communication, or statutory reporting workflows, reconcile the holder data with the issuer's off-platform records and the compliance modules configured for the equity.

## Full script [#full-script]

```ts file=<rootDir>/src/examples/create-mint-equity.ts
import { createDalpClient } from "@settlemint/dalp-sdk";

async function main() {
  // Step 1: Create the SDK client
  const dalp = createDalpClient({
    url: "https://your-platform.example.com",
    apiKey: "YOUR_API_KEY",
  });
  const pincode = "YOUR_PINCODE";

  // Step 2: Get your wallet address
  const me = await dalp.user.me({});
  const myWallet = me.data.wallet;
  if (!myWallet) {
    throw new Error("No wallet found. Create a wallet first via the DALP dashboard.");
  }
  console.log("Wallet:", myWallet);

  // Step 3: Set up system roles
  // Follow the Set Up Roles guide to grant yourself 'tokenManager'

  // Step 4: Create equity token
  const equity = await dalp.token.create({
    body: {
      type: "equity",
      name: "Series B Voting Shares",
      symbol: "SBVS",
      decimals: 18,
      countryCode: "840",
      priceCurrency: "USD",
      basePrice: "10.00",
      class: "COMMON_EQUITY",
      category: "VOTING_COMMON_STOCK",
      uniqueIdentifier: "US0378331005",
      initialModulePairs: [],
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });

  if ("transactionId" in equity) {
    console.log("Equity creation queued:", equity.transactionId);
    return;
  }
  const tokenAddress = equity.data.id;
  console.log("Equity created:", tokenAddress);

  // Step 5: Grant token roles
  await dalp.token.grantRole({
    params: { tokenAddress },
    body: {
      accounts: [myWallet],
      role: "supplyManagement",
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  await dalp.token.grantRole({
    params: { tokenAddress },
    body: {
      accounts: [myWallet],
      role: "emergency",
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  console.log("Roles granted");

  // Step 6: Unpause the equity
  await dalp.token.unpause({
    params: { tokenAddress },
    body: {
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  console.log("Equity unpaused");

  // Step 7: Mint shares — 100 shares
  await dalp.token.mint({
    params: { tokenAddress },
    body: {
      recipients: [myWallet],
      amounts: [100_000_000_000_000_000_000n],
      walletVerification: {
        secretVerificationCode: pincode,
        verificationType: "PINCODE",
      },
    },
  });
  console.log("Minted shares");

  // Step 8: Verify holders
  const holders = await dalp.token.holders({ params: { tokenAddress }, query: { limit: 200 } });
  console.log("Holders:", holders.data);
}

await main();
```

![Equity token with on-chain governance parameters](/docs/screenshots/equity/equity-detail-1.webp)

## Troubleshooting [#troubleshooting]

| Error or symptom                                | What to check                                                                                                                 |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `Authentication missing`                        | Check the API key passed to `createDalpClient`.                                                                               |
| `PINCODE_INVALID`                               | Re-enter the PINCODE or use another enabled wallet verification type.                                                         |
| `USER_NOT_AUTHORIZED` or missing `tokenManager` | Ask a system `admin` to grant `tokenManager` before token creation.                                                           |
| Permission denied during mint or unpause        | Grant the token `supplyManagement` role for minting and `emergency` role for unpause.                                         |
| Token is paused                                 | Confirm Step 6 succeeded before testing transfers.                                                                            |
| `RecipientNotVerified`                          | Register the recipient wallet in the identity registry, then retry the mint.                                                  |
| Invalid `class` or `category`                   | Use one of the values in the DALP equity taxonomy. These fields are optional when the issuance does not fit a taxonomy value. |
