@clayno-club/asset-flow 0.1.2 → 0.1.3
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/README.md +27 -17
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,20 +29,30 @@ pnpm add @clayno-club/asset-flow
|
|
|
29
29
|
|
|
30
30
|
## Core API
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- `
|
|
35
|
-
- `
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
**Classification:**
|
|
33
|
+
|
|
34
|
+
- `classify(tx, mint)` — classify a single transaction for a tracked mint
|
|
35
|
+
- `explain(tx, mint)` — same as classify, but returns the full decision trace
|
|
36
|
+
|
|
37
|
+
**Raw augmentation:**
|
|
38
|
+
|
|
39
|
+
- `shouldFetchRaw(tx, mint)` — check if raw data would improve classification
|
|
40
|
+
- `augmentWithRaw(tx, rawTx)` — merge raw ownership evidence into enhanced tx
|
|
41
|
+
|
|
42
|
+
**History normalization:**
|
|
43
|
+
|
|
44
|
+
- `buildMintHistory(transactions, mint)` — full pipeline: flows + value movements + ownership periods
|
|
45
|
+
- `buildFlows(transactions, mint)` — just the canonical flows
|
|
46
|
+
- `buildValueMovements(transactions, mint)` — just the value movements
|
|
47
|
+
- `buildOwnershipPeriods(flows)` — ownership periods from flows
|
|
48
|
+
- `extractMints(tx)` — extract candidate mint addresses from a transaction
|
|
39
49
|
|
|
40
50
|
## Example: classify one transaction
|
|
41
51
|
|
|
42
52
|
```ts
|
|
43
|
-
import {
|
|
53
|
+
import { classify } from "@clayno-club/asset-flow";
|
|
44
54
|
|
|
45
|
-
const classification =
|
|
55
|
+
const classification = classify(tx, mint);
|
|
46
56
|
|
|
47
57
|
console.log(classification.family);
|
|
48
58
|
console.log(classification.derivedType);
|
|
@@ -52,17 +62,17 @@ console.log(classification.materialization);
|
|
|
52
62
|
## Example: augment enhanced data with raw ownership evidence
|
|
53
63
|
|
|
54
64
|
```ts
|
|
55
|
-
import {
|
|
65
|
+
import { augmentWithRaw } from "@clayno-club/asset-flow";
|
|
56
66
|
|
|
57
|
-
const augmented =
|
|
67
|
+
const augmented = augmentWithRaw(enhancedTx, rawTx);
|
|
58
68
|
```
|
|
59
69
|
|
|
60
70
|
## Example: normalize mint history
|
|
61
71
|
|
|
62
72
|
```ts
|
|
63
|
-
import {
|
|
73
|
+
import { buildMintHistory } from "@clayno-club/asset-flow";
|
|
64
74
|
|
|
65
|
-
const normalized =
|
|
75
|
+
const normalized = buildMintHistory(transactions, mint);
|
|
66
76
|
|
|
67
77
|
console.log(normalized.flows);
|
|
68
78
|
console.log(normalized.valueMovements);
|
|
@@ -72,9 +82,9 @@ console.log(normalized.periods);
|
|
|
72
82
|
## Example: explain a classification decision
|
|
73
83
|
|
|
74
84
|
```ts
|
|
75
|
-
import {
|
|
85
|
+
import { explain } from "@clayno-club/asset-flow";
|
|
76
86
|
|
|
77
|
-
const explanation =
|
|
87
|
+
const explanation = explain(tx, mint);
|
|
78
88
|
|
|
79
89
|
console.log(explanation.facts);
|
|
80
90
|
console.log(explanation.candidates);
|
|
@@ -111,8 +121,8 @@ The normalized history contains:
|
|
|
111
121
|
|
|
112
122
|
Some Solana transactions do not expose enough ownership detail in enhanced/indexed form alone. When raw transaction data is available, use:
|
|
113
123
|
|
|
114
|
-
- `
|
|
115
|
-
- `
|
|
124
|
+
- `shouldFetchRaw()`
|
|
125
|
+
- `augmentWithRaw()`
|
|
116
126
|
|
|
117
127
|
This lets you keep the classification path deterministic while improving owner resolution for custody-heavy or protocol-heavy transactions.
|
|
118
128
|
|
package/dist/index.d.ts
CHANGED
|
@@ -271,4 +271,4 @@ declare function augmentEnhancedTransactionWithRaw(tx: HeliusEnhancedTx, rawTx:
|
|
|
271
271
|
declare function applyRawOwnerOverridesToEnhanced(tx: HeliusEnhancedTx, rawTx: RawAssetFlowTransaction): HeliusEnhancedTx;
|
|
272
272
|
declare function shouldFetchRawForMintTx(tx: HeliusEnhancedTx, mint: string): boolean;
|
|
273
273
|
|
|
274
|
-
export { type AssetFlowClassificationExplanation, type AssetFlowCoverageCluster, type AssetFlowCoverageReviewCandidate, type AssetFlowCoverageScanResult, type AssetFlowDerivedType, type AssetFlowEffect, type AssetFlowFamily, type AssetFlowInterpreterConfidence, type AssetFlowMatcherExplanation, type AssetFlowMaterialization, type AssetFlowObservation, type AssetFlowTransactionFacts, type AssetFlowTxClassification, type AssetNftTouchKind, type AssetOwnershipKind, type AssetSettlementKind, type ExtractedMintFlow, type ExtractedValueMovement, type HeliusEnhancedAction, type HeliusEnhancedInstruction, type HeliusEnhancedTx, type HeliusNativeTransfer, type HeliusTokenTransfer, type NormalizedMintHistory, type RawAssetFlowAccountKey, type RawAssetFlowInstruction, type RawAssetFlowTokenBalance, type RawAssetFlowTransaction, type ReconstructedOwnershipPeriod, applyRawOwnerOverridesToEnhanced, augmentEnhancedTransactionWithRaw, buildTransactionFacts, classifyEnhancedTransactionForMint, clusterCoverageReviewCandidates, collectCoverageReviewCandidates, explainEnhancedTransactionForMint, extractCandidateMintsFromEnhancedTx, extractCandidateMintsFromRawTransaction, extractMintFlows, extractValueMovements, getMintNftTransfers, hasMeaningfulNativeSettlement, isMintNftTransfer, isNonFungibleTokenStandard, mergeRawProgramEvidence, normalizeEnhancedType, normalizeMintHistory, observationFromFacts, observeEnhancedTransactionForMint, reconstructOwnershipPeriods, scanTransactionsForCoverage, shouldApplyRawOwnerOverrides, shouldFetchRawForMintTx, synthesizeEnhancedTransactionsFromRaw, toNullableNumber };
|
|
274
|
+
export { type AssetFlowClassificationExplanation, type AssetFlowCoverageCluster, type AssetFlowCoverageReviewCandidate, type AssetFlowCoverageScanResult, type AssetFlowDerivedType, type AssetFlowEffect, type AssetFlowFamily, type AssetFlowInterpreterConfidence, type AssetFlowMatcherExplanation, type AssetFlowMaterialization, type AssetFlowObservation, type AssetFlowTransactionFacts, type AssetFlowTxClassification, type AssetNftTouchKind, type AssetOwnershipKind, type AssetSettlementKind, type ExtractedMintFlow, type ExtractedValueMovement, type HeliusEnhancedAction, type HeliusEnhancedInstruction, type HeliusEnhancedTx, type HeliusNativeTransfer, type HeliusTokenTransfer, type NormalizedMintHistory, type RawAssetFlowAccountKey, type RawAssetFlowInstruction, type RawAssetFlowTokenBalance, type RawAssetFlowTransaction, type ReconstructedOwnershipPeriod, applyRawOwnerOverridesToEnhanced, augmentEnhancedTransactionWithRaw, augmentEnhancedTransactionWithRaw as augmentWithRaw, extractMintFlows as buildFlows, normalizeMintHistory as buildMintHistory, reconstructOwnershipPeriods as buildOwnershipPeriods, buildTransactionFacts, extractValueMovements as buildValueMovements, classifyEnhancedTransactionForMint as classify, classifyEnhancedTransactionForMint, clusterCoverageReviewCandidates, collectCoverageReviewCandidates, explainEnhancedTransactionForMint as explain, explainEnhancedTransactionForMint, extractCandidateMintsFromEnhancedTx, extractCandidateMintsFromRawTransaction, extractMintFlows, extractCandidateMintsFromEnhancedTx as extractMints, extractValueMovements, getMintNftTransfers, hasMeaningfulNativeSettlement, isMintNftTransfer, isNonFungibleTokenStandard, mergeRawProgramEvidence, normalizeEnhancedType, normalizeMintHistory, observationFromFacts, observeEnhancedTransactionForMint, reconstructOwnershipPeriods, scanTransactionsForCoverage, shouldApplyRawOwnerOverrides, shouldFetchRawForMintTx as shouldFetchRaw, shouldFetchRawForMintTx, synthesizeEnhancedTransactionsFromRaw, toNullableNumber };
|
package/dist/index.js
CHANGED
|
@@ -2592,14 +2592,22 @@ function shouldFetchRawForMintTx(tx, mint) {
|
|
|
2592
2592
|
export {
|
|
2593
2593
|
applyRawOwnerOverridesToEnhanced,
|
|
2594
2594
|
augmentEnhancedTransactionWithRaw,
|
|
2595
|
+
augmentEnhancedTransactionWithRaw as augmentWithRaw,
|
|
2596
|
+
extractMintFlows as buildFlows,
|
|
2597
|
+
normalizeMintHistory as buildMintHistory,
|
|
2598
|
+
reconstructOwnershipPeriods as buildOwnershipPeriods,
|
|
2595
2599
|
buildTransactionFacts,
|
|
2600
|
+
extractValueMovements as buildValueMovements,
|
|
2601
|
+
classifyEnhancedTransactionForMint as classify,
|
|
2596
2602
|
classifyEnhancedTransactionForMint,
|
|
2597
2603
|
clusterCoverageReviewCandidates,
|
|
2598
2604
|
collectCoverageReviewCandidates,
|
|
2605
|
+
explainEnhancedTransactionForMint as explain,
|
|
2599
2606
|
explainEnhancedTransactionForMint,
|
|
2600
2607
|
extractCandidateMintsFromEnhancedTx,
|
|
2601
2608
|
extractCandidateMintsFromRawTransaction,
|
|
2602
2609
|
extractMintFlows,
|
|
2610
|
+
extractCandidateMintsFromEnhancedTx as extractMints,
|
|
2603
2611
|
extractValueMovements,
|
|
2604
2612
|
getMintNftTransfers,
|
|
2605
2613
|
hasMeaningfulNativeSettlement,
|
|
@@ -2613,6 +2621,7 @@ export {
|
|
|
2613
2621
|
reconstructOwnershipPeriods,
|
|
2614
2622
|
scanTransactionsForCoverage,
|
|
2615
2623
|
shouldApplyRawOwnerOverrides,
|
|
2624
|
+
shouldFetchRawForMintTx as shouldFetchRaw,
|
|
2616
2625
|
shouldFetchRawForMintTx,
|
|
2617
2626
|
synthesizeEnhancedTransactionsFromRaw,
|
|
2618
2627
|
toNullableNumber
|