@seedprotocol/publish 0.7.1 → 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/package.json +10 -5
  2. package/dist/chainConfig-BJ8C_RRz.js +0 -1455
  3. package/dist/chainConfig-BJ8C_RRz.js.map +0 -1
  4. package/dist/chainConfig-DWynbnb8.js +0 -1455
  5. package/dist/chainConfig-DWynbnb8.js.map +0 -1
  6. package/dist/chainConfig-DWzoOtkS.js +0 -1453
  7. package/dist/chainConfig-DWzoOtkS.js.map +0 -1
  8. package/dist/chainConfig-DXCcqaAs.js +0 -1455
  9. package/dist/chainConfig-DXCcqaAs.js.map +0 -1
  10. package/dist/chainConfig-DmuPBs3D.js +0 -1455
  11. package/dist/chainConfig-DmuPBs3D.js.map +0 -1
  12. package/dist/ensureAutomationSessionKey-BVmh030S.js +0 -84
  13. package/dist/ensureAutomationSessionKey-BVmh030S.js.map +0 -1
  14. package/dist/ensureAutomationSessionKey-ClCkti9-.js +0 -84
  15. package/dist/ensureAutomationSessionKey-ClCkti9-.js.map +0 -1
  16. package/dist/ensureAutomationSessionKey-CxpJY_uH.js +0 -84
  17. package/dist/ensureAutomationSessionKey-CxpJY_uH.js.map +0 -1
  18. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js +0 -84
  19. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js.map +0 -1
  20. package/dist/ensureAutomationSessionKey-h3zOmDr5.js +0 -84
  21. package/dist/ensureAutomationSessionKey-h3zOmDr5.js.map +0 -1
  22. package/dist/ensureModularPublishBootstrap-BImiIFJe.js +0 -23
  23. package/dist/ensureModularPublishBootstrap-BImiIFJe.js.map +0 -1
  24. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js +0 -23
  25. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js.map +0 -1
  26. package/dist/ensureModularPublishBootstrap-DRFhp-O2.js +0 -23
  27. package/dist/ensureModularPublishBootstrap-DRFhp-O2.js.map +0 -1
  28. package/dist/ensureModularPublishBootstrap-DegJnYKL.js +0 -23
  29. package/dist/ensureModularPublishBootstrap-DegJnYKL.js.map +0 -1
  30. package/dist/ensureModularPublishBootstrap-E4l8no0p.js +0 -23
  31. package/dist/ensureModularPublishBootstrap-E4l8no0p.js.map +0 -1
  32. package/dist/ensureSmartWalletThenPublish-0nKg13WN.js +0 -47
  33. package/dist/ensureSmartWalletThenPublish-0nKg13WN.js.map +0 -1
  34. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js +0 -47
  35. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js.map +0 -1
  36. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js +0 -47
  37. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js.map +0 -1
  38. package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js +0 -47
  39. package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js.map +0 -1
  40. package/dist/ensureSmartWalletThenPublish-UklyVBu9.js +0 -47
  41. package/dist/ensureSmartWalletThenPublish-UklyVBu9.js.map +0 -1
  42. package/dist/managedAccountAdmin-B4HkLWWE.js +0 -28
  43. package/dist/managedAccountAdmin-B4HkLWWE.js.map +0 -1
  44. package/dist/managedAccountAdmin-ByEX_Eg2.js +0 -28
  45. package/dist/managedAccountAdmin-ByEX_Eg2.js.map +0 -1
  46. package/dist/managedAccountAdmin-C5UqbkQ0.js +0 -28
  47. package/dist/managedAccountAdmin-C5UqbkQ0.js.map +0 -1
  48. package/dist/managedAccountAdmin-DS6nniiu.js +0 -28
  49. package/dist/managedAccountAdmin-DS6nniiu.js.map +0 -1
  50. package/dist/managedAccountAdmin-DwFI-ZfE.js +0 -28
  51. package/dist/managedAccountAdmin-DwFI-ZfE.js.map +0 -1
  52. package/dist/publishAuthorization-C-XYb9Ef.js +0 -4034
  53. package/dist/publishAuthorization-C-XYb9Ef.js.map +0 -1
  54. package/dist/publishAuthorization-CG23g8w2.js +0 -3987
  55. package/dist/publishAuthorization-CG23g8w2.js.map +0 -1
  56. package/dist/publishAuthorization-CvK_coYp.js +0 -4011
  57. package/dist/publishAuthorization-CvK_coYp.js.map +0 -1
  58. package/dist/publishAuthorization-DgDI4zor.js +0 -4011
  59. package/dist/publishAuthorization-DgDI4zor.js.map +0 -1
  60. package/dist/publishAuthorization-S3ofoXPN.js +0 -4059
  61. package/dist/publishAuthorization-S3ofoXPN.js.map +0 -1
  62. package/dist/publishThirdwebClient-BFx_M2Uy.js +0 -18
  63. package/dist/publishThirdwebClient-BFx_M2Uy.js.map +0 -1
  64. package/dist/publishThirdwebClient-BQ_KnMi5.js +0 -18
  65. package/dist/publishThirdwebClient-BQ_KnMi5.js.map +0 -1
  66. package/dist/publishThirdwebClient-BmqsJCjp.js +0 -18
  67. package/dist/publishThirdwebClient-BmqsJCjp.js.map +0 -1
  68. package/dist/publishThirdwebClient-CO18ST7C.js +0 -18
  69. package/dist/publishThirdwebClient-CO18ST7C.js.map +0 -1
  70. package/dist/publishThirdwebClient-D-K2WEeM.js +0 -18
  71. package/dist/publishThirdwebClient-D-K2WEeM.js.map +0 -1
  72. package/dist/resolveRevokeAccount-9-OzXVdp.js +0 -38
  73. package/dist/resolveRevokeAccount-9-OzXVdp.js.map +0 -1
  74. package/dist/resolveRevokeAccount-CXTz4-wI.js +0 -38
  75. package/dist/resolveRevokeAccount-CXTz4-wI.js.map +0 -1
  76. package/dist/resolveRevokeAccount-CXa5XlOv.js +0 -38
  77. package/dist/resolveRevokeAccount-CXa5XlOv.js.map +0 -1
  78. package/dist/resolveRevokeAccount-DsNod8ti.js +0 -38
  79. package/dist/resolveRevokeAccount-DsNod8ti.js.map +0 -1
  80. package/dist/resolveRevokeAccount-QgZ6YZuS.js +0 -38
  81. package/dist/resolveRevokeAccount-QgZ6YZuS.js.map +0 -1
  82. package/dist/worker-BQN6N0W0.js +0 -72
  83. package/dist/worker-BQN6N0W0.js.map +0 -1
  84. package/dist/worker-CJRUAOAn.js +0 -69
  85. package/dist/worker-CJRUAOAn.js.map +0 -1
  86. package/dist/worker-CN7zg73B.js +0 -69
  87. package/dist/worker-CN7zg73B.js.map +0 -1
  88. package/dist/worker-FmHZbku5.js +0 -72
  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,47 +0,0 @@
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-DXCcqaAs.js";
3
- import { A as c, h as l, j as u, z as d } from "./publishAuthorization-S3ofoXPN.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-UklyVBu9.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureSmartWalletThenPublish-UklyVBu9.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"}
@@ -1,28 +0,0 @@
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-DWzoOtkS.js";
3
- import { B as a, N as o } from "./publishAuthorization-DgDI4zor.js";
4
- import { t as s } from "./publishThirdwebClient-CO18ST7C.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-B4HkLWWE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"managedAccountAdmin-B4HkLWWE.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"}
@@ -1,28 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,28 +0,0 @@
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-DXCcqaAs.js";
3
- import { B as a, N as o } from "./publishAuthorization-S3ofoXPN.js";
4
- import { t as s } from "./publishThirdwebClient-BFx_M2Uy.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-C5UqbkQ0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"managedAccountAdmin-C5UqbkQ0.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"}
@@ -1,28 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,28 +0,0 @@
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
@@ -1 +0,0 @@
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"}