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 Wallets

Getting all the wallets and addresses for a user

Suppose you want to view all of the addresses that a certain user generated. You can use the SDK to get back all of their addresses and check the balances.

A wallet is a collection of addresses that the user created. users could generate an infinite number of addresses if they wish but typically the user generates one to two addresses.

Here are the properties for getting wallets function:

property
description
required
type

network

specify which blockchin

required

networkType

reference

specify which user

optional

string

You only need to initialize the client once at the start of the application

For Example,

Get All Wallets

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

const client = new Oumla({
   apiKey: process.env.API_KEY,

   // Additional options...
});

const wallets = await client.wallets.get();

console.log(wallets)

// return type is Wallet[]

The expected output

{
  wallets: [
    {
      reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f',
      organizationId: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f',
      network: 'BTC',
      type: 'User',
      date: '2024-03-10T11:14:09.896Z',
      currentDeepIndex:: 1,
      index: 0,
    },
    // and the other wallets
  ],
  skip: 0,
  take: 10,
  totalElements: 1,
  totalPages: 1
}

Get Wallet By Reference

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

const client = new Oumla({
   apiKey: process.env.API_KEY,

   // Additional options...
});

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

console.log(wallets)

// return type is Wallet[]

The expected output

{
  wallets: [
    {
      createdAt: '2024-03-10T11:14:09.896Z',
      updated_at: '2024-03-10T11:14:09.896Z',
      isActive: false,
      isVerified: false,
      reference: 'dba1fea5-2004-4ea8-a06d-a7c7c5559b8f',
      currentIndex: 1,
      type: 'User',
      label: null,
      miniWallets: [Array]
    }
  ],
  skip: 0,
  take: 10,
  totalElements: 1,
  totalPages: 1
}
PreviousGenerate a WalletNextGenerate Addresses

Last updated 8 months ago