@gardenfi/utils 2.4.6-beta.1 → 2.4.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +2 -2
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +2 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +3 -3
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +2 -2
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +1 -1
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +3 -3
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +2 -2
- package/dist/index262.cjs +2 -1
- package/dist/index262.js +40 -102
- package/dist/index263.cjs +1 -1
- package/dist/index263.js +2 -7
- package/dist/index264.cjs +1 -1
- package/dist/index264.js +5 -224
- package/dist/index265.cjs +1 -1
- package/dist/index265.js +10 -6
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +20 -7
- package/dist/index267.cjs +1 -1
- package/dist/index267.js +8 -26
- package/dist/index268.cjs +1 -1
- package/dist/index268.js +66 -5
- package/dist/index269.cjs +1 -2
- package/dist/index269.js +64 -40
- package/dist/index270.cjs +1 -1
- package/dist/index270.js +187 -2
- package/dist/index271.cjs +1 -1
- package/dist/index271.js +20 -8
- package/dist/index272.cjs +1 -1
- package/dist/index272.js +40 -17
- package/dist/index273.cjs +1 -1
- package/dist/index273.js +76 -8
- package/dist/index274.cjs +1 -1
- package/dist/index274.js +40 -66
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +15 -64
- package/dist/index276.cjs +1 -1
- package/dist/index276.js +12 -185
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +11 -21
- package/dist/index278.cjs +2 -1
- package/dist/index278.js +18 -42
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +13 -75
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +31 -27
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +11 -40
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +6 -16
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +7 -14
- package/dist/index283.cjs +1 -1
- package/dist/index283.js +25 -11
- package/dist/index284.cjs +1 -2
- package/dist/index284.js +19 -18
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +145 -13
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +103 -11
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +6 -19
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +219 -141
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +12 -8
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +2 -2
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +41 -10
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +77 -18
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +2 -43
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +10 -77
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +20 -2
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +27 -31
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +68 -698
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +685 -126
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +124 -186
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +200 -67
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +8 -12
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +1 -1
- package/package.json +1 -1
package/dist/index279.js
CHANGED
|
@@ -1,79 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
class s extends t {
|
|
15
|
-
constructor({ param: e, name: r }) {
|
|
16
|
-
super("Invalid ABI parameter.", {
|
|
17
|
-
details: e,
|
|
18
|
-
metaMessages: [
|
|
19
|
-
`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`
|
|
20
|
-
]
|
|
21
|
-
}), Object.defineProperty(this, "name", {
|
|
22
|
-
enumerable: !0,
|
|
23
|
-
configurable: !0,
|
|
24
|
-
writable: !0,
|
|
25
|
-
value: "SolidityProtectedKeywordError"
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
class l extends t {
|
|
30
|
-
constructor({ param: e, type: r, modifier: i }) {
|
|
31
|
-
super("Invalid ABI parameter.", {
|
|
32
|
-
details: e,
|
|
33
|
-
metaMessages: [
|
|
34
|
-
`Modifier "${i}" not allowed${r ? ` in "${r}" type` : ""}.`
|
|
35
|
-
]
|
|
36
|
-
}), Object.defineProperty(this, "name", {
|
|
37
|
-
enumerable: !0,
|
|
38
|
-
configurable: !0,
|
|
39
|
-
writable: !0,
|
|
40
|
-
value: "InvalidModifierError"
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
class d extends t {
|
|
45
|
-
constructor({ param: e, type: r, modifier: i }) {
|
|
46
|
-
super("Invalid ABI parameter.", {
|
|
47
|
-
details: e,
|
|
48
|
-
metaMessages: [
|
|
49
|
-
`Modifier "${i}" not allowed${r ? ` in "${r}" type` : ""}.`,
|
|
50
|
-
`Data location can only be specified for array, struct, or mapping types, but "${i}" was given.`
|
|
51
|
-
]
|
|
52
|
-
}), Object.defineProperty(this, "name", {
|
|
53
|
-
enumerable: !0,
|
|
54
|
-
configurable: !0,
|
|
55
|
-
writable: !0,
|
|
56
|
-
value: "InvalidFunctionModifierError"
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
class u extends t {
|
|
61
|
-
constructor({ abiParameter: e }) {
|
|
62
|
-
super("Invalid ABI parameter.", {
|
|
63
|
-
details: JSON.stringify(e, null, 2),
|
|
64
|
-
metaMessages: ["ABI parameter type is invalid."]
|
|
65
|
-
}), Object.defineProperty(this, "name", {
|
|
66
|
-
enumerable: !0,
|
|
67
|
-
configurable: !0,
|
|
68
|
-
writable: !0,
|
|
69
|
-
value: "InvalidAbiTypeParameterError"
|
|
70
|
-
});
|
|
1
|
+
import { isAddress as f } from "./index176.js";
|
|
2
|
+
import { isAddressEqual as o } from "./index186.js";
|
|
3
|
+
function l(n) {
|
|
4
|
+
const { address: r, domain: s, message: e, nonce: t, scheme: a, time: i = /* @__PURE__ */ new Date() } = n;
|
|
5
|
+
if (s && e.domain !== s || t && e.nonce !== t || a && e.scheme !== a || e.expirationTime && i >= e.expirationTime || e.notBefore && i < e.notBefore)
|
|
6
|
+
return !1;
|
|
7
|
+
try {
|
|
8
|
+
if (!e.address || !f(e.address, { strict: !1 }) || r && !o(e.address, r))
|
|
9
|
+
return !1;
|
|
10
|
+
} catch {
|
|
11
|
+
return !1;
|
|
71
12
|
}
|
|
13
|
+
return !0;
|
|
72
14
|
}
|
|
73
15
|
export {
|
|
74
|
-
|
|
75
|
-
d as InvalidFunctionModifierError,
|
|
76
|
-
l as InvalidModifierError,
|
|
77
|
-
n as InvalidParameterError,
|
|
78
|
-
s as SolidityProtectedKeywordError
|
|
16
|
+
l as validateSiweMessage
|
|
79
17
|
};
|
package/dist/index28.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index218.cjs"),a=e.defineChain({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.drpc.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0});exports.sepolia=a;
|
package/dist/index28.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { defineChain as e } from "./index218.js";
|
|
2
|
+
const s = /* @__PURE__ */ e({
|
|
3
|
+
id: 11155111,
|
|
4
|
+
name: "Sepolia",
|
|
5
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
6
|
+
rpcUrls: {
|
|
7
|
+
default: {
|
|
8
|
+
http: ["https://sepolia.drpc.org"]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
blockExplorers: {
|
|
12
|
+
default: {
|
|
13
|
+
name: "Etherscan",
|
|
14
|
+
url: "https://sepolia.etherscan.io",
|
|
15
|
+
apiUrl: "https://api-sepolia.etherscan.io/api"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
contracts: {
|
|
19
|
+
multicall3: {
|
|
20
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
21
|
+
blockCreated: 751532
|
|
22
|
+
},
|
|
23
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
24
|
+
ensUniversalResolver: {
|
|
25
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
26
|
+
blockCreated: 5317080
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
testnet: !0
|
|
30
|
+
});
|
|
27
31
|
export {
|
|
28
|
-
|
|
32
|
+
s as sepolia
|
|
29
33
|
};
|
package/dist/index280.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index224.cjs"),t=new o.LruMap(8192);function i(r,{enabled:n=!0,id:e}){if(!n||!e)return r();if(t.get(e))return t.get(e);const u=r().finally(()=>t.delete(e));return t.set(e,u),u}exports.promiseCache=t;exports.withDedupe=i;
|
package/dist/index280.js
CHANGED
|
@@ -1,43 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
value: "InvalidSignatureError"
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
class i extends r {
|
|
15
|
-
constructor({ signature: e }) {
|
|
16
|
-
super("Unknown signature.", {
|
|
17
|
-
details: e
|
|
18
|
-
}), Object.defineProperty(this, "name", {
|
|
19
|
-
enumerable: !0,
|
|
20
|
-
configurable: !0,
|
|
21
|
-
writable: !0,
|
|
22
|
-
value: "UnknownSignatureError"
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
class s extends r {
|
|
27
|
-
constructor({ signature: e }) {
|
|
28
|
-
super("Invalid struct signature.", {
|
|
29
|
-
details: e,
|
|
30
|
-
metaMessages: ["No properties exist."]
|
|
31
|
-
}), Object.defineProperty(this, "name", {
|
|
32
|
-
enumerable: !0,
|
|
33
|
-
configurable: !0,
|
|
34
|
-
writable: !0,
|
|
35
|
-
value: "InvalidStructSignatureError"
|
|
36
|
-
});
|
|
37
|
-
}
|
|
1
|
+
import { LruMap as u } from "./index224.js";
|
|
2
|
+
const t = /* @__PURE__ */ new u(8192);
|
|
3
|
+
function s(r, { enabled: o = !0, id: e }) {
|
|
4
|
+
if (!o || !e)
|
|
5
|
+
return r();
|
|
6
|
+
if (t.get(e))
|
|
7
|
+
return t.get(e);
|
|
8
|
+
const n = r().finally(() => t.delete(e));
|
|
9
|
+
return t.set(e, n), n;
|
|
38
10
|
}
|
|
39
11
|
export {
|
|
40
|
-
|
|
41
|
-
s as
|
|
42
|
-
i as UnknownSignatureError
|
|
12
|
+
t as promiseCache,
|
|
13
|
+
s as withDedupe
|
|
43
14
|
};
|
package/dist/index281.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index154.cjs"),r=require("./index156.cjs"),c=e=>r.keccak256(t.toBytes(e));function n(e){return c(e)}exports.hashSignature=n;
|
package/dist/index281.js
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`"${r.trim()}" has too many ${e > 0 ? "opening" : "closing"} parentheses.`
|
|
7
|
-
],
|
|
8
|
-
details: `Depth "${e}"`
|
|
9
|
-
}), Object.defineProperty(this, "name", {
|
|
10
|
-
enumerable: !0,
|
|
11
|
-
configurable: !0,
|
|
12
|
-
writable: !0,
|
|
13
|
-
value: "InvalidParenthesisError"
|
|
14
|
-
});
|
|
15
|
-
}
|
|
1
|
+
import { toBytes as o } from "./index154.js";
|
|
2
|
+
import { keccak256 as r } from "./index156.js";
|
|
3
|
+
const e = (t) => r(o(t));
|
|
4
|
+
function c(t) {
|
|
5
|
+
return e(t);
|
|
16
6
|
}
|
|
17
7
|
export {
|
|
18
|
-
|
|
8
|
+
c as hashSignature
|
|
19
9
|
};
|
package/dist/index282.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index283.cjs"),n=require("./index264.cjs"),i=t=>{const r=typeof t=="string"?t:n.formatAbiItem(t);return e.normalizeSignature(r)};exports.toSignature=i;
|
package/dist/index282.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
enumerable: !0,
|
|
8
|
-
configurable: !0,
|
|
9
|
-
writable: !0,
|
|
10
|
-
value: "CircularReferenceError"
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
import { normalizeSignature as o } from "./index283.js";
|
|
2
|
+
import { formatAbiItem as n } from "./index264.js";
|
|
3
|
+
const m = (r) => {
|
|
4
|
+
const t = typeof r == "string" ? r : n(r);
|
|
5
|
+
return o(t);
|
|
6
|
+
};
|
|
14
7
|
export {
|
|
15
|
-
|
|
8
|
+
m as toSignature
|
|
16
9
|
};
|
package/dist/index283.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index41.cjs");function a(r){let l=!0,i="",o=0,t="",u=!1;for(let n=0;n<r.length;n++){const e=r[n];if(["(",")",","].includes(e)&&(l=!0),e==="("&&o++,e===")"&&o--,!!l){if(o===0){if(e===" "&&["event","function",""].includes(t))t="";else if(t+=e,e===")"){u=!0;break}continue}if(e===" "){r[n-1]!==","&&i!==","&&i!==",("&&(i="",l=!1);continue}t+=e,i+=e}}if(!u)throw new f.BaseError("Unable to normalize signature.");return t}exports.normalizeSignature=a;
|
package/dist/index283.js
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { BaseError as u } from "./index41.js";
|
|
2
|
+
function a(r) {
|
|
3
|
+
let l = !0, i = "", f = 0, t = "", o = !1;
|
|
4
|
+
for (let n = 0; n < r.length; n++) {
|
|
5
|
+
const e = r[n];
|
|
6
|
+
if (["(", ")", ","].includes(e) && (l = !0), e === "(" && f++, e === ")" && f--, !!l) {
|
|
7
|
+
if (f === 0) {
|
|
8
|
+
if (e === " " && ["event", "function", ""].includes(t))
|
|
9
|
+
t = "";
|
|
10
|
+
else if (t += e, e === ")") {
|
|
11
|
+
o = !0;
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
if (e === " ") {
|
|
17
|
+
r[n - 1] !== "," && i !== "," && i !== ",(" && (i = "", l = !1);
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
t += e, i += e;
|
|
9
21
|
}
|
|
10
|
-
}
|
|
22
|
+
}
|
|
23
|
+
if (!o)
|
|
24
|
+
throw new u("Unable to normalize signature.");
|
|
25
|
+
return t;
|
|
11
26
|
}
|
|
12
|
-
const t = /* @__PURE__ */ r();
|
|
13
27
|
export {
|
|
14
|
-
|
|
28
|
+
a as normalizeSignature
|
|
15
29
|
};
|
package/dist/index284.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
2
|
-
- `).slice(1);return{...p,...m,...s?{chainId:Number(s)}:{},...i?{expirationTime:new Date(i)}:{},...o?{issuedAt:new Date(o)}:{},...r?{notBefore:new Date(r)}:{},...a?{requestId:a}:{},...u?{resources:u}:{},...n?{scheme:n}:{},...t?{statement:t}:{}}}const h=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,A=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;exports.parseSiweMessage=x;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=BigInt(2**32-1),c=BigInt(32);function u(t,o=!1){return o?{h:Number(t&l),l:Number(t>>c&l)}:{h:Number(t>>c&l)|0,l:Number(t&l)|0}}function B(t,o=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let e=0;e<r;e++){const{h:f,l:s}=u(t[e],o);[n[e],i[e]]=[f,s]}return[n,i]}const g=(t,o,r)=>t<<r|o>>>32-r,m=(t,o,r)=>o<<r|t>>>32-r,S=(t,o,r)=>o<<r-32|t>>>64-r,a=(t,o,r)=>t<<r-32|o>>>64-r;exports.fromBig=u;exports.rotlBH=S;exports.rotlBL=a;exports.rotlSH=g;exports.rotlSL=m;exports.split=B;
|
package/dist/index284.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
- `).slice(1);
|
|
5
|
-
return {
|
|
6
|
-
...p,
|
|
7
|
-
...x,
|
|
8
|
-
...s ? { chainId: Number(s) } : {},
|
|
9
|
-
...i ? { expirationTime: new Date(i) } : {},
|
|
10
|
-
...o ? { issuedAt: new Date(o) } : {},
|
|
11
|
-
...r ? { notBefore: new Date(r) } : {},
|
|
12
|
-
...a ? { requestId: a } : {},
|
|
13
|
-
...u ? { resources: u } : {},
|
|
14
|
-
...n ? { scheme: n } : {},
|
|
15
|
-
...t ? { statement: t } : {}
|
|
16
|
-
};
|
|
1
|
+
const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
|
|
2
|
+
function s(t, r = !1) {
|
|
3
|
+
return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
|
|
17
4
|
}
|
|
18
|
-
|
|
5
|
+
function h(t, r = !1) {
|
|
6
|
+
const n = t.length;
|
|
7
|
+
let l = new Uint32Array(n), c = new Uint32Array(n);
|
|
8
|
+
for (let e = 0; e < n; e++) {
|
|
9
|
+
const { h: u, l: f } = s(t[e], r);
|
|
10
|
+
[l[e], c[e]] = [u, f];
|
|
11
|
+
}
|
|
12
|
+
return [l, c];
|
|
13
|
+
}
|
|
14
|
+
const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
|
|
19
15
|
export {
|
|
20
|
-
|
|
16
|
+
s as fromBig,
|
|
17
|
+
B as rotlBH,
|
|
18
|
+
a as rotlBL,
|
|
19
|
+
m as rotlSH,
|
|
20
|
+
A as rotlSL,
|
|
21
|
+
h as split
|
|
21
22
|
};
|
package/dist/index285.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index297.cjs");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function p(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function s(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function c(t,...e){if(!p(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function m(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");s(t.outputLen),s(t.blockLen)}function B(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function E(t,e){c(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function H(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function U(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function L(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function S(t,e){return t<<32-e|t>>>e}const h=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function w(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function g(t){for(let e=0;e<t.length;e++)t[e]=w(t[e]);return t}const T=h?t=>t:g,d=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",V=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function _(t){if(c(t),d)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=V[t[n]];return e}const f={_0:48,_9:57,A:65,F:70,a:97,f:102};function l(t){if(t>=f._0&&t<=f._9)return t-f._0;if(t>=f.A&&t<=f.F)return t-(f.A-10);if(t>=f.a&&t<=f.f)return t-(f.a-10)}function I(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(d)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let o=0,i=0;o<n;o++,i+=2){const a=l(t.charCodeAt(i)),y=l(t.charCodeAt(i+1));if(a===void 0||y===void 0){const A=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+A+'" at index '+i)}r[o]=a*16+y}return r}function x(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function b(t){return typeof t=="string"&&(t=x(t)),c(t),t}function k(...t){let e=0;for(let r=0;r<t.length;r++){const o=t[r];c(o),e+=o.length}const n=new Uint8Array(e);for(let r=0,o=0;r<t.length;r++){const i=t[r];n.set(i,o),o+=i.length}return n}class O{}function R(t){const e=r=>t().update(b(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function v(t=32){if(u.crypto&&typeof u.crypto.getRandomValues=="function")return u.crypto.getRandomValues(new Uint8Array(t));if(u.crypto&&typeof u.crypto.randomBytes=="function")return Uint8Array.from(u.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}exports.Hash=O;exports.abytes=c;exports.aexists=B;exports.ahash=m;exports.anumber=s;exports.aoutput=E;exports.byteSwap=w;exports.byteSwap32=g;exports.bytesToHex=_;exports.clean=U;exports.concatBytes=k;exports.createHasher=R;exports.createView=L;exports.hexToBytes=I;exports.isBytes=p;exports.isLE=h;exports.randomBytes=v;exports.rotr=S;exports.swap32IfBE=T;exports.toBytes=b;exports.u32=H;exports.utf8ToBytes=x;
|
package/dist/index285.js
CHANGED
|
@@ -1,17 +1,149 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { crypto as u } from "./index297.js";
|
|
2
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
|
+
function w(t) {
|
|
4
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
5
|
+
}
|
|
6
|
+
function l(t) {
|
|
7
|
+
if (!Number.isSafeInteger(t) || t < 0)
|
|
8
|
+
throw new Error("positive integer expected, got " + t);
|
|
9
|
+
}
|
|
10
|
+
function c(t, ...e) {
|
|
11
|
+
if (!w(t))
|
|
12
|
+
throw new Error("Uint8Array expected");
|
|
13
|
+
if (e.length > 0 && !e.includes(t.length))
|
|
14
|
+
throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
|
|
15
|
+
}
|
|
16
|
+
function U(t) {
|
|
17
|
+
if (typeof t != "function" || typeof t.create != "function")
|
|
18
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
19
|
+
l(t.outputLen), l(t.blockLen);
|
|
20
|
+
}
|
|
21
|
+
function B(t, e = !0) {
|
|
22
|
+
if (t.destroyed)
|
|
23
|
+
throw new Error("Hash instance has been destroyed");
|
|
24
|
+
if (e && t.finished)
|
|
25
|
+
throw new Error("Hash#digest() has already been called");
|
|
26
|
+
}
|
|
27
|
+
function H(t, e) {
|
|
28
|
+
c(t);
|
|
29
|
+
const n = e.outputLen;
|
|
30
|
+
if (t.length < n)
|
|
31
|
+
throw new Error("digestInto() expects output buffer of length at least " + n);
|
|
32
|
+
}
|
|
33
|
+
function L(t) {
|
|
34
|
+
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
35
|
+
}
|
|
36
|
+
function V(...t) {
|
|
37
|
+
for (let e = 0; e < t.length; e++)
|
|
38
|
+
t[e].fill(0);
|
|
39
|
+
}
|
|
40
|
+
function _(t) {
|
|
41
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
42
|
+
}
|
|
43
|
+
function S(t, e) {
|
|
44
|
+
return t << 32 - e | t >>> e;
|
|
45
|
+
}
|
|
46
|
+
const d = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
47
|
+
function h(t) {
|
|
48
|
+
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
49
|
+
}
|
|
50
|
+
function x(t) {
|
|
51
|
+
for (let e = 0; e < t.length; e++)
|
|
52
|
+
t[e] = h(t[e]);
|
|
53
|
+
return t;
|
|
54
|
+
}
|
|
55
|
+
const T = d ? (t) => t : x, p = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", A = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
56
|
+
function k(t) {
|
|
57
|
+
if (c(t), p)
|
|
58
|
+
return t.toHex();
|
|
59
|
+
let e = "";
|
|
60
|
+
for (let n = 0; n < t.length; n++)
|
|
61
|
+
e += A[t[n]];
|
|
62
|
+
return e;
|
|
63
|
+
}
|
|
64
|
+
const f = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
65
|
+
function y(t) {
|
|
66
|
+
if (t >= f._0 && t <= f._9)
|
|
67
|
+
return t - f._0;
|
|
68
|
+
if (t >= f.A && t <= f.F)
|
|
69
|
+
return t - (f.A - 10);
|
|
70
|
+
if (t >= f.a && t <= f.f)
|
|
71
|
+
return t - (f.a - 10);
|
|
72
|
+
}
|
|
73
|
+
function I(t) {
|
|
74
|
+
if (typeof t != "string")
|
|
75
|
+
throw new Error("hex string expected, got " + typeof t);
|
|
76
|
+
if (p)
|
|
77
|
+
return Uint8Array.fromHex(t);
|
|
78
|
+
const e = t.length, n = e / 2;
|
|
79
|
+
if (e % 2)
|
|
80
|
+
throw new Error("hex string expected, got unpadded hex of length " + e);
|
|
81
|
+
const r = new Uint8Array(n);
|
|
82
|
+
for (let o = 0, i = 0; o < n; o++, i += 2) {
|
|
83
|
+
const s = y(t.charCodeAt(i)), a = y(t.charCodeAt(i + 1));
|
|
84
|
+
if (s === void 0 || a === void 0) {
|
|
85
|
+
const g = t[i] + t[i + 1];
|
|
86
|
+
throw new Error('hex string expected, got non-hex character "' + g + '" at index ' + i);
|
|
87
|
+
}
|
|
88
|
+
r[o] = s * 16 + a;
|
|
12
89
|
}
|
|
13
|
-
return
|
|
90
|
+
return r;
|
|
91
|
+
}
|
|
92
|
+
function m(t) {
|
|
93
|
+
if (typeof t != "string")
|
|
94
|
+
throw new Error("string expected");
|
|
95
|
+
return new Uint8Array(new TextEncoder().encode(t));
|
|
96
|
+
}
|
|
97
|
+
function b(t) {
|
|
98
|
+
return typeof t == "string" && (t = m(t)), c(t), t;
|
|
99
|
+
}
|
|
100
|
+
function R(...t) {
|
|
101
|
+
let e = 0;
|
|
102
|
+
for (let r = 0; r < t.length; r++) {
|
|
103
|
+
const o = t[r];
|
|
104
|
+
c(o), e += o.length;
|
|
105
|
+
}
|
|
106
|
+
const n = new Uint8Array(e);
|
|
107
|
+
for (let r = 0, o = 0; r < t.length; r++) {
|
|
108
|
+
const i = t[r];
|
|
109
|
+
n.set(i, o), o += i.length;
|
|
110
|
+
}
|
|
111
|
+
return n;
|
|
112
|
+
}
|
|
113
|
+
class F {
|
|
114
|
+
}
|
|
115
|
+
function O(t) {
|
|
116
|
+
const e = (r) => t().update(b(r)).digest(), n = t();
|
|
117
|
+
return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = () => t(), e;
|
|
118
|
+
}
|
|
119
|
+
function v(t = 32) {
|
|
120
|
+
if (u && typeof u.getRandomValues == "function")
|
|
121
|
+
return u.getRandomValues(new Uint8Array(t));
|
|
122
|
+
if (u && typeof u.randomBytes == "function")
|
|
123
|
+
return Uint8Array.from(u.randomBytes(t));
|
|
124
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
14
125
|
}
|
|
15
126
|
export {
|
|
16
|
-
|
|
127
|
+
F as Hash,
|
|
128
|
+
c as abytes,
|
|
129
|
+
B as aexists,
|
|
130
|
+
U as ahash,
|
|
131
|
+
l as anumber,
|
|
132
|
+
H as aoutput,
|
|
133
|
+
h as byteSwap,
|
|
134
|
+
x as byteSwap32,
|
|
135
|
+
k as bytesToHex,
|
|
136
|
+
V as clean,
|
|
137
|
+
R as concatBytes,
|
|
138
|
+
O as createHasher,
|
|
139
|
+
_ as createView,
|
|
140
|
+
I as hexToBytes,
|
|
141
|
+
w as isBytes,
|
|
142
|
+
d as isLE,
|
|
143
|
+
v as randomBytes,
|
|
144
|
+
S as rotr,
|
|
145
|
+
T as swap32IfBE,
|
|
146
|
+
b as toBytes,
|
|
147
|
+
L as u32,
|
|
148
|
+
m as utf8ToBytes
|
|
17
149
|
};
|
package/dist/index286.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index296.cjs"),x=require("./index285.cjs"),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),f=new Uint32Array(64);class u extends e.HashMD{constructor(o=32){super(64,o,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:o,B:h,C:s,D:a,E:r,F:b,G:c,H:i}=this;return[o,h,s,a,r,b,c,i]}set(o,h,s,a,r,b,c,i){this.A=o|0,this.B=h|0,this.C=s|0,this.D=a|0,this.E=r|0,this.F=b|0,this.G=c|0,this.H=i|0}process(o,h){for(let t=0;t<16;t++,h+=4)f[t]=o.getUint32(h,!1);for(let t=16;t<64;t++){const H=f[t-15],d=f[t-2],S=x.rotr(H,7)^x.rotr(H,18)^H>>>3,l=x.rotr(d,17)^x.rotr(d,19)^d>>>10;f[t]=l+f[t-7]+S+f[t-16]|0}let{A:s,B:a,C:r,D:b,E:c,F:i,G:n,H:A}=this;for(let t=0;t<64;t++){const H=x.rotr(c,6)^x.rotr(c,11)^x.rotr(c,25),d=A+H+e.Chi(c,i,n)+_[t]+f[t]|0,l=(x.rotr(s,2)^x.rotr(s,13)^x.rotr(s,22))+e.Maj(s,a,r)|0;A=n,n=i,i=c,c=b+d|0,b=r,r=a,a=s,s=d+l|0}s=s+this.A|0,a=a+this.B|0,r=r+this.C|0,b=b+this.D|0,c=c+this.E|0,i=i+this.F|0,n=n+this.G|0,A=A+this.H|0,this.set(s,a,r,b,c,i,n,A)}roundClean(){x.clean(f)}destroy(){this.set(0,0,0,0,0,0,0,0),x.clean(this.buffer)}}const I=x.createHasher(()=>new u);exports.SHA256=u;exports.sha256=I;
|