diff --git a/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt b/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt index 271d66c..ebf2b3a 100644 --- a/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt +++ b/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt @@ -794,10 +794,48 @@ class Script(rawOutputScript: List) * @param address The address in string format. */ class Address(address: String) { + /** Return the Payload */ + fun payload(): Payload + + /** Return the Network. */ + fun Network(): Network + /** Return the ScriptPubKey. */ fun scriptPubkey(): Script } +/** + * The method used to produce an address. + */ +sealed class Payload { + /** P2PKH address. */ + data class PubkeyHash( + val `pubkeyHash`: List + ) : Payload() + + /** P2SH address. */ + data class ScriptHash( + val `scriptHash`: List + ) : Payload() + /** Segwit address. */ + data class WitnessProgram( + val `version`: WitnessVersion, + val `program`: List + ) : Payload() +} + +/** + * Version of the witness program. + * + * Helps limit possible versions of the witness according to the specification. If a plain u8 type + * was used instead it would mean that the version may be > 16, which would be incorrect. + * First byte of scriptPubkey in transaction output for transactions starting with opcodes ranging + * from 0 to 16 (inclusive). + */ +enum class WitnessVersion { + V0,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16; +} + /** * Mnemonic phrases are a human-readable version of the private keys. Supported number of words are 12, 15, 18, 21 and 24. *