@indexing/jiti 0.0.43 → 0.0.45

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
@@ -13,10 +13,6 @@ function $parcel$interopDefault(a) {
13
13
  return a && a.__esModule ? a.default : a;
14
14
  }
15
15
 
16
- function $parcel$defineInteropFlag(a) {
17
- Object.defineProperty(a, '__esModule', {value: true, configurable: true});
18
- }
19
-
20
16
  function $parcel$exportWildcard(dest, source) {
21
17
  Object.keys(source).forEach(function(key) {
22
18
  if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
@@ -42,9 +38,7 @@ $parcel$export(module.exports, "types", () => $faefaad95e5fcca0$exports);
42
38
 
43
39
  var $6bd2ca253e883278$exports = {};
44
40
 
45
- $parcel$defineInteropFlag($6bd2ca253e883278$exports);
46
-
47
- $parcel$export($6bd2ca253e883278$exports, "default", () => $6bd2ca253e883278$export$2e2bcd8739ae039);
41
+ $parcel$export($6bd2ca253e883278$exports, "blockToVM", () => $6bd2ca253e883278$export$ae001c77434c5340);
48
42
  const $6bd2ca253e883278$var$PARTIAL_VM_TO_NETWORK_MAP = {
49
43
  APTOS: [
50
44
  "APTOS",
@@ -85,7 +79,7 @@ const $6bd2ca253e883278$var$PARTIAL_VM_TO_NETWORK_MAP = {
85
79
  "TON"
86
80
  ],
87
81
  UTXO: [
88
- "BTICOIN",
82
+ "BITCOIN",
89
83
  "BITCOIN_TESTNET",
90
84
  "DOGECOIN",
91
85
  "LITECOIN"
@@ -97,9 +91,10 @@ const $6bd2ca253e883278$var$PARTIAL_NETWORK_TO_VM_MAP = Object.entries($6bd2ca25
97
91
  ...a,
98
92
  ...b
99
93
  }), {});
100
- function $6bd2ca253e883278$export$2e2bcd8739ae039(block) {
94
+ function $6bd2ca253e883278$export$ae001c77434c5340(block) {
101
95
  if (!block) return null;
102
- if ($6bd2ca253e883278$var$PARTIAL_NETWORK_TO_VM_MAP[block._network]) return $6bd2ca253e883278$var$PARTIAL_NETWORK_TO_VM_MAP[block._network];
96
+ const network = block._network.toUpperCase();
97
+ if ($6bd2ca253e883278$var$PARTIAL_NETWORK_TO_VM_MAP[network]) return $6bd2ca253e883278$var$PARTIAL_NETWORK_TO_VM_MAP[network];
103
98
  if (!!block.block) return "COSMOS";
104
99
  // "safe" default
105
100
  return "EVM";
@@ -108,10 +103,10 @@ function $6bd2ca253e883278$export$2e2bcd8739ae039(block) {
108
103
 
109
104
 
110
105
  const $25d5bdd23cba31eb$export$ace043a4f2efe476 = {
111
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "APTOS",
106
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "APTOS",
112
107
  transform (block) {
113
108
  let transfers = [];
114
- for (const tx of block.transactions){
109
+ for (const tx of block.transactions || []){
115
110
  if (!tx?.events || !Array.isArray(tx.events)) continue;
116
111
  const timestamp = tx.timestamp ? new Date(parseInt(tx.timestamp, 10) / 1000).toISOString() : null;
117
112
  const gasUsed = BigInt(tx.gas_used || "0");
@@ -322,11 +317,11 @@ const $25d5bdd23cba31eb$export$ace043a4f2efe476 = {
322
317
 
323
318
 
324
319
  const $60d24c82dc5feb2e$export$893111d8d332e195 = {
325
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "CARDANO",
320
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "CARDANO",
326
321
  transform (block) {
327
322
  let transfers = [];
328
323
  const blockTimestamp = new Date(block.timestamp * 1000).toISOString();
329
- for (const tx of block.transactions){
324
+ for (const tx of block.transactions || []){
330
325
  const typedTx = tx;
331
326
  if (!Array.isArray(typedTx.operations)) continue;
332
327
  const transactionHash = typedTx.transaction_identifier?.hash || "";
@@ -395,7 +390,7 @@ const $60d24c82dc5feb2e$export$893111d8d332e195 = {
395
390
 
396
391
  var $f9ab50a3e879ac1c$require$Buffer = $8zHUo$buffer.Buffer;
397
392
  const $f9ab50a3e879ac1c$export$b5fd4920e8b7d913 = {
398
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "COSMOS",
393
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "COSMOS",
399
394
  transform (block) {
400
395
  let transfers = [];
401
396
  const typedBlock = block;
@@ -455,12 +450,10 @@ const $f9ab50a3e879ac1c$export$b5fd4920e8b7d913 = {
455
450
  var $d7167569386d0d4c$exports = {};
456
451
  var $b8691f253b6baa6e$exports = {};
457
452
 
458
- $parcel$defineInteropFlag($b8691f253b6baa6e$exports);
453
+ $parcel$export($b8691f253b6baa6e$exports, "blockToTimestamp", () => $b8691f253b6baa6e$export$ec64f6024312bb14);
459
454
 
460
- $parcel$export($b8691f253b6baa6e$exports, "default", () => $b8691f253b6baa6e$export$2e2bcd8739ae039);
461
-
462
- function $b8691f253b6baa6e$export$2e2bcd8739ae039(block) {
463
- const vm = (0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block);
455
+ function $b8691f253b6baa6e$export$ec64f6024312bb14(block) {
456
+ const vm = (0, $6bd2ca253e883278$export$ae001c77434c5340)(block);
464
457
  switch(vm){
465
458
  case "APTOS":
466
459
  return new Date(parseInt(block.transactions[0].timestamp, 10) / 1000);
@@ -653,7 +646,7 @@ function $414c83047563e72e$export$685b7dc2197cd06c(rawBlock) {
653
646
  for (const k of [
654
647
  "miner"
655
648
  ])rawBlock[k] = (0, $596a656635c74d50$export$db81f9ea057ab646)(rawBlock[k]);
656
- rawBlock.transactions = rawBlock.transactions.map((tx)=>{
649
+ rawBlock.transactions = (rawBlock.transactions || []).map((tx)=>{
657
650
  for (const k of [
658
651
  "blockNumber",
659
652
  "cumulativeGasUsed",
@@ -712,11 +705,11 @@ $parcel$exportWildcard($d7167569386d0d4c$exports, $414c83047563e72e$exports);
712
705
 
713
706
  const $8deaea1ef39b6485$var$NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
714
707
  const $8deaea1ef39b6485$export$5beebc5708fabf3c = {
715
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "EVM",
708
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "EVM",
716
709
  transform (block, _ctx) {
717
710
  const TOKEN_TYPES = _ctx.params.tokenTypes || [];
718
711
  let transfers = [];
719
- for (const tx of block.transactions){
712
+ for (const tx of block.transactions || []){
720
713
  if (!tx.receipt) continue;
721
714
  const timestamp = new Date(block.timestamp * 1000).toISOString();
722
715
  const transactionGasFee = BigInt(tx.receipt.gasUsed) * BigInt(tx.receipt.effectiveGasPrice);
@@ -878,7 +871,7 @@ const $8deaea1ef39b6485$export$5beebc5708fabf3c = {
878
871
 
879
872
 
880
873
  const $5a4d345db3c04a51$export$d7ac970e8e789607 = {
881
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "FILECOIN",
874
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "FILECOIN",
882
875
  transform (block) {
883
876
  let transfers = [];
884
877
  const typedBlock = block;
@@ -938,11 +931,11 @@ const $5a4d345db3c04a51$export$d7ac970e8e789607 = {
938
931
 
939
932
 
940
933
  const $2e46ec862e47c14f$export$400f08bfae9ee97f = {
941
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "RIPPLE",
934
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "RIPPLE",
942
935
  transform (block) {
943
936
  let transfers = [];
944
937
  if (!Array.isArray(block.transactions)) return [];
945
- for (const rawTx of block.transactions){
938
+ for (const rawTx of block.transactions || []){
946
939
  const typedTx = rawTx;
947
940
  if (typedTx.TransactionType !== "Payment") continue;
948
941
  const deliveredOrAmount = typedTx.metaData?.delivered_amount ?? typedTx.Amount ?? "0";
@@ -998,7 +991,7 @@ const $2e46ec862e47c14f$export$400f08bfae9ee97f = {
998
991
 
999
992
 
1000
993
  const $3b9b8f5747dcca8e$export$722698bc663d0ac0 = {
1001
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "SUI",
994
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "SUI",
1002
995
  transform (block) {
1003
996
  let transfers = [];
1004
997
  const blockNumber = parseInt(block.sequence, 10);
@@ -1103,10 +1096,10 @@ const $3b9b8f5747dcca8e$export$722698bc663d0ac0 = {
1103
1096
 
1104
1097
 
1105
1098
  const $fc7ca671efecc378$export$a51565c56ceacb0a = {
1106
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "SVM",
1099
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "SVM",
1107
1100
  transform (block) {
1108
1101
  let transfers = [];
1109
- for (const tx of block.transactions){
1102
+ for (const tx of block.transactions || []){
1110
1103
  const svmTx = tx;
1111
1104
  const txHash = svmTx.transaction.signatures[0];
1112
1105
  const timestamp = block.blockTime ? new Date(block.blockTime * 1000).toISOString() : null;
@@ -1515,11 +1508,11 @@ const $fc7ca671efecc378$export$a51565c56ceacb0a = {
1515
1508
 
1516
1509
 
1517
1510
  const $fc745f3cb8eb3f52$export$36783fc9701281c6 = {
1518
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "STARKNET",
1511
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "STARKNET",
1519
1512
  transform (block) {
1520
1513
  let transfers = [];
1521
1514
  if (!Array.isArray(block.transactions)) return [];
1522
- for (const tx of block.transactions){
1515
+ for (const tx of block.transactions || []){
1523
1516
  const typedTx = tx;
1524
1517
  const timestamp = block.timestamp ? new Date(block.timestamp * 1000).toISOString() : null;
1525
1518
  let transactionGasFee = BigInt(0);
@@ -1574,10 +1567,10 @@ const $fc745f3cb8eb3f52$export$36783fc9701281c6 = {
1574
1567
 
1575
1568
 
1576
1569
  const $3478cd776d185339$export$681f497010b17679 = {
1577
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "STELLAR",
1570
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "STELLAR",
1578
1571
  transform (block) {
1579
1572
  let transfers = [];
1580
- for (const tx of block.transactions){
1573
+ for (const tx of block.transactions || []){
1581
1574
  const typedTx = tx;
1582
1575
  for (const op of typedTx.operations)if (op.type === "payment") transfers.push({
1583
1576
  amount: BigInt(op.amount.replace(".", "")),
@@ -1621,7 +1614,7 @@ const $3478cd776d185339$export$681f497010b17679 = {
1621
1614
 
1622
1615
 
1623
1616
  const $11a2c5b0fd56c033$export$bc6c7ab7e0727dd7 = {
1624
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "SUBSTRATE",
1617
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "SUBSTRATE",
1625
1618
  transform (block) {
1626
1619
  let transfers = [];
1627
1620
  const typedBlock = block;
@@ -1677,7 +1670,7 @@ const $11a2c5b0fd56c033$export$bc6c7ab7e0727dd7 = {
1677
1670
 
1678
1671
 
1679
1672
  const $cd430dd11c31e572$export$608f3f42810b9879 = {
1680
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "TON",
1673
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "TON",
1681
1674
  transform (block) {
1682
1675
  let transfers = [];
1683
1676
  const blockNumber = block.seqno;
@@ -1743,7 +1736,7 @@ const $cd430dd11c31e572$export$608f3f42810b9879 = {
1743
1736
 
1744
1737
 
1745
1738
  const $990c4f660694d8bc$export$4f5322cf4718bd30 = {
1746
- match: (block)=>(0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block) === "UTXO",
1739
+ match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "UTXO",
1747
1740
  transform (block) {
1748
1741
  let transfers = [];
1749
1742
  const timestamp = block.time ? new Date(block.time * 1000).toISOString() : null;
@@ -1890,12 +1883,12 @@ const $9af31dbb692f94e3$var$filterValuesTemplate = {
1890
1883
  params: [],
1891
1884
  transform: (block)=>{
1892
1885
  let finalValues = [];
1893
- const vm = block._vm || (0, $6bd2ca253e883278$export$2e2bcd8739ae039)(block);
1886
+ const vm = block._vm || (0, $6bd2ca253e883278$export$ae001c77434c5340)(block);
1894
1887
  switch(vm){
1895
1888
  case "APTOS":
1896
1889
  {
1897
1890
  const values = new Set();
1898
- for (const tx of block.transactions){
1891
+ for (const tx of block.transactions || []){
1899
1892
  values.add(tx.sender);
1900
1893
  if (!Array.isArray(tx.events)) continue;
1901
1894
  for (const evt of tx.events)values.add(evt.guid?.account_address);
@@ -1985,7 +1978,7 @@ const $9af31dbb692f94e3$var$filterValuesTemplate = {
1985
1978
  case "STELLAR":
1986
1979
  {
1987
1980
  const values = new Set();
1988
- for (const tx of block.transactions){
1981
+ for (const tx of block.transactions || []){
1989
1982
  values.add(tx.source_account);
1990
1983
  tx.operations?.forEach((op)=>{
1991
1984
  values.add(op.from);
@@ -2013,7 +2006,7 @@ const $9af31dbb692f94e3$var$filterValuesTemplate = {
2013
2006
  case "SUI":
2014
2007
  {
2015
2008
  const values = new Set();
2016
- for (const tx of block.transactions){
2009
+ for (const tx of block.transactions || []){
2017
2010
  values.add(tx.sender);
2018
2011
  tx.balanceChanges?.forEach((bc)=>{
2019
2012
  values.add(bc.owner);
@@ -2026,7 +2019,7 @@ const $9af31dbb692f94e3$var$filterValuesTemplate = {
2026
2019
  case "SVM":
2027
2020
  {
2028
2021
  const values = new Set();
2029
- for (const tx of block.transactions){
2022
+ for (const tx of block.transactions || []){
2030
2023
  tx.transaction.message.accountKeys.forEach((a)=>values.add(typeof a === "string" ? a : a.pubkey));
2031
2024
  tx.meta.postTokenBalances.concat(tx.meta.preTokenBalances).forEach((tb)=>{
2032
2025
  values.add(tb.owner);