zcash-android-wallet-sdk/docs/-sdk-synchronizer/validate-address.md

20 lines
1.1 KiB
Markdown
Raw Normal View History

2020-06-10 00:27:52 -07:00
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [validateAddress](./validate-address.md)
2020-01-15 05:07:00 -08:00
# validateAddress
2020-06-10 00:27:52 -07:00
`suspend fun validateAddress(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`AddressType`](../../cash.z.ecc.android.sdk.validate/-address-type/index.md)
2020-01-15 05:07:00 -08:00
2020-06-10 00:27:52 -07:00
Validates the given address, returning information about why it is invalid. This is a
convenience method that combines the behavior of [isValidShieldedAddr](../-synchronizer/is-valid-shielded-addr.md) and
[isValidTransparentAddr](../-synchronizer/is-valid-transparent-addr.md) into one call so that the developer doesn't have to worry about
handling the exceptions that they throw. Rather, exceptions are converted to
[AddressType.Invalid](../../cash.z.ecc.android.sdk.validate/-address-type/-invalid/index.md) which has a `reason` property describing why it is invalid.
2020-01-15 05:07:00 -08:00
### Parameters
2020-06-09 20:28:21 -07:00
`address` - the address to validate.
2020-06-10 00:27:52 -07:00
**Return**
an instance of [AddressType](../../cash.z.ecc.android.sdk.validate/-address-type/index.md) providing validation info regarding the given address.