@roochnetwork/rooch-sdk
Version:
25 lines (24 loc) • 540 B
JavaScript
import { bytesEqual, toB64 } from "../utils/index.js";
class PublicKey {
/**
* Checks if two public keys are equal
*/
equals(publicKey) {
return bytesEqual(this.toBytes(), publicKey.toBytes());
}
/**
* Return the base-64 representation of the public key
*/
toBase64() {
return toB64(this.toBytes());
}
toString() {
throw new Error(
"`toString` is not implemented on public keys. Use `toBase64()` or `toBytes()` instead."
);
}
}
export {
PublicKey
};
//# sourceMappingURL=publickey.js.map