Addresses routes

For a profile to receive digital assets they need a receiving address. every profile has the ability to get millions of receiving addresses.

Before you create an address, make sure that you create a wallet

Create an address

This operation creates an address

POST https://sandbox.oumla.com/api/v1/address/generate

Headers

Name
Type
Description

x-api-key*

string

Oumla api key

Request Body

Name
Type
Description

reference *

string

The id for that user.

network*

NetworkType

One of the network types that we support. like for example "ETH"

clientShare*

string

The client share that generated in the registration.

Sample code of the request:

async function generateAddress(reference: string, network: string, clientShare: string) {
  const apiKey = "Your API Key";
  const url = "https://sandbox.oumla.com/api/v1/address/generate";

  const data = JSON.stringify({ reference, network, clientShare });

  const response = await fetch(url, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": apiKey,
    },
    body: data,
  });

  const responseData = await response.json();
  console.log(responseData);
}

// Example usage
generateAddress("dba1fea5-2004-4ea8-a06d-a7c7c5559b8f","BTC", "Your clientShare")

The expected response:

{
    "message": "bitcoin mainnet address created",
    "data": "3Ls73KucJMLsD8Tm6aMzq64SVo32z8Buhi",
    "success": true,
    "status": 201
}

Get Addresses

This operation to get addresses by Profile

GET https://sandbox.oumla.com/api/v1/addresses/{{reference}}

Query Parameters (required)

Name
Type
Description

reference*

string

The id for that user.

Headers

Name
Type
Description

x-api-key*

string

Oumla api key

Sample code of the request:

async function getAddressByReference(reference: string) {
  const apiKey = "Your API Key";
  const url = `https://sandbox.oumla.com/api/v1/addresses/${reference}`;

  const response = await fetch(url, {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": apiKey,
    },
  });

  const data = await response.json();
  console.log(data);
}

getAddressByReference("89a625b9-4c5f-4130-8b56-afx8010f8103")

Get Addresses

This operation to get addresses for organization

GET https://sandbox.oumla.com/api/v1/addresses/organization

Query Parameters (Optional)

Name
Type
Description

skip

number

to skip a certain number of rows

limit

number

to get a certain number of rows

Headers

Name
Type
Description

x-api-key*

string

Oumla api key

Sample code of the request:

async function getAllAddressed() {
  const apiKey = "Your API Key";
  const url = `https://sandbox.oumla.com/api/v1/addresses/organization`;

  const response = await fetch(url, {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": apiKey,
    },
  });

  const data = await response.json();
  console.log(data);
}

getAllAddressed()

The expected response:

{
  addresses: [
    {
      address: 'tb1q96ljkt664n2gc6ah07m0q9nzfpmzl7kkg409wkvkx9ey8nzf5f3qlcerem',
      date: '2024-04-01T10:02:04.521Z',
      label: null,
      network: 'BTC',
      balance: 0,
      reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f'
    },
    // and the other addresses
  ],
  skip: 0,
  take: 10,
  totalElements: 1,
  totalPages: 1
}

Last updated