jmwallet.wallet.psbt
jmwallet.wallet.psbt
Strict BIP174 PSBT v0 parsing and record-preserving updates.
Attributes
PSBT_GLOBAL_UNSIGNED_TX = 0
module-attribute
PSBT_GLOBAL_VERSION = 251
module-attribute
PSBT_GLOBAL_XPUB = 1
module-attribute
PSBT_IN_BIP32_DERIVATION = 6
module-attribute
PSBT_IN_FINAL_SCRIPTSIG = 7
module-attribute
PSBT_IN_FINAL_SCRIPTWITNESS = 8
module-attribute
PSBT_IN_NON_WITNESS_UTXO = 0
module-attribute
PSBT_IN_PARTIAL_SIG = 2
module-attribute
PSBT_IN_PROPRIETARY = 252
module-attribute
PSBT_IN_REDEEM_SCRIPT = 4
module-attribute
PSBT_IN_SIGHASH_TYPE = 3
module-attribute
PSBT_IN_WITNESS_SCRIPT = 5
module-attribute
PSBT_IN_WITNESS_UTXO = 1
module-attribute
PSBT_MAGIC = b'psbt\xff'
module-attribute
PSBT_OUT_BIP32_DERIVATION = 2
module-attribute
PSBT_OUT_PROPRIETARY = 252
module-attribute
PSBT_OUT_REDEEM_SCRIPT = 0
module-attribute
PSBT_OUT_WITNESS_SCRIPT = 1
module-attribute
Classes
BIP32KeyOrigin
dataclass
A BIP32 public key and its master fingerprint and derivation path.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
82 83 84 85 86 87 88 | |
Attributes
fingerprint: bytes
instance-attribute
path: tuple[int, ...]
instance-attribute
pubkey: bytes
instance-attribute
PSBTError
Bases: ValueError
Raised when a PSBT violates BIP174 serialization requirements.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
36 37 | |
PSBTKeyValue
dataclass
An ordered raw PSBT key/value record.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
40 41 42 43 44 45 | |
Attributes
key: bytes
instance-attribute
value: bytes
instance-attribute
PSBTMap
dataclass
A PSBT map retaining record order and unknown records.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
Attributes
records: list[PSBTKeyValue] = field(default_factory=list)
class-attribute
instance-attribute
Methods:
append(key: bytes, value: bytes) -> None
Append a unique, nonempty raw record to this map.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
54 55 56 57 58 59 60 | |
serialize() -> bytes
Serialize this map with canonical CompactSize lengths.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
62 63 64 65 66 67 68 69 70 71 | |
ParsedPSBT
dataclass
A parsed BIP174 PSBT v0, retaining all raw map records.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
Attributes
global_map: PSBTMap
instance-attribute
input_maps: list[PSBTMap]
instance-attribute
output_maps: list[PSBTMap]
instance-attribute
transaction: ParsedTransaction
instance-attribute
unsigned_tx: bytes
instance-attribute
Methods:
append_input_key_value(input_index: int, key: bytes, value: bytes) -> None
Append a valid unique record to an input map.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
111 112 113 114 115 116 117 118 119 120 121 | |
serialize() -> bytes
Serialize the PSBT while preserving all map record order.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
101 102 103 104 105 106 107 108 109 | |
WitnessUTXO
dataclass
The amount and scriptPubKey contained in a PSBT witness UTXO record.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
74 75 76 77 78 79 | |
Attributes
script_pubkey: bytes
instance-attribute
value: int
instance-attribute
Functions:
parse_bip32_derivation(key: bytes, value: bytes) -> BIP32KeyOrigin
Parse a BIP174 BIP32 derivation key/value pair.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
178 179 180 181 182 183 184 185 186 187 188 189 190 | |
parse_psbt(data: bytes) -> ParsedPSBT
Parse a strict, complete BIP174 PSBT v0 binary payload.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
parse_witness_utxo(value: bytes) -> WitnessUTXO
Parse a BIP174 witness UTXO value with exact consumption.
Source code in jmwallet/src/jmwallet/wallet/psbt.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |