@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/main.js CHANGED
@@ -4515,6 +4515,30 @@ function $cd430dd11c31e572$var$decodeJettonInternalTransfer(body) {
4515
4515
  return null;
4516
4516
  }
4517
4517
  }
4518
+ // Other TEP-74 jetton messages whose `in_msg.value` is only forwarded gas or a
4519
+ // refund — never a user-facing TON transfer. Emitting a native transfer for
4520
+ // these surfaces phantom TON hops around every jetton send:
4521
+ // 0x0f8a7ea5 transfer — owner → own jetton wallet (attached gas)
4522
+ // 0x7362d09c transfer_notification — jetton wallet → owner (forwarded gas)
4523
+ // 0xd53276db excesses — jetton wallet → response addr (gas refund)
4524
+ // `internal_transfer` (0x178d4519) is handled above as the jetton TOKEN row.
4525
+ const $cd430dd11c31e572$var$JETTON_GAS_ONLY_OPS = new Set([
4526
+ 0x0f8a7ea5,
4527
+ 0x7362d09c,
4528
+ 0xd53276db
4529
+ ]);
4530
+ // True when the message body carries one of the jetton gas-only op-codes above.
4531
+ // Reads only the 32-bit op-code; returns false for text comments, empty/non-BoC
4532
+ // bodies, or any other op — which fall through to the native path.
4533
+ function $cd430dd11c31e572$var$isJettonGasOnlyMessage(body) {
4534
+ if (!body) return false;
4535
+ try {
4536
+ const slice = (0, $8zHUo$toncore.Cell).fromBoc($cd430dd11c31e572$require$Buffer.from(body, "base64"))[0].beginParse();
4537
+ return $cd430dd11c31e572$var$JETTON_GAS_ONLY_OPS.has(slice.loadUint(32));
4538
+ } catch {
4539
+ return false;
4540
+ }
4541
+ }
4518
4542
  const $cd430dd11c31e572$export$608f3f42810b9879 = {
4519
4543
  match: (block)=>(0, $6bd2ca253e883278$export$ae001c77434c5340)(block) === "TON",
4520
4544
  transform (block) {
@@ -4558,6 +4582,11 @@ const $cd430dd11c31e572$export$608f3f42810b9879 = {
4558
4582
  });
4559
4583
  continue;
4560
4584
  }
4585
+ // A jetton send's own gas hops (transfer / transfer_notification /
4586
+ // excesses) carry `in_msg.value` as forwarded gas, not a real TON
4587
+ // transfer — skip them so they don't surface as phantom native transfers
4588
+ // alongside the jetton `internal_transfer` row emitted above.
4589
+ if ($cd430dd11c31e572$var$isJettonGasOnlyMessage(inMsg.msg_data?.body)) continue;
4561
4590
  const inValue = BigInt(inMsg.value || "0");
4562
4591
  if (inValue > 0n) transfers.push({
4563
4592
  blockNumber: blockNumber,
@@ -4617,6 +4646,123 @@ const $cd430dd11c31e572$export$608f3f42810b9879 = {
4617
4646
  transactionGasFee: 233386n
4618
4647
  }
4619
4648
  ]
4649
+ },
4650
+ {
4651
+ // Jetton gas hops must not surface as native transfers. Synthetic block
4652
+ // (inline payload, no network) with four txs: a genuine native transfer,
4653
+ // an `excesses` (0xd53276db), a `transfer_notification` (0x7362d09c), and a
4654
+ // jetton `internal_transfer` (0x178d4519). Only the native and the jetton
4655
+ // rows survive; the two gas-only ops are dropped despite carrying value.
4656
+ params: {
4657
+ network: "TON"
4658
+ },
4659
+ payload: {
4660
+ _network: "TON",
4661
+ seqno: 76697922,
4662
+ shards: [
4663
+ {
4664
+ transactions: [
4665
+ {
4666
+ address: {
4667
+ account_address: "EQrecipient_native"
4668
+ },
4669
+ utime: 1782844609,
4670
+ fee: "100",
4671
+ transaction_id: {
4672
+ hash: "native-hash"
4673
+ },
4674
+ in_msg: {
4675
+ value: "1000000000",
4676
+ source: {
4677
+ account_address: "EQsender_native"
4678
+ },
4679
+ msg_data: {}
4680
+ }
4681
+ },
4682
+ {
4683
+ address: {
4684
+ account_address: "EQsubject"
4685
+ },
4686
+ utime: 1782844609,
4687
+ fee: "100",
4688
+ transaction_id: {
4689
+ hash: "excesses-hash"
4690
+ },
4691
+ in_msg: {
4692
+ value: "49490794",
4693
+ source: {
4694
+ account_address: "EQjetton_wallet"
4695
+ },
4696
+ msg_data: {
4697
+ body: (0, $8zHUo$toncore.beginCell)().storeUint(0xd53276db, 32).storeUint(0, 64).endCell().toBoc().toString("base64")
4698
+ }
4699
+ }
4700
+ },
4701
+ {
4702
+ address: {
4703
+ account_address: "EQowner"
4704
+ },
4705
+ utime: 1782844609,
4706
+ fee: "100",
4707
+ transaction_id: {
4708
+ hash: "notification-hash"
4709
+ },
4710
+ in_msg: {
4711
+ value: "49490794",
4712
+ source: {
4713
+ account_address: "EQowner_jetton_wallet"
4714
+ },
4715
+ msg_data: {
4716
+ body: (0, $8zHUo$toncore.beginCell)().storeUint(0x7362d09c, 32).storeUint(0, 64).endCell().toBoc().toString("base64")
4717
+ }
4718
+ }
4719
+ },
4720
+ {
4721
+ address: {
4722
+ account_address: "EQrecipient_jetton_wallet"
4723
+ },
4724
+ utime: 1782844609,
4725
+ fee: "200",
4726
+ transaction_id: {
4727
+ hash: "jetton-hash"
4728
+ },
4729
+ in_msg: {
4730
+ value: "49740664",
4731
+ source: {
4732
+ account_address: "EQsender_jetton_wallet"
4733
+ },
4734
+ msg_data: {
4735
+ body: (0, $8zHUo$toncore.beginCell)().storeUint(0x178d4519, 32).storeUint(0, 64).storeCoins(2800000000n).storeAddress(null).endCell().toBoc().toString("base64")
4736
+ }
4737
+ }
4738
+ }
4739
+ ]
4740
+ }
4741
+ ]
4742
+ },
4743
+ output: [
4744
+ {
4745
+ blockNumber: 76697922,
4746
+ from: "EQsender_native",
4747
+ to: "EQrecipient_native",
4748
+ amount: 1000000000n,
4749
+ token: "TON",
4750
+ tokenType: "NATIVE",
4751
+ timestamp: "2026-06-30T18:36:49.000Z",
4752
+ transactionHash: "native-hash",
4753
+ transactionGasFee: 100n
4754
+ },
4755
+ {
4756
+ blockNumber: 76697922,
4757
+ from: "EQsender_jetton_wallet",
4758
+ to: "EQrecipient_jetton_wallet",
4759
+ amount: 2800000000n,
4760
+ tokenType: "TOKEN",
4761
+ timestamp: "2026-06-30T18:36:49.000Z",
4762
+ transactionHash: "jetton-hash",
4763
+ transactionGasFee: 200n
4764
+ }
4765
+ ]
4620
4766
  }
4621
4767
  ]
4622
4768
  };