@stoqey/ib 1.2.16 → 1.2.20
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 +1 -1
- package/dist/api/contract/future.d.ts +6 -5
- package/dist/api/contract/future.js +4 -6
- package/dist/api/contract/future.js.map +1 -1
- package/dist/api/data/enum/sec-type.d.ts +3 -1
- package/dist/api/data/enum/sec-type.js +2 -0
- package/dist/api/data/enum/sec-type.js.map +1 -1
- package/dist/api-next/api-next.d.ts +1 -1
- package/dist/api-next/api-next.js +1 -1
- package/dist/tools/contract-details.js +1 -1
- package/dist/tools/contract-details.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ ib.reqIds();
|
|
|
162
162
|
While IBApi uses a request function / event callback design where subscriptions are managed by the user, IBApiNext does use RxJS 7 to manage subscriptions.\
|
|
163
163
|
In general, there are two types of functions on IBApiNext:
|
|
164
164
|
|
|
165
|
-
-
|
|
165
|
+
- One-shot functions, returning a Promise, such as `IBApiNext.getCurrentTime` or `IBApiNext.getContractDetails`. Such functions will send a request to TWS and return the result (or error) on the Promise.
|
|
166
166
|
|
|
167
167
|
- Endless stream subscriptions, returning an Observable, such as `IBApiNext.getAccountSummary` or `IBApiNext.getMarketData`.
|
|
168
168
|
Such functions will deliver an endless stream of update events. The `complete` callback will NEVER be invoked (do not try to convert to a Promise - it will never resolve!)
|
|
@@ -5,11 +5,12 @@ import { Contract } from "./contract";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class Future implements Contract {
|
|
7
7
|
symbol: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exchange
|
|
11
|
-
multiplier
|
|
12
|
-
|
|
8
|
+
localSymbol: string;
|
|
9
|
+
lastTradeDateOrContractMonth: string;
|
|
10
|
+
exchange: string;
|
|
11
|
+
multiplier: number;
|
|
12
|
+
currency: string;
|
|
13
|
+
constructor(symbol: string, localSymbol: string, lastTradeDateOrContractMonth: string, exchange: string, multiplier: number, currency: string);
|
|
13
14
|
secType: SecType;
|
|
14
15
|
}
|
|
15
16
|
export default Future;
|
|
@@ -9,16 +9,14 @@ const sec_type_1 = __importDefault(require("../data/enum/sec-type"));
|
|
|
9
9
|
* A Future Option Contract
|
|
10
10
|
*/
|
|
11
11
|
class Future {
|
|
12
|
-
constructor(symbol,
|
|
13
|
-
var _a, _b;
|
|
12
|
+
constructor(symbol, localSymbol, lastTradeDateOrContractMonth, exchange, multiplier, currency) {
|
|
14
13
|
this.symbol = symbol;
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
14
|
+
this.localSymbol = localSymbol;
|
|
15
|
+
this.lastTradeDateOrContractMonth = lastTradeDateOrContractMonth;
|
|
17
16
|
this.exchange = exchange;
|
|
18
17
|
this.multiplier = multiplier;
|
|
18
|
+
this.currency = currency;
|
|
19
19
|
this.secType = sec_type_1.default.FUT;
|
|
20
|
-
this.currency = (_a = this.currency) !== null && _a !== void 0 ? _a : "USD";
|
|
21
|
-
this.exchange = (_b = this.exchange) !== null && _b !== void 0 ? _b : "ONE";
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
exports.Future = Future;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"future.js","sourceRoot":"","sources":["../../../src/api/contract/future.ts"],"names":[],"mappings":";;;;;;AAAA,qEAA4C;AAG5C;;GAEG;AACH,MAAa,MAAM;IACjB,YACS,MAAc,EACd,
|
|
1
|
+
{"version":3,"file":"future.js","sourceRoot":"","sources":["../../../src/api/contract/future.ts"],"names":[],"mappings":";;;;;;AAAA,qEAA4C;AAG5C;;GAEG;AACH,MAAa,MAAM;IACjB,YACS,MAAc,EACd,WAAmB,EACnB,4BAAoC,EACpC,QAAgB,EAChB,UAAkB,EAClB,QAAgB;QALhB,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAQ;QACnB,iCAA4B,GAA5B,4BAA4B,CAAQ;QACpC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAGlB,YAAO,GAAG,kBAAO,CAAC,GAAG,CAAC;IAF1B,CAAC;CAGL;AAXD,wBAWC;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -32,6 +32,8 @@ var SecType;
|
|
|
32
32
|
SecType["NEWS"] = "NEWS";
|
|
33
33
|
/** Mutual fund. */
|
|
34
34
|
SecType["FUND"] = "FUND";
|
|
35
|
+
/** Cryptocurrency. */
|
|
36
|
+
SecType["CRYPTO"] = "CRYPTO ";
|
|
35
37
|
})(SecType = exports.SecType || (exports.SecType = {}));
|
|
36
38
|
exports.default = SecType;
|
|
37
39
|
//# sourceMappingURL=sec-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sec-type.js","sourceRoot":"","sources":["../../../../src/api/data/enum/sec-type.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"sec-type.js","sourceRoot":"","sources":["../../../../src/api/data/enum/sec-type.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,OA0CX;AA1CD,WAAY,OAAO;IACjB,qBAAqB;IACrB,sBAAW,CAAA;IAEX,aAAa;IACb,sBAAW,CAAA;IAEX,YAAY;IACZ,sBAAW,CAAA;IAEX,YAAY;IACZ,sBAAW,CAAA;IAEX,sBAAsB;IACtB,sBAAW,CAAA;IAEX,+BAA+B;IAC/B,sBAAW,CAAA;IAEX,kBAAkB;IAClB,wBAAa,CAAA;IAEb,aAAa;IACb,sBAAW,CAAA;IAEX,eAAe;IACf,sBAAW,CAAA;IAEX,YAAY;IACZ,wBAAa,CAAA;IAEb,iBAAiB;IACjB,0BAAe,CAAA;IAEf,YAAY;IACZ,wBAAa,CAAA;IAEb,mBAAmB;IACnB,wBAAa,CAAA;IAEb,sBAAsB;IACtB,6BAAkB,CAAA;AACpB,CAAC,EA1CW,OAAO,GAAP,eAAO,KAAP,eAAO,QA0ClB;AAED,kBAAe,OAAO,CAAC"}
|
|
@@ -206,7 +206,7 @@ export declare class IBApiNext {
|
|
|
206
206
|
/** contractDetailsEnd event handler */
|
|
207
207
|
private readonly onContractDetailsEnd;
|
|
208
208
|
/**
|
|
209
|
-
* Request contract information
|
|
209
|
+
* Request contract information from TWS.
|
|
210
210
|
* This method will provide all the contracts matching the contract provided.
|
|
211
211
|
*
|
|
212
212
|
* It can also be used to retrieve complete options and futures chains.
|
|
@@ -977,7 +977,7 @@ class IBApiNext {
|
|
|
977
977
|
}, [[__1.EventName.position, this.onPosition]], "getPositions");
|
|
978
978
|
}
|
|
979
979
|
/**
|
|
980
|
-
* Request contract information
|
|
980
|
+
* Request contract information from TWS.
|
|
981
981
|
* This method will provide all the contracts matching the contract provided.
|
|
982
982
|
*
|
|
983
983
|
* It can also be used to retrieve complete options and futures chains.
|
|
@@ -19,7 +19,7 @@ const OPTION_ARGUMENTS = [
|
|
|
19
19
|
["symbol=<name>", "The symbol name."],
|
|
20
20
|
[
|
|
21
21
|
"sectype=<type>",
|
|
22
|
-
"The security type. Valid values: STK, OPT, FUT, IND, FOP, CFD, CASH, BAG, BOND, CMDTY, NEWS and
|
|
22
|
+
"The security type. Valid values: STK, OPT, FUT, IND, FOP, CFD, CASH, BAG, BOND, CMDTY, NEWS, FUND and CRYPTO.",
|
|
23
23
|
],
|
|
24
24
|
["exchange=<name>", "The destination exchange name."],
|
|
25
25
|
["currency=<currency>", "The contract currency."],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-details.js","sourceRoot":"","sources":["../../src/tools/contract-details.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAEH,gDAAwB;AAIxB,8DAAsC;AACtC,8DAAwD;AAExD,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AAEjF,MAAM,gBAAgB,GACpB,8DAA8D,CAAC;AACjE,MAAM,UAAU,GAAG,sCAAsC,CAAC;AAC1D,MAAM,gBAAgB,GAAuB;IAC3C,CAAC,gBAAgB,EAAE,sCAAsC,CAAC;IAC1D,CAAC,eAAe,EAAE,kBAAkB,CAAC;IACrC;QACE,gBAAgB;QAChB
|
|
1
|
+
{"version":3,"file":"contract-details.js","sourceRoot":"","sources":["../../src/tools/contract-details.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAEH,gDAAwB;AAIxB,8DAAsC;AACtC,8DAAwD;AAExD,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AAEjF,MAAM,gBAAgB,GACpB,8DAA8D,CAAC;AACjE,MAAM,UAAU,GAAG,sCAAsC,CAAC;AAC1D,MAAM,gBAAgB,GAAuB;IAC3C,CAAC,gBAAgB,EAAE,sCAAsC,CAAC;IAC1D,CAAC,eAAe,EAAE,kBAAkB,CAAC;IACrC;QACE,gBAAgB;QAChB,+GAA+G;KAChH;IACD,CAAC,iBAAiB,EAAE,gCAAgC,CAAC;IACrD,CAAC,qBAAqB,EAAE,wBAAwB,CAAC;IACjD;QACE,iBAAiB;QACjB,8EAA8E;YAC5E,gIAAgI;KACnI;IACD,CAAC,iBAAiB,EAAE,4BAA4B,CAAC;IACjD,CAAC,aAAa,EAAE,qDAAqD,CAAC;CACvE,CAAC;AACF,MAAM,YAAY,GAChB,6DAA6D,CAAC;AAEhE,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAE9E,MAAM,uBAAwB,SAAQ,8BAAY;IAChD;QACE,KAAK,CAAC,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,KAAK;;QACH,MAAM,UAAU,GAAG,cAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC7C,gBAAM,CAAC,KAAK,CAAC,YAAY,UAAU,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;QAEf,IAAI,CAAC,GAAG;aACL,kBAAkB,CAAC;YAClB,MAAM,EAAE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