@seedprotocol/publish 0.6.10 → 0.7.0

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 (78) hide show
  1. package/dist/chainConfig-BJ8C_RRz.js +1455 -0
  2. package/dist/chainConfig-BJ8C_RRz.js.map +1 -0
  3. package/dist/chainConfig-DWynbnb8.js +1455 -0
  4. package/dist/chainConfig-DWynbnb8.js.map +1 -0
  5. package/dist/chainConfig-DmuPBs3D.js +1455 -0
  6. package/dist/chainConfig-DmuPBs3D.js.map +1 -0
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/ensureAutomationSessionKey-BVmh030S.js +84 -0
  9. package/dist/ensureAutomationSessionKey-BVmh030S.js.map +1 -0
  10. package/dist/ensureAutomationSessionKey-CxpJY_uH.js +84 -0
  11. package/dist/ensureAutomationSessionKey-CxpJY_uH.js.map +1 -0
  12. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js +84 -0
  13. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js.map +1 -0
  14. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js +23 -0
  15. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js.map +1 -0
  16. package/dist/ensureModularPublishBootstrap-DRFhp-O2.js +23 -0
  17. package/dist/ensureModularPublishBootstrap-DRFhp-O2.js.map +1 -0
  18. package/dist/ensureModularPublishBootstrap-DegJnYKL.js +23 -0
  19. package/dist/ensureModularPublishBootstrap-DegJnYKL.js.map +1 -0
  20. package/dist/ensureSmartWalletThenPublish-0nKg13WN.js +47 -0
  21. package/dist/ensureSmartWalletThenPublish-0nKg13WN.js.map +1 -0
  22. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js +47 -0
  23. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js.map +1 -0
  24. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js +47 -0
  25. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js.map +1 -0
  26. package/dist/index.js +3 -3
  27. package/dist/managedAccountAdmin-ByEX_Eg2.js +28 -0
  28. package/dist/managedAccountAdmin-ByEX_Eg2.js.map +1 -0
  29. package/dist/managedAccountAdmin-DS6nniiu.js +28 -0
  30. package/dist/managedAccountAdmin-DS6nniiu.js.map +1 -0
  31. package/dist/managedAccountAdmin-DwFI-ZfE.js +28 -0
  32. package/dist/managedAccountAdmin-DwFI-ZfE.js.map +1 -0
  33. package/dist/publishAuthorization-C-XYb9Ef.js +4034 -0
  34. package/dist/publishAuthorization-C-XYb9Ef.js.map +1 -0
  35. package/dist/publishAuthorization-CG23g8w2.js +3987 -0
  36. package/dist/publishAuthorization-CG23g8w2.js.map +1 -0
  37. package/dist/publishAuthorization-CvK_coYp.js +4011 -0
  38. package/dist/publishAuthorization-CvK_coYp.js.map +1 -0
  39. package/dist/publishThirdwebClient-BQ_KnMi5.js +18 -0
  40. package/dist/publishThirdwebClient-BQ_KnMi5.js.map +1 -0
  41. package/dist/publishThirdwebClient-BmqsJCjp.js +18 -0
  42. package/dist/publishThirdwebClient-BmqsJCjp.js.map +1 -0
  43. package/dist/publishThirdwebClient-D-K2WEeM.js +18 -0
  44. package/dist/publishThirdwebClient-D-K2WEeM.js.map +1 -0
  45. package/dist/resolveRevokeAccount-9-OzXVdp.js +38 -0
  46. package/dist/resolveRevokeAccount-9-OzXVdp.js.map +1 -0
  47. package/dist/resolveRevokeAccount-CXa5XlOv.js +38 -0
  48. package/dist/resolveRevokeAccount-CXa5XlOv.js.map +1 -0
  49. package/dist/resolveRevokeAccount-QgZ6YZuS.js +38 -0
  50. package/dist/resolveRevokeAccount-QgZ6YZuS.js.map +1 -0
  51. package/dist/services/publish/actors/checking.d.ts.map +1 -1
  52. package/dist/services/publish/actors/createAttestations.d.ts.map +1 -1
  53. package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
  54. package/dist/services/publish/actors/multiPublishReceipt.d.ts +58 -0
  55. package/dist/services/publish/actors/multiPublishReceipt.d.ts.map +1 -0
  56. package/dist/services/publish/actors/persistSeedUid.d.ts.map +1 -1
  57. package/dist/services/publish/actors/recordMultiPublishReceipt.d.ts +45 -0
  58. package/dist/services/publish/actors/recordMultiPublishReceipt.d.ts.map +1 -0
  59. package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
  60. package/dist/services/publishCost/types.d.ts +3 -1
  61. package/dist/services/publishCost/types.d.ts.map +1 -1
  62. package/dist/services/publishManager/actions/publishDone.d.ts.map +1 -1
  63. package/dist/services/publishManager/actions/stopAll.d.ts.map +1 -1
  64. package/dist/services/publishManager/actions/stopPublish.d.ts.map +1 -1
  65. package/dist/services/publishManager/actors/restoreFromDb.d.ts.map +1 -1
  66. package/dist/services/publishManager/index.d.ts +3 -3
  67. package/dist/services/publishManager/index.d.ts.map +1 -1
  68. package/dist/services/publishManager/publishLocks.d.ts +22 -0
  69. package/dist/services/publishManager/publishLocks.d.ts.map +1 -0
  70. package/dist/services/revoke/revokeAttestations.d.ts.map +1 -1
  71. package/dist/thirdweb.js +6 -6
  72. package/dist/worker-CJRUAOAn.js +69 -0
  73. package/dist/worker-CJRUAOAn.js.map +1 -0
  74. package/dist/worker-FmHZbku5.js +72 -0
  75. package/dist/worker-FmHZbku5.js.map +1 -0
  76. package/dist/worker-qoGuo876.js +69 -0
  77. package/dist/worker-qoGuo876.js.map +1 -0
  78. package/package.json +6 -6
@@ -0,0 +1,23 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { h as t, mt as n, t as r, y as i } from "./chainConfig-DmuPBs3D.js";
3
+ import { B as a, M as o, v as s } from "./publishAuthorization-CG23g8w2.js";
4
+ import { t as c } from "./publishThirdwebClient-BQ_KnMi5.js";
5
+ import { t as l } from "./managedAccountAdmin-DwFI-ZfE.js";
6
+ //#region src/helpers/ensureModularPublishBootstrap.ts
7
+ var u = /* @__PURE__ */ e({ ensureModularPublishBootstrap: () => d });
8
+ async function d(e) {
9
+ a();
10
+ let u = o();
11
+ await u.autoConnect({
12
+ client: c(),
13
+ chain: i()
14
+ });
15
+ let d = u.getAccount();
16
+ if (!d) throw new n(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
17
+ if (d.address.toLowerCase() !== e.toLowerCase()) throw new n(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
+ return await s(e, async () => t(await l(e))), d;
19
+ }
20
+ //#endregion
21
+ export { u as n, d as t };
22
+
23
+ //# sourceMappingURL=ensureModularPublishBootstrap-CmxyX_EN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureModularPublishBootstrap-CmxyX_EN.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\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 `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
@@ -0,0 +1,23 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { h as t, mt as n, t as r, y as i } from "./chainConfig-BJ8C_RRz.js";
3
+ import { B as a, M as o, v as s } from "./publishAuthorization-CvK_coYp.js";
4
+ import { t as c } from "./publishThirdwebClient-D-K2WEeM.js";
5
+ import { t as l } from "./managedAccountAdmin-DS6nniiu.js";
6
+ //#region src/helpers/ensureModularPublishBootstrap.ts
7
+ var u = /* @__PURE__ */ e({ ensureModularPublishBootstrap: () => d });
8
+ async function d(e) {
9
+ a();
10
+ let u = o();
11
+ await u.autoConnect({
12
+ client: c(),
13
+ chain: i()
14
+ });
15
+ let d = u.getAccount();
16
+ if (!d) throw new n(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
17
+ if (d.address.toLowerCase() !== e.toLowerCase()) throw new n(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
+ return await s(e, async () => t(await l(e))), d;
19
+ }
20
+ //#endregion
21
+ export { u as n, d as t };
22
+
23
+ //# sourceMappingURL=ensureModularPublishBootstrap-DRFhp-O2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureModularPublishBootstrap-DRFhp-O2.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\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 `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
@@ -0,0 +1,23 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { h as t, mt as n, t as r, y as i } from "./chainConfig-DWynbnb8.js";
3
+ import { B as a, M as o, v as s } from "./publishAuthorization-C-XYb9Ef.js";
4
+ import { t as c } from "./publishThirdwebClient-BmqsJCjp.js";
5
+ import { t as l } from "./managedAccountAdmin-ByEX_Eg2.js";
6
+ //#region src/helpers/ensureModularPublishBootstrap.ts
7
+ var u = /* @__PURE__ */ e({ ensureModularPublishBootstrap: () => d });
8
+ async function d(e) {
9
+ a();
10
+ let u = o();
11
+ await u.autoConnect({
12
+ client: c(),
13
+ chain: i()
14
+ });
15
+ let d = u.getAccount();
16
+ if (!d) throw new n(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
17
+ if (d.address.toLowerCase() !== e.toLowerCase()) throw new n(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
+ return await s(e, async () => t(await l(e))), d;
19
+ }
20
+ //#endregion
21
+ export { u as n, d as t };
22
+
23
+ //# sourceMappingURL=ensureModularPublishBootstrap-DegJnYKL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureModularPublishBootstrap-DegJnYKL.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\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 `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
@@ -0,0 +1,47 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { D as t, O as n, h as r, mt as i, o as a, t as o, y as s } from "./chainConfig-DmuPBs3D.js";
3
+ import { A as c, h as l, j as u, z as d } from "./publishAuthorization-CG23g8w2.js";
4
+ import { ethers as f } from "ethers";
5
+ //#region src/helpers/ensureSmartWalletThenPublish.ts
6
+ var p = /* @__PURE__ */ e({ ensureSmartWalletThenPublish: () => _ }), m = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.", h = () => `Could not connect the managed publishing account on ${o()}. Reconnect with the same sign-in method and try again.`;
7
+ function g(e) {
8
+ if (e) return e instanceof f.Wallet ? e : t(e) ? e.signer : n(e) ? e : r(e).signer;
9
+ }
10
+ async function _(e, t, n, o) {
11
+ let f = a(), p = await n();
12
+ if (!p || !p.trim()) return { outcome: "no_address" };
13
+ if (f.useModularExecutor) {
14
+ let t = await u();
15
+ if (!t) return {
16
+ outcome: "managed_not_ready",
17
+ error: new i(m, "MANAGED_ACCOUNT_UNAVAILABLE")
18
+ };
19
+ let n;
20
+ try {
21
+ n = await c(s());
22
+ } catch (e) {
23
+ return {
24
+ outcome: "managed_not_ready",
25
+ error: new i(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
26
+ };
27
+ }
28
+ let a = r(t);
29
+ return l.createPublish(e, n, a, {
30
+ ...o,
31
+ dataItemSigner: g(o?.dataItemSigner) ?? a.signer
32
+ }), { outcome: "started" };
33
+ }
34
+ let _ = await d(t ?? null);
35
+ if ("address" in _) {
36
+ let t = r(_.account);
37
+ return l.createPublish(e, _.address, t, {
38
+ ...o,
39
+ dataItemSigner: g(o?.dataItemSigner) ?? t.signer
40
+ }), { outcome: "started" };
41
+ }
42
+ return { outcome: "needs_deploy" };
43
+ }
44
+ //#endregion
45
+ export { p as n, _ as t };
46
+
47
+ //# sourceMappingURL=ensureSmartWalletThenPublish-0nKg13WN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureSmartWalletThenPublish-0nKg13WN.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
@@ -0,0 +1,47 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { D as t, O as n, h as r, mt as i, o as a, t as o, y as s } from "./chainConfig-BJ8C_RRz.js";
3
+ import { A as c, h as l, j as u, z as d } from "./publishAuthorization-CvK_coYp.js";
4
+ import { ethers as f } from "ethers";
5
+ //#region src/helpers/ensureSmartWalletThenPublish.ts
6
+ var p = /* @__PURE__ */ e({ ensureSmartWalletThenPublish: () => _ }), m = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.", h = () => `Could not connect the managed publishing account on ${o()}. Reconnect with the same sign-in method and try again.`;
7
+ function g(e) {
8
+ if (e) return e instanceof f.Wallet ? e : t(e) ? e.signer : n(e) ? e : r(e).signer;
9
+ }
10
+ async function _(e, t, n, o) {
11
+ let f = a(), p = await n();
12
+ if (!p || !p.trim()) return { outcome: "no_address" };
13
+ if (f.useModularExecutor) {
14
+ let t = await u();
15
+ if (!t) return {
16
+ outcome: "managed_not_ready",
17
+ error: new i(m, "MANAGED_ACCOUNT_UNAVAILABLE")
18
+ };
19
+ let n;
20
+ try {
21
+ n = await c(s());
22
+ } catch (e) {
23
+ return {
24
+ outcome: "managed_not_ready",
25
+ error: new i(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
26
+ };
27
+ }
28
+ let a = r(t);
29
+ return l.createPublish(e, n, a, {
30
+ ...o,
31
+ dataItemSigner: g(o?.dataItemSigner) ?? a.signer
32
+ }), { outcome: "started" };
33
+ }
34
+ let _ = await d(t ?? null);
35
+ if ("address" in _) {
36
+ let t = r(_.account);
37
+ return l.createPublish(e, _.address, t, {
38
+ ...o,
39
+ dataItemSigner: g(o?.dataItemSigner) ?? t.signer
40
+ }), { outcome: "started" };
41
+ }
42
+ return { outcome: "needs_deploy" };
43
+ }
44
+ //#endregion
45
+ export { p as n, _ as t };
46
+
47
+ //# sourceMappingURL=ensureSmartWalletThenPublish-BdqeUL6t.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureSmartWalletThenPublish-BdqeUL6t.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
@@ -0,0 +1,47 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { D as t, O as n, h as r, mt as i, o as a, t as o, y as s } from "./chainConfig-DWynbnb8.js";
3
+ import { A as c, h as l, j as u, z as d } from "./publishAuthorization-C-XYb9Ef.js";
4
+ import { ethers as f } from "ethers";
5
+ //#region src/helpers/ensureSmartWalletThenPublish.ts
6
+ var p = /* @__PURE__ */ e({ ensureSmartWalletThenPublish: () => _ }), m = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.", h = () => `Could not connect the managed publishing account on ${o()}. Reconnect with the same sign-in method and try again.`;
7
+ function g(e) {
8
+ if (e) return e instanceof f.Wallet ? e : t(e) ? e.signer : n(e) ? e : r(e).signer;
9
+ }
10
+ async function _(e, t, n, o) {
11
+ let f = a(), p = await n();
12
+ if (!p || !p.trim()) return { outcome: "no_address" };
13
+ if (f.useModularExecutor) {
14
+ let t = await u();
15
+ if (!t) return {
16
+ outcome: "managed_not_ready",
17
+ error: new i(m, "MANAGED_ACCOUNT_UNAVAILABLE")
18
+ };
19
+ let n;
20
+ try {
21
+ n = await c(s());
22
+ } catch (e) {
23
+ return {
24
+ outcome: "managed_not_ready",
25
+ error: new i(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
26
+ };
27
+ }
28
+ let a = r(t);
29
+ return l.createPublish(e, n, a, {
30
+ ...o,
31
+ dataItemSigner: g(o?.dataItemSigner) ?? a.signer
32
+ }), { outcome: "started" };
33
+ }
34
+ let _ = await d(t ?? null);
35
+ if ("address" in _) {
36
+ let t = r(_.account);
37
+ return l.createPublish(e, _.address, t, {
38
+ ...o,
39
+ dataItemSigner: g(o?.dataItemSigner) ?? t.signer
40
+ }), { outcome: "started" };
41
+ }
42
+ return { outcome: "needs_deploy" };
43
+ }
44
+ //#endregion
45
+ export { p as n, _ as t };
46
+
47
+ //# sourceMappingURL=ensureSmartWalletThenPublish-BfEndtFo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureSmartWalletThenPublish-BfEndtFo.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, H as o, I as s, M as c, Mt as l, N as u, O as d, Ot as f, R as p, S as m, T as h, Tt as g, U as _, W as v, Y as y, _t as ee, a as te, c as ne, ct as re, d as ie, dt as b, et as ae, f as oe, ft as se, gt as ce, ht as le, i as ue, j as x, jt as S, k as C, kt as de, l as fe, mt as pe, n as me, o as w, pt as he, q as ge, r as _e, s as ve, st as ye, t as be, tt as xe, vt as Se, w as Ce, x as we, yt as Te } from "./chainConfig-DWzoOtkS.js";
2
- import { $ as Ee, C as De, J as Oe, Q as ke, X as Ae, Y as je, Z as Me, _ as Ne, a as Pe, c as Fe, et as Ie, g as Le, h as Re, i as ze, l as Be, n as Ve, nt as He, o as Ue, q as We, r as Ge, s as Ke, t as qe, tt as Je, v as Ye, w as Xe } from "./publishAuthorization-DgDI4zor.js";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, H as o, I as s, M as c, Mt as l, N as u, O as d, Ot as f, R as p, S as m, T as h, Tt as g, U as _, W as v, Y as y, _t as ee, a as te, c as ne, ct as re, d as ie, dt as b, et as ae, f as oe, ft as se, gt as ce, ht as le, i as ue, j as x, jt as S, k as C, kt as de, l as fe, mt as pe, n as me, o as w, pt as he, q as ge, r as _e, s as ve, st as ye, t as be, tt as xe, vt as Se, w as Ce, x as we, yt as Te } from "./chainConfig-DWynbnb8.js";
2
+ import { $ as Ee, C as De, J as Oe, Q as ke, X as Ae, Y as je, Z as Me, _ as Ne, a as Pe, c as Fe, et as Ie, g as Le, h as Re, i as ze, l as Be, n as Ve, nt as He, o as Ue, q as We, r as Ge, s as Ke, t as qe, tt as Je, v as Ye, w as Xe } from "./publishAuthorization-C-XYb9Ef.js";
3
3
  import { n as Ze, r as Qe } from "./collectBatchUids-CnIe9jUB.js";
4
4
  import { BaseDb as T, arweaveL1FinalizeJobs as E, isItemOwned as $e, publishProcesses as D, uploadProcesses as et } from "@seedprotocol/sdk";
5
5
  import { createPublicClient as tt, createWalletClient as nt, custom as rt, defineChain as it, http as O } from "viem";
@@ -770,7 +770,7 @@ function $n(e) {
770
770
  async function er(e, t) {
771
771
  let n = w();
772
772
  if (n.useModularExecutor) {
773
- let { ensureSmartWalletThenPublish: n } = await import("./ensureSmartWalletThenPublish-DuOYPJFd.js").then((e) => e.n);
773
+ let { ensureSmartWalletThenPublish: n } = await import("./ensureSmartWalletThenPublish-BfEndtFo.js").then((e) => e.n);
774
774
  return n(e, null, async () => {
775
775
  let e = x();
776
776
  return e?.publisherAddress ?? e?.signer.address ?? null;
@@ -0,0 +1,28 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { mt as t, nt as n, t as r, y as i } from "./chainConfig-DWynbnb8.js";
3
+ import { B as a, N as o } from "./publishAuthorization-C-XYb9Ef.js";
4
+ import { t as s } from "./publishThirdwebClient-BmqsJCjp.js";
5
+ //#region src/helpers/managedAccountAdmin.ts
6
+ var c = /* @__PURE__ */ e({ getManagedAccountAdmin: () => l });
7
+ async function l(e) {
8
+ a();
9
+ let c = o();
10
+ await c.autoConnect({
11
+ client: s(),
12
+ chain: i()
13
+ });
14
+ let l = c.getAccount();
15
+ if (!l) throw new t(`Could not connect the in-app wallet that administers your publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
16
+ let u;
17
+ try {
18
+ u = await n(e, l.address);
19
+ } catch (n) {
20
+ throw new t(`Could not check the admins of your publishing account on ${r()}.`, "MANAGED_ACCOUNT_UNAVAILABLE", e, n);
21
+ }
22
+ if (!u) throw new t(`The connected in-app wallet (${l.address}) is not an admin of publishing account ${e}.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
23
+ return l;
24
+ }
25
+ //#endregion
26
+ export { c as n, l as t };
27
+
28
+ //# sourceMappingURL=managedAccountAdmin-ByEX_Eg2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managedAccountAdmin-ByEX_Eg2.js","names":[],"sources":["../src/helpers/managedAccountAdmin.ts"],"sourcesContent":["import type { Address } from 'viem'\nimport type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishChainName } from './chainConfig'\nimport { readIsAdmin } from './contracts'\nimport { getClient, getModularAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Connects the user's in-app EOA, the ManagedAccount's admin, for admin-only transactions such as\n * `installSeedExecutor`. Those must come from the admin directly: the new contracts reject them as\n * self-calls from the smart account. `PublishConfig.thirdweb.modularWalletMode` decides whether\n * the EOA sends gas-sponsored EIP-7702 transactions (default) or plain funded ones.\n *\n * @throws ManagedAccountPublishError `MANAGED_ACCOUNT_UNAVAILABLE` when the wallet is not\n * connected or is not an admin of `managedAddress`\n */\nexport async function getManagedAccountAdmin(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const wallet = getModularAccountWallet()\n await wallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const admin = wallet.getAccount()\n if (!admin) {\n throw new ManagedAccountPublishError(\n `Could not connect the in-app wallet that administers your publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n let isAdmin: boolean\n try {\n isAdmin = await readIsAdmin(managedAddress as Address, admin.address as Address)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n `Could not check the admins of your publishing account on ${getPublishChainName()}.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n cause,\n )\n }\n if (!isAdmin) {\n throw new ManagedAccountPublishError(\n `The connected in-app wallet (${admin.address}) is not an admin of publishing account ${managedAddress}.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n return admin\n}\n"],"mappings":";;;;;;AAiBA,eAAsB,EAAuB,GAA0C;CACrF,EAA0B;CAC1B,IAAM,IAAS,EAAwB;CACvC,MAAM,EAAO,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CAClF,IAAM,IAAQ,EAAO,WAAW;CAChC,IAAI,CAAC,GACH,MAAM,IAAI,EACR,mFAAmF,EAAoB,EAAE,0DACzG,+BACA,CACF;CAEF,IAAI;CACJ,IAAI;EACF,IAAU,MAAM,EAAY,GAA2B,EAAM,OAAkB;CACjF,SAAS,GAAO;EACd,MAAM,IAAI,EACR,4DAA4D,EAAoB,EAAE,IAClF,+BACA,GACA,CACF;CACF;CACA,IAAI,CAAC,GACH,MAAM,IAAI,EACR,gCAAgC,EAAM,QAAQ,0CAA0C,EAAe,IACvG,+BACA,CACF;CAEF,OAAO;AACT"}
@@ -0,0 +1,28 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { mt as t, nt as n, t as r, y as i } from "./chainConfig-BJ8C_RRz.js";
3
+ import { B as a, N as o } from "./publishAuthorization-CvK_coYp.js";
4
+ import { t as s } from "./publishThirdwebClient-D-K2WEeM.js";
5
+ //#region src/helpers/managedAccountAdmin.ts
6
+ var c = /* @__PURE__ */ e({ getManagedAccountAdmin: () => l });
7
+ async function l(e) {
8
+ a();
9
+ let c = o();
10
+ await c.autoConnect({
11
+ client: s(),
12
+ chain: i()
13
+ });
14
+ let l = c.getAccount();
15
+ if (!l) throw new t(`Could not connect the in-app wallet that administers your publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
16
+ let u;
17
+ try {
18
+ u = await n(e, l.address);
19
+ } catch (n) {
20
+ throw new t(`Could not check the admins of your publishing account on ${r()}.`, "MANAGED_ACCOUNT_UNAVAILABLE", e, n);
21
+ }
22
+ if (!u) throw new t(`The connected in-app wallet (${l.address}) is not an admin of publishing account ${e}.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
23
+ return l;
24
+ }
25
+ //#endregion
26
+ export { c as n, l as t };
27
+
28
+ //# sourceMappingURL=managedAccountAdmin-DS6nniiu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managedAccountAdmin-DS6nniiu.js","names":[],"sources":["../src/helpers/managedAccountAdmin.ts"],"sourcesContent":["import type { Address } from 'viem'\nimport type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishChainName } from './chainConfig'\nimport { readIsAdmin } from './contracts'\nimport { getClient, getModularAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Connects the user's in-app EOA, the ManagedAccount's admin, for admin-only transactions such as\n * `installSeedExecutor`. Those must come from the admin directly: the new contracts reject them as\n * self-calls from the smart account. `PublishConfig.thirdweb.modularWalletMode` decides whether\n * the EOA sends gas-sponsored EIP-7702 transactions (default) or plain funded ones.\n *\n * @throws ManagedAccountPublishError `MANAGED_ACCOUNT_UNAVAILABLE` when the wallet is not\n * connected or is not an admin of `managedAddress`\n */\nexport async function getManagedAccountAdmin(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const wallet = getModularAccountWallet()\n await wallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const admin = wallet.getAccount()\n if (!admin) {\n throw new ManagedAccountPublishError(\n `Could not connect the in-app wallet that administers your publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n let isAdmin: boolean\n try {\n isAdmin = await readIsAdmin(managedAddress as Address, admin.address as Address)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n `Could not check the admins of your publishing account on ${getPublishChainName()}.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n cause,\n )\n }\n if (!isAdmin) {\n throw new ManagedAccountPublishError(\n `The connected in-app wallet (${admin.address}) is not an admin of publishing account ${managedAddress}.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n return admin\n}\n"],"mappings":";;;;;;AAiBA,eAAsB,EAAuB,GAA0C;CACrF,EAA0B;CAC1B,IAAM,IAAS,EAAwB;CACvC,MAAM,EAAO,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CAClF,IAAM,IAAQ,EAAO,WAAW;CAChC,IAAI,CAAC,GACH,MAAM,IAAI,EACR,mFAAmF,EAAoB,EAAE,0DACzG,+BACA,CACF;CAEF,IAAI;CACJ,IAAI;EACF,IAAU,MAAM,EAAY,GAA2B,EAAM,OAAkB;CACjF,SAAS,GAAO;EACd,MAAM,IAAI,EACR,4DAA4D,EAAoB,EAAE,IAClF,+BACA,GACA,CACF;CACF;CACA,IAAI,CAAC,GACH,MAAM,IAAI,EACR,gCAAgC,EAAM,QAAQ,0CAA0C,EAAe,IACvG,+BACA,CACF;CAEF,OAAO;AACT"}
@@ -0,0 +1,28 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { mt as t, nt as n, t as r, y as i } from "./chainConfig-DmuPBs3D.js";
3
+ import { B as a, N as o } from "./publishAuthorization-CG23g8w2.js";
4
+ import { t as s } from "./publishThirdwebClient-BQ_KnMi5.js";
5
+ //#region src/helpers/managedAccountAdmin.ts
6
+ var c = /* @__PURE__ */ e({ getManagedAccountAdmin: () => l });
7
+ async function l(e) {
8
+ a();
9
+ let c = o();
10
+ await c.autoConnect({
11
+ client: s(),
12
+ chain: i()
13
+ });
14
+ let l = c.getAccount();
15
+ if (!l) throw new t(`Could not connect the in-app wallet that administers your publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
16
+ let u;
17
+ try {
18
+ u = await n(e, l.address);
19
+ } catch (n) {
20
+ throw new t(`Could not check the admins of your publishing account on ${r()}.`, "MANAGED_ACCOUNT_UNAVAILABLE", e, n);
21
+ }
22
+ if (!u) throw new t(`The connected in-app wallet (${l.address}) is not an admin of publishing account ${e}.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
23
+ return l;
24
+ }
25
+ //#endregion
26
+ export { c as n, l as t };
27
+
28
+ //# sourceMappingURL=managedAccountAdmin-DwFI-ZfE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managedAccountAdmin-DwFI-ZfE.js","names":[],"sources":["../src/helpers/managedAccountAdmin.ts"],"sourcesContent":["import type { Address } from 'viem'\nimport type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishChainName } from './chainConfig'\nimport { readIsAdmin } from './contracts'\nimport { getClient, getModularAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Connects the user's in-app EOA, the ManagedAccount's admin, for admin-only transactions such as\n * `installSeedExecutor`. Those must come from the admin directly: the new contracts reject them as\n * self-calls from the smart account. `PublishConfig.thirdweb.modularWalletMode` decides whether\n * the EOA sends gas-sponsored EIP-7702 transactions (default) or plain funded ones.\n *\n * @throws ManagedAccountPublishError `MANAGED_ACCOUNT_UNAVAILABLE` when the wallet is not\n * connected or is not an admin of `managedAddress`\n */\nexport async function getManagedAccountAdmin(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const wallet = getModularAccountWallet()\n await wallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const admin = wallet.getAccount()\n if (!admin) {\n throw new ManagedAccountPublishError(\n `Could not connect the in-app wallet that administers your publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n let isAdmin: boolean\n try {\n isAdmin = await readIsAdmin(managedAddress as Address, admin.address as Address)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n `Could not check the admins of your publishing account on ${getPublishChainName()}.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n cause,\n )\n }\n if (!isAdmin) {\n throw new ManagedAccountPublishError(\n `The connected in-app wallet (${admin.address}) is not an admin of publishing account ${managedAddress}.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n return admin\n}\n"],"mappings":";;;;;;AAiBA,eAAsB,EAAuB,GAA0C;CACrF,EAA0B;CAC1B,IAAM,IAAS,EAAwB;CACvC,MAAM,EAAO,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CAClF,IAAM,IAAQ,EAAO,WAAW;CAChC,IAAI,CAAC,GACH,MAAM,IAAI,EACR,mFAAmF,EAAoB,EAAE,0DACzG,+BACA,CACF;CAEF,IAAI;CACJ,IAAI;EACF,IAAU,MAAM,EAAY,GAA2B,EAAM,OAAkB;CACjF,SAAS,GAAO;EACd,MAAM,IAAI,EACR,4DAA4D,EAAoB,EAAE,IAClF,+BACA,GACA,CACF;CACF;CACA,IAAI,CAAC,GACH,MAAM,IAAI,EACR,gCAAgC,EAAM,QAAQ,0CAA0C,EAAe,IACvG,+BACA,CACF;CAEF,OAAO;AACT"}