@cygnus-wealth/data-models 1.2.0 → 1.4.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 (85) hide show
  1. package/dist/cjs/enums/ChainFamily.js +54 -0
  2. package/dist/cjs/enums/DeFiDiscoverySource.js +37 -0
  3. package/dist/cjs/enums/DeFiPositionType.js +39 -0
  4. package/dist/cjs/enums/DeFiProtocol.js +46 -0
  5. package/dist/cjs/enums/IntegrationSource.js +8 -0
  6. package/dist/cjs/index.js +9 -1
  7. package/dist/cjs/interfaces/AccountAssetEntry.js +2 -0
  8. package/dist/cjs/interfaces/AccountBalanceList.js +2 -0
  9. package/dist/cjs/interfaces/AccountGroup.js +2 -0
  10. package/dist/cjs/interfaces/AccountMetadata.js +2 -0
  11. package/dist/cjs/interfaces/AccountPortfolio.js +2 -0
  12. package/dist/cjs/interfaces/AccountSummary.js +2 -0
  13. package/dist/cjs/interfaces/AddressRequest.js +2 -0
  14. package/dist/cjs/interfaces/AssetDistribution.js +2 -0
  15. package/dist/cjs/interfaces/ConnectedAccount.js +2 -0
  16. package/dist/cjs/interfaces/DeFiPosition.js +2 -0
  17. package/dist/cjs/interfaces/GroupPortfolio.js +2 -0
  18. package/dist/cjs/interfaces/TrackedAddress.js +2 -0
  19. package/dist/cjs/interfaces/WalletConnection.js +2 -0
  20. package/dist/cjs/interfaces/WalletPortfolio.js +2 -0
  21. package/dist/cjs/interfaces/WatchAddress.js +2 -0
  22. package/dist/cjs/types/AccountId.js +2 -0
  23. package/dist/cjs/types/Caip2ChainId.js +2 -0
  24. package/dist/cjs/types/WalletConnectionId.js +2 -0
  25. package/dist/cjs/types/WalletProviderId.js +2 -0
  26. package/dist/enums/ChainFamily.d.ts +50 -0
  27. package/dist/enums/ChainFamily.js +51 -0
  28. package/dist/enums/DeFiDiscoverySource.d.ts +33 -0
  29. package/dist/enums/DeFiDiscoverySource.js +34 -0
  30. package/dist/enums/DeFiPositionType.d.ts +35 -0
  31. package/dist/enums/DeFiPositionType.js +36 -0
  32. package/dist/enums/DeFiProtocol.d.ts +42 -0
  33. package/dist/enums/DeFiProtocol.js +43 -0
  34. package/dist/enums/IntegrationSource.d.ts +8 -0
  35. package/dist/enums/IntegrationSource.js +8 -0
  36. package/dist/index.d.ts +23 -0
  37. package/dist/index.js +4 -0
  38. package/dist/interfaces/AccountAssetEntry.d.ts +42 -0
  39. package/dist/interfaces/AccountAssetEntry.js +1 -0
  40. package/dist/interfaces/AccountBalanceList.d.ts +85 -0
  41. package/dist/interfaces/AccountBalanceList.js +1 -0
  42. package/dist/interfaces/AccountGroup.d.ts +37 -0
  43. package/dist/interfaces/AccountGroup.js +1 -0
  44. package/dist/interfaces/AccountMetadata.d.ts +54 -0
  45. package/dist/interfaces/AccountMetadata.js +1 -0
  46. package/dist/interfaces/AccountPortfolio.d.ts +47 -0
  47. package/dist/interfaces/AccountPortfolio.js +1 -0
  48. package/dist/interfaces/AccountSummary.d.ts +49 -0
  49. package/dist/interfaces/AccountSummary.js +1 -0
  50. package/dist/interfaces/AddressRequest.d.ts +36 -0
  51. package/dist/interfaces/AddressRequest.js +1 -0
  52. package/dist/interfaces/Asset.d.ts +6 -0
  53. package/dist/interfaces/AssetDistribution.d.ts +45 -0
  54. package/dist/interfaces/AssetDistribution.js +1 -0
  55. package/dist/interfaces/ConnectedAccount.d.ts +52 -0
  56. package/dist/interfaces/ConnectedAccount.js +1 -0
  57. package/dist/interfaces/DeFiPosition.d.ts +79 -0
  58. package/dist/interfaces/DeFiPosition.js +1 -0
  59. package/dist/interfaces/FilterOptions.d.ts +8 -0
  60. package/dist/interfaces/GroupPortfolio.d.ts +39 -0
  61. package/dist/interfaces/GroupPortfolio.js +1 -0
  62. package/dist/interfaces/IntegrationCredentials.d.ts +3 -0
  63. package/dist/interfaces/LendingPosition.d.ts +3 -0
  64. package/dist/interfaces/LiquidityPosition.d.ts +3 -0
  65. package/dist/interfaces/Portfolio.d.ts +8 -0
  66. package/dist/interfaces/StakedPosition.d.ts +3 -0
  67. package/dist/interfaces/TrackedAddress.d.ts +50 -0
  68. package/dist/interfaces/TrackedAddress.js +1 -0
  69. package/dist/interfaces/Transaction.d.ts +3 -0
  70. package/dist/interfaces/VaultPosition.d.ts +3 -0
  71. package/dist/interfaces/WalletConnection.d.ts +67 -0
  72. package/dist/interfaces/WalletConnection.js +1 -0
  73. package/dist/interfaces/WalletPortfolio.d.ts +40 -0
  74. package/dist/interfaces/WalletPortfolio.js +1 -0
  75. package/dist/interfaces/WatchAddress.d.ts +42 -0
  76. package/dist/interfaces/WatchAddress.js +1 -0
  77. package/dist/types/AccountId.d.ts +27 -0
  78. package/dist/types/AccountId.js +1 -0
  79. package/dist/types/Caip2ChainId.d.ts +27 -0
  80. package/dist/types/Caip2ChainId.js +1 -0
  81. package/dist/types/WalletConnectionId.d.ts +19 -0
  82. package/dist/types/WalletConnectionId.js +1 -0
  83. package/dist/types/WalletProviderId.d.ts +17 -0
  84. package/dist/types/WalletProviderId.js +1 -0
  85. package/package.json +26 -1
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChainFamily = void 0;
4
+ /**
5
+ * Classification of blockchain protocol families.
6
+ *
7
+ * Groups blockchain networks by their underlying protocol family rather than
8
+ * individual chain identity. Used for routing (which integration handles which
9
+ * addresses), discovery (which standard detects which providers), and display
10
+ * (chain family badges in UI).
11
+ *
12
+ * `ChainFamily` is distinct from `Chain` — a chain family contains multiple
13
+ * chains (e.g., EVM family includes Ethereum, Polygon, Arbitrum, etc.).
14
+ *
15
+ * This is a closed enum. Adding new families requires Enterprise Architecture
16
+ * approval, a new integration bounded context, and correlation registry entries.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import { ChainFamily } from '@cygnus-wealth/data-models';
21
+ *
22
+ * // Route address to correct integration
23
+ * function getIntegration(family: ChainFamily) {
24
+ * switch (family) {
25
+ * case ChainFamily.EVM:
26
+ * return evmIntegration;
27
+ * case ChainFamily.SOLANA:
28
+ * return solIntegration;
29
+ * default:
30
+ * throw new Error(`No integration for ${family}`);
31
+ * }
32
+ * }
33
+ * ```
34
+ *
35
+ * @since 1.5.0
36
+ * @stability extended
37
+ *
38
+ * @see {@link Chain} for specific chain identification within a family
39
+ */
40
+ var ChainFamily;
41
+ (function (ChainFamily) {
42
+ /** EVM-compatible chains (Ethereum, Polygon, Arbitrum, Optimism, Avalanche, BSC, Base) */
43
+ ChainFamily["EVM"] = "evm";
44
+ /** Solana mainnet */
45
+ ChainFamily["SOLANA"] = "solana";
46
+ /** SUI mainnet (Move-based L1) */
47
+ ChainFamily["SUI"] = "sui";
48
+ /** Bitcoin mainnet (UTXO model) */
49
+ ChainFamily["BITCOIN"] = "bitcoin";
50
+ /** Cosmos ecosystem chains (Cosmos Hub, Osmosis, etc.) */
51
+ ChainFamily["COSMOS"] = "cosmos";
52
+ /** Aptos mainnet (Move-based L1) */
53
+ ChainFamily["APTOS"] = "aptos";
54
+ })(ChainFamily || (exports.ChainFamily = ChainFamily = {}));
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeFiDiscoverySource = void 0;
4
+ /**
5
+ * How a DeFi position was discovered during portfolio scanning.
6
+ *
7
+ * Distinguishes between positions found by scanning wallet token balances
8
+ * (receipt tokens like aTokens, cTokens, LP tokens) versus positions found
9
+ * by querying protocol smart contract state directly.
10
+ *
11
+ * This distinction matters for reconciliation: wallet-scanned positions are
12
+ * inferred from token holdings, while contract-queried positions come from
13
+ * authoritative on-chain state.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { DeFiDiscoverySource } from '@cygnus-wealth/data-models';
18
+ *
19
+ * // Found aUSDC in wallet — infer Aave supply position
20
+ * const walletDiscovered = DeFiDiscoverySource.WALLET_TOKEN_SCAN;
21
+ *
22
+ * // Queried Aave LendingPool.getUserAccountData() directly
23
+ * const contractDiscovered = DeFiDiscoverySource.CONTRACT_QUERY;
24
+ * ```
25
+ *
26
+ * @since 1.3.0
27
+ * @stability extended
28
+ *
29
+ * @see {@link DeFiPosition} for usage in position interfaces
30
+ */
31
+ var DeFiDiscoverySource;
32
+ (function (DeFiDiscoverySource) {
33
+ /** Position inferred from receipt/derivative tokens found in wallet balance scan */
34
+ DeFiDiscoverySource["WALLET_TOKEN_SCAN"] = "WALLET_TOKEN_SCAN";
35
+ /** Position discovered by querying protocol smart contract state directly */
36
+ DeFiDiscoverySource["CONTRACT_QUERY"] = "CONTRACT_QUERY";
37
+ })(DeFiDiscoverySource || (exports.DeFiDiscoverySource = DeFiDiscoverySource = {}));
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeFiPositionType = void 0;
4
+ /**
5
+ * Classification of DeFi position types across protocols.
6
+ *
7
+ * Provides a unified taxonomy for all DeFi position categories, enabling
8
+ * consistent categorization regardless of the specific protocol. Used as
9
+ * a discriminator on the base {@link DeFiPosition} interface.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { DeFiPositionType } from '@cygnus-wealth/data-models';
14
+ *
15
+ * const positionType = DeFiPositionType.VAULT;
16
+ * ```
17
+ *
18
+ * @since 1.3.0
19
+ * @stability extended
20
+ *
21
+ * @see {@link DeFiPosition} for usage in the base position interface
22
+ */
23
+ var DeFiPositionType;
24
+ (function (DeFiPositionType) {
25
+ /** Yield vault deposit (Yearn, Beefy, Harvest, Sommelier) */
26
+ DeFiPositionType["VAULT"] = "VAULT";
27
+ /** Lending protocol supply position (Aave, Compound — depositing to earn interest) */
28
+ DeFiPositionType["LENDING_SUPPLY"] = "LENDING_SUPPLY";
29
+ /** Lending protocol borrow position (Aave, Compound — borrowing against collateral) */
30
+ DeFiPositionType["LENDING_BORROW"] = "LENDING_BORROW";
31
+ /** AMM liquidity pool position (Uniswap, Curve, Balancer) */
32
+ DeFiPositionType["LIQUIDITY_POOL"] = "LIQUIDITY_POOL";
33
+ /** Proof-of-stake or liquid staking position (Lido, Rocket Pool, native staking) */
34
+ DeFiPositionType["STAKING"] = "STAKING";
35
+ /** Yield farming / incentive mining position (LP rewards, token emissions) */
36
+ DeFiPositionType["FARMING"] = "FARMING";
37
+ /** Perpetual futures or leveraged position (Jupiter, GMX, dYdX) */
38
+ DeFiPositionType["PERP_POSITION"] = "PERP_POSITION";
39
+ })(DeFiPositionType || (exports.DeFiPositionType = DeFiPositionType = {}));
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeFiProtocol = void 0;
4
+ /**
5
+ * Well-known DeFi protocol identifiers for position attribution.
6
+ *
7
+ * Provides standardized identifiers for major DeFi protocols across chains.
8
+ * Extensible via OTHER for protocols not yet explicitly enumerated.
9
+ * Protocol-specific version info (e.g., "Aave V3") should be stored in
10
+ * position metadata rather than the enum.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { DeFiProtocol } from '@cygnus-wealth/data-models';
15
+ *
16
+ * const protocol = DeFiProtocol.AAVE;
17
+ * ```
18
+ *
19
+ * @since 1.3.0
20
+ * @stability extended
21
+ *
22
+ * @see {@link DeFiPosition} for usage in position interfaces
23
+ */
24
+ var DeFiProtocol;
25
+ (function (DeFiProtocol) {
26
+ /** Beefy Finance — multi-chain yield optimizer / auto-compounder */
27
+ DeFiProtocol["BEEFY"] = "BEEFY";
28
+ /** Aave — decentralized lending and borrowing protocol */
29
+ DeFiProtocol["AAVE"] = "AAVE";
30
+ /** Uniswap — Ethereum-native AMM / DEX */
31
+ DeFiProtocol["UNISWAP"] = "UNISWAP";
32
+ /** Compound — algorithmic money market protocol */
33
+ DeFiProtocol["COMPOUND"] = "COMPOUND";
34
+ /** Lido — liquid staking for Ethereum and other PoS chains */
35
+ DeFiProtocol["LIDO"] = "LIDO";
36
+ /** Marinade Finance — liquid staking for Solana */
37
+ DeFiProtocol["MARINADE"] = "MARINADE";
38
+ /** Raydium — Solana AMM and liquidity provider */
39
+ DeFiProtocol["RAYDIUM"] = "RAYDIUM";
40
+ /** Jupiter — Solana DEX aggregator and perps platform */
41
+ DeFiProtocol["JUPITER"] = "JUPITER";
42
+ /** Orca — Solana concentrated liquidity DEX */
43
+ DeFiProtocol["ORCA"] = "ORCA";
44
+ /** Protocol not covered by other values; store name in metadata */
45
+ DeFiProtocol["OTHER"] = "OTHER";
46
+ })(DeFiProtocol || (exports.DeFiProtocol = DeFiProtocol = {}));
@@ -64,6 +64,14 @@ var IntegrationSource;
64
64
  IntegrationSource["MANUAL_ENTRY"] = "MANUAL_ENTRY";
65
65
  /** Data fetched directly from blockchain via RPC */
66
66
  IntegrationSource["BLOCKCHAIN_DIRECT"] = "BLOCKCHAIN_DIRECT";
67
+ /** SUI blockchain integration */
68
+ IntegrationSource["SUI"] = "SUI";
69
+ /** Bitcoin blockchain integration */
70
+ IntegrationSource["BITCOIN"] = "BITCOIN";
71
+ /** Cosmos ecosystem integration */
72
+ IntegrationSource["COSMOS"] = "COSMOS";
73
+ /** Aptos blockchain integration */
74
+ IntegrationSource["APTOS"] = "APTOS";
67
75
  /** Other or unclassified data source */
68
76
  IntegrationSource["OTHER"] = "OTHER";
69
77
  })(IntegrationSource || (exports.IntegrationSource = IntegrationSource = {}));
package/dist/cjs/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VaultStrategyType = exports.LendingPositionType = exports.AccountType = exports.TransactionType = exports.IntegrationSource = exports.Chain = exports.AssetType = void 0;
3
+ exports.DeFiDiscoverySource = exports.DeFiProtocol = exports.DeFiPositionType = exports.VaultStrategyType = exports.LendingPositionType = exports.AccountType = exports.TransactionType = exports.IntegrationSource = exports.ChainFamily = exports.Chain = exports.AssetType = void 0;
4
4
  // Enums
5
5
  var AssetType_1 = require("./enums/AssetType");
6
6
  Object.defineProperty(exports, "AssetType", { enumerable: true, get: function () { return AssetType_1.AssetType; } });
7
7
  var Chain_1 = require("./enums/Chain");
8
8
  Object.defineProperty(exports, "Chain", { enumerable: true, get: function () { return Chain_1.Chain; } });
9
+ var ChainFamily_1 = require("./enums/ChainFamily");
10
+ Object.defineProperty(exports, "ChainFamily", { enumerable: true, get: function () { return ChainFamily_1.ChainFamily; } });
9
11
  var IntegrationSource_1 = require("./enums/IntegrationSource");
10
12
  Object.defineProperty(exports, "IntegrationSource", { enumerable: true, get: function () { return IntegrationSource_1.IntegrationSource; } });
11
13
  var TransactionType_1 = require("./enums/TransactionType");
@@ -16,3 +18,9 @@ var LendingPositionType_1 = require("./enums/LendingPositionType");
16
18
  Object.defineProperty(exports, "LendingPositionType", { enumerable: true, get: function () { return LendingPositionType_1.LendingPositionType; } });
17
19
  var VaultStrategyType_1 = require("./enums/VaultStrategyType");
18
20
  Object.defineProperty(exports, "VaultStrategyType", { enumerable: true, get: function () { return VaultStrategyType_1.VaultStrategyType; } });
21
+ var DeFiPositionType_1 = require("./enums/DeFiPositionType");
22
+ Object.defineProperty(exports, "DeFiPositionType", { enumerable: true, get: function () { return DeFiPositionType_1.DeFiPositionType; } });
23
+ var DeFiProtocol_1 = require("./enums/DeFiProtocol");
24
+ Object.defineProperty(exports, "DeFiProtocol", { enumerable: true, get: function () { return DeFiProtocol_1.DeFiProtocol; } });
25
+ var DeFiDiscoverySource_1 = require("./enums/DeFiDiscoverySource");
26
+ Object.defineProperty(exports, "DeFiDiscoverySource", { enumerable: true, get: function () { return DeFiDiscoverySource_1.DeFiDiscoverySource; } });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Classification of blockchain protocol families.
3
+ *
4
+ * Groups blockchain networks by their underlying protocol family rather than
5
+ * individual chain identity. Used for routing (which integration handles which
6
+ * addresses), discovery (which standard detects which providers), and display
7
+ * (chain family badges in UI).
8
+ *
9
+ * `ChainFamily` is distinct from `Chain` — a chain family contains multiple
10
+ * chains (e.g., EVM family includes Ethereum, Polygon, Arbitrum, etc.).
11
+ *
12
+ * This is a closed enum. Adding new families requires Enterprise Architecture
13
+ * approval, a new integration bounded context, and correlation registry entries.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { ChainFamily } from '@cygnus-wealth/data-models';
18
+ *
19
+ * // Route address to correct integration
20
+ * function getIntegration(family: ChainFamily) {
21
+ * switch (family) {
22
+ * case ChainFamily.EVM:
23
+ * return evmIntegration;
24
+ * case ChainFamily.SOLANA:
25
+ * return solIntegration;
26
+ * default:
27
+ * throw new Error(`No integration for ${family}`);
28
+ * }
29
+ * }
30
+ * ```
31
+ *
32
+ * @since 1.5.0
33
+ * @stability extended
34
+ *
35
+ * @see {@link Chain} for specific chain identification within a family
36
+ */
37
+ export declare enum ChainFamily {
38
+ /** EVM-compatible chains (Ethereum, Polygon, Arbitrum, Optimism, Avalanche, BSC, Base) */
39
+ EVM = "evm",
40
+ /** Solana mainnet */
41
+ SOLANA = "solana",
42
+ /** SUI mainnet (Move-based L1) */
43
+ SUI = "sui",
44
+ /** Bitcoin mainnet (UTXO model) */
45
+ BITCOIN = "bitcoin",
46
+ /** Cosmos ecosystem chains (Cosmos Hub, Osmosis, etc.) */
47
+ COSMOS = "cosmos",
48
+ /** Aptos mainnet (Move-based L1) */
49
+ APTOS = "aptos"
50
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Classification of blockchain protocol families.
3
+ *
4
+ * Groups blockchain networks by their underlying protocol family rather than
5
+ * individual chain identity. Used for routing (which integration handles which
6
+ * addresses), discovery (which standard detects which providers), and display
7
+ * (chain family badges in UI).
8
+ *
9
+ * `ChainFamily` is distinct from `Chain` — a chain family contains multiple
10
+ * chains (e.g., EVM family includes Ethereum, Polygon, Arbitrum, etc.).
11
+ *
12
+ * This is a closed enum. Adding new families requires Enterprise Architecture
13
+ * approval, a new integration bounded context, and correlation registry entries.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { ChainFamily } from '@cygnus-wealth/data-models';
18
+ *
19
+ * // Route address to correct integration
20
+ * function getIntegration(family: ChainFamily) {
21
+ * switch (family) {
22
+ * case ChainFamily.EVM:
23
+ * return evmIntegration;
24
+ * case ChainFamily.SOLANA:
25
+ * return solIntegration;
26
+ * default:
27
+ * throw new Error(`No integration for ${family}`);
28
+ * }
29
+ * }
30
+ * ```
31
+ *
32
+ * @since 1.5.0
33
+ * @stability extended
34
+ *
35
+ * @see {@link Chain} for specific chain identification within a family
36
+ */
37
+ export var ChainFamily;
38
+ (function (ChainFamily) {
39
+ /** EVM-compatible chains (Ethereum, Polygon, Arbitrum, Optimism, Avalanche, BSC, Base) */
40
+ ChainFamily["EVM"] = "evm";
41
+ /** Solana mainnet */
42
+ ChainFamily["SOLANA"] = "solana";
43
+ /** SUI mainnet (Move-based L1) */
44
+ ChainFamily["SUI"] = "sui";
45
+ /** Bitcoin mainnet (UTXO model) */
46
+ ChainFamily["BITCOIN"] = "bitcoin";
47
+ /** Cosmos ecosystem chains (Cosmos Hub, Osmosis, etc.) */
48
+ ChainFamily["COSMOS"] = "cosmos";
49
+ /** Aptos mainnet (Move-based L1) */
50
+ ChainFamily["APTOS"] = "aptos";
51
+ })(ChainFamily || (ChainFamily = {}));
@@ -0,0 +1,33 @@
1
+ /**
2
+ * How a DeFi position was discovered during portfolio scanning.
3
+ *
4
+ * Distinguishes between positions found by scanning wallet token balances
5
+ * (receipt tokens like aTokens, cTokens, LP tokens) versus positions found
6
+ * by querying protocol smart contract state directly.
7
+ *
8
+ * This distinction matters for reconciliation: wallet-scanned positions are
9
+ * inferred from token holdings, while contract-queried positions come from
10
+ * authoritative on-chain state.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { DeFiDiscoverySource } from '@cygnus-wealth/data-models';
15
+ *
16
+ * // Found aUSDC in wallet — infer Aave supply position
17
+ * const walletDiscovered = DeFiDiscoverySource.WALLET_TOKEN_SCAN;
18
+ *
19
+ * // Queried Aave LendingPool.getUserAccountData() directly
20
+ * const contractDiscovered = DeFiDiscoverySource.CONTRACT_QUERY;
21
+ * ```
22
+ *
23
+ * @since 1.3.0
24
+ * @stability extended
25
+ *
26
+ * @see {@link DeFiPosition} for usage in position interfaces
27
+ */
28
+ export declare enum DeFiDiscoverySource {
29
+ /** Position inferred from receipt/derivative tokens found in wallet balance scan */
30
+ WALLET_TOKEN_SCAN = "WALLET_TOKEN_SCAN",
31
+ /** Position discovered by querying protocol smart contract state directly */
32
+ CONTRACT_QUERY = "CONTRACT_QUERY"
33
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * How a DeFi position was discovered during portfolio scanning.
3
+ *
4
+ * Distinguishes between positions found by scanning wallet token balances
5
+ * (receipt tokens like aTokens, cTokens, LP tokens) versus positions found
6
+ * by querying protocol smart contract state directly.
7
+ *
8
+ * This distinction matters for reconciliation: wallet-scanned positions are
9
+ * inferred from token holdings, while contract-queried positions come from
10
+ * authoritative on-chain state.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { DeFiDiscoverySource } from '@cygnus-wealth/data-models';
15
+ *
16
+ * // Found aUSDC in wallet — infer Aave supply position
17
+ * const walletDiscovered = DeFiDiscoverySource.WALLET_TOKEN_SCAN;
18
+ *
19
+ * // Queried Aave LendingPool.getUserAccountData() directly
20
+ * const contractDiscovered = DeFiDiscoverySource.CONTRACT_QUERY;
21
+ * ```
22
+ *
23
+ * @since 1.3.0
24
+ * @stability extended
25
+ *
26
+ * @see {@link DeFiPosition} for usage in position interfaces
27
+ */
28
+ export var DeFiDiscoverySource;
29
+ (function (DeFiDiscoverySource) {
30
+ /** Position inferred from receipt/derivative tokens found in wallet balance scan */
31
+ DeFiDiscoverySource["WALLET_TOKEN_SCAN"] = "WALLET_TOKEN_SCAN";
32
+ /** Position discovered by querying protocol smart contract state directly */
33
+ DeFiDiscoverySource["CONTRACT_QUERY"] = "CONTRACT_QUERY";
34
+ })(DeFiDiscoverySource || (DeFiDiscoverySource = {}));
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Classification of DeFi position types across protocols.
3
+ *
4
+ * Provides a unified taxonomy for all DeFi position categories, enabling
5
+ * consistent categorization regardless of the specific protocol. Used as
6
+ * a discriminator on the base {@link DeFiPosition} interface.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { DeFiPositionType } from '@cygnus-wealth/data-models';
11
+ *
12
+ * const positionType = DeFiPositionType.VAULT;
13
+ * ```
14
+ *
15
+ * @since 1.3.0
16
+ * @stability extended
17
+ *
18
+ * @see {@link DeFiPosition} for usage in the base position interface
19
+ */
20
+ export declare enum DeFiPositionType {
21
+ /** Yield vault deposit (Yearn, Beefy, Harvest, Sommelier) */
22
+ VAULT = "VAULT",
23
+ /** Lending protocol supply position (Aave, Compound — depositing to earn interest) */
24
+ LENDING_SUPPLY = "LENDING_SUPPLY",
25
+ /** Lending protocol borrow position (Aave, Compound — borrowing against collateral) */
26
+ LENDING_BORROW = "LENDING_BORROW",
27
+ /** AMM liquidity pool position (Uniswap, Curve, Balancer) */
28
+ LIQUIDITY_POOL = "LIQUIDITY_POOL",
29
+ /** Proof-of-stake or liquid staking position (Lido, Rocket Pool, native staking) */
30
+ STAKING = "STAKING",
31
+ /** Yield farming / incentive mining position (LP rewards, token emissions) */
32
+ FARMING = "FARMING",
33
+ /** Perpetual futures or leveraged position (Jupiter, GMX, dYdX) */
34
+ PERP_POSITION = "PERP_POSITION"
35
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Classification of DeFi position types across protocols.
3
+ *
4
+ * Provides a unified taxonomy for all DeFi position categories, enabling
5
+ * consistent categorization regardless of the specific protocol. Used as
6
+ * a discriminator on the base {@link DeFiPosition} interface.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { DeFiPositionType } from '@cygnus-wealth/data-models';
11
+ *
12
+ * const positionType = DeFiPositionType.VAULT;
13
+ * ```
14
+ *
15
+ * @since 1.3.0
16
+ * @stability extended
17
+ *
18
+ * @see {@link DeFiPosition} for usage in the base position interface
19
+ */
20
+ export var DeFiPositionType;
21
+ (function (DeFiPositionType) {
22
+ /** Yield vault deposit (Yearn, Beefy, Harvest, Sommelier) */
23
+ DeFiPositionType["VAULT"] = "VAULT";
24
+ /** Lending protocol supply position (Aave, Compound — depositing to earn interest) */
25
+ DeFiPositionType["LENDING_SUPPLY"] = "LENDING_SUPPLY";
26
+ /** Lending protocol borrow position (Aave, Compound — borrowing against collateral) */
27
+ DeFiPositionType["LENDING_BORROW"] = "LENDING_BORROW";
28
+ /** AMM liquidity pool position (Uniswap, Curve, Balancer) */
29
+ DeFiPositionType["LIQUIDITY_POOL"] = "LIQUIDITY_POOL";
30
+ /** Proof-of-stake or liquid staking position (Lido, Rocket Pool, native staking) */
31
+ DeFiPositionType["STAKING"] = "STAKING";
32
+ /** Yield farming / incentive mining position (LP rewards, token emissions) */
33
+ DeFiPositionType["FARMING"] = "FARMING";
34
+ /** Perpetual futures or leveraged position (Jupiter, GMX, dYdX) */
35
+ DeFiPositionType["PERP_POSITION"] = "PERP_POSITION";
36
+ })(DeFiPositionType || (DeFiPositionType = {}));
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Well-known DeFi protocol identifiers for position attribution.
3
+ *
4
+ * Provides standardized identifiers for major DeFi protocols across chains.
5
+ * Extensible via OTHER for protocols not yet explicitly enumerated.
6
+ * Protocol-specific version info (e.g., "Aave V3") should be stored in
7
+ * position metadata rather than the enum.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { DeFiProtocol } from '@cygnus-wealth/data-models';
12
+ *
13
+ * const protocol = DeFiProtocol.AAVE;
14
+ * ```
15
+ *
16
+ * @since 1.3.0
17
+ * @stability extended
18
+ *
19
+ * @see {@link DeFiPosition} for usage in position interfaces
20
+ */
21
+ export declare enum DeFiProtocol {
22
+ /** Beefy Finance — multi-chain yield optimizer / auto-compounder */
23
+ BEEFY = "BEEFY",
24
+ /** Aave — decentralized lending and borrowing protocol */
25
+ AAVE = "AAVE",
26
+ /** Uniswap — Ethereum-native AMM / DEX */
27
+ UNISWAP = "UNISWAP",
28
+ /** Compound — algorithmic money market protocol */
29
+ COMPOUND = "COMPOUND",
30
+ /** Lido — liquid staking for Ethereum and other PoS chains */
31
+ LIDO = "LIDO",
32
+ /** Marinade Finance — liquid staking for Solana */
33
+ MARINADE = "MARINADE",
34
+ /** Raydium — Solana AMM and liquidity provider */
35
+ RAYDIUM = "RAYDIUM",
36
+ /** Jupiter — Solana DEX aggregator and perps platform */
37
+ JUPITER = "JUPITER",
38
+ /** Orca — Solana concentrated liquidity DEX */
39
+ ORCA = "ORCA",
40
+ /** Protocol not covered by other values; store name in metadata */
41
+ OTHER = "OTHER"
42
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Well-known DeFi protocol identifiers for position attribution.
3
+ *
4
+ * Provides standardized identifiers for major DeFi protocols across chains.
5
+ * Extensible via OTHER for protocols not yet explicitly enumerated.
6
+ * Protocol-specific version info (e.g., "Aave V3") should be stored in
7
+ * position metadata rather than the enum.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { DeFiProtocol } from '@cygnus-wealth/data-models';
12
+ *
13
+ * const protocol = DeFiProtocol.AAVE;
14
+ * ```
15
+ *
16
+ * @since 1.3.0
17
+ * @stability extended
18
+ *
19
+ * @see {@link DeFiPosition} for usage in position interfaces
20
+ */
21
+ export var DeFiProtocol;
22
+ (function (DeFiProtocol) {
23
+ /** Beefy Finance — multi-chain yield optimizer / auto-compounder */
24
+ DeFiProtocol["BEEFY"] = "BEEFY";
25
+ /** Aave — decentralized lending and borrowing protocol */
26
+ DeFiProtocol["AAVE"] = "AAVE";
27
+ /** Uniswap — Ethereum-native AMM / DEX */
28
+ DeFiProtocol["UNISWAP"] = "UNISWAP";
29
+ /** Compound — algorithmic money market protocol */
30
+ DeFiProtocol["COMPOUND"] = "COMPOUND";
31
+ /** Lido — liquid staking for Ethereum and other PoS chains */
32
+ DeFiProtocol["LIDO"] = "LIDO";
33
+ /** Marinade Finance — liquid staking for Solana */
34
+ DeFiProtocol["MARINADE"] = "MARINADE";
35
+ /** Raydium — Solana AMM and liquidity provider */
36
+ DeFiProtocol["RAYDIUM"] = "RAYDIUM";
37
+ /** Jupiter — Solana DEX aggregator and perps platform */
38
+ DeFiProtocol["JUPITER"] = "JUPITER";
39
+ /** Orca — Solana concentrated liquidity DEX */
40
+ DeFiProtocol["ORCA"] = "ORCA";
41
+ /** Protocol not covered by other values; store name in metadata */
42
+ DeFiProtocol["OTHER"] = "OTHER";
43
+ })(DeFiProtocol || (DeFiProtocol = {}));
@@ -60,6 +60,14 @@ export declare enum IntegrationSource {
60
60
  MANUAL_ENTRY = "MANUAL_ENTRY",
61
61
  /** Data fetched directly from blockchain via RPC */
62
62
  BLOCKCHAIN_DIRECT = "BLOCKCHAIN_DIRECT",
63
+ /** SUI blockchain integration */
64
+ SUI = "SUI",
65
+ /** Bitcoin blockchain integration */
66
+ BITCOIN = "BITCOIN",
67
+ /** Cosmos ecosystem integration */
68
+ COSMOS = "COSMOS",
69
+ /** Aptos blockchain integration */
70
+ APTOS = "APTOS",
63
71
  /** Other or unclassified data source */
64
72
  OTHER = "OTHER"
65
73
  }