Sending Transactions

Send transactions from your users to other address

Sending a transaction from an address or multiple addresses to another address. This function will create a transaction

Before you create any transaction, make sure that you create an address and make sure you have amount in your wallet, if you don't have please check this How to Obtain Testnet Coins?

The createTransacion function has the following properties.

property description required

network

specify which blockchain

required

from

specify which addresses to withdraw from. This is an array of strings.

required

amount

the amount to send.

required

to

the desired address

required

property description required

network

specify which blockchain

required

from

specify which addresses to withdraw from. This is an array of strings.

required

amount

the amount to send.

required

to

the desired address

required

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

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

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

const result = await client.transactions.create({
    network: "BTC",
    amount: 0.001,
    from: [
        "tb1qmkg9mcvlt6atwp5gugvwmyc8kj3sffn728rnghcsa4jvtl2ea0ks03fwlw"
    ],
    to: "tb1qmkg9mcvlt6atwp5gugvwmyc8kj3sffn728rnghcsa4jvtl2ea0ks03fwlw"
});

console.log(result); 

The expected output

 { status: 'confirmed' }

Last updated