@funkit/fun-relay 2.2.0-next.3 → 2.2.0-next.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @funkit/fun-relay
2
2
 
3
+ ## 2.2.0-next.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 7312429: adopt checkedIndexedAccess for safety
8
+
3
9
  ## 2.2.0-next.3
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -244,7 +244,7 @@ function getTxHash({
244
244
  };
245
245
  logger.info(`${logPrefix}:started`, logProps);
246
246
  const getTxHashFromTxHashes = () => {
247
- const rawTxHashWithUnreliableTyping = txHashes[0].txHash;
247
+ const rawTxHashWithUnreliableTyping = txHashes[0]?.txHash;
248
248
  const txHash = typeof rawTxHashWithUnreliableTyping === "object" ? rawTxHashWithUnreliableTyping.id : rawTxHashWithUnreliableTyping;
249
249
  logger.info(`${logPrefix}:txHashesMode`, {
250
250
  ...logProps,
@@ -379,12 +379,14 @@ async function executeRelayQuote({
379
379
  ) {
380
380
  logger.info(`${logPrefix}:onTransactionConfirmed`, txHashes);
381
381
  isTransactionConfirmed = true;
382
- if (relayQuote.steps[0].requestId) {
382
+ const firstStep = relayQuote.steps[0];
383
+ const firstItem = firstStep?.items[0];
384
+ if (firstStep?.requestId && firstItem) {
383
385
  manuallyRegisterIndex(logger, {
384
- requestId: relayQuote.steps[0].requestId,
385
- chainId: relayQuote.steps[0].items[0].data.chainId,
386
+ requestId: firstStep.requestId,
387
+ chainId: firstItem.data.chainId,
386
388
  tx: jsonStringifyWithBigIntSanitization({
387
- ...relayQuote.steps[0].items[0].data,
389
+ ...firstItem.data,
388
390
  txHash
389
391
  })
390
392
  });