@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
package/dist/index.js
CHANGED
|
@@ -1,24 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { BaseDb as
|
|
6
|
-
import { createPublicClient as
|
|
7
|
-
import { ethers as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { lookup as
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, G as o, H as s, I as c, J as l, K as u, O as d, P as f, Q as p, R as m, S as h, T as g, V as _, _t as v, a as y, at as b, b as ee, bt as te, c as ne, ct as x, d as re, f as ie, gt as ae, i as oe, j as se, k as S, l as ce, n as le, o as C, ot as ue, pt as de, r as fe, s as pe, t as me, w as he, x as ge, y as _e, yt as w } from "./chainConfig-BYm5OXpk.js";
|
|
2
|
+
import { a as ve, i as ye, n as be, o as xe, r as Se, s as Ce, t as we } from "./errors-Du3LNbJN.js";
|
|
3
|
+
import { $ as Te, G as Ee, J as De, K as Oe, Q as ke, X as Ae, Y as je, Z as Me, _ as Ne, a as Pe, b as Fe, c as Ie, et as Le, g as Re, h as T, i as ze, l as Be, n as Ve, o as He, q as Ue, r as We, s as Ge, t as Ke, v as qe, y as Je } from "./publishAuthorization-CxBkijU6.js";
|
|
4
|
+
import { n as Ye, r as Xe } from "./collectBatchUids-CnIe9jUB.js";
|
|
5
|
+
import { BaseDb as E, arweaveL1FinalizeJobs as D, isItemOwned as Ze, publishProcesses as O, uploadProcesses as Qe } from "@seedprotocol/sdk";
|
|
6
|
+
import { createPublicClient as $e, createWalletClient as et, custom as tt, defineChain as nt, http as k } from "viem";
|
|
7
|
+
import { ethers as rt } from "ethers";
|
|
8
|
+
import { DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS as it, DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS as at, DOMAIN_OWNERSHIP_METHOD as ot, DOMAIN_OWNERSHIP_METHOD as st, DOMAIN_OWNERSHIP_SCHEMA_DEF as ct, DOMAIN_OWNERSHIP_SCHEMA_DEF as A, DOMAIN_OWNERSHIP_SCHEMA_NAME as lt, DOMAIN_OWNERSHIP_SCHEMA_NAME as ut, DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE as dt, EAS_CHAIN_DEPLOYMENTS as ft, PUBLISHED_BY_SCHEMA_DEF as pt, PUBLISHED_BY_SCHEMA_DEF as j, PUBLISHED_BY_SCHEMA_NAME as mt, PUBLISHED_BY_SCHEMA_NAME as ht, assessDomainOwnership as gt, buildDomainOwnershipTxtValue as _t, decodeDomainOwnershipData as vt, domainOwnershipTxtName as yt, getDomainOwnershipFromEas as bt, getEasChainDeployment as xt, hashDomainOwnershipChallenge as St, hashDomainRegistryFingerprint as Ct, hashPublishedByBatch as wt, hashPublishedByBatch as Tt, isValidEasAttestationUid as M, normalizeBytes32Hex as N, parseDomainOwnershipTxtValue as Et } from "@seedprotocol/eas";
|
|
9
|
+
import { useCallback as P, useEffect as F, useMemo as I, useRef as Dt, useState as L } from "react";
|
|
10
|
+
import { jsx as R, jsxs as Ot } from "react/jsx-runtime";
|
|
11
|
+
import { SeedProvider as kt, SeedProvider as At, useLiveQuery as z } from "@seedprotocol/react";
|
|
12
|
+
import { entryPoint08Address as B } from "viem/account-abstraction";
|
|
13
|
+
import { createSmartAccountClient as jt } from "permissionless";
|
|
14
|
+
import { to7702SimpleSmartAccount as Mt } from "permissionless/accounts";
|
|
15
|
+
import { createPimlicoClient as Nt } from "permissionless/clients/pimlico";
|
|
16
|
+
import { NO_EXPIRATION as Pt, SchemaEncoder as Ft, SchemaRegistry as It, ZERO_BYTES32 as V } from "@ethereum-attestation-service/eas-sdk";
|
|
17
|
+
import { and as Lt, desc as H, eq as U, inArray as Rt, notInArray as zt } from "drizzle-orm";
|
|
18
|
+
import { useSelector as Bt } from "@xstate/react";
|
|
19
|
+
import { lookup as Vt, toRegistrableDomain as Ht } from "rdapper";
|
|
20
|
+
//#region src/helpers/seedTwin.ts
|
|
21
|
+
function Ut(e) {
|
|
22
|
+
let t = [
|
|
23
|
+
["chainId", e?.chainId],
|
|
24
|
+
["rpcUrl", e?.rpcUrl],
|
|
25
|
+
["bundlerUrl", e?.bundlerUrl],
|
|
26
|
+
["easGraphqlUrl", e?.easGraphqlUrl],
|
|
27
|
+
["contracts.eas", e?.contracts?.eas],
|
|
28
|
+
["contracts.schemaRegistry", e?.contracts?.schemaRegistry],
|
|
29
|
+
["contracts.managedAccountFactory", e?.contracts?.managedAccountFactory],
|
|
30
|
+
["contracts.seedProtocolExecutor", e?.contracts?.seedProtocolExecutor]
|
|
31
|
+
].filter(([, e]) => e == null || e === "").map(([e]) => e);
|
|
32
|
+
if (t.length > 0) throw Error(`seedTwinConfig: twin.json is missing ${t.join(", ")}. Re-run twin:up.`);
|
|
33
|
+
let n = e.forkedFrom?.chain ? ` (${e.forkedFrom.chain} fork)` : "", r = nt({
|
|
34
|
+
id: e.chainId,
|
|
35
|
+
name: `Seed twin${n}`,
|
|
36
|
+
nativeCurrency: {
|
|
37
|
+
name: "Ether",
|
|
38
|
+
symbol: "ETH",
|
|
39
|
+
decimals: 18
|
|
40
|
+
},
|
|
41
|
+
rpcUrls: { default: { http: [e.rpcUrl] } },
|
|
42
|
+
testnet: !0
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
chain: r,
|
|
46
|
+
publish: {
|
|
47
|
+
chain: r,
|
|
48
|
+
rpcUrl: e.rpcUrl,
|
|
49
|
+
easContractAddress: e.contracts.eas,
|
|
50
|
+
schemaRegistryAddress: e.contracts.schemaRegistry,
|
|
51
|
+
managedAccountFactoryAddress: e.contracts.managedAccountFactory,
|
|
52
|
+
modularAccountModuleContract: e.contracts.seedProtocolExecutor,
|
|
53
|
+
thirdweb: {
|
|
54
|
+
bundlerUrl: e.bundlerUrl,
|
|
55
|
+
sponsorGas: !1,
|
|
56
|
+
modularWalletMode: "EOA"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
eas: {
|
|
60
|
+
chainId: e.chainId,
|
|
61
|
+
indexerUrl: e.easGraphqlUrl
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
20
66
|
//#region src/react/PublishModeButtons.tsx
|
|
21
|
-
var
|
|
67
|
+
var Wt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish mode" }) => {
|
|
22
68
|
let i = {
|
|
23
69
|
display: "inline-flex",
|
|
24
70
|
gap: 8,
|
|
@@ -33,17 +79,17 @@ var Pt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish
|
|
|
33
79
|
cursor: n ? "not-allowed" : "pointer",
|
|
34
80
|
opacity: n ? .6 : 1
|
|
35
81
|
});
|
|
36
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ Ot("div", {
|
|
37
83
|
role: "group",
|
|
38
84
|
"aria-label": r,
|
|
39
85
|
style: i,
|
|
40
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ R("button", {
|
|
41
87
|
type: "button",
|
|
42
88
|
disabled: n,
|
|
43
89
|
style: a(e === "patch"),
|
|
44
90
|
onClick: () => t("patch"),
|
|
45
91
|
children: "Publish updates"
|
|
46
|
-
}), /* @__PURE__ */
|
|
92
|
+
}), /* @__PURE__ */ R("button", {
|
|
47
93
|
type: "button",
|
|
48
94
|
disabled: n,
|
|
49
95
|
style: a(e === "new_version"),
|
|
@@ -51,11 +97,11 @@ var Pt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish
|
|
|
51
97
|
children: "New version"
|
|
52
98
|
})]
|
|
53
99
|
});
|
|
54
|
-
},
|
|
55
|
-
t &&
|
|
56
|
-
}, [t]), /* @__PURE__ */
|
|
57
|
-
value: t ??
|
|
58
|
-
children: /* @__PURE__ */
|
|
100
|
+
}, Gt = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => (F(() => {
|
|
101
|
+
t && pe(t);
|
|
102
|
+
}, [t]), /* @__PURE__ */ R(Te.Provider, {
|
|
103
|
+
value: t ?? y(),
|
|
104
|
+
children: /* @__PURE__ */ R(At, {
|
|
59
105
|
queryClient: n,
|
|
60
106
|
queryClientRef: r,
|
|
61
107
|
children: e
|
|
@@ -63,30 +109,30 @@ var Pt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish
|
|
|
63
109
|
}));
|
|
64
110
|
//#endregion
|
|
65
111
|
//#region src/helpers/adapters/eip1193.ts
|
|
66
|
-
async function
|
|
67
|
-
let n = t.chain ??
|
|
68
|
-
if (!
|
|
112
|
+
async function Kt(e, t = {}) {
|
|
113
|
+
let n = t.chain ?? fe(), i = t.address;
|
|
114
|
+
if (!i) {
|
|
69
115
|
let t = await e.request({ method: "eth_requestAccounts" });
|
|
70
116
|
if (!t?.[0]) throw Error("@seedprotocol/publish: EIP-1193 provider returned no accounts");
|
|
71
|
-
|
|
117
|
+
i = t[0];
|
|
72
118
|
}
|
|
73
|
-
let
|
|
74
|
-
account:
|
|
119
|
+
let a = et({
|
|
120
|
+
account: i,
|
|
75
121
|
chain: n,
|
|
76
|
-
transport:
|
|
122
|
+
transport: tt(e)
|
|
77
123
|
});
|
|
78
124
|
return {
|
|
79
|
-
signer:
|
|
80
|
-
address:
|
|
81
|
-
signMessage: async ({ message: e }) =>
|
|
82
|
-
account:
|
|
125
|
+
signer: h({
|
|
126
|
+
address: i,
|
|
127
|
+
signMessage: async ({ message: e }) => a.signMessage({
|
|
128
|
+
account: i,
|
|
83
129
|
message: typeof e == "string" ? e : { raw: e.raw }
|
|
84
130
|
})
|
|
85
131
|
}),
|
|
86
|
-
txSender:
|
|
87
|
-
address:
|
|
88
|
-
sendTransaction: async (e) => ({ transactionHash: await
|
|
89
|
-
account:
|
|
132
|
+
txSender: r({
|
|
133
|
+
address: i,
|
|
134
|
+
sendTransaction: async (e) => ({ transactionHash: await a.sendTransaction({
|
|
135
|
+
account: i,
|
|
90
136
|
chain: n,
|
|
91
137
|
to: e.to,
|
|
92
138
|
data: e.data,
|
|
@@ -96,14 +142,14 @@ async function B(e, t = {}) {
|
|
|
96
142
|
})
|
|
97
143
|
};
|
|
98
144
|
}
|
|
99
|
-
async function
|
|
145
|
+
async function qt(e = {}) {
|
|
100
146
|
let t = globalThis.ethereum;
|
|
101
147
|
if (!t) throw Error("@seedprotocol/publish: window.ethereum is not available");
|
|
102
|
-
return
|
|
148
|
+
return Kt(t, e);
|
|
103
149
|
}
|
|
104
150
|
//#endregion
|
|
105
151
|
//#region src/helpers/adapters/permissionlessTxSender.ts
|
|
106
|
-
function
|
|
152
|
+
function Jt(e) {
|
|
107
153
|
return {
|
|
108
154
|
address: e.address,
|
|
109
155
|
type: "local",
|
|
@@ -118,185 +164,219 @@ function Lt(e) {
|
|
|
118
164
|
}
|
|
119
165
|
};
|
|
120
166
|
}
|
|
121
|
-
async function
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
167
|
+
async function Yt(e) {
|
|
168
|
+
let t;
|
|
169
|
+
try {
|
|
170
|
+
t = (await (await fetch(e, {
|
|
171
|
+
method: "POST",
|
|
172
|
+
headers: { "Content-Type": "application/json" },
|
|
173
|
+
body: JSON.stringify({
|
|
174
|
+
jsonrpc: "2.0",
|
|
175
|
+
id: 1,
|
|
176
|
+
method: "eth_supportedEntryPoints",
|
|
177
|
+
params: []
|
|
178
|
+
})
|
|
179
|
+
})).json()).result;
|
|
180
|
+
} catch {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (!Array.isArray(t)) return;
|
|
184
|
+
let n = t.map((e) => String(e).toLowerCase());
|
|
185
|
+
if (!n.includes(B.toLowerCase())) throw Error(`@seedprotocol/publish: PublishConfig.bundlerUrl (${e}) does not support EntryPoint v0.8 (it lists ${n.join(", ") || "none"}). The top-level bundlerUrl is only for the permissionless EIP-7702 sender. For Thirdweb in-app wallets (e.g. a local twin's bundler), set PublishConfig.thirdweb.bundlerUrl instead.`);
|
|
186
|
+
}
|
|
187
|
+
async function Xt(e) {
|
|
188
|
+
let { signer: t, bundlerUrl: n, paymasterUrl: i } = e;
|
|
189
|
+
await Yt(n);
|
|
190
|
+
let a = fe(), o = le(), s = t.address, c = $e({
|
|
191
|
+
chain: a,
|
|
192
|
+
transport: k(o)
|
|
193
|
+
}), l = Jt(t), u = await Mt({
|
|
126
194
|
client: c,
|
|
127
195
|
owner: l,
|
|
128
196
|
entryPoint: {
|
|
129
|
-
address:
|
|
197
|
+
address: B,
|
|
130
198
|
version: "0.8"
|
|
131
199
|
}
|
|
132
|
-
}), d =
|
|
133
|
-
transport:
|
|
200
|
+
}), d = Nt({
|
|
201
|
+
transport: k(i ?? n),
|
|
134
202
|
entryPoint: {
|
|
135
|
-
address:
|
|
203
|
+
address: B,
|
|
136
204
|
version: "0.8"
|
|
137
205
|
}
|
|
138
|
-
}), f =
|
|
206
|
+
}), f = jt({
|
|
139
207
|
account: u,
|
|
140
|
-
chain:
|
|
141
|
-
bundlerTransport:
|
|
208
|
+
chain: a,
|
|
209
|
+
bundlerTransport: k(n),
|
|
142
210
|
paymaster: d,
|
|
143
211
|
userOperation: { estimateFeesPerGas: async () => (await d.getUserOperationGasPrice()).fast }
|
|
144
212
|
});
|
|
145
|
-
return
|
|
213
|
+
return r({
|
|
146
214
|
address: u.address ?? s,
|
|
147
215
|
sendTransaction: async (e) => {
|
|
216
|
+
let t;
|
|
148
217
|
try {
|
|
149
|
-
|
|
218
|
+
let n = await f.sendUserOperation({ calls: [{
|
|
150
219
|
to: e.to,
|
|
151
220
|
data: e.data,
|
|
152
|
-
value: e.value ?? 0n
|
|
153
|
-
|
|
154
|
-
})
|
|
221
|
+
value: e.value ?? 0n
|
|
222
|
+
}] });
|
|
223
|
+
t = await f.waitForUserOperationReceipt({ hash: n });
|
|
155
224
|
} catch (e) {
|
|
156
225
|
let t = e instanceof Error ? e.message : String(e);
|
|
157
226
|
throw Error(`@seedprotocol/publish: permissionless/EIP-7702 send failed (${t}). Ensure bundlerUrl/paymasterUrl support EntryPoint v0.8, or use accountMode: 'eoa' / Thirdweb adapter.`, { cause: e });
|
|
158
227
|
}
|
|
228
|
+
return { transactionHash: Zt(t, u.address) };
|
|
159
229
|
}
|
|
160
230
|
});
|
|
161
231
|
}
|
|
232
|
+
function Zt(e, t) {
|
|
233
|
+
let n = e.receipt.transactionHash;
|
|
234
|
+
if (e.success) return n;
|
|
235
|
+
let r = e.reason;
|
|
236
|
+
throw r && !/^0x[0-9a-f]*$/i.test(r) ? new Se(`The publish UserOp in transaction ${n} failed: ${r}`, "USEROP_REVERTED", t) : ke({
|
|
237
|
+
txHash: n,
|
|
238
|
+
revertData: r,
|
|
239
|
+
sender: t
|
|
240
|
+
});
|
|
241
|
+
}
|
|
162
242
|
//#endregion
|
|
163
243
|
//#region src/react/useSeedWallet.ts
|
|
164
|
-
function
|
|
165
|
-
let [e,
|
|
166
|
-
|
|
167
|
-
|
|
244
|
+
function Qt() {
|
|
245
|
+
let [e, n] = L(() => S()), [r, i] = L(() => S() ? "connected" : "disconnected");
|
|
246
|
+
F(() => {
|
|
247
|
+
n(S());
|
|
168
248
|
}, []);
|
|
169
|
-
let
|
|
170
|
-
|
|
249
|
+
let a = P(async (e) => {
|
|
250
|
+
i("connecting");
|
|
171
251
|
try {
|
|
172
|
-
let
|
|
173
|
-
|
|
174
|
-
let
|
|
175
|
-
|
|
176
|
-
signer:
|
|
177
|
-
bundlerUrl:
|
|
178
|
-
paymasterUrl:
|
|
252
|
+
let r;
|
|
253
|
+
r = g(e) ? e : await Kt(e);
|
|
254
|
+
let a = C(), o = r.txSender;
|
|
255
|
+
a.accountMode === "eip7702" && a.bundlerUrl && (o = await Xt({
|
|
256
|
+
signer: r.signer,
|
|
257
|
+
bundlerUrl: a.bundlerUrl,
|
|
258
|
+
paymasterUrl: a.paymasterUrl
|
|
179
259
|
}));
|
|
180
|
-
let
|
|
181
|
-
signer:
|
|
182
|
-
txSender:
|
|
183
|
-
ownedAddresses: [
|
|
184
|
-
publisherAddress:
|
|
260
|
+
let s = {
|
|
261
|
+
signer: r.signer,
|
|
262
|
+
txSender: o,
|
|
263
|
+
ownedAddresses: [r.signer.address, o.address],
|
|
264
|
+
publisherAddress: r.signer.address
|
|
185
265
|
};
|
|
186
|
-
return await
|
|
266
|
+
return await t(s), n(s), i("connected"), s;
|
|
187
267
|
} catch (e) {
|
|
188
|
-
throw
|
|
268
|
+
throw i("disconnected"), e;
|
|
189
269
|
}
|
|
190
|
-
}, []),
|
|
191
|
-
|
|
270
|
+
}, []), o = P(() => {
|
|
271
|
+
d(), n(null), i("disconnected");
|
|
192
272
|
}, []);
|
|
193
273
|
return {
|
|
194
274
|
address: e?.signer.address,
|
|
195
275
|
signer: e?.signer,
|
|
196
276
|
txSender: e?.txSender,
|
|
197
|
-
status:
|
|
198
|
-
connect:
|
|
199
|
-
disconnect:
|
|
277
|
+
status: r,
|
|
278
|
+
connect: a,
|
|
279
|
+
disconnect: o
|
|
200
280
|
};
|
|
201
281
|
}
|
|
202
282
|
//#endregion
|
|
203
283
|
//#region src/services/publishCost/gasHeuristics.ts
|
|
204
|
-
var
|
|
284
|
+
var W = {
|
|
205
285
|
BASE: 80000n,
|
|
206
286
|
NEW_SEED: 120000n,
|
|
207
287
|
NEW_VERSION: 80000n,
|
|
208
288
|
ATTESTATION: 55000n
|
|
209
289
|
};
|
|
210
|
-
function
|
|
211
|
-
return
|
|
290
|
+
function $t(e) {
|
|
291
|
+
return W.BASE + W.NEW_SEED * BigInt(e.newSeedCount) + W.NEW_VERSION * BigInt(e.newVersionCount) + W.ATTESTATION * BigInt(e.attestationCount);
|
|
212
292
|
}
|
|
213
293
|
//#endregion
|
|
214
294
|
//#region src/services/publishCost/tokenPrices.ts
|
|
215
|
-
var
|
|
216
|
-
function
|
|
295
|
+
var en = 6e4, G = null, K = null;
|
|
296
|
+
function tn() {
|
|
217
297
|
try {
|
|
218
|
-
return
|
|
298
|
+
return C().getTokenPrices;
|
|
219
299
|
} catch {
|
|
220
300
|
return;
|
|
221
301
|
}
|
|
222
302
|
}
|
|
223
|
-
async function
|
|
303
|
+
async function nn(e) {
|
|
224
304
|
let t = await fetch(`https://api.coinbase.com/v2/prices/${e}-USD/spot`);
|
|
225
305
|
if (!t.ok) throw Error(`Coinbase ${e}-USD spot failed: ${t.status}`);
|
|
226
306
|
let n = await t.json(), r = Number(n.data?.amount);
|
|
227
307
|
if (!Number.isFinite(r) || r <= 0) throw Error(`Invalid ${e} USD price`);
|
|
228
308
|
return r;
|
|
229
309
|
}
|
|
230
|
-
async function
|
|
231
|
-
let [e, t] = await Promise.all([
|
|
310
|
+
async function rn() {
|
|
311
|
+
let [e, t] = await Promise.all([nn("ETH"), nn("AR")]);
|
|
232
312
|
return {
|
|
233
313
|
ethUsd: e,
|
|
234
314
|
arUsd: t
|
|
235
315
|
};
|
|
236
316
|
}
|
|
237
|
-
async function
|
|
317
|
+
async function an(e) {
|
|
238
318
|
let t = Date.now();
|
|
239
|
-
return !e?.forceRefresh &&
|
|
319
|
+
return !e?.forceRefresh && G && t - G.fetchedAt < en ? G : (K && !e?.forceRefresh || (K = (async () => {
|
|
240
320
|
try {
|
|
241
|
-
let e =
|
|
321
|
+
let e = tn(), t = e ? await e() : await rn(), n = {
|
|
242
322
|
ethUsd: t.ethUsd,
|
|
243
323
|
arUsd: t.arUsd,
|
|
244
324
|
fetchedAt: Date.now()
|
|
245
325
|
};
|
|
246
|
-
return
|
|
326
|
+
return G = n, n;
|
|
247
327
|
} catch (e) {
|
|
248
|
-
if (
|
|
328
|
+
if (G) return G;
|
|
249
329
|
throw e;
|
|
250
330
|
} finally {
|
|
251
|
-
|
|
331
|
+
K = null;
|
|
252
332
|
}
|
|
253
|
-
})()),
|
|
333
|
+
})()), K);
|
|
254
334
|
}
|
|
255
|
-
function
|
|
256
|
-
|
|
335
|
+
function on() {
|
|
336
|
+
G = null, K = null;
|
|
257
337
|
}
|
|
258
338
|
//#endregion
|
|
259
339
|
//#region src/services/publishCost/marketRates.ts
|
|
260
|
-
var
|
|
261
|
-
async function
|
|
262
|
-
return
|
|
340
|
+
var sn = 6e4, cn = 1e6, q = null, J = null;
|
|
341
|
+
async function ln() {
|
|
342
|
+
return b().getGasPrice();
|
|
263
343
|
}
|
|
264
|
-
async function
|
|
265
|
-
let e = BigInt(await
|
|
266
|
-
return Number(e) /
|
|
344
|
+
async function un() {
|
|
345
|
+
let e = BigInt(await Me().transactions.getPrice(cn));
|
|
346
|
+
return Number(e) / cn;
|
|
267
347
|
}
|
|
268
|
-
async function
|
|
348
|
+
async function dn(e) {
|
|
269
349
|
let t = Date.now();
|
|
270
|
-
return !e?.forceRefresh &&
|
|
350
|
+
return !e?.forceRefresh && q && t - q.fetchedAt < sn ? q : (J && !e?.forceRefresh || (J = (async () => {
|
|
271
351
|
try {
|
|
272
352
|
let [t, n, r] = await Promise.all([
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
353
|
+
an({ forceRefresh: e?.forceRefresh }),
|
|
354
|
+
ln(),
|
|
355
|
+
un()
|
|
276
356
|
]), i = {
|
|
277
357
|
...t,
|
|
278
358
|
gasPriceWei: n,
|
|
279
359
|
winstonPerByte: r,
|
|
280
360
|
fetchedAt: Date.now()
|
|
281
361
|
};
|
|
282
|
-
return
|
|
362
|
+
return q = i, i;
|
|
283
363
|
} catch (e) {
|
|
284
|
-
if (
|
|
364
|
+
if (q) return q;
|
|
285
365
|
throw e;
|
|
286
366
|
} finally {
|
|
287
|
-
|
|
367
|
+
J = null;
|
|
288
368
|
}
|
|
289
|
-
})()),
|
|
369
|
+
})()), J);
|
|
290
370
|
}
|
|
291
|
-
function
|
|
292
|
-
|
|
371
|
+
function fn() {
|
|
372
|
+
q = null, J = null, on();
|
|
293
373
|
}
|
|
294
374
|
//#endregion
|
|
295
375
|
//#region src/services/publishCost/estimatePublishCost.ts
|
|
296
|
-
var
|
|
297
|
-
function
|
|
376
|
+
var pn = 0xe8d4a51000, mn = 0xde0b6b3a7640000;
|
|
377
|
+
function hn() {
|
|
298
378
|
try {
|
|
299
|
-
let e =
|
|
379
|
+
let e = C();
|
|
300
380
|
return {
|
|
301
381
|
evmUserPays: !e.paymasterUrl,
|
|
302
382
|
arweavePath: e.useArweaveBundler ? "bundler" : "l1"
|
|
@@ -308,22 +388,22 @@ function en() {
|
|
|
308
388
|
};
|
|
309
389
|
}
|
|
310
390
|
}
|
|
311
|
-
function
|
|
391
|
+
function gn(e) {
|
|
312
392
|
return Math.round(e * 100) / 100;
|
|
313
393
|
}
|
|
314
|
-
function
|
|
315
|
-
let r = n?.evmUserPays ?? !0, i = n?.arweavePath ?? "l1", a =
|
|
394
|
+
function _n(e, t, n) {
|
|
395
|
+
let r = n?.evmUserPays ?? !0, i = n?.arweavePath ?? "l1", a = $t(e), o = a * t.gasPriceWei, s = Number(o) / mn, c = s * t.ethUsd, l = Math.max(0, Math.round(e.uploadBytes * t.winstonPerByte)) / pn, u = l * t.arUsd;
|
|
316
396
|
return {
|
|
317
|
-
totalUsd:
|
|
397
|
+
totalUsd: gn(c + u),
|
|
318
398
|
evm: {
|
|
319
399
|
eth: s.toPrecision(6),
|
|
320
|
-
usd:
|
|
400
|
+
usd: gn(c),
|
|
321
401
|
gas: a,
|
|
322
402
|
userPays: r
|
|
323
403
|
},
|
|
324
404
|
arweave: {
|
|
325
405
|
ar: l.toPrecision(6),
|
|
326
|
-
usd:
|
|
406
|
+
usd: gn(u),
|
|
327
407
|
bytes: e.uploadBytes,
|
|
328
408
|
uploadCount: e.uploadCount,
|
|
329
409
|
path: i,
|
|
@@ -338,42 +418,42 @@ function nn(e, t, n) {
|
|
|
338
418
|
estimatedAt: Date.now()
|
|
339
419
|
};
|
|
340
420
|
}
|
|
341
|
-
async function
|
|
342
|
-
let n =
|
|
421
|
+
async function vn(e, t) {
|
|
422
|
+
let n = hn(), r = t?.work;
|
|
343
423
|
if (!r) {
|
|
344
424
|
let { summarizePublishWork: n } = await import("@seedprotocol/sdk");
|
|
345
425
|
r = await n(e, { publishMode: t?.publishMode });
|
|
346
426
|
}
|
|
347
|
-
let i = t?.rates ?? await
|
|
348
|
-
return
|
|
427
|
+
let i = t?.rates ?? await dn();
|
|
428
|
+
return _n(r, i, n);
|
|
349
429
|
}
|
|
350
430
|
//#endregion
|
|
351
431
|
//#region src/services/publishCost/watchPublishCost.ts
|
|
352
|
-
var
|
|
353
|
-
function
|
|
432
|
+
var yn = 6e4, bn = 15e3;
|
|
433
|
+
function xn(e) {
|
|
354
434
|
let t = e.getService().getSnapshot(), n = (t && typeof t == "object" && "context" in t ? t.context : void 0)?.propertyValue ?? e.value;
|
|
355
435
|
return `${e.propertyName}:${e.uid ?? ""}:${String(n ?? "")}`;
|
|
356
436
|
}
|
|
357
|
-
function
|
|
437
|
+
function Sn(e) {
|
|
358
438
|
let t = e.properties ?? [];
|
|
359
439
|
return [
|
|
360
440
|
e.seedLocalId,
|
|
361
441
|
e.seedUid ?? "",
|
|
362
442
|
e.latestVersionLocalId ?? "",
|
|
363
|
-
...t.map(
|
|
443
|
+
...t.map(xn)
|
|
364
444
|
].join("|");
|
|
365
445
|
}
|
|
366
|
-
function
|
|
446
|
+
function Cn(e) {
|
|
367
447
|
return e instanceof Error ? e : Error(String(e));
|
|
368
448
|
}
|
|
369
|
-
function
|
|
370
|
-
let r = n?.priceRefreshMs ??
|
|
371
|
-
let t = await
|
|
372
|
-
return
|
|
449
|
+
function wn(e, t, n) {
|
|
450
|
+
let r = n?.priceRefreshMs ?? yn, i = n?.itemIdleMs ?? bn, a = n?.estimate ?? ((e) => vn(e, n)), o = n?.reprice ?? (async (e) => {
|
|
451
|
+
let t = await dn({ forceRefresh: !0 });
|
|
452
|
+
return _n(e.work, t, {
|
|
373
453
|
evmUserPays: e.evm.userPays,
|
|
374
454
|
arweavePath: e.arweave.path
|
|
375
455
|
});
|
|
376
|
-
}), s = !1, c =
|
|
456
|
+
}), s = !1, c = Sn(e), l = null, u = !1, d = !1, f = null, p = 0, m = null, h = null, g = () => {
|
|
377
457
|
s || t({
|
|
378
458
|
estimate: l,
|
|
379
459
|
isEstimating: u,
|
|
@@ -387,10 +467,10 @@ function un(e, t, n) {
|
|
|
387
467
|
try {
|
|
388
468
|
let n = await a(e);
|
|
389
469
|
if (s || t !== p) return;
|
|
390
|
-
l = n, c =
|
|
470
|
+
l = n, c = Sn(e), d = !1, u = !1, f = null, g();
|
|
391
471
|
} catch (e) {
|
|
392
472
|
if (s || t !== p) return;
|
|
393
|
-
u = !1, f =
|
|
473
|
+
u = !1, f = Cn(e), g();
|
|
394
474
|
}
|
|
395
475
|
}, v = () => {
|
|
396
476
|
if (l && (d = !0), i <= 0) {
|
|
@@ -404,9 +484,9 @@ function un(e, t, n) {
|
|
|
404
484
|
m &&= (clearTimeout(m), null), _();
|
|
405
485
|
};
|
|
406
486
|
_();
|
|
407
|
-
let
|
|
487
|
+
let b = e.subscribe(() => {
|
|
408
488
|
if (s) return;
|
|
409
|
-
let t =
|
|
489
|
+
let t = Sn(e);
|
|
410
490
|
t !== c && (c = t, v());
|
|
411
491
|
});
|
|
412
492
|
return r > 0 && (h = setInterval(() => {
|
|
@@ -417,44 +497,44 @@ function un(e, t, n) {
|
|
|
417
497
|
l = e, g();
|
|
418
498
|
} catch (e) {
|
|
419
499
|
if (s) return;
|
|
420
|
-
f =
|
|
500
|
+
f = Cn(e), g();
|
|
421
501
|
}
|
|
422
502
|
})();
|
|
423
503
|
}, r)), {
|
|
424
504
|
refresh: y,
|
|
425
505
|
dispose: () => {
|
|
426
|
-
s = !0,
|
|
506
|
+
s = !0, b.unsubscribe(), m && clearTimeout(m), h && clearInterval(h);
|
|
427
507
|
}
|
|
428
508
|
};
|
|
429
509
|
}
|
|
430
510
|
//#endregion
|
|
431
511
|
//#region src/helpers/publishDisplayHelpers.ts
|
|
432
|
-
function
|
|
512
|
+
function Tn(e) {
|
|
433
513
|
return e === "creatingAttestationsDirectToEas" ? "creatingAttestations" : e;
|
|
434
514
|
}
|
|
435
|
-
function
|
|
515
|
+
function En(e, t, n) {
|
|
436
516
|
if (e != null) return n;
|
|
437
|
-
if (t?.status === "completed") return
|
|
438
|
-
if (t?.status === "failed") return
|
|
517
|
+
if (t?.status === "completed") return w.SUCCESS;
|
|
518
|
+
if (t?.status === "failed") return w.FAILURE;
|
|
439
519
|
if (t?.status !== "interrupted") return n;
|
|
440
520
|
}
|
|
441
|
-
function
|
|
521
|
+
function Dn(e) {
|
|
442
522
|
if (e) {
|
|
443
|
-
if (e.status === "failed") return
|
|
444
|
-
if (e.status === "completed") return
|
|
523
|
+
if (e.status === "failed") return w.FAILURE;
|
|
524
|
+
if (e.status === "completed") return w.SUCCESS;
|
|
445
525
|
if (e.status !== "interrupted") {
|
|
446
526
|
if (e.completedAt != null) {
|
|
447
527
|
try {
|
|
448
528
|
let t = JSON.parse(e.persistedSnapshot);
|
|
449
|
-
if (t.status === "done" && t.value ===
|
|
529
|
+
if (t.status === "done" && t.value === w.FAILURE) return w.FAILURE;
|
|
450
530
|
} catch {}
|
|
451
|
-
return
|
|
531
|
+
return w.SUCCESS;
|
|
452
532
|
}
|
|
453
533
|
try {
|
|
454
534
|
let t = JSON.parse(e.persistedSnapshot);
|
|
455
535
|
if (t.status === "done") {
|
|
456
|
-
if (t.value ===
|
|
457
|
-
if (t.value ===
|
|
536
|
+
if (t.value === w.SUCCESS) return w.SUCCESS;
|
|
537
|
+
if (t.value === w.FAILURE) return w.FAILURE;
|
|
458
538
|
}
|
|
459
539
|
if (typeof t.value == "string") return t.value;
|
|
460
540
|
} catch {
|
|
@@ -465,19 +545,19 @@ function pn(e) {
|
|
|
465
545
|
}
|
|
466
546
|
//#endregion
|
|
467
547
|
//#region src/hooks/usePublishProcess.ts
|
|
468
|
-
function
|
|
469
|
-
return !e || e.status !== "done" ? !1 : e.value ===
|
|
548
|
+
function On(e) {
|
|
549
|
+
return !e || e.status !== "done" ? !1 : e.value === w.SUCCESS || e.value === w.FAILURE;
|
|
470
550
|
}
|
|
471
|
-
function
|
|
472
|
-
let t =
|
|
473
|
-
|
|
551
|
+
function kn(e) {
|
|
552
|
+
let t = T.getService(), n = Bt(t, (t) => t?.context?.publishProcesses?.get(e) ?? null), r = Dt(null);
|
|
553
|
+
F(() => {
|
|
474
554
|
r.current = null;
|
|
475
555
|
}, [e]);
|
|
476
|
-
let [i, a] =
|
|
556
|
+
let [i, a] = L(void 0), [o, s] = L(null), c = E.getAppDb(), l = I(() => e && c ? c.select().from(O).where(U(O.seedLocalId, e)).orderBy(H(O.startedAt)).limit(1) : null, [c, e]), u = z(l)?.[0], d = u?.status, f = I(() => {
|
|
477
557
|
if (n != null) return i;
|
|
478
558
|
if (o === "success" || o === "failure") return o;
|
|
479
|
-
let e =
|
|
480
|
-
return e ===
|
|
559
|
+
let e = Dn(u);
|
|
560
|
+
return e === w.SUCCESS || e === w.FAILURE ? e : En(n, d == null ? void 0 : { status: d }, i);
|
|
481
561
|
}, [
|
|
482
562
|
n,
|
|
483
563
|
d,
|
|
@@ -485,16 +565,16 @@ function hn(e) {
|
|
|
485
565
|
o,
|
|
486
566
|
u
|
|
487
567
|
]);
|
|
488
|
-
return
|
|
568
|
+
return F(() => {
|
|
489
569
|
s(null);
|
|
490
|
-
}, [e]),
|
|
570
|
+
}, [e]), F(() => {
|
|
491
571
|
n ?? (d === "completed" ? s("success") : d === "failed" && s("failure"));
|
|
492
|
-
}, [d, n]),
|
|
572
|
+
}, [d, n]), F(() => {
|
|
493
573
|
n != null && s(null);
|
|
494
|
-
}, [n]),
|
|
574
|
+
}, [n]), F(() => {
|
|
495
575
|
if (!n) {
|
|
496
576
|
let e = r.current;
|
|
497
|
-
|
|
577
|
+
On(e) ? (a(e.value), e.value === w.SUCCESS ? s("success") : e.value === w.FAILURE && s("failure")) : a(void 0);
|
|
498
578
|
return;
|
|
499
579
|
}
|
|
500
580
|
let e = n.getSnapshot();
|
|
@@ -518,21 +598,21 @@ function hn(e) {
|
|
|
518
598
|
}
|
|
519
599
|
//#endregion
|
|
520
600
|
//#region src/hooks/useCanPublishItem.ts
|
|
521
|
-
function
|
|
522
|
-
let [t, n] =
|
|
523
|
-
return
|
|
601
|
+
function An(e) {
|
|
602
|
+
let [t, n] = L(!0);
|
|
603
|
+
return F(() => {
|
|
524
604
|
if (!e) {
|
|
525
605
|
n(!1);
|
|
526
606
|
return;
|
|
527
607
|
}
|
|
528
|
-
|
|
608
|
+
Ze(e).then(n).catch(() => n(!1));
|
|
529
609
|
}, [e?.seedLocalId]), t;
|
|
530
610
|
}
|
|
531
611
|
//#endregion
|
|
532
612
|
//#region src/hooks/useArweaveL1Finalize.ts
|
|
533
|
-
function
|
|
534
|
-
let t =
|
|
535
|
-
return
|
|
613
|
+
function jn(e) {
|
|
614
|
+
let t = E.getAppDb(), n = I(() => e && t ? t.select().from(D).where(U(D.seedLocalId, e)).orderBy(H(D.updatedAt)) : null, [t, e]), r = z(n) ?? [];
|
|
615
|
+
return I(() => {
|
|
536
616
|
let e = r.filter((e) => e.phase === "pending_l1").length, t = r.filter((e) => e.phase === "confirmed").length;
|
|
537
617
|
return {
|
|
538
618
|
hasPendingL1: e > 0,
|
|
@@ -544,8 +624,8 @@ function _n(e) {
|
|
|
544
624
|
}
|
|
545
625
|
//#endregion
|
|
546
626
|
//#region src/hooks/useItemPublishStatus.ts
|
|
547
|
-
function
|
|
548
|
-
let { publishProcess: t, value: n } =
|
|
627
|
+
function Mn(e) {
|
|
628
|
+
let { publishProcess: t, value: n } = kn(e ?? ""), r = jn(e), i = E.getAppDb(), a = I(() => e && i ? i.select().from(O).where(U(O.seedLocalId, e)).orderBy(H(O.startedAt)).limit(1) : null, [i, e]), o = z(a)?.[0];
|
|
549
629
|
return {
|
|
550
630
|
latestRecord: o,
|
|
551
631
|
publishProcess: t,
|
|
@@ -558,44 +638,44 @@ function vn(e) {
|
|
|
558
638
|
}
|
|
559
639
|
//#endregion
|
|
560
640
|
//#region src/hooks/usePublishProcesses.ts
|
|
561
|
-
function
|
|
562
|
-
let e =
|
|
563
|
-
return
|
|
641
|
+
function Nn() {
|
|
642
|
+
let e = E.getAppDb();
|
|
643
|
+
return I(() => e ? e.select().from(O).orderBy(H(O.startedAt)) : null, [e]);
|
|
564
644
|
}
|
|
565
|
-
function
|
|
566
|
-
let t =
|
|
567
|
-
return
|
|
645
|
+
function Pn(e) {
|
|
646
|
+
let t = E.getAppDb();
|
|
647
|
+
return I(() => t && e ? t.select().from(O).where(U(O.seedLocalId, e)).orderBy(H(O.startedAt)) : null, [t, e]);
|
|
568
648
|
}
|
|
569
|
-
function
|
|
570
|
-
let e =
|
|
649
|
+
function Fn() {
|
|
650
|
+
let e = Nn(), t = z(e);
|
|
571
651
|
return {
|
|
572
652
|
records: t,
|
|
573
|
-
nonActiveCount:
|
|
653
|
+
nonActiveCount: I(() => t === void 0 ? void 0 : t.filter((e) => e.status !== "in_progress").length, [t])
|
|
574
654
|
};
|
|
575
655
|
}
|
|
576
|
-
function
|
|
577
|
-
let e =
|
|
578
|
-
return
|
|
656
|
+
function In() {
|
|
657
|
+
let e = Nn();
|
|
658
|
+
return z(e);
|
|
579
659
|
}
|
|
580
|
-
function
|
|
581
|
-
return
|
|
660
|
+
function Ln() {
|
|
661
|
+
return Fn().nonActiveCount;
|
|
582
662
|
}
|
|
583
|
-
function
|
|
584
|
-
let t =
|
|
585
|
-
return
|
|
663
|
+
function Rn(e) {
|
|
664
|
+
let t = Pn(e);
|
|
665
|
+
return z(t);
|
|
586
666
|
}
|
|
587
|
-
function
|
|
588
|
-
let t =
|
|
667
|
+
function zn(e) {
|
|
668
|
+
let t = Pn(e), n = z(t);
|
|
589
669
|
return {
|
|
590
670
|
records: n,
|
|
591
|
-
nonActiveCount:
|
|
671
|
+
nonActiveCount: I(() => n === void 0 ? void 0 : n.filter((e) => e.status !== "in_progress").length, [n])
|
|
592
672
|
};
|
|
593
673
|
}
|
|
594
|
-
function
|
|
595
|
-
return
|
|
674
|
+
function Bn(e) {
|
|
675
|
+
return zn(e).nonActiveCount;
|
|
596
676
|
}
|
|
597
|
-
function
|
|
598
|
-
let t =
|
|
677
|
+
function Vn(e) {
|
|
678
|
+
let t = E.getAppDb(), n = I(() => e != null && t ? t.select().from(O).where(U(O.id, e)).limit(1) : null, [t, e]), r = z(n), i = r === void 0;
|
|
599
679
|
return {
|
|
600
680
|
record: r && r.length > 0 ? r[0] : null,
|
|
601
681
|
isLoading: i
|
|
@@ -603,45 +683,45 @@ function Dn(e) {
|
|
|
603
683
|
}
|
|
604
684
|
//#endregion
|
|
605
685
|
//#region src/hooks/clearCompletedPublishProcesses.ts
|
|
606
|
-
async function
|
|
607
|
-
let e =
|
|
608
|
-
e && await e.delete(
|
|
686
|
+
async function Hn() {
|
|
687
|
+
let e = E.getAppDb();
|
|
688
|
+
e && await e.delete(O).where(zt(O.status, ["in_progress"]));
|
|
609
689
|
}
|
|
610
|
-
async function
|
|
611
|
-
let t =
|
|
612
|
-
t && await t.delete(
|
|
690
|
+
async function Un(e) {
|
|
691
|
+
let t = E.getAppDb();
|
|
692
|
+
t && await t.delete(O).where(Lt(U(O.seedLocalId, e), zt(O.status, ["in_progress"])));
|
|
613
693
|
}
|
|
614
|
-
async function
|
|
615
|
-
let e =
|
|
616
|
-
e && await e.delete(
|
|
694
|
+
async function Wn() {
|
|
695
|
+
let e = E.getAppDb();
|
|
696
|
+
e && await e.delete(O);
|
|
617
697
|
}
|
|
618
|
-
async function
|
|
619
|
-
let e =
|
|
620
|
-
e && await e.delete(
|
|
698
|
+
async function Gn() {
|
|
699
|
+
let e = E.getAppDb();
|
|
700
|
+
e && await e.delete(Qe);
|
|
621
701
|
}
|
|
622
|
-
async function
|
|
623
|
-
let t =
|
|
624
|
-
t && await t.delete(
|
|
702
|
+
async function Kn(e) {
|
|
703
|
+
let t = E.getAppDb();
|
|
704
|
+
t && await t.delete(O).where(U(O.seedLocalId, e));
|
|
625
705
|
}
|
|
626
|
-
async function
|
|
627
|
-
let t =
|
|
628
|
-
t && await t.delete(
|
|
706
|
+
async function qn(e) {
|
|
707
|
+
let t = E.getAppDb();
|
|
708
|
+
t && await t.delete(O).where(U(O.id, e));
|
|
629
709
|
}
|
|
630
|
-
async function
|
|
710
|
+
async function Jn(e) {
|
|
631
711
|
if (e.length === 0) return;
|
|
632
|
-
let t =
|
|
633
|
-
t && await t.delete(
|
|
712
|
+
let t = E.getAppDb();
|
|
713
|
+
t && await t.delete(O).where(Rt(O.id, e));
|
|
634
714
|
}
|
|
635
715
|
//#endregion
|
|
636
716
|
//#region src/hooks/publishProcessHelpers.ts
|
|
637
|
-
function
|
|
717
|
+
function Yn(e) {
|
|
638
718
|
try {
|
|
639
719
|
return (JSON.parse(e.persistedSnapshot).context?.arweaveTransactions ?? []).map((e) => e.transaction?.id).filter((e) => typeof e == "string");
|
|
640
720
|
} catch {
|
|
641
721
|
return [];
|
|
642
722
|
}
|
|
643
723
|
}
|
|
644
|
-
function
|
|
724
|
+
function Xn(e) {
|
|
645
725
|
try {
|
|
646
726
|
return JSON.parse(e.persistedSnapshot).context?.easPayload ?? void 0;
|
|
647
727
|
} catch {
|
|
@@ -650,14 +730,14 @@ function In(e) {
|
|
|
650
730
|
}
|
|
651
731
|
//#endregion
|
|
652
732
|
//#region src/hooks/usePublishCostEstimate.ts
|
|
653
|
-
function
|
|
654
|
-
let [n, r] =
|
|
655
|
-
return
|
|
733
|
+
function Zn(e, t) {
|
|
734
|
+
let [n, r] = L(null), [i, a] = L(!1), [o, s] = L(!1), [c, l] = L(null), u = Dt(() => {}), d = t?.publishMode, f = t?.priceRefreshMs, p = t?.itemIdleMs;
|
|
735
|
+
return F(() => {
|
|
656
736
|
if (!e) {
|
|
657
737
|
r(null), a(!1), s(!1), l(null), u.current = () => {};
|
|
658
738
|
return;
|
|
659
739
|
}
|
|
660
|
-
let n =
|
|
740
|
+
let n = wn(e, (e) => {
|
|
661
741
|
r(e.estimate), a(e.isEstimating), s(e.isStale), l(e.error), u.current = e.refresh;
|
|
662
742
|
}, t);
|
|
663
743
|
return () => {
|
|
@@ -674,14 +754,14 @@ function Ln(e, t) {
|
|
|
674
754
|
isEstimating: i,
|
|
675
755
|
isStale: o,
|
|
676
756
|
error: c,
|
|
677
|
-
refresh:
|
|
757
|
+
refresh: P(() => {
|
|
678
758
|
u.current();
|
|
679
759
|
}, [])
|
|
680
760
|
};
|
|
681
761
|
}
|
|
682
762
|
//#endregion
|
|
683
763
|
//#region src/helpers/transformPayloadToIntegerIds.ts
|
|
684
|
-
function
|
|
764
|
+
function Qn(e) {
|
|
685
765
|
let t = /* @__PURE__ */ new Map();
|
|
686
766
|
for (let n = 0; n < e.length; n++) {
|
|
687
767
|
let r = e[n]?.localId;
|
|
@@ -706,26 +786,26 @@ function Rn(e) {
|
|
|
706
786
|
}
|
|
707
787
|
//#endregion
|
|
708
788
|
//#region src/helpers/ensureWalletThenPublish.ts
|
|
709
|
-
function
|
|
789
|
+
function $n(e) {
|
|
710
790
|
if (e) {
|
|
711
|
-
if (e instanceof
|
|
712
|
-
if (
|
|
713
|
-
if (
|
|
791
|
+
if (e instanceof rt.Wallet) return e;
|
|
792
|
+
if (g(e)) return e.signer;
|
|
793
|
+
if (a(e)) return e;
|
|
714
794
|
}
|
|
715
795
|
}
|
|
716
|
-
async function
|
|
717
|
-
let n =
|
|
796
|
+
async function er(e, t) {
|
|
797
|
+
let n = C();
|
|
718
798
|
if (n.useModularExecutor) {
|
|
719
|
-
let { ensureSmartWalletThenPublish: n } = await import("./ensureSmartWalletThenPublish-
|
|
799
|
+
let { ensureSmartWalletThenPublish: n } = await import("./ensureSmartWalletThenPublish-DAomriGc.js").then((e) => e.n);
|
|
720
800
|
return n(e, null, async () => {
|
|
721
|
-
let e =
|
|
801
|
+
let e = S();
|
|
722
802
|
return e?.publisherAddress ?? e?.signer.address ?? null;
|
|
723
803
|
}, t);
|
|
724
804
|
}
|
|
725
|
-
let r =
|
|
805
|
+
let r = S();
|
|
726
806
|
if (!r) return { outcome: "no_wallet" };
|
|
727
807
|
if (n.accountMode === "eip7702" && n.bundlerUrl) {
|
|
728
|
-
let e = await
|
|
808
|
+
let e = await Xt({
|
|
729
809
|
signer: r.signer,
|
|
730
810
|
bundlerUrl: n.bundlerUrl,
|
|
731
811
|
paymasterUrl: n.paymasterUrl
|
|
@@ -737,20 +817,20 @@ async function Bn(e, t) {
|
|
|
737
817
|
};
|
|
738
818
|
}
|
|
739
819
|
let i = r.publisherAddress ?? r.txSender.address ?? r.signer.address;
|
|
740
|
-
return i?.trim() ? (
|
|
820
|
+
return i?.trim() ? (T.createPublish(e, i, r, {
|
|
741
821
|
...t,
|
|
742
|
-
dataItemSigner:
|
|
822
|
+
dataItemSigner: $n(t?.dataItemSigner) ?? r.signer
|
|
743
823
|
}), { outcome: "started" }) : { outcome: "no_address" };
|
|
744
824
|
}
|
|
745
825
|
//#endregion
|
|
746
826
|
//#region src/services/domainOwnership/registry.ts
|
|
747
|
-
function
|
|
748
|
-
let t =
|
|
827
|
+
function Y(e) {
|
|
828
|
+
let t = Ht(e);
|
|
749
829
|
if (!t) throw Error(`@seedprotocol/publish: unable to resolve registrable domain for "${e}"`);
|
|
750
830
|
return t.toLowerCase();
|
|
751
831
|
}
|
|
752
|
-
async function
|
|
753
|
-
let t =
|
|
832
|
+
async function tr(e) {
|
|
833
|
+
let t = Y(e), n = await Vt(t);
|
|
754
834
|
if (!n.ok || !n.record) return null;
|
|
755
835
|
let r = n.record;
|
|
756
836
|
return {
|
|
@@ -764,8 +844,8 @@ async function J(e) {
|
|
|
764
844
|
isRegistered: r.isRegistered
|
|
765
845
|
};
|
|
766
846
|
}
|
|
767
|
-
function
|
|
768
|
-
return
|
|
847
|
+
function nr(e) {
|
|
848
|
+
return Ct({
|
|
769
849
|
domain: e.domain,
|
|
770
850
|
creationDate: e.creationDate ?? "",
|
|
771
851
|
registrarIanaId: e.registrarIanaId ?? ""
|
|
@@ -773,36 +853,36 @@ function Vn(e) {
|
|
|
773
853
|
}
|
|
774
854
|
//#endregion
|
|
775
855
|
//#region src/services/domainOwnership/challenge.ts
|
|
776
|
-
function
|
|
856
|
+
function rr(e) {
|
|
777
857
|
let t = new Uint8Array(e);
|
|
778
858
|
return crypto.getRandomValues(t), t;
|
|
779
859
|
}
|
|
780
|
-
function
|
|
860
|
+
function ir(e) {
|
|
781
861
|
let t = "";
|
|
782
862
|
for (let n of e) t += String.fromCharCode(n);
|
|
783
863
|
return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
784
864
|
}
|
|
785
|
-
function
|
|
786
|
-
let t = e.normalizeRegistrable === !1 ? e.domain.trim().toLowerCase().replace(/\.$/, "") :
|
|
865
|
+
function ar(e) {
|
|
866
|
+
let t = e.normalizeRegistrable === !1 ? e.domain.trim().toLowerCase().replace(/\.$/, "") : Y(e.domain);
|
|
787
867
|
if (!t || t.includes(" ")) throw Error("@seedprotocol/publish: createDomainOwnershipChallenge requires a valid domain");
|
|
788
868
|
let n = e.claimer.trim();
|
|
789
869
|
if (!/^0x[0-9a-fA-F]{40}$/.test(n)) throw Error("@seedprotocol/publish: createDomainOwnershipChallenge requires a 20-byte hex claimer address");
|
|
790
|
-
let r = e.scope ??
|
|
870
|
+
let r = e.scope ?? dt, i = e.ttlMs ?? it, a = e.now ?? Date.now(), o = new Date(a + i).toISOString(), s = ir(rr(32)), c = St({
|
|
791
871
|
domain: t,
|
|
792
872
|
claimer: n,
|
|
793
873
|
token: s,
|
|
794
874
|
scope: r
|
|
795
|
-
}), l =
|
|
875
|
+
}), l = yt(t), u = _t({
|
|
796
876
|
token: s,
|
|
797
877
|
claimer: n,
|
|
798
878
|
expiry: o
|
|
799
879
|
});
|
|
800
880
|
return {
|
|
801
|
-
challengeId:
|
|
881
|
+
challengeId: ir(rr(16)),
|
|
802
882
|
domain: t,
|
|
803
883
|
claimer: n,
|
|
804
884
|
scope: r,
|
|
805
|
-
method:
|
|
885
|
+
method: st,
|
|
806
886
|
token: s,
|
|
807
887
|
txtName: l,
|
|
808
888
|
txtValue: u,
|
|
@@ -813,14 +893,14 @@ function Wn(e) {
|
|
|
813
893
|
}
|
|
814
894
|
//#endregion
|
|
815
895
|
//#region src/services/domainOwnership/dnsVerify.ts
|
|
816
|
-
async function
|
|
896
|
+
async function or(e) {
|
|
817
897
|
let { promises: t } = await import("node:dns");
|
|
818
898
|
return {
|
|
819
899
|
source: "node:dns",
|
|
820
900
|
values: (await t.resolveTxt(e)).map((e) => e.join(""))
|
|
821
901
|
};
|
|
822
902
|
}
|
|
823
|
-
async function
|
|
903
|
+
async function sr(e, t, n) {
|
|
824
904
|
let r = `${n}?name=${encodeURIComponent(e)}&type=TXT`, i = await fetch(r, { headers: { accept: "application/dns-json" } });
|
|
825
905
|
if (!i.ok) throw Error(`DoH ${t} HTTP ${i.status}`);
|
|
826
906
|
let a = await i.json();
|
|
@@ -830,20 +910,20 @@ async function Kn(e, t, n) {
|
|
|
830
910
|
dnssecAuthenticated: !!a.AD
|
|
831
911
|
};
|
|
832
912
|
}
|
|
833
|
-
function
|
|
834
|
-
let e = [(e) =>
|
|
835
|
-
return typeof document > "u" && e.unshift((e) =>
|
|
913
|
+
function cr() {
|
|
914
|
+
let e = [(e) => sr(e, "cloudflare-doh", "https://cloudflare-dns.com/dns-query"), (e) => sr(e, "google-doh", "https://dns.google/resolve")];
|
|
915
|
+
return typeof document > "u" && e.unshift((e) => or(e)), e;
|
|
836
916
|
}
|
|
837
|
-
function
|
|
838
|
-
let n =
|
|
917
|
+
function lr(e, t) {
|
|
918
|
+
let n = Et(t);
|
|
839
919
|
for (let r of e) {
|
|
840
920
|
if (r === t || r.replace(/^"|"$/g, "") === t) return !0;
|
|
841
|
-
let e =
|
|
921
|
+
let e = Et(r);
|
|
842
922
|
if (n && e && e.token === n.token && e.claimer === n.claimer) return !0;
|
|
843
923
|
}
|
|
844
924
|
return !1;
|
|
845
925
|
}
|
|
846
|
-
async function
|
|
926
|
+
async function ur(e, t) {
|
|
847
927
|
let n = t?.now ?? Date.now();
|
|
848
928
|
if (Date.parse(e.expiresAt) <= n) return {
|
|
849
929
|
ok: !1,
|
|
@@ -851,7 +931,7 @@ async function Yn(e, t) {
|
|
|
851
931
|
lookups: [],
|
|
852
932
|
error: "Challenge expired"
|
|
853
933
|
};
|
|
854
|
-
let r =
|
|
934
|
+
let r = _t({
|
|
855
935
|
token: e.token,
|
|
856
936
|
claimer: e.claimer,
|
|
857
937
|
expiry: e.expiresAt
|
|
@@ -862,11 +942,11 @@ async function Yn(e, t) {
|
|
|
862
942
|
lookups: [],
|
|
863
943
|
error: "Challenge txtValue does not match token/claimer/expiry"
|
|
864
944
|
};
|
|
865
|
-
let i = t?.lookups ??
|
|
945
|
+
let i = t?.lookups ?? cr(), a = t?.quorum ?? 2, o = [], s = [], c = !1;
|
|
866
946
|
await Promise.all(i.map(async (t) => {
|
|
867
947
|
try {
|
|
868
948
|
let n = await t(e.txtName);
|
|
869
|
-
o.push(n),
|
|
949
|
+
o.push(n), lr(n.values, r) && (s.push(n.source), n.dnssecAuthenticated && (c = !0));
|
|
870
950
|
} catch {
|
|
871
951
|
o.push({
|
|
872
952
|
source: "error",
|
|
@@ -884,32 +964,32 @@ async function Yn(e, t) {
|
|
|
884
964
|
}
|
|
885
965
|
//#endregion
|
|
886
966
|
//#region src/services/domainOwnership/index.ts
|
|
887
|
-
var
|
|
888
|
-
function
|
|
889
|
-
if (
|
|
890
|
-
if (
|
|
967
|
+
var dr = "0x0000000000000000000000000000000000000000", fr = !0;
|
|
968
|
+
function pr(e) {
|
|
969
|
+
if (g(e)) return e.txSender;
|
|
970
|
+
if (i(e)) return e;
|
|
891
971
|
throw Error("@seedprotocol/publish: domain ownership write APIs require a PublishWallet or SeedTxSender");
|
|
892
972
|
}
|
|
893
|
-
async function
|
|
894
|
-
let
|
|
895
|
-
return n
|
|
973
|
+
async function X(e, t) {
|
|
974
|
+
let n = await e.sendTransaction(t);
|
|
975
|
+
return x(n.transactionHash);
|
|
896
976
|
}
|
|
897
|
-
function
|
|
898
|
-
return
|
|
977
|
+
function Z() {
|
|
978
|
+
return It.getSchemaUID(A, dr, fr);
|
|
899
979
|
}
|
|
900
|
-
async function
|
|
901
|
-
let t =
|
|
902
|
-
return await
|
|
903
|
-
schema:
|
|
904
|
-
resolverAddress:
|
|
905
|
-
revocable:
|
|
906
|
-
})), await
|
|
980
|
+
async function mr(e) {
|
|
981
|
+
let t = pr(e), n = Z();
|
|
982
|
+
return await je(n) || (await X(t, Ae({
|
|
983
|
+
schema: A,
|
|
984
|
+
resolverAddress: dr,
|
|
985
|
+
revocable: fr
|
|
986
|
+
})), await X(t, De({
|
|
907
987
|
schemaUid: n,
|
|
908
|
-
schemaName:
|
|
988
|
+
schemaName: ut
|
|
909
989
|
}))), n;
|
|
910
990
|
}
|
|
911
|
-
function
|
|
912
|
-
return new
|
|
991
|
+
function hr(e) {
|
|
992
|
+
return new Ft(A).encodeData([
|
|
913
993
|
{
|
|
914
994
|
name: "domain",
|
|
915
995
|
value: e.domain,
|
|
@@ -927,7 +1007,7 @@ function er(e) {
|
|
|
927
1007
|
},
|
|
928
1008
|
{
|
|
929
1009
|
name: "challengeHash",
|
|
930
|
-
value:
|
|
1010
|
+
value: N(e.challengeHash),
|
|
931
1011
|
type: "bytes32"
|
|
932
1012
|
},
|
|
933
1013
|
{
|
|
@@ -947,7 +1027,7 @@ function er(e) {
|
|
|
947
1027
|
},
|
|
948
1028
|
{
|
|
949
1029
|
name: "registryFingerprint",
|
|
950
|
-
value:
|
|
1030
|
+
value: N(e.registryFingerprint),
|
|
951
1031
|
type: "bytes32"
|
|
952
1032
|
},
|
|
953
1033
|
{
|
|
@@ -957,76 +1037,76 @@ function er(e) {
|
|
|
957
1037
|
}
|
|
958
1038
|
]);
|
|
959
1039
|
}
|
|
960
|
-
function
|
|
1040
|
+
function gr(e) {
|
|
961
1041
|
if (typeof e.override == "number" && e.override > 0) return e.override;
|
|
962
1042
|
if (e.registryExpirationDate) {
|
|
963
1043
|
let t = Date.parse(e.registryExpirationDate);
|
|
964
1044
|
if (Number.isFinite(t) && t > 0) return Math.floor(t / 1e3);
|
|
965
1045
|
}
|
|
966
|
-
return e.verifiedAt +
|
|
967
|
-
}
|
|
968
|
-
async function
|
|
969
|
-
let
|
|
970
|
-
if (!/^0x[0-9a-fA-F]{40}$/.test(
|
|
971
|
-
let
|
|
972
|
-
if (
|
|
973
|
-
let
|
|
974
|
-
domain:
|
|
1046
|
+
return e.verifiedAt + at;
|
|
1047
|
+
}
|
|
1048
|
+
async function _r(e) {
|
|
1049
|
+
let t = pr(e.wallet), n = e.ensureSchema === !1 ? Z() : await mr(e.wallet), r = Y(e.domain), i = e.claimer.trim();
|
|
1050
|
+
if (!/^0x[0-9a-fA-F]{40}$/.test(i)) throw Error("@seedprotocol/publish: attestDomainOwnership requires a valid claimer address");
|
|
1051
|
+
let a = N(e.challengeHash);
|
|
1052
|
+
if (a === V) throw Error("@seedprotocol/publish: attestDomainOwnership requires a non-zero challengeHash");
|
|
1053
|
+
let o = e.verifiedAt ?? Math.floor(Date.now() / 1e3), s = nr({
|
|
1054
|
+
domain: r,
|
|
975
1055
|
creationDate: e.registrySnapshot.creationDate ?? "",
|
|
976
1056
|
registrarIanaId: e.registrySnapshot.registrarIanaId ?? ""
|
|
977
|
-
}), l = e.registrySnapshot.creationDate ?? "", u = e.registrySnapshot.expirationDate ?? "", d = e.scope ??
|
|
978
|
-
verifiedAt:
|
|
1057
|
+
}), l = e.registrySnapshot.creationDate ?? "", u = e.registrySnapshot.expirationDate ?? "", d = e.scope ?? dt, p = e.method ?? st, m = gr({
|
|
1058
|
+
verifiedAt: o,
|
|
979
1059
|
registryExpirationDate: u,
|
|
980
1060
|
override: e.expirationTime
|
|
981
|
-
}),
|
|
982
|
-
domain:
|
|
983
|
-
claimer:
|
|
984
|
-
method:
|
|
985
|
-
challengeHash:
|
|
986
|
-
verifiedAt:
|
|
1061
|
+
}), h = hr({
|
|
1062
|
+
domain: r,
|
|
1063
|
+
claimer: i,
|
|
1064
|
+
method: p,
|
|
1065
|
+
challengeHash: a,
|
|
1066
|
+
verifiedAt: o,
|
|
987
1067
|
registryCreationDate: l,
|
|
988
1068
|
registryExpirationDate: u,
|
|
989
|
-
registryFingerprint:
|
|
1069
|
+
registryFingerprint: s,
|
|
990
1070
|
scope: d
|
|
991
|
-
}),
|
|
992
|
-
schema:
|
|
1071
|
+
}), g = await X(t, c({
|
|
1072
|
+
schema: n,
|
|
993
1073
|
data: {
|
|
994
|
-
recipient:
|
|
995
|
-
expirationTime: BigInt(
|
|
1074
|
+
recipient: i,
|
|
1075
|
+
expirationTime: BigInt(m),
|
|
996
1076
|
revocable: !0,
|
|
997
|
-
refUID:
|
|
998
|
-
data:
|
|
1077
|
+
refUID: V,
|
|
1078
|
+
data: h,
|
|
999
1079
|
value: 0n
|
|
1000
1080
|
}
|
|
1001
1081
|
}));
|
|
1002
|
-
if (!
|
|
1003
|
-
let { easContractAddress:
|
|
1004
|
-
if (!
|
|
1082
|
+
if (!g) throw Error("@seedprotocol/publish: attestDomainOwnership failed — no receipt");
|
|
1083
|
+
let { easContractAddress: _ } = C(), v = f(g, _);
|
|
1084
|
+
if (!v || !M(v)) throw Error("@seedprotocol/publish: attestDomainOwnership failed — could not parse attestation UID");
|
|
1005
1085
|
return {
|
|
1006
|
-
uid:
|
|
1007
|
-
schemaUid:
|
|
1008
|
-
challengeHash:
|
|
1009
|
-
registryFingerprint:
|
|
1010
|
-
verifiedAt:
|
|
1011
|
-
expirationTime:
|
|
1086
|
+
uid: v,
|
|
1087
|
+
schemaUid: n,
|
|
1088
|
+
challengeHash: a,
|
|
1089
|
+
registryFingerprint: s,
|
|
1090
|
+
verifiedAt: o,
|
|
1091
|
+
expirationTime: m
|
|
1012
1092
|
};
|
|
1013
1093
|
}
|
|
1014
|
-
async function
|
|
1015
|
-
let t =
|
|
1016
|
-
if (!
|
|
1017
|
-
if (!await
|
|
1094
|
+
async function vr(e) {
|
|
1095
|
+
let t = pr(e.wallet), n = e.schemaUid ?? Z(), r = N(e.uid);
|
|
1096
|
+
if (!M(r)) throw Error("@seedprotocol/publish: revokeDomainOwnership requires a valid attestation uid");
|
|
1097
|
+
if (!await X(t, m([{
|
|
1018
1098
|
schema: n,
|
|
1019
1099
|
data: [{ uid: r }]
|
|
1020
1100
|
}]))) throw Error("@seedprotocol/publish: revokeDomainOwnership failed — no receipt");
|
|
1021
1101
|
}
|
|
1022
|
-
async function
|
|
1023
|
-
let { challenge: t } = e, n =
|
|
1102
|
+
async function yr(e) {
|
|
1103
|
+
let { challenge: t } = e, n = St({
|
|
1024
1104
|
domain: t.domain,
|
|
1025
1105
|
claimer: t.claimer,
|
|
1026
1106
|
token: t.token,
|
|
1027
1107
|
scope: t.scope
|
|
1028
1108
|
});
|
|
1029
|
-
if (
|
|
1109
|
+
if (N(n) !== N(t.challengeHash)) return {
|
|
1030
1110
|
ok: !1,
|
|
1031
1111
|
dns: {
|
|
1032
1112
|
ok: !1,
|
|
@@ -1038,7 +1118,7 @@ async function ir(e) {
|
|
|
1038
1118
|
challengeHash: n,
|
|
1039
1119
|
error: "Challenge hash does not match domain/claimer/token/scope"
|
|
1040
1120
|
};
|
|
1041
|
-
let r = await
|
|
1121
|
+
let r = await ur(t, {
|
|
1042
1122
|
lookups: e.dnsLookups,
|
|
1043
1123
|
now: e.now
|
|
1044
1124
|
});
|
|
@@ -1049,7 +1129,7 @@ async function ir(e) {
|
|
|
1049
1129
|
challengeHash: n,
|
|
1050
1130
|
error: r.error ?? "DNS verification failed"
|
|
1051
1131
|
};
|
|
1052
|
-
let i = e.registryLookup ??
|
|
1132
|
+
let i = e.registryLookup ?? tr, a;
|
|
1053
1133
|
try {
|
|
1054
1134
|
a = await i(t.domain);
|
|
1055
1135
|
} catch {
|
|
@@ -1068,8 +1148,8 @@ async function ir(e) {
|
|
|
1068
1148
|
error: "Registry lookup failed"
|
|
1069
1149
|
};
|
|
1070
1150
|
}
|
|
1071
|
-
async function
|
|
1072
|
-
let t = await
|
|
1151
|
+
async function br(e) {
|
|
1152
|
+
let t = await yr({
|
|
1073
1153
|
challenge: e.challenge,
|
|
1074
1154
|
dnsLookups: e.dnsLookups,
|
|
1075
1155
|
registryLookup: e.registryLookup,
|
|
@@ -1077,7 +1157,7 @@ async function ar(e) {
|
|
|
1077
1157
|
});
|
|
1078
1158
|
if (!t.ok || !t.registrySnapshot) throw Error(`@seedprotocol/publish: verifyAndAttestDomainOwnership failed — ${t.error ?? "verification failed"}`);
|
|
1079
1159
|
return {
|
|
1080
|
-
...await
|
|
1160
|
+
...await _r({
|
|
1081
1161
|
wallet: e.wallet,
|
|
1082
1162
|
domain: e.challenge.domain,
|
|
1083
1163
|
claimer: e.challenge.claimer,
|
|
@@ -1091,21 +1171,21 @@ async function ar(e) {
|
|
|
1091
1171
|
dns: t.dns
|
|
1092
1172
|
};
|
|
1093
1173
|
}
|
|
1094
|
-
async function
|
|
1095
|
-
let t = (await
|
|
1174
|
+
async function xr(e) {
|
|
1175
|
+
let t = (await bt({
|
|
1096
1176
|
toolAddresses: e.toolAddresses,
|
|
1097
1177
|
schemaUid: e.schemaUid,
|
|
1098
1178
|
excludeRevoked: !0
|
|
1099
|
-
})).find((t) =>
|
|
1179
|
+
})).find((t) => N(t.id) === N(e.uid));
|
|
1100
1180
|
if (!t) throw Error("@seedprotocol/publish: assessDomainOwnershipLive could not find attestation for uid/toolAddresses");
|
|
1101
|
-
let n =
|
|
1181
|
+
let n = vt(t.decodedDataJson ?? "[]"), r = e.registryLookup ?? tr, i;
|
|
1102
1182
|
try {
|
|
1103
1183
|
i = await r(n.domain);
|
|
1104
1184
|
} catch {
|
|
1105
1185
|
i = null;
|
|
1106
1186
|
}
|
|
1107
1187
|
return {
|
|
1108
|
-
...
|
|
1188
|
+
...gt({
|
|
1109
1189
|
decoded: n,
|
|
1110
1190
|
registrySnapshot: i,
|
|
1111
1191
|
now: e.now
|
|
@@ -1117,50 +1197,50 @@ async function or(e) {
|
|
|
1117
1197
|
}
|
|
1118
1198
|
//#endregion
|
|
1119
1199
|
//#region src/services/publishedBy/index.ts
|
|
1120
|
-
var
|
|
1121
|
-
function
|
|
1122
|
-
if (
|
|
1123
|
-
if (
|
|
1200
|
+
var Sr = "0x0000000000000000000000000000000000000000", Cr = !0;
|
|
1201
|
+
function wr(e) {
|
|
1202
|
+
if (g(e)) return e.txSender;
|
|
1203
|
+
if (i(e)) return e;
|
|
1124
1204
|
throw Error("@seedprotocol/publish: attestPublishedBy / revokePublishedBy require a PublishWallet or SeedTxSender");
|
|
1125
1205
|
}
|
|
1126
1206
|
async function Q(e, t) {
|
|
1127
|
-
let
|
|
1128
|
-
return n
|
|
1207
|
+
let n = await e.sendTransaction(t);
|
|
1208
|
+
return x(n.transactionHash);
|
|
1129
1209
|
}
|
|
1130
1210
|
function $() {
|
|
1131
|
-
return
|
|
1132
|
-
}
|
|
1133
|
-
async function
|
|
1134
|
-
let t =
|
|
1135
|
-
return await
|
|
1136
|
-
schema:
|
|
1137
|
-
resolverAddress:
|
|
1138
|
-
revocable:
|
|
1139
|
-
})), await Q(t,
|
|
1211
|
+
return It.getSchemaUID(j, Sr, Cr);
|
|
1212
|
+
}
|
|
1213
|
+
async function Tr(e) {
|
|
1214
|
+
let t = wr(e), n = $();
|
|
1215
|
+
return await je(n) || (await Q(t, Ae({
|
|
1216
|
+
schema: j,
|
|
1217
|
+
resolverAddress: Sr,
|
|
1218
|
+
revocable: Cr
|
|
1219
|
+
})), await Q(t, De({
|
|
1140
1220
|
schemaUid: n,
|
|
1141
|
-
schemaName:
|
|
1221
|
+
schemaName: ht
|
|
1142
1222
|
}))), n;
|
|
1143
1223
|
}
|
|
1144
|
-
function
|
|
1145
|
-
return new
|
|
1224
|
+
function Er(e) {
|
|
1225
|
+
return new Ft(j).encodeData([
|
|
1146
1226
|
{
|
|
1147
1227
|
name: "seedUid",
|
|
1148
|
-
value:
|
|
1228
|
+
value: N(e.seedUid),
|
|
1149
1229
|
type: "bytes32"
|
|
1150
1230
|
},
|
|
1151
1231
|
{
|
|
1152
1232
|
name: "versionUid",
|
|
1153
|
-
value:
|
|
1233
|
+
value: N(e.versionUid || V),
|
|
1154
1234
|
type: "bytes32"
|
|
1155
1235
|
},
|
|
1156
1236
|
{
|
|
1157
1237
|
name: "attestationUids",
|
|
1158
|
-
value: e.attestationUids.map((e) =>
|
|
1238
|
+
value: e.attestationUids.map((e) => N(e)),
|
|
1159
1239
|
type: "bytes32[]"
|
|
1160
1240
|
},
|
|
1161
1241
|
{
|
|
1162
1242
|
name: "batchHash",
|
|
1163
|
-
value:
|
|
1243
|
+
value: N(e.batchHash),
|
|
1164
1244
|
type: "bytes32"
|
|
1165
1245
|
},
|
|
1166
1246
|
{
|
|
@@ -1175,52 +1255,52 @@ function ur(e) {
|
|
|
1175
1255
|
}
|
|
1176
1256
|
]);
|
|
1177
1257
|
}
|
|
1178
|
-
async function
|
|
1179
|
-
let
|
|
1180
|
-
if (e.mode === "uids")
|
|
1258
|
+
async function Dr(e) {
|
|
1259
|
+
let t = wr(e.wallet), n = e.ensureSchema === !1 ? $() : await Tr(e.wallet), r = [], i;
|
|
1260
|
+
if (e.mode === "uids") r = e.attestationUids.map((e) => N(e)).filter((e) => M(e)), i = e.batchHash ? N(e.batchHash) : Tt(r);
|
|
1181
1261
|
else {
|
|
1182
1262
|
if (!e.batchHash) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires batchHash");
|
|
1183
|
-
if (
|
|
1263
|
+
if (i = N(e.batchHash), i === V) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires a non-zero batchHash");
|
|
1184
1264
|
}
|
|
1185
|
-
let
|
|
1186
|
-
if (!
|
|
1187
|
-
let
|
|
1188
|
-
seedUid:
|
|
1189
|
-
versionUid:
|
|
1190
|
-
attestationUids:
|
|
1191
|
-
batchHash:
|
|
1265
|
+
let a = N(e.seedUid);
|
|
1266
|
+
if (!M(a)) throw Error("@seedprotocol/publish: attestPublishedBy requires a valid seedUid");
|
|
1267
|
+
let o = Er({
|
|
1268
|
+
seedUid: a,
|
|
1269
|
+
versionUid: N(e.versionUid ?? V),
|
|
1270
|
+
attestationUids: r,
|
|
1271
|
+
batchHash: i,
|
|
1192
1272
|
toolName: e.toolName,
|
|
1193
1273
|
toolVersion: e.toolVersion
|
|
1194
|
-
}),
|
|
1195
|
-
schema:
|
|
1274
|
+
}), s = await Q(t, c({
|
|
1275
|
+
schema: n,
|
|
1196
1276
|
data: {
|
|
1197
|
-
recipient:
|
|
1198
|
-
expirationTime: BigInt(
|
|
1277
|
+
recipient: se,
|
|
1278
|
+
expirationTime: BigInt(Pt),
|
|
1199
1279
|
revocable: !0,
|
|
1200
|
-
refUID:
|
|
1201
|
-
data:
|
|
1280
|
+
refUID: a,
|
|
1281
|
+
data: o,
|
|
1202
1282
|
value: 0n
|
|
1203
1283
|
}
|
|
1204
1284
|
}));
|
|
1205
|
-
if (!
|
|
1206
|
-
let { easContractAddress: l } =
|
|
1207
|
-
if (!u || !
|
|
1285
|
+
if (!s) throw Error("@seedprotocol/publish: attestPublishedBy failed — no receipt");
|
|
1286
|
+
let { easContractAddress: l } = C(), u = f(s, l);
|
|
1287
|
+
if (!u || !M(u)) throw Error("@seedprotocol/publish: attestPublishedBy failed — could not parse attestation UID");
|
|
1208
1288
|
return {
|
|
1209
1289
|
uid: u,
|
|
1210
|
-
schemaUid:
|
|
1211
|
-
batchHash:
|
|
1212
|
-
attestationUids:
|
|
1290
|
+
schemaUid: n,
|
|
1291
|
+
batchHash: i,
|
|
1292
|
+
attestationUids: r
|
|
1213
1293
|
};
|
|
1214
1294
|
}
|
|
1215
|
-
async function
|
|
1216
|
-
let t =
|
|
1217
|
-
if (!
|
|
1218
|
-
if (!await Q(t,
|
|
1295
|
+
async function Or(e) {
|
|
1296
|
+
let t = wr(e.wallet), n = e.schemaUid ?? $(), r = N(e.uid);
|
|
1297
|
+
if (!M(r)) throw Error("@seedprotocol/publish: revokePublishedBy requires a valid attestation uid");
|
|
1298
|
+
if (!await Q(t, m([{
|
|
1219
1299
|
schema: n,
|
|
1220
1300
|
data: [{ uid: r }]
|
|
1221
1301
|
}]))) throw Error("@seedprotocol/publish: revokePublishedBy failed — no receipt");
|
|
1222
1302
|
}
|
|
1223
1303
|
//#endregion
|
|
1224
|
-
export {
|
|
1304
|
+
export { we as AttestationVerificationError, de as DEFAULT_PUBLISH_CHAIN, ot as DOMAIN_OWNERSHIP_METHOD, ct as DOMAIN_OWNERSHIP_SCHEMA_DEF, lt as DOMAIN_OWNERSHIP_SCHEMA_NAME, ft as EAS_CHAIN_DEPLOYMENTS, be as Eip7702ModularAccountPublishError, ae as MANAGED_ACCOUNT_FACTORY_ADDRESSES, v as MULTI_PUBLISH_ABI_REFERENCE_ADDRESS_OP_SEPOLIA, Se as ManagedAccountPublishError, pt as PUBLISHED_BY_SCHEMA_DEF, mt as PUBLISHED_BY_SCHEMA_NAME, Ke as PUBLISH_AUTHORIZATION_SCHEMA_DEF, Ve as PUBLISH_AUTHORIZATION_SCHEMA_NAME, We as PUBLISH_AUTHORIZATION_SCOPES, W as PUBLISH_GAS_HEURISTICS, re as PublishChainConfigError, T as PublishManager, Wt as PublishModeButtons, Gt as PublishProvider, te as SEED_PROTOCOL_CONTRACT_ADDRESS_OP_SEPOLIA, kt as SeedProvider, _e as asPublishWallet, ee as asSeedSigner, ge as asSeedTxSender, Je as assertExecutorModuleReadyForAccount, Ne as assertManagedAccountEasMatchesConfig, xr as assessDomainOwnershipLive, ze as assessPublishAuthorizationLive, _r as attestDomainOwnership, Pe as attestPublishAuthorization, Dr as attestPublishedBy, Ee as buildPublishAnchorBytes, Wn as clearAllPublishProcesses, Gn as clearAllUploadProcesses, Hn as clearCompletedPublishProcesses, Un as clearCompletedPublishProcessesForSeed, d as clearPublishWallet, Ye as collectPublishedBatch, _n as combinePublishCostEstimate, oe as configurePublish, ar as createDomainOwnershipChallenge, Xt as createPermissionlessTxSender, qn as deletePublishProcessById, Jn as deletePublishProcessesByIds, Kn as deletePublishProcessesForSeed, hr as encodeDomainOwnershipAttestationData, n as encodeEasAttest, _ as encodeEasMultiAttest, s as encodeEasMultiRevoke, o as encodeMultiPublish, u as encodeMultiPublishInteger, He as encodePublishAuthorizationAttestationData, Er as encodePublishedByAttestationData, l as encodeSetEas, mr as ensureDomainOwnershipSchema, Ue as ensureEasSchemasForItem, qe as ensureManagedAccountEasConfigured, Ge as ensurePublishAuthorizationSchema, Tr as ensurePublishedBySchema, er as ensureWalletThenPublish, vn as estimatePublishCost, nr as fingerprintFromRegistrySnapshot, Kt as fromEip1193Provider, he as fromEthersWallet, qt as fromWindowEthereum, Me as getArweave, Yn as getArweaveTransactionIds, dn as getCachedMarketRates, an as getCachedTokenPrices, Tn as getDisplayStepId, Z as getDomainOwnershipSchemaUid, xt as getEasChainDeployment, Xn as getEasPayload, Ie as getPublishAuthorizationSchemaUid, me as getPublishChainName, C as getPublishConfig, Dn as getPublishMachineValueForUi, b as getPublishPublicClient, S as getPublishWallet, $ as getPublishedBySchemaUid, wt as hashPublishedByBatch, $t as heuristicPublishGas, pe as initPublish, ue as isContractDeployed, ye as isEip7702ModularAccountPublishError, ve as isManagedAccountPublishError, g as isPublishWallet, xe as isRouterNonModularCoreAccountError, a as isSeedSigner, i as isSeedTxSender, tr as lookupDomainRegistry, Y as normalizeRegistrableDomain, Re as publishMachine, p as readGetEas, e as readIsActiveSigner, ne as requireManagedAccountFactoryAddress, fn as resetMarketRateCache, on as resetTokenPriceCache, En as resolvePublishDisplayValue, ce as resolvePublishEasChain, vr as revokeDomainOwnership, Be as revokePublishAuthorization, Or as revokePublishedBy, Ut as seedTwinConfig, t as setPublishWallet, Fe as simulateCallFromAccount, Ce as stringifyUnderlyingCause, Qn as transformPayloadToIntegerIds, Xe as uidsFromAttestationPairs, jn as useArweaveL1Finalize, An as useCanPublishItem, Mn as useItemPublishStatus, Le as usePublishConfig, Zn as usePublishCostEstimate, kn as usePublishProcess, Vn as usePublishProcessById, In as usePublishProcesses, Rn as usePublishProcessesForSeed, Ln as usePublishProcessesNonActiveCount, Bn as usePublishProcessesNonActiveCountForSeed, Fn as usePublishProcessesState, zn as usePublishProcessesStateForSeed, Qt as useSeedWallet, br as verifyAndAttestDomainOwnership, Oe as verifyDataItem, yr as verifyDomainOwnershipChallenge, ur as verifyDomainOwnershipDns, ie as verifyPublishChain, x as waitForPublishReceipt, wn as watchPublishCost };
|
|
1225
1305
|
|
|
1226
1306
|
//# sourceMappingURL=index.js.map
|