@ultrade/shared 1.0.10 → 1.0.11

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 (122) hide show
  1. package/README.md +232 -0
  2. package/dist/{src/common → common}/mappers/codexAsset.mapper.d.ts +1 -1
  3. package/dist/{src/common → common}/mappers/codexBalance.mapper.d.ts +1 -1
  4. package/dist/{src/common → common}/mappers/trade.mapper.d.ts +3 -3
  5. package/dist/{src/helpers → helpers}/assert.helper.d.ts +2 -2
  6. package/dist/{src/helpers → helpers}/balance.helper.d.ts +3 -3
  7. package/dist/{src/helpers → helpers}/order.helper.d.ts +1 -1
  8. package/dist/{src/helpers → helpers}/pair.helper.d.ts +1 -1
  9. package/dist/{src/helpers → helpers}/pointSystem.helper.d.ts +1 -1
  10. package/dist/{src/helpers → helpers}/withdraw.helper.d.ts +1 -1
  11. package/dist/{src/interfaces → interfaces}/accountInfo.interface.d.ts +2 -2
  12. package/dist/{src/interfaces → interfaces}/api/affiliate.interface.d.ts +1 -1
  13. package/dist/{src/interfaces → interfaces}/cache.interface.d.ts +1 -1
  14. package/dist/{src/interfaces → interfaces}/db/hummingbot/index.d.ts +2 -2
  15. package/dist/{src/interfaces → interfaces}/db/market/index.d.ts +2 -2
  16. package/dist/{src/interfaces → interfaces}/db/notification_center/index.d.ts +2 -2
  17. package/dist/{src/interfaces → interfaces}/db/relayer/index.d.ts +2 -2
  18. package/dist/{src/interfaces → interfaces}/db/social/index.d.ts +2 -2
  19. package/dist/{src/interfaces → interfaces}/db/white_label/index.d.ts +2 -2
  20. package/dist/{src/interfaces → interfaces}/db/withdrawal_wallets/index.d.ts +1 -1
  21. package/dist/{src/interfaces → interfaces}/dto/index.d.ts +1 -1
  22. package/dist/{src/interfaces → interfaces}/last-look-trade.interface.d.ts +1 -1
  23. package/dist/{src/interfaces → interfaces}/order.interface.d.ts +2 -2
  24. package/dist/{src/interfaces → interfaces}/services/accountCache.interface.d.ts +2 -2
  25. package/dist/{src/interfaces → interfaces}/services/balances.interface.d.ts +1 -1
  26. package/dist/{src/interfaces → interfaces}/services/price-model.interface.d.ts +1 -1
  27. package/dist/{src/interfaces → interfaces}/services/price-service.interface.d.ts +1 -1
  28. package/dist/{src/interfaces → interfaces}/services/socialActivity.interface.d.ts +1 -1
  29. package/dist/{src/interfaces → interfaces}/streaming.interface.d.ts +2 -2
  30. package/dist/{src/interfaces → interfaces}/trading.interface.d.ts +2 -2
  31. package/dist/{src/interfaces → interfaces}/tradingKey.interface.d.ts +1 -1
  32. package/dist/{src/interfaces → interfaces}/wallet.interface.d.ts +1 -1
  33. package/dist/{src/interfaces → interfaces}/withdrawalWallets.interface.d.ts +1 -1
  34. package/dist/{src/types → types}/amm/amm.d.ts +1 -1
  35. package/dist/{src/types → types}/hummingbots.types.d.ts +1 -1
  36. package/dist/{src/types → types}/notification.type.d.ts +1 -1
  37. package/dist/{src/types → types}/state.type.d.ts +1 -1
  38. package/package.json +13 -8
  39. /package/dist/{src/common → common}/auth.helper.d.ts +0 -0
  40. /package/dist/{src/common → common}/big-number.helper.d.ts +0 -0
  41. /package/dist/{src/common → common}/index.d.ts +0 -0
  42. /package/dist/{src/common → common}/mappers/index.d.ts +0 -0
  43. /package/dist/{src/common → common}/utils/assert.d.ts +0 -0
  44. /package/dist/{src/common → common}/utils/decode.d.ts +0 -0
  45. /package/dist/{src/common → common}/utils/index.d.ts +0 -0
  46. /package/dist/{src/common → common}/utils/social.d.ts +0 -0
  47. /package/dist/{src/common → common}/utils/stat.d.ts +0 -0
  48. /package/dist/{src/constants → constants}/auth.d.ts +0 -0
  49. /package/dist/{src/constants → constants}/cctp.d.ts +0 -0
  50. /package/dist/{src/constants → constants}/codex.d.ts +0 -0
  51. /package/dist/{src/constants → constants}/index.d.ts +0 -0
  52. /package/dist/{src/constants → constants}/response.d.ts +0 -0
  53. /package/dist/{src/constants → constants}/settings.d.ts +0 -0
  54. /package/dist/{src/constants → constants}/withdrawalWalletsMessage.d.ts +0 -0
  55. /package/dist/{src/enums → enums}/chains.enum.d.ts +0 -0
  56. /package/dist/{src/enums → enums}/db/account/index.d.ts +0 -0
  57. /package/dist/{src/enums → enums}/db/affiliate.enum.d.ts +0 -0
  58. /package/dist/{src/enums → enums}/db/available-pair-settings.enum.d.ts +0 -0
  59. /package/dist/{src/enums → enums}/db/common.enum.d.ts +0 -0
  60. /package/dist/{src/enums → enums}/db/component/index.d.ts +0 -0
  61. /package/dist/{src/enums → enums}/db/index.d.ts +0 -0
  62. /package/dist/{src/enums → enums}/db/market-maker.enum.d.ts +0 -0
  63. /package/dist/{src/enums → enums}/db/notification-center/userNotification.enum.d.ts +0 -0
  64. /package/dist/{src/enums → enums}/db/order-side.enum.d.ts +0 -0
  65. /package/dist/{src/enums → enums}/db/order-status.enum.d.ts +0 -0
  66. /package/dist/{src/enums → enums}/db/order-type.enum.d.ts +0 -0
  67. /package/dist/{src/enums → enums}/db/relayer.enum.d.ts +0 -0
  68. /package/dist/{src/enums → enums}/db/setting-type.enum.d.ts +0 -0
  69. /package/dist/{src/enums → enums}/db/social-action.enum.d.ts +0 -0
  70. /package/dist/{src/enums → enums}/db/social-prompt.enum.d.ts +0 -0
  71. /package/dist/{src/enums → enums}/db/social.enum.d.ts +0 -0
  72. /package/dist/{src/enums → enums}/db/state-type.enum.d.ts +0 -0
  73. /package/dist/{src/enums → enums}/db/trade.enums.d.ts +0 -0
  74. /package/dist/{src/enums → enums}/db/tradingKeyType.enum.d.ts +0 -0
  75. /package/dist/{src/enums → enums}/db/upgrade.enum.d.ts +0 -0
  76. /package/dist/{src/enums → enums}/db/withdrawal-wallet.enum.d.ts +0 -0
  77. /package/dist/{src/enums → enums}/index.d.ts +0 -0
  78. /package/dist/{src/enums → enums}/maintenanceMode.enum.d.ts +0 -0
  79. /package/dist/{src/enums → enums}/notification.enum.d.ts +0 -0
  80. /package/dist/{src/enums → enums}/rabbitMq.d.ts +0 -0
  81. /package/dist/{src/enums → enums}/social.enum.d.ts +0 -0
  82. /package/dist/{src/helpers → helpers}/Encoding.d.ts +0 -0
  83. /package/dist/{src/helpers → helpers}/algo.helper.d.ts +0 -0
  84. /package/dist/{src/helpers → helpers}/atomic.helper.d.ts +0 -0
  85. /package/dist/{src/helpers → helpers}/codex/common.helper.d.ts +0 -0
  86. /package/dist/{src/helpers → helpers}/codex/index.d.ts +0 -0
  87. /package/dist/{src/helpers → helpers}/codex/mbr.helper.d.ts +0 -0
  88. /package/dist/{src/helpers → helpers}/codex/mna.helper.d.ts +0 -0
  89. /package/dist/{src/helpers → helpers}/codex/order.helper.d.ts +0 -0
  90. /package/dist/{src/helpers → helpers}/codex/setGlobal.helper.d.ts +0 -0
  91. /package/dist/{src/helpers → helpers}/codex/transfer.helper.d.ts +0 -0
  92. /package/dist/{src/helpers → helpers}/codex/txn.helper.d.ts +0 -0
  93. /package/dist/{src/helpers → helpers}/codex.helper.d.ts +0 -0
  94. /package/dist/{src/helpers → helpers}/eth.helper.d.ts +0 -0
  95. /package/dist/{src/helpers → helpers}/index.d.ts +0 -0
  96. /package/dist/{src/helpers → helpers}/interval.helpers.d.ts +0 -0
  97. /package/dist/{src/helpers → helpers}/liquidity.helper.d.ts +0 -0
  98. /package/dist/{src/helpers → helpers}/ticker.helpers.d.ts +0 -0
  99. /package/dist/{src/helpers → helpers}/vaa.helper.d.ts +0 -0
  100. /package/dist/{src/interfaces → interfaces}/api/index.d.ts +0 -0
  101. /package/dist/{src/interfaces → interfaces}/db/baseModel.interface.d.ts +0 -0
  102. /package/dist/{src/interfaces → interfaces}/db/index.d.ts +0 -0
  103. /package/dist/{src/interfaces → interfaces}/db/marketing/index.d.ts +0 -0
  104. /package/dist/{src/interfaces → interfaces}/db/softDeleteModel.interface.d.ts +0 -0
  105. /package/dist/{src/interfaces → interfaces}/emailService.interface.d.ts +0 -0
  106. /package/dist/{src/interfaces → interfaces}/index.d.ts +0 -0
  107. /package/dist/{src/interfaces → interfaces}/kmsService.interface.d.ts +0 -0
  108. /package/dist/{src/interfaces → interfaces}/market.interface.d.ts +0 -0
  109. /package/dist/{src/interfaces → interfaces}/pagination.interface.d.ts +0 -0
  110. /package/dist/{src/interfaces → interfaces}/pair.interface.d.ts +0 -0
  111. /package/dist/{src/interfaces → interfaces}/query.interface.d.ts +0 -0
  112. /package/dist/{src/interfaces → interfaces}/services/algod.interface.d.ts +0 -0
  113. /package/dist/{src/interfaces → interfaces}/services/coin-market-cap.interface.d.ts +0 -0
  114. /package/dist/{src/interfaces → interfaces}/services/index.d.ts +0 -0
  115. /package/dist/{src/interfaces → interfaces}/services/tmc.interface.d.ts +0 -0
  116. /package/dist/{src/interfaces → interfaces}/timestream.interface.d.ts +0 -0
  117. /package/dist/{src/interfaces → interfaces}/transfer.interface.d.ts +0 -0
  118. /package/dist/{src/types → types}/algo-order.type.d.ts +0 -0
  119. /package/dist/{src/types → types}/api/request.types.d.ts +0 -0
  120. /package/dist/{src/types → types}/codex.types.d.ts +0 -0
  121. /package/dist/{src/types → types}/index.d.ts +0 -0
  122. /package/dist/{src/types → types}/settings.type.d.ts +0 -0
package/README.md ADDED
@@ -0,0 +1,232 @@
1
+ # @ultrade/shared
2
+
3
+ Shared code, utilities, and types for Ultrade platform packages. Supports both Node.js and browser environments.
4
+
5
+ **Repository:** [https://github.com/ultrade-org/ultrade-shared](https://github.com/ultrade-org/ultrade-shared)
6
+
7
+ ## Package Info
8
+
9
+ - **Name:** `@ultrade/shared`
10
+ - **Dual Build:** Browser and Node.js builds
11
+
12
+ ## Installation
13
+
14
+ Install the package using your preferred package manager:
15
+
16
+ ```bash
17
+ npm install @ultrade/shared
18
+ ```
19
+
20
+ ```bash
21
+ yarn add @ultrade/shared
22
+ ```
23
+
24
+ ```bash
25
+ pnpm add @ultrade/shared
26
+ ```
27
+
28
+ ## TypeScript Configuration
29
+
30
+ For proper type resolution and convenient development, you need to configure your `tsconfig.json` correctly.
31
+
32
+ ### Recommended Configuration
33
+
34
+ The configuration should be able to resolve types that account for the `exports` field in `package.json`:
35
+
36
+ ```json
37
+ {
38
+ "compilerOptions": {
39
+ "moduleResolution": "nodenext"
40
+ // Alternative options: "node16" or "bundler"
41
+ }
42
+ }
43
+ ```
44
+
45
+ ### Alternative: Manual Path Configuration
46
+
47
+ If you cannot change your TypeScript settings, you can explicitly specify paths:
48
+
49
+ ```json
50
+ {
51
+ "compilerOptions": {
52
+ "paths": {
53
+ "@ultrade/shared/browser/*": ["../shared/dist/browser/*"],
54
+ "@ultrade/shared/node/*": ["../shared/dist/node/*"]
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Structure
61
+
62
+ ```
63
+ src/
64
+ ├── common/ # Common utilities (shared between browser/node)
65
+ │ ├── auth.helper.ts # Authentication helpers
66
+ │ ├── big-number.helper.ts # BigNumber utilities
67
+ │ ├── mappers/ # Data mapping utilities
68
+ │ │ ├── amm.mappers.ts
69
+ │ │ ├── order.mappers.ts
70
+ │ │ ├── pair.mappers.ts
71
+ │ │ └── vip.mappers.ts
72
+ │ ├── utils/ # Common utility functions
73
+ │ │ ├── auth.utils.ts
74
+ │ │ ├── common.utils.ts
75
+ │ │ ├── decimal.utils.ts
76
+ │ │ ├── errors.utils.ts
77
+ │ │ └── validation.utils.ts
78
+ │ └── index.ts
79
+
80
+ ├── constants/ # Constants
81
+ │ ├── allowedUrls.ts
82
+ │ ├── auth.ts
83
+ │ ├── cctp.ts # Cross-Chain Transfer Protocol
84
+ │ ├── codex.ts
85
+ │ ├── env.ts
86
+ │ ├── response.ts
87
+ │ ├── settings.ts
88
+ │ ├── social.ts
89
+ │ ├── withdrawalWalletsMessage.ts
90
+ │ └── index.ts
91
+
92
+ ├── enums/ # Enumerations
93
+ │ ├── chains.enum.ts # Blockchain chains
94
+ │ ├── db/ # Database enums (23 files)
95
+ │ ├── maintenanceMode.enum.ts
96
+ │ ├── notification.enum.ts
97
+ │ ├── rabbitMq.ts
98
+ │ ├── social.enum.ts
99
+ │ └── index.ts
100
+
101
+ ├── helpers/ # Helper functions
102
+ │ ├── algo.helper.ts # Algorand helpers
103
+ │ ├── assert.helper.ts # Assertion utilities
104
+ │ ├── atomic.helper.ts # Atomic conversion helpers
105
+ │ ├── balance.helper.ts # Balance calculations
106
+ │ ├── codex/ # Codex protocol helpers
107
+ │ │ ├── cancel-order.helper.ts
108
+ │ │ ├── create-order.helper.ts
109
+ │ │ ├── dtw.helper.ts
110
+ │ │ ├── login.helper.ts
111
+ │ │ ├── trading-key.helper.ts
112
+ │ │ ├── transfer.helper.ts
113
+ │ │ └── withdraw.helper.ts
114
+ │ ├── codex.helper.ts
115
+ │ ├── Encoding.ts
116
+ │ ├── eth.helper.ts # Ethereum helpers
117
+ │ ├── interval.helpers.ts
118
+ │ ├── liquidity.helper.ts
119
+ │ ├── order.helper.ts
120
+ │ ├── pair.helper.ts
121
+ │ ├── pointSystem.helper.ts
122
+ │ ├── ticker.helpers.ts
123
+ │ ├── vaa.helper.ts # Wormhole VAA helpers
124
+ │ ├── withdraw.helper.ts
125
+ │ └── index.ts
126
+
127
+ ├── interfaces/ # TypeScript interfaces
128
+ │ ├── accountInfo.interface.ts
129
+ │ ├── api/ # API-related interfaces
130
+ │ ├── cache.interface.ts
131
+ │ ├── db/ # Database interfaces (11 files)
132
+ │ ├── dto/ # Data transfer objects
133
+ │ ├── emailService.interface.ts
134
+ │ ├── kmsService.interface.ts
135
+ │ ├── last-look-trade.interface.ts
136
+ │ ├── market.interface.ts
137
+ │ ├── order.interface.ts
138
+ │ ├── pagination.interface.ts
139
+ │ ├── pair.interface.ts
140
+ │ ├── query.interface.ts
141
+ │ ├── services/ # Service interfaces (9 files)
142
+ │ ├── streaming.interface.ts
143
+ │ ├── timestream.interface.ts
144
+ │ ├── trading.interface.ts
145
+ │ ├── tradingKey.interface.ts
146
+ │ ├── transfer.interface.ts
147
+ │ ├── wallet.interface.ts
148
+ │ ├── withdrawalWallets.interface.ts
149
+ │ └── index.ts
150
+
151
+ └── types/ # Type definitions
152
+ ├── algo-order.type.ts
153
+ ├── amm/ # AMM types
154
+ ├── api/ # API types
155
+ ├── codex.types.ts
156
+ ├── hummingbots.types.ts
157
+ ├── notification.type.ts
158
+ ├── settings.type.ts
159
+ ├── state.type.ts
160
+ └── index.ts
161
+ ```
162
+
163
+ ## TypeScript Path Aliases
164
+
165
+ Defined in `tsconfig.alias.json`:
166
+
167
+ | Alias | Path | Description |
168
+ |-------|------|-------------|
169
+ | `@common/*` | `./src/common/*` | Common utilities |
170
+ | `@constants` | `./src/constants/index.ts` | Constants |
171
+ | `@enums` | `./src/enums/index.ts` | Enumerations |
172
+ | `@helpers/*` | `./src/helpers/*` | Helper functions |
173
+ | `@interfaces` | `./src/interfaces/index.ts` | Interfaces |
174
+ | `@types` | `./src/types/index.ts` | Type definitions |
175
+
176
+ ## Package Exports
177
+
178
+ The package uses conditional exports for browser and node environments:
179
+
180
+ ```json
181
+ {
182
+ "./browser/common/*": {
183
+ "import": "./dist/browser/common/*.js",
184
+ "types": "./dist/common/*.d.ts"
185
+ },
186
+ "./node/common/*": {
187
+ "import": "./dist/node/common/*.js",
188
+ "types": "./dist/common/*.d.ts"
189
+ },
190
+ "./browser/helpers/*": {
191
+ "import": "./dist/browser/helpers/*.js",
192
+ "types": "./dist/helpers/*.d.ts"
193
+ },
194
+ "./node/helpers/*": {
195
+ "import": "./dist/node/helpers/*.js",
196
+ "types": "./dist/helpers/*.d.ts"
197
+ },
198
+ "./browser/*": {
199
+ "import": "./dist/browser/*/index.js",
200
+ "types": "./dist/*/index.d.ts"
201
+ },
202
+ "./node/*": {
203
+ "import": "./dist/node/*/index.js",
204
+ "types": "./dist/*/index.d.ts"
205
+ }
206
+ }
207
+ ```
208
+
209
+ ## Build Commands
210
+
211
+ **Important:** First install node_modules from monorepo root (npm_packages)
212
+
213
+ - `npm run build` - Production build (both browser and node)
214
+ - `npm run dev` - Development build with watch
215
+ - `npm run dev:node` - Node.js development build
216
+ - `npm run dev:browser` - Browser development build
217
+ - `npm run version:update` - Bump patch version
218
+
219
+ ## Usage Examples
220
+
221
+ ### Browser Environment
222
+ ```typescript
223
+ import { makeLoginMsg } from '@ultrade/shared/browser/helpers/codex.helper';
224
+ import { PROVIDERS } from '@ultrade/shared/browser/interfaces';
225
+ import { OrderStatus } from '@ultrade/shared/browser/enums';
226
+ ```
227
+
228
+ ### Node.js Environment
229
+ ```typescript
230
+ import { validateOrder } from '@ultrade/shared/node/helpers';
231
+ import { DbOrderStatus } from '@ultrade/shared/node/enums/db';
232
+ ```
@@ -1,2 +1,2 @@
1
- import { ICodexAsset, ICodexAssetDto } from "@interfaces";
1
+ import { ICodexAsset, ICodexAssetDto } from "../../interfaces/index.ts";
2
2
  export declare function mapToCodexAssetDto(o: ICodexAsset, isArchived?: (a: ICodexAsset) => boolean): ICodexAssetDto;
@@ -1,2 +1,2 @@
1
- import { ICodexBalance, ICodexBalanceDto } from "@interfaces";
1
+ import { ICodexBalance, ICodexBalanceDto } from "../../interfaces/index.ts";
2
2
  export declare function mapToCodexBalanceDto(o: ICodexBalance): ICodexBalanceDto;
@@ -1,6 +1,6 @@
1
- import { ICodexAsset, IOrder, ITrade } from "@interfaces";
2
- import { OrderSide } from "@enums";
3
- import { IOrderDto, ITradeDto } from "@interfaces";
1
+ import { ICodexAsset, IOrder, ITrade } from "../../interfaces/index.ts";
2
+ import { OrderSide } from "../../enums/index.ts";
3
+ import { IOrderDto, ITradeDto } from "../../interfaces/index.ts";
4
4
  export declare function mapToUserTradeDto(t: ITrade, baseAsset?: ICodexAsset, priceAsset?: ICodexAsset): ITradeDto;
5
5
  export declare function mapToOrderTradeDto(order: IOrder, trades?: Partial<ITrade>[], pairKey?: string, baseAsset?: ICodexAsset, priceAsset?: ICodexAsset): IOrderDto;
6
6
  export declare function isMaker(oSide: OrderSide, tSide: OrderSide): boolean;
@@ -1,5 +1,5 @@
1
- import { IOrderDataInMsg, IOrderData } from "@interfaces";
2
- import { IPairInfo } from "@interfaces";
1
+ import { IOrderDataInMsg, IOrderData } from "../interfaces/index.ts";
2
+ import { IPairInfo } from "../interfaces/index.ts";
3
3
  export declare const assertOrderData: (order: IOrderData, pair: IPairInfo) => void;
4
4
  export declare const assertOrderExpirationAtCreationMoment: (order: IOrderDataInMsg) => void;
5
5
  export declare const assertOrder: (order: IOrderDataInMsg, pair: {
@@ -1,6 +1,6 @@
1
- import { AddressChain, PairToken } from "@interfaces";
2
- import { ICancelingOrder, IPairInfo } from "@interfaces";
3
- import { IBalanceInfo } from "@interfaces";
1
+ import { AddressChain, PairToken } from "../interfaces/index.ts";
2
+ import { ICancelingOrder, IPairInfo } from "../interfaces/index.ts";
3
+ import { IBalanceInfo } from "../interfaces/index.ts";
4
4
  export declare const mapToBalanceInfo: (pairInfo: IPairInfo, { userId, chainId, price, side, type, amount, total, id }: Partial<ICancelingOrder>) => IBalanceInfo;
5
5
  export declare const mapToCodexBalance: (account: AddressChain, token: PairToken, amount: string, lockedAmount?: string) => {
6
6
  hash: string;
@@ -1,4 +1,4 @@
1
- import { OrderSide, OrderType } from "@enums";
1
+ import { OrderSide, OrderType } from "../enums/index.ts";
2
2
  import { OrderSideShort, OrderTypeShort } from "../interfaces/order.interface";
3
3
  export declare function mapOrderSideFromShort(value: OrderSideShort): OrderSide;
4
4
  export declare function mapOrderSideToShort(value: OrderSide): OrderSideShort;
@@ -1,4 +1,4 @@
1
- import { IPair, IPairSetting, PairTokenInfo } from "@interfaces";
1
+ import { IPair, IPairSetting, PairTokenInfo } from "../interfaces/index.ts";
2
2
  export declare const fetchTokensFromPair: (pair: IPair) => {
3
3
  baseAsset: PairTokenInfo;
4
4
  priceAsset: PairTokenInfo;
@@ -1,4 +1,4 @@
1
- import { ICompanySetting } from '@interfaces';
1
+ import { ICompanySetting } from '../interfaces/index.ts';
2
2
  export declare const transformPointSystemSettings: (pointSystemSettings: ICompanySetting[]) => {
3
3
  discordEnabled: string | boolean;
4
4
  telegramBotName: string | boolean;
@@ -1,6 +1,6 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  import { IWithdrawData } from "../interfaces/wallet.interface";
3
- import { WithdrawalWalletData, UpdateWithdrawalWalletData } from '@interfaces';
3
+ import { WithdrawalWalletData, UpdateWithdrawalWalletData } from '../interfaces/index.ts';
4
4
  export declare const TOKEN_PROGRAM_ID: PublicKey;
5
5
  export declare const ASSOCIATED_TOKEN_PROGRAM_ID: PublicKey;
6
6
  export declare function getAssociatedTokenAddressSync(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): PublicKey;
@@ -1,5 +1,5 @@
1
- import { KYCAuthenticationStatus, LastLookAction, MarketMakerRebateTier } from '@enums';
2
- import { IAccount } from '@interfaces';
1
+ import { KYCAuthenticationStatus, LastLookAction, MarketMakerRebateTier } from '../enums/index.ts';
2
+ import { IAccount } from './index.ts';
3
3
  export interface IAccountInfo extends IAccount {
4
4
  lastLook?: {
5
5
  defaultAction: LastLookAction;
@@ -1,4 +1,4 @@
1
- import { DBAffiliate } from '@interfaces';
1
+ import { DBAffiliate } from '../index.ts';
2
2
  export interface SummaryStat {
3
3
  value: number | null;
4
4
  trend: number | null;
@@ -1,4 +1,4 @@
1
- import { ICompany, ICompanySetting } from '@interfaces';
1
+ import { ICompany, ICompanySetting } from './index.ts';
2
2
  export interface ICompanyCache extends Pick<ICompany, 'id' | 'domain' | 'name' | 'enabled' | 'isSuper' | 'collectionWallet' | 'collectionWalletChainId'> {
3
3
  companyBDPartner: ICompanyBDPartnerCache;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { HummingbotInstanceStatus } from '@types';
2
- import { IUser } from '@interfaces';
1
+ import { HummingbotInstanceStatus } from '../../../types/index.ts';
2
+ import { IUser } from '../../index.ts';
3
3
  export interface IStrategy {
4
4
  id: number;
5
5
  name: string;
@@ -1,5 +1,5 @@
1
- import { FeeTier, LastLookAction, KYCAuthenticationStatus, StateType, UpgradeStatus, OrderSide, TradeStatus, TradeSubStatus, TradingKeyType, ComponentType, ComponentStatusType, PairComponentStatusType } from '@enums';
2
- import { IBaseModel, ICompany } from '@interfaces';
1
+ import { FeeTier, LastLookAction, KYCAuthenticationStatus, StateType, UpgradeStatus, OrderSide, TradeStatus, TradeSubStatus, TradingKeyType, ComponentType, ComponentStatusType, PairComponentStatusType } from '../../../enums/index.ts';
2
+ import { IBaseModel, ICompany } from '../../index.ts';
3
3
  export interface IAccount {
4
4
  address: string;
5
5
  chainId: number;
@@ -1,5 +1,5 @@
1
- import { GlobalNotificationEnum, NotificationPriorityEnum, NotificationStatusEnum, NotificationType, ScheduledNotificationStatusEnum } from '@enums';
2
- import { IAccount } from '@interfaces';
1
+ import { GlobalNotificationEnum, NotificationPriorityEnum, NotificationStatusEnum, NotificationType, ScheduledNotificationStatusEnum } from '../../../enums/index.ts';
2
+ import { IAccount } from '../../index.ts';
3
3
  export interface INotificationModel {
4
4
  id: number;
5
5
  priority: NotificationPriorityEnum;
@@ -1,5 +1,5 @@
1
- import { CCTPStatus, TransactionType } from '@enums';
2
- import { ICodexAsset } from '@interfaces';
1
+ import { CCTPStatus, TransactionType } from '../../../enums/index.ts';
2
+ import { ICodexAsset } from '../../index.ts';
3
3
  export interface IOperationStatus {
4
4
  primaryId: number;
5
5
  id: string;
@@ -1,5 +1,5 @@
1
- import { ActionSource, PromptTypeEnum, SeasonStatusEnum, TweetType } from '@enums';
2
- import { IAccount, ICompany } from '@interfaces';
1
+ import { ActionSource, PromptTypeEnum, SeasonStatusEnum, TweetType } from '../../../enums/index.ts';
2
+ import { IAccount, ICompany } from '../../index.ts';
3
3
  export interface ISocialAccount {
4
4
  address: string;
5
5
  companyId: number;
@@ -1,5 +1,5 @@
1
- import { SettingTypeColumn, MarketMakerRebateTier } from '@enums';
2
- import { ICollectionWallet, IBaseModel, ISoftDeleteModel, IAccount, IPairEntity, IAvailablePairSetting, IInvitedByAffiliateAccount } from '@interfaces';
1
+ import { SettingTypeColumn, MarketMakerRebateTier } from '../../../enums/index.ts';
2
+ import { ICollectionWallet, IBaseModel, ISoftDeleteModel, IAccount, IPairEntity, IAvailablePairSetting, IInvitedByAffiliateAccount } from '../../index.ts';
3
3
  export interface ICompanyBDPartner {
4
4
  companyId: number;
5
5
  name: string;
@@ -1,4 +1,4 @@
1
- import { WithdrawalWalletType } from '@enums';
1
+ import { WithdrawalWalletType } from '../../../enums/index.ts';
2
2
  export { WithdrawalWalletType };
3
3
  export interface IWithdrawalWallets {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { OrderSide, OrderStatus, OrderType, TradeStatus } from "@enums";
1
+ import { OrderSide, OrderStatus, OrderType, TradeStatus } from "../../enums/index.ts";
2
2
  import { OrderSideShort } from "../order.interface";
3
3
  export interface ICodexAssetDto {
4
4
  id: number;
@@ -1,4 +1,4 @@
1
- import { LastLookAction } from "@enums";
1
+ import { LastLookAction } from "../enums/index.ts";
2
2
  export interface LastLookTrade {
3
3
  userId: string;
4
4
  tradeId: number;
@@ -1,5 +1,5 @@
1
- import { OrderSide, OrderType, Chains } from "@enums";
2
- import { IRangeParamsDto } from "@interfaces";
1
+ import { OrderSide, OrderType, Chains } from "../enums/index.ts";
2
+ import { IRangeParamsDto } from "./index.ts";
3
3
  export interface IOrderDataInMsg {
4
4
  address: string;
5
5
  chainId: Chains;
@@ -1,5 +1,5 @@
1
- import { IAccount, IAccountInfo } from '@interfaces';
2
- import { LastLookAction, MarketMakerRebateTier, KYCAuthenticationStatus } from '@enums';
1
+ import { IAccount, IAccountInfo } from '../index.ts';
2
+ import { LastLookAction, MarketMakerRebateTier, KYCAuthenticationStatus } from '../../enums/index.ts';
3
3
  export interface AccountInfo extends IAccount, IAccountInfo {
4
4
  lastLook?: {
5
5
  defaultAction: LastLookAction;
@@ -1,4 +1,4 @@
1
- import { BalanceActionType, AddressChain } from '@interfaces';
1
+ import { BalanceActionType, AddressChain } from '../index.ts';
2
2
  export type IBalanceInfo = {
3
3
  account: AddressChain;
4
4
  token: AddressChain;
@@ -1,4 +1,4 @@
1
- import { PriceObject } from '@interfaces';
1
+ import { PriceObject } from '../index.ts';
2
2
  export interface IPriceModel extends Map<number, number> {
3
3
  serialize(): PriceObject;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { ICodexAsset, IPriceModel } from '@interfaces';
1
+ import { ICodexAsset, IPriceModel } from '../index.ts';
2
2
  export interface PriceProvider {
3
3
  getPrices(assets: Pick<ICodexAsset, 'id' | 'coinmarketcapId'>[]): Promise<IPriceModel | null>;
4
4
  compareAssetWithCoinmarketId(assets: ICodexAsset[], isMainnet: boolean): Promise<ICodexAsset[]>;
@@ -1,4 +1,4 @@
1
- import { AccountInfo } from '@interfaces';
1
+ import { AccountInfo } from '../index.ts';
2
2
  export interface SocialAccountInfo extends AccountInfo {
3
3
  companyId: number;
4
4
  companyWallet?: string;
@@ -1,5 +1,5 @@
1
- import { OperationStatusEnum, OrderSide, OrderStatus, OrderType } from "@enums";
2
- import { Notification } from "@types";
1
+ import { OperationStatusEnum, OrderSide, OrderStatus, OrderType } from "../enums/index.ts";
2
+ import { Notification } from "../types/index.ts";
3
3
  export interface CancelStreamTrade {
4
4
  pairId: number;
5
5
  pairKey: string;
@@ -1,5 +1,5 @@
1
- import { OrderSide, OrderType, TradeStatus } from "@enums";
2
- import { IPairSetting, PairToken, PairTokenInfo } from "@interfaces";
1
+ import { OrderSide, OrderType, TradeStatus } from "../enums/index.ts";
2
+ import { IPairSetting, PairToken, PairTokenInfo } from "./index.ts";
3
3
  export interface InsertTrade {
4
4
  buy_order_id?: number;
5
5
  sell_order_id?: number;
@@ -1,4 +1,4 @@
1
- import { TradingKeyType } from "@enums";
1
+ import { TradingKeyType } from "../enums/index.ts";
2
2
  export interface ITradingKeyMessageData {
3
3
  tkAddress: string;
4
4
  loginAddress: string;
@@ -1,4 +1,4 @@
1
- import { ActionTypeEnum, TradeStatus } from "@enums";
1
+ import { ActionTypeEnum, TradeStatus } from "../enums/index.ts";
2
2
  import { IRangeParamsDto } from "./query.interface";
3
3
  export type TechnologyType = "ALGORAND" | "EVM" | "SOLANA";
4
4
  export declare enum PROVIDERS {
@@ -1,4 +1,4 @@
1
- import { WithdrawalWalletType, ISignedMessage } from "@interfaces";
1
+ import { WithdrawalWalletType, ISignedMessage } from "./index.ts";
2
2
  export interface WithdrawalWalletData {
3
3
  address: string;
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { IAsset } from "@interfaces";
1
+ import { IAsset } from "../../interfaces/index.ts";
2
2
  export interface PoolInfo {
3
3
  appId: number | string;
4
4
  asset1Id: number;
@@ -1,4 +1,4 @@
1
- import { IHummingbotInstance } from '@interfaces';
1
+ import { IHummingbotInstance } from '../interfaces/index.ts';
2
2
  export interface HummingbotUserData {
3
3
  password: string;
4
4
  tradingKey: string;
@@ -1,4 +1,4 @@
1
- import { NotificationPriorityEnum, NotificationStatusEnum, NotificationType } from "@enums";
1
+ import { NotificationPriorityEnum, NotificationStatusEnum, NotificationType } from "../enums/index.ts";
2
2
  export type Notification = {
3
3
  id: number | null;
4
4
  globalNotificationId: number | null;
@@ -1,4 +1,4 @@
1
- import { StateType } from "@enums";
1
+ import { StateType } from "../enums/index.ts";
2
2
  export type State = {
3
3
  [key in StateType]: string;
4
4
  };
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
1
  {
2
2
  "name": "@ultrade/shared",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "This package contains shared code for the projects.",
5
5
  "exports": {
6
6
  "./browser/common/*": {
7
7
  "import": "./dist/browser/common/*.js",
8
- "types": "./dist/src/common/*.d.ts"
8
+ "types": "./dist/common/*.d.ts"
9
9
  },
10
10
  "./node/common/*": {
11
11
  "import": "./dist/node/common/*.js",
12
- "types": "./dist/src/common/*.d.ts"
12
+ "types": "./dist/common/*.d.ts"
13
13
  },
14
14
  "./browser/helpers/*": {
15
15
  "import": "./dist/browser/helpers/*.js",
16
- "types": "./dist/src/helpers/*.d.ts"
16
+ "types": "./dist/helpers/*.d.ts"
17
17
  },
18
18
  "./node/helpers/*": {
19
19
  "import": "./dist/node/helpers/*.js",
20
- "types": "./dist/src/helpers/*.d.ts"
20
+ "types": "./dist/helpers/*.d.ts"
21
21
  },
22
22
  "./browser/*": {
23
23
  "import": "./dist/browser/*/index.js",
24
- "types": "./dist/src/*/index.d.ts"
24
+ "types": "./dist/*/index.d.ts"
25
25
  },
26
26
  "./node/*": {
27
27
  "import": "./dist/node/*/index.js",
28
- "types": "./dist/src/*/index.d.ts"
28
+ "types": "./dist/*/index.d.ts"
29
29
  }
30
30
  },
31
31
  "scripts": {
@@ -36,8 +36,13 @@
36
36
  "version:update": "npm version patch --no-git-tag-version"
37
37
  },
38
38
  "files": [
39
- "dist"
39
+ "dist",
40
+ "README.md"
40
41
  ],
42
+ "publishConfig": {
43
+ "registry": "https://registry.npmjs.org/",
44
+ "access": "public"
45
+ },
41
46
  "devDependencies": {
42
47
  "@esbuild-plugins/node-globals-polyfill": "^0.2.3",
43
48
  "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes