• Assert that address is a valid Stellar contract address (C-address, starts with the letter C).

    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. 'contractId', 'target', 'asset').

    Returns void

    When address is not a valid Stellar contract address.

    assertContractAddress('CA...', 'contractId');  // passes silently
    assertContractAddress('GABC...', 'target'); // throws