iq-option-client 1.3.3
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/LICENSE +16 -0
- package/README.md +531 -0
- package/dist/bin/IQOption.d.ts +2 -0
- package/dist/bin/IQOption.js +100 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +26 -0
- package/dist/lib/Helper/Logger/ILogger.d.ts +39 -0
- package/dist/lib/Helper/Logger/ILogger.js +3 -0
- package/dist/lib/Helper/Logger/LogLevel.d.ts +10 -0
- package/dist/lib/Helper/Logger/LogLevel.js +23 -0
- package/dist/lib/Helper/Logger/LoggerContext.d.ts +59 -0
- package/dist/lib/Helper/Logger/LoggerContext.js +49 -0
- package/dist/lib/Helper/Logger/LoggerFactory.d.ts +22 -0
- package/dist/lib/Helper/Logger/LoggerFactory.js +87 -0
- package/dist/lib/Helper/Logger/WinstonLogger.d.ts +21 -0
- package/dist/lib/Helper/Logger/WinstonLogger.js +56 -0
- package/dist/lib/Helper/Logger/index.d.ts +5 -0
- package/dist/lib/Helper/Logger/index.js +30 -0
- package/dist/lib/Helper/LoggerHelper.d.ts +11 -0
- package/dist/lib/Helper/LoggerHelper.js +48 -0
- package/dist/lib/Helper/SleepHelper.d.ts +6 -0
- package/dist/lib/Helper/SleepHelper.js +15 -0
- package/dist/lib/Helper/index.d.ts +3 -0
- package/dist/lib/Helper/index.js +20 -0
- package/dist/lib/Service/IQOptionService/Adapter/StreamAdapter.d.ts +16 -0
- package/dist/lib/Service/IQOptionService/Adapter/StreamAdapter.js +47 -0
- package/dist/lib/Service/IQOptionService/Adapter/index.d.ts +1 -0
- package/dist/lib/Service/IQOptionService/Adapter/index.js +26 -0
- package/dist/lib/Service/IQOptionService/Builder/OrderBuilder.d.ts +44 -0
- package/dist/lib/Service/IQOptionService/Builder/OrderBuilder.js +91 -0
- package/dist/lib/Service/IQOptionService/Builder/OrderRequest.d.ts +28 -0
- package/dist/lib/Service/IQOptionService/Builder/OrderRequest.js +20 -0
- package/dist/lib/Service/IQOptionService/Builder/index.d.ts +2 -0
- package/dist/lib/Service/IQOptionService/Builder/index.js +27 -0
- package/dist/lib/Service/IQOptionService/Command/CommandInvoker.d.ts +13 -0
- package/dist/lib/Service/IQOptionService/Command/CommandInvoker.js +35 -0
- package/dist/lib/Service/IQOptionService/Command/GetProfileCommand.d.ts +13 -0
- package/dist/lib/Service/IQOptionService/Command/GetProfileCommand.js +20 -0
- package/dist/lib/Service/IQOptionService/Command/ICommand.d.ts +13 -0
- package/dist/lib/Service/IQOptionService/Command/ICommand.js +11 -0
- package/dist/lib/Service/IQOptionService/Command/SendOrderCommand.d.ts +14 -0
- package/dist/lib/Service/IQOptionService/Command/SendOrderCommand.js +20 -0
- package/dist/lib/Service/IQOptionService/Command/index.d.ts +4 -0
- package/dist/lib/Service/IQOptionService/Command/index.js +29 -0
- package/dist/lib/Service/IQOptionService/Error/AuthenticationError.d.ts +7 -0
- package/dist/lib/Service/IQOptionService/Error/AuthenticationError.js +22 -0
- package/dist/lib/Service/IQOptionService/Error/ConnectionError.d.ts +7 -0
- package/dist/lib/Service/IQOptionService/Error/ConnectionError.js +22 -0
- package/dist/lib/Service/IQOptionService/Error/ErrorHandler.d.ts +17 -0
- package/dist/lib/Service/IQOptionService/Error/ErrorHandler.js +58 -0
- package/dist/lib/Service/IQOptionService/Error/IQOptionError.d.ts +15 -0
- package/dist/lib/Service/IQOptionService/Error/IQOptionError.js +46 -0
- package/dist/lib/Service/IQOptionService/Error/OrderError.d.ts +7 -0
- package/dist/lib/Service/IQOptionService/Error/OrderError.js +22 -0
- package/dist/lib/Service/IQOptionService/Error/RetryStrategy.d.ts +42 -0
- package/dist/lib/Service/IQOptionService/Error/RetryStrategy.js +67 -0
- package/dist/lib/Service/IQOptionService/Error/Retryable.d.ts +20 -0
- package/dist/lib/Service/IQOptionService/Error/Retryable.js +36 -0
- package/dist/lib/Service/IQOptionService/Error/TimeoutError.d.ts +7 -0
- package/dist/lib/Service/IQOptionService/Error/TimeoutError.js +23 -0
- package/dist/lib/Service/IQOptionService/Error/index.d.ts +8 -0
- package/dist/lib/Service/IQOptionService/Error/index.js +33 -0
- package/dist/lib/Service/IQOptionService/Factory/StreamFactory.d.ts +17 -0
- package/dist/lib/Service/IQOptionService/Factory/StreamFactory.js +43 -0
- package/dist/lib/Service/IQOptionService/Factory/StreamType.d.ts +9 -0
- package/dist/lib/Service/IQOptionService/Factory/StreamType.js +22 -0
- package/dist/lib/Service/IQOptionService/Factory/index.d.ts +2 -0
- package/dist/lib/Service/IQOptionService/Factory/index.js +27 -0
- package/dist/lib/Service/IQOptionService/Helper/InputValidator.d.ts +34 -0
- package/dist/lib/Service/IQOptionService/Helper/InputValidator.js +101 -0
- package/dist/lib/Service/IQOptionService/Helper/RequestIdGenerator.d.ts +18 -0
- package/dist/lib/Service/IQOptionService/Helper/RequestIdGenerator.js +37 -0
- package/dist/lib/Service/IQOptionService/Helper/index.d.ts +2 -0
- package/dist/lib/Service/IQOptionService/Helper/index.js +27 -0
- package/dist/lib/Service/IQOptionService/IQOptionApi.d.ts +96 -0
- package/dist/lib/Service/IQOptionService/IQOptionApi.js +343 -0
- package/dist/lib/Service/IQOptionService/IQOptionExpired.d.ts +7 -0
- package/dist/lib/Service/IQOptionService/IQOptionExpired.js +27 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamCandleGenerated.d.ts +55 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamCandleGenerated.js +88 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamOptionClose.d.ts +33 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamOptionClose.js +59 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamTradersSentiment.d.ts +46 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamTradersSentiment.js +84 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamUserAlerts.d.ts +40 -0
- package/dist/lib/Service/IQOptionService/IQOptionStreamUserAlerts.js +79 -0
- package/dist/lib/Service/IQOptionService/IQOptionWrapper.d.ts +51 -0
- package/dist/lib/Service/IQOptionService/IQOptionWrapper.js +111 -0
- package/dist/lib/Service/IQOptionService/IQOptionWs.d.ts +56 -0
- package/dist/lib/Service/IQOptionService/IQOptionWs.js +125 -0
- package/dist/lib/Service/IQOptionService/Interface/IAuthService.d.ts +12 -0
- package/dist/lib/Service/IQOptionService/Interface/IAuthService.js +11 -0
- package/dist/lib/Service/IQOptionService/Interface/IIQOptionStream.d.ts +9 -0
- package/dist/lib/Service/IQOptionService/Interface/IIQOptionStream.js +11 -0
- package/dist/lib/Service/IQOptionService/Interface/IWebSocketClient.d.ts +26 -0
- package/dist/lib/Service/IQOptionService/Interface/IWebSocketClient.js +3 -0
- package/dist/lib/Service/IQOptionService/Interface/index.d.ts +3 -0
- package/dist/lib/Service/IQOptionService/Interface/index.js +28 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionAction.d.ts +23 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionAction.js +36 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionCandle.d.ts +61 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionCandle.js +11 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionCurrency.d.ts +9 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionCurrency.js +22 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionCurrencyType.d.ts +8 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionCurrencyType.js +21 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionInitializationData.d.ts +117 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionInitializationData.js +14 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionInstrumentType.d.ts +4 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionInstrumentType.js +9 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionInstruments.d.ts +22 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionInstruments.js +3 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionMarket.d.ts +100 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionMarket.js +113 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionMarketInvert.d.ts +6 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionMarketInvert.js +108 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionMode.d.ts +7 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionMode.js +20 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionModel.d.ts +13 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionModel.js +26 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionName.d.ts +8 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionName.js +21 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionOptionClosed.d.ts +43 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionOptionClosed.js +11 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionOptionOpened.d.ts +39 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionOptionOpened.js +11 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionProfile.d.ts +152 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionProfile.js +11 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionResult.d.ts +17 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionResult.js +30 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionTime.d.ts +12 -0
- package/dist/lib/Service/IQOptionService/Model/IQOptionTime.js +25 -0
- package/dist/lib/Service/IQOptionService/Model/index.d.ts +17 -0
- package/dist/lib/Service/IQOptionService/Model/index.js +42 -0
- package/dist/lib/Service/IQOptionService/Repository/IQOptionRepository.d.ts +26 -0
- package/dist/lib/Service/IQOptionService/Repository/IQOptionRepository.js +3 -0
- package/dist/lib/Service/IQOptionService/Repository/WebSocketRepository.d.ts +19 -0
- package/dist/lib/Service/IQOptionService/Repository/WebSocketRepository.js +99 -0
- package/dist/lib/Service/IQOptionService/Repository/index.d.ts +2 -0
- package/dist/lib/Service/IQOptionService/Repository/index.js +27 -0
- package/dist/lib/Service/IQOptionService/Strategy/BinaryOrderStrategy.d.ts +15 -0
- package/dist/lib/Service/IQOptionService/Strategy/BinaryOrderStrategy.js +66 -0
- package/dist/lib/Service/IQOptionService/Strategy/DigitalOrderStrategy.d.ts +15 -0
- package/dist/lib/Service/IQOptionService/Strategy/DigitalOrderStrategy.js +83 -0
- package/dist/lib/Service/IQOptionService/Strategy/IOrderStrategy.d.ts +10 -0
- package/dist/lib/Service/IQOptionService/Strategy/IOrderStrategy.js +3 -0
- package/dist/lib/Service/IQOptionService/Strategy/index.d.ts +3 -0
- package/dist/lib/Service/IQOptionService/Strategy/index.js +28 -0
- package/dist/lib/Service/IQOptionService/index.d.ts +16 -0
- package/dist/lib/Service/IQOptionService/index.js +41 -0
- package/dist/lib/Service/index.d.ts +1 -0
- package/dist/lib/Service/index.js +26 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +27 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020, Wellington Rocha
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
# IQ Option Client
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/iq-option-client)
|
|
4
|
+
[](https://opensource.org/licenses/ISC)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
|
|
7
|
+
A robust TypeScript client library for interacting with the **IQ Option WebSocket API**. This library provides a clean, type-safe interface for real-time trading, market data streaming, and order management with full SOLID principles implementation.
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- 🔐 **Secure Authentication** - Environment-based credential management
|
|
12
|
+
- 📊 **Real-time Data Streaming** - WebSocket-based candle data, trader sentiment, and option events
|
|
13
|
+
- 📈 **Order Management** - Binary and digital option order execution
|
|
14
|
+
- 🎯 **Type-Safe** - Full TypeScript support with comprehensive type definitions
|
|
15
|
+
- 🏗️ **SOLID Architecture** - Clean code with design patterns (Strategy, Repository, Factory, Command, Builder)
|
|
16
|
+
- 🔄 **Error Handling** - Comprehensive error handling with retry logic
|
|
17
|
+
- 📝 **Structured Logging** - Winston-based logging with context and metadata
|
|
18
|
+
- ✅ **Input Validation** - Built-in validation for all API methods
|
|
19
|
+
- 🧪 **Well Tested** - Comprehensive test suite
|
|
20
|
+
|
|
21
|
+
## 📦 Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install iq-option-client
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or with yarn:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
yarn add iq-option-client
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 🚀 Quick Start
|
|
34
|
+
|
|
35
|
+
### Basic Setup
|
|
36
|
+
|
|
37
|
+
1. **Install the package:**
|
|
38
|
+
```bash
|
|
39
|
+
npm install iq.option.client
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
2. **Create a `.env` file** (or set environment variables):
|
|
43
|
+
```env
|
|
44
|
+
IQ_OPTION_EMAIL=your-email@example.com
|
|
45
|
+
IQ_OPTION_PASSWORD=your-password
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
3. **Basic usage:**
|
|
49
|
+
```typescript
|
|
50
|
+
import { IQOptionApi, IQOptionMarket, IQOptionModel, iqOptionExpired, IQOptionCurrencyType } from 'iq-option-client';
|
|
51
|
+
|
|
52
|
+
// Initialize client
|
|
53
|
+
const api = new IQOptionApi(
|
|
54
|
+
process.env.IQ_OPTION_EMAIL!,
|
|
55
|
+
process.env.IQ_OPTION_PASSWORD!
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// Connect and authenticate
|
|
59
|
+
const profile = await api.connectAsync();
|
|
60
|
+
|
|
61
|
+
// Get test balance
|
|
62
|
+
const testBalance = profile.balances.find(
|
|
63
|
+
b => b.type === IQOptionCurrencyType.TEST
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
// Send a binary order
|
|
67
|
+
const result = await api.sendOrderBinary(
|
|
68
|
+
IQOptionMarket.EURUSD_OTC,
|
|
69
|
+
IQOptionModel.BUY,
|
|
70
|
+
iqOptionExpired(1), // 1 minute expiration
|
|
71
|
+
testBalance!.id,
|
|
72
|
+
90, // profit percent
|
|
73
|
+
10 // amount
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
console.log('Order result:', result);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 📚 Documentation
|
|
80
|
+
|
|
81
|
+
### Core Classes
|
|
82
|
+
|
|
83
|
+
#### `IQOptionApi`
|
|
84
|
+
|
|
85
|
+
Main API client for IQ Option operations.
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { IQOptionApi } from 'iq-option-client';
|
|
89
|
+
|
|
90
|
+
const api = new IQOptionApi(email, password);
|
|
91
|
+
|
|
92
|
+
// Connect and get profile
|
|
93
|
+
const profile = await api.connectAsync();
|
|
94
|
+
|
|
95
|
+
// Get initialization data
|
|
96
|
+
const initData = await api.getInitializationData();
|
|
97
|
+
|
|
98
|
+
// Get digital option instruments
|
|
99
|
+
const instruments = await api.getDigitalOptionInstruments(IQOptionMarket.EURUSD);
|
|
100
|
+
|
|
101
|
+
// Send binary order
|
|
102
|
+
await api.sendOrderBinary(
|
|
103
|
+
market,
|
|
104
|
+
side,
|
|
105
|
+
expirationTime,
|
|
106
|
+
balanceId,
|
|
107
|
+
profitPercent,
|
|
108
|
+
amount
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// Send digital order
|
|
112
|
+
await api.sendOrderDigital(
|
|
113
|
+
market,
|
|
114
|
+
side,
|
|
115
|
+
timeMinutes,
|
|
116
|
+
balanceId,
|
|
117
|
+
amount,
|
|
118
|
+
instrumentIndex
|
|
119
|
+
);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Streams
|
|
123
|
+
|
|
124
|
+
##### Candle Stream
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { IQOptionStreamCandleGenerated, IQOptionMarket, IQOptionTime } from 'iq-option-client';
|
|
128
|
+
|
|
129
|
+
const candleStream = new IQOptionStreamCandleGenerated(
|
|
130
|
+
api.getIQOptionWs(),
|
|
131
|
+
IQOptionMarket.EURUSD,
|
|
132
|
+
IQOptionTime.ONE_MINUTE
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
await candleStream.startStream();
|
|
136
|
+
|
|
137
|
+
candleStream.on('data', (candle) => {
|
|
138
|
+
console.log('New candle:', {
|
|
139
|
+
open: candle.open,
|
|
140
|
+
close: candle.close,
|
|
141
|
+
high: candle.max,
|
|
142
|
+
low: candle.min,
|
|
143
|
+
time: candle.from
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
##### Traders Sentiment Stream
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { IQOptionStreamOptionTradersSentiment } from 'iq-option-client';
|
|
152
|
+
|
|
153
|
+
const sentimentStream = new IQOptionStreamOptionTradersSentiment(
|
|
154
|
+
api.getIQOptionWs(),
|
|
155
|
+
IQOptionMarket.EURUSD
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
await sentimentStream.startStream();
|
|
159
|
+
|
|
160
|
+
sentimentStream.on('data', (data) => {
|
|
161
|
+
console.log('Traders sentiment:', data.value);
|
|
162
|
+
// value > 0.8 = strong buy sentiment
|
|
163
|
+
// value < 0.22 = strong sell sentiment
|
|
164
|
+
});
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
##### Option Close Stream
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { IQOptionStreamOptionClose } from 'iq-option-client';
|
|
171
|
+
|
|
172
|
+
const closeStream = new IQOptionStreamOptionClose(api.getIQOptionWs());
|
|
173
|
+
|
|
174
|
+
await closeStream.startStream();
|
|
175
|
+
|
|
176
|
+
closeStream.on('data', (data) => {
|
|
177
|
+
console.log('Option closed:', {
|
|
178
|
+
result: data.win,
|
|
179
|
+
profit: data.profit,
|
|
180
|
+
optionId: data.option_id
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
##### User Alerts Stream
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
import { IQOptionStreamUserAlerts } from 'iq-option-client';
|
|
189
|
+
|
|
190
|
+
const alertsStream = new IQOptionStreamUserAlerts(api.getIQOptionWs());
|
|
191
|
+
|
|
192
|
+
await alertsStream.startStream();
|
|
193
|
+
await alertsStream.subscribe();
|
|
194
|
+
|
|
195
|
+
alertsStream.on('data', (alert) => {
|
|
196
|
+
console.log('User alert:', alert);
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Advanced Usage
|
|
201
|
+
|
|
202
|
+
#### Using Design Patterns
|
|
203
|
+
|
|
204
|
+
The library implements several design patterns for extensibility:
|
|
205
|
+
|
|
206
|
+
##### Strategy Pattern - Order Types
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
import {
|
|
210
|
+
BinaryOrderStrategy,
|
|
211
|
+
DigitalOrderStrategy,
|
|
212
|
+
WebSocketRepository
|
|
213
|
+
} from 'iq-option-client';
|
|
214
|
+
|
|
215
|
+
const repository = new WebSocketRepository(api.getIQOptionWs());
|
|
216
|
+
|
|
217
|
+
// Binary order strategy
|
|
218
|
+
const binaryStrategy = new BinaryOrderStrategy(repository, 90); // 90% profit
|
|
219
|
+
await binaryStrategy.execute(market, side, time, balanceId, amount);
|
|
220
|
+
|
|
221
|
+
// Digital order strategy
|
|
222
|
+
const digitalStrategy = new DigitalOrderStrategy(repository, instrumentIndex);
|
|
223
|
+
await digitalStrategy.execute(market, side, time, balanceId, amount);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
##### Builder Pattern - Order Construction
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
import { OrderBuilder, IQOptionMarket, IQOptionModel } from 'iq-option-client';
|
|
230
|
+
|
|
231
|
+
const order = new OrderBuilder()
|
|
232
|
+
.withMarket(IQOptionMarket.EURUSD_OTC)
|
|
233
|
+
.withSide(IQOptionModel.BUY)
|
|
234
|
+
.withTime(iqOptionExpired(1))
|
|
235
|
+
.withBalance(balanceId)
|
|
236
|
+
.withAmount(10)
|
|
237
|
+
.withProfitPercent(90)
|
|
238
|
+
.build();
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
##### Factory Pattern - Stream Creation
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
import { StreamFactory, StreamType } from 'iq-option-client';
|
|
245
|
+
|
|
246
|
+
const factory = new StreamFactory(api.getIQOptionWs());
|
|
247
|
+
|
|
248
|
+
const candleStream = factory.create(
|
|
249
|
+
StreamType.CANDLE,
|
|
250
|
+
IQOptionMarket.EURUSD,
|
|
251
|
+
IQOptionTime.ONE_MINUTE
|
|
252
|
+
);
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
##### Command Pattern - Encapsulated Operations
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
import {
|
|
259
|
+
SendOrderCommand,
|
|
260
|
+
GetProfileCommand,
|
|
261
|
+
CommandInvoker
|
|
262
|
+
} from 'iq-option-client';
|
|
263
|
+
|
|
264
|
+
const invoker = new CommandInvoker();
|
|
265
|
+
|
|
266
|
+
// Execute order command
|
|
267
|
+
const orderCommand = new SendOrderCommand(strategy, orderRequest);
|
|
268
|
+
const result = await invoker.execute(orderCommand);
|
|
269
|
+
|
|
270
|
+
// Execute profile command
|
|
271
|
+
const profileCommand = new GetProfileCommand(repository);
|
|
272
|
+
const profile = await invoker.execute(profileCommand);
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Error Handling
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
import {
|
|
279
|
+
IQOptionError,
|
|
280
|
+
AuthenticationError,
|
|
281
|
+
ConnectionError,
|
|
282
|
+
OrderError,
|
|
283
|
+
TimeoutError,
|
|
284
|
+
ErrorHandler
|
|
285
|
+
} from 'iq-option-client';
|
|
286
|
+
|
|
287
|
+
try {
|
|
288
|
+
await api.connectAsync();
|
|
289
|
+
} catch (error) {
|
|
290
|
+
if (error instanceof AuthenticationError) {
|
|
291
|
+
console.error('Authentication failed:', error.message);
|
|
292
|
+
} else if (error instanceof ConnectionError) {
|
|
293
|
+
console.error('Connection failed:', error.message);
|
|
294
|
+
// Connection errors are retryable
|
|
295
|
+
} else if (error instanceof TimeoutError) {
|
|
296
|
+
console.error('Operation timed out:', error.message);
|
|
297
|
+
} else if (error instanceof IQOptionError) {
|
|
298
|
+
console.error('IQ Option error:', error.toJSON());
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Logging
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
import { LoggerFactory } from 'iq-option-client';
|
|
307
|
+
|
|
308
|
+
const logger = LoggerFactory.create({
|
|
309
|
+
className: 'MyClass',
|
|
310
|
+
methodName: 'myMethod'
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
logger.info('Operation started', { operation: 'trade' });
|
|
314
|
+
logger.debug('Debug information', { metadata: { value: 123 } });
|
|
315
|
+
logger.error('Error occurred', { operation: 'trade' }, error);
|
|
316
|
+
logger.performance('Operation completed', 150, { operation: 'trade' });
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Input Validation
|
|
320
|
+
|
|
321
|
+
All public methods include built-in validation:
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
// These will throw IQOptionError if invalid
|
|
325
|
+
await api.sendOrderBinary(
|
|
326
|
+
IQOptionMarket.EURUSD_OTC, // Validated
|
|
327
|
+
IQOptionModel.BUY, // Validated
|
|
328
|
+
iqOptionExpired(1), // Validated (> 0)
|
|
329
|
+
balanceId, // Validated (> 0)
|
|
330
|
+
90, // Validated (0-100)
|
|
331
|
+
10 // Validated (> 0)
|
|
332
|
+
);
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## 🎯 API Reference
|
|
336
|
+
|
|
337
|
+
### Enums
|
|
338
|
+
|
|
339
|
+
- `IQOptionMarket` - Available markets (EURUSD, EURUSD_OTC, etc.)
|
|
340
|
+
- `IQOptionModel` - Order direction (BUY, SELL)
|
|
341
|
+
- `IQOptionTime` - Time intervals (ONE_MINUTE, FIVE_MINUTES, etc.)
|
|
342
|
+
- `IQOptionCurrency` - Currency types (USD, EUR, etc.)
|
|
343
|
+
- `IQOptionCurrencyType` - Balance types (FIAT, TEST, etc.)
|
|
344
|
+
|
|
345
|
+
### Main Classes
|
|
346
|
+
|
|
347
|
+
- `IQOptionApi` - Main API client
|
|
348
|
+
- `IQOptionWs` - WebSocket client
|
|
349
|
+
- `IQOptionWrapper` - Authentication wrapper
|
|
350
|
+
- `IQOptionStreamCandleGenerated` - Candle data stream
|
|
351
|
+
- `IQOptionStreamOptionClose` - Option close events stream
|
|
352
|
+
- `IQOptionStreamOptionTradersSentiment` - Traders sentiment stream
|
|
353
|
+
- `IQOptionStreamUserAlerts` - User alerts stream
|
|
354
|
+
|
|
355
|
+
### Helper Functions
|
|
356
|
+
|
|
357
|
+
- `iqOptionExpired(minutes)` - Calculate expiration timestamp
|
|
358
|
+
- `LoggerFactory` - Create logger instances
|
|
359
|
+
- `RequestIdGenerator` - Generate unique request IDs
|
|
360
|
+
- `InputValidator` - Validate input parameters
|
|
361
|
+
|
|
362
|
+
## 🔧 Configuration
|
|
363
|
+
|
|
364
|
+
### Environment Variables
|
|
365
|
+
|
|
366
|
+
```env
|
|
367
|
+
# Required
|
|
368
|
+
IQ_OPTION_EMAIL=your-email@example.com
|
|
369
|
+
IQ_OPTION_PASSWORD=your-password
|
|
370
|
+
|
|
371
|
+
# Optional - Logging
|
|
372
|
+
LOG_LEVEL=info # debug, info, warn, error
|
|
373
|
+
LOG_DIR=./logs # Directory for log files
|
|
374
|
+
IQC_LOG_LEVEL=info # Library-specific log level
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Logging Configuration
|
|
378
|
+
|
|
379
|
+
The library uses Winston for logging. Configure via environment variables:
|
|
380
|
+
|
|
381
|
+
- `LOG_LEVEL` - Global log level (default: `info`)
|
|
382
|
+
- `LOG_DIR` - Directory for log files (optional, enables file logging)
|
|
383
|
+
- `IQC_LOG_LEVEL` - Library-specific log level
|
|
384
|
+
|
|
385
|
+
## 🧪 Testing
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
# Run tests
|
|
389
|
+
npm test
|
|
390
|
+
|
|
391
|
+
# Run tests with coverage
|
|
392
|
+
npm run test:coverage
|
|
393
|
+
|
|
394
|
+
# Run sample application
|
|
395
|
+
npm run sample:iqoption
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
**Note:** Tests require valid IQ Option credentials set in environment variables:
|
|
399
|
+
- `TEST_IQ_OPTION_EMAIL` or `IQ_OPTION_EMAIL`
|
|
400
|
+
- `TEST_IQ_OPTION_PASSWORD` or `IQ_OPTION_PASSWORD`
|
|
401
|
+
|
|
402
|
+
## 📋 Requirements
|
|
403
|
+
|
|
404
|
+
- Node.js >= 14.0.0
|
|
405
|
+
- TypeScript >= 5.0.0 (for TypeScript projects)
|
|
406
|
+
|
|
407
|
+
## 🏗️ Architecture
|
|
408
|
+
|
|
409
|
+
This library follows SOLID principles and implements several design patterns:
|
|
410
|
+
|
|
411
|
+
- **Single Responsibility Principle** - Each class has a single, well-defined purpose
|
|
412
|
+
- **Open/Closed Principle** - Extensible through interfaces and strategies
|
|
413
|
+
- **Liskov Substitution Principle** - Interfaces can be substituted
|
|
414
|
+
- **Interface Segregation** - Focused, specific interfaces
|
|
415
|
+
- **Dependency Inversion** - Dependencies injected via constructors
|
|
416
|
+
|
|
417
|
+
### Design Patterns
|
|
418
|
+
|
|
419
|
+
- **Strategy Pattern** - Different order execution strategies
|
|
420
|
+
- **Repository Pattern** - Data access abstraction
|
|
421
|
+
- **Factory Pattern** - Stream creation
|
|
422
|
+
- **Command Pattern** - Encapsulated operations
|
|
423
|
+
- **Builder Pattern** - Fluent object construction
|
|
424
|
+
- **Adapter Pattern** - Stream interface unification
|
|
425
|
+
|
|
426
|
+
## 🔒 Security
|
|
427
|
+
|
|
428
|
+
- **Never commit credentials** - Always use environment variables
|
|
429
|
+
- **Use `.env` file** - Add `.env` to `.gitignore`
|
|
430
|
+
- **Validate inputs** - All public methods validate inputs
|
|
431
|
+
- **Error handling** - Comprehensive error handling prevents information leakage
|
|
432
|
+
|
|
433
|
+
## 📝 Examples
|
|
434
|
+
|
|
435
|
+
### Complete Trading Bot Example
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
import {
|
|
439
|
+
IQOptionApi,
|
|
440
|
+
IQOptionMarket,
|
|
441
|
+
IQOptionModel,
|
|
442
|
+
IQOptionTime,
|
|
443
|
+
IQOptionCurrencyType,
|
|
444
|
+
IQOptionStreamCandleGenerated,
|
|
445
|
+
IQOptionStreamOptionTradersSentiment,
|
|
446
|
+
iqOptionExpired,
|
|
447
|
+
LoggerFactory
|
|
448
|
+
} from 'iq-option-client';
|
|
449
|
+
|
|
450
|
+
const logger = LoggerFactory.getDefault();
|
|
451
|
+
const api = new IQOptionApi(
|
|
452
|
+
process.env.IQ_OPTION_EMAIL!,
|
|
453
|
+
process.env.IQ_OPTION_PASSWORD!
|
|
454
|
+
);
|
|
455
|
+
|
|
456
|
+
// Connect
|
|
457
|
+
const profile = await api.connectAsync();
|
|
458
|
+
const testBalance = profile.balances.find(
|
|
459
|
+
b => b.type === IQOptionCurrencyType.TEST
|
|
460
|
+
);
|
|
461
|
+
|
|
462
|
+
// Setup sentiment stream
|
|
463
|
+
const sentimentStream = new IQOptionStreamOptionTradersSentiment(
|
|
464
|
+
api.getIQOptionWs(),
|
|
465
|
+
IQOptionMarket.EURUSD
|
|
466
|
+
);
|
|
467
|
+
await sentimentStream.startStream();
|
|
468
|
+
|
|
469
|
+
sentimentStream.on('data', async (data) => {
|
|
470
|
+
if (data.value > 0.8) {
|
|
471
|
+
logger.info('Strong buy signal detected');
|
|
472
|
+
// Execute buy order
|
|
473
|
+
await api.sendOrderBinary(
|
|
474
|
+
IQOptionMarket.EURUSD_OTC,
|
|
475
|
+
IQOptionModel.BUY,
|
|
476
|
+
iqOptionExpired(1),
|
|
477
|
+
testBalance!.id,
|
|
478
|
+
90,
|
|
479
|
+
10
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
// Setup candle stream for analysis
|
|
485
|
+
const candleStream = new IQOptionStreamCandleGenerated(
|
|
486
|
+
api.getIQOptionWs(),
|
|
487
|
+
IQOptionMarket.EURUSD,
|
|
488
|
+
IQOptionTime.ONE_MINUTE
|
|
489
|
+
);
|
|
490
|
+
await candleStream.startStream();
|
|
491
|
+
|
|
492
|
+
candleStream.on('data', (candle) => {
|
|
493
|
+
// Perform technical analysis
|
|
494
|
+
logger.debug('New candle received', { candle });
|
|
495
|
+
});
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## 🤝 Contributing
|
|
499
|
+
|
|
500
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
501
|
+
|
|
502
|
+
1. Fork the repository
|
|
503
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
504
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
505
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
506
|
+
5. Open a Pull Request
|
|
507
|
+
|
|
508
|
+
## 📄 License
|
|
509
|
+
|
|
510
|
+
This project is licensed under the ISC License - see the LICENSE file for details.
|
|
511
|
+
|
|
512
|
+
## 👤 Author
|
|
513
|
+
|
|
514
|
+
**Wellington Rocha**
|
|
515
|
+
|
|
516
|
+
## 🙏 Acknowledgments
|
|
517
|
+
|
|
518
|
+
- IQ Option for providing the WebSocket API
|
|
519
|
+
- All contributors and users of this library
|
|
520
|
+
|
|
521
|
+
## ⚠️ Disclaimer
|
|
522
|
+
|
|
523
|
+
This library is not officially affiliated with IQ Option. Use at your own risk. Trading involves substantial risk of loss. Only trade with money you can afford to lose.
|
|
524
|
+
|
|
525
|
+
## 📞 Support
|
|
526
|
+
|
|
527
|
+
For issues, questions, or contributions, please open an issue on GitHub.
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
Made with ❤️ by the community
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findUserBalanceFiat = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (C) 2020 Wellington Rocha
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
9
|
+
*
|
|
10
|
+
* Proprietary and confidential.
|
|
11
|
+
*/
|
|
12
|
+
// Load environment variables from .env file if it exists
|
|
13
|
+
try {
|
|
14
|
+
require("dotenv").config();
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
// dotenv is optional, continue without it
|
|
18
|
+
}
|
|
19
|
+
const Core = require("../lib");
|
|
20
|
+
const Logger_1 = require("../lib/Helper/Logger");
|
|
21
|
+
// Get credentials from environment variables
|
|
22
|
+
const email = process.env.IQ_OPTION_EMAIL;
|
|
23
|
+
const password = process.env.IQ_OPTION_PASSWORD;
|
|
24
|
+
if (!email || !password) {
|
|
25
|
+
// eslint-disable-next-line no-console
|
|
26
|
+
console.error("Error: IQ_OPTION_EMAIL and IQ_OPTION_PASSWORD environment variables are required");
|
|
27
|
+
// eslint-disable-next-line no-console
|
|
28
|
+
console.error("Please set them in your .env file or environment");
|
|
29
|
+
// eslint-disable-next-line no-console
|
|
30
|
+
console.error("See .env.example for reference");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const logger = Logger_1.LoggerFactory.getDefault();
|
|
34
|
+
const iqOptionApi = new Core.IQOptionApi(email, password);
|
|
35
|
+
const candles = {
|
|
36
|
+
open: [],
|
|
37
|
+
close: [],
|
|
38
|
+
high: [],
|
|
39
|
+
low: [],
|
|
40
|
+
};
|
|
41
|
+
const findUserBalanceFiat = (balances, currency, test = false) => {
|
|
42
|
+
if (test) {
|
|
43
|
+
return balances.filter((f) => f.type === Core.IQOptionCurrencyType.TEST)[0];
|
|
44
|
+
}
|
|
45
|
+
return balances.filter((f) => f.currency === currency && f.type === Core.IQOptionCurrencyType.FIAT)[0];
|
|
46
|
+
};
|
|
47
|
+
exports.findUserBalanceFiat = findUserBalanceFiat;
|
|
48
|
+
iqOptionApi
|
|
49
|
+
.connectAsync()
|
|
50
|
+
.then(async (profile) => {
|
|
51
|
+
logger.info("Connected successfully", { operation: "connect", userId: profile.user_id });
|
|
52
|
+
const market = Core.IQOptionMarket.EURUSD;
|
|
53
|
+
// Setup traders sentiment stream
|
|
54
|
+
const tradersSentiment = new Core.IQOptionStreamOptionTradersSentiment(iqOptionApi.getIQOptionWs(), market);
|
|
55
|
+
await tradersSentiment.startStream();
|
|
56
|
+
logger.info("Traders sentiment stream started", { market });
|
|
57
|
+
tradersSentiment.on("data", async (data) => {
|
|
58
|
+
logger.debug("Traders sentiment data received", { metadata: { value: data.value } });
|
|
59
|
+
if (data.value > 0.8) {
|
|
60
|
+
logger.info("Buy signal detected", { metadata: { value: data.value } });
|
|
61
|
+
// Add your buy logic here
|
|
62
|
+
}
|
|
63
|
+
if (data.value < 0.22) {
|
|
64
|
+
logger.info("Sell signal detected", { metadata: { value: data.value } });
|
|
65
|
+
// Add your sell logic here
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
// Setup candle stream
|
|
70
|
+
const time = Core.IQOptionTime.ONE_MINUTE;
|
|
71
|
+
const candleStream = new Core.IQOptionStreamCandleGenerated(iqOptionApi.getIQOptionWs(), market, time);
|
|
72
|
+
await candleStream.startStream();
|
|
73
|
+
logger.info("Candle stream started", { market, metadata: { time } });
|
|
74
|
+
candleStream.on("data", (data) => {
|
|
75
|
+
candles.open.unshift(data.open);
|
|
76
|
+
candles.close.unshift(data.close);
|
|
77
|
+
candles.high.unshift(data.max);
|
|
78
|
+
candles.low.unshift(data.min);
|
|
79
|
+
// Keep only last 100 candles
|
|
80
|
+
candles.open = candles.open.slice(0, 100);
|
|
81
|
+
candles.close = candles.close.slice(0, 100);
|
|
82
|
+
candles.high = candles.high.slice(0, 100);
|
|
83
|
+
candles.low = candles.low.slice(0, 100);
|
|
84
|
+
if (candles.close.length > 50) {
|
|
85
|
+
logger.debug("Candles updated", {
|
|
86
|
+
metadata: {
|
|
87
|
+
count: candles.close.length,
|
|
88
|
+
latestClose: candles.close[0]
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
// Add your technical analysis here (RSI, MACD, etc.)
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
})
|
|
95
|
+
.catch((e) => {
|
|
96
|
+
const error = e instanceof Error ? e : new Error(String(e));
|
|
97
|
+
logger.error("Application error", { operation: "main" }, error);
|
|
98
|
+
process.exit(1);
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSVFPcHRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYmluL0lRT3B0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7O0dBT0c7QUFDSCx5REFBeUQ7QUFDekQsSUFBSSxDQUFDO0lBQ0QsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFDO0FBQy9CLENBQUM7QUFBQyxPQUFPLENBQUMsRUFBRSxDQUFDO0lBQ1QsMENBQTBDO0FBQzlDLENBQUM7QUFFRCwrQkFBK0I7QUFDL0IsaURBQXFEO0FBRXJELDZDQUE2QztBQUM3QyxNQUFNLEtBQUssR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLGVBQWUsQ0FBQztBQUMxQyxNQUFNLFFBQVEsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLGtCQUFrQixDQUFDO0FBRWhELElBQUksQ0FBQyxLQUFLLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQztJQUN0QixzQ0FBc0M7SUFDdEMsT0FBTyxDQUFDLEtBQUssQ0FBQyxrRkFBa0YsQ0FBQyxDQUFDO0lBQ2xHLHNDQUFzQztJQUN0QyxPQUFPLENBQUMsS0FBSyxDQUFDLGtEQUFrRCxDQUFDLENBQUM7SUFDbEUsc0NBQXNDO0lBQ3RDLE9BQU8sQ0FBQyxLQUFLLENBQUMsZ0NBQWdDLENBQUMsQ0FBQztJQUNoRCxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQ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yxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNwQixDQUFDLENBQUMsQ0FBQyJ9
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./lib";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/*
|
|
18
|
+
* Copyright (C) 2020 Wellington Rocha
|
|
19
|
+
* All Rights Reserved.
|
|
20
|
+
*
|
|
21
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
22
|
+
*
|
|
23
|
+
* Proprietary and confidential.
|
|
24
|
+
*/
|
|
25
|
+
__exportStar(require("./lib"), exports);
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBOzs7Ozs7O0dBT0c7QUFDSCx3Q0FBc0IifQ==
|