@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/main.js CHANGED
@@ -1154,6 +1154,8 @@ const $f9ab50a3e879ac1c$export$b5fd4920e8b7d913 = {
1154
1154
 
1155
1155
 
1156
1156
  const $8deaea1ef39b6485$var$NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
1157
+ // zkSync Era wraps native ETH as an ERC-20 at this address; Transfer logs from it represent native ETH movements
1158
+ const $8deaea1ef39b6485$var$ZKSYNC_NATIVE_ETH = "0x000000000000000000000000000000000000800a";
1157
1159
  const $8deaea1ef39b6485$export$5beebc5708fabf3c = {
1158
1160
  match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "EVM",
1159
1161
  transform (block, _ctx) {
@@ -1164,10 +1166,39 @@ const $8deaea1ef39b6485$export$5beebc5708fabf3c = {
1164
1166
  if (!tx.receipt) continue;
1165
1167
  const timestamp = new Date(typedBlock.timestamp * 1000).toISOString();
1166
1168
  const transactionGasFee = BigInt(tx.receipt.gasUsed) * BigInt(tx.receipt.effectiveGasPrice);
1169
+ // check if this tx has zkSync native ETH Transfer logs (used to skip unreliable traces)
1170
+ const hasZkSyncEthLogs = tx.receipt.logs.some((log)=>log.address.toLowerCase() === $8deaea1ef39b6485$var$ZKSYNC_NATIVE_ETH);
1167
1171
  // track direct ETH transfers
1168
1172
  if (!TOKEN_TYPES.length || TOKEN_TYPES.includes("NATIVE")) {
1169
- // pull from traces, if available
1170
- if (Array.isArray(tx.traces)) for (const trace of tx.traces.filter((t)=>t.action)){
1173
+ // handle L1→L2 deposit transactions (OP Stack type 0x7e) as native mints
1174
+ if (tx.mint && BigInt(tx.mint) > 0n) transfers.push({
1175
+ amount: BigInt(tx.mint),
1176
+ blockNumber: tx.blockNumber,
1177
+ from: $8deaea1ef39b6485$var$NULL_ADDRESS,
1178
+ timestamp: timestamp,
1179
+ to: tx.to?.toLowerCase() || tx.from?.toLowerCase() || $8deaea1ef39b6485$var$NULL_ADDRESS,
1180
+ tokenType: "NATIVE",
1181
+ transactionGasFee: transactionGasFee,
1182
+ transactionHash: tx.hash
1183
+ });
1184
+ else if (hasZkSyncEthLogs) for (const log of tx.receipt.logs){
1185
+ if (log.address.toLowerCase() !== $8deaea1ef39b6485$var$ZKSYNC_NATIVE_ETH) continue;
1186
+ const txfer = (0, $da55be3e40667945$export$cf548b70626e2eb9)(log, [
1187
+ "Transfer(address indexed from, address indexed to, uint256 value)"
1188
+ ]);
1189
+ if (txfer) transfers.push({
1190
+ amount: txfer.decoded.value,
1191
+ blockNumber: tx.blockNumber,
1192
+ from: txfer.decoded.from?.toLowerCase() || $8deaea1ef39b6485$var$NULL_ADDRESS,
1193
+ index: log.logIndex,
1194
+ timestamp: timestamp,
1195
+ to: txfer.decoded.to?.toLowerCase() || $8deaea1ef39b6485$var$NULL_ADDRESS,
1196
+ tokenType: "NATIVE",
1197
+ transactionGasFee: transactionGasFee,
1198
+ transactionHash: tx.hash
1199
+ });
1200
+ }
1201
+ else if (Array.isArray(tx.traces)) for (const trace of tx.traces.filter((t)=>t.action)){
1171
1202
  const action = trace.action;
1172
1203
  if (!action?.value) continue;
1173
1204
  transfers.push({
@@ -1195,6 +1226,8 @@ const $8deaea1ef39b6485$export$5beebc5708fabf3c = {
1195
1226
  }
1196
1227
  // track ERC20 transfers
1197
1228
  if (!TOKEN_TYPES.length || TOKEN_TYPES.includes("TOKEN")) for (const log of tx.receipt.logs){
1229
+ // skip zkSync native ETH logs (already handled as NATIVE above)
1230
+ if (log.address.toLowerCase() === $8deaea1ef39b6485$var$ZKSYNC_NATIVE_ETH) continue;
1198
1231
  const txfer = (0, $da55be3e40667945$export$cf548b70626e2eb9)(log, [
1199
1232
  "Transfer(address indexed from, address indexed to, uint256 value)"
1200
1233
  ]);
@@ -1294,6 +1327,51 @@ const $8deaea1ef39b6485$export$5beebc5708fabf3c = {
1294
1327
  }
1295
1328
  ]
1296
1329
  },
1330
+ {
1331
+ params: {
1332
+ network: "BASE",
1333
+ walletAddress: "0xDa863f802Cc8CBA3C436bF801BD7785d9E7d4F36",
1334
+ tokenTypes: [
1335
+ "NATIVE"
1336
+ ]
1337
+ },
1338
+ payload: "https://jiti.indexing.co/networks/base/13170774",
1339
+ output: [
1340
+ {
1341
+ amount: 80000000000000000n,
1342
+ blockNumber: 13170774,
1343
+ from: "0x0000000000000000000000000000000000000000",
1344
+ timestamp: "2024-04-14T21:41:35.000Z",
1345
+ to: "0xda863f802cc8cba3c436bf801bd7785d9e7d4f36",
1346
+ tokenType: "NATIVE",
1347
+ transactionGasFee: 0n,
1348
+ transactionHash: "0xa3c7cbece45ff18b18e001c4bc096567c85526dad3453dba88791054a61fc444"
1349
+ }
1350
+ ]
1351
+ },
1352
+ {
1353
+ params: {
1354
+ network: "ZKSYNC",
1355
+ walletAddress: "0xf70da97812CB96aCDF810712Aa562db8dfA3dBEf",
1356
+ tokenTypes: [
1357
+ "NATIVE"
1358
+ ]
1359
+ },
1360
+ payload: "https://jiti.indexing.co/networks/zksync/55005000",
1361
+ output: [
1362
+ {
1363
+ amount: 1615028132795916n,
1364
+ blockNumber: 55005000,
1365
+ from: "0xebd1e414ebb98522cfd932104ba41fac10a4ef35",
1366
+ index: 4,
1367
+ timestamp: "2025-02-01T06:14:12.000Z",
1368
+ to: "0xf70da97812cb96acdf810712aa562db8dfa3dbef",
1369
+ tokenType: "NATIVE",
1370
+ transactionGasFee: 6389164250000n,
1371
+ transactionHash: "0xc0e1850d24af965e6a02836301a696e9f021b07fed765d8affe3bda1846d5700"
1372
+ }
1373
+ ]
1374
+ },
1297
1375
  {
1298
1376
  params: {
1299
1377
  network: "POLYGON",