EosioName

public struct EosioName : Codable, CustomStringConvertible, Equatable, Hashable

The EosioName struct provides validation that an EOSIO name is valid, throwing errors on attempts to create an invalid name.

EOSIO names are a max of 12 characters, a-z, 1-5 & .. Names may not begin or end with a period (.).

  • Declaration

    Swift

    public var description: String { get }

    Return Value

    The EOSIO name as a String.

  • Declaration

    Swift

    private(set) public var string: String { get }

    Return Value

    The EOSIO name as a String.

  • Init with a String.

    Throws

    If not a valid EOSIO name.

    Declaration

    Swift

    public init(_ name: String) throws

    Parameters

    name

    An EOSIO name as a string.

  • Init with a decoder.

    Throws

    If not a valid EOSIO name.

    Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder.

  • Encode the EOSIO name to String.

    Throws

    If the name cannot be encoded.

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder.