Address
The Address class is a util class that helps you deal with addresses.
// example usageconst address1 = Address.fromSs58(account1.address)const address2 = Address.fromSs58(account2.address)
// so you don't have to worry about prefix when comparing!const isSameAddress = address1.isEqual(address2)
// helps convert an address to different format by providingconst polkadotAddress = address1.toSs58(0)Address Methods
Section titled “Address Methods”isEqual(Address)
Section titled “isEqual(Address)”Compares 2 address classes.
const isSameAddress = address.isEqual(address2)toSs58(prefix)
Section titled “toSs58(prefix)”Format the address according to the prefix.
const polkadotAddress = address.toSs58(0)toPubKey()
Section titled “toPubKey()”Returns the pubkey of the address
const pubkey = address.toPubKey()