UNPKG

@oko-wallet/oko-sdk-cosmos

Version:
29 lines 996 B
export async function getPublicKey() { console.log("[oko-cosmos] getPublicKey: start"); try { await this.waitUntilInitialized; if (this.state === null) { throw new Error("Cosmos SDK is not properly initialized"); } if (this.state.publicKey) { console.log("[oko-cosmos] getPublicKey: cached public key"); return this.state.publicKey; } console.log("[oko-cosmos] getPublicKey: getPublicKey from eWallet"); const pk = await this.okoWallet.getPublicKey(); if (pk === null) { this.state.publicKey = null; return null; } else { const publicKey = Buffer.from(pk, "hex"); this.state.publicKey = publicKey; return this.state.publicKey; } } catch (error) { console.error("[oko-cosmos] getPublicKey failed with error:", error); throw error; } } //# sourceMappingURL=get_public_key.js.map