@indexing/jiti 0.1.20 → 0.1.21

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
@@ -3,7 +3,7 @@ import {sha256 as $hgUW1$sha256, keccak256 as $hgUW1$keccak256, decodeEventLog a
3
3
  import $hgUW1$tronweb from "tronweb";
4
4
  import {decodeTxRaw as $hgUW1$decodeTxRaw, Registry as $hgUW1$Registry} from "@cosmjs/proto-signing";
5
5
  import {defaultRegistryTypes as $hgUW1$defaultRegistryTypes} from "@cosmjs/stargate";
6
- import {Address as $hgUW1$Address, Cell as $hgUW1$Cell} from "@ton/core";
6
+ import {Address as $hgUW1$Address, Cell as $hgUW1$Cell, beginCell as $hgUW1$beginCell} from "@ton/core";
7
7
  import $hgUW1$bs58 from "bs58";
8
8
 
9
9
 
@@ -4497,6 +4497,30 @@ function $e97546fe39f2692a$var$decodeJettonInternalTransfer(body) {
4497
4497
  return null;
4498
4498
  }
4499
4499
  }
4500
+ // Other TEP-74 jetton messages whose `in_msg.value` is only forwarded gas or a
4501
+ // refund — never a user-facing TON transfer. Emitting a native transfer for
4502
+ // these surfaces phantom TON hops around every jetton send:
4503
+ // 0x0f8a7ea5 transfer — owner → own jetton wallet (attached gas)
4504
+ // 0x7362d09c transfer_notification — jetton wallet → owner (forwarded gas)
4505
+ // 0xd53276db excesses — jetton wallet → response addr (gas refund)
4506
+ // `internal_transfer` (0x178d4519) is handled above as the jetton TOKEN row.
4507
+ const $e97546fe39f2692a$var$JETTON_GAS_ONLY_OPS = new Set([
4508
+ 0x0f8a7ea5,
4509
+ 0x7362d09c,
4510
+ 0xd53276db
4511
+ ]);
4512
+ // True when the message body carries one of the jetton gas-only op-codes above.
4513
+ // Reads only the 32-bit op-code; returns false for text comments, empty/non-BoC
4514
+ // bodies, or any other op — which fall through to the native path.
4515
+ function $e97546fe39f2692a$var$isJettonGasOnlyMessage(body) {
4516
+ if (!body) return false;
4517
+ try {
4518
+ const slice = (0, $hgUW1$Cell).fromBoc($e97546fe39f2692a$require$Buffer.from(body, "base64"))[0].beginParse();
4519
+ return $e97546fe39f2692a$var$JETTON_GAS_ONLY_OPS.has(slice.loadUint(32));
4520
+ } catch {
4521
+ return false;
4522
+ }
4523
+ }
4500
4524
  const $e97546fe39f2692a$export$608f3f42810b9879 = {
4501
4525
  match: (block)=>(0, $09654dffcb68affa$export$ae001c77434c5340)(block) === "TON",
4502
4526
  transform (block) {
@@ -4540,6 +4564,11 @@ const $e97546fe39f2692a$export$608f3f42810b9879 = {
4540
4564
  });
4541
4565
  continue;
4542
4566
  }
4567
+ // A jetton send's own gas hops (transfer / transfer_notification /
4568
+ // excesses) carry `in_msg.value` as forwarded gas, not a real TON
4569
+ // transfer — skip them so they don't surface as phantom native transfers
4570
+ // alongside the jetton `internal_transfer` row emitted above.
4571
+ if ($e97546fe39f2692a$var$isJettonGasOnlyMessage(inMsg.msg_data?.body)) continue;
4543
4572
  const inValue = BigInt(inMsg.value || "0");
4544
4573
  if (inValue > 0n) transfers.push({
4545
4574
  blockNumber: blockNumber,
@@ -4599,6 +4628,123 @@ const $e97546fe39f2692a$export$608f3f42810b9879 = {
4599
4628
  transactionGasFee: 233386n
4600
4629
  }
4601
4630
  ]
4631
+ },
4632
+ {
4633
+ // Jetton gas hops must not surface as native transfers. Synthetic block
4634
+ // (inline payload, no network) with four txs: a genuine native transfer,
4635
+ // an `excesses` (0xd53276db), a `transfer_notification` (0x7362d09c), and a
4636
+ // jetton `internal_transfer` (0x178d4519). Only the native and the jetton
4637
+ // rows survive; the two gas-only ops are dropped despite carrying value.
4638
+ params: {
4639
+ network: "TON"
4640
+ },
4641
+ payload: {
4642
+ _network: "TON",
4643
+ seqno: 76697922,
4644
+ shards: [
4645
+ {
4646
+ transactions: [
4647
+ {
4648
+ address: {
4649
+ account_address: "EQrecipient_native"
4650
+ },
4651
+ utime: 1782844609,
4652
+ fee: "100",
4653
+ transaction_id: {
4654
+ hash: "native-hash"
4655
+ },
4656
+ in_msg: {
4657
+ value: "1000000000",
4658
+ source: {
4659
+ account_address: "EQsender_native"
4660
+ },
4661
+ msg_data: {}
4662
+ }
4663
+ },
4664
+ {
4665
+ address: {
4666
+ account_address: "EQsubject"
4667
+ },
4668
+ utime: 1782844609,
4669
+ fee: "100",
4670
+ transaction_id: {
4671
+ hash: "excesses-hash"
4672
+ },
4673
+ in_msg: {
4674
+ value: "49490794",
4675
+ source: {
4676
+ account_address: "EQjetton_wallet"
4677
+ },
4678
+ msg_data: {
4679
+ body: (0, $hgUW1$beginCell)().storeUint(0xd53276db, 32).storeUint(0, 64).endCell().toBoc().toString("base64")
4680
+ }
4681
+ }
4682
+ },
4683
+ {
4684
+ address: {
4685
+ account_address: "EQowner"
4686
+ },
4687
+ utime: 1782844609,
4688
+ fee: "100",
4689
+ transaction_id: {
4690
+ hash: "notification-hash"
4691
+ },
4692
+ in_msg: {
4693
+ value: "49490794",
4694
+ source: {
4695
+ account_address: "EQowner_jetton_wallet"
4696
+ },
4697
+ msg_data: {
4698
+ body: (0, $hgUW1$beginCell)().storeUint(0x7362d09c, 32).storeUint(0, 64).endCell().toBoc().toString("base64")
4699
+ }
4700
+ }
4701
+ },
4702
+ {
4703
+ address: {
4704
+ account_address: "EQrecipient_jetton_wallet"
4705
+ },
4706
+ utime: 1782844609,
4707
+ fee: "200",
4708
+ transaction_id: {
4709
+ hash: "jetton-hash"
4710
+ },
4711
+ in_msg: {
4712
+ value: "49740664",
4713
+ source: {
4714
+ account_address: "EQsender_jetton_wallet"
4715
+ },
4716
+ msg_data: {
4717
+ body: (0, $hgUW1$beginCell)().storeUint(0x178d4519, 32).storeUint(0, 64).storeCoins(2800000000n).storeAddress(null).endCell().toBoc().toString("base64")
4718
+ }
4719
+ }
4720
+ }
4721
+ ]
4722
+ }
4723
+ ]
4724
+ },
4725
+ output: [
4726
+ {
4727
+ blockNumber: 76697922,
4728
+ from: "EQsender_native",
4729
+ to: "EQrecipient_native",
4730
+ amount: 1000000000n,
4731
+ token: "TON",
4732
+ tokenType: "NATIVE",
4733
+ timestamp: "2026-06-30T18:36:49.000Z",
4734
+ transactionHash: "native-hash",
4735
+ transactionGasFee: 100n
4736
+ },
4737
+ {
4738
+ blockNumber: 76697922,
4739
+ from: "EQsender_jetton_wallet",
4740
+ to: "EQrecipient_jetton_wallet",
4741
+ amount: 2800000000n,
4742
+ tokenType: "TOKEN",
4743
+ timestamp: "2026-06-30T18:36:49.000Z",
4744
+ transactionHash: "jetton-hash",
4745
+ transactionGasFee: 200n
4746
+ }
4747
+ ]
4602
4748
  }
4603
4749
  ]
4604
4750
  };