@cygnus-wealth/data-models 0.0.2 → 1.0.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.
Files changed (41) hide show
  1. package/README.md +366 -63
  2. package/dist/enums/AccountType.d.ts +41 -0
  3. package/dist/enums/AccountType.js +41 -0
  4. package/dist/enums/AssetType.d.ts +114 -0
  5. package/dist/enums/AssetType.js +114 -0
  6. package/dist/enums/Chain.d.ts +57 -0
  7. package/dist/enums/Chain.js +57 -0
  8. package/dist/enums/IntegrationSource.d.ts +47 -0
  9. package/dist/enums/IntegrationSource.js +47 -4
  10. package/dist/enums/LendingPositionType.d.ts +25 -0
  11. package/dist/enums/LendingPositionType.js +26 -0
  12. package/dist/enums/TransactionType.d.ts +50 -0
  13. package/dist/enums/TransactionType.js +50 -0
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +1 -0
  16. package/dist/interfaces/Account.d.ts +92 -0
  17. package/dist/interfaces/ApiError.d.ts +61 -0
  18. package/dist/interfaces/ApiResponse.d.ts +60 -1
  19. package/dist/interfaces/Asset.d.ts +59 -0
  20. package/dist/interfaces/Balance.d.ts +52 -0
  21. package/dist/interfaces/BaseEntity.d.ts +61 -0
  22. package/dist/interfaces/FilterOptions.d.ts +68 -0
  23. package/dist/interfaces/IntegrationCredentials.d.ts +54 -0
  24. package/dist/interfaces/LendingPosition.d.ts +89 -4
  25. package/dist/interfaces/LiquidityPosition.d.ts +66 -2
  26. package/dist/interfaces/MarketData.d.ts +53 -0
  27. package/dist/interfaces/Metadata.d.ts +86 -0
  28. package/dist/interfaces/NFT.d.ts +55 -0
  29. package/dist/interfaces/PaginatedResponse.d.ts +59 -0
  30. package/dist/interfaces/Portfolio.d.ts +104 -2
  31. package/dist/interfaces/PortfolioAsset.d.ts +76 -0
  32. package/dist/interfaces/PortfolioAsset.js +1 -0
  33. package/dist/interfaces/PortfolioItem.d.ts +13 -0
  34. package/dist/interfaces/Price.d.ts +45 -2
  35. package/dist/interfaces/StakedPosition.d.ts +77 -0
  36. package/dist/interfaces/SyncStatus.d.ts +55 -0
  37. package/dist/interfaces/Transaction.d.ts +114 -2
  38. package/dist/types/AssetIdentifier.d.ts +61 -0
  39. package/dist/types/SortOrder.d.ts +50 -0
  40. package/dist/types/TimeRange.d.ts +51 -0
  41. package/package.json +29 -3
@@ -1,15 +1,129 @@
1
+ /**
2
+ * Classification of financial asset types across all integration sources.
3
+ *
4
+ * AssetType provides standardized categorization for all tradeable, holdable, or
5
+ * stakeable instruments within the CygnusWealth ecosystem. This enum serves as
6
+ * the primary taxonomy for asset classification across CEX, DEX, traditional
7
+ * finance, and DeFi sources.
8
+ *
9
+ * **Design Rationale:**
10
+ * - Covers both traditional finance (stocks, bonds) and crypto (tokens, NFTs, DeFi positions)
11
+ * - Distinguishes between base assets and derivative/yield-generating positions
12
+ * - Extensible via OTHER for edge cases without breaking existing types
13
+ *
14
+ * **Integration Guidance:**
15
+ * - Integration domains should map external classifications to these types
16
+ * - When in doubt between similar types, prefer more specific (e.g., NFT over CRYPTOCURRENCY)
17
+ * - Use metadata field for preserving source-specific asset classifications
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Mapping external asset types
22
+ * function mapRobinhoodAsset(rhAsset: any): AssetType {
23
+ * switch (rhAsset.type) {
24
+ * case 'stock': return AssetType.STOCK;
25
+ * case 'cryptocurrency': return AssetType.CRYPTOCURRENCY;
26
+ * case 'etp': return AssetType.ETF;
27
+ * default: return AssetType.OTHER;
28
+ * }
29
+ * }
30
+ * ```
31
+ *
32
+ * @since 0.0.1
33
+ * @stability core
34
+ *
35
+ * @see {@link Asset} for usage in asset models
36
+ */
1
37
  export declare enum AssetType {
38
+ /**
39
+ * Fungible digital currencies and tokens (BTC, ETH, ERC-20 tokens, SPL tokens).
40
+ *
41
+ * Includes all blockchain-based fungible assets that serve as currencies or
42
+ * utility tokens. Does not include NFTs or DeFi positions (use specific types for those).
43
+ */
2
44
  CRYPTOCURRENCY = "CRYPTOCURRENCY",
45
+ /**
46
+ * Equity securities in publicly traded companies (AAPL, TSLA, etc.).
47
+ *
48
+ * Represents ownership shares in corporations. Sourced from traditional
49
+ * exchanges (NYSE, NASDAQ) via brokerages like Robinhood or Kraken.
50
+ */
3
51
  STOCK = "STOCK",
52
+ /**
53
+ * Exchange-Traded Funds - baskets of securities trading on exchanges (SPY, QQQ).
54
+ *
55
+ * Investment funds that track indices, commodities, or asset baskets and
56
+ * trade like stocks on traditional exchanges.
57
+ */
4
58
  ETF = "ETF",
59
+ /**
60
+ * Mutual funds - professionally managed investment portfolios.
61
+ *
62
+ * Pooled investment vehicles typically accessed through brokerages,
63
+ * not traded on exchanges. Examples: VTSAX, FXAIX.
64
+ */
5
65
  MUTUAL_FUND = "MUTUAL_FUND",
66
+ /**
67
+ * Fixed-income debt securities (government bonds, corporate bonds).
68
+ *
69
+ * Instruments representing loans to governments or corporations with
70
+ * defined interest payments and maturity dates.
71
+ */
6
72
  BOND = "BOND",
73
+ /**
74
+ * Physical goods or raw materials (gold, oil, wheat).
75
+ *
76
+ * Tangible assets traded on commodity exchanges or held as commodities-backed
77
+ * instruments. Includes precious metals, energy, agricultural products.
78
+ */
7
79
  COMMODITY = "COMMODITY",
80
+ /**
81
+ * Government-issued currencies (USD, EUR, JPY).
82
+ *
83
+ * Traditional fiat money held in brokerage cash accounts or wallets.
84
+ * Represents purchasing power in sovereign currencies.
85
+ */
8
86
  FIAT = "FIAT",
87
+ /**
88
+ * Non-fungible tokens - unique digital assets (ERC-721, ERC-1155, Solana NFTs).
89
+ *
90
+ * Blockchain-based unique or semi-fungible assets with distinct identities.
91
+ * Includes art, collectibles, gaming assets, membership tokens.
92
+ */
9
93
  NFT = "NFT",
94
+ /**
95
+ * Financial instruments deriving value from underlying assets (options, futures).
96
+ *
97
+ * Contracts whose value depends on underlying securities, indices, or commodities.
98
+ * Includes options, futures, swaps, and structured products.
99
+ */
10
100
  DERIVATIVE = "DERIVATIVE",
101
+ /**
102
+ * DeFi liquidity pool positions (Uniswap V2/V3 LP, Curve LP tokens).
103
+ *
104
+ * Represents shares in automated market maker (AMM) liquidity pools.
105
+ * These are yield-generating positions, not base assets.
106
+ */
11
107
  LIQUIDITY_POOL = "LIQUIDITY_POOL",
108
+ /**
109
+ * Staked cryptocurrency positions (ETH 2.0 staking, validator delegations).
110
+ *
111
+ * Assets locked in proof-of-stake protocols to earn rewards.
112
+ * Includes direct staking and delegated staking positions.
113
+ */
12
114
  STAKED_POSITION = "STAKED_POSITION",
115
+ /**
116
+ * DeFi lending protocol positions (Aave deposits, Compound supplies).
117
+ *
118
+ * Assets supplied to lending protocols to earn interest.
119
+ * Represents yield-generating positions in money markets.
120
+ */
13
121
  LENDING_POSITION = "LENDING_POSITION",
122
+ /**
123
+ * Catch-all for assets not fitting standard categories.
124
+ *
125
+ * Use sparingly for genuinely novel asset types. Document the specific
126
+ * type in the asset's metadata field for future classification refinement.
127
+ */
14
128
  OTHER = "OTHER"
15
129
  }
@@ -1,16 +1,130 @@
1
+ /**
2
+ * Classification of financial asset types across all integration sources.
3
+ *
4
+ * AssetType provides standardized categorization for all tradeable, holdable, or
5
+ * stakeable instruments within the CygnusWealth ecosystem. This enum serves as
6
+ * the primary taxonomy for asset classification across CEX, DEX, traditional
7
+ * finance, and DeFi sources.
8
+ *
9
+ * **Design Rationale:**
10
+ * - Covers both traditional finance (stocks, bonds) and crypto (tokens, NFTs, DeFi positions)
11
+ * - Distinguishes between base assets and derivative/yield-generating positions
12
+ * - Extensible via OTHER for edge cases without breaking existing types
13
+ *
14
+ * **Integration Guidance:**
15
+ * - Integration domains should map external classifications to these types
16
+ * - When in doubt between similar types, prefer more specific (e.g., NFT over CRYPTOCURRENCY)
17
+ * - Use metadata field for preserving source-specific asset classifications
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Mapping external asset types
22
+ * function mapRobinhoodAsset(rhAsset: any): AssetType {
23
+ * switch (rhAsset.type) {
24
+ * case 'stock': return AssetType.STOCK;
25
+ * case 'cryptocurrency': return AssetType.CRYPTOCURRENCY;
26
+ * case 'etp': return AssetType.ETF;
27
+ * default: return AssetType.OTHER;
28
+ * }
29
+ * }
30
+ * ```
31
+ *
32
+ * @since 0.0.1
33
+ * @stability core
34
+ *
35
+ * @see {@link Asset} for usage in asset models
36
+ */
1
37
  export var AssetType;
2
38
  (function (AssetType) {
39
+ /**
40
+ * Fungible digital currencies and tokens (BTC, ETH, ERC-20 tokens, SPL tokens).
41
+ *
42
+ * Includes all blockchain-based fungible assets that serve as currencies or
43
+ * utility tokens. Does not include NFTs or DeFi positions (use specific types for those).
44
+ */
3
45
  AssetType["CRYPTOCURRENCY"] = "CRYPTOCURRENCY";
46
+ /**
47
+ * Equity securities in publicly traded companies (AAPL, TSLA, etc.).
48
+ *
49
+ * Represents ownership shares in corporations. Sourced from traditional
50
+ * exchanges (NYSE, NASDAQ) via brokerages like Robinhood or Kraken.
51
+ */
4
52
  AssetType["STOCK"] = "STOCK";
53
+ /**
54
+ * Exchange-Traded Funds - baskets of securities trading on exchanges (SPY, QQQ).
55
+ *
56
+ * Investment funds that track indices, commodities, or asset baskets and
57
+ * trade like stocks on traditional exchanges.
58
+ */
5
59
  AssetType["ETF"] = "ETF";
60
+ /**
61
+ * Mutual funds - professionally managed investment portfolios.
62
+ *
63
+ * Pooled investment vehicles typically accessed through brokerages,
64
+ * not traded on exchanges. Examples: VTSAX, FXAIX.
65
+ */
6
66
  AssetType["MUTUAL_FUND"] = "MUTUAL_FUND";
67
+ /**
68
+ * Fixed-income debt securities (government bonds, corporate bonds).
69
+ *
70
+ * Instruments representing loans to governments or corporations with
71
+ * defined interest payments and maturity dates.
72
+ */
7
73
  AssetType["BOND"] = "BOND";
74
+ /**
75
+ * Physical goods or raw materials (gold, oil, wheat).
76
+ *
77
+ * Tangible assets traded on commodity exchanges or held as commodities-backed
78
+ * instruments. Includes precious metals, energy, agricultural products.
79
+ */
8
80
  AssetType["COMMODITY"] = "COMMODITY";
81
+ /**
82
+ * Government-issued currencies (USD, EUR, JPY).
83
+ *
84
+ * Traditional fiat money held in brokerage cash accounts or wallets.
85
+ * Represents purchasing power in sovereign currencies.
86
+ */
9
87
  AssetType["FIAT"] = "FIAT";
88
+ /**
89
+ * Non-fungible tokens - unique digital assets (ERC-721, ERC-1155, Solana NFTs).
90
+ *
91
+ * Blockchain-based unique or semi-fungible assets with distinct identities.
92
+ * Includes art, collectibles, gaming assets, membership tokens.
93
+ */
10
94
  AssetType["NFT"] = "NFT";
95
+ /**
96
+ * Financial instruments deriving value from underlying assets (options, futures).
97
+ *
98
+ * Contracts whose value depends on underlying securities, indices, or commodities.
99
+ * Includes options, futures, swaps, and structured products.
100
+ */
11
101
  AssetType["DERIVATIVE"] = "DERIVATIVE";
102
+ /**
103
+ * DeFi liquidity pool positions (Uniswap V2/V3 LP, Curve LP tokens).
104
+ *
105
+ * Represents shares in automated market maker (AMM) liquidity pools.
106
+ * These are yield-generating positions, not base assets.
107
+ */
12
108
  AssetType["LIQUIDITY_POOL"] = "LIQUIDITY_POOL";
109
+ /**
110
+ * Staked cryptocurrency positions (ETH 2.0 staking, validator delegations).
111
+ *
112
+ * Assets locked in proof-of-stake protocols to earn rewards.
113
+ * Includes direct staking and delegated staking positions.
114
+ */
13
115
  AssetType["STAKED_POSITION"] = "STAKED_POSITION";
116
+ /**
117
+ * DeFi lending protocol positions (Aave deposits, Compound supplies).
118
+ *
119
+ * Assets supplied to lending protocols to earn interest.
120
+ * Represents yield-generating positions in money markets.
121
+ */
14
122
  AssetType["LENDING_POSITION"] = "LENDING_POSITION";
123
+ /**
124
+ * Catch-all for assets not fitting standard categories.
125
+ *
126
+ * Use sparingly for genuinely novel asset types. Document the specific
127
+ * type in the asset's metadata field for future classification refinement.
128
+ */
15
129
  AssetType["OTHER"] = "OTHER";
16
130
  })(AssetType || (AssetType = {}));
@@ -1,12 +1,69 @@
1
+ /**
2
+ * Blockchain network identifiers for multi-chain asset tracking.
3
+ *
4
+ * Provides standardized identifiers for all supported blockchain networks.
5
+ * Enables consistent asset identification across EVM chains, alternative L1s,
6
+ * and traditional finance systems.
7
+ *
8
+ * **Design Rationale:**
9
+ * - Covers major EVM chains (Ethereum, Polygon, Arbitrum, Optimism, Avalanche, BSC, Base)
10
+ * - Includes alternative L1s (Solana, SUI, Bitcoin)
11
+ * - Extensible via OTHER for new chains without breaking changes
12
+ * - Chain-agnostic operations use Chain type for abstraction
13
+ *
14
+ * **Integration Guidance:**
15
+ * - Map chain IDs (1, 137, 42161) to these enum values in integration domains
16
+ * - Use Chain.OTHER for unsupported chains, document actual chain in metadata
17
+ * - Testnets should be distinguished in metadata, not separate enum values
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * function getChainFromId(chainId: number): Chain {
22
+ * const chainMap: Record<number, Chain> = {
23
+ * 1: Chain.ETHEREUM,
24
+ * 137: Chain.POLYGON,
25
+ * 42161: Chain.ARBITRUM,
26
+ * 10: Chain.OPTIMISM,
27
+ * 43114: Chain.AVALANCHE,
28
+ * 56: Chain.BSC,
29
+ * 8453: Chain.BASE
30
+ * };
31
+ * return chainMap[chainId] || Chain.OTHER;
32
+ * }
33
+ * ```
34
+ *
35
+ * @since 0.0.1
36
+ * @stability core
37
+ *
38
+ * @see {@link Asset} for usage in asset identification
39
+ * @see {@link Transaction} for usage in transaction tracking
40
+ */
1
41
  export declare enum Chain {
42
+ /** Ethereum mainnet (Chain ID: 1) - Primary EVM L1 */
2
43
  ETHEREUM = "ETHEREUM",
44
+ /** Polygon PoS (Chain ID: 137) - EVM sidechain for Ethereum */
3
45
  POLYGON = "POLYGON",
46
+ /** Arbitrum One (Chain ID: 42161) - Optimistic rollup L2 for Ethereum */
4
47
  ARBITRUM = "ARBITRUM",
48
+ /** Optimism (Chain ID: 10) - Optimistic rollup L2 for Ethereum */
5
49
  OPTIMISM = "OPTIMISM",
50
+ /** Avalanche C-Chain (Chain ID: 43114) - EVM-compatible L1 */
6
51
  AVALANCHE = "AVALANCHE",
52
+ /** Binance Smart Chain (Chain ID: 56) - EVM-compatible chain */
7
53
  BSC = "BSC",
54
+ /** Base (Chain ID: 8453) - Coinbase's Optimistic rollup L2 */
55
+ BASE = "BASE",
56
+ /** Solana mainnet - High-performance L1, non-EVM */
8
57
  SOLANA = "SOLANA",
58
+ /** SUI mainnet - Move-based L1, non-EVM */
9
59
  SUI = "SUI",
60
+ /** Bitcoin mainnet - Original blockchain, UTXO model */
10
61
  BITCOIN = "BITCOIN",
62
+ /**
63
+ * Unsupported or emerging chains.
64
+ *
65
+ * Use for chains not yet explicitly enumerated. Store actual chain
66
+ * identifier in asset metadata for future classification.
67
+ */
11
68
  OTHER = "OTHER"
12
69
  }
@@ -1,13 +1,70 @@
1
+ /**
2
+ * Blockchain network identifiers for multi-chain asset tracking.
3
+ *
4
+ * Provides standardized identifiers for all supported blockchain networks.
5
+ * Enables consistent asset identification across EVM chains, alternative L1s,
6
+ * and traditional finance systems.
7
+ *
8
+ * **Design Rationale:**
9
+ * - Covers major EVM chains (Ethereum, Polygon, Arbitrum, Optimism, Avalanche, BSC, Base)
10
+ * - Includes alternative L1s (Solana, SUI, Bitcoin)
11
+ * - Extensible via OTHER for new chains without breaking changes
12
+ * - Chain-agnostic operations use Chain type for abstraction
13
+ *
14
+ * **Integration Guidance:**
15
+ * - Map chain IDs (1, 137, 42161) to these enum values in integration domains
16
+ * - Use Chain.OTHER for unsupported chains, document actual chain in metadata
17
+ * - Testnets should be distinguished in metadata, not separate enum values
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * function getChainFromId(chainId: number): Chain {
22
+ * const chainMap: Record<number, Chain> = {
23
+ * 1: Chain.ETHEREUM,
24
+ * 137: Chain.POLYGON,
25
+ * 42161: Chain.ARBITRUM,
26
+ * 10: Chain.OPTIMISM,
27
+ * 43114: Chain.AVALANCHE,
28
+ * 56: Chain.BSC,
29
+ * 8453: Chain.BASE
30
+ * };
31
+ * return chainMap[chainId] || Chain.OTHER;
32
+ * }
33
+ * ```
34
+ *
35
+ * @since 0.0.1
36
+ * @stability core
37
+ *
38
+ * @see {@link Asset} for usage in asset identification
39
+ * @see {@link Transaction} for usage in transaction tracking
40
+ */
1
41
  export var Chain;
2
42
  (function (Chain) {
43
+ /** Ethereum mainnet (Chain ID: 1) - Primary EVM L1 */
3
44
  Chain["ETHEREUM"] = "ETHEREUM";
45
+ /** Polygon PoS (Chain ID: 137) - EVM sidechain for Ethereum */
4
46
  Chain["POLYGON"] = "POLYGON";
47
+ /** Arbitrum One (Chain ID: 42161) - Optimistic rollup L2 for Ethereum */
5
48
  Chain["ARBITRUM"] = "ARBITRUM";
49
+ /** Optimism (Chain ID: 10) - Optimistic rollup L2 for Ethereum */
6
50
  Chain["OPTIMISM"] = "OPTIMISM";
51
+ /** Avalanche C-Chain (Chain ID: 43114) - EVM-compatible L1 */
7
52
  Chain["AVALANCHE"] = "AVALANCHE";
53
+ /** Binance Smart Chain (Chain ID: 56) - EVM-compatible chain */
8
54
  Chain["BSC"] = "BSC";
55
+ /** Base (Chain ID: 8453) - Coinbase's Optimistic rollup L2 */
56
+ Chain["BASE"] = "BASE";
57
+ /** Solana mainnet - High-performance L1, non-EVM */
9
58
  Chain["SOLANA"] = "SOLANA";
59
+ /** SUI mainnet - Move-based L1, non-EVM */
10
60
  Chain["SUI"] = "SUI";
61
+ /** Bitcoin mainnet - Original blockchain, UTXO model */
11
62
  Chain["BITCOIN"] = "BITCOIN";
63
+ /**
64
+ * Unsupported or emerging chains.
65
+ *
66
+ * Use for chains not yet explicitly enumerated. Store actual chain
67
+ * identifier in asset metadata for future classification.
68
+ */
12
69
  Chain["OTHER"] = "OTHER";
13
70
  })(Chain || (Chain = {}));
@@ -1,18 +1,65 @@
1
+ /**
2
+ * Data source identifiers for integration traceability.
3
+ *
4
+ * Tracks origin of data flowing through the system, enabling source-specific
5
+ * logic, validation, and troubleshooting. This comprehensive enum covers centralized
6
+ * exchanges (CEXs), decentralized exchanges (DEXs), wallet providers, and manual entries.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { IntegrationSource } from '@cygnus-wealth/data-models';
11
+ *
12
+ * // Identify data source for routing logic
13
+ * function processAccountData(source: IntegrationSource) {
14
+ * switch(source) {
15
+ * case IntegrationSource.ROBINHOOD:
16
+ * return fetchCEXData();
17
+ * case IntegrationSource.UNISWAP:
18
+ * return fetchDEXData();
19
+ * case IntegrationSource.METAMASK:
20
+ * return fetchWalletData();
21
+ * default:
22
+ * return fetchGenericData();
23
+ * }
24
+ * }
25
+ * ```
26
+ *
27
+ * @since 0.0.1
28
+ * @stability standard
29
+ */
1
30
  export declare enum IntegrationSource {
31
+ /** Robinhood centralized exchange */
2
32
  ROBINHOOD = "ROBINHOOD",
33
+ /** Kraken centralized exchange */
3
34
  KRAKEN = "KRAKEN",
35
+ /** Coinbase centralized exchange */
4
36
  COINBASE = "COINBASE",
37
+ /** Binance centralized exchange */
5
38
  BINANCE = "BINANCE",
39
+ /** Uniswap decentralized exchange */
6
40
  UNISWAP = "UNISWAP",
41
+ /** SushiSwap decentralized exchange */
7
42
  SUSHISWAP = "SUSHISWAP",
43
+ /** PancakeSwap decentralized exchange */
8
44
  PANCAKESWAP = "PANCAKESWAP",
45
+ /** Curve Finance decentralized exchange */
9
46
  CURVE = "CURVE",
47
+ /** Balancer decentralized exchange */
10
48
  BALANCER = "BALANCER",
49
+ /** MetaMask wallet provider */
11
50
  METAMASK = "METAMASK",
51
+ /** Rabby wallet provider */
12
52
  RABBY = "RABBY",
53
+ /** Phantom wallet provider (Solana) */
13
54
  PHANTOM = "PHANTOM",
55
+ /** Slush wallet provider (SUI) */
14
56
  SLUSH = "SLUSH",
57
+ /** Suiet wallet provider (SUI) */
58
+ SUIET = "SUIET",
59
+ /** Manually entered data by user */
15
60
  MANUAL_ENTRY = "MANUAL_ENTRY",
61
+ /** Data fetched directly from blockchain via RPC */
16
62
  BLOCKCHAIN_DIRECT = "BLOCKCHAIN_DIRECT",
63
+ /** Other or unclassified data source */
17
64
  OTHER = "OTHER"
18
65
  }
@@ -1,23 +1,66 @@
1
+ /**
2
+ * Data source identifiers for integration traceability.
3
+ *
4
+ * Tracks origin of data flowing through the system, enabling source-specific
5
+ * logic, validation, and troubleshooting. This comprehensive enum covers centralized
6
+ * exchanges (CEXs), decentralized exchanges (DEXs), wallet providers, and manual entries.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { IntegrationSource } from '@cygnus-wealth/data-models';
11
+ *
12
+ * // Identify data source for routing logic
13
+ * function processAccountData(source: IntegrationSource) {
14
+ * switch(source) {
15
+ * case IntegrationSource.ROBINHOOD:
16
+ * return fetchCEXData();
17
+ * case IntegrationSource.UNISWAP:
18
+ * return fetchDEXData();
19
+ * case IntegrationSource.METAMASK:
20
+ * return fetchWalletData();
21
+ * default:
22
+ * return fetchGenericData();
23
+ * }
24
+ * }
25
+ * ```
26
+ *
27
+ * @since 0.0.1
28
+ * @stability standard
29
+ */
1
30
  export var IntegrationSource;
2
31
  (function (IntegrationSource) {
3
- // CEXs
32
+ /** Robinhood centralized exchange */
4
33
  IntegrationSource["ROBINHOOD"] = "ROBINHOOD";
34
+ /** Kraken centralized exchange */
5
35
  IntegrationSource["KRAKEN"] = "KRAKEN";
36
+ /** Coinbase centralized exchange */
6
37
  IntegrationSource["COINBASE"] = "COINBASE";
38
+ /** Binance centralized exchange */
7
39
  IntegrationSource["BINANCE"] = "BINANCE";
8
- // DEXs
40
+ /** Uniswap decentralized exchange */
9
41
  IntegrationSource["UNISWAP"] = "UNISWAP";
42
+ /** SushiSwap decentralized exchange */
10
43
  IntegrationSource["SUSHISWAP"] = "SUSHISWAP";
44
+ /** PancakeSwap decentralized exchange */
11
45
  IntegrationSource["PANCAKESWAP"] = "PANCAKESWAP";
46
+ /** Curve Finance decentralized exchange */
12
47
  IntegrationSource["CURVE"] = "CURVE";
48
+ /** Balancer decentralized exchange */
13
49
  IntegrationSource["BALANCER"] = "BALANCER";
14
- // Wallets
50
+ /** MetaMask wallet provider */
15
51
  IntegrationSource["METAMASK"] = "METAMASK";
52
+ /** Rabby wallet provider */
16
53
  IntegrationSource["RABBY"] = "RABBY";
54
+ /** Phantom wallet provider (Solana) */
17
55
  IntegrationSource["PHANTOM"] = "PHANTOM";
56
+ /** Slush wallet provider (SUI) */
18
57
  IntegrationSource["SLUSH"] = "SLUSH";
19
- // Other
58
+ /** Suiet wallet provider (SUI) */
59
+ IntegrationSource["SUIET"] = "SUIET";
60
+ /** Manually entered data by user */
20
61
  IntegrationSource["MANUAL_ENTRY"] = "MANUAL_ENTRY";
62
+ /** Data fetched directly from blockchain via RPC */
21
63
  IntegrationSource["BLOCKCHAIN_DIRECT"] = "BLOCKCHAIN_DIRECT";
64
+ /** Other or unclassified data source */
22
65
  IntegrationSource["OTHER"] = "OTHER";
23
66
  })(IntegrationSource || (IntegrationSource = {}));
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Type of lending position: supply (lender) or borrow (borrower).
3
+ *
4
+ * Discriminates between assets deposited to earn interest (SUPPLY) and
5
+ * assets borrowed while paying interest (BORROW) in DeFi lending protocols.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { LendingPositionType } from '@cygnus-wealth/data-models';
10
+ *
11
+ * const supplyType = LendingPositionType.SUPPLY;
12
+ * const borrowType = LendingPositionType.BORROW;
13
+ * ```
14
+ *
15
+ * @since 0.2.0
16
+ * @stability core
17
+ *
18
+ * @see {@link LendingPosition} for usage in lending positions
19
+ */
20
+ export declare enum LendingPositionType {
21
+ /** User supplied assets earning interest (lender) */
22
+ SUPPLY = "SUPPLY",
23
+ /** User borrowed assets paying interest (borrower) */
24
+ BORROW = "BORROW"
25
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Type of lending position: supply (lender) or borrow (borrower).
3
+ *
4
+ * Discriminates between assets deposited to earn interest (SUPPLY) and
5
+ * assets borrowed while paying interest (BORROW) in DeFi lending protocols.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { LendingPositionType } from '@cygnus-wealth/data-models';
10
+ *
11
+ * const supplyType = LendingPositionType.SUPPLY;
12
+ * const borrowType = LendingPositionType.BORROW;
13
+ * ```
14
+ *
15
+ * @since 0.2.0
16
+ * @stability core
17
+ *
18
+ * @see {@link LendingPosition} for usage in lending positions
19
+ */
20
+ export var LendingPositionType;
21
+ (function (LendingPositionType) {
22
+ /** User supplied assets earning interest (lender) */
23
+ LendingPositionType["SUPPLY"] = "SUPPLY";
24
+ /** User borrowed assets paying interest (borrower) */
25
+ LendingPositionType["BORROW"] = "BORROW";
26
+ })(LendingPositionType || (LendingPositionType = {}));
@@ -1,21 +1,71 @@
1
+ /**
2
+ * Standardized transaction type classification.
3
+ *
4
+ * Unified categorization for all financial operations across CEX, DEX,
5
+ * blockchain transfers, and DeFi protocols. Enables consistent transaction
6
+ * history and analytics across all integration sources.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { TransactionType } from '@cygnus-wealth/data-models';
11
+ *
12
+ * // Classify transaction based on operation
13
+ * function getTransactionIcon(type: TransactionType): string {
14
+ * switch(type) {
15
+ * case TransactionType.BUY:
16
+ * return '📈';
17
+ * case TransactionType.SELL:
18
+ * return '📉';
19
+ * case TransactionType.STAKE:
20
+ * return '🔒';
21
+ * case TransactionType.SWAP:
22
+ * return '🔄';
23
+ * default:
24
+ * return '📄';
25
+ * }
26
+ * }
27
+ * ```
28
+ *
29
+ * @since 0.0.1
30
+ * @stability standard
31
+ */
1
32
  export declare enum TransactionType {
33
+ /** Purchase of an asset with fiat or another asset */
2
34
  BUY = "BUY",
35
+ /** Sale of an asset for fiat or another asset */
3
36
  SELL = "SELL",
37
+ /** Incoming transfer of assets to account */
4
38
  TRANSFER_IN = "TRANSFER_IN",
39
+ /** Outgoing transfer of assets from account */
5
40
  TRANSFER_OUT = "TRANSFER_OUT",
41
+ /** Exchange of one asset for another via DEX or CEX */
6
42
  SWAP = "SWAP",
43
+ /** Locking assets for staking rewards */
7
44
  STAKE = "STAKE",
45
+ /** Unlocking previously staked assets */
8
46
  UNSTAKE = "UNSTAKE",
47
+ /** Claiming earned staking or liquidity rewards */
9
48
  CLAIM_REWARD = "CLAIM_REWARD",
49
+ /** Adding assets to a liquidity pool */
10
50
  PROVIDE_LIQUIDITY = "PROVIDE_LIQUIDITY",
51
+ /** Removing assets from a liquidity pool */
11
52
  REMOVE_LIQUIDITY = "REMOVE_LIQUIDITY",
53
+ /** Borrowing assets from a lending protocol */
12
54
  BORROW = "BORROW",
55
+ /** Repaying borrowed assets to a lending protocol */
13
56
  REPAY = "REPAY",
57
+ /** Forced liquidation of collateralized position */
14
58
  LIQUIDATION = "LIQUIDATION",
59
+ /** Creation of new tokens (NFT minting, token minting) */
15
60
  MINT = "MINT",
61
+ /** Destruction of tokens */
16
62
  BURN = "BURN",
63
+ /** Transaction fee payment */
17
64
  FEE = "FEE",
65
+ /** Dividend payment received */
18
66
  DIVIDEND = "DIVIDEND",
67
+ /** Interest payment received or paid */
19
68
  INTEREST = "INTEREST",
69
+ /** Other or unclassified transaction type */
20
70
  OTHER = "OTHER"
21
71
  }