Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 2 characters in body; edited title
Source Link

How to get BTC transfer amount from raw tx using bitoinjsbitcoinjs

How to get BTC transfer amount from raw tx using bitoinjsbitcoinjs

Suppose I have following object

console.log(bitcoinjs.Transaction.fromHex(rawTx));

The output

Transaction {
  version: 2,
  locktime: 1655960,
  ins: [
    {
      hash: <Buffer dc 4d aa 10 db 80 36 52 24 49 7c c5 7c bc c5 bc df be e1 2d 58 61 70 e1 0c 7b 76 a7 35 cc 7c 3a>,
      index: 21,
      script: <Buffer 16 00 14 5f f3 9b e6 42 af a9 f3 59 25 34 e7 6a dd b2 ee e3 41 82 15>,
      sequence: 4294967294,
      witness: [Array]
    }
  ],
  outs: [
    {
      value: 1000000,
      script: <Buffer a9 14 14 ea 69 2e 87 76 ec c6 2e 6a aa a1 7d cc d2 8f f3 30 b7 46 87>
    },
    {
      value: 3299775,
      script: <Buffer a9 14 73 e2 99 78 43 31 1e cc 32 b5 ac 38 ef c9 9b b3 ae 54 bc 7c 87>
    }
  ]
}

How can I decode transfer amount (in BTC) from this object?

How to get BTC transfer amount from raw tx using bitoinjs

Suppose I have following object

console.log(bitcoinjs.Transaction.fromHex(rawTx));

The output

Transaction {
  version: 2,
  locktime: 1655960,
  ins: [
    {
      hash: <Buffer dc 4d aa 10 db 80 36 52 24 49 7c c5 7c bc c5 bc df be e1 2d 58 61 70 e1 0c 7b 76 a7 35 cc 7c 3a>,
      index: 21,
      script: <Buffer 16 00 14 5f f3 9b e6 42 af a9 f3 59 25 34 e7 6a dd b2 ee e3 41 82 15>,
      sequence: 4294967294,
      witness: [Array]
    }
  ],
  outs: [
    {
      value: 1000000,
      script: <Buffer a9 14 14 ea 69 2e 87 76 ec c6 2e 6a aa a1 7d cc d2 8f f3 30 b7 46 87>
    },
    {
      value: 3299775,
      script: <Buffer a9 14 73 e2 99 78 43 31 1e cc 32 b5 ac 38 ef c9 9b b3 ae 54 bc 7c 87>
    }
  ]
}

How can I decode transfer amount (in BTC) from this object?

How to get BTC transfer amount from raw tx using bitcoinjs

Suppose I have following object

console.log(bitcoinjs.Transaction.fromHex(rawTx));

The output

Transaction {
  version: 2,
  locktime: 1655960,
  ins: [
    {
      hash: <Buffer dc 4d aa 10 db 80 36 52 24 49 7c c5 7c bc c5 bc df be e1 2d 58 61 70 e1 0c 7b 76 a7 35 cc 7c 3a>,
      index: 21,
      script: <Buffer 16 00 14 5f f3 9b e6 42 af a9 f3 59 25 34 e7 6a dd b2 ee e3 41 82 15>,
      sequence: 4294967294,
      witness: [Array]
    }
  ],
  outs: [
    {
      value: 1000000,
      script: <Buffer a9 14 14 ea 69 2e 87 76 ec c6 2e 6a aa a1 7d cc d2 8f f3 30 b7 46 87>
    },
    {
      value: 3299775,
      script: <Buffer a9 14 73 e2 99 78 43 31 1e cc 32 b5 ac 38 ef c9 9b b3 ae 54 bc 7c 87>
    }
  ]
}

How can I decode transfer amount (in BTC) from this object?

Source Link

How to get BTC transfer amount from raw tx using bitoinjs

Suppose I have following object

console.log(bitcoinjs.Transaction.fromHex(rawTx));

The output

Transaction {
  version: 2,
  locktime: 1655960,
  ins: [
    {
      hash: <Buffer dc 4d aa 10 db 80 36 52 24 49 7c c5 7c bc c5 bc df be e1 2d 58 61 70 e1 0c 7b 76 a7 35 cc 7c 3a>,
      index: 21,
      script: <Buffer 16 00 14 5f f3 9b e6 42 af a9 f3 59 25 34 e7 6a dd b2 ee e3 41 82 15>,
      sequence: 4294967294,
      witness: [Array]
    }
  ],
  outs: [
    {
      value: 1000000,
      script: <Buffer a9 14 14 ea 69 2e 87 76 ec c6 2e 6a aa a1 7d cc d2 8f f3 30 b7 46 87>
    },
    {
      value: 3299775,
      script: <Buffer a9 14 73 e2 99 78 43 31 1e cc 32 b5 ac 38 ef c9 9b b3 ae 54 bc 7c 87>
    }
  ]
}

How can I decode transfer amount (in BTC) from this object?