@seedprotocol/publish 0.7.11-next.1384.g8b47246 → 0.7.11

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 (30) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/{chainConfig-DK_5pgXF.js → chainConfig-nYXoVL1s.js} +9 -9
  3. package/dist/{chainConfig-DK_5pgXF.js.map → chainConfig-nYXoVL1s.js.map} +1 -1
  4. package/dist/{ensureAutomationSessionKey-BwCXLjcX.js → ensureAutomationSessionKey-BaaHU2Wb.js} +3 -3
  5. package/dist/{ensureAutomationSessionKey-BwCXLjcX.js.map → ensureAutomationSessionKey-BaaHU2Wb.js.map} +1 -1
  6. package/dist/{ensureModularPublishBootstrap-DZcceVDq.js → ensureModularPublishBootstrap-NzYQ1MfY.js} +3 -3
  7. package/dist/{ensureModularPublishBootstrap-DZcceVDq.js.map → ensureModularPublishBootstrap-NzYQ1MfY.js.map} +1 -1
  8. package/dist/{ensureSmartWalletThenPublish-BW1_dW3n.js → ensureSmartWalletThenPublish-CpuDoo5O.js} +2 -2
  9. package/dist/{ensureSmartWalletThenPublish-BW1_dW3n.js.map → ensureSmartWalletThenPublish-CpuDoo5O.js.map} +1 -1
  10. package/dist/helpers/assertStorageBoundToIdentity.d.ts.map +1 -1
  11. package/dist/helpers/enrollPublishAutomation.d.ts +5 -1
  12. package/dist/helpers/enrollPublishAutomation.d.ts.map +1 -1
  13. package/dist/index.js +50 -50
  14. package/dist/index.js.map +1 -1
  15. package/dist/{managedAccountAdmin-Cb1ut9V4.js → managedAccountAdmin-BeSXTCeH.js} +2 -2
  16. package/dist/{managedAccountAdmin-Cb1ut9V4.js.map → managedAccountAdmin-BeSXTCeH.js.map} +1 -1
  17. package/dist/{publishAuthorization-C_VidnTq.js → publishAuthorization-CVl5ZK5B.js} +24 -21
  18. package/dist/publishAuthorization-CVl5ZK5B.js.map +1 -0
  19. package/dist/{resolveRevokeAccount-CCJ_7quC.js → resolveRevokeAccount-DRrUY9FR.js} +2 -2
  20. package/dist/{resolveRevokeAccount-CCJ_7quC.js.map → resolveRevokeAccount-DRrUY9FR.js.map} +1 -1
  21. package/dist/services/domainOwnership/index.d.ts.map +1 -1
  22. package/dist/services/publishAuthorization/index.d.ts +1 -1
  23. package/dist/services/publishAuthorization/index.d.ts.map +1 -1
  24. package/dist/services/publishedBy/index.d.ts.map +1 -1
  25. package/dist/thirdweb.js +39 -38
  26. package/dist/thirdweb.js.map +1 -1
  27. package/dist/{worker-C7XeFMWh.js → worker-D1czx7Yg.js} +2 -2
  28. package/dist/{worker-C7XeFMWh.js.map → worker-D1czx7Yg.js.map} +1 -1
  29. package/package.json +7 -7
  30. package/dist/publishAuthorization-C_VidnTq.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"managedAccountAdmin-Cb1ut9V4.js","names":["__exportAll","ManagedAccountPublishError","readIsAdmin","getModularAccountWallet","syncPublishInAppAuthToken","getPublishThirdwebChain","getClient","getPublishChainName","managedAccountAdmin_exports","getManagedAccountAdmin","wallet","admin","managedAddress","isAdmin","cause"],"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,eAAsBS,EAAuB,GAA0C;CACrF,EAA0B;CAC1B,IAAMC,IAASP,EAAwB;CACvC,MAAMO,EAAO,YAAY;EAAE,QAAQJ,EAAU;EAAG,OAAOD,EAAwB;CAAE,CAAC;CAClF,IAAMM,IAAQD,EAAO,WAAW;CAChC,IAAI,CAACC,GACH,MAAM,IAAIV,EACR,mFAAmFM,EAAoB,EAAE,0DACzG,+BACAK,CACF;CAEF,IAAIC;CACJ,IAAI;EACF,IAAU,MAAMX,EAAYU,GAA2BD,EAAM,OAAkB;CACjF,SAASG,GAAO;EACd,MAAM,IAAIb,EACR,4DAA4DM,EAAoB,EAAE,IAClF,+BACAK,GACAE,CACF;CACF;CACA,IAAI,CAACD,GACH,MAAM,IAAIZ,EACR,gCAAgCU,EAAM,QAAQ,0CAA0CC,EAAe,IACvG,+BACAA,CACF;CAEF,OAAOD;AACT"}
1
+ {"version":3,"file":"managedAccountAdmin-BeSXTCeH.js","names":["__exportAll","ManagedAccountPublishError","readIsAdmin","getModularAccountWallet","syncPublishInAppAuthToken","getPublishThirdwebChain","getClient","getPublishChainName","managedAccountAdmin_exports","getManagedAccountAdmin","wallet","admin","managedAddress","isAdmin","cause"],"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,eAAsBS,EAAuB,GAA0C;CACrF,EAA0B;CAC1B,IAAMC,IAASP,EAAwB;CACvC,MAAMO,EAAO,YAAY;EAAE,QAAQJ,EAAU;EAAG,OAAOD,EAAwB;CAAE,CAAC;CAClF,IAAMM,IAAQD,EAAO,WAAW;CAChC,IAAI,CAACC,GACH,MAAM,IAAIV,EACR,mFAAmFM,EAAoB,EAAE,0DACzG,+BACAK,CACF;CAEF,IAAIC;CACJ,IAAI;EACF,IAAU,MAAMX,EAAYU,GAA2BD,EAAM,OAAkB;CACjF,SAASG,GAAO;EACd,MAAM,IAAIb,EACR,4DAA4DM,EAAoB,EAAE,IAClF,+BACAK,GACAE,CACF;CACF;CACA,IAAI,CAACD,GACH,MAAM,IAAIZ,EACR,gCAAgCU,EAAM,QAAQ,0CAA0CC,EAAe,IACvG,+BACAA,CACF;CAEF,OAAOD;AACT"}
@@ -1,4 +1,4 @@
1
- import { Ct as e, D as t, Dt as n, O as r, Ot as i, Tt as a, Ut as o, i as s, k as c, kt as l } from "./chainConfig-DK_5pgXF.js";
1
+ import { Ct as e, D as t, Dt as n, O as r, Ot as i, Tt as a, Ut as o, i as s, k as c, kt as l } from "./chainConfig-nYXoVL1s.js";
2
2
  import { keccak256 as u, toUtf8Bytes as d } from "ethers";
3
3
  import { SchemaEncoder as f, SchemaRegistry as p, ZERO_BYTES32 as m } from "@ethereum-attestation-service/eas-sdk";
4
4
  import { createContext as h, useContext as g } from "react";
@@ -112,21 +112,23 @@ function W(e) {
112
112
  ]);
113
113
  }
114
114
  async function G(e) {
115
- let t = z(e.wallet), r = e.ensureSchema === !1 ? H() : await U(e.wallet), a = V("identity", e.identity), o = V("sessionKey", e.sessionKey), c = e.app?.trim() ? V("app", e.app) : R, l = e.grantedAt ?? Math.floor(Date.now() / 1e3), u = typeof e.expiresAt == "number" && e.expiresAt > 0 ? Math.trunc(e.expiresAt) : 0, d = e.scopes ?? S, f = O(e.permissionsHash ?? P(N({ expiresAt: u > 0 ? u : void 0 }), d === S ? "publish,revoke" : d));
116
- if (f === m) throw Error("@seedprotocol/publish: attestPublishAuthorization requires a non-zero permissionsHash");
117
- let p = typeof e.expirationTime == "number" && e.expirationTime > 0 ? e.expirationTime : u > 0 ? u : l + _, h = W({
118
- identity: a,
119
- sessionKey: o,
120
- app: c,
121
- scopes: d,
122
- grantedAt: l,
123
- expiresAt: u,
124
- permissionsHash: f
115
+ let t = z(e.wallet), r = V("identity", e.identity);
116
+ if (t.address.toLowerCase() !== r.toLowerCase()) throw Error(`@seedprotocol/publish: attestPublishAuthorization must be sent by the identity (${r}), not ${t.address}`);
117
+ let a = V("sessionKey", e.sessionKey), o = e.app?.trim() ? V("app", e.app) : R, c = e.grantedAt ?? Math.floor(Date.now() / 1e3), l = typeof e.expiresAt == "number" && e.expiresAt > 0 ? Math.trunc(e.expiresAt) : 0, u = e.scopes ?? S, d = O(e.permissionsHash ?? P(N({ expiresAt: l > 0 ? l : void 0 }), u === S ? "publish,revoke" : u));
118
+ if (d === m) throw Error("@seedprotocol/publish: attestPublishAuthorization requires a non-zero permissionsHash");
119
+ let f = typeof e.expirationTime == "number" && e.expirationTime > 0 ? e.expirationTime : l > 0 ? l : c + _, p = e.ensureSchema === !1 ? H() : await U(e.wallet), h = W({
120
+ identity: r,
121
+ sessionKey: a,
122
+ app: o,
123
+ scopes: u,
124
+ grantedAt: c,
125
+ expiresAt: l,
126
+ permissionsHash: d
125
127
  }), g = await B(t, i({
126
- schema: r,
128
+ schema: p,
127
129
  data: {
128
- recipient: o,
129
- expirationTime: BigInt(p),
130
+ recipient: a,
131
+ expirationTime: BigInt(f),
130
132
  revocable: !0,
131
133
  refUID: m,
132
134
  data: h,
@@ -138,11 +140,11 @@ async function G(e) {
138
140
  if (!y || !D(y)) throw Error("@seedprotocol/publish: attestPublishAuthorization failed — could not parse attestation UID");
139
141
  return {
140
142
  uid: y,
141
- schemaUid: r,
142
- permissionsHash: f,
143
- grantedAt: l,
144
- expiresAt: u,
145
- expirationTime: p
143
+ schemaUid: p,
144
+ permissionsHash: d,
145
+ grantedAt: c,
146
+ expiresAt: l,
147
+ expirationTime: f
146
148
  };
147
149
  }
148
150
  async function K(e) {
@@ -165,7 +167,8 @@ async function q(e) {
165
167
  decoded: n,
166
168
  assess: w({
167
169
  decoded: n,
168
- expirationTime: r
170
+ expirationTime: r,
171
+ revoked: t.revoked
169
172
  }),
170
173
  expirationTime: r
171
174
  };
@@ -173,4 +176,4 @@ async function q(e) {
173
176
  //#endregion
174
177
  export { G as a, H as c, N as d, P as f, A as g, k as h, q as i, K as l, j as m, x as n, W as o, F as p, C as r, U as s, y as t, M as u };
175
178
 
176
- //# sourceMappingURL=publishAuthorization-C_VidnTq.js.map
179
+ //# sourceMappingURL=publishAuthorization-CVl5ZK5B.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishAuthorization-CVl5ZK5B.js","names":["ZERO_ADDRESS","isPublishWallet","prepareNameSchemaAttestation","getAttestationUidFromReceipt","getSchemaRecord","prepareEasAttest","isSeedTxSender","waitForPublishReceipt","getPublishConfig","registerSchema","prepareEasMultiRevoke","PUBLISH_AUTHORIZATION_SCHEMA_DEF$1","PUBLISH_AUTHORIZATION_SCHEMA_NAME$1","PUBLISH_AUTHORIZATION_SCOPES$1","PublishConfigContext","createContext","usePublishConfig","config","useContext","approvedTargetsForAutomationPublish","module","PUBLISH_AUTOMATION_SCOPES","buildAutomationSessionKeyPermissions","out","params","hashAutomationSessionKeyPermissions","material","permissions","a","scopes","keccak256","toUtf8Bytes","toThirdwebSessionKeyPermissions","base","RESOLVER_ADDRESS","REVOCABLE","ZERO_ADDRESS$1","resolveTxSender","account","sendAndWait","result","txSender","tx","assertAddress","t","addr","label","getPublishAuthorizationSchemaUid","SchemaRegistry","PUBLISH_AUTHORIZATION_SCHEMA_DEF","ensurePublishAuthorizationSchema","sender","schemaUid","PUBLISH_AUTHORIZATION_SCHEMA_NAME","encodePublishAuthorizationAttestationData","SchemaEncoder","normalizeBytes32Hex","attestPublishAuthorization","identity","sessionKey","app","grantedAt","expiresAt","PUBLISH_AUTHORIZATION_SCOPES","permissionsHash","ZERO_BYTES32","expirationTime","PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS","data","receipt","uid","easContractAddress","isValidEasAttestationUid","revokePublishAuthorization","assessPublishAuthorizationLive","row","getPublishAuthorizationFromEas","r","decoded","decodePublishAuthorizationData","assessPublishAuthorization"],"sources":["../src/react/PublishConfigContext.tsx","../src/helpers/approvedTargetsForAutomationPublish.ts","../src/helpers/automationSessionKeyPermissions.ts","../src/services/publishAuthorization/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { PublishConfig } from '../config'\n\nexport const PublishConfigContext = createContext<PublishConfig | null>(null)\n\nexport function usePublishConfig(): PublishConfig {\n const config = useContext(PublishConfigContext)\n if (!config) {\n throw new Error(\n 'usePublishConfig: PublishConfig is missing. Pass config to PublishProvider or call initPublish() before render.',\n )\n }\n return config\n}\n","import { getPublishConfig } from '../config'\n\n/**\n * Allowlisted call targets for session keys on a ManagedAccount.\n * Returns only the configured Seed executor module — never the ManagedAccount or raw EAS\n * (those would allow `setEas` / arbitrary attestations).\n *\n * @throws if `modularAccountModuleContract` is unset or invalid\n */\nexport function approvedTargetsForAutomationPublish(): `0x${string}`[] {\n const module = getPublishConfig().modularAccountModuleContract?.trim()\n if (!module || !/^0x[0-9a-fA-F]{40}$/.test(module)) {\n throw new Error(\n '@seedprotocol/publish: session keys require PublishConfig.modularAccountModuleContract ' +\n '(their only approved target is the Seed executor module).',\n )\n }\n return [module.toLowerCase() as `0x${string}`]\n}\n","import { keccak256, toUtf8Bytes } from 'ethers'\nimport { approvedTargetsForAutomationPublish } from './approvedTargetsForAutomationPublish'\n\n/** Fixed v1 scopes for publish automation grants. */\nexport const PUBLISH_AUTOMATION_SCOPES = 'publish,revoke' as const\n\nexport type AutomationSessionKeyPermissions = {\n approvedTargets: `0x${string}`[]\n nativeTokenLimitPerTransaction: number\n /** Unix seconds; omit for Thirdweb default long window. */\n expiresAt?: number\n}\n\n/**\n * Canonical permissions for an automation session key (module-only targets).\n */\nexport function buildAutomationSessionKeyPermissions(params?: {\n expiresAt?: number\n}): AutomationSessionKeyPermissions {\n const approvedTargets = approvedTargetsForAutomationPublish()\n const out: AutomationSessionKeyPermissions = {\n approvedTargets,\n nativeTokenLimitPerTransaction: 0,\n }\n if (typeof params?.expiresAt === 'number' && params.expiresAt > 0) {\n out.expiresAt = Math.trunc(params.expiresAt)\n }\n return out\n}\n\n/**\n * Deterministic permissions hash for the PublishAuthorization sidecar.\n * Material: sorted targets | nativeLimit | expiresAt (0 if unset) | scopes\n */\nexport function hashAutomationSessionKeyPermissions(\n permissions: AutomationSessionKeyPermissions,\n scopes: string = PUBLISH_AUTOMATION_SCOPES,\n): `0x${string}` {\n const targets = [...permissions.approvedTargets].map((a) => a.toLowerCase()).sort().join(',')\n const limit = permissions.nativeTokenLimitPerTransaction\n const expiresAt = permissions.expiresAt ?? 0\n const material = `${targets}|${limit}|${expiresAt}|${scopes.trim()}`\n return keccak256(toUtf8Bytes(material)) as `0x${string}`\n}\n\n/** Shape passed to Thirdweb `addSessionKey` / `shouldUpdateSessionKey`. */\nexport function toThirdwebSessionKeyPermissions(permissions: AutomationSessionKeyPermissions): {\n approvedTargets: `0x${string}`[]\n nativeTokenLimitPerTransaction: number\n permissionEndTimestamp?: Date\n} {\n const base = {\n approvedTargets: permissions.approvedTargets,\n nativeTokenLimitPerTransaction: permissions.nativeTokenLimitPerTransaction,\n }\n if (permissions.expiresAt != null && permissions.expiresAt > 0) {\n return {\n ...base,\n permissionEndTimestamp: new Date(permissions.expiresAt * 1000),\n }\n }\n return base\n}\n","import {\n PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS,\n PUBLISH_AUTHORIZATION_SCHEMA_DEF,\n PUBLISH_AUTHORIZATION_SCHEMA_NAME,\n PUBLISH_AUTHORIZATION_SCOPES,\n assessPublishAuthorization,\n decodePublishAuthorizationData,\n getPublishAuthorizationFromEas,\n type PublishAuthorizationAssessResult,\n type PublishAuthorizationDecoded,\n} from '@seedprotocol/eas'\nimport { SchemaEncoder, ZERO_BYTES32 } from '@ethereum-attestation-service/eas-sdk'\nimport { SchemaRegistry } from '@ethereum-attestation-service/eas-sdk'\nimport { prepareEasAttest, prepareEasMultiRevoke } from '~/helpers/easDirect'\nimport { getSchemaRecord, registerSchema } from '~/helpers/schemaRegistry'\nimport { prepareNameSchemaAttestation } from '~/helpers/nameSchemaAttestation'\nimport { waitForPublishReceipt } from '~/helpers/chainClient'\nimport { getPublishConfig } from '~/config'\nimport {\n isPublishWallet,\n isSeedTxSender,\n type PublishWallet,\n type SeedTxSender,\n} from '~/helpers/seedSigner'\nimport { getAttestationUidFromReceipt } from '~/helpers/easDirect'\nimport { normalizeBytes32Hex, isValidEasAttestationUid } from '@seedprotocol/eas'\nimport {\n buildAutomationSessionKeyPermissions,\n hashAutomationSessionKeyPermissions,\n PUBLISH_AUTOMATION_SCOPES,\n} from '~/helpers/automationSessionKeyPermissions'\n\nexport {\n PUBLISH_AUTHORIZATION_SCHEMA_DEF,\n PUBLISH_AUTHORIZATION_SCHEMA_NAME,\n PUBLISH_AUTHORIZATION_SCOPES,\n} from '@seedprotocol/eas'\n\nconst RESOLVER_ADDRESS = '0x0000000000000000000000000000000000000000'\nconst REVOCABLE = true\nconst ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'\n\nfunction resolveTxSender(account: PublishWallet | SeedTxSender): SeedTxSender {\n if (isPublishWallet(account)) return account.txSender\n if (isSeedTxSender(account)) return account\n throw new Error(\n '@seedprotocol/publish: publish authorization write APIs require a PublishWallet or SeedTxSender',\n )\n}\n\nasync function sendAndWait(\n txSender: SeedTxSender,\n tx: Parameters<SeedTxSender['sendTransaction']>[0],\n) {\n const result = await txSender.sendTransaction(tx)\n return waitForPublishReceipt(result.transactionHash)\n}\n\nfunction assertAddress(label: string, addr: string): `0x${string}` {\n const t = addr.trim()\n if (!/^0x[0-9a-fA-F]{40}$/.test(t)) {\n throw new Error(`@seedprotocol/publish: ${label} must be a valid address`)\n }\n return t as `0x${string}`\n}\n\n/** Deterministic on-chain schema UID for {@link PUBLISH_AUTHORIZATION_SCHEMA_DEF}. */\nexport function getPublishAuthorizationSchemaUid(): `0x${string}` {\n return SchemaRegistry.getSchemaUID(\n PUBLISH_AUTHORIZATION_SCHEMA_DEF,\n RESOLVER_ADDRESS as `0x${string}`,\n REVOCABLE,\n ) as `0x${string}`\n}\n\n/**\n * Registers the PublishAuthorization EAS schema (if missing) and creates a Schema #1 name attestation.\n */\nexport async function ensurePublishAuthorizationSchema(\n account: PublishWallet | SeedTxSender,\n): Promise<`0x${string}`> {\n const sender = resolveTxSender(account)\n const schemaUid = getPublishAuthorizationSchemaUid()\n const onChain = await getSchemaRecord(schemaUid)\n if (!onChain) {\n await sendAndWait(\n sender,\n registerSchema({\n schema: PUBLISH_AUTHORIZATION_SCHEMA_DEF,\n resolverAddress: RESOLVER_ADDRESS,\n revocable: REVOCABLE,\n }),\n )\n await sendAndWait(\n sender,\n prepareNameSchemaAttestation({\n schemaUid,\n schemaName: PUBLISH_AUTHORIZATION_SCHEMA_NAME,\n }),\n )\n }\n return schemaUid\n}\n\nexport function encodePublishAuthorizationAttestationData(params: {\n identity: string\n sessionKey: string\n app: string\n scopes: string\n grantedAt: number\n expiresAt: number\n permissionsHash: string\n}): `0x${string}` {\n const schemaEncoder = new SchemaEncoder(PUBLISH_AUTHORIZATION_SCHEMA_DEF)\n const encodedData = schemaEncoder.encodeData([\n { name: 'identity', value: params.identity as `0x${string}`, type: 'address' },\n { name: 'sessionKey', value: params.sessionKey as `0x${string}`, type: 'address' },\n { name: 'app', value: params.app as `0x${string}`, type: 'address' },\n { name: 'scopes', value: params.scopes, type: 'string' },\n { name: 'grantedAt', value: params.grantedAt, type: 'uint64' },\n { name: 'expiresAt', value: params.expiresAt, type: 'uint64' },\n {\n name: 'permissionsHash',\n value: normalizeBytes32Hex(params.permissionsHash) as `0x${string}`,\n type: 'bytes32',\n },\n ])\n return encodedData as `0x${string}`\n}\n\nexport type AttestPublishAuthorizationParams = {\n /** The ManagedAccount (identity) wallet, which becomes the EAS attester. Any other sender throws. */\n wallet: PublishWallet | SeedTxSender\n identity: string\n sessionKey: string\n /** Optional app label address; defaults to zero address. */\n app?: string\n scopes?: string\n grantedAt?: number\n expiresAt?: number\n permissionsHash?: string\n ensureSchema?: boolean\n /** Override EAS expirationTime (unix seconds). */\n expirationTime?: number\n}\n\nexport type AttestPublishAuthorizationResult = {\n uid: `0x${string}`\n schemaUid: `0x${string}`\n permissionsHash: `0x${string}`\n grantedAt: number\n expiresAt: number\n expirationTime: number\n}\n\n/**\n * ManagedAccount attests a PublishAuthorization grant (recipient = session key).\n */\nexport async function attestPublishAuthorization(\n params: AttestPublishAuthorizationParams,\n): Promise<AttestPublishAuthorizationResult> {\n const sender = resolveTxSender(params.wallet)\n const identity = assertAddress('identity', params.identity)\n if (sender.address.toLowerCase() !== identity.toLowerCase()) {\n throw new Error(\n `@seedprotocol/publish: attestPublishAuthorization must be sent by the identity (${identity}), not ${sender.address}`,\n )\n }\n const sessionKey = assertAddress('sessionKey', params.sessionKey)\n const app = params.app?.trim()\n ? assertAddress('app', params.app)\n : (ZERO_ADDRESS as `0x${string}`)\n\n const grantedAt = params.grantedAt ?? Math.floor(Date.now() / 1000)\n const expiresAt =\n typeof params.expiresAt === 'number' && params.expiresAt > 0\n ? Math.trunc(params.expiresAt)\n : 0\n const scopes = params.scopes ?? PUBLISH_AUTHORIZATION_SCOPES\n\n const permissionsHash = normalizeBytes32Hex(\n params.permissionsHash ??\n hashAutomationSessionKeyPermissions(\n buildAutomationSessionKeyPermissions({\n expiresAt: expiresAt > 0 ? expiresAt : undefined,\n }),\n scopes === PUBLISH_AUTHORIZATION_SCOPES ? PUBLISH_AUTOMATION_SCOPES : scopes,\n ),\n ) as `0x${string}`\n\n if (permissionsHash === ZERO_BYTES32) {\n throw new Error(\n '@seedprotocol/publish: attestPublishAuthorization requires a non-zero permissionsHash',\n )\n }\n\n const expirationTime =\n typeof params.expirationTime === 'number' && params.expirationTime > 0\n ? params.expirationTime\n : expiresAt > 0\n ? expiresAt\n : grantedAt + PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS\n\n // Register the schema only once the inputs are known good, so a bad call spends no gas.\n const schemaUid =\n params.ensureSchema === false\n ? getPublishAuthorizationSchemaUid()\n : await ensurePublishAuthorizationSchema(params.wallet)\n\n const data = encodePublishAuthorizationAttestationData({\n identity,\n sessionKey,\n app,\n scopes,\n grantedAt,\n expiresAt,\n permissionsHash,\n })\n\n const tx = prepareEasAttest({\n schema: schemaUid,\n data: {\n recipient: sessionKey,\n expirationTime: BigInt(expirationTime),\n revocable: true,\n refUID: ZERO_BYTES32 as `0x${string}`,\n data,\n value: 0n,\n },\n })\n\n const receipt = await sendAndWait(sender, tx)\n if (!receipt) {\n throw new Error('@seedprotocol/publish: attestPublishAuthorization failed — no receipt')\n }\n const { easContractAddress } = getPublishConfig()\n const uid = getAttestationUidFromReceipt(receipt, easContractAddress)\n if (!uid || !isValidEasAttestationUid(uid)) {\n throw new Error(\n '@seedprotocol/publish: attestPublishAuthorization failed — could not parse attestation UID',\n )\n }\n\n return {\n uid: uid as `0x${string}`,\n schemaUid,\n permissionsHash,\n grantedAt,\n expiresAt,\n expirationTime,\n }\n}\n\n/**\n * Revoke a PublishAuthorization sidecar (must be signed by the original ManagedAccount attester).\n */\nexport async function revokePublishAuthorization(params: {\n wallet: PublishWallet | SeedTxSender\n uid: string\n schemaUid?: string\n}): Promise<void> {\n const sender = resolveTxSender(params.wallet)\n const schemaUid = (params.schemaUid ?? getPublishAuthorizationSchemaUid()) as `0x${string}`\n const uid = normalizeBytes32Hex(params.uid) as `0x${string}`\n if (!isValidEasAttestationUid(uid)) {\n throw new Error(\n '@seedprotocol/publish: revokePublishAuthorization requires a valid attestation uid',\n )\n }\n\n const tx = prepareEasMultiRevoke([\n {\n schema: schemaUid,\n data: [{ uid }],\n },\n ])\n const receipt = await sendAndWait(sender, tx)\n if (!receipt) {\n throw new Error('@seedprotocol/publish: revokePublishAuthorization failed — no receipt')\n }\n}\n\nexport type AssessPublishAuthorizationLiveResult = {\n uid: string\n decoded: PublishAuthorizationDecoded\n assess: PublishAuthorizationAssessResult\n expirationTime?: number | null\n}\n\n/**\n * Load a PublishAuthorization attestation by uid (via identity filter + client match) and assess.\n * Prefer filtering with {@link getPublishAuthorizationFromEas} when you know identity/sessionKey.\n */\nexport async function assessPublishAuthorizationLive(params: {\n uid: string\n identities: string[]\n}): Promise<AssessPublishAuthorizationLiveResult | null> {\n const rows = await getPublishAuthorizationFromEas({\n identities: params.identities,\n excludeRevoked: false,\n })\n const row = rows.find((r) => r.id?.toLowerCase() === params.uid.toLowerCase())\n if (!row) return null\n const decoded = decodePublishAuthorizationData(row.decodedDataJson ?? '[]')\n const expirationTime =\n typeof row.expirationTime === 'number'\n ? row.expirationTime\n : typeof row.expirationTime === 'string'\n ? Number(row.expirationTime)\n : null\n return {\n uid: row.id,\n decoded,\n assess: assessPublishAuthorization({ decoded, expirationTime, revoked: row.revoked }),\n expirationTime,\n }\n}\n"],"mappings":";;;;;;AAGA,IAAac,IAAuBC,EAAoC,IAAI;AAE5E,SAAgBC,IAAkC;CAChD,IAAMC,IAASC,EAAWJ,CAAoB;CAC9C,IAAI,CAACG,GACH,MAAU,MACR,iHACF;CAEF,OAAOA;AACT;;;ACJA,SAAgBE,IAAuD;CACrE,IAAMC,IAASZ,EAAiB,CAAC,CAAC,8BAA8B,KAAK;CACrE,IAAI,CAACY,KAAU,CAAC,sBAAsB,KAAKA,CAAM,GAC/C,MAAU,MACR,kJAEF;CAEF,OAAO,CAACA,EAAO,YAAY,CAAkB;AAC/C;;;ACdA,IAAaC,IAA4B;AAYzC,SAAgBC,EAAqC,GAEjB;CAElC,IAAMC,IAAuC;EAC3C,iBAFsBJ,EAEtB;EACA,gCAAgC;CAClC;CA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,CAC0C,CAAE,GAE1C,MAAU,MAAM,uEAAuE;AAE3F;AAaA,eAAsBsB,EAA+B,GAGI;CAKvD,IAAMC,KAAM,MAJOC,EAA+B;EAChD,YAAYpD,EAAO;EACnB,gBAAgB;CAClB,CAAC,EAAA,CACgB,MAAM,MAAMqD,EAAE,IAAI,YAAY,MAAMrD,EAAO,IAAI,YAAY,CAAC;CAC7E,IAAI,CAACmD,GAAK,OAAO;CACjB,IAAMG,IAAUC,EAA+BJ,EAAI,mBAAmB,IAAI,GACpET,IACJ,OAAOS,EAAI,kBAAmB,WAC1BA,EAAI,iBACJ,OAAOA,EAAI,kBAAmB,WAC5B,OAAOA,EAAI,cAAc,IACzB;CACR,OAAO;EACL,KAAKA,EAAI;EACT;EACA,QAAQK,EAA2B;GAAE;GAAS;GAAgB,SAASL,EAAI;EAAQ,CAAC;EACpF;CACF;AACF"}
@@ -1,4 +1,4 @@
1
- import { J as e, K as t, U as n, V as r, Z as i, gt as a, i as o, rt as s } from "./chainConfig-DK_5pgXF.js";
1
+ import { J as e, K as t, U as n, V as r, Z as i, gt as a, i as o, rt as s } from "./chainConfig-nYXoVL1s.js";
2
2
  import { getGetAdditionalSyncAddresses as c } from "@seedprotocol/sdk";
3
3
  //#region src/helpers/resolveRevokeAccount.ts
4
4
  async function l(l) {
@@ -34,4 +34,4 @@ async function l(l) {
34
34
  //#endregion
35
35
  export { l as resolveRevokeAccount };
36
36
 
37
- //# sourceMappingURL=resolveRevokeAccount-CCJ_7quC.js.map
37
+ //# sourceMappingURL=resolveRevokeAccount-DRrUY9FR.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveRevokeAccount-CCJ_7quC.js","names":["isSmartWalletDeployed","getSmartWalletAddressForAdmin","getManagedAccountWallet","getConnectedManagedAccountAddress","syncPublishInAppAuthToken","getPublishThirdwebChain","getPublishConfig","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 syncPublishInAppAuthToken,\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 // Same as ensureModularPublishBootstrap: the managed wallet reads the in-app session token.\n syncPublishInAppAuthToken()\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":";;;AAuBA,eAAsBQ,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,MAAMjB,EAA8BU,EAAQ,OAAO;EAIjF,IAHsBD,EAAS,YAG3B,MAFiBQ,EAAsB,YAErB,KAAgBJ,GAA0B;GAC9D,IAAMK,IAAiBL,IACnB,MAAMX,EAAkCE,EAAwB,CAAC,CAAC,CAAC,YAAYa,CAAqB,IACpGA;GAEJ,IAAI,MADmBlB,EAAsBmB,CAAc,GAC7C;IAEZ,EAA0B;IAC1B,IAAMC,IAAuBlB,EAAwB;IACrD,MAAMkB,EAAqB,YAAY;KACrC,QAAQb,EAAU;KAClB,OAAOF,EAAwB;IACjC,CAAC;IACD,IAAMgB,IAAiBD,EAAqB,WAAW;IACvD,IAAIC,GACF,OAAOA;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAIP,GAA0B;EAC5B,IAAM,EAAE,oCAAiCR,EAAiB;EAO1D,MANKgB,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAOX;AACT"}
1
+ {"version":3,"file":"resolveRevokeAccount-DRrUY9FR.js","names":["isSmartWalletDeployed","getSmartWalletAddressForAdmin","getManagedAccountWallet","getConnectedManagedAccountAddress","syncPublishInAppAuthToken","getPublishThirdwebChain","getPublishConfig","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 syncPublishInAppAuthToken,\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 // Same as ensureModularPublishBootstrap: the managed wallet reads the in-app session token.\n syncPublishInAppAuthToken()\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":";;;AAuBA,eAAsBQ,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,MAAMjB,EAA8BU,EAAQ,OAAO;EAIjF,IAHsBD,EAAS,YAG3B,MAFiBQ,EAAsB,YAErB,KAAgBJ,GAA0B;GAC9D,IAAMK,I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AoC,CAAC,CA6BhD;AAED,MAAM,MAAM,+BAA+B,GAAG,2BAA2B,GAAG;IAC1E,OAAO,EAAE,sBAAsB,CAAA;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,gBAAgB,EAAE,sBAAsB,GAAG,IAAI,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE;IACtD,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAA;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAkC3C"}
@@ -17,7 +17,7 @@ export declare function encodePublishAuthorizationAttestationData(params: {
17
17
  permissionsHash: string;
18
18
  }): `0x${string}`;
19
19
  export type AttestPublishAuthorizationParams = {
20
- /** Must be the ManagedAccount (identity) wallet — becomes EAS attester. */
20
+ /** The ManagedAccount (identity) wallet, which becomes the EAS attester. Any other sender throws. */
21
21
  wallet: PublishWallet | SeedTxSender;
22
22
  identity: string;
23
23
  sessionKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/publishAuthorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,gCAAgC,EACrC,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAA;AAS7B,OAAO,EACL,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,mBAAmB,CAAA;AA8B1B,sFAAsF;AACtF,wBAAgB,gCAAgC,IAAI,KAAK,MAAM,EAAE,CAMhE;AAED;;GAEG;AACH,wBAAsB,gCAAgC,C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E;IACvD,MAAM,EAAE,aAAa,GAAG,YAAY,CAAA;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhB;AAED,MAAM,MAAM,oCAAoC,GAAG;IACjD,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,2BAA2B,CAAA;IACpC,MAAM,EAAE,gCAAgC,CAAA;IACxC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAAC,MAAM,EAAE;IAC3D,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,GAAG,OAAO,CAAC,oCAAoC,GAAG,IAAI,CAAC,CAoBvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/publishAuthorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,gCAAgC,EACrC,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAA;AAS7B,OAAO,EACL,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,mBAAmB,CAAA;AA8B1B,sFAAsF;AACtF,wBAAgB,gCAAgC,IAAI,KAAK,MAAM,EAAE,CAMhE;AAED;;GAEG;AACH,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,aAAa,GAAG,YAAY,GACpC,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAsBxB;AAED,wBAAgB,yCAAyC,CAAC,MAAM,EAAE;IAChE,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,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AuB,GAAG;IACpC,GAAG,EAAE,KAAK,MAAM,EAAE,CAAA;IAClB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAA;IACxB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAA;IACxB,eAAe,EAAE,KAAK,MAAM,EAAE,EAAE,CAAA;CACjC,CAAA;AAeD,6EAA6E;AAC7E,wBAAgB,uBAAuB,IAAI,KAAK,MAAM,EAAE,CAMvD;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,aAAa,GAAG,YAAY,GACpC,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAsBxB;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE;IACvD,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,KAAK,MAAM,EAAE,CAuBhB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAwElC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE;IAC9C,MAAM,EAAE,aAAa,GAAG,YAAY,CAAA;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhB;AAED,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA"}
package/dist/thirdweb.js CHANGED
@@ -1,28 +1,28 @@
1
- import { $ as e, A as t, B as n, Bt as r, G as i, Gt as a, H as o, I as s, J as c, K as l, Kt as u, L as ee, Lt as te, M as ne, N as d, P as re, Q as f, R as ie, U as p, Ut as ae, V as m, Vt as h, W as g, X as oe, Y as se, Z as _, a as v, et as ce, gt as y, ht as b, i as x, j as le, mt as ue, nt as de, p as S, pt as fe, q as C, r as pe, rt as w, t as T, tt as me, z as E } from "./chainConfig-DK_5pgXF.js";
1
+ import { $ as e, A as t, B as n, Bt as r, G as i, Gt as a, H as o, I as s, J as c, K as l, Kt as u, L as ee, Lt as te, M as ne, N as d, P as re, Q as f, R as ie, U as p, Ut as ae, V as m, Vt as h, W as g, X as oe, Y as se, Z as _, a as v, et as ce, gt as y, ht as b, i as x, j as le, mt as ue, nt as de, p as S, pt as fe, q as C, r as pe, rt as w, t as T, tt as me, z as E } from "./chainConfig-nYXoVL1s.js";
2
2
  import { i as he, t as D } from "./publishWalletRegistry-BaQe9rIR.js";
3
- import { a as O, d as k, f as A, g as j, h as M, l as N, m as P, p as F, u as I } from "./publishAuthorization-C_VidnTq.js";
4
- import { t as L } from "./ensureSmartWalletThenPublish-BW1_dW3n.js";
5
- import { t as R } from "./ensureModularPublishBootstrap-DZcceVDq.js";
6
- import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-BwCXLjcX.js";
3
+ import { a as O, d as k, f as A, g as j, h as M, l as N, m as P, p as F, u as I } from "./publishAuthorization-CVl5ZK5B.js";
4
+ import { t as L } from "./ensureSmartWalletThenPublish-CpuDoo5O.js";
5
+ import { t as R } from "./ensureModularPublishBootstrap-NzYQ1MfY.js";
6
+ import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-BaaHU2Wb.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 { ConnectButton as ve, ThirdwebProvider as ye, darkTheme as be, useActiveAccount as xe, useActiveWallet as Se, useActiveWalletConnectionStatus as Ce, useIsAutoConnecting as we } from "thirdweb/react";
10
10
  import { useCallback as Te, useEffect as W, useRef as G } from "react";
11
- import { assessPublishAuthorization as Ee, decodePublishAuthorizationData as De, getPublishAuthorizationFromEas as Oe } from "@seedprotocol/eas";
11
+ import { PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS as Ee, assessPublishAuthorization as De, decodePublishAuthorizationData as Oe, getPublishAuthorizationFromEas as ke } from "@seedprotocol/eas";
12
12
  import { jsx as K } from "react/jsx-runtime";
13
- import { SeedProvider as ke } from "@seedprotocol/react";
14
- import { addSessionKey as Ae, shouldUpdateSessionKey as je } from "thirdweb/extensions/erc4337";
13
+ import { SeedProvider as Ae } from "@seedprotocol/react";
14
+ import { addSessionKey as je, shouldUpdateSessionKey as Me } from "thirdweb/extensions/erc4337";
15
15
  //#region src/react/ConnectButton.tsx
16
16
  var q = "seedProtocol:publish:userChoseWalletDisconnect";
17
- function Me(e) {
17
+ function Ne(e) {
18
18
  console.warn("[ConnectButton] Wallet setup / module install skipped:", e), x().onWalletSetupWarning?.(e);
19
19
  }
20
- function Ne() {
20
+ function Pe() {
21
21
  return H.isInitialized() ? Promise.resolve() : new Promise((e) => {
22
22
  H.onReady(() => e());
23
23
  });
24
24
  }
25
- async function Pe(e, t, n) {
25
+ async function Fe(e, t, n) {
26
26
  if (n.modularAccountModuleContract) {
27
27
  if (n.useModularExecutor) {
28
28
  if (!t) return;
@@ -40,11 +40,11 @@ async function Pe(e, t, n) {
40
40
  } else try {
41
41
  await d(e.address, e, n);
42
42
  } catch (e) {
43
- Me(e);
43
+ Ne(e);
44
44
  }
45
45
  }
46
46
  }
47
- var Fe = () => {
47
+ var Ie = () => {
48
48
  let e = j(), t = y(e), n = Se(), r = xe(), i = Ce(), a = we(), o = G(null), s = G(!1), c = G(!1);
49
49
  W(() => {
50
50
  if (typeof window > "u") return;
@@ -76,7 +76,7 @@ var Fe = () => {
76
76
  let u = Te(async (n) => {
77
77
  let r = n.getAccount();
78
78
  if (!r) return;
79
- await Ne();
79
+ await Pe();
80
80
  let i = /* @__PURE__ */ new Set([r.address.toLowerCase()]), a;
81
81
  if (e.useModularExecutor) {
82
82
  _();
@@ -111,7 +111,7 @@ var Fe = () => {
111
111
  } catch (e) {
112
112
  throw o.current = null, console.warn("[ConnectButton] Failed to set seed client addresses:", e), e;
113
113
  }
114
- await Pe(r, a, e);
114
+ await Fe(r, a, e);
115
115
  }
116
116
  }, [e]);
117
117
  return W(() => {
@@ -169,32 +169,32 @@ var Fe = () => {
169
169
  borderColor: "#344054"
170
170
  } })
171
171
  });
172
- }, Ie = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => {
172
+ }, Le = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => {
173
173
  let i = G(void 0);
174
174
  return t && i.current !== t && (v(t), i.current = t), /* @__PURE__ */ K(M.Provider, {
175
175
  value: t ?? pe(),
176
- children: /* @__PURE__ */ K(ye, { children: /* @__PURE__ */ K(ke, {
176
+ children: /* @__PURE__ */ K(ye, { children: /* @__PURE__ */ K(Ae, {
177
177
  queryClient: n,
178
178
  queryClientRef: r,
179
179
  children: e
180
180
  }) })
181
181
  });
182
- }, Le = "Modular (EIP-7702) wallet is not connected. Sign in with the same method and try again.", Re = () => `Your modular account is not upgraded to an EIP-7702 smart account on ${T()} yet. Enable autoDeployEip7702ModularAccount in publish config or complete wallet setup, then retry.`, ze = () => `Automatic EIP-7702 smart account setup failed on ${T()}. Retry or reconnect your wallet.`, J = "EIP-7702 upgrade was sent but on-chain bytecode was not detected yet. Wait a moment and retry.", Y = 5;
183
- async function Be() {
182
+ }, Re = "Modular (EIP-7702) wallet is not connected. Sign in with the same method and try again.", ze = () => `Your modular account is not upgraded to an EIP-7702 smart account on ${T()} yet. Enable autoDeployEip7702ModularAccount in publish config or complete wallet setup, then retry.`, J = () => `Automatic EIP-7702 smart account setup failed on ${T()}. Retry or reconnect your wallet.`, Be = "EIP-7702 upgrade was sent but on-chain bytecode was not detected yet. Wait a moment and retry.", Y = 5;
183
+ async function Ve() {
184
184
  let { autoDeployEip7702ModularAccount: e } = x(), t = g();
185
185
  await t.autoConnect({
186
186
  client: w(),
187
187
  chain: y()
188
188
  });
189
189
  let n = t.getAccount();
190
- if (!n) throw new a(Le, "EIP7702_MODULAR_ACCOUNT_UNAVAILABLE");
190
+ if (!n) throw new a(Re, "EIP7702_MODULAR_ACCOUNT_UNAVAILABLE");
191
191
  let i = w(), o = U({
192
192
  client: i,
193
193
  chain: y(),
194
194
  address: n.address
195
195
  });
196
196
  if (!await r(n.address)) {
197
- if (!e) throw new a(Re(), "EIP7702_MODULAR_NOT_UPGRADED", n.address);
197
+ if (!e) throw new a(ze(), "EIP7702_MODULAR_NOT_UPGRADED", n.address);
198
198
  try {
199
199
  await ge({
200
200
  smartAccount: n,
@@ -204,9 +204,9 @@ async function Be() {
204
204
  });
205
205
  } catch (e) {
206
206
  if (await h(n.address, Y)) return;
207
- throw new a(ze(), "EIP7702_MODULAR_DEPLOY_FAILED", n.address, e);
207
+ throw new a(J(), "EIP7702_MODULAR_DEPLOY_FAILED", n.address, e);
208
208
  }
209
- if (!await h(n.address, Y)) throw new a(J, "EIP7702_MODULAR_NOT_CONFIRMED", n.address);
209
+ if (!await h(n.address, Y)) throw new a(Be, "EIP7702_MODULAR_NOT_CONFIRMED", n.address);
210
210
  }
211
211
  }
212
212
  //#endregion
@@ -216,15 +216,15 @@ function X(e) {
216
216
  }
217
217
  //#endregion
218
218
  //#region src/helpers/ensureManagedSignerSessionKey.ts
219
- var Ve = () => `Could not connect the managed publishing account to authorize the modular signer on ${T()}. Reconnect and try again.`, Z = () => `Could not authorize the modular wallet as a session signer on your publishing account on ${T()}.`;
220
- async function He(e) {
219
+ var He = () => `Could not connect the managed publishing account to authorize the modular signer on ${T()}. Reconnect and try again.`, Z = () => `Could not authorize the modular wallet as a session signer on your publishing account on ${T()}.`;
220
+ async function Ue(e) {
221
221
  let { managedAddress: t, signerAddress: n } = e, r = p();
222
222
  await r.autoConnect({
223
223
  client: w(),
224
224
  chain: y()
225
225
  });
226
226
  let i = r.getAccount();
227
- if (!i) throw new u(Ve(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
227
+ if (!i) throw new u(He(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
228
228
  let a = U({
229
229
  client: w(),
230
230
  chain: y(),
@@ -234,7 +234,7 @@ async function He(e) {
234
234
  nativeTokenLimitPerTransaction: 0
235
235
  }, s = !1;
236
236
  try {
237
- s = await je({
237
+ s = await Me({
238
238
  accountContract: a,
239
239
  sessionKeyAddress: n,
240
240
  newPermissions: o
@@ -243,7 +243,7 @@ async function He(e) {
243
243
  throw new u(Z(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
244
244
  }
245
245
  if (s) try {
246
- let e = Ae({
246
+ let e = je({
247
247
  contract: a,
248
248
  account: i,
249
249
  sessionKeyAddress: n,
@@ -279,7 +279,7 @@ async function Q(e) {
279
279
  async function $(e, t) {
280
280
  return t || b(await Q(e), { kind: "smart" });
281
281
  }
282
- async function Ue(e) {
282
+ async function We(e) {
283
283
  let t = x();
284
284
  if (!t.modularAccountModuleContract?.trim()) throw Error("@seedprotocol/publish: enrollPublishAutomation requires PublishConfig.modularAccountModuleContract");
285
285
  let n = await Q(e), r;
@@ -290,9 +290,9 @@ async function Ue(e) {
290
290
  }
291
291
  await re(e, r.status === "installed" ? { installedEas: r.eas } : { readAttempts: r.status === "already-installed" ? 5 : 1 });
292
292
  }
293
- async function We(e) {
294
- let { managedAddress: t, sessionKeyAddress: n, appAddress: r, expiresAt: i } = e;
295
- await Ue(t), await V({
293
+ async function Ge(e) {
294
+ let { managedAddress: t, sessionKeyAddress: n, appAddress: r } = e, i = typeof e.expiresAt == "number" && e.expiresAt > 0 ? Math.trunc(e.expiresAt) : Math.floor(Date.now() / 1e3) + Ee;
295
+ await We(t), await V({
296
296
  managedAddress: t,
297
297
  sessionKeyAddress: n,
298
298
  expiresAt: i
@@ -310,7 +310,7 @@ async function We(e) {
310
310
  })
311
311
  };
312
312
  }
313
- async function Ge(e) {
313
+ async function Ke(e) {
314
314
  let { managedAddress: t, sessionKeyAddress: n, authorizationUid: r } = e, i = await $(t, e.userWallet);
315
315
  await z({
316
316
  managedAddress: t,
@@ -322,7 +322,7 @@ async function Ge(e) {
322
322
  }
323
323
  //#endregion
324
324
  //#region src/helpers/assertStorageBoundToIdentity.ts
325
- async function Ke(e) {
325
+ async function qe(e) {
326
326
  let { managedAddress: t, dataItemOwner: n, atTime: r, allowActiveSessionKey: i = !0, allowSidecar: a = !0 } = e, o = [], s = n.trim().toLowerCase(), c = t.trim().toLowerCase();
327
327
  if (!/^0x[0-9a-fA-F]{40}$/.test(s) || !/^0x[0-9a-fA-F]{40}$/.test(c)) return {
328
328
  bound: !1,
@@ -339,17 +339,18 @@ async function Ke(e) {
339
339
  o.push(e instanceof Error ? e.message : "isActiveSigner check failed");
340
340
  }
341
341
  if (a) try {
342
- let e = await Oe({
342
+ let e = await ke({
343
343
  identities: [t],
344
344
  sessionKeys: [n],
345
345
  excludeRevoked: !0
346
346
  }), i = r == null ? Date.now() : r * 1e3;
347
347
  for (let t of e) try {
348
- let e = De(t.decodedDataJson ?? "[]");
348
+ let e = Oe(t.decodedDataJson ?? "[]");
349
349
  if (e.identity.toLowerCase() !== c || e.sessionKey.toLowerCase() !== s) continue;
350
- let n = typeof t.expirationTime == "number" ? t.expirationTime : null, r = Ee({
350
+ let n = typeof t.expirationTime == "number" ? t.expirationTime : null, r = De({
351
351
  decoded: e,
352
352
  expirationTime: n,
353
+ revoked: t.revoked,
353
354
  now: i
354
355
  });
355
356
  if (r.status === "valid") return {
@@ -369,6 +370,6 @@ async function Ke(e) {
369
370
  };
370
371
  }
371
372
  //#endregion
372
- export { me as CALL_GAS_HEADROOM_BPS, Fe as ConnectButton, s as ExternalWalletsForDeploy, I as PUBLISH_AUTOMATION_SCOPES, Ie as PublishProvider, ee as appMetadata, P as approvedTargetsForAutomationPublish, fe as asSeedSignerFromThirdweb, ue as asThirdwebPublishWallet, Ke as assertStorageBoundToIdentity, k as buildAutomationSessionKeyPermissions, X as defaultApprovedTargetsForModularPublish, ie as deployManagedAccountViaFactory, E as deploySmartWalletContract, We as enrollPublishAutomation, V as ensureAutomationSessionKey, Be as ensureEip7702ModularAccountReady, d as ensureExecutorModuleInstalled, t as ensureManagedAccountReady, He as ensureManagedSignerSessionKey, R as ensureModularPublishBootstrap, L as ensureSmartWalletThenPublish, b as fromThirdwebAccount, w as getClient, n as getConnectedAccount, m as getConnectedManagedAccountAddress, o as getConnectedModularAccount, p as getManagedAccountWallet, g as getModularAccountWallet, y as getPublishThirdwebChain, i as getSharedPublishInAppWalletStorage, l as getSmartWalletAddressForAdmin, C as getWalletsForConnectButton, A as hashAutomationSessionKeyPermissions, B as isAutomationSessionActive, c as isSmartWalletDeployed, se as pollSmartWalletDeployed, z as removeAutomationSessionKey, oe as resolveSmartWalletForPublish, Ge as revokePublishAutomation, le as runModularExecutorPublishPrep, de as seedPaymaster, F as toThirdwebSessionKeyPermissions, ne as tryDeployManagedAccount, f as useActiveSmartWalletContract, e as useLocalWalletAccount, j as usePublishConfig, ce as wallets };
373
+ export { me as CALL_GAS_HEADROOM_BPS, Ie as ConnectButton, s as ExternalWalletsForDeploy, I as PUBLISH_AUTOMATION_SCOPES, Le as PublishProvider, ee as appMetadata, P as approvedTargetsForAutomationPublish, fe as asSeedSignerFromThirdweb, ue as asThirdwebPublishWallet, qe as assertStorageBoundToIdentity, k as buildAutomationSessionKeyPermissions, X as defaultApprovedTargetsForModularPublish, ie as deployManagedAccountViaFactory, E as deploySmartWalletContract, Ge as enrollPublishAutomation, V as ensureAutomationSessionKey, Ve as ensureEip7702ModularAccountReady, d as ensureExecutorModuleInstalled, t as ensureManagedAccountReady, Ue as ensureManagedSignerSessionKey, R as ensureModularPublishBootstrap, L as ensureSmartWalletThenPublish, b as fromThirdwebAccount, w as getClient, n as getConnectedAccount, m as getConnectedManagedAccountAddress, o as getConnectedModularAccount, p as getManagedAccountWallet, g as getModularAccountWallet, y as getPublishThirdwebChain, i as getSharedPublishInAppWalletStorage, l as getSmartWalletAddressForAdmin, C as getWalletsForConnectButton, A as hashAutomationSessionKeyPermissions, B as isAutomationSessionActive, c as isSmartWalletDeployed, se as pollSmartWalletDeployed, z as removeAutomationSessionKey, oe as resolveSmartWalletForPublish, Ke as revokePublishAutomation, le as runModularExecutorPublishPrep, de as seedPaymaster, F as toThirdwebSessionKeyPermissions, ne as tryDeployManagedAccount, f as useActiveSmartWalletContract, e as useLocalWalletAccount, j as usePublishConfig, ce as wallets };
373
374
 
374
375
  //# sourceMappingURL=thirdweb.js.map