Add Kotlin API docs for new AddressInfo type

This commit is contained in:
thunderbiscuit 2023-03-28 19:51:15 -04:00
parent ac600a1312
commit 5ee8698e0a
No known key found for this signature in database
GPG Key ID: 88253696EB836462
2 changed files with 7 additions and 2 deletions

View File

@ -24,12 +24,14 @@ enum class Network {
* *
* @property index Child index of this address. * @property index Child index of this address.
* @property address Address. * @property address Address.
* @property keychain Type of keychain.
* *
* @sample org.bitcoindevkit.addressInfoSample * @sample org.bitcoindevkit.addressInfoSample
*/ */
data class AddressInfo ( data class AddressInfo (
var index: UInt, var index: UInt,
var address: String var address: Address,
var keychain: KeychainKind
) )
/** /**
@ -846,6 +848,9 @@ class Address(address: String) {
* Quoting BIP 173 "inside QR codes uppercase SHOULD be used, as those permit the use of alphanumeric mode, which is 45% more compact than the normal byte mode." * Quoting BIP 173 "inside QR codes uppercase SHOULD be used, as those permit the use of alphanumeric mode, which is 45% more compact than the normal byte mode."
*/ */
fun toQrUri(): String fun toQrUri(): String
/** Return the address as a string. */
fun asString(): String
}} }}
/** /**

View File

@ -87,7 +87,7 @@ fun addressInfoSample() {
val newAddress: AddressInfo = wallet.getAddress(AddressIndex.New) val newAddress: AddressInfo = wallet.getAddress(AddressIndex.New)
println("New address at index ${newAddress.index} is ${newAddress.address}") println("New address at index ${newAddress.index} is ${newAddress.address.asString()}")
} }
fun blockchainSample() { fun blockchainSample() {