@indexing/jiti 0.1.2 → 0.1.4

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
@@ -395,6 +395,7 @@ const $68871103c7bc00cf$var$CHAIN_ID = {
395
395
  UNICHAIN: 130,
396
396
  UNICHAIN_SEPOLIA: 1301,
397
397
  UOMI_TESTNET: 4386,
398
+ WORLD: 480,
398
399
  XAI: 660279,
399
400
  XPLA: 37,
400
401
  XPLA_TESTNET: 47,
@@ -700,17 +701,21 @@ const $bea1ed486f96b980$export$ace043a4f2efe476 = {
700
701
  });
701
702
  } else if (owner?.length > 4) {
702
703
  const payload = tx.payload;
703
- if (payload && payload.function === "0x1::aptos_account::transfer_coins") transfers.push({
704
- amount: BigInt(payload.arguments[1]),
705
- blockNumber: parseInt(typedBlock.block_height, 10),
706
- from: sender,
707
- to: owner,
708
- timestamp: timestamp,
709
- token: null,
710
- tokenType: "NATIVE",
711
- transactionGasFee: gasUsed,
712
- transactionHash: tx.hash
713
- });
704
+ if (payload && payload.function === "0x1::aptos_account::transfer_coins") {
705
+ const coinType = payload.type_arguments?.[0];
706
+ const isNative = !coinType || coinType.toLowerCase().includes("aptos_coin");
707
+ transfers.push({
708
+ amount: BigInt(payload.arguments[1]),
709
+ blockNumber: parseInt(typedBlock.block_height, 10),
710
+ from: sender,
711
+ to: owner,
712
+ timestamp: timestamp,
713
+ token: isNative ? null : coinType.toLowerCase(),
714
+ tokenType: isNative ? "NATIVE" : "TOKEN",
715
+ transactionGasFee: gasUsed,
716
+ transactionHash: tx.hash
717
+ });
718
+ }
714
719
  }
715
720
  }
716
721
  for (const evt of tx.events){
@@ -875,6 +880,51 @@ const $bea1ed486f96b980$export$ace043a4f2efe476 = {
875
880
  transactionHash: "0xa7d2d682f6940c1023d95ae8950b8d1dc0604abd34a4a2cc654f1be6f330ca44"
876
881
  }
877
882
  ]
883
+ },
884
+ // transfer_coins with non-native token (PROPS) — should NOT produce token: null
885
+ // Bug: the transfer_coins code path blindly sets token: null, tokenType: 'NATIVE'
886
+ // even when type_arguments indicates a non-native coin
887
+ {
888
+ params: {
889
+ network: "APTOS",
890
+ transactionHash: "0xaaec78039e7392b430c554bc33291c2786a1c92669e8f8f88280f419b0792d29"
891
+ },
892
+ payload: "https://jiti.indexing.co/networks/aptos/661127894",
893
+ output: [
894
+ {
895
+ amount: 18740000000000n,
896
+ blockNumber: 661127894,
897
+ from: "0xaa0090c74e4976834ff1b9b9ef945e1c4b6cdb49cccf37c2554ef026081312f1",
898
+ to: "0xaa0090c74e4976834ff1b9b9ef945e1c4b6cdb49cccf37c2554ef026081312f1",
899
+ timestamp: "2026-03-13T15:33:48.659Z",
900
+ token: "0xe50684a338db732d8fb8a3ac71c4b8633878bd0193bca5de2ebc852a83b35099::propbase_coin::props",
901
+ tokenType: "TOKEN",
902
+ transactionGasFee: 16n,
903
+ transactionHash: "0xaaec78039e7392b430c554bc33291c2786a1c92669e8f8f88280f419b0792d29"
904
+ },
905
+ {
906
+ amount: 53458526229170n,
907
+ blockNumber: 661127894,
908
+ from: "0xaa0090c74e4976834ff1b9b9ef945e1c4b6cdb49cccf37c2554ef026081312f1",
909
+ to: "0xf520886f20b097e2e2e4116ab66d943f13a3f107d2ba09f6f1abc38e872b234c",
910
+ timestamp: "2026-03-13T15:33:48.659Z",
911
+ token: "0x6dba1728c73363be1bdd4d504844c40fbb893e368ccbeff1d1bd83497dbc756d",
912
+ tokenType: "TOKEN",
913
+ transactionGasFee: 16n,
914
+ transactionHash: "0xaaec78039e7392b430c554bc33291c2786a1c92669e8f8f88280f419b0792d29"
915
+ },
916
+ {
917
+ amount: 18740000000000n,
918
+ blockNumber: 661127894,
919
+ from: "0xaa0090c74e4976834ff1b9b9ef945e1c4b6cdb49cccf37c2554ef026081312f1",
920
+ to: "0xf520886f20b097e2e2e4116ab66d943f13a3f107d2ba09f6f1abc38e872b234c",
921
+ timestamp: "2026-03-13T15:33:48.659Z",
922
+ token: "0xe50684a338db732d8fb8a3ac71c4b8633878bd0193bca5de2ebc852a83b35099::propbase_coin::props",
923
+ tokenType: "TOKEN",
924
+ transactionGasFee: 16n,
925
+ transactionHash: "0xaaec78039e7392b430c554bc33291c2786a1c92669e8f8f88280f419b0792d29"
926
+ }
927
+ ]
878
928
  }
879
929
  ]
880
930
  };