@pushchain/core 6.0.13 → 6.0.14
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/package.json +1 -1
- package/src/lib/orchestrator/internals/response-builder.d.ts +19 -0
- package/src/lib/orchestrator/internals/response-builder.js +133 -19
- package/src/lib/orchestrator/internals/tx-transformer.js +3 -0
- package/src/lib/orchestrator/orchestrator.d.ts +6 -1
- package/src/lib/orchestrator/orchestrator.js +6 -1
- package/src/lib/orchestrator/orchestrator.types.d.ts +25 -1
- package/src/lib/progress-hook/progress-hook.js +1 -1
package/package.json
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Contains: queryUniversalTxStatusFromGatewayTx, trackTransaction,
|
|
5
5
|
* transformToUniversalTxResponse, and the ResponseBuilderCallbacks interface.
|
|
6
6
|
*/
|
|
7
|
+
import { CHAIN } from '../../constants/enums';
|
|
7
8
|
import { UniversalTx } from '../../generated/uexecutor/v1/types';
|
|
9
|
+
import type { UniversalTxV2 } from '../../generated/uexecutor/v2/types';
|
|
8
10
|
import { ProgressEvent } from '../../progress-hook/progress-hook.types';
|
|
9
11
|
import { EvmClient } from '../../vm-client/evm-client';
|
|
10
12
|
import type { TxResponse } from '../../vm-client/vm-client.types';
|
|
@@ -27,5 +29,22 @@ export interface ResponseBuilderCallbacks {
|
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
export declare function queryUniversalTxStatusFromGatewayTx(ctx: OrchestratorContext, evmClient: EvmClient | undefined, gatewayAddress: `0x${string}` | undefined, txHash: string, evmGatewayMethod: 'sendFunds' | 'sendTxWithFunds' | 'sendTxWithGas'): Promise<UniversalTx | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Source-hash resolution for trackTransaction.
|
|
34
|
+
*
|
|
35
|
+
* When the caller tracks by an ORIGIN/source-leg hash (a Sepolia tx hash, a
|
|
36
|
+
* Solana signature, …) instead of the Push Chain root hash, the universal
|
|
37
|
+
* record can't be fetched by that hash: `PushClient` is EVM-only (so it can't
|
|
38
|
+
* even read a Solana tx), and external-inbound records are keyed by a derived
|
|
39
|
+
* `universalTxId`, not by the source hash. Delegate to the universal-tx
|
|
40
|
+
* detector (which dispatches EVM/SVM) to derive the `universalTxId`, then load
|
|
41
|
+
* the universal record and its first Push pcTx so the caller can reconstruct
|
|
42
|
+
* from the Push side.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveUniversalTxFromSourceHash(ctx: OrchestratorContext, sourceHash: string, sourceChain: CHAIN, rpcUrls: Partial<Record<CHAIN, string[]>>): Promise<{
|
|
45
|
+
universalTxData: UniversalTxV2;
|
|
46
|
+
pushTxHash: string;
|
|
47
|
+
sourceSender?: string;
|
|
48
|
+
}>;
|
|
30
49
|
export declare function trackTransaction(ctx: OrchestratorContext, txHash: string, options?: TrackTransactionOptions, callbacks?: ResponseBuilderCallbacks): Promise<UniversalTxResponse>;
|
|
31
50
|
export declare function transformToUniversalTxResponse(ctx: OrchestratorContext, tx: TxResponse, eventBuffer: ProgressEvent[] | undefined, callbacks: ResponseBuilderCallbacks): Promise<UniversalTxResponse>;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.queryUniversalTxStatusFromGatewayTx = queryUniversalTxStatusFromGatewayTx;
|
|
10
|
+
exports.resolveUniversalTxFromSourceHash = resolveUniversalTxFromSourceHash;
|
|
10
11
|
exports.trackTransaction = trackTransaction;
|
|
11
12
|
exports.transformToUniversalTxResponse = transformToUniversalTxResponse;
|
|
12
13
|
const tslib_1 = require("tslib");
|
|
@@ -27,6 +28,7 @@ const svm_helpers_1 = require("./svm-helpers");
|
|
|
27
28
|
const outbound_tracker_1 = require("./outbound-tracker");
|
|
28
29
|
const inbound_tracker_1 = require("./inbound-tracker");
|
|
29
30
|
const tx_transformer_1 = require("./tx-transformer");
|
|
31
|
+
const detector_1 = require("../../universal-tx-detector/detector");
|
|
30
32
|
const progress_route_hooks_1 = require("./progress-route-hooks");
|
|
31
33
|
const outbound_sync_1 = require("./outbound-sync");
|
|
32
34
|
/**
|
|
@@ -162,6 +164,56 @@ txHash, evmGatewayMethod) {
|
|
|
162
164
|
// ============================================================================
|
|
163
165
|
// trackTransaction
|
|
164
166
|
// ============================================================================
|
|
167
|
+
/** Push Chain CHAIN ids — tracking these uses the Push-native path. */
|
|
168
|
+
const PUSH_CHAINS = new Set([
|
|
169
|
+
enums_1.CHAIN.PUSH_MAINNET,
|
|
170
|
+
enums_1.CHAIN.PUSH_TESTNET_DONUT,
|
|
171
|
+
enums_1.CHAIN.PUSH_LOCALNET,
|
|
172
|
+
]);
|
|
173
|
+
/**
|
|
174
|
+
* Source-hash resolution for trackTransaction.
|
|
175
|
+
*
|
|
176
|
+
* When the caller tracks by an ORIGIN/source-leg hash (a Sepolia tx hash, a
|
|
177
|
+
* Solana signature, …) instead of the Push Chain root hash, the universal
|
|
178
|
+
* record can't be fetched by that hash: `PushClient` is EVM-only (so it can't
|
|
179
|
+
* even read a Solana tx), and external-inbound records are keyed by a derived
|
|
180
|
+
* `universalTxId`, not by the source hash. Delegate to the universal-tx
|
|
181
|
+
* detector (which dispatches EVM/SVM) to derive the `universalTxId`, then load
|
|
182
|
+
* the universal record and its first Push pcTx so the caller can reconstruct
|
|
183
|
+
* from the Push side.
|
|
184
|
+
*/
|
|
185
|
+
function resolveUniversalTxFromSourceHash(ctx, sourceHash, sourceChain, rpcUrls) {
|
|
186
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
var _a, _b;
|
|
188
|
+
const detection = yield (0, detector_1.detectUniversalTx)(sourceHash, sourceChain, {
|
|
189
|
+
pushClient: ctx.pushClient,
|
|
190
|
+
rpcUrls: Object.assign(Object.assign({}, ctx.rpcUrls), rpcUrls),
|
|
191
|
+
// We do our own getUniversalTxByIdV2 below; the detector's cosmos
|
|
192
|
+
// cross-ref can come back empty for SVM even when the record exists.
|
|
193
|
+
skipPushChainLookup: true,
|
|
194
|
+
});
|
|
195
|
+
const utxId = detection.decoded.universalTxId;
|
|
196
|
+
if (!utxId) {
|
|
197
|
+
throw new Error(`trackTransaction: could not resolve a universal transaction from hash ` +
|
|
198
|
+
`"${sourceHash}" on ${sourceChain} (detected kind: ${detection.kind}). ` +
|
|
199
|
+
`Pass the Push Chain root hash, or a source hash that emitted a ` +
|
|
200
|
+
`UniversalTx event.`);
|
|
201
|
+
}
|
|
202
|
+
const utxResponse = yield ctx.pushClient.getUniversalTxByIdV2(utxId);
|
|
203
|
+
const universalTxData = utxResponse === null || utxResponse === void 0 ? void 0 : utxResponse.universalTx;
|
|
204
|
+
if (!universalTxData) {
|
|
205
|
+
throw new Error(`trackTransaction: resolved universalTxId ${utxId} from ${sourceChain} ` +
|
|
206
|
+
`hash "${sourceHash}", but no universal transaction record exists on ` +
|
|
207
|
+
`Push Chain yet (it may still be relaying).`);
|
|
208
|
+
}
|
|
209
|
+
const pushTxHash = (_b = (_a = universalTxData.pcTx) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.txHash;
|
|
210
|
+
if (!pushTxHash) {
|
|
211
|
+
throw new Error(`trackTransaction: universal tx ${utxId} (from ${sourceChain} hash ` +
|
|
212
|
+
`"${sourceHash}") has no Push Chain tx recorded yet.`);
|
|
213
|
+
}
|
|
214
|
+
return { universalTxData, pushTxHash, sourceSender: detection.decoded.sender };
|
|
215
|
+
});
|
|
216
|
+
}
|
|
165
217
|
function trackTransaction(ctx, txHash, options, callbacks) {
|
|
166
218
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
167
219
|
var _a, _b;
|
|
@@ -169,7 +221,33 @@ function trackTransaction(ctx, txHash, options, callbacks) {
|
|
|
169
221
|
throw new Error('trackTransaction requires ResponseBuilderCallbacks');
|
|
170
222
|
}
|
|
171
223
|
const { chain = (0, helpers_1.getPushChainForNetwork)(ctx.pushNetwork), progressHook, waitForCompletion = true, advanced = {}, } = options !== null && options !== void 0 ? options : {};
|
|
224
|
+
// Fail fast on an unsupported `chain`. It defaults to Push Chain when the
|
|
225
|
+
// caller omits it; an explicitly-passed value that isn't a known CHAIN_INFO
|
|
226
|
+
// entry (a raw numeric chainId, a typo, or a chain from a plain-JS caller
|
|
227
|
+
// that skips the CHAIN type) would otherwise throw an opaque "Cannot read
|
|
228
|
+
// properties of undefined (reading 'defaultRPC')" at the RPC lookup below.
|
|
229
|
+
if (!chain_1.CHAIN_INFO[chain]) {
|
|
230
|
+
throw new Error(`trackTransaction: unsupported chain "${String(chain)}". Pass a ` +
|
|
231
|
+
`PushChain.CONSTANTS.CHAIN value. Supported: ${Object.keys(chain_1.CHAIN_INFO).join(', ')}`);
|
|
232
|
+
}
|
|
172
233
|
const { timeout = 300000, pollingIntervalMs = 1000, rpcUrls = {} } = advanced;
|
|
234
|
+
// Source-hash mode: a non-Push `chain` means `txHash` is an origin/source-leg
|
|
235
|
+
// hash (a Sepolia tx hash, a Solana signature, …), not a Push Chain hash.
|
|
236
|
+
// Resolve it to the universal record + its Push pcTx via the detector, then
|
|
237
|
+
// reconstruct from the Push side. Push-native tracking (below) is unchanged.
|
|
238
|
+
let preResolvedUtxData;
|
|
239
|
+
let sourceOriginChain;
|
|
240
|
+
let sourceSender;
|
|
241
|
+
let trackChain = chain;
|
|
242
|
+
let trackHash = txHash;
|
|
243
|
+
if (!PUSH_CHAINS.has(chain)) {
|
|
244
|
+
const resolved = yield resolveUniversalTxFromSourceHash(ctx, txHash, chain, rpcUrls);
|
|
245
|
+
preResolvedUtxData = resolved.universalTxData;
|
|
246
|
+
sourceOriginChain = chain;
|
|
247
|
+
sourceSender = resolved.sourceSender;
|
|
248
|
+
trackHash = resolved.pushTxHash;
|
|
249
|
+
trackChain = (0, helpers_1.getPushChainForNetwork)(ctx.pushNetwork);
|
|
250
|
+
}
|
|
173
251
|
// Event buffer for replay via response.progressHook()
|
|
174
252
|
const eventBuffer = [];
|
|
175
253
|
// Helper to emit progress events. Per-tx hook (passed to trackTransaction)
|
|
@@ -180,8 +258,11 @@ function trackTransaction(ctx, txHash, options, callbacks) {
|
|
|
180
258
|
(0, context_1.printLog)(ctx, event.message);
|
|
181
259
|
fanOut(event, progressHook, ctx.progressHook);
|
|
182
260
|
};
|
|
183
|
-
// Create client for target chain with optional RPC override
|
|
184
|
-
|
|
261
|
+
// Create client for target chain with optional RPC override. In source-hash
|
|
262
|
+
// mode `trackChain` is Push (the resolved pcTx lives on Push Chain).
|
|
263
|
+
const chainRPCs = rpcUrls[trackChain] ||
|
|
264
|
+
ctx.rpcUrls[trackChain] ||
|
|
265
|
+
chain_1.CHAIN_INFO[trackChain].defaultRPC;
|
|
185
266
|
const client = new push_client_1.PushClient({
|
|
186
267
|
rpcUrls: chainRPCs,
|
|
187
268
|
network: ctx.pushNetwork,
|
|
@@ -192,37 +273,39 @@ function trackTransaction(ctx, txHash, options, callbacks) {
|
|
|
192
273
|
// eslint-disable-next-line no-constant-condition
|
|
193
274
|
while (true) {
|
|
194
275
|
try {
|
|
195
|
-
tx = yield client.getTransaction(
|
|
276
|
+
tx = yield client.getTransaction(trackHash);
|
|
196
277
|
break; // Found transaction
|
|
197
278
|
}
|
|
198
279
|
catch (err) {
|
|
199
280
|
if (!waitForCompletion) {
|
|
200
|
-
throw new Error(`Transaction ${
|
|
281
|
+
throw new Error(`Transaction ${trackHash} not found`);
|
|
201
282
|
}
|
|
202
283
|
// Check timeout
|
|
203
284
|
if (Date.now() - start > timeout) {
|
|
204
|
-
throw new Error(`Timeout: transaction ${
|
|
285
|
+
throw new Error(`Timeout: transaction ${trackHash} not confirmed within ${timeout}ms`);
|
|
205
286
|
}
|
|
206
287
|
// Brief delay before retry
|
|
207
288
|
yield new Promise((r) => setTimeout(r, pollingIntervalMs));
|
|
208
289
|
}
|
|
209
290
|
}
|
|
210
|
-
// Try to get UniversalTx data for richer progress reconstruction
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
let universalTxData;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
291
|
+
// Try to get UniversalTx data for richer progress reconstruction.
|
|
292
|
+
// In source-hash mode we already resolved the record above; otherwise run the
|
|
293
|
+
// three-tier lookup: direct hash → computed keccak ID → Cosmos extraction.
|
|
294
|
+
let universalTxData = preResolvedUtxData;
|
|
295
|
+
if (!universalTxData) {
|
|
296
|
+
try {
|
|
297
|
+
const utxResponse = yield ctx.pushClient.getUniversalTxByIdV2(trackHash);
|
|
298
|
+
if (utxResponse === null || utxResponse === void 0 ? void 0 : utxResponse.universalTx) {
|
|
299
|
+
universalTxData = utxResponse.universalTx;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
catch (_c) {
|
|
303
|
+
// Ignore - try computed ID next
|
|
218
304
|
}
|
|
219
|
-
}
|
|
220
|
-
catch (_c) {
|
|
221
|
-
// Ignore - try computed ID next
|
|
222
305
|
}
|
|
223
306
|
if (!universalTxData) {
|
|
224
307
|
try {
|
|
225
|
-
const computedId = (0, outbound_tracker_1.computeUniversalTxId)(ctx.pushNetwork,
|
|
308
|
+
const computedId = (0, outbound_tracker_1.computeUniversalTxId)(ctx.pushNetwork, trackHash);
|
|
226
309
|
const queryId = computedId.startsWith('0x') ? computedId.slice(2) : computedId;
|
|
227
310
|
const utxResponse = yield ctx.pushClient.getUniversalTxByIdV2(queryId);
|
|
228
311
|
if (utxResponse === null || utxResponse === void 0 ? void 0 : utxResponse.universalTx) {
|
|
@@ -235,7 +318,7 @@ function trackTransaction(ctx, txHash, options, callbacks) {
|
|
|
235
318
|
}
|
|
236
319
|
if (!universalTxData) {
|
|
237
320
|
try {
|
|
238
|
-
const extractedId = yield (0, outbound_tracker_1.extractUniversalSubTxIdFromTx)(ctx,
|
|
321
|
+
const extractedId = yield (0, outbound_tracker_1.extractUniversalSubTxIdFromTx)(ctx, trackHash);
|
|
239
322
|
if (extractedId) {
|
|
240
323
|
const queryId = extractedId.startsWith('0x') ? extractedId.slice(2) : extractedId;
|
|
241
324
|
const utxResponse = yield ctx.pushClient.getUniversalTxByIdV2(queryId);
|
|
@@ -279,6 +362,33 @@ function trackTransaction(ctx, txHash, options, callbacks) {
|
|
|
279
362
|
universalTxResponse._expectsInboundRoundTrip = true;
|
|
280
363
|
}
|
|
281
364
|
}
|
|
365
|
+
// Source-hash mode: the pcTx we fetched lives on Push Chain, so the
|
|
366
|
+
// transform resolves chain to the Push side. Surface the true source chain
|
|
367
|
+
// the caller tracked so `chain`/`chainNamespace` reflect where the universal
|
|
368
|
+
// tx actually originated. (An outbound-derived chain above, if any, wins.)
|
|
369
|
+
if (sourceOriginChain && !universalTxResponse.chain) {
|
|
370
|
+
universalTxResponse.chain = sourceOriginChain;
|
|
371
|
+
universalTxResponse.chainNamespace = sourceOriginChain;
|
|
372
|
+
}
|
|
373
|
+
// Override `origin` with the true source account. The transform derives
|
|
374
|
+
// origin from the Push pcTx (whose `from` is the keeper that submitted the
|
|
375
|
+
// inbound), so in source-hash mode it would otherwise read as a Push
|
|
376
|
+
// address. Rebuild it as `<sourceChainCaip>:<sourceSender>` using the
|
|
377
|
+
// chain's native address encoding (0x for EVM, base58 for SVM).
|
|
378
|
+
if (sourceOriginChain && sourceSender) {
|
|
379
|
+
let originAddr = sourceSender;
|
|
380
|
+
try {
|
|
381
|
+
originAddr =
|
|
382
|
+
chain_1.CHAIN_INFO[sourceOriginChain].vm === enums_1.VM.SVM
|
|
383
|
+
? bs58_1.bs58.encode((0, viem_1.toBytes)(sourceSender))
|
|
384
|
+
: (0, viem_1.getAddress)(sourceSender);
|
|
385
|
+
}
|
|
386
|
+
catch (_f) {
|
|
387
|
+
// Keep the raw sender if re-encoding fails.
|
|
388
|
+
}
|
|
389
|
+
universalTxResponse.origin = `${sourceOriginChain}:${originAddr}`;
|
|
390
|
+
universalTxResponse.chainId = chain_1.CHAIN_INFO[sourceOriginChain].chainId;
|
|
391
|
+
}
|
|
282
392
|
// Reconstruct and emit SEND-TX-* progress events
|
|
283
393
|
const reconstructedEvents = (0, tx_transformer_1.reconstructProgressEvents)(universalTxResponse, universalTxData);
|
|
284
394
|
for (const event of reconstructedEvents) {
|
|
@@ -520,7 +630,7 @@ function transformToUniversalTxResponse(ctx_1, tx_1) {
|
|
|
520
630
|
accessList: Array.isArray(tx.accessList) ? [...tx.accessList] : [],
|
|
521
631
|
// 6. Utilities
|
|
522
632
|
wait: (waitOptions) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
523
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
633
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
524
634
|
// For trackTransaction replays the tx is historical — cosmos already
|
|
525
635
|
// has the full graph indexed, so the 20s/30s initial-wait buffers
|
|
526
636
|
// designed for live sends are pure deadweight. Default them to 0 when
|
|
@@ -662,6 +772,10 @@ function transformToUniversalTxResponse(ctx_1, tx_1) {
|
|
|
662
772
|
callbacks.printLog(`[wait] External chain tracking ${isTimeout ? 'timed out' : 'failed'}: ${errMsg}`);
|
|
663
773
|
}
|
|
664
774
|
}
|
|
775
|
+
// Resolve the terminal hash for the whole journey: inbound (R3) >
|
|
776
|
+
// external outbound (R2) > the Push tx itself (R1). Single-tx analogue
|
|
777
|
+
// of CascadeCompletionResult.finalTxHash.
|
|
778
|
+
baseReceipt = Object.assign(Object.assign({}, baseReceipt), { finalTxHash: (_l = (_k = baseReceipt.pushInboundTxHash) !== null && _k !== void 0 ? _k : baseReceipt.externalTxHash) !== null && _l !== void 0 ? _l : baseReceipt.hash });
|
|
665
779
|
return baseReceipt;
|
|
666
780
|
}),
|
|
667
781
|
// Internal: register a wait-phase progressHook without replaying
|
|
@@ -41,6 +41,9 @@ function transformToUniversalTxReceipt(receipt, originalTxResponse) {
|
|
|
41
41
|
from: originalTxResponse.from,
|
|
42
42
|
to: originalTxResponse.to,
|
|
43
43
|
},
|
|
44
|
+
// Terminal-hash baseline = this Push tx. `wait()` upgrades it to the
|
|
45
|
+
// external/inbound leg for R2/R3 (see UniversalTxReceipt.finalTxHash).
|
|
46
|
+
finalTxHash: receipt.transactionHash,
|
|
44
47
|
};
|
|
45
48
|
}
|
|
46
49
|
// ============================================================================
|
|
@@ -118,9 +118,14 @@ export declare class Orchestrator {
|
|
|
118
118
|
* Tracks a transaction by hash on Push Chain and returns UniversalTxResponse.
|
|
119
119
|
* Reconstructs and replays SEND-TX-* progress events for completed transactions.
|
|
120
120
|
*
|
|
121
|
-
* @param txHash - Transaction hash to track
|
|
121
|
+
* @param txHash - Transaction hash to track. A Push Chain root hash by
|
|
122
|
+
* default; when `options.chain` is a non-Push chain, an origin/source-leg
|
|
123
|
+
* hash (a source EVM tx hash or a Solana signature) that is resolved to the
|
|
124
|
+
* universal transaction via the universal-tx detector.
|
|
122
125
|
* @param options - Tracking options (chain, progressHook, waitForCompletion, advanced config)
|
|
123
126
|
* @returns Promise resolving to UniversalTxResponse with wait() and progressHook() methods
|
|
127
|
+
* @throws If `options.chain` is provided but is not a supported chain (not present in CHAIN_INFO)
|
|
128
|
+
* @throws If a source-leg hash cannot be resolved to a universal transaction on Push Chain
|
|
124
129
|
*/
|
|
125
130
|
trackTransaction(txHash: string, options?: import('./orchestrator.types').TrackTransactionOptions): Promise<UniversalTxResponse>;
|
|
126
131
|
/**
|
|
@@ -401,9 +401,14 @@ class Orchestrator {
|
|
|
401
401
|
* Tracks a transaction by hash on Push Chain and returns UniversalTxResponse.
|
|
402
402
|
* Reconstructs and replays SEND-TX-* progress events for completed transactions.
|
|
403
403
|
*
|
|
404
|
-
* @param txHash - Transaction hash to track
|
|
404
|
+
* @param txHash - Transaction hash to track. A Push Chain root hash by
|
|
405
|
+
* default; when `options.chain` is a non-Push chain, an origin/source-leg
|
|
406
|
+
* hash (a source EVM tx hash or a Solana signature) that is resolved to the
|
|
407
|
+
* universal transaction via the universal-tx detector.
|
|
405
408
|
* @param options - Tracking options (chain, progressHook, waitForCompletion, advanced config)
|
|
406
409
|
* @returns Promise resolving to UniversalTxResponse with wait() and progressHook() methods
|
|
410
|
+
* @throws If `options.chain` is provided but is not a supported chain (not present in CHAIN_INFO)
|
|
411
|
+
* @throws If a source-leg hash cannot be resolved to a universal transaction on Push Chain
|
|
407
412
|
*/
|
|
408
413
|
trackTransaction(txHash, options) {
|
|
409
414
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -336,6 +336,21 @@ export interface UniversalTxReceipt {
|
|
|
336
336
|
pushInboundTxHash?: string;
|
|
337
337
|
/** Child UTX id that owns the inbound execution. */
|
|
338
338
|
pushInboundUtxId?: string;
|
|
339
|
+
/**
|
|
340
|
+
* The terminal on-chain tx hash for this transaction's journey — one "where
|
|
341
|
+
* did it ultimately land" hash, so callers don't have to branch on route:
|
|
342
|
+
* - R1 (UOA_TO_PUSH): the Push Chain tx → `hash`
|
|
343
|
+
* - R2 (UOA_TO_CEA): the external outbound tx → `externalTxHash`
|
|
344
|
+
* - R3 (CEA_TO_PUSH): the inbound Push tx that closed the round-trip
|
|
345
|
+
* → `pushInboundTxHash` (falls back to `externalTxHash`)
|
|
346
|
+
*
|
|
347
|
+
* Resolved as `pushInboundTxHash ?? externalTxHash ?? hash`. This is the
|
|
348
|
+
* single-transaction analogue of `CascadeCompletionResult.finalTxHash`,
|
|
349
|
+
* which points at the last confirmed hop of an `executeTransactions`
|
|
350
|
+
* cascade. The leg-specific fields above stay available when you need to
|
|
351
|
+
* distinguish the outbound vs inbound leg explicitly.
|
|
352
|
+
*/
|
|
353
|
+
finalTxHash?: string;
|
|
339
354
|
}
|
|
340
355
|
/**
|
|
341
356
|
* Signature interface modeled after ethers.js v6 Signature interface
|
|
@@ -724,7 +739,16 @@ export interface CascadeCompletionResult {
|
|
|
724
739
|
}
|
|
725
740
|
export interface TrackTransactionOptions {
|
|
726
741
|
/**
|
|
727
|
-
*
|
|
742
|
+
* Chain the `txHash` belongs to. Defaults to Push Chain based on the client
|
|
743
|
+
* network — pass the Push Chain root hash in that case.
|
|
744
|
+
*
|
|
745
|
+
* Pass a NON-Push chain (e.g. `CHAIN.ETHEREUM_SEPOLIA`, `CHAIN.SOLANA_DEVNET`)
|
|
746
|
+
* to track by an ORIGIN/source-leg hash — a source EVM tx hash or a Solana
|
|
747
|
+
* signature. The universal transaction is resolved from the source hash via
|
|
748
|
+
* the universal-tx detector and reconstructed from the Push side.
|
|
749
|
+
*
|
|
750
|
+
* Must be a supported chain (present in CHAIN_INFO); `trackTransaction`
|
|
751
|
+
* throws on an unsupported value.
|
|
728
752
|
*/
|
|
729
753
|
chain?: import('../constants/enums').CHAIN;
|
|
730
754
|
/**
|
|
@@ -328,7 +328,7 @@ const RAW_HOOKS_R2 = {
|
|
|
328
328
|
}),
|
|
329
329
|
[progress_hook_types_1.PROGRESS_HOOK.SEND_TX_203_02]: (ueaAddr, ceaAddr, targetChain, deployed) => ({
|
|
330
330
|
id: progress_hook_types_1.PROGRESS_HOOK.SEND_TX_203_02,
|
|
331
|
-
title: `${friendlyChain(targetChain)} Execution Account
|
|
331
|
+
title: `${friendlyChain(targetChain)} Execution Account Resolved`,
|
|
332
332
|
message: `UEA: ${ueaAddr}. CEA: ${ceaAddr} on ${targetChain}. Deployed: ${deployed}`,
|
|
333
333
|
response: { uea: ueaAddr, cea: ceaAddr, chain: targetChain, deployed },
|
|
334
334
|
level: 'SUCCESS',
|