@indexing/jiti 0.0.33 → 0.0.35

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
@@ -965,7 +965,7 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
965
965
  transfersByKey[key] = Object.assign(transfersByKey[key] || {}, txfer);
966
966
  }
967
967
  }
968
- for(let i = 1; i < solanaTx.meta.postBalances.length; i += 1){
968
+ for(let i = 0; i < solanaTx.meta.postBalances.length; i += 1){
969
969
  const post = solanaTx.meta.postBalances[i];
970
970
  const pre = solanaTx.meta.preBalances[i];
971
971
  if (post !== undefined && pre !== undefined && post !== pre) {
@@ -975,7 +975,7 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
975
975
  const txfer = {
976
976
  amount: diff,
977
977
  blockNumber: block.blockHeight,
978
- from: post > pre ? typeof allAccounts[0] === "string" ? allAccounts[0] : allAccounts[0]?.pubkey : typeof allAccounts[i] === "string" ? allAccounts[i] : allAccounts[i]?.pubkey,
978
+ from: typeof allAccounts[i] === "string" ? allAccounts[i] : allAccounts[i]?.pubkey,
979
979
  timestamp: timestamp,
980
980
  to: typeof allAccounts[i] === "string" ? allAccounts[i] : allAccounts[i]?.pubkey?.toString(),
981
981
  token: null,
@@ -983,9 +983,8 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
983
983
  transactionGasFee: txFee,
984
984
  transactionHash: txHash
985
985
  };
986
- if (post > pre) {
987
- if (transfersByKey[key]) delete txfer.from;
988
- } else delete txfer.to;
986
+ if (post > pre) delete txfer.from;
987
+ else delete txfer.to;
989
988
  transfersByKey[key] = Object.assign(transfersByKey[key] || {}, txfer);
990
989
  }
991
990
  }
@@ -1003,12 +1002,15 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
1003
1002
  delete transfersByKey[key];
1004
1003
  }
1005
1004
  }
1006
- for(const token in unmatchedFrom)if (unmatchedTo[token]?.length && unmatchedTo[token].reduce((a, b)=>a + BigInt(b.amount), BigInt(0)) - unmatchedFrom[token].reduce((a, b)=>a + BigInt(b.amount), BigInt(0)) === BigInt(0)) {
1007
- unmatchedTo[token].sort((a, b)=>a.amount > b.amount ? 1 : -1);
1008
- unmatchedFrom[token].forEach((um)=>{
1009
- um.from = unmatchedTo[token][0].from;
1010
- transfersByKey[`${token}-${um.amount.toString()}`] = um;
1011
- });
1005
+ for(const token in unmatchedFrom)if (unmatchedTo[token]?.length && unmatchedFrom[token]?.length) {
1006
+ 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") {
1008
+ unmatchedTo[token].sort((a, b)=>a.amount > b.amount ? 1 : -1);
1009
+ unmatchedFrom[token].forEach((um)=>{
1010
+ um.from = unmatchedTo[token][0].from;
1011
+ transfersByKey[`${token}-${um.amount.toString()}`] = um;
1012
+ });
1013
+ }
1012
1014
  }
1013
1015
  transfers.push(...Object.values(transfersByKey));
1014
1016
  }
@@ -1096,6 +1098,17 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
1096
1098
  },
1097
1099
  payload: "https://jiti.indexing.co/networks/solana/332450156",
1098
1100
  output: [
1101
+ {
1102
+ amount: 19796403663n,
1103
+ blockNumber: 310691098,
1104
+ timestamp: "2025-04-10T02:29:35.000Z",
1105
+ to: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1106
+ transactionGasFee: 80001n,
1107
+ transactionHash: "32T7ANVqz1sHBoKhfk3omrRqwDCJFYMi6TfuAwyqHPCZPCihdWTU9t9i5D6tGwuytWRwRqnEXksMPMWbFbfBzVUk",
1108
+ token: "CniPCE4b3s8gSUPhUiyMjXnytrEqUrMfSsnbBjLCpump",
1109
+ tokenType: "TOKEN",
1110
+ from: "4acL7mD2J6GYJy2g3iVTvfpmHCQSZ1rb8DBuupjcVzHJ"
1111
+ },
1099
1112
  {
1100
1113
  amount: 402062750n,
1101
1114
  blockNumber: 310691098,
@@ -1117,17 +1130,6 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
1117
1130
  tokenType: "NATIVE",
1118
1131
  transactionGasFee: 80001n,
1119
1132
  transactionHash: "32T7ANVqz1sHBoKhfk3omrRqwDCJFYMi6TfuAwyqHPCZPCihdWTU9t9i5D6tGwuytWRwRqnEXksMPMWbFbfBzVUk"
1120
- },
1121
- {
1122
- amount: 19796403663n,
1123
- blockNumber: 310691098,
1124
- timestamp: "2025-04-10T02:29:35.000Z",
1125
- to: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1126
- transactionGasFee: 80001n,
1127
- transactionHash: "32T7ANVqz1sHBoKhfk3omrRqwDCJFYMi6TfuAwyqHPCZPCihdWTU9t9i5D6tGwuytWRwRqnEXksMPMWbFbfBzVUk",
1128
- token: "CniPCE4b3s8gSUPhUiyMjXnytrEqUrMfSsnbBjLCpump",
1129
- tokenType: "TOKEN",
1130
- from: "4acL7mD2J6GYJy2g3iVTvfpmHCQSZ1rb8DBuupjcVzHJ"
1131
1133
  }
1132
1134
  ]
1133
1135
  },
@@ -1173,8 +1175,59 @@ const $f0bdc73ab4ea9846$export$1f0fe79deb1b813b = {
1173
1175
  transactionHash: "xKTWvnhSRErcHCMozRMEue4MriNr1Any6LiaQzXrR7imZ1MpZxRqbyv9LLg4JQoDq4oJZpDqPmzxLCtMCkgj2hn"
1174
1176
  }
1175
1177
  ]
1178
+ },
1179
+ {
1180
+ params: {
1181
+ network: "SOLANA",
1182
+ walletAddress: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz"
1183
+ },
1184
+ payload: "https://jiti.indexing.co/networks/solana/344836070",
1185
+ output: [
1186
+ {
1187
+ amount: 21234547656n,
1188
+ blockNumber: 323048342,
1189
+ from: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1190
+ timestamp: "2025-06-05T18:30:59.000Z",
1191
+ transactionGasFee: 118174n,
1192
+ transactionHash: "2wQdUtEnCf77jiros6eCbQ1BrWrn1uw4nisy87kmgHhZMGX2CqBugaLdne6bvQR8mAdxinVLivcbVVfJAdTry2rw",
1193
+ token: "6MQpbiTC2YcogidTmKqMLK82qvE9z5QEm7EP3AEDpump",
1194
+ tokenType: "TOKEN",
1195
+ to: "ChkRerg6X89xHYqV4iBqcboBdU1WA8Uvs9fp2yZrqbg"
1196
+ },
1197
+ {
1198
+ amount: 3272427086n,
1199
+ blockNumber: 323048342,
1200
+ from: "DQwTf8dHkjtM6VuewpgET7MS7kX3EEXQDqvXkScC6tnB",
1201
+ timestamp: "2025-06-05T18:30:59.000Z",
1202
+ to: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1203
+ token: null,
1204
+ tokenType: "NATIVE",
1205
+ transactionGasFee: 118174n,
1206
+ transactionHash: "2wQdUtEnCf77jiros6eCbQ1BrWrn1uw4nisy87kmgHhZMGX2CqBugaLdne6bvQR8mAdxinVLivcbVVfJAdTry2rw"
1207
+ }
1208
+ ]
1209
+ },
1210
+ {
1211
+ params: {
1212
+ network: "SOLANA",
1213
+ walletAddress: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i"
1214
+ },
1215
+ payload: "https://jiti.indexing.co/networks/solana/343762745",
1216
+ output: [
1217
+ {
1218
+ amount: 704724041n,
1219
+ blockNumber: 321976935,
1220
+ from: "AVAZvHLR2PcWpDf8BXY4rVxNHYRBytycHkcB5z5QNXYm",
1221
+ timestamp: "2025-05-31T21:20:52.000Z",
1222
+ to: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i",
1223
+ token: null,
1224
+ tokenType: "NATIVE",
1225
+ transactionGasFee: 191568n,
1226
+ transactionHash: "5usAzMSrENJQscoRdxi48n22aMcFmJ1U7f2yGmwUk8AHSFCzLfRtBP7gVnsZbe7Jy9SG2VoeVbVSoVvu43tsdvm1"
1227
+ }
1228
+ ]
1176
1229
  }
1177
- ]
1230
+ ].slice(0)
1178
1231
  };
1179
1232
 
1180
1233