@stricahq/typhonjs
Version:
Pure JS Cardano Wallet library
31 lines (30 loc) • 979 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ByronAddress = void 0;
const bs58_1 = __importDefault(require("bs58"));
/**
* this class does not allow generating a Byron address
* but is provided as a helper class to work with Byron Addresses
* */
class ByronAddress {
constructor(address) {
this.addressBech32 = bs58_1.default.encode(address);
this.addressBytes = address;
this.addressHex = address.toString("hex");
}
getHex() {
return this.addressHex;
}
getBytes() {
return this.addressBytes;
}
// bech32 naming to make it compatible with shelley type address classes, this is bs58 encoded address
getBech32() {
return this.addressBech32;
}
}
exports.ByronAddress = ByronAddress;
exports.default = ByronAddress;