@heyamiko/amiko-cli 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/index.js +3298 -1091
- package/package.json +1 -1
- package/skills/SKILL.md +1 -1
package/dist/index.js
CHANGED
|
@@ -5,43 +5,25 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
function __accessProp(key) {
|
|
9
|
-
return this[key];
|
|
10
|
-
}
|
|
11
|
-
var __toESMCache_node;
|
|
12
|
-
var __toESMCache_esm;
|
|
13
8
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
-
var canCache = mod != null && typeof mod === "object";
|
|
15
|
-
if (canCache) {
|
|
16
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
-
var cached = cache.get(mod);
|
|
18
|
-
if (cached)
|
|
19
|
-
return cached;
|
|
20
|
-
}
|
|
21
9
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
22
10
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
11
|
for (let key of __getOwnPropNames(mod))
|
|
24
12
|
if (!__hasOwnProp.call(to, key))
|
|
25
13
|
__defProp(to, key, {
|
|
26
|
-
get:
|
|
14
|
+
get: () => mod[key],
|
|
27
15
|
enumerable: true
|
|
28
16
|
});
|
|
29
|
-
if (canCache)
|
|
30
|
-
cache.set(mod, to);
|
|
31
17
|
return to;
|
|
32
18
|
};
|
|
33
19
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
-
var __returnValue = (v) => v;
|
|
35
|
-
function __exportSetter(name, newValue) {
|
|
36
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
37
|
-
}
|
|
38
20
|
var __export = (target, all) => {
|
|
39
21
|
for (var name in all)
|
|
40
22
|
__defProp(target, name, {
|
|
41
23
|
get: all[name],
|
|
42
24
|
enumerable: true,
|
|
43
25
|
configurable: true,
|
|
44
|
-
set:
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
45
27
|
});
|
|
46
28
|
};
|
|
47
29
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -861,7 +843,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
861
843
|
this._exitCallback = (err) => {
|
|
862
844
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
863
845
|
throw err;
|
|
864
|
-
}
|
|
846
|
+
} else {}
|
|
865
847
|
};
|
|
866
848
|
}
|
|
867
849
|
return this;
|
|
@@ -3596,7 +3578,7 @@ function getHumanReadableErrorMessage(code, context = {}) {
|
|
|
3596
3578
|
function getErrorMessage(code, context = {}) {
|
|
3597
3579
|
if (true) {
|
|
3598
3580
|
return getHumanReadableErrorMessage(code, context);
|
|
3599
|
-
}
|
|
3581
|
+
} else {}
|
|
3600
3582
|
}
|
|
3601
3583
|
function isSolanaError(e, code) {
|
|
3602
3584
|
const isSolanaError2 = e instanceof Error && e.name === "SolanaError";
|
|
@@ -7660,20 +7642,8 @@ var init_src3 = __esm(() => {
|
|
|
7660
7642
|
}
|
|
7661
7643
|
});
|
|
7662
7644
|
|
|
7663
|
-
// node_modules/mppx/node_modules/ox/
|
|
7664
|
-
|
|
7665
|
-
if (a.length !== b.length)
|
|
7666
|
-
return false;
|
|
7667
|
-
let diff = 0;
|
|
7668
|
-
for (let i = 0;i < a.length; i++)
|
|
7669
|
-
diff |= a[i] ^ b[i];
|
|
7670
|
-
return diff === 0;
|
|
7671
|
-
}
|
|
7672
|
-
var hasHexBuiltin;
|
|
7673
|
-
var init_utils = __esm(() => {
|
|
7674
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
7675
|
-
hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
|
|
7676
|
-
});
|
|
7645
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Abi.js
|
|
7646
|
+
var init_Abi = () => {};
|
|
7677
7647
|
|
|
7678
7648
|
// node_modules/mppx/node_modules/ox/_esm/core/version.js
|
|
7679
7649
|
var version = "0.1.1";
|
|
@@ -7818,827 +7788,187 @@ var init_Errors = __esm(() => {
|
|
|
7818
7788
|
})();
|
|
7819
7789
|
});
|
|
7820
7790
|
|
|
7821
|
-
// node_modules/
|
|
7822
|
-
function
|
|
7823
|
-
|
|
7824
|
-
throw new SizeOverflowError({
|
|
7825
|
-
givenSize: size(bytes),
|
|
7826
|
-
maxSize: size_
|
|
7827
|
-
});
|
|
7791
|
+
// node_modules/@noble/hashes/esm/utils.js
|
|
7792
|
+
function isBytes(a) {
|
|
7793
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
7828
7794
|
}
|
|
7829
|
-
function
|
|
7830
|
-
if (
|
|
7831
|
-
throw new
|
|
7832
|
-
offset: start,
|
|
7833
|
-
position: "start",
|
|
7834
|
-
size: size(value)
|
|
7835
|
-
});
|
|
7795
|
+
function anumber(n) {
|
|
7796
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
7797
|
+
throw new Error("positive integer expected, got " + n);
|
|
7836
7798
|
}
|
|
7837
|
-
function
|
|
7838
|
-
if (
|
|
7839
|
-
throw new
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
size: size(value)
|
|
7843
|
-
});
|
|
7844
|
-
}
|
|
7799
|
+
function abytes(b, ...lengths) {
|
|
7800
|
+
if (!isBytes(b))
|
|
7801
|
+
throw new Error("Uint8Array expected");
|
|
7802
|
+
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
7803
|
+
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
7845
7804
|
}
|
|
7846
|
-
function
|
|
7847
|
-
if (
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
7852
|
-
return char - (charCodeMap.a - 10);
|
|
7853
|
-
return;
|
|
7805
|
+
function ahash(h) {
|
|
7806
|
+
if (typeof h !== "function" || typeof h.create !== "function")
|
|
7807
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
7808
|
+
anumber(h.outputLen);
|
|
7809
|
+
anumber(h.blockLen);
|
|
7854
7810
|
}
|
|
7855
|
-
function
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
throw new SizeExceedsPaddingSizeError({
|
|
7861
|
-
size: bytes.length,
|
|
7862
|
-
targetSize: size2,
|
|
7863
|
-
type: "Bytes"
|
|
7864
|
-
});
|
|
7865
|
-
const paddedBytes = new Uint8Array(size2);
|
|
7866
|
-
for (let i = 0;i < size2; i++) {
|
|
7867
|
-
const padEnd = dir === "right";
|
|
7868
|
-
paddedBytes[padEnd ? i : size2 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
7869
|
-
}
|
|
7870
|
-
return paddedBytes;
|
|
7811
|
+
function aexists(instance, checkFinished = true) {
|
|
7812
|
+
if (instance.destroyed)
|
|
7813
|
+
throw new Error("Hash instance has been destroyed");
|
|
7814
|
+
if (checkFinished && instance.finished)
|
|
7815
|
+
throw new Error("Hash#digest() has already been called");
|
|
7871
7816
|
}
|
|
7872
|
-
function
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
7878
|
-
sliceLength++;
|
|
7879
|
-
else
|
|
7880
|
-
break;
|
|
7817
|
+
function aoutput(out, instance) {
|
|
7818
|
+
abytes(out);
|
|
7819
|
+
const min = instance.outputLen;
|
|
7820
|
+
if (out.length < min) {
|
|
7821
|
+
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
7881
7822
|
}
|
|
7882
|
-
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
7883
|
-
return data;
|
|
7884
|
-
}
|
|
7885
|
-
var charCodeMap;
|
|
7886
|
-
var init_bytes = __esm(() => {
|
|
7887
|
-
init_Bytes();
|
|
7888
|
-
charCodeMap = {
|
|
7889
|
-
zero: 48,
|
|
7890
|
-
nine: 57,
|
|
7891
|
-
A: 65,
|
|
7892
|
-
F: 70,
|
|
7893
|
-
a: 97,
|
|
7894
|
-
f: 102
|
|
7895
|
-
};
|
|
7896
|
-
});
|
|
7897
|
-
|
|
7898
|
-
// node_modules/mppx/node_modules/ox/_esm/core/internal/hex.js
|
|
7899
|
-
function assertSize2(hex, size_) {
|
|
7900
|
-
if (size2(hex) > size_)
|
|
7901
|
-
throw new SizeOverflowError2({
|
|
7902
|
-
givenSize: size2(hex),
|
|
7903
|
-
maxSize: size_
|
|
7904
|
-
});
|
|
7905
7823
|
}
|
|
7906
|
-
function
|
|
7907
|
-
|
|
7908
|
-
if (size3 === 0)
|
|
7909
|
-
return hex_;
|
|
7910
|
-
const hex = hex_.replace("0x", "");
|
|
7911
|
-
if (hex.length > size3 * 2)
|
|
7912
|
-
throw new SizeExceedsPaddingSizeError2({
|
|
7913
|
-
size: Math.ceil(hex.length / 2),
|
|
7914
|
-
targetSize: size3,
|
|
7915
|
-
type: "Hex"
|
|
7916
|
-
});
|
|
7917
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
7824
|
+
function u32(arr) {
|
|
7825
|
+
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
7918
7826
|
}
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
// node_modules/mppx/node_modules/ox/_esm/core/Json.js
|
|
7924
|
-
var exports_Json = {};
|
|
7925
|
-
__export(exports_Json, {
|
|
7926
|
-
stringify: () => stringify2,
|
|
7927
|
-
parse: () => parse,
|
|
7928
|
-
canonicalize: () => canonicalize
|
|
7929
|
-
});
|
|
7930
|
-
function canonicalize(value) {
|
|
7931
|
-
if (value === null || typeof value === "boolean" || typeof value === "string")
|
|
7932
|
-
return JSON.stringify(value);
|
|
7933
|
-
if (typeof value === "number") {
|
|
7934
|
-
if (!Number.isFinite(value))
|
|
7935
|
-
throw new TypeError("Cannot canonicalize non-finite number");
|
|
7936
|
-
return Object.is(value, -0) ? "0" : JSON.stringify(value);
|
|
7937
|
-
}
|
|
7938
|
-
if (typeof value === "bigint")
|
|
7939
|
-
throw new TypeError("Cannot canonicalize bigint");
|
|
7940
|
-
if (Array.isArray(value))
|
|
7941
|
-
return `[${value.map((item) => canonicalize(item)).join(",")}]`;
|
|
7942
|
-
if (typeof value === "object") {
|
|
7943
|
-
const entries = Object.keys(value).sort().reduce((acc, key) => {
|
|
7944
|
-
const v = value[key];
|
|
7945
|
-
if (v !== undefined)
|
|
7946
|
-
acc.push(`${JSON.stringify(key)}:${canonicalize(v)}`);
|
|
7947
|
-
return acc;
|
|
7948
|
-
}, []);
|
|
7949
|
-
return `{${entries.join(",")}}`;
|
|
7827
|
+
function clean(...arrays) {
|
|
7828
|
+
for (let i = 0;i < arrays.length; i++) {
|
|
7829
|
+
arrays[i].fill(0);
|
|
7950
7830
|
}
|
|
7951
|
-
return;
|
|
7952
7831
|
}
|
|
7953
|
-
function
|
|
7954
|
-
return
|
|
7955
|
-
const value = value_;
|
|
7956
|
-
if (typeof value === "string" && value.endsWith(bigIntSuffix))
|
|
7957
|
-
return BigInt(value.slice(0, -bigIntSuffix.length));
|
|
7958
|
-
return typeof reviver === "function" ? reviver(key, value) : value;
|
|
7959
|
-
});
|
|
7832
|
+
function createView(arr) {
|
|
7833
|
+
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
7960
7834
|
}
|
|
7961
|
-
function
|
|
7962
|
-
return
|
|
7963
|
-
if (typeof replacer === "function")
|
|
7964
|
-
return replacer(key, value2);
|
|
7965
|
-
if (typeof value2 === "bigint")
|
|
7966
|
-
return value2.toString() + bigIntSuffix;
|
|
7967
|
-
return value2;
|
|
7968
|
-
}, space);
|
|
7835
|
+
function rotr(word, shift) {
|
|
7836
|
+
return word << 32 - shift | word >>> shift;
|
|
7969
7837
|
}
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
// node_modules/mppx/node_modules/ox/_esm/core/Hex.js
|
|
7973
|
-
function assert(value, options2 = {}) {
|
|
7974
|
-
const { strict = false } = options2;
|
|
7975
|
-
if (!value)
|
|
7976
|
-
throw new InvalidHexTypeError(value);
|
|
7977
|
-
if (typeof value !== "string")
|
|
7978
|
-
throw new InvalidHexTypeError(value);
|
|
7979
|
-
if (strict) {
|
|
7980
|
-
if (!/^0x[0-9a-fA-F]*$/.test(value))
|
|
7981
|
-
throw new InvalidHexValueError(value);
|
|
7982
|
-
}
|
|
7983
|
-
if (!value.startsWith("0x"))
|
|
7984
|
-
throw new InvalidHexValueError(value);
|
|
7838
|
+
function rotl(word, shift) {
|
|
7839
|
+
return word << shift | word >>> 32 - shift >>> 0;
|
|
7985
7840
|
}
|
|
7986
|
-
function
|
|
7987
|
-
|
|
7988
|
-
for (let i = 0;i < value.length; i++)
|
|
7989
|
-
string += hexes[value[i]];
|
|
7990
|
-
const hex = `0x${string}`;
|
|
7991
|
-
if (typeof options2.size === "number") {
|
|
7992
|
-
assertSize2(hex, options2.size);
|
|
7993
|
-
return padRight(hex, options2.size);
|
|
7994
|
-
}
|
|
7995
|
-
return hex;
|
|
7841
|
+
function byteSwap(word) {
|
|
7842
|
+
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
7996
7843
|
}
|
|
7997
|
-
function
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
let maxValue;
|
|
8001
|
-
if (size3) {
|
|
8002
|
-
if (signed)
|
|
8003
|
-
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
8004
|
-
else
|
|
8005
|
-
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
8006
|
-
} else if (typeof value === "number") {
|
|
8007
|
-
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
8008
|
-
}
|
|
8009
|
-
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
8010
|
-
if (maxValue && value_ > maxValue || value_ < minValue) {
|
|
8011
|
-
const suffix = typeof value === "bigint" ? "n" : "";
|
|
8012
|
-
throw new IntegerOutOfRangeError({
|
|
8013
|
-
max: maxValue ? `${maxValue}${suffix}` : undefined,
|
|
8014
|
-
min: `${minValue}${suffix}`,
|
|
8015
|
-
signed,
|
|
8016
|
-
size: size3,
|
|
8017
|
-
value: `${value}${suffix}`
|
|
8018
|
-
});
|
|
7844
|
+
function byteSwap32(arr) {
|
|
7845
|
+
for (let i = 0;i < arr.length; i++) {
|
|
7846
|
+
arr[i] = byteSwap(arr[i]);
|
|
8019
7847
|
}
|
|
8020
|
-
|
|
8021
|
-
const hex = `0x${stringValue}`;
|
|
8022
|
-
if (size3)
|
|
8023
|
-
return padLeft(hex, size3);
|
|
8024
|
-
return hex;
|
|
8025
|
-
}
|
|
8026
|
-
function padLeft(value, size3) {
|
|
8027
|
-
return pad3(value, { dir: "left", size: size3 });
|
|
8028
|
-
}
|
|
8029
|
-
function padRight(value, size3) {
|
|
8030
|
-
return pad3(value, { dir: "right", size: size3 });
|
|
7848
|
+
return arr;
|
|
8031
7849
|
}
|
|
8032
|
-
function
|
|
8033
|
-
|
|
7850
|
+
function utf8ToBytes(str) {
|
|
7851
|
+
if (typeof str !== "string")
|
|
7852
|
+
throw new Error("string expected");
|
|
7853
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
|
8034
7854
|
}
|
|
8035
|
-
function
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
if (!signed)
|
|
8041
|
-
return value;
|
|
8042
|
-
const size3 = (hex.length - 2) / 2;
|
|
8043
|
-
const max_unsigned = (1n << BigInt(size3) * 8n) - 1n;
|
|
8044
|
-
const max_signed = max_unsigned >> 1n;
|
|
8045
|
-
if (value <= max_signed)
|
|
8046
|
-
return value;
|
|
8047
|
-
return value - max_unsigned - 1n;
|
|
7855
|
+
function toBytes(data) {
|
|
7856
|
+
if (typeof data === "string")
|
|
7857
|
+
data = utf8ToBytes(data);
|
|
7858
|
+
abytes(data);
|
|
7859
|
+
return data;
|
|
8048
7860
|
}
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
if (!signed && !size3)
|
|
8052
|
-
return Number(hex);
|
|
8053
|
-
return Number(toBigInt(hex, options2));
|
|
7861
|
+
|
|
7862
|
+
class Hash {
|
|
8054
7863
|
}
|
|
8055
|
-
function
|
|
8056
|
-
const
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
}
|
|
7864
|
+
function createHasher(hashCons) {
|
|
7865
|
+
const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
|
|
7866
|
+
const tmp = hashCons();
|
|
7867
|
+
hashC.outputLen = tmp.outputLen;
|
|
7868
|
+
hashC.blockLen = tmp.blockLen;
|
|
7869
|
+
hashC.create = () => hashCons();
|
|
7870
|
+
return hashC;
|
|
8063
7871
|
}
|
|
8064
|
-
var
|
|
8065
|
-
var
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
7872
|
+
var isLE, swap32IfBE;
|
|
7873
|
+
var init_utils = __esm(() => {
|
|
7874
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
7875
|
+
isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
|
7876
|
+
swap32IfBE = isLE ? (u) => u : byteSwap32;
|
|
7877
|
+
});
|
|
7878
|
+
|
|
7879
|
+
// node_modules/@noble/hashes/esm/hmac.js
|
|
7880
|
+
var HMAC, hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();
|
|
7881
|
+
var init_hmac = __esm(() => {
|
|
7882
|
+
init_utils();
|
|
7883
|
+
HMAC = class HMAC extends Hash {
|
|
7884
|
+
constructor(hash, _key) {
|
|
7885
|
+
super();
|
|
7886
|
+
this.finished = false;
|
|
7887
|
+
this.destroyed = false;
|
|
7888
|
+
ahash(hash);
|
|
7889
|
+
const key = toBytes(_key);
|
|
7890
|
+
this.iHash = hash.create();
|
|
7891
|
+
if (typeof this.iHash.update !== "function")
|
|
7892
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
7893
|
+
this.blockLen = this.iHash.blockLen;
|
|
7894
|
+
this.outputLen = this.iHash.outputLen;
|
|
7895
|
+
const blockLen = this.blockLen;
|
|
7896
|
+
const pad2 = new Uint8Array(blockLen);
|
|
7897
|
+
pad2.set(key.length > blockLen ? hash.create().update(key).digest() : key);
|
|
7898
|
+
for (let i = 0;i < pad2.length; i++)
|
|
7899
|
+
pad2[i] ^= 54;
|
|
7900
|
+
this.iHash.update(pad2);
|
|
7901
|
+
this.oHash = hash.create();
|
|
7902
|
+
for (let i = 0;i < pad2.length; i++)
|
|
7903
|
+
pad2[i] ^= 54 ^ 92;
|
|
7904
|
+
this.oHash.update(pad2);
|
|
7905
|
+
clean(pad2);
|
|
8078
7906
|
}
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
8084
|
-
});
|
|
8085
|
-
Object.defineProperty(this, "name", {
|
|
8086
|
-
enumerable: true,
|
|
8087
|
-
configurable: true,
|
|
8088
|
-
writable: true,
|
|
8089
|
-
value: "Hex.InvalidHexTypeError"
|
|
8090
|
-
});
|
|
7907
|
+
update(buf) {
|
|
7908
|
+
aexists(this);
|
|
7909
|
+
this.iHash.update(buf);
|
|
7910
|
+
return this;
|
|
8091
7911
|
}
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
Object.defineProperty(this, "name", {
|
|
8101
|
-
enumerable: true,
|
|
8102
|
-
configurable: true,
|
|
8103
|
-
writable: true,
|
|
8104
|
-
value: "Hex.InvalidHexValueError"
|
|
8105
|
-
});
|
|
7912
|
+
digestInto(out) {
|
|
7913
|
+
aexists(this);
|
|
7914
|
+
abytes(out, this.outputLen);
|
|
7915
|
+
this.finished = true;
|
|
7916
|
+
this.iHash.digestInto(out);
|
|
7917
|
+
this.oHash.update(out);
|
|
7918
|
+
this.oHash.digestInto(out);
|
|
7919
|
+
this.destroy();
|
|
8106
7920
|
}
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
Object.defineProperty(this, "name", {
|
|
8112
|
-
enumerable: true,
|
|
8113
|
-
configurable: true,
|
|
8114
|
-
writable: true,
|
|
8115
|
-
value: "Hex.SizeOverflowError"
|
|
8116
|
-
});
|
|
7921
|
+
digest() {
|
|
7922
|
+
const out = new Uint8Array(this.oHash.outputLen);
|
|
7923
|
+
this.digestInto(out);
|
|
7924
|
+
return out;
|
|
8117
7925
|
}
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
7926
|
+
_cloneInto(to) {
|
|
7927
|
+
to || (to = Object.create(Object.getPrototypeOf(this), {}));
|
|
7928
|
+
const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
|
|
7929
|
+
to = to;
|
|
7930
|
+
to.finished = finished;
|
|
7931
|
+
to.destroyed = destroyed;
|
|
7932
|
+
to.blockLen = blockLen;
|
|
7933
|
+
to.outputLen = outputLen;
|
|
7934
|
+
to.oHash = oHash._cloneInto(to.oHash);
|
|
7935
|
+
to.iHash = iHash._cloneInto(to.iHash);
|
|
7936
|
+
return to;
|
|
7937
|
+
}
|
|
7938
|
+
clone() {
|
|
7939
|
+
return this._cloneInto();
|
|
7940
|
+
}
|
|
7941
|
+
destroy() {
|
|
7942
|
+
this.destroyed = true;
|
|
7943
|
+
this.oHash.destroy();
|
|
7944
|
+
this.iHash.destroy();
|
|
8128
7945
|
}
|
|
8129
7946
|
};
|
|
7947
|
+
hmac.create = (hash, key) => new HMAC(hash, key);
|
|
8130
7948
|
});
|
|
8131
7949
|
|
|
8132
|
-
// node_modules/
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
size: () => size,
|
|
8145
|
-
random: () => random,
|
|
8146
|
-
padRight: () => padRight2,
|
|
8147
|
-
padLeft: () => padLeft2,
|
|
8148
|
-
isEqual: () => isEqual,
|
|
8149
|
-
fromString: () => fromString,
|
|
8150
|
-
fromNumber: () => fromNumber2,
|
|
8151
|
-
fromHex: () => fromHex,
|
|
8152
|
-
fromBoolean: () => fromBoolean,
|
|
8153
|
-
fromArray: () => fromArray,
|
|
8154
|
-
from: () => from,
|
|
8155
|
-
concat: () => concat,
|
|
8156
|
-
assert: () => assert2,
|
|
8157
|
-
SliceOffsetOutOfBoundsError: () => SliceOffsetOutOfBoundsError,
|
|
8158
|
-
SizeOverflowError: () => SizeOverflowError,
|
|
8159
|
-
SizeExceedsPaddingSizeError: () => SizeExceedsPaddingSizeError,
|
|
8160
|
-
InvalidBytesTypeError: () => InvalidBytesTypeError,
|
|
8161
|
-
InvalidBytesBooleanError: () => InvalidBytesBooleanError
|
|
8162
|
-
});
|
|
8163
|
-
function assert2(value) {
|
|
8164
|
-
if (value instanceof Uint8Array)
|
|
8165
|
-
return;
|
|
8166
|
-
if (!value)
|
|
8167
|
-
throw new InvalidBytesTypeError(value);
|
|
8168
|
-
if (typeof value !== "object")
|
|
8169
|
-
throw new InvalidBytesTypeError(value);
|
|
8170
|
-
if (!("BYTES_PER_ELEMENT" in value))
|
|
8171
|
-
throw new InvalidBytesTypeError(value);
|
|
8172
|
-
if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
|
|
8173
|
-
throw new InvalidBytesTypeError(value);
|
|
8174
|
-
}
|
|
8175
|
-
function concat(...values) {
|
|
8176
|
-
let length = 0;
|
|
8177
|
-
for (const arr of values) {
|
|
8178
|
-
length += arr.length;
|
|
8179
|
-
}
|
|
8180
|
-
const result = new Uint8Array(length);
|
|
8181
|
-
for (let i = 0, index = 0;i < values.length; i++) {
|
|
8182
|
-
const arr = values[i];
|
|
8183
|
-
result.set(arr, index);
|
|
8184
|
-
index += arr.length;
|
|
8185
|
-
}
|
|
8186
|
-
return result;
|
|
8187
|
-
}
|
|
8188
|
-
function from(value) {
|
|
8189
|
-
if (value instanceof Uint8Array)
|
|
8190
|
-
return value;
|
|
8191
|
-
if (typeof value === "string")
|
|
8192
|
-
return fromHex(value);
|
|
8193
|
-
return fromArray(value);
|
|
7950
|
+
// node_modules/@noble/hashes/esm/_md.js
|
|
7951
|
+
function setBigUint64(view, byteOffset, value, isLE2) {
|
|
7952
|
+
if (typeof view.setBigUint64 === "function")
|
|
7953
|
+
return view.setBigUint64(byteOffset, value, isLE2);
|
|
7954
|
+
const _32n = BigInt(32);
|
|
7955
|
+
const _u32_max = BigInt(4294967295);
|
|
7956
|
+
const wh = Number(value >> _32n & _u32_max);
|
|
7957
|
+
const wl = Number(value & _u32_max);
|
|
7958
|
+
const h = isLE2 ? 4 : 0;
|
|
7959
|
+
const l = isLE2 ? 0 : 4;
|
|
7960
|
+
view.setUint32(byteOffset + h, wh, isLE2);
|
|
7961
|
+
view.setUint32(byteOffset + l, wl, isLE2);
|
|
8194
7962
|
}
|
|
8195
|
-
function
|
|
8196
|
-
return
|
|
7963
|
+
function Chi(a, b, c) {
|
|
7964
|
+
return a & b ^ ~a & c;
|
|
8197
7965
|
}
|
|
8198
|
-
function
|
|
8199
|
-
|
|
8200
|
-
const bytes = new Uint8Array(1);
|
|
8201
|
-
bytes[0] = Number(value);
|
|
8202
|
-
if (typeof size3 === "number") {
|
|
8203
|
-
assertSize(bytes, size3);
|
|
8204
|
-
return padLeft2(bytes, size3);
|
|
8205
|
-
}
|
|
8206
|
-
return bytes;
|
|
8207
|
-
}
|
|
8208
|
-
function fromHex(value, options2 = {}) {
|
|
8209
|
-
const { size: size3 } = options2;
|
|
8210
|
-
let hex = value;
|
|
8211
|
-
if (size3) {
|
|
8212
|
-
assertSize2(value, size3);
|
|
8213
|
-
hex = padRight(value, size3);
|
|
8214
|
-
}
|
|
8215
|
-
let hexString = hex.slice(2);
|
|
8216
|
-
if (hexString.length % 2)
|
|
8217
|
-
hexString = `0${hexString}`;
|
|
8218
|
-
const length = hexString.length / 2;
|
|
8219
|
-
const bytes = new Uint8Array(length);
|
|
8220
|
-
for (let index = 0, j = 0;index < length; index++) {
|
|
8221
|
-
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
8222
|
-
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
8223
|
-
if (nibbleLeft === undefined || nibbleRight === undefined) {
|
|
8224
|
-
throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
8225
|
-
}
|
|
8226
|
-
bytes[index] = nibbleLeft << 4 | nibbleRight;
|
|
8227
|
-
}
|
|
8228
|
-
return bytes;
|
|
8229
|
-
}
|
|
8230
|
-
function fromNumber2(value, options2) {
|
|
8231
|
-
const hex = fromNumber(value, options2);
|
|
8232
|
-
return fromHex(hex);
|
|
8233
|
-
}
|
|
8234
|
-
function fromString(value, options2 = {}) {
|
|
8235
|
-
const { size: size3 } = options2;
|
|
8236
|
-
const bytes = encoder.encode(value);
|
|
8237
|
-
if (typeof size3 === "number") {
|
|
8238
|
-
assertSize(bytes, size3);
|
|
8239
|
-
return padRight2(bytes, size3);
|
|
8240
|
-
}
|
|
8241
|
-
return bytes;
|
|
8242
|
-
}
|
|
8243
|
-
function isEqual(bytesA, bytesB) {
|
|
8244
|
-
return equalBytes(bytesA, bytesB);
|
|
8245
|
-
}
|
|
8246
|
-
function padLeft2(value, size3) {
|
|
8247
|
-
return pad2(value, { dir: "left", size: size3 });
|
|
8248
|
-
}
|
|
8249
|
-
function padRight2(value, size3) {
|
|
8250
|
-
return pad2(value, { dir: "right", size: size3 });
|
|
8251
|
-
}
|
|
8252
|
-
function random(length) {
|
|
8253
|
-
return crypto.getRandomValues(new Uint8Array(length));
|
|
8254
|
-
}
|
|
8255
|
-
function size(value) {
|
|
8256
|
-
return value.length;
|
|
8257
|
-
}
|
|
8258
|
-
function slice(value, start, end, options2 = {}) {
|
|
8259
|
-
const { strict } = options2;
|
|
8260
|
-
assertStartOffset(value, start);
|
|
8261
|
-
const value_ = value.slice(start, end);
|
|
8262
|
-
if (strict)
|
|
8263
|
-
assertEndOffset(value_, start, end);
|
|
8264
|
-
return value_;
|
|
8265
|
-
}
|
|
8266
|
-
function toBigInt2(bytes, options2 = {}) {
|
|
8267
|
-
const { size: size3 } = options2;
|
|
8268
|
-
if (typeof size3 !== "undefined")
|
|
8269
|
-
assertSize(bytes, size3);
|
|
8270
|
-
const hex = fromBytes(bytes, options2);
|
|
8271
|
-
return toBigInt(hex, options2);
|
|
8272
|
-
}
|
|
8273
|
-
function toBoolean(bytes, options2 = {}) {
|
|
8274
|
-
const { size: size3 } = options2;
|
|
8275
|
-
let bytes_ = bytes;
|
|
8276
|
-
if (typeof size3 !== "undefined") {
|
|
8277
|
-
assertSize(bytes_, size3);
|
|
8278
|
-
bytes_ = trimLeft(bytes_);
|
|
8279
|
-
}
|
|
8280
|
-
if (bytes_.length > 1 || bytes_[0] > 1)
|
|
8281
|
-
throw new InvalidBytesBooleanError(bytes_);
|
|
8282
|
-
return Boolean(bytes_[0]);
|
|
8283
|
-
}
|
|
8284
|
-
function toHex(value, options2 = {}) {
|
|
8285
|
-
return fromBytes(value, options2);
|
|
8286
|
-
}
|
|
8287
|
-
function toNumber2(bytes, options2 = {}) {
|
|
8288
|
-
const { size: size3 } = options2;
|
|
8289
|
-
if (typeof size3 !== "undefined")
|
|
8290
|
-
assertSize(bytes, size3);
|
|
8291
|
-
const hex = fromBytes(bytes, options2);
|
|
8292
|
-
return toNumber(hex, options2);
|
|
8293
|
-
}
|
|
8294
|
-
function toString(bytes, options2 = {}) {
|
|
8295
|
-
const { size: size3 } = options2;
|
|
8296
|
-
let bytes_ = bytes;
|
|
8297
|
-
if (typeof size3 !== "undefined") {
|
|
8298
|
-
assertSize(bytes_, size3);
|
|
8299
|
-
bytes_ = trimRight(bytes_);
|
|
8300
|
-
}
|
|
8301
|
-
return decoder.decode(bytes_);
|
|
8302
|
-
}
|
|
8303
|
-
function trimLeft(value) {
|
|
8304
|
-
return trim(value, { dir: "left" });
|
|
8305
|
-
}
|
|
8306
|
-
function trimRight(value) {
|
|
8307
|
-
return trim(value, { dir: "right" });
|
|
8308
|
-
}
|
|
8309
|
-
function validate3(value) {
|
|
8310
|
-
try {
|
|
8311
|
-
assert2(value);
|
|
8312
|
-
return true;
|
|
8313
|
-
} catch {
|
|
8314
|
-
return false;
|
|
8315
|
-
}
|
|
8316
|
-
}
|
|
8317
|
-
var decoder, encoder, InvalidBytesBooleanError, InvalidBytesTypeError, SizeOverflowError, SliceOffsetOutOfBoundsError, SizeExceedsPaddingSizeError;
|
|
8318
|
-
var init_Bytes = __esm(() => {
|
|
8319
|
-
init_utils();
|
|
8320
|
-
init_Errors();
|
|
8321
|
-
init_Hex();
|
|
8322
|
-
init_bytes();
|
|
8323
|
-
init_hex();
|
|
8324
|
-
decoder = /* @__PURE__ */ new TextDecoder;
|
|
8325
|
-
encoder = /* @__PURE__ */ new TextEncoder;
|
|
8326
|
-
InvalidBytesBooleanError = class InvalidBytesBooleanError extends BaseError {
|
|
8327
|
-
constructor(bytes) {
|
|
8328
|
-
super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
|
|
8329
|
-
metaMessages: [
|
|
8330
|
-
"The bytes array must contain a single byte of either a `0` or `1` value."
|
|
8331
|
-
]
|
|
8332
|
-
});
|
|
8333
|
-
Object.defineProperty(this, "name", {
|
|
8334
|
-
enumerable: true,
|
|
8335
|
-
configurable: true,
|
|
8336
|
-
writable: true,
|
|
8337
|
-
value: "Bytes.InvalidBytesBooleanError"
|
|
8338
|
-
});
|
|
8339
|
-
}
|
|
8340
|
-
};
|
|
8341
|
-
InvalidBytesTypeError = class InvalidBytesTypeError extends BaseError {
|
|
8342
|
-
constructor(value) {
|
|
8343
|
-
super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
|
|
8344
|
-
metaMessages: ["Bytes values must be of type `Bytes`."]
|
|
8345
|
-
});
|
|
8346
|
-
Object.defineProperty(this, "name", {
|
|
8347
|
-
enumerable: true,
|
|
8348
|
-
configurable: true,
|
|
8349
|
-
writable: true,
|
|
8350
|
-
value: "Bytes.InvalidBytesTypeError"
|
|
8351
|
-
});
|
|
8352
|
-
}
|
|
8353
|
-
};
|
|
8354
|
-
SizeOverflowError = class SizeOverflowError extends BaseError {
|
|
8355
|
-
constructor({ givenSize, maxSize }) {
|
|
8356
|
-
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
8357
|
-
Object.defineProperty(this, "name", {
|
|
8358
|
-
enumerable: true,
|
|
8359
|
-
configurable: true,
|
|
8360
|
-
writable: true,
|
|
8361
|
-
value: "Bytes.SizeOverflowError"
|
|
8362
|
-
});
|
|
8363
|
-
}
|
|
8364
|
-
};
|
|
8365
|
-
SliceOffsetOutOfBoundsError = class SliceOffsetOutOfBoundsError extends BaseError {
|
|
8366
|
-
constructor({ offset, position, size: size3 }) {
|
|
8367
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size3}\`).`);
|
|
8368
|
-
Object.defineProperty(this, "name", {
|
|
8369
|
-
enumerable: true,
|
|
8370
|
-
configurable: true,
|
|
8371
|
-
writable: true,
|
|
8372
|
-
value: "Bytes.SliceOffsetOutOfBoundsError"
|
|
8373
|
-
});
|
|
8374
|
-
}
|
|
8375
|
-
};
|
|
8376
|
-
SizeExceedsPaddingSizeError = class SizeExceedsPaddingSizeError extends BaseError {
|
|
8377
|
-
constructor({ size: size3, targetSize, type }) {
|
|
8378
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
8379
|
-
Object.defineProperty(this, "name", {
|
|
8380
|
-
enumerable: true,
|
|
8381
|
-
configurable: true,
|
|
8382
|
-
writable: true,
|
|
8383
|
-
value: "Bytes.SizeExceedsPaddingSizeError"
|
|
8384
|
-
});
|
|
8385
|
-
}
|
|
8386
|
-
};
|
|
8387
|
-
});
|
|
8388
|
-
|
|
8389
|
-
// node_modules/mppx/node_modules/ox/_esm/core/Base64.js
|
|
8390
|
-
var exports_Base64 = {};
|
|
8391
|
-
__export(exports_Base64, {
|
|
8392
|
-
toString: () => toString2,
|
|
8393
|
-
toHex: () => toHex2,
|
|
8394
|
-
toBytes: () => toBytes,
|
|
8395
|
-
fromString: () => fromString2,
|
|
8396
|
-
fromHex: () => fromHex2,
|
|
8397
|
-
fromBytes: () => fromBytes2
|
|
8398
|
-
});
|
|
8399
|
-
function fromBytes2(value, options2 = {}) {
|
|
8400
|
-
const { pad: pad4 = true, url = false } = options2;
|
|
8401
|
-
const encoded = new Uint8Array(Math.ceil(value.length / 3) * 4);
|
|
8402
|
-
for (let i = 0, j = 0;j < value.length; i += 4, j += 3) {
|
|
8403
|
-
const y = (value[j] << 16) + (value[j + 1] << 8) + (value[j + 2] | 0);
|
|
8404
|
-
encoded[i] = integerToCharacter[y >> 18];
|
|
8405
|
-
encoded[i + 1] = integerToCharacter[y >> 12 & 63];
|
|
8406
|
-
encoded[i + 2] = integerToCharacter[y >> 6 & 63];
|
|
8407
|
-
encoded[i + 3] = integerToCharacter[y & 63];
|
|
8408
|
-
}
|
|
8409
|
-
const k = value.length % 3;
|
|
8410
|
-
const end = Math.floor(value.length / 3) * 4 + (k && k + 1);
|
|
8411
|
-
let base64 = decoder2.decode(new Uint8Array(encoded.buffer, 0, end));
|
|
8412
|
-
if (pad4 && k === 1)
|
|
8413
|
-
base64 += "==";
|
|
8414
|
-
if (pad4 && k === 2)
|
|
8415
|
-
base64 += "=";
|
|
8416
|
-
if (url)
|
|
8417
|
-
base64 = base64.replaceAll("+", "-").replaceAll("/", "_");
|
|
8418
|
-
return base64;
|
|
8419
|
-
}
|
|
8420
|
-
function fromHex2(value, options2 = {}) {
|
|
8421
|
-
return fromBytes2(fromHex(value), options2);
|
|
8422
|
-
}
|
|
8423
|
-
function fromString2(value, options2 = {}) {
|
|
8424
|
-
return fromBytes2(fromString(value), options2);
|
|
8425
|
-
}
|
|
8426
|
-
function toBytes(value) {
|
|
8427
|
-
const base64 = value.replace(/=+$/, "");
|
|
8428
|
-
const size3 = base64.length;
|
|
8429
|
-
const decoded = new Uint8Array(size3 + 3);
|
|
8430
|
-
encoder2.encodeInto(base64 + "===", decoded);
|
|
8431
|
-
for (let i = 0, j = 0;i < base64.length; i += 4, j += 3) {
|
|
8432
|
-
const x = (characterToInteger[decoded[i]] << 18) + (characterToInteger[decoded[i + 1]] << 12) + (characterToInteger[decoded[i + 2]] << 6) + characterToInteger[decoded[i + 3]];
|
|
8433
|
-
decoded[j] = x >> 16;
|
|
8434
|
-
decoded[j + 1] = x >> 8 & 255;
|
|
8435
|
-
decoded[j + 2] = x & 255;
|
|
8436
|
-
}
|
|
8437
|
-
const decodedSize = (size3 >> 2) * 3 + (size3 % 4 && size3 % 4 - 1);
|
|
8438
|
-
return new Uint8Array(decoded.buffer, 0, decodedSize);
|
|
8439
|
-
}
|
|
8440
|
-
function toHex2(value) {
|
|
8441
|
-
return fromBytes(toBytes(value));
|
|
8442
|
-
}
|
|
8443
|
-
function toString2(value) {
|
|
8444
|
-
return toString(toBytes(value));
|
|
8445
|
-
}
|
|
8446
|
-
var encoder2, decoder2, integerToCharacter, characterToInteger;
|
|
8447
|
-
var init_Base64 = __esm(() => {
|
|
8448
|
-
init_Bytes();
|
|
8449
|
-
init_Hex();
|
|
8450
|
-
encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
8451
|
-
decoder2 = /* @__PURE__ */ new TextDecoder;
|
|
8452
|
-
integerToCharacter = /* @__PURE__ */ Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((a, i) => [i, a.charCodeAt(0)]));
|
|
8453
|
-
characterToInteger = {
|
|
8454
|
-
...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((a, i) => [a.charCodeAt(0), i])),
|
|
8455
|
-
[61]: 0,
|
|
8456
|
-
[45]: 62,
|
|
8457
|
-
[95]: 63
|
|
8458
|
-
};
|
|
8459
|
-
});
|
|
8460
|
-
|
|
8461
|
-
// node_modules/@noble/hashes/esm/utils.js
|
|
8462
|
-
function isBytes(a) {
|
|
8463
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
8464
|
-
}
|
|
8465
|
-
function anumber(n) {
|
|
8466
|
-
if (!Number.isSafeInteger(n) || n < 0)
|
|
8467
|
-
throw new Error("positive integer expected, got " + n);
|
|
8468
|
-
}
|
|
8469
|
-
function abytes(b, ...lengths) {
|
|
8470
|
-
if (!isBytes(b))
|
|
8471
|
-
throw new Error("Uint8Array expected");
|
|
8472
|
-
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
8473
|
-
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
8474
|
-
}
|
|
8475
|
-
function ahash(h) {
|
|
8476
|
-
if (typeof h !== "function" || typeof h.create !== "function")
|
|
8477
|
-
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
8478
|
-
anumber(h.outputLen);
|
|
8479
|
-
anumber(h.blockLen);
|
|
8480
|
-
}
|
|
8481
|
-
function aexists(instance, checkFinished = true) {
|
|
8482
|
-
if (instance.destroyed)
|
|
8483
|
-
throw new Error("Hash instance has been destroyed");
|
|
8484
|
-
if (checkFinished && instance.finished)
|
|
8485
|
-
throw new Error("Hash#digest() has already been called");
|
|
8486
|
-
}
|
|
8487
|
-
function aoutput(out, instance) {
|
|
8488
|
-
abytes(out);
|
|
8489
|
-
const min = instance.outputLen;
|
|
8490
|
-
if (out.length < min) {
|
|
8491
|
-
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
8492
|
-
}
|
|
8493
|
-
}
|
|
8494
|
-
function u32(arr) {
|
|
8495
|
-
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
8496
|
-
}
|
|
8497
|
-
function clean(...arrays) {
|
|
8498
|
-
for (let i = 0;i < arrays.length; i++) {
|
|
8499
|
-
arrays[i].fill(0);
|
|
8500
|
-
}
|
|
8501
|
-
}
|
|
8502
|
-
function createView(arr) {
|
|
8503
|
-
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
8504
|
-
}
|
|
8505
|
-
function rotr(word, shift) {
|
|
8506
|
-
return word << 32 - shift | word >>> shift;
|
|
8507
|
-
}
|
|
8508
|
-
function rotl(word, shift) {
|
|
8509
|
-
return word << shift | word >>> 32 - shift >>> 0;
|
|
8510
|
-
}
|
|
8511
|
-
function byteSwap(word) {
|
|
8512
|
-
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
8513
|
-
}
|
|
8514
|
-
function byteSwap32(arr) {
|
|
8515
|
-
for (let i = 0;i < arr.length; i++) {
|
|
8516
|
-
arr[i] = byteSwap(arr[i]);
|
|
8517
|
-
}
|
|
8518
|
-
return arr;
|
|
8519
|
-
}
|
|
8520
|
-
function utf8ToBytes(str) {
|
|
8521
|
-
if (typeof str !== "string")
|
|
8522
|
-
throw new Error("string expected");
|
|
8523
|
-
return new Uint8Array(new TextEncoder().encode(str));
|
|
8524
|
-
}
|
|
8525
|
-
function toBytes2(data) {
|
|
8526
|
-
if (typeof data === "string")
|
|
8527
|
-
data = utf8ToBytes(data);
|
|
8528
|
-
abytes(data);
|
|
8529
|
-
return data;
|
|
8530
|
-
}
|
|
8531
|
-
|
|
8532
|
-
class Hash {
|
|
8533
|
-
}
|
|
8534
|
-
function createHasher(hashCons) {
|
|
8535
|
-
const hashC = (msg) => hashCons().update(toBytes2(msg)).digest();
|
|
8536
|
-
const tmp = hashCons();
|
|
8537
|
-
hashC.outputLen = tmp.outputLen;
|
|
8538
|
-
hashC.blockLen = tmp.blockLen;
|
|
8539
|
-
hashC.create = () => hashCons();
|
|
8540
|
-
return hashC;
|
|
8541
|
-
}
|
|
8542
|
-
var isLE, swap32IfBE;
|
|
8543
|
-
var init_utils2 = __esm(() => {
|
|
8544
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
8545
|
-
isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
|
8546
|
-
swap32IfBE = isLE ? (u) => u : byteSwap32;
|
|
8547
|
-
});
|
|
8548
|
-
|
|
8549
|
-
// node_modules/@noble/hashes/esm/hmac.js
|
|
8550
|
-
var HMAC, hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();
|
|
8551
|
-
var init_hmac = __esm(() => {
|
|
8552
|
-
init_utils2();
|
|
8553
|
-
HMAC = class HMAC extends Hash {
|
|
8554
|
-
constructor(hash, _key) {
|
|
8555
|
-
super();
|
|
8556
|
-
this.finished = false;
|
|
8557
|
-
this.destroyed = false;
|
|
8558
|
-
ahash(hash);
|
|
8559
|
-
const key = toBytes2(_key);
|
|
8560
|
-
this.iHash = hash.create();
|
|
8561
|
-
if (typeof this.iHash.update !== "function")
|
|
8562
|
-
throw new Error("Expected instance of class which extends utils.Hash");
|
|
8563
|
-
this.blockLen = this.iHash.blockLen;
|
|
8564
|
-
this.outputLen = this.iHash.outputLen;
|
|
8565
|
-
const blockLen = this.blockLen;
|
|
8566
|
-
const pad4 = new Uint8Array(blockLen);
|
|
8567
|
-
pad4.set(key.length > blockLen ? hash.create().update(key).digest() : key);
|
|
8568
|
-
for (let i = 0;i < pad4.length; i++)
|
|
8569
|
-
pad4[i] ^= 54;
|
|
8570
|
-
this.iHash.update(pad4);
|
|
8571
|
-
this.oHash = hash.create();
|
|
8572
|
-
for (let i = 0;i < pad4.length; i++)
|
|
8573
|
-
pad4[i] ^= 54 ^ 92;
|
|
8574
|
-
this.oHash.update(pad4);
|
|
8575
|
-
clean(pad4);
|
|
8576
|
-
}
|
|
8577
|
-
update(buf) {
|
|
8578
|
-
aexists(this);
|
|
8579
|
-
this.iHash.update(buf);
|
|
8580
|
-
return this;
|
|
8581
|
-
}
|
|
8582
|
-
digestInto(out) {
|
|
8583
|
-
aexists(this);
|
|
8584
|
-
abytes(out, this.outputLen);
|
|
8585
|
-
this.finished = true;
|
|
8586
|
-
this.iHash.digestInto(out);
|
|
8587
|
-
this.oHash.update(out);
|
|
8588
|
-
this.oHash.digestInto(out);
|
|
8589
|
-
this.destroy();
|
|
8590
|
-
}
|
|
8591
|
-
digest() {
|
|
8592
|
-
const out = new Uint8Array(this.oHash.outputLen);
|
|
8593
|
-
this.digestInto(out);
|
|
8594
|
-
return out;
|
|
8595
|
-
}
|
|
8596
|
-
_cloneInto(to) {
|
|
8597
|
-
to || (to = Object.create(Object.getPrototypeOf(this), {}));
|
|
8598
|
-
const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
|
|
8599
|
-
to = to;
|
|
8600
|
-
to.finished = finished;
|
|
8601
|
-
to.destroyed = destroyed;
|
|
8602
|
-
to.blockLen = blockLen;
|
|
8603
|
-
to.outputLen = outputLen;
|
|
8604
|
-
to.oHash = oHash._cloneInto(to.oHash);
|
|
8605
|
-
to.iHash = iHash._cloneInto(to.iHash);
|
|
8606
|
-
return to;
|
|
8607
|
-
}
|
|
8608
|
-
clone() {
|
|
8609
|
-
return this._cloneInto();
|
|
8610
|
-
}
|
|
8611
|
-
destroy() {
|
|
8612
|
-
this.destroyed = true;
|
|
8613
|
-
this.oHash.destroy();
|
|
8614
|
-
this.iHash.destroy();
|
|
8615
|
-
}
|
|
8616
|
-
};
|
|
8617
|
-
hmac.create = (hash, key) => new HMAC(hash, key);
|
|
8618
|
-
});
|
|
8619
|
-
|
|
8620
|
-
// node_modules/@noble/hashes/esm/_md.js
|
|
8621
|
-
function setBigUint64(view, byteOffset, value, isLE2) {
|
|
8622
|
-
if (typeof view.setBigUint64 === "function")
|
|
8623
|
-
return view.setBigUint64(byteOffset, value, isLE2);
|
|
8624
|
-
const _32n = BigInt(32);
|
|
8625
|
-
const _u32_max = BigInt(4294967295);
|
|
8626
|
-
const wh = Number(value >> _32n & _u32_max);
|
|
8627
|
-
const wl = Number(value & _u32_max);
|
|
8628
|
-
const h = isLE2 ? 4 : 0;
|
|
8629
|
-
const l = isLE2 ? 0 : 4;
|
|
8630
|
-
view.setUint32(byteOffset + h, wh, isLE2);
|
|
8631
|
-
view.setUint32(byteOffset + l, wl, isLE2);
|
|
8632
|
-
}
|
|
8633
|
-
function Chi(a, b, c) {
|
|
8634
|
-
return a & b ^ ~a & c;
|
|
8635
|
-
}
|
|
8636
|
-
function Maj(a, b, c) {
|
|
8637
|
-
return a & b ^ a & c ^ b & c;
|
|
7966
|
+
function Maj(a, b, c) {
|
|
7967
|
+
return a & b ^ a & c ^ b & c;
|
|
8638
7968
|
}
|
|
8639
7969
|
var HashMD, SHA256_IV;
|
|
8640
7970
|
var init__md = __esm(() => {
|
|
8641
|
-
|
|
7971
|
+
init_utils();
|
|
8642
7972
|
HashMD = class HashMD extends Hash {
|
|
8643
7973
|
constructor(blockLen, outputLen, padOffset, isLE2) {
|
|
8644
7974
|
super();
|
|
@@ -8655,7 +7985,7 @@ var init__md = __esm(() => {
|
|
|
8655
7985
|
}
|
|
8656
7986
|
update(data) {
|
|
8657
7987
|
aexists(this);
|
|
8658
|
-
data =
|
|
7988
|
+
data = toBytes(data);
|
|
8659
7989
|
abytes(data);
|
|
8660
7990
|
const { view, buffer, blockLen } = this;
|
|
8661
7991
|
const len = data.length;
|
|
@@ -8756,7 +8086,7 @@ function ripemd_f(group, x, y, z) {
|
|
|
8756
8086
|
var Rho160, Id160, Pi160, idxLR, idxL, idxR, shifts160, shiftsL160, shiftsR160, Kl160, Kr160, BUF_160, RIPEMD160, ripemd160;
|
|
8757
8087
|
var init_legacy = __esm(() => {
|
|
8758
8088
|
init__md();
|
|
8759
|
-
|
|
8089
|
+
init_utils();
|
|
8760
8090
|
Rho160 = /* @__PURE__ */ Uint8Array.from([
|
|
8761
8091
|
7,
|
|
8762
8092
|
4,
|
|
@@ -8937,7 +8267,7 @@ function keccakP(s, rounds = 24) {
|
|
|
8937
8267
|
var _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s), rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s), Keccak, gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen)), keccak_256;
|
|
8938
8268
|
var init_sha3 = __esm(() => {
|
|
8939
8269
|
init__u64();
|
|
8940
|
-
|
|
8270
|
+
init_utils();
|
|
8941
8271
|
_0n = BigInt(0);
|
|
8942
8272
|
_1n = BigInt(1);
|
|
8943
8273
|
_2n = BigInt(2);
|
|
@@ -8993,7 +8323,7 @@ var init_sha3 = __esm(() => {
|
|
|
8993
8323
|
}
|
|
8994
8324
|
update(data) {
|
|
8995
8325
|
aexists(this);
|
|
8996
|
-
data =
|
|
8326
|
+
data = toBytes(data);
|
|
8997
8327
|
abytes(data);
|
|
8998
8328
|
const { blockLen, state } = this;
|
|
8999
8329
|
const len = data.length;
|
|
@@ -9006,283 +8336,3128 @@ var init_sha3 = __esm(() => {
|
|
|
9006
8336
|
}
|
|
9007
8337
|
return this;
|
|
9008
8338
|
}
|
|
9009
|
-
finish() {
|
|
9010
|
-
if (this.finished)
|
|
9011
|
-
return;
|
|
9012
|
-
this.finished = true;
|
|
9013
|
-
const { state, suffix, pos, blockLen } = this;
|
|
9014
|
-
state[pos] ^= suffix;
|
|
9015
|
-
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
|
9016
|
-
this.keccak();
|
|
9017
|
-
state[blockLen - 1] ^= 128;
|
|
9018
|
-
this.keccak();
|
|
8339
|
+
finish() {
|
|
8340
|
+
if (this.finished)
|
|
8341
|
+
return;
|
|
8342
|
+
this.finished = true;
|
|
8343
|
+
const { state, suffix, pos, blockLen } = this;
|
|
8344
|
+
state[pos] ^= suffix;
|
|
8345
|
+
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
|
8346
|
+
this.keccak();
|
|
8347
|
+
state[blockLen - 1] ^= 128;
|
|
8348
|
+
this.keccak();
|
|
8349
|
+
}
|
|
8350
|
+
writeInto(out) {
|
|
8351
|
+
aexists(this, false);
|
|
8352
|
+
abytes(out);
|
|
8353
|
+
this.finish();
|
|
8354
|
+
const bufferOut = this.state;
|
|
8355
|
+
const { blockLen } = this;
|
|
8356
|
+
for (let pos = 0, len = out.length;pos < len; ) {
|
|
8357
|
+
if (this.posOut >= blockLen)
|
|
8358
|
+
this.keccak();
|
|
8359
|
+
const take = Math.min(blockLen - this.posOut, len - pos);
|
|
8360
|
+
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
|
8361
|
+
this.posOut += take;
|
|
8362
|
+
pos += take;
|
|
8363
|
+
}
|
|
8364
|
+
return out;
|
|
8365
|
+
}
|
|
8366
|
+
xofInto(out) {
|
|
8367
|
+
if (!this.enableXOF)
|
|
8368
|
+
throw new Error("XOF is not possible for this instance");
|
|
8369
|
+
return this.writeInto(out);
|
|
8370
|
+
}
|
|
8371
|
+
xof(bytes) {
|
|
8372
|
+
anumber(bytes);
|
|
8373
|
+
return this.xofInto(new Uint8Array(bytes));
|
|
8374
|
+
}
|
|
8375
|
+
digestInto(out) {
|
|
8376
|
+
aoutput(out, this);
|
|
8377
|
+
if (this.finished)
|
|
8378
|
+
throw new Error("digest() was already called");
|
|
8379
|
+
this.writeInto(out);
|
|
8380
|
+
this.destroy();
|
|
8381
|
+
return out;
|
|
8382
|
+
}
|
|
8383
|
+
digest() {
|
|
8384
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
8385
|
+
}
|
|
8386
|
+
destroy() {
|
|
8387
|
+
this.destroyed = true;
|
|
8388
|
+
clean(this.state);
|
|
8389
|
+
}
|
|
8390
|
+
_cloneInto(to) {
|
|
8391
|
+
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
8392
|
+
to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
|
8393
|
+
to.state32.set(this.state32);
|
|
8394
|
+
to.pos = this.pos;
|
|
8395
|
+
to.posOut = this.posOut;
|
|
8396
|
+
to.finished = this.finished;
|
|
8397
|
+
to.rounds = rounds;
|
|
8398
|
+
to.suffix = suffix;
|
|
8399
|
+
to.outputLen = outputLen;
|
|
8400
|
+
to.enableXOF = enableXOF;
|
|
8401
|
+
to.destroyed = this.destroyed;
|
|
8402
|
+
return to;
|
|
8403
|
+
}
|
|
8404
|
+
};
|
|
8405
|
+
keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
8406
|
+
});
|
|
8407
|
+
|
|
8408
|
+
// node_modules/@noble/hashes/esm/sha2.js
|
|
8409
|
+
var SHA256_K, SHA256_W, SHA256, sha256;
|
|
8410
|
+
var init_sha2 = __esm(() => {
|
|
8411
|
+
init__md();
|
|
8412
|
+
init_utils();
|
|
8413
|
+
SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
8414
|
+
1116352408,
|
|
8415
|
+
1899447441,
|
|
8416
|
+
3049323471,
|
|
8417
|
+
3921009573,
|
|
8418
|
+
961987163,
|
|
8419
|
+
1508970993,
|
|
8420
|
+
2453635748,
|
|
8421
|
+
2870763221,
|
|
8422
|
+
3624381080,
|
|
8423
|
+
310598401,
|
|
8424
|
+
607225278,
|
|
8425
|
+
1426881987,
|
|
8426
|
+
1925078388,
|
|
8427
|
+
2162078206,
|
|
8428
|
+
2614888103,
|
|
8429
|
+
3248222580,
|
|
8430
|
+
3835390401,
|
|
8431
|
+
4022224774,
|
|
8432
|
+
264347078,
|
|
8433
|
+
604807628,
|
|
8434
|
+
770255983,
|
|
8435
|
+
1249150122,
|
|
8436
|
+
1555081692,
|
|
8437
|
+
1996064986,
|
|
8438
|
+
2554220882,
|
|
8439
|
+
2821834349,
|
|
8440
|
+
2952996808,
|
|
8441
|
+
3210313671,
|
|
8442
|
+
3336571891,
|
|
8443
|
+
3584528711,
|
|
8444
|
+
113926993,
|
|
8445
|
+
338241895,
|
|
8446
|
+
666307205,
|
|
8447
|
+
773529912,
|
|
8448
|
+
1294757372,
|
|
8449
|
+
1396182291,
|
|
8450
|
+
1695183700,
|
|
8451
|
+
1986661051,
|
|
8452
|
+
2177026350,
|
|
8453
|
+
2456956037,
|
|
8454
|
+
2730485921,
|
|
8455
|
+
2820302411,
|
|
8456
|
+
3259730800,
|
|
8457
|
+
3345764771,
|
|
8458
|
+
3516065817,
|
|
8459
|
+
3600352804,
|
|
8460
|
+
4094571909,
|
|
8461
|
+
275423344,
|
|
8462
|
+
430227734,
|
|
8463
|
+
506948616,
|
|
8464
|
+
659060556,
|
|
8465
|
+
883997877,
|
|
8466
|
+
958139571,
|
|
8467
|
+
1322822218,
|
|
8468
|
+
1537002063,
|
|
8469
|
+
1747873779,
|
|
8470
|
+
1955562222,
|
|
8471
|
+
2024104815,
|
|
8472
|
+
2227730452,
|
|
8473
|
+
2361852424,
|
|
8474
|
+
2428436474,
|
|
8475
|
+
2756734187,
|
|
8476
|
+
3204031479,
|
|
8477
|
+
3329325298
|
|
8478
|
+
]);
|
|
8479
|
+
SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
8480
|
+
SHA256 = class SHA256 extends HashMD {
|
|
8481
|
+
constructor(outputLen = 32) {
|
|
8482
|
+
super(64, outputLen, 8, false);
|
|
8483
|
+
this.A = SHA256_IV[0] | 0;
|
|
8484
|
+
this.B = SHA256_IV[1] | 0;
|
|
8485
|
+
this.C = SHA256_IV[2] | 0;
|
|
8486
|
+
this.D = SHA256_IV[3] | 0;
|
|
8487
|
+
this.E = SHA256_IV[4] | 0;
|
|
8488
|
+
this.F = SHA256_IV[5] | 0;
|
|
8489
|
+
this.G = SHA256_IV[6] | 0;
|
|
8490
|
+
this.H = SHA256_IV[7] | 0;
|
|
8491
|
+
}
|
|
8492
|
+
get() {
|
|
8493
|
+
const { A, B, C, D: D2, E, F, G, H } = this;
|
|
8494
|
+
return [A, B, C, D2, E, F, G, H];
|
|
8495
|
+
}
|
|
8496
|
+
set(A, B, C, D2, E, F, G, H) {
|
|
8497
|
+
this.A = A | 0;
|
|
8498
|
+
this.B = B | 0;
|
|
8499
|
+
this.C = C | 0;
|
|
8500
|
+
this.D = D2 | 0;
|
|
8501
|
+
this.E = E | 0;
|
|
8502
|
+
this.F = F | 0;
|
|
8503
|
+
this.G = G | 0;
|
|
8504
|
+
this.H = H | 0;
|
|
8505
|
+
}
|
|
8506
|
+
process(view, offset) {
|
|
8507
|
+
for (let i = 0;i < 16; i++, offset += 4)
|
|
8508
|
+
SHA256_W[i] = view.getUint32(offset, false);
|
|
8509
|
+
for (let i = 16;i < 64; i++) {
|
|
8510
|
+
const W15 = SHA256_W[i - 15];
|
|
8511
|
+
const W2 = SHA256_W[i - 2];
|
|
8512
|
+
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
8513
|
+
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
8514
|
+
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
8515
|
+
}
|
|
8516
|
+
let { A, B, C, D: D2, E, F, G, H } = this;
|
|
8517
|
+
for (let i = 0;i < 64; i++) {
|
|
8518
|
+
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
8519
|
+
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
8520
|
+
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
|
|
8521
|
+
const T2 = sigma0 + Maj(A, B, C) | 0;
|
|
8522
|
+
H = G;
|
|
8523
|
+
G = F;
|
|
8524
|
+
F = E;
|
|
8525
|
+
E = D2 + T1 | 0;
|
|
8526
|
+
D2 = C;
|
|
8527
|
+
C = B;
|
|
8528
|
+
B = A;
|
|
8529
|
+
A = T1 + T2 | 0;
|
|
8530
|
+
}
|
|
8531
|
+
A = A + this.A | 0;
|
|
8532
|
+
B = B + this.B | 0;
|
|
8533
|
+
C = C + this.C | 0;
|
|
8534
|
+
D2 = D2 + this.D | 0;
|
|
8535
|
+
E = E + this.E | 0;
|
|
8536
|
+
F = F + this.F | 0;
|
|
8537
|
+
G = G + this.G | 0;
|
|
8538
|
+
H = H + this.H | 0;
|
|
8539
|
+
this.set(A, B, C, D2, E, F, G, H);
|
|
8540
|
+
}
|
|
8541
|
+
roundClean() {
|
|
8542
|
+
clean(SHA256_W);
|
|
8543
|
+
}
|
|
8544
|
+
destroy() {
|
|
8545
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
8546
|
+
clean(this.buffer);
|
|
8547
|
+
}
|
|
8548
|
+
};
|
|
8549
|
+
sha256 = /* @__PURE__ */ createHasher(() => new SHA256);
|
|
8550
|
+
});
|
|
8551
|
+
|
|
8552
|
+
// node_modules/@noble/hashes/esm/sha256.js
|
|
8553
|
+
var sha2562;
|
|
8554
|
+
var init_sha256 = __esm(() => {
|
|
8555
|
+
init_sha2();
|
|
8556
|
+
sha2562 = sha256;
|
|
8557
|
+
});
|
|
8558
|
+
|
|
8559
|
+
// node_modules/mppx/node_modules/ox/node_modules/@noble/curves/esm/abstract/utils.js
|
|
8560
|
+
function equalBytes(a, b) {
|
|
8561
|
+
if (a.length !== b.length)
|
|
8562
|
+
return false;
|
|
8563
|
+
let diff = 0;
|
|
8564
|
+
for (let i = 0;i < a.length; i++)
|
|
8565
|
+
diff |= a[i] ^ b[i];
|
|
8566
|
+
return diff === 0;
|
|
8567
|
+
}
|
|
8568
|
+
var hasHexBuiltin;
|
|
8569
|
+
var init_utils2 = __esm(() => {
|
|
8570
|
+
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
8571
|
+
hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
|
|
8572
|
+
});
|
|
8573
|
+
|
|
8574
|
+
// node_modules/mppx/node_modules/ox/_esm/core/internal/bytes.js
|
|
8575
|
+
function assertSize(bytes, size_) {
|
|
8576
|
+
if (size(bytes) > size_)
|
|
8577
|
+
throw new SizeOverflowError({
|
|
8578
|
+
givenSize: size(bytes),
|
|
8579
|
+
maxSize: size_
|
|
8580
|
+
});
|
|
8581
|
+
}
|
|
8582
|
+
function assertStartOffset(value, start) {
|
|
8583
|
+
if (typeof start === "number" && start > 0 && start > size(value) - 1)
|
|
8584
|
+
throw new SliceOffsetOutOfBoundsError({
|
|
8585
|
+
offset: start,
|
|
8586
|
+
position: "start",
|
|
8587
|
+
size: size(value)
|
|
8588
|
+
});
|
|
8589
|
+
}
|
|
8590
|
+
function assertEndOffset(value, start, end) {
|
|
8591
|
+
if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
|
|
8592
|
+
throw new SliceOffsetOutOfBoundsError({
|
|
8593
|
+
offset: end,
|
|
8594
|
+
position: "end",
|
|
8595
|
+
size: size(value)
|
|
8596
|
+
});
|
|
8597
|
+
}
|
|
8598
|
+
}
|
|
8599
|
+
function charCodeToBase16(char) {
|
|
8600
|
+
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
|
|
8601
|
+
return char - charCodeMap.zero;
|
|
8602
|
+
if (char >= charCodeMap.A && char <= charCodeMap.F)
|
|
8603
|
+
return char - (charCodeMap.A - 10);
|
|
8604
|
+
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
8605
|
+
return char - (charCodeMap.a - 10);
|
|
8606
|
+
return;
|
|
8607
|
+
}
|
|
8608
|
+
function pad2(bytes, options2 = {}) {
|
|
8609
|
+
const { dir, size: size2 = 32 } = options2;
|
|
8610
|
+
if (size2 === 0)
|
|
8611
|
+
return bytes;
|
|
8612
|
+
if (bytes.length > size2)
|
|
8613
|
+
throw new SizeExceedsPaddingSizeError({
|
|
8614
|
+
size: bytes.length,
|
|
8615
|
+
targetSize: size2,
|
|
8616
|
+
type: "Bytes"
|
|
8617
|
+
});
|
|
8618
|
+
const paddedBytes = new Uint8Array(size2);
|
|
8619
|
+
for (let i = 0;i < size2; i++) {
|
|
8620
|
+
const padEnd = dir === "right";
|
|
8621
|
+
paddedBytes[padEnd ? i : size2 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
8622
|
+
}
|
|
8623
|
+
return paddedBytes;
|
|
8624
|
+
}
|
|
8625
|
+
function trim(value, options2 = {}) {
|
|
8626
|
+
const { dir = "left" } = options2;
|
|
8627
|
+
let data = value;
|
|
8628
|
+
let sliceLength = 0;
|
|
8629
|
+
for (let i = 0;i < data.length - 1; i++) {
|
|
8630
|
+
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
8631
|
+
sliceLength++;
|
|
8632
|
+
else
|
|
8633
|
+
break;
|
|
8634
|
+
}
|
|
8635
|
+
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
8636
|
+
return data;
|
|
8637
|
+
}
|
|
8638
|
+
var charCodeMap;
|
|
8639
|
+
var init_bytes = __esm(() => {
|
|
8640
|
+
init_Bytes();
|
|
8641
|
+
charCodeMap = {
|
|
8642
|
+
zero: 48,
|
|
8643
|
+
nine: 57,
|
|
8644
|
+
A: 65,
|
|
8645
|
+
F: 70,
|
|
8646
|
+
a: 97,
|
|
8647
|
+
f: 102
|
|
8648
|
+
};
|
|
8649
|
+
});
|
|
8650
|
+
|
|
8651
|
+
// node_modules/mppx/node_modules/ox/_esm/core/internal/hex.js
|
|
8652
|
+
function assertSize2(hex, size_) {
|
|
8653
|
+
if (size2(hex) > size_)
|
|
8654
|
+
throw new SizeOverflowError2({
|
|
8655
|
+
givenSize: size2(hex),
|
|
8656
|
+
maxSize: size_
|
|
8657
|
+
});
|
|
8658
|
+
}
|
|
8659
|
+
function pad3(hex_, options2 = {}) {
|
|
8660
|
+
const { dir, size: size3 = 32 } = options2;
|
|
8661
|
+
if (size3 === 0)
|
|
8662
|
+
return hex_;
|
|
8663
|
+
const hex = hex_.replace("0x", "");
|
|
8664
|
+
if (hex.length > size3 * 2)
|
|
8665
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
8666
|
+
size: Math.ceil(hex.length / 2),
|
|
8667
|
+
targetSize: size3,
|
|
8668
|
+
type: "Hex"
|
|
8669
|
+
});
|
|
8670
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
8671
|
+
}
|
|
8672
|
+
var init_hex = __esm(() => {
|
|
8673
|
+
init_Hex();
|
|
8674
|
+
});
|
|
8675
|
+
|
|
8676
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Json.js
|
|
8677
|
+
var exports_Json = {};
|
|
8678
|
+
__export(exports_Json, {
|
|
8679
|
+
stringify: () => stringify2,
|
|
8680
|
+
parse: () => parse,
|
|
8681
|
+
canonicalize: () => canonicalize
|
|
8682
|
+
});
|
|
8683
|
+
function canonicalize(value) {
|
|
8684
|
+
if (value === null || typeof value === "boolean" || typeof value === "string")
|
|
8685
|
+
return JSON.stringify(value);
|
|
8686
|
+
if (typeof value === "number") {
|
|
8687
|
+
if (!Number.isFinite(value))
|
|
8688
|
+
throw new TypeError("Cannot canonicalize non-finite number");
|
|
8689
|
+
return Object.is(value, -0) ? "0" : JSON.stringify(value);
|
|
8690
|
+
}
|
|
8691
|
+
if (typeof value === "bigint")
|
|
8692
|
+
throw new TypeError("Cannot canonicalize bigint");
|
|
8693
|
+
if (Array.isArray(value))
|
|
8694
|
+
return `[${value.map((item) => canonicalize(item)).join(",")}]`;
|
|
8695
|
+
if (typeof value === "object") {
|
|
8696
|
+
const entries = Object.keys(value).sort().reduce((acc, key) => {
|
|
8697
|
+
const v = value[key];
|
|
8698
|
+
if (v !== undefined)
|
|
8699
|
+
acc.push(`${JSON.stringify(key)}:${canonicalize(v)}`);
|
|
8700
|
+
return acc;
|
|
8701
|
+
}, []);
|
|
8702
|
+
return `{${entries.join(",")}}`;
|
|
8703
|
+
}
|
|
8704
|
+
return;
|
|
8705
|
+
}
|
|
8706
|
+
function parse(string, reviver) {
|
|
8707
|
+
return JSON.parse(string, (key, value_) => {
|
|
8708
|
+
const value = value_;
|
|
8709
|
+
if (typeof value === "string" && value.endsWith(bigIntSuffix))
|
|
8710
|
+
return BigInt(value.slice(0, -bigIntSuffix.length));
|
|
8711
|
+
return typeof reviver === "function" ? reviver(key, value) : value;
|
|
8712
|
+
});
|
|
8713
|
+
}
|
|
8714
|
+
function stringify2(value, replacer, space) {
|
|
8715
|
+
return JSON.stringify(value, (key, value2) => {
|
|
8716
|
+
if (typeof replacer === "function")
|
|
8717
|
+
return replacer(key, value2);
|
|
8718
|
+
if (typeof value2 === "bigint")
|
|
8719
|
+
return value2.toString() + bigIntSuffix;
|
|
8720
|
+
return value2;
|
|
8721
|
+
}, space);
|
|
8722
|
+
}
|
|
8723
|
+
var bigIntSuffix = "#__bigint";
|
|
8724
|
+
|
|
8725
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Hex.js
|
|
8726
|
+
function assert(value, options2 = {}) {
|
|
8727
|
+
const { strict = false } = options2;
|
|
8728
|
+
if (!value)
|
|
8729
|
+
throw new InvalidHexTypeError(value);
|
|
8730
|
+
if (typeof value !== "string")
|
|
8731
|
+
throw new InvalidHexTypeError(value);
|
|
8732
|
+
if (strict) {
|
|
8733
|
+
if (!/^0x[0-9a-fA-F]*$/.test(value))
|
|
8734
|
+
throw new InvalidHexValueError(value);
|
|
8735
|
+
}
|
|
8736
|
+
if (!value.startsWith("0x"))
|
|
8737
|
+
throw new InvalidHexValueError(value);
|
|
8738
|
+
}
|
|
8739
|
+
function concat(...values) {
|
|
8740
|
+
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
8741
|
+
}
|
|
8742
|
+
function fromBoolean(value, options2 = {}) {
|
|
8743
|
+
const hex = `0x${Number(value)}`;
|
|
8744
|
+
if (typeof options2.size === "number") {
|
|
8745
|
+
assertSize2(hex, options2.size);
|
|
8746
|
+
return padLeft(hex, options2.size);
|
|
8747
|
+
}
|
|
8748
|
+
return hex;
|
|
8749
|
+
}
|
|
8750
|
+
function fromBytes(value, options2 = {}) {
|
|
8751
|
+
let string = "";
|
|
8752
|
+
for (let i = 0;i < value.length; i++)
|
|
8753
|
+
string += hexes[value[i]];
|
|
8754
|
+
const hex = `0x${string}`;
|
|
8755
|
+
if (typeof options2.size === "number") {
|
|
8756
|
+
assertSize2(hex, options2.size);
|
|
8757
|
+
return padRight(hex, options2.size);
|
|
8758
|
+
}
|
|
8759
|
+
return hex;
|
|
8760
|
+
}
|
|
8761
|
+
function fromNumber(value, options2 = {}) {
|
|
8762
|
+
const { signed, size: size3 } = options2;
|
|
8763
|
+
const value_ = BigInt(value);
|
|
8764
|
+
let maxValue;
|
|
8765
|
+
if (size3) {
|
|
8766
|
+
if (signed)
|
|
8767
|
+
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
8768
|
+
else
|
|
8769
|
+
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
8770
|
+
} else if (typeof value === "number") {
|
|
8771
|
+
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
8772
|
+
}
|
|
8773
|
+
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
8774
|
+
if (maxValue && value_ > maxValue || value_ < minValue) {
|
|
8775
|
+
const suffix = typeof value === "bigint" ? "n" : "";
|
|
8776
|
+
throw new IntegerOutOfRangeError({
|
|
8777
|
+
max: maxValue ? `${maxValue}${suffix}` : undefined,
|
|
8778
|
+
min: `${minValue}${suffix}`,
|
|
8779
|
+
signed,
|
|
8780
|
+
size: size3,
|
|
8781
|
+
value: `${value}${suffix}`
|
|
8782
|
+
});
|
|
8783
|
+
}
|
|
8784
|
+
const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size3 * 8, BigInt(value_)) : value_).toString(16);
|
|
8785
|
+
const hex = `0x${stringValue}`;
|
|
8786
|
+
if (size3)
|
|
8787
|
+
return padLeft(hex, size3);
|
|
8788
|
+
return hex;
|
|
8789
|
+
}
|
|
8790
|
+
function fromString(value, options2 = {}) {
|
|
8791
|
+
return fromBytes(encoder.encode(value), options2);
|
|
8792
|
+
}
|
|
8793
|
+
function padLeft(value, size3) {
|
|
8794
|
+
return pad3(value, { dir: "left", size: size3 });
|
|
8795
|
+
}
|
|
8796
|
+
function padRight(value, size3) {
|
|
8797
|
+
return pad3(value, { dir: "right", size: size3 });
|
|
8798
|
+
}
|
|
8799
|
+
function size2(value) {
|
|
8800
|
+
return Math.ceil((value.length - 2) / 2);
|
|
8801
|
+
}
|
|
8802
|
+
function toBigInt(hex, options2 = {}) {
|
|
8803
|
+
const { signed } = options2;
|
|
8804
|
+
if (options2.size)
|
|
8805
|
+
assertSize2(hex, options2.size);
|
|
8806
|
+
const value = BigInt(hex);
|
|
8807
|
+
if (!signed)
|
|
8808
|
+
return value;
|
|
8809
|
+
const size3 = (hex.length - 2) / 2;
|
|
8810
|
+
const max_unsigned = (1n << BigInt(size3) * 8n) - 1n;
|
|
8811
|
+
const max_signed = max_unsigned >> 1n;
|
|
8812
|
+
if (value <= max_signed)
|
|
8813
|
+
return value;
|
|
8814
|
+
return value - max_unsigned - 1n;
|
|
8815
|
+
}
|
|
8816
|
+
function toNumber(hex, options2 = {}) {
|
|
8817
|
+
const { signed, size: size3 } = options2;
|
|
8818
|
+
if (!signed && !size3)
|
|
8819
|
+
return Number(hex);
|
|
8820
|
+
return Number(toBigInt(hex, options2));
|
|
8821
|
+
}
|
|
8822
|
+
function validate2(value, options2 = {}) {
|
|
8823
|
+
const { strict = false } = options2;
|
|
8824
|
+
try {
|
|
8825
|
+
assert(value, { strict });
|
|
8826
|
+
return true;
|
|
8827
|
+
} catch {
|
|
8828
|
+
return false;
|
|
8829
|
+
}
|
|
8830
|
+
}
|
|
8831
|
+
var encoder, hexes, IntegerOutOfRangeError, InvalidHexTypeError, InvalidHexValueError, SizeOverflowError2, SizeExceedsPaddingSizeError2;
|
|
8832
|
+
var init_Hex = __esm(() => {
|
|
8833
|
+
init_Errors();
|
|
8834
|
+
init_hex();
|
|
8835
|
+
encoder = /* @__PURE__ */ new TextEncoder;
|
|
8836
|
+
hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
8837
|
+
IntegerOutOfRangeError = class IntegerOutOfRangeError extends BaseError {
|
|
8838
|
+
constructor({ max, min, signed, size: size3, value }) {
|
|
8839
|
+
super(`Number \`${value}\` is not in safe${size3 ? ` ${size3 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
|
|
8840
|
+
Object.defineProperty(this, "name", {
|
|
8841
|
+
enumerable: true,
|
|
8842
|
+
configurable: true,
|
|
8843
|
+
writable: true,
|
|
8844
|
+
value: "Hex.IntegerOutOfRangeError"
|
|
8845
|
+
});
|
|
8846
|
+
}
|
|
8847
|
+
};
|
|
8848
|
+
InvalidHexTypeError = class InvalidHexTypeError extends BaseError {
|
|
8849
|
+
constructor(value) {
|
|
8850
|
+
super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid hex type.`, {
|
|
8851
|
+
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
8852
|
+
});
|
|
8853
|
+
Object.defineProperty(this, "name", {
|
|
8854
|
+
enumerable: true,
|
|
8855
|
+
configurable: true,
|
|
8856
|
+
writable: true,
|
|
8857
|
+
value: "Hex.InvalidHexTypeError"
|
|
8858
|
+
});
|
|
8859
|
+
}
|
|
8860
|
+
};
|
|
8861
|
+
InvalidHexValueError = class InvalidHexValueError extends BaseError {
|
|
8862
|
+
constructor(value) {
|
|
8863
|
+
super(`Value \`${value}\` is an invalid hex value.`, {
|
|
8864
|
+
metaMessages: [
|
|
8865
|
+
'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
|
|
8866
|
+
]
|
|
8867
|
+
});
|
|
8868
|
+
Object.defineProperty(this, "name", {
|
|
8869
|
+
enumerable: true,
|
|
8870
|
+
configurable: true,
|
|
8871
|
+
writable: true,
|
|
8872
|
+
value: "Hex.InvalidHexValueError"
|
|
8873
|
+
});
|
|
8874
|
+
}
|
|
8875
|
+
};
|
|
8876
|
+
SizeOverflowError2 = class SizeOverflowError2 extends BaseError {
|
|
8877
|
+
constructor({ givenSize, maxSize }) {
|
|
8878
|
+
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
8879
|
+
Object.defineProperty(this, "name", {
|
|
8880
|
+
enumerable: true,
|
|
8881
|
+
configurable: true,
|
|
8882
|
+
writable: true,
|
|
8883
|
+
value: "Hex.SizeOverflowError"
|
|
8884
|
+
});
|
|
8885
|
+
}
|
|
8886
|
+
};
|
|
8887
|
+
SizeExceedsPaddingSizeError2 = class SizeExceedsPaddingSizeError2 extends BaseError {
|
|
8888
|
+
constructor({ size: size3, targetSize, type }) {
|
|
8889
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
8890
|
+
Object.defineProperty(this, "name", {
|
|
8891
|
+
enumerable: true,
|
|
8892
|
+
configurable: true,
|
|
8893
|
+
writable: true,
|
|
8894
|
+
value: "Hex.SizeExceedsPaddingSizeError"
|
|
8895
|
+
});
|
|
8896
|
+
}
|
|
8897
|
+
};
|
|
8898
|
+
});
|
|
8899
|
+
|
|
8900
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Bytes.js
|
|
8901
|
+
var exports_Bytes = {};
|
|
8902
|
+
__export(exports_Bytes, {
|
|
8903
|
+
validate: () => validate3,
|
|
8904
|
+
trimRight: () => trimRight,
|
|
8905
|
+
trimLeft: () => trimLeft,
|
|
8906
|
+
toString: () => toString,
|
|
8907
|
+
toNumber: () => toNumber2,
|
|
8908
|
+
toHex: () => toHex,
|
|
8909
|
+
toBoolean: () => toBoolean,
|
|
8910
|
+
toBigInt: () => toBigInt2,
|
|
8911
|
+
slice: () => slice,
|
|
8912
|
+
size: () => size,
|
|
8913
|
+
random: () => random,
|
|
8914
|
+
padRight: () => padRight2,
|
|
8915
|
+
padLeft: () => padLeft2,
|
|
8916
|
+
isEqual: () => isEqual,
|
|
8917
|
+
fromString: () => fromString2,
|
|
8918
|
+
fromNumber: () => fromNumber2,
|
|
8919
|
+
fromHex: () => fromHex,
|
|
8920
|
+
fromBoolean: () => fromBoolean2,
|
|
8921
|
+
fromArray: () => fromArray,
|
|
8922
|
+
from: () => from,
|
|
8923
|
+
concat: () => concat2,
|
|
8924
|
+
assert: () => assert2,
|
|
8925
|
+
SliceOffsetOutOfBoundsError: () => SliceOffsetOutOfBoundsError,
|
|
8926
|
+
SizeOverflowError: () => SizeOverflowError,
|
|
8927
|
+
SizeExceedsPaddingSizeError: () => SizeExceedsPaddingSizeError,
|
|
8928
|
+
InvalidBytesTypeError: () => InvalidBytesTypeError,
|
|
8929
|
+
InvalidBytesBooleanError: () => InvalidBytesBooleanError
|
|
8930
|
+
});
|
|
8931
|
+
function assert2(value) {
|
|
8932
|
+
if (value instanceof Uint8Array)
|
|
8933
|
+
return;
|
|
8934
|
+
if (!value)
|
|
8935
|
+
throw new InvalidBytesTypeError(value);
|
|
8936
|
+
if (typeof value !== "object")
|
|
8937
|
+
throw new InvalidBytesTypeError(value);
|
|
8938
|
+
if (!("BYTES_PER_ELEMENT" in value))
|
|
8939
|
+
throw new InvalidBytesTypeError(value);
|
|
8940
|
+
if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
|
|
8941
|
+
throw new InvalidBytesTypeError(value);
|
|
8942
|
+
}
|
|
8943
|
+
function concat2(...values) {
|
|
8944
|
+
let length = 0;
|
|
8945
|
+
for (const arr of values) {
|
|
8946
|
+
length += arr.length;
|
|
8947
|
+
}
|
|
8948
|
+
const result = new Uint8Array(length);
|
|
8949
|
+
for (let i = 0, index = 0;i < values.length; i++) {
|
|
8950
|
+
const arr = values[i];
|
|
8951
|
+
result.set(arr, index);
|
|
8952
|
+
index += arr.length;
|
|
8953
|
+
}
|
|
8954
|
+
return result;
|
|
8955
|
+
}
|
|
8956
|
+
function from(value) {
|
|
8957
|
+
if (value instanceof Uint8Array)
|
|
8958
|
+
return value;
|
|
8959
|
+
if (typeof value === "string")
|
|
8960
|
+
return fromHex(value);
|
|
8961
|
+
return fromArray(value);
|
|
8962
|
+
}
|
|
8963
|
+
function fromArray(value) {
|
|
8964
|
+
return value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
8965
|
+
}
|
|
8966
|
+
function fromBoolean2(value, options2 = {}) {
|
|
8967
|
+
const { size: size3 } = options2;
|
|
8968
|
+
const bytes = new Uint8Array(1);
|
|
8969
|
+
bytes[0] = Number(value);
|
|
8970
|
+
if (typeof size3 === "number") {
|
|
8971
|
+
assertSize(bytes, size3);
|
|
8972
|
+
return padLeft2(bytes, size3);
|
|
8973
|
+
}
|
|
8974
|
+
return bytes;
|
|
8975
|
+
}
|
|
8976
|
+
function fromHex(value, options2 = {}) {
|
|
8977
|
+
const { size: size3 } = options2;
|
|
8978
|
+
let hex = value;
|
|
8979
|
+
if (size3) {
|
|
8980
|
+
assertSize2(value, size3);
|
|
8981
|
+
hex = padRight(value, size3);
|
|
8982
|
+
}
|
|
8983
|
+
let hexString = hex.slice(2);
|
|
8984
|
+
if (hexString.length % 2)
|
|
8985
|
+
hexString = `0${hexString}`;
|
|
8986
|
+
const length = hexString.length / 2;
|
|
8987
|
+
const bytes = new Uint8Array(length);
|
|
8988
|
+
for (let index = 0, j = 0;index < length; index++) {
|
|
8989
|
+
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
8990
|
+
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
8991
|
+
if (nibbleLeft === undefined || nibbleRight === undefined) {
|
|
8992
|
+
throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
8993
|
+
}
|
|
8994
|
+
bytes[index] = nibbleLeft << 4 | nibbleRight;
|
|
8995
|
+
}
|
|
8996
|
+
return bytes;
|
|
8997
|
+
}
|
|
8998
|
+
function fromNumber2(value, options2) {
|
|
8999
|
+
const hex = fromNumber(value, options2);
|
|
9000
|
+
return fromHex(hex);
|
|
9001
|
+
}
|
|
9002
|
+
function fromString2(value, options2 = {}) {
|
|
9003
|
+
const { size: size3 } = options2;
|
|
9004
|
+
const bytes = encoder2.encode(value);
|
|
9005
|
+
if (typeof size3 === "number") {
|
|
9006
|
+
assertSize(bytes, size3);
|
|
9007
|
+
return padRight2(bytes, size3);
|
|
9008
|
+
}
|
|
9009
|
+
return bytes;
|
|
9010
|
+
}
|
|
9011
|
+
function isEqual(bytesA, bytesB) {
|
|
9012
|
+
return equalBytes(bytesA, bytesB);
|
|
9013
|
+
}
|
|
9014
|
+
function padLeft2(value, size3) {
|
|
9015
|
+
return pad2(value, { dir: "left", size: size3 });
|
|
9016
|
+
}
|
|
9017
|
+
function padRight2(value, size3) {
|
|
9018
|
+
return pad2(value, { dir: "right", size: size3 });
|
|
9019
|
+
}
|
|
9020
|
+
function random(length) {
|
|
9021
|
+
return crypto.getRandomValues(new Uint8Array(length));
|
|
9022
|
+
}
|
|
9023
|
+
function size(value) {
|
|
9024
|
+
return value.length;
|
|
9025
|
+
}
|
|
9026
|
+
function slice(value, start, end, options2 = {}) {
|
|
9027
|
+
const { strict } = options2;
|
|
9028
|
+
assertStartOffset(value, start);
|
|
9029
|
+
const value_ = value.slice(start, end);
|
|
9030
|
+
if (strict)
|
|
9031
|
+
assertEndOffset(value_, start, end);
|
|
9032
|
+
return value_;
|
|
9033
|
+
}
|
|
9034
|
+
function toBigInt2(bytes, options2 = {}) {
|
|
9035
|
+
const { size: size3 } = options2;
|
|
9036
|
+
if (typeof size3 !== "undefined")
|
|
9037
|
+
assertSize(bytes, size3);
|
|
9038
|
+
const hex = fromBytes(bytes, options2);
|
|
9039
|
+
return toBigInt(hex, options2);
|
|
9040
|
+
}
|
|
9041
|
+
function toBoolean(bytes, options2 = {}) {
|
|
9042
|
+
const { size: size3 } = options2;
|
|
9043
|
+
let bytes_ = bytes;
|
|
9044
|
+
if (typeof size3 !== "undefined") {
|
|
9045
|
+
assertSize(bytes_, size3);
|
|
9046
|
+
bytes_ = trimLeft(bytes_);
|
|
9047
|
+
}
|
|
9048
|
+
if (bytes_.length > 1 || bytes_[0] > 1)
|
|
9049
|
+
throw new InvalidBytesBooleanError(bytes_);
|
|
9050
|
+
return Boolean(bytes_[0]);
|
|
9051
|
+
}
|
|
9052
|
+
function toHex(value, options2 = {}) {
|
|
9053
|
+
return fromBytes(value, options2);
|
|
9054
|
+
}
|
|
9055
|
+
function toNumber2(bytes, options2 = {}) {
|
|
9056
|
+
const { size: size3 } = options2;
|
|
9057
|
+
if (typeof size3 !== "undefined")
|
|
9058
|
+
assertSize(bytes, size3);
|
|
9059
|
+
const hex = fromBytes(bytes, options2);
|
|
9060
|
+
return toNumber(hex, options2);
|
|
9061
|
+
}
|
|
9062
|
+
function toString(bytes, options2 = {}) {
|
|
9063
|
+
const { size: size3 } = options2;
|
|
9064
|
+
let bytes_ = bytes;
|
|
9065
|
+
if (typeof size3 !== "undefined") {
|
|
9066
|
+
assertSize(bytes_, size3);
|
|
9067
|
+
bytes_ = trimRight(bytes_);
|
|
9068
|
+
}
|
|
9069
|
+
return decoder.decode(bytes_);
|
|
9070
|
+
}
|
|
9071
|
+
function trimLeft(value) {
|
|
9072
|
+
return trim(value, { dir: "left" });
|
|
9073
|
+
}
|
|
9074
|
+
function trimRight(value) {
|
|
9075
|
+
return trim(value, { dir: "right" });
|
|
9076
|
+
}
|
|
9077
|
+
function validate3(value) {
|
|
9078
|
+
try {
|
|
9079
|
+
assert2(value);
|
|
9080
|
+
return true;
|
|
9081
|
+
} catch {
|
|
9082
|
+
return false;
|
|
9083
|
+
}
|
|
9084
|
+
}
|
|
9085
|
+
var decoder, encoder2, InvalidBytesBooleanError, InvalidBytesTypeError, SizeOverflowError, SliceOffsetOutOfBoundsError, SizeExceedsPaddingSizeError;
|
|
9086
|
+
var init_Bytes = __esm(() => {
|
|
9087
|
+
init_utils2();
|
|
9088
|
+
init_Errors();
|
|
9089
|
+
init_Hex();
|
|
9090
|
+
init_bytes();
|
|
9091
|
+
init_hex();
|
|
9092
|
+
decoder = /* @__PURE__ */ new TextDecoder;
|
|
9093
|
+
encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
9094
|
+
InvalidBytesBooleanError = class InvalidBytesBooleanError extends BaseError {
|
|
9095
|
+
constructor(bytes) {
|
|
9096
|
+
super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
|
|
9097
|
+
metaMessages: [
|
|
9098
|
+
"The bytes array must contain a single byte of either a `0` or `1` value."
|
|
9099
|
+
]
|
|
9100
|
+
});
|
|
9101
|
+
Object.defineProperty(this, "name", {
|
|
9102
|
+
enumerable: true,
|
|
9103
|
+
configurable: true,
|
|
9104
|
+
writable: true,
|
|
9105
|
+
value: "Bytes.InvalidBytesBooleanError"
|
|
9106
|
+
});
|
|
9107
|
+
}
|
|
9108
|
+
};
|
|
9109
|
+
InvalidBytesTypeError = class InvalidBytesTypeError extends BaseError {
|
|
9110
|
+
constructor(value) {
|
|
9111
|
+
super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
|
|
9112
|
+
metaMessages: ["Bytes values must be of type `Bytes`."]
|
|
9113
|
+
});
|
|
9114
|
+
Object.defineProperty(this, "name", {
|
|
9115
|
+
enumerable: true,
|
|
9116
|
+
configurable: true,
|
|
9117
|
+
writable: true,
|
|
9118
|
+
value: "Bytes.InvalidBytesTypeError"
|
|
9119
|
+
});
|
|
9120
|
+
}
|
|
9121
|
+
};
|
|
9122
|
+
SizeOverflowError = class SizeOverflowError extends BaseError {
|
|
9123
|
+
constructor({ givenSize, maxSize }) {
|
|
9124
|
+
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
9125
|
+
Object.defineProperty(this, "name", {
|
|
9126
|
+
enumerable: true,
|
|
9127
|
+
configurable: true,
|
|
9128
|
+
writable: true,
|
|
9129
|
+
value: "Bytes.SizeOverflowError"
|
|
9130
|
+
});
|
|
9131
|
+
}
|
|
9132
|
+
};
|
|
9133
|
+
SliceOffsetOutOfBoundsError = class SliceOffsetOutOfBoundsError extends BaseError {
|
|
9134
|
+
constructor({ offset, position, size: size3 }) {
|
|
9135
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size3}\`).`);
|
|
9136
|
+
Object.defineProperty(this, "name", {
|
|
9137
|
+
enumerable: true,
|
|
9138
|
+
configurable: true,
|
|
9139
|
+
writable: true,
|
|
9140
|
+
value: "Bytes.SliceOffsetOutOfBoundsError"
|
|
9141
|
+
});
|
|
9142
|
+
}
|
|
9143
|
+
};
|
|
9144
|
+
SizeExceedsPaddingSizeError = class SizeExceedsPaddingSizeError extends BaseError {
|
|
9145
|
+
constructor({ size: size3, targetSize, type }) {
|
|
9146
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
9147
|
+
Object.defineProperty(this, "name", {
|
|
9148
|
+
enumerable: true,
|
|
9149
|
+
configurable: true,
|
|
9150
|
+
writable: true,
|
|
9151
|
+
value: "Bytes.SizeExceedsPaddingSizeError"
|
|
9152
|
+
});
|
|
9153
|
+
}
|
|
9154
|
+
};
|
|
9155
|
+
});
|
|
9156
|
+
|
|
9157
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Hash.js
|
|
9158
|
+
var exports_Hash = {};
|
|
9159
|
+
__export(exports_Hash, {
|
|
9160
|
+
validate: () => validate4,
|
|
9161
|
+
sha256: () => sha2563,
|
|
9162
|
+
ripemd160: () => ripemd1603,
|
|
9163
|
+
keccak256: () => keccak256,
|
|
9164
|
+
hmac256: () => hmac256
|
|
9165
|
+
});
|
|
9166
|
+
function keccak256(value, options2 = {}) {
|
|
9167
|
+
const { as = typeof value === "string" ? "Hex" : "Bytes" } = options2;
|
|
9168
|
+
const bytes = keccak_256(from(value));
|
|
9169
|
+
if (as === "Bytes")
|
|
9170
|
+
return bytes;
|
|
9171
|
+
return fromBytes(bytes);
|
|
9172
|
+
}
|
|
9173
|
+
function hmac256(key, value, options2 = {}) {
|
|
9174
|
+
const { as = typeof value === "string" ? "Hex" : "Bytes" } = options2;
|
|
9175
|
+
const bytes = hmac(sha2562, from(key), from(value));
|
|
9176
|
+
if (as === "Bytes")
|
|
9177
|
+
return bytes;
|
|
9178
|
+
return fromBytes(bytes);
|
|
9179
|
+
}
|
|
9180
|
+
function ripemd1603(value, options2 = {}) {
|
|
9181
|
+
const { as = typeof value === "string" ? "Hex" : "Bytes" } = options2;
|
|
9182
|
+
const bytes = ripemd1602(from(value));
|
|
9183
|
+
if (as === "Bytes")
|
|
9184
|
+
return bytes;
|
|
9185
|
+
return fromBytes(bytes);
|
|
9186
|
+
}
|
|
9187
|
+
function sha2563(value, options2 = {}) {
|
|
9188
|
+
const { as = typeof value === "string" ? "Hex" : "Bytes" } = options2;
|
|
9189
|
+
const bytes = sha2562(from(value));
|
|
9190
|
+
if (as === "Bytes")
|
|
9191
|
+
return bytes;
|
|
9192
|
+
return fromBytes(bytes);
|
|
9193
|
+
}
|
|
9194
|
+
function validate4(value) {
|
|
9195
|
+
return validate2(value) && size2(value) === 32;
|
|
9196
|
+
}
|
|
9197
|
+
var init_Hash = __esm(() => {
|
|
9198
|
+
init_hmac();
|
|
9199
|
+
init_ripemd160();
|
|
9200
|
+
init_sha3();
|
|
9201
|
+
init_sha256();
|
|
9202
|
+
init_Bytes();
|
|
9203
|
+
init_Hex();
|
|
9204
|
+
});
|
|
9205
|
+
|
|
9206
|
+
// node_modules/mppx/node_modules/ox/_esm/core/internal/lru.js
|
|
9207
|
+
var LruMap;
|
|
9208
|
+
var init_lru = __esm(() => {
|
|
9209
|
+
LruMap = class LruMap extends Map {
|
|
9210
|
+
constructor(size3) {
|
|
9211
|
+
super();
|
|
9212
|
+
Object.defineProperty(this, "maxSize", {
|
|
9213
|
+
enumerable: true,
|
|
9214
|
+
configurable: true,
|
|
9215
|
+
writable: true,
|
|
9216
|
+
value: undefined
|
|
9217
|
+
});
|
|
9218
|
+
this.maxSize = size3;
|
|
9219
|
+
}
|
|
9220
|
+
get(key) {
|
|
9221
|
+
const value = super.get(key);
|
|
9222
|
+
if (super.has(key) && value !== undefined) {
|
|
9223
|
+
this.delete(key);
|
|
9224
|
+
super.set(key, value);
|
|
9225
|
+
}
|
|
9226
|
+
return value;
|
|
9227
|
+
}
|
|
9228
|
+
set(key, value) {
|
|
9229
|
+
super.set(key, value);
|
|
9230
|
+
if (this.maxSize && this.size > this.maxSize) {
|
|
9231
|
+
const firstKey = this.keys().next().value;
|
|
9232
|
+
if (firstKey)
|
|
9233
|
+
this.delete(firstKey);
|
|
9234
|
+
}
|
|
9235
|
+
return this;
|
|
9236
|
+
}
|
|
9237
|
+
};
|
|
9238
|
+
});
|
|
9239
|
+
|
|
9240
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Caches.js
|
|
9241
|
+
var caches, checksum;
|
|
9242
|
+
var init_Caches = __esm(() => {
|
|
9243
|
+
init_lru();
|
|
9244
|
+
caches = {
|
|
9245
|
+
checksum: /* @__PURE__ */ new LruMap(8192)
|
|
9246
|
+
};
|
|
9247
|
+
checksum = caches.checksum;
|
|
9248
|
+
});
|
|
9249
|
+
|
|
9250
|
+
// node_modules/mppx/node_modules/ox/_esm/core/PublicKey.js
|
|
9251
|
+
var init_PublicKey = () => {};
|
|
9252
|
+
|
|
9253
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Address.js
|
|
9254
|
+
function assert3(value, options2 = {}) {
|
|
9255
|
+
const { strict = true } = options2;
|
|
9256
|
+
if (!addressRegex.test(value))
|
|
9257
|
+
throw new InvalidAddressError({
|
|
9258
|
+
address: value,
|
|
9259
|
+
cause: new InvalidInputError
|
|
9260
|
+
});
|
|
9261
|
+
if (strict) {
|
|
9262
|
+
if (value.toLowerCase() === value)
|
|
9263
|
+
return;
|
|
9264
|
+
if (checksum2(value) !== value)
|
|
9265
|
+
throw new InvalidAddressError({
|
|
9266
|
+
address: value,
|
|
9267
|
+
cause: new InvalidChecksumError
|
|
9268
|
+
});
|
|
9269
|
+
}
|
|
9270
|
+
}
|
|
9271
|
+
function checksum2(address2) {
|
|
9272
|
+
if (checksum.has(address2))
|
|
9273
|
+
return checksum.get(address2);
|
|
9274
|
+
assert3(address2, { strict: false });
|
|
9275
|
+
const hexAddress = address2.substring(2).toLowerCase();
|
|
9276
|
+
const hash = keccak256(fromString2(hexAddress), { as: "Bytes" });
|
|
9277
|
+
const characters = hexAddress.split("");
|
|
9278
|
+
for (let i = 0;i < 40; i += 2) {
|
|
9279
|
+
if (hash[i >> 1] >> 4 >= 8 && characters[i]) {
|
|
9280
|
+
characters[i] = characters[i].toUpperCase();
|
|
9281
|
+
}
|
|
9282
|
+
if ((hash[i >> 1] & 15) >= 8 && characters[i + 1]) {
|
|
9283
|
+
characters[i + 1] = characters[i + 1].toUpperCase();
|
|
9284
|
+
}
|
|
9285
|
+
}
|
|
9286
|
+
const result = `0x${characters.join("")}`;
|
|
9287
|
+
checksum.set(address2, result);
|
|
9288
|
+
return result;
|
|
9289
|
+
}
|
|
9290
|
+
var addressRegex, InvalidAddressError, InvalidInputError, InvalidChecksumError;
|
|
9291
|
+
var init_Address = __esm(() => {
|
|
9292
|
+
init_Bytes();
|
|
9293
|
+
init_Caches();
|
|
9294
|
+
init_Errors();
|
|
9295
|
+
init_Hash();
|
|
9296
|
+
addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
9297
|
+
InvalidAddressError = class InvalidAddressError extends BaseError {
|
|
9298
|
+
constructor({ address: address2, cause }) {
|
|
9299
|
+
super(`Address "${address2}" is invalid.`, {
|
|
9300
|
+
cause
|
|
9301
|
+
});
|
|
9302
|
+
Object.defineProperty(this, "name", {
|
|
9303
|
+
enumerable: true,
|
|
9304
|
+
configurable: true,
|
|
9305
|
+
writable: true,
|
|
9306
|
+
value: "Address.InvalidAddressError"
|
|
9307
|
+
});
|
|
9308
|
+
}
|
|
9309
|
+
};
|
|
9310
|
+
InvalidInputError = class InvalidInputError extends BaseError {
|
|
9311
|
+
constructor() {
|
|
9312
|
+
super("Address is not a 20 byte (40 hexadecimal character) value.");
|
|
9313
|
+
Object.defineProperty(this, "name", {
|
|
9314
|
+
enumerable: true,
|
|
9315
|
+
configurable: true,
|
|
9316
|
+
writable: true,
|
|
9317
|
+
value: "Address.InvalidInputError"
|
|
9318
|
+
});
|
|
9319
|
+
}
|
|
9320
|
+
};
|
|
9321
|
+
InvalidChecksumError = class InvalidChecksumError extends BaseError {
|
|
9322
|
+
constructor() {
|
|
9323
|
+
super("Address does not match its checksum counterpart.");
|
|
9324
|
+
Object.defineProperty(this, "name", {
|
|
9325
|
+
enumerable: true,
|
|
9326
|
+
configurable: true,
|
|
9327
|
+
writable: true,
|
|
9328
|
+
value: "Address.InvalidChecksumError"
|
|
9329
|
+
});
|
|
9330
|
+
}
|
|
9331
|
+
};
|
|
9332
|
+
});
|
|
9333
|
+
|
|
9334
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AbiItem.js
|
|
9335
|
+
var init_AbiItem = () => {};
|
|
9336
|
+
|
|
9337
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Solidity.js
|
|
9338
|
+
var arrayRegex, bytesRegex, integerRegex, maxInt8, maxInt16, maxInt24, maxInt32, maxInt40, maxInt48, maxInt56, maxInt64, maxInt72, maxInt80, maxInt88, maxInt96, maxInt104, maxInt112, maxInt120, maxInt128, maxInt136, maxInt144, maxInt152, maxInt160, maxInt168, maxInt176, maxInt184, maxInt192, maxInt200, maxInt208, maxInt216, maxInt224, maxInt232, maxInt240, maxInt248, maxInt256, minInt8, minInt16, minInt24, minInt32, minInt40, minInt48, minInt56, minInt64, minInt72, minInt80, minInt88, minInt96, minInt104, minInt112, minInt120, minInt128, minInt136, minInt144, minInt152, minInt160, minInt168, minInt176, minInt184, minInt192, minInt200, minInt208, minInt216, minInt224, minInt232, minInt240, minInt248, minInt256, maxUint8, maxUint16, maxUint24, maxUint32, maxUint40, maxUint48, maxUint56, maxUint64, maxUint72, maxUint80, maxUint88, maxUint96, maxUint104, maxUint112, maxUint120, maxUint128, maxUint136, maxUint144, maxUint152, maxUint160, maxUint168, maxUint176, maxUint184, maxUint192, maxUint200, maxUint208, maxUint216, maxUint224, maxUint232, maxUint240, maxUint248, maxUint256;
|
|
9339
|
+
var init_Solidity = __esm(() => {
|
|
9340
|
+
arrayRegex = /^(.*)\[([0-9]*)\]$/;
|
|
9341
|
+
bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
|
|
9342
|
+
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)?$/;
|
|
9343
|
+
maxInt8 = 2n ** (8n - 1n) - 1n;
|
|
9344
|
+
maxInt16 = 2n ** (16n - 1n) - 1n;
|
|
9345
|
+
maxInt24 = 2n ** (24n - 1n) - 1n;
|
|
9346
|
+
maxInt32 = 2n ** (32n - 1n) - 1n;
|
|
9347
|
+
maxInt40 = 2n ** (40n - 1n) - 1n;
|
|
9348
|
+
maxInt48 = 2n ** (48n - 1n) - 1n;
|
|
9349
|
+
maxInt56 = 2n ** (56n - 1n) - 1n;
|
|
9350
|
+
maxInt64 = 2n ** (64n - 1n) - 1n;
|
|
9351
|
+
maxInt72 = 2n ** (72n - 1n) - 1n;
|
|
9352
|
+
maxInt80 = 2n ** (80n - 1n) - 1n;
|
|
9353
|
+
maxInt88 = 2n ** (88n - 1n) - 1n;
|
|
9354
|
+
maxInt96 = 2n ** (96n - 1n) - 1n;
|
|
9355
|
+
maxInt104 = 2n ** (104n - 1n) - 1n;
|
|
9356
|
+
maxInt112 = 2n ** (112n - 1n) - 1n;
|
|
9357
|
+
maxInt120 = 2n ** (120n - 1n) - 1n;
|
|
9358
|
+
maxInt128 = 2n ** (128n - 1n) - 1n;
|
|
9359
|
+
maxInt136 = 2n ** (136n - 1n) - 1n;
|
|
9360
|
+
maxInt144 = 2n ** (144n - 1n) - 1n;
|
|
9361
|
+
maxInt152 = 2n ** (152n - 1n) - 1n;
|
|
9362
|
+
maxInt160 = 2n ** (160n - 1n) - 1n;
|
|
9363
|
+
maxInt168 = 2n ** (168n - 1n) - 1n;
|
|
9364
|
+
maxInt176 = 2n ** (176n - 1n) - 1n;
|
|
9365
|
+
maxInt184 = 2n ** (184n - 1n) - 1n;
|
|
9366
|
+
maxInt192 = 2n ** (192n - 1n) - 1n;
|
|
9367
|
+
maxInt200 = 2n ** (200n - 1n) - 1n;
|
|
9368
|
+
maxInt208 = 2n ** (208n - 1n) - 1n;
|
|
9369
|
+
maxInt216 = 2n ** (216n - 1n) - 1n;
|
|
9370
|
+
maxInt224 = 2n ** (224n - 1n) - 1n;
|
|
9371
|
+
maxInt232 = 2n ** (232n - 1n) - 1n;
|
|
9372
|
+
maxInt240 = 2n ** (240n - 1n) - 1n;
|
|
9373
|
+
maxInt248 = 2n ** (248n - 1n) - 1n;
|
|
9374
|
+
maxInt256 = 2n ** (256n - 1n) - 1n;
|
|
9375
|
+
minInt8 = -(2n ** (8n - 1n));
|
|
9376
|
+
minInt16 = -(2n ** (16n - 1n));
|
|
9377
|
+
minInt24 = -(2n ** (24n - 1n));
|
|
9378
|
+
minInt32 = -(2n ** (32n - 1n));
|
|
9379
|
+
minInt40 = -(2n ** (40n - 1n));
|
|
9380
|
+
minInt48 = -(2n ** (48n - 1n));
|
|
9381
|
+
minInt56 = -(2n ** (56n - 1n));
|
|
9382
|
+
minInt64 = -(2n ** (64n - 1n));
|
|
9383
|
+
minInt72 = -(2n ** (72n - 1n));
|
|
9384
|
+
minInt80 = -(2n ** (80n - 1n));
|
|
9385
|
+
minInt88 = -(2n ** (88n - 1n));
|
|
9386
|
+
minInt96 = -(2n ** (96n - 1n));
|
|
9387
|
+
minInt104 = -(2n ** (104n - 1n));
|
|
9388
|
+
minInt112 = -(2n ** (112n - 1n));
|
|
9389
|
+
minInt120 = -(2n ** (120n - 1n));
|
|
9390
|
+
minInt128 = -(2n ** (128n - 1n));
|
|
9391
|
+
minInt136 = -(2n ** (136n - 1n));
|
|
9392
|
+
minInt144 = -(2n ** (144n - 1n));
|
|
9393
|
+
minInt152 = -(2n ** (152n - 1n));
|
|
9394
|
+
minInt160 = -(2n ** (160n - 1n));
|
|
9395
|
+
minInt168 = -(2n ** (168n - 1n));
|
|
9396
|
+
minInt176 = -(2n ** (176n - 1n));
|
|
9397
|
+
minInt184 = -(2n ** (184n - 1n));
|
|
9398
|
+
minInt192 = -(2n ** (192n - 1n));
|
|
9399
|
+
minInt200 = -(2n ** (200n - 1n));
|
|
9400
|
+
minInt208 = -(2n ** (208n - 1n));
|
|
9401
|
+
minInt216 = -(2n ** (216n - 1n));
|
|
9402
|
+
minInt224 = -(2n ** (224n - 1n));
|
|
9403
|
+
minInt232 = -(2n ** (232n - 1n));
|
|
9404
|
+
minInt240 = -(2n ** (240n - 1n));
|
|
9405
|
+
minInt248 = -(2n ** (248n - 1n));
|
|
9406
|
+
minInt256 = -(2n ** (256n - 1n));
|
|
9407
|
+
maxUint8 = 2n ** 8n - 1n;
|
|
9408
|
+
maxUint16 = 2n ** 16n - 1n;
|
|
9409
|
+
maxUint24 = 2n ** 24n - 1n;
|
|
9410
|
+
maxUint32 = 2n ** 32n - 1n;
|
|
9411
|
+
maxUint40 = 2n ** 40n - 1n;
|
|
9412
|
+
maxUint48 = 2n ** 48n - 1n;
|
|
9413
|
+
maxUint56 = 2n ** 56n - 1n;
|
|
9414
|
+
maxUint64 = 2n ** 64n - 1n;
|
|
9415
|
+
maxUint72 = 2n ** 72n - 1n;
|
|
9416
|
+
maxUint80 = 2n ** 80n - 1n;
|
|
9417
|
+
maxUint88 = 2n ** 88n - 1n;
|
|
9418
|
+
maxUint96 = 2n ** 96n - 1n;
|
|
9419
|
+
maxUint104 = 2n ** 104n - 1n;
|
|
9420
|
+
maxUint112 = 2n ** 112n - 1n;
|
|
9421
|
+
maxUint120 = 2n ** 120n - 1n;
|
|
9422
|
+
maxUint128 = 2n ** 128n - 1n;
|
|
9423
|
+
maxUint136 = 2n ** 136n - 1n;
|
|
9424
|
+
maxUint144 = 2n ** 144n - 1n;
|
|
9425
|
+
maxUint152 = 2n ** 152n - 1n;
|
|
9426
|
+
maxUint160 = 2n ** 160n - 1n;
|
|
9427
|
+
maxUint168 = 2n ** 168n - 1n;
|
|
9428
|
+
maxUint176 = 2n ** 176n - 1n;
|
|
9429
|
+
maxUint184 = 2n ** 184n - 1n;
|
|
9430
|
+
maxUint192 = 2n ** 192n - 1n;
|
|
9431
|
+
maxUint200 = 2n ** 200n - 1n;
|
|
9432
|
+
maxUint208 = 2n ** 208n - 1n;
|
|
9433
|
+
maxUint216 = 2n ** 216n - 1n;
|
|
9434
|
+
maxUint224 = 2n ** 224n - 1n;
|
|
9435
|
+
maxUint232 = 2n ** 232n - 1n;
|
|
9436
|
+
maxUint240 = 2n ** 240n - 1n;
|
|
9437
|
+
maxUint248 = 2n ** 248n - 1n;
|
|
9438
|
+
maxUint256 = 2n ** 256n - 1n;
|
|
9439
|
+
});
|
|
9440
|
+
|
|
9441
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AbiParameters.js
|
|
9442
|
+
function encodePacked(types, values) {
|
|
9443
|
+
if (types.length !== values.length)
|
|
9444
|
+
throw new LengthMismatchError({
|
|
9445
|
+
expectedLength: types.length,
|
|
9446
|
+
givenLength: values.length
|
|
9447
|
+
});
|
|
9448
|
+
const data = [];
|
|
9449
|
+
for (let i = 0;i < types.length; i++) {
|
|
9450
|
+
const type = types[i];
|
|
9451
|
+
const value = values[i];
|
|
9452
|
+
data.push(encodePacked.encode(type, value));
|
|
9453
|
+
}
|
|
9454
|
+
return concat(...data);
|
|
9455
|
+
}
|
|
9456
|
+
var BytesSizeMismatchError, LengthMismatchError, InvalidTypeError;
|
|
9457
|
+
var init_AbiParameters = __esm(() => {
|
|
9458
|
+
init_Address();
|
|
9459
|
+
init_Errors();
|
|
9460
|
+
init_Hex();
|
|
9461
|
+
init_Solidity();
|
|
9462
|
+
(function(encodePacked2) {
|
|
9463
|
+
function encode(type, value, isArray = false) {
|
|
9464
|
+
if (type === "address") {
|
|
9465
|
+
const address2 = value;
|
|
9466
|
+
assert3(address2);
|
|
9467
|
+
return padLeft(address2.toLowerCase(), isArray ? 32 : 0);
|
|
9468
|
+
}
|
|
9469
|
+
if (type === "string")
|
|
9470
|
+
return fromString(value);
|
|
9471
|
+
if (type === "bytes")
|
|
9472
|
+
return value;
|
|
9473
|
+
if (type === "bool")
|
|
9474
|
+
return padLeft(fromBoolean(value), isArray ? 32 : 1);
|
|
9475
|
+
const intMatch = type.match(integerRegex);
|
|
9476
|
+
if (intMatch) {
|
|
9477
|
+
const [_type, baseType, bits = "256"] = intMatch;
|
|
9478
|
+
const size3 = Number.parseInt(bits, 10) / 8;
|
|
9479
|
+
return fromNumber(value, {
|
|
9480
|
+
size: isArray ? 32 : size3,
|
|
9481
|
+
signed: baseType === "int"
|
|
9482
|
+
});
|
|
9483
|
+
}
|
|
9484
|
+
const bytesMatch = type.match(bytesRegex);
|
|
9485
|
+
if (bytesMatch) {
|
|
9486
|
+
const [_type, size3] = bytesMatch;
|
|
9487
|
+
if (Number.parseInt(size3, 10) !== (value.length - 2) / 2)
|
|
9488
|
+
throw new BytesSizeMismatchError({
|
|
9489
|
+
expectedSize: Number.parseInt(size3, 10),
|
|
9490
|
+
value
|
|
9491
|
+
});
|
|
9492
|
+
return padRight(value, isArray ? 32 : 0);
|
|
9493
|
+
}
|
|
9494
|
+
const arrayMatch = type.match(arrayRegex);
|
|
9495
|
+
if (arrayMatch && Array.isArray(value)) {
|
|
9496
|
+
const [_type, childType] = arrayMatch;
|
|
9497
|
+
const data = [];
|
|
9498
|
+
for (let i = 0;i < value.length; i++) {
|
|
9499
|
+
data.push(encode(childType, value[i], true));
|
|
9500
|
+
}
|
|
9501
|
+
if (data.length === 0)
|
|
9502
|
+
return "0x";
|
|
9503
|
+
return concat(...data);
|
|
9504
|
+
}
|
|
9505
|
+
throw new InvalidTypeError(type);
|
|
9506
|
+
}
|
|
9507
|
+
encodePacked2.encode = encode;
|
|
9508
|
+
})(encodePacked || (encodePacked = {}));
|
|
9509
|
+
BytesSizeMismatchError = class BytesSizeMismatchError extends BaseError {
|
|
9510
|
+
constructor({ expectedSize, value }) {
|
|
9511
|
+
super(`Size of bytes "${value}" (bytes${size2(value)}) does not match expected size (bytes${expectedSize}).`);
|
|
9512
|
+
Object.defineProperty(this, "name", {
|
|
9513
|
+
enumerable: true,
|
|
9514
|
+
configurable: true,
|
|
9515
|
+
writable: true,
|
|
9516
|
+
value: "AbiParameters.BytesSizeMismatchError"
|
|
9517
|
+
});
|
|
9518
|
+
}
|
|
9519
|
+
};
|
|
9520
|
+
LengthMismatchError = class LengthMismatchError extends BaseError {
|
|
9521
|
+
constructor({ expectedLength, givenLength }) {
|
|
9522
|
+
super([
|
|
9523
|
+
"ABI encoding parameters/values length mismatch.",
|
|
9524
|
+
`Expected length (parameters): ${expectedLength}`,
|
|
9525
|
+
`Given length (values): ${givenLength}`
|
|
9526
|
+
].join(`
|
|
9527
|
+
`));
|
|
9528
|
+
Object.defineProperty(this, "name", {
|
|
9529
|
+
enumerable: true,
|
|
9530
|
+
configurable: true,
|
|
9531
|
+
writable: true,
|
|
9532
|
+
value: "AbiParameters.LengthMismatchError"
|
|
9533
|
+
});
|
|
9534
|
+
}
|
|
9535
|
+
};
|
|
9536
|
+
InvalidTypeError = class InvalidTypeError extends BaseError {
|
|
9537
|
+
constructor(type) {
|
|
9538
|
+
super(`Type \`${type}\` is not a valid ABI Type.`);
|
|
9539
|
+
Object.defineProperty(this, "name", {
|
|
9540
|
+
enumerable: true,
|
|
9541
|
+
configurable: true,
|
|
9542
|
+
writable: true,
|
|
9543
|
+
value: "AbiParameters.InvalidTypeError"
|
|
9544
|
+
});
|
|
9545
|
+
}
|
|
9546
|
+
};
|
|
9547
|
+
});
|
|
9548
|
+
|
|
9549
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AbiConstructor.js
|
|
9550
|
+
var init_AbiConstructor = () => {};
|
|
9551
|
+
|
|
9552
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AbiError.js
|
|
9553
|
+
var init_AbiError = () => {};
|
|
9554
|
+
|
|
9555
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AbiEvent.js
|
|
9556
|
+
var init_AbiEvent = () => {};
|
|
9557
|
+
|
|
9558
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AbiFunction.js
|
|
9559
|
+
var init_AbiFunction = () => {};
|
|
9560
|
+
|
|
9561
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AccessList.js
|
|
9562
|
+
var init_AccessList = () => {};
|
|
9563
|
+
|
|
9564
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AccountProof.js
|
|
9565
|
+
var init_AccountProof = () => {};
|
|
9566
|
+
|
|
9567
|
+
// node_modules/mppx/node_modules/ox/_esm/core/AesGcm.js
|
|
9568
|
+
var init_AesGcm = () => {};
|
|
9569
|
+
|
|
9570
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Rlp.js
|
|
9571
|
+
var init_Rlp = () => {};
|
|
9572
|
+
|
|
9573
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Signature.js
|
|
9574
|
+
var init_Signature = () => {};
|
|
9575
|
+
|
|
9576
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Authorization.js
|
|
9577
|
+
var init_Authorization = () => {};
|
|
9578
|
+
|
|
9579
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Base32.js
|
|
9580
|
+
var init_Base32 = () => {};
|
|
9581
|
+
|
|
9582
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Base58.js
|
|
9583
|
+
var init_Base58 = () => {};
|
|
9584
|
+
|
|
9585
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Base64.js
|
|
9586
|
+
var exports_Base64 = {};
|
|
9587
|
+
__export(exports_Base64, {
|
|
9588
|
+
toString: () => toString2,
|
|
9589
|
+
toHex: () => toHex2,
|
|
9590
|
+
toBytes: () => toBytes2,
|
|
9591
|
+
fromString: () => fromString3,
|
|
9592
|
+
fromHex: () => fromHex2,
|
|
9593
|
+
fromBytes: () => fromBytes2
|
|
9594
|
+
});
|
|
9595
|
+
function fromBytes2(value, options2 = {}) {
|
|
9596
|
+
const { pad: pad4 = true, url = false } = options2;
|
|
9597
|
+
const encoded = new Uint8Array(Math.ceil(value.length / 3) * 4);
|
|
9598
|
+
for (let i = 0, j = 0;j < value.length; i += 4, j += 3) {
|
|
9599
|
+
const y = (value[j] << 16) + (value[j + 1] << 8) + (value[j + 2] | 0);
|
|
9600
|
+
encoded[i] = integerToCharacter[y >> 18];
|
|
9601
|
+
encoded[i + 1] = integerToCharacter[y >> 12 & 63];
|
|
9602
|
+
encoded[i + 2] = integerToCharacter[y >> 6 & 63];
|
|
9603
|
+
encoded[i + 3] = integerToCharacter[y & 63];
|
|
9604
|
+
}
|
|
9605
|
+
const k = value.length % 3;
|
|
9606
|
+
const end = Math.floor(value.length / 3) * 4 + (k && k + 1);
|
|
9607
|
+
let base64 = decoder2.decode(new Uint8Array(encoded.buffer, 0, end));
|
|
9608
|
+
if (pad4 && k === 1)
|
|
9609
|
+
base64 += "==";
|
|
9610
|
+
if (pad4 && k === 2)
|
|
9611
|
+
base64 += "=";
|
|
9612
|
+
if (url)
|
|
9613
|
+
base64 = base64.replaceAll("+", "-").replaceAll("/", "_");
|
|
9614
|
+
return base64;
|
|
9615
|
+
}
|
|
9616
|
+
function fromHex2(value, options2 = {}) {
|
|
9617
|
+
return fromBytes2(fromHex(value), options2);
|
|
9618
|
+
}
|
|
9619
|
+
function fromString3(value, options2 = {}) {
|
|
9620
|
+
return fromBytes2(fromString2(value), options2);
|
|
9621
|
+
}
|
|
9622
|
+
function toBytes2(value) {
|
|
9623
|
+
const base64 = value.replace(/=+$/, "");
|
|
9624
|
+
const size3 = base64.length;
|
|
9625
|
+
const decoded = new Uint8Array(size3 + 3);
|
|
9626
|
+
encoder3.encodeInto(base64 + "===", decoded);
|
|
9627
|
+
for (let i = 0, j = 0;i < base64.length; i += 4, j += 3) {
|
|
9628
|
+
const x = (characterToInteger[decoded[i]] << 18) + (characterToInteger[decoded[i + 1]] << 12) + (characterToInteger[decoded[i + 2]] << 6) + characterToInteger[decoded[i + 3]];
|
|
9629
|
+
decoded[j] = x >> 16;
|
|
9630
|
+
decoded[j + 1] = x >> 8 & 255;
|
|
9631
|
+
decoded[j + 2] = x & 255;
|
|
9632
|
+
}
|
|
9633
|
+
const decodedSize = (size3 >> 2) * 3 + (size3 % 4 && size3 % 4 - 1);
|
|
9634
|
+
return new Uint8Array(decoded.buffer, 0, decodedSize);
|
|
9635
|
+
}
|
|
9636
|
+
function toHex2(value) {
|
|
9637
|
+
return fromBytes(toBytes2(value));
|
|
9638
|
+
}
|
|
9639
|
+
function toString2(value) {
|
|
9640
|
+
return toString(toBytes2(value));
|
|
9641
|
+
}
|
|
9642
|
+
var encoder3, decoder2, integerToCharacter, characterToInteger;
|
|
9643
|
+
var init_Base64 = __esm(() => {
|
|
9644
|
+
init_Bytes();
|
|
9645
|
+
init_Hex();
|
|
9646
|
+
encoder3 = /* @__PURE__ */ new TextEncoder;
|
|
9647
|
+
decoder2 = /* @__PURE__ */ new TextDecoder;
|
|
9648
|
+
integerToCharacter = /* @__PURE__ */ Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((a, i) => [i, a.charCodeAt(0)]));
|
|
9649
|
+
characterToInteger = {
|
|
9650
|
+
...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((a, i) => [a.charCodeAt(0), i])),
|
|
9651
|
+
[61]: 0,
|
|
9652
|
+
[45]: 62,
|
|
9653
|
+
[95]: 63
|
|
9654
|
+
};
|
|
9655
|
+
});
|
|
9656
|
+
|
|
9657
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Bech32m.js
|
|
9658
|
+
var init_Bech32m = () => {};
|
|
9659
|
+
|
|
9660
|
+
// node_modules/mppx/node_modules/ox/_esm/core/BinaryStateTree.js
|
|
9661
|
+
var init_BinaryStateTree = () => {};
|
|
9662
|
+
|
|
9663
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Blobs.js
|
|
9664
|
+
var blobsPerTransaction = 6, bytesPerFieldElement = 32, fieldElementsPerBlob = 4096, bytesPerBlob, maxBytesPerTransaction;
|
|
9665
|
+
var init_Blobs = __esm(() => {
|
|
9666
|
+
bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;
|
|
9667
|
+
maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction - 1 - 1 * fieldElementsPerBlob * blobsPerTransaction;
|
|
9668
|
+
});
|
|
9669
|
+
|
|
9670
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Transaction.js
|
|
9671
|
+
var init_Transaction = () => {};
|
|
9672
|
+
|
|
9673
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Withdrawal.js
|
|
9674
|
+
var init_Withdrawal = () => {};
|
|
9675
|
+
|
|
9676
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Block.js
|
|
9677
|
+
var init_Block = () => {};
|
|
9678
|
+
|
|
9679
|
+
// node_modules/mppx/node_modules/ox/_esm/core/BlockOverrides.js
|
|
9680
|
+
var init_BlockOverrides = () => {};
|
|
9681
|
+
|
|
9682
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Bloom.js
|
|
9683
|
+
var init_Bloom = () => {};
|
|
9684
|
+
|
|
9685
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Bls.js
|
|
9686
|
+
var init_Bls = () => {};
|
|
9687
|
+
|
|
9688
|
+
// node_modules/mppx/node_modules/ox/_esm/core/BlsPoint.js
|
|
9689
|
+
var init_BlsPoint = () => {};
|
|
9690
|
+
|
|
9691
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Cbor.js
|
|
9692
|
+
function getEncodable(value) {
|
|
9693
|
+
if (typeof value === "undefined")
|
|
9694
|
+
return { length: 1, encode: (cursor) => cursor.pushUint8(247) };
|
|
9695
|
+
if (value === null)
|
|
9696
|
+
return { length: 1, encode: (cursor) => cursor.pushUint8(246) };
|
|
9697
|
+
if (typeof value === "boolean")
|
|
9698
|
+
return {
|
|
9699
|
+
length: 1,
|
|
9700
|
+
encode: (cursor) => cursor.pushUint8(value ? 245 : 244)
|
|
9701
|
+
};
|
|
9702
|
+
if (typeof value === "number")
|
|
9703
|
+
return getEncodable.number(value);
|
|
9704
|
+
if (typeof value === "bigint")
|
|
9705
|
+
throw new UnsupportedBigIntError;
|
|
9706
|
+
if (typeof value === "string")
|
|
9707
|
+
return getEncodable.string(value);
|
|
9708
|
+
if (Array.isArray(value))
|
|
9709
|
+
return getEncodable.array(value);
|
|
9710
|
+
if (value instanceof Uint8Array)
|
|
9711
|
+
return getEncodable.byteString(value);
|
|
9712
|
+
if (value instanceof ArrayBuffer)
|
|
9713
|
+
return getEncodable.byteString(new Uint8Array(value));
|
|
9714
|
+
if (ArrayBuffer.isView(value))
|
|
9715
|
+
return getEncodable.byteString(new Uint8Array(value.buffer, value.byteOffset, value.byteLength));
|
|
9716
|
+
if (value instanceof Map)
|
|
9717
|
+
return getEncodable.map(value);
|
|
9718
|
+
if (typeof value === "object")
|
|
9719
|
+
return getEncodable.object(value);
|
|
9720
|
+
throw new UnexpectedTokenError({ token: String(value) });
|
|
9721
|
+
}
|
|
9722
|
+
function decodeCursor(cursor) {
|
|
9723
|
+
const initialByte = cursor.readUint8();
|
|
9724
|
+
const majorType = initialByte >> 5;
|
|
9725
|
+
const additionalInfo = initialByte & 31;
|
|
9726
|
+
switch (majorType) {
|
|
9727
|
+
case 0:
|
|
9728
|
+
return decodeCursor.readUnsignedInteger(cursor, additionalInfo);
|
|
9729
|
+
case 1:
|
|
9730
|
+
return decodeCursor.readNegativeInteger(cursor, additionalInfo);
|
|
9731
|
+
case 2:
|
|
9732
|
+
return decodeCursor.readByteString(cursor, additionalInfo);
|
|
9733
|
+
case 3:
|
|
9734
|
+
return decodeCursor.readTextString(cursor, additionalInfo);
|
|
9735
|
+
case 4:
|
|
9736
|
+
return decodeCursor.readArray(cursor, additionalInfo);
|
|
9737
|
+
case 5:
|
|
9738
|
+
return decodeCursor.readMap(cursor, additionalInfo);
|
|
9739
|
+
case 6:
|
|
9740
|
+
throw new UnsupportedTagError({ tag: additionalInfo });
|
|
9741
|
+
case 7:
|
|
9742
|
+
return decodeCursor.readSimpleOrFloat(cursor, additionalInfo);
|
|
9743
|
+
default:
|
|
9744
|
+
throw new InvalidMajorTypeError({ majorType });
|
|
9745
|
+
}
|
|
9746
|
+
}
|
|
9747
|
+
var InvalidMajorTypeError, InvalidAdditionalInfoError, Unsupported64BitIntegerError, UnsupportedTagError, InvalidIndefiniteLengthChunkError, InvalidSimpleValueError, UnsupportedBigIntError, UnexpectedTokenError, NumberTooLargeError, StringTooLargeError, ArrayTooLargeError, ObjectTooLargeError, ByteStringTooLargeError;
|
|
9748
|
+
var init_Cbor = __esm(() => {
|
|
9749
|
+
init_Bytes();
|
|
9750
|
+
init_Errors();
|
|
9751
|
+
InvalidMajorTypeError = class InvalidMajorTypeError extends BaseError {
|
|
9752
|
+
constructor({ majorType }) {
|
|
9753
|
+
super(`Invalid CBOR major type: ${majorType}`);
|
|
9754
|
+
Object.defineProperty(this, "name", {
|
|
9755
|
+
enumerable: true,
|
|
9756
|
+
configurable: true,
|
|
9757
|
+
writable: true,
|
|
9758
|
+
value: "Cbor.InvalidMajorTypeError"
|
|
9759
|
+
});
|
|
9760
|
+
}
|
|
9761
|
+
};
|
|
9762
|
+
InvalidAdditionalInfoError = class InvalidAdditionalInfoError extends BaseError {
|
|
9763
|
+
constructor({ additionalInfo }) {
|
|
9764
|
+
super(`Invalid CBOR additional info: ${additionalInfo}`);
|
|
9765
|
+
Object.defineProperty(this, "name", {
|
|
9766
|
+
enumerable: true,
|
|
9767
|
+
configurable: true,
|
|
9768
|
+
writable: true,
|
|
9769
|
+
value: "Cbor.InvalidAdditionalInfoError"
|
|
9770
|
+
});
|
|
9771
|
+
}
|
|
9772
|
+
};
|
|
9773
|
+
Unsupported64BitIntegerError = class Unsupported64BitIntegerError extends BaseError {
|
|
9774
|
+
constructor() {
|
|
9775
|
+
super("64-bit integers are not supported in CBOR decoding.");
|
|
9776
|
+
Object.defineProperty(this, "name", {
|
|
9777
|
+
enumerable: true,
|
|
9778
|
+
configurable: true,
|
|
9779
|
+
writable: true,
|
|
9780
|
+
value: "Cbor.Unsupported64BitIntegerError"
|
|
9781
|
+
});
|
|
9782
|
+
}
|
|
9783
|
+
};
|
|
9784
|
+
UnsupportedTagError = class UnsupportedTagError extends BaseError {
|
|
9785
|
+
constructor({ tag }) {
|
|
9786
|
+
super(`CBOR tagged data (tag ${tag}) is not yet supported.`);
|
|
9787
|
+
Object.defineProperty(this, "name", {
|
|
9788
|
+
enumerable: true,
|
|
9789
|
+
configurable: true,
|
|
9790
|
+
writable: true,
|
|
9791
|
+
value: "Cbor.UnsupportedTagError"
|
|
9792
|
+
});
|
|
9793
|
+
}
|
|
9794
|
+
};
|
|
9795
|
+
InvalidIndefiniteLengthChunkError = class InvalidIndefiniteLengthChunkError extends BaseError {
|
|
9796
|
+
constructor({ type }) {
|
|
9797
|
+
super(`Invalid chunk type in indefinite-length ${type}`);
|
|
9798
|
+
Object.defineProperty(this, "name", {
|
|
9799
|
+
enumerable: true,
|
|
9800
|
+
configurable: true,
|
|
9801
|
+
writable: true,
|
|
9802
|
+
value: "Cbor.InvalidIndefiniteLengthChunkError"
|
|
9803
|
+
});
|
|
9804
|
+
}
|
|
9805
|
+
};
|
|
9806
|
+
InvalidSimpleValueError = class InvalidSimpleValueError extends BaseError {
|
|
9807
|
+
constructor({ value }) {
|
|
9808
|
+
super(`Invalid CBOR simple value: ${value}`);
|
|
9809
|
+
Object.defineProperty(this, "name", {
|
|
9810
|
+
enumerable: true,
|
|
9811
|
+
configurable: true,
|
|
9812
|
+
writable: true,
|
|
9813
|
+
value: "Cbor.InvalidSimpleValueError"
|
|
9814
|
+
});
|
|
9815
|
+
}
|
|
9816
|
+
};
|
|
9817
|
+
UnsupportedBigIntError = class UnsupportedBigIntError extends BaseError {
|
|
9818
|
+
constructor() {
|
|
9819
|
+
super("BigInt values are not supported in CBOR encoding.");
|
|
9820
|
+
Object.defineProperty(this, "name", {
|
|
9821
|
+
enumerable: true,
|
|
9822
|
+
configurable: true,
|
|
9823
|
+
writable: true,
|
|
9824
|
+
value: "Cbor.UnsupportedBigIntError"
|
|
9825
|
+
});
|
|
9826
|
+
}
|
|
9827
|
+
};
|
|
9828
|
+
UnexpectedTokenError = class UnexpectedTokenError extends BaseError {
|
|
9829
|
+
constructor({ token }) {
|
|
9830
|
+
super(`Unexpected token: ${token}`);
|
|
9831
|
+
Object.defineProperty(this, "name", {
|
|
9832
|
+
enumerable: true,
|
|
9833
|
+
configurable: true,
|
|
9834
|
+
writable: true,
|
|
9835
|
+
value: "Cbor.UnexpectedTokenError"
|
|
9836
|
+
});
|
|
9837
|
+
}
|
|
9838
|
+
};
|
|
9839
|
+
NumberTooLargeError = class NumberTooLargeError extends BaseError {
|
|
9840
|
+
constructor({ number }) {
|
|
9841
|
+
super(`Number exceeds maximum safe integer (${Number.MAX_SAFE_INTEGER}): ${number}`);
|
|
9842
|
+
Object.defineProperty(this, "name", {
|
|
9843
|
+
enumerable: true,
|
|
9844
|
+
configurable: true,
|
|
9845
|
+
writable: true,
|
|
9846
|
+
value: "Cbor.NumberTooLargeError"
|
|
9847
|
+
});
|
|
9848
|
+
}
|
|
9849
|
+
};
|
|
9850
|
+
StringTooLargeError = class StringTooLargeError extends BaseError {
|
|
9851
|
+
constructor({ size: size3 }) {
|
|
9852
|
+
super(`String length exceeds maximum (4294967295): ${size3}`);
|
|
9853
|
+
Object.defineProperty(this, "name", {
|
|
9854
|
+
enumerable: true,
|
|
9855
|
+
configurable: true,
|
|
9856
|
+
writable: true,
|
|
9857
|
+
value: "Cbor.StringTooLargeError"
|
|
9858
|
+
});
|
|
9859
|
+
}
|
|
9860
|
+
};
|
|
9861
|
+
ArrayTooLargeError = class ArrayTooLargeError extends BaseError {
|
|
9862
|
+
constructor({ size: size3 }) {
|
|
9863
|
+
super(`Array length exceeds maximum (4294967295): ${size3}`);
|
|
9864
|
+
Object.defineProperty(this, "name", {
|
|
9865
|
+
enumerable: true,
|
|
9866
|
+
configurable: true,
|
|
9867
|
+
writable: true,
|
|
9868
|
+
value: "Cbor.ArrayTooLargeError"
|
|
9869
|
+
});
|
|
9870
|
+
}
|
|
9871
|
+
};
|
|
9872
|
+
ObjectTooLargeError = class ObjectTooLargeError extends BaseError {
|
|
9873
|
+
constructor({ size: size3 }) {
|
|
9874
|
+
super(`Object size exceeds maximum (4294967295): ${size3}`);
|
|
9875
|
+
Object.defineProperty(this, "name", {
|
|
9876
|
+
enumerable: true,
|
|
9877
|
+
configurable: true,
|
|
9878
|
+
writable: true,
|
|
9879
|
+
value: "Cbor.ObjectTooLargeError"
|
|
9880
|
+
});
|
|
9881
|
+
}
|
|
9882
|
+
};
|
|
9883
|
+
ByteStringTooLargeError = class ByteStringTooLargeError extends BaseError {
|
|
9884
|
+
constructor({ size: size3 }) {
|
|
9885
|
+
super(`Byte string length exceeds maximum (4294967295): ${size3}`);
|
|
9886
|
+
Object.defineProperty(this, "name", {
|
|
9887
|
+
enumerable: true,
|
|
9888
|
+
configurable: true,
|
|
9889
|
+
writable: true,
|
|
9890
|
+
value: "Cbor.ByteStringTooLargeError"
|
|
9891
|
+
});
|
|
9892
|
+
}
|
|
9893
|
+
};
|
|
9894
|
+
(function(getEncodable2) {
|
|
9895
|
+
function number(value) {
|
|
9896
|
+
if (!Number.isSafeInteger(value)) {
|
|
9897
|
+
const float32 = Math.fround(value);
|
|
9898
|
+
if (Number.isNaN(value) || value === float32)
|
|
9899
|
+
return {
|
|
9900
|
+
length: 5,
|
|
9901
|
+
encode(cursor) {
|
|
9902
|
+
cursor.pushUint8(250);
|
|
9903
|
+
cursor.dataView.setFloat32(cursor.position, value, false);
|
|
9904
|
+
cursor.position += 4;
|
|
9905
|
+
}
|
|
9906
|
+
};
|
|
9907
|
+
return {
|
|
9908
|
+
length: 9,
|
|
9909
|
+
encode(cursor) {
|
|
9910
|
+
cursor.pushUint8(251);
|
|
9911
|
+
cursor.dataView.setFloat64(cursor.position, value, false);
|
|
9912
|
+
cursor.position += 8;
|
|
9913
|
+
}
|
|
9914
|
+
};
|
|
9915
|
+
}
|
|
9916
|
+
if (value >= 0) {
|
|
9917
|
+
if (value <= 23)
|
|
9918
|
+
return { length: 1, encode: (cursor) => cursor.pushUint8(value) };
|
|
9919
|
+
if (value <= 255)
|
|
9920
|
+
return {
|
|
9921
|
+
length: 2,
|
|
9922
|
+
encode: (cursor) => {
|
|
9923
|
+
cursor.pushUint8(24);
|
|
9924
|
+
cursor.pushUint8(value);
|
|
9925
|
+
}
|
|
9926
|
+
};
|
|
9927
|
+
if (value <= 65535)
|
|
9928
|
+
return {
|
|
9929
|
+
length: 3,
|
|
9930
|
+
encode: (cursor) => {
|
|
9931
|
+
cursor.pushUint8(25);
|
|
9932
|
+
cursor.pushUint16(value);
|
|
9933
|
+
}
|
|
9934
|
+
};
|
|
9935
|
+
if (value <= 4294967295)
|
|
9936
|
+
return {
|
|
9937
|
+
length: 5,
|
|
9938
|
+
encode: (cursor) => {
|
|
9939
|
+
cursor.pushUint8(26);
|
|
9940
|
+
cursor.pushUint32(value);
|
|
9941
|
+
}
|
|
9942
|
+
};
|
|
9943
|
+
throw new NumberTooLargeError({ number: value.toString(10) });
|
|
9944
|
+
}
|
|
9945
|
+
const positiveNumber = -1 - value;
|
|
9946
|
+
if (value >= -24)
|
|
9947
|
+
return {
|
|
9948
|
+
length: 1,
|
|
9949
|
+
encode: (cursor) => cursor.pushUint8(32 + positiveNumber)
|
|
9950
|
+
};
|
|
9951
|
+
if (positiveNumber <= 255)
|
|
9952
|
+
return {
|
|
9953
|
+
length: 2,
|
|
9954
|
+
encode: (cursor) => {
|
|
9955
|
+
cursor.pushUint8(56);
|
|
9956
|
+
cursor.pushUint8(positiveNumber);
|
|
9957
|
+
}
|
|
9958
|
+
};
|
|
9959
|
+
if (positiveNumber <= 65535)
|
|
9960
|
+
return {
|
|
9961
|
+
length: 3,
|
|
9962
|
+
encode: (cursor) => {
|
|
9963
|
+
cursor.pushUint8(57);
|
|
9964
|
+
cursor.pushUint16(positiveNumber);
|
|
9965
|
+
}
|
|
9966
|
+
};
|
|
9967
|
+
if (positiveNumber <= 4294967295)
|
|
9968
|
+
return {
|
|
9969
|
+
length: 5,
|
|
9970
|
+
encode: (cursor) => {
|
|
9971
|
+
cursor.pushUint8(58);
|
|
9972
|
+
cursor.pushUint32(positiveNumber);
|
|
9973
|
+
}
|
|
9974
|
+
};
|
|
9975
|
+
throw new NumberTooLargeError({ number: value.toString(10) });
|
|
9976
|
+
}
|
|
9977
|
+
getEncodable2.number = number;
|
|
9978
|
+
function string(value) {
|
|
9979
|
+
const encoded = fromString2(value);
|
|
9980
|
+
const size3 = encoded.length;
|
|
9981
|
+
if (size3 <= 23)
|
|
9982
|
+
return {
|
|
9983
|
+
length: 1 + size3,
|
|
9984
|
+
encode(cursor) {
|
|
9985
|
+
cursor.pushUint8(96 + size3);
|
|
9986
|
+
if (size3 > 0)
|
|
9987
|
+
cursor.pushBytes(encoded);
|
|
9988
|
+
}
|
|
9989
|
+
};
|
|
9990
|
+
if (size3 <= 255)
|
|
9991
|
+
return {
|
|
9992
|
+
length: 2 + size3,
|
|
9993
|
+
encode(cursor) {
|
|
9994
|
+
cursor.pushUint8(120);
|
|
9995
|
+
cursor.pushUint8(size3);
|
|
9996
|
+
cursor.pushBytes(encoded);
|
|
9997
|
+
}
|
|
9998
|
+
};
|
|
9999
|
+
if (size3 <= 65535)
|
|
10000
|
+
return {
|
|
10001
|
+
length: 3 + size3,
|
|
10002
|
+
encode(cursor) {
|
|
10003
|
+
cursor.pushUint8(121);
|
|
10004
|
+
cursor.pushUint16(size3);
|
|
10005
|
+
cursor.pushBytes(encoded);
|
|
10006
|
+
}
|
|
10007
|
+
};
|
|
10008
|
+
if (size3 <= 4294967295)
|
|
10009
|
+
return {
|
|
10010
|
+
length: 5 + size3,
|
|
10011
|
+
encode(cursor) {
|
|
10012
|
+
cursor.pushUint8(122);
|
|
10013
|
+
cursor.pushUint32(size3);
|
|
10014
|
+
cursor.pushBytes(encoded);
|
|
10015
|
+
}
|
|
10016
|
+
};
|
|
10017
|
+
throw new StringTooLargeError({ size: size3 });
|
|
10018
|
+
}
|
|
10019
|
+
getEncodable2.string = string;
|
|
10020
|
+
function array(value) {
|
|
10021
|
+
const items = value.map((item) => getEncodable2(item));
|
|
10022
|
+
const bodyLength = items.reduce((acc, item) => acc + item.length, 0);
|
|
10023
|
+
const size3 = value.length;
|
|
10024
|
+
if (size3 <= 23)
|
|
10025
|
+
return {
|
|
10026
|
+
length: 1 + bodyLength,
|
|
10027
|
+
encode(cursor) {
|
|
10028
|
+
cursor.pushUint8(128 + size3);
|
|
10029
|
+
for (const item of items)
|
|
10030
|
+
item.encode(cursor);
|
|
10031
|
+
}
|
|
10032
|
+
};
|
|
10033
|
+
if (size3 <= 255)
|
|
10034
|
+
return {
|
|
10035
|
+
length: 2 + bodyLength,
|
|
10036
|
+
encode(cursor) {
|
|
10037
|
+
cursor.pushUint8(152);
|
|
10038
|
+
cursor.pushUint8(size3);
|
|
10039
|
+
for (const item of items)
|
|
10040
|
+
item.encode(cursor);
|
|
10041
|
+
}
|
|
10042
|
+
};
|
|
10043
|
+
if (size3 <= 65535)
|
|
10044
|
+
return {
|
|
10045
|
+
length: 3 + bodyLength,
|
|
10046
|
+
encode(cursor) {
|
|
10047
|
+
cursor.pushUint8(153);
|
|
10048
|
+
cursor.pushUint16(size3);
|
|
10049
|
+
for (const item of items)
|
|
10050
|
+
item.encode(cursor);
|
|
10051
|
+
}
|
|
10052
|
+
};
|
|
10053
|
+
if (size3 <= 4294967295)
|
|
10054
|
+
return {
|
|
10055
|
+
length: 5 + bodyLength,
|
|
10056
|
+
encode(cursor) {
|
|
10057
|
+
cursor.pushUint8(154);
|
|
10058
|
+
cursor.pushUint32(size3);
|
|
10059
|
+
for (const item of items)
|
|
10060
|
+
item.encode(cursor);
|
|
10061
|
+
}
|
|
10062
|
+
};
|
|
10063
|
+
throw new ArrayTooLargeError({ size: size3 });
|
|
10064
|
+
}
|
|
10065
|
+
getEncodable2.array = array;
|
|
10066
|
+
function byteString(value) {
|
|
10067
|
+
const size3 = value.byteLength;
|
|
10068
|
+
if (size3 <= 23)
|
|
10069
|
+
return {
|
|
10070
|
+
length: 1 + size3,
|
|
10071
|
+
encode(cursor) {
|
|
10072
|
+
cursor.pushUint8(64 + size3);
|
|
10073
|
+
cursor.pushBytes(value);
|
|
10074
|
+
}
|
|
10075
|
+
};
|
|
10076
|
+
if (size3 <= 255)
|
|
10077
|
+
return {
|
|
10078
|
+
length: 2 + size3,
|
|
10079
|
+
encode(cursor) {
|
|
10080
|
+
cursor.pushUint8(88);
|
|
10081
|
+
cursor.pushUint8(size3);
|
|
10082
|
+
cursor.pushBytes(value);
|
|
10083
|
+
}
|
|
10084
|
+
};
|
|
10085
|
+
if (size3 <= 65535)
|
|
10086
|
+
return {
|
|
10087
|
+
length: 3 + size3,
|
|
10088
|
+
encode(cursor) {
|
|
10089
|
+
cursor.pushUint8(89);
|
|
10090
|
+
cursor.pushUint16(size3);
|
|
10091
|
+
cursor.pushBytes(value);
|
|
10092
|
+
}
|
|
10093
|
+
};
|
|
10094
|
+
if (size3 <= 4294967295)
|
|
10095
|
+
return {
|
|
10096
|
+
length: 5 + size3,
|
|
10097
|
+
encode(cursor) {
|
|
10098
|
+
cursor.pushUint8(90);
|
|
10099
|
+
cursor.pushUint32(size3);
|
|
10100
|
+
cursor.pushBytes(value);
|
|
10101
|
+
}
|
|
10102
|
+
};
|
|
10103
|
+
throw new ByteStringTooLargeError({ size: size3 });
|
|
10104
|
+
}
|
|
10105
|
+
getEncodable2.byteString = byteString;
|
|
10106
|
+
function object(value) {
|
|
10107
|
+
const keys2 = Object.keys(value);
|
|
10108
|
+
const entries = keys2.map((key) => ({
|
|
10109
|
+
key: getEncodable2(key),
|
|
10110
|
+
value: getEncodable2(value[key])
|
|
10111
|
+
}));
|
|
10112
|
+
const bodyLength = entries.reduce((acc, entry) => acc + entry.key.length + entry.value.length, 0);
|
|
10113
|
+
const size3 = keys2.length;
|
|
10114
|
+
if (size3 <= 23)
|
|
10115
|
+
return {
|
|
10116
|
+
length: 1 + bodyLength,
|
|
10117
|
+
encode(cursor) {
|
|
10118
|
+
cursor.pushUint8(160 + size3);
|
|
10119
|
+
for (const entry of entries) {
|
|
10120
|
+
entry.key.encode(cursor);
|
|
10121
|
+
entry.value.encode(cursor);
|
|
10122
|
+
}
|
|
10123
|
+
}
|
|
10124
|
+
};
|
|
10125
|
+
if (size3 <= 255)
|
|
10126
|
+
return {
|
|
10127
|
+
length: 2 + bodyLength,
|
|
10128
|
+
encode(cursor) {
|
|
10129
|
+
cursor.pushUint8(184);
|
|
10130
|
+
cursor.pushUint8(size3);
|
|
10131
|
+
for (const entry of entries) {
|
|
10132
|
+
entry.key.encode(cursor);
|
|
10133
|
+
entry.value.encode(cursor);
|
|
10134
|
+
}
|
|
10135
|
+
}
|
|
10136
|
+
};
|
|
10137
|
+
if (size3 <= 65535)
|
|
10138
|
+
return {
|
|
10139
|
+
length: 3 + bodyLength,
|
|
10140
|
+
encode(cursor) {
|
|
10141
|
+
cursor.pushUint8(185);
|
|
10142
|
+
cursor.pushUint16(size3);
|
|
10143
|
+
for (const entry of entries) {
|
|
10144
|
+
entry.key.encode(cursor);
|
|
10145
|
+
entry.value.encode(cursor);
|
|
10146
|
+
}
|
|
10147
|
+
}
|
|
10148
|
+
};
|
|
10149
|
+
if (size3 <= 4294967295)
|
|
10150
|
+
return {
|
|
10151
|
+
length: 5 + bodyLength,
|
|
10152
|
+
encode(cursor) {
|
|
10153
|
+
cursor.pushUint8(186);
|
|
10154
|
+
cursor.pushUint32(size3);
|
|
10155
|
+
for (const entry of entries) {
|
|
10156
|
+
entry.key.encode(cursor);
|
|
10157
|
+
entry.value.encode(cursor);
|
|
10158
|
+
}
|
|
10159
|
+
}
|
|
10160
|
+
};
|
|
10161
|
+
throw new ObjectTooLargeError({ size: size3 });
|
|
10162
|
+
}
|
|
10163
|
+
getEncodable2.object = object;
|
|
10164
|
+
function map(value) {
|
|
10165
|
+
const entries = [];
|
|
10166
|
+
for (const [k, v] of value)
|
|
10167
|
+
entries.push({ key: getEncodable2(k), value: getEncodable2(v) });
|
|
10168
|
+
const bodyLength = entries.reduce((acc, entry) => acc + entry.key.length + entry.value.length, 0);
|
|
10169
|
+
const size3 = value.size;
|
|
10170
|
+
if (size3 <= 23)
|
|
10171
|
+
return {
|
|
10172
|
+
length: 1 + bodyLength,
|
|
10173
|
+
encode(cursor) {
|
|
10174
|
+
cursor.pushUint8(160 + size3);
|
|
10175
|
+
for (const entry of entries) {
|
|
10176
|
+
entry.key.encode(cursor);
|
|
10177
|
+
entry.value.encode(cursor);
|
|
10178
|
+
}
|
|
10179
|
+
}
|
|
10180
|
+
};
|
|
10181
|
+
if (size3 <= 255)
|
|
10182
|
+
return {
|
|
10183
|
+
length: 2 + bodyLength,
|
|
10184
|
+
encode(cursor) {
|
|
10185
|
+
cursor.pushUint8(184);
|
|
10186
|
+
cursor.pushUint8(size3);
|
|
10187
|
+
for (const entry of entries) {
|
|
10188
|
+
entry.key.encode(cursor);
|
|
10189
|
+
entry.value.encode(cursor);
|
|
10190
|
+
}
|
|
10191
|
+
}
|
|
10192
|
+
};
|
|
10193
|
+
if (size3 <= 65535)
|
|
10194
|
+
return {
|
|
10195
|
+
length: 3 + bodyLength,
|
|
10196
|
+
encode(cursor) {
|
|
10197
|
+
cursor.pushUint8(185);
|
|
10198
|
+
cursor.pushUint16(size3);
|
|
10199
|
+
for (const entry of entries) {
|
|
10200
|
+
entry.key.encode(cursor);
|
|
10201
|
+
entry.value.encode(cursor);
|
|
10202
|
+
}
|
|
10203
|
+
}
|
|
10204
|
+
};
|
|
10205
|
+
if (size3 <= 4294967295)
|
|
10206
|
+
return {
|
|
10207
|
+
length: 5 + bodyLength,
|
|
10208
|
+
encode(cursor) {
|
|
10209
|
+
cursor.pushUint8(186);
|
|
10210
|
+
cursor.pushUint32(size3);
|
|
10211
|
+
for (const entry of entries) {
|
|
10212
|
+
entry.key.encode(cursor);
|
|
10213
|
+
entry.value.encode(cursor);
|
|
10214
|
+
}
|
|
10215
|
+
}
|
|
10216
|
+
};
|
|
10217
|
+
throw new ObjectTooLargeError({ size: size3 });
|
|
10218
|
+
}
|
|
10219
|
+
getEncodable2.map = map;
|
|
10220
|
+
})(getEncodable || (getEncodable = {}));
|
|
10221
|
+
(function(decodeCursor2) {
|
|
10222
|
+
function readLength(cursor, additionalInfo) {
|
|
10223
|
+
if (additionalInfo < 24)
|
|
10224
|
+
return additionalInfo;
|
|
10225
|
+
if (additionalInfo === 24)
|
|
10226
|
+
return cursor.readUint8();
|
|
10227
|
+
if (additionalInfo === 25)
|
|
10228
|
+
return cursor.readUint16();
|
|
10229
|
+
if (additionalInfo === 26)
|
|
10230
|
+
return cursor.readUint32();
|
|
10231
|
+
if (additionalInfo === 27)
|
|
10232
|
+
throw new Unsupported64BitIntegerError;
|
|
10233
|
+
throw new InvalidAdditionalInfoError({ additionalInfo });
|
|
10234
|
+
}
|
|
10235
|
+
function readUnsignedInteger(cursor, additionalInfo) {
|
|
10236
|
+
return readLength(cursor, additionalInfo);
|
|
10237
|
+
}
|
|
10238
|
+
decodeCursor2.readUnsignedInteger = readUnsignedInteger;
|
|
10239
|
+
function readNegativeInteger(cursor, additionalInfo) {
|
|
10240
|
+
const value = readLength(cursor, additionalInfo);
|
|
10241
|
+
return -1 - value;
|
|
10242
|
+
}
|
|
10243
|
+
decodeCursor2.readNegativeInteger = readNegativeInteger;
|
|
10244
|
+
function readByteString(cursor, additionalInfo) {
|
|
10245
|
+
if (additionalInfo === 31) {
|
|
10246
|
+
const chunks = [];
|
|
10247
|
+
let totalLength = 0;
|
|
10248
|
+
while (true) {
|
|
10249
|
+
const byte = cursor.inspectUint8();
|
|
10250
|
+
if (byte === 255) {
|
|
10251
|
+
cursor.readUint8();
|
|
10252
|
+
break;
|
|
10253
|
+
}
|
|
10254
|
+
const chunk = decodeCursor2(cursor);
|
|
10255
|
+
if (!(chunk instanceof Uint8Array))
|
|
10256
|
+
throw new InvalidIndefiniteLengthChunkError({ type: "byte string" });
|
|
10257
|
+
chunks.push(chunk);
|
|
10258
|
+
totalLength += chunk.length;
|
|
10259
|
+
}
|
|
10260
|
+
const result = new Uint8Array(totalLength);
|
|
10261
|
+
let offset = 0;
|
|
10262
|
+
for (const chunk of chunks) {
|
|
10263
|
+
result.set(chunk, offset);
|
|
10264
|
+
offset += chunk.length;
|
|
10265
|
+
}
|
|
10266
|
+
return result;
|
|
10267
|
+
}
|
|
10268
|
+
const length = readLength(cursor, additionalInfo);
|
|
10269
|
+
return cursor.readBytes(length);
|
|
10270
|
+
}
|
|
10271
|
+
decodeCursor2.readByteString = readByteString;
|
|
10272
|
+
function readTextString(cursor, additionalInfo) {
|
|
10273
|
+
if (additionalInfo === 31) {
|
|
10274
|
+
const chunks = [];
|
|
10275
|
+
while (true) {
|
|
10276
|
+
const byte = cursor.inspectUint8();
|
|
10277
|
+
if (byte === 255) {
|
|
10278
|
+
cursor.readUint8();
|
|
10279
|
+
break;
|
|
10280
|
+
}
|
|
10281
|
+
const chunk = decodeCursor2(cursor);
|
|
10282
|
+
if (typeof chunk !== "string")
|
|
10283
|
+
throw new InvalidIndefiniteLengthChunkError({ type: "text string" });
|
|
10284
|
+
chunks.push(chunk);
|
|
10285
|
+
}
|
|
10286
|
+
return chunks.join("");
|
|
10287
|
+
}
|
|
10288
|
+
const length = readLength(cursor, additionalInfo);
|
|
10289
|
+
const bytes = cursor.readBytes(length);
|
|
10290
|
+
return toString(bytes);
|
|
10291
|
+
}
|
|
10292
|
+
decodeCursor2.readTextString = readTextString;
|
|
10293
|
+
function readArray(cursor, additionalInfo) {
|
|
10294
|
+
if (additionalInfo === 31) {
|
|
10295
|
+
const result2 = [];
|
|
10296
|
+
while (true) {
|
|
10297
|
+
const byte = cursor.inspectUint8();
|
|
10298
|
+
if (byte === 255) {
|
|
10299
|
+
cursor.readUint8();
|
|
10300
|
+
break;
|
|
10301
|
+
}
|
|
10302
|
+
result2.push(decodeCursor2(cursor));
|
|
10303
|
+
}
|
|
10304
|
+
return result2;
|
|
10305
|
+
}
|
|
10306
|
+
const length = readLength(cursor, additionalInfo);
|
|
10307
|
+
const result = [];
|
|
10308
|
+
for (let i = 0;i < length; i++) {
|
|
10309
|
+
result.push(decodeCursor2(cursor));
|
|
10310
|
+
}
|
|
10311
|
+
return result;
|
|
10312
|
+
}
|
|
10313
|
+
decodeCursor2.readArray = readArray;
|
|
10314
|
+
function readMap(cursor, additionalInfo) {
|
|
10315
|
+
if (additionalInfo === 31) {
|
|
10316
|
+
const result2 = {};
|
|
10317
|
+
while (true) {
|
|
10318
|
+
const byte = cursor.inspectUint8();
|
|
10319
|
+
if (byte === 255) {
|
|
10320
|
+
cursor.readUint8();
|
|
10321
|
+
break;
|
|
10322
|
+
}
|
|
10323
|
+
const key = decodeCursor2(cursor);
|
|
10324
|
+
const keyStr = typeof key === "string" ? key : typeof key === "number" ? String(key) : String(key);
|
|
10325
|
+
const value = decodeCursor2(cursor);
|
|
10326
|
+
result2[keyStr] = value;
|
|
10327
|
+
}
|
|
10328
|
+
return result2;
|
|
10329
|
+
}
|
|
10330
|
+
const length = readLength(cursor, additionalInfo);
|
|
10331
|
+
const result = {};
|
|
10332
|
+
for (let i = 0;i < length; i++) {
|
|
10333
|
+
const key = decodeCursor2(cursor);
|
|
10334
|
+
const keyStr = typeof key === "string" ? key : typeof key === "number" ? String(key) : String(key);
|
|
10335
|
+
const value = decodeCursor2(cursor);
|
|
10336
|
+
result[keyStr] = value;
|
|
10337
|
+
}
|
|
10338
|
+
return result;
|
|
10339
|
+
}
|
|
10340
|
+
decodeCursor2.readMap = readMap;
|
|
10341
|
+
function readSimpleOrFloat(cursor, additionalInfo) {
|
|
10342
|
+
if (additionalInfo === 20)
|
|
10343
|
+
return false;
|
|
10344
|
+
if (additionalInfo === 21)
|
|
10345
|
+
return true;
|
|
10346
|
+
if (additionalInfo === 22)
|
|
10347
|
+
return null;
|
|
10348
|
+
if (additionalInfo === 23)
|
|
10349
|
+
return;
|
|
10350
|
+
if (additionalInfo === 25) {
|
|
10351
|
+
const bits = cursor.readUint16();
|
|
10352
|
+
return getFloat16(bits);
|
|
10353
|
+
}
|
|
10354
|
+
if (additionalInfo === 26) {
|
|
10355
|
+
const value = cursor.dataView.getFloat32(cursor.position, false);
|
|
10356
|
+
cursor.position += 4;
|
|
10357
|
+
return value;
|
|
10358
|
+
}
|
|
10359
|
+
if (additionalInfo === 27) {
|
|
10360
|
+
const value = cursor.dataView.getFloat64(cursor.position, false);
|
|
10361
|
+
cursor.position += 8;
|
|
10362
|
+
return value;
|
|
10363
|
+
}
|
|
10364
|
+
if (additionalInfo === 24) {
|
|
10365
|
+
const simpleValue = cursor.readUint8();
|
|
10366
|
+
if (simpleValue < 32)
|
|
10367
|
+
throw new InvalidSimpleValueError({ value: simpleValue });
|
|
10368
|
+
return;
|
|
10369
|
+
}
|
|
10370
|
+
throw new InvalidAdditionalInfoError({ additionalInfo });
|
|
10371
|
+
}
|
|
10372
|
+
decodeCursor2.readSimpleOrFloat = readSimpleOrFloat;
|
|
10373
|
+
function getFloat16(bits) {
|
|
10374
|
+
const sign = bits >> 15 & 1;
|
|
10375
|
+
const exponent = bits >> 10 & 31;
|
|
10376
|
+
const fraction = bits & 1023;
|
|
10377
|
+
if (exponent === 0) {
|
|
10378
|
+
if (fraction === 0)
|
|
10379
|
+
return sign ? -0 : 0;
|
|
10380
|
+
const value2 = 2 ** -14 * (fraction / 1024);
|
|
10381
|
+
return sign ? -value2 : value2;
|
|
10382
|
+
}
|
|
10383
|
+
if (exponent === 31) {
|
|
10384
|
+
if (fraction === 0)
|
|
10385
|
+
return sign ? -Infinity : Infinity;
|
|
10386
|
+
return NaN;
|
|
10387
|
+
}
|
|
10388
|
+
const value = 2 ** (exponent - 15) * (1 + fraction / 1024);
|
|
10389
|
+
return sign ? -value : value;
|
|
10390
|
+
}
|
|
10391
|
+
})(decodeCursor || (decodeCursor = {}));
|
|
10392
|
+
});
|
|
10393
|
+
|
|
10394
|
+
// node_modules/mppx/node_modules/ox/_esm/core/CompactSize.js
|
|
10395
|
+
var init_CompactSize = () => {};
|
|
10396
|
+
|
|
10397
|
+
// node_modules/mppx/node_modules/ox/_esm/core/ContractAddress.js
|
|
10398
|
+
var init_ContractAddress = () => {};
|
|
10399
|
+
|
|
10400
|
+
// node_modules/mppx/node_modules/ox/_esm/core/CoseKey.js
|
|
10401
|
+
var init_CoseKey = () => {};
|
|
10402
|
+
|
|
10403
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Ed25519.js
|
|
10404
|
+
var init_Ed25519 = () => {};
|
|
10405
|
+
|
|
10406
|
+
// node_modules/@adraffy/ens-normalize/dist/index.mjs
|
|
10407
|
+
var FENCED, S0 = 44032, L0 = 4352, V0 = 4449, T0 = 4519, L_COUNT = 19, V_COUNT = 21, T_COUNT = 28, N_COUNT, S_COUNT, S1, L1, V1, T1;
|
|
10408
|
+
var init_dist = __esm(() => {
|
|
10409
|
+
FENCED = new Map([[8217, "apostrophe"], [8260, "fraction slash"], [12539, "middle dot"]]);
|
|
10410
|
+
N_COUNT = V_COUNT * T_COUNT;
|
|
10411
|
+
S_COUNT = L_COUNT * N_COUNT;
|
|
10412
|
+
S1 = S0 + S_COUNT;
|
|
10413
|
+
L1 = L0 + L_COUNT;
|
|
10414
|
+
V1 = V0 + V_COUNT;
|
|
10415
|
+
T1 = T0 + T_COUNT;
|
|
10416
|
+
});
|
|
10417
|
+
|
|
10418
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Ens.js
|
|
10419
|
+
var init_Ens = __esm(() => {
|
|
10420
|
+
init_dist();
|
|
10421
|
+
});
|
|
10422
|
+
|
|
10423
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Fee.js
|
|
10424
|
+
var init_Fee = () => {};
|
|
10425
|
+
|
|
10426
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Filter.js
|
|
10427
|
+
var init_Filter = () => {};
|
|
10428
|
+
|
|
10429
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Secp256k1.js
|
|
10430
|
+
var init_Secp256k1 = () => {};
|
|
10431
|
+
|
|
10432
|
+
// node_modules/mppx/node_modules/ox/_esm/core/HdKey.js
|
|
10433
|
+
var init_HdKey = () => {};
|
|
10434
|
+
|
|
10435
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Keystore.js
|
|
10436
|
+
var init_Keystore = () => {};
|
|
10437
|
+
|
|
10438
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Log.js
|
|
10439
|
+
var init_Log = () => {};
|
|
10440
|
+
|
|
10441
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Mnemonic.js
|
|
10442
|
+
var init_Mnemonic = () => {};
|
|
10443
|
+
|
|
10444
|
+
// node_modules/mppx/node_modules/ox/_esm/core/P256.js
|
|
10445
|
+
var init_P256 = () => {};
|
|
10446
|
+
|
|
10447
|
+
// node_modules/mppx/node_modules/ox/_esm/core/PersonalMessage.js
|
|
10448
|
+
var init_PersonalMessage = () => {};
|
|
10449
|
+
|
|
10450
|
+
// node_modules/eventemitter3/index.js
|
|
10451
|
+
var require_eventemitter3 = __commonJS((exports, module) => {
|
|
10452
|
+
var has = Object.prototype.hasOwnProperty;
|
|
10453
|
+
var prefix = "~";
|
|
10454
|
+
function Events() {}
|
|
10455
|
+
if (Object.create) {
|
|
10456
|
+
Events.prototype = Object.create(null);
|
|
10457
|
+
if (!new Events().__proto__)
|
|
10458
|
+
prefix = false;
|
|
10459
|
+
}
|
|
10460
|
+
function EE(fn, context, once) {
|
|
10461
|
+
this.fn = fn;
|
|
10462
|
+
this.context = context;
|
|
10463
|
+
this.once = once || false;
|
|
10464
|
+
}
|
|
10465
|
+
function addListener(emitter, event, fn, context, once) {
|
|
10466
|
+
if (typeof fn !== "function") {
|
|
10467
|
+
throw new TypeError("The listener must be a function");
|
|
10468
|
+
}
|
|
10469
|
+
var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
|
|
10470
|
+
if (!emitter._events[evt])
|
|
10471
|
+
emitter._events[evt] = listener, emitter._eventsCount++;
|
|
10472
|
+
else if (!emitter._events[evt].fn)
|
|
10473
|
+
emitter._events[evt].push(listener);
|
|
10474
|
+
else
|
|
10475
|
+
emitter._events[evt] = [emitter._events[evt], listener];
|
|
10476
|
+
return emitter;
|
|
10477
|
+
}
|
|
10478
|
+
function clearEvent(emitter, evt) {
|
|
10479
|
+
if (--emitter._eventsCount === 0)
|
|
10480
|
+
emitter._events = new Events;
|
|
10481
|
+
else
|
|
10482
|
+
delete emitter._events[evt];
|
|
10483
|
+
}
|
|
10484
|
+
function EventEmitter() {
|
|
10485
|
+
this._events = new Events;
|
|
10486
|
+
this._eventsCount = 0;
|
|
10487
|
+
}
|
|
10488
|
+
EventEmitter.prototype.eventNames = function eventNames() {
|
|
10489
|
+
var names = [], events, name;
|
|
10490
|
+
if (this._eventsCount === 0)
|
|
10491
|
+
return names;
|
|
10492
|
+
for (name in events = this._events) {
|
|
10493
|
+
if (has.call(events, name))
|
|
10494
|
+
names.push(prefix ? name.slice(1) : name);
|
|
10495
|
+
}
|
|
10496
|
+
if (Object.getOwnPropertySymbols) {
|
|
10497
|
+
return names.concat(Object.getOwnPropertySymbols(events));
|
|
10498
|
+
}
|
|
10499
|
+
return names;
|
|
10500
|
+
};
|
|
10501
|
+
EventEmitter.prototype.listeners = function listeners(event) {
|
|
10502
|
+
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
|
|
10503
|
+
if (!handlers)
|
|
10504
|
+
return [];
|
|
10505
|
+
if (handlers.fn)
|
|
10506
|
+
return [handlers.fn];
|
|
10507
|
+
for (var i = 0, l = handlers.length, ee = new Array(l);i < l; i++) {
|
|
10508
|
+
ee[i] = handlers[i].fn;
|
|
10509
|
+
}
|
|
10510
|
+
return ee;
|
|
10511
|
+
};
|
|
10512
|
+
EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
|
10513
|
+
var evt = prefix ? prefix + event : event, listeners = this._events[evt];
|
|
10514
|
+
if (!listeners)
|
|
10515
|
+
return 0;
|
|
10516
|
+
if (listeners.fn)
|
|
10517
|
+
return 1;
|
|
10518
|
+
return listeners.length;
|
|
10519
|
+
};
|
|
10520
|
+
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
10521
|
+
var evt = prefix ? prefix + event : event;
|
|
10522
|
+
if (!this._events[evt])
|
|
10523
|
+
return false;
|
|
10524
|
+
var listeners = this._events[evt], len = arguments.length, args, i;
|
|
10525
|
+
if (listeners.fn) {
|
|
10526
|
+
if (listeners.once)
|
|
10527
|
+
this.removeListener(event, listeners.fn, undefined, true);
|
|
10528
|
+
switch (len) {
|
|
10529
|
+
case 1:
|
|
10530
|
+
return listeners.fn.call(listeners.context), true;
|
|
10531
|
+
case 2:
|
|
10532
|
+
return listeners.fn.call(listeners.context, a1), true;
|
|
10533
|
+
case 3:
|
|
10534
|
+
return listeners.fn.call(listeners.context, a1, a2), true;
|
|
10535
|
+
case 4:
|
|
10536
|
+
return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
10537
|
+
case 5:
|
|
10538
|
+
return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
10539
|
+
case 6:
|
|
10540
|
+
return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
10541
|
+
}
|
|
10542
|
+
for (i = 1, args = new Array(len - 1);i < len; i++) {
|
|
10543
|
+
args[i - 1] = arguments[i];
|
|
10544
|
+
}
|
|
10545
|
+
listeners.fn.apply(listeners.context, args);
|
|
10546
|
+
} else {
|
|
10547
|
+
var length = listeners.length, j;
|
|
10548
|
+
for (i = 0;i < length; i++) {
|
|
10549
|
+
if (listeners[i].once)
|
|
10550
|
+
this.removeListener(event, listeners[i].fn, undefined, true);
|
|
10551
|
+
switch (len) {
|
|
10552
|
+
case 1:
|
|
10553
|
+
listeners[i].fn.call(listeners[i].context);
|
|
10554
|
+
break;
|
|
10555
|
+
case 2:
|
|
10556
|
+
listeners[i].fn.call(listeners[i].context, a1);
|
|
10557
|
+
break;
|
|
10558
|
+
case 3:
|
|
10559
|
+
listeners[i].fn.call(listeners[i].context, a1, a2);
|
|
10560
|
+
break;
|
|
10561
|
+
case 4:
|
|
10562
|
+
listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
|
10563
|
+
break;
|
|
10564
|
+
default:
|
|
10565
|
+
if (!args)
|
|
10566
|
+
for (j = 1, args = new Array(len - 1);j < len; j++) {
|
|
10567
|
+
args[j - 1] = arguments[j];
|
|
10568
|
+
}
|
|
10569
|
+
listeners[i].fn.apply(listeners[i].context, args);
|
|
10570
|
+
}
|
|
10571
|
+
}
|
|
10572
|
+
}
|
|
10573
|
+
return true;
|
|
10574
|
+
};
|
|
10575
|
+
EventEmitter.prototype.on = function on(event, fn, context) {
|
|
10576
|
+
return addListener(this, event, fn, context, false);
|
|
10577
|
+
};
|
|
10578
|
+
EventEmitter.prototype.once = function once(event, fn, context) {
|
|
10579
|
+
return addListener(this, event, fn, context, true);
|
|
10580
|
+
};
|
|
10581
|
+
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
10582
|
+
var evt = prefix ? prefix + event : event;
|
|
10583
|
+
if (!this._events[evt])
|
|
10584
|
+
return this;
|
|
10585
|
+
if (!fn) {
|
|
10586
|
+
clearEvent(this, evt);
|
|
10587
|
+
return this;
|
|
10588
|
+
}
|
|
10589
|
+
var listeners = this._events[evt];
|
|
10590
|
+
if (listeners.fn) {
|
|
10591
|
+
if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
|
|
10592
|
+
clearEvent(this, evt);
|
|
10593
|
+
}
|
|
10594
|
+
} else {
|
|
10595
|
+
for (var i = 0, events = [], length = listeners.length;i < length; i++) {
|
|
10596
|
+
if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
|
10597
|
+
events.push(listeners[i]);
|
|
10598
|
+
}
|
|
10599
|
+
}
|
|
10600
|
+
if (events.length)
|
|
10601
|
+
this._events[evt] = events.length === 1 ? events[0] : events;
|
|
10602
|
+
else
|
|
10603
|
+
clearEvent(this, evt);
|
|
10604
|
+
}
|
|
10605
|
+
return this;
|
|
10606
|
+
};
|
|
10607
|
+
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
10608
|
+
var evt;
|
|
10609
|
+
if (event) {
|
|
10610
|
+
evt = prefix ? prefix + event : event;
|
|
10611
|
+
if (this._events[evt])
|
|
10612
|
+
clearEvent(this, evt);
|
|
10613
|
+
} else {
|
|
10614
|
+
this._events = new Events;
|
|
10615
|
+
this._eventsCount = 0;
|
|
10616
|
+
}
|
|
10617
|
+
return this;
|
|
10618
|
+
};
|
|
10619
|
+
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
10620
|
+
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
10621
|
+
EventEmitter.prefixed = prefix;
|
|
10622
|
+
EventEmitter.EventEmitter = EventEmitter;
|
|
10623
|
+
if (typeof module !== "undefined") {
|
|
10624
|
+
module.exports = EventEmitter;
|
|
10625
|
+
}
|
|
10626
|
+
});
|
|
10627
|
+
|
|
10628
|
+
// node_modules/eventemitter3/index.mjs
|
|
10629
|
+
var import__2;
|
|
10630
|
+
var init_eventemitter3 = __esm(() => {
|
|
10631
|
+
import__2 = __toESM(require_eventemitter3(), 1);
|
|
10632
|
+
});
|
|
10633
|
+
|
|
10634
|
+
// node_modules/mppx/node_modules/ox/_esm/core/RpcResponse.js
|
|
10635
|
+
var BaseError2, InvalidInputError2, ResourceNotFoundError, ResourceUnavailableError, TransactionRejectedError, MethodNotSupportedError, LimitExceededError, VersionNotSupportedError, InvalidRequestError, MethodNotFoundError, InvalidParamsError, InternalError, ParseError;
|
|
10636
|
+
var init_RpcResponse = __esm(() => {
|
|
10637
|
+
BaseError2 = class BaseError2 extends Error {
|
|
10638
|
+
constructor(errorObject) {
|
|
10639
|
+
const { cause, code, message, data, stack } = errorObject;
|
|
10640
|
+
super(message, { cause });
|
|
10641
|
+
Object.defineProperty(this, "name", {
|
|
10642
|
+
enumerable: true,
|
|
10643
|
+
configurable: true,
|
|
10644
|
+
writable: true,
|
|
10645
|
+
value: "RpcResponse.BaseError"
|
|
10646
|
+
});
|
|
10647
|
+
Object.defineProperty(this, "cause", {
|
|
10648
|
+
enumerable: true,
|
|
10649
|
+
configurable: true,
|
|
10650
|
+
writable: true,
|
|
10651
|
+
value: undefined
|
|
10652
|
+
});
|
|
10653
|
+
Object.defineProperty(this, "stack", {
|
|
10654
|
+
enumerable: true,
|
|
10655
|
+
configurable: true,
|
|
10656
|
+
writable: true,
|
|
10657
|
+
value: undefined
|
|
10658
|
+
});
|
|
10659
|
+
Object.defineProperty(this, "code", {
|
|
10660
|
+
enumerable: true,
|
|
10661
|
+
configurable: true,
|
|
10662
|
+
writable: true,
|
|
10663
|
+
value: undefined
|
|
10664
|
+
});
|
|
10665
|
+
Object.defineProperty(this, "data", {
|
|
10666
|
+
enumerable: true,
|
|
10667
|
+
configurable: true,
|
|
10668
|
+
writable: true,
|
|
10669
|
+
value: undefined
|
|
10670
|
+
});
|
|
10671
|
+
this.cause = cause;
|
|
10672
|
+
this.code = code;
|
|
10673
|
+
this.data = data;
|
|
10674
|
+
this.stack = stack ?? "";
|
|
10675
|
+
}
|
|
10676
|
+
};
|
|
10677
|
+
InvalidInputError2 = class InvalidInputError2 extends BaseError2 {
|
|
10678
|
+
constructor(parameters = {}) {
|
|
10679
|
+
super({
|
|
10680
|
+
code: InvalidInputError2.code,
|
|
10681
|
+
data: parameters.data,
|
|
10682
|
+
message: parameters.message ?? "Missing or invalid parameters."
|
|
10683
|
+
});
|
|
10684
|
+
Object.defineProperty(this, "code", {
|
|
10685
|
+
enumerable: true,
|
|
10686
|
+
configurable: true,
|
|
10687
|
+
writable: true,
|
|
10688
|
+
value: -32000
|
|
10689
|
+
});
|
|
10690
|
+
Object.defineProperty(this, "name", {
|
|
10691
|
+
enumerable: true,
|
|
10692
|
+
configurable: true,
|
|
10693
|
+
writable: true,
|
|
10694
|
+
value: "RpcResponse.InvalidInputError"
|
|
10695
|
+
});
|
|
10696
|
+
}
|
|
10697
|
+
};
|
|
10698
|
+
Object.defineProperty(InvalidInputError2, "code", {
|
|
10699
|
+
enumerable: true,
|
|
10700
|
+
configurable: true,
|
|
10701
|
+
writable: true,
|
|
10702
|
+
value: -32000
|
|
10703
|
+
});
|
|
10704
|
+
ResourceNotFoundError = class ResourceNotFoundError extends BaseError2 {
|
|
10705
|
+
constructor(parameters = {}) {
|
|
10706
|
+
super({
|
|
10707
|
+
code: ResourceNotFoundError.code,
|
|
10708
|
+
data: parameters.data,
|
|
10709
|
+
message: parameters.message ?? "Requested resource not found."
|
|
10710
|
+
});
|
|
10711
|
+
Object.defineProperty(this, "code", {
|
|
10712
|
+
enumerable: true,
|
|
10713
|
+
configurable: true,
|
|
10714
|
+
writable: true,
|
|
10715
|
+
value: -32001
|
|
10716
|
+
});
|
|
10717
|
+
Object.defineProperty(this, "name", {
|
|
10718
|
+
enumerable: true,
|
|
10719
|
+
configurable: true,
|
|
10720
|
+
writable: true,
|
|
10721
|
+
value: "RpcResponse.ResourceNotFoundError"
|
|
10722
|
+
});
|
|
10723
|
+
}
|
|
10724
|
+
};
|
|
10725
|
+
Object.defineProperty(ResourceNotFoundError, "code", {
|
|
10726
|
+
enumerable: true,
|
|
10727
|
+
configurable: true,
|
|
10728
|
+
writable: true,
|
|
10729
|
+
value: -32001
|
|
10730
|
+
});
|
|
10731
|
+
ResourceUnavailableError = class ResourceUnavailableError extends BaseError2 {
|
|
10732
|
+
constructor(parameters = {}) {
|
|
10733
|
+
super({
|
|
10734
|
+
code: ResourceUnavailableError.code,
|
|
10735
|
+
data: parameters.data,
|
|
10736
|
+
message: parameters.message ?? "Requested resource not available."
|
|
10737
|
+
});
|
|
10738
|
+
Object.defineProperty(this, "code", {
|
|
10739
|
+
enumerable: true,
|
|
10740
|
+
configurable: true,
|
|
10741
|
+
writable: true,
|
|
10742
|
+
value: -32002
|
|
10743
|
+
});
|
|
10744
|
+
Object.defineProperty(this, "name", {
|
|
10745
|
+
enumerable: true,
|
|
10746
|
+
configurable: true,
|
|
10747
|
+
writable: true,
|
|
10748
|
+
value: "RpcResponse.ResourceUnavailableError"
|
|
10749
|
+
});
|
|
10750
|
+
}
|
|
10751
|
+
};
|
|
10752
|
+
Object.defineProperty(ResourceUnavailableError, "code", {
|
|
10753
|
+
enumerable: true,
|
|
10754
|
+
configurable: true,
|
|
10755
|
+
writable: true,
|
|
10756
|
+
value: -32002
|
|
10757
|
+
});
|
|
10758
|
+
TransactionRejectedError = class TransactionRejectedError extends BaseError2 {
|
|
10759
|
+
constructor(parameters = {}) {
|
|
10760
|
+
super({
|
|
10761
|
+
code: TransactionRejectedError.code,
|
|
10762
|
+
data: parameters.data,
|
|
10763
|
+
message: parameters.message ?? "Transaction creation failed."
|
|
10764
|
+
});
|
|
10765
|
+
Object.defineProperty(this, "code", {
|
|
10766
|
+
enumerable: true,
|
|
10767
|
+
configurable: true,
|
|
10768
|
+
writable: true,
|
|
10769
|
+
value: -32003
|
|
10770
|
+
});
|
|
10771
|
+
Object.defineProperty(this, "name", {
|
|
10772
|
+
enumerable: true,
|
|
10773
|
+
configurable: true,
|
|
10774
|
+
writable: true,
|
|
10775
|
+
value: "RpcResponse.TransactionRejectedError"
|
|
10776
|
+
});
|
|
10777
|
+
}
|
|
10778
|
+
};
|
|
10779
|
+
Object.defineProperty(TransactionRejectedError, "code", {
|
|
10780
|
+
enumerable: true,
|
|
10781
|
+
configurable: true,
|
|
10782
|
+
writable: true,
|
|
10783
|
+
value: -32003
|
|
10784
|
+
});
|
|
10785
|
+
MethodNotSupportedError = class MethodNotSupportedError extends BaseError2 {
|
|
10786
|
+
constructor(parameters = {}) {
|
|
10787
|
+
super({
|
|
10788
|
+
code: MethodNotSupportedError.code,
|
|
10789
|
+
data: parameters.data,
|
|
10790
|
+
message: parameters.message ?? "Method is not implemented."
|
|
10791
|
+
});
|
|
10792
|
+
Object.defineProperty(this, "code", {
|
|
10793
|
+
enumerable: true,
|
|
10794
|
+
configurable: true,
|
|
10795
|
+
writable: true,
|
|
10796
|
+
value: -32004
|
|
10797
|
+
});
|
|
10798
|
+
Object.defineProperty(this, "name", {
|
|
10799
|
+
enumerable: true,
|
|
10800
|
+
configurable: true,
|
|
10801
|
+
writable: true,
|
|
10802
|
+
value: "RpcResponse.MethodNotSupportedError"
|
|
10803
|
+
});
|
|
10804
|
+
}
|
|
10805
|
+
};
|
|
10806
|
+
Object.defineProperty(MethodNotSupportedError, "code", {
|
|
10807
|
+
enumerable: true,
|
|
10808
|
+
configurable: true,
|
|
10809
|
+
writable: true,
|
|
10810
|
+
value: -32004
|
|
10811
|
+
});
|
|
10812
|
+
LimitExceededError = class LimitExceededError extends BaseError2 {
|
|
10813
|
+
constructor(parameters = {}) {
|
|
10814
|
+
super({
|
|
10815
|
+
code: LimitExceededError.code,
|
|
10816
|
+
data: parameters.data,
|
|
10817
|
+
message: parameters.message ?? "Rate limit exceeded."
|
|
10818
|
+
});
|
|
10819
|
+
Object.defineProperty(this, "code", {
|
|
10820
|
+
enumerable: true,
|
|
10821
|
+
configurable: true,
|
|
10822
|
+
writable: true,
|
|
10823
|
+
value: -32005
|
|
10824
|
+
});
|
|
10825
|
+
Object.defineProperty(this, "name", {
|
|
10826
|
+
enumerable: true,
|
|
10827
|
+
configurable: true,
|
|
10828
|
+
writable: true,
|
|
10829
|
+
value: "RpcResponse.LimitExceededError"
|
|
10830
|
+
});
|
|
10831
|
+
}
|
|
10832
|
+
};
|
|
10833
|
+
Object.defineProperty(LimitExceededError, "code", {
|
|
10834
|
+
enumerable: true,
|
|
10835
|
+
configurable: true,
|
|
10836
|
+
writable: true,
|
|
10837
|
+
value: -32005
|
|
10838
|
+
});
|
|
10839
|
+
VersionNotSupportedError = class VersionNotSupportedError extends BaseError2 {
|
|
10840
|
+
constructor(parameters = {}) {
|
|
10841
|
+
super({
|
|
10842
|
+
code: VersionNotSupportedError.code,
|
|
10843
|
+
data: parameters.data,
|
|
10844
|
+
message: parameters.message ?? "JSON-RPC version not supported."
|
|
10845
|
+
});
|
|
10846
|
+
Object.defineProperty(this, "code", {
|
|
10847
|
+
enumerable: true,
|
|
10848
|
+
configurable: true,
|
|
10849
|
+
writable: true,
|
|
10850
|
+
value: -32006
|
|
10851
|
+
});
|
|
10852
|
+
Object.defineProperty(this, "name", {
|
|
10853
|
+
enumerable: true,
|
|
10854
|
+
configurable: true,
|
|
10855
|
+
writable: true,
|
|
10856
|
+
value: "RpcResponse.VersionNotSupportedError"
|
|
10857
|
+
});
|
|
10858
|
+
}
|
|
10859
|
+
};
|
|
10860
|
+
Object.defineProperty(VersionNotSupportedError, "code", {
|
|
10861
|
+
enumerable: true,
|
|
10862
|
+
configurable: true,
|
|
10863
|
+
writable: true,
|
|
10864
|
+
value: -32006
|
|
10865
|
+
});
|
|
10866
|
+
InvalidRequestError = class InvalidRequestError extends BaseError2 {
|
|
10867
|
+
constructor(parameters = {}) {
|
|
10868
|
+
super({
|
|
10869
|
+
code: InvalidRequestError.code,
|
|
10870
|
+
data: parameters.data,
|
|
10871
|
+
message: parameters.message ?? "Input is not a valid JSON-RPC request."
|
|
10872
|
+
});
|
|
10873
|
+
Object.defineProperty(this, "code", {
|
|
10874
|
+
enumerable: true,
|
|
10875
|
+
configurable: true,
|
|
10876
|
+
writable: true,
|
|
10877
|
+
value: -32600
|
|
10878
|
+
});
|
|
10879
|
+
Object.defineProperty(this, "name", {
|
|
10880
|
+
enumerable: true,
|
|
10881
|
+
configurable: true,
|
|
10882
|
+
writable: true,
|
|
10883
|
+
value: "RpcResponse.InvalidRequestError"
|
|
10884
|
+
});
|
|
10885
|
+
}
|
|
10886
|
+
};
|
|
10887
|
+
Object.defineProperty(InvalidRequestError, "code", {
|
|
10888
|
+
enumerable: true,
|
|
10889
|
+
configurable: true,
|
|
10890
|
+
writable: true,
|
|
10891
|
+
value: -32600
|
|
10892
|
+
});
|
|
10893
|
+
MethodNotFoundError = class MethodNotFoundError extends BaseError2 {
|
|
10894
|
+
constructor(parameters = {}) {
|
|
10895
|
+
super({
|
|
10896
|
+
code: MethodNotFoundError.code,
|
|
10897
|
+
data: parameters.data,
|
|
10898
|
+
message: parameters.message ?? "Method does not exist."
|
|
10899
|
+
});
|
|
10900
|
+
Object.defineProperty(this, "code", {
|
|
10901
|
+
enumerable: true,
|
|
10902
|
+
configurable: true,
|
|
10903
|
+
writable: true,
|
|
10904
|
+
value: -32601
|
|
10905
|
+
});
|
|
10906
|
+
Object.defineProperty(this, "name", {
|
|
10907
|
+
enumerable: true,
|
|
10908
|
+
configurable: true,
|
|
10909
|
+
writable: true,
|
|
10910
|
+
value: "RpcResponse.MethodNotFoundError"
|
|
10911
|
+
});
|
|
10912
|
+
}
|
|
10913
|
+
};
|
|
10914
|
+
Object.defineProperty(MethodNotFoundError, "code", {
|
|
10915
|
+
enumerable: true,
|
|
10916
|
+
configurable: true,
|
|
10917
|
+
writable: true,
|
|
10918
|
+
value: -32601
|
|
10919
|
+
});
|
|
10920
|
+
InvalidParamsError = class InvalidParamsError extends BaseError2 {
|
|
10921
|
+
constructor(parameters = {}) {
|
|
10922
|
+
super({
|
|
10923
|
+
code: InvalidParamsError.code,
|
|
10924
|
+
data: parameters.data,
|
|
10925
|
+
message: parameters.message ?? "Invalid method parameters."
|
|
10926
|
+
});
|
|
10927
|
+
Object.defineProperty(this, "code", {
|
|
10928
|
+
enumerable: true,
|
|
10929
|
+
configurable: true,
|
|
10930
|
+
writable: true,
|
|
10931
|
+
value: -32602
|
|
10932
|
+
});
|
|
10933
|
+
Object.defineProperty(this, "name", {
|
|
10934
|
+
enumerable: true,
|
|
10935
|
+
configurable: true,
|
|
10936
|
+
writable: true,
|
|
10937
|
+
value: "RpcResponse.InvalidParamsError"
|
|
10938
|
+
});
|
|
10939
|
+
}
|
|
10940
|
+
};
|
|
10941
|
+
Object.defineProperty(InvalidParamsError, "code", {
|
|
10942
|
+
enumerable: true,
|
|
10943
|
+
configurable: true,
|
|
10944
|
+
writable: true,
|
|
10945
|
+
value: -32602
|
|
10946
|
+
});
|
|
10947
|
+
InternalError = class InternalError extends BaseError2 {
|
|
10948
|
+
constructor(parameters = {}) {
|
|
10949
|
+
super({
|
|
10950
|
+
cause: parameters.cause,
|
|
10951
|
+
code: InternalError.code,
|
|
10952
|
+
data: parameters.data,
|
|
10953
|
+
message: parameters.message ?? "Internal JSON-RPC error.",
|
|
10954
|
+
stack: parameters.stack
|
|
10955
|
+
});
|
|
10956
|
+
Object.defineProperty(this, "code", {
|
|
10957
|
+
enumerable: true,
|
|
10958
|
+
configurable: true,
|
|
10959
|
+
writable: true,
|
|
10960
|
+
value: -32603
|
|
10961
|
+
});
|
|
10962
|
+
Object.defineProperty(this, "name", {
|
|
10963
|
+
enumerable: true,
|
|
10964
|
+
configurable: true,
|
|
10965
|
+
writable: true,
|
|
10966
|
+
value: "RpcResponse.InternalError"
|
|
10967
|
+
});
|
|
10968
|
+
}
|
|
10969
|
+
};
|
|
10970
|
+
Object.defineProperty(InternalError, "code", {
|
|
10971
|
+
enumerable: true,
|
|
10972
|
+
configurable: true,
|
|
10973
|
+
writable: true,
|
|
10974
|
+
value: -32603
|
|
10975
|
+
});
|
|
10976
|
+
ParseError = class ParseError extends BaseError2 {
|
|
10977
|
+
constructor(parameters = {}) {
|
|
10978
|
+
super({
|
|
10979
|
+
code: ParseError.code,
|
|
10980
|
+
data: parameters.data,
|
|
10981
|
+
message: parameters.message ?? "Failed to parse JSON-RPC response."
|
|
10982
|
+
});
|
|
10983
|
+
Object.defineProperty(this, "code", {
|
|
10984
|
+
enumerable: true,
|
|
10985
|
+
configurable: true,
|
|
10986
|
+
writable: true,
|
|
10987
|
+
value: -32700
|
|
10988
|
+
});
|
|
10989
|
+
Object.defineProperty(this, "name", {
|
|
10990
|
+
enumerable: true,
|
|
10991
|
+
configurable: true,
|
|
10992
|
+
writable: true,
|
|
10993
|
+
value: "RpcResponse.ParseError"
|
|
10994
|
+
});
|
|
9019
10995
|
}
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
10996
|
+
};
|
|
10997
|
+
Object.defineProperty(ParseError, "code", {
|
|
10998
|
+
enumerable: true,
|
|
10999
|
+
configurable: true,
|
|
11000
|
+
writable: true,
|
|
11001
|
+
value: -32700
|
|
11002
|
+
});
|
|
11003
|
+
});
|
|
11004
|
+
|
|
11005
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Provider.js
|
|
11006
|
+
var ProviderRpcError, UserRejectedRequestError, UnauthorizedError, UnsupportedMethodError, DisconnectedError, ChainDisconnectedError, SwitchChainError, UnsupportedNonOptionalCapabilityError, UnsupportedChainIdError, DuplicateIdError, UnknownBundleIdError, BundleTooLargeError, AtomicReadyWalletRejectedUpgradeError, AtomicityNotSupportedError;
|
|
11007
|
+
var init_Provider = __esm(() => {
|
|
11008
|
+
init_eventemitter3();
|
|
11009
|
+
ProviderRpcError = class ProviderRpcError extends Error {
|
|
11010
|
+
constructor(code, message) {
|
|
11011
|
+
super(message);
|
|
11012
|
+
Object.defineProperty(this, "name", {
|
|
11013
|
+
enumerable: true,
|
|
11014
|
+
configurable: true,
|
|
11015
|
+
writable: true,
|
|
11016
|
+
value: "ProviderRpcError"
|
|
11017
|
+
});
|
|
11018
|
+
Object.defineProperty(this, "code", {
|
|
11019
|
+
enumerable: true,
|
|
11020
|
+
configurable: true,
|
|
11021
|
+
writable: true,
|
|
11022
|
+
value: undefined
|
|
11023
|
+
});
|
|
11024
|
+
Object.defineProperty(this, "details", {
|
|
11025
|
+
enumerable: true,
|
|
11026
|
+
configurable: true,
|
|
11027
|
+
writable: true,
|
|
11028
|
+
value: undefined
|
|
11029
|
+
});
|
|
11030
|
+
this.code = code;
|
|
11031
|
+
this.details = message;
|
|
9035
11032
|
}
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
11033
|
+
};
|
|
11034
|
+
UserRejectedRequestError = class UserRejectedRequestError extends ProviderRpcError {
|
|
11035
|
+
constructor({ message = "The user rejected the request." } = {}) {
|
|
11036
|
+
super(4001, message);
|
|
11037
|
+
Object.defineProperty(this, "code", {
|
|
11038
|
+
enumerable: true,
|
|
11039
|
+
configurable: true,
|
|
11040
|
+
writable: true,
|
|
11041
|
+
value: 4001
|
|
11042
|
+
});
|
|
11043
|
+
Object.defineProperty(this, "name", {
|
|
11044
|
+
enumerable: true,
|
|
11045
|
+
configurable: true,
|
|
11046
|
+
writable: true,
|
|
11047
|
+
value: "Provider.UserRejectedRequestError"
|
|
11048
|
+
});
|
|
9040
11049
|
}
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
11050
|
+
};
|
|
11051
|
+
Object.defineProperty(UserRejectedRequestError, "code", {
|
|
11052
|
+
enumerable: true,
|
|
11053
|
+
configurable: true,
|
|
11054
|
+
writable: true,
|
|
11055
|
+
value: 4001
|
|
11056
|
+
});
|
|
11057
|
+
UnauthorizedError = class UnauthorizedError extends ProviderRpcError {
|
|
11058
|
+
constructor({ message = "The requested method and/or account has not been authorized by the user." } = {}) {
|
|
11059
|
+
super(4100, message);
|
|
11060
|
+
Object.defineProperty(this, "code", {
|
|
11061
|
+
enumerable: true,
|
|
11062
|
+
configurable: true,
|
|
11063
|
+
writable: true,
|
|
11064
|
+
value: 4100
|
|
11065
|
+
});
|
|
11066
|
+
Object.defineProperty(this, "name", {
|
|
11067
|
+
enumerable: true,
|
|
11068
|
+
configurable: true,
|
|
11069
|
+
writable: true,
|
|
11070
|
+
value: "Provider.UnauthorizedError"
|
|
11071
|
+
});
|
|
9044
11072
|
}
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
11073
|
+
};
|
|
11074
|
+
Object.defineProperty(UnauthorizedError, "code", {
|
|
11075
|
+
enumerable: true,
|
|
11076
|
+
configurable: true,
|
|
11077
|
+
writable: true,
|
|
11078
|
+
value: 4100
|
|
11079
|
+
});
|
|
11080
|
+
UnsupportedMethodError = class UnsupportedMethodError extends ProviderRpcError {
|
|
11081
|
+
constructor({ message = "The provider does not support the requested method." } = {}) {
|
|
11082
|
+
super(4200, message);
|
|
11083
|
+
Object.defineProperty(this, "code", {
|
|
11084
|
+
enumerable: true,
|
|
11085
|
+
configurable: true,
|
|
11086
|
+
writable: true,
|
|
11087
|
+
value: 4200
|
|
11088
|
+
});
|
|
11089
|
+
Object.defineProperty(this, "name", {
|
|
11090
|
+
enumerable: true,
|
|
11091
|
+
configurable: true,
|
|
11092
|
+
writable: true,
|
|
11093
|
+
value: "Provider.UnsupportedMethodError"
|
|
11094
|
+
});
|
|
9052
11095
|
}
|
|
9053
|
-
|
|
9054
|
-
|
|
11096
|
+
};
|
|
11097
|
+
Object.defineProperty(UnsupportedMethodError, "code", {
|
|
11098
|
+
enumerable: true,
|
|
11099
|
+
configurable: true,
|
|
11100
|
+
writable: true,
|
|
11101
|
+
value: 4200
|
|
11102
|
+
});
|
|
11103
|
+
DisconnectedError = class DisconnectedError extends ProviderRpcError {
|
|
11104
|
+
constructor({ message = "The provider is disconnected from all chains." } = {}) {
|
|
11105
|
+
super(4900, message);
|
|
11106
|
+
Object.defineProperty(this, "code", {
|
|
11107
|
+
enumerable: true,
|
|
11108
|
+
configurable: true,
|
|
11109
|
+
writable: true,
|
|
11110
|
+
value: 4900
|
|
11111
|
+
});
|
|
11112
|
+
Object.defineProperty(this, "name", {
|
|
11113
|
+
enumerable: true,
|
|
11114
|
+
configurable: true,
|
|
11115
|
+
writable: true,
|
|
11116
|
+
value: "Provider.DisconnectedError"
|
|
11117
|
+
});
|
|
9055
11118
|
}
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
11119
|
+
};
|
|
11120
|
+
Object.defineProperty(DisconnectedError, "code", {
|
|
11121
|
+
enumerable: true,
|
|
11122
|
+
configurable: true,
|
|
11123
|
+
writable: true,
|
|
11124
|
+
value: 4900
|
|
11125
|
+
});
|
|
11126
|
+
ChainDisconnectedError = class ChainDisconnectedError extends ProviderRpcError {
|
|
11127
|
+
constructor({ message = "The provider is not connected to the requested chain." } = {}) {
|
|
11128
|
+
super(4901, message);
|
|
11129
|
+
Object.defineProperty(this, "code", {
|
|
11130
|
+
enumerable: true,
|
|
11131
|
+
configurable: true,
|
|
11132
|
+
writable: true,
|
|
11133
|
+
value: 4901
|
|
11134
|
+
});
|
|
11135
|
+
Object.defineProperty(this, "name", {
|
|
11136
|
+
enumerable: true,
|
|
11137
|
+
configurable: true,
|
|
11138
|
+
writable: true,
|
|
11139
|
+
value: "Provider.ChainDisconnectedError"
|
|
11140
|
+
});
|
|
9059
11141
|
}
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
11142
|
+
};
|
|
11143
|
+
Object.defineProperty(ChainDisconnectedError, "code", {
|
|
11144
|
+
enumerable: true,
|
|
11145
|
+
configurable: true,
|
|
11146
|
+
writable: true,
|
|
11147
|
+
value: 4901
|
|
11148
|
+
});
|
|
11149
|
+
SwitchChainError = class SwitchChainError extends ProviderRpcError {
|
|
11150
|
+
constructor({ message = "An error occurred when attempting to switch chain." } = {}) {
|
|
11151
|
+
super(4902, message);
|
|
11152
|
+
Object.defineProperty(this, "code", {
|
|
11153
|
+
enumerable: true,
|
|
11154
|
+
configurable: true,
|
|
11155
|
+
writable: true,
|
|
11156
|
+
value: 4902
|
|
11157
|
+
});
|
|
11158
|
+
Object.defineProperty(this, "name", {
|
|
11159
|
+
enumerable: true,
|
|
11160
|
+
configurable: true,
|
|
11161
|
+
writable: true,
|
|
11162
|
+
value: "Provider.SwitchChainError"
|
|
11163
|
+
});
|
|
9073
11164
|
}
|
|
9074
11165
|
};
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
1925078388,
|
|
9097
|
-
2162078206,
|
|
9098
|
-
2614888103,
|
|
9099
|
-
3248222580,
|
|
9100
|
-
3835390401,
|
|
9101
|
-
4022224774,
|
|
9102
|
-
264347078,
|
|
9103
|
-
604807628,
|
|
9104
|
-
770255983,
|
|
9105
|
-
1249150122,
|
|
9106
|
-
1555081692,
|
|
9107
|
-
1996064986,
|
|
9108
|
-
2554220882,
|
|
9109
|
-
2821834349,
|
|
9110
|
-
2952996808,
|
|
9111
|
-
3210313671,
|
|
9112
|
-
3336571891,
|
|
9113
|
-
3584528711,
|
|
9114
|
-
113926993,
|
|
9115
|
-
338241895,
|
|
9116
|
-
666307205,
|
|
9117
|
-
773529912,
|
|
9118
|
-
1294757372,
|
|
9119
|
-
1396182291,
|
|
9120
|
-
1695183700,
|
|
9121
|
-
1986661051,
|
|
9122
|
-
2177026350,
|
|
9123
|
-
2456956037,
|
|
9124
|
-
2730485921,
|
|
9125
|
-
2820302411,
|
|
9126
|
-
3259730800,
|
|
9127
|
-
3345764771,
|
|
9128
|
-
3516065817,
|
|
9129
|
-
3600352804,
|
|
9130
|
-
4094571909,
|
|
9131
|
-
275423344,
|
|
9132
|
-
430227734,
|
|
9133
|
-
506948616,
|
|
9134
|
-
659060556,
|
|
9135
|
-
883997877,
|
|
9136
|
-
958139571,
|
|
9137
|
-
1322822218,
|
|
9138
|
-
1537002063,
|
|
9139
|
-
1747873779,
|
|
9140
|
-
1955562222,
|
|
9141
|
-
2024104815,
|
|
9142
|
-
2227730452,
|
|
9143
|
-
2361852424,
|
|
9144
|
-
2428436474,
|
|
9145
|
-
2756734187,
|
|
9146
|
-
3204031479,
|
|
9147
|
-
3329325298
|
|
9148
|
-
]);
|
|
9149
|
-
SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
9150
|
-
SHA256 = class SHA256 extends HashMD {
|
|
9151
|
-
constructor(outputLen = 32) {
|
|
9152
|
-
super(64, outputLen, 8, false);
|
|
9153
|
-
this.A = SHA256_IV[0] | 0;
|
|
9154
|
-
this.B = SHA256_IV[1] | 0;
|
|
9155
|
-
this.C = SHA256_IV[2] | 0;
|
|
9156
|
-
this.D = SHA256_IV[3] | 0;
|
|
9157
|
-
this.E = SHA256_IV[4] | 0;
|
|
9158
|
-
this.F = SHA256_IV[5] | 0;
|
|
9159
|
-
this.G = SHA256_IV[6] | 0;
|
|
9160
|
-
this.H = SHA256_IV[7] | 0;
|
|
11166
|
+
Object.defineProperty(SwitchChainError, "code", {
|
|
11167
|
+
enumerable: true,
|
|
11168
|
+
configurable: true,
|
|
11169
|
+
writable: true,
|
|
11170
|
+
value: 4902
|
|
11171
|
+
});
|
|
11172
|
+
UnsupportedNonOptionalCapabilityError = class UnsupportedNonOptionalCapabilityError extends ProviderRpcError {
|
|
11173
|
+
constructor({ message = "This Wallet does not support a capability that was not marked as optional." } = {}) {
|
|
11174
|
+
super(5700, message);
|
|
11175
|
+
Object.defineProperty(this, "code", {
|
|
11176
|
+
enumerable: true,
|
|
11177
|
+
configurable: true,
|
|
11178
|
+
writable: true,
|
|
11179
|
+
value: 5700
|
|
11180
|
+
});
|
|
11181
|
+
Object.defineProperty(this, "name", {
|
|
11182
|
+
enumerable: true,
|
|
11183
|
+
configurable: true,
|
|
11184
|
+
writable: true,
|
|
11185
|
+
value: "Provider.UnsupportedNonOptionalCapabilityError"
|
|
11186
|
+
});
|
|
9161
11187
|
}
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
11188
|
+
};
|
|
11189
|
+
Object.defineProperty(UnsupportedNonOptionalCapabilityError, "code", {
|
|
11190
|
+
enumerable: true,
|
|
11191
|
+
configurable: true,
|
|
11192
|
+
writable: true,
|
|
11193
|
+
value: 5700
|
|
11194
|
+
});
|
|
11195
|
+
UnsupportedChainIdError = class UnsupportedChainIdError extends ProviderRpcError {
|
|
11196
|
+
constructor({ message = "This Wallet does not support the requested chain ID." } = {}) {
|
|
11197
|
+
super(5710, message);
|
|
11198
|
+
Object.defineProperty(this, "code", {
|
|
11199
|
+
enumerable: true,
|
|
11200
|
+
configurable: true,
|
|
11201
|
+
writable: true,
|
|
11202
|
+
value: 5710
|
|
11203
|
+
});
|
|
11204
|
+
Object.defineProperty(this, "name", {
|
|
11205
|
+
enumerable: true,
|
|
11206
|
+
configurable: true,
|
|
11207
|
+
writable: true,
|
|
11208
|
+
value: "Provider.UnsupportedChainIdError"
|
|
11209
|
+
});
|
|
9165
11210
|
}
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
11211
|
+
};
|
|
11212
|
+
Object.defineProperty(UnsupportedChainIdError, "code", {
|
|
11213
|
+
enumerable: true,
|
|
11214
|
+
configurable: true,
|
|
11215
|
+
writable: true,
|
|
11216
|
+
value: 5710
|
|
11217
|
+
});
|
|
11218
|
+
DuplicateIdError = class DuplicateIdError extends ProviderRpcError {
|
|
11219
|
+
constructor({ message = "There is already a bundle submitted with this ID." } = {}) {
|
|
11220
|
+
super(5720, message);
|
|
11221
|
+
Object.defineProperty(this, "code", {
|
|
11222
|
+
enumerable: true,
|
|
11223
|
+
configurable: true,
|
|
11224
|
+
writable: true,
|
|
11225
|
+
value: 5720
|
|
11226
|
+
});
|
|
11227
|
+
Object.defineProperty(this, "name", {
|
|
11228
|
+
enumerable: true,
|
|
11229
|
+
configurable: true,
|
|
11230
|
+
writable: true,
|
|
11231
|
+
value: "Provider.DuplicateIdError"
|
|
11232
|
+
});
|
|
9175
11233
|
}
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
B = A;
|
|
9199
|
-
A = T1 + T2 | 0;
|
|
9200
|
-
}
|
|
9201
|
-
A = A + this.A | 0;
|
|
9202
|
-
B = B + this.B | 0;
|
|
9203
|
-
C = C + this.C | 0;
|
|
9204
|
-
D2 = D2 + this.D | 0;
|
|
9205
|
-
E = E + this.E | 0;
|
|
9206
|
-
F = F + this.F | 0;
|
|
9207
|
-
G = G + this.G | 0;
|
|
9208
|
-
H = H + this.H | 0;
|
|
9209
|
-
this.set(A, B, C, D2, E, F, G, H);
|
|
11234
|
+
};
|
|
11235
|
+
Object.defineProperty(DuplicateIdError, "code", {
|
|
11236
|
+
enumerable: true,
|
|
11237
|
+
configurable: true,
|
|
11238
|
+
writable: true,
|
|
11239
|
+
value: 5720
|
|
11240
|
+
});
|
|
11241
|
+
UnknownBundleIdError = class UnknownBundleIdError extends ProviderRpcError {
|
|
11242
|
+
constructor({ message = "This bundle id is unknown / has not been submitted." } = {}) {
|
|
11243
|
+
super(5730, message);
|
|
11244
|
+
Object.defineProperty(this, "code", {
|
|
11245
|
+
enumerable: true,
|
|
11246
|
+
configurable: true,
|
|
11247
|
+
writable: true,
|
|
11248
|
+
value: 5730
|
|
11249
|
+
});
|
|
11250
|
+
Object.defineProperty(this, "name", {
|
|
11251
|
+
enumerable: true,
|
|
11252
|
+
configurable: true,
|
|
11253
|
+
writable: true,
|
|
11254
|
+
value: "Provider.UnknownBundleIdError"
|
|
11255
|
+
});
|
|
9210
11256
|
}
|
|
9211
|
-
|
|
9212
|
-
|
|
11257
|
+
};
|
|
11258
|
+
Object.defineProperty(UnknownBundleIdError, "code", {
|
|
11259
|
+
enumerable: true,
|
|
11260
|
+
configurable: true,
|
|
11261
|
+
writable: true,
|
|
11262
|
+
value: 5730
|
|
11263
|
+
});
|
|
11264
|
+
BundleTooLargeError = class BundleTooLargeError extends ProviderRpcError {
|
|
11265
|
+
constructor({ message = "The call bundle is too large for the Wallet to process." } = {}) {
|
|
11266
|
+
super(5740, message);
|
|
11267
|
+
Object.defineProperty(this, "code", {
|
|
11268
|
+
enumerable: true,
|
|
11269
|
+
configurable: true,
|
|
11270
|
+
writable: true,
|
|
11271
|
+
value: 5740
|
|
11272
|
+
});
|
|
11273
|
+
Object.defineProperty(this, "name", {
|
|
11274
|
+
enumerable: true,
|
|
11275
|
+
configurable: true,
|
|
11276
|
+
writable: true,
|
|
11277
|
+
value: "Provider.BundleTooLargeError"
|
|
11278
|
+
});
|
|
9213
11279
|
}
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
11280
|
+
};
|
|
11281
|
+
Object.defineProperty(BundleTooLargeError, "code", {
|
|
11282
|
+
enumerable: true,
|
|
11283
|
+
configurable: true,
|
|
11284
|
+
writable: true,
|
|
11285
|
+
value: 5740
|
|
11286
|
+
});
|
|
11287
|
+
AtomicReadyWalletRejectedUpgradeError = class AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError {
|
|
11288
|
+
constructor({ message = "The Wallet can support atomicity after an upgrade, but the user rejected the upgrade." } = {}) {
|
|
11289
|
+
super(5750, message);
|
|
11290
|
+
Object.defineProperty(this, "code", {
|
|
11291
|
+
enumerable: true,
|
|
11292
|
+
configurable: true,
|
|
11293
|
+
writable: true,
|
|
11294
|
+
value: 5750
|
|
11295
|
+
});
|
|
11296
|
+
Object.defineProperty(this, "name", {
|
|
11297
|
+
enumerable: true,
|
|
11298
|
+
configurable: true,
|
|
11299
|
+
writable: true,
|
|
11300
|
+
value: "Provider.AtomicReadyWalletRejectedUpgradeError"
|
|
11301
|
+
});
|
|
9217
11302
|
}
|
|
9218
11303
|
};
|
|
9219
|
-
|
|
11304
|
+
Object.defineProperty(AtomicReadyWalletRejectedUpgradeError, "code", {
|
|
11305
|
+
enumerable: true,
|
|
11306
|
+
configurable: true,
|
|
11307
|
+
writable: true,
|
|
11308
|
+
value: 5750
|
|
11309
|
+
});
|
|
11310
|
+
AtomicityNotSupportedError = class AtomicityNotSupportedError extends ProviderRpcError {
|
|
11311
|
+
constructor({ message = "The wallet does not support atomic execution but the request requires it." } = {}) {
|
|
11312
|
+
super(5760, message);
|
|
11313
|
+
Object.defineProperty(this, "code", {
|
|
11314
|
+
enumerable: true,
|
|
11315
|
+
configurable: true,
|
|
11316
|
+
writable: true,
|
|
11317
|
+
value: 5760
|
|
11318
|
+
});
|
|
11319
|
+
Object.defineProperty(this, "name", {
|
|
11320
|
+
enumerable: true,
|
|
11321
|
+
configurable: true,
|
|
11322
|
+
writable: true,
|
|
11323
|
+
value: "Provider.AtomicityNotSupportedError"
|
|
11324
|
+
});
|
|
11325
|
+
}
|
|
11326
|
+
};
|
|
11327
|
+
Object.defineProperty(AtomicityNotSupportedError, "code", {
|
|
11328
|
+
enumerable: true,
|
|
11329
|
+
configurable: true,
|
|
11330
|
+
writable: true,
|
|
11331
|
+
value: 5760
|
|
11332
|
+
});
|
|
9220
11333
|
});
|
|
9221
11334
|
|
|
9222
|
-
// node_modules
|
|
9223
|
-
var
|
|
9224
|
-
var init_sha256 = __esm(() => {
|
|
9225
|
-
init_sha2();
|
|
9226
|
-
sha2562 = sha256;
|
|
9227
|
-
});
|
|
11335
|
+
// node_modules/mppx/node_modules/ox/_esm/core/RpcTransport.js
|
|
11336
|
+
var init_RpcTransport = () => {};
|
|
9228
11337
|
|
|
9229
|
-
// node_modules/mppx/node_modules/ox/_esm/core/
|
|
9230
|
-
var
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
}
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
var
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
});
|
|
11338
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Siwe.js
|
|
11339
|
+
var init_Siwe = () => {};
|
|
11340
|
+
|
|
11341
|
+
// node_modules/mppx/node_modules/ox/_esm/core/StateOverrides.js
|
|
11342
|
+
var init_StateOverrides = () => {};
|
|
11343
|
+
|
|
11344
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TransactionReceipt.js
|
|
11345
|
+
var init_TransactionReceipt = () => {};
|
|
11346
|
+
|
|
11347
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TransactionRequest.js
|
|
11348
|
+
var init_TransactionRequest = () => {};
|
|
11349
|
+
|
|
11350
|
+
// node_modules/mppx/node_modules/ox/_esm/core/Value.js
|
|
11351
|
+
var init_Value = () => {};
|
|
11352
|
+
|
|
11353
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TxEnvelope.js
|
|
11354
|
+
var init_TxEnvelope = () => {};
|
|
11355
|
+
|
|
11356
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TxEnvelopeEip1559.js
|
|
11357
|
+
var init_TxEnvelopeEip1559 = () => {};
|
|
11358
|
+
|
|
11359
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TxEnvelopeEip2930.js
|
|
11360
|
+
var init_TxEnvelopeEip2930 = () => {};
|
|
11361
|
+
|
|
11362
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TxEnvelopeEip4844.js
|
|
11363
|
+
var init_TxEnvelopeEip4844 = () => {};
|
|
11364
|
+
|
|
11365
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TxEnvelopeEip7702.js
|
|
11366
|
+
var init_TxEnvelopeEip7702 = () => {};
|
|
11367
|
+
|
|
11368
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TxEnvelopeLegacy.js
|
|
11369
|
+
var init_TxEnvelopeLegacy = () => {};
|
|
11370
|
+
|
|
11371
|
+
// node_modules/mppx/node_modules/ox/_esm/core/TypedData.js
|
|
11372
|
+
var init_TypedData = () => {};
|
|
11373
|
+
|
|
11374
|
+
// node_modules/mppx/node_modules/ox/_esm/core/ValidatorData.js
|
|
11375
|
+
var init_ValidatorData = () => {};
|
|
11376
|
+
|
|
11377
|
+
// node_modules/mppx/node_modules/ox/_esm/core/WebAuthnP256.js
|
|
11378
|
+
var init_WebAuthnP256 = () => {};
|
|
11379
|
+
|
|
11380
|
+
// node_modules/mppx/node_modules/ox/_esm/core/WebCryptoP256.js
|
|
11381
|
+
var init_WebCryptoP256 = () => {};
|
|
11382
|
+
|
|
11383
|
+
// node_modules/mppx/node_modules/ox/_esm/core/X25519.js
|
|
11384
|
+
var init_X25519 = () => {};
|
|
9277
11385
|
|
|
9278
11386
|
// node_modules/mppx/node_modules/ox/_esm/index.js
|
|
9279
11387
|
var init__esm = __esm(() => {
|
|
11388
|
+
init_Abi();
|
|
11389
|
+
init_AbiConstructor();
|
|
11390
|
+
init_AbiError();
|
|
11391
|
+
init_AbiEvent();
|
|
11392
|
+
init_AbiFunction();
|
|
11393
|
+
init_AbiItem();
|
|
11394
|
+
init_AbiParameters();
|
|
11395
|
+
init_AccessList();
|
|
11396
|
+
init_AccountProof();
|
|
11397
|
+
init_Address();
|
|
11398
|
+
init_AesGcm();
|
|
11399
|
+
init_Authorization();
|
|
11400
|
+
init_Base32();
|
|
11401
|
+
init_Base58();
|
|
9280
11402
|
init_Base64();
|
|
11403
|
+
init_Bech32m();
|
|
11404
|
+
init_BinaryStateTree();
|
|
11405
|
+
init_Blobs();
|
|
11406
|
+
init_Block();
|
|
11407
|
+
init_BlockOverrides();
|
|
11408
|
+
init_Bloom();
|
|
11409
|
+
init_Bls();
|
|
11410
|
+
init_BlsPoint();
|
|
9281
11411
|
init_Bytes();
|
|
11412
|
+
init_Caches();
|
|
11413
|
+
init_Cbor();
|
|
11414
|
+
init_CompactSize();
|
|
11415
|
+
init_ContractAddress();
|
|
11416
|
+
init_CoseKey();
|
|
11417
|
+
init_Ed25519();
|
|
11418
|
+
init_Ens();
|
|
11419
|
+
init_Errors();
|
|
11420
|
+
init_Fee();
|
|
11421
|
+
init_Filter();
|
|
9282
11422
|
init_Hash();
|
|
11423
|
+
init_HdKey();
|
|
9283
11424
|
init_Hex();
|
|
11425
|
+
init_Keystore();
|
|
11426
|
+
init_Log();
|
|
11427
|
+
init_Mnemonic();
|
|
11428
|
+
init_P256();
|
|
11429
|
+
init_PersonalMessage();
|
|
11430
|
+
init_Provider();
|
|
11431
|
+
init_PublicKey();
|
|
11432
|
+
init_Rlp();
|
|
11433
|
+
init_RpcResponse();
|
|
11434
|
+
init_RpcTransport();
|
|
11435
|
+
init_Secp256k1();
|
|
11436
|
+
init_Signature();
|
|
11437
|
+
init_Siwe();
|
|
11438
|
+
init_Solidity();
|
|
11439
|
+
init_StateOverrides();
|
|
11440
|
+
init_Transaction();
|
|
11441
|
+
init_TransactionReceipt();
|
|
11442
|
+
init_TransactionRequest();
|
|
11443
|
+
init_TxEnvelope();
|
|
11444
|
+
init_TxEnvelopeEip1559();
|
|
11445
|
+
init_TxEnvelopeEip2930();
|
|
11446
|
+
init_TxEnvelopeEip4844();
|
|
11447
|
+
init_TxEnvelopeEip7702();
|
|
11448
|
+
init_TxEnvelopeLegacy();
|
|
11449
|
+
init_TypedData();
|
|
11450
|
+
init_ValidatorData();
|
|
11451
|
+
init_Value();
|
|
11452
|
+
init_WebAuthnP256();
|
|
11453
|
+
init_WebCryptoP256();
|
|
11454
|
+
init_Withdrawal();
|
|
11455
|
+
init_X25519();
|
|
9284
11456
|
});
|
|
9285
11457
|
|
|
11458
|
+
// node_modules/mppx/dist/BodyDigest.js
|
|
11459
|
+
var init_BodyDigest = () => {};
|
|
11460
|
+
|
|
9286
11461
|
// node_modules/mppx/dist/PaymentRequest.js
|
|
9287
11462
|
function deserialize(encoded) {
|
|
9288
11463
|
const json = exports_Base64.toString(encoded);
|
|
@@ -9433,7 +11608,7 @@ __export(exports_util, {
|
|
|
9433
11608
|
assertNever: () => assertNever,
|
|
9434
11609
|
assertIs: () => assertIs,
|
|
9435
11610
|
assertEqual: () => assertEqual,
|
|
9436
|
-
assert: () =>
|
|
11611
|
+
assert: () => assert4,
|
|
9437
11612
|
allowsEval: () => allowsEval,
|
|
9438
11613
|
aborted: () => aborted,
|
|
9439
11614
|
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
@@ -9450,7 +11625,7 @@ function assertIs(_arg) {}
|
|
|
9450
11625
|
function assertNever(_x) {
|
|
9451
11626
|
throw new Error("Unexpected value in exhaustive check");
|
|
9452
11627
|
}
|
|
9453
|
-
function
|
|
11628
|
+
function assert4(_) {}
|
|
9454
11629
|
function getEnumValues(entries) {
|
|
9455
11630
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
9456
11631
|
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -19992,7 +22167,7 @@ function finalize(ctx, schema) {
|
|
|
19992
22167
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
19993
22168
|
} else if (ctx.target === "draft-04") {
|
|
19994
22169
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
19995
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
22170
|
+
} else if (ctx.target === "openapi-3.0") {} else {}
|
|
19996
22171
|
if (ctx.external?.uri) {
|
|
19997
22172
|
const id = ctx.external.registry.get(schema)?.id;
|
|
19998
22173
|
if (!id)
|
|
@@ -20257,7 +22432,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
20257
22432
|
if (val === undefined) {
|
|
20258
22433
|
if (ctx.unrepresentable === "throw") {
|
|
20259
22434
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
20260
|
-
}
|
|
22435
|
+
} else {}
|
|
20261
22436
|
} else if (typeof val === "bigint") {
|
|
20262
22437
|
if (ctx.unrepresentable === "throw") {
|
|
20263
22438
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -22670,6 +24845,12 @@ var init_Credential = __esm(() => {
|
|
|
22670
24845
|
};
|
|
22671
24846
|
});
|
|
22672
24847
|
|
|
24848
|
+
// node_modules/mppx/dist/Errors.js
|
|
24849
|
+
var init_Errors2 = () => {};
|
|
24850
|
+
|
|
24851
|
+
// node_modules/mppx/dist/Expires.js
|
|
24852
|
+
var init_Expires = () => {};
|
|
24853
|
+
|
|
22673
24854
|
// node_modules/mppx/dist/Method.js
|
|
22674
24855
|
var exports_Method = {};
|
|
22675
24856
|
__export(exports_Method, {
|
|
@@ -22701,9 +24882,32 @@ function toServer(method, options2) {
|
|
|
22701
24882
|
};
|
|
22702
24883
|
}
|
|
22703
24884
|
|
|
24885
|
+
// node_modules/mppx/dist/Receipt.js
|
|
24886
|
+
var Schema2;
|
|
24887
|
+
var init_Receipt = __esm(() => {
|
|
24888
|
+
init_zod();
|
|
24889
|
+
Schema2 = object({
|
|
24890
|
+
method: string2(),
|
|
24891
|
+
reference: string2(),
|
|
24892
|
+
externalId: optional(string2()),
|
|
24893
|
+
status: literal("success"),
|
|
24894
|
+
timestamp: datetime3()
|
|
24895
|
+
});
|
|
24896
|
+
});
|
|
24897
|
+
|
|
24898
|
+
// node_modules/mppx/dist/Store.js
|
|
24899
|
+
var init_Store = () => {};
|
|
24900
|
+
|
|
22704
24901
|
// node_modules/mppx/dist/index.js
|
|
22705
|
-
var
|
|
24902
|
+
var init_dist2 = __esm(() => {
|
|
24903
|
+
init_BodyDigest();
|
|
24904
|
+
init_Challenge();
|
|
22706
24905
|
init_Credential();
|
|
24906
|
+
init_Errors2();
|
|
24907
|
+
init_Expires();
|
|
24908
|
+
init_PaymentRequest();
|
|
24909
|
+
init_Receipt();
|
|
24910
|
+
init_Store();
|
|
22707
24911
|
init_zod();
|
|
22708
24912
|
});
|
|
22709
24913
|
|
|
@@ -22720,7 +24924,7 @@ var init_constants = __esm(() => {
|
|
|
22720
24924
|
// node_modules/@solana/mpp/dist/Methods.js
|
|
22721
24925
|
var charge;
|
|
22722
24926
|
var init_Methods = __esm(() => {
|
|
22723
|
-
|
|
24927
|
+
init_dist2();
|
|
22724
24928
|
charge = exports_Method.from({
|
|
22725
24929
|
intent: "charge",
|
|
22726
24930
|
name: "solana",
|
|
@@ -22911,7 +25115,7 @@ var init_Charge = __esm(() => {
|
|
|
22911
25115
|
init_src();
|
|
22912
25116
|
init_src2();
|
|
22913
25117
|
init_src3();
|
|
22914
|
-
|
|
25118
|
+
init_dist2();
|
|
22915
25119
|
init_constants();
|
|
22916
25120
|
init_Methods();
|
|
22917
25121
|
});
|
|
@@ -23095,7 +25299,9 @@ var init_Mppx = __esm(() => {
|
|
|
23095
25299
|
|
|
23096
25300
|
// node_modules/mppx/dist/client/index.js
|
|
23097
25301
|
var init_client = __esm(() => {
|
|
25302
|
+
init_Expires();
|
|
23098
25303
|
init_Mppx();
|
|
25304
|
+
init_Transport();
|
|
23099
25305
|
});
|
|
23100
25306
|
|
|
23101
25307
|
// node_modules/@solana/mpp/dist/client/index.js
|
|
@@ -27521,18 +29727,18 @@ async function uploadCreateInput(auth, source, kind) {
|
|
|
27521
29727
|
if (file2.size > config2.maxBytes) {
|
|
27522
29728
|
throw new Error(`"${source}" is ${file2.size} bytes; the ${kind} limit is ${config2.maxBytes} bytes (${KIND_ACCEPTS[kind]}).`);
|
|
27523
29729
|
}
|
|
27524
|
-
const
|
|
29730
|
+
const session = await amikoWebFetch(auth, "/api/create/uploads", {
|
|
27525
29731
|
method: "POST",
|
|
27526
29732
|
body: { contentType: mime, sizeBytes: file2.size },
|
|
27527
29733
|
timeoutMs: 30000
|
|
27528
29734
|
});
|
|
27529
|
-
if (!
|
|
29735
|
+
if (!session.uploadUrl || !session.path) {
|
|
27530
29736
|
throw new Error(`Could not start the upload for "${source}".`);
|
|
27531
29737
|
}
|
|
27532
|
-
await presignedPut(
|
|
29738
|
+
await presignedPut(session.uploadUrl, file2.buffer, mime);
|
|
27533
29739
|
const finalized = await amikoWebFetch(auth, "/api/create/uploads", {
|
|
27534
29740
|
method: "PUT",
|
|
27535
|
-
body: { path:
|
|
29741
|
+
body: { path: session.path },
|
|
27536
29742
|
timeoutMs: 30000
|
|
27537
29743
|
});
|
|
27538
29744
|
if (!finalized.url) {
|
|
@@ -33814,7 +36020,7 @@ function registerPostCommand(program2) {
|
|
|
33814
36020
|
process.exit(1);
|
|
33815
36021
|
}
|
|
33816
36022
|
});
|
|
33817
|
-
program2.command("drafts").description("List
|
|
36023
|
+
program2.command("drafts").description("List draft posts (newest first). Defaults to only YOUR OWN drafts (this twin's). Pass --all to include the owner's own drafts and other twins'.").option("--limit <n>", "Max results (1-100, default 20)", "20").option("--offset <n>", "Pagination offset", "0").option("--all", "Include every draft the owner holds — the owner's own composer drafts and other twins' — not just this twin's").option("--json", "Output as JSON").action(async (opts) => {
|
|
33818
36024
|
const limit = Number(opts.limit ?? "20");
|
|
33819
36025
|
const offset = Number(opts.offset ?? "0");
|
|
33820
36026
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
@@ -33832,14 +36038,15 @@ function registerPostCommand(program2) {
|
|
|
33832
36038
|
query: {
|
|
33833
36039
|
status: "draft",
|
|
33834
36040
|
limit,
|
|
33835
|
-
offset
|
|
36041
|
+
offset,
|
|
36042
|
+
...opts.all ? { all: "true" } : {}
|
|
33836
36043
|
}
|
|
33837
36044
|
});
|
|
33838
36045
|
spinner?.stop();
|
|
33839
36046
|
const posts = data.posts ?? [];
|
|
33840
36047
|
renderOutput(data, () => {
|
|
33841
36048
|
if (posts.length === 0) {
|
|
33842
|
-
console.log(dim('No drafts. Save one with: amiko post create --content "..." --draft'));
|
|
36049
|
+
console.log(dim(opts.all ? 'No drafts. Save one with: amiko post create --content "..." --draft' : `No drafts of yours. Save one with: amiko post create --content "..." --draft (or --all to see the owner's own drafts)`));
|
|
33843
36050
|
return;
|
|
33844
36051
|
}
|
|
33845
36052
|
console.log(heading(`Drafts — ${posts.length}`));
|