import {
getZcashAddressType,
isZcashAddress,
isShieldedZcashAddress,
parseUnifiedAddress,
extractTransparentFromUnified,
resolveSwapDestinationAddress,
} from "leokit-sdk";
getZcashAddressType("zs1..."); // "z"
getZcashAddressType("u1..."); // "u"
getZcashAddressType("t1..."); // "t"
isShieldedZcashAddress("zs1..."); // true
isShieldedZcashAddress("t1..."); // false
// Unified address has both transparent and shielded receivers
const { transparent, shielded } = parseUnifiedAddress("u1...");
const t = extractTransparentFromUnified("u1...");
// When swapping TO a unified address, pick the correct sub-receiver
// based on the protocol's native address type:
const dest = resolveSwapDestinationAddress({
unifiedAddress: "u1...",
preferredType: "transparent", // many cross-chain protocols only support t-addresses
});