@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/main.js CHANGED
@@ -74,7 +74,32 @@ const $25d5bdd23cba31eb$export$ace043a4f2efe476 = {
74
74
  for (const tx of block.transactions){
75
75
  if (!tx?.events || !Array.isArray(tx.events)) continue;
76
76
  const timestamp = tx.timestamp ? new Date(parseInt(tx.timestamp, 10) / 1000).toISOString() : null;
77
+ const gasUsed = BigInt(tx.gas_used || "0");
77
78
  const transfersByKey = {};
79
+ const sender = tx.sender;
80
+ const accountAddressMap = {};
81
+ const changes = tx.changes;
82
+ for(let ci = 0; ci < changes.length; ci += 1){
83
+ if (!changes[ci]?.data) continue;
84
+ const { address: accountAddress, data: { data: { balance: balance, metadata: metadata }, type: changeType } } = changes[ci];
85
+ if (changeType === "0x1::fungible_asset::FungibleStore") {
86
+ if (!accountAddressMap[accountAddress]) accountAddressMap[accountAddress] = changes[ci + 1]?.data.data.owner;
87
+ const to = accountAddressMap[accountAddress];
88
+ const tokenAddress = metadata?.inner;
89
+ if (!to || !tokenAddress || to === sender) continue;
90
+ transfers.push({
91
+ amount: BigInt(balance),
92
+ blockNumber: parseInt(block.block_height, 10),
93
+ from: sender,
94
+ to: to,
95
+ timestamp: timestamp,
96
+ token: tokenAddress,
97
+ tokenType: "TOKEN",
98
+ transactionGasFee: gasUsed,
99
+ transactionHash: tx.hash
100
+ });
101
+ }
102
+ }
78
103
  for (const evt of tx.events){
79
104
  const evtType = evt.type;
80
105
  if (/::(Withdraw|Deposit)[^:]*/.test(evtType)) {
@@ -96,11 +121,11 @@ const $25d5bdd23cba31eb$export$ace043a4f2efe476 = {
96
121
  if (!partial.from || !partial.to) continue;
97
122
  const fromAddr = partial.from.length < 66 ? `0x0${partial.from.slice(2)}` : partial.from;
98
123
  const toAddr = partial.to.length < 66 ? `0x0${partial.to.slice(2)}` : partial.to;
124
+ if (toAddr === "0x00") continue;
99
125
  let finalToken = null;
100
126
  let finalTokenType = "TOKEN";
101
127
  if (partial.tokenAddress?.toLowerCase().includes("aptos_coin")) finalToken = null;
102
128
  else finalToken = partial.tokenAddress?.toLowerCase();
103
- const gasUsed = BigInt(tx.gas_used || "0");
104
129
  transfers.push({
105
130
  amount: BigInt(partial.amount),
106
131
  blockNumber: parseInt(block.block_height, 10),
@@ -155,6 +180,17 @@ const $25d5bdd23cba31eb$export$ace043a4f2efe476 = {
155
180
  },
156
181
  payload: "https://jiti.indexing.co/networks/aptos/303623631",
157
182
  output: [
183
+ {
184
+ amount: 3000160n,
185
+ blockNumber: 303623631,
186
+ from: "0xa4e7455d27731ab857e9701b1e6ed72591132b909fe6e4fd99b66c1d6318d9e8",
187
+ timestamp: "2025-03-14T15:39:49.845Z",
188
+ to: "0x9317336bfc9ba6987d40492ddea8d41e11b7c2e473f3556a9c82309d326e79ce",
189
+ token: "0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b",
190
+ tokenType: "TOKEN",
191
+ transactionGasFee: 16n,
192
+ transactionHash: "0x24b8854bad1f6543b35069eacd6ec40a583ca7fa452b422b04d747d24b65279c"
193
+ },
158
194
  {
159
195
  amount: 1000060n,
160
196
  blockNumber: 303623631,
@@ -167,6 +203,27 @@ const $25d5bdd23cba31eb$export$ace043a4f2efe476 = {
167
203
  transactionHash: "0x24b8854bad1f6543b35069eacd6ec40a583ca7fa452b422b04d747d24b65279c"
168
204
  }
169
205
  ]
206
+ },
207
+ {
208
+ params: {
209
+ network: "APTOS",
210
+ contractAddress: "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b",
211
+ walletAddress: "0x1a07942979574456e8197ac0ba8e3bfcf93d7922493cc3ca0c6b46b580b0a47e"
212
+ },
213
+ payload: "https://jiti.indexing.co/networks/aptos/326121833",
214
+ output: [
215
+ {
216
+ amount: 10000000n,
217
+ blockNumber: 326121833,
218
+ from: "0xd91c64b777e51395c6ea9dec562ed79a4afa0cd6dad5a87b187c37198a1f855a",
219
+ timestamp: "2025-04-19T08:57:28.135Z",
220
+ to: "0x1a07942979574456e8197ac0ba8e3bfcf93d7922493cc3ca0c6b46b580b0a47e",
221
+ token: "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b",
222
+ tokenType: "TOKEN",
223
+ transactionGasFee: 10877n,
224
+ transactionHash: "0xc5a21679a947f986908b09091516bc3896245d974686ca2bd5709b7dbc5118fb"
225
+ }
226
+ ]
170
227
  }
171
228
  ]
172
229
  };
@@ -1010,7 +1067,7 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
1010
1067
  }
1011
1068
  for(const token in unmatchedFrom)if (unmatchedTo[token]?.length && unmatchedFrom[token]?.length) {
1012
1069
  const unmatchedDiff = unmatchedTo[token].reduce((a, b)=>a + BigInt(b.amount), BigInt(0)) - unmatchedFrom[token].reduce((a, b)=>a + BigInt(b.amount), BigInt(0));
1013
- if (unmatchedDiff === BigInt(0) || token === "null" && unmatchedDiff === txFee) {
1070
+ if (unmatchedDiff === BigInt(0) || token === "null") {
1014
1071
  unmatchedTo[token].sort((a, b)=>a.amount > b.amount ? 1 : -1);
1015
1072
  unmatchedFrom[token].forEach((um)=>{
1016
1073
  um.from = unmatchedTo[token][0].from;
@@ -1212,8 +1269,28 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
1212
1269
  transactionHash: "2wQdUtEnCf77jiros6eCbQ1BrWrn1uw4nisy87kmgHhZMGX2CqBugaLdne6bvQR8mAdxinVLivcbVVfJAdTry2rw"
1213
1270
  }
1214
1271
  ]
1272
+ },
1273
+ {
1274
+ params: {
1275
+ network: "SOLANA",
1276
+ walletAddress: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i"
1277
+ },
1278
+ payload: "https://jiti.indexing.co/networks/solana/343762745",
1279
+ output: [
1280
+ {
1281
+ amount: 704724041n,
1282
+ blockNumber: 321976935,
1283
+ from: "AVAZvHLR2PcWpDf8BXY4rVxNHYRBytycHkcB5z5QNXYm",
1284
+ timestamp: "2025-05-31T21:20:52.000Z",
1285
+ to: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i",
1286
+ token: null,
1287
+ tokenType: "NATIVE",
1288
+ transactionGasFee: 191568n,
1289
+ transactionHash: "5usAzMSrENJQscoRdxi48n22aMcFmJ1U7f2yGmwUk8AHSFCzLfRtBP7gVnsZbe7Jy9SG2VoeVbVSoVvu43tsdvm1"
1290
+ }
1291
+ ]
1215
1292
  }
1216
- ]
1293
+ ].slice(0)
1217
1294
  };
1218
1295
 
1219
1296