Skip to main content
The Oumla TypeScript SDK provides a type-safe, easy-to-use interface for interacting with the Oumla API. This reference documents all available SDK methods organized by resource.
Two Ways to Use Oumla: You can interact with Oumla either through our TypeScript SDK (documented here) or through direct REST API calls (see API Reference). Both methods provide the same functionality - choose the one that best fits your project. The SDK is recommended for TypeScript/JavaScript projects as it provides type safety and better developer experience.

Installation

npm install @oumla/sdk
or
yarn add @oumla/sdk
or
pnpm add @oumla/sdk

Quick Start

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

const client = new OumlaSdkApiClient({
  environment: OumlaSdkApiEnvironment.Sandbox,
  apiKey: 'your-api-key-here'
});
Get your API key from the dashboard.

SDK Resources

The SDK is organized into the following resource modules:

Profiles

Create and manage user profiles (User, Department, Merchant)

Wallets

Generate and manage wallets for profiles and organizations

Addresses

Generate addresses for Bitcoin and Ethereum networks

Transactions

Query transaction history by address, wallet, profile, or organization

Portfolio

View assets and native balances across addresses

Withdrawals

Create and execute withdrawal requests

Tokenization

Create collections, mint tokens, and manage NFTs (ERC-721, ERC-1155)

Contract Templates

Manage smart contract templates and deploy contracts

Deployed Contracts

Manage deployed contracts and contract ABIs

Contract Interactions

Call read and write functions on deployed contracts

Workflows

Track async workflow status for long-running operations

Type Safety

The SDK provides full TypeScript support with comprehensive type definitions:
import type { CreateProfileRequest, CreateProfileResponse } from '@oumla/sdk';

const request: CreateProfileRequest = {
  reference: 'user-123',
  type: 'User'
};

const response: CreateProfileResponse = await client.profiles.createProfile(request);

Error Handling

All SDK methods throw typed errors that you can catch and handle:
import { OumlaSdkApiError } from '@oumla/sdk';

try {
  const profile = await client.profiles.createProfile({ reference: 'user-123', type: 'User' });
} catch (error) {
  if (error instanceof OumlaSdkApiError) {
    console.error('API Error:', error.statusCode, error.message);
    // Handle specific error codes
    if (error.statusCode === 401) {
      // Authentication error
    }
  }
}

Environments

The SDK supports multiple environments:
import { OumlaSdkApiEnvironment } from '@oumla/sdk';

// Sandbox environment (for testing)
const sandboxClient = new OumlaSdkApiClient({
  environment: OumlaSdkApiEnvironment.Sandbox,
  apiKey: 'your-sandbox-api-key'
});

// Production environment
const productionClient = new OumlaSdkApiClient({
  environment: OumlaSdkApiEnvironment.Production,
  apiKey: 'your-production-api-key'
});

// Custom base URL
const customClient = new OumlaSdkApiClient({
  baseUrl: 'https://custom-api.example.com',
  apiKey: 'your-api-key'
});

Request Options

All SDK methods accept optional request options:
const profile = await client.profiles.createProfile(
  { reference: 'user-123', type: 'User' },
  {
    timeoutInSeconds: 30,
    maxRetries: 3,
    apiKey: 'override-api-key', // Override default API key
    headers: { 'Custom-Header': 'value' }
  }
);

Next Steps