@seedprotocol/publish 0.4.30 → 0.4.31
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 +13 -0
- package/README.md +6 -2
- package/dist/config-B4_sw4Ey.js +442 -0
- package/dist/config-B4_sw4Ey.js.map +1 -0
- package/dist/config-BcAZza3G.js +432 -0
- package/dist/config-BcAZza3G.js.map +1 -0
- package/dist/config-BtwOzQP0.js +471 -0
- package/dist/config-BtwOzQP0.js.map +1 -0
- package/dist/config-CJkIBxtE.js +432 -0
- package/dist/config-CJkIBxtE.js.map +1 -0
- package/dist/config-DBOagqZ1.js +432 -0
- package/dist/config-DBOagqZ1.js.map +1 -0
- package/dist/config-Ds5V_P5K.js +557 -0
- package/dist/config-Ds5V_P5K.js.map +1 -0
- package/dist/config-MpeHT6rf.js +535 -0
- package/dist/config-MpeHT6rf.js.map +1 -0
- package/dist/config-_R8orn1f.js +454 -0
- package/dist/config-_R8orn1f.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/errors.d.ts +3 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/helpers/ensureEip7702ModularAccountReady.d.ts.map +1 -1
- package/dist/helpers/ensureExecutorModule.d.ts +2 -1
- package/dist/helpers/ensureExecutorModule.d.ts.map +1 -1
- package/dist/helpers/ensureManagedAccountEasConfigured.d.ts +2 -1
- package/dist/helpers/ensureManagedAccountEasConfigured.d.ts.map +1 -1
- package/dist/helpers/ensureManagedAccountReady.d.ts +3 -2
- package/dist/helpers/ensureManagedAccountReady.d.ts.map +1 -1
- package/dist/helpers/ensureManagedSignerSessionKey.d.ts +9 -0
- package/dist/helpers/ensureManagedSignerSessionKey.d.ts.map +1 -0
- package/dist/helpers/ensureModularPublishBootstrap.d.ts +7 -0
- package/dist/helpers/ensureModularPublishBootstrap.d.ts.map +1 -0
- package/dist/helpers/ensureSmartWalletThenPublish.d.ts +4 -3
- package/dist/helpers/ensureSmartWalletThenPublish.d.ts.map +1 -1
- package/dist/helpers/thirdweb.d.ts +18 -1
- package/dist/helpers/thirdweb.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5334 -5883
- package/dist/index.js.map +1 -1
- package/dist/react/ConnectButton.d.ts.map +1 -1
- package/dist/services/publish/actors/createAttestations.d.ts.map +1 -1
- package/dist/services/publish/index.d.ts.map +1 -1
- package/dist/worker-BCxmY47A.js +69 -0
- package/dist/worker-BCxmY47A.js.map +1 -0
- package/dist/worker-CaUA-aJd.js +69 -0
- package/dist/worker-CaUA-aJd.js.map +1 -0
- package/dist/worker-D9Pq_HWb.js +69 -0
- package/dist/worker-D9Pq_HWb.js.map +1 -0
- package/dist/worker-DFRFhbL9.js +69 -0
- package/dist/worker-DFRFhbL9.js.map +1 -0
- package/dist/worker-DFc2aG0v.js +69 -0
- package/dist/worker-DFc2aG0v.js.map +1 -0
- package/dist/worker-DL5ecOQf.js +69 -0
- package/dist/worker-DL5ecOQf.js.map +1 -0
- package/dist/worker-OeOnFu0v.js +69 -0
- package/dist/worker-OeOnFu0v.js.map +1 -0
- package/dist/worker-TgcK7QlX.js +69 -0
- package/dist/worker-TgcK7QlX.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import { DEFAULT_ARWEAVE_GRAPHQL_URL as e, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as t, getAttesterForSeed as n, getGetAdditionalSyncAddresses as r, getMetadataAttestationUidsForSeedUid as i, getVersionsForSeedUid as a, isValidEasAttestationUid as o, setAdditionalSyncAddresses as s, setGetPublisherForNewSeeds as c, setRevokeExecutor as l, updateSeedRevokedAt as u } from "@seedprotocol/sdk";
|
|
2
|
+
import { createThirdwebClient as d, getContract as f, parseEventLogs as p, prepareContractCall as m, prepareEvent as h, readContract as g, sendTransaction as _, waitForReceipt as v } from "thirdweb";
|
|
3
|
+
import { createWallet as y, inAppWallet as b } from "thirdweb/wallets";
|
|
4
|
+
import { useActiveAccount as x } from "thirdweb/react";
|
|
5
|
+
import { isContractDeployed as ee } from "thirdweb/utils";
|
|
6
|
+
import { useEffect as S, useRef as C, useState as w } from "react";
|
|
7
|
+
import { optimismSepolia as T } from "thirdweb/chains";
|
|
8
|
+
import te from "debug";
|
|
9
|
+
import { encodeAbiParameters as ne } from "viem";
|
|
10
|
+
//#region src/helpers/constants.ts
|
|
11
|
+
var re = "0x4200000000000000000000000000000000000020", ie = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", E = "0x76f47d88bfaf670f5208911181fcdc0e160cb16d", D = "0x4200000000000000000000000000000000000021", O = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", ae = O, oe = {
|
|
12
|
+
SUCCESS: "success",
|
|
13
|
+
FAILURE: "failure"
|
|
14
|
+
}, se = [
|
|
15
|
+
"pollingForConfirmation",
|
|
16
|
+
"uploadingData",
|
|
17
|
+
"uploadingViaBundler",
|
|
18
|
+
"uploadingViaBundlerPhase2"
|
|
19
|
+
], ce = 3e4;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/helpers/thirdweb/11155420/0x76f47d88bfaf670f5208911181fcdc0e160cb16d.ts
|
|
22
|
+
async function le(e) {
|
|
23
|
+
return g({
|
|
24
|
+
contract: e.contract,
|
|
25
|
+
method: [
|
|
26
|
+
"0x8878ed33",
|
|
27
|
+
[{
|
|
28
|
+
type: "address",
|
|
29
|
+
name: "_adminSigner"
|
|
30
|
+
}, {
|
|
31
|
+
type: "bytes",
|
|
32
|
+
name: "_data"
|
|
33
|
+
}],
|
|
34
|
+
[{ type: "address" }]
|
|
35
|
+
],
|
|
36
|
+
params: [e.adminSigner, e.data]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function ue(e) {
|
|
40
|
+
return m({
|
|
41
|
+
contract: e.contract,
|
|
42
|
+
method: [
|
|
43
|
+
"0xd8fd8f44",
|
|
44
|
+
[{
|
|
45
|
+
type: "address",
|
|
46
|
+
name: "_admin"
|
|
47
|
+
}, {
|
|
48
|
+
type: "bytes",
|
|
49
|
+
name: "_data"
|
|
50
|
+
}],
|
|
51
|
+
[{ type: "address" }]
|
|
52
|
+
],
|
|
53
|
+
params: [e.admin, e.data]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/helpers/thirdweb.ts
|
|
58
|
+
var de = te("permaPress:helpers:thirdweb"), k = "seedProtocol:inAppPublish:", A = null;
|
|
59
|
+
function j() {
|
|
60
|
+
return A ||= {
|
|
61
|
+
getItem: async (e) => typeof window > "u" ? null : localStorage.getItem(k + e),
|
|
62
|
+
setItem: async (e, t) => {
|
|
63
|
+
typeof window > "u" || localStorage.setItem(k + e, t);
|
|
64
|
+
},
|
|
65
|
+
removeItem: async (e) => {
|
|
66
|
+
typeof window > "u" || localStorage.removeItem(k + e);
|
|
67
|
+
}
|
|
68
|
+
}, A;
|
|
69
|
+
}
|
|
70
|
+
var M = null;
|
|
71
|
+
function N() {
|
|
72
|
+
if (!M) {
|
|
73
|
+
let { thirdwebClientId: e } = $();
|
|
74
|
+
M = d({ clientId: e });
|
|
75
|
+
}
|
|
76
|
+
return M;
|
|
77
|
+
}
|
|
78
|
+
var fe = [y("io.metamask")], pe = () => {
|
|
79
|
+
let [e, t] = w(null);
|
|
80
|
+
return y("io.metamask"), C(!1), S(() => {}, []), e;
|
|
81
|
+
}, P = () => {
|
|
82
|
+
let e = x(), [t, n] = w(null);
|
|
83
|
+
return S(() => {
|
|
84
|
+
!e || !e.address || n(f({
|
|
85
|
+
client: N(),
|
|
86
|
+
chain: T,
|
|
87
|
+
address: e.address
|
|
88
|
+
}));
|
|
89
|
+
}, [e]), t;
|
|
90
|
+
}, F = () => {
|
|
91
|
+
let { thirdwebAccountFactoryAddress: e } = $();
|
|
92
|
+
return f({
|
|
93
|
+
client: N(),
|
|
94
|
+
chain: T,
|
|
95
|
+
address: e
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
async function I(e, t = "0x") {
|
|
99
|
+
return le({
|
|
100
|
+
contract: F(),
|
|
101
|
+
adminSigner: e,
|
|
102
|
+
data: t
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async function L(e) {
|
|
106
|
+
let t = await ee(f({
|
|
107
|
+
client: N(),
|
|
108
|
+
chain: T,
|
|
109
|
+
address: e
|
|
110
|
+
}));
|
|
111
|
+
return fetch("http://127.0.0.1:7754/ingest/2810478a-7cf0-49a8-bc23-760b81417972", {
|
|
112
|
+
method: "POST",
|
|
113
|
+
headers: {
|
|
114
|
+
"Content-Type": "application/json",
|
|
115
|
+
"X-Debug-Session-Id": "62a91c"
|
|
116
|
+
},
|
|
117
|
+
body: JSON.stringify({
|
|
118
|
+
sessionId: "62a91c",
|
|
119
|
+
runId: "initial",
|
|
120
|
+
hypothesisId: "H1",
|
|
121
|
+
location: "packages/publish/src/helpers/thirdweb.ts:isSmartWalletDeployed",
|
|
122
|
+
message: "smart wallet bytecode check result",
|
|
123
|
+
data: {
|
|
124
|
+
smartWalletAddress: e,
|
|
125
|
+
deployed: t,
|
|
126
|
+
chainId: T.id
|
|
127
|
+
},
|
|
128
|
+
timestamp: Date.now()
|
|
129
|
+
})
|
|
130
|
+
}).catch(() => {}), t;
|
|
131
|
+
}
|
|
132
|
+
async function R(e) {
|
|
133
|
+
if (!e) return { needsDeploy: !0 };
|
|
134
|
+
if (await L(e.address)) return {
|
|
135
|
+
address: e.address,
|
|
136
|
+
account: e
|
|
137
|
+
};
|
|
138
|
+
let t = await I(e.address);
|
|
139
|
+
return await L(t) ? {
|
|
140
|
+
address: t,
|
|
141
|
+
account: e
|
|
142
|
+
} : { needsDeploy: !0 };
|
|
143
|
+
}
|
|
144
|
+
var z = [y("io.metamask"), y("me.rainbow")], B = async (e) => {
|
|
145
|
+
let t = F();
|
|
146
|
+
fetch("http://127.0.0.1:7754/ingest/2810478a-7cf0-49a8-bc23-760b81417972", {
|
|
147
|
+
method: "POST",
|
|
148
|
+
headers: {
|
|
149
|
+
"Content-Type": "application/json",
|
|
150
|
+
"X-Debug-Session-Id": "62a91c"
|
|
151
|
+
},
|
|
152
|
+
body: JSON.stringify({
|
|
153
|
+
sessionId: "62a91c",
|
|
154
|
+
runId: "initial",
|
|
155
|
+
hypothesisId: "H2,H3",
|
|
156
|
+
location: "packages/publish/src/helpers/thirdweb.ts:deploySmartWalletContract",
|
|
157
|
+
message: "preparing managed account factory createAccount",
|
|
158
|
+
data: {
|
|
159
|
+
signingAccountAddress: e.address,
|
|
160
|
+
adminParam: e.address,
|
|
161
|
+
factoryAddress: $().thirdwebAccountFactoryAddress,
|
|
162
|
+
managedWalletFactoryAddress: E,
|
|
163
|
+
chainId: T.id
|
|
164
|
+
},
|
|
165
|
+
timestamp: Date.now()
|
|
166
|
+
})
|
|
167
|
+
}).catch(() => {});
|
|
168
|
+
let n = ue({
|
|
169
|
+
contract: t,
|
|
170
|
+
admin: e.address,
|
|
171
|
+
data: "0x"
|
|
172
|
+
}), r;
|
|
173
|
+
try {
|
|
174
|
+
r = await _({
|
|
175
|
+
account: e,
|
|
176
|
+
transaction: n
|
|
177
|
+
});
|
|
178
|
+
} catch (t) {
|
|
179
|
+
throw fetch("http://127.0.0.1:7754/ingest/2810478a-7cf0-49a8-bc23-760b81417972", {
|
|
180
|
+
method: "POST",
|
|
181
|
+
headers: {
|
|
182
|
+
"Content-Type": "application/json",
|
|
183
|
+
"X-Debug-Session-Id": "62a91c"
|
|
184
|
+
},
|
|
185
|
+
body: JSON.stringify({
|
|
186
|
+
sessionId: "62a91c",
|
|
187
|
+
runId: "initial",
|
|
188
|
+
hypothesisId: "H2,H3",
|
|
189
|
+
location: "packages/publish/src/helpers/thirdweb.ts:deploySmartWalletContract",
|
|
190
|
+
message: "managed account createAccount send failed",
|
|
191
|
+
data: {
|
|
192
|
+
signingAccountAddress: e.address,
|
|
193
|
+
error: t instanceof Error ? t.message : String(t)
|
|
194
|
+
},
|
|
195
|
+
timestamp: Date.now()
|
|
196
|
+
})
|
|
197
|
+
}).catch(() => {}), t;
|
|
198
|
+
}
|
|
199
|
+
de("createAccountTx result:", r), fetch("http://127.0.0.1:7754/ingest/2810478a-7cf0-49a8-bc23-760b81417972", {
|
|
200
|
+
method: "POST",
|
|
201
|
+
headers: {
|
|
202
|
+
"Content-Type": "application/json",
|
|
203
|
+
"X-Debug-Session-Id": "62a91c"
|
|
204
|
+
},
|
|
205
|
+
body: JSON.stringify({
|
|
206
|
+
sessionId: "62a91c",
|
|
207
|
+
runId: "initial",
|
|
208
|
+
hypothesisId: "H2",
|
|
209
|
+
location: "packages/publish/src/helpers/thirdweb.ts:deploySmartWalletContract",
|
|
210
|
+
message: "managed account createAccount transaction sent",
|
|
211
|
+
data: {
|
|
212
|
+
signingAccountAddress: e.address,
|
|
213
|
+
transactionHash: r.transactionHash
|
|
214
|
+
},
|
|
215
|
+
timestamp: Date.now()
|
|
216
|
+
})
|
|
217
|
+
}).catch(() => {});
|
|
218
|
+
let i = await v({
|
|
219
|
+
client: N(),
|
|
220
|
+
transactionHash: r.transactionHash,
|
|
221
|
+
chain: T
|
|
222
|
+
});
|
|
223
|
+
if (!i) throw Error("Failed to deploy smart wallet");
|
|
224
|
+
return i;
|
|
225
|
+
}, me = {
|
|
226
|
+
name: "Seed Protocol",
|
|
227
|
+
description: "Seed Protocol",
|
|
228
|
+
url: "https://seedprotocol.io"
|
|
229
|
+
};
|
|
230
|
+
async function V(e = T) {
|
|
231
|
+
let t = W();
|
|
232
|
+
await t.autoConnect({
|
|
233
|
+
client: N(),
|
|
234
|
+
chain: e
|
|
235
|
+
});
|
|
236
|
+
let n = t.getAccount();
|
|
237
|
+
if (fetch("http://127.0.0.1:7754/ingest/2810478a-7cf0-49a8-bc23-760b81417972", {
|
|
238
|
+
method: "POST",
|
|
239
|
+
headers: {
|
|
240
|
+
"Content-Type": "application/json",
|
|
241
|
+
"X-Debug-Session-Id": "62a91c"
|
|
242
|
+
},
|
|
243
|
+
body: JSON.stringify({
|
|
244
|
+
sessionId: "62a91c",
|
|
245
|
+
runId: "initial",
|
|
246
|
+
hypothesisId: "H4",
|
|
247
|
+
location: "packages/publish/src/helpers/thirdweb.ts:getConnectedManagedAccountAddress",
|
|
248
|
+
message: "managed wallet autoConnect account result",
|
|
249
|
+
data: {
|
|
250
|
+
hasAccount: !!n,
|
|
251
|
+
managedAccountAddress: n?.address ?? null,
|
|
252
|
+
chainId: e.id
|
|
253
|
+
},
|
|
254
|
+
timestamp: Date.now()
|
|
255
|
+
})
|
|
256
|
+
}).catch(() => {}), !n) throw Error("Failed to get managed account");
|
|
257
|
+
return n.address;
|
|
258
|
+
}
|
|
259
|
+
async function H() {
|
|
260
|
+
try {
|
|
261
|
+
let e = K();
|
|
262
|
+
return await e.autoConnect({
|
|
263
|
+
client: N(),
|
|
264
|
+
chain: T
|
|
265
|
+
}), e.getAccount() ?? null;
|
|
266
|
+
} catch {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
async function he() {
|
|
271
|
+
return H();
|
|
272
|
+
}
|
|
273
|
+
var U = null, W = () => (U ||= b({
|
|
274
|
+
storage: j(),
|
|
275
|
+
auth: { options: [
|
|
276
|
+
"farcaster",
|
|
277
|
+
"email",
|
|
278
|
+
"passkey",
|
|
279
|
+
"phone"
|
|
280
|
+
] },
|
|
281
|
+
executionMode: {
|
|
282
|
+
mode: "EIP4337",
|
|
283
|
+
smartAccount: {
|
|
284
|
+
chain: T,
|
|
285
|
+
factoryAddress: E,
|
|
286
|
+
gasless: !0
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}), U), G = null, K = () => (G ||= b({
|
|
290
|
+
storage: j(),
|
|
291
|
+
auth: { options: [
|
|
292
|
+
"farcaster",
|
|
293
|
+
"email",
|
|
294
|
+
"passkey",
|
|
295
|
+
"phone"
|
|
296
|
+
] },
|
|
297
|
+
executionMode: {
|
|
298
|
+
mode: "EIP7702",
|
|
299
|
+
sponsorGas: !0
|
|
300
|
+
}
|
|
301
|
+
}), G), q = null, ge = () => (q ||= [K()], q), _e = [
|
|
302
|
+
{
|
|
303
|
+
type: "error",
|
|
304
|
+
name: "AccessDenied",
|
|
305
|
+
inputs: []
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
type: "error",
|
|
309
|
+
name: "AlreadyRevoked",
|
|
310
|
+
inputs: []
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
type: "error",
|
|
314
|
+
name: "InvalidRevocation",
|
|
315
|
+
inputs: []
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
type: "error",
|
|
319
|
+
name: "InvalidRevocations",
|
|
320
|
+
inputs: []
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
type: "error",
|
|
324
|
+
name: "InvalidSchema",
|
|
325
|
+
inputs: []
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
type: "error",
|
|
329
|
+
name: "Irrevocable",
|
|
330
|
+
inputs: []
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
type: "error",
|
|
334
|
+
name: "NotFound",
|
|
335
|
+
inputs: []
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
type: "error",
|
|
339
|
+
name: "NotPayable",
|
|
340
|
+
inputs: []
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
type: "error",
|
|
344
|
+
name: "InsufficientValue",
|
|
345
|
+
inputs: []
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
type: "error",
|
|
349
|
+
name: "InvalidLength",
|
|
350
|
+
inputs: []
|
|
351
|
+
}
|
|
352
|
+
], ve = () => h({ signature: "event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)" }), J = "0x" + "0".repeat(64);
|
|
353
|
+
function ye(e, t, n) {
|
|
354
|
+
let { easContractAddress: r } = $();
|
|
355
|
+
return m({
|
|
356
|
+
contract: f({
|
|
357
|
+
client: e,
|
|
358
|
+
chain: t,
|
|
359
|
+
address: r
|
|
360
|
+
}),
|
|
361
|
+
method: "function attest((bytes32 schema,(address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 value) data) request) payable returns (bytes32)",
|
|
362
|
+
params: [{
|
|
363
|
+
schema: n.schema,
|
|
364
|
+
data: {
|
|
365
|
+
recipient: n.data.recipient ?? "0x0000000000000000000000000000000000000000",
|
|
366
|
+
expirationTime: n.data.expirationTime ?? 0n,
|
|
367
|
+
revocable: n.data.revocable ?? !0,
|
|
368
|
+
refUID: n.data.refUID,
|
|
369
|
+
data: n.data.data,
|
|
370
|
+
value: n.data.value ?? 0n
|
|
371
|
+
}
|
|
372
|
+
}]
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function be(e, t, n) {
|
|
376
|
+
let { easContractAddress: r } = $();
|
|
377
|
+
return m({
|
|
378
|
+
contract: f({
|
|
379
|
+
client: e,
|
|
380
|
+
chain: t,
|
|
381
|
+
address: r
|
|
382
|
+
}),
|
|
383
|
+
method: "function multiAttest((bytes32 schema,(address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 value)[] data)[] requests) payable returns (bytes32[])",
|
|
384
|
+
params: [n]
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
function xe(e) {
|
|
388
|
+
return ne([{ type: "bytes32" }], [e]);
|
|
389
|
+
}
|
|
390
|
+
function Se(e, t) {
|
|
391
|
+
return Y(e, t)[0]?.uid;
|
|
392
|
+
}
|
|
393
|
+
function Y(e, t) {
|
|
394
|
+
if (!e.logs?.length) return [];
|
|
395
|
+
let n = t.toLowerCase(), r = e.logs.filter((e) => e.address && e.address.toLowerCase() === n);
|
|
396
|
+
if (!r.length) return [];
|
|
397
|
+
try {
|
|
398
|
+
let e = p({
|
|
399
|
+
logs: r,
|
|
400
|
+
events: [ve()],
|
|
401
|
+
strict: !1
|
|
402
|
+
}), t = [];
|
|
403
|
+
for (let n of e) {
|
|
404
|
+
let e = n?.args?.uid, r = n?.args?.schemaUID;
|
|
405
|
+
!e || e === J || r && t.push({
|
|
406
|
+
schemaUid: r,
|
|
407
|
+
uid: e
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
return t;
|
|
411
|
+
} catch {
|
|
412
|
+
return [];
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
function Ce(e, t, n) {
|
|
416
|
+
let { easContractAddress: r } = $();
|
|
417
|
+
return m({
|
|
418
|
+
contract: f({
|
|
419
|
+
client: e,
|
|
420
|
+
chain: t,
|
|
421
|
+
address: r,
|
|
422
|
+
abi: [..._e]
|
|
423
|
+
}),
|
|
424
|
+
method: "function multiRevoke((bytes32 schema,(bytes32 uid,uint256 value)[] data)[] multiRequests) payable",
|
|
425
|
+
params: [n.map((e) => ({
|
|
426
|
+
schema: e.schema,
|
|
427
|
+
data: e.data.map((e) => ({
|
|
428
|
+
uid: e.uid,
|
|
429
|
+
value: e.value ?? 0n
|
|
430
|
+
}))
|
|
431
|
+
}))]
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/helpers/resolveRevokeAccount.ts
|
|
436
|
+
async function X(e) {
|
|
437
|
+
let { account: t, attester: n } = e;
|
|
438
|
+
if (!n || t.address.toLowerCase() === n.toLowerCase()) return t;
|
|
439
|
+
let i = r();
|
|
440
|
+
if (i) {
|
|
441
|
+
let e = await i(), t = n.toLowerCase();
|
|
442
|
+
if (e?.some((e) => e?.toLowerCase() === t)) throw Error("Revocation not supported for items published via the modular executor.");
|
|
443
|
+
}
|
|
444
|
+
try {
|
|
445
|
+
let e = await I(t.address);
|
|
446
|
+
if (n.toLowerCase() === e.toLowerCase() && await L(e)) {
|
|
447
|
+
let e = W();
|
|
448
|
+
await e.autoConnect({
|
|
449
|
+
client: N(),
|
|
450
|
+
chain: T
|
|
451
|
+
});
|
|
452
|
+
let t = e.getAccount();
|
|
453
|
+
if (t) return t;
|
|
454
|
+
}
|
|
455
|
+
} catch {}
|
|
456
|
+
return t;
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/services/revoke/revokeAttestations.ts
|
|
460
|
+
async function we(e) {
|
|
461
|
+
let { seedLocalId: r, seedUid: s, seedSchemaUid: c } = e, l = await H();
|
|
462
|
+
if (!l) throw Error("No wallet connected. Connect a wallet to revoke attestations.");
|
|
463
|
+
let d = await X({
|
|
464
|
+
account: l,
|
|
465
|
+
attester: await n({
|
|
466
|
+
seedLocalId: r,
|
|
467
|
+
seedUid: s
|
|
468
|
+
})
|
|
469
|
+
}), f = N(), [p, m] = await Promise.all([a(s), i(s)]), h = p.map((e) => e.uid).filter((e) => o(e)), g = /* @__PURE__ */ new Map();
|
|
470
|
+
for (let { uid: e, schemaUid: t } of m) {
|
|
471
|
+
if (!o(e)) continue;
|
|
472
|
+
let n = g.get(t) ?? [];
|
|
473
|
+
n.push(e), g.set(t, n);
|
|
474
|
+
}
|
|
475
|
+
let y = [];
|
|
476
|
+
for (let [e, t] of g) t.length > 0 && y.push({
|
|
477
|
+
schema: e,
|
|
478
|
+
data: t.map((e) => ({ uid: e }))
|
|
479
|
+
});
|
|
480
|
+
h.length > 0 && y.push({
|
|
481
|
+
schema: t,
|
|
482
|
+
data: h.map((e) => ({ uid: e }))
|
|
483
|
+
}), y.push({
|
|
484
|
+
schema: c,
|
|
485
|
+
data: [{ uid: s }]
|
|
486
|
+
});
|
|
487
|
+
for (let e of y) {
|
|
488
|
+
if (e.data.length === 0) continue;
|
|
489
|
+
let t = Ce(f, T, [e]);
|
|
490
|
+
try {
|
|
491
|
+
await v({
|
|
492
|
+
client: f,
|
|
493
|
+
chain: T,
|
|
494
|
+
transactionHash: (await _({
|
|
495
|
+
account: d,
|
|
496
|
+
transaction: t
|
|
497
|
+
})).transactionHash
|
|
498
|
+
});
|
|
499
|
+
} catch (e) {
|
|
500
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
501
|
+
if (t.includes("AccessDenied") || t.includes("0x4ca88867")) throw Error("Only the original attester can revoke attestations. Connect the wallet that published this item.");
|
|
502
|
+
if (t.includes("AlreadyRevoked")) continue;
|
|
503
|
+
throw e;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
await u({
|
|
507
|
+
seedLocalId: r,
|
|
508
|
+
revokedAt: Math.floor(Date.now() / 1e3)
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
//#endregion
|
|
512
|
+
//#region src/config.ts
|
|
513
|
+
var Z = null;
|
|
514
|
+
function Te(e) {
|
|
515
|
+
Z = e;
|
|
516
|
+
}
|
|
517
|
+
function Ee() {
|
|
518
|
+
return Z;
|
|
519
|
+
}
|
|
520
|
+
function Q(e) {
|
|
521
|
+
Te(e), c(async () => {
|
|
522
|
+
try {
|
|
523
|
+
return await V(T);
|
|
524
|
+
} catch {
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
}), l(we), import("./worker-D9Pq_HWb.js").then((e) => {
|
|
528
|
+
e.startArweaveL1FinalizeWorker();
|
|
529
|
+
}), s(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
|
|
530
|
+
}
|
|
531
|
+
var De = Q;
|
|
532
|
+
function $() {
|
|
533
|
+
let t = Z;
|
|
534
|
+
if (!t) throw Error("@seedprotocol/publish: Call initPublish() or ensure PublishProvider is mounted with config before using the publish package");
|
|
535
|
+
let n = t.useArweaveBundler ?? !1, r = t.arweaveUploadVerificationBaseUrl ?? t.uploadApiBaseUrl, i = t.arweaveGraphqlUrl ?? e, a = t.useModularExecutor ?? !1;
|
|
536
|
+
return {
|
|
537
|
+
...t,
|
|
538
|
+
thirdwebAccountFactoryAddress: E,
|
|
539
|
+
easContractAddress: D,
|
|
540
|
+
useIntegerLocalIds: t.useIntegerLocalIds ?? !1,
|
|
541
|
+
useDirectEas: t.useDirectEas ?? !1,
|
|
542
|
+
modularAccountModuleData: t.modularAccountModuleData ?? "0x",
|
|
543
|
+
useModularExecutor: a,
|
|
544
|
+
useArweaveBundler: n,
|
|
545
|
+
arweaveUploadVerificationBaseUrl: r,
|
|
546
|
+
arweaveGraphqlUrl: i,
|
|
547
|
+
autoDeployManagedAccount: t.autoDeployManagedAccount ?? !1,
|
|
548
|
+
autoDeployEip7702ModularAccount: Oe(t, a)
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function Oe(e, t) {
|
|
552
|
+
return e.autoDeployEip7702ModularAccount === !0 ? !0 : e.autoDeployEip7702ModularAccount === !1 ? !1 : t;
|
|
553
|
+
}
|
|
554
|
+
//#endregion
|
|
555
|
+
export { ie as A, ge as C, pe as D, P as E, re as F, ae as I, O as M, ce as N, fe as O, oe as P, I as S, R as T, he as _, J as a, K as b, Y as c, z as d, me as f, V as g, H as h, Q as i, se as j, D as k, ye as l, N as m, Ee as n, xe as o, B as p, $ as r, Se as s, De as t, be as u, F as v, L as w, j as x, W as y };
|
|
556
|
+
|
|
557
|
+
//# sourceMappingURL=config-Ds5V_P5K.js.map
|