Create a Bitcoin Transaction
Who is this tutorial for:
- API users that DO NOT use their iPhone as the Instruction Key.
- API users that need to implement the functionality in programming languages other than JavaScript
- API users that DO NOT want to use our JavaScript SDK.
Brief Outline
- Get your subWallet id from the User Wallets Details Query
- Create a bitcoin transaction via the Create BTC Transaction Mutation
- Verify the transaction and that it was sent by TrustVault
- For testing purposes (sandbox environment) you can skip this step
- For Production we highly recommend you verify the data
- Sign each transaction input
- If your signing solution requires the pre-image data then use the
input.unverifiedDigestData.signData
and use the SHA256 hashing algorithm - If your signing solution can sign hash data then use the
input.unverifiedDigestData.shaSignData
- If your signing solution requires the pre-image data then use the
- Submit the signatures in the same order as the inputs via the Add Signature Mutation
- Poll the status of the transaction to confirm it was sent to the network using the Get Request Item Query
JavaScript Example
Below is a brief example for creating, signing and submitting a BTC transaction. Sandbox users can comment out the verifyBitcoinTransaction
for fast implementation but MUST implement it for Production. The code for verifyBitcoinTransaction
will be made available soon.
1 | import { ApiClient } from "./api-client"; |