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