@seedprotocol/publish 0.7.2 → 0.7.3-next.654.g52217f6

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 (24) hide show
  1. package/dist/{chainConfig-BDMRU4m8.js → chainConfig-bc_6IgAw.js} +5 -5
  2. package/dist/{chainConfig-BDMRU4m8.js.map → chainConfig-bc_6IgAw.js.map} +1 -1
  3. package/dist/{ensureAutomationSessionKey-bw6knEyC.js → ensureAutomationSessionKey-D0bbWT8e.js} +4 -4
  4. package/dist/{ensureAutomationSessionKey-bw6knEyC.js.map → ensureAutomationSessionKey-D0bbWT8e.js.map} +1 -1
  5. package/dist/{ensureModularPublishBootstrap-Vc4Jz_B9.js → ensureModularPublishBootstrap-x1bmc__0.js} +5 -5
  6. package/dist/{ensureModularPublishBootstrap-Vc4Jz_B9.js.map → ensureModularPublishBootstrap-x1bmc__0.js.map} +1 -1
  7. package/dist/{ensureSmartWalletThenPublish-42iEhiHG.js → ensureSmartWalletThenPublish-DNkeFWvC.js} +3 -3
  8. package/dist/{ensureSmartWalletThenPublish-42iEhiHG.js.map → ensureSmartWalletThenPublish-DNkeFWvC.js.map} +1 -1
  9. package/dist/index.js +3 -3
  10. package/dist/{managedAccountAdmin-B3DPMmhR.js → managedAccountAdmin-CdS1SCA_.js} +4 -4
  11. package/dist/{managedAccountAdmin-B3DPMmhR.js.map → managedAccountAdmin-CdS1SCA_.js.map} +1 -1
  12. package/dist/{publishAuthorization-CAFF5jQ2.js → publishAuthorization-C5kXlbOT.js} +809 -999
  13. package/dist/publishAuthorization-C5kXlbOT.js.map +1 -0
  14. package/dist/{publishThirdwebClient-CPzAjnmf.js → publishThirdwebClient-VSG2MC38.js} +2 -2
  15. package/dist/{publishThirdwebClient-CPzAjnmf.js.map → publishThirdwebClient-VSG2MC38.js.map} +1 -1
  16. package/dist/{resolveRevokeAccount-CkbTpC27.js → resolveRevokeAccount-D2RP6qcU.js} +4 -4
  17. package/dist/{resolveRevokeAccount-CkbTpC27.js.map → resolveRevokeAccount-D2RP6qcU.js.map} +1 -1
  18. package/dist/services/publish/helpers/getPublishUploadData.d.ts +12 -23
  19. package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
  20. package/dist/thirdweb.js +6 -6
  21. package/dist/{worker-CCQ7KBMm.js → worker-BIQLQSjk.js} +2 -2
  22. package/dist/{worker-CCQ7KBMm.js.map → worker-BIQLQSjk.js.map} +1 -1
  23. package/package.json +5 -5
  24. package/dist/publishAuthorization-CAFF5jQ2.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { o as t } from "./chainConfig-BDMRU4m8.js";
2
+ import { o as t } from "./chainConfig-bc_6IgAw.js";
3
3
  import { createThirdwebClient as n } from "thirdweb";
4
4
  //#region src/helpers/publishThirdwebClient.ts
5
5
  var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
@@ -15,4 +15,4 @@ function o() {
15
15
  //#endregion
16
16
  export { r as n, o as t };
17
17
 
18
- //# sourceMappingURL=publishThirdwebClient-CPzAjnmf.js.map
18
+ //# sourceMappingURL=publishThirdwebClient-VSG2MC38.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"publishThirdwebClient-CPzAjnmf.js","names":["__exportAll","getPublishConfig","publishThirdwebClient_exports","getClient","_client","_clientKey","thirdwebClientId","thirdwebSecretKey","key","createThirdwebClient"],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGII,IAAiC,MACjCC,IAA4B;AAOhC,SAAgBF,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsBF,EAAiB;CACjE,IAAI,CAACK,KAAoB,CAACC,GACxB,MAAU,MACR,sIACF;CAEF,IAAMC,IAAM,GAAGF,KAAoB,GAAG,IAAIC,KAAqB;CAU/D,QATI,CAACH,KAAWC,MAAeG,OAC7B,IAAaA,GACb,IACIC,EADMH,IACe;EACnB,UAAUA;EACV,GAAIC,IAAoB,EAAE,WAAWA,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAWA,EAAmB,CAAC,IAErDH;AACT"}
1
+ {"version":3,"file":"publishThirdwebClient-VSG2MC38.js","names":["__exportAll","getPublishConfig","publishThirdwebClient_exports","getClient","_client","_clientKey","thirdwebClientId","thirdwebSecretKey","key","createThirdwebClient"],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGII,IAAiC,MACjCC,IAA4B;AAOhC,SAAgBF,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsBF,EAAiB;CACjE,IAAI,CAACK,KAAoB,CAACC,GACxB,MAAU,MACR,sIACF;CAEF,IAAMC,IAAM,GAAGF,KAAoB,GAAG,IAAIC,KAAqB;CAU/D,QATI,CAACH,KAAWC,MAAeG,OAC7B,IAAaA,GACb,IACIC,EADMH,IACe;EACnB,UAAUA;EACV,GAAIC,IAAoB,EAAE,WAAWA,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAWA,EAAmB,CAAC,IAErDH;AACT"}
@@ -1,6 +1,6 @@
1
- import { o as e, y as t } from "./chainConfig-BDMRU4m8.js";
2
- import { A as n, F as r, L as i, M as a } from "./publishAuthorization-CAFF5jQ2.js";
3
- import { t as o } from "./publishThirdwebClient-CPzAjnmf.js";
1
+ import { o as e, y as t } from "./chainConfig-bc_6IgAw.js";
2
+ import { A as n, F as r, L as i, M as a } from "./publishAuthorization-C5kXlbOT.js";
3
+ import { t as o } from "./publishThirdwebClient-VSG2MC38.js";
4
4
  import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
5
5
  //#region src/helpers/resolveRevokeAccount.ts
6
6
  async function c(c) {
@@ -35,4 +35,4 @@ async function c(c) {
35
35
  //#endregion
36
36
  export { c as resolveRevokeAccount };
37
37
 
38
- //# sourceMappingURL=resolveRevokeAccount-CkbTpC27.js.map
38
+ //# sourceMappingURL=resolveRevokeAccount-D2RP6qcU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveRevokeAccount-CkbTpC27.js","names":["getPublishConfig","getPublishThirdwebChain","getConnectedManagedAccountAddress","getSmartWalletAddressForAdmin","isSmartWalletDeployed","getManagedAccountWallet","getClient","resolveRevokeAccount","params","attester","account","additionalGetter","getGetAdditionalSyncAddresses","attesterIsExecutorModule","additional","attesterLower","a","derivedManagedAccount","managedAddress","managedAccountWallet","managedAccount","modularAccountModuleContract"],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(getPublishThirdwebChain()).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;AAsBA,eAAsBO,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAaC;CAE9B,IAAI,CAACC,KAAYC,EAAQ,QAAQ,YAAY,MAAMD,EAAS,YAAY,GACtE,OAAOC;CAGT,IAAMC,IAAmBC,EAA8B,GACnDC,IAA2B;CAC/B,IAAIF,GAAkB;EACpB,IAAMG,IAAa,MAAMH,EAAiB,GACpCI,IAAgBN,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAACK,GAAY,MACtC,MAA0BE,GAAG,YAAY,MAAMD,CAClD;CACF;CAEA,IAAI;EACF,IAAME,IAAwB,MAAMd,EAA8BO,EAAQ,OAAO;EAIjF,IAHsBD,EAAS,YAG3B,MAFiBQ,EAAsB,YAErB,KAAgBJ,GAA0B;GAC9D,IAAMK,IAAiBL,IACnB,MAAMX,EAAkCD,EAAwB,CAAC,CAAC,CAAC,YAAYgB,CAAqB,IACpGA;GAEJ,IAAI,MADmBb,EAAsBc,CAAc,GAC7C;IACZ,IAAMC,IAAuBd,EAAwB;IACrD,MAAMc,EAAqB,YAAY;KACrC,QAAQb,EAAU;KAClB,OAAOL,EAAwB;IACjC,CAAC;IACD,IAAMmB,IAAiBD,EAAqB,WAAW;IACvD,IAAIC,GACF,OAAOA;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAIP,GAA0B;EAC5B,IAAM,EAAE,oCAAiCb,EAAiB;EAO1D,MANKqB,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAOX;AACT"}
1
+ {"version":3,"file":"resolveRevokeAccount-D2RP6qcU.js","names":["getPublishConfig","getPublishThirdwebChain","getConnectedManagedAccountAddress","getSmartWalletAddressForAdmin","isSmartWalletDeployed","getManagedAccountWallet","getClient","resolveRevokeAccount","params","attester","account","additionalGetter","getGetAdditionalSyncAddresses","attesterIsExecutorModule","additional","attesterLower","a","derivedManagedAccount","managedAddress","managedAccountWallet","managedAccount","modularAccountModuleContract"],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(getPublishThirdwebChain()).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;AAsBA,eAAsBO,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAaC;CAE9B,IAAI,CAACC,KAAYC,EAAQ,QAAQ,YAAY,MAAMD,EAAS,YAAY,GACtE,OAAOC;CAGT,IAAMC,IAAmBC,EAA8B,GACnDC,IAA2B;CAC/B,IAAIF,GAAkB;EACpB,IAAMG,IAAa,MAAMH,EAAiB,GACpCI,IAAgBN,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAACK,GAAY,MACtC,MAA0BE,GAAG,YAAY,MAAMD,CAClD;CACF;CAEA,IAAI;EACF,IAAME,IAAwB,MAAMd,EAA8BO,EAAQ,OAAO;EAIjF,IAHsBD,EAAS,YAG3B,MAFiBQ,EAAsB,YAErB,KAAgBJ,GAA0B;GAC9D,IAAMK,IAAiBL,IACnB,MAAMX,EAAkCD,EAAwB,CAAC,CAAC,CAAC,YAAYgB,CAAqB,IACpGA;GAEJ,IAAI,MADmBb,EAAsBc,CAAc,GAC7C;IACZ,IAAMC,IAAuBd,EAAwB;IACrD,MAAMc,EAAqB,YAAY;KACrC,QAAQb,EAAU;KAClB,OAAOL,EAAwB;IACjC,CAAC;IACD,IAAMmB,IAAiBD,EAAqB,WAAW;IACvD,IAAIC,GACF,OAAOA;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAIP,GAA0B;EAC5B,IAAM,EAAE,oCAAiCb,EAAiB;EAO1D,MANKqB,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAOX;AACT"}
@@ -1,26 +1,15 @@
1
- import type { IItem, IItemProperty, TransactionTag } from '@seedprotocol/sdk';
2
- /** Optional extra tags appended after Content-SHA-256 / Content-Type (mirrors SDK getPublishUploads). */
3
- export type GetPublishUploadDataOptions = {
4
- arweaveUploadTags?: TransactionTag[];
5
- deferHtmlStorageSeedLocalIds?: string[];
6
- onlyHtmlStorageSeedLocalIds?: string[];
7
- skipRelationRecursion?: boolean;
8
- };
9
- export type PublishUploadData = {
10
- data: Uint8Array;
11
- contentHash?: string;
12
- contentType?: string;
13
- /** Full tag list for DataItem / bundler: content tags then configured arweaveUploadTags. */
14
- tags: TransactionTag[];
15
- itemPropertyName: string;
16
- itemPropertyLocalId: string;
17
- seedLocalId: string;
18
- versionLocalId: string;
19
- };
20
1
  /**
21
- * Upload data for a publish of `item`: its own, and that of every draft item the publish carries
22
- * along (reachable through relation and list properties; the SDK's getPublishDraftGraph, the same
23
- * walk as getPublishUploads and getPublishPayload).
2
+ * Raw upload data (bytes + Content-SHA-256 / Content-Type / configured tags) for the bundler /
3
+ * DataItem path. The builder lives in the SDK (`getPublishUploadData`, next to `getPublishUploads`,
4
+ * which makes L1 transactions from the same data), so both publish paths upload the same bytes
5
+ * with the same tags.
6
+ *
7
+ * Kept as a module of its own so publish actors (and their tests) have one import to mock.
24
8
  */
25
- export declare const getPublishUploadData: (item: IItem<any>, uploads?: PublishUploadData[], relatedItemProperty?: IItemProperty<any>, options?: GetPublishUploadDataOptions) => Promise<PublishUploadData[]>;
9
+ import { getPublishUploadData as sdkGetPublishUploadData } from '@seedprotocol/sdk';
10
+ import type { GetPublishUploadsOptions, PublishUploadData } from '@seedprotocol/sdk';
11
+ export type { PublishUploadData };
12
+ /** Same options as the SDK's getPublishUploads (extra tags, two-phase Html embedded-image publish). */
13
+ export type GetPublishUploadDataOptions = GetPublishUploadsOptions;
14
+ export declare const getPublishUploadData: (...args: Parameters<typeof sdkGetPublishUploadData>) => ReturnType<typeof sdkGetPublishUploadData>;
26
15
  //# sourceMappingURL=getPublishUploadData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPublishUploadData.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/helpers/getPublishUploadData.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAG7E,yGAAyG;AACzG,MAAM,MAAM,2BAA2B,GAAG;IACxC,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAA;IACpC,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAA;IACvC,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAA;IACtC,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AA8DD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAoTD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAS,iBAAiB,EAAO,EACjC,sBAAsB,aAAa,CAAC,GAAG,CAAC,EACxC,UAAU,2BAA2B,KACpC,OAAO,CAAC,iBAAiB,EAAE,CAa7B,CAAA"}
1
+ {"version":3,"file":"getPublishUploadData.d.ts","sourceRoot":"","sources":["../../../../src/services/publish/helpers/getPublishUploadData.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,IAAI,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AACnF,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAEpF,YAAY,EAAE,iBAAiB,EAAE,CAAA;AAEjC,uGAAuG;AACvG,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAA;AAElE,eAAO,MAAM,oBAAoB,GAC/B,GAAG,MAAM,UAAU,CAAC,OAAO,uBAAuB,CAAC,KAClD,UAAU,CAAC,OAAO,uBAAuB,CAAqC,CAAA"}
package/dist/thirdweb.js CHANGED
@@ -1,9 +1,9 @@
1
- import { A as e, M as t, a as n, ct as r, dt as i, h as a, lt as o, m as s, mt as c, o as l, p as u, pt as d, s as f, t as p, tt as ee, y as m } from "./chainConfig-BDMRU4m8.js";
2
- import { A as h, B as g, C as _, D as te, E as ne, F as v, G as re, H as ie, I as y, K as ae, L as oe, M as b, N as x, O as se, P as S, R as C, S as w, T as ce, U as le, W as ue, a as de, b as fe, d as pe, f as me, h as T, j as he, k as E, l as D, m as O, nt as k, p as A, tt as j, u as M, x as N, y as P, z as F } from "./publishAuthorization-CAFF5jQ2.js";
3
- import { t as I } from "./publishThirdwebClient-CPzAjnmf.js";
4
- import { t as L } from "./ensureSmartWalletThenPublish-42iEhiHG.js";
5
- import { t as R } from "./ensureModularPublishBootstrap-Vc4Jz_B9.js";
6
- import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-bw6knEyC.js";
1
+ import { A as e, M as t, a as n, ct as r, dt as i, h as a, lt as o, m as s, mt as c, o as l, p as u, pt as d, s as f, t as p, tt as ee, y as m } from "./chainConfig-bc_6IgAw.js";
2
+ import { A as h, B as g, C as _, D as te, E as ne, F as v, G as re, H as ie, I as y, K as ae, L as oe, M as b, N as x, O as se, P as S, R as C, S as w, T as ce, U as le, W as ue, a as de, b as fe, d as pe, f as me, h as T, j as he, k as E, l as D, m as O, nt as k, p as A, tt as j, u as M, x as N, y as P, z as F } from "./publishAuthorization-C5kXlbOT.js";
3
+ import { t as I } from "./publishThirdwebClient-VSG2MC38.js";
4
+ import { t as L } from "./ensureSmartWalletThenPublish-DNkeFWvC.js";
5
+ import { t as R } from "./ensureModularPublishBootstrap-x1bmc__0.js";
6
+ import { i as z, r as B, t as V } from "./ensureAutomationSessionKey-D0bbWT8e.js";
7
7
  import { client as H } from "@seedprotocol/sdk";
8
8
  import { deploySmartAccount as ge, getContract as U, sendTransaction as _e } from "thirdweb";
9
9
  import { assessPublishAuthorization as ve, decodePublishAuthorizationData as ye, getPublishAuthorizationFromEas as be } from "@seedprotocol/eas";
@@ -1,4 +1,4 @@
1
- import { o as e } from "./chainConfig-BDMRU4m8.js";
1
+ import { o as e } from "./chainConfig-bc_6IgAw.js";
2
2
  import { BaseDb as t, applyArweaveL1TransactionIdLocal as n, arweaveL1FinalizeJobs as r, getArweaveUploadStatus as i, isArweaveL1AnchoringComplete as a, queryArweaveGatewayTransactionWithFallback as o } from "@seedprotocol/sdk";
3
3
  import s from "debug";
4
4
  import { eq as c } from "drizzle-orm";
@@ -69,4 +69,4 @@ async function m() {
69
69
  //#endregion
70
70
  export { f as startArweaveL1FinalizeWorker, p as stopArweaveL1FinalizeWorker };
71
71
 
72
- //# sourceMappingURL=worker-CCQ7KBMm.js.map
72
+ //# sourceMappingURL=worker-BIQLQSjk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker-CCQ7KBMm.js","names":["getPublishConfig","debug","logger","TICK_MS","intervalId","startArweaveL1FinalizeWorker","runArweaveL1FinalizeTick","stopArweaveL1FinalizeWorker","config","BaseDb","db","pending","arweaveL1FinalizeJobs","eq","uploadBase","graphqlUrl","job","dataItemId","l1TxId","bundled","queryArweaveGatewayTransactionWithFallback","status","getArweaveUploadStatus","statusStr","isArweaveL1AnchoringComplete","resolvedL1","applyArweaveL1TransactionIdLocal","err"],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n applyArweaveL1TransactionIdLocal,\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\n\nconst TICK_MS = 45_000\n\nlet intervalId: ReturnType<typeof setInterval> | null = null\n\nexport function startArweaveL1FinalizeWorker(): void {\n if (intervalId != null) return\n intervalId = setInterval(() => {\n void runArweaveL1FinalizeTick()\n }, TICK_MS)\n void runArweaveL1FinalizeTick()\n}\n\nexport function stopArweaveL1FinalizeWorker(): void {\n if (intervalId != null) {\n clearInterval(intervalId)\n intervalId = null\n }\n}\n\nasync function runArweaveL1FinalizeTick(): Promise<void> {\n let config: ReturnType<typeof getPublishConfig>\n try {\n config = getPublishConfig()\n } catch {\n return\n }\n if (!config.useArweaveBundler) return\n\n // initPublish may start this worker before Seed platformClassesInit configures BaseDb.\n if (!BaseDb.isAppDbReady()) return\n const db = BaseDb.getAppDb()\n if (!db) return\n\n const pending = await db\n .select()\n .from(arweaveL1FinalizeJobs)\n .where(eq(arweaveL1FinalizeJobs.phase, 'pending_l1'))\n .limit(25)\n\n if (pending.length === 0) return\n\n const uploadBase = config.arweaveUploadVerificationBaseUrl\n const graphqlUrl = config.arweaveGraphqlUrl\n\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\n\n if (!l1TxId) {\n const gql = await queryArweaveGatewayTransactionWithFallback(graphqlUrl, dataItemId)\n const bundled = gql?.bundledInId ?? null\n if (bundled) {\n l1TxId = bundled\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n l1TransactionId: bundled,\n bundleId: bundled,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n\n const status = await getArweaveUploadStatus(uploadBase, dataItemId)\n const statusStr = status ? JSON.stringify(status) : null\n\n if (status && isArweaveL1AnchoringComplete(status)) {\n const resolvedL1 =\n l1TxId ??\n status.bundleId ??\n status.turbo?.bundleId ??\n job.l1TransactionId ??\n null\n\n if (resolvedL1) {\n await applyArweaveL1TransactionIdLocal({\n seedLocalId: job.seedLocalId,\n versionLocalId: job.versionLocalId,\n dataItemId,\n l1TransactionId: resolvedL1,\n })\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n phase: 'confirmed',\n statusJson: statusStr,\n l1TransactionId: resolvedL1 ?? job.l1TransactionId,\n bundleId: status.bundleId ?? job.bundleId,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n continue\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n statusJson: statusStr,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n } catch (err) {\n logger('tick error for job', job.id, err)\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n errorMessage: err instanceof Error ? err.message : String(err),\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id,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IAClD,IAAMI,IACJP,KACAG,EAAO,YACPA,EAAO,OAAO,YACdL,EAAI,mBACJ;IAWF,AATIS,KACF,MAAMC,EAAiC;KACrC,aAAaV,EAAI;KACjB,gBAAgBA,EAAI;KACpB;KACA,iBAAiBS;IACnB,CAAC,GAGH,MAAMf,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;KACH,OAAO;KACP,YAAYW;KACZ,iBAAiBE,KAAcT,EAAI;KACnC,UAAUK,EAAO,YAAYL,EAAI;KACjC,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAMH,EAAGD,EAAsB,IAAII,EAAI,EAAG,CAAC;IAC9C;GACF;GAEA,MAAMN,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;IACH,YAAYW;IACZ,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAMV,EAAGD,EAAsB,IAAII,EAAI,EAAG,CAAC;EAChD,SAASW,GAAK;GAEZ,AADAzB,EAAO,sBAAsBc,EAAI,IAAIW,CAAG,GACxC,MAAMjB,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAce,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAMd,EAAGD,EAAsB,IAAII,EAAI,EAAG,CAAC;EAChD;CACF;AACF"}
1
+ {"version":3,"file":"worker-BIQLQSjk.js","names":["getPublishConfig","debug","logger","TICK_MS","intervalId","startArweaveL1FinalizeWorker","runArweaveL1FinalizeTick","stopArweaveL1FinalizeWorker","config","BaseDb","db","pending","arweaveL1FinalizeJobs","eq","uploadBase","graphqlUrl","job","dataItemId","l1TxId","bundled","queryArweaveGatewayTransactionWithFallback","status","getArweaveUploadStatus","statusStr","isArweaveL1AnchoringComplete","resolvedL1","applyArweaveL1TransactionIdLocal","err"],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n applyArweaveL1TransactionIdLocal,\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\n\nconst TICK_MS = 45_000\n\nlet intervalId: ReturnType<typeof setInterval> | null = null\n\nexport function startArweaveL1FinalizeWorker(): void {\n if (intervalId != null) return\n intervalId = setInterval(() => {\n void runArweaveL1FinalizeTick()\n }, TICK_MS)\n void runArweaveL1FinalizeTick()\n}\n\nexport function stopArweaveL1FinalizeWorker(): void {\n if (intervalId != null) {\n clearInterval(intervalId)\n intervalId = null\n }\n}\n\nasync function runArweaveL1FinalizeTick(): Promise<void> {\n let config: ReturnType<typeof getPublishConfig>\n try {\n config = getPublishConfig()\n } catch {\n return\n }\n if (!config.useArweaveBundler) return\n\n // initPublish may start this worker before Seed platformClassesInit configures BaseDb.\n if (!BaseDb.isAppDbReady()) return\n const db = BaseDb.getAppDb()\n if (!db) return\n\n const pending = await db\n .select()\n .from(arweaveL1FinalizeJobs)\n .where(eq(arweaveL1FinalizeJobs.phase, 'pending_l1'))\n .limit(25)\n\n if (pending.length === 0) return\n\n const uploadBase = config.arweaveUploadVerificationBaseUrl\n const graphqlUrl = config.arweaveGraphqlUrl\n\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\n\n if (!l1TxId) {\n const gql = await queryArweaveGatewayTransactionWithFallback(graphqlUrl, dataItemId)\n const bundled = gql?.bundledInId ?? null\n if (bundled) {\n l1TxId = bundled\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n l1TransactionId: bundled,\n bundleId: bundled,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n\n const status = await getArweaveUploadStatus(uploadBase, dataItemId)\n const statusStr = status ? JSON.stringify(status) : null\n\n if (status && isArweaveL1AnchoringComplete(status)) {\n const resolvedL1 =\n l1TxId ??\n status.bundleId ??\n status.turbo?.bundleId ??\n job.l1TransactionId ??\n null\n\n if (resolvedL1) {\n await applyArweaveL1TransactionIdLocal({\n seedLocalId: job.seedLocalId,\n versionLocalId: job.versionLocalId,\n dataItemId,\n l1TransactionId: resolvedL1,\n })\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n phase: 'confirmed',\n statusJson: statusStr,\n l1TransactionId: resolvedL1 ?? job.l1TransactionId,\n bundleId: status.bundleId ?? job.bundleId,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n continue\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n statusJson: statusStr,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n } catch (err) {\n logger('tick error for job', job.id, err)\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n errorMessage: err instanceof Error ? err.message : String(err),\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n}\n"],"mappings":";;;;;AAYA,IAAME,IAASD,EAAM,uCAAuC,GAEtDE,IAAU,MAEZC,IAAoD;AAExD,SAAgBC,IAAqC;CACnD,AAAID,MACJ,IAAa,kBAAkB;EAC7B,EAA8B;CAChC,GAAGD,CAAO,GACVG,EAA8B;AAChC;AAEA,SAAgBC,IAAoC;CAClD,AAAIH,KAAc,SAChB,cAAcA,CAAU,GACxB,IAAa;AAEjB;AAEA,eAAeE,IAA0C;CACvD,IAAIE;CACJ,IAAI;EACF,IAASR,EAAiB;CAC5B,QAAQ;EACN;CACF;CAIA,IAHI,CAACQ,EAAO,qBAGR,CAACC,EAAO,aAAa,GAAG;CAC5B,IAAMC,IAAKD,EAAO,SAAS;CAC3B,IAAI,CAACC,GAAI;CAET,IAAMC,IAAU,MAAMD,EACnB,OAAO,CAAC,CACR,KAAKE,CAAqB,CAAC,CAC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,EAAG,CAAC;EAChD,SAASW,GAAK;GAEZ,AADAzB,EAAO,sBAAsBc,EAAI,IAAIW,CAAG,GACxC,MAAMjB,EACH,OAAOE,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAce,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAMd,EAAGD,EAAsB,IAAII,EAAI,EAAG,CAAC;EAChD;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedprotocol/publish",
3
- "version": "0.7.2",
3
+ "version": "0.7.3-next.654.g52217f6",
4
4
  "description": "Publish UI components and helpers for Seed Protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,10 +38,10 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@ethereum-attestation-service/eas-sdk": "^2.9.0",
41
- "@seedprotocol/arweave": "0.7.2",
42
- "@seedprotocol/eas": "0.7.2",
43
- "@seedprotocol/react": "0.7.2",
44
- "@seedprotocol/sdk": "0.7.2",
41
+ "@seedprotocol/arweave": "0.7.3-next.654.g52217f6",
42
+ "@seedprotocol/eas": "0.7.3-next.654.g52217f6",
43
+ "@seedprotocol/react": "0.7.3-next.654.g52217f6",
44
+ "@seedprotocol/sdk": "0.7.3-next.654.g52217f6",
45
45
  "@xstate/react": "^6.1.0",
46
46
  "arweave": "^1.15.7",
47
47
  "debug": "^4.4.1",