@cygnus-wealth/data-models 1.1.1 → 1.2.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/cjs/enums/AccountType.js +57 -0
- package/dist/cjs/enums/AssetType.js +133 -0
- package/dist/cjs/enums/Chain.js +73 -0
- package/dist/cjs/enums/IntegrationSource.js +69 -0
- package/dist/cjs/enums/LendingPositionType.js +29 -0
- package/dist/cjs/enums/TransactionType.js +75 -0
- package/dist/cjs/enums/VaultStrategyType.js +34 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/interfaces/Account.js +2 -0
- package/dist/cjs/interfaces/ApiError.js +2 -0
- package/dist/cjs/interfaces/ApiResponse.js +2 -0
- package/dist/cjs/interfaces/Asset.js +2 -0
- package/dist/cjs/interfaces/Balance.js +2 -0
- package/dist/cjs/interfaces/BaseEntity.js +2 -0
- package/dist/cjs/interfaces/FilterOptions.js +2 -0
- package/dist/cjs/interfaces/IntegrationCredentials.js +2 -0
- package/dist/cjs/interfaces/LendingPosition.js +2 -0
- package/dist/cjs/interfaces/LiquidityPosition.js +2 -0
- package/dist/cjs/interfaces/MarketData.js +2 -0
- package/dist/cjs/interfaces/Metadata.js +2 -0
- package/dist/cjs/interfaces/NFT.js +2 -0
- package/dist/cjs/interfaces/PaginatedResponse.js +2 -0
- package/dist/cjs/interfaces/Portfolio.js +2 -0
- package/dist/cjs/interfaces/PortfolioAsset.js +2 -0
- package/dist/cjs/interfaces/PortfolioItem.js +2 -0
- package/dist/cjs/interfaces/Price.js +2 -0
- package/dist/cjs/interfaces/StakedPosition.js +2 -0
- package/dist/cjs/interfaces/SyncStatus.js +2 -0
- package/dist/cjs/interfaces/Transaction.js +2 -0
- package/dist/cjs/interfaces/VaultPosition.js +2 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/AssetIdentifier.js +2 -0
- package/dist/cjs/types/NetworkEnvironment.js +2 -0
- package/dist/cjs/types/SortOrder.js +2 -0
- package/dist/cjs/types/TimeRange.js +2 -0
- package/dist/enums/VaultStrategyType.d.ts +30 -0
- package/dist/enums/VaultStrategyType.js +31 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/Account.d.ts +3 -0
- package/dist/interfaces/VaultPosition.d.ts +110 -0
- package/dist/interfaces/VaultPosition.js +1 -0
- package/package.json +22 -12
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Classification of account types.
|
|
6
|
+
*
|
|
7
|
+
* Categorizes account containers for display, grouping, and business logic.
|
|
8
|
+
* Enables specialized UI components and processing based on account purpose
|
|
9
|
+
* and characteristics.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { AccountType } from '@cygnus-wealth/data-models';
|
|
14
|
+
*
|
|
15
|
+
* // Route account to specialized handler
|
|
16
|
+
* function processAccount(type: AccountType) {
|
|
17
|
+
* switch(type) {
|
|
18
|
+
* case AccountType.SPOT:
|
|
19
|
+
* return processCEXSpotAccount();
|
|
20
|
+
* case AccountType.WALLET:
|
|
21
|
+
* return processWalletAccount();
|
|
22
|
+
* case AccountType.DEFI:
|
|
23
|
+
* return processDeFiPositions();
|
|
24
|
+
* case AccountType.RETIREMENT:
|
|
25
|
+
* return processTaxAdvantaged();
|
|
26
|
+
* default:
|
|
27
|
+
* return processGenericAccount();
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @since 0.0.1
|
|
33
|
+
* @stability standard
|
|
34
|
+
*/
|
|
35
|
+
var AccountType;
|
|
36
|
+
(function (AccountType) {
|
|
37
|
+
/** Spot trading account on centralized exchange */
|
|
38
|
+
AccountType["SPOT"] = "SPOT";
|
|
39
|
+
/** Margin trading account with leverage */
|
|
40
|
+
AccountType["MARGIN"] = "MARGIN";
|
|
41
|
+
/** Futures or derivatives trading account */
|
|
42
|
+
AccountType["FUTURES"] = "FUTURES";
|
|
43
|
+
/** Savings or interest-earning account */
|
|
44
|
+
AccountType["SAVINGS"] = "SAVINGS";
|
|
45
|
+
/** Staking account for proof-of-stake rewards */
|
|
46
|
+
AccountType["STAKING"] = "STAKING";
|
|
47
|
+
/** Self-custody blockchain wallet */
|
|
48
|
+
AccountType["WALLET"] = "WALLET";
|
|
49
|
+
/** DeFi protocol positions (lending, liquidity, etc.) */
|
|
50
|
+
AccountType["DEFI"] = "DEFI";
|
|
51
|
+
/** Traditional brokerage account */
|
|
52
|
+
AccountType["BROKERAGE"] = "BROKERAGE";
|
|
53
|
+
/** Tax-advantaged retirement account (IRA, 401k, etc.) */
|
|
54
|
+
AccountType["RETIREMENT"] = "RETIREMENT";
|
|
55
|
+
/** Other or unclassified account type */
|
|
56
|
+
AccountType["OTHER"] = "OTHER";
|
|
57
|
+
})(AccountType || (exports.AccountType = AccountType = {}));
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssetType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Classification of financial asset types across all integration sources.
|
|
6
|
+
*
|
|
7
|
+
* AssetType provides standardized categorization for all tradeable, holdable, or
|
|
8
|
+
* stakeable instruments within the CygnusWealth ecosystem. This enum serves as
|
|
9
|
+
* the primary taxonomy for asset classification across CEX, DEX, traditional
|
|
10
|
+
* finance, and DeFi sources.
|
|
11
|
+
*
|
|
12
|
+
* **Design Rationale:**
|
|
13
|
+
* - Covers both traditional finance (stocks, bonds) and crypto (tokens, NFTs, DeFi positions)
|
|
14
|
+
* - Distinguishes between base assets and derivative/yield-generating positions
|
|
15
|
+
* - Extensible via OTHER for edge cases without breaking existing types
|
|
16
|
+
*
|
|
17
|
+
* **Integration Guidance:**
|
|
18
|
+
* - Integration domains should map external classifications to these types
|
|
19
|
+
* - When in doubt between similar types, prefer more specific (e.g., NFT over CRYPTOCURRENCY)
|
|
20
|
+
* - Use metadata field for preserving source-specific asset classifications
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Mapping external asset types
|
|
25
|
+
* function mapRobinhoodAsset(rhAsset: any): AssetType {
|
|
26
|
+
* switch (rhAsset.type) {
|
|
27
|
+
* case 'stock': return AssetType.STOCK;
|
|
28
|
+
* case 'cryptocurrency': return AssetType.CRYPTOCURRENCY;
|
|
29
|
+
* case 'etp': return AssetType.ETF;
|
|
30
|
+
* default: return AssetType.OTHER;
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @since 0.0.1
|
|
36
|
+
* @stability core
|
|
37
|
+
*
|
|
38
|
+
* @see {@link Asset} for usage in asset models
|
|
39
|
+
*/
|
|
40
|
+
var AssetType;
|
|
41
|
+
(function (AssetType) {
|
|
42
|
+
/**
|
|
43
|
+
* Fungible digital currencies and tokens (BTC, ETH, ERC-20 tokens, SPL tokens).
|
|
44
|
+
*
|
|
45
|
+
* Includes all blockchain-based fungible assets that serve as currencies or
|
|
46
|
+
* utility tokens. Does not include NFTs or DeFi positions (use specific types for those).
|
|
47
|
+
*/
|
|
48
|
+
AssetType["CRYPTOCURRENCY"] = "CRYPTOCURRENCY";
|
|
49
|
+
/**
|
|
50
|
+
* Equity securities in publicly traded companies (AAPL, TSLA, etc.).
|
|
51
|
+
*
|
|
52
|
+
* Represents ownership shares in corporations. Sourced from traditional
|
|
53
|
+
* exchanges (NYSE, NASDAQ) via brokerages like Robinhood or Kraken.
|
|
54
|
+
*/
|
|
55
|
+
AssetType["STOCK"] = "STOCK";
|
|
56
|
+
/**
|
|
57
|
+
* Exchange-Traded Funds - baskets of securities trading on exchanges (SPY, QQQ).
|
|
58
|
+
*
|
|
59
|
+
* Investment funds that track indices, commodities, or asset baskets and
|
|
60
|
+
* trade like stocks on traditional exchanges.
|
|
61
|
+
*/
|
|
62
|
+
AssetType["ETF"] = "ETF";
|
|
63
|
+
/**
|
|
64
|
+
* Mutual funds - professionally managed investment portfolios.
|
|
65
|
+
*
|
|
66
|
+
* Pooled investment vehicles typically accessed through brokerages,
|
|
67
|
+
* not traded on exchanges. Examples: VTSAX, FXAIX.
|
|
68
|
+
*/
|
|
69
|
+
AssetType["MUTUAL_FUND"] = "MUTUAL_FUND";
|
|
70
|
+
/**
|
|
71
|
+
* Fixed-income debt securities (government bonds, corporate bonds).
|
|
72
|
+
*
|
|
73
|
+
* Instruments representing loans to governments or corporations with
|
|
74
|
+
* defined interest payments and maturity dates.
|
|
75
|
+
*/
|
|
76
|
+
AssetType["BOND"] = "BOND";
|
|
77
|
+
/**
|
|
78
|
+
* Physical goods or raw materials (gold, oil, wheat).
|
|
79
|
+
*
|
|
80
|
+
* Tangible assets traded on commodity exchanges or held as commodities-backed
|
|
81
|
+
* instruments. Includes precious metals, energy, agricultural products.
|
|
82
|
+
*/
|
|
83
|
+
AssetType["COMMODITY"] = "COMMODITY";
|
|
84
|
+
/**
|
|
85
|
+
* Government-issued currencies (USD, EUR, JPY).
|
|
86
|
+
*
|
|
87
|
+
* Traditional fiat money held in brokerage cash accounts or wallets.
|
|
88
|
+
* Represents purchasing power in sovereign currencies.
|
|
89
|
+
*/
|
|
90
|
+
AssetType["FIAT"] = "FIAT";
|
|
91
|
+
/**
|
|
92
|
+
* Non-fungible tokens - unique digital assets (ERC-721, ERC-1155, Solana NFTs).
|
|
93
|
+
*
|
|
94
|
+
* Blockchain-based unique or semi-fungible assets with distinct identities.
|
|
95
|
+
* Includes art, collectibles, gaming assets, membership tokens.
|
|
96
|
+
*/
|
|
97
|
+
AssetType["NFT"] = "NFT";
|
|
98
|
+
/**
|
|
99
|
+
* Financial instruments deriving value from underlying assets (options, futures).
|
|
100
|
+
*
|
|
101
|
+
* Contracts whose value depends on underlying securities, indices, or commodities.
|
|
102
|
+
* Includes options, futures, swaps, and structured products.
|
|
103
|
+
*/
|
|
104
|
+
AssetType["DERIVATIVE"] = "DERIVATIVE";
|
|
105
|
+
/**
|
|
106
|
+
* DeFi liquidity pool positions (Uniswap V2/V3 LP, Curve LP tokens).
|
|
107
|
+
*
|
|
108
|
+
* Represents shares in automated market maker (AMM) liquidity pools.
|
|
109
|
+
* These are yield-generating positions, not base assets.
|
|
110
|
+
*/
|
|
111
|
+
AssetType["LIQUIDITY_POOL"] = "LIQUIDITY_POOL";
|
|
112
|
+
/**
|
|
113
|
+
* Staked cryptocurrency positions (ETH 2.0 staking, validator delegations).
|
|
114
|
+
*
|
|
115
|
+
* Assets locked in proof-of-stake protocols to earn rewards.
|
|
116
|
+
* Includes direct staking and delegated staking positions.
|
|
117
|
+
*/
|
|
118
|
+
AssetType["STAKED_POSITION"] = "STAKED_POSITION";
|
|
119
|
+
/**
|
|
120
|
+
* DeFi lending protocol positions (Aave deposits, Compound supplies).
|
|
121
|
+
*
|
|
122
|
+
* Assets supplied to lending protocols to earn interest.
|
|
123
|
+
* Represents yield-generating positions in money markets.
|
|
124
|
+
*/
|
|
125
|
+
AssetType["LENDING_POSITION"] = "LENDING_POSITION";
|
|
126
|
+
/**
|
|
127
|
+
* Catch-all for assets not fitting standard categories.
|
|
128
|
+
*
|
|
129
|
+
* Use sparingly for genuinely novel asset types. Document the specific
|
|
130
|
+
* type in the asset's metadata field for future classification refinement.
|
|
131
|
+
*/
|
|
132
|
+
AssetType["OTHER"] = "OTHER";
|
|
133
|
+
})(AssetType || (exports.AssetType = AssetType = {}));
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Chain = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Blockchain network identifiers for multi-chain asset tracking.
|
|
6
|
+
*
|
|
7
|
+
* Provides standardized identifiers for all supported blockchain networks.
|
|
8
|
+
* Enables consistent asset identification across EVM chains, alternative L1s,
|
|
9
|
+
* and traditional finance systems.
|
|
10
|
+
*
|
|
11
|
+
* **Design Rationale:**
|
|
12
|
+
* - Covers major EVM chains (Ethereum, Polygon, Arbitrum, Optimism, Avalanche, BSC, Base)
|
|
13
|
+
* - Includes alternative L1s (Solana, SUI, Bitcoin)
|
|
14
|
+
* - Extensible via OTHER for new chains without breaking changes
|
|
15
|
+
* - Chain-agnostic operations use Chain type for abstraction
|
|
16
|
+
*
|
|
17
|
+
* **Integration Guidance:**
|
|
18
|
+
* - Map chain IDs (1, 137, 42161) to these enum values in integration domains
|
|
19
|
+
* - Use Chain.OTHER for unsupported chains, document actual chain in metadata
|
|
20
|
+
* - Testnets should be distinguished in metadata, not separate enum values
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* function getChainFromId(chainId: number): Chain {
|
|
25
|
+
* const chainMap: Record<number, Chain> = {
|
|
26
|
+
* 1: Chain.ETHEREUM,
|
|
27
|
+
* 137: Chain.POLYGON,
|
|
28
|
+
* 42161: Chain.ARBITRUM,
|
|
29
|
+
* 10: Chain.OPTIMISM,
|
|
30
|
+
* 43114: Chain.AVALANCHE,
|
|
31
|
+
* 56: Chain.BSC,
|
|
32
|
+
* 8453: Chain.BASE
|
|
33
|
+
* };
|
|
34
|
+
* return chainMap[chainId] || Chain.OTHER;
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @since 0.0.1
|
|
39
|
+
* @stability core
|
|
40
|
+
*
|
|
41
|
+
* @see {@link Asset} for usage in asset identification
|
|
42
|
+
* @see {@link Transaction} for usage in transaction tracking
|
|
43
|
+
*/
|
|
44
|
+
var Chain;
|
|
45
|
+
(function (Chain) {
|
|
46
|
+
/** Ethereum mainnet (Chain ID: 1) - Primary EVM L1 */
|
|
47
|
+
Chain["ETHEREUM"] = "ETHEREUM";
|
|
48
|
+
/** Polygon PoS (Chain ID: 137) - EVM sidechain for Ethereum */
|
|
49
|
+
Chain["POLYGON"] = "POLYGON";
|
|
50
|
+
/** Arbitrum One (Chain ID: 42161) - Optimistic rollup L2 for Ethereum */
|
|
51
|
+
Chain["ARBITRUM"] = "ARBITRUM";
|
|
52
|
+
/** Optimism (Chain ID: 10) - Optimistic rollup L2 for Ethereum */
|
|
53
|
+
Chain["OPTIMISM"] = "OPTIMISM";
|
|
54
|
+
/** Avalanche C-Chain (Chain ID: 43114) - EVM-compatible L1 */
|
|
55
|
+
Chain["AVALANCHE"] = "AVALANCHE";
|
|
56
|
+
/** Binance Smart Chain (Chain ID: 56) - EVM-compatible chain */
|
|
57
|
+
Chain["BSC"] = "BSC";
|
|
58
|
+
/** Base (Chain ID: 8453) - Coinbase's Optimistic rollup L2 */
|
|
59
|
+
Chain["BASE"] = "BASE";
|
|
60
|
+
/** Solana mainnet - High-performance L1, non-EVM */
|
|
61
|
+
Chain["SOLANA"] = "SOLANA";
|
|
62
|
+
/** SUI mainnet - Move-based L1, non-EVM */
|
|
63
|
+
Chain["SUI"] = "SUI";
|
|
64
|
+
/** Bitcoin mainnet - Original blockchain, UTXO model */
|
|
65
|
+
Chain["BITCOIN"] = "BITCOIN";
|
|
66
|
+
/**
|
|
67
|
+
* Unsupported or emerging chains.
|
|
68
|
+
*
|
|
69
|
+
* Use for chains not yet explicitly enumerated. Store actual chain
|
|
70
|
+
* identifier in asset metadata for future classification.
|
|
71
|
+
*/
|
|
72
|
+
Chain["OTHER"] = "OTHER";
|
|
73
|
+
})(Chain || (exports.Chain = Chain = {}));
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationSource = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Data source identifiers for integration traceability.
|
|
6
|
+
*
|
|
7
|
+
* Tracks origin of data flowing through the system, enabling source-specific
|
|
8
|
+
* logic, validation, and troubleshooting. This comprehensive enum covers centralized
|
|
9
|
+
* exchanges (CEXs), decentralized exchanges (DEXs), wallet providers, and manual entries.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { IntegrationSource } from '@cygnus-wealth/data-models';
|
|
14
|
+
*
|
|
15
|
+
* // Identify data source for routing logic
|
|
16
|
+
* function processAccountData(source: IntegrationSource) {
|
|
17
|
+
* switch(source) {
|
|
18
|
+
* case IntegrationSource.ROBINHOOD:
|
|
19
|
+
* return fetchCEXData();
|
|
20
|
+
* case IntegrationSource.UNISWAP:
|
|
21
|
+
* return fetchDEXData();
|
|
22
|
+
* case IntegrationSource.METAMASK:
|
|
23
|
+
* return fetchWalletData();
|
|
24
|
+
* default:
|
|
25
|
+
* return fetchGenericData();
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @since 0.0.1
|
|
31
|
+
* @stability standard
|
|
32
|
+
*/
|
|
33
|
+
var IntegrationSource;
|
|
34
|
+
(function (IntegrationSource) {
|
|
35
|
+
/** Robinhood centralized exchange */
|
|
36
|
+
IntegrationSource["ROBINHOOD"] = "ROBINHOOD";
|
|
37
|
+
/** Kraken centralized exchange */
|
|
38
|
+
IntegrationSource["KRAKEN"] = "KRAKEN";
|
|
39
|
+
/** Coinbase centralized exchange */
|
|
40
|
+
IntegrationSource["COINBASE"] = "COINBASE";
|
|
41
|
+
/** Binance centralized exchange */
|
|
42
|
+
IntegrationSource["BINANCE"] = "BINANCE";
|
|
43
|
+
/** Uniswap decentralized exchange */
|
|
44
|
+
IntegrationSource["UNISWAP"] = "UNISWAP";
|
|
45
|
+
/** SushiSwap decentralized exchange */
|
|
46
|
+
IntegrationSource["SUSHISWAP"] = "SUSHISWAP";
|
|
47
|
+
/** PancakeSwap decentralized exchange */
|
|
48
|
+
IntegrationSource["PANCAKESWAP"] = "PANCAKESWAP";
|
|
49
|
+
/** Curve Finance decentralized exchange */
|
|
50
|
+
IntegrationSource["CURVE"] = "CURVE";
|
|
51
|
+
/** Balancer decentralized exchange */
|
|
52
|
+
IntegrationSource["BALANCER"] = "BALANCER";
|
|
53
|
+
/** MetaMask wallet provider */
|
|
54
|
+
IntegrationSource["METAMASK"] = "METAMASK";
|
|
55
|
+
/** Rabby wallet provider */
|
|
56
|
+
IntegrationSource["RABBY"] = "RABBY";
|
|
57
|
+
/** Phantom wallet provider (Solana) */
|
|
58
|
+
IntegrationSource["PHANTOM"] = "PHANTOM";
|
|
59
|
+
/** Slush wallet provider (SUI) */
|
|
60
|
+
IntegrationSource["SLUSH"] = "SLUSH";
|
|
61
|
+
/** Suiet wallet provider (SUI) */
|
|
62
|
+
IntegrationSource["SUIET"] = "SUIET";
|
|
63
|
+
/** Manually entered data by user */
|
|
64
|
+
IntegrationSource["MANUAL_ENTRY"] = "MANUAL_ENTRY";
|
|
65
|
+
/** Data fetched directly from blockchain via RPC */
|
|
66
|
+
IntegrationSource["BLOCKCHAIN_DIRECT"] = "BLOCKCHAIN_DIRECT";
|
|
67
|
+
/** Other or unclassified data source */
|
|
68
|
+
IntegrationSource["OTHER"] = "OTHER";
|
|
69
|
+
})(IntegrationSource || (exports.IntegrationSource = IntegrationSource = {}));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LendingPositionType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Type of lending position: supply (lender) or borrow (borrower).
|
|
6
|
+
*
|
|
7
|
+
* Discriminates between assets deposited to earn interest (SUPPLY) and
|
|
8
|
+
* assets borrowed while paying interest (BORROW) in DeFi lending protocols.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { LendingPositionType } from '@cygnus-wealth/data-models';
|
|
13
|
+
*
|
|
14
|
+
* const supplyType = LendingPositionType.SUPPLY;
|
|
15
|
+
* const borrowType = LendingPositionType.BORROW;
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @since 0.2.0
|
|
19
|
+
* @stability core
|
|
20
|
+
*
|
|
21
|
+
* @see {@link LendingPosition} for usage in lending positions
|
|
22
|
+
*/
|
|
23
|
+
var LendingPositionType;
|
|
24
|
+
(function (LendingPositionType) {
|
|
25
|
+
/** User supplied assets earning interest (lender) */
|
|
26
|
+
LendingPositionType["SUPPLY"] = "SUPPLY";
|
|
27
|
+
/** User borrowed assets paying interest (borrower) */
|
|
28
|
+
LendingPositionType["BORROW"] = "BORROW";
|
|
29
|
+
})(LendingPositionType || (exports.LendingPositionType = LendingPositionType = {}));
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Standardized transaction type classification.
|
|
6
|
+
*
|
|
7
|
+
* Unified categorization for all financial operations across CEX, DEX,
|
|
8
|
+
* blockchain transfers, and DeFi protocols. Enables consistent transaction
|
|
9
|
+
* history and analytics across all integration sources.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { TransactionType } from '@cygnus-wealth/data-models';
|
|
14
|
+
*
|
|
15
|
+
* // Classify transaction based on operation
|
|
16
|
+
* function getTransactionIcon(type: TransactionType): string {
|
|
17
|
+
* switch(type) {
|
|
18
|
+
* case TransactionType.BUY:
|
|
19
|
+
* return '📈';
|
|
20
|
+
* case TransactionType.SELL:
|
|
21
|
+
* return '📉';
|
|
22
|
+
* case TransactionType.STAKE:
|
|
23
|
+
* return '🔒';
|
|
24
|
+
* case TransactionType.SWAP:
|
|
25
|
+
* return '🔄';
|
|
26
|
+
* default:
|
|
27
|
+
* return '📄';
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @since 0.0.1
|
|
33
|
+
* @stability standard
|
|
34
|
+
*/
|
|
35
|
+
var TransactionType;
|
|
36
|
+
(function (TransactionType) {
|
|
37
|
+
/** Purchase of an asset with fiat or another asset */
|
|
38
|
+
TransactionType["BUY"] = "BUY";
|
|
39
|
+
/** Sale of an asset for fiat or another asset */
|
|
40
|
+
TransactionType["SELL"] = "SELL";
|
|
41
|
+
/** Incoming transfer of assets to account */
|
|
42
|
+
TransactionType["TRANSFER_IN"] = "TRANSFER_IN";
|
|
43
|
+
/** Outgoing transfer of assets from account */
|
|
44
|
+
TransactionType["TRANSFER_OUT"] = "TRANSFER_OUT";
|
|
45
|
+
/** Exchange of one asset for another via DEX or CEX */
|
|
46
|
+
TransactionType["SWAP"] = "SWAP";
|
|
47
|
+
/** Locking assets for staking rewards */
|
|
48
|
+
TransactionType["STAKE"] = "STAKE";
|
|
49
|
+
/** Unlocking previously staked assets */
|
|
50
|
+
TransactionType["UNSTAKE"] = "UNSTAKE";
|
|
51
|
+
/** Claiming earned staking or liquidity rewards */
|
|
52
|
+
TransactionType["CLAIM_REWARD"] = "CLAIM_REWARD";
|
|
53
|
+
/** Adding assets to a liquidity pool */
|
|
54
|
+
TransactionType["PROVIDE_LIQUIDITY"] = "PROVIDE_LIQUIDITY";
|
|
55
|
+
/** Removing assets from a liquidity pool */
|
|
56
|
+
TransactionType["REMOVE_LIQUIDITY"] = "REMOVE_LIQUIDITY";
|
|
57
|
+
/** Borrowing assets from a lending protocol */
|
|
58
|
+
TransactionType["BORROW"] = "BORROW";
|
|
59
|
+
/** Repaying borrowed assets to a lending protocol */
|
|
60
|
+
TransactionType["REPAY"] = "REPAY";
|
|
61
|
+
/** Forced liquidation of collateralized position */
|
|
62
|
+
TransactionType["LIQUIDATION"] = "LIQUIDATION";
|
|
63
|
+
/** Creation of new tokens (NFT minting, token minting) */
|
|
64
|
+
TransactionType["MINT"] = "MINT";
|
|
65
|
+
/** Destruction of tokens */
|
|
66
|
+
TransactionType["BURN"] = "BURN";
|
|
67
|
+
/** Transaction fee payment */
|
|
68
|
+
TransactionType["FEE"] = "FEE";
|
|
69
|
+
/** Dividend payment received */
|
|
70
|
+
TransactionType["DIVIDEND"] = "DIVIDEND";
|
|
71
|
+
/** Interest payment received or paid */
|
|
72
|
+
TransactionType["INTEREST"] = "INTEREST";
|
|
73
|
+
/** Other or unclassified transaction type */
|
|
74
|
+
TransactionType["OTHER"] = "OTHER";
|
|
75
|
+
})(TransactionType || (exports.TransactionType = TransactionType = {}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VaultStrategyType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Strategy type for yield vault positions.
|
|
6
|
+
*
|
|
7
|
+
* Classifies the underlying strategy used by a yield vault to generate returns.
|
|
8
|
+
* Different strategy types carry different risk profiles and return characteristics.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { VaultStrategyType } from '@cygnus-wealth/data-models';
|
|
13
|
+
*
|
|
14
|
+
* const strategyType = VaultStrategyType.YIELD_AGGREGATOR;
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @since 1.2.0
|
|
18
|
+
* @stability extended
|
|
19
|
+
*
|
|
20
|
+
* @see {@link VaultPosition} for usage in vault positions
|
|
21
|
+
*/
|
|
22
|
+
var VaultStrategyType;
|
|
23
|
+
(function (VaultStrategyType) {
|
|
24
|
+
/** Auto-compounding yield aggregator (e.g., Yearn, Beefy) */
|
|
25
|
+
VaultStrategyType["YIELD_AGGREGATOR"] = "YIELD_AGGREGATOR";
|
|
26
|
+
/** Single-asset lending vault (e.g., Yearn USDC vault lending on Aave) */
|
|
27
|
+
VaultStrategyType["LENDING"] = "LENDING";
|
|
28
|
+
/** Liquidity provision strategy (vault deposits into LP pools) */
|
|
29
|
+
VaultStrategyType["LIQUIDITY_PROVISION"] = "LIQUIDITY_PROVISION";
|
|
30
|
+
/** Delta-neutral or options-based structured product */
|
|
31
|
+
VaultStrategyType["STRUCTURED_PRODUCT"] = "STRUCTURED_PRODUCT";
|
|
32
|
+
/** Strategy type not covered by other categories */
|
|
33
|
+
VaultStrategyType["OTHER"] = "OTHER";
|
|
34
|
+
})(VaultStrategyType || (exports.VaultStrategyType = VaultStrategyType = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VaultStrategyType = exports.LendingPositionType = exports.AccountType = exports.TransactionType = exports.IntegrationSource = exports.Chain = exports.AssetType = void 0;
|
|
4
|
+
// Enums
|
|
5
|
+
var AssetType_1 = require("./enums/AssetType");
|
|
6
|
+
Object.defineProperty(exports, "AssetType", { enumerable: true, get: function () { return AssetType_1.AssetType; } });
|
|
7
|
+
var Chain_1 = require("./enums/Chain");
|
|
8
|
+
Object.defineProperty(exports, "Chain", { enumerable: true, get: function () { return Chain_1.Chain; } });
|
|
9
|
+
var IntegrationSource_1 = require("./enums/IntegrationSource");
|
|
10
|
+
Object.defineProperty(exports, "IntegrationSource", { enumerable: true, get: function () { return IntegrationSource_1.IntegrationSource; } });
|
|
11
|
+
var TransactionType_1 = require("./enums/TransactionType");
|
|
12
|
+
Object.defineProperty(exports, "TransactionType", { enumerable: true, get: function () { return TransactionType_1.TransactionType; } });
|
|
13
|
+
var AccountType_1 = require("./enums/AccountType");
|
|
14
|
+
Object.defineProperty(exports, "AccountType", { enumerable: true, get: function () { return AccountType_1.AccountType; } });
|
|
15
|
+
var LendingPositionType_1 = require("./enums/LendingPositionType");
|
|
16
|
+
Object.defineProperty(exports, "LendingPositionType", { enumerable: true, get: function () { return LendingPositionType_1.LendingPositionType; } });
|
|
17
|
+
var VaultStrategyType_1 = require("./enums/VaultStrategyType");
|
|
18
|
+
Object.defineProperty(exports, "VaultStrategyType", { enumerable: true, get: function () { return VaultStrategyType_1.VaultStrategyType; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy type for yield vault positions.
|
|
3
|
+
*
|
|
4
|
+
* Classifies the underlying strategy used by a yield vault to generate returns.
|
|
5
|
+
* Different strategy types carry different risk profiles and return characteristics.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { VaultStrategyType } from '@cygnus-wealth/data-models';
|
|
10
|
+
*
|
|
11
|
+
* const strategyType = VaultStrategyType.YIELD_AGGREGATOR;
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @since 1.2.0
|
|
15
|
+
* @stability extended
|
|
16
|
+
*
|
|
17
|
+
* @see {@link VaultPosition} for usage in vault positions
|
|
18
|
+
*/
|
|
19
|
+
export declare enum VaultStrategyType {
|
|
20
|
+
/** Auto-compounding yield aggregator (e.g., Yearn, Beefy) */
|
|
21
|
+
YIELD_AGGREGATOR = "YIELD_AGGREGATOR",
|
|
22
|
+
/** Single-asset lending vault (e.g., Yearn USDC vault lending on Aave) */
|
|
23
|
+
LENDING = "LENDING",
|
|
24
|
+
/** Liquidity provision strategy (vault deposits into LP pools) */
|
|
25
|
+
LIQUIDITY_PROVISION = "LIQUIDITY_PROVISION",
|
|
26
|
+
/** Delta-neutral or options-based structured product */
|
|
27
|
+
STRUCTURED_PRODUCT = "STRUCTURED_PRODUCT",
|
|
28
|
+
/** Strategy type not covered by other categories */
|
|
29
|
+
OTHER = "OTHER"
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy type for yield vault positions.
|
|
3
|
+
*
|
|
4
|
+
* Classifies the underlying strategy used by a yield vault to generate returns.
|
|
5
|
+
* Different strategy types carry different risk profiles and return characteristics.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { VaultStrategyType } from '@cygnus-wealth/data-models';
|
|
10
|
+
*
|
|
11
|
+
* const strategyType = VaultStrategyType.YIELD_AGGREGATOR;
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @since 1.2.0
|
|
15
|
+
* @stability extended
|
|
16
|
+
*
|
|
17
|
+
* @see {@link VaultPosition} for usage in vault positions
|
|
18
|
+
*/
|
|
19
|
+
export var VaultStrategyType;
|
|
20
|
+
(function (VaultStrategyType) {
|
|
21
|
+
/** Auto-compounding yield aggregator (e.g., Yearn, Beefy) */
|
|
22
|
+
VaultStrategyType["YIELD_AGGREGATOR"] = "YIELD_AGGREGATOR";
|
|
23
|
+
/** Single-asset lending vault (e.g., Yearn USDC vault lending on Aave) */
|
|
24
|
+
VaultStrategyType["LENDING"] = "LENDING";
|
|
25
|
+
/** Liquidity provision strategy (vault deposits into LP pools) */
|
|
26
|
+
VaultStrategyType["LIQUIDITY_PROVISION"] = "LIQUIDITY_PROVISION";
|
|
27
|
+
/** Delta-neutral or options-based structured product */
|
|
28
|
+
VaultStrategyType["STRUCTURED_PRODUCT"] = "STRUCTURED_PRODUCT";
|
|
29
|
+
/** Strategy type not covered by other categories */
|
|
30
|
+
VaultStrategyType["OTHER"] = "OTHER";
|
|
31
|
+
})(VaultStrategyType || (VaultStrategyType = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { IntegrationSource } from './enums/IntegrationSource';
|
|
|
4
4
|
export { TransactionType } from './enums/TransactionType';
|
|
5
5
|
export { AccountType } from './enums/AccountType';
|
|
6
6
|
export { LendingPositionType } from './enums/LendingPositionType';
|
|
7
|
+
export { VaultStrategyType } from './enums/VaultStrategyType';
|
|
7
8
|
export { BaseEntity } from './interfaces/BaseEntity';
|
|
8
9
|
export { Metadata } from './interfaces/Metadata';
|
|
9
10
|
export { Asset } from './interfaces/Asset';
|
|
@@ -14,6 +15,7 @@ export { Balance } from './interfaces/Balance';
|
|
|
14
15
|
export { LiquidityPosition } from './interfaces/LiquidityPosition';
|
|
15
16
|
export { StakedPosition } from './interfaces/StakedPosition';
|
|
16
17
|
export { LendingPosition } from './interfaces/LendingPosition';
|
|
18
|
+
export { VaultPosition } from './interfaces/VaultPosition';
|
|
17
19
|
export { Account } from './interfaces/Account';
|
|
18
20
|
export { Portfolio } from './interfaces/Portfolio';
|
|
19
21
|
export { PortfolioAsset } from './interfaces/PortfolioAsset';
|
package/dist/index.js
CHANGED
|
@@ -5,3 +5,4 @@ export { IntegrationSource } from './enums/IntegrationSource';
|
|
|
5
5
|
export { TransactionType } from './enums/TransactionType';
|
|
6
6
|
export { AccountType } from './enums/AccountType';
|
|
7
7
|
export { LendingPositionType } from './enums/LendingPositionType';
|
|
8
|
+
export { VaultStrategyType } from './enums/VaultStrategyType';
|
|
@@ -4,6 +4,7 @@ import { Balance } from './Balance';
|
|
|
4
4
|
import { LiquidityPosition } from './LiquidityPosition';
|
|
5
5
|
import { StakedPosition } from './StakedPosition';
|
|
6
6
|
import { LendingPosition } from './LendingPosition';
|
|
7
|
+
import { VaultPosition } from './VaultPosition';
|
|
7
8
|
import { NFT } from './NFT';
|
|
8
9
|
import { Price } from './Price';
|
|
9
10
|
import { Metadata } from './Metadata';
|
|
@@ -105,6 +106,8 @@ export interface Account {
|
|
|
105
106
|
stakedPositions?: StakedPosition[];
|
|
106
107
|
/** Array of lending/borrowing positions (for DeFi money markets) */
|
|
107
108
|
lendingPositions?: LendingPosition[];
|
|
109
|
+
/** Array of yield vault positions (for vault deposits) */
|
|
110
|
+
vaultPositions?: VaultPosition[];
|
|
108
111
|
/** Array of NFTs held in this account */
|
|
109
112
|
nfts?: NFT[];
|
|
110
113
|
/** Total value of all holdings in this account (sum of all positions) */
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Chain } from '../enums/Chain';
|
|
2
|
+
import { VaultStrategyType } from '../enums/VaultStrategyType';
|
|
3
|
+
import { Asset } from './Asset';
|
|
4
|
+
import { Price } from './Price';
|
|
5
|
+
import { Metadata } from './Metadata';
|
|
6
|
+
/**
|
|
7
|
+
* Yield vault deposit position tracking shares and performance.
|
|
8
|
+
*
|
|
9
|
+
* Represents user deposits in yield-generating vaults (Yearn, Beefy, Harvest,
|
|
10
|
+
* Sommelier, etc.) where assets are deposited into a vault contract that
|
|
11
|
+
* executes automated strategies. Tracks deposited amount, vault share tokens,
|
|
12
|
+
* APY, and underlying asset.
|
|
13
|
+
*
|
|
14
|
+
* **Design Pattern:** DeFi position entity for vault operations. Vaults issue
|
|
15
|
+
* share tokens representing proportional ownership. The share price (pricePerShare)
|
|
16
|
+
* increases over time as the vault earns yield, meaning the same number of shares
|
|
17
|
+
* becomes redeemable for more underlying tokens.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { VaultPosition, VaultStrategyType, Chain, AssetType } from '@cygnus-wealth/data-models';
|
|
22
|
+
*
|
|
23
|
+
* // Yearn USDC vault deposit
|
|
24
|
+
* const yearnPosition: VaultPosition = {
|
|
25
|
+
* id: 'yearn-usdc-vault-123',
|
|
26
|
+
* protocol: 'Yearn V3',
|
|
27
|
+
* vaultAddress: '0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE',
|
|
28
|
+
* vaultName: 'USDC yVault',
|
|
29
|
+
* chain: Chain.ETHEREUM,
|
|
30
|
+
* strategyType: VaultStrategyType.YIELD_AGGREGATOR,
|
|
31
|
+
* depositAsset: {
|
|
32
|
+
* id: 'ethereum-usdc',
|
|
33
|
+
* symbol: 'USDC',
|
|
34
|
+
* name: 'USD Coin',
|
|
35
|
+
* type: AssetType.CRYPTOCURRENCY,
|
|
36
|
+
* decimals: 6
|
|
37
|
+
* },
|
|
38
|
+
* depositedAmount: '50000.000000',
|
|
39
|
+
* shareBalance: '48500.000000',
|
|
40
|
+
* pricePerShare: 1.0309,
|
|
41
|
+
* apy: 8.5,
|
|
42
|
+
* value: {
|
|
43
|
+
* value: 50000,
|
|
44
|
+
* currency: 'USD',
|
|
45
|
+
* timestamp: new Date()
|
|
46
|
+
* }
|
|
47
|
+
* };
|
|
48
|
+
*
|
|
49
|
+
* // Beefy auto-compounder on Arbitrum
|
|
50
|
+
* const beefyPosition: VaultPosition = {
|
|
51
|
+
* id: 'beefy-arb-eth-usdc-456',
|
|
52
|
+
* protocol: 'Beefy',
|
|
53
|
+
* vaultAddress: '0xDeadBeef...',
|
|
54
|
+
* vaultName: 'mooArbETH-USDC',
|
|
55
|
+
* chain: Chain.ARBITRUM,
|
|
56
|
+
* strategyType: VaultStrategyType.LIQUIDITY_PROVISION,
|
|
57
|
+
* depositAsset: {
|
|
58
|
+
* id: 'arbitrum-eth',
|
|
59
|
+
* symbol: 'ETH',
|
|
60
|
+
* name: 'Ethereum',
|
|
61
|
+
* type: AssetType.CRYPTOCURRENCY,
|
|
62
|
+
* decimals: 18
|
|
63
|
+
* },
|
|
64
|
+
* depositedAmount: '2.5',
|
|
65
|
+
* shareBalance: '2.35',
|
|
66
|
+
* pricePerShare: 1.0638,
|
|
67
|
+
* apy: 12.3,
|
|
68
|
+
* value: {
|
|
69
|
+
* value: 5000,
|
|
70
|
+
* currency: 'USD',
|
|
71
|
+
* timestamp: new Date()
|
|
72
|
+
* }
|
|
73
|
+
* };
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @since 1.2.0
|
|
77
|
+
* @stability extended
|
|
78
|
+
*
|
|
79
|
+
* @see {@link VaultStrategyType} for vault strategy classification
|
|
80
|
+
* @see {@link Asset} for deposit asset definition
|
|
81
|
+
* @see {@link Account} for position aggregation
|
|
82
|
+
*/
|
|
83
|
+
export interface VaultPosition {
|
|
84
|
+
/** Unique identifier for this vault position */
|
|
85
|
+
id: string;
|
|
86
|
+
/** Vault protocol name (e.g., 'Yearn V3', 'Beefy', 'Harvest', 'Sommelier') */
|
|
87
|
+
protocol: string;
|
|
88
|
+
/** Smart contract address of the vault */
|
|
89
|
+
vaultAddress: string;
|
|
90
|
+
/** Human-readable vault name (e.g., 'USDC yVault', 'mooArbETH-USDC') */
|
|
91
|
+
vaultName: string;
|
|
92
|
+
/** Blockchain network where the vault exists */
|
|
93
|
+
chain: Chain;
|
|
94
|
+
/** Classification of the vault's underlying strategy */
|
|
95
|
+
strategyType: VaultStrategyType;
|
|
96
|
+
/** Asset deposited into the vault (the underlying token) */
|
|
97
|
+
depositAsset: Asset;
|
|
98
|
+
/** Amount of underlying asset deposited (as string for precision) */
|
|
99
|
+
depositedAmount: string;
|
|
100
|
+
/** Amount of vault share tokens held (as string for precision) */
|
|
101
|
+
shareBalance?: string;
|
|
102
|
+
/** Current price per share in terms of deposit asset (e.g., 1.03 means 3% profit) */
|
|
103
|
+
pricePerShare?: number;
|
|
104
|
+
/** Annual Percentage Yield for the vault (e.g., 8.5 = 8.5%) */
|
|
105
|
+
apy?: number;
|
|
106
|
+
/** Current total value of the vault position */
|
|
107
|
+
value?: Price;
|
|
108
|
+
/** Protocol-specific metadata (strategy details, harvest frequency, TVL, etc.) */
|
|
109
|
+
metadata?: Metadata;
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,49 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cygnus-wealth/data-models",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Shared TypeScript data models for CygnusWealth project",
|
|
5
|
-
"main": "dist/index.js",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/index.js"
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/cjs/index.js"
|
|
11
13
|
},
|
|
12
14
|
"./enums/AssetType": {
|
|
13
15
|
"types": "./dist/enums/AssetType.d.ts",
|
|
14
|
-
"import": "./dist/enums/AssetType.js"
|
|
16
|
+
"import": "./dist/enums/AssetType.js",
|
|
17
|
+
"require": "./dist/cjs/enums/AssetType.js"
|
|
15
18
|
},
|
|
16
19
|
"./enums/Chain": {
|
|
17
20
|
"types": "./dist/enums/Chain.d.ts",
|
|
18
|
-
"import": "./dist/enums/Chain.js"
|
|
21
|
+
"import": "./dist/enums/Chain.js",
|
|
22
|
+
"require": "./dist/cjs/enums/Chain.js"
|
|
19
23
|
},
|
|
20
24
|
"./enums/IntegrationSource": {
|
|
21
25
|
"types": "./dist/enums/IntegrationSource.d.ts",
|
|
22
|
-
"import": "./dist/enums/IntegrationSource.js"
|
|
26
|
+
"import": "./dist/enums/IntegrationSource.js",
|
|
27
|
+
"require": "./dist/cjs/enums/IntegrationSource.js"
|
|
23
28
|
},
|
|
24
29
|
"./enums/TransactionType": {
|
|
25
30
|
"types": "./dist/enums/TransactionType.d.ts",
|
|
26
|
-
"import": "./dist/enums/TransactionType.js"
|
|
31
|
+
"import": "./dist/enums/TransactionType.js",
|
|
32
|
+
"require": "./dist/cjs/enums/TransactionType.js"
|
|
27
33
|
},
|
|
28
34
|
"./enums/AccountType": {
|
|
29
35
|
"types": "./dist/enums/AccountType.d.ts",
|
|
30
|
-
"import": "./dist/enums/AccountType.js"
|
|
36
|
+
"import": "./dist/enums/AccountType.js",
|
|
37
|
+
"require": "./dist/cjs/enums/AccountType.js"
|
|
31
38
|
},
|
|
32
39
|
"./enums/LendingPositionType": {
|
|
33
40
|
"types": "./dist/enums/LendingPositionType.d.ts",
|
|
34
|
-
"import": "./dist/enums/LendingPositionType.js"
|
|
41
|
+
"import": "./dist/enums/LendingPositionType.js",
|
|
42
|
+
"require": "./dist/cjs/enums/LendingPositionType.js"
|
|
35
43
|
},
|
|
36
44
|
"./interfaces/*": {
|
|
37
45
|
"types": "./dist/interfaces/*.d.ts",
|
|
38
|
-
"import": "./dist/interfaces/*.js"
|
|
46
|
+
"import": "./dist/interfaces/*.js",
|
|
47
|
+
"require": "./dist/cjs/interfaces/*.js"
|
|
39
48
|
},
|
|
40
49
|
"./types/*": {
|
|
41
50
|
"types": "./dist/types/*.d.ts",
|
|
42
|
-
"import": "./dist/types/*.js"
|
|
51
|
+
"import": "./dist/types/*.js",
|
|
52
|
+
"require": "./dist/cjs/types/*.js"
|
|
43
53
|
}
|
|
44
54
|
},
|
|
45
55
|
"scripts": {
|
|
46
|
-
"build": "tsc",
|
|
56
|
+
"build": "tsc && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
47
57
|
"test": "vitest",
|
|
48
58
|
"test:run": "vitest --run",
|
|
49
59
|
"test:coverage": "vitest --coverage --run",
|