@atomiqlabs/chain-starknet 5.1.3 → 5.1.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.
@@ -56,9 +56,10 @@ class StarknetChainEventsBrowser {
56
56
  catch (e) {
57
57
  this.logger.warn("getSwapDataGetter(): getter: starknet_traceTransaction not supported by the RPC: ", e);
58
58
  const blockTraces = await this.provider.getBlockTransactionsTraces(event.blockHash);
59
- trace = blockTraces.find(val => (0, Utils_1.toHex)(val.transaction_hash) === (0, Utils_1.toHex)(event.txHash));
60
- if (trace == null)
59
+ const foundTrace = blockTraces.find(val => (0, Utils_1.toHex)(val.transaction_hash) === (0, Utils_1.toHex)(event.txHash));
60
+ if (foundTrace == null)
61
61
  throw new Error(`Cannot find ${event.txHash} in the block traces, block: ${event.blockHash}`);
62
+ trace = foundTrace.trace_root;
62
63
  }
63
64
  if (trace == null)
64
65
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/chain-starknet",
3
- "version": "5.1.3",
3
+ "version": "5.1.4",
4
4
  "description": "Starknet specific base implementation",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -106,8 +106,9 @@ export class StarknetChainEventsBrowser implements ChainEvents<StarknetSwapData>
106
106
  } catch (e) {
107
107
  this.logger.warn("getSwapDataGetter(): getter: starknet_traceTransaction not supported by the RPC: ", e);
108
108
  const blockTraces: any[] = await this.provider.getBlockTransactionsTraces(event.blockHash);
109
- trace = blockTraces.find(val => toHex(val.transaction_hash)===toHex(event.txHash));
110
- if(trace==null) throw new Error(`Cannot find ${event.txHash} in the block traces, block: ${event.blockHash}`);
109
+ const foundTrace = blockTraces.find(val => toHex(val.transaction_hash)===toHex(event.txHash));
110
+ if(foundTrace==null) throw new Error(`Cannot find ${event.txHash} in the block traces, block: ${event.blockHash}`);
111
+ trace = foundTrace.trace_root;
111
112
  }
112
113
  if(trace==null) return null;
113
114
  if(trace.execute_invocation.revert_reason!=null) return null;