@seedprotocol/publish 0.6.7 → 0.6.8
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 +8 -0
- package/README.md +69 -11
- package/dist/chainConfig-3sSqEVQh.js +1433 -0
- package/dist/chainConfig-3sSqEVQh.js.map +1 -0
- package/dist/chainConfig-3wlYarAG.js +1433 -0
- package/dist/chainConfig-3wlYarAG.js.map +1 -0
- package/dist/chainConfig-BRcsMopd.js +1442 -0
- package/dist/chainConfig-BRcsMopd.js.map +1 -0
- package/dist/chainConfig-BYm5OXpk.js +1433 -0
- package/dist/chainConfig-BYm5OXpk.js.map +1 -0
- package/dist/chainConfig-CfVGYAsY.js +1311 -0
- package/dist/chainConfig-CfVGYAsY.js.map +1 -0
- package/dist/chainConfig-DDA4YmAB.js +1424 -0
- package/dist/chainConfig-DDA4YmAB.js.map +1 -0
- package/dist/config-CPBd5C_b.js +1201 -0
- package/dist/config-CPBd5C_b.js.map +1 -0
- package/dist/config-DkIapO94.js +955 -0
- package/dist/config-DkIapO94.js.map +1 -0
- package/dist/config-EQZZNH9H.js +955 -0
- package/dist/config-EQZZNH9H.js.map +1 -0
- package/dist/config.d.ts +85 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/ensureAutomationSessionKey-BMHLKfjj.js +85 -0
- package/dist/ensureAutomationSessionKey-BMHLKfjj.js.map +1 -0
- package/dist/ensureAutomationSessionKey-BZ9_3FMW.js +86 -0
- package/dist/ensureAutomationSessionKey-BZ9_3FMW.js.map +1 -0
- package/dist/ensureAutomationSessionKey-C8D7BFjU.js +85 -0
- package/dist/ensureAutomationSessionKey-C8D7BFjU.js.map +1 -0
- package/dist/ensureAutomationSessionKey-CClLVX2w.js +85 -0
- package/dist/ensureAutomationSessionKey-CClLVX2w.js.map +1 -0
- package/dist/ensureAutomationSessionKey-CNNN1jBQ.js +85 -0
- package/dist/ensureAutomationSessionKey-CNNN1jBQ.js.map +1 -0
- package/dist/ensureAutomationSessionKey-D8Gki6U6.js +85 -0
- package/dist/ensureAutomationSessionKey-D8Gki6U6.js.map +1 -0
- package/dist/ensureAutomationSessionKey-DEH7nwUc.js +86 -0
- package/dist/ensureAutomationSessionKey-DEH7nwUc.js.map +1 -0
- package/dist/ensureAutomationSessionKey-Dhvbii2M.js +86 -0
- package/dist/ensureAutomationSessionKey-Dhvbii2M.js.map +1 -0
- package/dist/ensureAutomationSessionKey-Dyfk8qVp.js +85 -0
- package/dist/ensureAutomationSessionKey-Dyfk8qVp.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-5HJDqJJM.js +24 -0
- package/dist/ensureModularPublishBootstrap-5HJDqJJM.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-BW8jKN_A.js +24 -0
- package/dist/ensureModularPublishBootstrap-BW8jKN_A.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-Btih5xbB.js +129 -0
- package/dist/ensureModularPublishBootstrap-Btih5xbB.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-CI4U08Gc.js +129 -0
- package/dist/ensureModularPublishBootstrap-CI4U08Gc.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-CcU-hXll.js +128 -0
- package/dist/ensureModularPublishBootstrap-CcU-hXll.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-CdrykHAi.js +24 -0
- package/dist/ensureModularPublishBootstrap-CdrykHAi.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-DGBKVGg5.js +24 -0
- package/dist/ensureModularPublishBootstrap-DGBKVGg5.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-DaREOqSc.js +129 -0
- package/dist/ensureModularPublishBootstrap-DaREOqSc.js.map +1 -0
- package/dist/ensureModularPublishBootstrap-DxIG-LUP.js +24 -0
- package/dist/ensureModularPublishBootstrap-DxIG-LUP.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-BSYzckyS.js +49 -0
- package/dist/ensureSmartWalletThenPublish-BSYzckyS.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js +49 -0
- package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-Bl415Ss6.js +48 -0
- package/dist/ensureSmartWalletThenPublish-Bl415Ss6.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-CE7acryB.js +49 -0
- package/dist/ensureSmartWalletThenPublish-CE7acryB.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-D5GSZRyZ.js +48 -0
- package/dist/ensureSmartWalletThenPublish-D5GSZRyZ.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-DAomriGc.js +48 -0
- package/dist/ensureSmartWalletThenPublish-DAomriGc.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js +48 -0
- package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js +48 -0
- package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js.map +1 -0
- package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js +48 -0
- package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js.map +1 -0
- package/dist/errors-Du3LNbJN.js.map +1 -1
- package/dist/errors.d.ts +2 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/helpers/abi/executor.d.ts +128 -0
- package/dist/helpers/abi/executor.d.ts.map +1 -1
- package/dist/helpers/abi/factory.d.ts +1 -1
- package/dist/helpers/abi/factory.d.ts.map +1 -1
- package/dist/helpers/abi/publisher.d.ts +11 -0
- package/dist/helpers/abi/publisher.d.ts.map +1 -1
- package/dist/helpers/abi/seedErrors.d.ts +141 -0
- package/dist/helpers/abi/seedErrors.d.ts.map +1 -0
- package/dist/helpers/abi/seedExecutorRouter.d.ts +60 -0
- package/dist/helpers/abi/seedExecutorRouter.d.ts.map +1 -0
- package/dist/helpers/adapters/permissionlessTxSender.d.ts +26 -0
- package/dist/helpers/adapters/permissionlessTxSender.d.ts.map +1 -1
- package/dist/helpers/adapters/thirdwebAccount.d.ts +10 -2
- package/dist/helpers/adapters/thirdwebAccount.d.ts.map +1 -1
- package/dist/helpers/approvedTargetsForAutomationPublish.d.ts +1 -1
- package/dist/helpers/blockchain.d.ts +4 -0
- package/dist/helpers/blockchain.d.ts.map +1 -1
- package/dist/helpers/chainClient.d.ts.map +1 -1
- package/dist/helpers/chainConfig.d.ts +2 -0
- package/dist/helpers/chainConfig.d.ts.map +1 -1
- package/dist/helpers/constants.d.ts +14 -3
- package/dist/helpers/constants.d.ts.map +1 -1
- package/dist/helpers/contracts/index.d.ts +25 -0
- package/dist/helpers/contracts/index.d.ts.map +1 -1
- package/dist/helpers/defaultApprovedTargetsForModularPublish.d.ts +12 -2
- package/dist/helpers/defaultApprovedTargetsForModularPublish.d.ts.map +1 -1
- package/dist/helpers/describeRevert.d.ts +33 -0
- package/dist/helpers/describeRevert.d.ts.map +1 -0
- package/dist/helpers/easDirect.d.ts +3 -8
- package/dist/helpers/easDirect.d.ts.map +1 -1
- package/dist/helpers/enrollPublishAutomation.d.ts +6 -2
- package/dist/helpers/enrollPublishAutomation.d.ts.map +1 -1
- package/dist/helpers/ensureAutomationSessionKey.d.ts.map +1 -1
- package/dist/helpers/ensureEip7702ModularAccountReady.d.ts +1 -1
- package/dist/helpers/ensureEip7702ModularAccountReady.d.ts.map +1 -1
- package/dist/helpers/ensureExecutorModule.d.ts +6 -3
- package/dist/helpers/ensureExecutorModule.d.ts.map +1 -1
- package/dist/helpers/ensureManagedAccountEasConfigured.d.ts +8 -3
- package/dist/helpers/ensureManagedAccountEasConfigured.d.ts.map +1 -1
- package/dist/helpers/ensureManagedAccountReady.d.ts.map +1 -1
- package/dist/helpers/ensureManagedSignerSessionKey.d.ts +5 -0
- package/dist/helpers/ensureManagedSignerSessionKey.d.ts.map +1 -1
- package/dist/helpers/ensureModularPublishBootstrap.d.ts +6 -2
- package/dist/helpers/ensureModularPublishBootstrap.d.ts.map +1 -1
- package/dist/helpers/ensureSmartWalletThenPublish.d.ts.map +1 -1
- package/dist/helpers/executorModuleReadiness.d.ts +28 -0
- package/dist/helpers/executorModuleReadiness.d.ts.map +1 -0
- package/dist/helpers/managedAccountAdmin.d.ts +12 -0
- package/dist/helpers/managedAccountAdmin.d.ts.map +1 -0
- package/dist/helpers/publishThirdwebClient.d.ts +10 -0
- package/dist/helpers/publishThirdwebClient.d.ts.map +1 -0
- package/dist/helpers/retryNonceTooLow.d.ts +12 -0
- package/dist/helpers/retryNonceTooLow.d.ts.map +1 -0
- package/dist/helpers/seedSigner.d.ts.map +1 -1
- package/dist/helpers/seedTwin.d.ts +47 -0
- package/dist/helpers/seedTwin.d.ts.map +1 -0
- package/dist/helpers/thirdweb.d.ts +21 -6
- package/dist/helpers/thirdweb.d.ts.map +1 -1
- package/dist/helpers/thirdwebChain.d.ts +21 -0
- package/dist/helpers/thirdwebChain.d.ts.map +1 -0
- package/dist/helpers/verifyPublishChain.d.ts +21 -0
- package/dist/helpers/verifyPublishChain.d.ts.map +1 -0
- package/dist/hooks/useItemPublishStatus.d.ts +2 -0
- package/dist/hooks/useItemPublishStatus.d.ts.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +478 -398
- package/dist/index.js.map +1 -1
- package/dist/managedAccountAdmin-B64V1rlU.js +29 -0
- package/dist/managedAccountAdmin-B64V1rlU.js.map +1 -0
- package/dist/managedAccountAdmin-BVLGWpEb.js +29 -0
- package/dist/managedAccountAdmin-BVLGWpEb.js.map +1 -0
- package/dist/managedAccountAdmin-Bje6X8Ds.js +29 -0
- package/dist/managedAccountAdmin-Bje6X8Ds.js.map +1 -0
- package/dist/managedAccountAdmin-C84-IlQ9.js +29 -0
- package/dist/managedAccountAdmin-C84-IlQ9.js.map +1 -0
- package/dist/managedAccountAdmin-DhCRBoPX.js +29 -0
- package/dist/managedAccountAdmin-DhCRBoPX.js.map +1 -0
- package/dist/publishAuthorization-B0G1em4a.js +3695 -0
- package/dist/publishAuthorization-B0G1em4a.js.map +1 -0
- package/dist/publishAuthorization-B1BVVfp0.js +3604 -0
- package/dist/publishAuthorization-B1BVVfp0.js.map +1 -0
- package/dist/publishAuthorization-Bltn3y_K.js +3599 -0
- package/dist/publishAuthorization-Bltn3y_K.js.map +1 -0
- package/dist/publishAuthorization-By2Tt9kW.js +3912 -0
- package/dist/publishAuthorization-By2Tt9kW.js.map +1 -0
- package/dist/publishAuthorization-CxBkijU6.js +3925 -0
- package/dist/publishAuthorization-CxBkijU6.js.map +1 -0
- package/dist/publishAuthorization-CxWY7lAQ.js +3706 -0
- package/dist/publishAuthorization-CxWY7lAQ.js.map +1 -0
- package/dist/publishAuthorization-DEriY_jm.js +3687 -0
- package/dist/publishAuthorization-DEriY_jm.js.map +1 -0
- package/dist/publishAuthorization-DfAQs1sN.js +3707 -0
- package/dist/publishAuthorization-DfAQs1sN.js.map +1 -0
- package/dist/publishAuthorization-DqhhCAhd.js +3652 -0
- package/dist/publishAuthorization-DqhhCAhd.js.map +1 -0
- package/dist/publishThirdwebClient-BdgkcqM7.js +18 -0
- package/dist/publishThirdwebClient-BdgkcqM7.js.map +1 -0
- package/dist/publishThirdwebClient-BkmDN480.js +18 -0
- package/dist/publishThirdwebClient-BkmDN480.js.map +1 -0
- package/dist/publishThirdwebClient-BnDhP3N-.js +18 -0
- package/dist/publishThirdwebClient-BnDhP3N-.js.map +1 -0
- package/dist/publishThirdwebClient-CQ29pzG2.js +18 -0
- package/dist/publishThirdwebClient-CQ29pzG2.js.map +1 -0
- package/dist/publishThirdwebClient-CZIVmr9Z.js +18 -0
- package/dist/publishThirdwebClient-CZIVmr9Z.js.map +1 -0
- package/dist/publishThirdwebClient-DroRrOFQ.js +18 -0
- package/dist/publishThirdwebClient-DroRrOFQ.js.map +1 -0
- package/dist/publishThirdwebClient-DzXFjQ7L.js +18 -0
- package/dist/publishThirdwebClient-DzXFjQ7L.js.map +1 -0
- package/dist/publishThirdwebClient-Dzb2vcEs.js +18 -0
- package/dist/publishThirdwebClient-Dzb2vcEs.js.map +1 -0
- package/dist/publishThirdwebClient-i8P7fivi.js +18 -0
- package/dist/publishThirdwebClient-i8P7fivi.js.map +1 -0
- package/dist/react/ConnectButton.d.ts.map +1 -1
- package/dist/resolveRevokeAccount-B5iXpuRT.js +38 -0
- package/dist/resolveRevokeAccount-B5iXpuRT.js.map +1 -0
- package/dist/resolveRevokeAccount-B7ImSb4Y.js +38 -0
- package/dist/resolveRevokeAccount-B7ImSb4Y.js.map +1 -0
- package/dist/resolveRevokeAccount-BM1j2l5Q.js +38 -0
- package/dist/resolveRevokeAccount-BM1j2l5Q.js.map +1 -0
- package/dist/resolveRevokeAccount-BtVG0xxc.js +38 -0
- package/dist/resolveRevokeAccount-BtVG0xxc.js.map +1 -0
- package/dist/resolveRevokeAccount-CJZZdBcQ.js +39 -0
- package/dist/resolveRevokeAccount-CJZZdBcQ.js.map +1 -0
- package/dist/resolveRevokeAccount-CaIMuCee.js +39 -0
- package/dist/resolveRevokeAccount-CaIMuCee.js.map +1 -0
- package/dist/resolveRevokeAccount-Cg4TQgnd.js +38 -0
- package/dist/resolveRevokeAccount-Cg4TQgnd.js.map +1 -0
- package/dist/resolveRevokeAccount-DHnxtEIj.js +39 -0
- package/dist/resolveRevokeAccount-DHnxtEIj.js.map +1 -0
- package/dist/resolveRevokeAccount-S-2WXkNh.js +38 -0
- package/dist/resolveRevokeAccount-S-2WXkNh.js.map +1 -0
- package/dist/services/publish/actors/checking.d.ts.map +1 -1
- package/dist/services/publish/actors/createAttestations.d.ts.map +1 -1
- package/dist/services/publish/helpers/ensureEasSchemas.d.ts +12 -1
- package/dist/services/publish/helpers/ensureEasSchemas.d.ts.map +1 -1
- package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
- package/dist/services/publishManager/actions/createPublish.d.ts.map +1 -1
- package/dist/services/publishManager/actions/drainPendingCreates.d.ts +3 -0
- package/dist/services/publishManager/actions/drainPendingCreates.d.ts.map +1 -0
- package/dist/services/publishManager/actions/publishDone.d.ts.map +1 -1
- package/dist/services/publishManager/actions/queueCreatePublish.d.ts +2 -0
- package/dist/services/publishManager/actions/queueCreatePublish.d.ts.map +1 -0
- package/dist/services/publishManager/actors/restoreFromDb.d.ts.map +1 -1
- package/dist/services/publishManager/actors/savePublish.d.ts +11 -0
- package/dist/services/publishManager/actors/savePublish.d.ts.map +1 -1
- package/dist/services/publishManager/createPublishResult.d.ts +6 -0
- package/dist/services/publishManager/createPublishResult.d.ts.map +1 -0
- package/dist/services/publishManager/index.d.ts +61 -1
- package/dist/services/publishManager/index.d.ts.map +1 -1
- package/dist/services/revoke/revokeAttestations.d.ts +3 -2
- package/dist/services/revoke/revokeAttestations.d.ts.map +1 -1
- package/dist/thirdweb.d.ts +1 -0
- package/dist/thirdweb.d.ts.map +1 -1
- package/dist/thirdweb.js +193 -117
- package/dist/thirdweb.js.map +1 -1
- package/dist/worker-2dUZSapK.js +69 -0
- package/dist/worker-2dUZSapK.js.map +1 -0
- package/dist/worker-B8gN5WTx.js +69 -0
- package/dist/worker-B8gN5WTx.js.map +1 -0
- package/dist/worker-BgErCNTb.js +69 -0
- package/dist/worker-BgErCNTb.js.map +1 -0
- package/dist/worker-C07rPV2G.js +69 -0
- package/dist/worker-C07rPV2G.js.map +1 -0
- package/dist/worker-C9Za_dlQ.js +69 -0
- package/dist/worker-C9Za_dlQ.js.map +1 -0
- package/dist/worker-CEgulQnm.js +69 -0
- package/dist/worker-CEgulQnm.js.map +1 -0
- package/dist/worker-C_TL94He.js +69 -0
- package/dist/worker-C_TL94He.js.map +1 -0
- package/dist/worker-DypHzXgH.js +69 -0
- package/dist/worker-DypHzXgH.js.map +1 -0
- package/dist/worker-ZL4Wg19t.js +69 -0
- package/dist/worker-ZL4Wg19t.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,955 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { DEFAULT_ARWEAVE_GRAPHQL_URL as t, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as n, client as r, getAttesterForSeed as i, getGetAdditionalSyncAddresses as a, getMetadataAttestationUidsForSeedUid as o, getVersionsForSeedUid as s, isValidEasAttestationUid as c, setAdditionalSyncAddresses as l, setGetPublisherForNewSeeds as u, setRevokeExecutor as d, updateSeedRevokedAt as ee } from "@seedprotocol/sdk";
|
|
3
|
+
import { createPublicClient as f, encodeAbiParameters as p, encodeFunctionData as m, http as h, parseEventLogs as g } from "viem";
|
|
4
|
+
import { optimismSepolia as te } from "viem/chains";
|
|
5
|
+
import { defineChain as ne, prepareTransaction as re, sendTransaction as ie } from "thirdweb";
|
|
6
|
+
import { optimismSepolia as _ } from "thirdweb/chains";
|
|
7
|
+
import { ethers as ae } from "ethers";
|
|
8
|
+
//#region src/helpers/constants.ts
|
|
9
|
+
var v = "0x4200000000000000000000000000000000000020", oe = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", y = "0x76f47d88bfaf670f5208911181fcdc0e160cb16d", b = "0x4200000000000000000000000000000000000021", x = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", se = x, ce = {
|
|
10
|
+
SUCCESS: "success",
|
|
11
|
+
FAILURE: "failure"
|
|
12
|
+
}, le = [
|
|
13
|
+
"pollingForConfirmation",
|
|
14
|
+
"uploadingData",
|
|
15
|
+
"uploadingViaBundler",
|
|
16
|
+
"uploadingViaBundlerPhase2"
|
|
17
|
+
], ue = 3e4, de = [
|
|
18
|
+
{
|
|
19
|
+
type: "error",
|
|
20
|
+
name: "AccessDenied",
|
|
21
|
+
inputs: []
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: "error",
|
|
25
|
+
name: "AlreadyRevoked",
|
|
26
|
+
inputs: []
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "error",
|
|
30
|
+
name: "InvalidRevocation",
|
|
31
|
+
inputs: []
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "error",
|
|
35
|
+
name: "InvalidRevocations",
|
|
36
|
+
inputs: []
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "error",
|
|
40
|
+
name: "InvalidSchema",
|
|
41
|
+
inputs: []
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: "error",
|
|
45
|
+
name: "Irrevocable",
|
|
46
|
+
inputs: []
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "error",
|
|
50
|
+
name: "NotFound",
|
|
51
|
+
inputs: []
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "error",
|
|
55
|
+
name: "NotPayable",
|
|
56
|
+
inputs: []
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: "error",
|
|
60
|
+
name: "InsufficientValue",
|
|
61
|
+
inputs: []
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type: "error",
|
|
65
|
+
name: "InvalidLength",
|
|
66
|
+
inputs: []
|
|
67
|
+
}
|
|
68
|
+
], S = [
|
|
69
|
+
{
|
|
70
|
+
name: "recipient",
|
|
71
|
+
type: "address"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "expirationTime",
|
|
75
|
+
type: "uint64"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "revocable",
|
|
79
|
+
type: "bool"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "refUID",
|
|
83
|
+
type: "bytes32"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "data",
|
|
87
|
+
type: "bytes"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "value",
|
|
91
|
+
type: "uint256"
|
|
92
|
+
}
|
|
93
|
+
], C = [
|
|
94
|
+
{
|
|
95
|
+
type: "function",
|
|
96
|
+
name: "attest",
|
|
97
|
+
stateMutability: "payable",
|
|
98
|
+
inputs: [{
|
|
99
|
+
name: "request",
|
|
100
|
+
type: "tuple",
|
|
101
|
+
components: [{
|
|
102
|
+
name: "schema",
|
|
103
|
+
type: "bytes32"
|
|
104
|
+
}, {
|
|
105
|
+
name: "data",
|
|
106
|
+
type: "tuple",
|
|
107
|
+
components: S
|
|
108
|
+
}]
|
|
109
|
+
}],
|
|
110
|
+
outputs: [{ type: "bytes32" }]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "function",
|
|
114
|
+
name: "multiAttest",
|
|
115
|
+
stateMutability: "payable",
|
|
116
|
+
inputs: [{
|
|
117
|
+
name: "requests",
|
|
118
|
+
type: "tuple[]",
|
|
119
|
+
components: [{
|
|
120
|
+
name: "schema",
|
|
121
|
+
type: "bytes32"
|
|
122
|
+
}, {
|
|
123
|
+
name: "data",
|
|
124
|
+
type: "tuple[]",
|
|
125
|
+
components: S
|
|
126
|
+
}]
|
|
127
|
+
}],
|
|
128
|
+
outputs: [{ type: "bytes32[]" }]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: "function",
|
|
132
|
+
name: "multiRevoke",
|
|
133
|
+
stateMutability: "payable",
|
|
134
|
+
inputs: [{
|
|
135
|
+
name: "multiRequests",
|
|
136
|
+
type: "tuple[]",
|
|
137
|
+
components: [{
|
|
138
|
+
name: "schema",
|
|
139
|
+
type: "bytes32"
|
|
140
|
+
}, {
|
|
141
|
+
name: "data",
|
|
142
|
+
type: "tuple[]",
|
|
143
|
+
components: [{
|
|
144
|
+
name: "uid",
|
|
145
|
+
type: "bytes32"
|
|
146
|
+
}, {
|
|
147
|
+
name: "value",
|
|
148
|
+
type: "uint256"
|
|
149
|
+
}]
|
|
150
|
+
}]
|
|
151
|
+
}],
|
|
152
|
+
outputs: []
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: "event",
|
|
156
|
+
name: "Attested",
|
|
157
|
+
inputs: [
|
|
158
|
+
{
|
|
159
|
+
name: "recipient",
|
|
160
|
+
type: "address",
|
|
161
|
+
indexed: !0
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "attester",
|
|
165
|
+
type: "address",
|
|
166
|
+
indexed: !0
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "uid",
|
|
170
|
+
type: "bytes32",
|
|
171
|
+
indexed: !1
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "schemaUID",
|
|
175
|
+
type: "bytes32",
|
|
176
|
+
indexed: !0
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
...de
|
|
181
|
+
], w = [{
|
|
182
|
+
name: "schema",
|
|
183
|
+
type: "bytes32"
|
|
184
|
+
}, {
|
|
185
|
+
name: "data",
|
|
186
|
+
type: "tuple[]",
|
|
187
|
+
components: [
|
|
188
|
+
{
|
|
189
|
+
name: "recipient",
|
|
190
|
+
type: "address"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "expirationTime",
|
|
194
|
+
type: "uint64"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "revocable",
|
|
198
|
+
type: "bool"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "refUID",
|
|
202
|
+
type: "bytes32"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "data",
|
|
206
|
+
type: "bytes"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "value",
|
|
210
|
+
type: "uint256"
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}], fe = [{
|
|
214
|
+
type: "function",
|
|
215
|
+
name: "multiPublish",
|
|
216
|
+
stateMutability: "nonpayable",
|
|
217
|
+
inputs: [{
|
|
218
|
+
name: "requests",
|
|
219
|
+
type: "tuple[]",
|
|
220
|
+
components: [
|
|
221
|
+
{
|
|
222
|
+
name: "localId",
|
|
223
|
+
type: "string"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "seedUid",
|
|
227
|
+
type: "bytes32"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "seedSchemaUid",
|
|
231
|
+
type: "bytes32"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "versionUid",
|
|
235
|
+
type: "bytes32"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "versionSchemaUid",
|
|
239
|
+
type: "bytes32"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "seedIsRevocable",
|
|
243
|
+
type: "bool"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "listOfAttestations",
|
|
247
|
+
type: "tuple[]",
|
|
248
|
+
components: w
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "propertiesToUpdate",
|
|
252
|
+
type: "tuple[]",
|
|
253
|
+
components: [{
|
|
254
|
+
name: "publishLocalId",
|
|
255
|
+
type: "string"
|
|
256
|
+
}, {
|
|
257
|
+
name: "propertySchemaUid",
|
|
258
|
+
type: "bytes32"
|
|
259
|
+
}]
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}],
|
|
263
|
+
outputs: [{ type: "bytes32[]" }]
|
|
264
|
+
}], pe = [{
|
|
265
|
+
type: "function",
|
|
266
|
+
name: "multiPublish",
|
|
267
|
+
stateMutability: "nonpayable",
|
|
268
|
+
inputs: [{
|
|
269
|
+
name: "requests",
|
|
270
|
+
type: "tuple[]",
|
|
271
|
+
components: [
|
|
272
|
+
{
|
|
273
|
+
name: "localIdIndex",
|
|
274
|
+
type: "uint256"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: "seedUid",
|
|
278
|
+
type: "bytes32"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: "seedSchemaUid",
|
|
282
|
+
type: "bytes32"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "versionUid",
|
|
286
|
+
type: "bytes32"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: "versionSchemaUid",
|
|
290
|
+
type: "bytes32"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "seedIsRevocable",
|
|
294
|
+
type: "bool"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: "listOfAttestations",
|
|
298
|
+
type: "tuple[]",
|
|
299
|
+
components: w
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: "propertiesToUpdate",
|
|
303
|
+
type: "tuple[]",
|
|
304
|
+
components: [{
|
|
305
|
+
name: "publishLocalIdIndex",
|
|
306
|
+
type: "uint256"
|
|
307
|
+
}, {
|
|
308
|
+
name: "propertySchemaUid",
|
|
309
|
+
type: "bytes32"
|
|
310
|
+
}]
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
}],
|
|
314
|
+
outputs: [{ type: "bytes32[]" }]
|
|
315
|
+
}], T = [
|
|
316
|
+
{
|
|
317
|
+
type: "function",
|
|
318
|
+
name: "getEas",
|
|
319
|
+
stateMutability: "view",
|
|
320
|
+
inputs: [],
|
|
321
|
+
outputs: [{ type: "address" }]
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
type: "function",
|
|
325
|
+
name: "setEas",
|
|
326
|
+
stateMutability: "nonpayable",
|
|
327
|
+
inputs: [{
|
|
328
|
+
name: "_eas",
|
|
329
|
+
type: "address"
|
|
330
|
+
}],
|
|
331
|
+
outputs: [{ type: "string" }]
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
type: "function",
|
|
335
|
+
name: "isActiveSigner",
|
|
336
|
+
stateMutability: "view",
|
|
337
|
+
inputs: [{
|
|
338
|
+
name: "signer",
|
|
339
|
+
type: "address"
|
|
340
|
+
}],
|
|
341
|
+
outputs: [{ type: "bool" }]
|
|
342
|
+
}
|
|
343
|
+
], me = [{
|
|
344
|
+
type: "event",
|
|
345
|
+
name: "CreatedAttestation",
|
|
346
|
+
inputs: [{
|
|
347
|
+
name: "result",
|
|
348
|
+
type: "tuple",
|
|
349
|
+
indexed: !1,
|
|
350
|
+
components: [{
|
|
351
|
+
name: "schemaUid",
|
|
352
|
+
type: "bytes32"
|
|
353
|
+
}, {
|
|
354
|
+
name: "attestationUid",
|
|
355
|
+
type: "bytes32"
|
|
356
|
+
}]
|
|
357
|
+
}]
|
|
358
|
+
}, {
|
|
359
|
+
type: "event",
|
|
360
|
+
name: "SeedPublished",
|
|
361
|
+
inputs: [{
|
|
362
|
+
name: "returnedDataFromEAS",
|
|
363
|
+
type: "bytes",
|
|
364
|
+
indexed: !1
|
|
365
|
+
}]
|
|
366
|
+
}], E = [{
|
|
367
|
+
type: "function",
|
|
368
|
+
name: "getAddress",
|
|
369
|
+
stateMutability: "view",
|
|
370
|
+
inputs: [{
|
|
371
|
+
name: "_adminSigner",
|
|
372
|
+
type: "address"
|
|
373
|
+
}, {
|
|
374
|
+
name: "_data",
|
|
375
|
+
type: "bytes"
|
|
376
|
+
}],
|
|
377
|
+
outputs: [{ type: "address" }]
|
|
378
|
+
}, {
|
|
379
|
+
type: "function",
|
|
380
|
+
name: "createAccount",
|
|
381
|
+
stateMutability: "nonpayable",
|
|
382
|
+
inputs: [{
|
|
383
|
+
name: "_admin",
|
|
384
|
+
type: "address"
|
|
385
|
+
}, {
|
|
386
|
+
name: "_data",
|
|
387
|
+
type: "bytes"
|
|
388
|
+
}],
|
|
389
|
+
outputs: [{ type: "address" }]
|
|
390
|
+
}], he = [{
|
|
391
|
+
type: "function",
|
|
392
|
+
name: "getSchema",
|
|
393
|
+
stateMutability: "view",
|
|
394
|
+
inputs: [{
|
|
395
|
+
name: "uid",
|
|
396
|
+
type: "bytes32"
|
|
397
|
+
}],
|
|
398
|
+
outputs: [{
|
|
399
|
+
name: "",
|
|
400
|
+
type: "tuple",
|
|
401
|
+
components: [
|
|
402
|
+
{
|
|
403
|
+
name: "uid",
|
|
404
|
+
type: "bytes32"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: "resolver",
|
|
408
|
+
type: "address"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: "revocable",
|
|
412
|
+
type: "bool"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "schema",
|
|
416
|
+
type: "string"
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
}]
|
|
420
|
+
}, {
|
|
421
|
+
type: "function",
|
|
422
|
+
name: "register",
|
|
423
|
+
stateMutability: "nonpayable",
|
|
424
|
+
inputs: [
|
|
425
|
+
{
|
|
426
|
+
name: "schema",
|
|
427
|
+
type: "string"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: "resolver",
|
|
431
|
+
type: "address"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: "revocable",
|
|
435
|
+
type: "bool"
|
|
436
|
+
}
|
|
437
|
+
],
|
|
438
|
+
outputs: [{ type: "bytes32" }]
|
|
439
|
+
}], D = te;
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/helpers/chainConfig.ts
|
|
442
|
+
function O() {
|
|
443
|
+
try {
|
|
444
|
+
return $().chain ?? D;
|
|
445
|
+
} catch {
|
|
446
|
+
return D;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function k() {
|
|
450
|
+
let e = $();
|
|
451
|
+
if (e.rpcUrl) return e.rpcUrl;
|
|
452
|
+
if (e.thirdwebClientId) return `https://${(e.chain ?? D).id}.rpc.thirdweb.com/${e.thirdwebClientId}`;
|
|
453
|
+
throw Error("@seedprotocol/publish: rpcUrl is required when thirdwebClientId is not set. A thirdwebSecretKey authenticates Thirdweb RPC but does not build this URL. Pass rpcUrl or thirdwebClientId in initPublish / PublishProvider config.");
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/helpers/chainClient.ts
|
|
457
|
+
var A = null, j = null;
|
|
458
|
+
function ge() {
|
|
459
|
+
try {
|
|
460
|
+
let e = $().thirdwebSecretKey;
|
|
461
|
+
return e ? { headers: { "x-secret-key": e } } : void 0;
|
|
462
|
+
} catch {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
function _e() {
|
|
467
|
+
let e = O(), t = k(), n = ge();
|
|
468
|
+
return f({
|
|
469
|
+
chain: e,
|
|
470
|
+
transport: h(t, n ? { fetchOptions: n } : void 0)
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
function M() {
|
|
474
|
+
let e = O(), t = k(), n = "";
|
|
475
|
+
try {
|
|
476
|
+
n = $().thirdwebSecretKey ?? "";
|
|
477
|
+
} catch {
|
|
478
|
+
n = "";
|
|
479
|
+
}
|
|
480
|
+
let r = `${e.id}:${t}:${n ? "1" : "0"}:${n}`;
|
|
481
|
+
return (!A || j !== r) && (j = r, A = _e()), A;
|
|
482
|
+
}
|
|
483
|
+
async function N(e) {
|
|
484
|
+
return M().waitForTransactionReceipt({ hash: e });
|
|
485
|
+
}
|
|
486
|
+
async function P(e) {
|
|
487
|
+
let t = await M().getBytecode({ address: e });
|
|
488
|
+
return !!t && t !== "0x";
|
|
489
|
+
}
|
|
490
|
+
async function ve(e) {
|
|
491
|
+
try {
|
|
492
|
+
let t = await M().getBlock({ blockNumber: e });
|
|
493
|
+
if (t?.timestamp != null) return Number(t.timestamp) * 1e3;
|
|
494
|
+
} catch {}
|
|
495
|
+
return null;
|
|
496
|
+
}
|
|
497
|
+
var ye = 5, be = 6e3;
|
|
498
|
+
async function xe(e, t = ye, n = be) {
|
|
499
|
+
for (let r = 0; r < t; r++) {
|
|
500
|
+
if (await P(e)) return !0;
|
|
501
|
+
r < t - 1 && await new Promise((e) => {
|
|
502
|
+
setTimeout(e, n);
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
return !1;
|
|
506
|
+
}
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region src/helpers/contracts/index.ts
|
|
509
|
+
function Se(e, t, n) {
|
|
510
|
+
return {
|
|
511
|
+
to: e,
|
|
512
|
+
data: m({
|
|
513
|
+
abi: fe,
|
|
514
|
+
functionName: "multiPublish",
|
|
515
|
+
args: [t]
|
|
516
|
+
}),
|
|
517
|
+
gas: n
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
function Ce(e, t, n) {
|
|
521
|
+
return {
|
|
522
|
+
to: e,
|
|
523
|
+
data: m({
|
|
524
|
+
abi: pe,
|
|
525
|
+
functionName: "multiPublish",
|
|
526
|
+
args: [t]
|
|
527
|
+
}),
|
|
528
|
+
gas: n
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
function we(e, t) {
|
|
532
|
+
return {
|
|
533
|
+
to: e,
|
|
534
|
+
data: m({
|
|
535
|
+
abi: T,
|
|
536
|
+
functionName: "setEas",
|
|
537
|
+
args: [t]
|
|
538
|
+
})
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
async function Te(e) {
|
|
542
|
+
return M().readContract({
|
|
543
|
+
address: e,
|
|
544
|
+
abi: T,
|
|
545
|
+
functionName: "getEas"
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
async function Ee(e, t) {
|
|
549
|
+
return M().readContract({
|
|
550
|
+
address: e,
|
|
551
|
+
abi: T,
|
|
552
|
+
functionName: "isActiveSigner",
|
|
553
|
+
args: [t]
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
async function De(e, t = "0x") {
|
|
557
|
+
let { thirdwebAccountFactoryAddress: n } = $();
|
|
558
|
+
return M().readContract({
|
|
559
|
+
address: n || "0x76f47d88bfaf670f5208911181fcdc0e160cb16d",
|
|
560
|
+
abi: E,
|
|
561
|
+
functionName: "getAddress",
|
|
562
|
+
args: [e, t]
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
function Oe(e, t = "0x") {
|
|
566
|
+
let { thirdwebAccountFactoryAddress: n } = $();
|
|
567
|
+
return {
|
|
568
|
+
to: n || "0x76f47d88bfaf670f5208911181fcdc0e160cb16d",
|
|
569
|
+
data: m({
|
|
570
|
+
abi: E,
|
|
571
|
+
functionName: "createAccount",
|
|
572
|
+
args: [e, t]
|
|
573
|
+
})
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
var ke = "0x0000000000000000000000000000000000000000";
|
|
577
|
+
function F(e) {
|
|
578
|
+
let { easContractAddress: t } = $();
|
|
579
|
+
return {
|
|
580
|
+
to: t,
|
|
581
|
+
data: m({
|
|
582
|
+
abi: C,
|
|
583
|
+
functionName: "attest",
|
|
584
|
+
args: [{
|
|
585
|
+
schema: e.schema,
|
|
586
|
+
data: {
|
|
587
|
+
recipient: e.data.recipient ?? ke,
|
|
588
|
+
expirationTime: e.data.expirationTime ?? 0n,
|
|
589
|
+
revocable: e.data.revocable ?? !0,
|
|
590
|
+
refUID: e.data.refUID,
|
|
591
|
+
data: e.data.data,
|
|
592
|
+
value: e.data.value ?? 0n
|
|
593
|
+
}
|
|
594
|
+
}]
|
|
595
|
+
})
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
function I(e) {
|
|
599
|
+
let { easContractAddress: t } = $();
|
|
600
|
+
return {
|
|
601
|
+
to: t,
|
|
602
|
+
data: m({
|
|
603
|
+
abi: C,
|
|
604
|
+
functionName: "multiAttest",
|
|
605
|
+
args: [e]
|
|
606
|
+
})
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
function L(e) {
|
|
610
|
+
let { easContractAddress: t } = $();
|
|
611
|
+
return {
|
|
612
|
+
to: t,
|
|
613
|
+
data: m({
|
|
614
|
+
abi: C,
|
|
615
|
+
functionName: "multiRevoke",
|
|
616
|
+
args: [e.map((e) => ({
|
|
617
|
+
schema: e.schema,
|
|
618
|
+
data: e.data.map((e) => ({
|
|
619
|
+
uid: e.uid,
|
|
620
|
+
value: e.value ?? 0n
|
|
621
|
+
}))
|
|
622
|
+
}))]
|
|
623
|
+
})
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
var Ae = "0x" + "0".repeat(64);
|
|
627
|
+
async function je(e) {
|
|
628
|
+
let t = await M().readContract({
|
|
629
|
+
address: v,
|
|
630
|
+
abi: he,
|
|
631
|
+
functionName: "getSchema",
|
|
632
|
+
args: [e]
|
|
633
|
+
});
|
|
634
|
+
return !t || t.uid === Ae ? null : {
|
|
635
|
+
uid: t.uid,
|
|
636
|
+
resolver: t.resolver,
|
|
637
|
+
revocable: t.revocable,
|
|
638
|
+
schema: t.schema
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function Me(e) {
|
|
642
|
+
return {
|
|
643
|
+
to: v,
|
|
644
|
+
data: m({
|
|
645
|
+
abi: he,
|
|
646
|
+
functionName: "register",
|
|
647
|
+
args: [
|
|
648
|
+
e.schema,
|
|
649
|
+
e.resolverAddress,
|
|
650
|
+
e.revocable
|
|
651
|
+
]
|
|
652
|
+
})
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
//#endregion
|
|
656
|
+
//#region src/helpers/easDirect.ts
|
|
657
|
+
var Ne = "0x0000000000000000000000000000000000000000", R = "0x" + "0".repeat(64);
|
|
658
|
+
function Pe(e) {
|
|
659
|
+
return F(e);
|
|
660
|
+
}
|
|
661
|
+
function Fe(e) {
|
|
662
|
+
return I(e);
|
|
663
|
+
}
|
|
664
|
+
function Ie(e) {
|
|
665
|
+
return p([{ type: "bytes32" }], [e]);
|
|
666
|
+
}
|
|
667
|
+
function Le(e, t) {
|
|
668
|
+
return z(e, t)[0]?.uid;
|
|
669
|
+
}
|
|
670
|
+
function z(e, t) {
|
|
671
|
+
if (!e.logs?.length) return [];
|
|
672
|
+
let n = t.toLowerCase(), r = e.logs.filter((e) => e.address && e.address.toLowerCase() === n);
|
|
673
|
+
if (!r.length) return [];
|
|
674
|
+
try {
|
|
675
|
+
let e = g({
|
|
676
|
+
abi: C,
|
|
677
|
+
eventName: "Attested",
|
|
678
|
+
logs: r,
|
|
679
|
+
strict: !1
|
|
680
|
+
}), t = [];
|
|
681
|
+
for (let n of e) {
|
|
682
|
+
let e = n.args?.uid, r = n.args?.schemaUID;
|
|
683
|
+
e && e !== R && r && t.push({
|
|
684
|
+
schemaUid: r,
|
|
685
|
+
uid: e
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
return t;
|
|
689
|
+
} catch {
|
|
690
|
+
return [];
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
function B(e) {
|
|
694
|
+
let { modularAccountModuleContract: t } = $(), n = t?.trim();
|
|
695
|
+
return n && /^0x[0-9a-fA-F]{40}$/.test(n) ? Re(n, e) : L(e);
|
|
696
|
+
}
|
|
697
|
+
function Re(e, t) {
|
|
698
|
+
return {
|
|
699
|
+
to: e,
|
|
700
|
+
data: m({
|
|
701
|
+
abi: C,
|
|
702
|
+
functionName: "multiRevoke",
|
|
703
|
+
args: [t.map((e) => ({
|
|
704
|
+
schema: e.schema,
|
|
705
|
+
data: e.data.map((e) => ({
|
|
706
|
+
uid: e.uid,
|
|
707
|
+
value: e.value ?? 0n
|
|
708
|
+
}))
|
|
709
|
+
}))]
|
|
710
|
+
})
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region src/helpers/publishWalletRegistry.ts
|
|
715
|
+
var V = null;
|
|
716
|
+
function ze() {
|
|
717
|
+
return r.isInitialized() ? Promise.resolve() : new Promise((e) => {
|
|
718
|
+
r.onReady(() => e());
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
async function Be(e) {
|
|
722
|
+
if (V = e, !e) return;
|
|
723
|
+
await ze();
|
|
724
|
+
let t = /* @__PURE__ */ new Set();
|
|
725
|
+
for (let n of e.ownedAddresses ?? []) n && t.add(n.toLowerCase());
|
|
726
|
+
t.add(e.signer.address.toLowerCase()), t.add(e.txSender.address.toLowerCase()), e.publisherAddress && t.add(e.publisherAddress.toLowerCase());
|
|
727
|
+
try {
|
|
728
|
+
await r.setAddresses({ owned: [...t] });
|
|
729
|
+
let n = e.publisherAddress ?? e.signer.address;
|
|
730
|
+
n && await r.claimUnpublishedDrafts(n);
|
|
731
|
+
} catch (e) {
|
|
732
|
+
console.warn("[publishWalletRegistry] Failed to set seed client addresses:", e);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
function H() {
|
|
736
|
+
return V;
|
|
737
|
+
}
|
|
738
|
+
function Ve() {
|
|
739
|
+
V = null;
|
|
740
|
+
}
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region src/helpers/seedSigner.ts
|
|
743
|
+
var U = Symbol.for("seedprotocol.SeedSigner"), W = Symbol.for("seedprotocol.SeedTxSender");
|
|
744
|
+
function G(e) {
|
|
745
|
+
return Object.assign(e, { [U]: !0 });
|
|
746
|
+
}
|
|
747
|
+
function K(e) {
|
|
748
|
+
return Object.assign(e, { [W]: !0 });
|
|
749
|
+
}
|
|
750
|
+
function q(e) {
|
|
751
|
+
return !!e && typeof e == "object" && U in e;
|
|
752
|
+
}
|
|
753
|
+
function J(e) {
|
|
754
|
+
return !!e && typeof e == "object" && W in e;
|
|
755
|
+
}
|
|
756
|
+
function Y(e) {
|
|
757
|
+
return !!e && typeof e == "object" && "signer" in e && "txSender" in e && q(e.signer) && J(e.txSender);
|
|
758
|
+
}
|
|
759
|
+
function He(e) {
|
|
760
|
+
let t = e.address;
|
|
761
|
+
return {
|
|
762
|
+
signer: G({
|
|
763
|
+
address: t,
|
|
764
|
+
signMessage: async ({ message: t }) => {
|
|
765
|
+
if (typeof t == "string") return await e.signMessage(t);
|
|
766
|
+
let n = t.raw, r = typeof n == "string" ? ae.getBytes(n) : n instanceof Uint8Array ? n : new Uint8Array(n);
|
|
767
|
+
return await e.signMessage(r);
|
|
768
|
+
}
|
|
769
|
+
}),
|
|
770
|
+
txSender: K({
|
|
771
|
+
address: t,
|
|
772
|
+
sendTransaction: async (t) => ({ transactionHash: (await e.sendTransaction({
|
|
773
|
+
to: t.to,
|
|
774
|
+
data: t.data,
|
|
775
|
+
value: t.value,
|
|
776
|
+
gasLimit: t.gas
|
|
777
|
+
})).hash })
|
|
778
|
+
})
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
function Ue(e) {
|
|
782
|
+
if (Y(e)) return e.signer;
|
|
783
|
+
if (q(e)) return e;
|
|
784
|
+
throw Error("@seedprotocol/publish: expected a SeedSigner or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
|
|
785
|
+
}
|
|
786
|
+
function We(e) {
|
|
787
|
+
if (Y(e)) return e.txSender;
|
|
788
|
+
if (J(e)) return e;
|
|
789
|
+
throw Error("@seedprotocol/publish: expected a SeedTxSender or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
|
|
790
|
+
}
|
|
791
|
+
function Ge(e) {
|
|
792
|
+
if (Y(e)) return e;
|
|
793
|
+
throw Error("@seedprotocol/publish: expected a PublishWallet (signer + txSender). Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
|
|
794
|
+
}
|
|
795
|
+
//#endregion
|
|
796
|
+
//#region src/helpers/adapters/thirdwebAccount.ts
|
|
797
|
+
var Ke = /* @__PURE__ */ e({
|
|
798
|
+
asSeedSignerFromThirdweb: () => Je,
|
|
799
|
+
asThirdwebPublishWallet: () => Z,
|
|
800
|
+
fromThirdwebAccount: () => X
|
|
801
|
+
});
|
|
802
|
+
function qe() {
|
|
803
|
+
let e = O();
|
|
804
|
+
return e.id === _.id ? _ : ne({
|
|
805
|
+
id: e.id,
|
|
806
|
+
name: e.name,
|
|
807
|
+
nativeCurrency: e.nativeCurrency,
|
|
808
|
+
rpc: e.rpcUrls.default.http[0] ?? ""
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
function X(e, t) {
|
|
812
|
+
let n = t?.client, r = e.address;
|
|
813
|
+
return {
|
|
814
|
+
signer: G({
|
|
815
|
+
address: r,
|
|
816
|
+
signMessage: async ({ message: t }) => await e.signMessage({ message: t })
|
|
817
|
+
}),
|
|
818
|
+
txSender: K({
|
|
819
|
+
address: r,
|
|
820
|
+
sendTransaction: async (t) => {
|
|
821
|
+
let r = n ?? (await import("./publishThirdwebClient-CZIVmr9Z.js").then((e) => e.n)).getClient(), i = qe(), a = re({
|
|
822
|
+
client: r,
|
|
823
|
+
chain: i,
|
|
824
|
+
to: t.to,
|
|
825
|
+
data: t.data,
|
|
826
|
+
value: t.value,
|
|
827
|
+
gas: t.gas
|
|
828
|
+
});
|
|
829
|
+
return { transactionHash: (await ie({
|
|
830
|
+
account: e,
|
|
831
|
+
transaction: a
|
|
832
|
+
})).transactionHash };
|
|
833
|
+
}
|
|
834
|
+
})
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
function Z(e, t) {
|
|
838
|
+
if (Y(e)) return e;
|
|
839
|
+
if (q(e)) throw Error("@seedprotocol/publish/thirdweb: SeedSigner alone cannot send sponsored txs. Pass fromThirdwebAccount(account) or a PublishWallet.");
|
|
840
|
+
return X(e, t);
|
|
841
|
+
}
|
|
842
|
+
function Je(e) {
|
|
843
|
+
return Y(e) ? e.signer : q(e) ? e : X(e).signer;
|
|
844
|
+
}
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region src/services/revoke/revokeAttestations.ts
|
|
847
|
+
async function Ye(e) {
|
|
848
|
+
if (!e) return !1;
|
|
849
|
+
let t = a();
|
|
850
|
+
if (!t) return !1;
|
|
851
|
+
let n = await t(), r = e.toLowerCase();
|
|
852
|
+
return !!n?.some((e) => e?.toLowerCase() === r);
|
|
853
|
+
}
|
|
854
|
+
async function Xe(e) {
|
|
855
|
+
let { seedLocalId: t, seedUid: r, seedSchemaUid: a } = e, l = await i({
|
|
856
|
+
seedLocalId: t,
|
|
857
|
+
seedUid: r
|
|
858
|
+
}), u = H();
|
|
859
|
+
if (!u) try {
|
|
860
|
+
let { getConnectedAccount: e } = await import("./publishAuthorization-Bltn3y_K.js").then((e) => e.z), { resolveRevokeAccount: t } = await import("./resolveRevokeAccount-CaIMuCee.js"), n = await e();
|
|
861
|
+
if (!n) throw Error("No wallet connected. Connect a wallet to revoke attestations.");
|
|
862
|
+
u = X(await t({
|
|
863
|
+
account: n,
|
|
864
|
+
attester: l
|
|
865
|
+
}));
|
|
866
|
+
} catch (e) {
|
|
867
|
+
throw e instanceof Error && e.message.includes("No wallet connected") || e instanceof Error && e.message.includes("Revocation not supported") ? e : Error("No wallet connected. Use useSeedWallet / setPublishWallet, or @seedprotocol/publish/thirdweb ConnectButton.", { cause: e });
|
|
868
|
+
}
|
|
869
|
+
else if (await Ye(l)) {
|
|
870
|
+
let { modularAccountModuleContract: e } = $();
|
|
871
|
+
if (!e?.trim()) throw Error("Revocation not supported for items published via the modular executor.");
|
|
872
|
+
}
|
|
873
|
+
let d = u.txSender, [f, p] = await Promise.all([s(r), o(r)]), m = f.map((e) => e.uid).filter((e) => c(e)), h = /* @__PURE__ */ new Map();
|
|
874
|
+
for (let { uid: e, schemaUid: t } of p) {
|
|
875
|
+
if (!c(e)) continue;
|
|
876
|
+
let n = h.get(t) ?? [];
|
|
877
|
+
n.push(e), h.set(t, n);
|
|
878
|
+
}
|
|
879
|
+
let g = [];
|
|
880
|
+
for (let [e, t] of h) t.length > 0 && g.push({
|
|
881
|
+
schema: e,
|
|
882
|
+
data: t.map((e) => ({ uid: e }))
|
|
883
|
+
});
|
|
884
|
+
m.length > 0 && g.push({
|
|
885
|
+
schema: n,
|
|
886
|
+
data: m.map((e) => ({ uid: e }))
|
|
887
|
+
}), g.push({
|
|
888
|
+
schema: a,
|
|
889
|
+
data: [{ uid: r }]
|
|
890
|
+
});
|
|
891
|
+
for (let e of g) {
|
|
892
|
+
if (e.data.length === 0) continue;
|
|
893
|
+
let t = B([e]);
|
|
894
|
+
try {
|
|
895
|
+
await N((await d.sendTransaction(t)).transactionHash);
|
|
896
|
+
} catch (e) {
|
|
897
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
898
|
+
if (t.includes("AccessDenied") || t.includes("0x4ca88867")) throw Error("Only the original attester can revoke attestations. Connect the wallet that published this item.");
|
|
899
|
+
if (t.includes("AlreadyRevoked")) continue;
|
|
900
|
+
throw e;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
let te = Math.floor(Date.now() / 1e3);
|
|
904
|
+
await ee({
|
|
905
|
+
seedLocalId: t,
|
|
906
|
+
revokedAt: te
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/config.ts
|
|
911
|
+
var Q = null;
|
|
912
|
+
function Ze(e) {
|
|
913
|
+
Q = e;
|
|
914
|
+
}
|
|
915
|
+
function Qe() {
|
|
916
|
+
return Q;
|
|
917
|
+
}
|
|
918
|
+
function $e(e) {
|
|
919
|
+
Ze(e), u(async () => {
|
|
920
|
+
let e = H();
|
|
921
|
+
if (e?.publisherAddress) return e.publisherAddress;
|
|
922
|
+
if (e?.signer?.address) return e.signer.address;
|
|
923
|
+
}), d(Xe), import("./worker-CEgulQnm.js").then((e) => {
|
|
924
|
+
e.startArweaveL1FinalizeWorker();
|
|
925
|
+
}), l(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
|
|
926
|
+
}
|
|
927
|
+
var et = $e;
|
|
928
|
+
function $() {
|
|
929
|
+
let e = Q;
|
|
930
|
+
if (!e) throw Error("@seedprotocol/publish: Call initPublish() or ensure PublishProvider is mounted with config before using the publish package");
|
|
931
|
+
let n = e.useArweaveBundler ?? !1, r = e.arweaveUploadVerificationBaseUrl ?? e.uploadApiBaseUrl, i = e.arweaveGraphqlUrl ?? t, a = e.useModularExecutor ?? !1, o = e.chain ?? D, s = e.accountMode ?? (e.bundlerUrl ? "eip7702" : "eoa");
|
|
932
|
+
return {
|
|
933
|
+
...e,
|
|
934
|
+
thirdwebAccountFactoryAddress: y,
|
|
935
|
+
easContractAddress: b,
|
|
936
|
+
useIntegerLocalIds: e.useIntegerLocalIds ?? !1,
|
|
937
|
+
useDirectEas: e.useDirectEas ?? !1,
|
|
938
|
+
modularAccountModuleData: e.modularAccountModuleData ?? "0x",
|
|
939
|
+
useModularExecutor: a,
|
|
940
|
+
useArweaveBundler: n,
|
|
941
|
+
arweaveUploadVerificationBaseUrl: r,
|
|
942
|
+
arweaveGraphqlUrl: i,
|
|
943
|
+
autoDeployManagedAccount: e.autoDeployManagedAccount ?? !1,
|
|
944
|
+
autoDeployEip7702ModularAccount: tt(e, a),
|
|
945
|
+
chain: o,
|
|
946
|
+
accountMode: s
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
function tt(e, t) {
|
|
950
|
+
return e.autoDeployEip7702ModularAccount === !0 || e.autoDeployEip7702ModularAccount !== !1 && t;
|
|
951
|
+
}
|
|
952
|
+
//#endregion
|
|
953
|
+
export { ue as $, F as A, je as B, Ie as C, Fe as D, Pe as E, Me as F, N as G, M as H, we as I, me as J, k as K, De as L, L as M, Se as N, B as O, Ce as P, x as Q, Te as R, R as S, z as T, P as U, ve as V, xe as W, oe as X, b as Y, le as Z, J as _, Je as a, Be as b, Ke as c, We as d, ce as et, G as f, q as g, Y as h, $e as i, I as j, Oe as k, Ge as l, He as m, Qe as n, y as nt, Z as o, K as p, O as q, $ as r, X as s, et as t, se as tt, Ue as u, Ve as v, Le as w, Ne as x, H as y, Ee as z };
|
|
954
|
+
|
|
955
|
+
//# sourceMappingURL=config-EQZZNH9H.js.map
|