Raw Transactions

Create an un-broadcasted raw transaction

Once a transaction is created using the /send endpoint and broadcasted to the network, there may be situations where access to the raw transaction data before broadcasting is necessary. To address this use case, the /rawtx endpoint becomes relevant. By utilizing the /rawtx endpoint, you can generate one or multiple transactions and retrieve the un-broadcasted raw transaction data. This data can be employed for alternative processes as needed.

The transactions generated through the /rawtx endpoint are constructed in their pure form, devoid of any change outputs that might be required for subsequent transactions. It's important to understand that any change outputs included in the transactions are not considered valid on the network until the previous transaction has been successfully broadcasted.

Similar to the /send endpoint, the /rawtx endpoint allows you to create transactions using the same input parameters in the request body. This facilitates consistency and familiarity in the process of generating transactions between the two endpoints.

var parameters = {
    serviceId: 'optional',
    walletID: 'optional',
    data: {
      dataArray: [
        {
          to: "17n2JVhrCf1oYSMkZtZNjcf1deteUEKQsH",
          amount: 0.0001
        }
      ]
    },
}
const response = await relysia.transaction.v1.rawtx(parameters);

Build and return a raw transaction

GET https://api.relysia.com/v1/rawtx

Use the /rawtx endpoint containing a single input and output. Transactions can be held and the utxo that is used will be blocked from the user access.

Headers

Request Body

{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "Operation completed successfully",
    "rawTxs": [
      "0100000002e36d2003986bc84d1dec875ed686960e3794334c2e53bd8ee0d7897e4bf3f521000000006a4730440220063953703f06f9557691dba7b0424b9a1ca6dba2ec35bae7dd41e7b15fd38f1d0220439c01459709def5c824ded74102f4170ab3cee9ba7ab9f3b92dc80d7fcecf74412103c63be73d975c3f6274539704e27b2cb811bcc80dc11e95157cef3df8a5b3ac36ffffffffe36d2003986bc84d1dec875ed686960e3794334c2e53bd8ee0d7897e4bf3f521010000006b483045022100e5e0b6e4a61b7bad5c69a5b83032d6a48bb5976d582d52c881db2910ad79bb58022040a10e7dd9cde95c3756c63f33d6b5c119f35dcb4cedd29cc4424bf01e3548ed4121020824bb65d1cc92de2a37410e4279211a0d53788140a528b17f7ada7f4ad8a9a9ffffffff0101000000000000001976a91447431db9649fd75c28834cb152f17cc8ea7fa11f88ac00000000"
    ]
  }
}

The rawtx response is a valid signed transaction that can be used in conjunction with paying invoices or awaiting other logic before broadcasting it to the network.

Last updated