Class Federation

java.lang.Object
org.stellar.sdk.federation.Federation

public class Federation extends Object
Helper class for resolving Stellar addresses.
See Also:
  • Method Details

    • resolve

      public static FederationResponse resolve(String value)
      This method is a helper method for handling user inputs that contain `destination` value. It accepts two types of values:
      • For Stellar address (ex. bob*stellar.org`) it splits Stellar address and then tries to find information about federation server in stellar.toml file for a given domain.
      • For account ID (ex. GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS ) it simply returns the given Account ID.
      Parameters:
      value - Stellar address or account id
      Returns:
      FederationResponse
      Throws:
      MalformedAddressException - Address is malformed
      ConnectionErrorException - Connection problems
      NoFederationServerException - Stellar.toml does not contain federation server info
      FederationServerInvalidException - Federation server is invalid (malformed URL, not HTTPS, etc.)
      StellarTomlNotFoundInvalidException - Stellar.toml file was not found or was malformed.
      NotFoundException - Stellar address not found by federation server
      ServerErrorException - Federation server responded with error