@gardenfi/utils 3.0.0-beta.2 → 3.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +35 -36
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +4 -4
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +3 -3
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -2
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +1 -1
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +1 -1
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +1 -1
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +1 -1
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +5 -5
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +33 -13
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +9 -34
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +60 -55
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +17 -23
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +106 -6
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +78 -18
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +9 -15
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +71 -5
- package/dist/index146.cjs +2 -1
- package/dist/index146.js +3 -14
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +9 -11
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +13 -12
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +4 -11
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +12 -8
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +2 -4
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +32 -17
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +21 -5
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +5 -171
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +5 -103
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +5 -33
- package/dist/index157.cjs +9 -1
- package/dist/index157.js +34 -8
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +3 -61
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +18 -19
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +19 -105
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +27 -70
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +6 -7
- package/dist/index163.cjs +4 -1
- package/dist/index163.js +194 -71
- package/dist/index164.cjs +1 -2
- package/dist/index164.js +28 -3
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +162 -9
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +127 -13
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +27 -4
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +56 -2
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +191 -31
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +4 -22
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +20 -5
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +3 -6
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +16 -5
- package/dist/index174.cjs +1 -9
- package/dist/index174.js +11 -35
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +35 -3
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +3 -19
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +25 -18
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +8 -35
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +23 -6
- package/dist/index180.cjs +1 -4
- package/dist/index180.js +28 -194
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +3 -27
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +6 -161
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +6 -127
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +32 -27
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +5 -192
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +38 -4
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +43 -14
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +33 -3
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +16 -15
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +40 -32
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +105 -3
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +3 -28
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +5 -25
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +3 -28
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +17 -6
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +5 -6
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +8 -32
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +104 -5
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +5 -37
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +6 -49
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +25 -30
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +34 -17
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +13 -42
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +74 -100
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +2 -3
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +17 -4
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +171 -3
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +17 -17
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +10 -8
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +25 -5
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +18 -27
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +15 -78
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +6 -2
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +13 -18
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +10 -17
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +16 -10
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +1 -1
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +8 -8
- package/dist/index220.cjs +2 -1
- package/dist/index220.js +40 -102
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +2 -17
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +5 -214
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +8 -106
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +17 -204
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +8 -42
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +62 -74
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +66 -2
- package/dist/index228.cjs +1 -2
- package/dist/index228.js +187 -40
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +29 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +76 -5
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +39 -9
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +14 -17
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +13 -8
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +11 -66
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +11 -64
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +18 -187
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +106 -26
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +98 -71
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +6 -40
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +7 -17
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +25 -12
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +16 -11
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +212 -10
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +206 -6
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +43 -7
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +74 -22
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +2 -20
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index252.cjs +1 -1
- package/dist/index252.js +68 -657
- package/dist/index253.cjs +1 -1
- package/dist/index253.js +634 -154
- package/dist/index254.cjs +1 -1
- package/dist/index254.js +176 -67
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +4 -4
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +1 -1
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +24 -41
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +6 -6
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +8 -8
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +2 -2
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +2 -2
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +4 -4
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +3 -3
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +3 -3
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +6 -6
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +1 -1
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +2 -2
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +2 -2
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -2
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +1 -1
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +4 -4
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +3 -3
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +2 -2
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +1 -1
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +1 -1
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +2 -2
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +1 -1
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +5 -5
- package/dist/src/lib/utils.d.ts +0 -15
- package/package.json +1 -1
package/dist/index208.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index42.cjs"),c=require("./index207.cjs");function u(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{chainId:i,nonce:o,...s}=r,a=r.address;e.push([i?n.toHex(i):"0x",a,o?n.toHex(o):"0x",...c.toYParitySignatureArray({},s)])}return e}exports.serializeAuthorizationList=u;
|
package/dist/index208.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { toHex as i } from "./index42.js";
|
|
2
|
+
import { toYParitySignatureArray as c } from "./index207.js";
|
|
3
|
+
function f(r) {
|
|
4
|
+
if (!r || r.length === 0)
|
|
5
|
+
return [];
|
|
6
|
+
const t = [];
|
|
7
|
+
for (const o of r) {
|
|
8
|
+
const { chainId: n, nonce: e, ...s } = o, a = o.address;
|
|
9
|
+
t.push([
|
|
10
|
+
n ? i(n) : "0x",
|
|
11
|
+
a,
|
|
12
|
+
e ? i(e) : "0x",
|
|
13
|
+
...c({}, s)
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as serializeAuthorizationList
|
|
20
20
|
};
|
package/dist/index209.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,i){let t=r.toString();const n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(i,"0");let[l,e]=[t.slice(0,t.length-i),t.slice(t.length-i)];return e=e.replace(/(0+)$/,""),`${n?"-":""}${l||"0"}${e?`.${e}`:""}`}exports.formatUnits=o;
|
package/dist/index209.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
function a(r, n) {
|
|
2
|
+
let t = r.toString();
|
|
3
|
+
const i = t.startsWith("-");
|
|
4
|
+
i && (t = t.slice(1)), t = t.padStart(n, "0");
|
|
5
|
+
let [l, e] = [
|
|
6
|
+
t.slice(0, t.length - n),
|
|
7
|
+
t.slice(t.length - n)
|
|
8
|
+
];
|
|
9
|
+
return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
|
|
8
10
|
}
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
a as formatUnits
|
|
11
13
|
};
|
package/dist/index210.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 n=require("./index150.cjs"),t=require("./index174.cjs");function i(s){if(typeof s=="string"){if(!t.isAddress(s,{strict:!1}))throw new n.InvalidAddressError({address:s});return{address:s,type:"json-rpc"}}if(!t.isAddress(s.address,{strict:!1}))throw new n.InvalidAddressError({address:s.address});return{address:s.address,nonceManager:s.nonceManager,sign:s.sign,signAuthorization:s.signAuthorization,signMessage:s.signMessage,signTransaction:s.signTransaction,signTypedData:s.signTypedData,source:"custom",type:"local"}}exports.toAccount=i;
|
package/dist/index210.js
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { InvalidAddressError as s } from "./index150.js";
|
|
2
|
+
import { isAddress as a } from "./index174.js";
|
|
3
|
+
function r(n) {
|
|
4
|
+
if (typeof n == "string") {
|
|
5
|
+
if (!a(n, { strict: !1 }))
|
|
6
|
+
throw new s({ address: n });
|
|
7
|
+
return {
|
|
8
|
+
address: n,
|
|
9
|
+
type: "json-rpc"
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
if (!a(n.address, { strict: !1 }))
|
|
13
|
+
throw new s({ address: n.address });
|
|
14
|
+
return {
|
|
15
|
+
address: n.address,
|
|
16
|
+
nonceManager: n.nonceManager,
|
|
17
|
+
sign: n.sign,
|
|
18
|
+
signAuthorization: n.signAuthorization,
|
|
19
|
+
signMessage: n.signMessage,
|
|
20
|
+
signTransaction: n.signTransaction,
|
|
21
|
+
signTypedData: n.signTypedData,
|
|
22
|
+
source: "custom",
|
|
23
|
+
type: "local"
|
|
24
|
+
};
|
|
5
25
|
}
|
|
6
26
|
export {
|
|
7
|
-
|
|
27
|
+
r as toAccount
|
|
8
28
|
};
|
package/dist/index211.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 a=require("./index202.cjs"),l=require("./index181.cjs"),y=require("./index168.cjs"),i=require("./index42.cjs"),x=require("./index203.cjs");let r=!1;async function g({hash:n,privateKey:o,to:e="object"}){const{r:c,s:u,recovery:t}=a.secp256k1.sign(n.slice(2),o.slice(2),{lowS:!0,extraEntropy:l.isHex(r,{strict:!1})?y.hexToBytes(r):r}),s={r:i.numberToHex(c,{size:32}),s:i.numberToHex(u,{size:32}),v:t?28n:27n,yParity:t};return e==="bytes"||e==="hex"?x.serializeSignature({...s,to:e}):s}exports.sign=g;
|
package/dist/index211.js
CHANGED
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
function s(r) {
|
|
20
|
-
if (r === 0 || r === 1)
|
|
21
|
-
return r;
|
|
22
|
-
if (r === 27)
|
|
23
|
-
return 0;
|
|
24
|
-
if (r === 28)
|
|
25
|
-
return 1;
|
|
26
|
-
throw new Error("Invalid yParityOrV value");
|
|
1
|
+
import { secp256k1 as a } from "./index202.js";
|
|
2
|
+
import { isHex as f } from "./index181.js";
|
|
3
|
+
import { hexToBytes as p } from "./index168.js";
|
|
4
|
+
import { numberToHex as s } from "./index42.js";
|
|
5
|
+
import { serializeSignature as u } from "./index203.js";
|
|
6
|
+
let e = !1;
|
|
7
|
+
async function z({ hash: o, privateKey: n, to: r = "object" }) {
|
|
8
|
+
const { r: m, s: c, recovery: t } = a.sign(o.slice(2), n.slice(2), {
|
|
9
|
+
lowS: !0,
|
|
10
|
+
extraEntropy: f(e, { strict: !1 }) ? p(e) : e
|
|
11
|
+
}), i = {
|
|
12
|
+
r: s(m, { size: 32 }),
|
|
13
|
+
s: s(c, { size: 32 }),
|
|
14
|
+
v: t ? 28n : 27n,
|
|
15
|
+
yParity: t
|
|
16
|
+
};
|
|
17
|
+
return r === "bytes" || r === "hex" ? u({ ...i, to: r }) : i;
|
|
27
18
|
}
|
|
28
19
|
export {
|
|
29
|
-
|
|
20
|
+
z as sign
|
|
30
21
|
};
|
package/dist/index212.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 c=require("./index216.cjs"),a=require("./index211.cjs");async function u(t){const{chainId:n,nonce:i,privateKey:r,to:o="object"}=t,s=t.contractAddress??t.address,e=await a.sign({hash:c.hashAuthorization({address:s,chainId:n,nonce:i}),privateKey:r,to:o});return o==="object"?{address:s,chainId:n,nonce:i,...e}:e}exports.signAuthorization=u;
|
package/dist/index212.js
CHANGED
|
@@ -1,81 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
for (const o of e) {
|
|
16
|
-
const { chainId: r } = o, i = o.address;
|
|
17
|
-
if (!f(i))
|
|
18
|
-
throw new s({ address: i });
|
|
19
|
-
if (r < 0)
|
|
20
|
-
throw new n({ chainId: r });
|
|
21
|
-
}
|
|
22
|
-
d(t);
|
|
23
|
-
}
|
|
24
|
-
function L(t) {
|
|
25
|
-
const { blobVersionedHashes: e } = t;
|
|
26
|
-
if (e) {
|
|
27
|
-
if (e.length === 0)
|
|
28
|
-
throw new P();
|
|
29
|
-
for (const o of e) {
|
|
30
|
-
const r = F(o), i = G(I(o, 0, 1));
|
|
31
|
-
if (r !== 32)
|
|
32
|
-
throw new p({ hash: o, size: r });
|
|
33
|
-
if (i !== c)
|
|
34
|
-
throw new x({
|
|
35
|
-
hash: o,
|
|
36
|
-
version: i
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
d(t);
|
|
41
|
-
}
|
|
42
|
-
function d(t) {
|
|
43
|
-
const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
|
|
44
|
-
if (e <= 0)
|
|
45
|
-
throw new n({ chainId: e });
|
|
46
|
-
if (i && !f(i))
|
|
47
|
-
throw new s({ address: i });
|
|
48
|
-
if (r && r > m)
|
|
49
|
-
throw new w({ maxFeePerGas: r });
|
|
50
|
-
if (o && r && o > r)
|
|
51
|
-
throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
|
|
52
|
-
}
|
|
53
|
-
function B(t) {
|
|
54
|
-
const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
|
|
55
|
-
if (e <= 0)
|
|
56
|
-
throw new n({ chainId: e });
|
|
57
|
-
if (a && !f(a))
|
|
58
|
-
throw new s({ address: a });
|
|
59
|
-
if (o || i)
|
|
60
|
-
throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
|
|
61
|
-
if (r && r > m)
|
|
62
|
-
throw new w({ maxFeePerGas: r });
|
|
63
|
-
}
|
|
64
|
-
function K(t) {
|
|
65
|
-
const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
|
|
66
|
-
if (a && !f(a))
|
|
67
|
-
throw new s({ address: a });
|
|
68
|
-
if (typeof e < "u" && e <= 0)
|
|
69
|
-
throw new n({ chainId: e });
|
|
70
|
-
if (o || i)
|
|
71
|
-
throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
|
72
|
-
if (r && r > m)
|
|
73
|
-
throw new w({ maxFeePerGas: r });
|
|
1
|
+
import { hashAuthorization as a } from "./index216.js";
|
|
2
|
+
import { sign as e } from "./index211.js";
|
|
3
|
+
async function u(t) {
|
|
4
|
+
const { chainId: o, nonce: n, privateKey: c, to: i = "object" } = t, r = t.contractAddress ?? t.address, s = await e({
|
|
5
|
+
hash: a({ address: r, chainId: o, nonce: n }),
|
|
6
|
+
privateKey: c,
|
|
7
|
+
to: i
|
|
8
|
+
});
|
|
9
|
+
return i === "object" ? {
|
|
10
|
+
address: r,
|
|
11
|
+
chainId: o,
|
|
12
|
+
nonce: n,
|
|
13
|
+
...s
|
|
14
|
+
} : s;
|
|
74
15
|
}
|
|
75
16
|
export {
|
|
76
|
-
|
|
77
|
-
B as assertTransactionEIP2930,
|
|
78
|
-
L as assertTransactionEIP4844,
|
|
79
|
-
C as assertTransactionEIP7702,
|
|
80
|
-
K as assertTransactionLegacy
|
|
17
|
+
u as signAuthorization
|
|
81
18
|
};
|
package/dist/index213.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 a=require("./index196.cjs"),n=require("./index211.cjs");async function t({message:e,privateKey:s}){return await n.sign({hash:a.hashMessage(e),privateKey:s,to:"hex"})}exports.signMessage=t;
|
package/dist/index213.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { hashMessage as e } from "./index196.js";
|
|
2
|
+
import { sign as o } from "./index211.js";
|
|
3
|
+
async function i({ message: s, privateKey: a }) {
|
|
4
|
+
return await o({ hash: e(s), privateKey: a, to: "hex" });
|
|
5
|
+
}
|
|
2
6
|
export {
|
|
3
|
-
|
|
7
|
+
i as signMessage
|
|
4
8
|
};
|
package/dist/index214.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 s=require("./index178.cjs"),c=require("./index207.cjs"),o=require("./index211.cjs");async function u(i){const{privateKey:n,transaction:a,serializer:e=c.serializeTransaction}=i,r=a.type==="eip4844"?{...a,sidecars:!1}:a,t=await o.sign({hash:s.keccak256(await e(r)),privateKey:n});return await e(a,t)}exports.signTransaction=u;
|
package/dist/index214.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!f(i, { strict: !1 }))
|
|
14
|
-
throw new s({ address: i });
|
|
15
|
-
n.push([i, e]);
|
|
16
|
-
}
|
|
17
|
-
return n;
|
|
1
|
+
import { keccak256 as e } from "./index178.js";
|
|
2
|
+
import { serializeTransaction as o } from "./index207.js";
|
|
3
|
+
import { sign as c } from "./index211.js";
|
|
4
|
+
async function u(r) {
|
|
5
|
+
const { privateKey: t, transaction: a, serializer: i = o } = r, n = a.type === "eip4844" ? {
|
|
6
|
+
...a,
|
|
7
|
+
sidecars: !1
|
|
8
|
+
} : a, s = await c({
|
|
9
|
+
hash: e(await i(n)),
|
|
10
|
+
privateKey: t
|
|
11
|
+
});
|
|
12
|
+
return await i(a, s);
|
|
18
13
|
}
|
|
19
14
|
export {
|
|
20
|
-
|
|
15
|
+
u as signTransaction
|
|
21
16
|
};
|
package/dist/index215.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index198.cjs"),s=require("./index211.cjs");async function i(e){const{privateKey:t,...a}=e;return await s.sign({hash:n.hashTypedData(a),privateKey:t,to:"hex"})}exports.signTypedData=i;
|
package/dist/index215.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
n ? i(n) : "0x",
|
|
11
|
-
a,
|
|
12
|
-
e ? i(e) : "0x",
|
|
13
|
-
...c({}, s)
|
|
14
|
-
]);
|
|
15
|
-
}
|
|
16
|
-
return t;
|
|
1
|
+
import { hashTypedData as o } from "./index198.js";
|
|
2
|
+
import { sign as r } from "./index211.js";
|
|
3
|
+
async function p(t) {
|
|
4
|
+
const { privateKey: a, ...e } = t;
|
|
5
|
+
return await r({
|
|
6
|
+
hash: o(e),
|
|
7
|
+
privateKey: a,
|
|
8
|
+
to: "hex"
|
|
9
|
+
});
|
|
17
10
|
}
|
|
18
11
|
export {
|
|
19
|
-
|
|
12
|
+
p as signTypedData
|
|
20
13
|
};
|
package/dist/index216.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index120.cjs"),u=require("./index168.cjs"),c=require("./index42.cjs"),a=require("./index190.cjs"),h=require("./index178.cjs");function d(e){const{chainId:t,nonce:o,to:r}=e,s=e.contractAddress??e.address,n=h.keccak256(i.concatHex(["0x05",a.toRlp([t?c.numberToHex(t):"0x",s,o?c.numberToHex(o):"0x"])]));return r==="bytes"?u.hexToBytes(n):n}exports.hashAuthorization=d;
|
package/dist/index216.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { concatHex as i } from "./index120.js";
|
|
2
|
+
import { hexToBytes as m } from "./index168.js";
|
|
3
|
+
import { numberToHex as c } from "./index42.js";
|
|
4
|
+
import { toRlp as d } from "./index190.js";
|
|
5
|
+
import { keccak256 as f } from "./index178.js";
|
|
6
|
+
function b(o) {
|
|
7
|
+
const { chainId: t, nonce: r, to: s } = o, e = o.contractAddress ?? o.address, n = f(i([
|
|
8
|
+
"0x05",
|
|
9
|
+
d([
|
|
10
|
+
t ? c(t) : "0x",
|
|
11
|
+
e,
|
|
12
|
+
r ? c(r) : "0x"
|
|
13
|
+
])
|
|
14
|
+
]));
|
|
15
|
+
return s === "bytes" ? m(n) : n;
|
|
10
16
|
}
|
|
11
17
|
export {
|
|
12
|
-
|
|
18
|
+
b as hashAuthorization
|
|
13
19
|
};
|
package/dist/index217.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./index163.cjs");function s(n,e){const t=(n.details||"").toLowerCase(),i=n instanceof c.BaseError?n.walk(r=>(r==null?void 0:r.code)===o.ExecutionRevertedError.code):n;return i instanceof c.BaseError?new o.ExecutionRevertedError({cause:n,message:i.details}):o.ExecutionRevertedError.nodeMessage.test(t)?new o.ExecutionRevertedError({cause:n,message:n.details}):o.FeeCapTooHighError.nodeMessage.test(t)?new o.FeeCapTooHighError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.FeeCapTooLowError.nodeMessage.test(t)?new o.FeeCapTooLowError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.NonceTooHighError.nodeMessage.test(t)?new o.NonceTooHighError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceTooLowError.nodeMessage.test(t)?new o.NonceTooLowError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceMaxValueError.nodeMessage.test(t)?new o.NonceMaxValueError({cause:n,nonce:e==null?void 0:e.nonce}):o.InsufficientFundsError.nodeMessage.test(t)?new o.InsufficientFundsError({cause:n}):o.IntrinsicGasTooHighError.nodeMessage.test(t)?new o.IntrinsicGasTooHighError({cause:n,gas:e==null?void 0:e.gas}):o.IntrinsicGasTooLowError.nodeMessage.test(t)?new o.IntrinsicGasTooLowError({cause:n,gas:e==null?void 0:e.gas}):o.TransactionTypeNotSupportedError.nodeMessage.test(t)?new o.TransactionTypeNotSupportedError({cause:n}):o.TipAboveFeeCapError.nodeMessage.test(t)?new o.TipAboveFeeCapError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new o.UnknownNodeError({cause:n})}exports.getNodeError=s;
|
package/dist/index217.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseError as c } from "./index35.js";
|
|
2
|
-
import { ExecutionRevertedError as t, FeeCapTooHighError as u, FeeCapTooLowError as d, NonceTooHighError as a, NonceTooLowError as f, NonceMaxValueError as w, InsufficientFundsError as r, IntrinsicGasTooHighError as E, IntrinsicGasTooLowError as m, TransactionTypeNotSupportedError as x, TipAboveFeeCapError as F, UnknownNodeError as M } from "./
|
|
2
|
+
import { ExecutionRevertedError as t, FeeCapTooHighError as u, FeeCapTooLowError as d, NonceTooHighError as a, NonceTooLowError as f, NonceMaxValueError as w, InsufficientFundsError as r, IntrinsicGasTooHighError as E, IntrinsicGasTooLowError as m, TransactionTypeNotSupportedError as x, TipAboveFeeCapError as F, UnknownNodeError as M } from "./index163.js";
|
|
3
3
|
function P(o, e) {
|
|
4
4
|
const n = (o.details || "").toLowerCase(), s = o instanceof c ? o.walk((i) => (i == null ? void 0 : i.code) === t.code) : o;
|
|
5
5
|
return s instanceof c ? new t({
|
package/dist/index22.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index202.cjs"),u=require("./index42.cjs"),a=require("./index210.cjs"),g=require("./index200.cjs"),y=require("./index211.cjs"),d=require("./index212.cjs"),T=require("./index213.cjs"),l=require("./index214.cjs"),q=require("./index215.cjs");function A(s,t={}){const{nonceManager:c}=t,e=u.toHex(i.secp256k1.getPublicKey(s.slice(2),!1)),o=g.publicKeyToAddress(e);return{...a.toAccount({address:o,nonceManager:c,async sign({hash:n}){return y.sign({hash:n,privateKey:s,to:"hex"})},async signAuthorization(n){return d.signAuthorization({...n,privateKey:s})},async signMessage({message:n}){return T.signMessage({message:n,privateKey:s})},async signTransaction(n,{serializer:r}={}){return l.signTransaction({privateKey:s,transaction:n,serializer:r})},async signTypedData(n){return q.signTypedData({...n,privateKey:s})}}),publicKey:e,source:"privateKey"}}exports.privateKeyToAccount=A;
|
package/dist/index22.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { secp256k1 as e } from "./
|
|
1
|
+
import { secp256k1 as e } from "./index202.js";
|
|
2
2
|
import { toHex as a } from "./index42.js";
|
|
3
|
-
import { toAccount as m } from "./
|
|
4
|
-
import { publicKeyToAddress as u } from "./
|
|
5
|
-
import { sign as g } from "./
|
|
6
|
-
import { signAuthorization as p } from "./
|
|
7
|
-
import { signMessage as f } from "./
|
|
8
|
-
import { signTransaction as y } from "./
|
|
9
|
-
import { signTypedData as d } from "./
|
|
3
|
+
import { toAccount as m } from "./index210.js";
|
|
4
|
+
import { publicKeyToAddress as u } from "./index200.js";
|
|
5
|
+
import { sign as g } from "./index211.js";
|
|
6
|
+
import { signAuthorization as p } from "./index212.js";
|
|
7
|
+
import { signMessage as f } from "./index213.js";
|
|
8
|
+
import { signTransaction as y } from "./index214.js";
|
|
9
|
+
import { signTypedData as d } from "./index215.js";
|
|
10
10
|
function H(n, t = {}) {
|
|
11
11
|
const { nonceManager: s } = t, r = a(e.getPublicKey(n.slice(2), !1)), c = u(r);
|
|
12
12
|
return {
|
package/dist/index220.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index221.cjs");class t extends Error{constructor(a,e={}){var i;const s=e.cause instanceof t?e.cause.details:(i=e.cause)!=null&&i.message?e.cause.message:e.details,r=e.cause instanceof t&&e.cause.docsPath||e.docsPath,u=[a||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...s?[`Details: ${s}`]:[],`Version: abitype@${o.version}`].join(`
|
|
2
|
+
`);super(u),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),e.cause&&(this.cause=e.cause),this.details=s,this.docsPath=r,this.metaMessages=e.metaMessages,this.shortMessage=a}}exports.BaseError=t;
|