@clayno-club/asset-flow 0.4.0 → 0.5.0

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/index.js CHANGED
@@ -3759,6 +3759,9 @@ function buildSuiFlows(tx, assetId, classification2, currentBeneficialOwner) {
3759
3759
  })
3760
3760
  ];
3761
3761
  }
3762
+ function isOwnershipMovingCustodyFlow(derivedType) {
3763
+ return derivedType === "LOCK" || derivedType === "UNLOCK" || derivedType === "LIST" || derivedType === "DELIST";
3764
+ }
3762
3765
  function extractAssetFlows(transactions, assetId, classificationCache = /* @__PURE__ */ new Map()) {
3763
3766
  const flows = [];
3764
3767
  let currentBeneficialOwner = null;
@@ -3769,6 +3772,11 @@ function extractAssetFlows(transactions, assetId, classificationCache = /* @__PU
3769
3772
  if (txFlows.length === 0) {
3770
3773
  continue;
3771
3774
  }
3775
+ for (const flow of txFlows) {
3776
+ if (isOwnershipMovingCustodyFlow(flow.derivedType) && flow.fromAddress && flow.toAddress && flow.fromAddress !== flow.toAddress) {
3777
+ flow.derivedType = "TRANSFER";
3778
+ }
3779
+ }
3772
3780
  txFlows.forEach((flow, index) => {
3773
3781
  flow.transferIndex = index;
3774
3782
  flows.push(flow);