Package org.stellar.sdk
Class Address
java.lang.Object
org.stellar.sdk.Address
Represents a single address in the Stellar network. An address can represent an account,
contract, muxed account, claimable balance, or liquidity pool.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the type of the address. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AddressfromAccount(byte[] accountId) Creates a newAddressfrom a Stellar public key.static AddressfromClaimableBalance(byte[] claimableBalanceId) Creates a newAddressfrom a Stellar Claimable Balance ID.static AddressfromContract(byte[] contractId) Creates a newAddressfrom a Stellar Contract ID.static AddressfromLiquidityPool(byte[] liquidityPoolId) Creates a newAddressfrom a Stellar Liquidity Pool ID.static AddressfromMuxedAccount(byte[] muxedAccountId) Creates a newAddressfrom a Stellar med25519 public key.static AddressfromSCAddress(SCAddress scAddress) static AddressReturns the type of this address.byte[]getBytes()Returns the byte array of the Stellar public key or contract ID.inthashCode()Converts this object to itsSCAddressXDR object representation.toSCVal()Converts this object to itsSCValXDR object representation.toString()
-
Constructor Details
-
Address
Creates a newAddressfrom a Stellar public key (G...), contract ID (C...), med25519 public key (M...), liquidity pool ID (L...), or claimable balance ID (B...).- Parameters:
address- the StrKey encoded format of Stellar address.
-
-
Method Details
-
fromAccount
Creates a newAddressfrom a Stellar public key.- Parameters:
accountId- the byte array of the Stellar public key (G...).- Returns:
- a new
Addressobject from the given Stellar public key.
-
fromContract
Creates a newAddressfrom a Stellar Contract ID.- Parameters:
contractId- the byte array of the Stellar Contract ID.- Returns:
- a new
Addressobject from the given Stellar Contract ID.
-
fromMuxedAccount
Creates a newAddressfrom a Stellar med25519 public key.- Parameters:
muxedAccountId- the byte array of the Stellar med25519 public key (M...).- Returns:
- a new
Addressobject from the given Stellar med25519 public key.
-
fromClaimableBalance
Creates a newAddressfrom a Stellar Claimable Balance ID.- Parameters:
claimableBalanceId- the byte array of the Stellar Claimable Balance ID (B...).- Returns:
- a new
Addressobject from the given Stellar Claimable Balance ID.
-
fromLiquidityPool
Creates a newAddressfrom a Stellar Liquidity Pool ID.- Parameters:
liquidityPoolId- the byte array of the Stellar Liquidity Pool ID (L...).- Returns:
- a new
Addressobject from the given Stellar Liquidity Pool ID.
-
fromSCAddress
-
fromSCVal
-
toSCAddress
Converts this object to itsSCAddressXDR object representation.- Returns:
- a new
SCAddressobject from this object
-
toSCVal
Converts this object to itsSCValXDR object representation.- Returns:
- a new
SCValobject from this object
-
getBytes
public byte[] getBytes()Returns the byte array of the Stellar public key or contract ID.- Returns:
- the byte array of the Stellar public key or contract ID.
-
getAddressType
Returns the type of this address.- Returns:
- the type of this address.
-
toString
-
equals
-
hashCode
public int hashCode()
-