• Assert that address is a valid Stellar G-address (Ed25519 public key, starts with the letter G).

    Throws an Error with a descriptive message including field if validation fails.

    Parameters

    • address: string

      The address string to validate.

    • field: string

      A human-readable field name used in the error message (e.g. 'source', 'newAdmin').

    Returns void

    When address is not a valid Ed25519 public key.

    assertAccountAddress('GABC...', 'source');   // passes silently
    assertAccountAddress('CC...', 'source'); // throws