Assert that address is a valid Stellar G-address (Ed25519 public key, starts with the letter G).
address
G
Throws an Error with a descriptive message including field if validation fails.
field
The address string to validate.
A human-readable field name used in the error message (e.g. 'source', 'newAdmin').
'source'
'newAdmin'
When address is not a valid Ed25519 public key.
assertAccountAddress('GABC...', 'source'); // passes silentlyassertAccountAddress('CC...', 'source'); // throws Copy
assertAccountAddress('GABC...', 'source'); // passes silentlyassertAccountAddress('CC...', 'source'); // throws
Assert that
addressis a valid Stellar G-address (Ed25519 public key, starts with the letterG).Throws an Error with a descriptive message including
fieldif validation fails.