@gardenfi/utils 2.1.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +12 -8
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +75 -34
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +45 -43
- 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/index189.cjs +1 -1
- package/dist/index189.js +2 -2
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +19 -15
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +27 -25
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +16 -16
- 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/index228.cjs +1 -1
- package/dist/index228.js +14 -14
- 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 +31 -2
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +2 -14
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +13 -12
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +10 -45
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +46 -10
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +11 -7
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +7 -9
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +8 -12
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +13 -14
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +14 -9
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +7 -28
- 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/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +1 -1
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +7 -6
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +103 -16
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +5 -222
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +224 -6
- 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 +124 -48
- 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 -11
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +139 -19
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +42 -28
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +72 -32
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +2 -69
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +69 -2
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +699 -41
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +179 -620
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index300.cjs +2 -1
- package/dist/index300.js +63 -203
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +4 -172
- package/dist/index302.cjs +1 -2
- package/dist/index302.js +39 -65
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +7 -4
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +60 -38
- package/dist/index305.cjs +1 -1
- package/dist/index305.js +77 -7
- package/dist/index306.cjs +1 -1
- package/dist/index306.js +4 -63
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +181 -64
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +64 -4
- package/dist/index309.cjs +1 -1
- package/dist/index309.js +44 -194
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +4 -18
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +5 -64
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +2 -45
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +21 -4
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +41 -41
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +29 -24
- 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 +111 -107
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +11 -11
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +1 -1
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +26 -26
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +3 -3
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +8 -8
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -1
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +8 -3
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +53 -51
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +55 -54
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +53 -57
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +44 -42
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +41 -41
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +48 -47
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +28 -28
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +26 -26
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +1 -1
- package/dist/src/lib/utils.d.ts +2 -1
- package/package.json +1 -1
- package/dist/index314.cjs +0 -1
- package/dist/index314.js +0 -107
- package/dist/index315.cjs +0 -1
- package/dist/index315.js +0 -7
- package/dist/index316.cjs +0 -1
- package/dist/index316.js +0 -4
- package/dist/index317.cjs +0 -1
- package/dist/index317.js +0 -24
package/dist/index102.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 l=require("./index45.cjs"),p=require("./index150.cjs");async function f(s,c={}){const{account:n=s.account,chainId:t}=c,e=n?l.parseAccount(n):void 0,o=t?[e==null?void 0:e.address,[p.numberToHex(t)]]:[e==null?void 0:e.address],u=await s.request({method:"wallet_getCapabilities",params:o}),a={};for(const[r,b]of Object.entries(u)){a[Number(r)]={};for(let[i,d]of Object.entries(b))i==="addSubAccount"&&(i="unstable_addSubAccount"),a[Number(r)][i]=d}return typeof t=="number"?a[t]:a}exports.getCapabilities=f;
|
package/dist/index102.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { parseAccount as p } from "./index45.js";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { numberToHex as f } from "./index150.js";
|
|
3
|
+
async function h(s, n = {}) {
|
|
4
|
+
const { account: o = s.account, chainId: t } = n, e = o ? p(o) : void 0, c = t ? [e == null ? void 0 : e.address, [f(t)]] : [e == null ? void 0 : e.address], b = await s.request({
|
|
4
5
|
method: "wallet_getCapabilities",
|
|
5
|
-
params:
|
|
6
|
-
}),
|
|
7
|
-
for (const [
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
params: c
|
|
7
|
+
}), a = {};
|
|
8
|
+
for (const [r, u] of Object.entries(b)) {
|
|
9
|
+
a[Number(r)] = {};
|
|
10
|
+
for (let [i, d] of Object.entries(u))
|
|
11
|
+
i === "addSubAccount" && (i = "unstable_addSubAccount"), a[Number(r)][i] = d;
|
|
12
|
+
}
|
|
13
|
+
return typeof t == "number" ? a[t] : a;
|
|
10
14
|
}
|
|
11
15
|
export {
|
|
12
|
-
|
|
16
|
+
h as getCapabilities
|
|
13
17
|
};
|
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 k=require("./index45.cjs"),h=require("./index38.cjs"),w=require("./index138.cjs"),N=require("./index177.cjs"),g=require("./index154.cjs"),M=require("./index182.cjs"),c=require("./index150.cjs"),S=require("./index247.cjs"),_=require("./index108.cjs"),T="0x5792579257925792579257925792579257925792579257925792579257925792",v=c.numberToHex(0,{size:32});async function H(i,s){const{account:f=i.account,capabilities:l,chain:u=i.chain,experimental_fallback:x,experimental_fallbackDelay:m=32,forceAtomic:b=!1,id:y,version:C="2.0.0"}=s,r=f?k.parseAccount(f):null,d=s.calls.map(a=>{const e=a,o=e.abi?N.encodeFunctionData({abi:e.abi,functionName:e.functionName,args:e.args}):e.data;return{data:e.dataSuffix&&o?g.concat([o,e.dataSuffix]):o,to:e.to,value:e.value?c.numberToHex(e.value):void 0}});try{const a=await i.request({method:"wallet_sendCalls",params:[{atomicRequired:b,calls:d,capabilities:l,chainId:c.numberToHex(u.id),from:r==null?void 0:r.address,id:y,version:C}]},{retryCount:0});return typeof a=="string"?{id:a}:a}catch(a){const e=a;if(x&&(e.name==="MethodNotFoundRpcError"||e.name==="MethodNotSupportedRpcError"||e.name==="UnknownRpcError"||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")||e.details.toLowerCase().includes("account upgraded to unsupported contract")||e.details.toLowerCase().includes("eip-7702 not supported")||e.details.toLowerCase().includes("unsupported wc_ method"))){if(l&&Object.values(l).some(n=>!n.optional)){const n="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new w.UnsupportedNonOptionalCapabilityError(new h.BaseError(n,{details:n}))}if(b&&d.length>1){const t="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new w.AtomicityNotSupportedError(new h.BaseError(t,{details:t}))}const o=[];for(const t of d){const n=_.sendTransaction(i,{account:r,chain:u,data:t.data,to:t.to,value:t.value?M.hexToBigInt(t.value):void 0});o.push(n),m>0&&await new Promise(E=>setTimeout(E,m))}const p=await Promise.allSettled(o);if(p.every(t=>t.status==="rejected"))throw p[0].reason;const q=p.map(t=>t.status==="fulfilled"?t.value:v);return{id:g.concat([...q,c.numberToHex(u.id,{size:32}),T])}}throw S.getTransactionError(a,{...s,account:r,chain:s.chain})}}exports.fallbackMagicIdentifier=T;exports.fallbackTransactionErrorMagicIdentifier=v;exports.sendCalls=H;
|
package/dist/index107.js
CHANGED
|
@@ -1,50 +1,91 @@
|
|
|
1
|
-
import { parseAccount as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { parseAccount as E } from "./index45.js";
|
|
2
|
+
import { BaseError as w } from "./index38.js";
|
|
3
|
+
import { UnsupportedNonOptionalCapabilityError as N, AtomicityNotSupportedError as T } from "./index138.js";
|
|
4
|
+
import { encodeFunctionData as k } from "./index177.js";
|
|
5
|
+
import { concat as b } from "./index154.js";
|
|
6
|
+
import { hexToBigInt as _ } from "./index182.js";
|
|
4
7
|
import { numberToHex as c } from "./index150.js";
|
|
5
|
-
import { getTransactionError as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { getTransactionError as L } from "./index247.js";
|
|
9
|
+
import { sendTransaction as S } from "./index108.js";
|
|
10
|
+
const A = "0x5792579257925792579257925792579257925792579257925792579257925792", I = c(0, {
|
|
11
|
+
size: 32
|
|
12
|
+
});
|
|
13
|
+
async function P(i, s) {
|
|
14
|
+
const { account: f = i.account, capabilities: l, chain: d = i.chain, experimental_fallback: g, experimental_fallbackDelay: m = 32, forceAtomic: h = !1, id: v, version: C = "2.0.0" } = s, r = f ? E(f) : null, u = s.calls.map((a) => {
|
|
15
|
+
const t = a, e = t.abi ? k({
|
|
16
|
+
abi: t.abi,
|
|
17
|
+
functionName: t.functionName,
|
|
18
|
+
args: t.args
|
|
19
|
+
}) : t.data;
|
|
14
20
|
return {
|
|
15
|
-
data:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
args: o.args
|
|
19
|
-
}) : o.data,
|
|
20
|
-
to: o.to,
|
|
21
|
-
value: o.value ? c(o.value) : void 0
|
|
21
|
+
data: t.dataSuffix && e ? b([e, t.dataSuffix]) : e,
|
|
22
|
+
to: t.to,
|
|
23
|
+
value: t.value ? c(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: c(
|
|
33
|
-
from:
|
|
34
|
-
id:
|
|
35
|
-
version:
|
|
31
|
+
atomicRequired: h,
|
|
32
|
+
calls: u,
|
|
33
|
+
capabilities: l,
|
|
34
|
+
chainId: c(d.id),
|
|
35
|
+
from: r == null ? void 0 : r.address,
|
|
36
|
+
id: v,
|
|
37
|
+
version: C
|
|
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 (g && (t.name === "MethodNotFoundRpcError" || t.name === "MethodNotSupportedRpcError" || t.name === "UnknownRpcError" || 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") || t.details.toLowerCase().includes("account upgraded to unsupported contract") || t.details.toLowerCase().includes("eip-7702 not supported") || t.details.toLowerCase().includes("unsupported wc_ method"))) {
|
|
45
|
+
if (l && Object.values(l).some((n) => !n.optional)) {
|
|
46
|
+
const n = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
|
|
47
|
+
throw new N(new w(n, {
|
|
48
|
+
details: n
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
if (h && u.length > 1) {
|
|
52
|
+
const o = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
|
|
53
|
+
throw new T(new w(o, {
|
|
54
|
+
details: o
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
const e = [];
|
|
58
|
+
for (const o of u) {
|
|
59
|
+
const n = S(i, {
|
|
60
|
+
account: r,
|
|
61
|
+
chain: d,
|
|
62
|
+
data: o.data,
|
|
63
|
+
to: o.to,
|
|
64
|
+
value: o.value ? _(o.value) : void 0
|
|
65
|
+
});
|
|
66
|
+
e.push(n), m > 0 && await new Promise((x) => setTimeout(x, m));
|
|
67
|
+
}
|
|
68
|
+
const p = await Promise.allSettled(e);
|
|
69
|
+
if (p.every((o) => o.status === "rejected"))
|
|
70
|
+
throw p[0].reason;
|
|
71
|
+
const y = p.map((o) => o.status === "fulfilled" ? o.value : I);
|
|
72
|
+
return {
|
|
73
|
+
id: b([
|
|
74
|
+
...y,
|
|
75
|
+
c(d.id, { size: 32 }),
|
|
76
|
+
A
|
|
77
|
+
])
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
throw L(a, {
|
|
81
|
+
...s,
|
|
82
|
+
account: r,
|
|
83
|
+
chain: s.chain
|
|
45
84
|
});
|
|
46
85
|
}
|
|
47
86
|
}
|
|
48
87
|
export {
|
|
49
|
-
A as
|
|
88
|
+
A as fallbackMagicIdentifier,
|
|
89
|
+
I as fallbackTransactionErrorMagicIdentifier,
|
|
90
|
+
P as sendCalls
|
|
50
91
|
};
|
package/dist/index108.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 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,47 +1,47 @@
|
|
|
1
|
-
import { parseAccount as
|
|
2
|
-
import { AccountNotFoundError as
|
|
3
|
-
import { BaseError as
|
|
4
|
-
import { recoverAuthorizationAddress as
|
|
5
|
-
import { assertCurrentChain as
|
|
6
|
-
import { getTransactionError as
|
|
7
|
-
import { extract as
|
|
8
|
-
import { formatTransactionRequest as
|
|
1
|
+
import { parseAccount as _ } from "./index45.js";
|
|
2
|
+
import { AccountNotFoundError as G, AccountTypeNotSupportedError as p } from "./index249.js";
|
|
3
|
+
import { BaseError as B } from "./index38.js";
|
|
4
|
+
import { recoverAuthorizationAddress as O } from "./index240.js";
|
|
5
|
+
import { assertCurrentChain as U } from "./index212.js";
|
|
6
|
+
import { getTransactionError as W } from "./index247.js";
|
|
7
|
+
import { extract as j } from "./index236.js";
|
|
8
|
+
import { formatTransactionRequest as k } from "./index184.js";
|
|
9
9
|
import { getAction as f } from "./index29.js";
|
|
10
|
-
import { LruMap as
|
|
11
|
-
import { assertRequest as
|
|
12
|
-
import { getChainId as
|
|
13
|
-
import { prepareTransactionRequest as
|
|
14
|
-
import { sendRawTransaction as
|
|
15
|
-
const h = new
|
|
16
|
-
async function
|
|
17
|
-
var
|
|
18
|
-
const { account: d = t.account, chain: e = t.chain, accessList: w, authorizationList: s, blobs: l, data: y, gas: T, gasPrice: g, maxFeePerBlobGas: R, maxFeePerGas: E, maxPriorityFeePerGas: q, nonce: P,
|
|
10
|
+
import { LruMap as D } from "./index220.js";
|
|
11
|
+
import { assertRequest as H } from "./index197.js";
|
|
12
|
+
import { getChainId as J } from "./index71.js";
|
|
13
|
+
import { prepareTransactionRequest as K, defaultParameters as Q } from "./index96.js";
|
|
14
|
+
import { sendRawTransaction as V } from "./index97.js";
|
|
15
|
+
const h = new D(128);
|
|
16
|
+
async function mr(t, o) {
|
|
17
|
+
var z, A, F, I;
|
|
18
|
+
const { account: d = t.account, chain: e = t.chain, accessList: w, authorizationList: s, blobs: l, data: y, gas: T, gasPrice: g, maxFeePerBlobGas: R, maxFeePerGas: E, maxPriorityFeePerGas: q, nonce: P, type: C, value: N, ...M } = o;
|
|
19
19
|
if (typeof d > "u")
|
|
20
|
-
throw new
|
|
20
|
+
throw new G({
|
|
21
21
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
22
22
|
});
|
|
23
|
-
const r = d ?
|
|
23
|
+
const r = d ? _(d) : null;
|
|
24
24
|
try {
|
|
25
|
-
|
|
25
|
+
H(o);
|
|
26
26
|
const a = await (async () => {
|
|
27
27
|
if (o.to)
|
|
28
28
|
return o.to;
|
|
29
29
|
if (o.to !== null && s && s.length > 0)
|
|
30
|
-
return await
|
|
30
|
+
return await O({
|
|
31
31
|
authorization: s[0]
|
|
32
32
|
}).catch(() => {
|
|
33
|
-
throw new
|
|
33
|
+
throw new B("`to` is required. Could not infer from `authorizationList`.");
|
|
34
34
|
});
|
|
35
35
|
})();
|
|
36
36
|
if ((r == null ? void 0 : r.type) === "json-rpc" || r === null) {
|
|
37
37
|
let i;
|
|
38
|
-
e !== null && (i = await f(t,
|
|
38
|
+
e !== null && (i = await f(t, J, "getChainId")({}), U({
|
|
39
39
|
currentChainId: i,
|
|
40
40
|
chain: e
|
|
41
41
|
}));
|
|
42
|
-
const c = (
|
|
42
|
+
const c = (F = (A = (z = t.chain) == null ? void 0 : z.formatters) == null ? void 0 : A.transactionRequest) == null ? void 0 : F.format, b = (c || k)({
|
|
43
43
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
44
|
-
...
|
|
44
|
+
...j(M, { format: c }),
|
|
45
45
|
accessList: w,
|
|
46
46
|
authorizationList: s,
|
|
47
47
|
blobs: l,
|
|
@@ -55,21 +55,22 @@ async function dr(t, o) {
|
|
|
55
55
|
maxPriorityFeePerGas: q,
|
|
56
56
|
nonce: P,
|
|
57
57
|
to: a,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
type: C,
|
|
59
|
+
value: N
|
|
60
|
+
}), v = h.get(t.uid), S = v ? "wallet_sendTransaction" : "eth_sendTransaction";
|
|
60
61
|
try {
|
|
61
62
|
return await t.request({
|
|
62
|
-
method:
|
|
63
|
-
params: [
|
|
63
|
+
method: S,
|
|
64
|
+
params: [b]
|
|
64
65
|
}, { retryCount: 0 });
|
|
65
|
-
} catch (
|
|
66
|
-
if (
|
|
67
|
-
throw
|
|
68
|
-
const n =
|
|
66
|
+
} catch (L) {
|
|
67
|
+
if (v === !1)
|
|
68
|
+
throw L;
|
|
69
|
+
const n = L;
|
|
69
70
|
if (n.name === "InvalidInputRpcError" || n.name === "InvalidParamsRpcError" || n.name === "MethodNotFoundRpcError" || n.name === "MethodNotSupportedRpcError")
|
|
70
71
|
return await t.request({
|
|
71
72
|
method: "wallet_sendTransaction",
|
|
72
|
-
params: [
|
|
73
|
+
params: [b]
|
|
73
74
|
}, { retryCount: 0 }).then((m) => (h.set(t.uid, !0), m)).catch((m) => {
|
|
74
75
|
const u = m;
|
|
75
76
|
throw u.name === "MethodNotFoundRpcError" || u.name === "MethodNotSupportedRpcError" ? (h.set(t.uid, !1), n) : u;
|
|
@@ -78,7 +79,7 @@ async function dr(t, o) {
|
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
if ((r == null ? void 0 : r.type) === "local") {
|
|
81
|
-
const i = await f(t,
|
|
82
|
+
const i = await f(t, K, "prepareTransactionRequest")({
|
|
82
83
|
account: r,
|
|
83
84
|
accessList: w,
|
|
84
85
|
authorizationList: s,
|
|
@@ -92,15 +93,16 @@ async function dr(t, o) {
|
|
|
92
93
|
maxPriorityFeePerGas: q,
|
|
93
94
|
nonce: P,
|
|
94
95
|
nonceManager: r.nonceManager,
|
|
95
|
-
parameters: [...
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
parameters: [...Q, "sidecars"],
|
|
97
|
+
type: C,
|
|
98
|
+
value: N,
|
|
99
|
+
...M,
|
|
98
100
|
to: a
|
|
99
|
-
}), c = (
|
|
101
|
+
}), c = (I = e == null ? void 0 : e.serializers) == null ? void 0 : I.transaction, x = await r.signTransaction(i, {
|
|
100
102
|
serializer: c
|
|
101
103
|
});
|
|
102
|
-
return await f(t,
|
|
103
|
-
serializedTransaction:
|
|
104
|
+
return await f(t, V, "sendRawTransaction")({
|
|
105
|
+
serializedTransaction: x
|
|
104
106
|
});
|
|
105
107
|
}
|
|
106
108
|
throw (r == null ? void 0 : r.type) === "smart" ? new p({
|
|
@@ -114,7 +116,7 @@ async function dr(t, o) {
|
|
|
114
116
|
type: r == null ? void 0 : r.type
|
|
115
117
|
});
|
|
116
118
|
} catch (a) {
|
|
117
|
-
throw a instanceof p ? a :
|
|
119
|
+
throw a instanceof p ? a : W(a, {
|
|
118
120
|
...o,
|
|
119
121
|
account: r,
|
|
120
122
|
chain: o.chain || void 0
|
|
@@ -122,5 +124,5 @@ async function dr(t, o) {
|
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
126
|
export {
|
|
125
|
-
|
|
127
|
+
mr as sendTransaction
|
|
126
128
|
};
|
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.6";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/index189.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index190.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index190.cjs"),o=require("./index191.cjs");async function s({hash:e,signature:r}){return c.publicKeyToAddress(await o.recoverPublicKey({hash:e,signature:r}))}exports.recoverAddress=s;
|
package/dist/index189.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { publicKeyToAddress as o } from "./index190.js";
|
|
2
2
|
import { recoverPublicKey as c } from "./index191.js";
|
|
3
|
-
async function
|
|
3
|
+
async function s({ hash: r, signature: e }) {
|
|
4
4
|
return o(await c({ hash: r, signature: e }));
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
s as recoverAddress
|
|
8
8
|
};
|
package/dist/index191.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("./index185.cjs"),d=require("./index124.cjs"),o=require("./index182.cjs"),c=require("./index150.cjs");async function g({hash:e,signature:r}){const u=n.isHex(e)?e:c.toHex(e),{secp256k1:i}=await Promise.resolve().then(()=>require("./index192.cjs"));return`0x${(()=>{if(typeof r=="object"&&"r"in r&&"s"in r){const{r:v,s:y,v:b,yParity:f}=r,a=Number(f??b),H=s(a);return new i.Signature(o.hexToBigInt(v),o.hexToBigInt(y)).addRecoveryBit(H)}const t=n.isHex(r)?r:c.toHex(r);if(d.size(t)!==65)throw new Error("invalid signature length");const l=o.hexToNumber(`0x${t.slice(130)}`),x=s(l);return i.Signature.fromCompact(t.substring(2,130)).addRecoveryBit(x)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function s(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}exports.recoverPublicKey=g;
|