@seedprotocol/publish 0.4.17 → 0.4.18
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/dist/config.d.ts +16 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/errors.d.ts +27 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/helpers/constants.d.ts +6 -0
- package/dist/helpers/constants.d.ts.map +1 -1
- package/dist/helpers/debugPublishIngest.d.ts +2 -0
- package/dist/helpers/debugPublishIngest.d.ts.map +1 -0
- package/dist/helpers/ensureExecutorModule.d.ts +15 -0
- package/dist/helpers/ensureExecutorModule.d.ts.map +1 -0
- package/dist/helpers/ensureManagedAccountReady.d.ts +36 -0
- package/dist/helpers/ensureManagedAccountReady.d.ts.map +1 -0
- package/dist/helpers/ensureSmartWalletThenPublish.d.ts +11 -1
- package/dist/helpers/ensureSmartWalletThenPublish.d.ts.map +1 -1
- package/dist/helpers/publishDisplayHelpers.d.ts +22 -0
- package/dist/helpers/publishDisplayHelpers.d.ts.map +1 -1
- package/dist/hooks/usePublishProcess.d.ts.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2049 -1653
- package/dist/index.js.map +1 -1
- package/dist/react/ConnectButton.d.ts.map +1 -1
- package/dist/react/PublishModeButtons.d.ts +15 -0
- package/dist/react/PublishModeButtons.d.ts.map +1 -0
- package/dist/services/PublishManager/actions/createPublish.d.ts.map +1 -1
- package/dist/services/PublishManager/actions/stopAll.d.ts +2 -1
- package/dist/services/PublishManager/actions/stopAll.d.ts.map +1 -1
- package/dist/services/PublishManager/actors/savePublish.d.ts.map +1 -1
- package/dist/services/PublishManager/actors/subscribe.d.ts.map +1 -1
- package/dist/services/publish/actors/checking.d.ts.map +1 -1
- package/dist/services/publish/actors/createAttestations.d.ts.map +1 -1
- package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
- package/dist/services/publish/actors/persistSeedUid.d.ts +4 -2
- package/dist/services/publish/actors/persistSeedUid.d.ts.map +1 -1
- package/dist/services/publish/actors/publishRequestNormalize.d.ts +13 -0
- package/dist/services/publish/actors/publishRequestNormalize.d.ts.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/config.d.ts
CHANGED
|
@@ -42,8 +42,9 @@ export interface PublishConfig {
|
|
|
42
42
|
*/
|
|
43
43
|
useDirectEas?: boolean;
|
|
44
44
|
/**
|
|
45
|
-
* Optional IModularCore module to ensure is installed on the
|
|
46
|
-
* When set, onConnect will check getInstalledModules and install if missing.
|
|
45
|
+
* Optional IModularCore module to ensure is installed on the **ModularCore** account contract.
|
|
46
|
+
* When set, onConnect / publish prep will check getInstalledModules and install if missing.
|
|
47
|
+
* If the smart account is not ModularCore (no Router), install is skipped — typical for default EIP-4337 accounts.
|
|
47
48
|
*/
|
|
48
49
|
modularAccountModuleContract?: string;
|
|
49
50
|
/** Optional module install data (default "0x"). Used with modularAccountModuleContract. */
|
|
@@ -53,6 +54,15 @@ export interface PublishConfig {
|
|
|
53
54
|
* Default: false (uses the smart wallet executor).
|
|
54
55
|
*/
|
|
55
56
|
useModularExecutor?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* When true (and `useModularExecutor`), attempts to deploy the ManagedAccount via the factory
|
|
59
|
+
* if it is not yet deployed on Optimism Sepolia. Default: false (surface `managed_not_ready` instead).
|
|
60
|
+
*/
|
|
61
|
+
autoDeployManagedAccount?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Called when optional wallet setup steps fail after connect (e.g. executor module install).
|
|
64
|
+
*/
|
|
65
|
+
onWalletSetupWarning?: (error: unknown) => void;
|
|
56
66
|
/**
|
|
57
67
|
* EXPERIMENTAL: Use Arweave bundler for instant uploads instead of reimbursement + chunk upload.
|
|
58
68
|
* When true, skips sendReimbursementRequest, pollForConfirmation, and chunk-by-chunk uploadData.
|
|
@@ -84,6 +94,8 @@ export interface PublishConfig {
|
|
|
84
94
|
}
|
|
85
95
|
/** Options passed at createPublish time. Signers here override config fallbacks. */
|
|
86
96
|
export interface CreatePublishOptions {
|
|
97
|
+
/** `patch` (default): pending properties only. `new_version`: new Version attestation + all properties. */
|
|
98
|
+
publishMode?: import('./types').PublishMode;
|
|
87
99
|
/** Required when useArweaveBundler: sign DataItems (wallet flow) */
|
|
88
100
|
signDataItems?: (uploads: import('./services/publish/helpers/getPublishUploadData').PublishUploadData[]) => Promise<ArweaveDataItemInfoResult[]>;
|
|
89
101
|
/** Required when useArweaveBundler: signer for DataItems (backend/script flow) */
|
|
@@ -126,6 +138,8 @@ export interface ResolvedPublishConfig extends PublishConfig {
|
|
|
126
138
|
modularAccountModuleData: string;
|
|
127
139
|
useModularExecutor: boolean;
|
|
128
140
|
useArweaveBundler: boolean;
|
|
141
|
+
/** Resolved: defaults to false. */
|
|
142
|
+
autoDeployManagedAccount: boolean;
|
|
129
143
|
}
|
|
130
144
|
/**
|
|
131
145
|
* Internal: Get resolved config. Reads from ref set by initPublish or PublishProvider.
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,iGAAiG;AACjG,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACzC;AAED,kEAAkE;AAClE,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAC3D,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,6EAA6E;AAC7E,MAAM,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gBAAgB,IAAI,qBAAqB,CAsBxD"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -5,4 +5,31 @@ export declare class AttestationVerificationError extends Error {
|
|
|
5
5
|
readonly code: 'METADATA_PROPERTIES_MISSING';
|
|
6
6
|
constructor(message: string, seedLocalId: string, expectedSchemas: string[], foundSchemas: string[], code?: 'METADATA_PROPERTIES_MISSING');
|
|
7
7
|
}
|
|
8
|
+
export type ManagedAccountPublishErrorCode = 'MANAGED_ACCOUNT_NOT_DEPLOYED' | 'MANAGED_ACCOUNT_UNAVAILABLE' | 'EXECUTOR_MODULE_NOT_INSTALLED';
|
|
9
|
+
/**
|
|
10
|
+
* Thrown or returned when the managed publishing account (Optimism Sepolia) is missing,
|
|
11
|
+
* unreachable, or missing the executor module for the modular executor path.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ManagedAccountPublishError extends Error {
|
|
14
|
+
readonly code: ManagedAccountPublishErrorCode;
|
|
15
|
+
readonly managedAddress?: string | undefined;
|
|
16
|
+
/** Original error when connection or deployment failed (avoids shadowing `Error.cause`). */
|
|
17
|
+
readonly underlyingCause?: unknown;
|
|
18
|
+
constructor(message: string, code: ManagedAccountPublishErrorCode, managedAddress?: string | undefined, underlyingCause?: unknown);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* True when `e` is a managed-account publish error. Uses `name` + `code` as a fallback
|
|
22
|
+
* when `instanceof` fails across duplicate bundled class identities.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isManagedAccountPublishError(e: unknown): e is ManagedAccountPublishError;
|
|
25
|
+
/**
|
|
26
|
+
* Best-effort string for RPC / thirdweb / viem failures that are not plain `Error`
|
|
27
|
+
* (so logs and UIs can show the real revert or RPC reason).
|
|
28
|
+
*/
|
|
29
|
+
export declare function stringifyUnderlyingCause(u: unknown, maxLen?: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* True when the RPC/contract error indicates the account is **not** Thirdweb ModularCore
|
|
32
|
+
* (no Router / `getInstalledModules`), e.g. default EIP-4337 smart accounts.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isRouterNonModularCoreAccountError(cause: unknown): boolean;
|
|
8
35
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,4BAA6B,SAAQ,KAAK;aAGnC,WAAW,EAAE,MAAM;aACnB,eAAe,EAAE,MAAM,EAAE;aACzB,YAAY,EAAE,MAAM,EAAE;aACtB,IAAI,EAAE,6BAA6B;gBAJnD,OAAO,EAAE,MAAM,EACC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EAAE,EACzB,YAAY,EAAE,MAAM,EAAE,EACtB,IAAI,GAAE,6BAA6D;CAKtF"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,4BAA6B,SAAQ,KAAK;aAGnC,WAAW,EAAE,MAAM;aACnB,eAAe,EAAE,MAAM,EAAE;aACzB,YAAY,EAAE,MAAM,EAAE;aACtB,IAAI,EAAE,6BAA6B;gBAJnD,OAAO,EAAE,MAAM,EACC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EAAE,EACzB,YAAY,EAAE,MAAM,EAAE,EACtB,IAAI,GAAE,6BAA6D;CAKtF;AAED,MAAM,MAAM,8BAA8B,GACtC,8BAA8B,GAC9B,6BAA6B,GAC7B,+BAA+B,CAAA;AAEnC;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;aAMjC,IAAI,EAAE,8BAA8B;aACpC,cAAc,CAAC,EAAE,MAAM;IANzC,4FAA4F;IAC5F,SAAgB,eAAe,CAAC,EAAE,OAAO,CAAA;gBAGvC,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,8BAA8B,EACpC,cAAc,CAAC,EAAE,MAAM,YAAA,EACvC,eAAe,CAAC,EAAE,OAAO;CAM5B;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,0BAA0B,CAKxF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,SAAM,GAAG,MAAM,CAqBzE;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE1E"}
|
|
@@ -9,6 +9,12 @@ export declare const EAS_SCHEMA_NAME_ATTESTATION_UID: "0x44d562ac1d7cd77e2329786
|
|
|
9
9
|
export declare const THIRDWEB_ACCOUNT_FACTORY_ADDRESS: "0x76f47d88bfaf670f5208911181fcdc0e160cb16d";
|
|
10
10
|
/** EAS contract address on Optimism Sepolia (chain 11155420) */
|
|
11
11
|
export declare const EAS_CONTRACT_ADDRESS: "0x4200000000000000000000000000000000000021";
|
|
12
|
+
/**
|
|
13
|
+
* SeedProtocol contract on Optimism Sepolia — same deployment as
|
|
14
|
+
* `helpers/thirdweb/11155420/0xcd8c945872df8e664e55cf8885c85ea3ea8f2148` (multiPublish ABI).
|
|
15
|
+
* The Thirdweb managed smart account address is not this contract; `multiPublish` must target this `to`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SEED_PROTOCOL_CONTRACT_ADDRESS_OP_SEPOLIA: "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148";
|
|
12
18
|
export declare const PublishMachineStates: {
|
|
13
19
|
readonly SUCCESS: "success";
|
|
14
20
|
readonly FAILURE: "failure";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,+DAA+D;AAC/D,eAAO,MAAM,uBAAuB,EAClC,4CAAqD,CAAA;AAEvD,wEAAwE;AACxE,eAAO,MAAM,+BAA+B,EAC1C,oEAA6E,CAAA;AAE/E,2EAA2E;AAC3E,eAAO,MAAM,gCAAgC,EAC3C,4CAAqD,CAAA;AAEvD,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,EAC/B,4CAAqD,CAAA;AAEvD,eAAO,MAAM,oBAAoB;;;CAGvB,CAAA;AAEV,qFAAqF;AACrF,eAAO,MAAM,2BAA2B,6EAI9B,CAAA;AAEV,eAAO,MAAM,yBAAyB,QAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,+DAA+D;AAC/D,eAAO,MAAM,uBAAuB,EAClC,4CAAqD,CAAA;AAEvD,wEAAwE;AACxE,eAAO,MAAM,+BAA+B,EAC1C,oEAA6E,CAAA;AAE/E,2EAA2E;AAC3E,eAAO,MAAM,gCAAgC,EAC3C,4CAAqD,CAAA;AAEvD,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,EAC/B,4CAAqD,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,yCAAyC,EACpD,4CAAqD,CAAA;AAEvD,eAAO,MAAM,oBAAoB;;;CAGvB,CAAA;AAEV,qFAAqF;AACrF,eAAO,MAAM,2BAA2B,6EAI9B,CAAA;AAEV,eAAO,MAAM,yBAAyB,QAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugPublishIngest.d.ts","sourceRoot":"","sources":["../../src/helpers/debugPublishIngest.ts"],"names":[],"mappings":"AAOA,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,SAAkB,GACtB,IAAI,CAgBN"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Account } from 'thirdweb/wallets';
|
|
2
|
+
import type { PublishConfig } from '../config';
|
|
3
|
+
/**
|
|
4
|
+
* Ensures `modularAccountModuleContract` is installed on `contractAddress` when that contract
|
|
5
|
+
* implements Thirdweb ModularCore (`getInstalledModules` / Router). If the account does not
|
|
6
|
+
* support ModularCore (RPC error `Router: function does not exist`), this is a **no-op** — many
|
|
7
|
+
* EIP-4337 managed accounts embed `multiPublish` without pluggable modules.
|
|
8
|
+
*
|
|
9
|
+
* No-op if `modularAccountModuleContract` is unset.
|
|
10
|
+
*
|
|
11
|
+
* @param contractAddress - Account contract to inspect (typically the managed smart account)
|
|
12
|
+
* @param account - Account that can sign `installModule` for that contract
|
|
13
|
+
*/
|
|
14
|
+
export declare function ensureExecutorModuleInstalled(contractAddress: string, account: Account, config: Pick<PublishConfig, 'modularAccountModuleContract'>): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=ensureExecutorModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensureExecutorModule.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureExecutorModule.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAI/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAM9C;;;;;;;;;;GAUG;AACH,wBAAsB,6BAA6B,CACjD,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,8BAA8B,CAAC,GAC1D,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ManagedAccountPublishError } from '../errors';
|
|
2
|
+
export type EnsureManagedAccountReadyResult = {
|
|
3
|
+
kind: 'skip';
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'unavailable';
|
|
6
|
+
cause: unknown;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'not_deployed';
|
|
9
|
+
managedAddress: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'ready';
|
|
12
|
+
managedAddress: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Checks managed account deployment for the modular executor path.
|
|
16
|
+
* Returns `{ kind: 'skip' }` when `useModularExecutor` is false.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ensureManagedAccountReady(): Promise<EnsureManagedAccountReadyResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Deploys the ManagedAccount via the factory using the managed in-app wallet signer.
|
|
21
|
+
* @throws ManagedAccountPublishError on missing account or deploy failure
|
|
22
|
+
*/
|
|
23
|
+
export declare function tryDeployManagedAccount(): Promise<void>;
|
|
24
|
+
export type ModularExecutorPublishPrepResult = {
|
|
25
|
+
ok: true;
|
|
26
|
+
managedAddress: string;
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
error: ManagedAccountPublishError;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Full gate for modular executor publish: deployment check, optional factory deploy, optional executor module on the managed contract.
|
|
33
|
+
* Call only when `useModularExecutor` is true.
|
|
34
|
+
*/
|
|
35
|
+
export declare function runModularExecutorPublishPrep(): Promise<ModularExecutorPublishPrepResult>;
|
|
36
|
+
//# sourceMappingURL=ensureManagedAccountReady.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensureManagedAccountReady.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureManagedAccountReady.ts"],"names":[],"mappings":"AASA,OAAO,EAAgC,0BAA0B,EAAE,MAAM,WAAW,CAAA;AAepF,MAAM,MAAM,+BAA+B,GACvC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7C;;;GAGG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,+BAA+B,CAAC,CAkB1F;AAYD;;;GAGG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAO7D;AAED,MAAM,MAAM,gCAAgC,GACxC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,0BAA0B,CAAA;CAAE,CAAA;AAEpD;;;GAGG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,gCAAgC,CAAC,CAqE/F"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import type { Account } from 'thirdweb/wallets';
|
|
2
2
|
import type { Item } from '@seedprotocol/sdk';
|
|
3
3
|
import type { CreatePublishOptions } from '../config';
|
|
4
|
+
import { ManagedAccountPublishError } from '../errors';
|
|
4
5
|
export type EnsureSmartWalletResult = {
|
|
5
6
|
outcome: 'started';
|
|
6
7
|
} | {
|
|
7
8
|
outcome: 'no_address';
|
|
8
9
|
} | {
|
|
9
10
|
outcome: 'needs_deploy';
|
|
11
|
+
} | {
|
|
12
|
+
outcome: 'managed_not_ready';
|
|
13
|
+
error: ManagedAccountPublishError;
|
|
10
14
|
};
|
|
11
15
|
/**
|
|
12
16
|
* Resolves the smart wallet for the current account; if deployed, starts publish.
|
|
13
|
-
* If the user has no deployed ManagedAccount, returns needs_deploy so the caller can open the deploy modal.
|
|
17
|
+
* If the user has no deployed ManagedAccount (non-modular path), returns needs_deploy so the caller can open the deploy modal.
|
|
18
|
+
*
|
|
19
|
+
* When `useModularExecutor` is true, runs {@link runModularExecutorPublishPrep} first and uses the **managed** account
|
|
20
|
+
* address as the publish `address` (context for `multiPublish`).
|
|
21
|
+
*
|
|
22
|
+
* Pass `options.publishMode`: `patch` (default) publishes only pending properties on the current Version;
|
|
23
|
+
* `new_version` creates a new Version attestation and re-attests all properties (requires an existing Seed UID).
|
|
14
24
|
*/
|
|
15
25
|
export declare function ensureSmartWalletThenPublish(item: Item<any>, activeAccount: Account | null | undefined, getAddress: () => Promise<string | null>, options?: CreatePublishOptions): Promise<EnsureSmartWalletResult>;
|
|
16
26
|
//# sourceMappingURL=ensureSmartWalletThenPublish.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureSmartWalletThenPublish.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureSmartWalletThenPublish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"ensureSmartWalletThenPublish.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureSmartWalletThenPublish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAGrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AAEtD,MAAM,MAAM,uBAAuB,GAC/B;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,GACtB;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,GACzB;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,GAC3B;IAAE,OAAO,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,0BAA0B,CAAA;CAAE,CAAA;AAKvE;;;;;;;;;GASG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EACf,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACzC,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,EACxC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,uBAAuB,CAAC,CA0ClC"}
|
|
@@ -5,4 +5,26 @@
|
|
|
5
5
|
* machine value for display.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getDisplayStepId(machineValue: string): string;
|
|
8
|
+
type PublishRowStatus = 'in_progress' | 'completed' | 'failed' | 'interrupted';
|
|
9
|
+
/**
|
|
10
|
+
* Single source of truth for step UIs: the live machine while running; once the
|
|
11
|
+
* actor is gone, prefer the DB row status so we never flash an intermediate
|
|
12
|
+
* `persistedSnapshot` value (e.g. creatingAttestations) after a completed run.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolvePublishDisplayValue(publishProcess: unknown | null | undefined, record: {
|
|
15
|
+
status: PublishRowStatus;
|
|
16
|
+
} | undefined, machineValue: string | undefined): string | undefined;
|
|
17
|
+
export type PublishRowForDisplay = {
|
|
18
|
+
status: string;
|
|
19
|
+
persistedSnapshot: string;
|
|
20
|
+
completedAt?: number | null;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Derives the machine-state string for UI from the persisted DB row. Prefer
|
|
24
|
+
* `status` / `completedAt` over raw `persistedSnapshot` JSON so a stale or
|
|
25
|
+
* out-of-order snapshot write cannot force the UI back to an intermediate step
|
|
26
|
+
* after a terminal save (common when consumers read `JSON.parse(persistedSnapshot).value`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function getPublishMachineValueForUi(record: PublishRowForDisplay | undefined): string | undefined;
|
|
29
|
+
export {};
|
|
8
30
|
//# sourceMappingURL=publishDisplayHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishDisplayHelpers.d.ts","sourceRoot":"","sources":["../../src/helpers/publishDisplayHelpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publishDisplayHelpers.d.ts","sourceRoot":"","sources":["../../src/helpers/publishDisplayHelpers.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED,KAAK,gBAAgB,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,aAAa,CAAA;AAE9E;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EAC1C,MAAM,EAAE;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,GAAG,SAAS,EAChD,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,MAAM,GAAG,SAAS,CAKpB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CA6BxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePublishProcess.d.ts","sourceRoot":"","sources":["../../src/hooks/usePublishProcess.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePublishProcess.d.ts","sourceRoot":"","sources":["../../src/hooks/usePublishProcess.ts"],"names":[],"mappings":"AAcA,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM;;;EAmHpD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { initPublish, configurePublish, type PublishConfig, type ResolvedPublishConfig, type CreatePublishOptions, type SerializedPublishUpload, type ArweaveTransactionInfoResult, type ArweaveDataItemInfoResult, } from './config';
|
|
2
2
|
export type { PublishUploadData } from './services/publish/helpers/getPublishUploadData';
|
|
3
|
-
export { AttestationVerificationError } from './errors';
|
|
3
|
+
export { AttestationVerificationError, isManagedAccountPublishError, isRouterNonModularCoreAccountError, ManagedAccountPublishError, type ManagedAccountPublishErrorCode, stringifyUnderlyingCause, } from './errors';
|
|
4
4
|
export { default as ConnectButton } from './react/ConnectButton';
|
|
5
|
+
export { PublishModeButtons } from './react/PublishModeButtons';
|
|
6
|
+
export type { PublishModeButtonsProps } from './react/PublishModeButtons';
|
|
7
|
+
export type { PublishMode } from './types';
|
|
5
8
|
export { default as PublishProvider, usePublishConfig } from './react/PublishProvider';
|
|
6
9
|
export type { PublishProviderProps } from './react/PublishProvider';
|
|
7
10
|
export { SeedProvider } from '@seedprotocol/react';
|
|
@@ -14,7 +17,9 @@ export { usePublishProcess, useCanPublishItem, useItemPublishStatus, usePublishP
|
|
|
14
17
|
export type { PublishProcessRecord, PublishProcessStatus } from './hooks/useItemPublishStatus';
|
|
15
18
|
export { getArweave } from './helpers/blockchain';
|
|
16
19
|
export { verifyDataItem } from './helpers/arweave';
|
|
17
|
-
export { getDisplayStepId } from './helpers/publishDisplayHelpers';
|
|
20
|
+
export { getDisplayStepId, getPublishMachineValueForUi, resolvePublishDisplayValue, type PublishRowForDisplay, } from './helpers/publishDisplayHelpers';
|
|
18
21
|
export { transformPayloadToIntegerIds, type RequestWithStringIds, type RequestWithIntegerIds, } from './helpers/transformPayloadToIntegerIds';
|
|
19
22
|
export { ensureSmartWalletThenPublish, type EnsureSmartWalletResult, } from './helpers/ensureSmartWalletThenPublish';
|
|
23
|
+
export { ensureExecutorModuleInstalled } from './helpers/ensureExecutorModule';
|
|
24
|
+
export { ensureManagedAccountReady, tryDeployManagedAccount, runModularExecutorPublishPrep, type EnsureManagedAccountReadyResult, type ModularExecutorPublishPrepResult, } from './helpers/ensureManagedAccountReady';
|
|
20
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,W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