Please note the following addresses are used for the example purpose only.
Step 1: Prepare Your Request
To initiate the transaction, use the/api/transaction/encode
endpoint with the following payload:
Step 2: Response
The API will respond with a hex-encoded PSBT (Partially Signed Bitcoin Transaction). Example:Step 3: Analyze the PSBT
The PSBT contains details about the inputs and outputs used in the transaction.Inputs:
Outputs:
Step 4: Signing the Transaction
The PSBT provided by Adamik API must be signed with a compatible Bitcoin signer. Example of a signed transaction (hex-encoded):Step 5: Finalize and Broadcast
After signing, submit the transaction using the/api/transaction/broadcast
endpoint.
- Submit the original transaction intent.
- Input the hex-encoded PSBT.
- Add the signed BTC transaction in the signature field of the broadcast endpoint
Summary
- Transaction Intent: Specify sender, recipient, and amount.
- PSBT Generation: The Adamik API will generate the PSBT and automatically select the UTXOs for the transaction, as well as calculate the fees.
- Sign the PSBT: Employ a compatible signer.
- Broadcast: Submit the signed transaction back to the Adamik API, which will broadcast the transaction to the Bitcoin network.