toAddress property

String get toAddress

Generates an address for this public key, using the provided kwargs for additional parameters. The exact encoding method depends on the coin configuration. An exception is thrown for special cases like Cardano Shelley or Monero, which require using specific classes to generate addresses.

Implementation

String get toAddress {
  BlockchainAddressEncoder encoder = coinConf.encoder();
  if (encoder is AdaShelleyAddrEncoder) {
    throw ArgumentException(
        'Use the CardanoShelley class to get Cardano Shelley addresses');
  }
  // Exception for Monero
  if (encoder is XmrAddrEncoder) {
    throw ArgumentException('Use the Monero class to get Monero addresses');
  }
  return encoder.encodeKey(
      pubKey.pubKey.compressed, coinConf.getParams(pubKey));
}