@gardenfi/utils 2.1.3-beta.1 → 2.1.3-beta.10
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/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +71 -42
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +2 -2
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- 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/index125.cjs +1 -1
- package/dist/index125.js +1 -1
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +36 -34
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +15 -18
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +2 -2
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +43 -43
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +3 -113
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +1 -1
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +1 -1
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +2 -2
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +3 -3
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +3 -3
- package/dist/index247.cjs +1 -2
- package/dist/index247.js +13 -24
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +15 -13
- package/dist/index249.cjs +2 -1
- package/dist/index249.js +23 -14
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +1 -1
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +103 -16
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +13 -220
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +214 -6
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +2 -2
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +7 -7
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +7 -27
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +26 -34
- package/dist/index283.cjs +1 -1
- package/dist/index283.js +13 -12
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +89 -51
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +3 -67
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +140 -3
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +143 -128
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +9 -155
- package/dist/index289.cjs +1 -1
- package/dist/index289.js +111 -7
- package/dist/index290.cjs +2 -1
- package/dist/index290.js +116 -95
- package/dist/index291.cjs +1 -2
- package/dist/index291.js +8 -131
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +19 -40
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +43 -2
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +74 -202
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +2 -69
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +68 -11
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +656 -18
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +197 -633
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +78 -73
- package/dist/index300.cjs +2 -2
- package/dist/index300.js +7 -7
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +1 -1
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +2 -2
- package/dist/index305.cjs +1 -1
- package/dist/index305.js +1 -1
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +2 -2
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +1 -1
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +1 -1
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +5 -105
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +2 -5
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +22 -2
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +40 -21
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +24 -24
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +98 -97
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +53 -51
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +44 -42
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +15 -15
- package/package.json +1 -1
- package/dist/index314.cjs +0 -1
- package/dist/index314.js +0 -22
- package/dist/index315.cjs +0 -1
- package/dist/index315.js +0 -74
- package/dist/index316.cjs +0 -1
- package/dist/index316.js +0 -24
package/dist/index104.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index45.cjs"),f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index45.cjs"),f=require("./index249.cjs"),g=require("./index181.cjs"),s=require("./index29.cjs"),h=require("./index71.cjs"),A=require("./index83.cjs");async function p(o,n){var i;const{account:c=o.account,chainId:u,nonce:a}=n;if(!c)throw new f.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const r=d.parseAccount(c),t=(()=>{if(n.executor)return n.executor==="self"?n.executor:d.parseAccount(n.executor)})(),e={address:n.contractAddress??n.address,chainId:u,nonce:a};return typeof e.chainId>"u"&&(e.chainId=((i=o.chain)==null?void 0:i.id)??await s.getAction(o,h.getChainId,"getChainId")({})),typeof e.nonce>"u"&&(e.nonce=await s.getAction(o,A.getTransactionCount,"getTransactionCount")({address:r.address,blockTag:"pending"}),(t==="self"||t!=null&&t.address&&g.isAddressEqual(t.address,r.address))&&(e.nonce+=1)),e}exports.prepareAuthorization=p;
|
package/dist/index104.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAccount as e } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as f } from "./
|
|
2
|
+
import { AccountNotFoundError as f } from "./index249.js";
|
|
3
3
|
import { isAddressEqual as h } from "./index181.js";
|
|
4
4
|
import { getAction as a } from "./index29.js";
|
|
5
5
|
import { getChainId as p } from "./index71.js";
|
package/dist/index107.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("./index45.cjs"),h=require("./index38.cjs"),g=require("./index138.cjs"),k=require("./index177.cjs"),N=require("./index154.cjs"),M=require("./index182.cjs"),s=require("./index150.cjs"),H=require("./index247.cjs"),I=require("./index108.cjs"),w="0x5792579257925792579257925792579257925792579257925792579257925792",T=s.numberToHex(0,{size:32});async function _(r,i){const{account:p=r.account,capabilities:c,chain:l=r.chain,experimental_fallback:v,experimental_fallbackDelay:m=32,forceAtomic:b=!1,id:y,version:q="2.0.0"}=i,n=p?E.parseAccount(p):null,u=i.calls.map(a=>{const e=a;return{data:e.abi?k.encodeFunctionData({abi:e.abi,functionName:e.functionName,args:e.args}):e.data,to:e.to,value:e.value?s.numberToHex(e.value):void 0}});try{const a=await r.request({method:"wallet_sendCalls",params:[{atomicRequired:b,calls:u,capabilities:c,chainId:s.numberToHex(l.id),from:n==null?void 0:n.address,id:y,version:q}]},{retryCount:0});return typeof a=="string"?{id:a}:a}catch(a){const e=a;if(v&&(e.name==="MethodNotFoundRpcError"||e.name==="MethodNotSupportedRpcError"||e.details.toLowerCase().includes("does not exist / is not available")||e.details.toLowerCase().includes("missing or invalid. request()")||e.details.toLowerCase().includes("did not match any variant of untagged enum"))){if(c&&Object.values(c).some(o=>!o.optional)){const o="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new g.UnsupportedNonOptionalCapabilityError(new h.BaseError(o,{details:o}))}if(b&&u.length>1){const t="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new g.AtomicityNotSupportedError(new h.BaseError(t,{details:t}))}const d=[];for(const t of u){const o=I.sendTransaction(r,{account:n,chain:l,data:t.data,to:t.to,value:t.value?M.hexToBigInt(t.value):void 0});d.push(o),m>0&&await new Promise(C=>setTimeout(C,m))}const f=await Promise.allSettled(d);if(f.every(t=>t.status==="rejected"))throw f[0].reason;const x=f.map(t=>t.status==="fulfilled"?t.value:T);return{id:N.concat([...x,s.numberToHex(l.id,{size:32}),w])}}throw H.getTransactionError(a,{...i,account:n,chain:i.chain})}}exports.fallbackMagicIdentifier=w;exports.fallbackTransactionErrorMagicIdentifier=T;exports.sendCalls=_;
|
package/dist/index107.js
CHANGED
|
@@ -1,62 +1,91 @@
|
|
|
1
|
-
import { parseAccount as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { parseAccount as N } from "./index45.js";
|
|
2
|
+
import { BaseError as b } from "./index38.js";
|
|
3
|
+
import { UnsupportedNonOptionalCapabilityError as T, AtomicityNotSupportedError as x } from "./index138.js";
|
|
4
|
+
import { encodeFunctionData as E } from "./index177.js";
|
|
5
|
+
import { concat as k } from "./index154.js";
|
|
6
|
+
import { hexToBigInt as _ } from "./index182.js";
|
|
7
|
+
import { numberToHex as s } from "./index150.js";
|
|
8
|
+
import { getTransactionError as A } from "./index247.js";
|
|
9
|
+
import { sendTransaction as I } from "./index108.js";
|
|
10
|
+
const M = "0x5792579257925792579257925792579257925792579257925792579257925792", O = s(0, {
|
|
11
|
+
size: 32
|
|
12
|
+
});
|
|
13
|
+
async function P(i, r) {
|
|
14
|
+
const { account: f = i.account, capabilities: c, chain: l = i.chain, experimental_fallback: w, experimental_fallbackDelay: p = 32, forceAtomic: h = !1, id: g, version: v = "2.0.0" } = r, n = f ? N(f) : null, d = r.calls.map((a) => {
|
|
15
|
+
const t = a;
|
|
14
16
|
return {
|
|
15
|
-
data: t.abi ?
|
|
17
|
+
data: t.abi ? E({
|
|
16
18
|
abi: t.abi,
|
|
17
19
|
functionName: t.functionName,
|
|
18
20
|
args: t.args
|
|
19
21
|
}) : t.data,
|
|
20
22
|
to: t.to,
|
|
21
|
-
value: t.value ?
|
|
23
|
+
value: t.value ? s(t.value) : void 0
|
|
22
24
|
};
|
|
23
25
|
});
|
|
24
26
|
try {
|
|
25
|
-
const
|
|
27
|
+
const a = await i.request({
|
|
26
28
|
method: "wallet_sendCalls",
|
|
27
29
|
params: [
|
|
28
30
|
{
|
|
29
|
-
atomicRequired:
|
|
30
|
-
calls:
|
|
31
|
-
capabilities:
|
|
32
|
-
chainId:
|
|
33
|
-
from:
|
|
34
|
-
id:
|
|
35
|
-
version:
|
|
31
|
+
atomicRequired: h,
|
|
32
|
+
calls: d,
|
|
33
|
+
capabilities: c,
|
|
34
|
+
chainId: s(l.id),
|
|
35
|
+
from: n == null ? void 0 : n.address,
|
|
36
|
+
id: g,
|
|
37
|
+
version: v
|
|
36
38
|
}
|
|
37
39
|
]
|
|
38
40
|
}, { retryCount: 0 });
|
|
39
|
-
return typeof
|
|
40
|
-
} catch (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
return typeof a == "string" ? { id: a } : a;
|
|
42
|
+
} catch (a) {
|
|
43
|
+
const t = a;
|
|
44
|
+
if (w && (t.name === "MethodNotFoundRpcError" || t.name === "MethodNotSupportedRpcError" || t.details.toLowerCase().includes("does not exist / is not available") || t.details.toLowerCase().includes("missing or invalid. request()") || t.details.toLowerCase().includes("did not match any variant of untagged enum"))) {
|
|
45
|
+
if (c && Object.values(c).some((e) => !e.optional)) {
|
|
46
|
+
const e = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
|
|
47
|
+
throw new T(new b(e, {
|
|
48
|
+
details: e
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
if (h && d.length > 1) {
|
|
52
|
+
const o = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
|
|
53
|
+
throw new x(new b(o, {
|
|
54
|
+
details: o
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
const u = [];
|
|
58
|
+
for (const o of d) {
|
|
59
|
+
const e = I(i, {
|
|
60
|
+
account: n,
|
|
61
|
+
chain: l,
|
|
62
|
+
data: o.data,
|
|
63
|
+
to: o.to,
|
|
64
|
+
value: o.value ? _(o.value) : void 0
|
|
65
|
+
});
|
|
66
|
+
u.push(e), p > 0 && await new Promise((C) => setTimeout(C, p));
|
|
67
|
+
}
|
|
68
|
+
const m = await Promise.allSettled(u);
|
|
69
|
+
if (m.every((o) => o.status === "rejected"))
|
|
70
|
+
throw m[0].reason;
|
|
71
|
+
const y = m.map((o) => o.status === "fulfilled" ? o.value : O);
|
|
72
|
+
return {
|
|
73
|
+
id: k([
|
|
74
|
+
...y,
|
|
75
|
+
s(l.id, { size: 32 }),
|
|
76
|
+
M
|
|
77
|
+
])
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
throw A(a, {
|
|
81
|
+
...r,
|
|
82
|
+
account: n,
|
|
83
|
+
chain: r.chain
|
|
45
84
|
});
|
|
46
85
|
}
|
|
47
86
|
}
|
|
48
|
-
function y(o) {
|
|
49
|
-
const n = o != null && o.paymasterService ? Object.entries(o.paymasterService).reduce((e, [c, s]) => ({
|
|
50
|
-
...e ?? {},
|
|
51
|
-
[u(Number(c))]: s
|
|
52
|
-
}), {}) : void 0;
|
|
53
|
-
return {
|
|
54
|
-
...o,
|
|
55
|
-
...n ? {
|
|
56
|
-
paymasterService: n
|
|
57
|
-
} : {}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
87
|
export {
|
|
61
|
-
|
|
88
|
+
M as fallbackMagicIdentifier,
|
|
89
|
+
O as fallbackTransactionErrorMagicIdentifier,
|
|
90
|
+
P as sendCalls
|
|
62
91
|
};
|
package/dist/index108.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./index45.cjs"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./index45.cjs"),u=require("./index249.cjs"),O=require("./index38.cjs"),j=require("./index240.cjs"),B=require("./index212.cjs"),U=require("./index247.cjs"),W=require("./index236.cjs"),k=require("./index184.cjs"),l=require("./index29.cjs"),D=require("./index220.cjs"),H=require("./index197.cjs"),J=require("./index71.cjs"),L=require("./index96.cjs"),K=require("./index97.cjs"),f=new D.LruMap(128);async function Q(r,e){var M,z,I,S;const{account:d=r.account,chain:n=r.chain,accessList:w,authorizationList:s,blobs:q,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,type:C,value:N,...P}=e;if(typeof d>"u")throw new u.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const t=d?G.parseAccount(d):null;try{H.assertRequest(e);const a=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await j.recoverAuthorizationAddress({authorization:s[0]}).catch(()=>{throw new O.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if((t==null?void 0:t.type)==="json-rpc"||t===null){let i;n!==null&&(i=await l.getAction(r,J.getChainId,"getChainId")({}),B.assertCurrentChain({currentChainId:i,chain:n}));const c=(I=(z=(M=r.chain)==null?void 0:M.formatters)==null?void 0:z.transactionRequest)==null?void 0:I.format,F=(c||k.formatTransactionRequest)({...W.extract(P,{format:c}),accessList:w,authorizationList:s,blobs:q,chainId:i,data:m,from:t==null?void 0:t.address,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,to:a,type:C,value:N}),v=f.get(r.uid),_=v?"wallet_sendTransaction":"eth_sendTransaction";try{return await r.request({method:_,params:[F]},{retryCount:0})}catch(x){if(v===!1)throw x;const o=x;if(o.name==="InvalidInputRpcError"||o.name==="InvalidParamsRpcError"||o.name==="MethodNotFoundRpcError"||o.name==="MethodNotSupportedRpcError")return await r.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(p=>(f.set(r.uid,!0),p)).catch(p=>{const h=p;throw h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"?(f.set(r.uid,!1),o):h});throw o}}if((t==null?void 0:t.type)==="local"){const i=await l.getAction(r,L.prepareTransactionRequest,"prepareTransactionRequest")({account:t,accessList:w,authorizationList:s,blobs:q,chain:n,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,nonceManager:t.nonceManager,parameters:[...L.defaultParameters,"sidecars"],type:C,value:N,...P,to:a}),c=(S=n==null?void 0:n.serializers)==null?void 0:S.transaction,b=await t.signTransaction(i,{serializer:c});return await l.getAction(r,K.sendRawTransaction,"sendRawTransaction")({serializedTransaction:b})}throw(t==null?void 0:t.type)==="smart"?new u.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new u.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:t==null?void 0:t.type})}catch(a){throw a instanceof u.AccountTypeNotSupportedError?a:U.getTransactionError(a,{...e,account:t,chain:e.chain||void 0})}}exports.sendTransaction=Q;
|
package/dist/index108.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { parseAccount as _ } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as G, AccountTypeNotSupportedError as p } from "./
|
|
2
|
+
import { AccountNotFoundError as G, AccountTypeNotSupportedError as p } from "./index249.js";
|
|
3
3
|
import { BaseError as B } from "./index38.js";
|
|
4
4
|
import { recoverAuthorizationAddress as O } from "./index240.js";
|
|
5
5
|
import { assertCurrentChain as U } from "./index212.js";
|
|
6
|
-
import { getTransactionError as W } from "./
|
|
6
|
+
import { getTransactionError as W } from "./index247.js";
|
|
7
7
|
import { extract as j } from "./index236.js";
|
|
8
8
|
import { formatTransactionRequest as k } from "./index184.js";
|
|
9
9
|
import { getAction as f } from "./index29.js";
|
package/dist/index110.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),r=require("./index249.cjs"),e=require("./index104.cjs");async function a(t,n){const{account:i=t.account}=n;if(!i)throw new r.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const o=u.parseAccount(i);if(!o.signAuthorization)throw new r.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:o.type});const c=await e.prepareAuthorization(t,n);return o.signAuthorization(c)}exports.signAuthorization=a;
|
package/dist/index110.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAccount as c } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as u, AccountTypeNotSupportedError as a } from "./
|
|
2
|
+
import { AccountNotFoundError as u, AccountTypeNotSupportedError as a } from "./index249.js";
|
|
3
3
|
import { prepareAuthorization as s } from "./index104.js";
|
|
4
4
|
async function A(t, n) {
|
|
5
5
|
const { account: i = t.account } = n;
|
package/dist/index111.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index45.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index45.cjs"),a=require("./index249.cjs"),o=require("./index150.cjs");async function i(n,{account:e=n.account,message:r}){if(!e)throw new a.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const t=c.parseAccount(e);if(t.signMessage)return t.signMessage({message:r});const s=typeof r=="string"?o.stringToHex(r):r.raw instanceof Uint8Array?o.toHex(r.raw):r.raw;return n.request({method:"personal_sign",params:[s,t.address]},{retryCount:0})}exports.signMessage=i;
|
package/dist/index111.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAccount as e } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as i } from "./
|
|
2
|
+
import { AccountNotFoundError as i } from "./index249.js";
|
|
3
3
|
import { stringToHex as a, toHex as c } from "./index150.js";
|
|
4
4
|
async function g(n, { account: o = n.account, message: r }) {
|
|
5
5
|
if (!o)
|
package/dist/index112.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index45.cjs"),f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index45.cjs"),f=require("./index249.cjs"),C=require("./index212.cjs"),T=require("./index150.cjs"),m=require("./index184.cjs"),I=require("./index29.cjs"),w=require("./index197.cjs"),A=require("./index71.cjs");async function R(t,s){var i,u,d,h;const{account:o=t.account,chain:n=t.chain,...c}=s;if(!o)throw new f.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const r=g.parseAccount(o);w.assertRequest({account:r,...s});const a=await I.getAction(t,A.getChainId,"getChainId")({});n!==null&&C.assertCurrentChain({currentChainId:a,chain:n});const e=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),q=((u=e==null?void 0:e.transactionRequest)==null?void 0:u.format)||m.formatTransactionRequest;return r.signTransaction?r.signTransaction({...c,chainId:a},{serializer:(h=(d=t.chain)==null?void 0:d.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...q(c),chainId:T.numberToHex(a),from:r.address}]},{retryCount:0})}exports.signTransaction=R;
|
package/dist/index112.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAccount as d } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as p } from "./
|
|
2
|
+
import { AccountNotFoundError as p } from "./index249.js";
|
|
3
3
|
import { assertCurrentChain as g } from "./index212.js";
|
|
4
4
|
import { numberToHex as T } from "./index150.js";
|
|
5
5
|
import { formatTransactionRequest as C } from "./index184.js";
|
package/dist/index113.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),y=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),y=require("./index249.cjs"),s=require("./index188.cjs");async function p(c,r){const{account:i=c.account,domain:t,message:a,primaryType:e}=r;if(!i)throw new y.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const n=u.parseAccount(i),o={EIP712Domain:s.getTypesForEIP712Domain({domain:t}),...r.types};if(s.validateTypedData({domain:t,message:a,primaryType:e,types:o}),n.signTypedData)return n.signTypedData({domain:t,message:a,primaryType:e,types:o});const d=s.serializeTypedData({domain:t,message:a,primaryType:e,types:o});return c.request({method:"eth_signTypedData_v4",params:[n.address,d]},{retryCount:0})}exports.signTypedData=p;
|
package/dist/index113.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAccount as p } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as d } from "./
|
|
2
|
+
import { AccountNotFoundError as d } from "./index249.js";
|
|
3
3
|
import { getTypesForEIP712Domain as y, validateTypedData as m, serializeTypedData as u } from "./index188.js";
|
|
4
4
|
async function f(r, s) {
|
|
5
5
|
const { account: c = r.account, domain: t, message: a, primaryType: o } = s;
|
package/dist/index125.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.31.0";exports.version=e;
|
package/dist/index125.js
CHANGED
package/dist/index166.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index122.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index122.cjs"),A=require("./index124.cjs"),D=require("./index167.cjs"),S=require("./index168.cjs"),b=require("./index158.cjs"),I=require("./index123.cjs"),p="/docs/contract/decodeEventLog";function q(n){const{abi:d,data:i,strict:v,topics:E}=n,m=v??!0,[f,...w]=E;if(!f)throw new a.AbiEventSignatureEmptyTopicsError({docsPath:p});const o=d.find(e=>e.type==="event"&&f===D.toEventSelector(I.formatAbiItem(e)));if(!(o&&"name"in o)||o.type!=="event")throw new a.AbiEventSignatureNotFoundError(f,{docsPath:p});const{name:y,inputs:r}=o,u=r==null?void 0:r.some(e=>!("name"in e&&e.name)),c=u?[]:{},g=r.map((e,t)=>[e,t]).filter(([e])=>"indexed"in e&&e.indexed);for(let e=0;e<g.length;e++){const[t,l]=g[e],h=w[e];if(!h)throw new a.DecodeLogTopicsMismatch({abiItem:o,param:t});c[u?l:t.name||l]=L({param:t,value:h})}const s=r.filter(e=>!("indexed"in e&&e.indexed));if(s.length>0){if(i&&i!=="0x")try{const e=b.decodeAbiParameters(s,i);if(e)if(u)for(let t=0;t<r.length;t++)c[t]=c[t]??e.shift();else for(let t=0;t<s.length;t++)c[s[t].name]=e[t]}catch(e){if(m)throw e instanceof a.AbiDecodingDataSizeTooSmallError||e instanceof S.PositionOutOfBoundsError?new a.DecodeLogDataMismatch({abiItem:o,data:i,params:s,size:A.size(i)}):e}else if(m)throw new a.DecodeLogDataMismatch({abiItem:o,data:"0x",params:s,size:0})}return{eventName:y,args:Object.values(c).length>0?c:void 0}}function L({param:n,value:d}){return n.type==="string"||n.type==="bytes"||n.type==="tuple"||n.type.match(/^(.*)\[(\d+)?\]$/)?d:(b.decodeAbiParameters([n],d)||[])[0]}exports.decodeEventLog=q;
|
package/dist/index166.js
CHANGED
|
@@ -1,65 +1,67 @@
|
|
|
1
|
-
import { AbiEventSignatureEmptyTopicsError as
|
|
2
|
-
import { size as
|
|
3
|
-
import { toEventSelector as
|
|
4
|
-
import { PositionOutOfBoundsError as
|
|
5
|
-
import { decodeAbiParameters as
|
|
6
|
-
import { formatAbiItem as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const { abi:
|
|
1
|
+
import { AbiEventSignatureEmptyTopicsError as A, AbiEventSignatureNotFoundError as x, DecodeLogTopicsMismatch as D, AbiDecodingDataSizeTooSmallError as I, DecodeLogDataMismatch as l } from "./index122.js";
|
|
2
|
+
import { size as S } from "./index124.js";
|
|
3
|
+
import { toEventSelector as T } from "./index167.js";
|
|
4
|
+
import { PositionOutOfBoundsError as z } from "./index168.js";
|
|
5
|
+
import { decodeAbiParameters as w } from "./index158.js";
|
|
6
|
+
import { formatAbiItem as L } from "./index123.js";
|
|
7
|
+
const u = "/docs/contract/decodeEventLog";
|
|
8
|
+
function U(o) {
|
|
9
|
+
const { abi: d, data: i, strict: E, topics: b } = o, m = E ?? !0, [a, ...v] = b;
|
|
10
10
|
if (!a)
|
|
11
|
-
throw new
|
|
12
|
-
const
|
|
13
|
-
if (!(
|
|
14
|
-
throw new
|
|
15
|
-
const { name:
|
|
16
|
-
let c = f ? [] : {};
|
|
17
|
-
const p = d.filter((e) => "indexed" in e && e.indexed);
|
|
11
|
+
throw new A({ docsPath: u });
|
|
12
|
+
const n = d.find((e) => e.type === "event" && a === T(L(e)));
|
|
13
|
+
if (!(n && "name" in n) || n.type !== "event")
|
|
14
|
+
throw new x(a, { docsPath: u });
|
|
15
|
+
const { name: y, inputs: r } = n, f = r == null ? void 0 : r.some((e) => !("name" in e && e.name)), c = f ? [] : {}, p = r.map((e, t) => [e, t]).filter(([e]) => "indexed" in e && e.indexed);
|
|
18
16
|
for (let e = 0; e < p.length; e++) {
|
|
19
|
-
const t = p[e],
|
|
20
|
-
if (!
|
|
17
|
+
const [t, g] = p[e], h = v[e];
|
|
18
|
+
if (!h)
|
|
21
19
|
throw new D({
|
|
22
|
-
abiItem:
|
|
20
|
+
abiItem: n,
|
|
23
21
|
param: t
|
|
24
22
|
});
|
|
25
|
-
c[f ?
|
|
23
|
+
c[f ? g : t.name || g] = O({
|
|
24
|
+
param: t,
|
|
25
|
+
value: h
|
|
26
|
+
});
|
|
26
27
|
}
|
|
27
|
-
const s =
|
|
28
|
+
const s = r.filter((e) => !("indexed" in e && e.indexed));
|
|
28
29
|
if (s.length > 0) {
|
|
29
|
-
if (
|
|
30
|
+
if (i && i !== "0x")
|
|
30
31
|
try {
|
|
31
|
-
const e =
|
|
32
|
+
const e = w(s, i);
|
|
32
33
|
if (e)
|
|
33
34
|
if (f)
|
|
34
|
-
|
|
35
|
+
for (let t = 0; t < r.length; t++)
|
|
36
|
+
c[t] = c[t] ?? e.shift();
|
|
35
37
|
else
|
|
36
38
|
for (let t = 0; t < s.length; t++)
|
|
37
39
|
c[s[t].name] = e[t];
|
|
38
40
|
} catch (e) {
|
|
39
41
|
if (m)
|
|
40
|
-
throw e instanceof
|
|
41
|
-
abiItem:
|
|
42
|
-
data:
|
|
42
|
+
throw e instanceof I || e instanceof z ? new l({
|
|
43
|
+
abiItem: n,
|
|
44
|
+
data: i,
|
|
43
45
|
params: s,
|
|
44
|
-
size:
|
|
46
|
+
size: S(i)
|
|
45
47
|
}) : e;
|
|
46
48
|
}
|
|
47
49
|
else if (m)
|
|
48
|
-
throw new
|
|
49
|
-
abiItem:
|
|
50
|
+
throw new l({
|
|
51
|
+
abiItem: n,
|
|
50
52
|
data: "0x",
|
|
51
53
|
params: s,
|
|
52
54
|
size: 0
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
return {
|
|
56
|
-
eventName:
|
|
58
|
+
eventName: y,
|
|
57
59
|
args: Object.values(c).length > 0 ? c : void 0
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
62
|
+
function O({ param: o, value: d }) {
|
|
63
|
+
return o.type === "string" || o.type === "bytes" || o.type === "tuple" || o.type.match(/^(.*)\[(\d+)?\]$/) ? d : (w([o], d) || [])[0];
|
|
62
64
|
}
|
|
63
65
|
export {
|
|
64
|
-
|
|
66
|
+
U as decodeEventLog
|
|
65
67
|
};
|
package/dist/index192.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 F=require("./index277.cjs"),C=require("./index278.cjs"),n=require("./index279.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(0),M=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function N(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,m=n.pow2(_,d,f)*_%f,S=n.pow2(m,i,f)*I%f,P=n.pow2(S,e,f)*c%f,v=n.pow2(P,s,f)*B%f,E=n.pow2(v,r,f)*o%f,q=n.pow2(E,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:N}),O=C.createCurve({a:G,b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},F.sha256);exports.secp256k1=O;
|
package/dist/index192.js
CHANGED
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { sha256 as C } from "./index277.js";
|
|
2
|
+
import { createCurve as G } from "./index278.js";
|
|
3
|
+
import { Field as N, mod as k, pow2 as t } from "./index279.js";
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
|
-
const q = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), w = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
6
|
-
function
|
|
7
|
-
const f = q, e = BigInt(3), r = BigInt(6),
|
|
5
|
+
const q = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), w = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), M = BigInt(0), O = BigInt(1), _ = BigInt(2), h = (n, f) => (n + f / _) / f;
|
|
6
|
+
function W(n) {
|
|
7
|
+
const f = q, e = BigInt(3), r = BigInt(6), B = BigInt(11), a = BigInt(22), s = BigInt(23), i = BigInt(44), g = BigInt(88), o = n * n * n % f, c = o * o * n % f, d = t(c, e, f) * c % f, b = t(d, e, f) * c % f, m = t(b, _, f) * o % f, I = t(m, B, f) * m % f, p = t(I, a, f) * I % f, x = t(p, i, f) * p % f, E = t(x, g, f) * x % f, F = t(E, i, f) * p % f, P = t(F, e, f) * c % f, S = t(P, s, f) * I % f, v = t(S, r, f) * o % f, u = t(v, _, f);
|
|
8
8
|
if (!l.eql(l.sqr(u), n))
|
|
9
9
|
throw new Error("Cannot find square root");
|
|
10
10
|
return u;
|
|
11
11
|
}
|
|
12
|
-
const l =
|
|
13
|
-
a:
|
|
12
|
+
const l = N(q, void 0, void 0, { sqrt: W }), D = G({
|
|
13
|
+
a: M,
|
|
14
14
|
b: BigInt(7),
|
|
15
15
|
Fp: l,
|
|
16
16
|
n: w,
|
|
17
17
|
Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),
|
|
18
18
|
Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),
|
|
19
19
|
h: BigInt(1),
|
|
20
|
-
// Cofactor
|
|
21
20
|
lowS: !0,
|
|
22
21
|
// Allow only low-S signatures by default in sign() and verify()
|
|
23
22
|
endo: {
|
|
24
23
|
// Endomorphism, see above
|
|
25
24
|
beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
|
|
26
25
|
splitScalar: (n) => {
|
|
27
|
-
const f = w, e = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), r = -
|
|
28
|
-
let o = k(n - i * e - g *
|
|
29
|
-
const d = o > s,
|
|
30
|
-
if (d && (o = f - o),
|
|
26
|
+
const f = w, e = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), r = -O * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), B = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), a = e, s = BigInt("0x100000000000000000000000000000000"), i = h(a * n, f), g = h(-r * n, f);
|
|
27
|
+
let o = k(n - i * e - g * B, f), c = k(-i * r - g * a, f);
|
|
28
|
+
const d = o > s, b = c > s;
|
|
29
|
+
if (d && (o = f - o), b && (c = f - c), o > s || c > s)
|
|
31
30
|
throw new Error("splitScalar: Endomorphism failed, k=" + n);
|
|
32
|
-
return { k1neg: d, k1: o, k2neg:
|
|
31
|
+
return { k1neg: d, k1: o, k2neg: b, k2: c };
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
},
|
|
36
|
-
BigInt(0);
|
|
37
|
-
O.ProjectivePoint;
|
|
34
|
+
}, C);
|
|
38
35
|
export {
|
|
39
|
-
|
|
36
|
+
D as secp256k1
|
|
40
37
|
};
|
package/dist/index222.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index280.cjs"),r=require("./index281.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
|
package/dist/index222.js
CHANGED
package/dist/index225.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 f=require("./index283.cjs"),c=require("./index284.cjs"),A=BigInt(0),u=BigInt(1),H=BigInt(2),L=BigInt(7),S=BigInt(256),T=BigInt(113),O=[],y=[],w=[];for(let n=0,t=u,s=1,i=0;n<24;n++){[s,i]=[i,(2*s+3*i)%5],O.push(2*(5*i+s)),y.push((n+1)*(n+2)/2%64);let o=A;for(let r=0;r<7;r++)t=(t<<u^(t>>L)*T)%S,t&H&&(o^=u<<(u<<BigInt(r))-u);w.push(o)}const _=f.split(w,!0),F=_[0],X=_[1],I=(n,t,s)=>s>32?f.rotlBH(n,t,s):f.rotlSH(n,t,s),x=(n,t,s)=>s>32?f.rotlBL(n,t,s):f.rotlSL(n,t,s);function b(n,t=24){const s=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let e=0;e<10;e++)s[e]=n[e]^n[e+10]^n[e+20]^n[e+30]^n[e+40];for(let e=0;e<10;e+=2){const h=(e+8)%10,l=(e+2)%10,p=s[l],a=s[l+1],g=I(p,a,1)^s[h],B=x(p,a,1)^s[h+1];for(let d=0;d<50;d+=10)n[e+d]^=g,n[e+d+1]^=B}let o=n[2],r=n[3];for(let e=0;e<24;e++){const h=y[e],l=I(o,r,h),p=x(o,r,h),a=O[e];o=n[a],r=n[a+1],n[a]=l,n[a+1]=p}for(let e=0;e<50;e+=10){for(let h=0;h<10;h++)s[h]=n[e+h];for(let h=0;h<10;h++)n[e+h]^=~s[(h+2)%10]&s[(h+4)%10]}n[0]^=F[i],n[1]^=X[i]}c.clean(s)}class k extends c.Hash{constructor(t,s,i,o=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=s,this.outputLen=i,this.enableXOF=o,this.rounds=r,c.anumber(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=c.u32(this.state)}clone(){return this._cloneInto()}keccak(){c.swap32IfBE(this.state32),b(this.state32,this.rounds),c.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){c.aexists(this),t=c.toBytes(t),c.abytes(t);const{blockLen:s,state:i}=this,o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let h=0;h<e;h++)i[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:i,blockLen:o}=this;t[i]^=s,s&128&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){c.aexists(this,!1),c.abytes(t),this.finish();const s=this.state,{blockLen:i}=this;for(let o=0,r=t.length;o<r;){this.posOut>=i&&this.keccak();const e=Math.min(i-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return c.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(c.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,c.clean(this.state)}_cloneInto(t){const{blockLen:s,suffix:i,outputLen:o,rounds:r,enableXOF:e}=this;return t||(t=new k(s,i,o,e,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=i,t.outputLen=o,t.enableXOF=e,t.destroyed=this.destroyed,t}}const m=(n,t,s)=>c.createHasher(()=>new k(t,n,s)),E=m(1,136,256/8);exports.Keccak=k;exports.keccakP=b;exports.keccak_256=E;
|