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

The createTransacion function has the following properties.

property description required

network

specify which blockchin

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.createTransaction({
    network: "BTC",
    amount: 0.001
    from: [
        "tb1qmkg9mcvlt6atwp5gugvwmyc8kj3sffn728rnghcsa4jvtl2ea0ks03fwlw"
    ]
    to: "tb1qmkg9mcvlt6atwp5gugvwmyc8kj3sffn728rnghcsa4jvtl2ea0ks03fwlw"
});

console.log(result); 

Last updated