@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/main.js CHANGED
@@ -971,7 +971,7 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
971
971
  transfersByKey[key] = Object.assign(transfersByKey[key] || {}, txfer);
972
972
  }
973
973
  }
974
- for(let i = 1; i < solanaTx.meta.postBalances.length; i += 1){
974
+ for(let i = 0; i < solanaTx.meta.postBalances.length; i += 1){
975
975
  const post = solanaTx.meta.postBalances[i];
976
976
  const pre = solanaTx.meta.preBalances[i];
977
977
  if (post !== undefined && pre !== undefined && post !== pre) {
@@ -981,7 +981,7 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
981
981
  const txfer = {
982
982
  amount: diff,
983
983
  blockNumber: block.blockHeight,
984
- from: post > pre ? typeof allAccounts[0] === "string" ? allAccounts[0] : allAccounts[0]?.pubkey : typeof allAccounts[i] === "string" ? allAccounts[i] : allAccounts[i]?.pubkey,
984
+ from: typeof allAccounts[i] === "string" ? allAccounts[i] : allAccounts[i]?.pubkey,
985
985
  timestamp: timestamp,
986
986
  to: typeof allAccounts[i] === "string" ? allAccounts[i] : allAccounts[i]?.pubkey?.toString(),
987
987
  token: null,
@@ -989,9 +989,8 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
989
989
  transactionGasFee: txFee,
990
990
  transactionHash: txHash
991
991
  };
992
- if (post > pre) {
993
- if (transfersByKey[key]) delete txfer.from;
994
- } else delete txfer.to;
992
+ if (post > pre) delete txfer.from;
993
+ else delete txfer.to;
995
994
  transfersByKey[key] = Object.assign(transfersByKey[key] || {}, txfer);
996
995
  }
997
996
  }
@@ -1009,12 +1008,15 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
1009
1008
  delete transfersByKey[key];
1010
1009
  }
1011
1010
  }
1012
- 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)) {
1013
- unmatchedTo[token].sort((a, b)=>a.amount > b.amount ? 1 : -1);
1014
- unmatchedFrom[token].forEach((um)=>{
1015
- um.from = unmatchedTo[token][0].from;
1016
- transfersByKey[`${token}-${um.amount.toString()}`] = um;
1017
- });
1011
+ for(const token in unmatchedFrom)if (unmatchedTo[token]?.length && unmatchedFrom[token]?.length) {
1012
+ 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") {
1014
+ unmatchedTo[token].sort((a, b)=>a.amount > b.amount ? 1 : -1);
1015
+ unmatchedFrom[token].forEach((um)=>{
1016
+ um.from = unmatchedTo[token][0].from;
1017
+ transfersByKey[`${token}-${um.amount.toString()}`] = um;
1018
+ });
1019
+ }
1018
1020
  }
1019
1021
  transfers.push(...Object.values(transfersByKey));
1020
1022
  }
@@ -1102,6 +1104,17 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
1102
1104
  },
1103
1105
  payload: "https://jiti.indexing.co/networks/solana/332450156",
1104
1106
  output: [
1107
+ {
1108
+ amount: 19796403663n,
1109
+ blockNumber: 310691098,
1110
+ timestamp: "2025-04-10T02:29:35.000Z",
1111
+ to: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1112
+ transactionGasFee: 80001n,
1113
+ transactionHash: "32T7ANVqz1sHBoKhfk3omrRqwDCJFYMi6TfuAwyqHPCZPCihdWTU9t9i5D6tGwuytWRwRqnEXksMPMWbFbfBzVUk",
1114
+ token: "CniPCE4b3s8gSUPhUiyMjXnytrEqUrMfSsnbBjLCpump",
1115
+ tokenType: "TOKEN",
1116
+ from: "4acL7mD2J6GYJy2g3iVTvfpmHCQSZ1rb8DBuupjcVzHJ"
1117
+ },
1105
1118
  {
1106
1119
  amount: 402062750n,
1107
1120
  blockNumber: 310691098,
@@ -1123,17 +1136,6 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
1123
1136
  tokenType: "NATIVE",
1124
1137
  transactionGasFee: 80001n,
1125
1138
  transactionHash: "32T7ANVqz1sHBoKhfk3omrRqwDCJFYMi6TfuAwyqHPCZPCihdWTU9t9i5D6tGwuytWRwRqnEXksMPMWbFbfBzVUk"
1126
- },
1127
- {
1128
- amount: 19796403663n,
1129
- blockNumber: 310691098,
1130
- timestamp: "2025-04-10T02:29:35.000Z",
1131
- to: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1132
- transactionGasFee: 80001n,
1133
- transactionHash: "32T7ANVqz1sHBoKhfk3omrRqwDCJFYMi6TfuAwyqHPCZPCihdWTU9t9i5D6tGwuytWRwRqnEXksMPMWbFbfBzVUk",
1134
- token: "CniPCE4b3s8gSUPhUiyMjXnytrEqUrMfSsnbBjLCpump",
1135
- tokenType: "TOKEN",
1136
- from: "4acL7mD2J6GYJy2g3iVTvfpmHCQSZ1rb8DBuupjcVzHJ"
1137
1139
  }
1138
1140
  ]
1139
1141
  },
@@ -1179,8 +1181,59 @@ const $290fd8bc430da9f0$export$1f0fe79deb1b813b = {
1179
1181
  transactionHash: "xKTWvnhSRErcHCMozRMEue4MriNr1Any6LiaQzXrR7imZ1MpZxRqbyv9LLg4JQoDq4oJZpDqPmzxLCtMCkgj2hn"
1180
1182
  }
1181
1183
  ]
1184
+ },
1185
+ {
1186
+ params: {
1187
+ network: "SOLANA",
1188
+ walletAddress: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz"
1189
+ },
1190
+ payload: "https://jiti.indexing.co/networks/solana/344836070",
1191
+ output: [
1192
+ {
1193
+ amount: 21234547656n,
1194
+ blockNumber: 323048342,
1195
+ from: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1196
+ timestamp: "2025-06-05T18:30:59.000Z",
1197
+ transactionGasFee: 118174n,
1198
+ transactionHash: "2wQdUtEnCf77jiros6eCbQ1BrWrn1uw4nisy87kmgHhZMGX2CqBugaLdne6bvQR8mAdxinVLivcbVVfJAdTry2rw",
1199
+ token: "6MQpbiTC2YcogidTmKqMLK82qvE9z5QEm7EP3AEDpump",
1200
+ tokenType: "TOKEN",
1201
+ to: "ChkRerg6X89xHYqV4iBqcboBdU1WA8Uvs9fp2yZrqbg"
1202
+ },
1203
+ {
1204
+ amount: 3272427086n,
1205
+ blockNumber: 323048342,
1206
+ from: "DQwTf8dHkjtM6VuewpgET7MS7kX3EEXQDqvXkScC6tnB",
1207
+ timestamp: "2025-06-05T18:30:59.000Z",
1208
+ to: "DgC9bBDvJYeVyTqcp8nW5F5USNvxBiZ9NMoTUVy5UVPz",
1209
+ token: null,
1210
+ tokenType: "NATIVE",
1211
+ transactionGasFee: 118174n,
1212
+ transactionHash: "2wQdUtEnCf77jiros6eCbQ1BrWrn1uw4nisy87kmgHhZMGX2CqBugaLdne6bvQR8mAdxinVLivcbVVfJAdTry2rw"
1213
+ }
1214
+ ]
1215
+ },
1216
+ {
1217
+ params: {
1218
+ network: "SOLANA",
1219
+ walletAddress: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i"
1220
+ },
1221
+ payload: "https://jiti.indexing.co/networks/solana/343762745",
1222
+ output: [
1223
+ {
1224
+ amount: 704724041n,
1225
+ blockNumber: 321976935,
1226
+ from: "AVAZvHLR2PcWpDf8BXY4rVxNHYRBytycHkcB5z5QNXYm",
1227
+ timestamp: "2025-05-31T21:20:52.000Z",
1228
+ to: "Gaq4K6e5tY9Z8L9bcWFPhNbteb9YYekjzH6eQPx24B5i",
1229
+ token: null,
1230
+ tokenType: "NATIVE",
1231
+ transactionGasFee: 191568n,
1232
+ transactionHash: "5usAzMSrENJQscoRdxi48n22aMcFmJ1U7f2yGmwUk8AHSFCzLfRtBP7gVnsZbe7Jy9SG2VoeVbVSoVvu43tsdvm1"
1233
+ }
1234
+ ]
1182
1235
  }
1183
- ]
1236
+ ].slice(0)
1184
1237
  };
1185
1238
 
1186
1239