@keplr-ewallet/ewallet-sdk-eth
Version:
16 lines • 530 B
JavaScript
import { isAddress } from "viem";
import { publicKeyToEthereumAddress } from "../utils";
import { standardError } from "../errors";
export async function getAddress() {
if (this.address !== null) {
return this.address;
}
const publicKey = await this.getPublicKey();
const address = publicKeyToEthereumAddress(publicKey);
if (!isAddress(address)) {
throw standardError.ethEWallet.invalidAddress({});
}
this.address = address;
return address;
}
//# sourceMappingURL=get_address.js.map