How to start with Oumla

Mohammed Aljasser
Oumla
Published in
5 min readNov 30, 2023

Oumla is a blockchain infrastructure that enables businesses and government entities to build on top of any blockchain with ease.

We make it easy for everyone to connect, build, and innovate without having to stress about complicated blockchain security and technical details. You can just concentrate on your business while we take care of all the blockchain stuff for you!

So, how to start with Oumla?

Basically, Oumla will enable you to do most of the operations in the blockchains, such as:

  • Generate wallet
  • Generate addresses
  • Generate transactions
  • Publish transactions
  • And even more.

Oumla will abstract all of the operations for you.

For example, Look at this code snippet from our SDK

const wallet = await client.generateWallet({
network: "BTC",
reference: "42ba5aa7-94ba-4e3a-a7c7-8d348084b7d4",
});

console.log(wallet);

Notice that you have to only give us the network and reference for that user, we will take care of the rest. Now this user has a Bitcoin wallet and you can do operations on that wallet such as create receiving addresses or create transactions.

let’s dig in!

The First Step

you have to go to our site Oumla.com and press Sign up to register with us. After that, you will be redirected to our dashboard.

From the dashboard, You can do a lot of things such as:

  • View all of the analytics.
  • View all of the user data and user operations.
  • View all of the wallets.
  • View all of the Transactions.
  • Along with API key management.

You need to generate an API key from the API keys tab on the side menu

The API key should start with “oumla_”

You can now use that key in our SDK or our API.

let’s take a look at our SDK. it’s open source ;)

You can download and use the SDK by using the following command

npm i @oumla/sdk

in any Typescript/Javascript project

Next, is to configure your client

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

const client = new Oumla({
apiKey: '{YOUR_API_KEY}', // Generated from the dashboard.
baseUrl: "https://sandbox.oumla.com"
});

Now let's assume that you want to create a wallet for a user that you got in your system. First, you have to create a profile for that user. let’s explain what’s a profile.

Profiles play a central role, acting as the core for wallets, addresses, and transactions. When integrating a user into your system for blockchain interaction, having a profile is key.

From the profile, you can create whatever you want. Such as wallets for different networks.

This is how to create a profile:

    const profile = await client.createProfile({
reference: "42ba5aa7-94ba-4e3a-a7c7-8d348084b7d4",
type: 'User',
});
console.log(profile);

From that, now we have a user in our system and that user is referred to by the UUID “42ba5aa7–94ba-4e3a-a7c7–8d348084b7d4”. When doing any operation, you have to mention that user. of course, that reference could be anything, such as emails, random numbers, etc. But we recommend using UUIDs since it is the standard when it comes to uniqueness.

Creating a wallet

Now we have a profile, and from that, we can manage that user and send and receive digital assets.

By default, when creating a profile we create a Bitcoin wallet for the user to make it easier for you. So no need to create a Bitcoin wallet. But to demonstrate how it could be done

Here is an example

const wallet = await client.generateWallet({
network: 'BTC',
reference: '42ba5aa7-94ba-4e3a-a7c7-8d348084b7d4',
});
console.log(wallet);

Now, that user has a wallet and can generate Bitcoin addresses from that wallet. Wallets can hold up to millions of addresses with no problems.

Read more

Creating an Address

let’s create a receiving address for that user “42ba5aa7–94ba-4e3a-a7c7–8d348084b7d4”.

Here is an example of creating a Bitcoin address using our SDK

  const address = await client.generateAddress({
network: 'BTC',
reference: '42ba5aa7–94ba-4e3a-a7c7–8d348084b7d4',
});

Now the user will get an address to receive digital assets and bitcoins.

You can generate any number of addresses for Bitcoin per user/profile.

To test our receiving part. You can for example use a faucet to receive some testnet bitcoin.

There are a lot of Bitcoin faucets such as:

there are many Bitcoin faucets to try out the system in testnet.

Read more

Get transactions

To check if the user has received transactions or not you can check the getTransactions function

Here is an example:

    const transactions = await client.getTransactions();
console.log(transactions);

isn’t that simple enough? :)

Read more

Creating and submitting Transactions

After receiving some digital assets in the user’s wallet you can easily withdraw from addresses using the following function.

    const tx = await client.createTransaction({
amount: 0.00001, // the amount in Bitcoin in this case.
from: [ // list of addresses or a single address
'tb1qm4pcj5jrakzmapma2znjcwztuhfx67n7wufcnn40fgkc32vpkq0q4fzv' // the address you wish to withdraw from
],
network: 'BTC', // the network
to: 'tb1qw2c3lxufxqe2x9s4rdzh65t4d7fssjgh8nv6', // the receiving address
});
console.log(tx);

After that, if you have enough balance, it should create a UTXO (basically a transaction) and send it to the blockchain.

Read more

Congrats 🎉

you’ve created a Bitcoin wallet, received some digital assets, and then transferred those assets to a different wallet without even knowing what actually how the blockchain network works and without worrying about storing and managing private keys. :)

Now (the day of the launch) we’re only supporting Bitcoin’s testnet but later we will support the EVMs(by Jan 2024).

Our goal is to support as many blockchains as we can. And make blockchain networks simple and easy to use. With the same interface you’ve tried in this blog!

for any suggestions please don’t hesitate to contact us at support@oumla.com

--

--