@ultrade/shared 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +232 -0
- package/dist/{src/common → common}/mappers/codexAsset.mapper.d.ts +1 -1
- package/dist/{src/common → common}/mappers/codexBalance.mapper.d.ts +1 -1
- package/dist/{src/common → common}/mappers/trade.mapper.d.ts +3 -3
- package/dist/{src/helpers → helpers}/assert.helper.d.ts +2 -2
- package/dist/{src/helpers → helpers}/balance.helper.d.ts +3 -3
- package/dist/{src/helpers → helpers}/codex/common.helper.d.ts +1 -1
- package/dist/{src/helpers → helpers}/order.helper.d.ts +1 -1
- package/dist/{src/helpers → helpers}/pair.helper.d.ts +1 -1
- package/dist/{src/helpers → helpers}/pointSystem.helper.d.ts +1 -1
- package/dist/{src/helpers → helpers}/withdraw.helper.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/accountInfo.interface.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/api/affiliate.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/cache.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/db/hummingbot/index.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/db/market/index.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/db/notification_center/index.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/db/relayer/index.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/db/social/index.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/db/white_label/index.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/db/withdrawal_wallets/index.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/dto/index.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/last-look-trade.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/order.interface.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/services/accountCache.interface.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/services/balances.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/services/price-model.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/services/price-service.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/services/socialActivity.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/streaming.interface.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/trading.interface.d.ts +2 -2
- package/dist/{src/interfaces → interfaces}/tradingKey.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/wallet.interface.d.ts +1 -1
- package/dist/{src/interfaces → interfaces}/withdrawalWallets.interface.d.ts +1 -1
- package/dist/{src/types → types}/amm/amm.d.ts +1 -1
- package/dist/{src/types → types}/hummingbots.types.d.ts +1 -1
- package/dist/{src/types → types}/notification.type.d.ts +1 -1
- package/dist/{src/types → types}/state.type.d.ts +1 -1
- package/package.json +13 -8
- /package/dist/{src/common → common}/auth.helper.d.ts +0 -0
- /package/dist/{src/common → common}/big-number.helper.d.ts +0 -0
- /package/dist/{src/common → common}/index.d.ts +0 -0
- /package/dist/{src/common → common}/mappers/index.d.ts +0 -0
- /package/dist/{src/common → common}/utils/assert.d.ts +0 -0
- /package/dist/{src/common → common}/utils/decode.d.ts +0 -0
- /package/dist/{src/common → common}/utils/index.d.ts +0 -0
- /package/dist/{src/common → common}/utils/social.d.ts +0 -0
- /package/dist/{src/common → common}/utils/stat.d.ts +0 -0
- /package/dist/{src/constants → constants}/auth.d.ts +0 -0
- /package/dist/{src/constants → constants}/cctp.d.ts +0 -0
- /package/dist/{src/constants → constants}/codex.d.ts +0 -0
- /package/dist/{src/constants → constants}/index.d.ts +0 -0
- /package/dist/{src/constants → constants}/response.d.ts +0 -0
- /package/dist/{src/constants → constants}/settings.d.ts +0 -0
- /package/dist/{src/constants → constants}/withdrawalWalletsMessage.d.ts +0 -0
- /package/dist/{src/enums → enums}/chains.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/account/index.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/affiliate.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/available-pair-settings.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/common.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/component/index.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/index.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/market-maker.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/notification-center/userNotification.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/order-side.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/order-status.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/order-type.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/relayer.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/setting-type.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/social-action.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/social-prompt.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/social.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/state-type.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/trade.enums.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/tradingKeyType.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/upgrade.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/withdrawal-wallet.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/index.d.ts +0 -0
- /package/dist/{src/enums → enums}/maintenanceMode.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/notification.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/rabbitMq.d.ts +0 -0
- /package/dist/{src/enums → enums}/social.enum.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/Encoding.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/algo.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/atomic.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/index.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/mbr.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/mna.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/order.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/setGlobal.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/transfer.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/txn.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/eth.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/index.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/interval.helpers.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/liquidity.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/ticker.helpers.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/vaa.helper.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/api/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/baseModel.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/marketing/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/softDeleteModel.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/emailService.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/kmsService.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/market.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/pagination.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/pair.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/query.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/algod.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/coin-market-cap.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/tmc.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/timestream.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/transfer.interface.d.ts +0 -0
- /package/dist/{src/types → types}/algo-order.type.d.ts +0 -0
- /package/dist/{src/types → types}/api/request.types.d.ts +0 -0
- /package/dist/{src/types → types}/codex.types.d.ts +0 -0
- /package/dist/{src/types → types}/index.d.ts +0 -0
- /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 "
|
|
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 "
|
|
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 "
|
|
2
|
-
import { OrderSide } from "
|
|
3
|
-
import { IOrderDto, ITradeDto } from "
|
|
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 "
|
|
2
|
-
import { IPairInfo } from "
|
|
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 "
|
|
2
|
-
import { ICancelingOrder, IPairInfo } from "
|
|
3
|
-
import { IBalanceInfo } from "
|
|
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;
|
|
@@ -13,7 +13,7 @@ export declare const getBoxKeyFromHash: (hash: string, prefix: string) => Uint8A
|
|
|
13
13
|
export declare const getAppArgs: (methodSignature: string, args: Array<Uint8Array | Buffer | number>) => Uint8Array[];
|
|
14
14
|
export declare const getDataBytesFromMsg: (message: string, encoding: BufferEncoding, dataBytesLength: number) => Uint8Array<ArrayBufferLike>;
|
|
15
15
|
export declare const getMsgArgs: (message: string, signature: string, signerAddress: string, signerChainId: number, encoding?: BufferEncoding) => Array<Buffer | Uint8Array>;
|
|
16
|
-
export declare const decodeSignature: (signature: string, chain: number) =>
|
|
16
|
+
export declare const decodeSignature: (signature: string, chain: number) => Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>;
|
|
17
17
|
export declare const getPublicKey: (address: string, chain: number, message: string, signature: string, encoding?: BufferEncoding) => Uint8Array | Buffer;
|
|
18
18
|
export declare const getPrefixedMessage: (message: string, encoding: BufferEncoding | undefined, chain: number) => Buffer;
|
|
19
19
|
export declare const getProviderChainId: (technology: TechnologyType) => Chains;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrderSide, OrderType } from "
|
|
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 { ICompanySetting } from '
|
|
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 '
|
|
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 '
|
|
2
|
-
import { IAccount } from '
|
|
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 { ICompany, ICompanySetting } from '
|
|
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 { FeeTier, LastLookAction, KYCAuthenticationStatus, StateType, UpgradeStatus, OrderSide, TradeStatus, TradeSubStatus, TradingKeyType, ComponentType, ComponentStatusType, PairComponentStatusType } from '
|
|
2
|
-
import { IBaseModel, ICompany } from '
|
|
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 '
|
|
2
|
-
import { IAccount } from '
|
|
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 '
|
|
2
|
-
import { ICodexAsset } from '
|
|
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 '
|
|
2
|
-
import { IAccount, ICompany } from '
|
|
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 '
|
|
2
|
-
import { ICollectionWallet, IBaseModel, ISoftDeleteModel, IAccount, IPairEntity, IAvailablePairSetting, IInvitedByAffiliateAccount } from '
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { OrderSide, OrderType, Chains } from "
|
|
2
|
-
import { IRangeParamsDto } from "
|
|
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 '
|
|
2
|
-
import { LastLookAction, MarketMakerRebateTier, KYCAuthenticationStatus } from '
|
|
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 { ICodexAsset, IPriceModel } from '
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { OperationStatusEnum, OrderSide, OrderStatus, OrderType } from "
|
|
2
|
-
import { Notification } from "
|
|
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 "
|
|
2
|
-
import { IPairSetting, PairToken, PairTokenInfo } from "
|
|
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 { NotificationPriorityEnum, NotificationStatusEnum, NotificationType } from "
|
|
1
|
+
import { NotificationPriorityEnum, NotificationStatusEnum, NotificationType } from "../enums/index.ts";
|
|
2
2
|
export type Notification = {
|
|
3
3
|
id: number | null;
|
|
4
4
|
globalNotificationId: number | null;
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultrade/shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
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/
|
|
8
|
+
"types": "./dist/common/*.d.ts"
|
|
9
9
|
},
|
|
10
10
|
"./node/common/*": {
|
|
11
11
|
"import": "./dist/node/common/*.js",
|
|
12
|
-
"types": "./dist/
|
|
12
|
+
"types": "./dist/common/*.d.ts"
|
|
13
13
|
},
|
|
14
14
|
"./browser/helpers/*": {
|
|
15
15
|
"import": "./dist/browser/helpers/*.js",
|
|
16
|
-
"types": "./dist/
|
|
16
|
+
"types": "./dist/helpers/*.d.ts"
|
|
17
17
|
},
|
|
18
18
|
"./node/helpers/*": {
|
|
19
19
|
"import": "./dist/node/helpers/*.js",
|
|
20
|
-
"types": "./dist/
|
|
20
|
+
"types": "./dist/helpers/*.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"./browser/*": {
|
|
23
23
|
"import": "./dist/browser/*/index.js",
|
|
24
|
-
"types": "./dist
|
|
24
|
+
"types": "./dist/*/index.d.ts"
|
|
25
25
|
},
|
|
26
26
|
"./node/*": {
|
|
27
27
|
"import": "./dist/node/*/index.js",
|
|
28
|
-
"types": "./dist
|
|
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
|
|
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
|
|
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
|