@seedprotocol/publish 0.7.8 → 0.7.9-next.1177.ga3e08ed

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +9 -24
  3. package/dist/{chainConfig-D9VBbk0H.js → chainConfig-D801ynuH.js} +1388 -1859
  4. package/dist/chainConfig-D801ynuH.js.map +1 -0
  5. package/dist/config.d.ts +9 -53
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/{ensureAutomationSessionKey-CiAto4jZ.js → ensureAutomationSessionKey-DqAS9J9s.js} +19 -19
  8. package/dist/{ensureAutomationSessionKey-CiAto4jZ.js.map → ensureAutomationSessionKey-DqAS9J9s.js.map} +1 -1
  9. package/dist/{ensureModularPublishBootstrap-CDBZqcsZ.js → ensureModularPublishBootstrap-DqmBSJ7_.js} +8 -8
  10. package/dist/{ensureModularPublishBootstrap-CDBZqcsZ.js.map → ensureModularPublishBootstrap-DqmBSJ7_.js.map} +1 -1
  11. package/dist/{ensureSmartWalletThenPublish-hIBtsKXM.js → ensureSmartWalletThenPublish-DcuHyKXL.js} +4 -4
  12. package/dist/{ensureSmartWalletThenPublish-hIBtsKXM.js.map → ensureSmartWalletThenPublish-DcuHyKXL.js.map} +1 -1
  13. package/dist/helpers/constants.d.ts +1 -1
  14. package/dist/helpers/constants.d.ts.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +35 -35
  18. package/dist/index.js.map +1 -1
  19. package/dist/{managedAccountAdmin-Cn1E82-b.js → managedAccountAdmin-IdudyXSZ.js} +6 -6
  20. package/dist/{managedAccountAdmin-Cn1E82-b.js.map → managedAccountAdmin-IdudyXSZ.js.map} +1 -1
  21. package/dist/payment.d.ts +7 -10
  22. package/dist/payment.d.ts.map +1 -1
  23. package/dist/{publishAuthorization-D0HD1CgM.js → publishAuthorization-D1aMORBP.js} +9 -9
  24. package/dist/{publishAuthorization-D0HD1CgM.js.map → publishAuthorization-D1aMORBP.js.map} +1 -1
  25. package/dist/{resolveRevokeAccount-BPZey06q.js → resolveRevokeAccount-zYQmsure.js} +12 -12
  26. package/dist/{resolveRevokeAccount-BPZey06q.js.map → resolveRevokeAccount-zYQmsure.js.map} +1 -1
  27. package/dist/services/arweaveL1Finalize/enqueue.d.ts.map +1 -1
  28. package/dist/services/arweaveL1Finalize/worker.d.ts.map +1 -1
  29. package/dist/services/publish/actors/checking.d.ts.map +1 -1
  30. package/dist/services/publish/actors/createArweaveDataItems.d.ts.map +1 -1
  31. package/dist/services/publish/actors/createArweaveDataItemsPhase2.d.ts.map +1 -1
  32. package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts +5 -3
  33. package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
  34. package/dist/services/publish/actors/index.d.ts +0 -5
  35. package/dist/services/publish/actors/index.d.ts.map +1 -1
  36. package/dist/services/publish/actors/multiPublishReceipt.d.ts +3 -0
  37. package/dist/services/publish/actors/multiPublishReceipt.d.ts.map +1 -1
  38. package/dist/services/publish/actors/preparingHtmlEmbedded.d.ts +1 -1
  39. package/dist/services/publish/actors/publishRequestNormalize.d.ts.map +1 -1
  40. package/dist/services/publish/actors/recordMultiPublishReceipt.d.ts.map +1 -1
  41. package/dist/services/publish/actors/uploadViaBundler.d.ts.map +1 -1
  42. package/dist/services/publish/actors/utils.d.ts +0 -24
  43. package/dist/services/publish/actors/utils.d.ts.map +1 -1
  44. package/dist/services/publish/helpers/getPublishUploadData.d.ts +3 -4
  45. package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
  46. package/dist/services/publish/helpers/itemNeedsArweave.d.ts +1 -1
  47. package/dist/services/publish/helpers/itemNeedsArweave.d.ts.map +1 -1
  48. package/dist/services/publish/index.d.ts +3 -77
  49. package/dist/services/publish/index.d.ts.map +1 -1
  50. package/dist/services/publishCost/estimatePublishCost.d.ts +5 -4
  51. package/dist/services/publishCost/estimatePublishCost.d.ts.map +1 -1
  52. package/dist/services/publishCost/types.d.ts +5 -5
  53. package/dist/services/publishCost/types.d.ts.map +1 -1
  54. package/dist/services/publishManager/actions/createPublish.d.ts.map +1 -1
  55. package/dist/services/publishManager/actors/restorableSnapshot.d.ts +0 -4
  56. package/dist/services/publishManager/actors/restorableSnapshot.d.ts.map +1 -1
  57. package/dist/thirdweb.js +94 -94
  58. package/dist/thirdweb.js.map +1 -1
  59. package/dist/types.d.ts +4 -30
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/worker-DaG8XHbB.js +78 -0
  62. package/dist/worker-DaG8XHbB.js.map +1 -0
  63. package/package.json +8 -8
  64. package/dist/chainConfig-D9VBbk0H.js.map +0 -1
  65. package/dist/helpers/uploadApi.d.ts +0 -37
  66. package/dist/helpers/uploadApi.d.ts.map +0 -1
  67. package/dist/services/publish/actors/createArweaveTransactions.d.ts +0 -12
  68. package/dist/services/publish/actors/createArweaveTransactions.d.ts.map +0 -1
  69. package/dist/services/publish/actors/createArweaveTransactionsPhase2.d.ts +0 -8
  70. package/dist/services/publish/actors/createArweaveTransactionsPhase2.d.ts.map +0 -1
  71. package/dist/services/publish/actors/pollForConfirmation.d.ts +0 -20
  72. package/dist/services/publish/actors/pollForConfirmation.d.ts.map +0 -1
  73. package/dist/services/publish/actors/sendReimbursementRequest.d.ts +0 -7
  74. package/dist/services/publish/actors/sendReimbursementRequest.d.ts.map +0 -1
  75. package/dist/services/publish/actors/uploadData.d.ts +0 -6
  76. package/dist/services/publish/actors/uploadData.d.ts.map +0 -1
  77. package/dist/services/upload/actors.d.ts +0 -11
  78. package/dist/services/upload/actors.d.ts.map +0 -1
  79. package/dist/services/upload/index.d.ts +0 -5
  80. package/dist/services/upload/index.d.ts.map +0 -1
  81. package/dist/services/upload/uploadMachine.d.ts +0 -48
  82. package/dist/services/upload/uploadMachine.d.ts.map +0 -1
  83. package/dist/services/upload/utils.d.ts +0 -21
  84. package/dist/services/upload/utils.d.ts.map +0 -1
  85. package/dist/worker-WIMx6RTs.js +0 -87
  86. package/dist/worker-WIMx6RTs.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"thirdweb.js","names":["seedClient","ConnectButtonThirdweb","pollSmartWalletDeployed","useLocalWalletAccount","ensureManagedAccountReady","getConnectedAccount","getSharedPublishInAppWalletStorage","getConnectedModularAccount","pollSmartWalletDeployed$1","ExternalWalletsForDeploy","isSmartWalletDeployed","getSmartWalletAddressForAdmin","Eip7702ModularAccountPublishError","appMetadata","tryDeployManagedAccount","ensureExecutorModuleInstalled","assertExecutorModuleReadyForAccount","useActiveSmartWalletContract","deployManagedAccountViaFactory","readIsActiveSigner","getManagedAccountWallet","getConnectedManagedAccountAddress","isContractDeployed","getModularAccountWallet","waitForPublishReceipt","resolveSmartWalletForPublish","pollSmartWalletDeployed","syncPublishInAppAuthToken","getPublishThirdwebChain","getPublishConfig","wallets","fromThirdwebAccount","asThirdwebPublishWallet","getConfigRef","runModularExecutorPublishPrep","PublishManager","asSeedSignerFromThirdweb","seedPaymaster","initPublish","getWalletsForConnectButton","ManagedAccountPublishError","getClient","getPublishChainName","CALL_GAS_HEADROOM_BPS","deploySmartWalletContract","setPublishWallet","clearPublishWallet","attestPublishAuthorization","buildAutomationSessionKeyPermissions","hashAutomationSessionKeyPermissions","usePublishConfig","PublishConfigContext","revokePublishAuthorization","approvedTargetsForAutomationPublish","toThirdwebSessionKeyPermissions","PUBLISH_AUTOMATION_SCOPES","ensureSmartWalletThenPublish","ensureModularPublishBootstrap","removeAutomationSessionKey","isAutomationSessionActive","ensureAutomationSessionKey","ConnectButton$1","USER_DISCONNECTED_SESSION_KEY","reportWalletSetupWarning","err","waitUntilSeedInitialized","client","resolve","ensureExecutorModulesForConnect","config","managedAddress","mw","ma","modularAccount","ConnectButton","thirdwebChain","wallet","useActiveWallet","activeAccount","useActiveAccount","connectionStatus","useActiveWalletConnectionStatus","isAutoConnecting","useIsAutoConnecting","lastSyncedOwnedKey","useRef","prevIsAutoConnecting","reloadAutoConnectRetried","prev","navType","userChoseDisconnect","syncActiveWalletToSeed","useCallback","account","activeWallet","owned","adminAddress","tryManaged","r","ownedKey","isSmart","publishWallet","adminAccount","dataItemSigner","useEffect","cancelled","darkTheme","PublishProviderThirdweb","initializedConfig","ThirdwebProvider","SeedProvider","MSG_NO_ACCOUNT","MSG_NOT_UPGRADED","MSG_DEPLOY_FAILED","MSG_NOT_CONFIRMED","DEPLOY_POLL_ATTEMPTS","ensureEip7702ModularAccountReady","modularAccountWallet","accountContract","getContract","autoDeployEip7702ModularAccount","deploySmartAccount","cause","defaultApprovedTargetsForModularPublish","MSG_UNAVAILABLE","MSG_ACTIVATION_FAILED","ensureManagedSignerSessionKey","params","managedWallet","managedAccount","permissions","shouldUpdate","shouldUpdateSessionKey","signerAddress","tx","addSessionKey","result","sendTransaction","active","connectManagedAccount","resolveUserWallet","userWallet","assertExecutorModuleInstalled","twAccount","install","enrollPublishAutomation","sessionKeyAddress","appAddress","revokePublishAutomation","authorizationUid","assertStorageBoundToIdentity","warnings","owner","dataItemOwner","identity","allowActiveSessionKey","allowSidecar","rows","getPublishAuthorizationFromEas","nowMs","atTime","row","decoded","decodePublishAuthorizationData","expirationTime","assess","assessPublishAuthorization"],"sources":["../src/react/ConnectButton.tsx","../src/react/PublishProvider.thirdweb.tsx","../src/helpers/ensureEip7702ModularAccountReady.ts","../src/helpers/defaultApprovedTargetsForModularPublish.ts","../src/helpers/ensureManagedSignerSessionKey.ts","../src/helpers/enrollPublishAutomation.ts","../src/helpers/assertStorageBoundToIdentity.ts"],"sourcesContent":["import React, { FC, useCallback, useEffect, useRef } from \"react\"\nimport {\n ConnectButton as ConnectButtonThirdweb,\n darkTheme,\n useActiveAccount,\n useActiveWallet,\n useActiveWalletConnectionStatus,\n useIsAutoConnecting,\n} from \"thirdweb/react\"\nimport { client as seedClient } from \"@seedprotocol/sdk\"\nimport {\n deploySmartWalletContract,\n getClient,\n getConnectedManagedAccountAddress,\n getManagedAccountWallet,\n getModularAccountWallet,\n getSmartWalletAddressForAdmin,\n getWalletsForConnectButton,\n syncPublishInAppAuthToken,\n} from \"../helpers/thirdweb\"\nimport { fromThirdwebAccount } from \"../helpers/adapters/thirdwebAccount\"\nimport { setPublishWallet, clearPublishWallet } from \"../helpers/publishWalletRegistry\"\nimport { usePublishConfig } from \"./PublishConfigContext\"\nimport { getPublishConfig } from \"../config\"\nimport type { Account, Wallet } from \"thirdweb/wallets\"\nimport type { PublishConfig } from \"../config\"\nimport { ensureExecutorModuleInstalled } from \"../helpers/ensureExecutorModule\"\nimport { PublishManager } from \"../services/publishManager\"\nimport { getPublishThirdwebChain } from '../helpers/thirdwebChain'\n\n/** Session flag so we do not force autoConnect after an explicit UI disconnect (survives reload). */\nconst USER_DISCONNECTED_SESSION_KEY = \"seedProtocol:publish:userChoseWalletDisconnect\"\n\nfunction reportWalletSetupWarning(err: unknown) {\n // Expected when managed-wallet autoConnect is still catching up; publish prep retries.\n console.warn(\"[ConnectButton] Wallet setup / module install skipped:\", err)\n getPublishConfig().onWalletSetupWarning?.(err)\n}\n\n/** Resolves after `ClientManager.init()` has finished; `setAddresses` requires this. */\nfunction waitUntilSeedInitialized(): Promise<void> {\n if (seedClient.isInitialized()) return Promise.resolve()\n return new Promise((resolve) => {\n seedClient.onReady(() => resolve())\n })\n}\n\n/**\n * Installs the Seed executor on the **ManagedAccount** (EIP-4337 Router) contract via its\n * `SeedExecutorRouterExtension`. Other accounts, such as the EIP-7702 modular wallet, have no\n * extension, so `ensureExecutorModuleInstalled` skips them.\n */\nasync function ensureExecutorModulesForConnect(\n modularAccount: Account,\n managedAddress: string | undefined,\n config: PublishConfig,\n): Promise<void> {\n if (!config.modularAccountModuleContract) {\n return\n }\n\n if (config.useModularExecutor) {\n if (!managedAddress) {\n return\n }\n try {\n syncPublishInAppAuthToken()\n const mw = getManagedAccountWallet()\n await mw.autoConnect({ client: getClient(), chain: getPublishThirdwebChain(config) })\n const ma = mw.getAccount()\n if (!ma) {\n return\n }\n await ensureExecutorModuleInstalled(managedAddress, ma, config)\n } catch {\n /* managed wallet session may lag modular connect; publish prep retries module install */\n }\n return\n }\n\n try {\n await ensureExecutorModuleInstalled(modularAccount.address, modularAccount, config)\n } catch (err) {\n reportWalletSetupWarning(err)\n }\n}\n\nconst ConnectButton: FC = () => {\n const config = usePublishConfig()\n const thirdwebChain = getPublishThirdwebChain(config)\n const wallet = useActiveWallet()\n const activeAccount = useActiveAccount()\n const connectionStatus = useActiveWalletConnectionStatus()\n const isAutoConnecting = useIsAutoConnecting()\n /** Avoid duplicate setAddresses when onConnect and the reconcile effect both run. */\n const lastSyncedOwnedKey = useRef<string | null>(null)\n const prevIsAutoConnecting = useRef(false)\n const reloadAutoConnectRetried = useRef(false)\n\n /**\n * Thirdweb sometimes finishes autoConnect on full reload with `disconnected` and no wallet\n * (see debug: isAutoConnecting true→false then disconnected). One explicit in-app autoConnect\n * retry recovers without affecting users who chose Disconnect (sessionStorage gate).\n */\n useEffect(() => {\n if (typeof window === \"undefined\") return\n const prev = prevIsAutoConnecting.current\n prevIsAutoConnecting.current = isAutoConnecting\n\n let navType: string | undefined\n try {\n navType = (\n performance.getEntriesByType(\"navigation\")[0] as\n | PerformanceNavigationTiming\n | undefined\n )?.type\n } catch {\n navType = undefined\n }\n if (navType !== \"reload\") return\n\n let userChoseDisconnect = false\n try {\n userChoseDisconnect =\n sessionStorage.getItem(USER_DISCONNECTED_SESSION_KEY) === \"1\"\n } catch {\n userChoseDisconnect = false\n }\n if (userChoseDisconnect) return\n\n if (!prev || isAutoConnecting || connectionStatus !== \"disconnected\") return\n if (reloadAutoConnectRetried.current) return\n reloadAutoConnectRetried.current = true\n\n void (config.useModularExecutor ? getModularAccountWallet() : getManagedAccountWallet())\n .autoConnect({ client: getClient(), chain: thirdwebChain })\n .catch(() => {\n /* no session or iframe not ready; Connect UI can still sign in */\n })\n }, [connectionStatus, isAutoConnecting, config.useModularExecutor, thirdwebChain])\n\n const syncActiveWalletToSeed = useCallback(\n async (activeWallet: Wallet) => {\n const account = activeWallet.getAccount()\n if (!account) {\n return\n }\n await waitUntilSeedInitialized()\n const owned = new Set<string>([account.address.toLowerCase()])\n let managedAddress: string | undefined\n if (config.useModularExecutor) {\n syncPublishInAppAuthToken()\n const adminAddress =\n activeWallet.getAdminAccount?.()?.address ?? account.address\n const tryManaged = async () => {\n try {\n return await getConnectedManagedAccountAddress(thirdwebChain)\n } catch {\n try {\n return await getSmartWalletAddressForAdmin(adminAddress)\n } catch {\n return undefined\n }\n }\n }\n managedAddress = await tryManaged()\n if (!managedAddress) {\n await new Promise<void>((r) => queueMicrotask(() => r()))\n managedAddress = await tryManaged()\n }\n if (managedAddress) {\n owned.add(managedAddress.toLowerCase())\n }\n }\n const ownedKey = [...owned].sort().join(\",\")\n if (lastSyncedOwnedKey.current === ownedKey) {\n return\n }\n // Another wallet took over: publishes started for the previous one stop (their rows stay\n // for it to resume). Not on the first sync, where publishes restored from the DB need this\n // wallet, nor on a re-sync of the same wallet.\n if (lastSyncedOwnedKey.current !== null) {\n PublishManager.stopAll()\n }\n lastSyncedOwnedKey.current = ownedKey\n try {\n const adminAddress = activeWallet.getAdminAccount?.()?.address\n // A wallet with a separate admin account, or the modular executor's ManagedAccount, is a\n // smart account; otherwise the connected account is a plain key (in-app or injected).\n const isSmart =\n !!managedAddress ||\n (!!adminAddress && adminAddress.toLowerCase() !== account.address.toLowerCase())\n const publishWallet = fromThirdwebAccount(account, { kind: isSmart ? \"smart\" : \"eoa\" })\n // Data items need an ECDSA signer. With the modular executor the connected account is an\n // EOA (or EIP-7702 on one) acting for the ManagedAccount; otherwise a smart wallet's admin\n // EOA signs them.\n const adminAccount = activeWallet.getAdminAccount?.()\n const dataItemSigner = managedAddress\n ? publishWallet.signer\n : isSmart && adminAccount && adminAccount.address.toLowerCase() !== account.address.toLowerCase()\n ? fromThirdwebAccount(adminAccount, { kind: \"eoa\" }).signer\n : undefined\n await setPublishWallet({\n ...publishWallet,\n ownedAddresses: [...owned],\n publisherAddress: managedAddress ?? account.address,\n ...(dataItemSigner ? { dataItemSigner } : {}),\n // A new user's smart wallet has no code until its first transaction: publish deploys it.\n ...(isSmart && !managedAddress\n ? { deploy: async () => { await deploySmartWalletContract(account) } }\n : {}),\n ...(adminAddress && adminAddress.toLowerCase() !== account.address.toLowerCase()\n ? { adminAddress }\n : {}),\n })\n } catch (err) {\n lastSyncedOwnedKey.current = null\n console.warn(\"[ConnectButton] Failed to set seed client addresses:\", err)\n throw err\n }\n await ensureExecutorModulesForConnect(account, managedAddress, config)\n },\n [config],\n )\n\n /**\n * Thirdweb autoConnect restores the wallet without calling onConnect. Seed addresses live in\n * SQLite (OPFS); after a wipe there is no app_state row until setAddresses runs again.\n */\n useEffect(() => {\n if (isAutoConnecting) {\n return\n }\n if (connectionStatus !== \"connected\") {\n lastSyncedOwnedKey.current = null\n return\n }\n if (!wallet) {\n return\n }\n let cancelled = false\n void (async () => {\n try {\n if (cancelled) return\n await syncActiveWalletToSeed(wallet)\n } catch {\n /* logged in syncActiveWalletToSeed */\n }\n })()\n return () => {\n cancelled = true\n }\n }, [\n wallet,\n activeAccount?.address,\n connectionStatus,\n isAutoConnecting,\n syncActiveWalletToSeed,\n ])\n\n const handleDisconnect = () => {\n try {\n sessionStorage.setItem(USER_DISCONNECTED_SESSION_KEY, \"1\")\n } catch {\n /* private mode / SSR */\n }\n void clearPublishWallet()\n PublishManager.stopAll()\n }\n\n const handleConnect = async (activeWallet: Wallet, _allConnectedWallets: Wallet[]) => {\n const account = activeWallet.getAccount()\n if (!account) return\n try {\n sessionStorage.removeItem(USER_DISCONNECTED_SESSION_KEY)\n } catch {\n /* ignore */\n }\n console.log('[ConnectButton] Connected', account.address)\n try {\n await syncActiveWalletToSeed(activeWallet)\n } catch {\n /* syncActiveWalletToSeed logs */\n }\n }\n\n return (\n <ConnectButtonThirdweb\n client={getClient()}\n wallets={getWalletsForConnectButton(config)}\n autoConnect={true}\n chain={thirdwebChain}\n chains={[ thirdwebChain, ]}\n onConnect={handleConnect}\n onDisconnect={handleDisconnect}\n theme={darkTheme({\n colors: {\n primaryButtonBg: '#1D2939',\n primaryButtonText: '#FFFFFF',\n secondaryButtonHoverBg: '#1D2939',\n connectedButtonBg: '#101828',\n connectedButtonBgHover: '#1D2939',\n borderColor: '#344054',\n },\n })}\n />\n )\n}\n\nexport default ConnectButton\n","import React, { FC, useRef } from \"react\"\nimport { ThirdwebProvider } from \"thirdweb/react\"\nimport { SeedProvider } from '@seedprotocol/react'\nimport { initPublish, getConfigRef, type PublishConfig } from \"../config\"\nimport { PublishConfigContext, usePublishConfig } from \"./PublishConfigContext\"\nimport type { PublishProviderProps } from \"./PublishProvider\"\n\nexport { usePublishConfig }\nexport type { PublishProviderProps }\n\n/**\n * Thirdweb-backed PublishProvider (includes ThirdwebProvider).\n */\nconst PublishProviderThirdweb: FC<PublishProviderProps> = ({\n children,\n config,\n queryClient,\n queryClientRef,\n}) => {\n // During render, not in an effect: children such as ConnectButton read the config on their\n // first render, which runs before this provider's effects. Once per config object.\n const initializedConfig = useRef<PublishConfig | undefined>(undefined)\n if (config && initializedConfig.current !== config) {\n initPublish(config)\n initializedConfig.current = config\n }\n\n return (\n <PublishConfigContext.Provider value={config ?? getConfigRef()}>\n <ThirdwebProvider>\n <SeedProvider queryClient={queryClient} queryClientRef={queryClientRef}>\n {children}\n </SeedProvider>\n </ThirdwebProvider>\n </PublishConfigContext.Provider>\n )\n}\n\nexport default PublishProviderThirdweb\n","import { deploySmartAccount, getContract } from 'thirdweb'\nimport { getPublishConfig } from '../config'\nimport { Eip7702ModularAccountPublishError } from '../errors'\nimport { isContractDeployed, pollSmartWalletDeployed } from './chainClient'\nimport { getClient, getModularAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nconst MSG_NO_ACCOUNT =\n 'Modular (EIP-7702) wallet is not connected. Sign in with the same method and try again.'\nconst MSG_NOT_UPGRADED = () =>\n `Your modular account is not upgraded to an EIP-7702 smart account on ${getPublishChainName()} yet. Enable autoDeployEip7702ModularAccount in publish config or complete wallet setup, then retry.`\nconst MSG_DEPLOY_FAILED = () =>\n `Automatic EIP-7702 smart account setup failed on ${getPublishChainName()}. Retry or reconnect your wallet.`\nconst MSG_NOT_CONFIRMED =\n 'EIP-7702 upgrade was sent but on-chain bytecode was not detected yet. Wait a moment and retry.'\n\nconst DEPLOY_POLL_ATTEMPTS = 5\n\n/**\n * Ensures the Thirdweb in-app modular wallet (EIP-7702) has non-empty bytecode at its address\n * on the publish chain. deploySmartAccount remains Thirdweb; bytecode checks use viem.\n */\nexport async function ensureEip7702ModularAccountReady(): Promise<void> {\n const { autoDeployEip7702ModularAccount } = getPublishConfig()\n const modularAccountWallet = getModularAccountWallet()\n await modularAccountWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const modularAccount = modularAccountWallet.getAccount()\n if (!modularAccount) {\n throw new Eip7702ModularAccountPublishError(MSG_NO_ACCOUNT, 'EIP7702_MODULAR_ACCOUNT_UNAVAILABLE')\n }\n\n const client = getClient()\n const accountContract = getContract({\n client,\n chain: getPublishThirdwebChain(),\n address: modularAccount.address,\n })\n\n if (await isContractDeployed(modularAccount.address)) {\n return\n }\n\n if (!autoDeployEip7702ModularAccount) {\n throw new Eip7702ModularAccountPublishError(\n MSG_NOT_UPGRADED(),\n 'EIP7702_MODULAR_NOT_UPGRADED',\n modularAccount.address,\n )\n }\n\n try {\n await deploySmartAccount({\n smartAccount: modularAccount,\n chain: getPublishThirdwebChain(),\n client,\n accountContract,\n })\n } catch (cause) {\n if (await pollSmartWalletDeployed(modularAccount.address, DEPLOY_POLL_ATTEMPTS)) {\n return\n }\n throw new Eip7702ModularAccountPublishError(\n MSG_DEPLOY_FAILED(),\n 'EIP7702_MODULAR_DEPLOY_FAILED',\n modularAccount.address,\n cause,\n )\n }\n\n if (!(await pollSmartWalletDeployed(modularAccount.address, DEPLOY_POLL_ATTEMPTS))) {\n throw new Eip7702ModularAccountPublishError(\n MSG_NOT_CONFIRMED,\n 'EIP7702_MODULAR_NOT_CONFIRMED',\n modularAccount.address,\n )\n }\n}\n","import { approvedTargetsForAutomationPublish } from './approvedTargetsForAutomationPublish'\n\n/**\n * Allowlisted call targets for a modular session signer: only the Seed executor module.\n *\n * Never the ManagedAccount (a key could then make any self-call, which the account trusts) and\n * never EAS (a direct EAS target bypasses the Seed extension's forced revocability).\n *\n * @deprecated Interactive publishing is a UserOp from the ManagedAccount itself and needs no\n * session key; automation keys use {@link approvedTargetsForAutomationPublish}, which this now\n * returns. `managedAddress` is ignored.\n * @throws if `modularAccountModuleContract` is unset or invalid\n */\nexport function defaultApprovedTargetsForModularPublish(_managedAddress?: string): `0x${string}`[] {\n return approvedTargetsForAutomationPublish()\n}\n","import { getContract, sendTransaction } from 'thirdweb'\nimport { addSessionKey, shouldUpdateSessionKey } from 'thirdweb/extensions/erc4337'\nimport type { Address } from 'viem'\nimport { ManagedAccountPublishError } from '../errors'\nimport { waitForPublishReceipt } from './chainClient'\nimport { readIsActiveSigner } from './contracts'\nimport { defaultApprovedTargetsForModularPublish } from './defaultApprovedTargetsForModularPublish'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nconst MSG_UNAVAILABLE = () =>\n `Could not connect the managed publishing account to authorize the modular signer on ${getPublishChainName()}. Reconnect and try again.`\nconst MSG_ACTIVATION_FAILED = () =>\n `Could not authorize the modular wallet as a session signer on your publishing account on ${getPublishChainName()}.`\n\n/**\n * Ensures the modular (EIP-7702) wallet is an active session signer on the ManagedAccount.\n * If permissions are missing or stale, sends `addSessionKey` signed by the managed EIP-4337 wallet.\n * Session-key AA extensions remain on Thirdweb; verification uses viem.\n *\n * The key may call only the Seed executor module ({@link defaultApprovedTargetsForModularPublish}).\n *\n * @deprecated Interactive publishing is a UserOp from the ManagedAccount itself and needs no\n * session key. For server-held keys use `enrollPublishAutomation`.\n */\nexport async function ensureManagedSignerSessionKey(params: {\n managedAddress: string\n signerAddress: string\n}): Promise<void> {\n const { managedAddress, signerAddress } = params\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n MSG_UNAVAILABLE(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n\n const accountContract = getContract({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n address: managedAddress,\n })\n const permissions = {\n approvedTargets: defaultApprovedTargetsForModularPublish(managedAddress),\n nativeTokenLimitPerTransaction: 0,\n }\n\n let shouldUpdate = false\n try {\n shouldUpdate = await shouldUpdateSessionKey({\n accountContract,\n sessionKeyAddress: signerAddress,\n newPermissions: permissions,\n })\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n\n if (shouldUpdate) {\n try {\n const tx = addSessionKey({\n contract: accountContract,\n account: managedAccount,\n sessionKeyAddress: signerAddress,\n permissions,\n })\n const result = await sendTransaction({ account: managedAccount, transaction: tx })\n await waitForPublishReceipt(result.transactionHash as `0x${string}`)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n }\n\n let active = false\n try {\n active = await readIsActiveSigner(managedAddress as Address, signerAddress as Address)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n\n if (!active) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n}\n","import type { Account } from 'thirdweb/wallets'\nimport type { PublishWallet } from './seedSigner'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { ensureExecutorModuleInstalled, type EnsureExecutorModuleResult } from './ensureExecutorModule'\nimport { assertExecutorModuleReadyForAccount } from './executorModuleReadiness'\nimport {\n ensureAutomationSessionKey,\n removeAutomationSessionKey,\n} from './ensureAutomationSessionKey'\nimport {\n attestPublishAuthorization,\n revokePublishAuthorization,\n type AttestPublishAuthorizationResult,\n} from '../services/publishAuthorization'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\nexport type EnrollPublishAutomationParams = {\n managedAddress: string\n sessionKeyAddress: string\n /** Optional app label stored in the sidecar (defaults to zero address). */\n appAddress?: string\n /** Unix seconds session / grant end (optional). */\n expiresAt?: number\n /**\n * User-controlled ManagedAccount wallet used to add the session key and attest the sidecar.\n * When omitted, uses the connected managed in-app wallet.\n */\n userWallet?: PublishWallet\n}\n\nexport type EnrollPublishAutomationResult = {\n managedAddress: string\n sessionKeyAddress: string\n authorization: AttestPublishAuthorizationResult\n}\n\nexport type RevokePublishAutomationParams = {\n managedAddress: string\n sessionKeyAddress: string\n authorizationUid: string\n userWallet?: PublishWallet\n}\n\nasync function connectManagedAccount(managedAddress: string): Promise<Account> {\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const account = managedWallet.getAccount()\n if (!account) {\n throw new ManagedAccountPublishError(\n 'Could not connect the managed publishing account to enroll or revoke publish automation.',\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n return account\n}\n\nasync function resolveUserWallet(\n managedAddress: string,\n userWallet?: PublishWallet,\n): Promise<PublishWallet> {\n if (userWallet) return userWallet\n return fromThirdwebAccount(await connectManagedAccount(managedAddress), { kind: 'smart' })\n}\n\nasync function assertExecutorModuleInstalled(managedAddress: string): Promise<void> {\n const config = getPublishConfig()\n const moduleAddr = config.modularAccountModuleContract?.trim()\n if (!moduleAddr) {\n throw new Error(\n '@seedprotocol/publish: enrollPublishAutomation requires PublishConfig.modularAccountModuleContract',\n )\n }\n\n const twAccount = await connectManagedAccount(managedAddress)\n let install: EnsureExecutorModuleResult\n try {\n install = await ensureExecutorModuleInstalled(managedAddress, twAccount, config)\n } catch (cause) {\n if (cause instanceof ManagedAccountPublishError) throw cause\n throw new ManagedAccountPublishError(\n 'Executor module setup failed for publish automation.',\n 'EXECUTOR_MODULE_NOT_INSTALLED',\n managedAddress,\n cause,\n )\n }\n\n // The session key may only call the module, so refuse to enroll unless the module can act\n // for this account. Otherwise every automation publish would revert. A fresh install is\n // confirmed from its receipt; otherwise the read may still trail an install that just landed.\n await assertExecutorModuleReadyForAccount(\n managedAddress,\n install.status === 'installed'\n ? { installedEas: install.eas }\n : { readAttempts: install.status === 'already-installed' ? 5 : 1 },\n )\n}\n\n/**\n * Enroll an app automation key: install the Seed executor (`installSeedExecutor` on Router\n * accounts with the executor router extension), add an executor-only session key, then attest\n * the PublishAuthorization sidecar (ManagedAccount attester).\n *\n * @throws ManagedAccountPublishError `AUTOMATION_UNSUPPORTED_ACCOUNT` before adding the session\n * key when the executor cannot act for the account (e.g. Router accounts without the extension)\n */\nexport async function enrollPublishAutomation(\n params: EnrollPublishAutomationParams,\n): Promise<EnrollPublishAutomationResult> {\n const { managedAddress, sessionKeyAddress, appAddress, expiresAt } = params\n\n await assertExecutorModuleInstalled(managedAddress)\n await ensureAutomationSessionKey({\n managedAddress,\n sessionKeyAddress,\n expiresAt,\n })\n\n const userWallet = await resolveUserWallet(managedAddress, params.userWallet)\n const authorization = await attestPublishAuthorization({\n wallet: userWallet,\n identity: managedAddress,\n sessionKey: sessionKeyAddress,\n app: appAddress,\n expiresAt,\n })\n\n return {\n managedAddress,\n sessionKeyAddress,\n authorization,\n }\n}\n\n/**\n * Disconnect automation: remove session key, then revoke PublishAuthorization sidecar.\n */\nexport async function revokePublishAutomation(\n params: RevokePublishAutomationParams,\n): Promise<void> {\n const { managedAddress, sessionKeyAddress, authorizationUid } = params\n const userWallet = await resolveUserWallet(managedAddress, params.userWallet)\n\n await removeAutomationSessionKey({\n managedAddress,\n sessionKeyAddress,\n })\n\n await revokePublishAuthorization({\n wallet: userWallet,\n uid: authorizationUid,\n })\n}\n","import {\n assessPublishAuthorization,\n decodePublishAuthorizationData,\n getPublishAuthorizationFromEas,\n} from '@seedprotocol/eas'\nimport { isAutomationSessionActive } from './ensureAutomationSessionKey'\n\nexport type AssertStorageBoundToIdentityParams = {\n managedAddress: string\n /** Recovered ANS-104 DataItem owner (Ethereum address). */\n dataItemOwner: string\n /**\n * Unix seconds for historical binding checks against PublishAuthorization expiry.\n * Defaults to now. Session-key live check always uses current `isActiveSigner`.\n */\n atTime?: number\n /**\n * When true (default), accept a live active session key on the ManagedAccount.\n */\n allowActiveSessionKey?: boolean\n /**\n * When true (default), accept a non-revoked PublishAuthorization sidecar valid at `atTime`.\n */\n allowSidecar?: boolean\n}\n\nexport type AssertStorageBoundToIdentityResult = {\n bound: boolean\n via: 'active_session_key' | 'publish_authorization' | null\n warnings: string[]\n}\n\n/**\n * Whether an Arweave DataItem owner is bound to a ManagedAccount identity for authorship.\n * Prefer live `isActiveSigner` for current publishes; use the PublishAuthorization sidecar\n * for discoverability / historical grants (revoking the session key stops new binds via\n * active check; sidecar validity is assessed at `atTime`).\n */\nexport async function assertStorageBoundToIdentity(\n params: AssertStorageBoundToIdentityParams,\n): Promise<AssertStorageBoundToIdentityResult> {\n const {\n managedAddress,\n dataItemOwner,\n atTime,\n allowActiveSessionKey = true,\n allowSidecar = true,\n } = params\n const warnings: string[] = []\n const owner = dataItemOwner.trim().toLowerCase()\n const identity = managedAddress.trim().toLowerCase()\n\n if (!/^0x[0-9a-fA-F]{40}$/.test(owner) || !/^0x[0-9a-fA-F]{40}$/.test(identity)) {\n return { bound: false, via: null, warnings: ['Invalid managedAddress or dataItemOwner'] }\n }\n\n if (allowActiveSessionKey) {\n try {\n const active = await isAutomationSessionActive(managedAddress, dataItemOwner)\n if (active) {\n return { bound: true, via: 'active_session_key', warnings }\n }\n } catch (e) {\n warnings.push(\n e instanceof Error ? e.message : 'isActiveSigner check failed',\n )\n }\n }\n\n if (allowSidecar) {\n try {\n const rows = await getPublishAuthorizationFromEas({\n identities: [managedAddress],\n sessionKeys: [dataItemOwner],\n excludeRevoked: true,\n })\n const nowMs = atTime != null ? atTime * 1000 : Date.now()\n for (const row of rows) {\n try {\n const decoded = decodePublishAuthorizationData(row.decodedDataJson ?? '[]')\n if (decoded.identity.toLowerCase() !== identity) continue\n if (decoded.sessionKey.toLowerCase() !== owner) continue\n const expirationTime =\n typeof row.expirationTime === 'number' ? row.expirationTime : null\n const assess = assessPublishAuthorization({\n decoded,\n expirationTime,\n now: nowMs,\n })\n if (assess.status === 'valid') {\n return {\n bound: true,\n via: 'publish_authorization',\n warnings: [...warnings, ...assess.warnings],\n }\n }\n warnings.push(...assess.warnings)\n } catch {\n // skip undecodable row\n }\n }\n } catch (e) {\n warnings.push(\n e instanceof Error ? e.message : 'PublishAuthorization query failed',\n )\n }\n }\n\n return { bound: false, via: null, warnings }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,IAAM8D,IAAgC;AAEtC,SAASC,GAAyB,GAAc;CAG9C,AADA,QAAQ,KAAK,0DAA0DC,CAAG,GAC1EnC,EAAiB,CAAC,CAAC,uBAAuBmC,CAAG;AAC/C;AAGA,SAASC,KAA0C;CAEjD,OADIjE,EAAW,cAAc,IAAU,QAAQ,QAAQ,IAChD,IAAI,SAAS,MAAY;EAC9B,EAAW,cAAcmE,EAAQ,CAAC;CACpC,CAAC;AACH;AAOA,eAAeC,GACb,GACA,GACA,GACe;CACf,IAAKC,EAAO,8BAIZ;MAAIA,EAAO,oBAAoB;GAC7B,IAAI,CAACC,GACH;GAEF,IAAI;IACF,EAA0B;IAC1B,IAAMC,IAAK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CAGF,IAAIG,GACF,IAAI;EACF,IAAMC,IAAO,MAAMC,GAA+B;GAChD,YAAY,CAACxF,CAAc;GAC3B,aAAa,CAACmF,CAAa;GAC3B,gBAAgB;EAClB,CAAC,GACKM,IAAQC,KAAU,OAAuB,KAAK,IAAI,IAAzBA,IAAS;EACxC,KAAK,IAAMC,KAAOJ,GAChB,IAAI;GACF,IAAMK,IAAUC,GAA+BF,EAAI,mBAAmB,IAAI;GAE1E,IADIC,EAAQ,SAAS,YAAY,MAAMR,KACnCQ,EAAQ,WAAW,YAAY,MAAMV,GAAO;GAChD,IAAMY,IACJ,OAAOH,EAAI,kBAAmB,WAAWA,EAAI,iBAAiB,MAC1DI,IAASC,GAA2B;IACxC;IACA;IACA,KAAKP;GACP,CAAC;GACD,IAAIM,EAAO,WAAW,SACpB,OAAO;IACL,OAAO;IACP,KAAK;IACL,UAAU,CAAC,GAAGd,GAAU,GAAGc,EAAO,QAAQ;GAC5C;GAEF,EAAS,KAAK,GAAGA,EAAO,QAAQ;EAClC,QAAQ,CAER;CAEJ,SAAS,GAAG;EACV,EAAS,KACP,aAAa,QAAQ,EAAE,UAAU,mCACnC;CACF;CAGF,OAAO;EAAE,OAAO;EAAO,KAAK;EAAM;CAAS;AAC7C"}
1
+ {"version":3,"file":"thirdweb.js","names":["seedClient","ConnectButtonThirdweb","pollSmartWalletDeployed","useActiveSmartWalletContract","deploySmartWalletContract","assertExecutorModuleReadyForAccount","getModularAccountWallet","getConnectedManagedAccountAddress","pollSmartWalletDeployed$1","getWalletsForConnectButton","getSharedPublishInAppWalletStorage","Eip7702ModularAccountPublishError","ExternalWalletsForDeploy","runModularExecutorPublishPrep","tryDeployManagedAccount","ensureExecutorModuleInstalled","syncPublishInAppAuthToken","appMetadata","readIsActiveSigner","getConnectedModularAccount","getConnectedAccount","isContractDeployed","getManagedAccountWallet","waitForPublishReceipt","pollSmartWalletDeployed","isSmartWalletDeployed","resolveSmartWalletForPublish","getPublishThirdwebChain","getPublishConfig","useLocalWalletAccount","fromThirdwebAccount","asThirdwebPublishWallet","getConfigRef","getClient","ensureManagedAccountReady","PublishManager","asSeedSignerFromThirdweb","CALL_GAS_HEADROOM_BPS","initPublish","getSmartWalletAddressForAdmin","ManagedAccountPublishError","seedPaymaster","getPublishChainName","wallets","deployManagedAccountViaFactory","setPublishWallet","clearPublishWallet","attestPublishAuthorization","buildAutomationSessionKeyPermissions","hashAutomationSessionKeyPermissions","usePublishConfig","PublishConfigContext","revokePublishAuthorization","approvedTargetsForAutomationPublish","toThirdwebSessionKeyPermissions","PUBLISH_AUTOMATION_SCOPES","ensureSmartWalletThenPublish","ensureModularPublishBootstrap","removeAutomationSessionKey","isAutomationSessionActive","ensureAutomationSessionKey","ConnectButton$1","USER_DISCONNECTED_SESSION_KEY","reportWalletSetupWarning","err","waitUntilSeedInitialized","client","resolve","ensureExecutorModulesForConnect","config","managedAddress","mw","ma","modularAccount","ConnectButton","thirdwebChain","wallet","useActiveWallet","activeAccount","useActiveAccount","connectionStatus","useActiveWalletConnectionStatus","isAutoConnecting","useIsAutoConnecting","lastSyncedOwnedKey","useRef","prevIsAutoConnecting","reloadAutoConnectRetried","prev","navType","userChoseDisconnect","syncActiveWalletToSeed","useCallback","account","activeWallet","owned","adminAddress","tryManaged","r","ownedKey","isSmart","publishWallet","adminAccount","dataItemSigner","useEffect","cancelled","darkTheme","PublishProviderThirdweb","initializedConfig","ThirdwebProvider","SeedProvider","MSG_NO_ACCOUNT","MSG_NOT_UPGRADED","MSG_DEPLOY_FAILED","MSG_NOT_CONFIRMED","DEPLOY_POLL_ATTEMPTS","ensureEip7702ModularAccountReady","modularAccountWallet","accountContract","getContract","autoDeployEip7702ModularAccount","deploySmartAccount","cause","defaultApprovedTargetsForModularPublish","MSG_UNAVAILABLE","MSG_ACTIVATION_FAILED","ensureManagedSignerSessionKey","params","managedWallet","managedAccount","permissions","shouldUpdate","shouldUpdateSessionKey","signerAddress","tx","addSessionKey","result","sendTransaction","active","connectManagedAccount","resolveUserWallet","userWallet","assertExecutorModuleInstalled","twAccount","install","enrollPublishAutomation","sessionKeyAddress","appAddress","revokePublishAutomation","authorizationUid","assertStorageBoundToIdentity","warnings","owner","dataItemOwner","identity","allowActiveSessionKey","allowSidecar","rows","getPublishAuthorizationFromEas","nowMs","atTime","row","decoded","decodePublishAuthorizationData","expirationTime","assess","assessPublishAuthorization"],"sources":["../src/react/ConnectButton.tsx","../src/react/PublishProvider.thirdweb.tsx","../src/helpers/ensureEip7702ModularAccountReady.ts","../src/helpers/defaultApprovedTargetsForModularPublish.ts","../src/helpers/ensureManagedSignerSessionKey.ts","../src/helpers/enrollPublishAutomation.ts","../src/helpers/assertStorageBoundToIdentity.ts"],"sourcesContent":["import React, { FC, useCallback, useEffect, useRef } from \"react\"\nimport {\n ConnectButton as ConnectButtonThirdweb,\n darkTheme,\n useActiveAccount,\n useActiveWallet,\n useActiveWalletConnectionStatus,\n useIsAutoConnecting,\n} from \"thirdweb/react\"\nimport { client as seedClient } from \"@seedprotocol/sdk\"\nimport {\n deploySmartWalletContract,\n getClient,\n getConnectedManagedAccountAddress,\n getManagedAccountWallet,\n getModularAccountWallet,\n getSmartWalletAddressForAdmin,\n getWalletsForConnectButton,\n syncPublishInAppAuthToken,\n} from \"../helpers/thirdweb\"\nimport { fromThirdwebAccount } from \"../helpers/adapters/thirdwebAccount\"\nimport { setPublishWallet, clearPublishWallet } from \"../helpers/publishWalletRegistry\"\nimport { usePublishConfig } from \"./PublishConfigContext\"\nimport { getPublishConfig } from \"../config\"\nimport type { Account, Wallet } from \"thirdweb/wallets\"\nimport type { PublishConfig } from \"../config\"\nimport { ensureExecutorModuleInstalled } from \"../helpers/ensureExecutorModule\"\nimport { PublishManager } from \"../services/publishManager\"\nimport { getPublishThirdwebChain } from '../helpers/thirdwebChain'\n\n/** Session flag so we do not force autoConnect after an explicit UI disconnect (survives reload). */\nconst USER_DISCONNECTED_SESSION_KEY = \"seedProtocol:publish:userChoseWalletDisconnect\"\n\nfunction reportWalletSetupWarning(err: unknown) {\n // Expected when managed-wallet autoConnect is still catching up; publish prep retries.\n console.warn(\"[ConnectButton] Wallet setup / module install skipped:\", err)\n getPublishConfig().onWalletSetupWarning?.(err)\n}\n\n/** Resolves after `ClientManager.init()` has finished; `setAddresses` requires this. */\nfunction waitUntilSeedInitialized(): Promise<void> {\n if (seedClient.isInitialized()) return Promise.resolve()\n return new Promise((resolve) => {\n seedClient.onReady(() => resolve())\n })\n}\n\n/**\n * Installs the Seed executor on the **ManagedAccount** (EIP-4337 Router) contract via its\n * `SeedExecutorRouterExtension`. Other accounts, such as the EIP-7702 modular wallet, have no\n * extension, so `ensureExecutorModuleInstalled` skips them.\n */\nasync function ensureExecutorModulesForConnect(\n modularAccount: Account,\n managedAddress: string | undefined,\n config: PublishConfig,\n): Promise<void> {\n if (!config.modularAccountModuleContract) {\n return\n }\n\n if (config.useModularExecutor) {\n if (!managedAddress) {\n return\n }\n try {\n syncPublishInAppAuthToken()\n const mw = getManagedAccountWallet()\n await mw.autoConnect({ client: getClient(), chain: getPublishThirdwebChain(config) })\n const ma = mw.getAccount()\n if (!ma) {\n return\n }\n await ensureExecutorModuleInstalled(managedAddress, ma, config)\n } catch {\n /* managed wallet session may lag modular connect; publish prep retries module install */\n }\n return\n }\n\n try {\n await ensureExecutorModuleInstalled(modularAccount.address, modularAccount, config)\n } catch (err) {\n reportWalletSetupWarning(err)\n }\n}\n\nconst ConnectButton: FC = () => {\n const config = usePublishConfig()\n const thirdwebChain = getPublishThirdwebChain(config)\n const wallet = useActiveWallet()\n const activeAccount = useActiveAccount()\n const connectionStatus = useActiveWalletConnectionStatus()\n const isAutoConnecting = useIsAutoConnecting()\n /** Avoid duplicate setAddresses when onConnect and the reconcile effect both run. */\n const lastSyncedOwnedKey = useRef<string | null>(null)\n const prevIsAutoConnecting = useRef(false)\n const reloadAutoConnectRetried = useRef(false)\n\n /**\n * Thirdweb sometimes finishes autoConnect on full reload with `disconnected` and no wallet\n * (see debug: isAutoConnecting true→false then disconnected). One explicit in-app autoConnect\n * retry recovers without affecting users who chose Disconnect (sessionStorage gate).\n */\n useEffect(() => {\n if (typeof window === \"undefined\") return\n const prev = prevIsAutoConnecting.current\n prevIsAutoConnecting.current = isAutoConnecting\n\n let navType: string | undefined\n try {\n navType = (\n performance.getEntriesByType(\"navigation\")[0] as\n | PerformanceNavigationTiming\n | undefined\n )?.type\n } catch {\n navType = undefined\n }\n if (navType !== \"reload\") return\n\n let userChoseDisconnect = false\n try {\n userChoseDisconnect =\n sessionStorage.getItem(USER_DISCONNECTED_SESSION_KEY) === \"1\"\n } catch {\n userChoseDisconnect = false\n }\n if (userChoseDisconnect) return\n\n if (!prev || isAutoConnecting || connectionStatus !== \"disconnected\") return\n if (reloadAutoConnectRetried.current) return\n reloadAutoConnectRetried.current = true\n\n void (config.useModularExecutor ? getModularAccountWallet() : getManagedAccountWallet())\n .autoConnect({ client: getClient(), chain: thirdwebChain })\n .catch(() => {\n /* no session or iframe not ready; Connect UI can still sign in */\n })\n }, [connectionStatus, isAutoConnecting, config.useModularExecutor, thirdwebChain])\n\n const syncActiveWalletToSeed = useCallback(\n async (activeWallet: Wallet) => {\n const account = activeWallet.getAccount()\n if (!account) {\n return\n }\n await waitUntilSeedInitialized()\n const owned = new Set<string>([account.address.toLowerCase()])\n let managedAddress: string | undefined\n if (config.useModularExecutor) {\n syncPublishInAppAuthToken()\n const adminAddress =\n activeWallet.getAdminAccount?.()?.address ?? account.address\n const tryManaged = async () => {\n try {\n return await getConnectedManagedAccountAddress(thirdwebChain)\n } catch {\n try {\n return await getSmartWalletAddressForAdmin(adminAddress)\n } catch {\n return undefined\n }\n }\n }\n managedAddress = await tryManaged()\n if (!managedAddress) {\n await new Promise<void>((r) => queueMicrotask(() => r()))\n managedAddress = await tryManaged()\n }\n if (managedAddress) {\n owned.add(managedAddress.toLowerCase())\n }\n }\n const ownedKey = [...owned].sort().join(\",\")\n if (lastSyncedOwnedKey.current === ownedKey) {\n return\n }\n // Another wallet took over: publishes started for the previous one stop (their rows stay\n // for it to resume). Not on the first sync, where publishes restored from the DB need this\n // wallet, nor on a re-sync of the same wallet.\n if (lastSyncedOwnedKey.current !== null) {\n PublishManager.stopAll()\n }\n lastSyncedOwnedKey.current = ownedKey\n try {\n const adminAddress = activeWallet.getAdminAccount?.()?.address\n // A wallet with a separate admin account, or the modular executor's ManagedAccount, is a\n // smart account; otherwise the connected account is a plain key (in-app or injected).\n const isSmart =\n !!managedAddress ||\n (!!adminAddress && adminAddress.toLowerCase() !== account.address.toLowerCase())\n const publishWallet = fromThirdwebAccount(account, { kind: isSmart ? \"smart\" : \"eoa\" })\n // Data items need an ECDSA signer. With the modular executor the connected account is an\n // EOA (or EIP-7702 on one) acting for the ManagedAccount; otherwise a smart wallet's admin\n // EOA signs them.\n const adminAccount = activeWallet.getAdminAccount?.()\n const dataItemSigner = managedAddress\n ? publishWallet.signer\n : isSmart && adminAccount && adminAccount.address.toLowerCase() !== account.address.toLowerCase()\n ? fromThirdwebAccount(adminAccount, { kind: \"eoa\" }).signer\n : undefined\n await setPublishWallet({\n ...publishWallet,\n ownedAddresses: [...owned],\n publisherAddress: managedAddress ?? account.address,\n ...(dataItemSigner ? { dataItemSigner } : {}),\n // A new user's smart wallet has no code until its first transaction: publish deploys it.\n ...(isSmart && !managedAddress\n ? { deploy: async () => { await deploySmartWalletContract(account) } }\n : {}),\n ...(adminAddress && adminAddress.toLowerCase() !== account.address.toLowerCase()\n ? { adminAddress }\n : {}),\n })\n } catch (err) {\n lastSyncedOwnedKey.current = null\n console.warn(\"[ConnectButton] Failed to set seed client addresses:\", err)\n throw err\n }\n await ensureExecutorModulesForConnect(account, managedAddress, config)\n },\n [config],\n )\n\n /**\n * Thirdweb autoConnect restores the wallet without calling onConnect. Seed addresses live in\n * SQLite (OPFS); after a wipe there is no app_state row until setAddresses runs again.\n */\n useEffect(() => {\n if (isAutoConnecting) {\n return\n }\n if (connectionStatus !== \"connected\") {\n lastSyncedOwnedKey.current = null\n return\n }\n if (!wallet) {\n return\n }\n let cancelled = false\n void (async () => {\n try {\n if (cancelled) return\n await syncActiveWalletToSeed(wallet)\n } catch {\n /* logged in syncActiveWalletToSeed */\n }\n })()\n return () => {\n cancelled = true\n }\n }, [\n wallet,\n activeAccount?.address,\n connectionStatus,\n isAutoConnecting,\n syncActiveWalletToSeed,\n ])\n\n const handleDisconnect = () => {\n try {\n sessionStorage.setItem(USER_DISCONNECTED_SESSION_KEY, \"1\")\n } catch {\n /* private mode / SSR */\n }\n void clearPublishWallet()\n PublishManager.stopAll()\n }\n\n const handleConnect = async (activeWallet: Wallet, _allConnectedWallets: Wallet[]) => {\n const account = activeWallet.getAccount()\n if (!account) return\n try {\n sessionStorage.removeItem(USER_DISCONNECTED_SESSION_KEY)\n } catch {\n /* ignore */\n }\n console.log('[ConnectButton] Connected', account.address)\n try {\n await syncActiveWalletToSeed(activeWallet)\n } catch {\n /* syncActiveWalletToSeed logs */\n }\n }\n\n return (\n <ConnectButtonThirdweb\n client={getClient()}\n wallets={getWalletsForConnectButton(config)}\n autoConnect={true}\n chain={thirdwebChain}\n chains={[ thirdwebChain, ]}\n onConnect={handleConnect}\n onDisconnect={handleDisconnect}\n theme={darkTheme({\n colors: {\n primaryButtonBg: '#1D2939',\n primaryButtonText: '#FFFFFF',\n secondaryButtonHoverBg: '#1D2939',\n connectedButtonBg: '#101828',\n connectedButtonBgHover: '#1D2939',\n borderColor: '#344054',\n },\n })}\n />\n )\n}\n\nexport default ConnectButton\n","import React, { FC, useRef } from \"react\"\nimport { ThirdwebProvider } from \"thirdweb/react\"\nimport { SeedProvider } from '@seedprotocol/react'\nimport { initPublish, getConfigRef, type PublishConfig } from \"../config\"\nimport { PublishConfigContext, usePublishConfig } from \"./PublishConfigContext\"\nimport type { PublishProviderProps } from \"./PublishProvider\"\n\nexport { usePublishConfig }\nexport type { PublishProviderProps }\n\n/**\n * Thirdweb-backed PublishProvider (includes ThirdwebProvider).\n */\nconst PublishProviderThirdweb: FC<PublishProviderProps> = ({\n children,\n config,\n queryClient,\n queryClientRef,\n}) => {\n // During render, not in an effect: children such as ConnectButton read the config on their\n // first render, which runs before this provider's effects. Once per config object.\n const initializedConfig = useRef<PublishConfig | undefined>(undefined)\n if (config && initializedConfig.current !== config) {\n initPublish(config)\n initializedConfig.current = config\n }\n\n return (\n <PublishConfigContext.Provider value={config ?? getConfigRef()}>\n <ThirdwebProvider>\n <SeedProvider queryClient={queryClient} queryClientRef={queryClientRef}>\n {children}\n </SeedProvider>\n </ThirdwebProvider>\n </PublishConfigContext.Provider>\n )\n}\n\nexport default PublishProviderThirdweb\n","import { deploySmartAccount, getContract } from 'thirdweb'\nimport { getPublishConfig } from '../config'\nimport { Eip7702ModularAccountPublishError } from '../errors'\nimport { isContractDeployed, pollSmartWalletDeployed } from './chainClient'\nimport { getClient, getModularAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nconst MSG_NO_ACCOUNT =\n 'Modular (EIP-7702) wallet is not connected. Sign in with the same method and try again.'\nconst MSG_NOT_UPGRADED = () =>\n `Your modular account is not upgraded to an EIP-7702 smart account on ${getPublishChainName()} yet. Enable autoDeployEip7702ModularAccount in publish config or complete wallet setup, then retry.`\nconst MSG_DEPLOY_FAILED = () =>\n `Automatic EIP-7702 smart account setup failed on ${getPublishChainName()}. Retry or reconnect your wallet.`\nconst MSG_NOT_CONFIRMED =\n 'EIP-7702 upgrade was sent but on-chain bytecode was not detected yet. Wait a moment and retry.'\n\nconst DEPLOY_POLL_ATTEMPTS = 5\n\n/**\n * Ensures the Thirdweb in-app modular wallet (EIP-7702) has non-empty bytecode at its address\n * on the publish chain. deploySmartAccount remains Thirdweb; bytecode checks use viem.\n */\nexport async function ensureEip7702ModularAccountReady(): Promise<void> {\n const { autoDeployEip7702ModularAccount } = getPublishConfig()\n const modularAccountWallet = getModularAccountWallet()\n await modularAccountWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const modularAccount = modularAccountWallet.getAccount()\n if (!modularAccount) {\n throw new Eip7702ModularAccountPublishError(MSG_NO_ACCOUNT, 'EIP7702_MODULAR_ACCOUNT_UNAVAILABLE')\n }\n\n const client = getClient()\n const accountContract = getContract({\n client,\n chain: getPublishThirdwebChain(),\n address: modularAccount.address,\n })\n\n if (await isContractDeployed(modularAccount.address)) {\n return\n }\n\n if (!autoDeployEip7702ModularAccount) {\n throw new Eip7702ModularAccountPublishError(\n MSG_NOT_UPGRADED(),\n 'EIP7702_MODULAR_NOT_UPGRADED',\n modularAccount.address,\n )\n }\n\n try {\n await deploySmartAccount({\n smartAccount: modularAccount,\n chain: getPublishThirdwebChain(),\n client,\n accountContract,\n })\n } catch (cause) {\n if (await pollSmartWalletDeployed(modularAccount.address, DEPLOY_POLL_ATTEMPTS)) {\n return\n }\n throw new Eip7702ModularAccountPublishError(\n MSG_DEPLOY_FAILED(),\n 'EIP7702_MODULAR_DEPLOY_FAILED',\n modularAccount.address,\n cause,\n )\n }\n\n if (!(await pollSmartWalletDeployed(modularAccount.address, DEPLOY_POLL_ATTEMPTS))) {\n throw new Eip7702ModularAccountPublishError(\n MSG_NOT_CONFIRMED,\n 'EIP7702_MODULAR_NOT_CONFIRMED',\n modularAccount.address,\n )\n }\n}\n","import { approvedTargetsForAutomationPublish } from './approvedTargetsForAutomationPublish'\n\n/**\n * Allowlisted call targets for a modular session signer: only the Seed executor module.\n *\n * Never the ManagedAccount (a key could then make any self-call, which the account trusts) and\n * never EAS (a direct EAS target bypasses the Seed extension's forced revocability).\n *\n * @deprecated Interactive publishing is a UserOp from the ManagedAccount itself and needs no\n * session key; automation keys use {@link approvedTargetsForAutomationPublish}, which this now\n * returns. `managedAddress` is ignored.\n * @throws if `modularAccountModuleContract` is unset or invalid\n */\nexport function defaultApprovedTargetsForModularPublish(_managedAddress?: string): `0x${string}`[] {\n return approvedTargetsForAutomationPublish()\n}\n","import { getContract, sendTransaction } from 'thirdweb'\nimport { addSessionKey, shouldUpdateSessionKey } from 'thirdweb/extensions/erc4337'\nimport type { Address } from 'viem'\nimport { ManagedAccountPublishError } from '../errors'\nimport { waitForPublishReceipt } from './chainClient'\nimport { readIsActiveSigner } from './contracts'\nimport { defaultApprovedTargetsForModularPublish } from './defaultApprovedTargetsForModularPublish'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nconst MSG_UNAVAILABLE = () =>\n `Could not connect the managed publishing account to authorize the modular signer on ${getPublishChainName()}. Reconnect and try again.`\nconst MSG_ACTIVATION_FAILED = () =>\n `Could not authorize the modular wallet as a session signer on your publishing account on ${getPublishChainName()}.`\n\n/**\n * Ensures the modular (EIP-7702) wallet is an active session signer on the ManagedAccount.\n * If permissions are missing or stale, sends `addSessionKey` signed by the managed EIP-4337 wallet.\n * Session-key AA extensions remain on Thirdweb; verification uses viem.\n *\n * The key may call only the Seed executor module ({@link defaultApprovedTargetsForModularPublish}).\n *\n * @deprecated Interactive publishing is a UserOp from the ManagedAccount itself and needs no\n * session key. For server-held keys use `enrollPublishAutomation`.\n */\nexport async function ensureManagedSignerSessionKey(params: {\n managedAddress: string\n signerAddress: string\n}): Promise<void> {\n const { managedAddress, signerAddress } = params\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n MSG_UNAVAILABLE(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n\n const accountContract = getContract({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n address: managedAddress,\n })\n const permissions = {\n approvedTargets: defaultApprovedTargetsForModularPublish(managedAddress),\n nativeTokenLimitPerTransaction: 0,\n }\n\n let shouldUpdate = false\n try {\n shouldUpdate = await shouldUpdateSessionKey({\n accountContract,\n sessionKeyAddress: signerAddress,\n newPermissions: permissions,\n })\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n\n if (shouldUpdate) {\n try {\n const tx = addSessionKey({\n contract: accountContract,\n account: managedAccount,\n sessionKeyAddress: signerAddress,\n permissions,\n })\n const result = await sendTransaction({ account: managedAccount, transaction: tx })\n await waitForPublishReceipt(result.transactionHash as `0x${string}`)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n }\n\n let active = false\n try {\n active = await readIsActiveSigner(managedAddress as Address, signerAddress as Address)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n\n if (!active) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n}\n","import type { Account } from 'thirdweb/wallets'\nimport type { PublishWallet } from './seedSigner'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { ensureExecutorModuleInstalled, type EnsureExecutorModuleResult } from './ensureExecutorModule'\nimport { assertExecutorModuleReadyForAccount } from './executorModuleReadiness'\nimport {\n ensureAutomationSessionKey,\n removeAutomationSessionKey,\n} from './ensureAutomationSessionKey'\nimport {\n attestPublishAuthorization,\n revokePublishAuthorization,\n type AttestPublishAuthorizationResult,\n} from '../services/publishAuthorization'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\nexport type EnrollPublishAutomationParams = {\n managedAddress: string\n sessionKeyAddress: string\n /** Optional app label stored in the sidecar (defaults to zero address). */\n appAddress?: string\n /** Unix seconds session / grant end (optional). */\n expiresAt?: number\n /**\n * User-controlled ManagedAccount wallet used to add the session key and attest the sidecar.\n * When omitted, uses the connected managed in-app wallet.\n */\n userWallet?: PublishWallet\n}\n\nexport type EnrollPublishAutomationResult = {\n managedAddress: string\n sessionKeyAddress: string\n authorization: AttestPublishAuthorizationResult\n}\n\nexport type RevokePublishAutomationParams = {\n managedAddress: string\n sessionKeyAddress: string\n authorizationUid: string\n userWallet?: PublishWallet\n}\n\nasync function connectManagedAccount(managedAddress: string): Promise<Account> {\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const account = managedWallet.getAccount()\n if (!account) {\n throw new ManagedAccountPublishError(\n 'Could not connect the managed publishing account to enroll or revoke publish automation.',\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n return account\n}\n\nasync function resolveUserWallet(\n managedAddress: string,\n userWallet?: PublishWallet,\n): Promise<PublishWallet> {\n if (userWallet) return userWallet\n return fromThirdwebAccount(await connectManagedAccount(managedAddress), { kind: 'smart' })\n}\n\nasync function assertExecutorModuleInstalled(managedAddress: string): Promise<void> {\n const config = getPublishConfig()\n const moduleAddr = config.modularAccountModuleContract?.trim()\n if (!moduleAddr) {\n throw new Error(\n '@seedprotocol/publish: enrollPublishAutomation requires PublishConfig.modularAccountModuleContract',\n )\n }\n\n const twAccount = await connectManagedAccount(managedAddress)\n let install: EnsureExecutorModuleResult\n try {\n install = await ensureExecutorModuleInstalled(managedAddress, twAccount, config)\n } catch (cause) {\n if (cause instanceof ManagedAccountPublishError) throw cause\n throw new ManagedAccountPublishError(\n 'Executor module setup failed for publish automation.',\n 'EXECUTOR_MODULE_NOT_INSTALLED',\n managedAddress,\n cause,\n )\n }\n\n // The session key may only call the module, so refuse to enroll unless the module can act\n // for this account. Otherwise every automation publish would revert. A fresh install is\n // confirmed from its receipt; otherwise the read may still trail an install that just landed.\n await assertExecutorModuleReadyForAccount(\n managedAddress,\n install.status === 'installed'\n ? { installedEas: install.eas }\n : { readAttempts: install.status === 'already-installed' ? 5 : 1 },\n )\n}\n\n/**\n * Enroll an app automation key: install the Seed executor (`installSeedExecutor` on Router\n * accounts with the executor router extension), add an executor-only session key, then attest\n * the PublishAuthorization sidecar (ManagedAccount attester).\n *\n * @throws ManagedAccountPublishError `AUTOMATION_UNSUPPORTED_ACCOUNT` before adding the session\n * key when the executor cannot act for the account (e.g. Router accounts without the extension)\n */\nexport async function enrollPublishAutomation(\n params: EnrollPublishAutomationParams,\n): Promise<EnrollPublishAutomationResult> {\n const { managedAddress, sessionKeyAddress, appAddress, expiresAt } = params\n\n await assertExecutorModuleInstalled(managedAddress)\n await ensureAutomationSessionKey({\n managedAddress,\n sessionKeyAddress,\n expiresAt,\n })\n\n const userWallet = await resolveUserWallet(managedAddress, params.userWallet)\n const authorization = await attestPublishAuthorization({\n wallet: userWallet,\n identity: managedAddress,\n sessionKey: sessionKeyAddress,\n app: appAddress,\n expiresAt,\n })\n\n return {\n managedAddress,\n sessionKeyAddress,\n authorization,\n }\n}\n\n/**\n * Disconnect automation: remove session key, then revoke PublishAuthorization sidecar.\n */\nexport async function revokePublishAutomation(\n params: RevokePublishAutomationParams,\n): Promise<void> {\n const { managedAddress, sessionKeyAddress, authorizationUid } = params\n const userWallet = await resolveUserWallet(managedAddress, params.userWallet)\n\n await removeAutomationSessionKey({\n managedAddress,\n sessionKeyAddress,\n })\n\n await revokePublishAuthorization({\n wallet: userWallet,\n uid: authorizationUid,\n })\n}\n","import {\n assessPublishAuthorization,\n decodePublishAuthorizationData,\n getPublishAuthorizationFromEas,\n} from '@seedprotocol/eas'\nimport { isAutomationSessionActive } from './ensureAutomationSessionKey'\n\nexport type AssertStorageBoundToIdentityParams = {\n managedAddress: string\n /** Recovered ANS-104 DataItem owner (Ethereum address). */\n dataItemOwner: string\n /**\n * Unix seconds for historical binding checks against PublishAuthorization expiry.\n * Defaults to now. Session-key live check always uses current `isActiveSigner`.\n */\n atTime?: number\n /**\n * When true (default), accept a live active session key on the ManagedAccount.\n */\n allowActiveSessionKey?: boolean\n /**\n * When true (default), accept a non-revoked PublishAuthorization sidecar valid at `atTime`.\n */\n allowSidecar?: boolean\n}\n\nexport type AssertStorageBoundToIdentityResult = {\n bound: boolean\n via: 'active_session_key' | 'publish_authorization' | null\n warnings: string[]\n}\n\n/**\n * Whether an Arweave DataItem owner is bound to a ManagedAccount identity for authorship.\n * Prefer live `isActiveSigner` for current publishes; use the PublishAuthorization sidecar\n * for discoverability / historical grants (revoking the session key stops new binds via\n * active check; sidecar validity is assessed at `atTime`).\n */\nexport async function assertStorageBoundToIdentity(\n params: AssertStorageBoundToIdentityParams,\n): Promise<AssertStorageBoundToIdentityResult> {\n const {\n managedAddress,\n dataItemOwner,\n atTime,\n allowActiveSessionKey = true,\n allowSidecar = true,\n } = params\n const warnings: string[] = []\n const owner = dataItemOwner.trim().toLowerCase()\n const identity = managedAddress.trim().toLowerCase()\n\n if (!/^0x[0-9a-fA-F]{40}$/.test(owner) || !/^0x[0-9a-fA-F]{40}$/.test(identity)) {\n return { bound: false, via: null, warnings: ['Invalid managedAddress or dataItemOwner'] }\n }\n\n if (allowActiveSessionKey) {\n try {\n const active = await isAutomationSessionActive(managedAddress, dataItemOwner)\n if (active) {\n return { bound: true, via: 'active_session_key', warnings }\n }\n } catch (e) {\n warnings.push(\n e instanceof Error ? e.message : 'isActiveSigner check failed',\n )\n }\n }\n\n if (allowSidecar) {\n try {\n const rows = await getPublishAuthorizationFromEas({\n identities: [managedAddress],\n sessionKeys: [dataItemOwner],\n excludeRevoked: true,\n })\n const nowMs = atTime != null ? atTime * 1000 : Date.now()\n for (const row of rows) {\n try {\n const decoded = decodePublishAuthorizationData(row.decodedDataJson ?? '[]')\n if (decoded.identity.toLowerCase() !== identity) continue\n if (decoded.sessionKey.toLowerCase() !== owner) continue\n const expirationTime =\n typeof row.expirationTime === 'number' ? row.expirationTime : null\n const assess = assessPublishAuthorization({\n decoded,\n expirationTime,\n now: nowMs,\n })\n if (assess.status === 'valid') {\n return {\n bound: true,\n via: 'publish_authorization',\n warnings: [...warnings, ...assess.warnings],\n }\n }\n warnings.push(...assess.warnings)\n } catch {\n // skip undecodable row\n }\n }\n } catch (e) {\n warnings.push(\n e instanceof Error ? e.message : 'PublishAuthorization query failed',\n )\n }\n }\n\n return { bound: false, via: null, warnings }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,IAAM8D,IAAgC;AAEtC,SAASC,GAAyB,GAAc;CAG9C,AADA,QAAQ,KAAK,0DAA0DC,CAAG,GAC1EpC,EAAiB,CAAC,CAAC,uBAAuBoC,CAAG;AAC/C;AAGA,SAASC,KAA0C;CAEjD,OADIjE,EAAW,cAAc,IAAU,QAAQ,QAAQ,IAChD,IAAI,SAAS,MAAY;EAC9B,EAAW,cAAcmE,EAAQ,CAAC;CACpC,CAAC;AACH;AAOA,eAAeC,GACb,GACA,GACA,GACe;CACf,IAAKC,EAAO,8BAIZ;MAAIA,EAAO,oBAAoB;GAC7B,IAAI,CAACC,GACH;GAEF,IAAI;IACF,EAA0B;IAC1B,IAAMC,IAAKjD,EAAwB;IACnC,MAAMiD,EAAG,YAAY;KAAE,QAAQtC,EAAU;KAAG,OAAON,EAAwB0C,CAAM;IAAE,CAAC;IACpF,IAAMG,IAAKD,EAAG,WAAW;IACzB,IAAI,CAACC,GACH;IAEF,MAAMzD,EAA8BuD,GAAgBE,GAAIH,CAAM;GAChE,QAAQ,CAER;EAEF,OAEA,IAAI;GACF,MAAMtD,EAA8B0D,EAAe,SAASA,GAAgBJ,CAAM;EACpF,SAASL,GAAK;GACZ,GAAyBA,CAAG;EAC9B;CANA;AAOF;AAEA,IAAMU,WAA0B;CAC9B,IAAML,IAASnB,EAAiB,GAC1ByB,IAAgBhD,EAAwB0C,CAAM,GAC9CO,IAASC,GAAgB,GACzBC,IAAgBC,GAAiB,GACjCC,IAAmBC,GAAgC,GACnDC,IAAmBC,GAAoB,GAEvCC,IAAqBC,EAAsB,IAAI,GAC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AAGd,GAAU,GAAGc,EAAO,QAAQ;GAC5C;GAEF,EAAS,KAAK,GAAGA,EAAO,QAAQ;EAClC,QAAQ,CAER;CAEJ,SAAS,GAAG;EACV,EAAS,KACP,aAAa,QAAQ,EAAE,UAAU,mCACnC;CACF;CAGF,OAAO;EAAE,OAAO;EAAO,KAAK;EAAM;CAAS;AAC7C"}
package/dist/types.d.ts CHANGED
@@ -5,9 +5,6 @@ export type PublishMode = 'patch' | 'new_version';
5
5
  export type HtmlEmbeddedDataUriPolicy = import('@seedprotocol/sdk').HtmlEmbeddedDataUriPolicy;
6
6
  import type { SeedSigner, PublishWallet } from './helpers/seedSigner';
7
7
  import type { ethers } from 'ethers';
8
- export type ReimbursementResponse = {
9
- transactionId: string;
10
- };
11
8
  /** Upload data for a single publish property (storage seed). */
12
9
  export type PublishUpload = {
13
10
  itemPropertyName: string;
@@ -45,23 +42,10 @@ export interface PublishMachineContext {
45
42
  existingSeedUid?: string;
46
43
  arweaveTransactions?: ArweaveTransactionInfo[];
47
44
  publishUploads?: unknown[];
48
- reimbursementTransactionId?: string;
49
- reimbursementConfirmed?: boolean;
50
- transactionKeys?: string;
51
- requestResponse?: unknown;
52
45
  completionPercentage?: number;
53
- /** Serialized uploader state for resume (from uploader.toJSON()). */
54
- uploaderState?: {
55
- chunkIndex: number;
56
- transaction: unknown;
57
- txPosted: boolean;
58
- [key: string]: unknown;
59
- };
60
- /** Index of current transaction being uploaded when resuming. */
61
- currentTransactionIndex?: number;
62
46
  /** Set when machine transitions to failure (from onError or uploadError). */
63
47
  error?: unknown;
64
- /** Which state failed (e.g. creatingArweaveTransactions, sendingReimbursementRequest). */
48
+ /** Which state failed (e.g. creatingArweaveDataItems, uploadingViaBundler). */
65
49
  errorStep?: string;
66
50
  /** Raw EAS attestation payload from getPublishPayload, stored for later retrieval. */
67
51
  easPayload?: unknown;
@@ -81,22 +65,12 @@ export interface PublishMachineContext {
81
65
  */
82
66
  bundlerUploadNotNeeded?: boolean;
83
67
  /**
84
- * Per-publish: sign DataItems when useArweaveBundler (from createPublish options).
68
+ * Per-publish: sign DataItems (from createPublish options).
85
69
  * Each upload has `tags` (content + arweaveUploadTags); use when building DataItems.
86
70
  */
87
71
  signDataItems?: (uploads: import('./services/publish/helpers/getPublishUploadData').PublishUploadData[]) => Promise<import('./config').ArweaveDataItemInfoResult[]>;
88
- /** Per-publish: signer for DataItems when useArweaveBundler (from createPublish options). */
72
+ /** Per-publish: signer for DataItems (from createPublish options). */
89
73
  dataItemSigner?: ethers.Wallet | SeedSigner | PublishWallet;
90
- /** Per-publish: sign Arweave transactions when NOT useArweaveBundler (from createPublish options). */
91
- signArweaveTransactions?: (uploads: import('./config').SerializedPublishUpload[]) => Promise<import('./config').ArweaveTransactionInfoResult[]>;
92
- /** Per-publish: JWK for in-process signing when NOT useArweaveBundler (from createPublish options). */
93
- arweaveJwk?: {
94
- kty: string;
95
- n: string;
96
- e: string;
97
- d?: string;
98
- [key: string]: unknown;
99
- };
100
74
  /**
101
75
  * Resolved Arweave tags for this run: initPublish defaults then createPublish extras.
102
76
  * Appended after Content-SHA-256 / Content-Type on each upload.
@@ -115,7 +89,7 @@ export interface PublishMachineContext {
115
89
  * Per-property `htmlEmbeddedDataUriPolicy` on the schema overrides this. Default: `materialize`.
116
90
  */
117
91
  htmlEmbeddedDataUriPolicy?: HtmlEmbeddedDataUriPolicy;
118
- /** Set during publish after embedded-image prep (non-bundler two-phase L1). */
92
+ /** Set during publish after embedded-image prep: Html seeds uploaded in a second pass. */
119
93
  htmlEmbeddedDeferredHtmlSeedLocalIds?: string[];
120
94
  htmlEmbeddedPhase1PublishUploads?: PublishUpload[];
121
95
  htmlEmbeddedPhase1ArweaveTransactions?: ArweaveTransactionInfo[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAE9D,qDAAq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B,EAAE,oBAAoB,CAAA;IACrE,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,wBAAwB,EAAE,oBAAoB,GAAG,IAAI,CAAA;IAC7E,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB"}
@@ -0,0 +1,78 @@
1
+ import { a as e, nn as t } from "./chainConfig-D801ynuH.js";
2
+ import { BaseDb as n, arweaveL1FinalizeJobs as r, getArweaveUploadStatus as i, isArweaveL1AnchoringComplete as a, queryArweaveGatewayTransactionWithFallback as o } from "@seedprotocol/sdk";
3
+ import s from "debug";
4
+ import { eq as c } from "drizzle-orm";
5
+ //#region src/services/arweaveL1Finalize/worker.ts
6
+ var l = s("seedProtocol:arweaveL1Finalize:worker"), u = 45e3, d = null;
7
+ function f() {
8
+ d ?? (d = setInterval(() => {
9
+ m();
10
+ }, u), m());
11
+ }
12
+ function p() {
13
+ d != null && (clearInterval(d), d = null);
14
+ }
15
+ async function m() {
16
+ let s;
17
+ try {
18
+ s = e();
19
+ } catch {
20
+ return;
21
+ }
22
+ if (!n.isAppDbReady()) return;
23
+ let u = n.getAppDb();
24
+ if (!u) return;
25
+ let d = await u.select().from(r).where(c(r.phase, "pending_l1")).limit(25);
26
+ if (d.length === 0) return;
27
+ let f = s.arweaveUploadVerificationBaseUrl, p = s.arweaveGraphqlUrl, m = t(s).storage.uploadTo === "turbo";
28
+ for (let e of d) {
29
+ let t = e.dataItemId;
30
+ try {
31
+ let n = e.l1TransactionId;
32
+ if (m) {
33
+ let i = await o(p, t), a = i?.bundledInId ?? n ?? null;
34
+ a && i?.blockHeight != null && await u.update(r).set({
35
+ phase: "confirmed",
36
+ statusJson: JSON.stringify(i),
37
+ l1TransactionId: a,
38
+ bundleId: a,
39
+ updatedAt: Date.now()
40
+ }).where(c(r.id, e.id));
41
+ continue;
42
+ }
43
+ if (!n) {
44
+ let i = (await o(p, t))?.bundledInId ?? null;
45
+ i && (n = i, await u.update(r).set({
46
+ l1TransactionId: i,
47
+ bundleId: i,
48
+ updatedAt: Date.now()
49
+ }).where(c(r.id, e.id)));
50
+ }
51
+ let s = await i(f, t), l = s ? JSON.stringify(s) : null;
52
+ if (s && a(s)) {
53
+ let t = n ?? s.bundleId ?? s.turbo?.bundleId ?? e.l1TransactionId ?? null;
54
+ await u.update(r).set({
55
+ phase: "confirmed",
56
+ statusJson: l,
57
+ l1TransactionId: t ?? e.l1TransactionId,
58
+ bundleId: s.bundleId ?? e.bundleId,
59
+ updatedAt: Date.now()
60
+ }).where(c(r.id, e.id));
61
+ continue;
62
+ }
63
+ await u.update(r).set({
64
+ statusJson: l,
65
+ updatedAt: Date.now()
66
+ }).where(c(r.id, e.id));
67
+ } catch (t) {
68
+ l("tick error for job", e.id, t), await u.update(r).set({
69
+ errorMessage: t instanceof Error ? t.message : String(t),
70
+ updatedAt: Date.now()
71
+ }).where(c(r.id, e.id));
72
+ }
73
+ }
74
+ }
75
+ //#endregion
76
+ export { f as startArweaveL1FinalizeWorker, p as stopArweaveL1FinalizeWorker };
77
+
78
+ //# sourceMappingURL=worker-DaG8XHbB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-DaG8XHbB.js","names":["getPublishConfig","resolvePublishPayment","debug","logger","TICK_MS","intervalId","startArweaveL1FinalizeWorker","runArweaveL1FinalizeTick","stopArweaveL1FinalizeWorker","config","BaseDb","db","pending","arweaveL1FinalizeJobs","eq","uploadBase","graphqlUrl","uploadedToTurbo","job","dataItemId","l1TxId","gql","queryArweaveGatewayTransactionWithFallback","bundled","status","getArweaveUploadStatus","statusStr","isArweaveL1AnchoringComplete","resolvedL1","err"],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport { resolvePublishPayment } from '~/payment'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\n\n/**\n * Tracks bundler uploads until their bundle is anchored on Arweave L1, recording the L1 / bundle id\n * in `arweave_l1_finalize_jobs`. Local metadata keeps the data item id, which is what was attested\n * and what gateways serve the item under.\n */\nconst TICK_MS = 45_000\n\nlet intervalId: ReturnType<typeof setInterval> | null = null\n\nexport function startArweaveL1FinalizeWorker(): void {\n if (intervalId != null) return\n intervalId = setInterval(() => {\n void runArweaveL1FinalizeTick()\n }, TICK_MS)\n void runArweaveL1FinalizeTick()\n}\n\nexport function stopArweaveL1FinalizeWorker(): void {\n if (intervalId != null) {\n clearInterval(intervalId)\n intervalId = null\n }\n}\n\nasync function runArweaveL1FinalizeTick(): Promise<void> {\n let config: ReturnType<typeof getPublishConfig>\n try {\n config = getPublishConfig()\n } catch {\n return\n }\n\n // initPublish may start this worker before Seed platformClassesInit configures BaseDb.\n if (!BaseDb.isAppDbReady()) return\n const db = BaseDb.getAppDb()\n if (!db) return\n\n const pending = await db\n .select()\n .from(arweaveL1FinalizeJobs)\n .where(eq(arweaveL1FinalizeJobs.phase, 'pending_l1'))\n .limit(25)\n\n if (pending.length === 0) return\n\n const uploadBase = config.arweaveUploadVerificationBaseUrl\n const graphqlUrl = config.arweaveGraphqlUrl\n // User-paid uploads went to Turbo; the upload API doesn't know them, so finish from GraphQL.\n const uploadedToTurbo = resolvePublishPayment(config).storage.uploadTo === 'turbo'\n\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\n\n if (uploadedToTurbo) {\n const gql = await queryArweaveGatewayTransactionWithFallback(graphqlUrl, dataItemId)\n const bundled = gql?.bundledInId ?? l1TxId ?? null\n if (bundled && gql?.blockHeight != null) {\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n phase: 'confirmed',\n statusJson: JSON.stringify(gql),\n l1TransactionId: bundled,\n bundleId: bundled,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n continue\n }\n\n if (!l1TxId) {\n const gql = await queryArweaveGatewayTransactionWithFallback(graphqlUrl, dataItemId)\n const bundled = gql?.bundledInId ?? null\n if (bundled) {\n l1TxId = bundled\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n l1TransactionId: bundled,\n bundleId: bundled,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n\n const status = await getArweaveUploadStatus(uploadBase, dataItemId)\n const statusStr = status ? JSON.stringify(status) : null\n\n if (status && isArweaveL1AnchoringComplete(status)) {\n const resolvedL1 =\n l1TxId ??\n status.bundleId ??\n status.turbo?.bundleId ??\n job.l1TransactionId ??\n null\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n phase: 'confirmed',\n statusJson: statusStr,\n l1TransactionId: resolvedL1 ?? job.l1TransactionId,\n bundleId: status.bundleId ?? job.bundleId,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n continue\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n statusJson: statusStr,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n } catch (err) {\n logger('tick error for job', job.id, err)\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n errorMessage: err instanceof Error ? err.message : String(err),\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n}\n"],"mappings":";;;;;AAYA,IAAMG,IAASD,EAAM,uCAAuC,GAOtDE,IAAU,MAEZC,IAAoD;AAExD,SAAgBC,IAAqC;CACnD,AAAID,MACJ,IAAa,kBAAkB;EAC7B,EAA8B;CAChC,GAAGD,CAAO,GACVG,EAA8B;AAChC;AAEA,SAAgBC,IAAoC;CAClD,AAAIH,KAAc,SAChB,cAAcA,CAAU,GACxB,IAAa;AAEjB;AAEA,eAAeE,IAA0C;CACvD,IAAIE;CACJ,IAAI;EACF,IAAST,E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K,UAAUA,CAAM,IAAI;GAEpD,IAAIA,KAAUG,EAA6BH,CAAM,GAAG;IAClD,IAAMI,IACJR,KACAI,EAAO,YACPA,EAAO,OAAO,YACdN,EAAI,mBACJ;IAEF,MAAMP,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;KACH,OAAO;KACP,YAAYa;KACZ,iBAAiBE,KAAcV,EAAI;KACnC,UAAUM,EAAO,YAAYN,EAAI;KACjC,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAMJ,EAAGD,EAAsB,IAAIK,EAAI,EAAG,CAAC;IAC9C;GACF;GAEA,MAAMP,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;IACH,YAAYa;IACZ,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAMZ,EAAGD,EAAsB,IAAIK,EAAI,EAAG,CAAC;EAChD,SAASW,GAAK;GAEZ,AADA1B,EAAO,sBAAsBe,EAAI,IAAIW,CAAG,GACxC,MAAMlB,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAcgB,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAMf,EAAGD,EAAsB,IAAIK,EAAI,EAAG,CAAC;EAChD;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedprotocol/publish",
3
- "version": "0.7.8",
3
+ "version": "0.7.9-next.1177.ga3e08ed",
4
4
  "description": "Publish Seed Protocol items to Arweave and EAS: publish state machine, React provider and hooks, wallet integration and optional thirdweb adapters",
5
5
  "keywords": [
6
6
  "seed-protocol",
@@ -46,12 +46,12 @@
46
46
  "scripts": {
47
47
  "build": "tsc -p tsconfig.build.json && vite build",
48
48
  "prepublishOnly": "npm run build && node ../../scripts/sync-versions.js",
49
- "test": "bun test src/helpers/defaultApprovedTargetsForModularPublish.test.ts && bun test src/helpers/arweave.test.ts src/helpers/ensureManagedAccountReady.test.ts src/helpers/ensureEip7702ModularAccountReady.test.ts src/helpers/ensureManagedSignerSessionKey.test.ts src/helpers/publishDisplayHelpers.test.ts src/services/publish/actors/createAttestationsRouting.test.ts src/services/publish/actors/seedUidHelpers.test.ts src/config.autoDeployEip7702.test.ts src/config.chain.test.ts && bun test src/helpers/ensureSmartWalletThenPublish.test.ts && bun test src/helpers/ensureManagedAccountEasConfigured.test.ts && bun test src/services/domainOwnership/domainOwnership.test.ts src/services/domainOwnership/domainOwnership.scope.test.ts && bun test src/services/publishAuthorization/publishAuthorization.test.ts && bun test src/helpers/approvedTargetsForAutomationPublish.test.ts && bun test src/helpers/easDirect.multiRevoke.test.ts && bun test src/helpers/ensureAutomationSessionKey.test.ts && bun test src/helpers/enrollPublishAutomation.test.ts && bun test src/helpers/executorModuleReadiness.test.ts src/helpers/describeRevert.test.ts && bun test src/helpers/contracts/encodeMultiPublish.test.ts && bun test src/helpers/assertStorageBoundToIdentity.test.ts && bun test src/payment.test.ts && bun test src/authorization.test.ts && bun test src/services/publish/authorizing.test.ts && bun test src/helpers/turbo.test.ts && bun test src/services/publish/helpers/uploadToTurbo.test.ts && bun test src/services/publishCost/estimatePublishCost.test.ts && bun test src/services/publishCost/watchPublishCost.test.ts && bun test src/services/publishedBy/publishedBy.test.ts && bun test src/helpers/publishThirdwebClient.test.ts src/helpers/chainClient.secretKey.test.ts src/helpers/chainClient.receipt.test.ts && bun test src/helpers/adapters/thirdwebAccount.test.ts && bun test src/services/publishManager/publishManager.node.test.ts && bun test src/services/publishManager/publishLocks.node.test.ts && bun test src/services/publishManager/actors/savePublish.test.ts src/services/publishManager/actions/requestSavePublish.test.ts && bun test src/services/publish/helpers/ensureEasSchemas.test.ts && bun test src/services/publish/helpers/verifyAttestations.test.ts && bun test src/services/publish/actors/checking.unpublishedRelated.test.ts && bun test src/services/publish/actors/checking.directEas.test.ts && bun test src/services/publish/actors/recordMultiPublishReceipt.test.ts && bun test src/services/publish/actors/createAttestations.batch.test.ts && bun test src/services/publish/actors/createAttestationsDirectToEas.batch.test.ts && bun test src/services/publish/actors/createAttestationsDirectToEas.lists.test.ts && bun test src/helpers/verifyPublishChain.test.ts && bun test src/helpers/thirdwebWallets.test.ts && bun test src/helpers/seedPaymaster.test.ts && bun test src/helpers/ensureExecutorModule.test.ts && bun test src/services/revoke/revokeAttestations.test.ts && bun test src/helpers/ensureModularPublishBootstrap.test.ts && bun test src/helpers/blockchain.test.ts src/helpers/retryNonceTooLow.test.ts src/helpers/seedTwin.test.ts && bun test src/helpers/runModularExecutorPublishPrep.test.ts && bun test src/helpers/adapters/permissionlessTxSender.test.ts && bun test src/helpers/publishItem.test.ts && bun test src/helpers/publishWalletRegistry.test.ts && bun test src/services/publish/actors/pollForConfirmation.test.ts src/config.uploadApiBaseUrl.test.ts src/react/PublishProvider.initOrder.test.tsx && bun test src/services/publish/actors/uploadViaBundler.resume.test.ts && bun test src/services/publishManager/actors/restorableSnapshot.test.ts && bun test src/helpers/defaultDataItemSigner.test.ts && bun test src/services/publish/htmlPhase2.flow.test.ts src/helpers/accountCodeKind.test.ts"
49
+ "test": "bun test src/helpers/defaultApprovedTargetsForModularPublish.test.ts && bun test src/helpers/arweave.test.ts src/helpers/ensureManagedAccountReady.test.ts src/helpers/ensureEip7702ModularAccountReady.test.ts src/helpers/ensureManagedSignerSessionKey.test.ts src/helpers/publishDisplayHelpers.test.ts src/services/publish/actors/createAttestationsRouting.test.ts src/services/publish/actors/seedUidHelpers.test.ts src/config.autoDeployEip7702.test.ts src/config.chain.test.ts && bun test src/helpers/ensureSmartWalletThenPublish.test.ts && bun test src/helpers/ensureManagedAccountEasConfigured.test.ts && bun test src/services/domainOwnership/domainOwnership.test.ts src/services/domainOwnership/domainOwnership.scope.test.ts && bun test src/services/publishAuthorization/publishAuthorization.test.ts && bun test src/helpers/approvedTargetsForAutomationPublish.test.ts && bun test src/helpers/easDirect.multiRevoke.test.ts && bun test src/helpers/ensureAutomationSessionKey.test.ts && bun test src/helpers/enrollPublishAutomation.test.ts && bun test src/helpers/executorModuleReadiness.test.ts src/helpers/describeRevert.test.ts && bun test src/helpers/contracts/encodeMultiPublish.test.ts && bun test src/helpers/assertStorageBoundToIdentity.test.ts && bun test src/payment.test.ts && bun test src/authorization.test.ts && bun test src/services/publish/authorizing.test.ts && bun test src/helpers/turbo.test.ts && bun test src/services/publish/helpers/uploadToTurbo.test.ts && bun test src/services/publishCost/estimatePublishCost.test.ts && bun test src/services/publishCost/watchPublishCost.test.ts && bun test src/services/publishedBy/publishedBy.test.ts && bun test src/helpers/publishThirdwebClient.test.ts src/helpers/chainClient.secretKey.test.ts src/helpers/chainClient.receipt.test.ts && bun test src/helpers/adapters/thirdwebAccount.test.ts && bun test src/services/publishManager/publishManager.node.test.ts && bun test src/services/publishManager/publishLocks.node.test.ts && bun test src/services/publishManager/actors/savePublish.test.ts src/services/publishManager/actions/requestSavePublish.test.ts && bun test src/services/publish/helpers/ensureEasSchemas.test.ts && bun test src/services/publish/helpers/verifyAttestations.test.ts && bun test src/services/publish/actors/checking.unpublishedRelated.test.ts && bun test src/services/publish/actors/checking.directEas.test.ts && bun test src/services/publish/actors/recordMultiPublishReceipt.test.ts && bun test src/services/publish/actors/createAttestations.batch.test.ts && bun test src/services/publish/actors/createAttestationsDirectToEas.batch.test.ts && bun test src/services/publish/actors/createAttestationsDirectToEas.lists.test.ts && bun test src/helpers/verifyPublishChain.test.ts && bun test src/helpers/thirdwebWallets.test.ts && bun test src/helpers/seedPaymaster.test.ts && bun test src/helpers/ensureExecutorModule.test.ts && bun test src/services/revoke/revokeAttestations.test.ts && bun test src/helpers/ensureModularPublishBootstrap.test.ts && bun test src/helpers/blockchain.test.ts src/helpers/retryNonceTooLow.test.ts src/helpers/seedTwin.test.ts && bun test src/helpers/runModularExecutorPublishPrep.test.ts && bun test src/helpers/adapters/permissionlessTxSender.test.ts && bun test src/helpers/publishItem.test.ts && bun test src/helpers/publishWalletRegistry.test.ts && bun test src/config.uploadApiBaseUrl.test.ts src/react/PublishProvider.initOrder.test.tsx && bun test src/services/publish/actors/uploadViaBundler.resume.test.ts && bun test src/services/publishManager/actors/restorableSnapshot.test.ts && bun test src/helpers/defaultDataItemSigner.test.ts && bun test src/services/publish/htmlPhase2.flow.test.ts src/helpers/accountCodeKind.test.ts"
50
50
  },
51
51
  "dependencies": {
52
52
  "@ethereum-attestation-service/eas-sdk": "^2.9.0",
53
- "@seedprotocol/arweave": "0.7.8",
54
- "@seedprotocol/eas": "0.7.8",
53
+ "@seedprotocol/arweave": "0.7.9-next.1177.ga3e08ed",
54
+ "@seedprotocol/eas": "0.7.9-next.1177.ga3e08ed",
55
55
  "@xstate/react": "^6.1.0",
56
56
  "arweave": "^1.15.7",
57
57
  "debug": "^4.4.1",
@@ -64,8 +64,8 @@
64
64
  "xstate": "^5.28.0"
65
65
  },
66
66
  "devDependencies": {
67
- "@seedprotocol/react": "0.7.8",
68
- "@seedprotocol/sdk": "0.7.8",
67
+ "@seedprotocol/react": "0.7.9-next.1177.ga3e08ed",
68
+ "@seedprotocol/sdk": "0.7.9-next.1177.ga3e08ed",
69
69
  "@types/bun": "latest",
70
70
  "@types/react": "^19.2.14",
71
71
  "@types/react-dom": "^19.2.3",
@@ -77,8 +77,8 @@
77
77
  "vite": "^8.0.0"
78
78
  },
79
79
  "peerDependencies": {
80
- "@seedprotocol/sdk": "0.7.8",
81
- "@seedprotocol/react": "0.7.8",
80
+ "@seedprotocol/sdk": "0.7.9-next.1177.ga3e08ed",
81
+ "@seedprotocol/react": "0.7.9-next.1177.ga3e08ed",
82
82
  "react": "^18 || ^19",
83
83
  "react-dom": "^18 || ^19",
84
84
  "thirdweb": "^5",