@seedprotocol/publish 0.7.0 → 0.7.2-next.593.gd5bd4ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chainConfig-DWynbnb8.js → chainConfig-BDMRU4m8.js} +5 -5
- package/dist/chainConfig-BDMRU4m8.js.map +1 -0
- package/dist/collectBatchUids-CnIe9jUB.js.map +1 -1
- package/dist/{ensureAutomationSessionKey-BVmh030S.js → ensureAutomationSessionKey-bw6knEyC.js} +4 -4
- package/dist/ensureAutomationSessionKey-bw6knEyC.js.map +1 -0
- package/dist/{ensureModularPublishBootstrap-DRFhp-O2.js → ensureModularPublishBootstrap-Vc4Jz_B9.js} +5 -5
- package/dist/ensureModularPublishBootstrap-Vc4Jz_B9.js.map +1 -0
- package/dist/{ensureSmartWalletThenPublish-0nKg13WN.js → ensureSmartWalletThenPublish-42iEhiHG.js} +3 -3
- package/dist/ensureSmartWalletThenPublish-42iEhiHG.js.map +1 -0
- package/dist/index.js +6 -14
- package/dist/index.js.map +1 -1
- package/dist/{managedAccountAdmin-B4HkLWWE.js → managedAccountAdmin-B3DPMmhR.js} +4 -4
- package/dist/managedAccountAdmin-B3DPMmhR.js.map +1 -0
- package/dist/{publishAuthorization-C-XYb9Ef.js → publishAuthorization-CAFF5jQ2.js} +1033 -1044
- package/dist/publishAuthorization-CAFF5jQ2.js.map +1 -0
- package/dist/{publishThirdwebClient-BQ_KnMi5.js → publishThirdwebClient-CPzAjnmf.js} +2 -2
- package/dist/publishThirdwebClient-CPzAjnmf.js.map +1 -0
- package/dist/{resolveRevokeAccount-9-OzXVdp.js → resolveRevokeAccount-CkbTpC27.js} +4 -4
- package/dist/resolveRevokeAccount-CkbTpC27.js.map +1 -0
- package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
- package/dist/services/publish/actors/rewritingHtmlEmbedded.d.ts.map +1 -1
- package/dist/services/publish/helpers/getPublishUploadData.d.ts +5 -0
- package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
- package/dist/thirdweb.js +7 -9
- package/dist/thirdweb.js.map +1 -1
- package/dist/{worker-FmHZbku5.js → worker-CCQ7KBMm.js} +2 -2
- package/dist/{worker-CJRUAOAn.js.map → worker-CCQ7KBMm.js.map} +1 -1
- package/package.json +13 -7
- package/dist/chainConfig-BJ8C_RRz.js +0 -1455
- package/dist/chainConfig-BJ8C_RRz.js.map +0 -1
- package/dist/chainConfig-DWynbnb8.js.map +0 -1
- package/dist/chainConfig-DWzoOtkS.js +0 -1453
- package/dist/chainConfig-DWzoOtkS.js.map +0 -1
- package/dist/chainConfig-DmuPBs3D.js +0 -1455
- package/dist/chainConfig-DmuPBs3D.js.map +0 -1
- package/dist/ensureAutomationSessionKey-BVmh030S.js.map +0 -1
- package/dist/ensureAutomationSessionKey-CxpJY_uH.js +0 -84
- package/dist/ensureAutomationSessionKey-CxpJY_uH.js.map +0 -1
- package/dist/ensureAutomationSessionKey-DwRm4YMJ.js +0 -84
- package/dist/ensureAutomationSessionKey-DwRm4YMJ.js.map +0 -1
- package/dist/ensureAutomationSessionKey-h3zOmDr5.js +0 -84
- package/dist/ensureAutomationSessionKey-h3zOmDr5.js.map +0 -1
- package/dist/ensureModularPublishBootstrap-BImiIFJe.js +0 -23
- package/dist/ensureModularPublishBootstrap-BImiIFJe.js.map +0 -1
- package/dist/ensureModularPublishBootstrap-CmxyX_EN.js +0 -23
- package/dist/ensureModularPublishBootstrap-CmxyX_EN.js.map +0 -1
- package/dist/ensureModularPublishBootstrap-DRFhp-O2.js.map +0 -1
- package/dist/ensureModularPublishBootstrap-DegJnYKL.js +0 -23
- package/dist/ensureModularPublishBootstrap-DegJnYKL.js.map +0 -1
- package/dist/ensureSmartWalletThenPublish-0nKg13WN.js.map +0 -1
- package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js +0 -47
- package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js.map +0 -1
- package/dist/ensureSmartWalletThenPublish-BfEndtFo.js +0 -47
- package/dist/ensureSmartWalletThenPublish-BfEndtFo.js.map +0 -1
- package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js +0 -47
- package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js.map +0 -1
- package/dist/managedAccountAdmin-B4HkLWWE.js.map +0 -1
- package/dist/managedAccountAdmin-ByEX_Eg2.js +0 -28
- package/dist/managedAccountAdmin-ByEX_Eg2.js.map +0 -1
- package/dist/managedAccountAdmin-DS6nniiu.js +0 -28
- package/dist/managedAccountAdmin-DS6nniiu.js.map +0 -1
- package/dist/managedAccountAdmin-DwFI-ZfE.js +0 -28
- package/dist/managedAccountAdmin-DwFI-ZfE.js.map +0 -1
- package/dist/publishAuthorization-C-XYb9Ef.js.map +0 -1
- package/dist/publishAuthorization-CG23g8w2.js +0 -3987
- package/dist/publishAuthorization-CG23g8w2.js.map +0 -1
- package/dist/publishAuthorization-CvK_coYp.js +0 -4011
- package/dist/publishAuthorization-CvK_coYp.js.map +0 -1
- package/dist/publishAuthorization-DgDI4zor.js +0 -4011
- package/dist/publishAuthorization-DgDI4zor.js.map +0 -1
- package/dist/publishThirdwebClient-BQ_KnMi5.js.map +0 -1
- package/dist/publishThirdwebClient-BmqsJCjp.js +0 -18
- package/dist/publishThirdwebClient-BmqsJCjp.js.map +0 -1
- package/dist/publishThirdwebClient-CO18ST7C.js +0 -18
- package/dist/publishThirdwebClient-CO18ST7C.js.map +0 -1
- package/dist/publishThirdwebClient-D-K2WEeM.js +0 -18
- package/dist/publishThirdwebClient-D-K2WEeM.js.map +0 -1
- package/dist/resolveRevokeAccount-9-OzXVdp.js.map +0 -1
- package/dist/resolveRevokeAccount-CXa5XlOv.js +0 -38
- package/dist/resolveRevokeAccount-CXa5XlOv.js.map +0 -1
- package/dist/resolveRevokeAccount-DsNod8ti.js +0 -38
- package/dist/resolveRevokeAccount-DsNod8ti.js.map +0 -1
- package/dist/resolveRevokeAccount-QgZ6YZuS.js +0 -38
- package/dist/resolveRevokeAccount-QgZ6YZuS.js.map +0 -1
- package/dist/worker-CJRUAOAn.js +0 -69
- package/dist/worker-CN7zg73B.js +0 -69
- package/dist/worker-CN7zg73B.js.map +0 -1
- package/dist/worker-FmHZbku5.js.map +0 -1
- package/dist/worker-qoGuo876.js +0 -69
- package/dist/worker-qoGuo876.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publishThirdwebClient-BQ_KnMi5.js","names":[],"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":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { o as t } from "./chainConfig-DWynbnb8.js";
|
|
3
|
-
import { createThirdwebClient as n } from "thirdweb";
|
|
4
|
-
//#region src/helpers/publishThirdwebClient.ts
|
|
5
|
-
var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
|
|
6
|
-
function o() {
|
|
7
|
-
let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
|
|
8
|
-
if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
|
|
9
|
-
let o = `${e ?? ""}\0${r ?? ""}`;
|
|
10
|
-
return (!i || a !== o) && (a = o, i = n(e ? {
|
|
11
|
-
clientId: e,
|
|
12
|
-
...r ? { secretKey: r } : {}
|
|
13
|
-
} : { secretKey: r })), i;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { r as n, o as t };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=publishThirdwebClient-BmqsJCjp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publishThirdwebClient-BmqsJCjp.js","names":[],"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":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { o as t } from "./chainConfig-DWzoOtkS.js";
|
|
3
|
-
import { createThirdwebClient as n } from "thirdweb";
|
|
4
|
-
//#region src/helpers/publishThirdwebClient.ts
|
|
5
|
-
var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
|
|
6
|
-
function o() {
|
|
7
|
-
let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
|
|
8
|
-
if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
|
|
9
|
-
let o = `${e ?? ""}\0${r ?? ""}`;
|
|
10
|
-
return (!i || a !== o) && (a = o, i = n(e ? {
|
|
11
|
-
clientId: e,
|
|
12
|
-
...r ? { secretKey: r } : {}
|
|
13
|
-
} : { secretKey: r })), i;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { r as n, o as t };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=publishThirdwebClient-CO18ST7C.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publishThirdwebClient-CO18ST7C.js","names":[],"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":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { o as t } from "./chainConfig-BJ8C_RRz.js";
|
|
3
|
-
import { createThirdwebClient as n } from "thirdweb";
|
|
4
|
-
//#region src/helpers/publishThirdwebClient.ts
|
|
5
|
-
var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
|
|
6
|
-
function o() {
|
|
7
|
-
let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
|
|
8
|
-
if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
|
|
9
|
-
let o = `${e ?? ""}\0${r ?? ""}`;
|
|
10
|
-
return (!i || a !== o) && (a = o, i = n(e ? {
|
|
11
|
-
clientId: e,
|
|
12
|
-
...r ? { secretKey: r } : {}
|
|
13
|
-
} : { secretKey: r })), i;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { r as n, o as t };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=publishThirdwebClient-D-K2WEeM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publishThirdwebClient-D-K2WEeM.js","names":[],"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":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRevokeAccount-9-OzXVdp.js","names":[],"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,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { o as e, y as t } from "./chainConfig-DmuPBs3D.js";
|
|
2
|
-
import { A as n, F as r, L as i, M as a } from "./publishAuthorization-CG23g8w2.js";
|
|
3
|
-
import { t as o } from "./publishThirdwebClient-BQ_KnMi5.js";
|
|
4
|
-
import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
|
|
5
|
-
//#region src/helpers/resolveRevokeAccount.ts
|
|
6
|
-
async function c(c) {
|
|
7
|
-
let { account: l, attester: u } = c;
|
|
8
|
-
if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
|
|
9
|
-
let d = s(), f = !1;
|
|
10
|
-
if (d) {
|
|
11
|
-
let e = await d(), t = u.toLowerCase();
|
|
12
|
-
f = !!e?.some((e) => e?.toLowerCase() === t);
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
let e = await r(l.address);
|
|
16
|
-
if (u.toLowerCase() === e.toLowerCase() || f) {
|
|
17
|
-
let r = f ? await n(t()).catch(() => e) : e;
|
|
18
|
-
if (await i(r)) {
|
|
19
|
-
let e = a();
|
|
20
|
-
await e.autoConnect({
|
|
21
|
-
client: o(),
|
|
22
|
-
chain: t()
|
|
23
|
-
});
|
|
24
|
-
let n = e.getAccount();
|
|
25
|
-
if (n) return n;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
} catch {}
|
|
29
|
-
if (f) {
|
|
30
|
-
let { modularAccountModuleContract: t } = e();
|
|
31
|
-
throw t?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
|
|
32
|
-
}
|
|
33
|
-
return l;
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { c as resolveRevokeAccount };
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=resolveRevokeAccount-CXa5XlOv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRevokeAccount-CXa5XlOv.js","names":[],"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,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { o as e, y as t } from "./chainConfig-DWzoOtkS.js";
|
|
2
|
-
import { A as n, F as r, L as i, M as a } from "./publishAuthorization-DgDI4zor.js";
|
|
3
|
-
import { t as o } from "./publishThirdwebClient-CO18ST7C.js";
|
|
4
|
-
import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
|
|
5
|
-
//#region src/helpers/resolveRevokeAccount.ts
|
|
6
|
-
async function c(c) {
|
|
7
|
-
let { account: l, attester: u } = c;
|
|
8
|
-
if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
|
|
9
|
-
let d = s(), f = !1;
|
|
10
|
-
if (d) {
|
|
11
|
-
let e = await d(), t = u.toLowerCase();
|
|
12
|
-
f = !!e?.some((e) => e?.toLowerCase() === t);
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
let e = await r(l.address);
|
|
16
|
-
if (u.toLowerCase() === e.toLowerCase() || f) {
|
|
17
|
-
let r = f ? await n(t()).catch(() => e) : e;
|
|
18
|
-
if (await i(r)) {
|
|
19
|
-
let e = a();
|
|
20
|
-
await e.autoConnect({
|
|
21
|
-
client: o(),
|
|
22
|
-
chain: t()
|
|
23
|
-
});
|
|
24
|
-
let n = e.getAccount();
|
|
25
|
-
if (n) return n;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
} catch {}
|
|
29
|
-
if (f) {
|
|
30
|
-
let { modularAccountModuleContract: t } = e();
|
|
31
|
-
throw t?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
|
|
32
|
-
}
|
|
33
|
-
return l;
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { c as resolveRevokeAccount };
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=resolveRevokeAccount-DsNod8ti.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRevokeAccount-DsNod8ti.js","names":[],"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,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { o as e, y as t } from "./chainConfig-BJ8C_RRz.js";
|
|
2
|
-
import { A as n, F as r, L as i, M as a } from "./publishAuthorization-CvK_coYp.js";
|
|
3
|
-
import { t as o } from "./publishThirdwebClient-D-K2WEeM.js";
|
|
4
|
-
import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
|
|
5
|
-
//#region src/helpers/resolveRevokeAccount.ts
|
|
6
|
-
async function c(c) {
|
|
7
|
-
let { account: l, attester: u } = c;
|
|
8
|
-
if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
|
|
9
|
-
let d = s(), f = !1;
|
|
10
|
-
if (d) {
|
|
11
|
-
let e = await d(), t = u.toLowerCase();
|
|
12
|
-
f = !!e?.some((e) => e?.toLowerCase() === t);
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
let e = await r(l.address);
|
|
16
|
-
if (u.toLowerCase() === e.toLowerCase() || f) {
|
|
17
|
-
let r = f ? await n(t()).catch(() => e) : e;
|
|
18
|
-
if (await i(r)) {
|
|
19
|
-
let e = a();
|
|
20
|
-
await e.autoConnect({
|
|
21
|
-
client: o(),
|
|
22
|
-
chain: t()
|
|
23
|
-
});
|
|
24
|
-
let n = e.getAccount();
|
|
25
|
-
if (n) return n;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
} catch {}
|
|
29
|
-
if (f) {
|
|
30
|
-
let { modularAccountModuleContract: t } = e();
|
|
31
|
-
throw t?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
|
|
32
|
-
}
|
|
33
|
-
return l;
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { c as resolveRevokeAccount };
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=resolveRevokeAccount-QgZ6YZuS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRevokeAccount-QgZ6YZuS.js","names":[],"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,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
|
package/dist/worker-CJRUAOAn.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { o as e } from "./chainConfig-DmuPBs3D.js";
|
|
2
|
-
import { BaseDb as t, applyArweaveL1TransactionIdLocal as n, arweaveL1FinalizeJobs as r, getArweaveUploadStatus as i, isArweaveL1AnchoringComplete as a, queryArweaveGatewayTransactionWithFallback as o } from "@seedprotocol/sdk";
|
|
3
|
-
import s from "debug";
|
|
4
|
-
import { eq as c } from "drizzle-orm";
|
|
5
|
-
//#region src/services/arweaveL1Finalize/worker.ts
|
|
6
|
-
var l = s("seedProtocol:arweaveL1Finalize:worker"), u = 45e3, d = null;
|
|
7
|
-
function f() {
|
|
8
|
-
d ?? (d = setInterval(() => {
|
|
9
|
-
p();
|
|
10
|
-
}, u), p());
|
|
11
|
-
}
|
|
12
|
-
async function p() {
|
|
13
|
-
let s;
|
|
14
|
-
try {
|
|
15
|
-
s = e();
|
|
16
|
-
} catch {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (!s.useArweaveBundler || !t.isAppDbReady()) return;
|
|
20
|
-
let u = t.getAppDb();
|
|
21
|
-
if (!u) return;
|
|
22
|
-
let d = await u.select().from(r).where(c(r.phase, "pending_l1")).limit(25);
|
|
23
|
-
if (d.length === 0) return;
|
|
24
|
-
let f = s.arweaveUploadVerificationBaseUrl, p = s.arweaveGraphqlUrl;
|
|
25
|
-
for (let e of d) {
|
|
26
|
-
let t = e.dataItemId;
|
|
27
|
-
try {
|
|
28
|
-
let s = e.l1TransactionId;
|
|
29
|
-
if (!s) {
|
|
30
|
-
let n = (await o(p, t))?.bundledInId ?? null;
|
|
31
|
-
n && (s = n, await u.update(r).set({
|
|
32
|
-
l1TransactionId: n,
|
|
33
|
-
bundleId: n,
|
|
34
|
-
updatedAt: Date.now()
|
|
35
|
-
}).where(c(r.id, e.id)));
|
|
36
|
-
}
|
|
37
|
-
let l = await i(f, t), d = l ? JSON.stringify(l) : null;
|
|
38
|
-
if (l && a(l)) {
|
|
39
|
-
let i = s ?? l.bundleId ?? l.turbo?.bundleId ?? e.l1TransactionId ?? null;
|
|
40
|
-
i && await n({
|
|
41
|
-
seedLocalId: e.seedLocalId,
|
|
42
|
-
versionLocalId: e.versionLocalId,
|
|
43
|
-
dataItemId: t,
|
|
44
|
-
l1TransactionId: i
|
|
45
|
-
}), await u.update(r).set({
|
|
46
|
-
phase: "confirmed",
|
|
47
|
-
statusJson: d,
|
|
48
|
-
l1TransactionId: i ?? e.l1TransactionId,
|
|
49
|
-
bundleId: l.bundleId ?? e.bundleId,
|
|
50
|
-
updatedAt: Date.now()
|
|
51
|
-
}).where(c(r.id, e.id));
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
await u.update(r).set({
|
|
55
|
-
statusJson: d,
|
|
56
|
-
updatedAt: Date.now()
|
|
57
|
-
}).where(c(r.id, e.id));
|
|
58
|
-
} catch (t) {
|
|
59
|
-
l("tick error for job", e.id, t), await u.update(r).set({
|
|
60
|
-
errorMessage: t instanceof Error ? t.message : String(t),
|
|
61
|
-
updatedAt: Date.now()
|
|
62
|
-
}).where(c(r.id, e.id));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { f as startArweaveL1FinalizeWorker };
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=worker-CJRUAOAn.js.map
|
package/dist/worker-CN7zg73B.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { o as e } from "./chainConfig-DWzoOtkS.js";
|
|
2
|
-
import { BaseDb as t, applyArweaveL1TransactionIdLocal as n, arweaveL1FinalizeJobs as r, getArweaveUploadStatus as i, isArweaveL1AnchoringComplete as a, queryArweaveGatewayTransactionWithFallback as o } from "@seedprotocol/sdk";
|
|
3
|
-
import s from "debug";
|
|
4
|
-
import { eq as c } from "drizzle-orm";
|
|
5
|
-
//#region src/services/arweaveL1Finalize/worker.ts
|
|
6
|
-
var l = s("seedProtocol:arweaveL1Finalize:worker"), u = 45e3, d = null;
|
|
7
|
-
function f() {
|
|
8
|
-
d ?? (d = setInterval(() => {
|
|
9
|
-
p();
|
|
10
|
-
}, u), p());
|
|
11
|
-
}
|
|
12
|
-
async function p() {
|
|
13
|
-
let s;
|
|
14
|
-
try {
|
|
15
|
-
s = e();
|
|
16
|
-
} catch {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (!s.useArweaveBundler || !t.isAppDbReady()) return;
|
|
20
|
-
let u = t.getAppDb();
|
|
21
|
-
if (!u) return;
|
|
22
|
-
let d = await u.select().from(r).where(c(r.phase, "pending_l1")).limit(25);
|
|
23
|
-
if (d.length === 0) return;
|
|
24
|
-
let f = s.arweaveUploadVerificationBaseUrl, p = s.arweaveGraphqlUrl;
|
|
25
|
-
for (let e of d) {
|
|
26
|
-
let t = e.dataItemId;
|
|
27
|
-
try {
|
|
28
|
-
let s = e.l1TransactionId;
|
|
29
|
-
if (!s) {
|
|
30
|
-
let n = (await o(p, t))?.bundledInId ?? null;
|
|
31
|
-
n && (s = n, await u.update(r).set({
|
|
32
|
-
l1TransactionId: n,
|
|
33
|
-
bundleId: n,
|
|
34
|
-
updatedAt: Date.now()
|
|
35
|
-
}).where(c(r.id, e.id)));
|
|
36
|
-
}
|
|
37
|
-
let l = await i(f, t), d = l ? JSON.stringify(l) : null;
|
|
38
|
-
if (l && a(l)) {
|
|
39
|
-
let i = s ?? l.bundleId ?? l.turbo?.bundleId ?? e.l1TransactionId ?? null;
|
|
40
|
-
i && await n({
|
|
41
|
-
seedLocalId: e.seedLocalId,
|
|
42
|
-
versionLocalId: e.versionLocalId,
|
|
43
|
-
dataItemId: t,
|
|
44
|
-
l1TransactionId: i
|
|
45
|
-
}), await u.update(r).set({
|
|
46
|
-
phase: "confirmed",
|
|
47
|
-
statusJson: d,
|
|
48
|
-
l1TransactionId: i ?? e.l1TransactionId,
|
|
49
|
-
bundleId: l.bundleId ?? e.bundleId,
|
|
50
|
-
updatedAt: Date.now()
|
|
51
|
-
}).where(c(r.id, e.id));
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
await u.update(r).set({
|
|
55
|
-
statusJson: d,
|
|
56
|
-
updatedAt: Date.now()
|
|
57
|
-
}).where(c(r.id, e.id));
|
|
58
|
-
} catch (t) {
|
|
59
|
-
l("tick error for job", e.id, t), await u.update(r).set({
|
|
60
|
-
errorMessage: t instanceof Error ? t.message : String(t),
|
|
61
|
-
updatedAt: Date.now()
|
|
62
|
-
}).where(c(r.id, e.id));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { f as startArweaveL1FinalizeWorker };
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=worker-CN7zg73B.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-CN7zg73B.js","names":[],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n applyArweaveL1TransactionIdLocal,\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\n\nconst TICK_MS = 45_000\n\nlet intervalId: ReturnType<typeof setInterval> | null = null\n\nexport function startArweaveL1FinalizeWorker(): void {\n if (intervalId != null) return\n intervalId = setInterval(() => {\n void runArweaveL1FinalizeTick()\n }, TICK_MS)\n void runArweaveL1FinalizeTick()\n}\n\nexport function stopArweaveL1FinalizeWorker(): void {\n if (intervalId != null) {\n clearInterval(intervalId)\n intervalId = null\n }\n}\n\nasync function runArweaveL1FinalizeTick(): Promise<void> {\n let config: ReturnType<typeof getPublishConfig>\n try {\n config = getPublishConfig()\n } catch {\n return\n }\n if (!config.useArweaveBundler) return\n\n // initPublish may start this worker before Seed platformClassesInit configures BaseDb.\n if (!BaseDb.isAppDbReady()) return\n const db = BaseDb.getAppDb()\n if (!db) return\n\n const pending = await db\n .select()\n .from(arweaveL1FinalizeJobs)\n .where(eq(arweaveL1FinalizeJobs.phase, 'pending_l1'))\n .limit(25)\n\n if (pending.length === 0) return\n\n const uploadBase = config.arweaveUploadVerificationBaseUrl\n const graphqlUrl = config.arweaveGraphqlUrl\n\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\n\n if (!l1TxId) {\n const gql = await queryArweaveGatewayTransactionWithFallback(graphqlUrl, dataItemId)\n const bundled = gql?.bundledInId ?? null\n if (bundled) {\n l1TxId = bundled\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n l1TransactionId: bundled,\n bundleId: bundled,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n\n const status = await getArweaveUploadStatus(uploadBase, dataItemId)\n const statusStr = status ? JSON.stringify(status) : null\n\n if (status && isArweaveL1AnchoringComplete(status)) {\n const resolvedL1 =\n l1TxId ??\n status.bundleId ??\n status.turbo?.bundleId ??\n job.l1TransactionId ??\n null\n\n if (resolvedL1) {\n await applyArweaveL1TransactionIdLocal({\n seedLocalId: job.seedLocalId,\n versionLocalId: job.versionLocalId,\n dataItemId,\n l1TransactionId: resolvedL1,\n })\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n phase: 'confirmed',\n statusJson: statusStr,\n l1TransactionId: resolvedL1 ?? job.l1TransactionId,\n bundleId: status.bundleId ?? job.bundleId,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n continue\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n statusJson: statusStr,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n } catch (err) {\n logger('tick error for job', job.id, err)\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n errorMessage: err instanceof Error ? err.message : String(err),\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n}\n"],"mappings":";;;;;AAYA,IAAM,IAAS,EAAM,uCAAuC,GAEtD,IAAU,MAEZ,IAAoD;AAExD,SAAgB,IAAqC;CAC/C,MACJ,IAAa,kBAAkB;EAC7B,EAA8B;CAChC,GAAG,CAAO,GACV,EAA8B;AAChC;AASA,eAAe,IAA0C;CACvD,IAAI;CACJ,IAAI;EACF,IAAS,EAAiB;CAC5B,QAAQ;EACN;CACF;CAIA,IAHI,CAAC,EAAO,qBAGR,CAAC,EAAO,aAAa,GAAG;CAC5B,IAAM,IAAK,EAAO,SAAS;CAC3B,IAAI,CAAC,GAAI;CAET,IAAM,IAAU,MAAM,EACnB,OAAO,CAAC,CACR,KAAK,CAAqB,CAAC,CAC3B,MAAM,EAAG,EAAsB,OAAO,YAAY,CAAC,CAAC,CACpD,MAAM,EAAE;CAEX,IAAI,EAAQ,WAAW,GAAG;CAE1B,IAAM,IAAa,EAAO,kCACpB,IAAa,EAAO;CAE1B,KAAK,IAAM,KAAO,GAAS;EACzB,IAAM,IAAa,EAAI;EACvB,IAAI;GACF,IAAI,IAAS,EAAI;GAEjB,IAAI,CAAC,GAAQ;IAEX,IAAM,KAAU,MADE,EAA2C,GAAY,CAAU,EAAA,EAC9D,eAAe;IACpC,AAAI,MACF,IAAS,GACT,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;KACH,iBAAiB;KACjB,UAAU;KACV,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;GAElD;GAEA,IAAM,IAAS,MAAM,EAAuB,GAAY,CAAU,GAC5D,IAAY,IAAS,KAAK,UAAU,CAAM,IAAI;GAEpD,IAAI,KAAU,EAA6B,CAAM,GAAG;IAClD,IAAM,IACJ,KACA,EAAO,YACP,EAAO,OAAO,YACd,EAAI,mBACJ;IAWF,AATI,KACF,MAAM,EAAiC;KACrC,aAAa,EAAI;KACjB,gBAAgB,EAAI;KACpB;KACA,iBAAiB;IACnB,CAAC,GAGH,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;KACH,OAAO;KACP,YAAY;KACZ,iBAAiB,KAAc,EAAI;KACnC,UAAU,EAAO,YAAY,EAAI;KACjC,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;IAC9C;GACF;GAEA,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;IACH,YAAY;IACZ,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD,SAAS,GAAK;GAEZ,AADA,EAAO,sBAAsB,EAAI,IAAI,CAAG,GACxC,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAc,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-FmHZbku5.js","names":[],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n applyArweaveL1TransactionIdLocal,\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\n\nconst TICK_MS = 45_000\n\nlet intervalId: ReturnType<typeof setInterval> | null = null\n\nexport function startArweaveL1FinalizeWorker(): void {\n if (intervalId != null) return\n intervalId = setInterval(() => {\n void runArweaveL1FinalizeTick()\n }, TICK_MS)\n void runArweaveL1FinalizeTick()\n}\n\nexport function stopArweaveL1FinalizeWorker(): void {\n if (intervalId != null) {\n clearInterval(intervalId)\n intervalId = null\n }\n}\n\nasync function runArweaveL1FinalizeTick(): Promise<void> {\n let config: ReturnType<typeof getPublishConfig>\n try {\n config = getPublishConfig()\n } catch {\n return\n }\n if (!config.useArweaveBundler) return\n\n // initPublish may start this worker before Seed platformClassesInit configures BaseDb.\n if (!BaseDb.isAppDbReady()) return\n const db = BaseDb.getAppDb()\n if (!db) return\n\n const pending = await db\n .select()\n .from(arweaveL1FinalizeJobs)\n .where(eq(arweaveL1FinalizeJobs.phase, 'pending_l1'))\n .limit(25)\n\n if (pending.length === 0) return\n\n const uploadBase = config.arweaveUploadVerificationBaseUrl\n const graphqlUrl = config.arweaveGraphqlUrl\n\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\n\n if (!l1TxId) {\n const gql = await queryArweaveGatewayTransactionWithFallback(graphqlUrl, dataItemId)\n const bundled = gql?.bundledInId ?? null\n if (bundled) {\n l1TxId = bundled\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n l1TransactionId: bundled,\n bundleId: bundled,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n\n const status = await getArweaveUploadStatus(uploadBase, dataItemId)\n const statusStr = status ? JSON.stringify(status) : null\n\n if (status && isArweaveL1AnchoringComplete(status)) {\n const resolvedL1 =\n l1TxId ??\n status.bundleId ??\n status.turbo?.bundleId ??\n job.l1TransactionId ??\n null\n\n if (resolvedL1) {\n await applyArweaveL1TransactionIdLocal({\n seedLocalId: job.seedLocalId,\n versionLocalId: job.versionLocalId,\n dataItemId,\n l1TransactionId: resolvedL1,\n })\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n phase: 'confirmed',\n statusJson: statusStr,\n l1TransactionId: resolvedL1 ?? job.l1TransactionId,\n bundleId: status.bundleId ?? job.bundleId,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n continue\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n statusJson: statusStr,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n } catch (err) {\n logger('tick error for job', job.id, err)\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n errorMessage: err instanceof Error ? err.message : String(err),\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n}\n"],"mappings":";;;;;AAYA,IAAM,IAAS,EAAM,uCAAuC,GAEtD,IAAU,MAEZ,IAAoD;AAExD,SAAgB,IAAqC;CAC/C,MACJ,IAAa,kBAAkB;EAC7B,EAA8B;CAChC,GAAG,CAAO,GACV,EAA8B;AAChC;AAEA,SAAgB,IAAoC;CAClD,AAAI,KAAc,SAChB,cAAc,CAAU,GACxB,IAAa;AAEjB;AAEA,eAAe,IAA0C;CACvD,IAAI;CACJ,IAAI;EACF,IAAS,EAAiB;CAC5B,QAAQ;EACN;CACF;CAIA,IAHI,CAAC,EAAO,qBAGR,CAAC,EAAO,aAAa,GAAG;CAC5B,IAAM,IAAK,EAAO,SAAS;CAC3B,IAAI,CAAC,GAAI;CAET,IAAM,IAAU,MAAM,EACnB,OAAO,CAAC,CACR,KAAK,CAAqB,CAAC,CAC3B,MAAM,EAAG,EAAsB,OAAO,YAAY,CAAC,CAAC,CACpD,MAAM,EAAE;CAEX,IAAI,EAAQ,WAAW,GAAG;CAE1B,IAAM,IAAa,EAAO,kCACpB,IAAa,EAAO;CAE1B,KAAK,IAAM,KAAO,GAAS;EACzB,IAAM,IAAa,EAAI;EACvB,IAAI;GACF,IAAI,IAAS,EAAI;GAEjB,IAAI,CAAC,GAAQ;IAEX,IAAM,KAAU,MADE,EAA2C,GAAY,CAAU,EAAA,EAC9D,eAAe;IACpC,AAAI,MACF,IAAS,GACT,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;KACH,iBAAiB;KACjB,UAAU;KACV,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;GAElD;GAEA,IAAM,IAAS,MAAM,EAAuB,GAAY,CAAU,GAC5D,IAAY,IAAS,KAAK,UAAU,CAAM,IAAI;GAEpD,IAAI,KAAU,EAA6B,CAAM,GAAG;IAClD,IAAM,IACJ,KACA,EAAO,YACP,EAAO,OAAO,YACd,EAAI,mBACJ;IAWF,AATI,KACF,MAAM,EAAiC;KACrC,aAAa,EAAI;KACjB,gBAAgB,EAAI;KACpB;KACA,iBAAiB;IACnB,CAAC,GAGH,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;KACH,OAAO;KACP,YAAY;KACZ,iBAAiB,KAAc,EAAI;KACnC,UAAU,EAAO,YAAY,EAAI;KACjC,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;IAC9C;GACF;GAEA,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;IACH,YAAY;IACZ,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD,SAAS,GAAK;GAEZ,AADA,EAAO,sBAAsB,EAAI,IAAI,CAAG,GACxC,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAc,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD;CACF;AACF"}
|
package/dist/worker-qoGuo876.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { o as e } from "./chainConfig-BJ8C_RRz.js";
|
|
2
|
-
import { BaseDb as t, applyArweaveL1TransactionIdLocal as n, arweaveL1FinalizeJobs as r, getArweaveUploadStatus as i, isArweaveL1AnchoringComplete as a, queryArweaveGatewayTransactionWithFallback as o } from "@seedprotocol/sdk";
|
|
3
|
-
import s from "debug";
|
|
4
|
-
import { eq as c } from "drizzle-orm";
|
|
5
|
-
//#region src/services/arweaveL1Finalize/worker.ts
|
|
6
|
-
var l = s("seedProtocol:arweaveL1Finalize:worker"), u = 45e3, d = null;
|
|
7
|
-
function f() {
|
|
8
|
-
d ?? (d = setInterval(() => {
|
|
9
|
-
p();
|
|
10
|
-
}, u), p());
|
|
11
|
-
}
|
|
12
|
-
async function p() {
|
|
13
|
-
let s;
|
|
14
|
-
try {
|
|
15
|
-
s = e();
|
|
16
|
-
} catch {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (!s.useArweaveBundler || !t.isAppDbReady()) return;
|
|
20
|
-
let u = t.getAppDb();
|
|
21
|
-
if (!u) return;
|
|
22
|
-
let d = await u.select().from(r).where(c(r.phase, "pending_l1")).limit(25);
|
|
23
|
-
if (d.length === 0) return;
|
|
24
|
-
let f = s.arweaveUploadVerificationBaseUrl, p = s.arweaveGraphqlUrl;
|
|
25
|
-
for (let e of d) {
|
|
26
|
-
let t = e.dataItemId;
|
|
27
|
-
try {
|
|
28
|
-
let s = e.l1TransactionId;
|
|
29
|
-
if (!s) {
|
|
30
|
-
let n = (await o(p, t))?.bundledInId ?? null;
|
|
31
|
-
n && (s = n, await u.update(r).set({
|
|
32
|
-
l1TransactionId: n,
|
|
33
|
-
bundleId: n,
|
|
34
|
-
updatedAt: Date.now()
|
|
35
|
-
}).where(c(r.id, e.id)));
|
|
36
|
-
}
|
|
37
|
-
let l = await i(f, t), d = l ? JSON.stringify(l) : null;
|
|
38
|
-
if (l && a(l)) {
|
|
39
|
-
let i = s ?? l.bundleId ?? l.turbo?.bundleId ?? e.l1TransactionId ?? null;
|
|
40
|
-
i && await n({
|
|
41
|
-
seedLocalId: e.seedLocalId,
|
|
42
|
-
versionLocalId: e.versionLocalId,
|
|
43
|
-
dataItemId: t,
|
|
44
|
-
l1TransactionId: i
|
|
45
|
-
}), await u.update(r).set({
|
|
46
|
-
phase: "confirmed",
|
|
47
|
-
statusJson: d,
|
|
48
|
-
l1TransactionId: i ?? e.l1TransactionId,
|
|
49
|
-
bundleId: l.bundleId ?? e.bundleId,
|
|
50
|
-
updatedAt: Date.now()
|
|
51
|
-
}).where(c(r.id, e.id));
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
await u.update(r).set({
|
|
55
|
-
statusJson: d,
|
|
56
|
-
updatedAt: Date.now()
|
|
57
|
-
}).where(c(r.id, e.id));
|
|
58
|
-
} catch (t) {
|
|
59
|
-
l("tick error for job", e.id, t), await u.update(r).set({
|
|
60
|
-
errorMessage: t instanceof Error ? t.message : String(t),
|
|
61
|
-
updatedAt: Date.now()
|
|
62
|
-
}).where(c(r.id, e.id));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { f as startArweaveL1FinalizeWorker };
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=worker-qoGuo876.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-qoGuo876.js","names":[],"sources":["../src/services/arweaveL1Finalize/worker.ts"],"sourcesContent":["import {\n applyArweaveL1TransactionIdLocal,\n arweaveL1FinalizeJobs,\n BaseDb,\n getArweaveUploadStatus,\n isArweaveL1AnchoringComplete,\n queryArweaveGatewayTransactionWithFallback,\n} from '@seedprotocol/sdk'\nimport { eq } from 'drizzle-orm'\nimport { getPublishConfig } from '~/config'\nimport debug from 'debug'\n\nconst logger = debug('seedProtocol:arweaveL1Finalize:worker')\n\nconst TICK_MS = 45_000\n\nlet intervalId: ReturnType<typeof setInterval> | null = null\n\nexport function startArweaveL1FinalizeWorker(): void {\n if (intervalId != null) return\n intervalId = setInterval(() => {\n void runArweaveL1FinalizeTick()\n }, TICK_MS)\n void runArweaveL1FinalizeTick()\n}\n\nexport function stopArweaveL1FinalizeWorker(): void {\n if (intervalId != null) {\n clearInterval(intervalId)\n intervalId = null\n }\n}\n\nasync function runArweaveL1FinalizeTick(): Promise<void> {\n let config: ReturnType<typeof getPublishConfig>\n try {\n config = getPublishConfig()\n } catch {\n return\n }\n if (!config.useArweaveBundler) return\n\n // initPublish may start this worker before Seed platformClassesInit configures BaseDb.\n if (!BaseDb.isAppDbReady()) return\n const db = BaseDb.getAppDb()\n if (!db) return\n\n const pending = await db\n .select()\n .from(arweaveL1FinalizeJobs)\n .where(eq(arweaveL1FinalizeJobs.phase, 'pending_l1'))\n .limit(25)\n\n if (pending.length === 0) return\n\n const uploadBase = config.arweaveUploadVerificationBaseUrl\n const graphqlUrl = config.arweaveGraphqlUrl\n\n for (const job of pending) {\n const dataItemId = job.dataItemId\n try {\n let l1TxId = job.l1TransactionId\n\n if (!l1TxId) {\n const gql = await queryArweaveGatewayTransactionWithFallback(graphqlUrl, dataItemId)\n const bundled = gql?.bundledInId ?? null\n if (bundled) {\n l1TxId = bundled\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n l1TransactionId: bundled,\n bundleId: bundled,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n\n const status = await getArweaveUploadStatus(uploadBase, dataItemId)\n const statusStr = status ? JSON.stringify(status) : null\n\n if (status && isArweaveL1AnchoringComplete(status)) {\n const resolvedL1 =\n l1TxId ??\n status.bundleId ??\n status.turbo?.bundleId ??\n job.l1TransactionId ??\n null\n\n if (resolvedL1) {\n await applyArweaveL1TransactionIdLocal({\n seedLocalId: job.seedLocalId,\n versionLocalId: job.versionLocalId,\n dataItemId,\n l1TransactionId: resolvedL1,\n })\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n phase: 'confirmed',\n statusJson: statusStr,\n l1TransactionId: resolvedL1 ?? job.l1TransactionId,\n bundleId: status.bundleId ?? job.bundleId,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n continue\n }\n\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n statusJson: statusStr,\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n } catch (err) {\n logger('tick error for job', job.id, err)\n await db\n .update(arweaveL1FinalizeJobs)\n .set({\n errorMessage: err instanceof Error ? err.message : String(err),\n updatedAt: Date.now(),\n })\n .where(eq(arweaveL1FinalizeJobs.id, job.id!))\n }\n }\n}\n"],"mappings":";;;;;AAYA,IAAM,IAAS,EAAM,uCAAuC,GAEtD,IAAU,MAEZ,IAAoD;AAExD,SAAgB,IAAqC;CAC/C,MACJ,IAAa,kBAAkB;EAC7B,EAA8B;CAChC,GAAG,CAAO,GACV,EAA8B;AAChC;AASA,eAAe,IAA0C;CACvD,IAAI;CACJ,IAAI;EACF,IAAS,EAAiB;CAC5B,QAAQ;EACN;CACF;CAIA,IAHI,CAAC,EAAO,qBAGR,CAAC,EAAO,aAAa,GAAG;CAC5B,IAAM,IAAK,EAAO,SAAS;CAC3B,IAAI,CAAC,GAAI;CAET,IAAM,IAAU,MAAM,EACnB,OAAO,CAAC,CACR,KAAK,CAAqB,CAAC,CAC3B,MAAM,EAAG,EAAsB,OAAO,YAAY,CAAC,CAAC,CACpD,MAAM,EAAE;CAEX,IAAI,EAAQ,WAAW,GAAG;CAE1B,IAAM,IAAa,EAAO,kCACpB,IAAa,EAAO;CAE1B,KAAK,IAAM,KAAO,GAAS;EACzB,IAAM,IAAa,EAAI;EACvB,IAAI;GACF,IAAI,IAAS,EAAI;GAEjB,IAAI,CAAC,GAAQ;IAEX,IAAM,KAAU,MADE,EAA2C,GAAY,CAAU,EAAA,EAC9D,eAAe;IACpC,AAAI,MACF,IAAS,GACT,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;KACH,iBAAiB;KACjB,UAAU;KACV,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;GAElD;GAEA,IAAM,IAAS,MAAM,EAAuB,GAAY,CAAU,GAC5D,IAAY,IAAS,KAAK,UAAU,CAAM,IAAI;GAEpD,IAAI,KAAU,EAA6B,CAAM,GAAG;IAClD,IAAM,IACJ,KACA,EAAO,YACP,EAAO,OAAO,YACd,EAAI,mBACJ;IAWF,AATI,KACF,MAAM,EAAiC;KACrC,aAAa,EAAI;KACjB,gBAAgB,EAAI;KACpB;KACA,iBAAiB;IACnB,CAAC,GAGH,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;KACH,OAAO;KACP,YAAY;KACZ,iBAAiB,KAAc,EAAI;KACnC,UAAU,EAAO,YAAY,EAAI;KACjC,WAAW,KAAK,IAAI;IACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;IAC9C;GACF;GAEA,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;IACH,YAAY;IACZ,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD,SAAS,GAAK;GAEZ,AADA,EAAO,sBAAsB,EAAI,IAAI,CAAG,GACxC,MAAM,EACH,OAAO,CAAqB,CAAC,CAC7B,IAAI;IACH,cAAc,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG;IAC7D,WAAW,KAAK,IAAI;GACtB,CAAC,CAAC,CACD,MAAM,EAAG,EAAsB,IAAI,EAAI,EAAG,CAAC;EAChD;CACF;AACF"}
|