Oumla Docs
  • Quick start
  • Introduction
  • Security
  • Networks
  • Authentication
  • Use cases
  • SDK
    • Oumla client
    • Create a Profile
    • Getting Profiles
    • Generate a Wallet
    • Getting Wallets
    • Generate Addresses
    • Getting Addresses
    • Getting Transactions
    • Sending Transactions
    • SDK reference
  • API Reference
    • Organization routes
    • Profiles routes
    • Wallet routes
    • Addresses routes
    • Transactions routes
  • Types
  • FAQs
Powered by GitBook
On this page
  1. SDK

Getting Addresses

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

Here are the properties for generateAddress function:

property
description
required
type

reference

specify which user. If not provied it will bring all the addresses for the organization

optional

string

Each address has metadata such as balance.

For Example,

Get All addresses


import { Oumla } from "@oumla/sdk";

const client = new Oumla({
   apiKey: process.env.API_KEY,
   // Additional options...
});

const address = await client.addresses.get();

console.log(address);

The expected output

{
  addresses: [
    {
      address: 'tb1qmkg9mcvlt6atwp5gugvwmyc8kj3sffn728rnghcsa4jvtl2ea0ks03fwlw',
      date: '2024-01-17T18:35:42.663Z',
      label: null,
      sub: '4bcc74c3-dc5c-4bfd-aaf3-6881a1b28809',
      network: 'BTC',
      balance: 0,
      reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f'
    },
    {
      address: 'tb1qmkg9mcvlt6atwp5gugvwmyc8kj3sffn728rnghcsa4jvtl2ea0ks03fwlw',
      date: '2024-01-17T09:10:17.944Z',
      label: null,
      sub: '4bcc74c3-dc5c-4bfd-aaf3-6881a1b28809',
      network: 'BTC',
      balance: 0,
      reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f'
    },
    // and the other addresses ...
  ],
  totalElements: 2,
  totalPages: 1,
  skip: 0,
  take: 10
}

Get Addresses By Reference


const client = new Oumla({
   apiKey: process.env.API_KEY,
   // Additional options...
});

const address = await client.addresses.get({
     reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f',
});

console.log(address);

The expected output

{
  addresses: [
    {
      address: 'tb1qmkg9mcvlt6atwp5gugvwmyc8kj3sffn728rnghcsa4jvtl2ea0ks03fwlw',
      date: '2024-03-10T13:07:56.936Z',
      label: null,
      network: 'BTC',
      balance: 0,
      reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f'
    }
    // and the other addresses ...
  ],
  skip: 0,
  take: 10,
  totalElements: 1,
  totalPages: 1
}
]
PreviousGenerate AddressesNextGetting Transactions

Last updated 9 months ago