@seedprotocol/publish 0.7.0 → 0.7.2-next.593.gd5bd4ea

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 (91) hide show
  1. package/README.md +1 -1
  2. package/dist/{chainConfig-DWynbnb8.js → chainConfig-BDMRU4m8.js} +5 -5
  3. package/dist/chainConfig-BDMRU4m8.js.map +1 -0
  4. package/dist/collectBatchUids-CnIe9jUB.js.map +1 -1
  5. package/dist/{ensureAutomationSessionKey-BVmh030S.js → ensureAutomationSessionKey-bw6knEyC.js} +4 -4
  6. package/dist/ensureAutomationSessionKey-bw6knEyC.js.map +1 -0
  7. package/dist/{ensureModularPublishBootstrap-DRFhp-O2.js → ensureModularPublishBootstrap-Vc4Jz_B9.js} +5 -5
  8. package/dist/ensureModularPublishBootstrap-Vc4Jz_B9.js.map +1 -0
  9. package/dist/{ensureSmartWalletThenPublish-0nKg13WN.js → ensureSmartWalletThenPublish-42iEhiHG.js} +3 -3
  10. package/dist/ensureSmartWalletThenPublish-42iEhiHG.js.map +1 -0
  11. package/dist/index.js +6 -14
  12. package/dist/index.js.map +1 -1
  13. package/dist/{managedAccountAdmin-B4HkLWWE.js → managedAccountAdmin-B3DPMmhR.js} +4 -4
  14. package/dist/managedAccountAdmin-B3DPMmhR.js.map +1 -0
  15. package/dist/{publishAuthorization-C-XYb9Ef.js → publishAuthorization-CAFF5jQ2.js} +1033 -1044
  16. package/dist/publishAuthorization-CAFF5jQ2.js.map +1 -0
  17. package/dist/{publishThirdwebClient-BQ_KnMi5.js → publishThirdwebClient-CPzAjnmf.js} +2 -2
  18. package/dist/publishThirdwebClient-CPzAjnmf.js.map +1 -0
  19. package/dist/{resolveRevokeAccount-9-OzXVdp.js → resolveRevokeAccount-CkbTpC27.js} +4 -4
  20. package/dist/resolveRevokeAccount-CkbTpC27.js.map +1 -0
  21. package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
  22. package/dist/services/publish/actors/rewritingHtmlEmbedded.d.ts.map +1 -1
  23. package/dist/services/publish/helpers/getPublishUploadData.d.ts +5 -0
  24. package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
  25. package/dist/thirdweb.js +7 -9
  26. package/dist/thirdweb.js.map +1 -1
  27. package/dist/{worker-FmHZbku5.js → worker-CCQ7KBMm.js} +2 -2
  28. package/dist/{worker-CJRUAOAn.js.map → worker-CCQ7KBMm.js.map} +1 -1
  29. package/package.json +13 -7
  30. package/dist/chainConfig-BJ8C_RRz.js +0 -1455
  31. package/dist/chainConfig-BJ8C_RRz.js.map +0 -1
  32. package/dist/chainConfig-DWynbnb8.js.map +0 -1
  33. package/dist/chainConfig-DWzoOtkS.js +0 -1453
  34. package/dist/chainConfig-DWzoOtkS.js.map +0 -1
  35. package/dist/chainConfig-DmuPBs3D.js +0 -1455
  36. package/dist/chainConfig-DmuPBs3D.js.map +0 -1
  37. package/dist/ensureAutomationSessionKey-BVmh030S.js.map +0 -1
  38. package/dist/ensureAutomationSessionKey-CxpJY_uH.js +0 -84
  39. package/dist/ensureAutomationSessionKey-CxpJY_uH.js.map +0 -1
  40. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js +0 -84
  41. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js.map +0 -1
  42. package/dist/ensureAutomationSessionKey-h3zOmDr5.js +0 -84
  43. package/dist/ensureAutomationSessionKey-h3zOmDr5.js.map +0 -1
  44. package/dist/ensureModularPublishBootstrap-BImiIFJe.js +0 -23
  45. package/dist/ensureModularPublishBootstrap-BImiIFJe.js.map +0 -1
  46. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js +0 -23
  47. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js.map +0 -1
  48. package/dist/ensureModularPublishBootstrap-DRFhp-O2.js.map +0 -1
  49. package/dist/ensureModularPublishBootstrap-DegJnYKL.js +0 -23
  50. package/dist/ensureModularPublishBootstrap-DegJnYKL.js.map +0 -1
  51. package/dist/ensureSmartWalletThenPublish-0nKg13WN.js.map +0 -1
  52. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js +0 -47
  53. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js.map +0 -1
  54. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js +0 -47
  55. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js.map +0 -1
  56. package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js +0 -47
  57. package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js.map +0 -1
  58. package/dist/managedAccountAdmin-B4HkLWWE.js.map +0 -1
  59. package/dist/managedAccountAdmin-ByEX_Eg2.js +0 -28
  60. package/dist/managedAccountAdmin-ByEX_Eg2.js.map +0 -1
  61. package/dist/managedAccountAdmin-DS6nniiu.js +0 -28
  62. package/dist/managedAccountAdmin-DS6nniiu.js.map +0 -1
  63. package/dist/managedAccountAdmin-DwFI-ZfE.js +0 -28
  64. package/dist/managedAccountAdmin-DwFI-ZfE.js.map +0 -1
  65. package/dist/publishAuthorization-C-XYb9Ef.js.map +0 -1
  66. package/dist/publishAuthorization-CG23g8w2.js +0 -3987
  67. package/dist/publishAuthorization-CG23g8w2.js.map +0 -1
  68. package/dist/publishAuthorization-CvK_coYp.js +0 -4011
  69. package/dist/publishAuthorization-CvK_coYp.js.map +0 -1
  70. package/dist/publishAuthorization-DgDI4zor.js +0 -4011
  71. package/dist/publishAuthorization-DgDI4zor.js.map +0 -1
  72. package/dist/publishThirdwebClient-BQ_KnMi5.js.map +0 -1
  73. package/dist/publishThirdwebClient-BmqsJCjp.js +0 -18
  74. package/dist/publishThirdwebClient-BmqsJCjp.js.map +0 -1
  75. package/dist/publishThirdwebClient-CO18ST7C.js +0 -18
  76. package/dist/publishThirdwebClient-CO18ST7C.js.map +0 -1
  77. package/dist/publishThirdwebClient-D-K2WEeM.js +0 -18
  78. package/dist/publishThirdwebClient-D-K2WEeM.js.map +0 -1
  79. package/dist/resolveRevokeAccount-9-OzXVdp.js.map +0 -1
  80. package/dist/resolveRevokeAccount-CXa5XlOv.js +0 -38
  81. package/dist/resolveRevokeAccount-CXa5XlOv.js.map +0 -1
  82. package/dist/resolveRevokeAccount-DsNod8ti.js +0 -38
  83. package/dist/resolveRevokeAccount-DsNod8ti.js.map +0 -1
  84. package/dist/resolveRevokeAccount-QgZ6YZuS.js +0 -38
  85. package/dist/resolveRevokeAccount-QgZ6YZuS.js.map +0 -1
  86. package/dist/worker-CJRUAOAn.js +0 -69
  87. package/dist/worker-CN7zg73B.js +0 -69
  88. package/dist/worker-CN7zg73B.js.map +0 -1
  89. package/dist/worker-FmHZbku5.js.map +0 -1
  90. package/dist/worker-qoGuo876.js +0 -69
  91. package/dist/worker-qoGuo876.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { o as t } from "./chainConfig-DmuPBs3D.js";
2
+ import { o as t } from "./chainConfig-BDMRU4m8.js";
3
3
  import { createThirdwebClient as n } from "thirdweb";
4
4
  //#region src/helpers/publishThirdwebClient.ts
5
5
  var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
@@ -15,4 +15,4 @@ function o() {
15
15
  //#endregion
16
16
  export { r as n, o as t };
17
17
 
18
- //# sourceMappingURL=publishThirdwebClient-BQ_KnMi5.js.map
18
+ //# sourceMappingURL=publishThirdwebClient-CPzAjnmf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-CPzAjnmf.js","names":["__exportAll","getPublishConfig","publishThirdwebClient_exports","getClient","_client","_clientKey","thirdwebClientId","thirdwebSecretKey","key","createThirdwebClient"],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGII,IAAiC,MACjCC,IAA4B;AAOhC,SAAgBF,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsBF,EAAiB;CACjE,IAAI,CAACK,KAAoB,CAACC,GACxB,MAAU,MACR,sIACF;CAEF,IAAMC,IAAM,GAAGF,KAAoB,GAAG,IAAIC,KAAqB;CAU/D,QATI,CAACH,KAAWC,MAAeG,OAC7B,IAAaA,GACb,IACIC,EADMH,IACe;EACnB,UAAUA;EACV,GAAIC,IAAoB,EAAE,WAAWA,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAWA,EAAmB,CAAC,IAErDH;AACT"}
@@ -1,6 +1,6 @@
1
- import { o as e, y as t } from "./chainConfig-DWynbnb8.js";
2
- import { A as n, F as r, L as i, M as a } from "./publishAuthorization-C-XYb9Ef.js";
3
- import { t as o } from "./publishThirdwebClient-BmqsJCjp.js";
1
+ import { o as e, y as t } from "./chainConfig-BDMRU4m8.js";
2
+ import { A as n, F as r, L as i, M as a } from "./publishAuthorization-CAFF5jQ2.js";
3
+ import { t as o } from "./publishThirdwebClient-CPzAjnmf.js";
4
4
  import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
5
5
  //#region src/helpers/resolveRevokeAccount.ts
6
6
  async function c(c) {
@@ -35,4 +35,4 @@ async function c(c) {
35
35
  //#endregion
36
36
  export { c as resolveRevokeAccount };
37
37
 
38
- //# sourceMappingURL=resolveRevokeAccount-9-OzXVdp.js.map
38
+ //# sourceMappingURL=resolveRevokeAccount-CkbTpC27.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRevokeAccount-CkbTpC27.js","names":["getPublishConfig","getPublishThirdwebChain","getConnectedManagedAccountAddress","getSmartWalletAddressForAdmin","isSmartWalletDeployed","getManagedAccountWallet","getClient","resolveRevokeAccount","params","attester","account","additionalGetter","getGetAdditionalSyncAddresses","attesterIsExecutorModule","additional","attesterLower","a","derivedManagedAccount","managedAddress","managedAccountWallet","managedAccount","modularAccountModuleContract"],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(getPublishThirdwebChain()).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;AAsBA,eAAsBO,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAaC;CAE9B,IAAI,CAACC,KAAYC,EAAQ,QAAQ,YAAY,MAAMD,EAAS,YAAY,GACtE,OAAOC;CAGT,IAAMC,IAAmBC,EAA8B,GACnDC,IAA2B;CAC/B,IAAIF,GAAkB;EACpB,IAAMG,IAAa,MAAMH,EAAiB,GACpCI,IAAgBN,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAACK,GAAY,MACtC,MAA0BE,GAAG,YAAY,MAAMD,CAClD;CACF;CAEA,IAAI;EACF,IAAME,IAAwB,MAAMd,EAA8BO,EAAQ,OAAO;EAIjF,IAHsBD,EAAS,YAG3B,MAFiBQ,EAAsB,YAErB,KAAgBJ,GAA0B;GAC9D,IAAMK,IAAiBL,IACnB,MAAMX,EAAkCD,EAAwB,CAAC,CAAC,CAAC,YAAYgB,CAAqB,IACpGA;GAEJ,IAAI,MADmBb,EAAsBc,CAAc,GAC7C;IACZ,IAAMC,IAAuBd,EAAwB;IACrD,MAAMc,EAAqB,YAAY;KACrC,QAAQb,EAAU;KAClB,OAAOL,EAAwB;IACjC,CAAC;IACD,IAAMmB,IAAiBD,EAAqB,WAAW;IACvD,IAAIC,GACF,OAAOA;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAIP,GAA0B;EAC5B,IAAM,EAAE,oCAAiCb,EAAiB;EAO1D,MANKqB,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAOX;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"createAttestationsDirectToEas.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/actors/createAttestationsDirectToEas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAiH3D,eAAO,MAAM,6BAA6B;gBAI1B,OAAO;oBACH,qBAAqB,CAAC,gBAAgB,CAAC;;aA9BnB,qBAAqB;WAAS,OAAO;gCAoV5E,CAAA"}
1
+ {"version":3,"file":"createAttestationsDirectToEas.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/actors/createAttestationsDirectToEas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AA6J3D,eAAO,MAAM,6BAA6B;gBAI1B,OAAO;oBACH,qBAAqB,CAAC,gBAAgB,CAAC;;aAhCnB,qBAAqB;WAAS,OAAO;gCAmW5E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"rewritingHtmlEmbedded.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/actors/rewritingHtmlEmbedded.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAuB3D,eAAO,MAAM,qBAAqB;aAnBD,qBAAqB;gCA2BrD,CAAA"}
1
+ {"version":3,"file":"rewritingHtmlEmbedded.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/actors/rewritingHtmlEmbedded.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAuB3D,eAAO,MAAM,qBAAqB;aAnBD,qBAAqB;gCA+BrD,CAAA"}
@@ -17,5 +17,10 @@ export type PublishUploadData = {
17
17
  seedLocalId: string;
18
18
  versionLocalId: string;
19
19
  };
20
+ /**
21
+ * Upload data for a publish of `item`: its own, and that of every draft item the publish carries
22
+ * along (reachable through relation and list properties; the SDK's getPublishDraftGraph, the same
23
+ * walk as getPublishUploads and getPublishPayload).
24
+ */
20
25
  export declare const getPublishUploadData: (item: IItem<any>, uploads?: PublishUploadData[], relatedItemProperty?: IItemProperty<any>, options?: GetPublishUploadDataOptions) => Promise<PublishUploadData[]>;
21
26
  //# sourceMappingURL=getPublishUploadData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPublishUploadData.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/helpers/getPublishUploadData.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAG7E,yGAAyG;AACzG,MAAM,MAAM,2BAA2B,GAAG;IACxC,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAA;IACpC,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAA;IACvC,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAA;IACtC,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AA8DD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AA2OD,eAAO,MAAM,oBAAoB,GAC/B,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAS,iBAAiB,EAAO,EACjC,sBAAsB,aAAa,CAAC,GAAG,CAAC,EACxC,UAAU,2BAA2B,KACpC,OAAO,CAAC,iBAAiB,EAAE,CA2D7B,CAAA"}
1
+ {"version":3,"file":"getPublishUploadData.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/helpers/getPublishUploadData.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAG7E,yGAAyG;AACzG,MAAM,MAAM,2BAA2B,GAAG;IACxC,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAA;IACpC,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAA;IACvC,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAA;IACtC,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AA8DD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAoTD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAS,iBAAiB,EAAO,EACjC,sBAAsB,aAAa,CAAC,GAAG,CAAC,EACxC,UAAU,2BAA2B,KACpC,OAAO,CAAC,iBAAiB,EAAE,CAa7B,CAAA"}
package/dist/thirdweb.js CHANGED
@@ -1,9 +1,9 @@
1
- import { A as e, M as t, a as n, ct as r, dt as i, h as a, lt as o, m as s, mt as c, o as l, p as u, pt as d, s as f, t as p, tt as ee, y as m } from "./chainConfig-DWynbnb8.js";
2
- import { A as h, B as g, C as _, D as te, E as ne, F as v, G as re, H as ie, I as y, K as ae, L as oe, M as b, N as x, O as se, P as S, R as C, S as w, T as ce, U as le, W as ue, a as de, b as fe, d as pe, f as me, h as T, j as he, k as E, l as D, m as O, nt as k, p as A, tt as j, u as M, x as N, y as P, z as F } from "./publishAuthorization-C-XYb9Ef.js";
3
- import { t as I } from "./publishThirdwebClient-BmqsJCjp.js";
4
- import { t as L } from "./ensureSmartWalletThenPublish-BfEndtFo.js";
5
- import { t as R } from "./ensureModularPublishBootstrap-DegJnYKL.js";
6
- import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-CxpJY_uH.js";
1
+ import { A as e, M as t, a as n, ct as r, dt as i, h as a, lt as o, m as s, mt as c, o as l, p as u, pt as d, s as f, t as p, tt as ee, y as m } from "./chainConfig-BDMRU4m8.js";
2
+ import { A as h, B as g, C as _, D as te, E as ne, F as v, G as re, H as ie, I as y, K as ae, L as oe, M as b, N as x, O as se, P as S, R as C, S as w, T as ce, U as le, W as ue, a as de, b as fe, d as pe, f as me, h as T, j as he, k as E, l as D, m as O, nt as k, p as A, tt as j, u as M, x as N, y as P, z as F } from "./publishAuthorization-CAFF5jQ2.js";
3
+ import { t as I } from "./publishThirdwebClient-CPzAjnmf.js";
4
+ import { t as L } from "./ensureSmartWalletThenPublish-42iEhiHG.js";
5
+ import { t as R } from "./ensureModularPublishBootstrap-Vc4Jz_B9.js";
6
+ import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-bw6knEyC.js";
7
7
  import { client as H } from "@seedprotocol/sdk";
8
8
  import { deploySmartAccount as ge, getContract as U, sendTransaction as _e } from "thirdweb";
9
9
  import { assessPublishAuthorization as ve, decodePublishAuthorizationData as ye, getPublishAuthorizationFromEas as be } from "@seedprotocol/eas";
@@ -37,9 +37,7 @@ async function Ne(e, t, n) {
37
37
  if (!r) return;
38
38
  await w(t, r, n);
39
39
  } catch {}
40
- return;
41
- }
42
- try {
40
+ } else try {
43
41
  await w(e.address, e, n);
44
42
  } catch (e) {
45
43
  je(e);
@@ -1 +1 @@
1
- {"version":3,"file":"thirdweb.js","names":[],"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 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 PublishManager.stopAll()\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 lastSyncedOwnedKey.current = ownedKey\n try {\n const publishWallet = fromThirdwebAccount(account)\n await setPublishWallet({\n ...publishWallet,\n ownedAddresses: [...owned],\n publisherAddress: managedAddress ?? account.address,\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 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, useEffect } from \"react\"\nimport type { MutableRefObject } from \"react\"\nimport type { QueryClient } from \"@tanstack/react-query\"\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 useEffect(() => {\n if (config) {\n initPublish(config)\n }\n }, [config])\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))\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":";;;;;;;;;;;;;;;AA8BA,IAAM,IAAgC;AAEtC,SAAS,GAAyB,GAAc;CAG9C,AADA,QAAQ,KAAK,0DAA0D,CAAG,GAC1E,EAAiB,CAAC,CAAC,uBAAuB,CAAG;AAC/C;AAGA,SAAS,KAA0C;CAEjD,OADI,EAAW,cAAc,IAAU,QAAQ,QAAQ,IAChD,IAAI,SAAS,MAAY;EAC9B,EAAW,cAAc,EAAQ,CAAC;CACpC,CAAC;AACH;AAOA,eAAe,GACb,GACA,GACA,GACe;CACV,MAAO,8BAIZ;MAAI,EAAO,oBAAoB;GAC7B,IAAI,CAAC,GACH;GAEF,IAAI;IACF,EAA0B;IAC1B,IAAM,IAAK,EAAwB;IACnC,MAAM,EAAG,YAAY;KAAE,QAAQ,EAAU;KAAG,OAAO,EAAw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,KAAO,GAChB,IAAI;GACF,IAAM,IAAU,GAA+B,EAAI,mBAAmB,IAAI;GAE1E,IADI,EAAQ,SAAS,YAAY,MAAM,KACnC,EAAQ,WAAW,YAAY,MAAM,GAAO;GAChD,IAAM,IACJ,OAAO,EAAI,kBAAmB,WAAW,EAAI,iBAAiB,MAC1D,IAAS,GAA2B;IACxC;IACA;IACA,KAAK;GACP,CAAC;GACD,IAAI,EAAO,WAAW,SACpB,OAAO;IACL,OAAO;IACP,KAAK;IACL,UAAU,CAAC,GAAG,GAAU,GAAG,EAAO,QAAQ;GAC5C;GAEF,EAAS,KAAK,GAAG,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","clearPublishWallet","setPublishWallet","getConfigRef","isContractDeployed","waitForPublishReceipt","fromThirdwebAccount","pollSmartWalletDeployed$1","asThirdwebPublishWallet","ManagedAccountPublishError","getPublishConfig","asSeedSignerFromThirdweb","Eip7702ModularAccountPublishError","initPublish","getPublishChainName","readIsActiveSigner","getPublishThirdwebChain","getConnectedManagedAccountAddress","syncPublishInAppAuthToken","assertExecutorModuleReadyForAccount","deployManagedAccountViaFactory","appMetadata","getSmartWalletAddressForAdmin","CALL_GAS_HEADROOM_BPS","useActiveSmartWalletContract","getWalletsForConnectButton","seedPaymaster","isSmartWalletDeployed","getManagedAccountWallet","getModularAccountWallet","deploySmartWalletContract","getSharedPublishInAppWalletStorage","pollSmartWalletDeployed","ensureExecutorModuleInstalled","ExternalWalletsForDeploy","useLocalWalletAccount","wallets","attestPublishAuthorization","runModularExecutorPublishPrep","buildAutomationSessionKeyPermissions","hashAutomationSessionKeyPermissions","PublishManager","getConnectedModularAccount","getConnectedAccount","revokePublishAuthorization","approvedTargetsForAutomationPublish","usePublishConfig","toThirdwebSessionKeyPermissions","PublishConfigContext","PUBLISH_AUTOMATION_SCOPES","tryDeployManagedAccount","ensureManagedAccountReady","resolveSmartWalletForPublish","getClient","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","publishWallet","useEffect","cancelled","darkTheme","PublishProviderThirdweb","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 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 PublishManager.stopAll()\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 lastSyncedOwnedKey.current = ownedKey\n try {\n const publishWallet = fromThirdwebAccount(account)\n await setPublishWallet({\n ...publishWallet,\n ownedAddresses: [...owned],\n publisherAddress: managedAddress ?? account.address,\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 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, useEffect } from \"react\"\nimport type { MutableRefObject } from \"react\"\nimport type { QueryClient } from \"@tanstack/react-query\"\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 useEffect(() => {\n if (config) {\n initPublish(config)\n }\n }, [config])\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))\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":";;;;;;;;;;;;;;;AA8BA,IAAM8D,IAAgC;AAEtC,SAASC,GAAyB,GAAc;CAG9C,AADA,QAAQ,KAAK,0DAA0DC,CAAG,GAC1EpD,EAAiB,CAAC,CAAC,uBAAuBoD,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,IAAKzC,EAAwB;IACnC,MAAMyC,EAAG,YAAY;KAAE,QAAQhB,EAAU;KAAG,OAAOrC,EAAwBmD,CAAM;IAAE,CAAC;IACpF,IAAMG,IAAKD,EAAG,WAAW;IACzB,IAAI,CAACC,GACH;IAEF,MAAMrC,EAA8BmC,GAAgBE,GAAIH,CAAM;GAChE,QAAQ,CAER;EAEF,OAEA,IAAI;GACF,MAAMlC,EAA8BsC,EAAe,SAASA,GAAgBJ,CAAM;EACpF,SAASL,GAAK;GACZ,GAAyBA,CAAG;EAC9B;CANA;AAOF;AAEA,IAAMU,WAA0B;CAC9B,IAAML,IAASrB,EAAiB,GAC1B2B,IAAgBzD,EAAwBmD,CAAM,GAC9CO,IAAS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AAG;EACV,EAAS,KACP,aAAa,QAAQ,EAAE,UAAU,6BACnC;CACF;CAGF,IAAIG,GACF,IAAI;EACF,IAAMC,IAAO,MAAMC,GAA+B;GAChD,YAAY,CAACpF,CAAc;GAC3B,aAAa,CAAC+E,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,4 +1,4 @@
1
- import { o as e } from "./chainConfig-DWynbnb8.js";
1
+ import { o as e } from "./chainConfig-BDMRU4m8.js";
2
2
  import { BaseDb as t, applyArweaveL1TransactionIdLocal as n, arweaveL1FinalizeJobs as r, getArweaveUploadStatus as i, isArweaveL1AnchoringComplete as a, queryArweaveGatewayTransactionWithFallback as o } from "@seedprotocol/sdk";
3
3
  import s from "debug";
4
4
  import { eq as c } from "drizzle-orm";
@@ -69,4 +69,4 @@ async function m() {
69
69
  //#endregion
70
70
  export { f as startArweaveL1FinalizeWorker, p as stopArweaveL1FinalizeWorker };
71
71
 
72
- //# sourceMappingURL=worker-FmHZbku5.js.map
72
+ //# sourceMappingURL=worker-CCQ7KBMm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker-CJRUAOAn.js","names":[],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n applyArweaveL1TransactionIdLocal,\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\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 if (!config.useArweaveBundler) return\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\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\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 if (resolvedL1) {\n await applyArweaveL1TransactionIdLocal({\n seedLocalId: job.seedLocalId,\n versionLocalId: job.versionLocalId,\n dataItemId,\n l1TransactionId: resolvedL1,\n })\n }\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,IAAM,IAAS,EAAM,uCAAuC,GAEtD,IAAU,MAEZ,IAAoD;AAExD,SAAgB,IAAqC;CAC/C,MACJ,IAAa,kBAAkB;EAC7B,EAA8B;CAChC,GAAG,CAAO,GACV,EAA8B;AAChC;AASA,eAAe,IAA0C;CACvD,IAAI;CACJ,IAAI;EACF,IAAS,EAAiB;CAC5B,QAAQ;EACN;CACF;CAIA,IAHI,CAAC,EAAO,qBAGR,CAAC,EAAO,aAAa,GAAG;CAC5B,IAAM,IAAK,EAAO,SAAS;CAC3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AG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD,SAAS,GAAK;GAEZ,AADA,EAAO,sBAAsB,EAAI,IAAI,CAAG,GACxC,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAc,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD;CACF;AACF"}
1
+ {"version":3,"file":"worker-CCQ7KBMm.js","names":["getPublishConfig","debug","logger","TICK_MS","intervalId","startArweaveL1FinalizeWorker","runArweaveL1FinalizeTick","stopArweaveL1FinalizeWorker","config","BaseDb","db","pending","arweaveL1FinalizeJobs","eq","uploadBase","graphqlUrl","job","dataItemId","l1TxId","bundled","queryArweaveGatewayTransactionWithFallback","status","getArweaveUploadStatus","statusStr","isArweaveL1AnchoringComplete","resolvedL1","applyArweaveL1TransactionIdLocal","err"],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n applyArweaveL1TransactionIdLocal,\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\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 if (!config.useArweaveBundler) return\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\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\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 if (resolvedL1) {\n await applyArweaveL1TransactionIdLocal({\n seedLocalId: job.seedLocalId,\n versionLocalId: job.versionLocalId,\n dataItemId,\n l1TransactionId: resolvedL1,\n })\n }\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,IAAME,IAASD,EAAM,uCAAuC,GAEtDE,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,IAASR,EAAiB;CAC5B,QAAQ;EACN;CACF;CAIA,IAHI,CAACQ,EAAO,qBAGR,CAACC,EAAO,aAAa,GAAG;CAC5B,IAAMC,IAAKD,EAAO,SAAS;CAC3B,IAAI,CAACC,GAAI;CAET,IAAMC,IAAU,MAAMD,EACnB,OAAO,CAAC,CACR,KAAKE,CAAqB,CAAC,CAC3B,MAAMC,EAAGD,EAAsB,OAAO,YAAY,CAAC,CAAC,CACpD,MAAM,EAAE;CAEX,IAAID,EAAQ,WAAW,GAAG;CAE1B,IAAMG,IAAaN,EAAO,kCACpBO,IAAaP,EAAO;CAE1B,KAAK,IAAMQ,KAAOL,GAAS;EACzB,IAAMM,IAAaD,EAAI;EACvB,IAAI;GACF,IAAIE,IAASF,EAAI;GAEjB,IAAI,CAACE,GAAQ;IAEX,IAAMC,KAAU,MADEC,EAA2CL,GAAYE,CAAU,EAAA,EAC9D,eAAe;IACpC,AAAIE,MACF,IAASA,GACT,MAAMT,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;KACH,iBAAiBO;KACjB,UAAUA;KACV,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAMN,EAAGD,EAAsB,IAAII,EAAI,EAAG,CAAC;GAElD;GAEA,IAAMK,IAAS,MAAMC,EAAuBR,GAAYG,CAAU,GAC5DM,IAAYF,IAAS,KAAK,UAAUA,CAAM,IAAI;GAEpD,IAAIA,KAAUG,EAA6BH,CAAM,GAAG;IAClD,IAAMI,IACJP,KACAG,EAAO,YACPA,EAAO,OAAO,YACdL,EAAI,mBACJ;IAWF,AATIS,KACF,MAAMC,EAAiC;KACrC,aAAaV,EAAI;KACjB,gBAAgBA,EAAI;KACpB;KACA,iBAAiBS;IACnB,CAAC,GAGH,MAAMf,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;KACH,OAAO;KACP,YAAYW;KACZ,iBAAiBE,KAAcT,EAAI;KACnC,UAAUK,EAAO,YAAYL,EAAI;KACjC,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAMH,EAAGD,EAAsB,IAAII,EAAI,EAAG,CAAC;IAC9C;GACF;GAEA,MAAMN,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;IACH,YAAYW;IACZ,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAMV,EAAGD,EAAsB,IAAII,EAAI,EAAG,CAAC;EAChD,SAASW,GAAK;GAEZ,AADAzB,EAAO,sBAAsBc,EAAI,IAAIW,CAAG,GACxC,MAAMjB,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAce,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAMd,EAAGD,EAAsB,IAAII,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.0",
3
+ "version": "0.7.2-next.593.gd5bd4ea",
4
4
  "description": "Publish UI components and helpers for Seed Protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,14 +34,14 @@
34
34
  "scripts": {
35
35
  "build": "tsc -p tsconfig.build.json && vite build",
36
36
  "prepublishOnly": "npm run build && node ../../scripts/sync-versions.js",
37
- "test": "bun test src/helpers/arweave.test.ts src/helpers/defaultApprovedTargetsForModularPublish.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 && 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/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/publish/helpers/ensureEasSchemas.test.ts && bun test src/services/publish/actors/checking.unpublishedRelated.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/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"
37
+ "test": "bun test src/helpers/arweave.test.ts src/helpers/defaultApprovedTargetsForModularPublish.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 && 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/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/publish/helpers/ensureEasSchemas.test.ts && bun test src/services/publish/actors/checking.unpublishedRelated.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"
38
38
  },
39
39
  "dependencies": {
40
40
  "@ethereum-attestation-service/eas-sdk": "^2.9.0",
41
- "@seedprotocol/arweave": "0.7.0",
42
- "@seedprotocol/eas": "0.7.0",
43
- "@seedprotocol/react": "0.7.0",
44
- "@seedprotocol/sdk": "0.7.0",
41
+ "@seedprotocol/arweave": "0.7.2-next.593.gd5bd4ea",
42
+ "@seedprotocol/eas": "0.7.2-next.593.gd5bd4ea",
43
+ "@seedprotocol/react": "0.7.2-next.593.gd5bd4ea",
44
+ "@seedprotocol/sdk": "0.7.2-next.593.gd5bd4ea",
45
45
  "@xstate/react": "^6.1.0",
46
46
  "arweave": "^1.15.7",
47
47
  "debug": "^4.4.1",
@@ -67,7 +67,8 @@
67
67
  "peerDependencies": {
68
68
  "react": "^18 || ^19",
69
69
  "react-dom": "^18 || ^19",
70
- "thirdweb": "^5"
70
+ "thirdweb": "^5",
71
+ "@tanstack/react-query": "^5"
71
72
  },
72
73
  "peerDependenciesMeta": {
73
74
  "thirdweb": {
@@ -76,6 +77,11 @@
76
77
  },
77
78
  "author": "Keith Axline <keith@journodao.xyz>",
78
79
  "license": "MIT",
80
+ "repository": {
81
+ "type": "git",
82
+ "url": "git+https://github.com/JournoLabs/seed-protocol-sdk.git",
83
+ "directory": "packages/publish"
84
+ },
79
85
  "publishConfig": {
80
86
  "access": "public"
81
87
  }