Skip to main content
Create NFT collections (ERC-721, ERC-1155), mint tokens, manage token operations, and link existing contracts.

Collection Methods

createCollection()

Create a new NFT collection (ERC-721 or ERC-1155). Returns a workflow ID for async processing. Signature:
createCollection(
  request: CreateCollectionRequest,
  requestOptions?: RequestOptions
): Promise<CreateCollectionResponse>
Parameters:
ParameterTypeRequiredDescription
request.addressIdstringYesAddress ID for deployment
request.type'NON_FUNGIBLE_TOKEN' | 'SEMI_FUNGIBLE_TOKEN'YesCollection type (ERC-721 or ERC-1155)
request.clientSharestringYesClient share for signing
request.createParamsobjectYesConstructor parameters
request.createParams.initializeParamsarrayYesArray of exactly 5 constructor parameter objects [{ name, type, value }, ...]
request.networkstringNoBlockchain network
request.displayNamestringNoCollection display name
request.useGaslessbooleanNoWhether to use gasless transactions
request.feestringNoCustom fee amount
request.feeLevelstringNoTransaction fee level
request.descriptionstringNoCollection description
Example Request:
const collection = await client.tokenization.createCollection({
  addressId: 'your-address-id',
  type: 'NON_FUNGIBLE_TOKEN',
  clientShare: 'your-client-share',
  network: 'ETHEREUM',
  displayName: 'My Collection',
  useGasless: false,
  fee: '0',
  feeLevel: 'standard',
  description: 'Optional collection description',
  createParams: {
    initializeParams: [
      { name: '_name', type: 'string', value: 'My Collection' },
      { name: '_symbol', type: 'string', value: 'MYC' },
      { name: 'defaultAdmin', type: 'address', value: '0x1111111111111111111111111111111111111111' },
      { name: 'minter', type: 'address', value: '0x2222222222222222222222222222222222222222' },
      { name: 'pauser', type: 'address', value: '0x3333333333333333333333333333333333333333' }
    ]
  }
});
Example Response:
{
  data: {
    workflowResult: {
      workflowId: 'workflow-id-here',
      operationId: 'deployment-id-here',
      status: 'started',
      message: 'Create collection workflow started'
    }
  }
}
Response Fields:
FieldTypeRequiredDescription
data.workflowResult.workflowIdstringYesWorkflow ID for tracking collection creation
data.workflowResult.operationIdstringYesOperation ID (e.g. deploymentId)
data.workflowResult.status'started' | 'already_running'YesWorkflow status
data.workflowResult.messagestringYesHuman-readable status message
console.log('Workflow ID:', collection.data.workflowResult.workflowId);

getCollections()

Get a paginated list of collections. Signature:
getCollections(
  request?: GetCollectionsRequest,
  requestOptions?: RequestOptions
): Promise<CollectionsResponse>
Example:
const collections = await client.tokenization.getCollections({
  skip: 0,
  take: 25
});

console.log('Collections:', collections.data);

getCollectionById()

Get details for a specific collection. Signature:
getCollectionById(
  id: string,
  requestOptions?: RequestOptions
): Promise<CollectionResponse>
Example:
const collection = await client.tokenization.getCollectionById('collection-id');

console.log('Contract Address:', collection.data.contractAddress);
console.log('Network:', collection.data.network);

deleteCollection()

Delete a collection. Signature:
deleteCollection(
  id: string,
  requestOptions?: RequestOptions
): Promise<void>
Example:
await client.tokenization.deleteCollection('collection-id');

Token Methods

mintToken()

Mint a token in a collection. Returns a workflow ID for async processing. Signature:
mintToken(
  id: string,
  request: MintTokenRequest,
  requestOptions?: RequestOptions
): Promise<MintTokenResponse>
Parameters:
ParameterTypeRequiredDescription
idstringYesCollection ID
request.addressIdstringYesAddress ID for signing
request.clientSharestringYesClient share
request.tostringYesRecipient address
request.metadataobjectNoToken metadata (JSON object)
request.useGaslessbooleanNoWhether to use gasless transactions
request.feestringNoCustom fee amount
request.feeLevelstringNoTransaction fee level
Example Request:
const mintResult = await client.tokenization.mintToken('collection-id', {
  addressId: 'address-id',
  clientShare: 'your-client-share',
  to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
  metadata: {
    name: 'My First NFT',
    image: 'https://example.com/image.png'
  },
  useGasless: false,
  fee: '0',
  feeLevel: 'standard'
});
Example Response:
{
  data: {
    workflowResult: {
      workflowId: 'workflow-id-here',
      operationId: 'mint-id-here',
      status: 'started',
      message: 'Mint token workflow started'
    }
  }
}
Response Fields:
FieldTypeRequiredDescription
data.workflowResult.workflowIdstringYesWorkflow ID for tracking token minting
data.workflowResult.operationIdstringYesOperation ID (e.g. mintId)
data.workflowResult.status'started' | 'already_running'YesWorkflow status
data.workflowResult.messagestringYesHuman-readable status message
console.log('Mint Workflow ID:', mintResult.data.workflowResult.workflowId);

burnToken()

Burn a token from a collection. Returns a workflow ID for async processing. Signature:
burnToken(
  id: string,
  request: BurnTokenRequest,
  requestOptions?: RequestOptions
): Promise<BurnTokenResponse>
Parameters:
ParameterTypeRequiredDescription
idstringYesCollection ID
request.addressIdstringYesAddress ID for signing
request.clientSharestringYesClient share
request.tokenIdstringYesToken ID to burn
request.useGaslessbooleanNoWhether to use gasless transactions
request.feestringNoCustom fee amount
request.feeLevelstringNoTransaction fee level
Example Request:
const burnResult = await client.tokenization.burnToken('collection-id', {
  addressId: 'address-id',
  clientShare: 'your-client-share',
  tokenId: '0',
  useGasless: false,
  fee: '0',
  feeLevel: 'standard'
});
Example Response:
{
  data: {
    workflowResult: {
      workflowId: 'workflow-id-here',
      operationId: 'burn-id-here',
      status: 'started',
      message: 'Burn token workflow started'
    }
  }
}
Response Fields:
FieldTypeRequiredDescription
data.workflowResult.workflowIdstringYesWorkflow ID for tracking token burning
data.workflowResult.operationIdstringYesOperation ID (e.g. burnId)
data.workflowResult.status'started' | 'already_running'YesWorkflow status
data.workflowResult.messagestringYesHuman-readable status message
console.log('Burn Workflow ID:', burnResult.data.workflowResult.workflowId);

getCollectionTokens()

Get all tokens in a collection. Signature:
getCollectionTokens(
  request: GetCollectionTokensRequest,
  requestOptions?: RequestOptions
): Promise<CollectionTokensResponse>
Example:
const tokens = await client.tokenization.getCollectionTokens({
  id: 'collection-id',
  skip: 0,
  take: 50
});

console.log('Tokens:', tokens.data);

getCollectionTokenDetails()

Get details for a specific token. Signature:
getCollectionTokenDetails(
  id: string,
  tokenId: string,
  requestOptions?: RequestOptions
): Promise<TokenDetailsResponse>
Example:
const token = await client.tokenization.getCollectionTokenDetails(
  'collection-id',
  '0'
);

console.log('Token:', token.data);

Token Management Methods

issueNewToken()

Start the issue-token workflow from a deployed contract template. Returns a workflow ID for async processing — the token is not ready until the workflow completes. Signature:
issueNewToken(
  request: IssueNewTokenRequest,
  requestOptions?: RequestOptions
): Promise<IssueNewTokenResponse>
Parameters:
ParameterTypeRequiredDescription
request.networkIdstringYesNetwork ID (from getNetworks())
request.addressIdstringYesAddress ID for signing
request.clientSharestringYesClient share for signing
request.createParamsobjectYesConstructor parameters
request.deploymentIdstringYesDeployment ID of the contract template
request.displayNamestringYesToken display name
request.useGaslessbooleanYesWhether to use gasless transactions
request.feestringYesCustom fee amount
request.feeLevel'LOW' | 'MEDIUM' | 'HIGH'NoTransaction fee level
Example Request:
const token = await client.tokenization.issueNewToken({
  networkId: 'your-network-id',
  addressId: 'address-id',
  clientShare: 'your-client-share',
  deploymentId: 'deployment-id',
  displayName: 'My Token',
  useGasless: false,
  fee: '0',
  feeLevel: 'MEDIUM',
  createParams: {
    initializeParams: [
      { name: '_name', type: 'string', value: 'My Token' },
      { name: '_symbol', type: 'string', value: 'MTK' }
    ]
  }
});
Example Response:
{
  data: {
    workflowResult: {
      workflowId: 'workflow-id-here',
      operationId: 'token-id-here',
      status: 'started',
      message: 'Issue token workflow started'
    }
  }
}
Response Fields:
FieldTypeRequiredDescription
data.workflowResult.workflowIdstringYesWorkflow ID for tracking token issuance
data.workflowResult.operationIdstringYesOperation ID (token ID assigned to the issuance)
data.workflowResult.status'started' | 'already_running'YesWorkflow status
data.workflowResult.messagestringYesHuman-readable status message
The HTTP endpoint responds with 202 Accepted. If the underlying contract is still deploying, expect error code ERR-146 (“Contract deployment is still in progress.”) — wait for the contract deployment workflow to complete before retrying.

getTokens()

List issued tokens for the organization with pagination. Signature:
getTokens(
  request?: GetTokensRequest,
  requestOptions?: RequestOptions
): Promise<TokensResponse>
Example:
const tokens = await client.tokenization.getTokens({
  skip: 0,
  take: 50
});

console.log('Tokens:', tokens.data);

getLinkedToken()

Get a linked token by its ID. Signature:
getLinkedToken(
  id: string,
  requestOptions?: RequestOptions
): Promise<LinkedTokenResponse>
Example:
const token = await client.tokenization.getLinkedToken('token-id');

console.log('Token:', token.data);

linkContract()

Link an existing deployed contract to the organization for tokenization. Signature:
linkContract(
  request: LinkContractRequest,
  requestOptions?: RequestOptions
): Promise<LinkContractResponse>
Parameters:
ParameterTypeRequiredDescription
request.networkIdstringYesNetwork ID (from getNetworks())
request.contractAddressstringYesContract address to link
request.typestringNoToken type
request.refIdstringNoExternal reference ID
request.displayNamestringNoDisplay name
Example:
const linked = await client.tokenization.linkContract({
  networkId: 'your-network-id',
  contractAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
  displayName: 'My Linked Token'
});

console.log('Linked:', linked.data);

unlinkToken()

Unlink a token from the organization. Signature:
unlinkToken(
  id: string,
  requestOptions?: RequestOptions
): Promise<void>
Example:
await client.tokenization.unlinkToken('token-id');

Complete Example

import { OumlaSdkApiClient, OumlaSdkApiEnvironment } from '@oumla/sdk';

const client = new OumlaSdkApiClient({
  environment: OumlaSdkApiEnvironment.Sandbox,
  apiKey: 'your-api-key'
});

async function tokenizationWorkflow() {
  // Create collection
  const collection = await client.tokenization.createCollection({
    addressId: 'address-id',
    type: 'NON_FUNGIBLE_TOKEN',
    clientShare: process.env.CLIENT_SHARE!,
    network: 'ETHEREUM',
    displayName: 'My NFT Collection',
    createParams: {
      initializeParams: [
        { name: '_name', type: 'string', value: 'My NFT Collection' },
        { name: '_symbol', type: 'string', value: 'MNFT' },
        { name: 'defaultAdmin', type: 'address', value: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb' },
        { name: 'minter', type: 'address', value: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb' },
        { name: 'pauser', type: 'address', value: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb' }
      ]
    }
  });

  // Check workflow status
  let status;
  do {
    status = await client.workflows.getWorkflowStatus(collection.data.workflowResult.workflowId);
    await new Promise(resolve => setTimeout(resolve, 2000));
  } while (status.data.status === 'RUNNING');

  if (status.data.status === 'COMPLETED') {
    // The operationId returned from createCollection is the collection ID
    const collectionId = collection.data.workflowResult.operationId;

    // Mint token
    const mintResult = await client.tokenization.mintToken(collectionId, {
      addressId: 'address-id',
      clientShare: process.env.CLIENT_SHARE!,
      to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
      metadata: {
        name: 'My First NFT',
        image: 'https://example.com/image.png'
      }
    });

    console.log('Mint workflow started:', mintResult.data.workflowResult.workflowId);
  }

  // Link an existing contract
  const linked = await client.tokenization.linkContract({
    networkId: 'your-network-id',
    contractAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
    displayName: 'My Existing Token'
  });

  // List all tokens
  const tokens = await client.tokenization.getTokens({ skip: 0, take: 50 });
  console.log('Organization tokens:', tokens.data);
}