@1shotapi/1shotpay-common 0.1.0 → 0.1.1
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.
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -4
package/dist/index.js
CHANGED
|
@@ -1307,9 +1307,22 @@ function x402NormalizeAcceptedPayments(req) {
|
|
|
1307
1307
|
if (Array.isArray(req.paymentRequirements))
|
|
1308
1308
|
candidates.push(...req.paymentRequirements);
|
|
1309
1309
|
}
|
|
1310
|
-
|
|
1310
|
+
const accepts = req.accepts;
|
|
1311
|
+
if (accepts != null) {
|
|
1312
|
+
if (Array.isArray(accepts)) candidates.push(...accepts);
|
|
1313
|
+
else candidates.push(accepts);
|
|
1314
|
+
}
|
|
1315
|
+
return candidates.filter(Boolean).map((c) => {
|
|
1316
|
+
const item = c;
|
|
1317
|
+
if (item && typeof item === "object" && item.maxAmountRequired != null && item.amount == null) {
|
|
1318
|
+
item.amount = item.maxAmountRequired;
|
|
1319
|
+
}
|
|
1320
|
+
return item;
|
|
1321
|
+
});
|
|
1311
1322
|
}
|
|
1312
1323
|
function x402GetChainIdFromNetwork(network) {
|
|
1324
|
+
const normalized = (network ?? "").trim().toLowerCase();
|
|
1325
|
+
if (normalized === "base" || normalized === "base-mainnet") return 8453;
|
|
1313
1326
|
const m = /^eip155:(\d+)$/.exec(network);
|
|
1314
1327
|
if (!m) return null;
|
|
1315
1328
|
const n = Number(m[1]);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/safe-stable-stringify/index.js","../types/enum/EHttpStatusCode.ts","../types/enum/ELocale.ts","../types/enum/EPayLinkStatus.ts","../types/primitives/ApiToken.ts","../types/primitives/BigNumberString.ts","../types/primitives/Base64String.ts","../types/primitives/DecimalAmount.ts","../types/primitives/EVMAccountAddress.ts","../types/primitives/EVMContractAddress.ts","../types/primitives/HexString.ts","../types/primitives/ISO8601DateString.ts","../types/primitives/JSONWebToken.ts","../types/primitives/JSONString.ts","../types/primitives/MillisecondTimestamp.ts","../types/primitives/PayLinkId.ts","../types/primitives/PayLinkPaymentId.ts","../types/primitives/RelayerTransactionId.ts","../types/primitives/Signature.ts","../types/primitives/TransactionHash.ts","../types/primitives/UnixTimestamp.ts","../types/primitives/URLString.ts","../types/primitives/USDCAmount.ts","../types/primitives/UserId.ts","../types/primitives/Username.ts","../types/errors/BaseError.ts","../types/errors/AjaxError.ts","../types/errors/ProxyError.ts","../types/errors/RetryError.ts","../types/errors/ValidationError.ts","../types/models/OAuthTokenModel.ts","../utils/AjaxUtils.ts","../utils/ITimeUtils.ts","../utils/ObjectUtils.ts","../../../node_modules/safe-stable-stringify/esm/wrapper.js","../utils/TimeUtils.ts","../utils/x402Utils.ts","../index.ts"],"sourcesContent":["'use strict'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst stringify = configure()\n\n// @ts-expect-error\nstringify.configure = configure\n// @ts-expect-error\nstringify.stringify = stringify\n\n// @ts-expect-error\nstringify.default = stringify\n\n// @ts-expect-error used for named export\nexports.stringify = stringify\n// @ts-expect-error used for named export\nexports.configure = configure\n\nmodule.exports = stringify\n\n// eslint-disable-next-line no-control-regex\nconst strEscapeSequencesRegExp = /[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/\n\n// Escape C0 control characters, double quotes, the backslash and every code\n// unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.\nfunction strEscape (str) {\n // Some magic numbers that worked out fine while benchmarking with v8 8.0\n if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {\n return `\"${str}\"`\n }\n return JSON.stringify(str)\n}\n\nfunction sort (array, comparator) {\n // Insertion sort is very efficient for small input sizes, but it has a bad\n // worst case complexity. Thus, use native array sort for bigger values.\n if (array.length > 2e2 || comparator) {\n return array.sort(comparator)\n }\n for (let i = 1; i < array.length; i++) {\n const currentValue = array[i]\n let position = i\n while (position !== 0 && array[position - 1] > currentValue) {\n array[position] = array[position - 1]\n position--\n }\n array[position] = currentValue\n }\n return array\n}\n\nconst typedArrayPrototypeGetSymbolToStringTag =\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(\n Object.getPrototypeOf(\n new Int8Array()\n )\n ),\n Symbol.toStringTag\n ).get\n\nfunction isTypedArrayWithEntries (value) {\n return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0\n}\n\nfunction stringifyTypedArray (array, separator, maximumBreadth) {\n if (array.length < maximumBreadth) {\n maximumBreadth = array.length\n }\n const whitespace = separator === ',' ? '' : ' '\n let res = `\"0\":${whitespace}${array[0]}`\n for (let i = 1; i < maximumBreadth; i++) {\n res += `${separator}\"${i}\":${whitespace}${array[i]}`\n }\n return res\n}\n\nfunction getCircularValueOption (options) {\n if (hasOwnProperty.call(options, 'circularValue')) {\n const circularValue = options.circularValue\n if (typeof circularValue === 'string') {\n return `\"${circularValue}\"`\n }\n if (circularValue == null) {\n return circularValue\n }\n if (circularValue === Error || circularValue === TypeError) {\n return {\n toString () {\n throw new TypeError('Converting circular structure to JSON')\n }\n }\n }\n throw new TypeError('The \"circularValue\" argument must be of type string or the value null or undefined')\n }\n return '\"[Circular]\"'\n}\n\nfunction getDeterministicOption (options) {\n let value\n if (hasOwnProperty.call(options, 'deterministic')) {\n value = options.deterministic\n if (typeof value !== 'boolean' && typeof value !== 'function') {\n throw new TypeError('The \"deterministic\" argument must be of type boolean or comparator function')\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getBooleanOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'boolean') {\n throw new TypeError(`The \"${key}\" argument must be of type boolean`)\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getPositiveIntegerOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'number') {\n throw new TypeError(`The \"${key}\" argument must be of type number`)\n }\n if (!Number.isInteger(value)) {\n throw new TypeError(`The \"${key}\" argument must be an integer`)\n }\n if (value < 1) {\n throw new RangeError(`The \"${key}\" argument must be >= 1`)\n }\n }\n return value === undefined ? Infinity : value\n}\n\nfunction getItemCount (number) {\n if (number === 1) {\n return '1 item'\n }\n return `${number} items`\n}\n\nfunction getUniqueReplacerSet (replacerArray) {\n const replacerSet = new Set()\n for (const value of replacerArray) {\n if (typeof value === 'string' || typeof value === 'number') {\n replacerSet.add(String(value))\n }\n }\n return replacerSet\n}\n\nfunction getStrictOption (options) {\n if (hasOwnProperty.call(options, 'strict')) {\n const value = options.strict\n if (typeof value !== 'boolean') {\n throw new TypeError('The \"strict\" argument must be of type boolean')\n }\n if (value) {\n return (value) => {\n let message = `Object can not safely be stringified. Received type ${typeof value}`\n if (typeof value !== 'function') message += ` (${value.toString()})`\n throw new Error(message)\n }\n }\n }\n}\n\nfunction configure (options) {\n options = { ...options }\n const fail = getStrictOption(options)\n if (fail) {\n if (options.bigint === undefined) {\n options.bigint = false\n }\n if (!('circularValue' in options)) {\n options.circularValue = Error\n }\n }\n const circularValue = getCircularValueOption(options)\n const bigint = getBooleanOption(options, 'bigint')\n const deterministic = getDeterministicOption(options)\n const comparator = typeof deterministic === 'function' ? deterministic : undefined\n const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth')\n const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth')\n\n function stringifyFnReplacer (key, parent, stack, replacer, spacer, indentation) {\n let value = parent[key]\n\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n value = replacer.call(parent, key, value)\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n let join = ','\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let whitespace = ''\n let separator = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (deterministic && !isTypedArrayWithEntries(value)) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":${whitespace}\"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyArrayReplacer (key, value, stack, replacer, spacer, indentation) {\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n const originalIndentation = indentation\n let res = ''\n let join = ','\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n stack.push(value)\n let whitespace = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n let separator = ''\n for (const key of replacer) {\n const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyIndent (key, value, stack, spacer, indentation) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again.\n if (typeof value !== 'object') {\n return stringifyIndent(key, value, stack, spacer, indentation)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n indentation += spacer\n let res = `\\n${indentation}`\n const join = `,\\n${indentation}`\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n res += `\\n${originalIndentation}`\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n indentation += spacer\n const join = `,\\n${indentation}`\n let res = ''\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, join, maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = join\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}: ${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\": \"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (separator !== '') {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifySimple (key, value, stack) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again\n if (typeof value !== 'object') {\n return stringifySimple(key, value, stack)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n\n const hasLength = value.length !== undefined\n if (hasLength && Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n res += ','\n }\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `,\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (hasLength && isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, ',', maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = ','\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifySimple(key, value[key], stack)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${tmp}`\n separator = ','\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":\"${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringify (value, replacer, space) {\n if (arguments.length > 1) {\n let spacer = ''\n if (typeof space === 'number') {\n spacer = ' '.repeat(Math.min(space, 10))\n } else if (typeof space === 'string') {\n spacer = space.slice(0, 10)\n }\n if (replacer != null) {\n if (typeof replacer === 'function') {\n return stringifyFnReplacer('', { '': value }, [], replacer, spacer, '')\n }\n if (Array.isArray(replacer)) {\n return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '')\n }\n }\n if (spacer.length !== 0) {\n return stringifyIndent('', value, [], spacer, '')\n }\n }\n return stringifySimple('', value, [])\n }\n\n return stringify\n}\n","// Copied from https://gist.github.com/scokmen/f813c904ef79022e84ab2409574d1b45\n\nexport enum EHttpStatusCode {\n /**\n * The server has received the request headers and the client should proceed to send the request body\n * (in the case of a request for which a body needs to be sent; for example, a POST request).\n * Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.\n * To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request\n * and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates the request should not be continued.\n */\n CONTINUE = 100,\n\n /**\n * The requester has asked the server to switch protocols and the server has agreed to do so.\n */\n SWITCHING_PROTOCOLS = 101,\n\n /**\n * A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.\n * This code indicates that the server has received and is processing the request, but no response is available yet.\n * This prevents the client from timing out and assuming the request was lost.\n */\n PROCESSING = 102,\n\n /**\n * Standard response for successful HTTP requests.\n * The actual response will depend on the request method used.\n * In a GET request, the response will contain an entity corresponding to the requested resource.\n * In a POST request, the response will contain an entity describing or containing the result of the action.\n */\n OK = 200,\n\n /**\n * The request has been fulfilled, resulting in the creation of a new resource.\n */\n CREATED = 201,\n\n /**\n * The request has been accepted for processing, but the processing has not been completed.\n * The request might or might not be eventually acted upon, and may be disallowed when processing occurs.\n */\n ACCEPTED = 202,\n\n /**\n * SINCE HTTP/1.1\n * The server is a transforming proxy that received a 200 OK from its origin,\n * but is returning a modified version of the origin's response.\n */\n NON_AUTHORITATIVE_INFORMATION = 203,\n\n /**\n * The server successfully processed the request and is not returning any content.\n */\n NO_CONTENT = 204,\n\n /**\n * The server successfully processed the request, but is not returning any content.\n * Unlike a 204 response, this response requires that the requester reset the document view.\n */\n RESET_CONTENT = 205,\n\n /**\n * The server is delivering only part of the resource (byte serving) due to a range header sent by the client.\n * The range header is used by HTTP clients to enable resuming of interrupted downloads,\n * or split a download into multiple simultaneous streams.\n */\n PARTIAL_CONTENT = 206,\n\n /**\n * The message body that follows is an XML message and can contain a number of separate response codes,\n * depending on how many sub-requests were made.\n */\n MULTI_STATUS = 207,\n\n /**\n * The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,\n * and are not being included again.\n */\n ALREADY_REPORTED = 208,\n\n /**\n * The server has fulfilled a request for the resource,\n * and the response is a representation of the result of one or more instance-manipulations applied to the current instance.\n */\n IM_USED = 226,\n\n /**\n * Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).\n * For example, this code could be used to present multiple video format options,\n * to list files with different filename extensions, or to suggest word-sense disambiguation.\n */\n MULTIPLE_CHOICES = 300,\n\n /**\n * This and all future requests should be directed to the given URI.\n */\n MOVED_PERMANENTLY = 301,\n\n /**\n * This is an example of industry practice contradicting the standard.\n * The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect\n * (the original describing phrase was \"Moved Temporarily\"), but popular browsers implemented 302\n * with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307\n * to distinguish between the two behaviours. However, some Web applications and frameworks\n * use the 302 status code as if it were the 303.\n */\n FOUND = 302,\n\n /**\n * SINCE HTTP/1.1\n * The response to the request can be found under another URI using a GET method.\n * When received in response to a POST (or PUT/DELETE), the client should presume that\n * the server has received the data and should issue a redirect with a separate GET message.\n */\n SEE_OTHER = 303,\n\n /**\n * Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.\n * In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.\n */\n NOT_MODIFIED = 304,\n\n /**\n * SINCE HTTP/1.1\n * The requested resource is available only through a proxy, the address for which is provided in the response.\n * Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.\n */\n USE_PROXY = 305,\n\n /**\n * No longer used. Originally meant \"Subsequent requests should use the specified proxy.\"\n */\n SWITCH_PROXY = 306,\n\n /**\n * SINCE HTTP/1.1\n * In this case, the request should be repeated with another URI; however, future requests should still use the original URI.\n * In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request.\n * For example, a POST request should be repeated using another POST request.\n */\n TEMPORARY_REDIRECT = 307,\n\n /**\n * The request and all future requests should be repeated using another URI.\n * 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.\n * So, for example, submitting a form to a permanently redirected resource may continue smoothly.\n */\n PERMANENT_REDIRECT = 308,\n\n /**\n * The server cannot or will not process the request due to an apparent client error\n * (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).\n */\n BAD_REQUEST = 400,\n\n /**\n * Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet\n * been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the\n * requested resource. See Basic access authentication and Digest access authentication. 401 semantically means\n * \"unauthenticated\",i.e. the user does not have the necessary credentials.\n */\n UNAUTHORIZED = 401,\n\n /**\n * Reserved for future use. The original intention was that this code might be used as part of some form of digital\n * cash or micro payment scheme, but that has not happened, and this code is not usually used.\n * Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.\n */\n PAYMENT_REQUIRED = 402,\n\n /**\n * The request was valid, but the server is refusing action.\n * The user might not have the necessary permissions for a resource.\n */\n FORBIDDEN = 403,\n\n /**\n * The requested resource could not be found but may be available in the future.\n * Subsequent requests by the client are permissible.\n */\n NOT_FOUND = 404,\n\n /**\n * A request method is not supported for the requested resource;\n * for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.\n */\n METHOD_NOT_ALLOWED = 405,\n\n /**\n * The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.\n */\n NOT_ACCEPTABLE = 406,\n\n /**\n * The client must first authenticate itself with the proxy.\n */\n PROXY_AUTHENTICATION_REQUIRED = 407,\n\n /**\n * The server timed out waiting for the request.\n * According to HTTP specifications:\n * \"The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.\"\n */\n REQUEST_TIMEOUT = 408,\n\n /**\n * Indicates that the request could not be processed because of conflict in the request,\n * such as an edit conflict between multiple simultaneous updates.\n */\n CONFLICT = 409,\n\n /**\n * Indicates that the resource requested is no longer available and will not be available again.\n * This should be used when a resource has been intentionally removed and the resource should be purged.\n * Upon receiving a 410 status code, the client should not request the resource in the future.\n * Clients such as search engines should remove the resource from their indices.\n * Most use cases do not require clients and search engines to purge the resource, and a \"404 Not Found\" may be used instead.\n */\n GONE = 410,\n\n /**\n * The request did not specify the length of its content, which is required by the requested resource.\n */\n LENGTH_REQUIRED = 411,\n\n /**\n * The server does not meet one of the preconditions that the requester put on the request.\n */\n PRECONDITION_FAILED = 412,\n\n /**\n * The request is larger than the server is willing or able to process. Previously called \"Request Entity Too Large\".\n */\n PAYLOAD_TOO_LARGE = 413,\n\n /**\n * The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,\n * in which case it should be converted to a POST request.\n * Called \"Request-URI Too Long\" previously.\n */\n URI_TOO_LONG = 414,\n\n /**\n * The request entity has a media type which the server or resource does not support.\n * For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.\n */\n UNSUPPORTED_MEDIA_TYPE = 415,\n\n /**\n * The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.\n * For example, if the client asked for a part of the file that lies beyond the end of the file.\n * Called \"Requested Range Not Satisfiable\" previously.\n */\n RANGE_NOT_SATISFIABLE = 416,\n\n /**\n * The server cannot meet the requirements of the Expect request-header field.\n */\n EXPECTATION_FAILED = 417,\n\n /**\n * This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,\n * and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by\n * teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.\n */\n I_AM_A_TEAPOT = 418,\n\n /**\n * The request was directed at a server that is not able to produce a response (for example because a connection reuse).\n */\n MISDIRECTED_REQUEST = 421,\n\n /**\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n UNPROCESSABLE_ENTITY = 422,\n\n /**\n * The resource that is being accessed is locked.\n */\n LOCKED = 423,\n\n /**\n * The request failed due to failure of a previous request (e.g., a PROPPATCH).\n */\n FAILED_DEPENDENCY = 424,\n\n /**\n * The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.\n */\n UPGRADE_REQUIRED = 426,\n\n /**\n * The origin server requires the request to be conditional.\n * Intended to prevent \"the 'lost update' problem, where a client\n * GETs a resource's state, modifies it, and PUTs it back to the server,\n * when meanwhile a third party has modified the state on the server, leading to a conflict.\"\n */\n PRECONDITION_REQUIRED = 428,\n\n /**\n * The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.\n */\n TOO_MANY_REQUESTS = 429,\n\n /**\n * The server is unwilling to process the request because either an individual header field,\n * or all the header fields collectively, are too large.\n */\n REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n\n /**\n * A server operator has received a legal demand to deny access to a resource or to a set of resources\n * that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.\n */\n UNAVAILABLE_FOR_LEGAL_REASONS = 451,\n\n /**\n * A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.\n */\n INTERNAL_SERVER_ERROR = 500,\n\n /**\n * The server either does not recognize the request method, or it lacks the ability to fulfill the request.\n * Usually this implies future availability (e.g., a new feature of a web-service API).\n */\n NOT_IMPLEMENTED = 501,\n\n /**\n * The server was acting as a gateway or proxy and received an invalid response from the upstream server.\n */\n BAD_GATEWAY = 502,\n\n /**\n * The server is currently unavailable (because it is overloaded or down for maintenance).\n * Generally, this is a temporary state.\n */\n SERVICE_UNAVAILABLE = 503,\n\n /**\n * The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.\n */\n GATEWAY_TIMEOUT = 504,\n\n /**\n * The server does not support the HTTP protocol version used in the request\n */\n HTTP_VERSION_NOT_SUPPORTED = 505,\n\n /**\n * Transparent content negotiation for the request results in a circular reference.\n */\n VARIANT_ALSO_NEGOTIATES = 506,\n\n /**\n * The server is unable to store the representation needed to complete the request.\n */\n INSUFFICIENT_STORAGE = 507,\n\n /**\n * The server detected an infinite loop while processing the request.\n */\n LOOP_DETECTED = 508,\n\n /**\n * Further extensions to the request are required for the server to fulfill it.\n */\n NOT_EXTENDED = 510,\n\n /**\n * The client needs to authenticate to gain network access.\n * Intended for use by intercepting proxies used to control access to the network (e.g., \"captive portals\" used\n * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).\n */\n NETWORK_AUTHENTICATION_REQUIRED = 511,\n}\n","export enum ELocale {\n English = \"en\",\n Spanish = \"es\",\n Turkish = \"tr\",\n}\n","export enum EPayLinkStatus {\n Active = 0,\n Paid = 1,\n Expired = 2,\n}\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * API token for machine-to-machine authentication\n */\nexport type ApiToken = Brand<string, \"ApiToken\">;\nexport const ApiToken = make<ApiToken>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a string representation of a big number. These values can be directly converted to a bigint.\n */\nexport type BigNumberString = Brand<string, \"BigNumberString\">;\nexport const BigNumberString = make<BigNumberString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is base64 encoded string\n */\nexport type Base64String = Brand<string, \"Base64String\">;\nexport const Base64String = make<Base64String>();\n","import { Brand, make } from \"ts-brand\";\n\n// This is an amount of USD in decimal format. 1.01 = $1.01 = 1010000 USDC\nexport type DecimalAmount = Brand<number, \"DecimalAmount\">;\nexport const DecimalAmount = make<DecimalAmount>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a 20-byte Ethereum account address, prefixed with \"0x\".\n */\nexport type EVMAccountAddress = Brand<string, \"EVMAccountAddress\">;\nexport const EVMAccountAddress = make<EVMAccountAddress>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a 20-byte Ethereum contract address, prefixed with \"0x\".\n */\nexport type EVMContractAddress = Brand<string, \"EVMContractAddress\">;\nexport const EVMContractAddress = make<EVMContractAddress>();\n","import { Brand, make } from \"ts-brand\";\n\n// HexString is always prefixed with 0x and encoded in hex\nexport type HexString = Brand<string, \"HexString\">;\nexport const HexString = make<HexString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * An ISO 8601 date string, in the format YYYY-MM-DDTHH:MM:SS.SSSZ\n * This is the same format as the ISO 8601 date string returned by the JavaScript Date object.\n */\nexport type ISO8601DateString = Brand<string, \"ISO8601DateString\">;\nexport const ISO8601DateString = make<ISO8601DateString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a JWT, still in Base64 format.\n */\nexport type JsonWebToken = Brand<string, \"JsonWebToken\">;\nexport const JsonWebToken = make<JsonWebToken>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a hex encoded binary data string that contains Solidity Call Data. It is prefixed with a \"0x\".\n */\nexport type JSONString = Brand<string, \"JSONString\">;\nexport const JSONString = make<JSONString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a Unix timestamp, in milliseconds, the default for javascript. Not seconds, which is the default for Unix\n */\nexport type MillisecondTimestamp = Brand<number, \"MillisecondTimestamp\">;\nexport const MillisecondTimestamp = make<MillisecondTimestamp>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a v7 UUID, like \"123e4567-e89b-12d3-a456-426614174000\"\n */\nexport type PayLinkId = Brand<string, \"PayLinkId\">;\nexport const PayLinkId = make<PayLinkId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a v7 UUID, like \"123e4567-e89b-12d3-a456-426614174000\"\n */\nexport type PayLinkPaymentId = Brand<string, \"PayLinkPaymentId\">;\nexport const PayLinkPaymentId = make<PayLinkPaymentId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * The ID of a transaction from the Relayer API.\n */\nexport type RelayerTransactionId = Brand<string, \"RelayerTransactionId\">;\nexport const RelayerTransactionId = make<RelayerTransactionId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is an EVM ERC-712 signature, hex encoded and prefixed with 0x.\n */\nexport type Signature = Brand<string, \"Signature\">;\nexport const Signature = make<Signature>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * A blockchain transaction hash.\n */\nexport type TransactionHash = Brand<string, \"TransactionHash\">;\nexport const TransactionHash = make<TransactionHash>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a Unix timestamp, in seconds. Not milliseconds, which is the default for JavaScript.\n */\nexport type UnixTimestamp = Brand<number, \"UnixTimestamp\">;\nexport const UnixTimestamp = make<UnixTimestamp>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a complete URL string, including the protocol, domain, and path. It can include a query string.\n */\nexport type URLString = Brand<string, \"URLString\">;\nexport const URLString = make<URLString>();\n","import { Brand, make } from \"ts-brand\";\n\n// This is an amount of USDC, in Wei. USDC has 6 decimals, so USDCAmount(1010000) = 1.01 USDC\nexport type USDCAmount = Brand<number, \"USDCAmount\">;\nexport const USDCAmount = make<USDCAmount>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a v7 UUID, like \"123e4567-e89b-12d3-a456-426614174000\"\n */\nexport type UserId = Brand<string, \"UserId\">;\nexport const UserId = make<UserId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * A Username string. The DB supports up to 128 characters.\n * It is used to identify a user in the system.\n * It is not case sensitive and must be unique.\n * It is not null.\n * It is not empty.\n * It is not a UUID.\n * It is not a URL.\n * It is not a JSON string.\n */\nexport type Username = Brand<string, \"Username\">;\nexport const Username = make<Username>();\n","import { EHttpStatusCode } from \"types/enum\";\n\n// Generic base error class for creating branded error types\nexport abstract class BaseError extends Error {\n abstract readonly errorCode: string;\n abstract readonly errorType: string;\n abstract readonly httpStatus: EHttpStatusCode;\n\n constructor(src: Error, errorType: string) {\n super(src.message);\n this.name = errorType;\n this.stack = src.stack;\n\n // Preserve the prototype chain\n Object.setPrototypeOf(this, this.constructor.prototype);\n }\n\n // Helper method to get error details\n getErrorDetails() {\n return {\n name: this.name,\n message: this.message,\n errorCode: this.errorCode,\n errorType: this.errorType,\n stack: this.stack,\n };\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\n// Branded error types to ensure they're distinguishable\nexport class AjaxError extends BaseError {\n readonly errorCode = \"ERR_AJAX\" as const;\n readonly errorType = \"AjaxError\";\n readonly httpStatus = EHttpStatusCode.INTERNAL_SERVER_ERROR;\n\n constructor(src: Error) {\n super(src, \"AjaxError\");\n }\n\n // Static factory method\n static fromError(src: Error): AjaxError {\n return new AjaxError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is AjaxError {\n return error instanceof AjaxError;\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\n// Branded error types to ensure they're distinguishable\nexport class ProxyError extends BaseError {\n readonly errorCode = \"ERR_PROXY\" as const;\n readonly errorType = \"ProxyError\";\n readonly httpStatus = EHttpStatusCode.INTERNAL_SERVER_ERROR;\n\n constructor(src: Error) {\n super(src, \"ProxyError\");\n }\n\n // Static factory method\n static fromError(src: Error): ProxyError {\n return new ProxyError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is ProxyError {\n return error instanceof ProxyError;\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\n// RetryError is used with backoffAndRetry(), when all you want to do is retry the operation but need an error\n// to signal that whatever you are doing is not complete.\nexport class RetryError extends BaseError {\n readonly errorCode = \"ERR_RETRY\" as const;\n readonly errorType = \"REtryError\";\n readonly httpStatus = EHttpStatusCode.I_AM_A_TEAPOT;\n\n constructor(src: Error) {\n super(src, \"RetryError\");\n }\n\n // Static factory method\n static fromError(src: Error): RetryError {\n return new RetryError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is RetryError {\n return error instanceof RetryError;\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\nexport class ValidationError extends BaseError {\n readonly errorCode = \"ERR_VALIDATION\" as const;\n readonly errorType = \"ValidationError\";\n readonly httpStatus = EHttpStatusCode.BAD_REQUEST;\n\n constructor(src: Error) {\n super(src, \"ValidationError\");\n }\n\n // Static factory method\n static fromError(src: Error): ValidationError {\n return new ValidationError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is ValidationError {\n return error instanceof ValidationError;\n }\n}\n","import { JsonWebToken } from \"../primitives\";\n\nexport class OAuthTokenModel {\n public constructor(\n public readonly access_token: JsonWebToken,\n public readonly token_type: \"Bearer\",\n public readonly expires_in: number,\n ) {}\n}\n","import { ResultAsync } from \"neverthrow\";\n\nimport type {\n IAjaxRequestConfig,\n IAjaxRequestBody,\n IAjaxUtils,\n} from \"./IAjaxUtils\";\n\nimport { AjaxError } from \"types/errors\";\nimport type { JsonWebToken } from \"types/primitives\";\n\nfunction isJsonBody(\n data: IAjaxRequestBody,\n): data is Record<string, unknown> | Array<Record<string, unknown>> {\n return (\n typeof data === \"object\" &&\n data !== null &&\n !(data instanceof ArrayBuffer) &&\n !(data instanceof Blob) &&\n !(data instanceof FormData) &&\n !(data instanceof URLSearchParams) &&\n !ArrayBuffer.isView(data) &&\n typeof (data as ReadableStream).getReader !== \"function\"\n );\n}\n\nfunction bodyToRequestInit(\n data: IAjaxRequestBody | undefined,\n): Pick<RequestInit, \"body\" | \"headers\"> {\n if (data === undefined || data === null) {\n return {};\n }\n if (isJsonBody(data)) {\n return {\n body: JSON.stringify(data),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n }\n return { body: data as BodyInit };\n}\n\n/**\n * Fetch-based implementation of IAjaxUtils.\n * Uses the global fetch (browser or Node 18+).\n */\nexport class AjaxUtils implements IAjaxUtils {\n private defaultToken: string = \"\";\n\n public setDefaultToken(token: JsonWebToken): void {\n this.defaultToken = token as string;\n }\n\n public get<T>(\n url: URL | string,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n return this.doFetch<T>(url, this.mergeConfig(config, { method: \"GET\" }));\n }\n\n public post<T>(\n url: URL | string,\n data?: IAjaxRequestBody,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n const { body, headers } = bodyToRequestInit(data);\n const init: RequestInit = { method: \"POST\" };\n if (body !== undefined) init.body = body;\n if (headers !== undefined) init.headers = headers;\n return this.doFetch<T>(url, this.mergeConfig(config, init));\n }\n\n public put<T>(\n url: URL | string,\n data: IAjaxRequestBody,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n const { body, headers } = bodyToRequestInit(data);\n return this.doFetch<T>(\n url,\n this.mergeConfig(config, { method: \"PUT\", body, headers }),\n );\n }\n\n public delete<T>(\n url: URL | string,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n return this.doFetch<T>(url, this.mergeConfig(config, { method: \"DELETE\" }));\n }\n\n private mergeConfig(\n config: IAjaxRequestConfig | undefined,\n init: RequestInit,\n ): RequestInit {\n const headers = new Headers(init.headers);\n if (config?.headers) {\n const c = new Headers(config.headers);\n c.forEach((v, k) => headers.set(k, v));\n }\n if (this.defaultToken) {\n headers.set(\"Authorization\", `Bearer ${this.defaultToken}`);\n }\n return {\n ...config,\n ...init,\n headers,\n };\n }\n\n private doFetch<T>(\n url: URL | string,\n init: RequestInit,\n ): ResultAsync<T, AjaxError> {\n return ResultAsync.fromPromise(\n (async (): Promise<T> => {\n const res = await fetch(url, init);\n if (!res.ok) {\n const text = await res.text();\n throw new Error(\n `HTTP ${res.status} ${res.statusText}${text ? `: ${text}` : \"\"}`,\n );\n }\n const contentType = res.headers.get(\"content-type\") ?? \"\";\n if (contentType.toLowerCase().includes(\"application/json\")) {\n return (await res.json()) as T;\n }\n return (await res.text()) as T;\n })(),\n (e) => AjaxError.fromError(e as Error),\n );\n }\n}\n","import {\n ISO8601DateString,\n MillisecondTimestamp,\n UnixTimestamp,\n} from \"types/primitives\";\n\nexport interface ITimeUtils {\n getUnixNow(): UnixTimestamp;\n getMillisecondNow(): MillisecondTimestamp;\n getISO8601TimeString(time: MillisecondTimestamp): ISO8601DateString;\n convertTimestampToISOString(unixTimestamp: UnixTimestamp): ISO8601DateString;\n convertISOStringToTimestamp(isoString: ISO8601DateString): UnixTimestamp;\n getUnixTodayStart(): UnixTimestamp;\n getUnixTodayEnd(): UnixTimestamp;\n getStartOfMonth(): UnixTimestamp;\n}\n\nexport const ITimeUtilsType = Symbol.for(\"ITimeUtils\");\n","import { okAsync, ResultAsync } from \"neverthrow\";\nimport stringify from \"safe-stable-stringify\";\n\nimport { ValidationError } from \"types/errors\";\nimport { JSONString } from \"types/primitives\";\n\nexport class ObjectUtils {\n // Taken from https://stackoverflow.com/questions/27936772/how-to-deep-merge-instead-of-shallow-merge\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static mergeDeep<T = unknown>(...objects: any[]): T {\n const isObject = (obj: unknown) => obj && typeof obj === \"object\";\n\n return objects.reduce((prev, obj) => {\n Object.keys(obj).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = ObjectUtils.mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n\n return prev;\n }, {});\n }\n\n /**\n * This method is an improvement on JSON.stringify. It uses a stable stringify method so that objects will always generate the same\n * hash, and it support a few non-serializeable types that are useful, such as BigInt, Map, and Set. The output is correct JSON\n * but uses markup to support the non-native types and must be deserialized with the deserialize() method to get the same object\n * back.\n * @param obj\n * @returns\n */\n static serialize(obj: unknown): JSONString {\n return JSONString(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stringify(obj, (_key: any, value: any) => {\n if (value instanceof Error) {\n return {\n dataType: \"Error\",\n value: {\n name: value.name || \"Error\",\n message: value.message || \"Unknown error\",\n stack: value.stack || undefined,\n },\n };\n } else if (value instanceof Map) {\n return {\n dataType: \"Map\",\n value: Array.from(value.entries()), // or with spread: value: [...value]\n };\n } else if (value instanceof Set) {\n return {\n dataType: \"Set\",\n value: [...value],\n };\n } else if (value instanceof BigInt) {\n return {\n dataType: \"BigInt\",\n value: value.toString(),\n };\n } else if (typeof value == \"bigint\") {\n return {\n dataType: \"bigint\",\n value: BigInt(value).toString(),\n };\n } else {\n return value;\n }\n }) as string,\n );\n }\n\n static deserialize<T = Record<string, unknown>>(\n json: JSONString,\n ): ResultAsync<T, ValidationError> {\n return ResultAsync.fromPromise(Promise.resolve(JSON.parse(json)), (e) =>\n ValidationError.fromError(e as Error),\n ).andThen((parsed) => {\n // Handle special data types\n const processValue = (value: unknown): unknown => {\n if (\n typeof value === \"object\" &&\n value !== null &&\n \"dataType\" in value &&\n \"value\" in value\n ) {\n const dataType = (value as { dataType: string }).dataType;\n const dataValue = (value as { value: unknown }).value;\n\n if (dataType === \"Error\") {\n const errorData = dataValue as {\n name?: string;\n message?: string;\n stack?: string;\n };\n const error = new Error(errorData.message || \"Unknown error\");\n error.name = errorData.name || \"Error\";\n if (errorData.stack) {\n error.stack = errorData.stack;\n }\n return error;\n } else if (dataType === \"Map\") {\n return new Map(dataValue as [unknown, unknown][]);\n } else if (dataType === \"Set\") {\n return new Set(dataValue as unknown[]);\n } else if (dataType === \"BigInt\" || dataType === \"bigint\") {\n return BigInt(dataValue as string);\n }\n }\n\n if (Array.isArray(value)) {\n return value.map(processValue);\n } else if (value && typeof value === \"object\") {\n const processed: Record<string, unknown> = {};\n for (const [key, val] of Object.entries(value)) {\n processed[key] = processValue(val);\n }\n return processed;\n }\n\n return value;\n };\n\n const processed = processValue(parsed);\n return okAsync(processed as T);\n });\n }\n\n static deserializeUnsafe<T = Record<string, unknown>>(json: JSONString): T {\n return JSON.parse(json, (_key, value) => {\n if (typeof value === \"object\" && value !== null) {\n if (value.dataType === \"Error\") {\n const errorData = value.value as {\n name?: string;\n message?: string;\n stack?: string;\n };\n const error = new Error(errorData.message || \"Unknown error\");\n error.name = errorData.name || \"Error\";\n if (errorData.stack) {\n error.stack = errorData.stack;\n }\n return error;\n } else if (value.dataType === \"Map\") {\n return new Map(value.value);\n } else if (value.dataType === \"Set\") {\n return new Set(value.value);\n } else if (value.dataType === \"BigInt\") {\n return BigInt(value.value);\n } else if (value.dataType === \"bigint\") {\n return BigInt(value.value);\n }\n }\n return value;\n });\n }\n\n /**\n * This object will convert an object with a Prototype into a generic object. This can be done by nulling the prototype but that's not\n * really possible in Typescript, so we we do it differently by cloning the object. This means this is also one way of doing a deep\n * copy of an object, but it will fail and instanceof() check.\n * @param obj\n * @returns\n */\n static toGenericObject<T = Record<string, unknown>>(\n obj: unknown,\n ): ResultAsync<T, ValidationError> {\n return ObjectUtils.deserialize(ObjectUtils.serialize(obj));\n }\n\n static removeNullValues<T>(array: (T | null | undefined)[]): T[] {\n function notEmpty<T>(value: T | null | undefined): value is T {\n if (value === null || value === undefined) return false;\n // const _testConversion: T = value;\n return true;\n }\n return array.filter(notEmpty);\n }\n\n static getEnumKeyByValue<T extends Record<string, string | number>>(\n enumObj: T,\n value: number,\n ): string {\n return (\n Object.keys(enumObj).find((key) => enumObj[key] === value) || \"Undefined\"\n );\n }\n\n static getEnumKeyByValueSafely<T extends Record<string, string | number>>(\n enumObj: T,\n value: number,\n ): string {\n // Filter out numeric keys like \"0\", \"1\"\n const stringKeys = Object.keys(enumObj).filter((key) => isNaN(Number(key)));\n for (const key of stringKeys) {\n if (enumObj[key] === value) {\n return key;\n }\n }\n return \"Undefined\";\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public static convertBigIntsToStrings<T>(input: T): any {\n if (typeof input === \"bigint\") {\n return input.toString();\n }\n\n if (Array.isArray(input)) {\n return input.map((i) => {\n return this.convertBigIntsToStrings(i);\n });\n }\n\n if (input && typeof input === \"object\") {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(input)) {\n result[key] = this.convertBigIntsToStrings(value);\n }\n return result;\n }\n\n return input;\n }\n}\n","import cjsModule from '../index.js'\n\nexport const configure = cjsModule.configure\n\nexport const stringify = cjsModule\nexport default cjsModule\n","import { injectable } from \"inversify\";\n\nimport type { ITimeUtils } from \"./ITimeUtils\";\n\nimport {\n ISO8601DateString,\n MillisecondTimestamp,\n UnixTimestamp,\n} from \"types/primitives\";\n\n@injectable()\nexport class TimeUtils implements ITimeUtils {\n protected lastBlockchainCheck: UnixTimestamp | undefined;\n protected lastBlockchainTimestamp: UnixTimestamp | undefined;\n constructor() {}\n\n public getUnixNow(): UnixTimestamp {\n return UnixTimestamp(Math.floor(Date.now() / 1000));\n }\n\n public getMillisecondNow(): MillisecondTimestamp {\n return MillisecondTimestamp(Date.now());\n }\n\n public getISO8601TimeString(\n time = MillisecondTimestamp(Date.now()),\n ): ISO8601DateString {\n return ISO8601DateString(new Date(time).toISOString());\n }\n\n public convertTimestampToISOString(\n unixTimestamp: UnixTimestamp,\n ): ISO8601DateString {\n const date = new Date(unixTimestamp * 1000);\n return ISO8601DateString(date.toISOString());\n }\n\n public convertISOStringToTimestamp(\n isoString: ISO8601DateString,\n ): UnixTimestamp {\n const date = new Date(isoString);\n return UnixTimestamp(Math.floor(date.getTime() / 1000));\n }\n\n public getUnixTodayStart(): UnixTimestamp {\n const date = new Date();\n date.setHours(0, 0, 0, 0);\n return UnixTimestamp(Math.floor(date.getTime() / 1000));\n }\n public getUnixTodayEnd(): UnixTimestamp {\n const date = new Date();\n date.setHours(23, 59, 59, 999);\n return UnixTimestamp(Math.floor(date.getTime() / 1000));\n }\n\n public getStartOfMonth(): UnixTimestamp {\n const startOfMonth = new Date(\n new Date().getFullYear(),\n new Date().getMonth(),\n 1,\n ).getTime();\n return UnixTimestamp(Math.floor(startOfMonth / 1000));\n }\n}\n","import { IERC3009TransferWithAuthorization } from \"types/domain\";\nimport {\n Base64String,\n BigNumberString,\n EVMAccountAddress,\n EVMContractAddress,\n Signature,\n URLString,\n} from \"types/primitives\";\n\nexport type X402PaymentRequirements = {\n // x402 v2 uses x402Version, older drafts may use version-like fields\n x402Version?: number;\n version?: number;\n resource?: {\n url?: URLString;\n description?: string;\n mimeType?: string;\n };\n // Common shapes observed across drafts:\n accepted?: unknown; // object | array\n paymentRequirements?: unknown; // array\n};\n\nexport type X402AcceptedPayment = {\n scheme?: string;\n network?: string;\n amount?: BigNumberString;\n asset?: EVMContractAddress;\n payTo?: EVMAccountAddress;\n maxTimeoutSeconds?: number;\n extra?: Record<string, unknown>;\n};\n\nexport type X402PaymentPayloadV2ExactEvm = {\n x402Version: number;\n resource: {\n url: string;\n description?: string;\n mimeType?: string;\n };\n accepted: {\n scheme: \"exact\";\n network: string;\n amount: BigNumberString;\n asset: EVMContractAddress;\n payTo: EVMAccountAddress;\n maxTimeoutSeconds?: number;\n extra?: Record<string, unknown>;\n };\n payload: {\n signature: Signature;\n authorization: IERC3009TransferWithAuthorization;\n };\n};\n\nexport function x402ResolveRequestUrl(input: RequestInfo | URL): string {\n if (typeof input === \"string\") return input;\n if (input instanceof URL) return input.toString();\n // Request\n return input.url;\n}\n\nexport function x402Base64EncodeUtf8(input: string): Base64String {\n // Browser path\n if (typeof btoa === \"function\") {\n return Base64String(btoa(unescape(encodeURIComponent(input))));\n }\n // Node path (best-effort)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const B = (globalThis as any).Buffer;\n if (B) {\n return Base64String(B.from(input, \"utf8\").toString(\"base64\"));\n }\n throw new Error(\"No base64 encoder available in this environment.\");\n}\n\nexport function x402Base64DecodeUtf8(input: Base64String): string {\n // Browser path\n if (typeof atob === \"function\") {\n return decodeURIComponent(escape(atob(input)));\n }\n // Node path (best-effort)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const B = (globalThis as any).Buffer;\n if (B) {\n return B.from(input, \"base64\").toString(\"utf8\");\n }\n throw new Error(\"No base64 decoder available in this environment.\");\n}\n\nexport function x402ParseJsonOrBase64Json(raw: string): unknown {\n const trimmed = raw.trim();\n // Try JSON first\n if (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) {\n return JSON.parse(trimmed);\n }\n // Then try base64(JSON)\n try {\n const decoded = x402Base64DecodeUtf8(Base64String(trimmed));\n return JSON.parse(decoded);\n } catch {\n // As a last attempt, sometimes headers are quoted strings\n const unquoted = trimmed.replace(/^\"+|\"+$/g, \"\");\n if (unquoted.startsWith(\"{\") || unquoted.startsWith(\"[\")) {\n return JSON.parse(unquoted);\n }\n const decoded = x402Base64DecodeUtf8(Base64String(unquoted));\n return JSON.parse(decoded);\n }\n}\n\nexport function x402NormalizeAcceptedPayments(\n req: X402PaymentRequirements,\n): X402AcceptedPayment[] {\n const candidates: unknown[] = [];\n if (req.accepted != null) {\n if (Array.isArray(req.accepted)) candidates.push(...req.accepted);\n else candidates.push(req.accepted);\n }\n if (req.paymentRequirements != null) {\n if (Array.isArray(req.paymentRequirements))\n candidates.push(...req.paymentRequirements);\n }\n // Best-effort coercion\n return candidates.filter(Boolean).map((c) => c as X402AcceptedPayment);\n}\n\nexport function x402GetChainIdFromNetwork(network: string): number | null {\n // Expected: eip155:<chainId>\n const m = /^eip155:(\\d+)$/.exec(network);\n if (!m) return null;\n const n = Number(m[1]);\n return Number.isFinite(n) ? n : null;\n}\n\nexport function x402IsUsdcOnBase(\n chainId: number,\n asset: EVMContractAddress,\n): boolean {\n const a = asset.toLowerCase();\n // Base mainnet USDC\n if (chainId === 8453 && a === \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\")\n return true;\n return false;\n}\n","/**\n * @1shotapi/1shotpay-common\n *\n * Shared types and utilities for 1ShotPay client and server SDKs.\n */\n\nimport { ResultAsync } from \"neverthrow\";\n\nexport * from \"./types/enum\";\nexport * from \"./types/primitives\";\nexport * from \"./types/domain\";\nexport * from \"./types/errors\";\nexport * from \"./types/models\";\nexport * from \"./utils/IAjaxUtils\";\nexport * from \"./utils/AjaxUtils\";\nexport * from \"./utils/ITimeUtils\";\nexport * from \"./utils/ObjectUtils\";\nexport * from \"./utils/TimeUtils\";\nexport * from \"./utils/x402Utils\";\n\n/**\n * A simple helper function to convert a ResultAsync to a promise if you prefer to use async/await syntax.\n * @param resultAsync A ResultAsync\n * @returns A promise that resolves with the value of the ResultAsync if it is ok, or rejects with the error\n */\nexport async function resultAsyncToPromise<T>(\n resultAsync: ResultAsync<T, Error>,\n): Promise<T> {\n const result = await resultAsync;\n if (result.isErr()) {\n throw result.error;\n }\n return result.value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qBAAqB,aAAa,OAAO,CAAC;AAC1D,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B,QAAQ;AAEN,UAAM,WAAW,QAAQ,QAAQ,YAAY,EAAE;AAC/C,QAAI,SAAS,WAAW,GAAG,KAAK,SAAS,WAAW,GAAG,GAAG;AACxD,aAAO,KAAK,MAAM,QAAQ;AAAA,IAC5B;AACA,UAAM,UAAU,qBAAqB,aAAa,QAAQ,CAAC;AAC3D,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B;AACF;AAEO,SAAS,8BACd,KACuB;AACvB,QAAM,aAAwB,CAAC;AAC/B,MAAI,IAAI,YAAY,MAAM;AACxB,QAAI,MAAM,QAAQ,IAAI,QAAQ,EAAG,YAAW,KAAK,GAAG,IAAI,QAAQ;AAAA,QAC3D,YAAW,KAAK,IAAI,QAAQ;AAAA,EACnC;AACA,MAAI,IAAI,uBAAuB,MAAM;AACnC,QAAI,MAAM,QAAQ,IAAI,mBAAmB;AACvC,iBAAW,KAAK,GAAG,IAAI,mBAAmB;AAAA,EAC9C;AAEA,SAAO,WAAW,OAAO,OAAO,EAAE,IAAI,CAAC,MAAM,CAAwB;AACvE;AAEO,SAAS,0BAA0B,SAAgC;AAExE,QAAM,IAAI,iBAAiB,KAAK,OAAO;AACvC,MAAI,CAAC,EAAG,QAAO;AACf,QAAM,IAAI,OAAO,EAAE,CAAC,CAAC;AACrB,SAAO,OAAO,SAAS,CAAC,IAAI,IAAI;AAClC;AAEO,SAAS,iBACd,SACA,OACS;AACT,QAAM,IAAI,MAAM,YAAY;AAE5B,MAAI,YAAY,QAAQ,MAAM;AAC5B,WAAO;AACT,SAAO;AACT;;;ACxHA,eAAsB,qBACpB,aACY;AACZ,QAAM,SAAS,MAAM;AACrB,MAAI,OAAO,MAAM,GAAG;AAClB,UAAM,OAAO;AAAA,EACf;AACA,SAAO,OAAO;AAChB;","names":["configure","value","tmp","key","res","join","stringify","EHttpStatusCode","ELocale","EPayLinkStatus","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","ResultAsync","cjsModule","cjsModule","ResultAsync","processed"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/safe-stable-stringify/index.js","../types/enum/EHttpStatusCode.ts","../types/enum/ELocale.ts","../types/enum/EPayLinkStatus.ts","../types/primitives/ApiToken.ts","../types/primitives/BigNumberString.ts","../types/primitives/Base64String.ts","../types/primitives/DecimalAmount.ts","../types/primitives/EVMAccountAddress.ts","../types/primitives/EVMContractAddress.ts","../types/primitives/HexString.ts","../types/primitives/ISO8601DateString.ts","../types/primitives/JSONWebToken.ts","../types/primitives/JSONString.ts","../types/primitives/MillisecondTimestamp.ts","../types/primitives/PayLinkId.ts","../types/primitives/PayLinkPaymentId.ts","../types/primitives/RelayerTransactionId.ts","../types/primitives/Signature.ts","../types/primitives/TransactionHash.ts","../types/primitives/UnixTimestamp.ts","../types/primitives/URLString.ts","../types/primitives/USDCAmount.ts","../types/primitives/UserId.ts","../types/primitives/Username.ts","../types/errors/BaseError.ts","../types/errors/AjaxError.ts","../types/errors/ProxyError.ts","../types/errors/RetryError.ts","../types/errors/ValidationError.ts","../types/models/OAuthTokenModel.ts","../utils/AjaxUtils.ts","../utils/ITimeUtils.ts","../utils/ObjectUtils.ts","../../../node_modules/safe-stable-stringify/esm/wrapper.js","../utils/TimeUtils.ts","../utils/x402Utils.ts","../index.ts"],"sourcesContent":["'use strict'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst stringify = configure()\n\n// @ts-expect-error\nstringify.configure = configure\n// @ts-expect-error\nstringify.stringify = stringify\n\n// @ts-expect-error\nstringify.default = stringify\n\n// @ts-expect-error used for named export\nexports.stringify = stringify\n// @ts-expect-error used for named export\nexports.configure = configure\n\nmodule.exports = stringify\n\n// eslint-disable-next-line no-control-regex\nconst strEscapeSequencesRegExp = /[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/\n\n// Escape C0 control characters, double quotes, the backslash and every code\n// unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.\nfunction strEscape (str) {\n // Some magic numbers that worked out fine while benchmarking with v8 8.0\n if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {\n return `\"${str}\"`\n }\n return JSON.stringify(str)\n}\n\nfunction sort (array, comparator) {\n // Insertion sort is very efficient for small input sizes, but it has a bad\n // worst case complexity. Thus, use native array sort for bigger values.\n if (array.length > 2e2 || comparator) {\n return array.sort(comparator)\n }\n for (let i = 1; i < array.length; i++) {\n const currentValue = array[i]\n let position = i\n while (position !== 0 && array[position - 1] > currentValue) {\n array[position] = array[position - 1]\n position--\n }\n array[position] = currentValue\n }\n return array\n}\n\nconst typedArrayPrototypeGetSymbolToStringTag =\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(\n Object.getPrototypeOf(\n new Int8Array()\n )\n ),\n Symbol.toStringTag\n ).get\n\nfunction isTypedArrayWithEntries (value) {\n return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0\n}\n\nfunction stringifyTypedArray (array, separator, maximumBreadth) {\n if (array.length < maximumBreadth) {\n maximumBreadth = array.length\n }\n const whitespace = separator === ',' ? '' : ' '\n let res = `\"0\":${whitespace}${array[0]}`\n for (let i = 1; i < maximumBreadth; i++) {\n res += `${separator}\"${i}\":${whitespace}${array[i]}`\n }\n return res\n}\n\nfunction getCircularValueOption (options) {\n if (hasOwnProperty.call(options, 'circularValue')) {\n const circularValue = options.circularValue\n if (typeof circularValue === 'string') {\n return `\"${circularValue}\"`\n }\n if (circularValue == null) {\n return circularValue\n }\n if (circularValue === Error || circularValue === TypeError) {\n return {\n toString () {\n throw new TypeError('Converting circular structure to JSON')\n }\n }\n }\n throw new TypeError('The \"circularValue\" argument must be of type string or the value null or undefined')\n }\n return '\"[Circular]\"'\n}\n\nfunction getDeterministicOption (options) {\n let value\n if (hasOwnProperty.call(options, 'deterministic')) {\n value = options.deterministic\n if (typeof value !== 'boolean' && typeof value !== 'function') {\n throw new TypeError('The \"deterministic\" argument must be of type boolean or comparator function')\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getBooleanOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'boolean') {\n throw new TypeError(`The \"${key}\" argument must be of type boolean`)\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getPositiveIntegerOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'number') {\n throw new TypeError(`The \"${key}\" argument must be of type number`)\n }\n if (!Number.isInteger(value)) {\n throw new TypeError(`The \"${key}\" argument must be an integer`)\n }\n if (value < 1) {\n throw new RangeError(`The \"${key}\" argument must be >= 1`)\n }\n }\n return value === undefined ? Infinity : value\n}\n\nfunction getItemCount (number) {\n if (number === 1) {\n return '1 item'\n }\n return `${number} items`\n}\n\nfunction getUniqueReplacerSet (replacerArray) {\n const replacerSet = new Set()\n for (const value of replacerArray) {\n if (typeof value === 'string' || typeof value === 'number') {\n replacerSet.add(String(value))\n }\n }\n return replacerSet\n}\n\nfunction getStrictOption (options) {\n if (hasOwnProperty.call(options, 'strict')) {\n const value = options.strict\n if (typeof value !== 'boolean') {\n throw new TypeError('The \"strict\" argument must be of type boolean')\n }\n if (value) {\n return (value) => {\n let message = `Object can not safely be stringified. Received type ${typeof value}`\n if (typeof value !== 'function') message += ` (${value.toString()})`\n throw new Error(message)\n }\n }\n }\n}\n\nfunction configure (options) {\n options = { ...options }\n const fail = getStrictOption(options)\n if (fail) {\n if (options.bigint === undefined) {\n options.bigint = false\n }\n if (!('circularValue' in options)) {\n options.circularValue = Error\n }\n }\n const circularValue = getCircularValueOption(options)\n const bigint = getBooleanOption(options, 'bigint')\n const deterministic = getDeterministicOption(options)\n const comparator = typeof deterministic === 'function' ? deterministic : undefined\n const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth')\n const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth')\n\n function stringifyFnReplacer (key, parent, stack, replacer, spacer, indentation) {\n let value = parent[key]\n\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n value = replacer.call(parent, key, value)\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n let join = ','\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let whitespace = ''\n let separator = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (deterministic && !isTypedArrayWithEntries(value)) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":${whitespace}\"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyArrayReplacer (key, value, stack, replacer, spacer, indentation) {\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n const originalIndentation = indentation\n let res = ''\n let join = ','\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n stack.push(value)\n let whitespace = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n let separator = ''\n for (const key of replacer) {\n const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyIndent (key, value, stack, spacer, indentation) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again.\n if (typeof value !== 'object') {\n return stringifyIndent(key, value, stack, spacer, indentation)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n indentation += spacer\n let res = `\\n${indentation}`\n const join = `,\\n${indentation}`\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n res += `\\n${originalIndentation}`\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n indentation += spacer\n const join = `,\\n${indentation}`\n let res = ''\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, join, maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = join\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}: ${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\": \"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (separator !== '') {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifySimple (key, value, stack) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again\n if (typeof value !== 'object') {\n return stringifySimple(key, value, stack)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n\n const hasLength = value.length !== undefined\n if (hasLength && Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n res += ','\n }\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `,\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (hasLength && isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, ',', maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = ','\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifySimple(key, value[key], stack)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${tmp}`\n separator = ','\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":\"${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringify (value, replacer, space) {\n if (arguments.length > 1) {\n let spacer = ''\n if (typeof space === 'number') {\n spacer = ' '.repeat(Math.min(space, 10))\n } else if (typeof space === 'string') {\n spacer = space.slice(0, 10)\n }\n if (replacer != null) {\n if (typeof replacer === 'function') {\n return stringifyFnReplacer('', { '': value }, [], replacer, spacer, '')\n }\n if (Array.isArray(replacer)) {\n return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '')\n }\n }\n if (spacer.length !== 0) {\n return stringifyIndent('', value, [], spacer, '')\n }\n }\n return stringifySimple('', value, [])\n }\n\n return stringify\n}\n","// Copied from https://gist.github.com/scokmen/f813c904ef79022e84ab2409574d1b45\n\nexport enum EHttpStatusCode {\n /**\n * The server has received the request headers and the client should proceed to send the request body\n * (in the case of a request for which a body needs to be sent; for example, a POST request).\n * Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.\n * To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request\n * and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates the request should not be continued.\n */\n CONTINUE = 100,\n\n /**\n * The requester has asked the server to switch protocols and the server has agreed to do so.\n */\n SWITCHING_PROTOCOLS = 101,\n\n /**\n * A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.\n * This code indicates that the server has received and is processing the request, but no response is available yet.\n * This prevents the client from timing out and assuming the request was lost.\n */\n PROCESSING = 102,\n\n /**\n * Standard response for successful HTTP requests.\n * The actual response will depend on the request method used.\n * In a GET request, the response will contain an entity corresponding to the requested resource.\n * In a POST request, the response will contain an entity describing or containing the result of the action.\n */\n OK = 200,\n\n /**\n * The request has been fulfilled, resulting in the creation of a new resource.\n */\n CREATED = 201,\n\n /**\n * The request has been accepted for processing, but the processing has not been completed.\n * The request might or might not be eventually acted upon, and may be disallowed when processing occurs.\n */\n ACCEPTED = 202,\n\n /**\n * SINCE HTTP/1.1\n * The server is a transforming proxy that received a 200 OK from its origin,\n * but is returning a modified version of the origin's response.\n */\n NON_AUTHORITATIVE_INFORMATION = 203,\n\n /**\n * The server successfully processed the request and is not returning any content.\n */\n NO_CONTENT = 204,\n\n /**\n * The server successfully processed the request, but is not returning any content.\n * Unlike a 204 response, this response requires that the requester reset the document view.\n */\n RESET_CONTENT = 205,\n\n /**\n * The server is delivering only part of the resource (byte serving) due to a range header sent by the client.\n * The range header is used by HTTP clients to enable resuming of interrupted downloads,\n * or split a download into multiple simultaneous streams.\n */\n PARTIAL_CONTENT = 206,\n\n /**\n * The message body that follows is an XML message and can contain a number of separate response codes,\n * depending on how many sub-requests were made.\n */\n MULTI_STATUS = 207,\n\n /**\n * The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,\n * and are not being included again.\n */\n ALREADY_REPORTED = 208,\n\n /**\n * The server has fulfilled a request for the resource,\n * and the response is a representation of the result of one or more instance-manipulations applied to the current instance.\n */\n IM_USED = 226,\n\n /**\n * Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).\n * For example, this code could be used to present multiple video format options,\n * to list files with different filename extensions, or to suggest word-sense disambiguation.\n */\n MULTIPLE_CHOICES = 300,\n\n /**\n * This and all future requests should be directed to the given URI.\n */\n MOVED_PERMANENTLY = 301,\n\n /**\n * This is an example of industry practice contradicting the standard.\n * The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect\n * (the original describing phrase was \"Moved Temporarily\"), but popular browsers implemented 302\n * with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307\n * to distinguish between the two behaviours. However, some Web applications and frameworks\n * use the 302 status code as if it were the 303.\n */\n FOUND = 302,\n\n /**\n * SINCE HTTP/1.1\n * The response to the request can be found under another URI using a GET method.\n * When received in response to a POST (or PUT/DELETE), the client should presume that\n * the server has received the data and should issue a redirect with a separate GET message.\n */\n SEE_OTHER = 303,\n\n /**\n * Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.\n * In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.\n */\n NOT_MODIFIED = 304,\n\n /**\n * SINCE HTTP/1.1\n * The requested resource is available only through a proxy, the address for which is provided in the response.\n * Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.\n */\n USE_PROXY = 305,\n\n /**\n * No longer used. Originally meant \"Subsequent requests should use the specified proxy.\"\n */\n SWITCH_PROXY = 306,\n\n /**\n * SINCE HTTP/1.1\n * In this case, the request should be repeated with another URI; however, future requests should still use the original URI.\n * In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request.\n * For example, a POST request should be repeated using another POST request.\n */\n TEMPORARY_REDIRECT = 307,\n\n /**\n * The request and all future requests should be repeated using another URI.\n * 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.\n * So, for example, submitting a form to a permanently redirected resource may continue smoothly.\n */\n PERMANENT_REDIRECT = 308,\n\n /**\n * The server cannot or will not process the request due to an apparent client error\n * (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).\n */\n BAD_REQUEST = 400,\n\n /**\n * Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet\n * been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the\n * requested resource. See Basic access authentication and Digest access authentication. 401 semantically means\n * \"unauthenticated\",i.e. the user does not have the necessary credentials.\n */\n UNAUTHORIZED = 401,\n\n /**\n * Reserved for future use. The original intention was that this code might be used as part of some form of digital\n * cash or micro payment scheme, but that has not happened, and this code is not usually used.\n * Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.\n */\n PAYMENT_REQUIRED = 402,\n\n /**\n * The request was valid, but the server is refusing action.\n * The user might not have the necessary permissions for a resource.\n */\n FORBIDDEN = 403,\n\n /**\n * The requested resource could not be found but may be available in the future.\n * Subsequent requests by the client are permissible.\n */\n NOT_FOUND = 404,\n\n /**\n * A request method is not supported for the requested resource;\n * for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.\n */\n METHOD_NOT_ALLOWED = 405,\n\n /**\n * The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.\n */\n NOT_ACCEPTABLE = 406,\n\n /**\n * The client must first authenticate itself with the proxy.\n */\n PROXY_AUTHENTICATION_REQUIRED = 407,\n\n /**\n * The server timed out waiting for the request.\n * According to HTTP specifications:\n * \"The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.\"\n */\n REQUEST_TIMEOUT = 408,\n\n /**\n * Indicates that the request could not be processed because of conflict in the request,\n * such as an edit conflict between multiple simultaneous updates.\n */\n CONFLICT = 409,\n\n /**\n * Indicates that the resource requested is no longer available and will not be available again.\n * This should be used when a resource has been intentionally removed and the resource should be purged.\n * Upon receiving a 410 status code, the client should not request the resource in the future.\n * Clients such as search engines should remove the resource from their indices.\n * Most use cases do not require clients and search engines to purge the resource, and a \"404 Not Found\" may be used instead.\n */\n GONE = 410,\n\n /**\n * The request did not specify the length of its content, which is required by the requested resource.\n */\n LENGTH_REQUIRED = 411,\n\n /**\n * The server does not meet one of the preconditions that the requester put on the request.\n */\n PRECONDITION_FAILED = 412,\n\n /**\n * The request is larger than the server is willing or able to process. Previously called \"Request Entity Too Large\".\n */\n PAYLOAD_TOO_LARGE = 413,\n\n /**\n * The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,\n * in which case it should be converted to a POST request.\n * Called \"Request-URI Too Long\" previously.\n */\n URI_TOO_LONG = 414,\n\n /**\n * The request entity has a media type which the server or resource does not support.\n * For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.\n */\n UNSUPPORTED_MEDIA_TYPE = 415,\n\n /**\n * The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.\n * For example, if the client asked for a part of the file that lies beyond the end of the file.\n * Called \"Requested Range Not Satisfiable\" previously.\n */\n RANGE_NOT_SATISFIABLE = 416,\n\n /**\n * The server cannot meet the requirements of the Expect request-header field.\n */\n EXPECTATION_FAILED = 417,\n\n /**\n * This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,\n * and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by\n * teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.\n */\n I_AM_A_TEAPOT = 418,\n\n /**\n * The request was directed at a server that is not able to produce a response (for example because a connection reuse).\n */\n MISDIRECTED_REQUEST = 421,\n\n /**\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n UNPROCESSABLE_ENTITY = 422,\n\n /**\n * The resource that is being accessed is locked.\n */\n LOCKED = 423,\n\n /**\n * The request failed due to failure of a previous request (e.g., a PROPPATCH).\n */\n FAILED_DEPENDENCY = 424,\n\n /**\n * The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.\n */\n UPGRADE_REQUIRED = 426,\n\n /**\n * The origin server requires the request to be conditional.\n * Intended to prevent \"the 'lost update' problem, where a client\n * GETs a resource's state, modifies it, and PUTs it back to the server,\n * when meanwhile a third party has modified the state on the server, leading to a conflict.\"\n */\n PRECONDITION_REQUIRED = 428,\n\n /**\n * The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.\n */\n TOO_MANY_REQUESTS = 429,\n\n /**\n * The server is unwilling to process the request because either an individual header field,\n * or all the header fields collectively, are too large.\n */\n REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n\n /**\n * A server operator has received a legal demand to deny access to a resource or to a set of resources\n * that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.\n */\n UNAVAILABLE_FOR_LEGAL_REASONS = 451,\n\n /**\n * A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.\n */\n INTERNAL_SERVER_ERROR = 500,\n\n /**\n * The server either does not recognize the request method, or it lacks the ability to fulfill the request.\n * Usually this implies future availability (e.g., a new feature of a web-service API).\n */\n NOT_IMPLEMENTED = 501,\n\n /**\n * The server was acting as a gateway or proxy and received an invalid response from the upstream server.\n */\n BAD_GATEWAY = 502,\n\n /**\n * The server is currently unavailable (because it is overloaded or down for maintenance).\n * Generally, this is a temporary state.\n */\n SERVICE_UNAVAILABLE = 503,\n\n /**\n * The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.\n */\n GATEWAY_TIMEOUT = 504,\n\n /**\n * The server does not support the HTTP protocol version used in the request\n */\n HTTP_VERSION_NOT_SUPPORTED = 505,\n\n /**\n * Transparent content negotiation for the request results in a circular reference.\n */\n VARIANT_ALSO_NEGOTIATES = 506,\n\n /**\n * The server is unable to store the representation needed to complete the request.\n */\n INSUFFICIENT_STORAGE = 507,\n\n /**\n * The server detected an infinite loop while processing the request.\n */\n LOOP_DETECTED = 508,\n\n /**\n * Further extensions to the request are required for the server to fulfill it.\n */\n NOT_EXTENDED = 510,\n\n /**\n * The client needs to authenticate to gain network access.\n * Intended for use by intercepting proxies used to control access to the network (e.g., \"captive portals\" used\n * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).\n */\n NETWORK_AUTHENTICATION_REQUIRED = 511,\n}\n","export enum ELocale {\n English = \"en\",\n Spanish = \"es\",\n Turkish = \"tr\",\n}\n","export enum EPayLinkStatus {\n Active = 0,\n Paid = 1,\n Expired = 2,\n}\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * API token for machine-to-machine authentication\n */\nexport type ApiToken = Brand<string, \"ApiToken\">;\nexport const ApiToken = make<ApiToken>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a string representation of a big number. These values can be directly converted to a bigint.\n */\nexport type BigNumberString = Brand<string, \"BigNumberString\">;\nexport const BigNumberString = make<BigNumberString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is base64 encoded string\n */\nexport type Base64String = Brand<string, \"Base64String\">;\nexport const Base64String = make<Base64String>();\n","import { Brand, make } from \"ts-brand\";\n\n// This is an amount of USD in decimal format. 1.01 = $1.01 = 1010000 USDC\nexport type DecimalAmount = Brand<number, \"DecimalAmount\">;\nexport const DecimalAmount = make<DecimalAmount>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a 20-byte Ethereum account address, prefixed with \"0x\".\n */\nexport type EVMAccountAddress = Brand<string, \"EVMAccountAddress\">;\nexport const EVMAccountAddress = make<EVMAccountAddress>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a 20-byte Ethereum contract address, prefixed with \"0x\".\n */\nexport type EVMContractAddress = Brand<string, \"EVMContractAddress\">;\nexport const EVMContractAddress = make<EVMContractAddress>();\n","import { Brand, make } from \"ts-brand\";\n\n// HexString is always prefixed with 0x and encoded in hex\nexport type HexString = Brand<string, \"HexString\">;\nexport const HexString = make<HexString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * An ISO 8601 date string, in the format YYYY-MM-DDTHH:MM:SS.SSSZ\n * This is the same format as the ISO 8601 date string returned by the JavaScript Date object.\n */\nexport type ISO8601DateString = Brand<string, \"ISO8601DateString\">;\nexport const ISO8601DateString = make<ISO8601DateString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a JWT, still in Base64 format.\n */\nexport type JsonWebToken = Brand<string, \"JsonWebToken\">;\nexport const JsonWebToken = make<JsonWebToken>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a hex encoded binary data string that contains Solidity Call Data. It is prefixed with a \"0x\".\n */\nexport type JSONString = Brand<string, \"JSONString\">;\nexport const JSONString = make<JSONString>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a Unix timestamp, in milliseconds, the default for javascript. Not seconds, which is the default for Unix\n */\nexport type MillisecondTimestamp = Brand<number, \"MillisecondTimestamp\">;\nexport const MillisecondTimestamp = make<MillisecondTimestamp>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a v7 UUID, like \"123e4567-e89b-12d3-a456-426614174000\"\n */\nexport type PayLinkId = Brand<string, \"PayLinkId\">;\nexport const PayLinkId = make<PayLinkId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a v7 UUID, like \"123e4567-e89b-12d3-a456-426614174000\"\n */\nexport type PayLinkPaymentId = Brand<string, \"PayLinkPaymentId\">;\nexport const PayLinkPaymentId = make<PayLinkPaymentId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * The ID of a transaction from the Relayer API.\n */\nexport type RelayerTransactionId = Brand<string, \"RelayerTransactionId\">;\nexport const RelayerTransactionId = make<RelayerTransactionId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is an EVM ERC-712 signature, hex encoded and prefixed with 0x.\n */\nexport type Signature = Brand<string, \"Signature\">;\nexport const Signature = make<Signature>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * A blockchain transaction hash.\n */\nexport type TransactionHash = Brand<string, \"TransactionHash\">;\nexport const TransactionHash = make<TransactionHash>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a Unix timestamp, in seconds. Not milliseconds, which is the default for JavaScript.\n */\nexport type UnixTimestamp = Brand<number, \"UnixTimestamp\">;\nexport const UnixTimestamp = make<UnixTimestamp>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a complete URL string, including the protocol, domain, and path. It can include a query string.\n */\nexport type URLString = Brand<string, \"URLString\">;\nexport const URLString = make<URLString>();\n","import { Brand, make } from \"ts-brand\";\n\n// This is an amount of USDC, in Wei. USDC has 6 decimals, so USDCAmount(1010000) = 1.01 USDC\nexport type USDCAmount = Brand<number, \"USDCAmount\">;\nexport const USDCAmount = make<USDCAmount>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * This is a v7 UUID, like \"123e4567-e89b-12d3-a456-426614174000\"\n */\nexport type UserId = Brand<string, \"UserId\">;\nexport const UserId = make<UserId>();\n","import { type Brand, make } from \"ts-brand\";\n\n/**\n * A Username string. The DB supports up to 128 characters.\n * It is used to identify a user in the system.\n * It is not case sensitive and must be unique.\n * It is not null.\n * It is not empty.\n * It is not a UUID.\n * It is not a URL.\n * It is not a JSON string.\n */\nexport type Username = Brand<string, \"Username\">;\nexport const Username = make<Username>();\n","import { EHttpStatusCode } from \"types/enum\";\n\n// Generic base error class for creating branded error types\nexport abstract class BaseError extends Error {\n abstract readonly errorCode: string;\n abstract readonly errorType: string;\n abstract readonly httpStatus: EHttpStatusCode;\n\n constructor(src: Error, errorType: string) {\n super(src.message);\n this.name = errorType;\n this.stack = src.stack;\n\n // Preserve the prototype chain\n Object.setPrototypeOf(this, this.constructor.prototype);\n }\n\n // Helper method to get error details\n getErrorDetails() {\n return {\n name: this.name,\n message: this.message,\n errorCode: this.errorCode,\n errorType: this.errorType,\n stack: this.stack,\n };\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\n// Branded error types to ensure they're distinguishable\nexport class AjaxError extends BaseError {\n readonly errorCode = \"ERR_AJAX\" as const;\n readonly errorType = \"AjaxError\";\n readonly httpStatus = EHttpStatusCode.INTERNAL_SERVER_ERROR;\n\n constructor(src: Error) {\n super(src, \"AjaxError\");\n }\n\n // Static factory method\n static fromError(src: Error): AjaxError {\n return new AjaxError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is AjaxError {\n return error instanceof AjaxError;\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\n// Branded error types to ensure they're distinguishable\nexport class ProxyError extends BaseError {\n readonly errorCode = \"ERR_PROXY\" as const;\n readonly errorType = \"ProxyError\";\n readonly httpStatus = EHttpStatusCode.INTERNAL_SERVER_ERROR;\n\n constructor(src: Error) {\n super(src, \"ProxyError\");\n }\n\n // Static factory method\n static fromError(src: Error): ProxyError {\n return new ProxyError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is ProxyError {\n return error instanceof ProxyError;\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\n// RetryError is used with backoffAndRetry(), when all you want to do is retry the operation but need an error\n// to signal that whatever you are doing is not complete.\nexport class RetryError extends BaseError {\n readonly errorCode = \"ERR_RETRY\" as const;\n readonly errorType = \"REtryError\";\n readonly httpStatus = EHttpStatusCode.I_AM_A_TEAPOT;\n\n constructor(src: Error) {\n super(src, \"RetryError\");\n }\n\n // Static factory method\n static fromError(src: Error): RetryError {\n return new RetryError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is RetryError {\n return error instanceof RetryError;\n }\n}\n","import { EHttpStatusCode } from \"types/enum\";\nimport { BaseError } from \"types/errors/BaseError\";\n\nexport class ValidationError extends BaseError {\n readonly errorCode = \"ERR_VALIDATION\" as const;\n readonly errorType = \"ValidationError\";\n readonly httpStatus = EHttpStatusCode.BAD_REQUEST;\n\n constructor(src: Error) {\n super(src, \"ValidationError\");\n }\n\n // Static factory method\n static fromError(src: Error): ValidationError {\n return new ValidationError(src);\n }\n\n // Static type guard method\n static isError(error: unknown): error is ValidationError {\n return error instanceof ValidationError;\n }\n}\n","import { JsonWebToken } from \"../primitives\";\n\nexport class OAuthTokenModel {\n public constructor(\n public readonly access_token: JsonWebToken,\n public readonly token_type: \"Bearer\",\n public readonly expires_in: number,\n ) {}\n}\n","import { ResultAsync } from \"neverthrow\";\n\nimport type {\n IAjaxRequestConfig,\n IAjaxRequestBody,\n IAjaxUtils,\n} from \"./IAjaxUtils\";\n\nimport { AjaxError } from \"types/errors\";\nimport type { JsonWebToken } from \"types/primitives\";\n\nfunction isJsonBody(\n data: IAjaxRequestBody,\n): data is Record<string, unknown> | Array<Record<string, unknown>> {\n return (\n typeof data === \"object\" &&\n data !== null &&\n !(data instanceof ArrayBuffer) &&\n !(data instanceof Blob) &&\n !(data instanceof FormData) &&\n !(data instanceof URLSearchParams) &&\n !ArrayBuffer.isView(data) &&\n typeof (data as ReadableStream).getReader !== \"function\"\n );\n}\n\nfunction bodyToRequestInit(\n data: IAjaxRequestBody | undefined,\n): Pick<RequestInit, \"body\" | \"headers\"> {\n if (data === undefined || data === null) {\n return {};\n }\n if (isJsonBody(data)) {\n return {\n body: JSON.stringify(data),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n }\n return { body: data as BodyInit };\n}\n\n/**\n * Fetch-based implementation of IAjaxUtils.\n * Uses the global fetch (browser or Node 18+).\n */\nexport class AjaxUtils implements IAjaxUtils {\n private defaultToken: string = \"\";\n\n public setDefaultToken(token: JsonWebToken): void {\n this.defaultToken = token as string;\n }\n\n public get<T>(\n url: URL | string,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n return this.doFetch<T>(url, this.mergeConfig(config, { method: \"GET\" }));\n }\n\n public post<T>(\n url: URL | string,\n data?: IAjaxRequestBody,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n const { body, headers } = bodyToRequestInit(data);\n const init: RequestInit = { method: \"POST\" };\n if (body !== undefined) init.body = body;\n if (headers !== undefined) init.headers = headers;\n return this.doFetch<T>(url, this.mergeConfig(config, init));\n }\n\n public put<T>(\n url: URL | string,\n data: IAjaxRequestBody,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n const { body, headers } = bodyToRequestInit(data);\n return this.doFetch<T>(\n url,\n this.mergeConfig(config, { method: \"PUT\", body, headers }),\n );\n }\n\n public delete<T>(\n url: URL | string,\n config?: IAjaxRequestConfig,\n ): ResultAsync<T, AjaxError> {\n return this.doFetch<T>(url, this.mergeConfig(config, { method: \"DELETE\" }));\n }\n\n private mergeConfig(\n config: IAjaxRequestConfig | undefined,\n init: RequestInit,\n ): RequestInit {\n const headers = new Headers(init.headers);\n if (config?.headers) {\n const c = new Headers(config.headers);\n c.forEach((v, k) => headers.set(k, v));\n }\n if (this.defaultToken) {\n headers.set(\"Authorization\", `Bearer ${this.defaultToken}`);\n }\n return {\n ...config,\n ...init,\n headers,\n };\n }\n\n private doFetch<T>(\n url: URL | string,\n init: RequestInit,\n ): ResultAsync<T, AjaxError> {\n return ResultAsync.fromPromise(\n (async (): Promise<T> => {\n const res = await fetch(url, init);\n if (!res.ok) {\n const text = await res.text();\n throw new Error(\n `HTTP ${res.status} ${res.statusText}${text ? `: ${text}` : \"\"}`,\n );\n }\n const contentType = res.headers.get(\"content-type\") ?? \"\";\n if (contentType.toLowerCase().includes(\"application/json\")) {\n return (await res.json()) as T;\n }\n return (await res.text()) as T;\n })(),\n (e) => AjaxError.fromError(e as Error),\n );\n }\n}\n","import {\n ISO8601DateString,\n MillisecondTimestamp,\n UnixTimestamp,\n} from \"types/primitives\";\n\nexport interface ITimeUtils {\n getUnixNow(): UnixTimestamp;\n getMillisecondNow(): MillisecondTimestamp;\n getISO8601TimeString(time: MillisecondTimestamp): ISO8601DateString;\n convertTimestampToISOString(unixTimestamp: UnixTimestamp): ISO8601DateString;\n convertISOStringToTimestamp(isoString: ISO8601DateString): UnixTimestamp;\n getUnixTodayStart(): UnixTimestamp;\n getUnixTodayEnd(): UnixTimestamp;\n getStartOfMonth(): UnixTimestamp;\n}\n\nexport const ITimeUtilsType = Symbol.for(\"ITimeUtils\");\n","import { okAsync, ResultAsync } from \"neverthrow\";\nimport stringify from \"safe-stable-stringify\";\n\nimport { ValidationError } from \"types/errors\";\nimport { JSONString } from \"types/primitives\";\n\nexport class ObjectUtils {\n // Taken from https://stackoverflow.com/questions/27936772/how-to-deep-merge-instead-of-shallow-merge\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static mergeDeep<T = unknown>(...objects: any[]): T {\n const isObject = (obj: unknown) => obj && typeof obj === \"object\";\n\n return objects.reduce((prev, obj) => {\n Object.keys(obj).forEach((key) => {\n const pVal = prev[key];\n const oVal = obj[key];\n\n if (Array.isArray(pVal) && Array.isArray(oVal)) {\n prev[key] = pVal.concat(...oVal);\n } else if (isObject(pVal) && isObject(oVal)) {\n prev[key] = ObjectUtils.mergeDeep(pVal, oVal);\n } else {\n prev[key] = oVal;\n }\n });\n\n return prev;\n }, {});\n }\n\n /**\n * This method is an improvement on JSON.stringify. It uses a stable stringify method so that objects will always generate the same\n * hash, and it support a few non-serializeable types that are useful, such as BigInt, Map, and Set. The output is correct JSON\n * but uses markup to support the non-native types and must be deserialized with the deserialize() method to get the same object\n * back.\n * @param obj\n * @returns\n */\n static serialize(obj: unknown): JSONString {\n return JSONString(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stringify(obj, (_key: any, value: any) => {\n if (value instanceof Error) {\n return {\n dataType: \"Error\",\n value: {\n name: value.name || \"Error\",\n message: value.message || \"Unknown error\",\n stack: value.stack || undefined,\n },\n };\n } else if (value instanceof Map) {\n return {\n dataType: \"Map\",\n value: Array.from(value.entries()), // or with spread: value: [...value]\n };\n } else if (value instanceof Set) {\n return {\n dataType: \"Set\",\n value: [...value],\n };\n } else if (value instanceof BigInt) {\n return {\n dataType: \"BigInt\",\n value: value.toString(),\n };\n } else if (typeof value == \"bigint\") {\n return {\n dataType: \"bigint\",\n value: BigInt(value).toString(),\n };\n } else {\n return value;\n }\n }) as string,\n );\n }\n\n static deserialize<T = Record<string, unknown>>(\n json: JSONString,\n ): ResultAsync<T, ValidationError> {\n return ResultAsync.fromPromise(Promise.resolve(JSON.parse(json)), (e) =>\n ValidationError.fromError(e as Error),\n ).andThen((parsed) => {\n // Handle special data types\n const processValue = (value: unknown): unknown => {\n if (\n typeof value === \"object\" &&\n value !== null &&\n \"dataType\" in value &&\n \"value\" in value\n ) {\n const dataType = (value as { dataType: string }).dataType;\n const dataValue = (value as { value: unknown }).value;\n\n if (dataType === \"Error\") {\n const errorData = dataValue as {\n name?: string;\n message?: string;\n stack?: string;\n };\n const error = new Error(errorData.message || \"Unknown error\");\n error.name = errorData.name || \"Error\";\n if (errorData.stack) {\n error.stack = errorData.stack;\n }\n return error;\n } else if (dataType === \"Map\") {\n return new Map(dataValue as [unknown, unknown][]);\n } else if (dataType === \"Set\") {\n return new Set(dataValue as unknown[]);\n } else if (dataType === \"BigInt\" || dataType === \"bigint\") {\n return BigInt(dataValue as string);\n }\n }\n\n if (Array.isArray(value)) {\n return value.map(processValue);\n } else if (value && typeof value === \"object\") {\n const processed: Record<string, unknown> = {};\n for (const [key, val] of Object.entries(value)) {\n processed[key] = processValue(val);\n }\n return processed;\n }\n\n return value;\n };\n\n const processed = processValue(parsed);\n return okAsync(processed as T);\n });\n }\n\n static deserializeUnsafe<T = Record<string, unknown>>(json: JSONString): T {\n return JSON.parse(json, (_key, value) => {\n if (typeof value === \"object\" && value !== null) {\n if (value.dataType === \"Error\") {\n const errorData = value.value as {\n name?: string;\n message?: string;\n stack?: string;\n };\n const error = new Error(errorData.message || \"Unknown error\");\n error.name = errorData.name || \"Error\";\n if (errorData.stack) {\n error.stack = errorData.stack;\n }\n return error;\n } else if (value.dataType === \"Map\") {\n return new Map(value.value);\n } else if (value.dataType === \"Set\") {\n return new Set(value.value);\n } else if (value.dataType === \"BigInt\") {\n return BigInt(value.value);\n } else if (value.dataType === \"bigint\") {\n return BigInt(value.value);\n }\n }\n return value;\n });\n }\n\n /**\n * This object will convert an object with a Prototype into a generic object. This can be done by nulling the prototype but that's not\n * really possible in Typescript, so we we do it differently by cloning the object. This means this is also one way of doing a deep\n * copy of an object, but it will fail and instanceof() check.\n * @param obj\n * @returns\n */\n static toGenericObject<T = Record<string, unknown>>(\n obj: unknown,\n ): ResultAsync<T, ValidationError> {\n return ObjectUtils.deserialize(ObjectUtils.serialize(obj));\n }\n\n static removeNullValues<T>(array: (T | null | undefined)[]): T[] {\n function notEmpty<T>(value: T | null | undefined): value is T {\n if (value === null || value === undefined) return false;\n // const _testConversion: T = value;\n return true;\n }\n return array.filter(notEmpty);\n }\n\n static getEnumKeyByValue<T extends Record<string, string | number>>(\n enumObj: T,\n value: number,\n ): string {\n return (\n Object.keys(enumObj).find((key) => enumObj[key] === value) || \"Undefined\"\n );\n }\n\n static getEnumKeyByValueSafely<T extends Record<string, string | number>>(\n enumObj: T,\n value: number,\n ): string {\n // Filter out numeric keys like \"0\", \"1\"\n const stringKeys = Object.keys(enumObj).filter((key) => isNaN(Number(key)));\n for (const key of stringKeys) {\n if (enumObj[key] === value) {\n return key;\n }\n }\n return \"Undefined\";\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public static convertBigIntsToStrings<T>(input: T): any {\n if (typeof input === \"bigint\") {\n return input.toString();\n }\n\n if (Array.isArray(input)) {\n return input.map((i) => {\n return this.convertBigIntsToStrings(i);\n });\n }\n\n if (input && typeof input === \"object\") {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(input)) {\n result[key] = this.convertBigIntsToStrings(value);\n }\n return result;\n }\n\n return input;\n }\n}\n","import cjsModule from '../index.js'\n\nexport const configure = cjsModule.configure\n\nexport const stringify = cjsModule\nexport default cjsModule\n","import { injectable } from \"inversify\";\n\nimport type { ITimeUtils } from \"./ITimeUtils\";\n\nimport {\n ISO8601DateString,\n MillisecondTimestamp,\n UnixTimestamp,\n} from \"types/primitives\";\n\n@injectable()\nexport class TimeUtils implements ITimeUtils {\n protected lastBlockchainCheck: UnixTimestamp | undefined;\n protected lastBlockchainTimestamp: UnixTimestamp | undefined;\n constructor() {}\n\n public getUnixNow(): UnixTimestamp {\n return UnixTimestamp(Math.floor(Date.now() / 1000));\n }\n\n public getMillisecondNow(): MillisecondTimestamp {\n return MillisecondTimestamp(Date.now());\n }\n\n public getISO8601TimeString(\n time = MillisecondTimestamp(Date.now()),\n ): ISO8601DateString {\n return ISO8601DateString(new Date(time).toISOString());\n }\n\n public convertTimestampToISOString(\n unixTimestamp: UnixTimestamp,\n ): ISO8601DateString {\n const date = new Date(unixTimestamp * 1000);\n return ISO8601DateString(date.toISOString());\n }\n\n public convertISOStringToTimestamp(\n isoString: ISO8601DateString,\n ): UnixTimestamp {\n const date = new Date(isoString);\n return UnixTimestamp(Math.floor(date.getTime() / 1000));\n }\n\n public getUnixTodayStart(): UnixTimestamp {\n const date = new Date();\n date.setHours(0, 0, 0, 0);\n return UnixTimestamp(Math.floor(date.getTime() / 1000));\n }\n public getUnixTodayEnd(): UnixTimestamp {\n const date = new Date();\n date.setHours(23, 59, 59, 999);\n return UnixTimestamp(Math.floor(date.getTime() / 1000));\n }\n\n public getStartOfMonth(): UnixTimestamp {\n const startOfMonth = new Date(\n new Date().getFullYear(),\n new Date().getMonth(),\n 1,\n ).getTime();\n return UnixTimestamp(Math.floor(startOfMonth / 1000));\n }\n}\n","import { IERC3009TransferWithAuthorization } from \"types/domain\";\nimport {\n Base64String,\n BigNumberString,\n EVMAccountAddress,\n EVMContractAddress,\n Signature,\n URLString,\n} from \"types/primitives\";\n\nexport type X402PaymentRequirements = {\n // x402 v2 uses x402Version, older drafts may use version-like fields\n x402Version?: number;\n version?: number;\n resource?: {\n url?: URLString;\n description?: string;\n mimeType?: string;\n };\n // Common shapes observed across drafts:\n accepted?: unknown; // object | array\n paymentRequirements?: unknown; // array\n};\n\nexport type X402AcceptedPayment = {\n scheme?: string;\n network?: string;\n amount?: BigNumberString;\n asset?: EVMContractAddress;\n payTo?: EVMAccountAddress;\n maxTimeoutSeconds?: number;\n extra?: Record<string, unknown>;\n};\n\nexport type X402PaymentPayloadV2ExactEvm = {\n x402Version: number;\n resource: {\n url: string;\n description?: string;\n mimeType?: string;\n };\n accepted: {\n scheme: \"exact\";\n network: string;\n amount: BigNumberString;\n asset: EVMContractAddress;\n payTo: EVMAccountAddress;\n maxTimeoutSeconds?: number;\n extra?: Record<string, unknown>;\n };\n payload: {\n signature: Signature;\n authorization: IERC3009TransferWithAuthorization;\n };\n};\n\nexport function x402ResolveRequestUrl(input: RequestInfo | URL): string {\n if (typeof input === \"string\") return input;\n if (input instanceof URL) return input.toString();\n // Request\n return input.url;\n}\n\nexport function x402Base64EncodeUtf8(input: string): Base64String {\n // Browser path\n if (typeof btoa === \"function\") {\n return Base64String(btoa(unescape(encodeURIComponent(input))));\n }\n // Node path (best-effort)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const B = (globalThis as any).Buffer;\n if (B) {\n return Base64String(B.from(input, \"utf8\").toString(\"base64\"));\n }\n throw new Error(\"No base64 encoder available in this environment.\");\n}\n\nexport function x402Base64DecodeUtf8(input: Base64String): string {\n // Browser path\n if (typeof atob === \"function\") {\n return decodeURIComponent(escape(atob(input)));\n }\n // Node path (best-effort)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const B = (globalThis as any).Buffer;\n if (B) {\n return B.from(input, \"base64\").toString(\"utf8\");\n }\n throw new Error(\"No base64 decoder available in this environment.\");\n}\n\nexport function x402ParseJsonOrBase64Json(raw: string): unknown {\n const trimmed = raw.trim();\n // Try JSON first\n if (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) {\n return JSON.parse(trimmed);\n }\n // Then try base64(JSON)\n try {\n const decoded = x402Base64DecodeUtf8(Base64String(trimmed));\n return JSON.parse(decoded);\n } catch {\n // As a last attempt, sometimes headers are quoted strings\n const unquoted = trimmed.replace(/^\"+|\"+$/g, \"\");\n if (unquoted.startsWith(\"{\") || unquoted.startsWith(\"[\")) {\n return JSON.parse(unquoted);\n }\n const decoded = x402Base64DecodeUtf8(Base64String(unquoted));\n return JSON.parse(decoded);\n }\n}\n\nexport function x402NormalizeAcceptedPayments(\n req: X402PaymentRequirements,\n): X402AcceptedPayment[] {\n const candidates: unknown[] = [];\n if (req.accepted != null) {\n if (Array.isArray(req.accepted)) candidates.push(...req.accepted);\n else candidates.push(req.accepted);\n }\n if (req.paymentRequirements != null) {\n if (Array.isArray(req.paymentRequirements))\n candidates.push(...req.paymentRequirements);\n }\n // Common alternative key (e.g. body uses \"accepts\" instead of \"accepted\")\n const accepts = (req as Record<string, unknown>).accepts;\n if (accepts != null) {\n if (Array.isArray(accepts)) candidates.push(...accepts);\n else candidates.push(accepts);\n }\n // Best-effort coercion: support maxAmountRequired -> amount\n return candidates.filter(Boolean).map((c) => {\n const item = c as Record<string, unknown>;\n if (\n item &&\n typeof item === \"object\" &&\n item.maxAmountRequired != null &&\n item.amount == null\n ) {\n item.amount = item.maxAmountRequired;\n }\n return item as X402AcceptedPayment;\n });\n}\n\nexport function x402GetChainIdFromNetwork(network: string): number | null {\n const normalized = (network ?? \"\").trim().toLowerCase();\n if (normalized === \"base\" || normalized === \"base-mainnet\") return 8453;\n // Expected: eip155:<chainId>\n const m = /^eip155:(\\d+)$/.exec(network);\n if (!m) return null;\n const n = Number(m[1]);\n return Number.isFinite(n) ? n : null;\n}\n\nexport function x402IsUsdcOnBase(\n chainId: number,\n asset: EVMContractAddress,\n): boolean {\n const a = asset.toLowerCase();\n // Base mainnet USDC\n if (chainId === 8453 && a === \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\")\n return true;\n return false;\n}\n","/**\n * @1shotapi/1shotpay-common\n *\n * Shared types and utilities for 1ShotPay client and server SDKs.\n */\n\nimport { ResultAsync } from \"neverthrow\";\n\nexport * from \"./types/enum\";\nexport * from \"./types/primitives\";\nexport * from \"./types/domain\";\nexport * from \"./types/errors\";\nexport * from \"./types/models\";\nexport * from \"./utils/IAjaxUtils\";\nexport * from \"./utils/AjaxUtils\";\nexport * from \"./utils/ITimeUtils\";\nexport * from \"./utils/ObjectUtils\";\nexport * from \"./utils/TimeUtils\";\nexport * from \"./utils/x402Utils\";\n\n/**\n * A simple helper function to convert a ResultAsync to a promise if you prefer to use async/await syntax.\n * @param resultAsync A ResultAsync\n * @returns A promise that resolves with the value of the ResultAsync if it is ok, or rejects with the error\n */\nexport async function resultAsyncToPromise<T>(\n resultAsync: ResultAsync<T, Error>,\n): Promise<T> {\n const result = await resultAsync;\n if (result.isErr()) {\n throw result.error;\n }\n return result.value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAM,EAAE,eAAe,IAAI,OAAO;AAElC,QAAM,YAAYA,WAAU;AAG5B,cAAU,YAAYA;AAEtB,cAAU,YAAY;AAGtB,cAAU,UAAU;AAGpB,YAAQ,YAAY;AAEpB,YAAQ,YAAYA;AAEpB,WAAO,UAAU;AAGjB,QAAM,2BAA2B;AAIjC,aAAS,UAAW,KAAK;AAEvB,UAAI,IAAI,SAAS,OAAQ,CAAC,yBAAyB,KAAK,GAAG,GAAG;AAC5D,eAAO,IAAI,GAAG;AAAA,MAChB;AACA,aAAO,KAAK,UAAU,GAAG;AAAA,IAC3B;AAEA,aAAS,KAAM,OAAO,YAAY;AAGhC,UAAI,MAAM,SAAS,OAAO,YAAY;AACpC,eAAO,MAAM,KAAK,UAAU;AAAA,MAC9B;AACA,eAAS,IAAI,GAAG,I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,MAAM;AACnC,QAAI,MAAM,QAAQ,IAAI,mBAAmB;AACvC,iBAAW,KAAK,GAAG,IAAI,mBAAmB;AAAA,EAC9C;AAEA,QAAM,UAAW,IAAgC;AACjD,MAAI,WAAW,MAAM;AACnB,QAAI,MAAM,QAAQ,OAAO,EAAG,YAAW,KAAK,GAAG,OAAO;AAAA,QACjD,YAAW,KAAK,OAAO;AAAA,EAC9B;AAEA,SAAO,WAAW,OAAO,OAAO,EAAE,IAAI,CAAC,MAAM;AAC3C,UAAM,OAAO;AACb,QACE,QACA,OAAO,SAAS,YAChB,KAAK,qBAAqB,QAC1B,KAAK,UAAU,MACf;AACA,WAAK,SAAS,KAAK;AAAA,IACrB;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAEO,SAAS,0BAA0B,SAAgC;AACxE,QAAM,cAAc,WAAW,IAAI,KAAK,EAAE,YAAY;AACtD,MAAI,eAAe,UAAU,eAAe,eAAgB,QAAO;AAEnE,QAAM,IAAI,iBAAiB,KAAK,OAAO;AACvC,MAAI,CAAC,EAAG,QAAO;AACf,QAAM,IAAI,OAAO,EAAE,CAAC,CAAC;AACrB,SAAO,OAAO,SAAS,CAAC,IAAI,IAAI;AAClC;AAEO,SAAS,iBACd,SACA,OACS;AACT,QAAM,IAAI,MAAM,YAAY;AAE5B,MAAI,YAAY,QAAQ,MAAM;AAC5B,WAAO;AACT,SAAO;AACT;;;AC3IA,eAAsB,qBACpB,aACY;AACZ,QAAM,SAAS,MAAM;AACrB,MAAI,OAAO,MAAM,GAAG;AAClB,UAAM,OAAO;AAAA,EACf;AACA,SAAO,OAAO;AAChB;","names":["configure","value","tmp","key","res","join","stringify","EHttpStatusCode","ELocale","EPayLinkStatus","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","make","ResultAsync","cjsModule","cjsModule","ResultAsync","processed"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1shotapi/1shotpay-common",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Shared types and utilities for 1ShotPay client and server SDKs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -43,11 +43,9 @@
|
|
|
43
43
|
"typescript": "^5.3.3"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
+
"inversify": "^7.11.0",
|
|
46
47
|
"neverthrow": "^8.2.0",
|
|
47
48
|
"reflect-metadata": "^0.2.2",
|
|
48
49
|
"ts-brand": "^0.2.0"
|
|
49
|
-
},
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"inversify": "^7.11.0"
|
|
52
50
|
}
|
|
53
51
|
}
|