UNPKG

@xpla/xpla

Version:

<p align="center"> <img src="https://user-images.githubusercontent.com/545047/188804067-28e67e5e-0214-4449-ab04-2e0c564a6885.svg" width="80"> </p>

16 lines (15 loc) 583 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAccountFromAuth = void 0; const defaults_1 = require("./defaults"); function getAccountFromAuth(auth, pubKeyConfig = defaults_1.defaultPublicKeyConfig) { const publicKey = auth.getPublicKey(pubKeyConfig.isCompressed); const pubKeyHash = pubKeyConfig.hash(publicKey); return { algo: auth.algo, publicKey, cosmosAddress: pubKeyHash.toBech32('xpla'), ethereumAddress: pubKeyHash.toPrefixedHex(), }; } exports.getAccountFromAuth = getAccountFromAuth;