Address class

Represents a single address in the Stellar network.

An address can represent an account or a contract. To create an address, call Address.new or use Address.forAccountId to create an Address for a given accountId or use Address.forContractId to create an Address for a given contractId or use Address.fromXdr to create an Address for a given XdrSCAddress.

Constructors

Address(int _type, {String? accountId, String? contractId})
Constructs an Address for the given type which can be Address.TYPE_ACCOUNT or Address.TYPE_CONTRACT.

Properties

accountId String?
The id of the account if type is TYPE_ACCOUNT otherwise null.
getter/setter pair
contractId String?
The id of the contract if type is TYPE_CONTRACT otherwise null.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type → dynamic
The type of the Address (TYPE_ACCOUNT or TYPE_CONTRACT).
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toXdr() XdrSCAddress
Returns a XdrSCAddress object created from this Address object.
toXdrSCVal() XdrSCVal
Returns a XdrSCVal containing an XdrSCObject for this Address.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

forAccountId(String accountId) Address
Constructs an Address of type Address.TYPE_ACCOUNT for the given accountId.
forContractId(String contractId) Address
Constructs an Address of type Address.TYPE_CONTRACT for the given contractId.
fromXdr(XdrSCAddress xdr) Address
Constructs an Address from the given xdr.

Constants

TYPE_ACCOUNT → const int
TYPE_CONTRACT → const int