@pushchain/core 6.0.27-alpha.3 → 6.0.27-alpha.5
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/AGW.md +35 -6
- package/CHANGELOG.md +13 -0
- package/MARKETPLACE.md +206 -0
- package/package.json +2 -1
- package/src/lib/agentic/codec/rules.js +74 -69
- package/src/lib/agentic/codec/universal.js +15 -3
- package/src/lib/agentic/constants.d.ts +36 -1
- package/src/lib/agentic/constants.js +14 -1
- package/src/lib/agentic/contracts/reader.d.ts +21 -0
- package/src/lib/agentic/contracts/reader.js +3 -0
- package/src/lib/agentic/error-messages.d.ts +3 -0
- package/src/lib/agentic/error-messages.js +127 -0
- package/src/lib/agentic/errors.d.ts +12 -3
- package/src/lib/agentic/errors.js +76 -0
- package/src/lib/agentic/management/common.js +6 -0
- package/src/lib/agentic/management/destination.d.ts +5 -0
- package/src/lib/agentic/management/destination.js +32 -0
- package/src/lib/agentic/management/prepare.js +80 -55
- package/src/lib/agentic/management/svm-public.js +13 -4
- package/src/lib/agentic/presets/index.js +8 -9
- package/src/lib/agentic/presets/routes.d.ts +1 -1
- package/src/lib/agentic/presets/routes.js +6 -7
- package/src/lib/agentic/presets/types.d.ts +1 -6
- package/src/lib/agentic/public-rule.js +18 -2
- package/src/lib/constants/index.d.ts +35 -0
- package/src/lib/index.d.ts +4 -0
- package/src/lib/index.js +6 -2
- package/src/lib/job/job.d.ts +35 -0
- package/src/lib/job/job.js +382 -0
- package/src/lib/job/types.d.ts +94 -0
- package/src/lib/job/types.js +3 -0
- package/src/lib/job/watch.d.ts +3 -0
- package/src/lib/job/watch.js +169 -0
- package/src/lib/job-spec/codec.d.ts +18 -0
- package/src/lib/job-spec/codec.js +348 -0
- package/src/lib/job-spec/constants.d.ts +32 -0
- package/src/lib/job-spec/constants.js +36 -0
- package/src/lib/job-spec/helpers.d.ts +19 -0
- package/src/lib/job-spec/helpers.js +138 -0
- package/src/lib/job-spec/index.d.ts +14 -0
- package/src/lib/job-spec/index.js +17 -0
- package/src/lib/job-spec/preview.d.ts +8 -0
- package/src/lib/job-spec/preview.js +298 -0
- package/src/lib/job-spec/read.d.ts +20 -0
- package/src/lib/job-spec/read.js +224 -0
- package/src/lib/job-spec/schema.d.ts +290 -0
- package/src/lib/job-spec/schema.js +70 -0
- package/src/lib/job-spec/types.d.ts +139 -0
- package/src/lib/job-spec/types.js +3 -0
- package/src/lib/market/contracts/AgenticCommerce.d.ts +1026 -0
- package/src/lib/market/contracts/AgenticCommerce.js +1317 -0
- package/src/lib/market/contracts/RulesBindingHook.d.ts +235 -0
- package/src/lib/market/contracts/RulesBindingHook.js +314 -0
- package/src/lib/market/contracts/UniversalMarketplace.d.ts +1770 -0
- package/src/lib/market/contracts/UniversalMarketplace.js +2295 -0
- package/src/lib/market/contracts/UniversalMarketplaceErrors.d.ts +309 -0
- package/src/lib/market/contracts/UniversalMarketplaceErrors.js +416 -0
- package/src/lib/market/contracts/UniversalMarketplaceRules.d.ts +241 -0
- package/src/lib/market/contracts/UniversalMarketplaceRules.js +323 -0
- package/src/lib/market/data.d.ts +8 -0
- package/src/lib/market/data.js +60 -0
- package/src/lib/market/deployment.d.ts +14 -0
- package/src/lib/market/deployment.js +23 -0
- package/src/lib/market/deposit.d.ts +24 -0
- package/src/lib/market/deposit.js +271 -0
- package/src/lib/market/errors.d.ts +13 -0
- package/src/lib/market/errors.js +81 -0
- package/src/lib/market/history.d.ts +6 -0
- package/src/lib/market/history.js +83 -0
- package/src/lib/market/index.d.ts +4 -0
- package/src/lib/market/index.js +12 -0
- package/src/lib/market/kernel-wire.d.ts +15 -0
- package/src/lib/market/kernel-wire.js +41 -0
- package/src/lib/market/market.d.ts +55 -0
- package/src/lib/market/market.js +635 -0
- package/src/lib/market/rules.d.ts +106 -0
- package/src/lib/market/rules.js +293 -0
- package/src/lib/market/runtime.d.ts +35 -0
- package/src/lib/market/runtime.js +130 -0
- package/src/lib/market/types.d.ts +180 -0
- package/src/lib/market/types.js +3 -0
- package/src/lib/orchestrator/internals/errors.d.ts +9 -2
- package/src/lib/orchestrator/internals/errors.js +9 -2
- package/src/lib/orchestrator/internals/push-chain-tx.js +17 -3
- package/src/lib/push-chain/push-chain.d.ts +44 -1
- package/src/lib/push-chain/push-chain.js +23 -3
- package/src/lib/read-state/read-params.d.ts +9 -0
- package/src/lib/read-state/read-params.js +5 -1
- package/src/lib/utils.d.ts +15 -0
- package/src/lib/utils.js +4 -0
|
@@ -99,11 +99,10 @@ function buildPresetApi(catalog) {
|
|
|
99
99
|
throw invalid('preset options must be an object');
|
|
100
100
|
const now = Math.floor(Date.now() / 1000);
|
|
101
101
|
const network = options.network ?? enums_1.PUSH_NETWORK.TESTNET_DONUT;
|
|
102
|
-
const funding = options.funding ?? 'push';
|
|
103
102
|
if (!Object.values(enums_1.PUSH_NETWORK).includes(network))
|
|
104
103
|
throw invalid('unknown preset Push network');
|
|
105
|
-
if (funding
|
|
106
|
-
throw invalid('preset funding
|
|
104
|
+
if ('funding' in options)
|
|
105
|
+
throw invalid('The preset funding option is no longer supported. Remove it; preset assets and limits are always preserved.');
|
|
107
106
|
if (options.agent !== undefined &&
|
|
108
107
|
(!(0, viem_1.isAddress)(options.agent, { strict: false }) ||
|
|
109
108
|
(0, viem_1.getAddress)(options.agent) === viem_1.zeroAddress))
|
|
@@ -281,8 +280,9 @@ function buildPresetApi(catalog) {
|
|
|
281
280
|
}
|
|
282
281
|
if (!calls.length || calls.length > 32)
|
|
283
282
|
throw (0, errors_1.capabilityUnavailable)('presetCalls', 'preset must contain 1..32 allowed calls including approvals');
|
|
284
|
-
|
|
285
|
-
|
|
283
|
+
const conditionCount = calls.reduce((n, c) => n + (c.pins?.length ?? 0), 0);
|
|
284
|
+
if (conditionCount > 32)
|
|
285
|
+
throw (0, errors_1.ruleConstraintLimit)(conditionCount, calls.length, chain.chainNamespace);
|
|
286
286
|
const pairs = new Map();
|
|
287
287
|
for (const call of calls) {
|
|
288
288
|
if (!/^[A-Za-z_$][\w$]*\(.*\)$/.test(call.selector))
|
|
@@ -313,7 +313,7 @@ function buildPresetApi(catalog) {
|
|
|
313
313
|
if (!selectedAssets.length)
|
|
314
314
|
issues.push({
|
|
315
315
|
code: 'ASSETS_REQUIRED',
|
|
316
|
-
message: 'Choose tokens and
|
|
316
|
+
message: 'No tokens selected: transfers from Push are disabled, not unrestricted. Choose explicit tokens and limits, then regenerate this preset.',
|
|
317
317
|
});
|
|
318
318
|
if (chain.swapRouters?.length && selectedAssets.length < 2)
|
|
319
319
|
issues.push({
|
|
@@ -326,14 +326,13 @@ function buildPresetApi(catalog) {
|
|
|
326
326
|
message: 'No asset operation has a positive per-call limit.',
|
|
327
327
|
});
|
|
328
328
|
const configurationReady = issues.length === 0;
|
|
329
|
-
const routes = (0, routes_1.presetRoutes)(chain.chainNamespace, selectedAssets, network
|
|
329
|
+
const routes = (0, routes_1.presetRoutes)(chain.chainNamespace, selectedAssets, network);
|
|
330
330
|
issues.push(...routes.issues);
|
|
331
|
-
const bridgeAssets =
|
|
331
|
+
const bridgeAssets = selectedAssets;
|
|
332
332
|
readiness.push({
|
|
333
333
|
chainNamespace: chain.chainNamespace,
|
|
334
334
|
ready: issues.length === 0,
|
|
335
335
|
configurationReady,
|
|
336
|
-
funding,
|
|
337
336
|
selectedAssets: selectedAssets.map((a) => ({
|
|
338
337
|
...a,
|
|
339
338
|
token: typeof a.token === 'string' ? a.token : { ...a.token },
|
|
@@ -3,7 +3,7 @@ import type { RuleAsset } from '../agentic.types';
|
|
|
3
3
|
import type { PresetChainReadiness, PresetConfigurationIssue } from './types';
|
|
4
4
|
/** Offline registry checks only. Grant preparation still verifies source metadata
|
|
5
5
|
* and wiring against chain state before any signature or transaction. */
|
|
6
|
-
export declare function presetRoutes(chain: string, assets: RuleAsset[], network: PUSH_NETWORK
|
|
6
|
+
export declare function presetRoutes(chain: string, assets: RuleAsset[], network: PUSH_NETWORK): {
|
|
7
7
|
bridgeAssets: PresetChainReadiness['bridgeAssets'];
|
|
8
8
|
issues: PresetConfigurationIssue[];
|
|
9
9
|
};
|
|
@@ -9,7 +9,7 @@ const deployments_1 = require("../deployments");
|
|
|
9
9
|
const operation_limits_1 = require("./operation-limits");
|
|
10
10
|
/** Offline registry checks only. Grant preparation still verifies source metadata
|
|
11
11
|
* and wiring against chain state before any signature or transaction. */
|
|
12
|
-
function presetRoutes(chain, assets, network
|
|
12
|
+
function presetRoutes(chain, assets, network) {
|
|
13
13
|
const issues = [];
|
|
14
14
|
network =
|
|
15
15
|
network === enums_1.PUSH_NETWORK.TESTNET ? enums_1.PUSH_NETWORK.TESTNET_DONUT : network;
|
|
@@ -37,12 +37,11 @@ function presetRoutes(chain, assets, network, funding) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
catch {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
40
|
+
issues.push({
|
|
41
|
+
code: 'BRIDGE_ASSET_UNAVAILABLE',
|
|
42
|
+
token,
|
|
43
|
+
message: `No SDK PRC20 mapping for ${chain}:${token} on ${network}. This preset cannot be created with this token until its Push route is verified. Choose a routed token only if the selected app supports that exact token address.`,
|
|
44
|
+
});
|
|
46
45
|
return { token, status: 'unavailable' };
|
|
47
46
|
}
|
|
48
47
|
});
|
|
@@ -25,10 +25,6 @@ export interface PresetAsset {
|
|
|
25
25
|
export interface PresetOptions {
|
|
26
26
|
/** Offline route/deployment checks; defaults to TESTNET_DONUT. */
|
|
27
27
|
network?: PUSH_NETWORK;
|
|
28
|
-
/** Push funding requires PRC20 routes. Destination funding explicitly emits
|
|
29
|
-
* empty bridge assets while preserving selected token/call limits in metadata.
|
|
30
|
-
* The CEA must already hold the required destination assets. Default: push. */
|
|
31
|
-
funding?: 'push' | 'destination';
|
|
32
28
|
/** Push-PC budget ceiling per outbound; omitted uses the catalog policy (20 PC).
|
|
33
29
|
* Explicit zero is preserved. This is not the fee charged. */
|
|
34
30
|
maxGasPerCall?: bigint;
|
|
@@ -63,8 +59,7 @@ export interface PresetChainReadiness {
|
|
|
63
59
|
chainNamespace: ForeignChainNamespace;
|
|
64
60
|
ready: boolean;
|
|
65
61
|
configurationReady: boolean;
|
|
66
|
-
|
|
67
|
-
/** Selected destination permissions, retained even when bridge assets is empty. */
|
|
62
|
+
/** Selected assets and caps, matching the returned rule assets. */
|
|
68
63
|
selectedAssets: RuleAsset[];
|
|
69
64
|
/** Registry presence only; grant preparation verifies exact on-chain identity. */
|
|
70
65
|
bridgeAssets: {
|
|
@@ -36,6 +36,7 @@ const selectors_1 = require("./codec/selectors");
|
|
|
36
36
|
const abi_layout_1 = require("./codec/abi-layout");
|
|
37
37
|
const defaults_1 = require("./codec/defaults");
|
|
38
38
|
const svm_accounts_1 = require("./codec/svm-accounts");
|
|
39
|
+
const destination_1 = require("./management/destination");
|
|
39
40
|
exports.WALLET = 'agentic:wallet';
|
|
40
41
|
const PUBLIC_INPUT = Symbol('AGW public rule');
|
|
41
42
|
/** Mark authored inputs for normalization after the wallet address is fixed. */
|
|
@@ -94,6 +95,11 @@ async function normalizePublicRule(input, wallet, runtime) {
|
|
|
94
95
|
if ('format' in rule && rule.format === 'decoded')
|
|
95
96
|
return input;
|
|
96
97
|
const r = rule;
|
|
98
|
+
if (!(0, viem_1.isAddress)(r.agent, { strict: false }) || /^0x0{40}$/i.test(r.agent))
|
|
99
|
+
throw new errors_1.AgenticError(errors_1.AGENTIC_ERROR_CODE.INVALID_RULE, 'Enter a valid agent wallet address.', {
|
|
100
|
+
userMessage: 'Enter a valid agent wallet address.',
|
|
101
|
+
details: { field: 'agent' },
|
|
102
|
+
});
|
|
97
103
|
rejectFields(r, [
|
|
98
104
|
'target',
|
|
99
105
|
'selector',
|
|
@@ -111,6 +117,11 @@ async function normalizePublicRule(input, wallet, runtime) {
|
|
|
111
117
|
r.validUntil <= runtime.nowSeconds() ||
|
|
112
118
|
r.validUntil >= 2 ** 48)
|
|
113
119
|
throw invalid('validUntil must be a future uint48 timestamp');
|
|
120
|
+
if (r.allowedCalls === undefined ||
|
|
121
|
+
(Array.isArray(r.allowedCalls) && !r.allowedCalls.length))
|
|
122
|
+
throw new errors_1.AgenticError(errors_1.AGENTIC_ERROR_CODE.INVALID_RULE, 'Add at least one allowed function. Selecting tokens and limits alone does not authorize transfers.', {
|
|
123
|
+
details: { reason: 'ALLOWED_FUNCTION_REQUIRED', field: 'allowedCalls' },
|
|
124
|
+
});
|
|
114
125
|
if (!Array.isArray(r.allowedCalls) ||
|
|
115
126
|
r.allowedCalls.length < 1 ||
|
|
116
127
|
r.allowedCalls.length > 32)
|
|
@@ -158,10 +169,15 @@ async function normalizePublicRule(input, wallet, runtime) {
|
|
|
158
169
|
throw invalid('native rules do not carry assets or maxGasPerCall');
|
|
159
170
|
const own = native
|
|
160
171
|
? wallet
|
|
161
|
-
: (0,
|
|
172
|
+
: await (0, destination_1.resolveRuleDestination)(runtime, wallet, r.chainNamespace);
|
|
162
173
|
const nativeActions = [];
|
|
163
174
|
const calls = [];
|
|
164
|
-
for (const call of r.allowedCalls) {
|
|
175
|
+
for (const [callIndex, call] of r.allowedCalls.entries()) {
|
|
176
|
+
if (!(0, viem_1.isAddress)(call.target, { strict: false }))
|
|
177
|
+
throw new errors_1.AgenticError(errors_1.AGENTIC_ERROR_CODE.INVALID_RULE, 'An allowed function has an invalid app address.', {
|
|
178
|
+
userMessage: 'An allowed function has an invalid app address. Select the app again.',
|
|
179
|
+
details: { field: `allowedCalls[${callIndex}].target`, callIndex },
|
|
180
|
+
});
|
|
165
181
|
const pins = call.pins ?? [];
|
|
166
182
|
const wirePins = [];
|
|
167
183
|
const occupied = new Set();
|
|
@@ -111,6 +111,41 @@ export declare const CONSTANTS: {
|
|
|
111
111
|
/** Checked v5 agentic wallet deployments by Push network (Donut only). */
|
|
112
112
|
AGENTIC: Readonly<{
|
|
113
113
|
WALLET: "agentic:wallet";
|
|
114
|
+
PRINCIPAL: "agentic:principal";
|
|
115
|
+
JOB: Readonly<{
|
|
116
|
+
ADDRESS: Readonly<{
|
|
117
|
+
'eip155:42101': Readonly<{
|
|
118
|
+
KERNEL: "0x977cf1AC973E9eC4332791d531507575006157Ed";
|
|
119
|
+
HOOK: "0xDe7A94e510b6C571DE7880d441349689F73A32b3";
|
|
120
|
+
EVALUATOR: "0x1afC81396f1bb36F91f74506284952b81e4bd47c";
|
|
121
|
+
}>;
|
|
122
|
+
}>;
|
|
123
|
+
EVALUATION: Readonly<{
|
|
124
|
+
readonly BOOLEAN: "BOOLEAN";
|
|
125
|
+
readonly COMPARE: "COMPARE";
|
|
126
|
+
readonly NUMBER: "NUMBER";
|
|
127
|
+
readonly PERCENTAGE: "PERCENTAGE";
|
|
128
|
+
}>;
|
|
129
|
+
OPERATION: Readonly<{
|
|
130
|
+
readonly EQUAL: "EQUAL";
|
|
131
|
+
readonly NOT_EQUAL: "NOT_EQUAL";
|
|
132
|
+
readonly GREATER_THAN: "GREATER_THAN";
|
|
133
|
+
readonly GREATER_OR_EQUAL: "GREATER_OR_EQUAL";
|
|
134
|
+
readonly LESS_THAN: "LESS_THAN";
|
|
135
|
+
readonly LESS_OR_EQUAL: "LESS_OR_EQUAL";
|
|
136
|
+
}>;
|
|
137
|
+
LOGIC: Readonly<{
|
|
138
|
+
readonly ALL: "ALL";
|
|
139
|
+
readonly ANY: "ANY";
|
|
140
|
+
readonly AT_LEAST: "AT_LEAST";
|
|
141
|
+
}>;
|
|
142
|
+
ALLOWED_MUTABILITY: Readonly<{
|
|
143
|
+
readonly NONE: "NONE";
|
|
144
|
+
readonly CLIENT: "CLIENT";
|
|
145
|
+
readonly PROVIDER: "PROVIDER";
|
|
146
|
+
readonly BOTH: "BOTH";
|
|
147
|
+
}>;
|
|
148
|
+
}>;
|
|
114
149
|
PRESETS: Readonly<{
|
|
115
150
|
CATEGORY: Readonly<{
|
|
116
151
|
DEXES: "DEXES";
|
package/src/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { PushChain } from './push-chain/push-chain';
|
|
2
|
+
export { MarketError, JobError, JobSpecError } from './market';
|
|
3
|
+
export type { AgentCardRules, MarketAssetToken, MarketPin, AgentCard, AgentCardInput, AgentCardSummary, MarketNamespace, MarketPreviewOptions, MarketWriteOptions, MarketOpenOptions, MarketDepositOptions, MarketDepositResult, MarketDepositStep, JobPlan, OwnerIntent, } from './market';
|
|
4
|
+
export type { JobNamespace, Job, JobStatus, JobEvent, JobWatchCursor, JobWatchOptions, CreateJobOptions, FundJobOptions, } from './job/types';
|
|
5
|
+
export type { JobSpec, JobSpecTemplate, JobRead, PreparedJobRead, JobReadInput, JobCheck, JobCheckTemplate, LogicTree, Evaluation, Operation, LogicKind, AllowedMutability, PrincipalMarker, PrepareJobReadOptions, ExecuteJobReadOptions, BuildJobSpecOptions, BuildJobSpecTemplateOptions, JobSpecPreview, PreviewJobSpecOptions, } from './job-spec';
|
|
2
6
|
export { CHAIN } from './constants/enums';
|
|
3
7
|
export type { ConversionQuote } from './constants/tokens';
|
|
4
8
|
export type { UniversalSigner, UniversalAccount, UniversalSignerSkeleton, SignAuthorizationParams, SignedAuthorization, DerivedExecutorAccount, ResolvedAccount, ResolvedControllerAccounts, AccountType, AccountRole, } from './universal/universal.types';
|
package/src/lib/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.PushChain = exports.AgenticRevertError = exports.AgenticError = exports.AGENTIC_ERROR_CODE = exports.PushChainBatchExecutionError = exports.PushChainExecutionError = exports.UNIVERSAL_READ_REGISTRY_EVM = exports.UNIVERSAL_CALLBACK_EVM = exports.toReadQuery = exports.toRequestIdHex = exports.inferResultShape = exports.sizeCallbackBudget = exports.toCallData = exports.validateReadSpec = exports.buildReadSpecFromPreflight = exports.parseFulfilOutcome = exports.parseReadRequestsFromReceipt = exports.decodeReadResult = exports.encodeReadQuery = exports.resolveDestination = exports.ReadRegistryUnavailableError = exports.ReadNotFoundError = void 0;
|
|
3
|
+
exports.ReadHeightUnavailableError = exports.InvalidReadSpecError = exports.InvalidReadQueryError = exports.ReadStateError = exports.TERMINAL_READ_STATUSES = exports.CONTRACT_REQUEST_STATUS = exports.READ_OUTCOME = exports.READ_ERROR_CODE = exports.READ_STATUS = exports.UNIVERSAL_READ_STATUS = exports.buildErc20WithdrawalMulticall = exports.buildMigrationPayload = exports.isValidSolanaHexAddress = exports.isSvmChain = exports.encodeSvmExecutePayload = exports.getAllCEAAddresses = exports.getCEAFactoryAddress = exports.chainSupportsOutbound = exports.chainSupportsCEA = exports.isCEA = exports.getPushAccountForCEA = exports.getCEAAddress = exports.quoteMaxPCForGasCapFromNativeValue = exports.quoteMaxPCForGasCap = exports.MAX_PC_FOR_GAS_BUFFER_BPS_LIMIT = exports.DEFAULT_MAX_PC_FOR_GAS_BUFFER_BPS = exports.isChainTarget = exports.detectRoute = exports.TransactionRoute = exports.parseUEAVersion = exports.PC20UnsafeEmptyPayloadError = exports.PC20ExportRevertedError = exports.PC20WrapperPredictionUnavailableError = exports.PC20UnknownChainNamespaceError = exports.InsufficientPC20BalanceError = exports.UnsupportedPC20DestinationError = exports.PC20AmbiguousAddressError = exports.PC20ExpectedButPRC20Error = exports.InvalidPC20MetadataError = exports.PC20FactoryMismatchError = exports.PC20RegistryMismatchError = exports.PC20WrapperNotRegisteredError = exports.PC20TokenChainMismatchError = exports.InvalidPC20AddressError = exports.PC20Error = exports.isPC20Reference = exports.CHAIN = exports.JobSpecError = exports.JobError = exports.MarketError = void 0;
|
|
4
|
+
exports.PushChain = exports.AgenticRevertError = exports.AgenticError = exports.AGENTIC_ERROR_CODE = exports.PushChainBatchExecutionError = exports.PushChainExecutionError = exports.UNIVERSAL_READ_REGISTRY_EVM = exports.UNIVERSAL_CALLBACK_EVM = exports.toReadQuery = exports.toRequestIdHex = exports.inferResultShape = exports.sizeCallbackBudget = exports.toCallData = exports.validateReadSpec = exports.buildReadSpecFromPreflight = exports.parseFulfilOutcome = exports.parseReadRequestsFromReceipt = exports.decodeReadResult = exports.encodeReadQuery = exports.resolveDestination = exports.ReadRegistryUnavailableError = exports.ReadNotFoundError = exports.ReadTimeoutError = exports.ReadDecodeError = exports.UnsupportedReadDestinationError = void 0;
|
|
5
5
|
const push_chain_1 = require("./push-chain/push-chain");
|
|
6
6
|
Object.defineProperty(exports, "PushChain", { enumerable: true, get: function () { return push_chain_1.PushChain; } });
|
|
7
|
+
var market_1 = require("./market");
|
|
8
|
+
Object.defineProperty(exports, "MarketError", { enumerable: true, get: function () { return market_1.MarketError; } });
|
|
9
|
+
Object.defineProperty(exports, "JobError", { enumerable: true, get: function () { return market_1.JobError; } });
|
|
10
|
+
Object.defineProperty(exports, "JobSpecError", { enumerable: true, get: function () { return market_1.JobSpecError; } });
|
|
7
11
|
var enums_1 = require("./constants/enums");
|
|
8
12
|
Object.defineProperty(exports, "CHAIN", { enumerable: true, get: function () { return enums_1.CHAIN; } });
|
|
9
13
|
var orchestrator_types_1 = require("./orchestrator/orchestrator.types");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import { type StackRuntime } from '../market/runtime';
|
|
3
|
+
import type { CreateJobOptions, FundJobOptions, Job, JobEvent, JobNamespace, JobStatus, JobWriteOptions, JobWatchOptions } from './types';
|
|
4
|
+
export declare class JobNamespaceImpl implements JobNamespace {
|
|
5
|
+
private readonly rt;
|
|
6
|
+
constructor(rt: StackRuntime);
|
|
7
|
+
private raw;
|
|
8
|
+
private jobAt;
|
|
9
|
+
status(jobId: bigint): Promise<Job>;
|
|
10
|
+
list(options?: {
|
|
11
|
+
client?: Address;
|
|
12
|
+
provider?: Address;
|
|
13
|
+
status?: JobStatus;
|
|
14
|
+
fromJobId?: bigint;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
jobs: Job[];
|
|
17
|
+
}>;
|
|
18
|
+
create(options: CreateJobOptions): Promise<{
|
|
19
|
+
jobId: bigint;
|
|
20
|
+
tx: import("../orchestrator/orchestrator.types").UniversalTxResponse;
|
|
21
|
+
}>;
|
|
22
|
+
private provider;
|
|
23
|
+
private open;
|
|
24
|
+
setBudget(jobId: bigint, budget: bigint, options?: JobWriteOptions & {
|
|
25
|
+
jobSpec?: Hex;
|
|
26
|
+
}): Promise<import("../orchestrator/orchestrator.types").UniversalTxResponse>;
|
|
27
|
+
fund(jobId: bigint, options?: FundJobOptions): Promise<import("../orchestrator/orchestrator.types").UniversalTxResponse>;
|
|
28
|
+
submit(jobId: bigint, options: JobWriteOptions & {
|
|
29
|
+
deliverable: Hex | string;
|
|
30
|
+
}): Promise<import("../orchestrator/orchestrator.types").UniversalTxResponse>;
|
|
31
|
+
cancel(jobId: bigint, options?: JobWriteOptions): Promise<import("../orchestrator/orchestrator.types").UniversalTxResponse>;
|
|
32
|
+
claimRefund(jobId: bigint, options?: JobWriteOptions): Promise<import("../orchestrator/orchestrator.types").UniversalTxResponse>;
|
|
33
|
+
verify(_jobId: bigint, _options?: JobWriteOptions): Promise<never>;
|
|
34
|
+
watch(jobId: bigint, callback: (event: JobEvent) => void, options?: JobWatchOptions): () => void;
|
|
35
|
+
}
|