@seedprotocol/publish 0.7.10 → 0.7.11-next.1396.g883ef47
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/CHANGELOG.md +9 -1
- package/README.md +1 -1
- package/dist/{chainConfig-B8U89YJb.js → chainConfig-nYXoVL1s.js} +1283 -1284
- package/dist/chainConfig-nYXoVL1s.js.map +1 -0
- package/dist/{collectBatchUids-CnIe9jUB.js → collectBatchUids-qRc2q61Q.js} +1 -2
- package/dist/collectBatchUids-qRc2q61Q.js.map +1 -0
- package/dist/config.d.ts +0 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/{ensureAutomationSessionKey-B19eVd1T.js → ensureAutomationSessionKey-BaaHU2Wb.js} +27 -27
- package/dist/{ensureAutomationSessionKey-B19eVd1T.js.map → ensureAutomationSessionKey-BaaHU2Wb.js.map} +1 -1
- package/dist/{ensureModularPublishBootstrap-COEV4BGz.js → ensureModularPublishBootstrap-NzYQ1MfY.js} +9 -9
- package/dist/{ensureModularPublishBootstrap-COEV4BGz.js.map → ensureModularPublishBootstrap-NzYQ1MfY.js.map} +1 -1
- package/dist/{ensureSmartWalletThenPublish-DhWyUjt0.js → ensureSmartWalletThenPublish-CpuDoo5O.js} +16 -16
- package/dist/{ensureSmartWalletThenPublish-DhWyUjt0.js.map → ensureSmartWalletThenPublish-CpuDoo5O.js.map} +1 -1
- package/dist/helpers/adapters/eip1193.d.ts +1 -3
- package/dist/helpers/adapters/eip1193.d.ts.map +1 -1
- package/dist/helpers/assertStorageBoundToIdentity.d.ts.map +1 -1
- package/dist/helpers/constants.d.ts +0 -13
- package/dist/helpers/constants.d.ts.map +1 -1
- package/dist/helpers/enrollPublishAutomation.d.ts +5 -1
- package/dist/helpers/enrollPublishAutomation.d.ts.map +1 -1
- package/dist/helpers/publishWalletRegistry.d.ts +1 -5
- package/dist/helpers/publishWalletRegistry.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +239 -239
- package/dist/index.js.map +1 -1
- package/dist/managedAccountAdmin-BeSXTCeH.js +26 -0
- package/dist/{managedAccountAdmin-xZbC3bQ5.js.map → managedAccountAdmin-BeSXTCeH.js.map} +1 -1
- package/dist/{publishAuthorization-CpmPRbpm.js → publishAuthorization-CVl5ZK5B.js} +37 -34
- package/dist/publishAuthorization-CVl5ZK5B.js.map +1 -0
- package/dist/publishWalletRegistry-BaQe9rIR.js.map +1 -1
- package/dist/react/PublishProvider.thirdweb.d.ts +0 -1
- package/dist/react/PublishProvider.thirdweb.d.ts.map +1 -1
- package/dist/{resolveRevokeAccount-D08n9UTy.js → resolveRevokeAccount-DRrUY9FR.js} +12 -12
- package/dist/{resolveRevokeAccount-D08n9UTy.js.map → resolveRevokeAccount-DRrUY9FR.js.map} +1 -1
- package/dist/services/domainOwnership/index.d.ts.map +1 -1
- package/dist/services/domainOwnership/public.d.ts +1 -1
- package/dist/services/domainOwnership/public.d.ts.map +1 -1
- package/dist/services/publish/actors/index.d.ts +1 -1
- package/dist/services/publish/actors/index.d.ts.map +1 -1
- package/dist/services/publish/actors/seedUidHelpers.d.ts +0 -39
- package/dist/services/publish/actors/seedUidHelpers.d.ts.map +1 -1
- package/dist/services/publish/actors/utils.d.ts +0 -1
- package/dist/services/publish/actors/utils.d.ts.map +1 -1
- package/dist/services/publish/index.d.ts +4 -6
- package/dist/services/publish/index.d.ts.map +1 -1
- package/dist/services/publishAuthorization/index.d.ts +1 -1
- package/dist/services/publishAuthorization/index.d.ts.map +1 -1
- package/dist/services/publishCost/index.d.ts +2 -2
- package/dist/services/publishCost/index.d.ts.map +1 -1
- package/dist/services/publishedBy/collectBatchUids.d.ts +0 -2
- package/dist/services/publishedBy/collectBatchUids.d.ts.map +1 -1
- package/dist/services/publishedBy/index.d.ts +1 -3
- package/dist/services/publishedBy/index.d.ts.map +1 -1
- package/dist/services/publishedBy/public.d.ts +1 -1
- package/dist/services/publishedBy/public.d.ts.map +1 -1
- package/dist/thirdweb.js +129 -128
- package/dist/thirdweb.js.map +1 -1
- package/dist/{worker-4DXDWw6E.js → worker-D1czx7Yg.js} +2 -2
- package/dist/{worker-4DXDWw6E.js.map → worker-D1czx7Yg.js.map} +1 -1
- package/package.json +7 -9
- package/dist/chainConfig-B8U89YJb.js.map +0 -1
- package/dist/collectBatchUids-CnIe9jUB.js.map +0 -1
- package/dist/managedAccountAdmin-xZbC3bQ5.js +0 -26
- package/dist/publishAuthorization-CpmPRbpm.js.map +0 -1
- package/dist/services/publish/seeds.d.ts +0 -2
- package/dist/services/publish/seeds.d.ts.map +0 -1
- package/dist/services/shared.d.ts +0 -7
- package/dist/services/shared.d.ts.map +0 -1
package/dist/thirdweb.js
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
import { $ as e,
|
|
2
|
-
import { i as
|
|
3
|
-
import { a as O, d as k, f as A, g as j, h as M, l as N, m as P, p as F, u as I } from "./publishAuthorization-
|
|
4
|
-
import { t as L } from "./ensureSmartWalletThenPublish-
|
|
5
|
-
import { t as R } from "./ensureModularPublishBootstrap-
|
|
6
|
-
import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-
|
|
1
|
+
import { $ as e, A as t, B as n, Bt as r, G as i, Gt as a, H as o, I as s, J as c, K as l, Kt as u, L as ee, Lt as te, M as ne, N as d, P as re, Q as f, R as ie, U as p, Ut as ae, V as m, Vt as h, W as g, X as oe, Y as se, Z as _, a as v, et as ce, gt as y, ht as b, i as x, j as le, mt as ue, nt as de, p as S, pt as fe, q as C, r as pe, rt as w, t as T, tt as me, z as E } from "./chainConfig-nYXoVL1s.js";
|
|
2
|
+
import { i as he, t as D } from "./publishWalletRegistry-BaQe9rIR.js";
|
|
3
|
+
import { a as O, d as k, f as A, g as j, h as M, l as N, m as P, p as F, u as I } from "./publishAuthorization-CVl5ZK5B.js";
|
|
4
|
+
import { t as L } from "./ensureSmartWalletThenPublish-CpuDoo5O.js";
|
|
5
|
+
import { t as R } from "./ensureModularPublishBootstrap-NzYQ1MfY.js";
|
|
6
|
+
import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-BaaHU2Wb.js";
|
|
7
7
|
import { client as H } from "@seedprotocol/sdk";
|
|
8
8
|
import { deploySmartAccount as ge, getContract as U, sendTransaction as _e } from "thirdweb";
|
|
9
9
|
import { ConnectButton as ve, ThirdwebProvider as ye, darkTheme as be, useActiveAccount as xe, useActiveWallet as Se, useActiveWalletConnectionStatus as Ce, useIsAutoConnecting as we } from "thirdweb/react";
|
|
10
10
|
import { useCallback as Te, useEffect as W, useRef as G } from "react";
|
|
11
|
-
import {
|
|
11
|
+
import { PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS as Ee, assessPublishAuthorization as De, decodePublishAuthorizationData as Oe, getPublishAuthorizationFromEas as ke } from "@seedprotocol/eas";
|
|
12
12
|
import { jsx as K } from "react/jsx-runtime";
|
|
13
|
-
import { SeedProvider as
|
|
14
|
-
import { addSessionKey as
|
|
13
|
+
import { SeedProvider as Ae } from "@seedprotocol/react";
|
|
14
|
+
import { addSessionKey as je, shouldUpdateSessionKey as Me } from "thirdweb/extensions/erc4337";
|
|
15
15
|
//#region src/react/ConnectButton.tsx
|
|
16
16
|
var q = "seedProtocol:publish:userChoseWalletDisconnect";
|
|
17
|
-
function
|
|
18
|
-
console.warn("[ConnectButton] Wallet setup / module install skipped:", e),
|
|
17
|
+
function Ne(e) {
|
|
18
|
+
console.warn("[ConnectButton] Wallet setup / module install skipped:", e), x().onWalletSetupWarning?.(e);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Pe() {
|
|
21
21
|
return H.isInitialized() ? Promise.resolve() : new Promise((e) => {
|
|
22
22
|
H.onReady(() => e());
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
async function
|
|
25
|
+
async function Fe(e, t, n) {
|
|
26
26
|
if (n.modularAccountModuleContract) {
|
|
27
27
|
if (n.useModularExecutor) {
|
|
28
28
|
if (!t) return;
|
|
29
29
|
try {
|
|
30
|
-
|
|
31
|
-
let e =
|
|
30
|
+
_();
|
|
31
|
+
let e = p();
|
|
32
32
|
await e.autoConnect({
|
|
33
|
-
client:
|
|
34
|
-
chain:
|
|
33
|
+
client: w(),
|
|
34
|
+
chain: y(n)
|
|
35
35
|
});
|
|
36
36
|
let r = e.getAccount();
|
|
37
37
|
if (!r) return;
|
|
38
|
-
await
|
|
38
|
+
await d(t, r, n);
|
|
39
39
|
} catch {}
|
|
40
40
|
} else try {
|
|
41
|
-
await
|
|
41
|
+
await d(e.address, e, n);
|
|
42
42
|
} catch (e) {
|
|
43
|
-
|
|
43
|
+
Ne(e);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
let e = j(),
|
|
47
|
+
var Ie = () => {
|
|
48
|
+
let e = j(), t = y(e), n = Se(), r = xe(), i = Ce(), a = we(), o = G(null), s = G(!1), c = G(!1);
|
|
49
49
|
W(() => {
|
|
50
50
|
if (typeof window > "u") return;
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
let
|
|
51
|
+
let n = s.current;
|
|
52
|
+
s.current = a;
|
|
53
|
+
let r;
|
|
54
54
|
try {
|
|
55
|
-
|
|
55
|
+
r = performance.getEntriesByType("navigation")[0]?.type;
|
|
56
56
|
} catch {
|
|
57
|
-
|
|
57
|
+
r = void 0;
|
|
58
58
|
}
|
|
59
|
-
if (
|
|
60
|
-
let
|
|
59
|
+
if (r !== "reload") return;
|
|
60
|
+
let o = !1;
|
|
61
61
|
try {
|
|
62
|
-
|
|
62
|
+
o = sessionStorage.getItem(q) === "1";
|
|
63
63
|
} catch {
|
|
64
|
-
|
|
64
|
+
o = !1;
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
client:
|
|
68
|
-
chain:
|
|
66
|
+
o || n && !a && i === "disconnected" && (c.current || (c.current = !0, (e.useModularExecutor ? g() : p()).autoConnect({
|
|
67
|
+
client: w(),
|
|
68
|
+
chain: t
|
|
69
69
|
}).catch(() => {})));
|
|
70
70
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
i,
|
|
72
|
+
a,
|
|
73
73
|
e.useModularExecutor,
|
|
74
|
-
|
|
74
|
+
t
|
|
75
75
|
]);
|
|
76
|
-
let
|
|
77
|
-
let
|
|
78
|
-
if (!
|
|
79
|
-
await
|
|
80
|
-
let
|
|
76
|
+
let u = Te(async (n) => {
|
|
77
|
+
let r = n.getAccount();
|
|
78
|
+
if (!r) return;
|
|
79
|
+
await Pe();
|
|
80
|
+
let i = /* @__PURE__ */ new Set([r.address.toLowerCase()]), a;
|
|
81
81
|
if (e.useModularExecutor) {
|
|
82
|
-
|
|
83
|
-
let e =
|
|
82
|
+
_();
|
|
83
|
+
let e = n.getAdminAccount?.()?.address ?? r.address, o = async () => {
|
|
84
84
|
try {
|
|
85
|
-
return await
|
|
85
|
+
return await m(t);
|
|
86
86
|
} catch {
|
|
87
87
|
try {
|
|
88
|
-
return await
|
|
88
|
+
return await l(e);
|
|
89
89
|
} catch {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
|
|
94
|
+
a = await o(), a ||= (await new Promise((e) => queueMicrotask(() => e())), await o()), a && i.add(a.toLowerCase());
|
|
95
95
|
}
|
|
96
|
-
let
|
|
97
|
-
if (
|
|
98
|
-
|
|
96
|
+
let s = [...i].sort().join(",");
|
|
97
|
+
if (o.current !== s) {
|
|
98
|
+
o.current !== null && S.stopAll(), o.current = s;
|
|
99
99
|
try {
|
|
100
|
-
let e =
|
|
101
|
-
await
|
|
102
|
-
...
|
|
103
|
-
ownedAddresses: [...
|
|
104
|
-
publisherAddress:
|
|
105
|
-
...
|
|
106
|
-
...
|
|
107
|
-
await
|
|
100
|
+
let e = n.getAdminAccount?.()?.address, t = !!a || !!e && e.toLowerCase() !== r.address.toLowerCase(), o = b(r, { kind: t ? "smart" : "eoa" }), s = n.getAdminAccount?.(), c = a ? o.signer : t && s && s.address.toLowerCase() !== r.address.toLowerCase() ? b(s, { kind: "eoa" }).signer : void 0;
|
|
101
|
+
await he({
|
|
102
|
+
...o,
|
|
103
|
+
ownedAddresses: [...i],
|
|
104
|
+
publisherAddress: a ?? r.address,
|
|
105
|
+
...c ? { dataItemSigner: c } : {},
|
|
106
|
+
...t && !a ? { deploy: async () => {
|
|
107
|
+
await E(r);
|
|
108
108
|
} } : {},
|
|
109
|
-
...e && e.toLowerCase() !==
|
|
109
|
+
...e && e.toLowerCase() !== r.address.toLowerCase() ? { adminAddress: e } : {}
|
|
110
110
|
});
|
|
111
111
|
} catch (e) {
|
|
112
|
-
throw
|
|
112
|
+
throw o.current = null, console.warn("[ConnectButton] Failed to set seed client addresses:", e), e;
|
|
113
113
|
}
|
|
114
|
-
await
|
|
114
|
+
await Fe(r, a, e);
|
|
115
115
|
}
|
|
116
116
|
}, [e]);
|
|
117
117
|
return W(() => {
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
120
|
-
|
|
118
|
+
if (a) return;
|
|
119
|
+
if (i !== "connected") {
|
|
120
|
+
o.current = null;
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
if (!
|
|
123
|
+
if (!n) return;
|
|
124
124
|
let e = !1;
|
|
125
125
|
return (async () => {
|
|
126
126
|
try {
|
|
127
127
|
if (e) return;
|
|
128
|
-
await
|
|
128
|
+
await u(n);
|
|
129
129
|
} catch {}
|
|
130
130
|
})(), () => {
|
|
131
131
|
e = !0;
|
|
132
132
|
};
|
|
133
133
|
}, [
|
|
134
|
+
n,
|
|
135
|
+
r?.address,
|
|
136
|
+
i,
|
|
134
137
|
a,
|
|
135
|
-
|
|
136
|
-
c,
|
|
137
|
-
l,
|
|
138
|
-
m
|
|
138
|
+
u
|
|
139
139
|
]), /* @__PURE__ */ K(ve, {
|
|
140
|
-
client:
|
|
141
|
-
wallets:
|
|
140
|
+
client: w(),
|
|
141
|
+
wallets: C(e),
|
|
142
142
|
autoConnect: !0,
|
|
143
|
-
chain:
|
|
144
|
-
chains: [
|
|
143
|
+
chain: t,
|
|
144
|
+
chains: [t],
|
|
145
145
|
onConnect: async (e, t) => {
|
|
146
146
|
let n = e.getAccount();
|
|
147
147
|
if (n) {
|
|
@@ -150,7 +150,7 @@ var Fe = () => {
|
|
|
150
150
|
} catch {}
|
|
151
151
|
console.log("[ConnectButton] Connected", n.address);
|
|
152
152
|
try {
|
|
153
|
-
await
|
|
153
|
+
await u(e);
|
|
154
154
|
} catch {}
|
|
155
155
|
}
|
|
156
156
|
},
|
|
@@ -169,44 +169,44 @@ var Fe = () => {
|
|
|
169
169
|
borderColor: "#344054"
|
|
170
170
|
} })
|
|
171
171
|
});
|
|
172
|
-
},
|
|
172
|
+
}, Le = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => {
|
|
173
173
|
let i = G(void 0);
|
|
174
|
-
return t && i.current !== t && (
|
|
175
|
-
value: t ??
|
|
176
|
-
children: /* @__PURE__ */ K(ye, { children: /* @__PURE__ */ K(
|
|
174
|
+
return t && i.current !== t && (v(t), i.current = t), /* @__PURE__ */ K(M.Provider, {
|
|
175
|
+
value: t ?? pe(),
|
|
176
|
+
children: /* @__PURE__ */ K(ye, { children: /* @__PURE__ */ K(Ae, {
|
|
177
177
|
queryClient: n,
|
|
178
178
|
queryClientRef: r,
|
|
179
179
|
children: e
|
|
180
180
|
}) })
|
|
181
181
|
});
|
|
182
|
-
},
|
|
183
|
-
async function
|
|
184
|
-
let { autoDeployEip7702ModularAccount: e } =
|
|
182
|
+
}, Re = "Modular (EIP-7702) wallet is not connected. Sign in with the same method and try again.", ze = () => `Your modular account is not upgraded to an EIP-7702 smart account on ${T()} yet. Enable autoDeployEip7702ModularAccount in publish config or complete wallet setup, then retry.`, J = () => `Automatic EIP-7702 smart account setup failed on ${T()}. Retry or reconnect your wallet.`, Be = "EIP-7702 upgrade was sent but on-chain bytecode was not detected yet. Wait a moment and retry.", Y = 5;
|
|
183
|
+
async function Ve() {
|
|
184
|
+
let { autoDeployEip7702ModularAccount: e } = x(), t = g();
|
|
185
185
|
await t.autoConnect({
|
|
186
|
-
client:
|
|
187
|
-
chain:
|
|
186
|
+
client: w(),
|
|
187
|
+
chain: y()
|
|
188
188
|
});
|
|
189
189
|
let n = t.getAccount();
|
|
190
|
-
if (!n) throw new
|
|
191
|
-
let i =
|
|
190
|
+
if (!n) throw new a(Re, "EIP7702_MODULAR_ACCOUNT_UNAVAILABLE");
|
|
191
|
+
let i = w(), o = U({
|
|
192
192
|
client: i,
|
|
193
|
-
chain:
|
|
193
|
+
chain: y(),
|
|
194
194
|
address: n.address
|
|
195
195
|
});
|
|
196
|
-
if (!await
|
|
197
|
-
if (!e) throw new
|
|
196
|
+
if (!await r(n.address)) {
|
|
197
|
+
if (!e) throw new a(ze(), "EIP7702_MODULAR_NOT_UPGRADED", n.address);
|
|
198
198
|
try {
|
|
199
199
|
await ge({
|
|
200
200
|
smartAccount: n,
|
|
201
|
-
chain:
|
|
201
|
+
chain: y(),
|
|
202
202
|
client: i,
|
|
203
203
|
accountContract: o
|
|
204
204
|
});
|
|
205
205
|
} catch (e) {
|
|
206
|
-
if (await
|
|
207
|
-
throw new
|
|
206
|
+
if (await h(n.address, Y)) return;
|
|
207
|
+
throw new a(J(), "EIP7702_MODULAR_DEPLOY_FAILED", n.address, e);
|
|
208
208
|
}
|
|
209
|
-
if (!await
|
|
209
|
+
if (!await h(n.address, Y)) throw new a(Be, "EIP7702_MODULAR_NOT_CONFIRMED", n.address);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
@@ -216,34 +216,34 @@ function X(e) {
|
|
|
216
216
|
}
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region src/helpers/ensureManagedSignerSessionKey.ts
|
|
219
|
-
var
|
|
220
|
-
async function
|
|
221
|
-
let { managedAddress: t, signerAddress: n } = e, r =
|
|
219
|
+
var He = () => `Could not connect the managed publishing account to authorize the modular signer on ${T()}. Reconnect and try again.`, Z = () => `Could not authorize the modular wallet as a session signer on your publishing account on ${T()}.`;
|
|
220
|
+
async function Ue(e) {
|
|
221
|
+
let { managedAddress: t, signerAddress: n } = e, r = p();
|
|
222
222
|
await r.autoConnect({
|
|
223
|
-
client:
|
|
224
|
-
chain:
|
|
223
|
+
client: w(),
|
|
224
|
+
chain: y()
|
|
225
225
|
});
|
|
226
226
|
let i = r.getAccount();
|
|
227
|
-
if (!i) throw new
|
|
227
|
+
if (!i) throw new u(He(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
|
|
228
228
|
let a = U({
|
|
229
|
-
client:
|
|
230
|
-
chain:
|
|
229
|
+
client: w(),
|
|
230
|
+
chain: y(),
|
|
231
231
|
address: t
|
|
232
232
|
}), o = {
|
|
233
233
|
approvedTargets: X(t),
|
|
234
234
|
nativeTokenLimitPerTransaction: 0
|
|
235
235
|
}, s = !1;
|
|
236
236
|
try {
|
|
237
|
-
s = await
|
|
237
|
+
s = await Me({
|
|
238
238
|
accountContract: a,
|
|
239
239
|
sessionKeyAddress: n,
|
|
240
240
|
newPermissions: o
|
|
241
241
|
});
|
|
242
242
|
} catch (e) {
|
|
243
|
-
throw new
|
|
243
|
+
throw new u(Z(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
|
|
244
244
|
}
|
|
245
245
|
if (s) try {
|
|
246
|
-
let e =
|
|
246
|
+
let e = je({
|
|
247
247
|
contract: a,
|
|
248
248
|
account: i,
|
|
249
249
|
sessionKeyAddress: n,
|
|
@@ -252,47 +252,47 @@ async function He(e) {
|
|
|
252
252
|
account: i,
|
|
253
253
|
transaction: e
|
|
254
254
|
});
|
|
255
|
-
await
|
|
255
|
+
await ae(t.transactionHash);
|
|
256
256
|
} catch (e) {
|
|
257
|
-
throw new
|
|
257
|
+
throw new u(Z(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
|
|
258
258
|
}
|
|
259
259
|
let c = !1;
|
|
260
260
|
try {
|
|
261
|
-
c = await
|
|
261
|
+
c = await te(t, n);
|
|
262
262
|
} catch (e) {
|
|
263
|
-
throw new
|
|
263
|
+
throw new u(Z(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
|
|
264
264
|
}
|
|
265
|
-
if (!c) throw new
|
|
265
|
+
if (!c) throw new u(Z(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
|
|
266
266
|
}
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/helpers/enrollPublishAutomation.ts
|
|
269
269
|
async function Q(e) {
|
|
270
|
-
let t =
|
|
270
|
+
let t = p();
|
|
271
271
|
await t.autoConnect({
|
|
272
|
-
client:
|
|
273
|
-
chain:
|
|
272
|
+
client: w(),
|
|
273
|
+
chain: y()
|
|
274
274
|
});
|
|
275
275
|
let n = t.getAccount();
|
|
276
|
-
if (!n) throw new
|
|
276
|
+
if (!n) throw new u("Could not connect the managed publishing account to enroll or revoke publish automation.", "MANAGED_ACCOUNT_UNAVAILABLE", e);
|
|
277
277
|
return n;
|
|
278
278
|
}
|
|
279
279
|
async function $(e, t) {
|
|
280
280
|
return t || b(await Q(e), { kind: "smart" });
|
|
281
281
|
}
|
|
282
|
-
async function
|
|
283
|
-
let t =
|
|
282
|
+
async function We(e) {
|
|
283
|
+
let t = x();
|
|
284
284
|
if (!t.modularAccountModuleContract?.trim()) throw Error("@seedprotocol/publish: enrollPublishAutomation requires PublishConfig.modularAccountModuleContract");
|
|
285
|
-
let
|
|
285
|
+
let n = await Q(e), r;
|
|
286
286
|
try {
|
|
287
|
-
|
|
287
|
+
r = await d(e, n, t);
|
|
288
288
|
} catch (t) {
|
|
289
|
-
throw t instanceof
|
|
289
|
+
throw t instanceof u ? t : new u("Executor module setup failed for publish automation.", "EXECUTOR_MODULE_NOT_INSTALLED", e, t);
|
|
290
290
|
}
|
|
291
|
-
await
|
|
291
|
+
await re(e, r.status === "installed" ? { installedEas: r.eas } : { readAttempts: r.status === "already-installed" ? 5 : 1 });
|
|
292
292
|
}
|
|
293
|
-
async function
|
|
294
|
-
let { managedAddress: t, sessionKeyAddress: n, appAddress: r, expiresAt:
|
|
295
|
-
await
|
|
293
|
+
async function Ge(e) {
|
|
294
|
+
let { managedAddress: t, sessionKeyAddress: n, appAddress: r } = e, i = typeof e.expiresAt == "number" && e.expiresAt > 0 ? Math.trunc(e.expiresAt) : Math.floor(Date.now() / 1e3) + Ee;
|
|
295
|
+
await We(t), await V({
|
|
296
296
|
managedAddress: t,
|
|
297
297
|
sessionKeyAddress: n,
|
|
298
298
|
expiresAt: i
|
|
@@ -310,7 +310,7 @@ async function We(e) {
|
|
|
310
310
|
})
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
async function
|
|
313
|
+
async function Ke(e) {
|
|
314
314
|
let { managedAddress: t, sessionKeyAddress: n, authorizationUid: r } = e, i = await $(t, e.userWallet);
|
|
315
315
|
await z({
|
|
316
316
|
managedAddress: t,
|
|
@@ -322,7 +322,7 @@ async function Ge(e) {
|
|
|
322
322
|
}
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region src/helpers/assertStorageBoundToIdentity.ts
|
|
325
|
-
async function
|
|
325
|
+
async function qe(e) {
|
|
326
326
|
let { managedAddress: t, dataItemOwner: n, atTime: r, allowActiveSessionKey: i = !0, allowSidecar: a = !0 } = e, o = [], s = n.trim().toLowerCase(), c = t.trim().toLowerCase();
|
|
327
327
|
if (!/^0x[0-9a-fA-F]{40}$/.test(s) || !/^0x[0-9a-fA-F]{40}$/.test(c)) return {
|
|
328
328
|
bound: !1,
|
|
@@ -339,17 +339,18 @@ async function Ke(e) {
|
|
|
339
339
|
o.push(e instanceof Error ? e.message : "isActiveSigner check failed");
|
|
340
340
|
}
|
|
341
341
|
if (a) try {
|
|
342
|
-
let e = await
|
|
342
|
+
let e = await ke({
|
|
343
343
|
identities: [t],
|
|
344
344
|
sessionKeys: [n],
|
|
345
345
|
excludeRevoked: !0
|
|
346
346
|
}), i = r == null ? Date.now() : r * 1e3;
|
|
347
347
|
for (let t of e) try {
|
|
348
|
-
let e =
|
|
348
|
+
let e = Oe(t.decodedDataJson ?? "[]");
|
|
349
349
|
if (e.identity.toLowerCase() !== c || e.sessionKey.toLowerCase() !== s) continue;
|
|
350
|
-
let n = typeof t.expirationTime == "number" ? t.expirationTime : null, r =
|
|
350
|
+
let n = typeof t.expirationTime == "number" ? t.expirationTime : null, r = De({
|
|
351
351
|
decoded: e,
|
|
352
352
|
expirationTime: n,
|
|
353
|
+
revoked: t.revoked,
|
|
353
354
|
now: i
|
|
354
355
|
});
|
|
355
356
|
if (r.status === "valid") return {
|
|
@@ -369,6 +370,6 @@ async function Ke(e) {
|
|
|
369
370
|
};
|
|
370
371
|
}
|
|
371
372
|
//#endregion
|
|
372
|
-
export {
|
|
373
|
+
export { me as CALL_GAS_HEADROOM_BPS, Ie as ConnectButton, s as ExternalWalletsForDeploy, I as PUBLISH_AUTOMATION_SCOPES, Le as PublishProvider, ee as appMetadata, P as approvedTargetsForAutomationPublish, fe as asSeedSignerFromThirdweb, ue as asThirdwebPublishWallet, qe as assertStorageBoundToIdentity, k as buildAutomationSessionKeyPermissions, X as defaultApprovedTargetsForModularPublish, ie as deployManagedAccountViaFactory, E as deploySmartWalletContract, Ge as enrollPublishAutomation, V as ensureAutomationSessionKey, Ve as ensureEip7702ModularAccountReady, d as ensureExecutorModuleInstalled, t as ensureManagedAccountReady, Ue as ensureManagedSignerSessionKey, R as ensureModularPublishBootstrap, L as ensureSmartWalletThenPublish, b as fromThirdwebAccount, w as getClient, n as getConnectedAccount, m as getConnectedManagedAccountAddress, o as getConnectedModularAccount, p as getManagedAccountWallet, g as getModularAccountWallet, y as getPublishThirdwebChain, i as getSharedPublishInAppWalletStorage, l as getSmartWalletAddressForAdmin, C as getWalletsForConnectButton, A as hashAutomationSessionKeyPermissions, B as isAutomationSessionActive, c as isSmartWalletDeployed, se as pollSmartWalletDeployed, z as removeAutomationSessionKey, oe as resolveSmartWalletForPublish, Ke as revokePublishAutomation, le as runModularExecutorPublishPrep, de as seedPaymaster, F as toThirdwebSessionKeyPermissions, ne as tryDeployManagedAccount, f as useActiveSmartWalletContract, e as useLocalWalletAccount, j as usePublishConfig, ce as wallets };
|
|
373
374
|
|
|
374
375
|
//# sourceMappingURL=thirdweb.js.map
|