@indexing/jiti 0.0.34 → 0.0.36

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
@@ -68,7 +68,32 @@ const $bea1ed486f96b980$export$ace043a4f2efe476 = {
68
68
  for (const tx of block.transactions){
69
69
  if (!tx?.events || !Array.isArray(tx.events)) continue;
70
70
  const timestamp = tx.timestamp ? new Date(parseInt(tx.timestamp, 10) / 1000).toISOString() : null;
71
+ const gasUsed = BigInt(tx.gas_used || "0");
71
72
  const transfersByKey = {};
73
+ const sender = tx.sender;
74
+ const accountAddressMap = {};
75
+ const changes = tx.changes;
76
+ for(let ci = 0; ci < changes.length; ci += 1){
77
+ if (!changes[ci]?.data) continue;
78
+ const { address: accountAddress, data: { data: { balance: balance, metadata: metadata }, type: changeType } } = changes[ci];
79
+ if (changeType === "0x1::fungible_asset::FungibleStore") {
80
+ if (!accountAddressMap[accountAddress]) accountAddressMap[accountAddress] = changes[ci + 1]?.data.data.owner;
81
+ const to = accountAddressMap[accountAddress];
82
+ const tokenAddress = metadata?.inner;
83
+ if (!to || !tokenAddress || to === sender) continue;
84
+ transfers.push({
85
+ amount: BigInt(balance),
86
+ blockNumber: parseInt(block.block_height, 10),
87
+ from: sender,
88
+ to: to,
89
+ timestamp: timestamp,
90
+ token: tokenAddress,
91
+ tokenType: "TOKEN",
92
+ transactionGasFee: gasUsed,
93
+ transactionHash: tx.hash
94
+ });
95
+ }
96
+ }
72
97
  for (const evt of tx.events){
73
98
  const evtType = evt.type;
74
99
  if (/::(Withdraw|Deposit)[^:]*/.test(evtType)) {
@@ -90,11 +115,11 @@ const $bea1ed486f96b980$export$ace043a4f2efe476 = {
90
115
  if (!partial.from || !partial.to) continue;
91
116
  const fromAddr = partial.from.length < 66 ? `0x0${partial.from.slice(2)}` : partial.from;
92
117
  const toAddr = partial.to.length < 66 ? `0x0${partial.to.slice(2)}` : partial.to;
118
+ if (toAddr === "0x00") continue;
93
119
  let finalToken = null;
94
120
  let finalTokenType = "TOKEN";
95
121
  if (partial.tokenAddress?.toLowerCase().includes("aptos_coin")) finalToken = null;
96
122
  else finalToken = partial.tokenAddress?.toLowerCase();
97
- const gasUsed = BigInt(tx.gas_used || "0");
98
123
  transfers.push({
99
124
  amount: BigInt(partial.amount),
100
125
  blockNumber: parseInt(block.block_height, 10),
@@ -149,6 +174,17 @@ const $bea1ed486f96b980$export$ace043a4f2efe476 = {
149
174
  },
150
175
  payload: "https://jiti.indexing.co/networks/aptos/303623631",
151
176
  output: [
177
+ {
178
+ amount: 3000160n,
179
+ blockNumber: 303623631,
180
+ from: "0xa4e7455d27731ab857e9701b1e6ed72591132b909fe6e4fd99b66c1d6318d9e8",
181
+ timestamp: "2025-03-14T15:39:49.845Z",
182
+ to: "0x9317336bfc9ba6987d40492ddea8d41e11b7c2e473f3556a9c82309d326e79ce",
183
+ token: "0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b",
184
+ tokenType: "TOKEN",
185
+ transactionGasFee: 16n,
186
+ transactionHash: "0x24b8854bad1f6543b35069eacd6ec40a583ca7fa452b422b04d747d24b65279c"
187
+ },
152
188
  {
153
189
  amount: 1000060n,
154
190
  blockNumber: 303623631,
@@ -161,6 +197,27 @@ const $bea1ed486f96b980$export$ace043a4f2efe476 = {
161
197
  transactionHash: "0x24b8854bad1f6543b35069eacd6ec40a583ca7fa452b422b04d747d24b65279c"
162
198
  }
163
199
  ]
200
+ },
201
+ {
202
+ params: {
203
+ network: "APTOS",
204
+ contractAddress: "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b",
205
+ walletAddress: "0x1a07942979574456e8197ac0ba8e3bfcf93d7922493cc3ca0c6b46b580b0a47e"
206
+ },
207
+ payload: "https://jiti.indexing.co/networks/aptos/326121833",
208
+ output: [
209
+ {
210
+ amount: 10000000n,
211
+ blockNumber: 326121833,
212
+ from: "0xd91c64b777e51395c6ea9dec562ed79a4afa0cd6dad5a87b187c37198a1f855a",
213
+ timestamp: "2025-04-19T08:57:28.135Z",
214
+ to: "0x1a07942979574456e8197ac0ba8e3bfcf93d7922493cc3ca0c6b46b580b0a47e",
215
+ token: "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b",
216
+ tokenType: "TOKEN",
217
+ transactionGasFee: 10877n,
218
+ transactionHash: "0xc5a21679a947f986908b09091516bc3896245d974686ca2bd5709b7dbc5118fb"
219
+ }
220
+ ]
164
221
  }
165
222
  ]
166
223
  };
@@ -1004,7 +1061,7 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
1004
1061
  }
1005
1062
  for(const token in unmatchedFrom)if (unmatchedTo[token]?.length && unmatchedFrom[token]?.length) {
1006
1063
  const unmatchedDiff = unmatchedTo[token].reduce((a, b)=>a + BigInt(b.amount), BigInt(0)) - unmatchedFrom[token].reduce((a, b)=>a + BigInt(b.amount), BigInt(0));
1007
- if (unmatchedDiff === BigInt(0) || token === "null" && unmatchedDiff === txFee) {
1064
+ if (unmatchedDiff === BigInt(0) || token === "null") {
1008
1065
  unmatchedTo[token].sort((a, b)=>a.amount > b.amount ? 1 : -1);
1009
1066
  unmatchedFrom[token].forEach((um)=>{
1010
1067
  um.from = unmatchedTo[token][0].from;
@@ -1206,8 +1263,28 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
1206
1263
  transactionHash: "2wQdUtEnCf77jiros6eCbQ1BrWrn1uw4nisy87kmgHhZMGX2CqBugaLdne6bvQR8mAdxinVLivcbVVfJAdTry2rw"
1207
1264
  }
1208
1265
  ]
1266
+ },
1267
+ {
1268
+ params: {
1269
+ network: "SOLANA",
1270
+ walletAddress: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i"
1271
+ },
1272
+ payload: "https://jiti.indexing.co/networks/solana/343762745",
1273
+ output: [
1274
+ {
1275
+ amount: 704724041n,
1276
+ blockNumber: 321976935,
1277
+ from: "AVAZvHLR2PcWpDf8BXY4rVxNHYRBytycHkcB5z5QNXYm",
1278
+ timestamp: "2025-05-31T21:20:52.000Z",
1279
+ to: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i",
1280
+ token: null,
1281
+ tokenType: "NATIVE",
1282
+ transactionGasFee: 191568n,
1283
+ transactionHash: "5usAzMSrENJQscoRdxi48n22aMcFmJ1U7f2yGmwUk8AHSFCzLfRtBP7gVnsZbe7Jy9SG2VoeVbVSoVvu43tsdvm1"
1284
+ }
1285
+ ]
1209
1286
  }
1210
- ]
1287
+ ].slice(0)
1211
1288
  };
1212
1289
 
1213
1290