UNPKG

zumokit

Version:

ZumoKit is a Wallet as a Service SDK

39 lines (38 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Utils = void 0; var ZumoKitError_1 = require("./ZumoKitError"); /** * Crypto utility interface describes methods for mnemonic phrase generation and * Bitcoin/Ethereum address validation. */ var Utils = /** @class */ (function () { /** @internal */ function Utils(zumoCoreModule, utilsImpl) { this.zumoCoreModule = zumoCoreModule; this.utilsImpl = utilsImpl; } /** * Generates mnemonic seed phrase used in wallet creation process. * @param wordCount 12, 15, 18, 21 or 24 */ Utils.prototype.generateMnemonic = function (wordCount) { try { return this.utilsImpl.generateMnemonic(wordCount); } catch (exception) { throw new ZumoKitError_1.ZumoKitError(this.zumoCoreModule.getException(exception)); } }; /** * Validates Ethereum, Bitcoin or Bitcoin SV address. * @param currencyCode 'ETH', 'BTC or 'BSV' * @param address blockchain address * @param network network type */ Utils.prototype.isValidAddress = function (currencyCode, address, network) { return this.utilsImpl.isValidAddress(currencyCode, address, network); }; return Utils; }()); exports.Utils = Utils;