Class AddressBase58

java.lang.Object
org.xrpl.xrpl4j.codec.addresses.Base58
org.xrpl.xrpl4j.codec.addresses.AddressBase58

public class AddressBase58 extends Base58
Extension of Base58 to provide XRPL Address specific Base58 encoding and decoding functionality.
  • Constructor Details

    • AddressBase58

      public AddressBase58()
  • Method Details

    • encode

      public static String encode(UnsignedByteArray bytes, List<Version> versions, com.google.common.primitives.UnsignedInteger expectedLength)
      Encodes the given UnsignedByteArray to a Base58Check String.
      Parameters:
      bytes - An UnsignedByteArray of data to encode.
      versions - A List of Versions which should be prepended to bytes.
      expectedLength - The expected length of the result.
      Returns:
      The Base58Check encoded String of the given parameters.
    • encodeChecked

      public static String encodeChecked(byte[] bytes, List<Version> versions)
      Concatenates the given Version bytes with the given input bytes, and Base58Check encodes the result.
      Parameters:
      bytes - The bytes to encode.
      versions - The Version to encode with.
      Returns:
      A String containing the Base58Check encoded bytes.
    • decode

      public static Decoded decode(String base58Value, Version version)
      Decode a Base58Check String with no specified VersionTypes or expected length.
      Parameters:
      base58Value - The Base58Check encoded String to be decoded.
      version - The Version to try decoding with.
      Returns:
      A Decoded containing the decoded value and version.
      Throws:
      EncodingFormatException - If the version bytes of the Base58 value are invalid.
    • decode

      public static Decoded decode(String base58Value, List<Version> versions, com.google.common.primitives.UnsignedInteger expectedLength)
      Decode a Base58Check String with no specified VersionTypes.
      Parameters:
      base58Value - The Base58Check encoded String to be decoded.
      versions - A List of Versions to try decoding with.
      expectedLength - The expected length of the decoded value.
      Returns:
      A Decoded containing the decoded value and version.
    • decode

      public static Decoded decode(String base58Value, List<VersionType> versionTypes, List<Version> versions, Optional<com.google.common.primitives.UnsignedInteger> expectedLength) throws EncodingFormatException
      Decode a Base58Check String.
      Parameters:
      base58Value - The Base58Check encoded String to be decoded.
      versionTypes - A List of VersionTypes which can be associated with the result of this method.
      versions - A List of Versions to try decoding with.
      expectedLength - The expected length of the decoded value.
      Returns:
      A Decoded containing the decoded value, version, and type.
      Throws:
      EncodingFormatException - If more than one version is supplied without an expectedLength value present, or if the version bytes of the Base58 value are invalid.