Electrum

電子獲取交易金額命令行

  • September 26, 2020

如何通過命令行檢索交易金額?似乎gettransaction返回雜湊僅包含一些輸入輸出資訊而沒有任何數量。

gettransaction('TXID')
deserialize('Serialized Hex')

第二個命令的範例輸出:

{
   "inputs": [
       {
           "coinbase": false,
           "nsequence": 4294967293,
           "prevout_hash": "c12ed68e512aa68dbf88878902efba20446024b645f5254f4b9411db2c6e684c",
           "prevout_n": 0,
           "scriptSig": "",
           "witness": "0247304402205c37067a6677463dc61251645de37e4f80c41dfd09350e80e1f603b756c5a5e20220164a6890be2d0495b1899616712d86fcad64e154ceadf472bad73a9c0f76941e0121020d46ac63ff392d6536d14016e35bfa2ddcb8a21dfa792cf24a55871435cd03e4"
       }
   ],
   "locktime": 1807798,
   "outputs": [
       {
           "address": "2MsceuMFj99x82UmTBgsXN6iiiphtWipGoC",
           "scriptpubkey": "a914040d887b939576a6718c2da094999075f59d54fc87",
           "value_sats": 1000000
       },
       {
           "address": "tb1qh7ncmmc3flp6pfcsqzvdnp9el87l28d87d0tz9",
           "scriptpubkey": "0014bfa78def114fc3a0a7100098d984b9f9fdf51da7",
           "value_sats": 1699000
       }
   ],
   "version": 2
}

引用自:https://bitcoin.stackexchange.com/questions/98712