FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

15
node_modules/ox/_cjs/core/Abi.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.format = format;
exports.from = from;
const abitype = require("abitype");
const internal = require("./internal/abi.js");
function format(abi) {
return abitype.formatAbi(abi);
}
function from(abi) {
if (internal.isSignatures(abi))
return abitype.parseAbi(abi);
return abi;
}
//# sourceMappingURL=Abi.js.map

1
node_modules/ox/_cjs/core/Abi.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Abi.js","sourceRoot":"","sources":["../../core/Abi.ts"],"names":[],"mappings":";;AA8CA,wBAEC;AA+FD,oBAGC;AAlJD,mCAAkC;AAElC,8CAA6C;AA4C7C,SAAgB,MAAM,CAAC,GAA6B;IAClD,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAU,CAAA;AACxC,CAAC;AA+FD,SAAgB,IAAI,CAAC,GAA4B;IAC/C,IAAI,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAC5D,OAAO,GAAG,CAAA;AACZ,CAAC"}

37
node_modules/ox/_cjs/core/AbiConstructor.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decode = decode;
exports.encode = encode;
exports.format = format;
exports.from = from;
exports.fromAbi = fromAbi;
const abitype = require("abitype");
const AbiItem = require("./AbiItem.js");
const AbiParameters = require("./AbiParameters.js");
const Hex = require("./Hex.js");
function decode(abiConstructor, options) {
const { bytecode } = options;
if (abiConstructor.inputs.length === 0)
return undefined;
const data = options.data.replace(bytecode, '0x');
return AbiParameters.decode(abiConstructor.inputs, data);
}
function encode(abiConstructor, options) {
const { bytecode, args } = options;
return Hex.concat(bytecode, abiConstructor.inputs?.length && args?.length
? AbiParameters.encode(abiConstructor.inputs, args)
: '0x');
}
function format(abiConstructor) {
return abitype.formatAbiItem(abiConstructor);
}
function from(abiConstructor) {
return AbiItem.from(abiConstructor);
}
function fromAbi(abi) {
const item = abi.find((item) => item.type === 'constructor');
if (!item)
throw new AbiItem.NotFoundError({ name: 'constructor' });
return item;
}
//# sourceMappingURL=AbiConstructor.js.map

1
node_modules/ox/_cjs/core/AbiConstructor.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AbiConstructor.js","sourceRoot":"","sources":["../../core/AbiConstructor.ts"],"names":[],"mappings":";;AAgDA,wBAQC;AA0ED,wBAWC;AA4DD,wBAEC;AA2HD,oBAIC;AAiDD,0BAIC;AA/XD,mCAAkC;AAElC,wCAAuC;AACvC,oDAAmD;AAEnD,gCAA+B;AA2C/B,SAAgB,MAAM,CACpB,cAA8B,EAC9B,OAAuB;IAEvB,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;IAC5B,IAAI,cAAc,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAY,CAAA;IAC5D,OAAO,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAC1D,CAAC;AA0ED,SAAgB,MAAM,CACpB,cAA8B,EAC9B,OAAuC;IAEvC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IAClC,OAAO,GAAG,CAAC,MAAM,CACf,QAAQ,EACR,cAAc,CAAC,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM;QAC3C,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAA0B,CAAC;QACzE,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC;AA4DD,SAAgB,MAAM,CAAC,cAA8B;IACnD,OAAO,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;AAC9C,CAAC;AA2HD,SAAgB,IAAI,CAClB,cAA2D;IAE3D,OAAO,OAAO,CAAC,IAAI,CAAC,cAAgC,CAAC,CAAA;AACvD,CAAC;AAiDD,SAAgB,OAAO,CAAC,GAAiC;IACvD,MAAM,IAAI,GAAI,GAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAA;IACzE,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAA;IACnE,OAAO,IAAI,CAAA;AACb,CAAC"}

93
node_modules/ox/_cjs/core/AbiError.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.solidityPanicSelector = exports.solidityPanic = exports.solidityErrorSelector = exports.solidityError = exports.panicReasons = void 0;
exports.decode = decode;
exports.encode = encode;
exports.format = format;
exports.from = from;
exports.fromAbi = fromAbi;
exports.getSelector = getSelector;
const abitype = require("abitype");
const AbiItem = require("./AbiItem.js");
const AbiParameters = require("./AbiParameters.js");
const Hex = require("./Hex.js");
function decode(abiError, data, options = {}) {
if (Hex.size(data) < 4)
throw new AbiItem.InvalidSelectorSizeError({ data });
if (abiError.inputs.length === 0)
return undefined;
const values = AbiParameters.decode(abiError.inputs, Hex.slice(data, 4), options);
if (values && Object.keys(values).length === 1) {
if (Array.isArray(values))
return values[0];
return Object.values(values)[0];
}
return values;
}
function encode(abiError, ...args) {
const selector = getSelector(abiError);
const data = args.length > 0
? AbiParameters.encode(abiError.inputs, args[0])
: undefined;
return data ? Hex.concat(selector, data) : selector;
}
function format(abiError) {
return abitype.formatAbiItem(abiError);
}
function from(abiError, options = {}) {
return AbiItem.from(abiError, options);
}
function fromAbi(abi, name, options) {
if (name === 'Error')
return exports.solidityError;
if (name === 'Panic')
return exports.solidityPanic;
if (Hex.validate(name, { strict: false })) {
const selector = Hex.slice(name, 0, 4);
if (selector === exports.solidityErrorSelector)
return exports.solidityError;
if (selector === exports.solidityPanicSelector)
return exports.solidityPanic;
}
const item = AbiItem.fromAbi(abi, name, options);
if (item.type !== 'error')
throw new AbiItem.NotFoundError({ name, type: 'error' });
return item;
}
function getSelector(abiItem) {
return AbiItem.getSelector(abiItem);
}
exports.panicReasons = {
1: 'An `assert` condition failed.',
17: 'Arithmetic operation resulted in underflow or overflow.',
18: 'Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).',
33: 'Attempted to convert to an invalid type.',
34: 'Attempted to access a storage byte array that is incorrectly encoded.',
49: 'Performed `.pop()` on an empty array',
50: 'Array index is out of bounds.',
65: 'Allocated too much memory or created an array which is too large.',
81: 'Attempted to call a zero-initialized variable of internal function type.',
};
exports.solidityError = from({
inputs: [
{
name: 'message',
type: 'string',
},
],
name: 'Error',
type: 'error',
});
exports.solidityErrorSelector = '0x08c379a0';
exports.solidityPanic = from({
inputs: [
{
name: 'reason',
type: 'uint8',
},
],
name: 'Panic',
type: 'error',
});
exports.solidityPanicSelector = '0x4e487b71';
//# sourceMappingURL=AbiError.js.map

1
node_modules/ox/_cjs/core/AbiError.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AbiError.js","sourceRoot":"","sources":["../../core/AbiError.ts"],"names":[],"mappings":";;;AAmJA,wBAkBC;AA4FD,wBAYC;AAkDD,wBAIC;AAkGD,oBAcC;AAmFD,0BA8BC;AAqDD,kCAEC;AA3lBD,mCAAkC;AAElC,wCAAuC;AACvC,oDAAmD;AAEnD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AA+B;IACnC,EAAE,EAAE,mEAAmE;IACvE,EAAE,EAAE,0EAA0E;CACrD,CAAA;AAEd,QAAA,aAAa,GAAiB,IAAI,CAAC;IAC9C,MAAM,EAAE;QACN;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;SACf;KACF;IACD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;CACd,CAAC,CAAA;AAEW,QAAA,qBAAqB,GAAG,YAAY,CAAA;AAEpC,QAAA,aAAa,GAAiB,IAAI,CAAC;IAC9C,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;SACd;KACF;IACD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;CACd,CAAC,CAAA;AAEW,QAAA,qBAAqB,GAAG,YAAY,CAAA"}

333
node_modules/ox/_cjs/core/AbiEvent.js generated vendored Normal file
View File

@@ -0,0 +1,333 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FilterTypeNotSupportedError = exports.SelectorTopicMismatchError = exports.TopicsMismatchError = exports.DataMismatchError = exports.InputNotFoundError = exports.ArgsMismatchError = void 0;
exports.assertArgs = assertArgs;
exports.decode = decode;
exports.encode = encode;
exports.format = format;
exports.from = from;
exports.fromAbi = fromAbi;
exports.getSelector = getSelector;
const abitype = require("abitype");
const AbiItem = require("./AbiItem.js");
const AbiParameters = require("./AbiParameters.js");
const Address = require("./Address.js");
const Bytes = require("./Bytes.js");
const Errors = require("./Errors.js");
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
const Cursor = require("./internal/cursor.js");
const errors_js_1 = require("./internal/errors.js");
function assertArgs(abiEvent, args, matchArgs) {
if (!args || !matchArgs)
throw new ArgsMismatchError({
abiEvent,
expected: args,
given: matchArgs,
});
function isEqual(input, value, arg) {
if (input.type === 'address')
return Address.isEqual(value, arg);
if (input.type === 'string')
return Hash.keccak256(Bytes.fromString(value)) === arg;
if (input.type === 'bytes')
return Hash.keccak256(value) === arg;
return value === arg;
}
if (Array.isArray(args) && Array.isArray(matchArgs)) {
for (const [index, value] of matchArgs.entries()) {
if (value === null || value === undefined)
continue;
const input = abiEvent.inputs[index];
if (!input)
throw new InputNotFoundError({
abiEvent,
name: `${index}`,
});
const value_ = Array.isArray(value) ? value : [value];
let equal = false;
for (const value of value_) {
if (isEqual(input, value, args[index]))
equal = true;
}
if (!equal)
throw new ArgsMismatchError({
abiEvent,
expected: args,
given: matchArgs,
});
}
}
if (typeof args === 'object' &&
!Array.isArray(args) &&
typeof matchArgs === 'object' &&
!Array.isArray(matchArgs))
for (const [key, value] of Object.entries(matchArgs)) {
if (value === null || value === undefined)
continue;
const input = abiEvent.inputs.find((input) => input.name === key);
if (!input)
throw new InputNotFoundError({ abiEvent, name: key });
const value_ = Array.isArray(value) ? value : [value];
let equal = false;
for (const value of value_) {
if (isEqual(input, value, args[key]))
equal = true;
}
if (!equal)
throw new ArgsMismatchError({
abiEvent,
expected: args,
given: matchArgs,
});
}
}
function decode(abiEvent, log) {
const { data, topics } = log;
const [selector_, ...argTopics] = topics;
const selector = getSelector(abiEvent);
if (selector_ !== selector)
throw new SelectorTopicMismatchError({
abiEvent,
actual: selector_,
expected: selector,
});
const { inputs } = abiEvent;
const isUnnamed = inputs?.every((x) => !('name' in x && x.name));
let args = isUnnamed ? [] : {};
const indexedInputs = inputs.filter((x) => 'indexed' in x && x.indexed);
for (let i = 0; i < indexedInputs.length; i++) {
const param = indexedInputs[i];
const topic = argTopics[i];
if (!topic)
throw new TopicsMismatchError({
abiEvent,
param: param,
});
args[isUnnamed ? i : param.name || i] = (() => {
if (param.type === 'string' ||
param.type === 'bytes' ||
param.type === 'tuple' ||
param.type.match(/^(.*)\[(\d+)?\]$/))
return topic;
const decoded = AbiParameters.decode([param], topic) || [];
return decoded[0];
})();
}
const nonIndexedInputs = inputs.filter((x) => !('indexed' in x && x.indexed));
if (nonIndexedInputs.length > 0) {
if (data && data !== '0x') {
try {
const decodedData = AbiParameters.decode(nonIndexedInputs, data);
if (decodedData) {
if (isUnnamed)
args = [...args, ...decodedData];
else {
for (let i = 0; i < nonIndexedInputs.length; i++) {
const index = inputs.indexOf(nonIndexedInputs[i]);
args[nonIndexedInputs[i].name || index] = decodedData[i];
}
}
}
}
catch (err) {
if (err instanceof AbiParameters.DataSizeTooSmallError ||
err instanceof Cursor.PositionOutOfBoundsError)
throw new DataMismatchError({
abiEvent,
data: data,
parameters: nonIndexedInputs,
size: Hex.size(data),
});
throw err;
}
}
else {
throw new DataMismatchError({
abiEvent,
data: '0x',
parameters: nonIndexedInputs,
size: 0,
});
}
}
return Object.values(args).length > 0 ? args : undefined;
}
function encode(abiEvent, ...[args]) {
let topics = [];
if (args && abiEvent.inputs) {
const indexedInputs = abiEvent.inputs.filter((param) => 'indexed' in param && param.indexed);
const args_ = Array.isArray(args)
? args
: Object.values(args).length > 0
? indexedInputs?.map((x, i) => args[x.name ?? i]) ?? []
: [];
if (args_.length > 0) {
const encode = (param, value) => {
if (param.type === 'string')
return Hash.keccak256(Hex.fromString(value));
if (param.type === 'bytes')
return Hash.keccak256(value);
if (param.type === 'tuple' || param.type.match(/^(.*)\[(\d+)?\]$/))
throw new FilterTypeNotSupportedError(param.type);
return AbiParameters.encode([param], [value]);
};
topics =
indexedInputs?.map((param, i) => {
if (Array.isArray(args_[i]))
return args_[i].map((_, j) => encode(param, args_[i][j]));
return typeof args_[i] !== 'undefined' && args_[i] !== null
? encode(param, args_[i])
: null;
}) ?? [];
}
}
const selector = (() => {
if (abiEvent.hash)
return abiEvent.hash;
return getSelector(abiEvent);
})();
return { topics: [selector, ...topics] };
}
function format(abiEvent) {
return abitype.formatAbiItem(abiEvent);
}
function from(abiEvent, options = {}) {
return AbiItem.from(abiEvent, options);
}
function fromAbi(abi, name, options) {
const item = AbiItem.fromAbi(abi, name, options);
if (item.type !== 'event')
throw new AbiItem.NotFoundError({ name, type: 'event' });
return item;
}
function getSelector(abiItem) {
return AbiItem.getSignatureHash(abiItem);
}
class ArgsMismatchError extends Errors.BaseError {
constructor({ abiEvent, expected, given, }) {
super('Given arguments do not match the expected arguments.', {
metaMessages: [
`Event: ${format(abiEvent)}`,
`Expected Arguments: ${!expected ? 'None' : ''}`,
expected ? (0, errors_js_1.prettyPrint)(expected) : undefined,
`Given Arguments: ${!given ? 'None' : ''}`,
given ? (0, errors_js_1.prettyPrint)(given) : undefined,
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiEvent.ArgsMismatchError'
});
}
}
exports.ArgsMismatchError = ArgsMismatchError;
class InputNotFoundError extends Errors.BaseError {
constructor({ abiEvent, name, }) {
super(`Parameter "${name}" not found on \`${format(abiEvent)}\`.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiEvent.InputNotFoundError'
});
}
}
exports.InputNotFoundError = InputNotFoundError;
class DataMismatchError extends Errors.BaseError {
constructor({ abiEvent, data, parameters, size, }) {
super([
`Data size of ${size} bytes is too small for non-indexed event parameters.`,
].join('\n'), {
metaMessages: [
`Non-indexed Parameters: (${AbiParameters.format(parameters)})`,
`Data: ${data} (${size} bytes)`,
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiEvent.DataMismatchError'
});
Object.defineProperty(this, "abiEvent", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "data", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "parameters", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "size", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.abiEvent = abiEvent;
this.data = data;
this.parameters = parameters;
this.size = size;
}
}
exports.DataMismatchError = DataMismatchError;
class TopicsMismatchError extends Errors.BaseError {
constructor({ abiEvent, param, }) {
super([
`Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ''} for "${format(abiEvent)}".`,
].join('\n'));
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiEvent.TopicsMismatchError'
});
Object.defineProperty(this, "abiEvent", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.abiEvent = abiEvent;
}
}
exports.TopicsMismatchError = TopicsMismatchError;
class SelectorTopicMismatchError extends Errors.BaseError {
constructor({ abiEvent, actual, expected, }) {
super(`topics[0]="${actual}" does not match the expected topics[0]="${expected}".`, {
metaMessages: [`Event: ${format(abiEvent)}`, `Selector: ${expected}`],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiEvent.SelectorTopicMismatchError'
});
}
}
exports.SelectorTopicMismatchError = SelectorTopicMismatchError;
class FilterTypeNotSupportedError extends Errors.BaseError {
constructor(type) {
super(`Filter type "${type}" is not supported.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiEvent.FilterTypeNotSupportedError'
});
}
}
exports.FilterTypeNotSupportedError = FilterTypeNotSupportedError;
//# sourceMappingURL=AbiEvent.js.map

1
node_modules/ox/_cjs/core/AbiEvent.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

80
node_modules/ox/_cjs/core/AbiFunction.js generated vendored Normal file
View File

@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeData = decodeData;
exports.decodeResult = decodeResult;
exports.encodeData = encodeData;
exports.encodeResult = encodeResult;
exports.format = format;
exports.from = from;
exports.fromAbi = fromAbi;
exports.getSelector = getSelector;
const abitype = require("abitype");
const AbiItem = require("./AbiItem.js");
const AbiParameters = require("./AbiParameters.js");
const Hex = require("./Hex.js");
function decodeData(abiFunction, data) {
const { overloads } = abiFunction;
if (Hex.size(data) < 4)
throw new AbiItem.InvalidSelectorSizeError({ data });
if (abiFunction.inputs.length === 0)
return undefined;
const item = overloads
? fromAbi([abiFunction, ...overloads], data)
: abiFunction;
if (Hex.size(data) <= 4)
return undefined;
return AbiParameters.decode(item.inputs, Hex.slice(data, 4));
}
function decodeResult(abiFunction, data, options = {}) {
const values = AbiParameters.decode(abiFunction.outputs, data, options);
if (values && Object.keys(values).length === 0)
return undefined;
if (values && Object.keys(values).length === 1) {
if (Array.isArray(values))
return values[0];
return Object.values(values)[0];
}
return values;
}
function encodeData(abiFunction, ...args) {
const { overloads } = abiFunction;
const item = overloads
? fromAbi([abiFunction, ...overloads], abiFunction.name, {
args: args[0],
})
: abiFunction;
const selector = getSelector(item);
const data = args.length > 0
? AbiParameters.encode(item.inputs, args[0])
: undefined;
return data ? Hex.concat(selector, data) : selector;
}
function encodeResult(abiFunction, output, options = {}) {
const { as = 'Array' } = options;
const values = (() => {
if (abiFunction.outputs.length === 1)
return [output];
if (Array.isArray(output))
return output;
if (as === 'Object')
return Object.values(output);
return [output];
})();
return AbiParameters.encode(abiFunction.outputs, values);
}
function format(abiFunction) {
return abitype.formatAbiItem(abiFunction);
}
function from(abiFunction, options = {}) {
return AbiItem.from(abiFunction, options);
}
function fromAbi(abi, name, options) {
const item = AbiItem.fromAbi(abi, name, options);
if (item.type !== 'function')
throw new AbiItem.NotFoundError({ name, type: 'function' });
return item;
}
function getSelector(abiItem) {
return AbiItem.getSelector(abiItem);
}
//# sourceMappingURL=AbiFunction.js.map

1
node_modules/ox/_cjs/core/AbiFunction.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AbiFunction.js","sourceRoot":"","sources":["../../core/AbiFunction.ts"],"names":[],"mappings":";;AA+FA,gCAeC;AA0HD,oCAeC;AAqID,gCAoBC;AA6CD,oCAkBC;AAsDD,wBAIC;AA6GD,oBAcC;AAqFD,0BAsBC;AAoCD,kCAEC;AArxBD,mCAAkC;AAElC,wCAAuC;AACvC,oDAAmD;AAEnD,gCAA+B;AA0F/B,SAAgB,UAAU,CACxB,WAAkC,EAClC,IAAa;IAEb,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAA;IAEjC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;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SAAgB,IAAI,CAGlB,WAOG,EACH,UAAwB,EAAE;IAE1B,OAAO,OAAO,CAAC,IAAI,CAAC,WAA0B,EAAE,OAAO,CAAU,CAAA;AACnE,CAAC;AAqFD,SAAgB,OAAO,CASrB,GAAuC,EACvC,IAAsD,EACtD,OAKC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,OAAc,CAAC,CAAA;IACvD,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;QAC1B,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;IAC7D,OAAO,IAAa,CAAA;AACtB,CAAC;AAoCD,SAAgB,WAAW,CAAC,OAA6B;IACvD,OAAO,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;AACrC,CAAC"}

174
node_modules/ox/_cjs/core/AbiItem.js generated vendored Normal file
View File

@@ -0,0 +1,174 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidSelectorSizeError = exports.NotFoundError = exports.AmbiguityError = void 0;
exports.format = format;
exports.from = from;
exports.fromAbi = fromAbi;
exports.getSelector = getSelector;
exports.getSignature = getSignature;
exports.getSignatureHash = getSignatureHash;
const abitype = require("abitype");
const Errors = require("./Errors.js");
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
const internal = require("./internal/abiItem.js");
function format(abiItem) {
return abitype.formatAbiItem(abiItem);
}
function from(abiItem, options = {}) {
const { prepare = true } = options;
const item = (() => {
if (Array.isArray(abiItem))
return abitype.parseAbiItem(abiItem);
if (typeof abiItem === 'string')
return abitype.parseAbiItem(abiItem);
return abiItem;
})();
return {
...item,
...(prepare ? { hash: getSignatureHash(item) } : {}),
};
}
function fromAbi(abi, name, options) {
const { args = [], prepare = true } = (options ??
{});
const isSelector = Hex.validate(name, { strict: false });
const abiItems = abi.filter((abiItem) => {
if (isSelector) {
if (abiItem.type === 'function' || abiItem.type === 'error')
return getSelector(abiItem) === Hex.slice(name, 0, 4);
if (abiItem.type === 'event')
return getSignatureHash(abiItem) === name;
return false;
}
return 'name' in abiItem && abiItem.name === name;
});
if (abiItems.length === 0)
throw new NotFoundError({ name: name });
if (abiItems.length === 1)
return {
...abiItems[0],
...(prepare ? { hash: getSignatureHash(abiItems[0]) } : {}),
};
let matchedAbiItem = undefined;
for (const abiItem of abiItems) {
if (!('inputs' in abiItem))
continue;
if (!args || args.length === 0) {
if (!abiItem.inputs || abiItem.inputs.length === 0)
return {
...abiItem,
...(prepare ? { hash: getSignatureHash(abiItem) } : {}),
};
continue;
}
if (!abiItem.inputs)
continue;
if (abiItem.inputs.length === 0)
continue;
if (abiItem.inputs.length !== args.length)
continue;
const matched = args.every((arg, index) => {
const abiParameter = 'inputs' in abiItem && abiItem.inputs[index];
if (!abiParameter)
return false;
return internal.isArgOfType(arg, abiParameter);
});
if (matched) {
if (matchedAbiItem &&
'inputs' in matchedAbiItem &&
matchedAbiItem.inputs) {
const ambiguousTypes = internal.getAmbiguousTypes(abiItem.inputs, matchedAbiItem.inputs, args);
if (ambiguousTypes)
throw new AmbiguityError({
abiItem,
type: ambiguousTypes[0],
}, {
abiItem: matchedAbiItem,
type: ambiguousTypes[1],
});
}
matchedAbiItem = abiItem;
}
}
const abiItem = (() => {
if (matchedAbiItem)
return matchedAbiItem;
const [abiItem, ...overloads] = abiItems;
return { ...abiItem, overloads };
})();
if (!abiItem)
throw new NotFoundError({ name: name });
return {
...abiItem,
...(prepare ? { hash: getSignatureHash(abiItem) } : {}),
};
}
function getSelector(abiItem) {
return Hex.slice(getSignatureHash(abiItem), 0, 4);
}
function getSignature(abiItem) {
const signature = (() => {
if (typeof abiItem === 'string')
return abiItem;
return abitype.formatAbiItem(abiItem);
})();
return internal.normalizeSignature(signature);
}
function getSignatureHash(abiItem) {
if (typeof abiItem !== 'string' && 'hash' in abiItem && abiItem.hash)
return abiItem.hash;
return Hash.keccak256(Hex.fromString(getSignature(abiItem)));
}
class AmbiguityError extends Errors.BaseError {
constructor(x, y) {
super('Found ambiguous types in overloaded ABI Items.', {
metaMessages: [
`\`${x.type}\` in \`${internal.normalizeSignature(abitype.formatAbiItem(x.abiItem))}\`, and`,
`\`${y.type}\` in \`${internal.normalizeSignature(abitype.formatAbiItem(y.abiItem))}\``,
'',
'These types encode differently and cannot be distinguished at runtime.',
'Remove one of the ambiguous items in the ABI.',
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiItem.AmbiguityError'
});
}
}
exports.AmbiguityError = AmbiguityError;
class NotFoundError extends Errors.BaseError {
constructor({ name, data, type = 'item', }) {
const selector = (() => {
if (name)
return ` with name "${name}"`;
if (data)
return ` with data "${data}"`;
return '';
})();
super(`ABI ${type}${selector} not found.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiItem.NotFoundError'
});
}
}
exports.NotFoundError = NotFoundError;
class InvalidSelectorSizeError extends Errors.BaseError {
constructor({ data }) {
super(`Selector size is invalid. Expected 4 bytes. Received ${Hex.size(data)} bytes ("${data}").`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiItem.InvalidSelectorSizeError'
});
}
}
exports.InvalidSelectorSizeError = InvalidSelectorSizeError;
//# sourceMappingURL=AbiItem.js.map

1
node_modules/ox/_cjs/core/AbiItem.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

227
node_modules/ox/_cjs/core/AbiParameters.js generated vendored Normal file
View File

@@ -0,0 +1,227 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidTypeError = exports.InvalidArrayError = exports.LengthMismatchError = exports.BytesSizeMismatchError = exports.ArrayLengthMismatchError = exports.ZeroDataError = exports.DataSizeTooSmallError = void 0;
exports.decode = decode;
exports.encode = encode;
exports.encodePacked = encodePacked;
exports.format = format;
exports.from = from;
const abitype = require("abitype");
const Address = require("./Address.js");
const Bytes = require("./Bytes.js");
const Errors = require("./Errors.js");
const Hex = require("./Hex.js");
const Solidity = require("./Solidity.js");
const internal = require("./internal/abiParameters.js");
const Cursor = require("./internal/cursor.js");
function decode(parameters, data, options = {}) {
const { as = 'Array', checksumAddress = false } = options;
const bytes = typeof data === 'string' ? Bytes.fromHex(data) : data;
const cursor = Cursor.create(bytes);
if (Bytes.size(bytes) === 0 && parameters.length > 0)
throw new ZeroDataError();
if (Bytes.size(bytes) && Bytes.size(bytes) < 32)
throw new DataSizeTooSmallError({
data: typeof data === 'string' ? data : Hex.fromBytes(data),
parameters: parameters,
size: Bytes.size(bytes),
});
let consumed = 0;
const values = as === 'Array' ? [] : {};
for (let i = 0; i < parameters.length; ++i) {
const param = parameters[i];
cursor.setPosition(consumed);
const [data, consumed_] = internal.decodeParameter(cursor, param, {
checksumAddress,
staticPosition: 0,
});
consumed += consumed_;
if (as === 'Array')
values.push(data);
else
values[param.name ?? i] = data;
}
return values;
}
function encode(parameters, values, options) {
const { checksumAddress = false } = options ?? {};
if (parameters.length !== values.length)
throw new LengthMismatchError({
expectedLength: parameters.length,
givenLength: values.length,
});
const preparedParameters = internal.prepareParameters({
checksumAddress,
parameters: parameters,
values: values,
});
const data = internal.encode(preparedParameters);
if (data.length === 0)
return '0x';
return data;
}
function encodePacked(types, values) {
if (types.length !== values.length)
throw new LengthMismatchError({
expectedLength: types.length,
givenLength: values.length,
});
const data = [];
for (let i = 0; i < types.length; i++) {
const type = types[i];
const value = values[i];
data.push(encodePacked.encode(type, value));
}
return Hex.concat(...data);
}
(function (encodePacked) {
function encode(type, value, isArray = false) {
if (type === 'address') {
const address = value;
Address.assert(address);
return Hex.padLeft(address.toLowerCase(), isArray ? 32 : 0);
}
if (type === 'string')
return Hex.fromString(value);
if (type === 'bytes')
return value;
if (type === 'bool')
return Hex.padLeft(Hex.fromBoolean(value), isArray ? 32 : 1);
const intMatch = type.match(Solidity.integerRegex);
if (intMatch) {
const [_type, baseType, bits = '256'] = intMatch;
const size = Number.parseInt(bits) / 8;
return Hex.fromNumber(value, {
size: isArray ? 32 : size,
signed: baseType === 'int',
});
}
const bytesMatch = type.match(Solidity.bytesRegex);
if (bytesMatch) {
const [_type, size] = bytesMatch;
if (Number.parseInt(size) !== (value.length - 2) / 2)
throw new BytesSizeMismatchError({
expectedSize: Number.parseInt(size),
value: value,
});
return Hex.padRight(value, isArray ? 32 : 0);
}
const arrayMatch = type.match(Solidity.arrayRegex);
if (arrayMatch && Array.isArray(value)) {
const [_type, childType] = arrayMatch;
const data = [];
for (let i = 0; i < value.length; i++) {
data.push(encode(childType, value[i], true));
}
if (data.length === 0)
return '0x';
return Hex.concat(...data);
}
throw new InvalidTypeError(type);
}
encodePacked.encode = encode;
})(encodePacked || (exports.encodePacked = encodePacked = {}));
function format(parameters) {
return abitype.formatAbiParameters(parameters);
}
function from(parameters) {
if (Array.isArray(parameters) && typeof parameters[0] === 'string')
return abitype.parseAbiParameters(parameters);
if (typeof parameters === 'string')
return abitype.parseAbiParameters(parameters);
return parameters;
}
class DataSizeTooSmallError extends Errors.BaseError {
constructor({ data, parameters, size, }) {
super(`Data size of ${size} bytes is too small for given parameters.`, {
metaMessages: [
`Params: (${abitype.formatAbiParameters(parameters)})`,
`Data: ${data} (${size} bytes)`,
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiParameters.DataSizeTooSmallError'
});
}
}
exports.DataSizeTooSmallError = DataSizeTooSmallError;
class ZeroDataError extends Errors.BaseError {
constructor() {
super('Cannot decode zero data ("0x") with ABI parameters.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiParameters.ZeroDataError'
});
}
}
exports.ZeroDataError = ZeroDataError;
class ArrayLengthMismatchError extends Errors.BaseError {
constructor({ expectedLength, givenLength, type, }) {
super(`Array length mismatch for type \`${type}\`. Expected: \`${expectedLength}\`. Given: \`${givenLength}\`.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiParameters.ArrayLengthMismatchError'
});
}
}
exports.ArrayLengthMismatchError = ArrayLengthMismatchError;
class BytesSizeMismatchError extends Errors.BaseError {
constructor({ expectedSize, value, }) {
super(`Size of bytes "${value}" (bytes${Hex.size(value)}) does not match expected size (bytes${expectedSize}).`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiParameters.BytesSizeMismatchError'
});
}
}
exports.BytesSizeMismatchError = BytesSizeMismatchError;
class LengthMismatchError extends Errors.BaseError {
constructor({ expectedLength, givenLength, }) {
super([
'ABI encoding parameters/values length mismatch.',
`Expected length (parameters): ${expectedLength}`,
`Given length (values): ${givenLength}`,
].join('\n'));
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiParameters.LengthMismatchError'
});
}
}
exports.LengthMismatchError = LengthMismatchError;
class InvalidArrayError extends Errors.BaseError {
constructor(value) {
super(`Value \`${value}\` is not a valid array.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiParameters.InvalidArrayError'
});
}
}
exports.InvalidArrayError = InvalidArrayError;
class InvalidTypeError extends Errors.BaseError {
constructor(type) {
super(`Type \`${type}\` is not a valid ABI Type.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AbiParameters.InvalidTypeError'
});
}
}
exports.InvalidTypeError = InvalidTypeError;
//# sourceMappingURL=AbiParameters.js.map

1
node_modules/ox/_cjs/core/AbiParameters.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

51
node_modules/ox/_cjs/core/AccessList.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidStorageKeySizeError = void 0;
exports.fromTupleList = fromTupleList;
exports.toTupleList = toTupleList;
const Address = require("./Address.js");
const Errors = require("./Errors.js");
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
function fromTupleList(accessList) {
const list = [];
for (let i = 0; i < accessList.length; i++) {
const [address, storageKeys] = accessList[i];
if (address)
Address.assert(address, { strict: false });
list.push({
address: address,
storageKeys: storageKeys.map((key) => Hash.validate(key) ? key : Hex.trimLeft(key)),
});
}
return list;
}
function toTupleList(accessList) {
if (!accessList || accessList.length === 0)
return [];
const tuple = [];
for (const { address, storageKeys } of accessList) {
for (let j = 0; j < storageKeys.length; j++)
if (Hex.size(storageKeys[j]) !== 32)
throw new InvalidStorageKeySizeError({
storageKey: storageKeys[j],
});
if (address)
Address.assert(address, { strict: false });
tuple.push([address, storageKeys]);
}
return tuple;
}
class InvalidStorageKeySizeError extends Errors.BaseError {
constructor({ storageKey }) {
super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Hex.size(storageKey)} bytes.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'AccessList.InvalidStorageKeySizeError'
});
}
}
exports.InvalidStorageKeySizeError = InvalidStorageKeySizeError;
//# sourceMappingURL=AccessList.js.map

1
node_modules/ox/_cjs/core/AccessList.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AccessList.js","sourceRoot":"","sources":["../../core/AccessList.ts"],"names":[],"mappings":";;;AAiDA,sCAeC;AA+BD,kCAkBC;AAjHD,wCAAuC;AACvC,sCAAqC;AACrC,kCAAiC;AACjC,gCAA+B;AA8C/B,SAAgB,aAAa,CAAC,UAAiB;IAC7C,MAAM,IAAI,GAAwB,EAAE,CAAA;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,UAAU,CAAC,CAAC,CAAyB,CAAA;QAEpE,IAAI,OAAO;YAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;QAEvD,IAAI,CAAC,IAAI,CAAC;YACR,OAAO,EAAE,OAAO;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AccountProof.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=AccountProof.js.map

1
node_modules/ox/_cjs/core/AccountProof.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AccountProof.js","sourceRoot":"","sources":["../../core/AccountProof.ts"],"names":[],"mappings":""}

116
node_modules/ox/_cjs/core/Address.js generated vendored Normal file
View File

@@ -0,0 +1,116 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidChecksumError = exports.InvalidInputError = exports.InvalidAddressError = void 0;
exports.assert = assert;
exports.checksum = checksum;
exports.from = from;
exports.fromPublicKey = fromPublicKey;
exports.isEqual = isEqual;
exports.validate = validate;
const Bytes = require("./Bytes.js");
const Caches = require("./Caches.js");
const Errors = require("./Errors.js");
const Hash = require("./Hash.js");
const PublicKey = require("./PublicKey.js");
const addressRegex = /^0x[a-fA-F0-9]{40}$/;
function assert(value, options = {}) {
const { strict = true } = options;
if (!addressRegex.test(value))
throw new InvalidAddressError({
address: value,
cause: new InvalidInputError(),
});
if (strict) {
if (value.toLowerCase() === value)
return;
if (checksum(value) !== value)
throw new InvalidAddressError({
address: value,
cause: new InvalidChecksumError(),
});
}
}
function checksum(address) {
if (Caches.checksum.has(address))
return Caches.checksum.get(address);
assert(address, { strict: false });
const hexAddress = address.substring(2).toLowerCase();
const hash = Hash.keccak256(Bytes.fromString(hexAddress), { as: 'Bytes' });
const characters = hexAddress.split('');
for (let i = 0; i < 40; i += 2) {
if (hash[i >> 1] >> 4 >= 8 && characters[i]) {
characters[i] = characters[i].toUpperCase();
}
if ((hash[i >> 1] & 0x0f) >= 8 && characters[i + 1]) {
characters[i + 1] = characters[i + 1].toUpperCase();
}
}
const result = `0x${characters.join('')}`;
Caches.checksum.set(address, result);
return result;
}
function from(address, options = {}) {
const { checksum: checksumVal = false } = options;
assert(address);
if (checksumVal)
return checksum(address);
return address;
}
function fromPublicKey(publicKey, options = {}) {
const address = Hash.keccak256(`0x${PublicKey.toHex(publicKey).slice(4)}`).substring(26);
return from(`0x${address}`, options);
}
function isEqual(addressA, addressB) {
assert(addressA, { strict: false });
assert(addressB, { strict: false });
return addressA.toLowerCase() === addressB.toLowerCase();
}
function validate(address, options = {}) {
const { strict = true } = options ?? {};
try {
assert(address, { strict });
return true;
}
catch {
return false;
}
}
class InvalidAddressError extends Errors.BaseError {
constructor({ address, cause }) {
super(`Address "${address}" is invalid.`, {
cause,
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Address.InvalidAddressError'
});
}
}
exports.InvalidAddressError = InvalidAddressError;
class InvalidInputError extends Errors.BaseError {
constructor() {
super('Address is not a 20 byte (40 hexadecimal character) value.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Address.InvalidInputError'
});
}
}
exports.InvalidInputError = InvalidInputError;
class InvalidChecksumError extends Errors.BaseError {
constructor() {
super('Address does not match its checksum counterpart.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Address.InvalidChecksumError'
});
}
}
exports.InvalidChecksumError = InvalidChecksumError;
//# sourceMappingURL=Address.js.map

1
node_modules/ox/_cjs/core/Address.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Address.js","sourceRoot":"","sources":["../../core/Address.ts"],"names":[],"mappings":";;;AAiCA,wBAoBC;AA6BD,4BAqBC;AA2CD,oBAKC;AAoCD,sCAQC;AA+CD,0BAIC;AA6BD,4BAWC;AA7RD,oCAAmC;AACnC,sCAAqC;AACrC,sCAAqC;AACrC,kCAAiC;AACjC,4CAA2C;AAE3C,MAAM,YAAY,GAAiB,qBAAqB,CAAA;AA0BxD,SAAgB,MAAM,CACpB,KAAa,EACb,UAA0B,EAAE;IAE5B,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,OAAO,CAAA;IAEjC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,K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Q,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAA;AAC1D,CAAC;AA6BD,SAAgB,QAAQ,CACtB,OAAe,EACf,UAA4B,EAAE;IAE9B,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IACvC,IAAI,CAAC;QACH,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC3B,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAwBD,MAAa,mBAIX,SAAQ,MAAM,CAAC,SAAgB;IAG/B,YAAY,EAAE,OAAO,EAAE,KAAK,EAAqC;QAC/D,KAAK,CAAC,YAAY,OAAO,eAAe,EAAE;YACxC,KAAK;SACN,CAAC,CAAA;QALc;;;;mBAAO,6BAA6B;WAAA;IAMtD,CAAC;CACF;AAZD,kDAYC;AAGD,MAAa,iBAAkB,SAAQ,MAAM,CAAC,SAAS;IAGrD;QACE,KAAK,CAAC,4DAA4D,CAAC,CAAA;QAHnD;;;;mBAAO,2BAA2B;WAAA;IAIpD,CAAC;CACF;AAND,8CAMC;AAGD,MAAa,oBAAqB,SAAQ,MAAM,CAAC,SAAS;IAGxD;QACE,KAAK,CAAC,kDAAkD,CAAC,CAAA;QAHzC;;;;mBAAO,8BAA8B;WAAA;IAIvD,CAAC;CACF;AAND,oDAMC"}

51
node_modules/ox/_cjs/core/AesGcm.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ivLength = void 0;
exports.decrypt = decrypt;
exports.encrypt = encrypt;
exports.getKey = getKey;
exports.randomSalt = randomSalt;
const Bytes = require("./Bytes.js");
const Hex = require("./Hex.js");
exports.ivLength = 16;
async function decrypt(value, key, options = {}) {
const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;
const encrypted = Bytes.from(value);
const iv = encrypted.slice(0, exports.ivLength);
const data = encrypted.slice(exports.ivLength);
const decrypted = await globalThis.crypto.subtle.decrypt({
name: 'AES-GCM',
iv,
}, key, Bytes.from(data));
const result = new Uint8Array(decrypted);
if (as === 'Bytes')
return result;
return Hex.from(result);
}
async function encrypt(value, key, options = {}) {
const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;
const iv = Bytes.random(exports.ivLength);
const encrypted = await globalThis.crypto.subtle.encrypt({
name: 'AES-GCM',
iv,
}, key, Bytes.from(value));
const result = Bytes.concat(iv, new Uint8Array(encrypted));
if (as === 'Bytes')
return result;
return Hex.from(result);
}
async function getKey(options) {
const { iterations = 900_000, password, salt = randomSalt(32) } = options;
const baseKey = await globalThis.crypto.subtle.importKey('raw', Bytes.fromString(password), { name: 'PBKDF2' }, false, ['deriveBits', 'deriveKey']);
const key = await globalThis.crypto.subtle.deriveKey({
name: 'PBKDF2',
salt,
iterations,
hash: 'SHA-256',
}, baseKey, { name: 'AES-GCM', length: 256 }, false, ['encrypt', 'decrypt']);
return key;
}
function randomSalt(size = 32) {
return Bytes.random(size);
}
//# sourceMappingURL=AesGcm.js.map

1
node_modules/ox/_cjs/core/AesGcm.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"AesGcm.js","sourceRoot":"","sources":["../../core/AesGcm.ts"],"names":[],"mappings":";;;AA2BA,0BAyBC;AAqCD,0BAuBC;AAkCD,wBAsBC;AA6BD,gCAEC;AAvMD,oCAAmC;AAEnC,gCAA+B;AAElB,QAAA,QAAQ,GAAG,EAAE,CAAA;AAuBnB,KAAK,UAAU,OAAO,CAM3B,KAAoC,EACpC,GAAc,EACd,UAA+B,EAAE;IAEjC,MAAM,EAAE,EAAE,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAA;IACpE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CA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AM,EAAE,UAAU,GAAG,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAA;IACzE,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CACtD,KAAK,EACL,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,EAC1B,EAAE,IAAI,EAAE,QAAQ,EAAE,EAClB,KAAK,EACL,CAAC,YAAY,EAAE,WAAW,CAAC,CAC5B,CAAA;IACD,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAClD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI;QACJ,UAAU;QACV,IAAI,EAAE,SAAS;KAChB,EACD,OAAO,EACP,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,EAChC,KAAK,EACL,CAAC,SAAS,EAAE,SAAS,CAAC,CACvB,CAAA;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AA6BD,SAAgB,UAAU,CAAC,IAAI,GAAG,EAAE;IAClC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC"}

88
node_modules/ox/_cjs/core/Authorization.js generated vendored Normal file
View File

@@ -0,0 +1,88 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.from = from;
exports.fromRpc = fromRpc;
exports.fromRpcList = fromRpcList;
exports.fromTuple = fromTuple;
exports.fromTupleList = fromTupleList;
exports.getSignPayload = getSignPayload;
exports.hash = hash;
exports.toRpc = toRpc;
exports.toRpcList = toRpcList;
exports.toTuple = toTuple;
exports.toTupleList = toTupleList;
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
const Rlp = require("./Rlp.js");
const Signature = require("./Signature.js");
function from(authorization, options = {}) {
if (typeof authorization.chainId === 'string')
return fromRpc(authorization);
return { ...authorization, ...options.signature };
}
function fromRpc(authorization) {
const { address, chainId, nonce } = authorization;
const signature = Signature.extract(authorization);
return {
address,
chainId: Number(chainId),
nonce: BigInt(nonce),
...signature,
};
}
function fromRpcList(authorizationList) {
return authorizationList.map(fromRpc);
}
function fromTuple(tuple) {
const [chainId, address, nonce, yParity, r, s] = tuple;
const signature = yParity && r && s ? Signature.fromTuple([yParity, r, s]) : undefined;
return from({
address,
chainId: Number(chainId),
nonce: BigInt(nonce),
...signature,
});
}
function fromTupleList(tupleList) {
const list = [];
for (const tuple of tupleList)
list.push(fromTuple(tuple));
return list;
}
function getSignPayload(authorization) {
return hash(authorization);
}
function hash(authorization) {
return Hash.keccak256(Hex.concat('0x05', Rlp.fromHex(toTuple(authorization))));
}
function toRpc(authorization) {
const { address, chainId, nonce, ...signature } = authorization;
return {
address,
chainId: Hex.fromNumber(chainId),
nonce: Hex.fromNumber(nonce),
...Signature.toRpc(signature),
};
}
function toRpcList(authorizationList) {
return authorizationList.map(toRpc);
}
function toTuple(authorization) {
const { address, chainId, nonce } = authorization;
const signature = Signature.extract(authorization);
return [
chainId ? Hex.fromNumber(chainId) : '0x',
address,
nonce ? Hex.fromNumber(nonce) : '0x',
...(signature ? Signature.toTuple(signature) : []),
];
}
function toTupleList(list) {
if (!list || list.length === 0)
return [];
const tupleList = [];
for (const authorization of list)
tupleList.push(toTuple(authorization));
return tupleList;
}
//# sourceMappingURL=Authorization.js.map

1
node_modules/ox/_cjs/core/Authorization.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Authorization.js","sourceRoot":"","sources":["../../core/Authorization.ts"],"names":[],"mappings":";;AAsHA,oBAUC;AA+CD,0BAUC;AA0BD,kCAEC;AAoDD,8BAYC;AAoED,sCAMC;AAqCD,wCAEC;AAyBD,oBAEC;AA+BD,sBASC;AA0BD,8BAEC;AA8BD,0BAWC;AA6CD,kCAWC;AApkBD,kCAAiC;AACjC,gCAA+B;AAC/B,gCAA+B;AAC/B,4CAA2C;AAiH3C,SAAgB,IAAI,CAIlB,aAA4C,E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,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAA;AACZ,CAAC;AA6CD,SAAgB,WAAW,CAIzB,IAAuB;IACvB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAEzC,MAAM,SAAS,GAAuB,EAAE,CAAA;IACxC,KAAK,MAAM,aAAa,IAAI,IAAI;QAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAA;IAExE,OAAO,SAAkB,CAAA;AAC3B,CAAC"}

46
node_modules/ox/_cjs/core/Base58.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromBytes = fromBytes;
exports.fromHex = fromHex;
exports.fromString = fromString;
exports.toBytes = toBytes;
exports.toHex = toHex;
exports.toString = toString;
const Bytes = require("./Bytes.js");
const Hex = require("./Hex.js");
const internal = require("./internal/base58.js");
function fromBytes(value) {
return internal.from(value);
}
function fromHex(value) {
return internal.from(value);
}
function fromString(value) {
return internal.from(Bytes.fromString(value));
}
function toBytes(value) {
return Bytes.fromHex(toHex(value));
}
function toHex(value) {
let integer = BigInt(0);
let pad = 0;
let checkPad = true;
for (let i = 0; i < value.length; i++) {
const char = value[i];
if (checkPad && char === '1')
pad++;
else
checkPad = false;
if (typeof internal.alphabetToInteger[char] !== 'bigint')
throw new Error('invalid base58 character: ' + char);
integer = integer * 58n;
integer = integer + internal.alphabetToInteger[char];
}
if (!pad)
return `0x${integer.toString(16)}`;
return `0x${'0'.repeat(pad * 2)}${integer.toString(16)}`;
}
function toString(value) {
return Hex.toString(toHex(value));
}
//# sourceMappingURL=Base58.js.map

1
node_modules/ox/_cjs/core/Base58.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Base58.js","sourceRoot":"","sources":["../../core/Base58.ts"],"names":[],"mappings":";;AAmBA,8BAEC;AAoBD,0BAEC;AA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vD,CAAC;IAED,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAa,CAAA;IACvD,OAAO,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAa,CAAA;AACrE,CAAC;AAoBD,SAAgB,QAAQ,CAAC,KAAa;IACpC,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;AACnC,CAAC"}

70
node_modules/ox/_cjs/core/Base64.js generated vendored Normal file
View File

@@ -0,0 +1,70 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromBytes = fromBytes;
exports.fromHex = fromHex;
exports.fromString = fromString;
exports.toBytes = toBytes;
exports.toHex = toHex;
exports.toString = toString;
const Bytes = require("./Bytes.js");
const Hex = require("./Hex.js");
const encoder = new TextEncoder();
const decoder = new TextDecoder();
const integerToCharacter = Object.fromEntries(Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/').map((a, i) => [i, a.charCodeAt(0)]));
const characterToInteger = {
...Object.fromEntries(Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/').map((a, i) => [a.charCodeAt(0), i])),
['='.charCodeAt(0)]: 0,
['-'.charCodeAt(0)]: 62,
['_'.charCodeAt(0)]: 63,
};
function fromBytes(value, options = {}) {
const { pad = true, url = false } = options;
const encoded = new Uint8Array(Math.ceil(value.length / 3) * 4);
for (let i = 0, j = 0; j < value.length; i += 4, j += 3) {
const y = (value[j] << 16) + (value[j + 1] << 8) + (value[j + 2] | 0);
encoded[i] = integerToCharacter[y >> 18];
encoded[i + 1] = integerToCharacter[(y >> 12) & 0x3f];
encoded[i + 2] = integerToCharacter[(y >> 6) & 0x3f];
encoded[i + 3] = integerToCharacter[y & 0x3f];
}
const k = value.length % 3;
const end = Math.floor(value.length / 3) * 4 + (k && k + 1);
let base64 = decoder.decode(new Uint8Array(encoded.buffer, 0, end));
if (pad && k === 1)
base64 += '==';
if (pad && k === 2)
base64 += '=';
if (url)
base64 = base64.replaceAll('+', '-').replaceAll('/', '_');
return base64;
}
function fromHex(value, options = {}) {
return fromBytes(Bytes.fromHex(value), options);
}
function fromString(value, options = {}) {
return fromBytes(Bytes.fromString(value), options);
}
function toBytes(value) {
const base64 = value.replace(/=+$/, '');
const size = base64.length;
const decoded = new Uint8Array(size + 3);
encoder.encodeInto(base64 + '===', decoded);
for (let i = 0, j = 0; i < base64.length; i += 4, j += 3) {
const x = (characterToInteger[decoded[i]] << 18) +
(characterToInteger[decoded[i + 1]] << 12) +
(characterToInteger[decoded[i + 2]] << 6) +
characterToInteger[decoded[i + 3]];
decoded[j] = x >> 16;
decoded[j + 1] = (x >> 8) & 0xff;
decoded[j + 2] = x & 0xff;
}
const decodedSize = (size >> 2) * 3 + (size % 4 && (size % 4) - 1);
return new Uint8Array(decoded.buffer, 0, decodedSize);
}
function toHex(value) {
return Hex.fromBytes(toBytes(value));
}
function toString(value) {
return Bytes.toString(toBytes(value));
}
//# sourceMappingURL=Base64.js.map

1
node_modules/ox/_cjs/core/Base64.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Base64.js","sourceRoot":"","sources":["../../core/Base64.ts"],"names":[],"mappings":";;AA8DA,8BAoBC;AA2DD,0BAEC;AA2DD,gCAEC;AAmCD,0BAqBC;AAoBD,sBAEC;AAoBD,4BAEC;AAhTD,oCAAmC;AAEnC,gCAA+B;AAE/B,MAAM,OAAO,GAAiB,IAAI,WAAW,EAAE,CAAA;AAC/C,MAAM,OAAO,GAAiB,IAAI,WAAW,EAAE,CAAA;AAE/C,MAAM,kBAAkB,GAAiB,MAAM,CAAC,WAAW,CACzD,KAAK,CAAC,IAAI,CACR,kEAAkE,CACnE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CA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AG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAClE,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,WAAW,CAAC,CAAA;AACvD,CAAC;AAoBD,SAAgB,KAAK,CAAC,KAAa;IACjC,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AACtC,CAAC;AAoBD,SAAgB,QAAQ,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AACvC,CAAC"}

141
node_modules/ox/_cjs/core/BinaryStateTree.js generated vendored Normal file
View File

@@ -0,0 +1,141 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = create;
exports.insert = insert;
exports.merkelize = merkelize;
const blake3_1 = require("@noble/hashes/blake3");
const Bytes = require("./Bytes.js");
function create() {
return {
root: emptyNode(),
};
}
function insert(tree, key, value) {
const stem = Bytes.slice(key, 0, 31);
const subIndex = Bytes.slice(key, 31)[0];
if (tree.root.type === 'empty') {
tree.root = stemNode(stem);
tree.root.values[subIndex] = value;
return;
}
function inner(node_, stem, subIndex, value, depth) {
let node = node_;
if (node.type === 'empty') {
node = stemNode(stem);
node.values[subIndex] = value;
return node;
}
const stemBits = bytesToBits(stem);
if (node.type === 'stem') {
if (Bytes.isEqual(node.stem, stem)) {
node.values[subIndex] = value;
return node;
}
const existingStemBits = bytesToBits(node.stem);
return splitLeaf(node, stemBits, existingStemBits, subIndex, value, depth);
}
if (node.type === 'internal') {
const bit = stemBits[depth];
if (bit === 0) {
node.left = inner(node.left, stem, subIndex, value, depth + 1);
}
else {
node.right = inner(node.right, stem, subIndex, value, depth + 1);
}
return node;
}
return emptyNode();
}
tree.root = inner(tree.root, stem, subIndex, value, 0);
}
function merkelize(tree) {
function inner(node) {
if (node.type === 'empty')
return new Uint8Array(32).fill(0);
if (node.type === 'internal') {
const hash_left = inner(node.left);
const hash_right = inner(node.right);
return hash(Bytes.concat(hash_left, hash_right));
}
let level = node.values.map(hash);
while (level.length > 1) {
const level_ = [];
for (let i = 0; i < level.length; i += 2)
level_.push(hash(Bytes.concat(level[i], level[i + 1])));
level = level_;
}
return hash(Bytes.concat(node.stem, new Uint8Array(1).fill(0), level[0]));
}
return inner(tree.root);
}
function splitLeaf(leaf, stemBits, existingStemBits, subIndex, value, depth) {
if (stemBits[depth] === existingStemBits[depth]) {
const internal = internalNode();
const bit = stemBits[depth];
if (bit === 0) {
internal.left = splitLeaf(leaf, stemBits, existingStemBits, subIndex, value, depth + 1);
}
else {
internal.right = splitLeaf(leaf, stemBits, existingStemBits, subIndex, value, depth + 1);
}
return internal;
}
const internal = internalNode();
const bit = stemBits[depth];
const stem = bitsToBytes(stemBits);
if (bit === 0) {
internal.left = stemNode(stem);
internal.left.values[subIndex] = value;
internal.right = leaf;
}
else {
internal.right = stemNode(stem);
internal.right.values[subIndex] = value;
internal.left = leaf;
}
return internal;
}
function emptyNode() {
return {
type: 'empty',
};
}
function internalNode() {
return {
left: emptyNode(),
right: emptyNode(),
type: 'internal',
};
}
function stemNode(stem) {
return {
stem,
values: Array.from({ length: 256 }, () => undefined),
type: 'stem',
};
}
function bytesToBits(bytes) {
const bits = [];
for (const byte of bytes)
for (let i = 0; i < 8; i++)
bits.push((byte >> (7 - i)) & 1);
return bits;
}
function bitsToBytes(bits) {
const byte_data = new Uint8Array(bits.length / 8);
for (let i = 0; i < bits.length; i += 8) {
let byte = 0;
for (let j = 0; j < 8; j++)
byte |= bits[i + j] << (7 - j);
byte_data[i / 8] = byte;
}
return byte_data;
}
function hash(bytes) {
if (!bytes)
return new Uint8Array(32).fill(0);
if (!bytes.some((byte) => byte !== 0))
return new Uint8Array(32).fill(0);
return (0, blake3_1.blake3)(bytes);
}
//# sourceMappingURL=BinaryStateTree.js.map

1
node_modules/ox/_cjs/core/BinaryStateTree.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

244
node_modules/ox/_cjs/core/Blobs.js generated vendored Normal file
View File

@@ -0,0 +1,244 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidVersionedHashVersionError = exports.InvalidVersionedHashSizeError = exports.EmptyBlobVersionedHashesError = exports.EmptyBlobError = exports.BlobSizeTooLargeError = exports.maxBytesPerTransaction = exports.bytesPerBlob = exports.fieldElementsPerBlob = exports.bytesPerFieldElement = void 0;
exports.commitmentsToVersionedHashes = commitmentsToVersionedHashes;
exports.commitmentToVersionedHash = commitmentToVersionedHash;
exports.from = from;
exports.sidecarsToVersionedHashes = sidecarsToVersionedHashes;
exports.to = to;
exports.toHex = toHex;
exports.toBytes = toBytes;
exports.toCommitments = toCommitments;
exports.toProofs = toProofs;
exports.toSidecars = toSidecars;
exports.toVersionedHashes = toVersionedHashes;
const Bytes = require("./Bytes.js");
const Errors = require("./Errors.js");
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
const Kzg = require("./Kzg.js");
const Cursor = require("./internal/cursor.js");
const blobsPerTransaction = 6;
exports.bytesPerFieldElement = 32;
exports.fieldElementsPerBlob = 4096;
exports.bytesPerBlob = exports.bytesPerFieldElement * exports.fieldElementsPerBlob;
exports.maxBytesPerTransaction = exports.bytesPerBlob * blobsPerTransaction -
1 -
1 * exports.fieldElementsPerBlob * blobsPerTransaction;
function commitmentsToVersionedHashes(commitments, options = {}) {
const { version } = options;
const as = options.as ?? (typeof commitments[0] === 'string' ? 'Hex' : 'Bytes');
const hashes = [];
for (const commitment of commitments) {
hashes.push(commitmentToVersionedHash(commitment, {
as,
version,
}));
}
return hashes;
}
function commitmentToVersionedHash(commitment, options = {}) {
const { version = 1 } = options;
const as = options.as ?? (typeof commitment === 'string' ? 'Hex' : 'Bytes');
const versionedHash = Hash.sha256(commitment, { as: 'Bytes' });
versionedHash.set([version], 0);
return (as === 'Bytes' ? versionedHash : Hex.fromBytes(versionedHash));
}
function from(data, options = {}) {
const as = options.as ?? (typeof data === 'string' ? 'Hex' : 'Bytes');
const data_ = (typeof data === 'string' ? Bytes.fromHex(data) : data);
const size_ = Bytes.size(data_);
if (!size_)
throw new EmptyBlobError();
if (size_ > exports.maxBytesPerTransaction)
throw new BlobSizeTooLargeError({
maxSize: exports.maxBytesPerTransaction,
size: size_,
});
const blobs = [];
let active = true;
let position = 0;
while (active) {
const blob = Cursor.create(new Uint8Array(exports.bytesPerBlob));
let size = 0;
while (size < exports.fieldElementsPerBlob) {
const bytes = data_.slice(position, position + (exports.bytesPerFieldElement - 1));
blob.pushByte(0x00);
blob.pushBytes(bytes);
if (bytes.length < 31) {
blob.pushByte(0x80);
active = false;
break;
}
size++;
position += 31;
}
blobs.push(blob);
}
return (as === 'Bytes'
? blobs.map((x) => x.bytes)
: blobs.map((x) => Hex.fromBytes(x.bytes)));
}
function sidecarsToVersionedHashes(sidecars, options = {}) {
const { version } = options;
const as = options.as ?? (typeof sidecars[0].blob === 'string' ? 'Hex' : 'Bytes');
const hashes = [];
for (const { commitment } of sidecars) {
hashes.push(commitmentToVersionedHash(commitment, {
as,
version,
}));
}
return hashes;
}
function to(blobs, to) {
const to_ = to ?? (typeof blobs[0] === 'string' ? 'Hex' : 'Bytes');
const blobs_ = (typeof blobs[0] === 'string'
? blobs.map((x) => Bytes.fromHex(x))
: blobs);
const length = blobs_.reduce((length, blob) => length + blob.length, 0);
const data = Cursor.create(new Uint8Array(length));
let active = true;
for (const blob of blobs_) {
const cursor = Cursor.create(blob);
while (active && cursor.position < blob.length) {
cursor.incrementPosition(1);
let consume = 31;
if (blob.length - cursor.position < 31)
consume = blob.length - cursor.position;
for (const _ in Array.from({ length: consume })) {
const byte = cursor.readByte();
const isTerminator = byte === 0x80 && !cursor.inspectBytes(cursor.remaining).includes(0x80);
if (isTerminator) {
active = false;
break;
}
data.pushByte(byte);
}
}
}
const trimmedData = data.bytes.slice(0, data.position);
return (to_ === 'Hex' ? Hex.fromBytes(trimmedData) : trimmedData);
}
function toHex(blobs) {
return to(blobs, 'Hex');
}
function toBytes(blobs) {
return to(blobs, 'Bytes');
}
function toCommitments(blobs, options) {
const { kzg } = options;
const as = options.as ?? (typeof blobs[0] === 'string' ? 'Hex' : 'Bytes');
const blobs_ = (typeof blobs[0] === 'string'
? blobs.map((x) => Bytes.fromHex(x))
: blobs);
const commitments = [];
for (const blob of blobs_)
commitments.push(Uint8Array.from(kzg.blobToKzgCommitment(blob)));
return (as === 'Bytes' ? commitments : commitments.map((x) => Hex.fromBytes(x)));
}
function toProofs(blobs, options) {
const { kzg } = options;
const as = options.as ?? (typeof blobs[0] === 'string' ? 'Hex' : 'Bytes');
const blobs_ = (typeof blobs[0] === 'string'
? blobs.map((x) => Bytes.fromHex(x))
: blobs);
const commitments = (typeof options.commitments[0] === 'string'
? options.commitments.map((x) => Bytes.fromHex(x))
: options.commitments);
const proofs = [];
for (let i = 0; i < blobs_.length; i++) {
const blob = blobs_[i];
const commitment = commitments[i];
proofs.push(Uint8Array.from(kzg.computeBlobKzgProof(blob, commitment)));
}
return (as === 'Bytes' ? proofs : proofs.map((x) => Hex.fromBytes(x)));
}
function toSidecars(blobs, options) {
const { kzg } = options;
const commitments = options.commitments ?? toCommitments(blobs, { kzg: kzg });
const proofs = options.proofs ??
toProofs(blobs, { commitments: commitments, kzg: kzg });
const sidecars = [];
for (let i = 0; i < blobs.length; i++)
sidecars.push({
blob: blobs[i],
commitment: commitments[i],
proof: proofs[i],
});
return sidecars;
}
function toVersionedHashes(blobs, options) {
const commitments = toCommitments(blobs, options);
return commitmentsToVersionedHashes(commitments, options);
}
class BlobSizeTooLargeError extends Errors.BaseError {
constructor({ maxSize, size }) {
super('Blob size is too large.', {
metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size} bytes`],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Blobs.BlobSizeTooLargeError'
});
}
}
exports.BlobSizeTooLargeError = BlobSizeTooLargeError;
class EmptyBlobError extends Errors.BaseError {
constructor() {
super('Blob data must not be empty.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Blobs.EmptyBlobError'
});
}
}
exports.EmptyBlobError = EmptyBlobError;
class EmptyBlobVersionedHashesError extends Errors.BaseError {
constructor() {
super('Blob versioned hashes must not be empty.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Blobs.EmptyBlobVersionedHashesError'
});
}
}
exports.EmptyBlobVersionedHashesError = EmptyBlobVersionedHashesError;
class InvalidVersionedHashSizeError extends Errors.BaseError {
constructor({ hash, size, }) {
super(`Versioned hash "${hash}" size is invalid.`, {
metaMessages: ['Expected: 32', `Received: ${size}`],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Blobs.InvalidVersionedHashSizeError'
});
}
}
exports.InvalidVersionedHashSizeError = InvalidVersionedHashSizeError;
class InvalidVersionedHashVersionError extends Errors.BaseError {
constructor({ hash, version, }) {
super(`Versioned hash "${hash}" version is invalid.`, {
metaMessages: [
`Expected: ${Kzg.versionedHashVersion}`,
`Received: ${version}`,
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Blobs.InvalidVersionedHashVersionError'
});
}
}
exports.InvalidVersionedHashVersionError = InvalidVersionedHashVersionError;
//# sourceMappingURL=Blobs.js.map

1
node_modules/ox/_cjs/core/Blobs.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

85
node_modules/ox/_cjs/core/Block.js generated vendored Normal file
View File

@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toRpc = toRpc;
exports.fromRpc = fromRpc;
const Hex = require("./Hex.js");
const Transaction = require("./Transaction.js");
const Withdrawal = require("./Withdrawal.js");
function toRpc(block, _options = {}) {
const transactions = block.transactions.map((transaction) => {
if (typeof transaction === 'string')
return transaction;
return Transaction.toRpc(transaction);
});
return {
baseFeePerGas: typeof block.baseFeePerGas === 'bigint'
? Hex.fromNumber(block.baseFeePerGas)
: undefined,
blobGasUsed: typeof block.blobGasUsed === 'bigint'
? Hex.fromNumber(block.blobGasUsed)
: undefined,
excessBlobGas: typeof block.excessBlobGas === 'bigint'
? Hex.fromNumber(block.excessBlobGas)
: undefined,
extraData: block.extraData,
difficulty: typeof block.difficulty === 'bigint'
? Hex.fromNumber(block.difficulty)
: undefined,
gasLimit: Hex.fromNumber(block.gasLimit),
gasUsed: Hex.fromNumber(block.gasUsed),
hash: block.hash,
logsBloom: block.logsBloom,
miner: block.miner,
mixHash: block.mixHash,
nonce: block.nonce,
number: (typeof block.number === 'bigint'
? Hex.fromNumber(block.number)
: null),
parentBeaconBlockRoot: block.parentBeaconBlockRoot,
parentHash: block.parentHash,
receiptsRoot: block.receiptsRoot,
sealFields: block.sealFields,
sha3Uncles: block.sha3Uncles,
size: Hex.fromNumber(block.size),
stateRoot: block.stateRoot,
timestamp: Hex.fromNumber(block.timestamp),
totalDifficulty: typeof block.totalDifficulty === 'bigint'
? Hex.fromNumber(block.totalDifficulty)
: undefined,
transactions,
transactionsRoot: block.transactionsRoot,
uncles: block.uncles,
withdrawals: block.withdrawals?.map(Withdrawal.toRpc),
withdrawalsRoot: block.withdrawalsRoot,
};
}
function fromRpc(block, _options = {}) {
if (!block)
return null;
const transactions = block.transactions.map((transaction) => {
if (typeof transaction === 'string')
return transaction;
return Transaction.fromRpc(transaction);
});
return {
...block,
baseFeePerGas: block.baseFeePerGas
? BigInt(block.baseFeePerGas)
: undefined,
blobGasUsed: block.blobGasUsed ? BigInt(block.blobGasUsed) : undefined,
difficulty: block.difficulty ? BigInt(block.difficulty) : undefined,
excessBlobGas: block.excessBlobGas
? BigInt(block.excessBlobGas)
: undefined,
gasLimit: BigInt(block.gasLimit ?? 0n),
gasUsed: BigInt(block.gasUsed ?? 0n),
number: block.number ? BigInt(block.number) : null,
size: BigInt(block.size ?? 0n),
stateRoot: block.stateRoot,
timestamp: BigInt(block.timestamp ?? 0n),
totalDifficulty: BigInt(block.totalDifficulty ?? 0n),
transactions,
withdrawals: block.withdrawals?.map(Withdrawal.fromRpc),
};
}
//# sourceMappingURL=Block.js.map

1
node_modules/ox/_cjs/core/Block.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Block.js","sourceRoot":"","sources":["../../core/Block.ts"],"names":[],"mappings":";;AAiJA,sBAyDC;AA2ED,0BAkCC;AArTD,gCAA+B;AAC/B,gDAA+C;AAC/C,8CAA6C;AA6I7C,SAAgB,KAAK,CAInB,KAA2C,EAC3C,WAAyD,EAAE;IAE3D,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;QAC1D,IAAI,OAAO,WAAW,KAAK,QAAQ;YAAE,OAAO,WAAW,CAAA;QACvD,OAAO,WAAW,CAAC,KAAK,CAAC,WAAkB,CAAQ,CAAA;IACrD,CAAC,CAAC,CAAA;IACF,OAAO;QACL,aAAa,EACX,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ;YACrC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC;YACrC,CAAC,CAAC,SAAS;QACf,WAAW,EACT,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ;YACnC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC;YACnC,CAAC,CAAC,SAAS;QACf,aAAa,EACX,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ;YACrC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC;YACrC,CAAC,CAAC,SAAS;QACf,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,UAAU,EACR,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ;YAClC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC;YAClC,CAAC,CAAC,SAAS;QACf,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC;QACxC,OAAO,EAAE,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W,EAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;KACtC,CAAA;AACrB,CAAC"}

63
node_modules/ox/_cjs/core/BlockOverrides.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromRpc = fromRpc;
exports.toRpc = toRpc;
const Hex = require("./Hex.js");
const Withdrawal = require("./Withdrawal.js");
function fromRpc(rpcBlockOverrides) {
return {
...(rpcBlockOverrides.baseFeePerGas && {
baseFeePerGas: BigInt(rpcBlockOverrides.baseFeePerGas),
}),
...(rpcBlockOverrides.blobBaseFee && {
blobBaseFee: BigInt(rpcBlockOverrides.blobBaseFee),
}),
...(rpcBlockOverrides.feeRecipient && {
feeRecipient: rpcBlockOverrides.feeRecipient,
}),
...(rpcBlockOverrides.gasLimit && {
gasLimit: BigInt(rpcBlockOverrides.gasLimit),
}),
...(rpcBlockOverrides.number && {
number: BigInt(rpcBlockOverrides.number),
}),
...(rpcBlockOverrides.prevRandao && {
prevRandao: BigInt(rpcBlockOverrides.prevRandao),
}),
...(rpcBlockOverrides.time && {
time: BigInt(rpcBlockOverrides.time),
}),
...(rpcBlockOverrides.withdrawals && {
withdrawals: rpcBlockOverrides.withdrawals.map(Withdrawal.fromRpc),
}),
};
}
function toRpc(blockOverrides) {
return {
...(typeof blockOverrides.baseFeePerGas === 'bigint' && {
baseFeePerGas: Hex.fromNumber(blockOverrides.baseFeePerGas),
}),
...(typeof blockOverrides.blobBaseFee === 'bigint' && {
blobBaseFee: Hex.fromNumber(blockOverrides.blobBaseFee),
}),
...(typeof blockOverrides.feeRecipient === 'string' && {
feeRecipient: blockOverrides.feeRecipient,
}),
...(typeof blockOverrides.gasLimit === 'bigint' && {
gasLimit: Hex.fromNumber(blockOverrides.gasLimit),
}),
...(typeof blockOverrides.number === 'bigint' && {
number: Hex.fromNumber(blockOverrides.number),
}),
...(typeof blockOverrides.prevRandao === 'bigint' && {
prevRandao: Hex.fromNumber(blockOverrides.prevRandao),
}),
...(typeof blockOverrides.time === 'bigint' && {
time: Hex.fromNumber(blockOverrides.time),
}),
...(blockOverrides.withdrawals && {
withdrawals: blockOverrides.withdrawals.map(Withdrawal.toRpc),
}),
};
}
//# sourceMappingURL=BlockOverrides.js.map

1
node_modules/ox/_cjs/core/BlockOverrides.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"BlockOverrides.js","sourceRoot":"","sources":["../../core/BlockOverrides.ts"],"names":[],"mappings":";;AA4DA,0BA2BC;AA+BD,sBA2BC;AAhJD,gCAA+B;AAC/B,8CAA6C;AA0D7C,SAAgB,OAAO,CAAC,iBAAsB;IAC5C,OAAO;QACL,GAAG,CAAC,iBAAiB,CAAC,aAAa,IAAI;YACrC,aAAa,EAAE,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC;SACvD,CAAC;QACF,GAAG,CAAC,iBAAiB,CAAC,WAAW,IAAI;YACnC,WAAW,EAAE,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC;SACnD,CAAC;QACF,GAAG,CAAC,iBAAiB,CAAC,YAAY,IAAI;YACpC,YAAY,EAAE,iBAAiB,CAAC,YAAY;SAC7C,CAAC;QACF,GAAG,CAAC,iBAAiB,CAAC,QAAQ,IAAI;YAChC,QAAQ,EAAE,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC;SAC7C,CAAC;QACF,GAAG,CAAC,iBAAiB,CAAC,MAAM,IAAI;YAC9B,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC;SACzC,CAAC;QACF,GAAG,CAAC,iBAAiB,CAAC,UAAU,IAAI;YAClC,UAAU,EAAE,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC;SACjD,CAAC;QACF,GAAG,CAAC,iBAAiB,CAAC,IAAI,IAAI;YAC5B,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC;SACrC,CAAC;QACF,GAAG,CAAC,iBAAiB,CAAC,WAAW,IAAI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C9D,CAAC;KACH,CAAA;AACH,CAAC"}

21
node_modules/ox/_cjs/core/Bloom.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contains = contains;
exports.validate = validate;
const Bytes = require("./Bytes.js");
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
function contains(bloom, input) {
const filter = Bytes.fromHex(bloom);
const hash = Hash.keccak256(input, { as: 'Bytes' });
for (const i of [0, 2, 4]) {
const bit = (hash[i + 1] + (hash[i] << 8)) & 0x7ff;
if ((filter[256 - 1 - Math.floor(bit / 8)] & (1 << (bit % 8))) === 0)
return false;
}
return true;
}
function validate(value) {
return Hex.validate(value) && Hex.size(value) === 256;
}
//# sourceMappingURL=Bloom.js.map

1
node_modules/ox/_cjs/core/Bloom.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Bloom.js","sourceRoot":"","sources":["../../core/Bloom.ts"],"names":[],"mappings":";;AAuBA,4BAcC;AA0BD,4BAEC;AAjED,oCAAmC;AAEnC,kCAAiC;AACjC,gCAA+B;AAoB/B,SAAgB,QAAQ,CACtB,KAAc,EACd,KAA4B;IAE5B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IAEnD,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC1B,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;QACpD,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACnE,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AA0BD,SAAgB,QAAQ,CAAC,KAAa;IACpC,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAA;AACvD,CAAC"}

76
node_modules/ox/_cjs/core/Bls.js generated vendored Normal file
View File

@@ -0,0 +1,76 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.noble = void 0;
exports.aggregate = aggregate;
exports.getPublicKey = getPublicKey;
exports.randomPrivateKey = randomPrivateKey;
exports.sign = sign;
exports.verify = verify;
const bls12_381_1 = require("@noble/curves/bls12-381");
const Bytes = require("./Bytes.js");
const Hex = require("./Hex.js");
exports.noble = bls12_381_1.bls12_381;
function aggregate(points) {
const group = typeof points[0]?.x === 'bigint' ? bls12_381_1.bls12_381.G1 : bls12_381_1.bls12_381.G2;
const point = points.reduce((acc, point) => acc.add(new group.ProjectivePoint(point.x, point.y, point.z)), group.ProjectivePoint.ZERO);
return {
x: point.px,
y: point.py,
z: point.pz,
};
}
function getPublicKey(options) {
const { privateKey, size = 'short-key:long-sig' } = options;
const group = size === 'short-key:long-sig' ? bls12_381_1.bls12_381.G1 : bls12_381_1.bls12_381.G2;
const { px, py, pz } = group.ProjectivePoint.fromPrivateKey(Hex.from(privateKey).slice(2));
return { x: px, y: py, z: pz };
}
function randomPrivateKey(options = {}) {
const { as = 'Hex' } = options;
const bytes = bls12_381_1.bls12_381.utils.randomPrivateKey();
if (as === 'Hex')
return Hex.fromBytes(bytes);
return bytes;
}
function sign(options) {
const { payload, privateKey, suite, size = 'short-key:long-sig' } = options;
const payloadGroup = size === 'short-key:long-sig' ? bls12_381_1.bls12_381.G2 : bls12_381_1.bls12_381.G1;
const payloadPoint = payloadGroup.hashToCurve(Bytes.from(payload), suite ? { DST: Bytes.fromString(suite) } : undefined);
const privateKeyGroup = size === 'short-key:long-sig' ? bls12_381_1.bls12_381.G1 : bls12_381_1.bls12_381.G2;
const signature = payloadPoint.multiply(privateKeyGroup.normPrivateKeyToScalar(privateKey.slice(2)));
return {
x: signature.px,
y: signature.py,
z: signature.pz,
};
}
function verify(options) {
const { payload, suite } = options;
const publicKey = options.publicKey;
const signature = options.signature;
const isShortSig = typeof signature.x === 'bigint';
const group = isShortSig ? bls12_381_1.bls12_381.G1 : bls12_381_1.bls12_381.G2;
const payloadPoint = group.hashToCurve(Bytes.from(payload), suite ? { DST: Bytes.fromString(suite) } : undefined);
const shortSigPairing = () => bls12_381_1.bls12_381.pairingBatch([
{
g1: payloadPoint,
g2: new bls12_381_1.bls12_381.G2.ProjectivePoint(publicKey.x, publicKey.y, publicKey.z),
},
{
g1: new bls12_381_1.bls12_381.G1.ProjectivePoint(signature.x, signature.y, signature.z),
g2: bls12_381_1.bls12_381.G2.ProjectivePoint.BASE.negate(),
},
]);
const longSigPairing = () => bls12_381_1.bls12_381.pairingBatch([
{
g1: new bls12_381_1.bls12_381.G1.ProjectivePoint(publicKey.x, publicKey.y, publicKey.z).negate(),
g2: payloadPoint,
},
{
g1: bls12_381_1.bls12_381.G1.ProjectivePoint.BASE,
g2: new bls12_381_1.bls12_381.G2.ProjectivePoint(signature.x, signature.y, signature.z),
},
]);
return bls12_381_1.bls12_381.fields.Fp12.eql(isShortSig ? shortSigPairing() : longSigPairing(), bls12_381_1.bls12_381.fields.Fp12.ONE);
}
//# sourceMappingURL=Bls.js.map

1
node_modules/ox/_cjs/core/Bls.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Bls.js","sourceRoot":"","sources":["../../core/Bls.ts"],"names":[],"mappings":";;;AAoDA,8BAcC;AAiHD,oCAOC;AAmCD,4CAOC;AAmFD,oBAmBC;AAiFD,wBA8CC;AAxcD,uDAA0D;AAG1D,oC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AAE,CAAC,eAAe,CAAC,IAAI;YAC/B,EAAE,EAAE,IAAI,qBAAG,CAAC,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;SACtE;KACF,CAAC,CAAA;IAEJ,OAAO,qBAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CACxB,UAAU,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EACjD,qBAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CACpB,CAAA;AACH,CAAC"}

28
node_modules/ox/_cjs/core/BlsPoint.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBytes = toBytes;
exports.toHex = toHex;
exports.fromBytes = fromBytes;
exports.fromHex = fromHex;
const bls12_381_1 = require("@noble/curves/bls12-381");
const Hex = require("./Hex.js");
function toBytes(point) {
const group = typeof point.z === 'bigint' ? bls12_381_1.bls12_381.G1 : bls12_381_1.bls12_381.G2;
return new group.ProjectivePoint(point.x, point.y, point.z).toRawBytes();
}
function toHex(point) {
return Hex.fromBytes(toBytes(point));
}
function fromBytes(bytes) {
const group = bytes.length === 48 ? bls12_381_1.bls12_381.G1 : bls12_381_1.bls12_381.G2;
const point = group.ProjectivePoint.fromHex(bytes);
return {
x: point.px,
y: point.py,
z: point.pz,
};
}
function fromHex(hex, group) {
return fromBytes(Hex.toBytes(hex), group);
}
//# sourceMappingURL=BlsPoint.js.map

1
node_modules/ox/_cjs/core/BlsPoint.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"BlsPoint.js","sourceRoot":"","sources":["../../core/BlsPoint.ts"],"names":[],"mappings":";;AA2DA,0BASC;AAsCD,sBAEC;AA+CD,8BAQC;AAkDD,0BAEC;AAvND,uDAA0D;AAI1D,gCAA+B;AAuD/B,SAAgB,OAAO,CACrB,KAAY;IAEZ,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAG,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAG,CAAC,EAAE,CAAA;IAC3D,OAAO,IAAK,KAAa,CAAC,eAAe,CACvC,KAAK,CAAC,CAAC,EACP,KAAK,CAAC,CAAC,EACP,KAAK,CAAC,CAAC,CACR,CAAC,UAAU,EAAE,CAAA;AAChB,CAAC;AAsCD,SAAgB,KAAK,CAAC,KAAc;IAClC,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AACtC,CAAC;AA+CD,SAAgB,SAAS,CAAC,KAAkB;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,qBAAG,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAG,CAAC,EAAE,CAAA;IACnD,MAAM,KAAK,GAAG,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAClD,OAAO;QACL,CAAC,EAAE,KAAK,CAAC,EAAE;QACX,CAAC,EAAE,KAAK,CAAC,EAAE;QACX,CAAC,EAAE,KAAK,CAAC,EAAE;KACZ,CAAA;AACH,CAAC;AAkDD,SAAgB,OAAO,CAAC,GAAY,EAAE,KAAkB;IACtD,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC"}

257
node_modules/ox/_cjs/core/Bytes.js generated vendored Normal file
View File

@@ -0,0 +1,257 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SizeExceedsPaddingSizeError = exports.SliceOffsetOutOfBoundsError = exports.SizeOverflowError = exports.InvalidBytesTypeError = exports.InvalidBytesBooleanError = void 0;
exports.assert = assert;
exports.concat = concat;
exports.from = from;
exports.fromArray = fromArray;
exports.fromBoolean = fromBoolean;
exports.fromHex = fromHex;
exports.fromNumber = fromNumber;
exports.fromString = fromString;
exports.isEqual = isEqual;
exports.padLeft = padLeft;
exports.padRight = padRight;
exports.random = random;
exports.size = size;
exports.slice = slice;
exports.toBigInt = toBigInt;
exports.toBoolean = toBoolean;
exports.toHex = toHex;
exports.toNumber = toNumber;
exports.toString = toString;
exports.trimLeft = trimLeft;
exports.trimRight = trimRight;
exports.validate = validate;
const utils_1 = require("@noble/curves/abstract/utils");
const Errors = require("./Errors.js");
const Hex = require("./Hex.js");
const Json = require("./Json.js");
const internal = require("./internal/bytes.js");
const internal_hex = require("./internal/hex.js");
const decoder = new TextDecoder();
const encoder = new TextEncoder();
function assert(value) {
if (value instanceof Uint8Array)
return;
if (!value)
throw new InvalidBytesTypeError(value);
if (typeof value !== 'object')
throw new InvalidBytesTypeError(value);
if (!('BYTES_PER_ELEMENT' in value))
throw new InvalidBytesTypeError(value);
if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== 'Uint8Array')
throw new InvalidBytesTypeError(value);
}
function concat(...values) {
let length = 0;
for (const arr of values) {
length += arr.length;
}
const result = new Uint8Array(length);
for (let i = 0, index = 0; i < values.length; i++) {
const arr = values[i];
result.set(arr, index);
index += arr.length;
}
return result;
}
function from(value) {
if (value instanceof Uint8Array)
return value;
if (typeof value === 'string')
return fromHex(value);
return fromArray(value);
}
function fromArray(value) {
return value instanceof Uint8Array ? value : new Uint8Array(value);
}
function fromBoolean(value, options = {}) {
const { size } = options;
const bytes = new Uint8Array(1);
bytes[0] = Number(value);
if (typeof size === 'number') {
internal.assertSize(bytes, size);
return padLeft(bytes, size);
}
return bytes;
}
function fromHex(value, options = {}) {
const { size } = options;
let hex = value;
if (size) {
internal_hex.assertSize(value, size);
hex = Hex.padRight(value, size);
}
let hexString = hex.slice(2);
if (hexString.length % 2)
hexString = `0${hexString}`;
const length = hexString.length / 2;
const bytes = new Uint8Array(length);
for (let index = 0, j = 0; index < length; index++) {
const nibbleLeft = internal.charCodeToBase16(hexString.charCodeAt(j++));
const nibbleRight = internal.charCodeToBase16(hexString.charCodeAt(j++));
if (nibbleLeft === undefined || nibbleRight === undefined) {
throw new Errors.BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
}
bytes[index] = nibbleLeft * 16 + nibbleRight;
}
return bytes;
}
function fromNumber(value, options) {
const hex = Hex.fromNumber(value, options);
return fromHex(hex);
}
function fromString(value, options = {}) {
const { size } = options;
const bytes = encoder.encode(value);
if (typeof size === 'number') {
internal.assertSize(bytes, size);
return padRight(bytes, size);
}
return bytes;
}
function isEqual(bytesA, bytesB) {
return (0, utils_1.equalBytes)(bytesA, bytesB);
}
function padLeft(value, size) {
return internal.pad(value, { dir: 'left', size });
}
function padRight(value, size) {
return internal.pad(value, { dir: 'right', size });
}
function random(length) {
return crypto.getRandomValues(new Uint8Array(length));
}
function size(value) {
return value.length;
}
function slice(value, start, end, options = {}) {
const { strict } = options;
internal.assertStartOffset(value, start);
const value_ = value.slice(start, end);
if (strict)
internal.assertEndOffset(value_, start, end);
return value_;
}
function toBigInt(bytes, options = {}) {
const { size } = options;
if (typeof size !== 'undefined')
internal.assertSize(bytes, size);
const hex = Hex.fromBytes(bytes, options);
return Hex.toBigInt(hex, options);
}
function toBoolean(bytes, options = {}) {
const { size } = options;
let bytes_ = bytes;
if (typeof size !== 'undefined') {
internal.assertSize(bytes_, size);
bytes_ = trimLeft(bytes_);
}
if (bytes_.length > 1 || bytes_[0] > 1)
throw new InvalidBytesBooleanError(bytes_);
return Boolean(bytes_[0]);
}
function toHex(value, options = {}) {
return Hex.fromBytes(value, options);
}
function toNumber(bytes, options = {}) {
const { size } = options;
if (typeof size !== 'undefined')
internal.assertSize(bytes, size);
const hex = Hex.fromBytes(bytes, options);
return Hex.toNumber(hex, options);
}
function toString(bytes, options = {}) {
const { size } = options;
let bytes_ = bytes;
if (typeof size !== 'undefined') {
internal.assertSize(bytes_, size);
bytes_ = trimRight(bytes_);
}
return decoder.decode(bytes_);
}
function trimLeft(value) {
return internal.trim(value, { dir: 'left' });
}
function trimRight(value) {
return internal.trim(value, { dir: 'right' });
}
function validate(value) {
try {
assert(value);
return true;
}
catch {
return false;
}
}
class InvalidBytesBooleanError extends Errors.BaseError {
constructor(bytes) {
super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
metaMessages: [
'The bytes array must contain a single byte of either a `0` or `1` value.',
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Bytes.InvalidBytesBooleanError'
});
}
}
exports.InvalidBytesBooleanError = InvalidBytesBooleanError;
class InvalidBytesTypeError extends Errors.BaseError {
constructor(value) {
super(`Value \`${typeof value === 'object' ? Json.stringify(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
metaMessages: ['Bytes values must be of type `Bytes`.'],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Bytes.InvalidBytesTypeError'
});
}
}
exports.InvalidBytesTypeError = InvalidBytesTypeError;
class SizeOverflowError extends Errors.BaseError {
constructor({ givenSize, maxSize }) {
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Bytes.SizeOverflowError'
});
}
}
exports.SizeOverflowError = SizeOverflowError;
class SliceOffsetOutOfBoundsError extends Errors.BaseError {
constructor({ offset, position, size, }) {
super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \`${offset}\` is out-of-bounds (size: \`${size}\`).`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Bytes.SliceOffsetOutOfBoundsError'
});
}
}
exports.SliceOffsetOutOfBoundsError = SliceOffsetOutOfBoundsError;
class SizeExceedsPaddingSizeError extends Errors.BaseError {
constructor({ size, targetSize, type, }) {
super(`${type.charAt(0).toUpperCase()}${type
.slice(1)
.toLowerCase()} size (\`${size}\`) exceeds padding size (\`${targetSize}\`).`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Bytes.SizeExceedsPaddingSizeError'
});
}
}
exports.SizeExceedsPaddingSizeError = SizeExceedsPaddingSizeError;
//# sourceMappingURL=Bytes.js.map

1
node_modules/ox/_cjs/core/Bytes.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

14
node_modules/ox/_cjs/core/Caches.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checksum = void 0;
exports.clear = clear;
const lru_js_1 = require("./internal/lru.js");
const caches = {
checksum: new lru_js_1.LruMap(8192),
};
exports.checksum = caches.checksum;
function clear() {
for (const cache of Object.values(caches))
cache.clear();
}
//# sourceMappingURL=Caches.js.map

1
node_modules/ox/_cjs/core/Caches.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Caches.js","sourceRoot":"","sources":["../../core/Caches.ts"],"names":[],"mappings":";;;AAkBA,sBAEC;AAnBD,8CAA0C;AAE1C,MAAM,MAAM,GAAG;IACb,QAAQ,EAAgB,IAAI,eAAM,CAAkB,IAAI,CAAC;CAC1D,CAAA;AAEY,QAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;AAWvC,SAAgB,KAAK;IACnB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QAAE,KAAK,CAAC,KAAK,EAAE,CAAA;AAC1D,CAAC"}

36
node_modules/ox/_cjs/core/ContractAddress.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.from = from;
exports.fromCreate = fromCreate;
exports.fromCreate2 = fromCreate2;
const Address = require("./Address.js");
const Bytes = require("./Bytes.js");
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
const Rlp = require("./Rlp.js");
function from(options) {
if (options.salt)
return fromCreate2(options);
return fromCreate(options);
}
function fromCreate(options) {
const from = Bytes.fromHex(Address.from(options.from));
let nonce = Bytes.fromNumber(options.nonce);
if (nonce[0] === 0)
nonce = new Uint8Array([]);
return Address.from(`0x${Hash.keccak256(Rlp.fromBytes([from, nonce], { as: 'Hex' })).slice(26)}`);
}
function fromCreate2(options) {
const from = Bytes.fromHex(Address.from(options.from));
const salt = Bytes.padLeft(Bytes.validate(options.salt) ? options.salt : Bytes.fromHex(options.salt), 32);
const bytecodeHash = (() => {
if ('bytecodeHash' in options) {
if (Bytes.validate(options.bytecodeHash))
return options.bytecodeHash;
return Bytes.fromHex(options.bytecodeHash);
}
return Hash.keccak256(options.bytecode, { as: 'Bytes' });
})();
return Address.from(Hex.slice(Hash.keccak256(Bytes.concat(Bytes.fromHex('0xff'), from, salt, bytecodeHash), { as: 'Hex' }), 12));
}
//# sourceMappingURL=ContractAddress.js.map

1
node_modules/ox/_cjs/core/ContractAddress.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ContractAddress.js","sourceRoot":"","sources":["../../core/ContractAddress.ts"],"names":[],"mappings":";;AA2CA,oBAGC;AA4BD,gCASC;AAqCD,kCAwBC;AAhJD,wCAAuC;AACvC,oCAAmC;AAEnC,kCAAiC;AACjC,gCAA+B;AAC/B,gCAA+B;AAsC/B,SAAgB,IAAI,CAAC,OAAqB;IACxC,IAAI,OAAO,CAAC,IAAI;QAAE,OAAO,WAAW,CAAC,OAAO,CAAC,CAAA;IAC7C,OAAO,UAAU,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC;AA4BD,SAAgB,UAAU,CAAC,OAA2B;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IAEtD,IAAI,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC3C,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAAE,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAA;IAE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ACF,CAAA;AACH,CAAC"}

34
node_modules/ox/_cjs/core/Ens.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.labelhash = labelhash;
exports.namehash = namehash;
exports.normalize = normalize;
const ens_normalize_1 = require("@adraffy/ens-normalize");
const Bytes = require("./Bytes.js");
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
const internal = require("./internal/ens.js");
function labelhash(label) {
const result = new Uint8Array(32).fill(0);
if (!label)
return Hex.fromBytes(result);
return (internal.unwrapLabelhash(label) || Hash.keccak256(Hex.fromString(label)));
}
function namehash(name) {
let result = new Uint8Array(32).fill(0);
if (!name)
return Hex.fromBytes(result);
const labels = name.split('.');
for (let i = labels.length - 1; i >= 0; i -= 1) {
const hashFromEncodedLabel = internal.unwrapLabelhash(labels[i]);
const hashed = hashFromEncodedLabel
? Bytes.fromHex(hashFromEncodedLabel)
: Hash.keccak256(Bytes.fromString(labels[i]), { as: 'Bytes' });
result = Hash.keccak256(Bytes.concat(result, hashed), { as: 'Bytes' });
}
return Hex.fromBytes(result);
}
function normalize(name) {
return (0, ens_normalize_1.ens_normalize)(name);
}
//# sourceMappingURL=Ens.js.map

1
node_modules/ox/_cjs/core/Ens.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Ens.js","sourceRoot":"","sources":["../../core/Ens.ts"],"names":[],"mappings":";;AAsBA,8BAMC;AA0BD,4BAeC;AA4BD,8BAEC;AAnGD,0DAAsD;AACtD,oCAAmC;AAEnC,kCAAiC;AACjC,gCAA+B;AAC/B,8CAA6C;AAiB7C,SAAgB,SAAS,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACzC,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO,CACL,QAAQ,CAAC,eAAe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{ value: true });
exports.BaseError = void 0;
const errors_js_1 = require("./internal/errors.js");
class BaseError extends Error {
constructor(shortMessage, options = {}) {
const details = (() => {
if (options.cause instanceof BaseError) {
if (options.cause.details)
return options.cause.details;
if (options.cause.shortMessage)
return options.cause.shortMessage;
}
if (options.cause?.message)
return options.cause.message;
return options.details;
})();
const docsPath = (() => {
if (options.cause instanceof BaseError)
return options.cause.docsPath || options.docsPath;
return options.docsPath;
})();
const docsBaseUrl = 'https://oxlib.sh';
const docs = `${docsBaseUrl}${docsPath ?? ''}`;
const message = [
shortMessage || 'An error occurred.',
...(options.metaMessages ? ['', ...options.metaMessages] : []),
...(details || docsPath
? [
'',
details ? `Details: ${details}` : undefined,
docsPath ? `See: ${docs}` : undefined,
]
: []),
]
.filter((x) => typeof x === 'string')
.join('\n');
super(message, options.cause ? { cause: options.cause } : undefined);
Object.defineProperty(this, "details", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "docs", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "docsPath", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "shortMessage", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "cause", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'BaseError'
});
Object.defineProperty(this, "version", {
enumerable: true,
configurable: true,
writable: true,
value: `ox@${(0, errors_js_1.getVersion)()}`
});
this.cause = options.cause;
this.details = details;
this.docs = docs;
this.docsPath = docsPath;
this.shortMessage = shortMessage;
}
walk(fn) {
return walk(this, fn);
}
}
exports.BaseError = BaseError;
function walk(err, fn) {
if (fn?.(err))
return err;
if (err && typeof err === 'object' && 'cause' in err && err.cause)
return walk(err.cause, fn);
return fn ? null : err;
}
//# sourceMappingURL=Errors.js.map

1
node_modules/ox/_cjs/core/Errors.js.map generated vendored Normal file
View File

@@ -0,0 +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AE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAA;AACxB,CAAC"}

3
node_modules/ox/_cjs/core/Fee.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Fee.js.map

1
node_modules/ox/_cjs/core/Fee.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Fee.js","sourceRoot":"","sources":["../../core/Fee.ts"],"names":[],"mappings":""}

41
node_modules/ox/_cjs/core/Filter.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromRpc = fromRpc;
exports.toRpc = toRpc;
const Hex = require("./Hex.js");
function fromRpc(filter) {
const { fromBlock, toBlock } = filter;
return {
...filter,
...(fromBlock && {
fromBlock: Hex.validate(fromBlock, { strict: false })
? BigInt(fromBlock)
: fromBlock,
}),
...(toBlock && {
toBlock: Hex.validate(toBlock, { strict: false })
? BigInt(toBlock)
: toBlock,
}),
};
}
function toRpc(filter) {
const { address, topics, fromBlock, toBlock } = filter;
return {
...(address && { address }),
...(topics && { topics }),
...(typeof fromBlock !== 'undefined'
? {
fromBlock: typeof fromBlock === 'bigint'
? Hex.fromNumber(fromBlock)
: fromBlock,
}
: {}),
...(typeof toBlock !== 'undefined'
? {
toBlock: typeof toBlock === 'bigint' ? Hex.fromNumber(toBlock) : toBlock,
}
: {}),
};
}
//# sourceMappingURL=Filter.js.map

1
node_modules/ox/_cjs/core/Filter.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../core/Filter.ts"],"names":[],"mappings":";;AAiEA,0BAeC;AA+BD,sBAoBC;AAhID,gCAA+B;AA8D/B,SAAgB,OAAO,CAAC,MAAW;IACjC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IACrC,OAAO;QACL,GAAG,MAAM;QACT,GAAG,CAAC,SAAS,IAAI;YACf,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;gBACnD,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;gBACnB,CAAC,CAAC,SAAS;SACd,CAAC;QACF,GAAG,CAAC,OAAO,IAAI;YACb,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;gBAC/C,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBACjB,CAAC,CAAC,OAAO;SACZ,CAAC;KACO,CAAA;AACb,CAAC;AA+BD,SAAgB,KAAK,CAAC,MAAc;IAClC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IACtD,OAAO;QACL,GAAG,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3B,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;QACzB,GAAG,CAAC,OAAO,SAAS,KAAK,WAAW;YAClC,CAAC,CAAC;gBACE,SAAS,EACP,OAAO,SAAS,KAAK,QAAQ;oBAC3B,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;oBAC3B,CAAC,CAAC,SAAS;aAChB;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,OAAO,KAAK,WAAW;YAChC,CAAC,CAAC;gBACE,OAAO,EACL,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO;aAClE;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAA;AACH,CAAC"}

36
node_modules/ox/_cjs/core/Hash.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.keccak256 = keccak256;
exports.ripemd160 = ripemd160;
exports.sha256 = sha256;
exports.validate = validate;
const ripemd160_1 = require("@noble/hashes/ripemd160");
const sha3_1 = require("@noble/hashes/sha3");
const sha256_1 = require("@noble/hashes/sha256");
const Bytes = require("./Bytes.js");
const Hex = require("./Hex.js");
function keccak256(value, options = {}) {
const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;
const bytes = (0, sha3_1.keccak_256)(Bytes.from(value));
if (as === 'Bytes')
return bytes;
return Hex.fromBytes(bytes);
}
function ripemd160(value, options = {}) {
const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;
const bytes = (0, ripemd160_1.ripemd160)(Bytes.from(value));
if (as === 'Bytes')
return bytes;
return Hex.fromBytes(bytes);
}
function sha256(value, options = {}) {
const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;
const bytes = (0, sha256_1.sha256)(Bytes.from(value));
if (as === 'Bytes')
return bytes;
return Hex.fromBytes(bytes);
}
function validate(value) {
return Hex.validate(value) && Hex.size(value) === 32;
}
//# sourceMappingURL=Hash.js.map

1
node_modules/ox/_cjs/core/Hash.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Hash.js","sourceRoot":"","sources":["../../core/Hash.ts"],"names":[],"mappings":";;AA4CA,8BAaC;AAmCD,8BAaC;AAmCD,wBAaC;AAmCD,4BAEC;AA9LD,uDAAsE;AACtE,6CAAkE;AAClE,iDAA6D;AAC7D,oCAAmC;AAEnC,gCAA+B;AAuC/B,SAAgB,SAAS,CAMvB,KAAoC,EACpC,UAAiC,EAAE;IAEnC,MAAM,EAAE,EAAE,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAA;IACpE,MAAM,KAAK,GAAG,IAAA,iBAAe,EAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAChD,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,KAAc,CAAA;IACzC,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,CAAU,CAAA;AACtC,CAAC;AAmCD,SAAgB,SAAS,CAMvB,KAAoC,EACpC,UAAiC,EAAE;IAEnC,MAAM,EAAE,EAAE,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAA;IACpE,MAAM,KAAK,GAAG,IAAA,qBAAe,EAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAChD,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,KAAc,CAAA;IACzC,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,CAAU,CAAA;AACtC,CAAC;AAmCD,SAAgB,MAAM,CAMpB,KAAoC,EACpC,UAA8B,EAAE;IAEhC,MAAM,EAAE,EAAE,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAA;IACpE,MAAM,KAAK,GAAG,IAAA,eAAY,EAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7C,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,KAAc,CAAA;IACzC,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,CAAU,CAAA;AACtC,CAAC;AAmCD,SAAgB,QAAQ,CAAC,KAAa;IACpC,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;AACtD,CAAC"}

26
node_modules/ox/_cjs/core/HdKey.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromExtendedKey = fromExtendedKey;
exports.fromJson = fromJson;
exports.fromSeed = fromSeed;
exports.path = path;
const bip32_1 = require("@scure/bip32");
const Bytes = require("./Bytes.js");
const internal = require("./internal/hdKey.js");
function fromExtendedKey(extendedKey) {
const key = bip32_1.HDKey.fromExtendedKey(extendedKey);
return internal.fromScure(key);
}
function fromJson(json) {
return internal.fromScure(bip32_1.HDKey.fromJSON(json));
}
function fromSeed(seed, options = {}) {
const { versions } = options;
const key = bip32_1.HDKey.fromMasterSeed(Bytes.from(seed), versions);
return internal.fromScure(key);
}
function path(options = {}) {
const { account = 0, change = 0, index = 0 } = options;
return `m/44'/60'/${account}'/${change}/${index}`;
}
//# sourceMappingURL=HdKey.js.map

1
node_modules/ox/_cjs/core/HdKey.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"HdKey.js","sourceRoot":"","sources":["../../core/HdKey.ts"],"names":[],"mappings":";;AAoCA,0CAGC;AAsBD,4BAEC;AAoCD,4BAOC;AA4BD,oBAGC;AAzID,wCAAmD;AACnD,oCAAmC;AAInC,gDAA+C;AA+B/C,SAAgB,eAAe,CAAC,WAAmB;IACjD,MAAM,GAAG,GAAG,aAAK,CAAC,eAAe,CAAC,WAAW,CAAC,CAAA;IAC9C,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;AAChC,CAAC;AAsBD,SAAgB,QAAQ,CAAC,IAAuB;IAC9C,OAAO,QAAQ,CAAC,SAAS,CAAC,aAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AACjD,CAAC;AAoCD,SAAgB,QAAQ,CACtB,IAA2B,EAC3B,UAA4B,EAAE;IAE9B,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;IAC5B,MAAM,GAAG,GAAG,aAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC5D,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;AAChC,CAAC;AA4BD,SAAgB,IAAI,CAAC,UAAwB,EAAE;IAC7C,MAAM,EAAE,OAAO,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,OAAO,CAAA;IACtD,OAAO,aAAa,OAAO,KAAK,MAAM,IAAI,KAAK,EAAE,CAAA;AACnD,CAAC"}

301
node_modules/ox/_cjs/core/Hex.js generated vendored Normal file
View File

@@ -0,0 +1,301 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SizeExceedsPaddingSizeError = exports.SliceOffsetOutOfBoundsError = exports.SizeOverflowError = exports.InvalidLengthError = exports.InvalidHexValueError = exports.InvalidHexTypeError = exports.InvalidHexBooleanError = exports.IntegerOutOfRangeError = void 0;
exports.assert = assert;
exports.concat = concat;
exports.from = from;
exports.fromBoolean = fromBoolean;
exports.fromBytes = fromBytes;
exports.fromNumber = fromNumber;
exports.fromString = fromString;
exports.isEqual = isEqual;
exports.padLeft = padLeft;
exports.padRight = padRight;
exports.random = random;
exports.slice = slice;
exports.size = size;
exports.trimLeft = trimLeft;
exports.trimRight = trimRight;
exports.toBigInt = toBigInt;
exports.toBoolean = toBoolean;
exports.toBytes = toBytes;
exports.toNumber = toNumber;
exports.toString = toString;
exports.validate = validate;
const utils_1 = require("@noble/curves/abstract/utils");
const Bytes = require("./Bytes.js");
const Errors = require("./Errors.js");
const Json = require("./Json.js");
const internal_bytes = require("./internal/bytes.js");
const internal = require("./internal/hex.js");
const encoder = new TextEncoder();
const hexes = Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, '0'));
function assert(value, options = {}) {
const { strict = false } = options;
if (!value)
throw new InvalidHexTypeError(value);
if (typeof value !== 'string')
throw new InvalidHexTypeError(value);
if (strict) {
if (!/^0x[0-9a-fA-F]*$/.test(value))
throw new InvalidHexValueError(value);
}
if (!value.startsWith('0x'))
throw new InvalidHexValueError(value);
}
function concat(...values) {
return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}`;
}
function from(value) {
if (value instanceof Uint8Array)
return fromBytes(value);
if (Array.isArray(value))
return fromBytes(new Uint8Array(value));
return value;
}
function fromBoolean(value, options = {}) {
const hex = `0x${Number(value)}`;
if (typeof options.size === 'number') {
internal.assertSize(hex, options.size);
return padLeft(hex, options.size);
}
return hex;
}
function fromBytes(value, options = {}) {
let string = '';
for (let i = 0; i < value.length; i++)
string += hexes[value[i]];
const hex = `0x${string}`;
if (typeof options.size === 'number') {
internal.assertSize(hex, options.size);
return padRight(hex, options.size);
}
return hex;
}
function fromNumber(value, options = {}) {
const { signed, size } = options;
const value_ = BigInt(value);
let maxValue;
if (size) {
if (signed)
maxValue = (1n << (BigInt(size) * 8n - 1n)) - 1n;
else
maxValue = 2n ** (BigInt(size) * 8n) - 1n;
}
else if (typeof value === 'number') {
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
}
const minValue = typeof maxValue === 'bigint' && signed ? -maxValue - 1n : 0;
if ((maxValue && value_ > maxValue) || value_ < minValue) {
const suffix = typeof value === 'bigint' ? 'n' : '';
throw new IntegerOutOfRangeError({
max: maxValue ? `${maxValue}${suffix}` : undefined,
min: `${minValue}${suffix}`,
signed,
size,
value: `${value}${suffix}`,
});
}
const stringValue = (signed && value_ < 0 ? (1n << BigInt(size * 8)) + BigInt(value_) : value_).toString(16);
const hex = `0x${stringValue}`;
if (size)
return padLeft(hex, size);
return hex;
}
function fromString(value, options = {}) {
return fromBytes(encoder.encode(value), options);
}
function isEqual(hexA, hexB) {
return (0, utils_1.equalBytes)(Bytes.fromHex(hexA), Bytes.fromHex(hexB));
}
function padLeft(value, size) {
return internal.pad(value, { dir: 'left', size });
}
function padRight(value, size) {
return internal.pad(value, { dir: 'right', size });
}
function random(length) {
return fromBytes(Bytes.random(length));
}
function slice(value, start, end, options = {}) {
const { strict } = options;
internal.assertStartOffset(value, start);
const value_ = `0x${value
.replace('0x', '')
.slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;
if (strict)
internal.assertEndOffset(value_, start, end);
return value_;
}
function size(value) {
return Math.ceil((value.length - 2) / 2);
}
function trimLeft(value) {
return internal.trim(value, { dir: 'left' });
}
function trimRight(value) {
return internal.trim(value, { dir: 'right' });
}
function toBigInt(hex, options = {}) {
const { signed } = options;
if (options.size)
internal.assertSize(hex, options.size);
const value = BigInt(hex);
if (!signed)
return value;
const size = (hex.length - 2) / 2;
const max_unsigned = (1n << (BigInt(size) * 8n)) - 1n;
const max_signed = max_unsigned >> 1n;
if (value <= max_signed)
return value;
return value - max_unsigned - 1n;
}
function toBoolean(hex, options = {}) {
if (options.size)
internal.assertSize(hex, options.size);
const hex_ = trimLeft(hex);
if (hex_ === '0x')
return false;
if (hex_ === '0x1')
return true;
throw new InvalidHexBooleanError(hex);
}
function toBytes(hex, options = {}) {
return Bytes.fromHex(hex, options);
}
function toNumber(hex, options = {}) {
const { signed, size } = options;
if (!signed && !size)
return Number(hex);
return Number(toBigInt(hex, options));
}
function toString(hex, options = {}) {
const { size } = options;
let bytes = Bytes.fromHex(hex);
if (size) {
internal_bytes.assertSize(bytes, size);
bytes = Bytes.trimRight(bytes);
}
return new TextDecoder().decode(bytes);
}
function validate(value, options = {}) {
const { strict = false } = options;
try {
assert(value, { strict });
return true;
}
catch {
return false;
}
}
class IntegerOutOfRangeError extends Errors.BaseError {
constructor({ max, min, signed, size, value, }) {
super(`Number \`${value}\` is not in safe${size ? ` ${size * 8}-bit` : ''}${signed ? ' signed' : ' unsigned'} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.IntegerOutOfRangeError'
});
}
}
exports.IntegerOutOfRangeError = IntegerOutOfRangeError;
class InvalidHexBooleanError extends Errors.BaseError {
constructor(hex) {
super(`Hex value \`"${hex}"\` is not a valid boolean.`, {
metaMessages: [
'The hex value must be `"0x0"` (false) or `"0x1"` (true).',
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.InvalidHexBooleanError'
});
}
}
exports.InvalidHexBooleanError = InvalidHexBooleanError;
class InvalidHexTypeError extends Errors.BaseError {
constructor(value) {
super(`Value \`${typeof value === 'object' ? Json.stringify(value) : value}\` of type \`${typeof value}\` is an invalid hex type.`, {
metaMessages: ['Hex types must be represented as `"0x${string}"`.'],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.InvalidHexTypeError'
});
}
}
exports.InvalidHexTypeError = InvalidHexTypeError;
class InvalidHexValueError extends Errors.BaseError {
constructor(value) {
super(`Value \`${value}\` is an invalid hex value.`, {
metaMessages: [
'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).',
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.InvalidHexValueError'
});
}
}
exports.InvalidHexValueError = InvalidHexValueError;
class InvalidLengthError extends Errors.BaseError {
constructor(value) {
super(`Hex value \`"${value}"\` is an odd length (${value.length - 2} nibbles).`, {
metaMessages: ['It must be an even length.'],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.InvalidLengthError'
});
}
}
exports.InvalidLengthError = InvalidLengthError;
class SizeOverflowError extends Errors.BaseError {
constructor({ givenSize, maxSize }) {
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.SizeOverflowError'
});
}
}
exports.SizeOverflowError = SizeOverflowError;
class SliceOffsetOutOfBoundsError extends Errors.BaseError {
constructor({ offset, position, size, }) {
super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \`${offset}\` is out-of-bounds (size: \`${size}\`).`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.SliceOffsetOutOfBoundsError'
});
}
}
exports.SliceOffsetOutOfBoundsError = SliceOffsetOutOfBoundsError;
class SizeExceedsPaddingSizeError extends Errors.BaseError {
constructor({ size, targetSize, type, }) {
super(`${type.charAt(0).toUpperCase()}${type
.slice(1)
.toLowerCase()} size (\`${size}\`) exceeds padding size (\`${targetSize}\`).`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Hex.SizeExceedsPaddingSizeError'
});
}
}
exports.SizeExceedsPaddingSizeError = SizeExceedsPaddingSizeError;
//# sourceMappingURL=Hex.js.map

1
node_modules/ox/_cjs/core/Hex.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

23
node_modules/ox/_cjs/core/Json.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.stringify = stringify;
const bigIntSuffix = '#__bigint';
function parse(string, reviver) {
return JSON.parse(string, (key, value_) => {
const value = value_;
if (typeof value === 'string' && value.endsWith(bigIntSuffix))
return BigInt(value.slice(0, -bigIntSuffix.length));
return typeof reviver === 'function' ? reviver(key, value) : value;
});
}
function stringify(value, replacer, space) {
return JSON.stringify(value, (key, value) => {
if (typeof replacer === 'function')
return replacer(key, value);
if (typeof value === 'bigint')
return value.toString() + bigIntSuffix;
return value;
}, space);
}
//# sourceMappingURL=Json.js.map

1
node_modules/ox/_cjs/core/Json.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Json.js","sourceRoot":"","sources":["../../core/Json.ts"],"names":[],"mappings":";;AAsBA,sBAUC;AAyBD,8BAcC;AArED,MAAM,YAAY,GAAG,WAAW,CAAA;AAoBhC,SAAgB,KAAK,CACnB,MAAc,EACd,OAAmE;IAEnE,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACxC,MAAM,KAAK,GAAG,MAAM,CAAA;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC3D,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA;QACrD,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IACpE,CAAC,CAAC,CAAA;AACJ,CAAC;AAyBD,SAAgB,SAAS,CACvB,KAAU,EACV,QAA2E,EAC3E,KAAmC;IAEnC,OAAO,IAAI,CAAC,SAAS,CACnB,KAAK,EACL,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACb,IAAI,OAAO,QAAQ,KAAK,UAAU;YAAE,OAAO,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC,QAAQ,EAAE,GAAG,YAAY,CAAA;QACrE,OAAO,KAAK,CAAA;IACd,CAAC,EACD,KAAK,CACN,CAAA;AACH,CAAC"}

13
node_modules/ox/_cjs/core/Kzg.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.versionedHashVersion = void 0;
exports.from = from;
exports.versionedHashVersion = 1;
function from(value) {
const { blobToKzgCommitment, computeBlobKzgProof } = value;
return {
blobToKzgCommitment,
computeBlobKzgProof,
};
}
//# sourceMappingURL=Kzg.js.map

1
node_modules/ox/_cjs/core/Kzg.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Kzg.js","sourceRoot":"","sources":["../../core/Kzg.ts"],"names":[],"mappings":";;;AAqCA,oBAMC;AAvCY,QAAA,oBAAoB,GAAG,CAAC,CAAA;AAiCrC,SAAgB,IAAI,CAAC,KAAU;IAC7B,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAA;IAC1D,OAAO;QACL,mBAAmB;QACnB,mBAAmB;KACpB,CAAA;AACH,CAAC"}

33
node_modules/ox/_cjs/core/Log.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromRpc = fromRpc;
exports.toRpc = toRpc;
const Hex = require("./Hex.js");
function fromRpc(log, _options = {}) {
return {
...log,
blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,
logIndex: log.logIndex ? Number(log.logIndex) : null,
transactionIndex: log.transactionIndex
? Number(log.transactionIndex)
: null,
};
}
function toRpc(log, _options = {}) {
return {
address: log.address,
blockHash: log.blockHash,
blockNumber: typeof log.blockNumber === 'bigint'
? Hex.fromNumber(log.blockNumber)
: null,
data: log.data,
logIndex: typeof log.logIndex === 'number' ? Hex.fromNumber(log.logIndex) : null,
topics: log.topics,
transactionHash: log.transactionHash,
transactionIndex: typeof log.transactionIndex === 'number'
? Hex.fromNumber(log.transactionIndex)
: null,
removed: log.removed,
};
}
//# sourceMappingURL=Log.js.map

1
node_modules/ox/_cjs/core/Log.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Log.js","sourceRoot":"","sources":["../../core/Log.ts"],"names":[],"mappings":";;AAyIA,0BAeC;AAyDD,sBAsBC;AArOD,gCAA+B;AAuI/B,SAAgB,OAAO,CAIrB,GAAuB,EACvB,WAAqC,EAAE;IAEvC,OAAO;QACL,GAAG,GAAG;QACN,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;QAC7D,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QACpD,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;YACpC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC9B,CAAC,CAAC,IAAI;KACO,CAAA;AACnB,CAAC;AAyDD,SAAgB,KAAK,CAGnB,GAAQ,EAAE,WAAmC,EAAE;IAC/C,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,WAAW,EACT,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ;YACjC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC;YACjC,CAAC,CAAC,IAAI;QACV,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,QAAQ,EACN,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QACxE,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,eAAe,EAAE,GAAG,CAAC,eAAe;QACpC,gBAAgB,EACd,OAAO,GAAG,CAAC,gBAAgB,KAAK,QAAQ;YACtC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC;YACtC,CAAC,CAAC,IAAI;QACV,OAAO,EAAE,GAAG,CAAC,OAAO;KACL,CAAA;AACnB,CAAC"}

51
node_modules/ox/_cjs/core/Mnemonic.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.traditionalChinese = exports.spanish = exports.simplifiedChinese = exports.portuguese = exports.korean = exports.japanese = exports.italian = exports.french = exports.czech = exports.english = exports.path = void 0;
exports.random = random;
exports.toHdKey = toHdKey;
exports.toPrivateKey = toPrivateKey;
exports.toSeed = toSeed;
exports.validate = validate;
const bip39_1 = require("@scure/bip39");
const Bytes = require("./Bytes.js");
const HdKey = require("./HdKey.js");
var HdKey_js_1 = require("./HdKey.js");
Object.defineProperty(exports, "path", { enumerable: true, get: function () { return HdKey_js_1.path; } });
var wordlists_js_1 = require("./internal/mnemonic/wordlists.js");
Object.defineProperty(exports, "english", { enumerable: true, get: function () { return wordlists_js_1.english; } });
Object.defineProperty(exports, "czech", { enumerable: true, get: function () { return wordlists_js_1.czech; } });
Object.defineProperty(exports, "french", { enumerable: true, get: function () { return wordlists_js_1.french; } });
Object.defineProperty(exports, "italian", { enumerable: true, get: function () { return wordlists_js_1.italian; } });
Object.defineProperty(exports, "japanese", { enumerable: true, get: function () { return wordlists_js_1.japanese; } });
Object.defineProperty(exports, "korean", { enumerable: true, get: function () { return wordlists_js_1.korean; } });
Object.defineProperty(exports, "portuguese", { enumerable: true, get: function () { return wordlists_js_1.portuguese; } });
Object.defineProperty(exports, "simplifiedChinese", { enumerable: true, get: function () { return wordlists_js_1.simplifiedChinese; } });
Object.defineProperty(exports, "spanish", { enumerable: true, get: function () { return wordlists_js_1.spanish; } });
Object.defineProperty(exports, "traditionalChinese", { enumerable: true, get: function () { return wordlists_js_1.traditionalChinese; } });
function random(wordlist, options = {}) {
const { strength = 128 } = options;
return (0, bip39_1.generateMnemonic)(wordlist, strength);
}
function toHdKey(mnemonic, options = {}) {
const { passphrase } = options;
const seed = toSeed(mnemonic, { passphrase });
return HdKey.fromSeed(seed);
}
function toPrivateKey(mnemonic, options = {}) {
const { path = HdKey.path(), passphrase } = options;
const hdKey = toHdKey(mnemonic, { passphrase }).derive(path);
if (options.as === 'Bytes')
return Bytes.from(hdKey.privateKey);
return hdKey.privateKey;
}
function toSeed(mnemonic, options = {}) {
const { passphrase } = options;
const seed = (0, bip39_1.mnemonicToSeedSync)(mnemonic, passphrase);
if (options.as === 'Hex')
return Bytes.toHex(seed);
return seed;
}
function validate(mnemonic, wordlist) {
return (0, bip39_1.validateMnemonic)(mnemonic, wordlist);
}
//# sourceMappingURL=Mnemonic.js.map

1
node_modules/ox/_cjs/core/Mnemonic.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Mnemonic.js","sourceRoot":"","sources":["../../core/Mnemonic.ts"],"names":[],"mappings":";;;AAwCA,wBAMC;AAyCD,0BAOC;AA0CD,oCAQC;AAmCD,wBAQC;AAmCD,4BAEC;AAhOD,wCAIqB;AACrB,oCAAmC;AAEnC,oCAAmC;AAG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AAE,UAAU,EAAE,GAAG,OAAO,CAAA;IAC9B,MAAM,IAAI,GAAG,IAAA,0BAAkB,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;IACrD,IAAI,OAAO,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAU,CAAA;IAC3D,OAAO,IAAa,CAAA;AACtB,CAAC;AAmCD,SAAgB,QAAQ,CAAC,QAAgB,EAAE,QAAkB;IAC3D,OAAO,IAAA,wBAAgB,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAC7C,CAAC"}

56
node_modules/ox/_cjs/core/P256.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.noble = void 0;
exports.getPublicKey = getPublicKey;
exports.randomPrivateKey = randomPrivateKey;
exports.recoverPublicKey = recoverPublicKey;
exports.sign = sign;
exports.verify = verify;
const p256_1 = require("@noble/curves/p256");
const Bytes = require("./Bytes.js");
const Hex = require("./Hex.js");
const PublicKey = require("./PublicKey.js");
const Entropy = require("./internal/entropy.js");
exports.noble = p256_1.secp256r1;
function getPublicKey(options) {
const { privateKey } = options;
const point = p256_1.secp256r1.ProjectivePoint.fromPrivateKey(typeof privateKey === 'string'
? privateKey.slice(2)
: Hex.fromBytes(privateKey).slice(2));
return PublicKey.from(point);
}
function randomPrivateKey(options = {}) {
const { as = 'Hex' } = options;
const bytes = p256_1.secp256r1.utils.randomPrivateKey();
if (as === 'Hex')
return Hex.fromBytes(bytes);
return bytes;
}
function recoverPublicKey(options) {
const { payload, signature } = options;
const { r, s, yParity } = signature;
const signature_ = new p256_1.secp256r1.Signature(BigInt(r), BigInt(s)).addRecoveryBit(yParity);
const payload_ = payload instanceof Uint8Array ? Hex.fromBytes(payload) : payload;
const point = signature_.recoverPublicKey(payload_.substring(2));
return PublicKey.from(point);
}
function sign(options) {
const { extraEntropy = Entropy.extraEntropy, hash, payload, privateKey, } = options;
const { r, s, recovery } = p256_1.secp256r1.sign(payload instanceof Uint8Array ? payload : Bytes.fromHex(payload), privateKey instanceof Uint8Array ? privateKey : Bytes.fromHex(privateKey), {
extraEntropy: typeof extraEntropy === 'boolean'
? extraEntropy
: Hex.from(extraEntropy).slice(2),
lowS: true,
...(hash ? { prehash: true } : {}),
});
return {
r,
s,
yParity: recovery,
};
}
function verify(options) {
const { hash, payload, publicKey, signature } = options;
return p256_1.secp256r1.verify(signature, payload instanceof Uint8Array ? payload : Bytes.fromHex(payload), PublicKey.toHex(publicKey).substring(2), ...(hash ? [{ prehash: true, lowS: true }] : []));
}
//# sourceMappingURL=P256.js.map

1
node_modules/ox/_cjs/core/P256.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"P256.js","sourceRoot":"","sources":["../../core/P256.ts"],"names":[],"mappings":";;;AAwBA,oCAUC;AA0BD,4CAOC;AAoCD,4CAaC;AAgCD,oBAwBC;AAgDD,wBAQC;AApOD,6CAA8C;AAC9C,oCAAmC;AAEnC,gCAA+B;AAC/B,4CAA2C;AAE3C,iDAAgD;AAGnC,QAAA,KAAK,GAAG,gBAAS,CAAA;AAe9B,SAAgB,YAAY,CAC1B,OAA6B;IAE7B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;IAC9B,MAAM,KAAK,GAAG,gBAAS,CAAC,eAAe,CAAC,cAAc,CACpD,OAAO,UAAU,KAAK,QAAQ;QAC5B,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CACvC,CAAA;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AA0BD,SAAgB,gBAAgB,CAC9B,UAAwC,EAAE;IAE1C,MAAM,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,CAAA;IAC9B,MAAM,KAAK,GAAG,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YAAY,KAAK,SAAS;YAC/B,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,IAAI,EAAE,IAAI;QACV,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnC,CACF,CAAA;IACD,OAAO;QACL,CAAC;QACD,CAAC;QACD,OAAO,EAAE,QAAQ;KAClB,CAAA;AACH,CAAC;AAgDD,SAAgB,MAAM,CAAC,OAAuB;IAC5C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;IACvD,OAAO,gBAAS,CAAC,MAAM,CACrB,SAAS,EACT,OAAO,YAAY,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAChE,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACvC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CACjD,CAAA;AACH,CAAC"}

14
node_modules/ox/_cjs/core/PersonalMessage.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.encode = encode;
exports.getSignPayload = getSignPayload;
const Hash = require("./Hash.js");
const Hex = require("./Hex.js");
function encode(data) {
const message = Hex.from(data);
return Hex.concat('0x19', Hex.fromString('Ethereum Signed Message:\n' + Hex.size(message)), message);
}
function getSignPayload(data) {
return Hash.keccak256(encode(data));
}
//# sourceMappingURL=PersonalMessage.js.map

1
node_modules/ox/_cjs/core/PersonalMessage.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"PersonalMessage.js","sourceRoot":"","sources":["../../core/PersonalMessage.ts"],"names":[],"mappings":";;AAoBA,wBAQC;AAyBD,wCAEC;AArDD,kCAAiC;AACjC,gCAA+B;AAiB/B,SAAgB,MAAM,CAAC,IAA2B;IAChD,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,GAAG,CAAC,MAAM,CAEf,MAAM,EACN,GAAG,CAAC,UAAU,CAAC,4BAA4B,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAChE,OAAO,CACR,CAAA;AACH,CAAC;AAyBD,SAAgB,cAAc,CAAC,IAA2B;IACxD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;AACrC,CAAC"}

235
node_modules/ox/_cjs/core/Provider.js generated vendored Normal file
View File

@@ -0,0 +1,235 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsUndefinedError = exports.ChainDisconnectedError = exports.DisconnectedError = exports.UnsupportedMethodError = exports.UnauthorizedError = exports.UserRejectedRequestError = exports.ProviderRpcError = void 0;
exports.createEmitter = createEmitter;
exports.from = from;
exports.parseError = parseError;
const eventemitter3_1 = require("eventemitter3");
const Errors = require("./Errors.js");
const RpcResponse = require("./RpcResponse.js");
class ProviderRpcError extends Error {
constructor(code, message) {
super(message);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'ProviderRpcError'
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "details", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.code = code;
this.details = message;
}
}
exports.ProviderRpcError = ProviderRpcError;
class UserRejectedRequestError extends ProviderRpcError {
constructor({ message = 'The user rejected the request.', } = {}) {
super(4001, message);
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4001
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Provider.UserRejectedRequestError'
});
}
}
exports.UserRejectedRequestError = UserRejectedRequestError;
Object.defineProperty(UserRejectedRequestError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4001
});
class UnauthorizedError extends ProviderRpcError {
constructor({ message = 'The requested method and/or account has not been authorized by the user.', } = {}) {
super(4100, message);
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4100
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Provider.UnauthorizedError'
});
}
}
exports.UnauthorizedError = UnauthorizedError;
Object.defineProperty(UnauthorizedError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4100
});
class UnsupportedMethodError extends ProviderRpcError {
constructor({ message = 'The provider does not support the requested method.', } = {}) {
super(4200, message);
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4200
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Provider.UnsupportedMethodError'
});
}
}
exports.UnsupportedMethodError = UnsupportedMethodError;
Object.defineProperty(UnsupportedMethodError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4200
});
class DisconnectedError extends ProviderRpcError {
constructor({ message = 'The provider is disconnected from all chains.', } = {}) {
super(4900, message);
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4900
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Provider.DisconnectedError'
});
}
}
exports.DisconnectedError = DisconnectedError;
Object.defineProperty(DisconnectedError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4900
});
class ChainDisconnectedError extends ProviderRpcError {
constructor({ message = 'The provider is not connected to the requested chain.', } = {}) {
super(4901, message);
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4901
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Provider.ChainDisconnectedError'
});
}
}
exports.ChainDisconnectedError = ChainDisconnectedError;
Object.defineProperty(ChainDisconnectedError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: 4901
});
function createEmitter() {
const emitter = new eventemitter3_1.EventEmitter();
return {
get eventNames() {
return emitter.eventNames.bind(emitter);
},
get listenerCount() {
return emitter.listenerCount.bind(emitter);
},
get listeners() {
return emitter.listeners.bind(emitter);
},
addListener: emitter.addListener.bind(emitter),
emit: emitter.emit.bind(emitter),
off: emitter.off.bind(emitter),
on: emitter.on.bind(emitter),
once: emitter.once.bind(emitter),
removeAllListeners: emitter.removeAllListeners.bind(emitter),
removeListener: emitter.removeListener.bind(emitter),
};
}
function from(provider, options = {}) {
const { includeEvents = true } = options;
if (!provider)
throw new IsUndefinedError();
return {
...(includeEvents
? {
on: provider.on?.bind(provider),
removeListener: provider.removeListener?.bind(provider),
}
: {}),
async request(args) {
try {
const result = await provider.request(args);
if (result &&
typeof result === 'object' &&
'jsonrpc' in result)
return RpcResponse.parse(result);
return result;
}
catch (error) {
throw parseError(error);
}
},
};
}
function parseError(errorObject) {
const errorObject_ = errorObject;
const error = RpcResponse.parseError(errorObject_);
if (error instanceof RpcResponse.InternalError) {
if (!error.data)
return error;
const { code } = error.data;
if (code === DisconnectedError.code)
return new DisconnectedError(errorObject_);
if (code === ChainDisconnectedError.code)
return new ChainDisconnectedError(errorObject_);
if (code === UserRejectedRequestError.code)
return new UserRejectedRequestError(errorObject_);
if (code === UnauthorizedError.code)
return new UnauthorizedError(errorObject_);
if (code === UnsupportedMethodError.code)
return new UnsupportedMethodError(errorObject_);
}
return error;
}
class IsUndefinedError extends Errors.BaseError {
constructor() {
super('`provider` is undefined.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Provider.IsUndefinedError'
});
}
}
exports.IsUndefinedError = IsUndefinedError;
//# sourceMappingURL=Provider.js.map

1
node_modules/ox/_cjs/core/Provider.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Provider.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QACtD,IAAI,IAAI,KAAK,iBAAiB,CAAC,IAAI;YACjC,OAAO,IAAI,iBAAiB,CAAC,YAAY,CAAU,CAAA;QACrD,IAAI,IAAI,KAAK,sBAAsB,CAAC,IAAI;YACtC,OAAO,IAAI,sBAAsB,CAAC,YAAY,CAAU,CAAA;QAC1D,IAAI,IAAI,KAAK,wBAAwB,CAAC,IAAI;YACxC,OAAO,IAAI,wBAAwB,CAAC,YAAY,CAAU,CAAA;QAC5D,IAAI,IAAI,KAAK,iBAAiB,CAAC,IAAI;YACjC,OAAO,IAAI,iBAAiB,CAAC,YAAY,CAAU,CAAA;QACrD,IAAI,IAAI,KAAK,sBAAsB,CAAC,IAAI;YACtC,OAAO,IAAI,sBAAsB,CAAC,YAAY,CAAU,CAAA;IAC5D,CAAC;IACD,OAAO,KAAc,CAAA;AACvB,CAAC;AA6CD,MAAa,gBAAiB,SAAQ,MAAM,CAAC,SAAS;IAGpD;QACE,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAHjB;;;;mBAAO,2BAA2B;WAAA;IAIpD,CAAC;CACF;AAND,4CAMC"}

186
node_modules/ox/_cjs/core/PublicKey.js generated vendored Normal file
View File

@@ -0,0 +1,186 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidSerializedSizeError = exports.InvalidUncompressedPrefixError = exports.InvalidCompressedPrefixError = exports.InvalidPrefixError = exports.InvalidError = void 0;
exports.assert = assert;
exports.compress = compress;
exports.from = from;
exports.fromBytes = fromBytes;
exports.fromHex = fromHex;
exports.toBytes = toBytes;
exports.toHex = toHex;
exports.validate = validate;
const Bytes = require("./Bytes.js");
const Errors = require("./Errors.js");
const Hex = require("./Hex.js");
const Json = require("./Json.js");
function assert(publicKey, options = {}) {
const { compressed } = options;
const { prefix, x, y } = publicKey;
if (compressed === false ||
(typeof x === 'bigint' && typeof y === 'bigint')) {
if (prefix !== 4)
throw new InvalidPrefixError({
prefix,
cause: new InvalidUncompressedPrefixError(),
});
return;
}
if (compressed === true ||
(typeof x === 'bigint' && typeof y === 'undefined')) {
if (prefix !== 3 && prefix !== 2)
throw new InvalidPrefixError({
prefix,
cause: new InvalidCompressedPrefixError(),
});
return;
}
throw new InvalidError({ publicKey });
}
function compress(publicKey) {
const { x, y } = publicKey;
return {
prefix: y % 2n === 0n ? 2 : 3,
x,
};
}
function from(value) {
const publicKey = (() => {
if (Hex.validate(value))
return fromHex(value);
if (Bytes.validate(value))
return fromBytes(value);
const { prefix, x, y } = value;
if (typeof x === 'bigint' && typeof y === 'bigint')
return { prefix: prefix ?? 0x04, x, y };
return { prefix, x };
})();
assert(publicKey);
return publicKey;
}
function fromBytes(publicKey) {
return fromHex(Hex.fromBytes(publicKey));
}
function fromHex(publicKey) {
if (publicKey.length !== 132 &&
publicKey.length !== 130 &&
publicKey.length !== 68)
throw new InvalidSerializedSizeError({ publicKey });
if (publicKey.length === 130) {
const x = BigInt(Hex.slice(publicKey, 0, 32));
const y = BigInt(Hex.slice(publicKey, 32, 64));
return {
prefix: 4,
x,
y,
};
}
if (publicKey.length === 132) {
const prefix = Number(Hex.slice(publicKey, 0, 1));
const x = BigInt(Hex.slice(publicKey, 1, 33));
const y = BigInt(Hex.slice(publicKey, 33, 65));
return {
prefix,
x,
y,
};
}
const prefix = Number(Hex.slice(publicKey, 0, 1));
const x = BigInt(Hex.slice(publicKey, 1, 33));
return {
prefix,
x,
};
}
function toBytes(publicKey, options = {}) {
return Bytes.fromHex(toHex(publicKey, options));
}
function toHex(publicKey, options = {}) {
assert(publicKey);
const { prefix, x, y } = publicKey;
const { includePrefix = true } = options;
const publicKey_ = Hex.concat(includePrefix ? Hex.fromNumber(prefix, { size: 1 }) : '0x', Hex.fromNumber(x, { size: 32 }), typeof y === 'bigint' ? Hex.fromNumber(y, { size: 32 }) : '0x');
return publicKey_;
}
function validate(publicKey, options = {}) {
try {
assert(publicKey, options);
return true;
}
catch (error) {
return false;
}
}
class InvalidError extends Errors.BaseError {
constructor({ publicKey }) {
super(`Value \`${Json.stringify(publicKey)}\` is not a valid public key.`, {
metaMessages: [
'Public key must contain:',
'- an `x` and `prefix` value (compressed)',
'- an `x`, `y`, and `prefix` value (uncompressed)',
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'PublicKey.InvalidError'
});
}
}
exports.InvalidError = InvalidError;
class InvalidPrefixError extends Errors.BaseError {
constructor({ prefix, cause }) {
super(`Prefix "${prefix}" is invalid.`, {
cause,
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'PublicKey.InvalidPrefixError'
});
}
}
exports.InvalidPrefixError = InvalidPrefixError;
class InvalidCompressedPrefixError extends Errors.BaseError {
constructor() {
super('Prefix must be 2 or 3 for compressed public keys.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'PublicKey.InvalidCompressedPrefixError'
});
}
}
exports.InvalidCompressedPrefixError = InvalidCompressedPrefixError;
class InvalidUncompressedPrefixError extends Errors.BaseError {
constructor() {
super('Prefix must be 4 for uncompressed public keys.');
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'PublicKey.InvalidUncompressedPrefixError'
});
}
}
exports.InvalidUncompressedPrefixError = InvalidUncompressedPrefixError;
class InvalidSerializedSizeError extends Errors.BaseError {
constructor({ publicKey }) {
super(`Value \`${publicKey}\` is an invalid public key size.`, {
metaMessages: [
'Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).',
`Received ${Hex.size(Hex.from(publicKey))} bytes.`,
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'PublicKey.InvalidSerializedSizeError'
});
}
}
exports.InvalidSerializedSizeError = InvalidSerializedSizeError;
//# sourceMappingURL=PublicKey.js.map

1
node_modules/ox/_cjs/core/PublicKey.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"PublicKey.js","sourceRoot":"","sources":["../../core/PublicKey.ts"],"names":[],"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,KAAK,CAAC,mDAAmD,CAAC,CAAA;QAH1C;;;;mBAAO,wCAAwC;WAAA;IAIjE,CAAC;CACF;AAND,oEAMC;AAGD,MAAa,8BAA+B,SAAQ,MAAM,CAAC,SAAS;IAGlE;QACE,KAAK,CAAC,gDAAgD,CAAC,CAAA;QAHvC;;;;mBAAO,0CAA0C;WAAA;IAInE,CAAC;CACF;AAND,wEAMC;AAGD,MAAa,0BAA2B,SAAQ,MAAM,CAAC,SAAS;IAG9D,YAAY,EAAE,SAAS,EAAwC;QAC7D,KAAK,CAAC,WAAW,SAAS,mCAAmC,EAAE;YAC7D,YAAY,EAAE;gBACZ,wGAAwG;gBACxG,YAAY,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS;aACnD;SACF,CAAC,CAAA;QARc;;;;mBAAO,sCAAsC;WAAA;IAS/D,CAAC;CACF;AAXD,gEAWC"}

173
node_modules/ox/_cjs/core/Rlp.js generated vendored Normal file
View File

@@ -0,0 +1,173 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBytes = toBytes;
exports.toHex = toHex;
exports.to = to;
exports.decodeRlpCursor = decodeRlpCursor;
exports.readLength = readLength;
exports.readList = readList;
exports.from = from;
exports.fromBytes = fromBytes;
exports.fromHex = fromHex;
const Bytes = require("./Bytes.js");
const Errors = require("./Errors.js");
const Hex = require("./Hex.js");
const Cursor = require("./internal/cursor.js");
function toBytes(value) {
return to(value, 'Bytes');
}
function toHex(value) {
return to(value, 'Hex');
}
function to(value, to) {
const to_ = to ?? (typeof value === 'string' ? 'Hex' : 'Bytes');
const bytes = (() => {
if (typeof value === 'string') {
if (value.length > 3 && value.length % 2 !== 0)
throw new Hex.InvalidLengthError(value);
return Bytes.fromHex(value);
}
return value;
})();
const cursor = Cursor.create(bytes, {
recursiveReadLimit: Number.POSITIVE_INFINITY,
});
const result = decodeRlpCursor(cursor, to_);
return result;
}
function decodeRlpCursor(cursor, to = 'Hex') {
if (cursor.bytes.length === 0)
return (to === 'Hex' ? Hex.fromBytes(cursor.bytes) : cursor.bytes);
const prefix = cursor.readByte();
if (prefix < 0x80)
cursor.decrementPosition(1);
if (prefix < 0xc0) {
const length = readLength(cursor, prefix, 0x80);
const bytes = cursor.readBytes(length);
return (to === 'Hex' ? Hex.fromBytes(bytes) : bytes);
}
const length = readLength(cursor, prefix, 0xc0);
return readList(cursor, length, to);
}
function readLength(cursor, prefix, offset) {
if (offset === 0x80 && prefix < 0x80)
return 1;
if (prefix <= offset + 55)
return prefix - offset;
if (prefix === offset + 55 + 1)
return cursor.readUint8();
if (prefix === offset + 55 + 2)
return cursor.readUint16();
if (prefix === offset + 55 + 3)
return cursor.readUint24();
if (prefix === offset + 55 + 4)
return cursor.readUint32();
throw new Errors.BaseError('Invalid RLP prefix');
}
function readList(cursor, length, to) {
const position = cursor.position;
const value = [];
while (cursor.position - position < length)
value.push(decodeRlpCursor(cursor, to));
return value;
}
function from(value, options) {
const { as } = options;
const encodable = getEncodable(value);
const cursor = Cursor.create(new Uint8Array(encodable.length));
encodable.encode(cursor);
if (as === 'Hex')
return Hex.fromBytes(cursor.bytes);
return cursor.bytes;
}
function fromBytes(bytes, options = {}) {
const { as = 'Bytes' } = options;
return from(bytes, { as });
}
function fromHex(hex, options = {}) {
const { as = 'Hex' } = options;
return from(hex, { as });
}
function getEncodable(bytes) {
if (Array.isArray(bytes))
return getEncodableList(bytes.map((x) => getEncodable(x)));
return getEncodableBytes(bytes);
}
function getEncodableList(list) {
const bodyLength = list.reduce((acc, x) => acc + x.length, 0);
const sizeOfBodyLength = getSizeOfLength(bodyLength);
const length = (() => {
if (bodyLength <= 55)
return 1 + bodyLength;
return 1 + sizeOfBodyLength + bodyLength;
})();
return {
length,
encode(cursor) {
if (bodyLength <= 55) {
cursor.pushByte(0xc0 + bodyLength);
}
else {
cursor.pushByte(0xc0 + 55 + sizeOfBodyLength);
if (sizeOfBodyLength === 1)
cursor.pushUint8(bodyLength);
else if (sizeOfBodyLength === 2)
cursor.pushUint16(bodyLength);
else if (sizeOfBodyLength === 3)
cursor.pushUint24(bodyLength);
else
cursor.pushUint32(bodyLength);
}
for (const { encode } of list) {
encode(cursor);
}
},
};
}
function getEncodableBytes(bytesOrHex) {
const bytes = typeof bytesOrHex === 'string' ? Bytes.fromHex(bytesOrHex) : bytesOrHex;
const sizeOfBytesLength = getSizeOfLength(bytes.length);
const length = (() => {
if (bytes.length === 1 && bytes[0] < 0x80)
return 1;
if (bytes.length <= 55)
return 1 + bytes.length;
return 1 + sizeOfBytesLength + bytes.length;
})();
return {
length,
encode(cursor) {
if (bytes.length === 1 && bytes[0] < 0x80) {
cursor.pushBytes(bytes);
}
else if (bytes.length <= 55) {
cursor.pushByte(0x80 + bytes.length);
cursor.pushBytes(bytes);
}
else {
cursor.pushByte(0x80 + 55 + sizeOfBytesLength);
if (sizeOfBytesLength === 1)
cursor.pushUint8(bytes.length);
else if (sizeOfBytesLength === 2)
cursor.pushUint16(bytes.length);
else if (sizeOfBytesLength === 3)
cursor.pushUint24(bytes.length);
else
cursor.pushUint32(bytes.length);
cursor.pushBytes(bytes);
}
},
};
}
function getSizeOfLength(length) {
if (length < 2 ** 8)
return 1;
if (length < 2 ** 16)
return 2;
if (length < 2 ** 24)
return 3;
if (length < 2 ** 32)
return 4;
throw new Errors.BaseError('Length is too large.');
}
//# sourceMappingURL=Rlp.js.map

1
node_modules/ox/_cjs/core/Rlp.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

25
node_modules/ox/_cjs/core/RpcRequest.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStore = createStore;
exports.from = from;
function createStore(options = {}) {
let id = options.id ?? 0;
return {
prepare(options) {
return from({
id: id++,
...options,
});
},
get id() {
return id;
},
};
}
function from(options) {
return {
...options,
jsonrpc: '2.0',
};
}
//# sourceMappingURL=RpcRequest.js.map

1
node_modules/ox/_cjs/core/RpcRequest.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"RpcRequest.js","sourceRoot":"","sources":["../../core/RpcRequest.ts"],"names":[],"mappings":";;AA2FA,kCAeC;AAwDD,oBAOC;AA9ED,SAAgB,WAAW,CAEzB,UAA+B,EAAE;IACjC,IAAI,EAAE,GAAG,OAAO,CAAC,EAAE,IAAI,CAAC,CAAA;IACxB,OAAO;QACL,OAAO,CAAC,OAAO;YACb,OAAO,IAAI,CAAC;gBACV,EAAE,EAAE,EAAE,EAAE;gBACR,GAAG,OAAO;aACF,CAAU,CAAA;QACtB,CAAC;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,CAAA;QACX,CAAC;KACF,CAAA;AACH,CAAC;AAwDD,SAAgB,IAAI,CAClB,OAAiC;IAEjC,OAAO;QACL,GAAG,OAAO;QACV,OAAO,EAAE,KAAK;KACN,CAAA;AACZ,CAAC"}

419
node_modules/ox/_cjs/core/RpcResponse.js generated vendored Normal file
View File

@@ -0,0 +1,419 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParseError = exports.InternalError = exports.InvalidParamsError = exports.MethodNotFoundError = exports.InvalidRequestError = exports.VersionNotSupportedError = exports.LimitExceededError = exports.MethodNotSupportedError = exports.TransactionRejectedError = exports.ResourceUnavailableError = exports.ResourceNotFoundError = exports.InvalidInputError = exports.BaseError = void 0;
exports.from = from;
exports.parse = parse;
exports.parseError = parseError;
function from(response, options = {}) {
const { request } = options;
return {
...response,
id: response.id ?? request?.id,
jsonrpc: response.jsonrpc ?? request.jsonrpc,
};
}
function parse(response, options = {}) {
const { raw = false } = options;
const response_ = response;
if (raw)
return response;
if (response_.error)
throw parseError(response_.error);
return response_.result;
}
function parseError(errorObject) {
const errorObject_ = errorObject;
const { code } = errorObject_;
if (code === InternalError.code)
return new InternalError(errorObject_);
if (code === InvalidInputError.code)
return new InvalidInputError(errorObject_);
if (code === InvalidParamsError.code)
return new InvalidParamsError(errorObject_);
if (code === InvalidRequestError.code)
return new InvalidRequestError(errorObject_);
if (code === LimitExceededError.code)
return new LimitExceededError(errorObject_);
if (code === MethodNotFoundError.code)
return new MethodNotFoundError(errorObject_);
if (code === MethodNotSupportedError.code)
return new MethodNotSupportedError(errorObject_);
if (code === ParseError.code)
return new ParseError(errorObject_);
if (code === ResourceNotFoundError.code)
return new ResourceNotFoundError(errorObject_);
if (code === ResourceUnavailableError.code)
return new ResourceUnavailableError(errorObject_);
if (code === TransactionRejectedError.code)
return new TransactionRejectedError(errorObject_);
if (code === VersionNotSupportedError.code)
return new VersionNotSupportedError(errorObject_);
return new InternalError({
data: errorObject_,
message: errorObject_.message,
});
}
class BaseError extends Error {
constructor(errorObject) {
const { code, message, data } = errorObject;
super(message);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.BaseError'
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "data", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.code = code;
this.data = data;
}
}
exports.BaseError = BaseError;
class InvalidInputError extends BaseError {
constructor(parameters = {}) {
super({
code: InvalidInputError.code,
data: parameters.data,
message: parameters.message ?? 'Missing or invalid parameters.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32000
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.InvalidInputError'
});
}
}
exports.InvalidInputError = InvalidInputError;
Object.defineProperty(InvalidInputError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32000
});
class ResourceNotFoundError extends BaseError {
constructor(parameters = {}) {
super({
code: ResourceNotFoundError.code,
data: parameters.data,
message: parameters.message ?? 'Requested resource not found.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32001
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.ResourceNotFoundError'
});
}
}
exports.ResourceNotFoundError = ResourceNotFoundError;
Object.defineProperty(ResourceNotFoundError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32001
});
class ResourceUnavailableError extends BaseError {
constructor(parameters = {}) {
super({
code: ResourceUnavailableError.code,
data: parameters.data,
message: parameters.message ?? 'Requested resource not available.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32002
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.ResourceUnavailableError'
});
}
}
exports.ResourceUnavailableError = ResourceUnavailableError;
Object.defineProperty(ResourceUnavailableError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32002
});
class TransactionRejectedError extends BaseError {
constructor(parameters = {}) {
super({
code: TransactionRejectedError.code,
data: parameters.data,
message: parameters.message ?? 'Transaction creation failed.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32003
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.TransactionRejectedError'
});
}
}
exports.TransactionRejectedError = TransactionRejectedError;
Object.defineProperty(TransactionRejectedError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32003
});
class MethodNotSupportedError extends BaseError {
constructor(parameters = {}) {
super({
code: MethodNotSupportedError.code,
data: parameters.data,
message: parameters.message ?? 'Method is not implemented.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32004
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.MethodNotSupportedError'
});
}
}
exports.MethodNotSupportedError = MethodNotSupportedError;
Object.defineProperty(MethodNotSupportedError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32004
});
class LimitExceededError extends BaseError {
constructor(parameters = {}) {
super({
code: LimitExceededError.code,
data: parameters.data,
message: parameters.message ?? 'Rate limit exceeded.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32005
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.LimitExceededError'
});
}
}
exports.LimitExceededError = LimitExceededError;
Object.defineProperty(LimitExceededError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32005
});
class VersionNotSupportedError extends BaseError {
constructor(parameters = {}) {
super({
code: VersionNotSupportedError.code,
data: parameters.data,
message: parameters.message ?? 'JSON-RPC version not supported.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32006
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.VersionNotSupportedError'
});
}
}
exports.VersionNotSupportedError = VersionNotSupportedError;
Object.defineProperty(VersionNotSupportedError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32006
});
class InvalidRequestError extends BaseError {
constructor(parameters = {}) {
super({
code: InvalidRequestError.code,
data: parameters.data,
message: parameters.message ?? 'Input is not a valid JSON-RPC request.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32600
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.InvalidRequestError'
});
}
}
exports.InvalidRequestError = InvalidRequestError;
Object.defineProperty(InvalidRequestError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32600
});
class MethodNotFoundError extends BaseError {
constructor(parameters = {}) {
super({
code: MethodNotFoundError.code,
data: parameters.data,
message: parameters.message ?? 'Method does not exist.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32601
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.MethodNotFoundError'
});
}
}
exports.MethodNotFoundError = MethodNotFoundError;
Object.defineProperty(MethodNotFoundError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32601
});
class InvalidParamsError extends BaseError {
constructor(parameters = {}) {
super({
code: InvalidParamsError.code,
data: parameters.data,
message: parameters.message ?? 'Invalid method parameters.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32602
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.InvalidParamsError'
});
}
}
exports.InvalidParamsError = InvalidParamsError;
Object.defineProperty(InvalidParamsError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32602
});
class InternalError extends BaseError {
constructor(parameters = {}) {
super({
code: InternalError.code,
data: parameters.data,
message: parameters.message ?? 'Internal JSON-RPC error.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32603
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.InternalError'
});
}
}
exports.InternalError = InternalError;
Object.defineProperty(InternalError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32603
});
class ParseError extends BaseError {
constructor(parameters = {}) {
super({
code: ParseError.code,
data: parameters.data,
message: parameters.message ?? 'Failed to parse JSON-RPC response.',
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32700
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcResponse.ParseError'
});
}
}
exports.ParseError = ParseError;
Object.defineProperty(ParseError, "code", {
enumerable: true,
configurable: true,
writable: true,
value: -32700
});
//# sourceMappingURL=RpcResponse.js.map

1
node_modules/ox/_cjs/core/RpcResponse.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/ox/_cjs/core/RpcSchema.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.from = from;
function from() {
return null;
}
//# sourceMappingURL=RpcSchema.js.map

1
node_modules/ox/_cjs/core/RpcSchema.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"RpcSchema.js","sourceRoot":"","sources":["../../core/RpcSchema.ts"],"names":[],"mappings":";;AAgDA,oBAEC;AAFD,SAAgB,IAAI;IAClB,OAAO,IAAa,CAAA;AACtB,CAAC"}

94
node_modules/ox/_cjs/core/RpcTransport.js generated vendored Normal file
View File

@@ -0,0 +1,94 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MalformedResponseError = exports.HttpError = void 0;
exports.fromHttp = fromHttp;
const Errors = require("./Errors.js");
const errors_js_1 = require("./internal/errors.js");
const promise = require("./internal/promise.js");
const internal = require("./internal/rpcTransport.js");
function fromHttp(url, options = {}) {
return internal.create({
async request(body_, options_) {
const { fetchFn = options.fetchFn ?? fetch, fetchOptions: fetchOptions_ = options.fetchOptions, timeout = options.timeout ?? 10_000, } = options_;
const body = JSON.stringify(body_);
const fetchOptions = typeof fetchOptions_ === 'function'
? await fetchOptions_(body_)
: fetchOptions_;
const response = await promise.withTimeout(({ signal }) => {
const init = {
...fetchOptions,
body,
headers: {
'Content-Type': 'application/json',
...fetchOptions?.headers,
},
method: fetchOptions?.method ?? 'POST',
signal: fetchOptions?.signal ?? (timeout > 0 ? signal : null),
};
const request = new Request(url, init);
return fetchFn(request);
}, {
timeout,
signal: true,
});
const data = await (async () => {
if (response.headers.get('Content-Type')?.startsWith('application/json'))
return response.json();
return response.text().then((data) => {
try {
return JSON.parse(data || '{}');
}
catch (err) {
if (response.ok)
throw new MalformedResponseError({
response: data,
});
return { error: data };
}
});
})();
if (!response.ok)
throw new HttpError({
body,
details: JSON.stringify(data.error) ?? response.statusText,
response,
url,
});
return data;
},
}, { raw: options.raw });
}
class HttpError extends Errors.BaseError {
constructor({ body, details, response, url, }) {
super('HTTP request failed.', {
details,
metaMessages: [
`Status: ${response.status}`,
`URL: ${(0, errors_js_1.getUrl)(url)}`,
body ? `Body: ${JSON.stringify(body)}` : undefined,
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcTransport.HttpError'
});
}
}
exports.HttpError = HttpError;
class MalformedResponseError extends Errors.BaseError {
constructor({ response }) {
super('HTTP Response could not be parsed as JSON.', {
metaMessages: [`Response: ${response}`],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'RpcTransport.MalformedResponseError'
});
}
}
exports.MalformedResponseError = MalformedResponseError;
//# sourceMappingURL=RpcTransport.js.map

1
node_modules/ox/_cjs/core/RpcTransport.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"RpcTransport.js","sourceRoot":"","sources":["../../core/RpcTransport.ts"],"names":[],"mappings":";;;AA6EA,4BAwEC;AArJD,sCAAqC;AAGrC,oDAA6C;AAC7C,iDAAgD;AAEhD,uDAAsD;AAuEtD,SAAgB,QAAQ,CAGtB,GAAW,EAAE,UAAyC,EAAE;IACxD,OAAO,QAAQ,CAAC,MAAM,CACpB;QACE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ;YAC3B,MAAM,EACJ,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,EAClC,YAAY,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,EAClD,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,MAAM,GACpC,GAAG,QAAQ,CAAA;YAEZ,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;YAElC,MAAM,YAAY,GAChB,OAAO,aAAa,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAM,aAAa,CAAC,KAAK,CAAC;gBAC5B,CAAC,CAAC,aAAa,CAAA;YAEnB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,CACxC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;gBACb,MAAM,IAAI,GAAgB;oBACxB,GAAG,YAAY;oBACf,IAAI;oBACJ,OAAO,EAAE;wBACP,cAAc,EAAE,kBAAkB;wBAClC,GAAG,YAAY,EAAE,OAAO;qBACzB;oBACD,MAAM,EAAE,YAAY,EAAE,MAAM,IAAI,MAAM;oBACtC,MAAM,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM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AAS;IAG7C,YAAY,EACV,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,GAAG,GACiE;QACpE,KAAK,CAAC,sBAAsB,EAAE;YAC5B,OAAO;YACP,YAAY,EAAE;gBACZ,WAAW,QAAQ,CAAC,MAAM,EAAE;gBAC5B,QAAQ,IAAA,kBAAM,EAAC,GAAG,CAAC,EAAE;gBACrB,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;aACnD;SACF,CAAC,CAAA;QAfc;;;;mBAAO,wBAAwB;WAAA;IAgBjD,CAAC;CACF;AAlBD,8BAkBC;AAGD,MAAa,sBAAuB,SAAQ,MAAM,CAAC,SAAS;IAG1D,YAAY,EAAE,QAAQ,EAAwB;QAC5C,KAAK,CAAC,4CAA4C,EAAE;YAClD,YAAY,EAAE,CAAC,aAAa,QAAQ,EAAE,CAAC;SACxC,CAAC,CAAA;QALc;;;;mBAAO,qCAAqC;WAAA;IAM9D,CAAC;CACF;AARD,wDAQC"}

60
node_modules/ox/_cjs/core/Secp256k1.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.noble = void 0;
exports.getPublicKey = getPublicKey;
exports.randomPrivateKey = randomPrivateKey;
exports.recoverAddress = recoverAddress;
exports.recoverPublicKey = recoverPublicKey;
exports.sign = sign;
exports.verify = verify;
const secp256k1_1 = require("@noble/curves/secp256k1");
const Address = require("./Address.js");
const Bytes = require("./Bytes.js");
const Hex = require("./Hex.js");
const PublicKey = require("./PublicKey.js");
const Entropy = require("./internal/entropy.js");
exports.noble = secp256k1_1.secp256k1;
function getPublicKey(options) {
const { privateKey } = options;
const point = secp256k1_1.secp256k1.ProjectivePoint.fromPrivateKey(Hex.from(privateKey).slice(2));
return PublicKey.from(point);
}
function randomPrivateKey(options = {}) {
const { as = 'Hex' } = options;
const bytes = secp256k1_1.secp256k1.utils.randomPrivateKey();
if (as === 'Hex')
return Hex.fromBytes(bytes);
return bytes;
}
function recoverAddress(options) {
return Address.fromPublicKey(recoverPublicKey(options));
}
function recoverPublicKey(options) {
const { payload, signature } = options;
const { r, s, yParity } = signature;
const signature_ = new secp256k1_1.secp256k1.Signature(BigInt(r), BigInt(s)).addRecoveryBit(yParity);
const point = signature_.recoverPublicKey(Hex.from(payload).substring(2));
return PublicKey.from(point);
}
function sign(options) {
const { extraEntropy = Entropy.extraEntropy, hash, payload, privateKey, } = options;
const { r, s, recovery } = secp256k1_1.secp256k1.sign(Bytes.from(payload), Bytes.from(privateKey), {
extraEntropy: typeof extraEntropy === 'boolean'
? extraEntropy
: Hex.from(extraEntropy).slice(2),
lowS: true,
...(hash ? { prehash: true } : {}),
});
return {
r,
s,
yParity: recovery,
};
}
function verify(options) {
const { address, hash, payload, publicKey, signature } = options;
if (address)
return Address.isEqual(address, recoverAddress({ payload, signature }));
return secp256k1_1.secp256k1.verify(signature, Bytes.from(payload), PublicKey.toBytes(publicKey), ...(hash ? [{ prehash: true, lowS: true }] : []));
}
//# sourceMappingURL=Secp256k1.js.map

1
node_modules/ox/_cjs/core/Secp256k1.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Secp256k1.js","sourceRoot":"","sources":["../../core/Secp256k1.ts"],"names":[],"mappings":";;;AA0BA,oCAQC;AA6BD,4CAOC;AAoCD,wCAIC;AAoCD,4CAWC;AAgCD,oBAwBC;AAgED,wBAUC;AA/RD,uDAAmD;AACnD,wCAAuC;AACvC,oCAAmC;AAEnC,gCAA+B;AAC/B,4CAA2C;AAE3C,iDAAgD;AAInC,QAAA,KAAK,GAAG,qBAAS,CAAA;AAe9B,SAAgB,YAAY,CAC1B,OAA6B;IAE7B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;IAC9B,MAAM,KAAK,GAAG,qBAAS,CAAC,eAAe,CAAC,cAAc,CACpD,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,K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AAG,qBAAS,CAAC,IAAI,CACvC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EACnB,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EACtB;QACE,YAAY,EACV,OAAO,YAAY,KAAK,SAAS;YAC/B,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,IAAI,EAAE,IAAI;QACV,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnC,CACF,CAAA;IACD,OAAO;QACL,CAAC;QACD,CAAC;QACD,OAAO,EAAE,QAAQ;KAClB,CAAA;AACH,CAAC;AAgED,SAAgB,MAAM,CAAC,OAAuB;IAC5C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;IAChE,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;IACzE,OAAO,qBAAS,CAAC,MAAM,CACrB,SAAS,EACT,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EACnB,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,EAC5B,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CACjD,CAAA;AACH,CAAC"}

288
node_modules/ox/_cjs/core/Signature.js generated vendored Normal file
View File

@@ -0,0 +1,288 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidVError = exports.InvalidYParityError = exports.InvalidSError = exports.InvalidRError = exports.MissingPropertiesError = exports.InvalidSerializedSizeError = void 0;
exports.assert = assert;
exports.fromBytes = fromBytes;
exports.fromHex = fromHex;
exports.extract = extract;
exports.from = from;
exports.fromDerBytes = fromDerBytes;
exports.fromDerHex = fromDerHex;
exports.fromLegacy = fromLegacy;
exports.fromRpc = fromRpc;
exports.fromTuple = fromTuple;
exports.toBytes = toBytes;
exports.toHex = toHex;
exports.toDerBytes = toDerBytes;
exports.toDerHex = toDerHex;
exports.toLegacy = toLegacy;
exports.toRpc = toRpc;
exports.toTuple = toTuple;
exports.validate = validate;
exports.vToYParity = vToYParity;
exports.yParityToV = yParityToV;
const secp256k1_1 = require("@noble/curves/secp256k1");
const Bytes = require("./Bytes.js");
const Errors = require("./Errors.js");
const Hex = require("./Hex.js");
const Json = require("./Json.js");
const Solidity = require("./Solidity.js");
function assert(signature, options = {}) {
const { recovered } = options;
if (typeof signature.r === 'undefined')
throw new MissingPropertiesError({ signature });
if (typeof signature.s === 'undefined')
throw new MissingPropertiesError({ signature });
if (recovered && typeof signature.yParity === 'undefined')
throw new MissingPropertiesError({ signature });
if (signature.r < 0n || signature.r > Solidity.maxUint256)
throw new InvalidRError({ value: signature.r });
if (signature.s < 0n || signature.s > Solidity.maxUint256)
throw new InvalidSError({ value: signature.s });
if (typeof signature.yParity === 'number' &&
signature.yParity !== 0 &&
signature.yParity !== 1)
throw new InvalidYParityError({ value: signature.yParity });
}
function fromBytes(signature) {
return fromHex(Hex.fromBytes(signature));
}
function fromHex(signature) {
if (signature.length !== 130 && signature.length !== 132)
throw new InvalidSerializedSizeError({ signature });
const r = BigInt(Hex.slice(signature, 0, 32));
const s = BigInt(Hex.slice(signature, 32, 64));
const yParity = (() => {
const yParity = Number(`0x${signature.slice(130)}`);
if (Number.isNaN(yParity))
return undefined;
try {
return vToYParity(yParity);
}
catch {
throw new InvalidYParityError({ value: yParity });
}
})();
if (typeof yParity === 'undefined')
return {
r,
s,
};
return {
r,
s,
yParity,
};
}
function extract(value) {
if (typeof value.r === 'undefined')
return undefined;
if (typeof value.s === 'undefined')
return undefined;
return from(value);
}
function from(signature) {
const signature_ = (() => {
if (typeof signature === 'string')
return fromHex(signature);
if (signature instanceof Uint8Array)
return fromBytes(signature);
if (typeof signature.r === 'string')
return fromRpc(signature);
if (signature.v)
return fromLegacy(signature);
return {
r: signature.r,
s: signature.s,
...(typeof signature.yParity !== 'undefined'
? { yParity: signature.yParity }
: {}),
};
})();
assert(signature_);
return signature_;
}
function fromDerBytes(signature) {
return fromDerHex(Hex.fromBytes(signature));
}
function fromDerHex(signature) {
const { r, s } = secp256k1_1.secp256k1.Signature.fromDER(Hex.from(signature).slice(2));
return { r, s };
}
function fromLegacy(signature) {
return {
r: signature.r,
s: signature.s,
yParity: vToYParity(signature.v),
};
}
function fromRpc(signature) {
const yParity = (() => {
const v = signature.v ? Number(signature.v) : undefined;
let yParity = signature.yParity ? Number(signature.yParity) : undefined;
if (typeof v === 'number' && typeof yParity !== 'number')
yParity = vToYParity(v);
if (typeof yParity !== 'number')
throw new InvalidYParityError({ value: signature.yParity });
return yParity;
})();
return {
r: BigInt(signature.r),
s: BigInt(signature.s),
yParity,
};
}
function fromTuple(tuple) {
const [yParity, r, s] = tuple;
return from({
r: r === '0x' ? 0n : BigInt(r),
s: s === '0x' ? 0n : BigInt(s),
yParity: yParity === '0x' ? 0 : Number(yParity),
});
}
function toBytes(signature) {
return Bytes.fromHex(toHex(signature));
}
function toHex(signature) {
assert(signature);
const r = signature.r;
const s = signature.s;
const signature_ = Hex.concat(Hex.fromNumber(r, { size: 32 }), Hex.fromNumber(s, { size: 32 }), typeof signature.yParity === 'number'
? Hex.fromNumber(yParityToV(signature.yParity), { size: 1 })
: '0x');
return signature_;
}
function toDerBytes(signature) {
const sig = new secp256k1_1.secp256k1.Signature(signature.r, signature.s);
return sig.toDERRawBytes();
}
function toDerHex(signature) {
const sig = new secp256k1_1.secp256k1.Signature(signature.r, signature.s);
return `0x${sig.toDERHex()}`;
}
function toLegacy(signature) {
return {
r: signature.r,
s: signature.s,
v: yParityToV(signature.yParity),
};
}
function toRpc(signature) {
const { r, s, yParity } = signature;
return {
r: Hex.fromNumber(r, { size: 32 }),
s: Hex.fromNumber(s, { size: 32 }),
yParity: yParity === 0 ? '0x0' : '0x1',
};
}
function toTuple(signature) {
const { r, s, yParity } = signature;
return [
yParity ? '0x01' : '0x',
r === 0n ? '0x' : Hex.trimLeft(Hex.fromNumber(r)),
s === 0n ? '0x' : Hex.trimLeft(Hex.fromNumber(s)),
];
}
function validate(signature, options = {}) {
try {
assert(signature, options);
return true;
}
catch {
return false;
}
}
function vToYParity(v) {
if (v === 0 || v === 27)
return 0;
if (v === 1 || v === 28)
return 1;
if (v >= 35)
return v % 2 === 0 ? 1 : 0;
throw new InvalidVError({ value: v });
}
function yParityToV(yParity) {
if (yParity === 0)
return 27;
if (yParity === 1)
return 28;
throw new InvalidYParityError({ value: yParity });
}
class InvalidSerializedSizeError extends Errors.BaseError {
constructor({ signature }) {
super(`Value \`${signature}\` is an invalid signature size.`, {
metaMessages: [
'Expected: 64 bytes or 65 bytes.',
`Received ${Hex.size(Hex.from(signature))} bytes.`,
],
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Signature.InvalidSerializedSizeError'
});
}
}
exports.InvalidSerializedSizeError = InvalidSerializedSizeError;
class MissingPropertiesError extends Errors.BaseError {
constructor({ signature }) {
super(`Signature \`${Json.stringify(signature)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Signature.MissingPropertiesError'
});
}
}
exports.MissingPropertiesError = MissingPropertiesError;
class InvalidRError extends Errors.BaseError {
constructor({ value }) {
super(`Value \`${value}\` is an invalid r value. r must be a positive integer less than 2^256.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Signature.InvalidRError'
});
}
}
exports.InvalidRError = InvalidRError;
class InvalidSError extends Errors.BaseError {
constructor({ value }) {
super(`Value \`${value}\` is an invalid s value. s must be a positive integer less than 2^256.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Signature.InvalidSError'
});
}
}
exports.InvalidSError = InvalidSError;
class InvalidYParityError extends Errors.BaseError {
constructor({ value }) {
super(`Value \`${value}\` is an invalid y-parity value. Y-parity must be 0 or 1.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Signature.InvalidYParityError'
});
}
}
exports.InvalidYParityError = InvalidYParityError;
class InvalidVError extends Errors.BaseError {
constructor({ value }) {
super(`Value \`${value}\` is an invalid v value. v must be 27, 28 or >=35.`);
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Signature.InvalidVError'
});
}
}
exports.InvalidVError = InvalidVError;
//# sourceMappingURL=Signature.js.map

1
node_modules/ox/_cjs/core/Signature.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

230
node_modules/ox/_cjs/core/Siwe.js generated vendored Normal file
View File

@@ -0,0 +1,230 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidMessageFieldError = exports.suffixRegex = exports.prefixRegex = exports.schemeRegex = exports.nonceRegex = exports.localhostRegex = exports.ipRegex = exports.domainRegex = void 0;
exports.createMessage = createMessage;
exports.generateNonce = generateNonce;
exports.isUri = isUri;
exports.parseMessage = parseMessage;
exports.validateMessage = validateMessage;
const Address = require("./Address.js");
const Errors = require("./Errors.js");
const uid_js_1 = require("./internal/uid.js");
exports.domainRegex = /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/;
exports.ipRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/;
exports.localhostRegex = /^localhost(:[0-9]{1,5})?$/;
exports.nonceRegex = /^[a-zA-Z0-9]{8,}$/;
exports.schemeRegex = /^([a-zA-Z][a-zA-Z0-9+-.]*)$/;
exports.prefixRegex = /^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/;
exports.suffixRegex = /(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;
function createMessage(value) {
const { chainId, domain, expirationTime, issuedAt = new Date(), nonce, notBefore, requestId, resources, scheme, uri, version, } = value;
{
if (chainId !== Math.floor(chainId))
throw new InvalidMessageFieldError({
field: 'chainId',
metaMessages: [
'- Chain ID must be a EIP-155 chain ID.',
'- See https://eips.ethereum.org/EIPS/eip-155',
'',
`Provided value: ${chainId}`,
],
});
if (!(exports.domainRegex.test(domain) ||
exports.ipRegex.test(domain) ||
exports.localhostRegex.test(domain)))
throw new InvalidMessageFieldError({
field: 'domain',
metaMessages: [
'- Domain must be an RFC 3986 authority.',
'- See https://www.rfc-editor.org/rfc/rfc3986',
'',
`Provided value: ${domain}`,
],
});
if (!exports.nonceRegex.test(nonce))
throw new InvalidMessageFieldError({
field: 'nonce',
metaMessages: [
'- Nonce must be at least 8 characters.',
'- Nonce must be alphanumeric.',
'',
`Provided value: ${nonce}`,
],
});
if (!isUri(uri))
throw new InvalidMessageFieldError({
field: 'uri',
metaMessages: [
'- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.',
'- See https://www.rfc-editor.org/rfc/rfc3986',
'',
`Provided value: ${uri}`,
],
});
if (version !== '1')
throw new InvalidMessageFieldError({
field: 'version',
metaMessages: [
"- Version must be '1'.",
'',
`Provided value: ${version}`,
],
});
if (scheme && !exports.schemeRegex.test(scheme))
throw new InvalidMessageFieldError({
field: 'scheme',
metaMessages: [
'- Scheme must be an RFC 3986 URI scheme.',
'- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1',
'',
`Provided value: ${scheme}`,
],
});
const statement = value.statement;
if (statement?.includes('\n'))
throw new InvalidMessageFieldError({
field: 'statement',
metaMessages: [
"- Statement must not include '\\n'.",
'',
`Provided value: ${statement}`,
],
});
}
const address = Address.from(value.address, { checksum: true });
const origin = (() => {
if (scheme)
return `${scheme}://${domain}`;
return domain;
})();
const statement = (() => {
if (!value.statement)
return '';
return `${value.statement}\n`;
})();
const prefix = `${origin} wants you to sign in with your Ethereum account:\n${address}\n\n${statement}`;
let suffix = `URI: ${uri}\nVersion: ${version}\nChain ID: ${chainId}\nNonce: ${nonce}\nIssued At: ${issuedAt.toISOString()}`;
if (expirationTime)
suffix += `\nExpiration Time: ${expirationTime.toISOString()}`;
if (notBefore)
suffix += `\nNot Before: ${notBefore.toISOString()}`;
if (requestId)
suffix += `\nRequest ID: ${requestId}`;
if (resources) {
let content = '\nResources:';
for (const resource of resources) {
if (!isUri(resource))
throw new InvalidMessageFieldError({
field: 'resources',
metaMessages: [
'- Every resource must be a RFC 3986 URI.',
'- See https://www.rfc-editor.org/rfc/rfc3986',
'',
`Provided value: ${resource}`,
],
});
content += `\n- ${resource}`;
}
suffix += content;
}
return `${prefix}\n${suffix}`;
}
function generateNonce() {
return (0, uid_js_1.uid)(96);
}
function isUri(value) {
if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value))
return false;
if (/%[^0-9a-f]/i.test(value))
return false;
if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value))
return false;
const splitted = splitUri(value);
const scheme = splitted[1];
const authority = splitted[2];
const path = splitted[3];
const query = splitted[4];
const fragment = splitted[5];
if (!(scheme?.length && path && path.length >= 0))
return false;
if (authority?.length) {
if (!(path.length === 0 || /^\//.test(path)))
return false;
}
else {
if (/^\/\//.test(path))
return false;
}
if (!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase()))
return false;
let out = '';
out += `${scheme}:`;
if (authority?.length)
out += `//${authority}`;
out += path;
if (query?.length)
out += `?${query}`;
if (fragment?.length)
out += `#${fragment}`;
return out;
}
function splitUri(value) {
return value.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);
}
function parseMessage(message) {
const { scheme, statement, ...prefix } = (message.match(exports.prefixRegex)
?.groups ?? {});
const { chainId, expirationTime, issuedAt, notBefore, requestId, ...suffix } = (message.match(exports.suffixRegex)?.groups ?? {});
const resources = message.split('Resources:')[1]?.split('\n- ').slice(1);
return {
...prefix,
...suffix,
...(chainId ? { chainId: Number(chainId) } : {}),
...(expirationTime ? { expirationTime: new Date(expirationTime) } : {}),
...(issuedAt ? { issuedAt: new Date(issuedAt) } : {}),
...(notBefore ? { notBefore: new Date(notBefore) } : {}),
...(requestId ? { requestId } : {}),
...(resources ? { resources } : {}),
...(scheme ? { scheme } : {}),
...(statement ? { statement } : {}),
};
}
function validateMessage(value) {
const { address, domain, message, nonce, scheme, time = new Date() } = value;
if (domain && message.domain !== domain)
return false;
if (nonce && message.nonce !== nonce)
return false;
if (scheme && message.scheme !== scheme)
return false;
if (message.expirationTime && time >= message.expirationTime)
return false;
if (message.notBefore && time < message.notBefore)
return false;
try {
if (!message.address)
return false;
if (address && !Address.isEqual(message.address, address))
return false;
}
catch {
return false;
}
return true;
}
class InvalidMessageFieldError extends Errors.BaseError {
constructor(parameters) {
const { field, metaMessages } = parameters;
super(`Invalid Sign-In with Ethereum message field "${field}".`, {
metaMessages,
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: 'Siwe.InvalidMessageFieldError'
});
}
}
exports.InvalidMessageFieldError = InvalidMessageFieldError;
//# sourceMappingURL=Siwe.js.map

1
node_modules/ox/_cjs/core/Siwe.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

104
node_modules/ox/_cjs/core/Solidity.js generated vendored Normal file
View File

@@ -0,0 +1,104 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.minInt120 = exports.minInt112 = exports.minInt104 = exports.minInt96 = exports.minInt88 = exports.minInt80 = exports.minInt72 = exports.minInt64 = exports.minInt56 = exports.minInt48 = exports.minInt40 = exports.minInt32 = exports.minInt24 = exports.minInt16 = exports.minInt8 = exports.maxInt256 = exports.maxInt248 = exports.maxInt240 = exports.maxInt232 = exports.maxInt224 = exports.maxInt216 = exports.maxInt208 = exports.maxInt200 = exports.maxInt192 = exports.maxInt184 = exports.maxInt176 = exports.maxInt168 = exports.maxInt160 = exports.maxInt152 = exports.maxInt144 = exports.maxInt136 = exports.maxInt128 = exports.maxInt120 = exports.maxInt112 = exports.maxInt104 = exports.maxInt96 = exports.maxInt88 = exports.maxInt80 = exports.maxInt72 = exports.maxInt64 = exports.maxInt56 = exports.maxInt48 = exports.maxInt40 = exports.maxInt32 = exports.maxInt24 = exports.maxInt16 = exports.maxInt8 = exports.integerRegex = exports.bytesRegex = exports.arrayRegex = void 0;
exports.maxUint256 = exports.maxUint248 = exports.maxUint240 = exports.maxUint232 = exports.maxUint224 = exports.maxUint216 = exports.maxUint208 = exports.maxUint200 = exports.maxUint192 = exports.maxUint184 = exports.maxUint176 = exports.maxUint168 = exports.maxUint160 = exports.maxUint152 = exports.maxUint144 = exports.maxUint136 = exports.maxUint128 = exports.maxUint120 = exports.maxUint112 = exports.maxUint104 = exports.maxUint96 = exports.maxUint88 = exports.maxUint80 = exports.maxUint72 = exports.maxUint64 = exports.maxUint56 = exports.maxUint48 = exports.maxUint40 = exports.maxUint32 = exports.maxUint24 = exports.maxUint16 = exports.maxUint8 = exports.minInt256 = exports.minInt248 = exports.minInt240 = exports.minInt232 = exports.minInt224 = exports.minInt216 = exports.minInt208 = exports.minInt200 = exports.minInt192 = exports.minInt184 = exports.minInt176 = exports.minInt168 = exports.minInt160 = exports.minInt152 = exports.minInt144 = exports.minInt136 = exports.minInt128 = void 0;
exports.arrayRegex = /^(.*)\[([0-9]*)\]$/;
exports.bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
exports.integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
exports.maxInt8 = 2n ** (8n - 1n) - 1n;
exports.maxInt16 = 2n ** (16n - 1n) - 1n;
exports.maxInt24 = 2n ** (24n - 1n) - 1n;
exports.maxInt32 = 2n ** (32n - 1n) - 1n;
exports.maxInt40 = 2n ** (40n - 1n) - 1n;
exports.maxInt48 = 2n ** (48n - 1n) - 1n;
exports.maxInt56 = 2n ** (56n - 1n) - 1n;
exports.maxInt64 = 2n ** (64n - 1n) - 1n;
exports.maxInt72 = 2n ** (72n - 1n) - 1n;
exports.maxInt80 = 2n ** (80n - 1n) - 1n;
exports.maxInt88 = 2n ** (88n - 1n) - 1n;
exports.maxInt96 = 2n ** (96n - 1n) - 1n;
exports.maxInt104 = 2n ** (104n - 1n) - 1n;
exports.maxInt112 = 2n ** (112n - 1n) - 1n;
exports.maxInt120 = 2n ** (120n - 1n) - 1n;
exports.maxInt128 = 2n ** (128n - 1n) - 1n;
exports.maxInt136 = 2n ** (136n - 1n) - 1n;
exports.maxInt144 = 2n ** (144n - 1n) - 1n;
exports.maxInt152 = 2n ** (152n - 1n) - 1n;
exports.maxInt160 = 2n ** (160n - 1n) - 1n;
exports.maxInt168 = 2n ** (168n - 1n) - 1n;
exports.maxInt176 = 2n ** (176n - 1n) - 1n;
exports.maxInt184 = 2n ** (184n - 1n) - 1n;
exports.maxInt192 = 2n ** (192n - 1n) - 1n;
exports.maxInt200 = 2n ** (200n - 1n) - 1n;
exports.maxInt208 = 2n ** (208n - 1n) - 1n;
exports.maxInt216 = 2n ** (216n - 1n) - 1n;
exports.maxInt224 = 2n ** (224n - 1n) - 1n;
exports.maxInt232 = 2n ** (232n - 1n) - 1n;
exports.maxInt240 = 2n ** (240n - 1n) - 1n;
exports.maxInt248 = 2n ** (248n - 1n) - 1n;
exports.maxInt256 = 2n ** (256n - 1n) - 1n;
exports.minInt8 = -(2n ** (8n - 1n));
exports.minInt16 = -(2n ** (16n - 1n));
exports.minInt24 = -(2n ** (24n - 1n));
exports.minInt32 = -(2n ** (32n - 1n));
exports.minInt40 = -(2n ** (40n - 1n));
exports.minInt48 = -(2n ** (48n - 1n));
exports.minInt56 = -(2n ** (56n - 1n));
exports.minInt64 = -(2n ** (64n - 1n));
exports.minInt72 = -(2n ** (72n - 1n));
exports.minInt80 = -(2n ** (80n - 1n));
exports.minInt88 = -(2n ** (88n - 1n));
exports.minInt96 = -(2n ** (96n - 1n));
exports.minInt104 = -(2n ** (104n - 1n));
exports.minInt112 = -(2n ** (112n - 1n));
exports.minInt120 = -(2n ** (120n - 1n));
exports.minInt128 = -(2n ** (128n - 1n));
exports.minInt136 = -(2n ** (136n - 1n));
exports.minInt144 = -(2n ** (144n - 1n));
exports.minInt152 = -(2n ** (152n - 1n));
exports.minInt160 = -(2n ** (160n - 1n));
exports.minInt168 = -(2n ** (168n - 1n));
exports.minInt176 = -(2n ** (176n - 1n));
exports.minInt184 = -(2n ** (184n - 1n));
exports.minInt192 = -(2n ** (192n - 1n));
exports.minInt200 = -(2n ** (200n - 1n));
exports.minInt208 = -(2n ** (208n - 1n));
exports.minInt216 = -(2n ** (216n - 1n));
exports.minInt224 = -(2n ** (224n - 1n));
exports.minInt232 = -(2n ** (232n - 1n));
exports.minInt240 = -(2n ** (240n - 1n));
exports.minInt248 = -(2n ** (248n - 1n));
exports.minInt256 = -(2n ** (256n - 1n));
exports.maxUint8 = 2n ** 8n - 1n;
exports.maxUint16 = 2n ** 16n - 1n;
exports.maxUint24 = 2n ** 24n - 1n;
exports.maxUint32 = 2n ** 32n - 1n;
exports.maxUint40 = 2n ** 40n - 1n;
exports.maxUint48 = 2n ** 48n - 1n;
exports.maxUint56 = 2n ** 56n - 1n;
exports.maxUint64 = 2n ** 64n - 1n;
exports.maxUint72 = 2n ** 72n - 1n;
exports.maxUint80 = 2n ** 80n - 1n;
exports.maxUint88 = 2n ** 88n - 1n;
exports.maxUint96 = 2n ** 96n - 1n;
exports.maxUint104 = 2n ** 104n - 1n;
exports.maxUint112 = 2n ** 112n - 1n;
exports.maxUint120 = 2n ** 120n - 1n;
exports.maxUint128 = 2n ** 128n - 1n;
exports.maxUint136 = 2n ** 136n - 1n;
exports.maxUint144 = 2n ** 144n - 1n;
exports.maxUint152 = 2n ** 152n - 1n;
exports.maxUint160 = 2n ** 160n - 1n;
exports.maxUint168 = 2n ** 168n - 1n;
exports.maxUint176 = 2n ** 176n - 1n;
exports.maxUint184 = 2n ** 184n - 1n;
exports.maxUint192 = 2n ** 192n - 1n;
exports.maxUint200 = 2n ** 200n - 1n;
exports.maxUint208 = 2n ** 208n - 1n;
exports.maxUint216 = 2n ** 216n - 1n;
exports.maxUint224 = 2n ** 224n - 1n;
exports.maxUint232 = 2n ** 232n - 1n;
exports.maxUint240 = 2n ** 240n - 1n;
exports.maxUint248 = 2n ** 248n - 1n;
exports.maxUint256 = 2n ** 256n - 1n;
//# sourceMappingURL=Solidity.js.map

1
node_modules/ox/_cjs/core/Solidity.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

48
node_modules/ox/_cjs/core/StateOverrides.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromRpc = fromRpc;
exports.toRpc = toRpc;
const Hex = require("./Hex.js");
function fromRpc(rpcStateOverrides) {
const stateOverrides = {};
for (const [address, accountOverridesRpc] of Object.entries(rpcStateOverrides)) {
const accountOverrides = {};
if (accountOverridesRpc.balance)
accountOverrides.balance = BigInt(accountOverridesRpc.balance);
if (accountOverridesRpc.code)
accountOverrides.code = accountOverridesRpc.code;
if (accountOverridesRpc.movePrecompileToAddress)
accountOverrides.movePrecompileToAddress =
accountOverridesRpc.movePrecompileToAddress;
if (accountOverridesRpc.nonce)
accountOverrides.nonce = BigInt(accountOverridesRpc.nonce);
if (accountOverridesRpc.state)
accountOverrides.state = accountOverridesRpc.state;
if (accountOverridesRpc.stateDiff)
accountOverrides.stateDiff = accountOverridesRpc.stateDiff;
stateOverrides[address] = accountOverrides;
}
return stateOverrides;
}
function toRpc(stateOverrides) {
const rpcStateOverrides = {};
for (const [address, accountOverrides] of Object.entries(stateOverrides)) {
const accountOverridesRpc = {};
if (typeof accountOverrides.balance === 'bigint')
accountOverridesRpc.balance = Hex.fromNumber(accountOverrides.balance);
if (accountOverrides.code)
accountOverridesRpc.code = accountOverrides.code;
if (accountOverrides.movePrecompileToAddress)
accountOverridesRpc.movePrecompileToAddress =
accountOverrides.movePrecompileToAddress;
if (typeof accountOverrides.nonce === 'bigint')
accountOverridesRpc.nonce = Hex.fromNumber(accountOverrides.nonce);
if (accountOverrides.state)
accountOverridesRpc.state = accountOverrides.state;
if (accountOverrides.stateDiff)
accountOverridesRpc.stateDiff = accountOverrides.stateDiff;
rpcStateOverrides[address] = accountOverridesRpc;
}
return rpcStateOverrides;
}
//# sourceMappingURL=StateOverrides.js.map

1
node_modules/ox/_cjs/core/StateOverrides.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"StateOverrides.js","sourceRoot":"","sources":["../../core/StateOverrides.ts"],"names":[],"mappings":";;AAsEA,0BAsBC;AAmBD,sBAmBC;AAjID,gCAA+B;AAqE/B,SAAgB,OAAO,CAAC,iBAAsB;IAC5C,MAAM,cAAc,GAAmB,EAAE,CAAA;IACzC,KAAK,MAAM,CAAC,OAAO,EAAE,mBAAmB,CAAC,IAAI,MAAM,CAAC,OAAO,CACzD,iBAAiB,CAClB,EAAE,CAAC;QACF,MAAM,gBAAgB,GAAqB,EAAE,CAAA;QAC7C,IA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,uBAAuB,CAAA;QAC5C,IAAI,OAAO,gBAAgB,CAAC,KAAK,KAAK,QAAQ;YAC5C,mBAAmB,CAAC,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;QACpE,IAAI,gBAAgB,CAAC,KAAK;YACxB,mBAAmB,CAAC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAA;QACpD,IAAI,gBAAgB,CAAC,SAAS;YAC5B,mBAAmB,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAC3D;QAAC,iBAAyB,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAA;IAC5D,CAAC;IACD,OAAO,iBAAiB,CAAA;AAC1B,CAAC"}

104
node_modules/ox/_cjs/core/Transaction.js generated vendored Normal file
View File

@@ -0,0 +1,104 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromRpcType = exports.toRpcType = void 0;
exports.fromRpc = fromRpc;
exports.toRpc = toRpc;
const Authorization = require("./Authorization.js");
const Hex = require("./Hex.js");
const Signature = require("./Signature.js");
exports.toRpcType = {
legacy: '0x0',
eip2930: '0x1',
eip1559: '0x2',
eip4844: '0x3',
eip7702: '0x4',
};
exports.fromRpcType = {
'0x0': 'legacy',
'0x1': 'eip2930',
'0x2': 'eip1559',
'0x3': 'eip4844',
'0x4': 'eip7702',
};
function fromRpc(transaction, _options = {}) {
if (!transaction)
return null;
const signature = Signature.extract(transaction);
const transaction_ = {
...transaction,
...signature,
};
transaction_.blockNumber = transaction.blockNumber
? BigInt(transaction.blockNumber)
: null;
transaction_.data = transaction.input;
transaction_.gas = BigInt(transaction.gas ?? 0n);
transaction_.nonce = BigInt(transaction.nonce ?? 0n);
transaction_.transactionIndex = transaction.transactionIndex
? Number(transaction.transactionIndex)
: null;
transaction_.value = BigInt(transaction.value ?? 0n);
if (transaction.authorizationList)
transaction_.authorizationList = Authorization.fromRpcList(transaction.authorizationList);
if (transaction.chainId)
transaction_.chainId = Number(transaction.chainId);
if (transaction.gasPrice)
transaction_.gasPrice = BigInt(transaction.gasPrice);
if (transaction.maxFeePerBlobGas)
transaction_.maxFeePerBlobGas = BigInt(transaction.maxFeePerBlobGas);
if (transaction.maxFeePerGas)
transaction_.maxFeePerGas = BigInt(transaction.maxFeePerGas);
if (transaction.maxPriorityFeePerGas)
transaction_.maxPriorityFeePerGas = BigInt(transaction.maxPriorityFeePerGas);
if (transaction.type)
transaction_.type =
exports.fromRpcType[transaction.type] ?? transaction.type;
if (signature)
transaction_.v = Signature.yParityToV(signature.yParity);
return transaction_;
}
function toRpc(transaction, _options) {
const rpc = {};
rpc.blockHash = transaction.blockHash;
rpc.blockNumber =
typeof transaction.blockNumber === 'bigint'
? Hex.fromNumber(transaction.blockNumber)
: null;
rpc.from = transaction.from;
rpc.gas = Hex.fromNumber(transaction.gas ?? 0n);
rpc.hash = transaction.hash;
rpc.input = transaction.input;
rpc.nonce = Hex.fromNumber(transaction.nonce ?? 0n);
rpc.to = transaction.to;
rpc.transactionIndex = transaction.transactionIndex
? Hex.fromNumber(transaction.transactionIndex)
: null;
rpc.type = exports.toRpcType[transaction.type] ?? transaction.type;
rpc.value = Hex.fromNumber(transaction.value ?? 0n);
if (transaction.accessList)
rpc.accessList = transaction.accessList;
if (transaction.authorizationList)
rpc.authorizationList = Authorization.toRpcList(transaction.authorizationList);
if (transaction.blobVersionedHashes)
rpc.blobVersionedHashes = transaction.blobVersionedHashes;
if (transaction.chainId)
rpc.chainId = Hex.fromNumber(transaction.chainId);
if (typeof transaction.gasPrice === 'bigint')
rpc.gasPrice = Hex.fromNumber(transaction.gasPrice);
if (typeof transaction.maxFeePerBlobGas === 'bigint')
rpc.maxFeePerBlobGas = Hex.fromNumber(transaction.maxFeePerBlobGas);
if (typeof transaction.maxFeePerGas === 'bigint')
rpc.maxFeePerGas = Hex.fromNumber(transaction.maxFeePerGas);
if (typeof transaction.maxPriorityFeePerGas === 'bigint')
rpc.maxPriorityFeePerGas = Hex.fromNumber(transaction.maxPriorityFeePerGas);
if (typeof transaction.r === 'bigint')
rpc.r = Hex.fromNumber(transaction.r, { size: 32 });
if (typeof transaction.s === 'bigint')
rpc.s = Hex.fromNumber(transaction.s, { size: 32 });
if (typeof transaction.v === 'number')
rpc.v = Hex.fromNumber(transaction.v, { size: 1 });
if (typeof transaction.yParity === 'number')
rpc.yParity = transaction.yParity === 0 ? '0x0' : '0x1';
return rpc;
}
//# sourceMappingURL=Transaction.js.map

1
node_modules/ox/_cjs/core/Transaction.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../core/Transaction.ts"],"names":[],"mappings":";;;AAiRA,0BA6CC;AA6CD,sBAiDC;AA1ZD,oDAAmD;AAEnD,gCAA+B;AAC/B,4CAA2C;AA8M9B,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;CACN,CAAA;AAQG,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;CACR,CAAA;AA0CV,SAAgB,OAAO,CAIrB,WAA8C,EAC9C,WAAqC,EAAE;IAEvC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAa,CAAA;IAEtC,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAEhD,MAAM,YAAY,GAAG;QACnB,GAAG,WAAW;QACd,GAAG,SAAS;KACsB,CAAA;IAEpC,YAAY,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW;QAChD,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC;QACjC,CAAC,CAAC,IAAI,CAAA;IACR,YAAY,CAAC,IAAI,GAAG,WAAW,CAAC,KAAK,CAA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