@indexing/jiti 0.1.4 → 0.1.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/dist/module.js CHANGED
@@ -1145,6 +1145,8 @@ const $8d6646508fb2fa58$export$b5fd4920e8b7d913 = {
1145
1145
 
1146
1146
 
1147
1147
  const $5ec62a2088d070a8$var$NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
1148
+ // zkSync Era wraps native ETH as an ERC-20 at this address; Transfer logs from it represent native ETH movements
1149
+ const $5ec62a2088d070a8$var$ZKSYNC_NATIVE_ETH = "0x000000000000000000000000000000000000800a";
1148
1150
  const $5ec62a2088d070a8$export$5beebc5708fabf3c = {
1149
1151
  match: (block)=>(0, $09654dffcb68affa$export$ae001c77434c5340)(block) === "EVM",
1150
1152
  transform (block, _ctx) {
@@ -1155,10 +1157,39 @@ const $5ec62a2088d070a8$export$5beebc5708fabf3c = {
1155
1157
  if (!tx.receipt) continue;
1156
1158
  const timestamp = new Date(typedBlock.timestamp * 1000).toISOString();
1157
1159
  const transactionGasFee = BigInt(tx.receipt.gasUsed) * BigInt(tx.receipt.effectiveGasPrice);
1160
+ // check if this tx has zkSync native ETH Transfer logs (used to skip unreliable traces)
1161
+ const hasZkSyncEthLogs = tx.receipt.logs.some((log)=>log.address.toLowerCase() === $5ec62a2088d070a8$var$ZKSYNC_NATIVE_ETH);
1158
1162
  // track direct ETH transfers
1159
1163
  if (!TOKEN_TYPES.length || TOKEN_TYPES.includes("NATIVE")) {
1160
- // pull from traces, if available
1161
- if (Array.isArray(tx.traces)) for (const trace of tx.traces.filter((t)=>t.action)){
1164
+ // handle L1→L2 deposit transactions (OP Stack type 0x7e) as native mints
1165
+ if (tx.mint && BigInt(tx.mint) > 0n) transfers.push({
1166
+ amount: BigInt(tx.mint),
1167
+ blockNumber: tx.blockNumber,
1168
+ from: $5ec62a2088d070a8$var$NULL_ADDRESS,
1169
+ timestamp: timestamp,
1170
+ to: tx.to?.toLowerCase() || tx.from?.toLowerCase() || $5ec62a2088d070a8$var$NULL_ADDRESS,
1171
+ tokenType: "NATIVE",
1172
+ transactionGasFee: transactionGasFee,
1173
+ transactionHash: tx.hash
1174
+ });
1175
+ else if (hasZkSyncEthLogs) for (const log of tx.receipt.logs){
1176
+ if (log.address.toLowerCase() !== $5ec62a2088d070a8$var$ZKSYNC_NATIVE_ETH) continue;
1177
+ const txfer = (0, $cfa23334cbdf9391$export$cf548b70626e2eb9)(log, [
1178
+ "Transfer(address indexed from, address indexed to, uint256 value)"
1179
+ ]);
1180
+ if (txfer) transfers.push({
1181
+ amount: txfer.decoded.value,
1182
+ blockNumber: tx.blockNumber,
1183
+ from: txfer.decoded.from?.toLowerCase() || $5ec62a2088d070a8$var$NULL_ADDRESS,
1184
+ index: log.logIndex,
1185
+ timestamp: timestamp,
1186
+ to: txfer.decoded.to?.toLowerCase() || $5ec62a2088d070a8$var$NULL_ADDRESS,
1187
+ tokenType: "NATIVE",
1188
+ transactionGasFee: transactionGasFee,
1189
+ transactionHash: tx.hash
1190
+ });
1191
+ }
1192
+ else if (Array.isArray(tx.traces)) for (const trace of tx.traces.filter((t)=>t.action)){
1162
1193
  const action = trace.action;
1163
1194
  if (!action?.value) continue;
1164
1195
  transfers.push({
@@ -1186,6 +1217,8 @@ const $5ec62a2088d070a8$export$5beebc5708fabf3c = {
1186
1217
  }
1187
1218
  // track ERC20 transfers
1188
1219
  if (!TOKEN_TYPES.length || TOKEN_TYPES.includes("TOKEN")) for (const log of tx.receipt.logs){
1220
+ // skip zkSync native ETH logs (already handled as NATIVE above)
1221
+ if (log.address.toLowerCase() === $5ec62a2088d070a8$var$ZKSYNC_NATIVE_ETH) continue;
1189
1222
  const txfer = (0, $cfa23334cbdf9391$export$cf548b70626e2eb9)(log, [
1190
1223
  "Transfer(address indexed from, address indexed to, uint256 value)"
1191
1224
  ]);
@@ -1285,6 +1318,51 @@ const $5ec62a2088d070a8$export$5beebc5708fabf3c = {
1285
1318
  }
1286
1319
  ]
1287
1320
  },
1321
+ {
1322
+ params: {
1323
+ network: "BASE",
1324
+ walletAddress: "0xDa863f802Cc8CBA3C436bF801BD7785d9E7d4F36",
1325
+ tokenTypes: [
1326
+ "NATIVE"
1327
+ ]
1328
+ },
1329
+ payload: "https://jiti.indexing.co/networks/base/13170774",
1330
+ output: [
1331
+ {
1332
+ amount: 80000000000000000n,
1333
+ blockNumber: 13170774,
1334
+ from: "0x0000000000000000000000000000000000000000",
1335
+ timestamp: "2024-04-14T21:41:35.000Z",
1336
+ to: "0xda863f802cc8cba3c436bf801bd7785d9e7d4f36",
1337
+ tokenType: "NATIVE",
1338
+ transactionGasFee: 0n,
1339
+ transactionHash: "0xa3c7cbece45ff18b18e001c4bc096567c85526dad3453dba88791054a61fc444"
1340
+ }
1341
+ ]
1342
+ },
1343
+ {
1344
+ params: {
1345
+ network: "ZKSYNC",
1346
+ walletAddress: "0xf70da97812CB96aCDF810712Aa562db8dfA3dBEf",
1347
+ tokenTypes: [
1348
+ "NATIVE"
1349
+ ]
1350
+ },
1351
+ payload: "https://jiti.indexing.co/networks/zksync/55005000",
1352
+ output: [
1353
+ {
1354
+ amount: 1615028132795916n,
1355
+ blockNumber: 55005000,
1356
+ from: "0xebd1e414ebb98522cfd932104ba41fac10a4ef35",
1357
+ index: 4,
1358
+ timestamp: "2025-02-01T06:14:12.000Z",
1359
+ to: "0xf70da97812cb96acdf810712aa562db8dfa3dbef",
1360
+ tokenType: "NATIVE",
1361
+ transactionGasFee: 6389164250000n,
1362
+ transactionHash: "0xc0e1850d24af965e6a02836301a696e9f021b07fed765d8affe3bda1846d5700"
1363
+ }
1364
+ ]
1365
+ },
1288
1366
  {
1289
1367
  params: {
1290
1368
  network: "POLYGON",