wallaby-cash 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/base.d.ts +20 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.umd.js +1 -1
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/lib/auth/index.d.ts +16 -10
  10. package/dist/lib/transactions/index.d.ts +5 -5
  11. package/dist/lib/utils/index.d.ts +29 -9
  12. package/dist/lib/utils/utils.d.ts +22 -13
  13. package/dist/lib/wallet/index.d.ts +34 -11
  14. package/dist/routes/auth.d.ts +11 -6
  15. package/dist/routes/merchants.d.ts +7 -7
  16. package/dist/routes/system.d.ts +4 -4
  17. package/dist/routes/transactions.d.ts +13 -6
  18. package/dist/routes/wallet.d.ts +15 -10
  19. package/dist/tests/data/user.d.ts +3 -2
  20. package/dist/types/auth.d.ts +5 -10
  21. package/dist/types/common.d.ts +5 -1
  22. package/dist/types/transactions.d.ts +2 -2
  23. package/dist/types/wallet.d.ts +13 -6
  24. package/package.json +2 -2
  25. package/src/base.ts +40 -8
  26. package/src/index.ts +2 -2
  27. package/src/lib/auth/index.ts +49 -24
  28. package/src/lib/transactions/index.ts +7 -7
  29. package/src/lib/utils/index.ts +77 -19
  30. package/src/lib/utils/utils.ts +96 -36
  31. package/src/lib/wallet/index.ts +209 -35
  32. package/src/routes/auth.ts +11 -6
  33. package/src/routes/merchants.ts +7 -7
  34. package/src/routes/system.ts +4 -4
  35. package/src/routes/transactions.ts +23 -6
  36. package/src/routes/wallet.ts +15 -10
  37. package/src/tests/auth.spec.ts +26 -24
  38. package/src/tests/data/user.ts +3 -2
  39. package/src/tests/utils.spec.ts +9 -13
  40. package/src/tests/wallet.spec.ts +12 -7
  41. package/src/types/auth.ts +5 -11
  42. package/src/types/common.ts +6 -1
  43. package/src/types/transactions.ts +2 -2
  44. package/src/types/wallet.ts +14 -6
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;"],"names":["s","m","h","d","ms","val","options","type","length","str","String","match","exec","n","parseFloat","toLowerCase","parse","isFinite","long","msAbs","Math","abs","plural","fmtLong","round","fmtShort","Error","JSON","stringify","name","isPlural","exports","formatArgs","args","this","useColors","namespace","module","humanize","diff","c","color","splice","index","lastC","replace","save","namespaces","storage","setItem","removeItem","error","load","r","getItem","process","env","DEBUG","window","__nwjs","navigator","userAgent","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","parseInt","RegExp","$1","localStorage","localstorage","destroy","warned","warn","colors","log","debug","createDebug","prevTime","namespacesCache","enabledCache","enableOverride","enabled","self","curr","Number","Date","prev","coerce","unshift","format","formatter","formatters","call","apply","selectColor","extend","Object","defineProperty","enumerable","configurable","get","set","v","init","delimiter","newDebug","toNamespace","regexp","toString","substring","default","stack","message","disable","names","map","skips","join","enable","i","split","len","push","slice","test","require$$0","keys","forEach","key","hash","charCodeAt","j","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","byteToHex","native","randomUUID","v4","buf","offset","rnds","random","arr","unsafeStringify"],"mappings":"i+DAIA,IAAIA,EAAI,IACJC,EAAQ,GAAJD,EACJE,EAAQ,GAAJD,EACJE,EAAQ,GAAJD,EAkBRE,EAAiB,SAASC,EAAKC,GAC7BA,EAAUA,GAAW,GACrB,IAAIC,SAAcF,EAClB,GAAa,WAATE,GAAqBF,EAAIG,OAAS,EACpC,OAkBJ,SAAeC,GAEb,MADAA,EAAMC,OAAOD,IACLD,OAAS,KAAjB,CAGA,IAAIG,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AKC,GACxB,GAAIJ,EAAOC,aAAeE,IAAQ7I,EAChC,OAAO0I,EAAOC,aAIhB,MAAMI,GADN/I,EAAUA,GAAW,IACAgJ,SAAWhJ,EAAQsI,KAAOA,KAK/C,GAHAS,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBF,EAAK,CACPC,EAASA,GAAU,EAEnB,IAAK,IAAIxB,EAAI,EAAGA,EAAI,KAAMA,EACxBuB,EAAIC,EAASxB,GAAKyB,EAAKzB,GAGzB,OAAOuB,CACR,CAED,OFbK,SAAyBI,EAAKH,EAAS,GAG5C,OAAQL,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,MAAMrI,aACvf,CESSyI,CAAgBH,EACzB"}
1
+ {"version":3,"file":"index.umd.js","sources":["../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;"],"names":["s","m","h","d","ms","val","options","type","length","str","String","match","exec","n","parseFloat","toLowerCase","parse","isFinite","long","msAbs","Math","abs","plural","fmtLong","round","fmtShort","Error","JSON","stringify","name","isPlural","exports","formatArgs","args","this","useColors","namespace","module","humanize","diff","c","color","splice","index","lastC","replace","save","namespaces","storage","setItem","removeItem","error","load","r","getItem","process","env","DEBUG","window","__nwjs","navigator","userAgent","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","parseInt","RegExp","$1","localStorage","localstorage","destroy","warned","warn","colors","log","debug","createDebug","prevTime","namespacesCache","enabledCache","enableOverride","enabled","self","curr","Number","Date","prev","coerce","unshift","format","formatter","formatters","call","apply","selectColor","extend","Object","defineProperty","enumerable","configurable","get","set","v","init","delimiter","newDebug","toNamespace","regexp","toString","substring","default","stack","message","disable","names","map","skips","join","enable","i","split","len","push","slice","test","require$$0","keys","forEach","key","hash","charCodeAt","j","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","byteToHex","native","randomUUID","v4","buf","offset","rnds","random","arr","unsafeStringify"],"mappings":"i+DAIA,IAAIA,EAAI,IACJC,EAAQ,GAAJD,EACJE,EAAQ,GAAJD,EACJE,EAAQ,GAAJD,EAkBRE,EAAiB,SAASC,EAAKC,GAC7BA,EAAUA,GAAW,GACrB,IAAIC,SAAcF,EAClB,GAAa,WAATE,GAAqBF,EAAIG,OAAS,EACpC,OAkBJ,SAAeC,GAEb,MADAA,EAAMC,OAAOD,IACLD,OAAS,KAAjB,CAGA,IAAIG,EAAQ,mIAAmIC,KAC7IH,GAEF,GAAKE,EAAL,CAGA,IAAIE,EAAIC,WAAWH,EAAM,IAEzB,QADYA,EAAM,IAAM,MAAMI,eAE5B,IAAK,QACL,IAAK,OACL,IAAK,MACL,IAAK,KACL,IAAK,IACH,OAzDEZ,SAyDKU,EACT,IAAK,QACL,IAAK,OACL,IAAK,IACH,OA9DEV,OA8DKU,EACT,IAAK,OACL,IAAK,MACL,IAAK,IACH,OAAOA,EAAIV,EACb,IAAK,QACL,IAAK,OACL,IAAK,MACL,IAAK,KACL,IAAK,IACH,OAAOU,EAAIX,EACb,IAAK,UACL,IAAK,SACL,IAAK,OACL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,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,IAAML,EAAUQ,EAAIH,EAAS,IAAM,IAAML,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,KAAOL,EAAUQ,EAAIH,EAAS,MAAMrI,aACvf,CESSyI,CAAgBH,EACzB"}
@@ -1,35 +1,35 @@
1
1
  import { Base } from '../../base';
2
- import { SignatureMessageRequest, SignatureMessageResponse, SignInRequest, SignInResponse, SignUpRequest, SignUpResponse, WallabyConfig, ClientAuthPubKeyRequest, RefreshAccessTokenResponse, ClientAuthPubKeyResponse } from '../../types';
2
+ import { SignatureMessageRequest, SignatureMessageResponse, SignInRequest, AuthResponse, SignUpRequest, WallabyConfig, ClientAuthPubKeyRequest, RefreshAccessTokenResponse, ClientAuthPubKeyResponse } from '../../types';
3
3
  export declare class Auth extends Base {
4
4
  constructor(config: WallabyConfig);
5
5
  /**
6
6
  *
7
7
  * @public
8
8
  * @description The returned message will be used to authorize the user to sign operations
9
- * @param {string} hashKey
9
+ * @param {string} password
10
10
  * @param {string} userId
11
11
  * @returns {SignatureMessageResponse} The returned message will be used for sign up and sign in signature
12
12
  */
13
- signatureMessage({ hashKey, userId }: SignatureMessageRequest): Promise<SignatureMessageResponse | undefined>;
13
+ signatureMessage({ password, userId }: SignatureMessageRequest): Promise<SignatureMessageResponse | undefined>;
14
14
  /**
15
15
  *
16
16
  * @public
17
17
  * @description Users will be able to sign in by providing a signature and message. Use the same key pair used on sign up'
18
- * @param {string} hashKey
18
+ * @param {string} password
19
19
  * @param {string} firstName
20
20
  * @param {string} lastName
21
21
  * @param {string} email
22
- * @returns {SignUpResponse}
22
+ * @returns { AuthResponse }
23
23
  */
24
- signUp({ hashKey, firstName, lastName, email }: SignUpRequest): Promise<SignUpResponse | undefined>;
24
+ signUp({ password, firstName, lastName, email }: SignUpRequest): Promise<AuthResponse | undefined>;
25
25
  /**
26
26
  *
27
27
  * @public
28
28
  * @description Users will be able to sign in by providing a signature and message. Use the same key pair used on sign up'
29
- * @param {string} hashKey
29
+ * @param {string} password
30
30
  * @returns {SignInResponse}
31
31
  */
32
- signIn({ hashKey }: SignInRequest): Promise<SignInResponse | undefined>;
32
+ signIn({ password }: SignInRequest): Promise<AuthResponse | undefined>;
33
33
  /**
34
34
  *
35
35
  * @public
@@ -40,11 +40,11 @@ export declare class Auth extends Base {
40
40
  refreshAccessToken({}: {}): Promise<RefreshAccessTokenResponse | undefined>;
41
41
  /**
42
42
  * @description Change user authentication public key
43
- * @param {string} hashKey
43
+ * @param {string} password
44
44
  * @param {string} userId
45
45
  * @returns {User} User object
46
46
  */
47
- updateClientAuthPubKey({ hashKey, }: Pick<ClientAuthPubKeyRequest, 'hashKey' | 'userId'>): Promise<ClientAuthPubKeyResponse | undefined>;
47
+ updateClientAuthPubKey({ password, }: Pick<ClientAuthPubKeyRequest, 'password' | 'userId'>): Promise<ClientAuthPubKeyResponse | undefined>;
48
48
  /**
49
49
  *
50
50
  * @deprecated
@@ -53,4 +53,10 @@ export declare class Auth extends Base {
53
53
  * @returns {WallabyAuthPubKeyResponse} Returns user's Wallaby WallabyAuthPubKey
54
54
  */
55
55
  getWallabyAuthPublicKey(): Promise<void>;
56
+ /**
57
+ * @description The user salt is used to double encrypt the seedphrase before being stored
58
+ * in local storage.
59
+ * @returns {string} Returns user's salt that is generated by Wallaby system
60
+ */
61
+ getUserSalt(): Promise<string | undefined>;
56
62
  }
@@ -25,10 +25,10 @@ export declare class Transactions extends Base {
25
25
  * @param {string} assetId
26
26
  * @param {string} reference
27
27
  * @param {string} memo
28
- * @param {string} hashKey
28
+ * @param {string} password
29
29
  * @returns {TransferResponse} Transaction object which contains the transaction hash and status
30
30
  */
31
- transfer({ originAddress, recipientAddress, amount, assetId, reference, memo, hashKey, }: TransferRequest): Promise<TransferResponse | undefined>;
31
+ transfer({ originAddress, recipientAddress, amount, assetId, reference, memo, password, }: TransferRequest): Promise<TransferResponse | undefined>;
32
32
  /**
33
33
  *
34
34
  * @public
@@ -41,7 +41,7 @@ export declare class Transactions extends Base {
41
41
  transactionHash: string;
42
42
  reference: string;
43
43
  blockchain: BlockchainName;
44
- hashKey: string;
44
+ password: string;
45
45
  }): Promise<TransactionStatusResponse | undefined>;
46
46
  /**
47
47
  *
@@ -63,7 +63,7 @@ export declare class Transactions extends Base {
63
63
  /**
64
64
  *
65
65
  * @public
66
- * @param {string} hashKey
66
+ * @param {string} password
67
67
  * @param {string} ownerAddress
68
68
  * @param {string} spenderAddress
69
69
  * @param {string} amount
@@ -74,7 +74,7 @@ export declare class Transactions extends Base {
74
74
  * @returns {CreateAllowanceResponse}
75
75
  *
76
76
  */
77
- createAllowance({ hashKey, ownerAddress, spenderAddress, amount, assetId, contractAddress, reference, memo, }: CreateAllowanceRequest): Promise<{
77
+ createAllowance({ password, ownerAddress, spenderAddress, amount, assetId, contractAddress, reference, memo, }: CreateAllowanceRequest): Promise<{
78
78
  transaction: Transaction;
79
79
  } | undefined>;
80
80
  }
@@ -1,21 +1,41 @@
1
1
  import { UtilsResponse, PasswordValidatorResponse, WallabyConfig, SeedPhraseType, RequestMothod } from '../../types';
2
2
  import { Base } from '../../base';
3
- import { Encrypted } from 'eth-crypto';
4
3
  export declare class Utils extends Base {
5
4
  setWallabyAuthPubKey: (userId: string, wallabyAuthPubKey: string) => void;
6
5
  getWallabyAuthPubKey: (userId: string) => UtilsResponse;
7
- setEncryptedPrivateKey: (userId: string, privateKey: string, hashKey: string) => boolean;
6
+ setEncryptedPrivateKey: (userId: string, privateKey: string, password: string) => boolean;
8
7
  getEncryptedPrivateKey: (userId: string) => UtilsResponse;
9
- getDecryptedPrivateKey: (userId: string, hashKey: string) => string | undefined;
10
- setEncryptedSeedPhrase: (userId: string, clientAuthPubKey: string, decryptedSeedPhrase: string, seedPhraseType: SeedPhraseType) => Promise<boolean>;
11
- getEncryptedSeedPhrase: (userId: string, seedPhraseType: SeedPhraseType) => Encrypted | undefined;
12
- getDecryptedSeedPhrase: (userId: string, hashKey: string, seedphraseType: SeedPhraseType) => Promise<UtilsResponse>;
13
- validatePassword: (userId: string, hashKey: string) => PasswordValidatorResponse;
8
+ getEncryptedSeedPhrase: (userId: string, seedPhraseType: SeedPhraseType) => string | undefined;
9
+ getDecryptedSeedPhrase: ({ userId, password, salt, seedPhraseType, }: {
10
+ userId: string;
11
+ password: string;
12
+ salt: string;
13
+ seedPhraseType: SeedPhraseType;
14
+ }) => Promise<UtilsResponse>;
15
+ validatePassword: (userId: string, password: string) => PasswordValidatorResponse;
16
+ private auth;
14
17
  constructor(config: WallabyConfig);
15
- fetchFromEndpoint({ endpoint, method, accessTokenRequired, payload, }: {
18
+ /**
19
+ *
20
+ * Decrypts user private key
21
+ * @param userId
22
+ * @param password
23
+ * @returns
24
+ */
25
+ getDecryptedPrivateKey: (userId: string, password: string) => UtilsResponse;
26
+ /**
27
+ *
28
+ * @param {string} userId
29
+ * @param {string} decryptedSeedPhrase
30
+ * @param {SeedPhraseType} seedphraseType
31
+ * @param {string} password
32
+ * @param {string} salt
33
+ */
34
+ setEncryptedSeedPhrase: (userId: string, clientAuthPubKey: string, decryptedSeedPhrase: string, seedPhraseType: SeedPhraseType, password: string, salt: string) => Promise<boolean>;
35
+ fetchFromEndpoint({ endpoint, method, requiresAccessToken, payload, }: {
16
36
  endpoint: string;
17
37
  method: RequestMothod;
18
- accessTokenRequired?: boolean;
38
+ requiresAccessToken?: boolean;
19
39
  payload?: any;
20
40
  }): Promise<any>;
21
41
  }
@@ -1,4 +1,3 @@
1
- import { Encrypted } from 'eth-crypto';
2
1
  import { UtilsResponse, PasswordValidatorResponse, WallabyError, SeedPhraseType } from '../../types';
3
2
  /**
4
3
  *
@@ -19,9 +18,9 @@ export declare const getWallabyAuthPubKey: (userId: string) => UtilsResponse;
19
18
  * Encrypts and stores user private key
20
19
  * @param userId ID of the user (should be a uuid)
21
20
  * @param privateKey private key
22
- * @param hashKey hashKey that is used to encrypt the private key
21
+ * @param password password that is used to encrypt the private key
23
22
  */
24
- export declare const setEncryptedPrivateKey: (userId: string, privateKey: string, hashKey: string) => boolean;
23
+ export declare const setEncryptedPrivateKey: (userId: string, privateKey: string, password: string) => boolean;
25
24
  /**
26
25
  *
27
26
  * Fetches encrypted private key from local storage
@@ -32,37 +31,47 @@ export declare const getEncryptedPrivateKey: (userId: string) => UtilsResponse;
32
31
  *
33
32
  * Decrypts user private key
34
33
  * @param userId
35
- * @param hashKey
34
+ * @param password
36
35
  * @returns
37
36
  */
38
- export declare const getDecryptedPrivateKey: (userId: string, hashKey: string) => UtilsResponse;
37
+ export declare const getDecryptedPrivateKey: (userId: string, password: string) => UtilsResponse;
39
38
  /**
40
39
  *
41
- * @param userId
42
- * @param encryptedSeedPhrase
40
+ * @param {string} userId
41
+ * @param {string} decryptedSeedPhrase
42
+ * @param {SeedPhraseType} seedphraseType
43
+ * @param {string} password
44
+ * @param {string} salt
43
45
  */
44
- export declare const setEncryptedSeedPhrase: (userId: string, clientAuthPubKey: string, decryptedSeedPhrase: string, seedPhraseType: SeedPhraseType) => Promise<boolean>;
46
+ export declare const setEncryptedSeedPhrase: (userId: string, clientAuthPubKey: string, decryptedSeedPhrase: string, seedPhraseType: SeedPhraseType, password: string, salt: string) => Promise<boolean>;
45
47
  /**
46
48
  *
47
49
  * @param {string} userId The user ID for whome the seedphrase belongs.
48
50
  * @param {SeedPhraseType} seedPhraseType Standard or Mnemonic seedphrase
49
51
  * @returns {UtilsResponse} It returns the encrypted seedphrase as a string or undefined
50
52
  */
51
- export declare const getEncryptedSeedPhrase: (userId: string, seedPhraseType: SeedPhraseType) => Encrypted | undefined;
53
+ export declare const getEncryptedSeedPhrase: (userId: string, seedPhraseType: SeedPhraseType) => string | undefined;
52
54
  /**
53
55
  *
54
56
  * @param {string} userId
55
- * @param {string} hashKey
57
+ * @param {string} password
58
+ * @param {string} salt
59
+ * @param {SeedPhraseType} seedPhraseType
56
60
  * @returns {UtilsResponse} It returns the decrypted seedphrase as a string or undefined
57
61
  */
58
- export declare const getDecryptedSeedPhrase: (userId: string, hashKey: string, seedPhraseType: SeedPhraseType) => Promise<UtilsResponse>;
62
+ export declare const getDecryptedSeedPhrase: ({ userId, password, salt, seedPhraseType, }: {
63
+ userId: string;
64
+ password: string;
65
+ salt: string;
66
+ seedPhraseType: SeedPhraseType;
67
+ }) => Promise<UtilsResponse>;
59
68
  export declare const setAccessToken: (userId: string, accessToken: string) => boolean;
60
69
  export declare const getAccessToken: (userId: string) => UtilsResponse | WallabyError;
61
70
  /**
62
71
  *
63
72
  * @param userId
64
- * @param hashKey
73
+ * @param password
65
74
  * @returns
66
75
  */
67
- export declare const validatePassword: (userId: string, hashKey: string) => PasswordValidatorResponse;
76
+ export declare const validatePassword: (userId: string, password: string) => PasswordValidatorResponse;
68
77
  export declare const clearLocalStorage: (userId: string) => void;
@@ -1,8 +1,22 @@
1
1
  import { Base } from '../../base';
2
- import { QueryUserRequest, CreateWalletRequest, CreateWalletResponse, RecoverWalletRequest, RecoverWalletResponse, TokenBalanceRequest, TokenBalancResponse, WallabyError, QueryWalletRequest, UserAssetsResponse, UserWalletsResponse, WalletAssetsResponse, WallabyConfig, ConvertMnemonicSeedPhraseRequest, ConvertMnemonicSeedPhraseResponse, CreateMultisigAssetRequest, CreateMultisigAssetResponse, ClearWalletInput } from '../../types';
2
+ import { QueryUserRequest, CreateWalletRequest, CreateWalletResponse, RecoverWalletRequest, RecoverWalletResponse, TokenBalanceRequest, TokenBalancResponse, WallabyError, QueryWalletRequest, UserAssetsResponse, UserWalletsResponse, WalletAssetsResponse, WallabyConfig, ConvertMnemonicSeedPhraseRequest, ConvertMnemonicSeedPhraseResponse, CreateMultisigAssetRequest, CreateMultisigAssetResponse, ImportWalletRequest, ImportWalletResponse } from '../../types';
3
3
  export declare class Wallet extends Base {
4
4
  private auth;
5
5
  constructor(config: WallabyConfig);
6
+ /**
7
+ *
8
+ * @public
9
+ * @description Retrieve the user's mnemonic seed phrases
10
+ * @param password User's wallet password
11
+ * @returns { Promise<{standardSeedPhrase: string, algorandSeedPhrase: string}> }
12
+ * It returns the user's standard (24 words) and algorand (25 words) seed phrases
13
+ */
14
+ mnemonicSeedPhrase({ password, }: {
15
+ password: string;
16
+ }): Promise<{
17
+ standardSeedPhrase: string;
18
+ algorandSeedPhrase: string;
19
+ }>;
6
20
  /**
7
21
  *
8
22
  * @public
@@ -20,10 +34,10 @@ export declare class Wallet extends Base {
20
34
  * @param {string} firstName The user's first name
21
35
  * @param {string} lastName The user's last name
22
36
  * @param {email} email The user's email
23
- * @param {string} hashKey The user's chosen password
37
+ * @param {string} password The user's chosen password
24
38
  * @returns {CreateWalletResponse} The wallet has been created successfully
25
39
  */
26
- create({ firstName, lastName, email, hashKey, }: Pick<CreateWalletRequest, 'firstName' | 'lastName' | 'email' | 'hashKey'>): Promise<CreateWalletResponse | WallabyError>;
40
+ create({ firstName, lastName, email, password, }: Pick<CreateWalletRequest, 'firstName' | 'lastName' | 'email' | 'password'>): Promise<CreateWalletResponse | WallabyError>;
27
41
  /**
28
42
  *
29
43
  * @public
@@ -31,36 +45,45 @@ export declare class Wallet extends Base {
31
45
  * @param {string} firstName The user's first name
32
46
  * @param {string} lastName The user's last name
33
47
  * @param {email} email The user's email
34
- * @param {string} hashKey The user's chosen password
48
+ * @param {string} password The user's chosen password
35
49
  * @returns {CreateWalletResponse} The wallet has been created successfully
36
50
  */
37
- createWithNewAccount({ firstName, lastName, email, hashKey, }: Pick<CreateWalletRequest, 'firstName' | 'lastName' | 'email' | 'hashKey'>): Promise<CreateWalletResponse | WallabyError>;
51
+ createWithNewAccount({ firstName, lastName, email, password, }: Pick<CreateWalletRequest, 'firstName' | 'lastName' | 'email' | 'password'>): Promise<CreateWalletResponse | WallabyError>;
52
+ /**
53
+ *
54
+ * @public
55
+ * @description Import an existing wallet, returns asset list and encrypted seedPhrase
56
+ * @param {string} password The user's chosen password
57
+ * @param {string} seedPhrase The user's seed phrase
58
+ * @returns {ImportWalletResponse} The wallet has been imported successfully
59
+ * The return includes the wallet, wallet assets, and the encrypted seedphrase
60
+ */
61
+ import({ password, seedPhrase }: ImportWalletRequest): Promise<ImportWalletResponse>;
38
62
  /**
39
63
  *
40
64
  * @public
41
65
  * @description Removes all Wallaby data from local storage.
42
- * @param {string} userId The user's ID that is associated with their stored keys
43
66
  * @returns {Boolean}
44
67
  */
45
- clearWalletData({ userId }: ClearWalletInput): Boolean;
68
+ clearDevice(): Boolean;
46
69
  /**
47
70
  *
48
71
  * @public
49
72
  * @description Convert BIP39 Standard seed phrase to Algorand fixed 25 words mnemonic phrase
50
- * @param {string} hashKey
73
+ * @param {string} password
51
74
  * @param {Encrypted} encryptedSeedPhrase It needs to be encypted using wallabyAuthPubKey
52
75
  * @returns {ConvertMnemonicSeedPhraseResponse} The mnemonic seed phrase has been converted successfully.
53
76
  */
54
- convertMnemonicSeedphrase({ hashKey, encryptedSeedPhrase, }: Pick<ConvertMnemonicSeedPhraseRequest, 'hashKey' | 'encryptedSeedPhrase'>): Promise<ConvertMnemonicSeedPhraseResponse | undefined>;
77
+ convertMnemonicSeedphrase({ password, encryptedSeedPhrase, }: Pick<ConvertMnemonicSeedPhraseRequest, 'password' | 'encryptedSeedPhrase'>): Promise<ConvertMnemonicSeedPhraseResponse | undefined>;
55
78
  /**
56
79
  *
57
80
  * @public
58
81
  * @description Recover the lost wallet and its assets.
59
- * @param {string} newHashKey User need to set a new password while recovering the wallet
82
+ * @param {string} newPassword User need to set a new password while recovering the wallet
60
83
  * @param {string} seedPhrase It needs to be encypted using wallabyAuthPubKey
61
84
  * @returns {RecoverWalletResponse} The wallet has been recovered successfully.
62
85
  */
63
- recover({ newHashKey, seedPhrase, }: Omit<RecoverWalletRequest, 'clientAuthPubKey'>): Promise<RecoverWalletResponse | undefined>;
86
+ recover({ newPassword, seedPhrase, }: Omit<RecoverWalletRequest, 'clientAuthPubKey'>): Promise<RecoverWalletResponse | undefined>;
64
87
  /**
65
88
  *
66
89
  * @description Get all user assets across all wallets by specifying user id
@@ -3,31 +3,36 @@ export declare const AuthRoutes: {
3
3
  signatureMessage: {
4
4
  fullPath: string;
5
5
  method: RequestMothod;
6
- accessTokenRequired: boolean;
6
+ requiresAccessToken: boolean;
7
7
  };
8
8
  signIn: {
9
9
  fullPath: string;
10
10
  method: RequestMothod;
11
- accessTokenRequired: boolean;
11
+ requiresAccessToken: boolean;
12
12
  };
13
13
  signUp: {
14
14
  fullPath: string;
15
15
  method: RequestMothod;
16
- accessTokenRequired: boolean;
16
+ requiresAccessToken: boolean;
17
17
  };
18
18
  refreshAcessToken: {
19
19
  fullPath: string;
20
20
  method: RequestMothod;
21
- accessTokenRequired: boolean;
21
+ requiresAccessToken: boolean;
22
22
  };
23
23
  clientAuthPubKey: {
24
24
  fullPath: string;
25
25
  method: RequestMothod;
26
- accessTokenRequired: boolean;
26
+ requiresAccessToken: boolean;
27
27
  };
28
28
  wallabyAuthPublicKey: {
29
29
  fullPath: string;
30
30
  method: RequestMothod;
31
- accessTokenRequired: boolean;
31
+ requiresAccessToken: boolean;
32
+ };
33
+ getUserSalt: {
34
+ fullPath: string;
35
+ method: RequestMothod;
36
+ requiresAccessToken: boolean;
32
37
  };
33
38
  };
@@ -3,33 +3,33 @@ export declare const MerchantsRoutes: {
3
3
  create: {
4
4
  fullPath: string;
5
5
  method: RequestMothod;
6
- accessTokenRequired: boolean;
6
+ requiresAccessToken: boolean;
7
7
  };
8
8
  update: {
9
9
  fullPath: ({ id }: {
10
10
  id: string;
11
11
  }) => string;
12
12
  method: RequestMothod;
13
- accessTokenRequired: boolean;
13
+ requiresAccessToken: boolean;
14
14
  };
15
15
  getMerchantData: {
16
16
  fullPath: ({ id }: {
17
17
  id: string;
18
18
  }) => string;
19
19
  method: RequestMothod;
20
- accessTokenRequired: boolean;
20
+ requiresAccessToken: boolean;
21
21
  };
22
22
  list: {
23
23
  fullPath: string;
24
24
  method: RequestMothod;
25
- accessTokenRequired: boolean;
25
+ requiresAccessToken: boolean;
26
26
  };
27
27
  getAssets: {
28
28
  fullPath: ({ id }: {
29
29
  id: string;
30
30
  }) => string;
31
31
  method: RequestMothod;
32
- accessTokenRequired: boolean;
32
+ requiresAccessToken: boolean;
33
33
  };
34
34
  addAsset: {
35
35
  fullPath: ({ id, configId }: {
@@ -37,7 +37,7 @@ export declare const MerchantsRoutes: {
37
37
  configId: string;
38
38
  }) => string;
39
39
  method: RequestMothod;
40
- accessTokenRequired: boolean;
40
+ requiresAccessToken: boolean;
41
41
  };
42
42
  deleteAsset: {
43
43
  fullPath: ({ id, configId }: {
@@ -45,6 +45,6 @@ export declare const MerchantsRoutes: {
45
45
  configId: string;
46
46
  }) => string;
47
47
  method: RequestMothod;
48
- accessTokenRequired: boolean;
48
+ requiresAccessToken: boolean;
49
49
  };
50
50
  };
@@ -3,21 +3,21 @@ export declare const SystemRoutes: {
3
3
  getSupportedBlockchains: {
4
4
  fullPath: string;
5
5
  method: RequestMothod;
6
- accessTokenRequired: boolean;
6
+ requiresAccessToken: boolean;
7
7
  };
8
8
  getSupportedTokens: {
9
9
  fullPath: string;
10
10
  method: RequestMothod;
11
- accessTokenRequired: boolean;
11
+ requiresAccessToken: boolean;
12
12
  };
13
13
  getUserByExternalUserId: {
14
14
  fullPath: ({ externalUserId }: QueryUserRequest) => string;
15
15
  method: RequestMothod;
16
- accessTokenRequired: boolean;
16
+ requiresAccessToken: boolean;
17
17
  };
18
18
  getUserData: {
19
19
  fullPath: ({ userId }: QueryUserRequest) => string;
20
20
  method: RequestMothod;
21
- accessTokenRequired: boolean;
21
+ requiresAccessToken: boolean;
22
22
  };
23
23
  };