@indexing/jiti 0.0.44 → 0.0.46
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 +22 -19
- package/dist/main.js.map +1 -1
- package/dist/module.js +22 -19
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/module.js
CHANGED
|
@@ -69,7 +69,7 @@ const $09654dffcb68affa$var$PARTIAL_VM_TO_NETWORK_MAP = {
|
|
|
69
69
|
"TON"
|
|
70
70
|
],
|
|
71
71
|
UTXO: [
|
|
72
|
-
"
|
|
72
|
+
"BITCOIN",
|
|
73
73
|
"BITCOIN_TESTNET",
|
|
74
74
|
"DOGECOIN",
|
|
75
75
|
"LITECOIN"
|
|
@@ -83,7 +83,8 @@ const $09654dffcb68affa$var$PARTIAL_NETWORK_TO_VM_MAP = Object.entries($09654dff
|
|
|
83
83
|
}), {});
|
|
84
84
|
function $09654dffcb68affa$export$ae001c77434c5340(block) {
|
|
85
85
|
if (!block) return null;
|
|
86
|
-
|
|
86
|
+
const network = block._network.toUpperCase();
|
|
87
|
+
if ($09654dffcb68affa$var$PARTIAL_NETWORK_TO_VM_MAP[network]) return $09654dffcb68affa$var$PARTIAL_NETWORK_TO_VM_MAP[network];
|
|
87
88
|
if (!!block.block) return "COSMOS";
|
|
88
89
|
// "safe" default
|
|
89
90
|
return "EVM";
|
|
@@ -95,7 +96,7 @@ const $bea1ed486f96b980$export$ace043a4f2efe476 = {
|
|
|
95
96
|
match: (block)=>(0, $09654dffcb68affa$export$ae001c77434c5340)(block) === "APTOS",
|
|
96
97
|
transform (block) {
|
|
97
98
|
let transfers = [];
|
|
98
|
-
for (const tx of block.transactions){
|
|
99
|
+
for (const tx of block.transactions || []){
|
|
99
100
|
if (!tx?.events || !Array.isArray(tx.events)) continue;
|
|
100
101
|
const timestamp = tx.timestamp ? new Date(parseInt(tx.timestamp, 10) / 1000).toISOString() : null;
|
|
101
102
|
const gasUsed = BigInt(tx.gas_used || "0");
|
|
@@ -310,7 +311,7 @@ const $8860a67278817de8$export$893111d8d332e195 = {
|
|
|
310
311
|
transform (block) {
|
|
311
312
|
let transfers = [];
|
|
312
313
|
const blockTimestamp = new Date(block.timestamp * 1000).toISOString();
|
|
313
|
-
for (const tx of block.transactions){
|
|
314
|
+
for (const tx of block.transactions || []){
|
|
314
315
|
const typedTx = tx;
|
|
315
316
|
if (!Array.isArray(typedTx.operations)) continue;
|
|
316
317
|
const transactionHash = typedTx.transaction_identifier?.hash || "";
|
|
@@ -635,7 +636,7 @@ function $8f1e0ae1ead9a2a9$export$685b7dc2197cd06c(rawBlock) {
|
|
|
635
636
|
for (const k of [
|
|
636
637
|
"miner"
|
|
637
638
|
])rawBlock[k] = (0, $42564d9f228fe302$export$db81f9ea057ab646)(rawBlock[k]);
|
|
638
|
-
rawBlock.transactions = rawBlock.transactions.map((tx)=>{
|
|
639
|
+
rawBlock.transactions = (rawBlock.transactions || []).map((tx)=>{
|
|
639
640
|
for (const k of [
|
|
640
641
|
"blockNumber",
|
|
641
642
|
"cumulativeGasUsed",
|
|
@@ -698,7 +699,7 @@ const $5ec62a2088d070a8$export$5beebc5708fabf3c = {
|
|
|
698
699
|
transform (block, _ctx) {
|
|
699
700
|
const TOKEN_TYPES = _ctx.params.tokenTypes || [];
|
|
700
701
|
let transfers = [];
|
|
701
|
-
for (const tx of block.transactions){
|
|
702
|
+
for (const tx of block.transactions || []){
|
|
702
703
|
if (!tx.receipt) continue;
|
|
703
704
|
const timestamp = new Date(block.timestamp * 1000).toISOString();
|
|
704
705
|
const transactionGasFee = BigInt(tx.receipt.gasUsed) * BigInt(tx.receipt.effectiveGasPrice);
|
|
@@ -924,7 +925,7 @@ const $07b3982e2fc4c8b2$export$400f08bfae9ee97f = {
|
|
|
924
925
|
transform (block) {
|
|
925
926
|
let transfers = [];
|
|
926
927
|
if (!Array.isArray(block.transactions)) return [];
|
|
927
|
-
for (const rawTx of block.transactions){
|
|
928
|
+
for (const rawTx of block.transactions || []){
|
|
928
929
|
const typedTx = rawTx;
|
|
929
930
|
if (typedTx.TransactionType !== "Payment") continue;
|
|
930
931
|
const deliveredOrAmount = typedTx.metaData?.delivered_amount ?? typedTx.Amount ?? "0";
|
|
@@ -1088,7 +1089,7 @@ const $64e1e522540ffc4e$export$a51565c56ceacb0a = {
|
|
|
1088
1089
|
match: (block)=>(0, $09654dffcb68affa$export$ae001c77434c5340)(block) === "SVM",
|
|
1089
1090
|
transform (block) {
|
|
1090
1091
|
let transfers = [];
|
|
1091
|
-
for (const tx of block.transactions){
|
|
1092
|
+
for (const tx of block.transactions || []){
|
|
1092
1093
|
const svmTx = tx;
|
|
1093
1094
|
const txHash = svmTx.transaction.signatures[0];
|
|
1094
1095
|
const timestamp = block.blockTime ? new Date(block.blockTime * 1000).toISOString() : null;
|
|
@@ -1501,7 +1502,7 @@ const $f7da547a9d6b4fc0$export$36783fc9701281c6 = {
|
|
|
1501
1502
|
transform (block) {
|
|
1502
1503
|
let transfers = [];
|
|
1503
1504
|
if (!Array.isArray(block.transactions)) return [];
|
|
1504
|
-
for (const tx of block.transactions){
|
|
1505
|
+
for (const tx of block.transactions || []){
|
|
1505
1506
|
const typedTx = tx;
|
|
1506
1507
|
const timestamp = block.timestamp ? new Date(block.timestamp * 1000).toISOString() : null;
|
|
1507
1508
|
let transactionGasFee = BigInt(0);
|
|
@@ -1559,7 +1560,7 @@ const $725699ccb951d76d$export$681f497010b17679 = {
|
|
|
1559
1560
|
match: (block)=>(0, $09654dffcb68affa$export$ae001c77434c5340)(block) === "STELLAR",
|
|
1560
1561
|
transform (block) {
|
|
1561
1562
|
let transfers = [];
|
|
1562
|
-
for (const tx of block.transactions){
|
|
1563
|
+
for (const tx of block.transactions || []){
|
|
1563
1564
|
const typedTx = tx;
|
|
1564
1565
|
for (const op of typedTx.operations)if (op.type === "payment") transfers.push({
|
|
1565
1566
|
amount: BigInt(op.amount.replace(".", "")),
|
|
@@ -1845,11 +1846,13 @@ const $0ab1acc1eff391f6$var$tokenTransfersTemplate = {
|
|
|
1845
1846
|
const seenTransfers = new Set();
|
|
1846
1847
|
transfers = transfers.filter((txfer)=>{
|
|
1847
1848
|
if (txfer.amount <= BigInt(0)) return false;
|
|
1848
|
-
if (_ctx
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1849
|
+
if (_ctx?.params) {
|
|
1850
|
+
if (_ctx.params.contractAddress && _ctx.params.contractAddress !== txfer.token) return false;
|
|
1851
|
+
if (_ctx.params.walletAddress && ![
|
|
1852
|
+
txfer.from,
|
|
1853
|
+
txfer.to
|
|
1854
|
+
].includes(_ctx.params.walletAddress)) return false;
|
|
1855
|
+
}
|
|
1853
1856
|
const key = `${txfer.transactionHash}-${txfer.from}-${txfer.to}-${txfer.amount}-${txfer.token}`;
|
|
1854
1857
|
if (seenTransfers.has(key)) return false;
|
|
1855
1858
|
seenTransfers.add(key);
|
|
@@ -1877,7 +1880,7 @@ const $dc0c078500ed1fea$var$filterValuesTemplate = {
|
|
|
1877
1880
|
case "APTOS":
|
|
1878
1881
|
{
|
|
1879
1882
|
const values = new Set();
|
|
1880
|
-
for (const tx of block.transactions){
|
|
1883
|
+
for (const tx of block.transactions || []){
|
|
1881
1884
|
values.add(tx.sender);
|
|
1882
1885
|
if (!Array.isArray(tx.events)) continue;
|
|
1883
1886
|
for (const evt of tx.events)values.add(evt.guid?.account_address);
|
|
@@ -1967,7 +1970,7 @@ const $dc0c078500ed1fea$var$filterValuesTemplate = {
|
|
|
1967
1970
|
case "STELLAR":
|
|
1968
1971
|
{
|
|
1969
1972
|
const values = new Set();
|
|
1970
|
-
for (const tx of block.transactions){
|
|
1973
|
+
for (const tx of block.transactions || []){
|
|
1971
1974
|
values.add(tx.source_account);
|
|
1972
1975
|
tx.operations?.forEach((op)=>{
|
|
1973
1976
|
values.add(op.from);
|
|
@@ -1995,7 +1998,7 @@ const $dc0c078500ed1fea$var$filterValuesTemplate = {
|
|
|
1995
1998
|
case "SUI":
|
|
1996
1999
|
{
|
|
1997
2000
|
const values = new Set();
|
|
1998
|
-
for (const tx of block.transactions){
|
|
2001
|
+
for (const tx of block.transactions || []){
|
|
1999
2002
|
values.add(tx.sender);
|
|
2000
2003
|
tx.balanceChanges?.forEach((bc)=>{
|
|
2001
2004
|
values.add(bc.owner);
|
|
@@ -2008,7 +2011,7 @@ const $dc0c078500ed1fea$var$filterValuesTemplate = {
|
|
|
2008
2011
|
case "SVM":
|
|
2009
2012
|
{
|
|
2010
2013
|
const values = new Set();
|
|
2011
|
-
for (const tx of block.transactions){
|
|
2014
|
+
for (const tx of block.transactions || []){
|
|
2012
2015
|
tx.transaction.message.accountKeys.forEach((a)=>values.add(typeof a === "string" ? a : a.pubkey));
|
|
2013
2016
|
tx.meta.postTokenBalances.concat(tx.meta.preTokenBalances).forEach((tb)=>{
|
|
2014
2017
|
values.add(tb.owner);
|