@coinbase/cdp-core 0.0.41 → 0.0.42

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.
Files changed (61) hide show
  1. package/dist/esm/index.native101.js +10 -79
  2. package/dist/esm/index.native102.js +79 -10
  3. package/dist/esm/index.native13.js +1 -1
  4. package/dist/esm/index.native25.js +149 -940
  5. package/dist/esm/index.native26.js +48 -2
  6. package/dist/esm/index.native27.js +244 -43
  7. package/dist/esm/index.native28.js +55 -27
  8. package/dist/esm/index.native29.js +940 -149
  9. package/dist/esm/index.native30.js +2 -48
  10. package/dist/esm/index.native31.js +43 -243
  11. package/dist/esm/index.native32.js +27 -55
  12. package/dist/esm/index.native8.js +4 -4
  13. package/dist/esm/index.native9.js +49 -31
  14. package/dist/esm/index.native92.js +1 -1
  15. package/dist/esm/index.web100.js +9 -117
  16. package/dist/esm/index.web101.js +79 -10
  17. package/dist/esm/index.web26.js +156 -155
  18. package/dist/esm/index.web27.js +1 -1
  19. package/dist/esm/index.web8.js +49 -31
  20. package/dist/esm/index.web82.js +6 -6
  21. package/dist/esm/index.web91.js +1 -1
  22. package/dist/esm/index.web94.js +19 -77
  23. package/dist/esm/index.web95.js +10 -21
  24. package/dist/esm/index.web96.js +19 -9
  25. package/dist/esm/index.web97.js +89 -15
  26. package/dist/esm/index.web98.js +19 -92
  27. package/dist/esm/index.web99.js +115 -18
  28. package/dist/native/index.native101.js +10 -79
  29. package/dist/native/index.native102.js +79 -10
  30. package/dist/native/index.native13.js +1 -1
  31. package/dist/native/index.native25.js +149 -940
  32. package/dist/native/index.native26.js +48 -2
  33. package/dist/native/index.native27.js +244 -43
  34. package/dist/native/index.native28.js +55 -27
  35. package/dist/native/index.native29.js +940 -149
  36. package/dist/native/index.native30.js +2 -48
  37. package/dist/native/index.native31.js +43 -243
  38. package/dist/native/index.native32.js +27 -55
  39. package/dist/native/index.native8.js +4 -4
  40. package/dist/native/index.native9.js +49 -31
  41. package/dist/native/index.native92.js +1 -1
  42. package/dist/native-types/eip1193/errors.d.ts +6 -0
  43. package/dist/native-types/eip1193/internal.d.ts +3 -1
  44. package/dist/types/eip1193/errors.d.ts +6 -0
  45. package/dist/types/eip1193/internal.d.ts +3 -1
  46. package/dist/web/index.web100.js +9 -117
  47. package/dist/web/index.web101.js +79 -10
  48. package/dist/web/index.web26.js +156 -155
  49. package/dist/web/index.web27.js +1 -1
  50. package/dist/web/index.web8.js +49 -31
  51. package/dist/web/index.web82.js +6 -6
  52. package/dist/web/index.web91.js +1 -1
  53. package/dist/web/index.web94.js +19 -77
  54. package/dist/web/index.web95.js +10 -21
  55. package/dist/web/index.web96.js +19 -9
  56. package/dist/web/index.web97.js +89 -15
  57. package/dist/web/index.web98.js +19 -92
  58. package/dist/web/index.web99.js +115 -18
  59. package/dist/web-types/eip1193/errors.d.ts +6 -0
  60. package/dist/web-types/eip1193/internal.d.ts +3 -1
  61. package/package.json +2 -2
@@ -1,120 +1,12 @@
1
- import { isJWK as p } from "./index.web109.js";
2
- import { decode as m } from "./index.web95.js";
3
- import y from "./index.web110.js";
4
- import { isCryptoKey as S, isKeyObject as K } from "./index.web108.js";
5
- let c;
6
- const f = async (e, r, s, i = !1) => {
7
- c ||= /* @__PURE__ */ new WeakMap();
8
- let n = c.get(e);
9
- if (n?.[s])
10
- return n[s];
11
- const t = await y({ ...r, alg: s });
12
- return i && Object.freeze(e), n ? n[s] = t : c.set(e, { [s]: t }), t;
13
- }, E = (e, r) => {
14
- c ||= /* @__PURE__ */ new WeakMap();
15
- let s = c.get(e);
16
- if (s?.[r])
17
- return s[r];
18
- const i = e.type === "public", n = !!i;
19
- let t;
20
- if (e.asymmetricKeyType === "x25519") {
21
- switch (r) {
22
- case "ECDH-ES":
23
- case "ECDH-ES+A128KW":
24
- case "ECDH-ES+A192KW":
25
- case "ECDH-ES+A256KW":
26
- break;
27
- default:
28
- throw new TypeError("given KeyObject instance cannot be used for this algorithm");
29
- }
30
- t = e.toCryptoKey(e.asymmetricKeyType, n, i ? [] : ["deriveBits"]);
31
- }
32
- if (e.asymmetricKeyType === "ed25519") {
33
- if (r !== "EdDSA" && r !== "Ed25519")
34
- throw new TypeError("given KeyObject instance cannot be used for this algorithm");
35
- t = e.toCryptoKey(e.asymmetricKeyType, n, [
36
- i ? "verify" : "sign"
37
- ]);
38
- }
39
- if (e.asymmetricKeyType === "rsa") {
40
- let a;
41
- switch (r) {
42
- case "RSA-OAEP":
43
- a = "SHA-1";
44
- break;
45
- case "RS256":
46
- case "PS256":
47
- case "RSA-OAEP-256":
48
- a = "SHA-256";
49
- break;
50
- case "RS384":
51
- case "PS384":
52
- case "RSA-OAEP-384":
53
- a = "SHA-384";
54
- break;
55
- case "RS512":
56
- case "PS512":
57
- case "RSA-OAEP-512":
58
- a = "SHA-512";
59
- break;
60
- default:
61
- throw new TypeError("given KeyObject instance cannot be used for this algorithm");
62
- }
63
- if (r.startsWith("RSA-OAEP"))
64
- return e.toCryptoKey({
65
- name: "RSA-OAEP",
66
- hash: a
67
- }, n, i ? ["encrypt"] : ["decrypt"]);
68
- t = e.toCryptoKey({
69
- name: r.startsWith("PS") ? "RSA-PSS" : "RSASSA-PKCS1-v1_5",
70
- hash: a
71
- }, n, [i ? "verify" : "sign"]);
72
- }
73
- if (e.asymmetricKeyType === "ec") {
74
- const o = (/* @__PURE__ */ new Map([
75
- ["prime256v1", "P-256"],
76
- ["secp384r1", "P-384"],
77
- ["secp521r1", "P-521"]
78
- ])).get(e.asymmetricKeyDetails?.namedCurve);
79
- if (!o)
80
- throw new TypeError("given KeyObject instance cannot be used for this algorithm");
81
- r === "ES256" && o === "P-256" && (t = e.toCryptoKey({
82
- name: "ECDSA",
83
- namedCurve: o
84
- }, n, [i ? "verify" : "sign"])), r === "ES384" && o === "P-384" && (t = e.toCryptoKey({
85
- name: "ECDSA",
86
- namedCurve: o
87
- }, n, [i ? "verify" : "sign"])), r === "ES512" && o === "P-521" && (t = e.toCryptoKey({
88
- name: "ECDSA",
89
- namedCurve: o
90
- }, n, [i ? "verify" : "sign"])), r.startsWith("ECDH-ES") && (t = e.toCryptoKey({
91
- name: "ECDH",
92
- namedCurve: o
93
- }, n, i ? [] : ["deriveBits"]));
94
- }
95
- if (!t)
96
- throw new TypeError("given KeyObject instance cannot be used for this algorithm");
97
- return s ? s[r] = t : c.set(e, { [r]: t }), t;
98
- }, d = async (e, r) => {
99
- if (e instanceof Uint8Array || S(e))
100
- return e;
101
- if (K(e)) {
102
- if (e.type === "secret")
103
- return e.export();
104
- if ("toCryptoKey" in e && typeof e.toCryptoKey == "function")
105
- try {
106
- return E(e, r);
107
- } catch (i) {
108
- if (i instanceof TypeError)
109
- throw i;
110
- }
111
- let s = e.export({ format: "jwk" });
112
- return f(e, s, r);
113
- }
114
- if (p(e))
115
- return e.k ? m(e.k) : f(e, e, r, !0);
116
- throw new Error("unreachable");
1
+ import { contracts as o } from "./index.web111.js";
2
+ import { formatters as r } from "./index.web112.js";
3
+ import { serializers as t } from "./index.web113.js";
4
+ const e = {
5
+ blockTime: 2e3,
6
+ contracts: o,
7
+ formatters: r,
8
+ serializers: t
117
9
  };
118
10
  export {
119
- d as default
11
+ e as chainConfig
120
12
  };
@@ -1,12 +1,81 @@
1
- import { contracts as o } from "./index.web111.js";
2
- import { formatters as r } from "./index.web112.js";
3
- import { serializers as t } from "./index.web113.js";
4
- const e = {
5
- blockTime: 2e3,
6
- contracts: o,
7
- formatters: r,
8
- serializers: t
9
- };
1
+ import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index.web90.js";
2
+ function y(o, t, s, n) {
3
+ if (typeof o.setBigUint64 == "function")
4
+ return o.setBigUint64(t, s, n);
5
+ const i = BigInt(32), h = BigInt(4294967295), e = Number(s >> i & h), r = Number(s & h), c = n ? 4 : 0, u = n ? 0 : 4;
6
+ o.setUint32(t + c, e, n), o.setUint32(t + u, r, n);
7
+ }
8
+ function U(o, t, s) {
9
+ return o & t ^ ~o & s;
10
+ }
11
+ function _(o, t, s) {
12
+ return o & t ^ o & s ^ t & s;
13
+ }
14
+ class m extends g {
15
+ constructor(t, s, n, i) {
16
+ super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = s, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = l(this.buffer);
17
+ }
18
+ update(t) {
19
+ b(this), t = a(t), d(t);
20
+ const { view: s, buffer: n, blockLen: i } = this, h = t.length;
21
+ for (let e = 0; e < h; ) {
22
+ const r = Math.min(i - this.pos, h - e);
23
+ if (r === i) {
24
+ const c = l(t);
25
+ for (; i <= h - e; e += i)
26
+ this.process(c, e);
27
+ continue;
28
+ }
29
+ n.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === i && (this.process(s, 0), this.pos = 0);
30
+ }
31
+ return this.length += t.length, this.roundClean(), this;
32
+ }
33
+ digestInto(t) {
34
+ b(this), x(t, this), this.finished = !0;
35
+ const { buffer: s, view: n, blockLen: i, isLE: h } = this;
36
+ let { pos: e } = this;
37
+ s[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(n, 0), e = 0);
38
+ for (let f = e; f < i; f++)
39
+ s[f] = 0;
40
+ y(n, i - 8, BigInt(this.length * 8), h), this.process(n, 0);
41
+ const r = l(t), c = this.outputLen;
42
+ if (c % 4)
43
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
44
+ const u = c / 4, p = this.get();
45
+ if (u > p.length)
46
+ throw new Error("_sha2: outputLen bigger than state");
47
+ for (let f = 0; f < u; f++)
48
+ r.setUint32(4 * f, p[f], h);
49
+ }
50
+ digest() {
51
+ const { buffer: t, outputLen: s } = this;
52
+ this.digestInto(t);
53
+ const n = t.slice(0, s);
54
+ return this.destroy(), n;
55
+ }
56
+ _cloneInto(t) {
57
+ t || (t = new this.constructor()), t.set(...this.get());
58
+ const { blockLen: s, buffer: n, length: i, finished: h, destroyed: e, pos: r } = this;
59
+ return t.destroyed = e, t.finished = h, t.length = i, t.pos = r, i % s && t.buffer.set(n), t;
60
+ }
61
+ clone() {
62
+ return this._cloneInto();
63
+ }
64
+ }
65
+ const B = /* @__PURE__ */ Uint32Array.from([
66
+ 1779033703,
67
+ 3144134277,
68
+ 1013904242,
69
+ 2773480762,
70
+ 1359893119,
71
+ 2600822924,
72
+ 528734635,
73
+ 1541459225
74
+ ]);
10
75
  export {
11
- e as chainConfig
76
+ U as Chi,
77
+ m as HashMD,
78
+ _ as Maj,
79
+ B as SHA256_IV,
80
+ y as setBigUint64
12
81
  };
@@ -1,41 +1,49 @@
1
- import { Hex as P } from "ox";
2
- import { toHex as f, createWalletClient as A } from "viem";
3
- import { getUserOperation as T, sendUserOperation as R, signEvmTypedData as U, signEvmHash as x, getCurrentUser as v, signOut as O, sendEvmTransaction as b, signEvmTransaction as D, signEvmMessage as H } from "./index.web5.js";
1
+ import { Hex as E } from "ox";
2
+ import { toHex as T, createWalletClient as P } from "viem";
3
+ import { getUserOperation as R, sendUserOperation as b, signEvmTypedData as U, signEvmHash as x, getCurrentUser as w, signOut as H, sendEvmTransaction as O, signEvmTransaction as D, signEvmMessage as N } from "./index.web5.js";
4
4
  import "@coinbase/cdp-api-client";
5
5
  import "./index.web7.js";
6
- import { validateUserConnected as g, RPCRequestError as i, STANDARD_ERROR_CODES as s, validateUserHasEvmSmartAccount as S, validateUserOwnsAddress as l, EIP1193ProviderError as p, validateUserHasEvmAccount as F } from "./index.web8.js";
6
+ import { validateUserConnected as v, validateUserHasEvmSmartAccount as S, RPCRequestError as u, STANDARD_ERROR_CODES as o, validateIsUsingEOA as h, validateUserOwnsAddress as p, EIP1193ProviderError as g } from "./index.web8.js";
7
7
  import "zustand";
8
- import { userOperationChainIdToNameMapping as m, isChainIdSupportedForCDPUserOps as I, isChainIdSupportedForCDPSends as N, sendTransactionChainIdToNameMapping as j, userOperationNameToChainIdMapping as q } from "./index.web17.js";
9
- function w(e) {
8
+ import { userOperationChainIdToNameMapping as m, isChainIdSupportedForCDPUserOps as I, isChainIdSupportedForCDPSends as F, sendTransactionChainIdToNameMapping as j, userOperationNameToChainIdMapping as k } from "./index.web17.js";
9
+ function f(t) {
10
10
  return {
11
- to: e.to,
12
- data: e.data,
13
- value: e.value ? BigInt(e.value) : void 0,
14
- nonce: e.nonce ? Number(e.nonce) : void 0,
15
- gas: e.gas ? BigInt(e.gas) : void 0,
16
- maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
17
- maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
11
+ to: t.to,
12
+ data: t.data,
13
+ value: t.value ? BigInt(t.value) : void 0,
14
+ nonce: t.nonce ? Number(t.nonce) : void 0,
15
+ gas: t.gas ? BigInt(t.gas) : void 0,
16
+ maxFeePerGas: t.maxFeePerGas ? BigInt(t.maxFeePerGas) : void 0,
17
+ maxPriorityFeePerGas: t.maxPriorityFeePerGas ? BigInt(t.maxPriorityFeePerGas) : void 0,
18
18
  type: "eip1559"
19
19
  };
20
20
  }
21
- function G(e) {
22
- return e.map((t) => ({
23
- to: t.to,
24
- data: t.data,
25
- value: t.value ? BigInt(t.value) : void 0
21
+ function q(t) {
22
+ return t.map((e) => ({
23
+ to: e.to,
24
+ data: e.data,
25
+ value: e.value ? BigInt(e.value) : void 0
26
26
  }));
27
27
  }
28
- function M(e) {
28
+ function B(t) {
29
29
  return {
30
30
  atomic: !0,
31
- chainId: f(q[e.network] ?? 0),
32
- id: e.userOpHash,
33
- status: B(e.status),
31
+ chainId: k[t.network] ?? 0,
32
+ receipts: t.receipts?.map((e) => ({
33
+ transactionHash: e.transactionHash,
34
+ blockHash: e.blockHash,
35
+ blockNumber: BigInt(e.blockNumber ?? 0),
36
+ gasUsed: BigInt(e.gasUsed ?? 0),
37
+ logs: [],
38
+ status: ""
39
+ })),
40
+ id: t.userOpHash,
41
+ status: G(t.status),
34
42
  version: "1"
35
43
  };
36
44
  }
37
- function B(e) {
38
- switch (e) {
45
+ function G(t) {
46
+ switch (t) {
39
47
  case "dropped":
40
48
  case "failed":
41
49
  return 400;
@@ -46,207 +54,200 @@ function B(e) {
46
54
  }
47
55
  }
48
56
  async function Q() {
49
- return (await v())?.evmAccounts || [];
50
- }
51
- async function X(e, t) {
52
- const n = await g();
53
- return e.emit("connect", {
54
- chainId: P.fromNumber(t.getState().chainId)
55
- }), n.evmAccounts || [];
56
- }
57
- async function Y(e) {
58
- const [t, n] = e;
59
- await l(n);
60
- const a = Buffer.from(t.slice(2), "hex").toString();
57
+ const t = await w();
58
+ return t?.evmSmartAccounts && t.evmSmartAccounts.length > 0 ? t.evmSmartAccounts : t?.evmAccounts || [];
59
+ }
60
+ async function X(t, e) {
61
+ const a = await v();
62
+ return t.emit("connect", {
63
+ chainId: E.fromNumber(e.getState().chainId)
64
+ }), a.evmSmartAccounts && a.evmSmartAccounts.length > 0 ? a.evmSmartAccounts : a.evmAccounts || [];
65
+ }
66
+ async function Y(t) {
67
+ await h();
68
+ const [e, a] = t;
69
+ await p(a);
70
+ const r = Buffer.from(e.slice(2), "hex").toString();
61
71
  try {
62
- return (await H({
63
- evmAccount: n,
64
- message: a
72
+ return (await N({
73
+ evmAccount: a,
74
+ message: r
65
75
  })).signature;
66
- } catch (o) {
67
- throw new p(
68
- s.provider.userRejectedRequest,
69
- o instanceof Error ? o.message : "Signing failed"
76
+ } catch (n) {
77
+ throw new g(
78
+ o.provider.userRejectedRequest,
79
+ n instanceof Error ? n.message : "Signing failed"
70
80
  );
71
81
  }
72
82
  }
73
- async function Z(e) {
74
- const [t, n] = e;
75
- await l(t);
83
+ async function Z(t) {
84
+ await h();
85
+ const [e, a] = t;
86
+ await p(e);
76
87
  try {
77
88
  return (await U({
78
- evmAccount: t,
79
- typedData: JSON.parse(n)
89
+ evmAccount: e,
90
+ typedData: JSON.parse(a)
80
91
  })).signature;
81
- } catch (a) {
82
- throw new p(
83
- s.provider.userRejectedRequest,
84
- a instanceof Error ? a.message : "Signing failed"
92
+ } catch (r) {
93
+ throw new g(
94
+ o.provider.userRejectedRequest,
95
+ r instanceof Error ? r.message : "Signing failed"
85
96
  );
86
97
  }
87
98
  }
88
- async function ee(e, t, n) {
89
- const [a] = e;
90
- if (!a || typeof a != "object")
91
- throw new i(
92
- s.rpc.invalidParams,
99
+ async function tt(t, e, a) {
100
+ const r = await h({
101
+ errorMessage: "sendTransaction with a smart account is not supported. Use sendCalls instead."
102
+ }), [n] = t;
103
+ if (!n || typeof n != "object")
104
+ throw new u(
105
+ o.rpc.invalidParams,
93
106
  "Transaction parameter must be an object"
94
107
  );
95
- if (!a.to)
96
- throw new i(
97
- s.rpc.invalidParams,
108
+ if (!n.to)
109
+ throw new u(
110
+ o.rpc.invalidParams,
98
111
  "Transaction must include 'to' field"
99
112
  );
100
- const d = (await F()).evmAccounts?.[0], c = t.getState(), r = a.chainId ? Number(a.chainId) : c.chainId;
113
+ const d = r.evmAccounts?.[0], i = e.getState(), s = n.chainId ? Number(n.chainId) : i.chainId;
101
114
  if (!d)
102
- throw new i(
103
- s.rpc.invalidParams,
115
+ throw new u(
116
+ o.rpc.invalidParams,
104
117
  "User does not have an EVM account"
105
118
  );
106
- if (N(r))
119
+ if (F(s))
107
120
  try {
108
- return (await b({
121
+ return (await O({
109
122
  evmAccount: d,
110
- transaction: { ...w(a), chainId: r },
111
- network: j[r]
123
+ transaction: { ...f(n), chainId: s },
124
+ network: j[s]
112
125
  })).transactionHash;
113
- } catch (u) {
114
- throw console.log("Transaction failed", u), new i(
115
- s.rpc.transactionRejected,
116
- u instanceof Error ? u.message : "Transaction failed"
126
+ } catch (c) {
127
+ throw console.log("Transaction failed", c), new u(
128
+ o.rpc.transactionRejected,
129
+ c instanceof Error ? c.message : "Transaction failed"
117
130
  );
118
131
  }
119
132
  else
120
133
  try {
121
- const u = A({
134
+ const c = P({
122
135
  // Safe as we check before calling this handler that chainId is configured
123
- chain: c.chains.find((h) => h.id === r),
124
- transport: n[r],
136
+ chain: i.chains.find((l) => l.id === s),
137
+ transport: a[s],
125
138
  account: d
126
- }), y = c.chains.find((h) => h.id === r), C = await u.prepareTransactionRequest({
127
- ...w(a),
139
+ }), y = i.chains.find((l) => l.id === s), A = await c.prepareTransactionRequest({
140
+ ...f(n),
128
141
  chain: y
129
- }), E = await D({
142
+ }), C = await D({
130
143
  evmAccount: d,
131
144
  transaction: {
132
- ...C,
145
+ ...A,
133
146
  type: "eip1559"
134
147
  }
135
148
  });
136
- return await u.sendRawTransaction({
137
- serializedTransaction: E.signedTransaction
149
+ return await c.sendRawTransaction({
150
+ serializedTransaction: C.signedTransaction
138
151
  });
139
- } catch (u) {
140
- throw new i(
141
- s.rpc.transactionRejected,
142
- u instanceof Error ? u.message : "Transaction failed"
152
+ } catch (c) {
153
+ throw new u(
154
+ o.rpc.transactionRejected,
155
+ c instanceof Error ? c.message : "Transaction failed"
143
156
  );
144
157
  }
145
158
  }
146
- async function te(e) {
147
- const [t, n] = e;
148
- await l(n);
159
+ async function et(t) {
160
+ await h();
161
+ const [e, a] = t;
162
+ await p(a);
149
163
  try {
150
164
  return (await x({
151
- evmAccount: n,
152
- hash: t
165
+ evmAccount: a,
166
+ hash: e
153
167
  })).signature;
154
- } catch (a) {
155
- throw new p(
156
- s.provider.userRejectedRequest,
157
- a instanceof Error ? a.message : "Signing failed"
168
+ } catch (r) {
169
+ throw new g(
170
+ o.provider.userRejectedRequest,
171
+ r instanceof Error ? r.message : "Signing failed"
158
172
  );
159
173
  }
160
174
  }
161
- async function ae(e) {
162
- return `0x${e.getState().chainId.toString(16)}`;
175
+ async function at(t) {
176
+ return `0x${t.getState().chainId.toString(16)}`;
163
177
  }
164
- async function ne() {
165
- await v() && await O();
178
+ async function nt() {
179
+ await w() && await H();
166
180
  }
167
- function re(e, t) {
168
- const n = Number.parseInt(e[0].chainId, 16);
169
- t.getState().setChainId(n);
181
+ function rt(t, e) {
182
+ const a = Number.parseInt(t[0].chainId, 16);
183
+ e.getState().setChainId(a);
170
184
  }
171
- async function se(e, t) {
172
- const n = e[0].calls, o = (await S()).evmSmartAccounts?.[0], c = t.getState().chainId;
173
- if (!o)
174
- throw new i(
175
- s.rpc.invalidParams,
176
- "User does not have an EVM smart account"
177
- );
178
- if (!I(c))
179
- throw new i(
180
- s.rpc.invalidParams,
185
+ async function st(t, e) {
186
+ const a = t[0].calls, n = (await S()).evmSmartAccounts?.[0], i = e.getState().chainId;
187
+ if (!I(i))
188
+ throw new u(
189
+ o.rpc.invalidParams,
181
190
  "Chain ID is not supported for user operations"
182
191
  );
183
192
  try {
184
- return (await R({
185
- evmSmartAccount: o,
186
- calls: G(n),
187
- network: m[c]
193
+ return (await b({
194
+ evmSmartAccount: n,
195
+ calls: q(a),
196
+ network: m[i]
188
197
  })).userOperationHash;
189
- } catch (r) {
190
- throw console.log("User operation failed", r), new i(
191
- s.rpc.transactionRejected,
192
- r instanceof Error ? r.message : "User operation failed"
198
+ } catch (s) {
199
+ throw console.log("User operation failed", s), new u(
200
+ o.rpc.transactionRejected,
201
+ s instanceof Error ? s.message : "User operation failed"
193
202
  );
194
203
  }
195
204
  }
196
- async function oe(e, t) {
197
- const n = e[0], o = (await S()).evmSmartAccounts?.[0], c = t.getState().chainId;
198
- if (!o)
199
- throw new i(
200
- s.rpc.invalidParams,
201
- "User does not have an EVM smart account"
202
- );
203
- if (!I(c) || !m[c])
204
- throw new i(
205
- s.rpc.invalidParams,
205
+ async function ot(t, e) {
206
+ const a = t[0], n = (await S()).evmSmartAccounts?.[0], i = e.getState().chainId;
207
+ if (!I(i) || !m[i])
208
+ throw new u(
209
+ o.rpc.invalidParams,
206
210
  "Chain ID is not supported for user operations"
207
211
  );
208
212
  try {
209
- const r = await T({
210
- userOperationHash: n,
211
- evmSmartAccount: o,
212
- network: m[c]
213
+ const s = await R({
214
+ userOperationHash: a,
215
+ evmSmartAccount: n,
216
+ network: m[i]
213
217
  });
214
- return M(r);
215
- } catch (r) {
216
- throw console.log("Failed to get user operation status", r), new i(
217
- s.rpc.internal,
218
+ return B(s);
219
+ } catch (s) {
220
+ throw console.log("Failed to get user operation status", s), new u(
221
+ o.rpc.internal,
218
222
  "Failed to get user operation status"
219
223
  );
220
224
  }
221
225
  }
222
- async function ie() {
223
- const e = await g();
224
- if (!e)
225
- throw new i(s.rpc.invalidParams, "User is not connected");
226
- return !e.evmSmartAccounts?.length ? {} : Object.keys(m).reduce(
227
- (a, o) => {
228
- const d = f(Number(o));
229
- return a[d] = {
226
+ async function it() {
227
+ return !(await v()).evmSmartAccounts?.length ? {} : Object.keys(m).reduce(
228
+ (r, n) => {
229
+ const d = T(Number(n));
230
+ return r[d] = {
230
231
  atomic: { status: "supported" },
231
232
  paymasterService: { supported: !0 }
232
- }, a;
233
+ }, r;
233
234
  },
234
235
  {}
235
236
  );
236
237
  }
237
238
  export {
238
239
  Q as handleAccounts,
239
- ae as handleChainId,
240
- ne as handleDisconnect,
241
- te as handleEthSign,
242
- oe as handleGetCallsStatus,
243
- ie as handleGetCapabilities,
240
+ at as handleChainId,
241
+ nt as handleDisconnect,
242
+ et as handleEthSign,
243
+ ot as handleGetCallsStatus,
244
+ it as handleGetCapabilities,
244
245
  Y as handlePersonalSign,
245
246
  X as handleRequestAccounts,
246
- se as handleSendCalls,
247
- ee as handleSendTransaction,
247
+ st as handleSendCalls,
248
+ tt as handleSendTransaction,
248
249
  Z as handleSignTypedData,
249
- re as handleSwitchEthereumChain,
250
- G as shimProviderCallsRequest,
251
- w as shimProviderTxRequest
250
+ rt as handleSwitchEthereumChain,
251
+ q as shimProviderCallsRequest,
252
+ f as shimProviderTxRequest
252
253
  };
@@ -1,4 +1,4 @@
1
- import { chainConfig as a } from "./index.web101.js";
1
+ import { chainConfig as a } from "./index.web100.js";
2
2
  import { defineChain as t } from "./index.web37.js";
3
3
  const e = 11155111, r = /* @__PURE__ */ t({
4
4
  ...a,