@pushchain/core 6.0.26 → 6.0.27-alpha.0
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 +194 -0
- package/CHANGELOG.md +8 -0
- package/README.md +2 -0
- package/package.json +7 -1
- package/src/lib/agentic/agentic.d.ts +23 -0
- package/src/lib/agentic/agentic.js +51 -0
- package/src/lib/agentic/agentic.types.d.ts +409 -0
- package/src/lib/agentic/agentic.types.js +3 -0
- package/src/lib/agentic/capabilities.d.ts +37 -0
- package/src/lib/agentic/capabilities.js +64 -0
- package/src/lib/agentic/chain.d.ts +3 -0
- package/src/lib/agentic/chain.js +15 -0
- package/src/lib/agentic/codec/abi-layout.d.ts +15 -0
- package/src/lib/agentic/codec/abi-layout.js +121 -0
- package/src/lib/agentic/codec/defaults.d.ts +51 -0
- package/src/lib/agentic/codec/defaults.js +53 -0
- package/src/lib/agentic/codec/ids.d.ts +35 -0
- package/src/lib/agentic/codec/ids.js +74 -0
- package/src/lib/agentic/codec/native.d.ts +75 -0
- package/src/lib/agentic/codec/native.js +328 -0
- package/src/lib/agentic/codec/rules.d.ts +45 -0
- package/src/lib/agentic/codec/rules.js +110 -0
- package/src/lib/agentic/codec/selectors.d.ts +19 -0
- package/src/lib/agentic/codec/selectors.js +60 -0
- package/src/lib/agentic/codec/session.d.ts +54 -0
- package/src/lib/agentic/codec/session.js +65 -0
- package/src/lib/agentic/codec/svm-accounts.d.ts +35 -0
- package/src/lib/agentic/codec/svm-accounts.js +68 -0
- package/src/lib/agentic/codec/svm-idl.d.ts +11 -0
- package/src/lib/agentic/codec/svm-idl.js +226 -0
- package/src/lib/agentic/codec/svm-terms.d.ts +157 -0
- package/src/lib/agentic/codec/svm-terms.js +242 -0
- package/src/lib/agentic/codec/universal-terms.d.ts +67 -0
- package/src/lib/agentic/codec/universal-terms.js +41 -0
- package/src/lib/agentic/codec/universal.d.ts +14 -0
- package/src/lib/agentic/codec/universal.js +157 -0
- package/src/lib/agentic/constants.d.ts +11 -0
- package/src/lib/agentic/constants.js +15 -0
- package/src/lib/agentic/context.d.ts +29 -0
- package/src/lib/agentic/context.js +56 -0
- package/src/lib/agentic/contracts/abi/v5/agent-validator.d.ts +105 -0
- package/src/lib/agentic/contracts/abi/v5/agent-validator.js +149 -0
- package/src/lib/agentic/contracts/abi/v5/agw-factory.d.ts +847 -0
- package/src/lib/agentic/contracts/abi/v5/agw-factory.js +1108 -0
- package/src/lib/agentic/contracts/abi/v5/agw.d.ts +1211 -0
- package/src/lib/agentic/contracts/abi/v5/agw.js +1588 -0
- package/src/lib/agentic/contracts/abi/v5/index.d.ts +6 -0
- package/src/lib/agentic/contracts/abi/v5/index.js +17 -0
- package/src/lib/agentic/contracts/abi/v5/smart-session.d.ts +1493 -0
- package/src/lib/agentic/contracts/abi/v5/smart-session.js +1965 -0
- package/src/lib/agentic/contracts/abi/v5/universal-rules-policy.d.ts +1640 -0
- package/src/lib/agentic/contracts/abi/v5/universal-rules-policy.js +2160 -0
- package/src/lib/agentic/contracts/donut-v5.d.ts +11 -0
- package/src/lib/agentic/contracts/donut-v5.js +15 -0
- package/src/lib/agentic/contracts/prc20-metadata.d.ts +26 -0
- package/src/lib/agentic/contracts/prc20-metadata.js +87 -0
- package/src/lib/agentic/contracts/reader.d.ts +35 -0
- package/src/lib/agentic/contracts/reader.js +16 -0
- package/src/lib/agentic/contracts/v5.d.ts +5323 -0
- package/src/lib/agentic/contracts/v5.js +316 -0
- package/src/lib/agentic/deployments.d.ts +61 -0
- package/src/lib/agentic/deployments.js +203 -0
- package/src/lib/agentic/errors.d.ts +71 -0
- package/src/lib/agentic/errors.js +92 -0
- package/src/lib/agentic/execution/guards.d.ts +9 -0
- package/src/lib/agentic/execution/guards.js +30 -0
- package/src/lib/agentic/execution/outbound.d.ts +55 -0
- package/src/lib/agentic/execution/outbound.js +187 -0
- package/src/lib/agentic/execution/send.d.ts +9 -0
- package/src/lib/agentic/execution/send.js +276 -0
- package/src/lib/agentic/execution/svm-instruction.d.ts +24 -0
- package/src/lib/agentic/execution/svm-instruction.js +40 -0
- package/src/lib/agentic/execution/svm-outbound.d.ts +18 -0
- package/src/lib/agentic/execution/svm-outbound.js +86 -0
- package/src/lib/agentic/execution/svm-payload.d.ts +18 -0
- package/src/lib/agentic/execution/svm-payload.js +136 -0
- package/src/lib/agentic/execution/svm-public.d.ts +5 -0
- package/src/lib/agentic/execution/svm-public.js +182 -0
- package/src/lib/agentic/execution/svm-quote.d.ts +11 -0
- package/src/lib/agentic/execution/svm-quote.js +24 -0
- package/src/lib/agentic/execution/svm-send.d.ts +44 -0
- package/src/lib/agentic/execution/svm-send.js +90 -0
- package/src/lib/agentic/index.d.ts +5 -0
- package/src/lib/agentic/index.js +10 -0
- package/src/lib/agentic/management/common.d.ts +29 -0
- package/src/lib/agentic/management/common.js +114 -0
- package/src/lib/agentic/management/create.d.ts +16 -0
- package/src/lib/agentic/management/create.js +271 -0
- package/src/lib/agentic/management/duplicates.d.ts +4 -0
- package/src/lib/agentic/management/duplicates.js +20 -0
- package/src/lib/agentic/management/label.d.ts +3 -0
- package/src/lib/agentic/management/label.js +17 -0
- package/src/lib/agentic/management/prepare.d.ts +7 -0
- package/src/lib/agentic/management/prepare.js +95 -0
- package/src/lib/agentic/management/rules-write.d.ts +42 -0
- package/src/lib/agentic/management/rules-write.js +279 -0
- package/src/lib/agentic/management/svm-context.d.ts +25 -0
- package/src/lib/agentic/management/svm-context.js +55 -0
- package/src/lib/agentic/management/svm-metadata.d.ts +10 -0
- package/src/lib/agentic/management/svm-metadata.js +56 -0
- package/src/lib/agentic/management/svm-public.d.ts +6 -0
- package/src/lib/agentic/management/svm-public.js +125 -0
- package/src/lib/agentic/management/svm.d.ts +27 -0
- package/src/lib/agentic/management/svm.js +150 -0
- package/src/lib/agentic/presets/catalog.d.ts +21 -0
- package/src/lib/agentic/presets/catalog.js +10 -0
- package/src/lib/agentic/presets/index.d.ts +5 -0
- package/src/lib/agentic/presets/index.js +190 -0
- package/src/lib/agentic/presets/types.d.ts +44 -0
- package/src/lib/agentic/presets/types.js +3 -0
- package/src/lib/agentic/public-rule.d.ts +9 -0
- package/src/lib/agentic/public-rule.js +342 -0
- package/src/lib/agentic/reads/checkpoints.d.ts +17 -0
- package/src/lib/agentic/reads/checkpoints.js +109 -0
- package/src/lib/agentic/reads/rules.d.ts +42 -0
- package/src/lib/agentic/reads/rules.js +286 -0
- package/src/lib/agentic/reads/snapshot.d.ts +28 -0
- package/src/lib/agentic/reads/snapshot.js +85 -0
- package/src/lib/agentic/reads/svm.d.ts +17 -0
- package/src/lib/agentic/reads/svm.js +52 -0
- package/src/lib/agentic/reads/wallets.d.ts +25 -0
- package/src/lib/agentic/reads/wallets.js +122 -0
- package/src/lib/agentic/response.d.ts +41 -0
- package/src/lib/agentic/response.js +358 -0
- package/src/lib/agentic/revert.d.ts +7 -0
- package/src/lib/agentic/revert.js +102 -0
- package/src/lib/agentic/runtime.d.ts +58 -0
- package/src/lib/agentic/runtime.js +95 -0
- package/src/lib/agentic/utils.d.ts +57 -0
- package/src/lib/agentic/utils.js +165 -0
- package/src/lib/agentic/wallet.d.ts +32 -0
- package/src/lib/agentic/wallet.js +130 -0
- package/src/lib/constants/enums.d.ts +6 -3
- package/src/lib/constants/enums.js +6 -3
- package/src/lib/constants/index.d.ts +60 -4
- package/src/lib/constants/index.js +17 -3
- package/src/lib/constants/read-state.d.ts +9 -0
- package/src/lib/constants/read-state.js +13 -1
- package/src/lib/index.d.ts +8 -2
- package/src/lib/index.js +9 -1
- package/src/lib/orchestrator/internals/errors.d.ts +7 -0
- package/src/lib/orchestrator/internals/errors.js +13 -1
- package/src/lib/orchestrator/internals/execute-standard.d.ts +3 -1
- package/src/lib/orchestrator/internals/execute-standard.js +3 -3
- package/src/lib/orchestrator/internals/outbound-sync.js +52 -7
- package/src/lib/orchestrator/internals/push-chain-tx.d.ts +1 -1
- package/src/lib/orchestrator/internals/push-chain-tx.js +13 -1
- package/src/lib/orchestrator/orchestrator.d.ts +3 -0
- package/src/lib/orchestrator/orchestrator.js +13 -1
- package/src/lib/orchestrator/orchestrator.types.d.ts +8 -0
- package/src/lib/orchestrator/route-detector.js +3 -2
- package/src/lib/orchestrator/svm-idl/resolve.d.ts +2 -0
- package/src/lib/orchestrator/svm-idl/resolve.js +11 -1
- package/src/lib/progress-hook/progress-hook.js +63 -0
- package/src/lib/progress-hook/progress-hook.types.d.ts +10 -1
- package/src/lib/progress-hook/progress-hook.types.js +10 -0
- package/src/lib/push-chain/push-chain.d.ts +56 -15
- package/src/lib/push-chain/push-chain.js +66 -7
- package/src/lib/read-state/destination.js +6 -1
- package/src/lib/read-state/read-params.d.ts +3 -3
- package/src/lib/read-state/read-params.js +3 -2
- package/src/lib/read-state/read-state.types.d.ts +3 -1
- package/src/lib/read-state/read-tracker.js +2 -2
- package/src/lib/read-state/spec-builder.js +1 -1
- package/src/lib/universal/prc20-address.d.ts +15 -0
- package/src/lib/universal/prc20-address.js +135 -0
- package/src/lib/utils.d.ts +6 -13
- package/src/lib/utils.js +5 -128
- package/src/lib/vm-client/evm-client.js +34 -20
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* callers.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.InsufficientUEABalanceError = exports.PushChainBatchExecutionError = exports.PushChainExecutionError = void 0;
|
|
13
|
+
exports.InsufficientUEABalanceError = exports.PushChainBatchExecutionError = exports.AtomicBatchUnavailableError = exports.PushChainExecutionError = void 0;
|
|
14
14
|
const formatters_1 = require("../../formatters");
|
|
15
15
|
/**
|
|
16
16
|
* Typed error for Route 1 Push Chain tx failures. Thrown by
|
|
@@ -31,14 +31,26 @@ class PushChainExecutionError extends Error {
|
|
|
31
31
|
code = 'PUSH_CHAIN_EXECUTION_FAILED';
|
|
32
32
|
gatewayTxHash;
|
|
33
33
|
decodedError;
|
|
34
|
+
/** Underlying transport/RPC error, kept so raw revert data is not lost. */
|
|
35
|
+
cause;
|
|
34
36
|
constructor(message, opts = {}) {
|
|
35
37
|
super((0, formatters_1.normalizePublicErrorMessage)(message));
|
|
36
38
|
this.name = 'PushChainExecutionError';
|
|
37
39
|
this.gatewayTxHash = opts.gatewayTxHash;
|
|
38
40
|
this.decodedError = opts.decodedError;
|
|
41
|
+
if (opts.cause !== undefined)
|
|
42
|
+
this.cause = opts.cause;
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
exports.PushChainExecutionError = PushChainExecutionError;
|
|
46
|
+
/** @internal A caller required an atomic native batch; sequential fallback is forbidden. */
|
|
47
|
+
class AtomicBatchUnavailableError extends PushChainExecutionError {
|
|
48
|
+
constructor(message, cause) {
|
|
49
|
+
super(message, { cause });
|
|
50
|
+
this.name = 'AtomicBatchUnavailableError';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.AtomicBatchUnavailableError = AtomicBatchUnavailableError;
|
|
42
54
|
/** Recovery metadata for a non-atomic Push batch. A pending hash is broadcast but unconfirmed. */
|
|
43
55
|
class PushChainBatchExecutionError extends PushChainExecutionError {
|
|
44
56
|
transactionHashes;
|
|
@@ -3,4 +3,6 @@ import type { ExecuteParams, UniversalTxResponse } from '../orchestrator.types';
|
|
|
3
3
|
import type { OrchestratorContext } from './context';
|
|
4
4
|
import { type ResponseBuilderCallbacks } from './response-builder';
|
|
5
5
|
export declare function resolveRequiredFunds(requiredGasFee: bigint, executeValue: bigint, requiredFundsOverride?: bigint): bigint;
|
|
6
|
-
export declare function executeStandardPayload(ctx: OrchestratorContext, execute: ExecuteParams, eventBuffer: ProgressEvent[], getResponseCallbacks: () => ResponseBuilderCallbacks
|
|
6
|
+
export declare function executeStandardPayload(ctx: OrchestratorContext, execute: ExecuteParams, eventBuffer: ProgressEvent[], getResponseCallbacks: () => ResponseBuilderCallbacks, policy?: {
|
|
7
|
+
requireAtomicBatch: boolean;
|
|
8
|
+
}): Promise<UniversalTxResponse>;
|
|
@@ -83,7 +83,7 @@ function resolveRequiredFunds(requiredGasFee, executeValue, requiredFundsOverrid
|
|
|
83
83
|
? requiredFundsOverride
|
|
84
84
|
: baseRequiredFunds;
|
|
85
85
|
}
|
|
86
|
-
async function executeStandardPayload(ctx, execute, eventBuffer, getResponseCallbacks) {
|
|
86
|
+
async function executeStandardPayload(ctx, execute, eventBuffer, getResponseCallbacks, policy) {
|
|
87
87
|
const transformFn = (tx, buf = []) => (0, response_builder_1.transformToUniversalTxResponse)(ctx, tx, buf, getResponseCallbacks());
|
|
88
88
|
// Set default value for value if undefined
|
|
89
89
|
if (execute.value === undefined) {
|
|
@@ -104,7 +104,7 @@ async function executeStandardPayload(ctx, execute, eventBuffer, getResponseCall
|
|
|
104
104
|
(0, context_1.fireProgressHook)(ctx, progress_hook_types_1.PROGRESS_HOOK.SEND_TX_107);
|
|
105
105
|
let tx;
|
|
106
106
|
try {
|
|
107
|
-
tx = await (0, push_chain_tx_1.sendPushTx)(ctx, execute, eventBuffer, transformFn);
|
|
107
|
+
tx = await (0, push_chain_tx_1.sendPushTx)(ctx, execute, eventBuffer, transformFn, policy?.requireAtomicBatch);
|
|
108
108
|
}
|
|
109
109
|
catch (err) {
|
|
110
110
|
// Push Chain broadcast failed. Wallet rejection surfaces as 104-04;
|
|
@@ -116,7 +116,7 @@ async function executeStandardPayload(ctx, execute, eventBuffer, getResponseCall
|
|
|
116
116
|
// outer orchestrator catch doesn't emit a second 199-02 on top.
|
|
117
117
|
ctx._routeTerminalEmitted = true;
|
|
118
118
|
if (!isUserDecline && !(err instanceof push_chain_tx_1.PushChainExecutionError)) {
|
|
119
|
-
throw new push_chain_tx_1.PushChainExecutionError(errMsg);
|
|
119
|
+
throw new push_chain_tx_1.PushChainExecutionError(errMsg, { cause: err });
|
|
120
120
|
}
|
|
121
121
|
throw err;
|
|
122
122
|
}
|
|
@@ -9,8 +9,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.OutboundFailedError = exports.OutboundTimeoutError = exports.INBOUND_INITIAL_WAIT_MS = exports.INBOUND_MAX_TIMEOUT_MS = exports.OUTBOUND_MAX_TIMEOUT_MS = exports.OUTBOUND_POLL_INTERVAL_MS = exports.OUTBOUND_INITIAL_WAIT_MS = void 0;
|
|
10
10
|
exports.waitForOutboundTx = waitForOutboundTx;
|
|
11
11
|
exports.waitForAllOutboundTxsV2 = waitForAllOutboundTxsV2;
|
|
12
|
+
const tslib_1 = require("tslib");
|
|
12
13
|
const tracking_1 = require("./pc20/tracking");
|
|
13
14
|
const viem_1 = require("viem");
|
|
15
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
16
|
+
const bs58_1 = tslib_1.__importDefault(require("bs58"));
|
|
14
17
|
const chain_1 = require("../../constants/chain");
|
|
15
18
|
const enums_1 = require("../../constants/enums");
|
|
16
19
|
const types_1 = require("../../generated/uexecutor/v1/types");
|
|
@@ -90,11 +93,11 @@ exports.OutboundFailedError = OutboundFailedError;
|
|
|
90
93
|
* (preserves the silent-success bug fix); if no receipt yet or RPC failure,
|
|
91
94
|
* we keep polling.
|
|
92
95
|
*
|
|
93
|
-
* EVM
|
|
96
|
+
* EVM receipts and confirmed/finalized Solana signatures are supported.
|
|
94
97
|
*/
|
|
95
|
-
async function
|
|
98
|
+
async function verifyExternalReceipt(ctx, destinationChain, externalTxHash) {
|
|
96
99
|
const chainInfo = chain_1.CHAIN_INFO[destinationChain];
|
|
97
|
-
if (!chainInfo || chainInfo.vm !== enums_1.VM.EVM) {
|
|
100
|
+
if (!chainInfo || (chainInfo.vm !== enums_1.VM.EVM && chainInfo.vm !== enums_1.VM.SVM)) {
|
|
98
101
|
return 'unsupported';
|
|
99
102
|
}
|
|
100
103
|
// Guard against unit-test contexts that don't pass a real rpcUrls map —
|
|
@@ -106,6 +109,45 @@ async function verifyExternalEvmReceipt(ctx, destinationChain, externalTxHash) {
|
|
|
106
109
|
: chainInfo.defaultRPC;
|
|
107
110
|
if (!rpcUrls?.length)
|
|
108
111
|
return 'unsupported';
|
|
112
|
+
if (chainInfo.vm === enums_1.VM.SVM) {
|
|
113
|
+
let signature;
|
|
114
|
+
try {
|
|
115
|
+
const bytes = externalTxHash.startsWith('0x')
|
|
116
|
+
? /^0x[0-9a-fA-F]{128}$/.test(externalTxHash)
|
|
117
|
+
? Buffer.from(externalTxHash.slice(2), 'hex')
|
|
118
|
+
: new Uint8Array()
|
|
119
|
+
: bs58_1.default.decode(externalTxHash);
|
|
120
|
+
if (bytes.length !== 64)
|
|
121
|
+
return 'pending';
|
|
122
|
+
signature = bs58_1.default.encode(bytes);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return 'pending';
|
|
126
|
+
}
|
|
127
|
+
for (const url of rpcUrls) {
|
|
128
|
+
try {
|
|
129
|
+
const connection = new web3_js_1.Connection(url, 'confirmed');
|
|
130
|
+
if (`solana:${(await connection.getGenesisHash()).slice(0, 32)}` !==
|
|
131
|
+
destinationChain)
|
|
132
|
+
continue;
|
|
133
|
+
const result = await connection.getSignatureStatuses([signature], {
|
|
134
|
+
searchTransactionHistory: true,
|
|
135
|
+
});
|
|
136
|
+
const status = result.value[0];
|
|
137
|
+
// A processed vote can still disappear. Never report success/failure
|
|
138
|
+
// before the signature is confirmed or finalized on the right cluster.
|
|
139
|
+
if (!status ||
|
|
140
|
+
(status.confirmationStatus !== 'confirmed' &&
|
|
141
|
+
status.confirmationStatus !== 'finalized'))
|
|
142
|
+
return 'pending';
|
|
143
|
+
return status.err ? 'reverted' : 'success';
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
(0, context_1.printLog)(ctx, `[verifyExternalReceipt] SVM RPC unavailable: ${error instanceof Error ? error.name : 'unknown'}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return 'pending';
|
|
150
|
+
}
|
|
109
151
|
try {
|
|
110
152
|
const client = (0, viem_1.createPublicClient)({
|
|
111
153
|
transport: (0, viem_1.fallback)(rpcUrls.map((url) => (0, viem_1.http)(url))),
|
|
@@ -128,7 +170,7 @@ async function verifyExternalEvmReceipt(ctx, destinationChain, externalTxHash) {
|
|
|
128
170
|
if (/not found|TransactionReceiptNotFound|could not be found/i.test(msg)) {
|
|
129
171
|
return 'pending';
|
|
130
172
|
}
|
|
131
|
-
(0, context_1.printLog)(ctx, `[
|
|
173
|
+
(0, context_1.printLog)(ctx, `[verifyExternalReceipt] RPC error for ${destinationChain} tx ${externalTxHash}: ${msg}`);
|
|
132
174
|
return 'pending';
|
|
133
175
|
}
|
|
134
176
|
}
|
|
@@ -268,7 +310,7 @@ async function waitForOutboundTx(ctx, pushChainTxHash, options = {}) {
|
|
|
268
310
|
const isCosmosObserved = ob.outboundStatus === types_2.OutboundStatus.OBSERVED;
|
|
269
311
|
if (!isCosmosObserved) {
|
|
270
312
|
// Tiebreaker: ask the destination-chain RPC directly.
|
|
271
|
-
const verdict = await
|
|
313
|
+
const verdict = await verifyExternalReceipt(ctx, chain, ob.observedTx.txHash);
|
|
272
314
|
if (verdict === 'reverted') {
|
|
273
315
|
(0, context_1.printLog)(ctx, `[waitForOutboundTx] Source-chain RPC reports REVERTED for ${ob.destinationChain} tx ${ob.observedTx.txHash} (cosmos still ${types_1.UniversalTxStatus[statusNum] ?? statusNum})`);
|
|
274
316
|
progressHook?.({
|
|
@@ -313,7 +355,10 @@ async function waitForOutboundTx(ctx, pushChainTxHash, options = {}) {
|
|
|
313
355
|
// created, and a repeat export deploys no wrapper so nothing is
|
|
314
356
|
// ever observed to backfill it. Resolve from UniversalCore instead,
|
|
315
357
|
// keyed by the Push-native source token.
|
|
316
|
-
const pc20Wrapper = await (0, tracking_1.resolvePC20WrapperForReceipt)(ctx, ob, {
|
|
358
|
+
const pc20Wrapper = await (0, tracking_1.resolvePC20WrapperForReceipt)(ctx, ob, {
|
|
359
|
+
network: ctx.pushNetwork,
|
|
360
|
+
rpcUrls: ctx.rpcUrls,
|
|
361
|
+
});
|
|
317
362
|
const details = {
|
|
318
363
|
externalTxHash: ob.observedTx.txHash,
|
|
319
364
|
destinationChain: chain,
|
|
@@ -477,7 +522,7 @@ async function waitForAllOutboundTxsV2(ctx, pushChainTxHash, outboundHops, optio
|
|
|
477
522
|
continue;
|
|
478
523
|
const isCosmosObserved = ob.outboundStatus === types_2.OutboundStatus.OBSERVED;
|
|
479
524
|
if (!isCosmosObserved) {
|
|
480
|
-
const verdict = await
|
|
525
|
+
const verdict = await verifyExternalReceipt(ctx, chain, externalTxHash);
|
|
481
526
|
if (verdict === 'reverted') {
|
|
482
527
|
for (const targetHop of pendingTargetHops) {
|
|
483
528
|
targetHop.status = 'failed';
|
|
@@ -20,7 +20,7 @@ type TransformToResponseFn = (tx: TxResponse, eventBuffer: ProgressEvent[]) => P
|
|
|
20
20
|
* For multicall arrays: executes each call as a separate transaction with
|
|
21
21
|
* local nonce management and per-tx receipt confirmation.
|
|
22
22
|
*/
|
|
23
|
-
export declare function sendPushTx(ctx: OrchestratorContext, execute: ExecuteParams, eventBuffer: ProgressEvent[], transformFn: TransformToResponseFn): Promise<UniversalTxResponse>;
|
|
23
|
+
export declare function sendPushTx(ctx: OrchestratorContext, execute: ExecuteParams, eventBuffer: ProgressEvent[], transformFn: TransformToResponseFn, requireAtomicBatch?: boolean): Promise<UniversalTxResponse>;
|
|
24
24
|
export type ResignUniversalPayloadFn = () => Promise<{
|
|
25
25
|
universalPayload: UniversalPayload;
|
|
26
26
|
verificationData: `0x${string}`;
|
|
@@ -66,7 +66,7 @@ async function getIndexedPushTransaction(ctx, txHash, label) {
|
|
|
66
66
|
* For multicall arrays: executes each call as a separate transaction with
|
|
67
67
|
* local nonce management and per-tx receipt confirmation.
|
|
68
68
|
*/
|
|
69
|
-
async function sendPushTx(ctx, execute, eventBuffer, transformFn) {
|
|
69
|
+
async function sendPushTx(ctx, execute, eventBuffer, transformFn, requireAtomicBatch = false) {
|
|
70
70
|
if (Array.isArray(execute.data)) {
|
|
71
71
|
const calls = execute.data;
|
|
72
72
|
// Reject a zero `to` BEFORE route selection so behaviour is identical
|
|
@@ -82,6 +82,15 @@ async function sendPushTx(ctx, execute, eventBuffer, transformFn) {
|
|
|
82
82
|
// (b) a wallet that can sign a 7702 authorization. When either is missing we
|
|
83
83
|
// fall back to the legacy non-atomic per-call loop below.
|
|
84
84
|
const executor = (0, chain_1.getBatchExecutorAddress)(ctx.universalSigner.account.chain);
|
|
85
|
+
if (requireAtomicBatch) {
|
|
86
|
+
if (!executor || !ctx.universalSigner.signAuthorization) {
|
|
87
|
+
throw new errors_1.AtomicBatchUnavailableError('This operation requires a sender-preserving atomic batch; the signer/network does not support EIP-7702.');
|
|
88
|
+
}
|
|
89
|
+
const code = await ctx.pushClient.publicClient.getCode({ address: executor });
|
|
90
|
+
if (!code || code === '0x') {
|
|
91
|
+
throw new errors_1.AtomicBatchUnavailableError(`Atomic batch executor ${executor} is not deployed on the connected network.`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
85
94
|
if (executor && ctx.universalSigner.signAuthorization) {
|
|
86
95
|
try {
|
|
87
96
|
(0, context_1.printLog)(ctx, `sendPushTx — executing ${calls.length} call(s) atomically via EIP-7702 (executor: ${executor})`);
|
|
@@ -100,6 +109,9 @@ async function sendPushTx(ctx, execute, eventBuffer, transformFn) {
|
|
|
100
109
|
// (e.g. a real revert) must surface.
|
|
101
110
|
if (!(err instanceof evm_client_1.EIP7702NotSupportedError))
|
|
102
111
|
throw err;
|
|
112
|
+
if (requireAtomicBatch) {
|
|
113
|
+
throw new errors_1.AtomicBatchUnavailableError('The signer could not authorize EIP-7702; no sequential transactions were sent.', err);
|
|
114
|
+
}
|
|
103
115
|
(0, context_1.printLog)(ctx, `sendPushTx — wallet cannot sign EIP-7702 authorization; falling back to sequential execution`);
|
|
104
116
|
// eslint-disable-next-line no-console
|
|
105
117
|
console.warn('[push-chain] Wallet cannot produce an EIP-7702 authorization — batch ' +
|
|
@@ -97,6 +97,9 @@ export declare class Orchestrator {
|
|
|
97
97
|
* Route 1 (Push Chain) dispatches to extracted sub-flow modules.
|
|
98
98
|
*/
|
|
99
99
|
execute(params: ExecuteParams | UniversalExecuteParams, options?: TransactionExecutionOptions): Promise<UniversalTxResponse>;
|
|
100
|
+
/** @internal Sender-preserving batch. Never uses the native sequential fallback. */
|
|
101
|
+
executeAtomicBatch(params: ExecuteParams, options?: TransactionExecutionOptions): Promise<UniversalTxResponse>;
|
|
102
|
+
private executeWithPolicy;
|
|
100
103
|
/**
|
|
101
104
|
* Prepare a universal transaction without executing it.
|
|
102
105
|
* Returns a PreparedUniversalTx that can be chained with thenOn() or sent with send().
|
|
@@ -157,6 +157,16 @@ class Orchestrator {
|
|
|
157
157
|
* Route 1 (Push Chain) dispatches to extracted sub-flow modules.
|
|
158
158
|
*/
|
|
159
159
|
async execute(params, options) {
|
|
160
|
+
return this.executeWithPolicy(params, options, false);
|
|
161
|
+
}
|
|
162
|
+
/** @internal Sender-preserving batch. Never uses the native sequential fallback. */
|
|
163
|
+
async executeAtomicBatch(params, options) {
|
|
164
|
+
if (typeof params.to !== 'string' || !Array.isArray(params.data) || params.data.length < 2 || params.funds) {
|
|
165
|
+
throw new Error('executeAtomicBatch requires multiple Push calls and no signer funds');
|
|
166
|
+
}
|
|
167
|
+
return this.executeWithPolicy(params, options, true);
|
|
168
|
+
}
|
|
169
|
+
async executeWithPolicy(params, options, requireAtomicBatch) {
|
|
160
170
|
const inlineProgressHook = params.progressHook;
|
|
161
171
|
if (options || inlineProgressHook) {
|
|
162
172
|
params = {
|
|
@@ -312,7 +322,9 @@ class Orchestrator {
|
|
|
312
322
|
? await (0, internals_1.executeFundsOnly)(this.ctx, legacy, eventBuffer, rcb)
|
|
313
323
|
: await (0, internals_1.executeFundsWithPayload)(this.ctx, legacy, eventBuffer, rcb));
|
|
314
324
|
}
|
|
315
|
-
return attachPerCallHookForWait(await (
|
|
325
|
+
return attachPerCallHookForWait(await (requireAtomicBatch
|
|
326
|
+
? (0, internals_1.executeStandardPayload)(this.ctx, execute, eventBuffer, rcb, { requireAtomicBatch: true })
|
|
327
|
+
: (0, internals_1.executeStandardPayload)(this.ctx, execute, eventBuffer, rcb)));
|
|
316
328
|
}
|
|
317
329
|
catch (err) {
|
|
318
330
|
const errMessage = (0, formatters_1.normalizePublicErrorMessage)(err);
|
|
@@ -374,6 +374,14 @@ export interface UniversalTxResponse {
|
|
|
374
374
|
childTxHash?: string;
|
|
375
375
|
/** Transaction route (UOA_TO_PUSH, UOA_TO_CEA, CEA_TO_PUSH, CEA_TO_CEA) */
|
|
376
376
|
route?: TransactionRouteType;
|
|
377
|
+
/**
|
|
378
|
+
* Agentic wallet (AGW) context, present when the transaction executed
|
|
379
|
+
* through an AGW. `from` is then the wallet and `origin` stays the signer;
|
|
380
|
+
* `agentic.rawTo` / `rawData` hold the wrapped call the signer sent.
|
|
381
|
+
* Outbound to/data/value summarize the first encoded destination call;
|
|
382
|
+
* `agentic.destinationCalls` retains the complete ordered call list.
|
|
383
|
+
*/
|
|
384
|
+
agentic?: import('../agentic/agentic.types').AgenticTxMetadata;
|
|
377
385
|
/**
|
|
378
386
|
* @internal True when this response was produced by `trackTransaction` and
|
|
379
387
|
* its progress events have already been replayed via the registered hook.
|
|
@@ -19,6 +19,7 @@ exports.detectRoute = detectRoute;
|
|
|
19
19
|
exports.validateRouteParams = validateRouteParams;
|
|
20
20
|
exports.getRouteInfo = getRouteInfo;
|
|
21
21
|
const enums_1 = require("../constants/enums");
|
|
22
|
+
const read_state_1 = require("../constants/read-state");
|
|
22
23
|
const tokens_1 = require("../constants/tokens");
|
|
23
24
|
const orchestrator_types_1 = require("./orchestrator.types");
|
|
24
25
|
const payload_builders_1 = require("./payload-builders");
|
|
@@ -215,8 +216,8 @@ function detectRoute(params) {
|
|
|
215
216
|
*/
|
|
216
217
|
function validateRouteParams(params, context) {
|
|
217
218
|
const toChain = isChainTarget(params.to) ? String(params.to.chain) : undefined;
|
|
218
|
-
if (String(params.from?.chain ?? '')
|
|
219
|
-
throw new RouteValidationError('CHAIN.WEB2 is a read-only destination and cannot be used with transaction APIs');
|
|
219
|
+
if ((0, read_state_1.isWeb2ReadChain)(String(params.from?.chain ?? '')) || (0, read_state_1.isWeb2ReadChain)(toChain)) {
|
|
220
|
+
throw new RouteValidationError('READ.CHAIN.WEB2 is a read-only destination and cannot be used with transaction APIs');
|
|
220
221
|
}
|
|
221
222
|
const route = detectRoute(params);
|
|
222
223
|
// Validate from.chain is supported external chain (Routes 3, 4)
|
|
@@ -12,3 +12,5 @@ export interface ResolvedSvmCall {
|
|
|
12
12
|
ixData: Uint8Array;
|
|
13
13
|
}
|
|
14
14
|
export declare function resolveSvmCall(input: ResolveInput): ResolvedSvmCall;
|
|
15
|
+
/** Internal AGW seam: use its registry-derived authority, not the signer's CEA. */
|
|
16
|
+
export declare function resolveSvmCallForCea(input: ResolveInput, ceaAuthority: `0x${string}`): ResolvedSvmCall;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveSvmCall = resolveSvmCall;
|
|
4
|
+
exports.resolveSvmCallForCea = resolveSvmCallForCea;
|
|
4
5
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
6
|
const buffer_1 = require("buffer");
|
|
6
7
|
const account_1 = require("../../universal/account/account");
|
|
@@ -13,6 +14,15 @@ const CEA_AUTHORITY_NAMES = new Set([
|
|
|
13
14
|
'ceaSigner',
|
|
14
15
|
]);
|
|
15
16
|
function resolveSvmCall(input) {
|
|
17
|
+
return resolveCall(input);
|
|
18
|
+
}
|
|
19
|
+
/** Internal AGW seam: use its registry-derived authority, not the signer's CEA. */
|
|
20
|
+
function resolveSvmCallForCea(input, ceaAuthority) {
|
|
21
|
+
if (!/^0x[0-9a-fA-F]{64}$/.test(ceaAuthority))
|
|
22
|
+
throw new Error('SVM CEA authority must be 32 bytes');
|
|
23
|
+
return resolveCall(input, ceaAuthority);
|
|
24
|
+
}
|
|
25
|
+
function resolveCall(input, authority) {
|
|
16
26
|
const idl = (0, registry_1.getIdl)(input.programAddress);
|
|
17
27
|
if (!idl) {
|
|
18
28
|
throw new Error(`resolveSvmCall: no IDL found for ${input.programAddress}. ` +
|
|
@@ -30,7 +40,7 @@ function resolveSvmCall(input) {
|
|
|
30
40
|
throw new Error(`resolveSvmCall: no instruction in IDL '${idl.metadata?.name ?? idl.address}' matches discriminator [${Array.from(disc).join(',')}]`);
|
|
31
41
|
}
|
|
32
42
|
const programPk = new web3_js_1.PublicKey(buffer_1.Buffer.from(input.programAddress.slice(2), 'hex'));
|
|
33
|
-
const
|
|
43
|
+
const ceaPdaHex = authority ?? (0, account_1.deriveSvmCeaPda)(input.senderUea, input.targetChain, true).address;
|
|
34
44
|
const accounts = [];
|
|
35
45
|
for (const item of ix.accounts) {
|
|
36
46
|
if ('accounts' in item) {
|
|
@@ -1233,6 +1233,68 @@ const RAW_HOOKS_READ = {
|
|
|
1233
1233
|
level: 'ERROR',
|
|
1234
1234
|
}),
|
|
1235
1235
|
};
|
|
1236
|
+
const RAW_HOOKS_AGENTIC = {
|
|
1237
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_101]: (address, index, deployed) => ({
|
|
1238
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_101,
|
|
1239
|
+
title: 'Agentic Wallet Derived',
|
|
1240
|
+
message: `Wallet ${address} at index ${index} (${deployed ? 'deployed' : 'not deployed'}).`,
|
|
1241
|
+
response: { address, index, deployed },
|
|
1242
|
+
level: 'INFO',
|
|
1243
|
+
}),
|
|
1244
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_102]: (address, strategy) => ({
|
|
1245
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_102,
|
|
1246
|
+
title: 'Deploy Step Added',
|
|
1247
|
+
message: `Deploying agentic wallet ${address} (${strategy}).`,
|
|
1248
|
+
response: { address, strategy },
|
|
1249
|
+
level: 'INFO',
|
|
1250
|
+
}),
|
|
1251
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_104]: (rulesIds) => ({
|
|
1252
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_104,
|
|
1253
|
+
title: 'Rules Granted',
|
|
1254
|
+
message: `Granted ${rulesIds.length} rule${rulesIds.length === 1 ? '' : 's'}.`,
|
|
1255
|
+
response: { rulesIds },
|
|
1256
|
+
level: 'INFO',
|
|
1257
|
+
}),
|
|
1258
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_105]: (target) => ({
|
|
1259
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_105,
|
|
1260
|
+
title: 'Rules Revoked',
|
|
1261
|
+
message: 'all' in target
|
|
1262
|
+
? 'Revoked every rule on the wallet.'
|
|
1263
|
+
: `Revoked ${target.rulesIds.length} rule${target.rulesIds.length === 1 ? '' : 's'}.`,
|
|
1264
|
+
response: target,
|
|
1265
|
+
level: 'INFO',
|
|
1266
|
+
}),
|
|
1267
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_106]: (label) => ({
|
|
1268
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_106,
|
|
1269
|
+
title: 'Label Set',
|
|
1270
|
+
message: `Wallet label set to "${label}".`,
|
|
1271
|
+
response: { label },
|
|
1272
|
+
level: 'INFO',
|
|
1273
|
+
}),
|
|
1274
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_107]: (rulesId, chainNamespace, door) => ({
|
|
1275
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_107,
|
|
1276
|
+
title: 'Rule Resolved',
|
|
1277
|
+
message: door === 'owner'
|
|
1278
|
+
? `Owner door on ${chainNamespace}; no rule applies.`
|
|
1279
|
+
: `Agent door on ${chainNamespace} under rule ${rulesId}.`,
|
|
1280
|
+
response: { rulesId: rulesId ?? null, chainNamespace, door },
|
|
1281
|
+
level: 'INFO',
|
|
1282
|
+
}),
|
|
1283
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_199_01]: (operation, txHash) => ({
|
|
1284
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_199_01,
|
|
1285
|
+
title: 'Agentic Operation Done',
|
|
1286
|
+
message: `${operation} completed.`,
|
|
1287
|
+
response: { operation, txHash: txHash ?? null },
|
|
1288
|
+
level: 'SUCCESS',
|
|
1289
|
+
}),
|
|
1290
|
+
[progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_199_02]: (operation, code, message, decodedError) => ({
|
|
1291
|
+
id: progress_hook_types_1.PROGRESS_HOOK.AGENTIC_TX_199_02,
|
|
1292
|
+
title: 'Agentic Operation Failed',
|
|
1293
|
+
message: `${operation} failed: ${message}`,
|
|
1294
|
+
response: { operation, code, decodedError: decodedError ?? null },
|
|
1295
|
+
level: 'ERROR',
|
|
1296
|
+
}),
|
|
1297
|
+
};
|
|
1236
1298
|
// Combine all routes into the master record
|
|
1237
1299
|
const RAW_HOOKS = {
|
|
1238
1300
|
...RAW_HOOKS_R1,
|
|
@@ -1241,6 +1303,7 @@ const RAW_HOOKS = {
|
|
|
1241
1303
|
...RAW_HOOKS_MULTICHAIN,
|
|
1242
1304
|
...RAW_HOOKS_MIG,
|
|
1243
1305
|
...RAW_HOOKS_READ,
|
|
1306
|
+
...RAW_HOOKS_AGENTIC,
|
|
1244
1307
|
};
|
|
1245
1308
|
// Build final hooks with timestamp injection
|
|
1246
1309
|
const PROGRESS_HOOKS = Object.fromEntries(Object.entries(RAW_HOOKS).map(([key, value]) => [key, withTimestamp(value)]));
|
|
@@ -134,7 +134,15 @@ export declare enum PROGRESS_HOOK {
|
|
|
134
134
|
UEA_MIG_03 = "UEA-MIG-03",
|
|
135
135
|
UEA_MIG_9901 = "UEA-MIG-9901",
|
|
136
136
|
UEA_MIG_9902 = "UEA-MIG-9902",
|
|
137
|
-
UEA_MIG_9903 = "UEA-MIG-9903"
|
|
137
|
+
UEA_MIG_9903 = "UEA-MIG-9903",
|
|
138
|
+
AGENTIC_TX_101 = "AGENTIC-TX-101",
|
|
139
|
+
AGENTIC_TX_102 = "AGENTIC-TX-102",
|
|
140
|
+
AGENTIC_TX_104 = "AGENTIC-TX-104",
|
|
141
|
+
AGENTIC_TX_105 = "AGENTIC-TX-105",
|
|
142
|
+
AGENTIC_TX_106 = "AGENTIC-TX-106",
|
|
143
|
+
AGENTIC_TX_107 = "AGENTIC-TX-107",
|
|
144
|
+
AGENTIC_TX_199_01 = "AGENTIC-TX-199-01",
|
|
145
|
+
AGENTIC_TX_199_02 = "AGENTIC-TX-199-02"
|
|
138
146
|
}
|
|
139
147
|
export type PROGRESS_HOOK_R1 = PROGRESS_HOOK.SEND_TX_101 | PROGRESS_HOOK.SEND_TX_102_01 | PROGRESS_HOOK.SEND_TX_103_01 | PROGRESS_HOOK.SEND_TX_103_02 | PROGRESS_HOOK.SEND_TX_103_03 | PROGRESS_HOOK.SEND_TX_103_03_01 | PROGRESS_HOOK.SEND_TX_103_03_02 | PROGRESS_HOOK.SEND_TX_103_03_03 | PROGRESS_HOOK.SEND_TX_103_03_04 | PROGRESS_HOOK.SEND_TX_104_01 | PROGRESS_HOOK.SEND_TX_104_02 | PROGRESS_HOOK.SEND_TX_104_03 | PROGRESS_HOOK.SEND_TX_104_04 | PROGRESS_HOOK.SEND_TX_105_01 | PROGRESS_HOOK.SEND_TX_105_02 | PROGRESS_HOOK.SEND_TX_106_01 | PROGRESS_HOOK.SEND_TX_106_02 | PROGRESS_HOOK.SEND_TX_106_03 | PROGRESS_HOOK.SEND_TX_106_03_01 | PROGRESS_HOOK.SEND_TX_106_03_02 | PROGRESS_HOOK.SEND_TX_106_04 | PROGRESS_HOOK.SEND_TX_106_05 | PROGRESS_HOOK.SEND_TX_106_06 | PROGRESS_HOOK.SEND_TX_107 | PROGRESS_HOOK.SEND_TX_199_01 | PROGRESS_HOOK.SEND_TX_199_02 | PROGRESS_HOOK.SEND_TX_199_03 | PROGRESS_HOOK.SEND_TX_199_99;
|
|
140
148
|
export type PROGRESS_HOOK_R2 = PROGRESS_HOOK.SEND_TX_201 | PROGRESS_HOOK.SEND_TX_202_01 | PROGRESS_HOOK.SEND_TX_202_02 | PROGRESS_HOOK.SEND_TX_203_01 | PROGRESS_HOOK.SEND_TX_203_02 | PROGRESS_HOOK.SEND_TX_203_03 | PROGRESS_HOOK.SEND_TX_203_04 | PROGRESS_HOOK.SEND_TX_203_05 | PROGRESS_HOOK.SEND_TX_204_01 | PROGRESS_HOOK.SEND_TX_204_02 | PROGRESS_HOOK.SEND_TX_204_03 | PROGRESS_HOOK.SEND_TX_204_04 | PROGRESS_HOOK.SEND_TX_207 | PROGRESS_HOOK.SEND_TX_209_01 | PROGRESS_HOOK.SEND_TX_209_02 | PROGRESS_HOOK.SEND_TX_299_01 | PROGRESS_HOOK.SEND_TX_299_02 | PROGRESS_HOOK.SEND_TX_299_03 | PROGRESS_HOOK.SEND_TX_299_99;
|
|
@@ -142,4 +150,5 @@ export type PROGRESS_HOOK_R3 = PROGRESS_HOOK.SEND_TX_301 | PROGRESS_HOOK.SEND_TX
|
|
|
142
150
|
export type PROGRESS_HOOK_MULTICHAIN = PROGRESS_HOOK.SEND_TX_001 | PROGRESS_HOOK.SEND_TX_002_01 | PROGRESS_HOOK.SEND_TX_002_99_99 | PROGRESS_HOOK.SEND_TX_003_03 | PROGRESS_HOOK.SEND_TX_003_04 | PROGRESS_HOOK.SEND_TX_003_05 | PROGRESS_HOOK.SEND_TX_999_01 | PROGRESS_HOOK.SEND_TX_999_02 | PROGRESS_HOOK.SEND_TX_999_03;
|
|
143
151
|
export type PROGRESS_HOOK_MIG = PROGRESS_HOOK.UEA_MIG_01 | PROGRESS_HOOK.UEA_MIG_02 | PROGRESS_HOOK.UEA_MIG_03 | PROGRESS_HOOK.UEA_MIG_9901 | PROGRESS_HOOK.UEA_MIG_9902 | PROGRESS_HOOK.UEA_MIG_9903;
|
|
144
152
|
export type PROGRESS_HOOK_READ = PROGRESS_HOOK.READ_TX_101 | PROGRESS_HOOK.READ_TX_102_01 | PROGRESS_HOOK.READ_TX_102_02 | PROGRESS_HOOK.READ_TX_102_03 | PROGRESS_HOOK.READ_TX_102_04 | PROGRESS_HOOK.READ_TX_102_05 | PROGRESS_HOOK.READ_TX_103_01 | PROGRESS_HOOK.READ_TX_103_02 | PROGRESS_HOOK.READ_TX_103_03 | PROGRESS_HOOK.READ_TX_104_01 | PROGRESS_HOOK.READ_TX_104_02 | PROGRESS_HOOK.READ_TX_104_03 | PROGRESS_HOOK.READ_TX_104_04 | PROGRESS_HOOK.READ_TX_104_05 | PROGRESS_HOOK.READ_TX_105_01 | PROGRESS_HOOK.READ_TX_105_02 | PROGRESS_HOOK.READ_TX_105_03 | PROGRESS_HOOK.READ_TX_105_04 | PROGRESS_HOOK.READ_TX_106_01 | PROGRESS_HOOK.READ_TX_106_02 | PROGRESS_HOOK.READ_TX_106_03 | PROGRESS_HOOK.READ_TX_106_04 | PROGRESS_HOOK.READ_TX_106_05 | PROGRESS_HOOK.READ_TX_106_06 | PROGRESS_HOOK.READ_TX_199_01 | PROGRESS_HOOK.READ_TX_199_02 | PROGRESS_HOOK.READ_TX_199_03 | PROGRESS_HOOK.READ_TX_199_99 | PROGRESS_HOOK.READ_TX_001 | PROGRESS_HOOK.READ_TX_002_01 | PROGRESS_HOOK.READ_TX_002_99_99 | PROGRESS_HOOK.READ_TX_999_01 | PROGRESS_HOOK.READ_TX_999_02 | PROGRESS_HOOK.READ_TX_999_03;
|
|
153
|
+
export type PROGRESS_HOOK_AGENTIC = PROGRESS_HOOK.AGENTIC_TX_101 | PROGRESS_HOOK.AGENTIC_TX_102 | PROGRESS_HOOK.AGENTIC_TX_104 | PROGRESS_HOOK.AGENTIC_TX_105 | PROGRESS_HOOK.AGENTIC_TX_106 | PROGRESS_HOOK.AGENTIC_TX_107 | PROGRESS_HOOK.AGENTIC_TX_199_01 | PROGRESS_HOOK.AGENTIC_TX_199_02;
|
|
145
154
|
export {};
|
|
@@ -147,5 +147,15 @@ var PROGRESS_HOOK;
|
|
|
147
147
|
PROGRESS_HOOK["UEA_MIG_9901"] = "UEA-MIG-9901";
|
|
148
148
|
PROGRESS_HOOK["UEA_MIG_9902"] = "UEA-MIG-9902";
|
|
149
149
|
PROGRESS_HOOK["UEA_MIG_9903"] = "UEA-MIG-9903";
|
|
150
|
+
// Agentic wallet (AGW) — AGENTIC-TX (PROPOSED in the AGW SDK spec 3.f).
|
|
151
|
+
// AGENTIC-TX-103 was removed by the spec (create no longer funds).
|
|
152
|
+
PROGRESS_HOOK["AGENTIC_TX_101"] = "AGENTIC-TX-101";
|
|
153
|
+
PROGRESS_HOOK["AGENTIC_TX_102"] = "AGENTIC-TX-102";
|
|
154
|
+
PROGRESS_HOOK["AGENTIC_TX_104"] = "AGENTIC-TX-104";
|
|
155
|
+
PROGRESS_HOOK["AGENTIC_TX_105"] = "AGENTIC-TX-105";
|
|
156
|
+
PROGRESS_HOOK["AGENTIC_TX_106"] = "AGENTIC-TX-106";
|
|
157
|
+
PROGRESS_HOOK["AGENTIC_TX_107"] = "AGENTIC-TX-107";
|
|
158
|
+
PROGRESS_HOOK["AGENTIC_TX_199_01"] = "AGENTIC-TX-199-01";
|
|
159
|
+
PROGRESS_HOOK["AGENTIC_TX_199_02"] = "AGENTIC-TX-199-02";
|
|
150
160
|
})(PROGRESS_HOOK || (exports.PROGRESS_HOOK = PROGRESS_HOOK = {}));
|
|
151
161
|
//# sourceMappingURL=progress-hook.types.js.map
|
|
@@ -10,6 +10,24 @@ import type { PreparedUniversalTx, CascadedTxResponse, CascadeExecutionOptions }
|
|
|
10
10
|
import type { Hex } from 'viem';
|
|
11
11
|
import type { BatchReadResponse, PreparedRead, UniversalReadResponse } from '../read-state/read-state.types';
|
|
12
12
|
import { type ReadOptions, type ReadPrepareOptions, type ReadValue, type ValidateReadCall, type ReadTrackOptions, type ReadExecuteOptions } from '../read-state/read-params';
|
|
13
|
+
import type { AgenticNamespace } from '../agentic/agentic.types';
|
|
14
|
+
/** Options accepted by `PushChain.initialize` / `reinitialize`. */
|
|
15
|
+
export interface PushChainInitializeOptions {
|
|
16
|
+
network: PUSH_NETWORK;
|
|
17
|
+
rpcUrls?: Partial<Record<CHAIN, string[]>>;
|
|
18
|
+
blockExplorers?: Partial<Record<CHAIN, string[]>>;
|
|
19
|
+
printTraces?: boolean;
|
|
20
|
+
progressHook?: (progress: ProgressEvent) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Act as this agentic wallet (AGW). The signer decides the door: the owner
|
|
23
|
+
* sends through `execute`, an agent named in an enabled rule through
|
|
24
|
+
* `executeAsAgent`; anyone else fails with NOT_OWNER_OR_AGENT.
|
|
25
|
+
* `universal.account` becomes the wallet; `universal.origin`,
|
|
26
|
+
* `getAccountStatus()` and gas stay the signer's. Not inherited by
|
|
27
|
+
* `reinitialize` — pass it again to keep acting as the wallet.
|
|
28
|
+
*/
|
|
29
|
+
agenticWallet?: `0x${string}`;
|
|
30
|
+
}
|
|
13
31
|
/**
|
|
14
32
|
* @class PushChain
|
|
15
33
|
*
|
|
@@ -36,7 +54,24 @@ export declare class PushChain {
|
|
|
36
54
|
TOKEN: import("../constants").PayableTokenConstantsMap;
|
|
37
55
|
};
|
|
38
56
|
READ: {
|
|
39
|
-
readonly
|
|
57
|
+
readonly CHAIN: Readonly<{
|
|
58
|
+
readonly PUSH_MAINNET: CHAIN.PUSH_MAINNET;
|
|
59
|
+
readonly PUSH_TESTNET: CHAIN.PUSH_TESTNET;
|
|
60
|
+
readonly PUSH_TESTNET_DONUT: CHAIN.PUSH_TESTNET;
|
|
61
|
+
readonly PUSH_LOCALNET: CHAIN.PUSH_LOCALNET;
|
|
62
|
+
readonly ETHEREUM_MAINNET: CHAIN.ETHEREUM_MAINNET;
|
|
63
|
+
readonly ETHEREUM_SEPOLIA: CHAIN.ETHEREUM_SEPOLIA;
|
|
64
|
+
readonly ARBITRUM_SEPOLIA: CHAIN.ARBITRUM_SEPOLIA;
|
|
65
|
+
readonly BASE_SEPOLIA: CHAIN.BASE_SEPOLIA;
|
|
66
|
+
readonly BNB_TESTNET: CHAIN.BNB_TESTNET;
|
|
67
|
+
readonly SOLANA_MAINNET: CHAIN.SOLANA_MAINNET;
|
|
68
|
+
readonly SOLANA_TESTNET: CHAIN.SOLANA_TESTNET;
|
|
69
|
+
readonly SOLANA_DEVNET: CHAIN.SOLANA_DEVNET;
|
|
70
|
+
readonly WEB2: "web2";
|
|
71
|
+
}> & {
|
|
72
|
+
readonly WEB2: typeof import("../constants").WEB2_READ_CHAIN;
|
|
73
|
+
};
|
|
74
|
+
readonly WEB2: "web2";
|
|
40
75
|
readonly NAMESPACE: {
|
|
41
76
|
readonly EVM: "eip155";
|
|
42
77
|
readonly SVM: "solana";
|
|
@@ -59,6 +94,16 @@ export declare class PushChain {
|
|
|
59
94
|
readonly ERROR_CODE: typeof import("../read-state/read-state.types").READ_ERROR_CODE;
|
|
60
95
|
readonly OUTCOME: typeof import("../read-state/read-state.types").READ_OUTCOME;
|
|
61
96
|
};
|
|
97
|
+
AGENTIC: Readonly<{
|
|
98
|
+
WALLET: "agentic:wallet";
|
|
99
|
+
PRESETS: Readonly<{
|
|
100
|
+
CATEGORY: Readonly<{
|
|
101
|
+
DEXES: "DEXES";
|
|
102
|
+
LENDING: "LENDING";
|
|
103
|
+
PREDICTION: "PREDICTION";
|
|
104
|
+
}>;
|
|
105
|
+
}>;
|
|
106
|
+
}>;
|
|
62
107
|
};
|
|
63
108
|
/**
|
|
64
109
|
* @static
|
|
@@ -246,6 +291,14 @@ export declare class PushChain {
|
|
|
246
291
|
to: MoveableToken | undefined;
|
|
247
292
|
}) => Promise<ConversionQuote>;
|
|
248
293
|
};
|
|
294
|
+
/**
|
|
295
|
+
* Agentic wallet management (AGW): derive, create, list and per-wallet
|
|
296
|
+
* handles. Ownership is the connected signer's Push identity.
|
|
297
|
+
*/
|
|
298
|
+
agentic: AgenticNamespace;
|
|
299
|
+
/** @internal AGW execution context when initialized with `agenticWallet`. */
|
|
300
|
+
private agenticContext?;
|
|
301
|
+
private readonly agenticRuntime;
|
|
249
302
|
/**
|
|
250
303
|
* Account status including UEA deployment state and version info.
|
|
251
304
|
* Initially unloaded — call getAccountStatus() to populate.
|
|
@@ -292,13 +345,7 @@ export declare class PushChain {
|
|
|
292
345
|
*
|
|
293
346
|
* @returns An initialized instance of PushChain.
|
|
294
347
|
*/
|
|
295
|
-
static initialize: (universalSigner: UniversalSigner | UniversalAccount, options?:
|
|
296
|
-
network: PUSH_NETWORK;
|
|
297
|
-
rpcUrls?: Partial<Record<CHAIN, string[]>>;
|
|
298
|
-
blockExplorers?: Partial<Record<CHAIN, string[]>>;
|
|
299
|
-
printTraces?: boolean;
|
|
300
|
-
progressHook?: (progress: ProgressEvent) => void;
|
|
301
|
-
}) => Promise<PushChain>;
|
|
348
|
+
static initialize: (universalSigner: UniversalSigner | UniversalAccount, options?: PushChainInitializeOptions) => Promise<PushChain>;
|
|
302
349
|
/**
|
|
303
350
|
* @method reinitialize
|
|
304
351
|
* Reinitializes the PushChain SDK with a new universal signer and optional config.
|
|
@@ -311,11 +358,5 @@ export declare class PushChain {
|
|
|
311
358
|
*
|
|
312
359
|
* @returns A new initialized instance of PushChain.
|
|
313
360
|
*/
|
|
314
|
-
reinitialize: (universalSigner: UniversalSigner | UniversalAccount, options?:
|
|
315
|
-
network: PUSH_NETWORK;
|
|
316
|
-
rpcUrls?: Partial<Record<CHAIN, string[]>>;
|
|
317
|
-
blockExplorers?: Partial<Record<CHAIN, string[]>>;
|
|
318
|
-
printTraces?: boolean;
|
|
319
|
-
progressHook?: (progress: ProgressEvent) => void;
|
|
320
|
-
}) => Promise<PushChain>;
|
|
361
|
+
reinitialize: (universalSigner: UniversalSigner | UniversalAccount, options?: PushChainInitializeOptions) => Promise<PushChain>;
|
|
321
362
|
}
|