@kkkermit/trading212.js 0.1.2 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @kkkermit/trading212.js
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - e1c9cee: Updated the API types to the latest Trading 212 spec.
8
+
3
9
  ## 0.1.2
4
10
 
5
11
  ### Patch Changes
@@ -1316,7 +1316,7 @@ var PortfolioResource = class {
1316
1316
  };
1317
1317
 
1318
1318
  // src/version.ts
1319
- var VERSION = "0.1.2" ;
1319
+ var VERSION = "0.1.3" ;
1320
1320
 
1321
1321
  // src/http/retry.ts
1322
1322
  var DEFAULT_RETRY = { maxAttempts: 3, baseDelayMs: 500, maxDelayMs: 1e4 };
@@ -1314,7 +1314,7 @@ var PortfolioResource = class {
1314
1314
  };
1315
1315
 
1316
1316
  // src/version.ts
1317
- var VERSION = "0.1.2" ;
1317
+ var VERSION = "0.1.3" ;
1318
1318
 
1319
1319
  // src/http/retry.ts
1320
1320
  var DEFAULT_RETRY = { maxAttempts: 3, baseDelayMs: 500, maxDelayMs: 1e4 };
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import { readFileSync } from "fs";
5
5
  import { parseArgs, parseEnv } from "util";
6
6
 
7
7
  // src/version.ts
8
- var VERSION = true ? "0.1.2" : "0.0.0-dev";
8
+ var VERSION = true ? "0.1.3" : "0.0.0-dev";
9
9
 
10
10
  // src/cli/doctor.ts
11
11
  import { styleText } from "util";
@@ -915,7 +915,7 @@ interface Instrument$1 {
915
915
  ticker?: string | null;
916
916
  }
917
917
  interface InstrumentIssue {
918
- name?: "DELISTED" | "SUSPENDED" | "NO_LONGER_TRADABLE" | "MAX_POSITION_SIZE_REACHED" | "APPROACHING_MAX_POSITION_SIZE" | "COMPLEX_INSTRUMENT_APP_TEST_REQUIRED" | "PRICE_TOO_LOW" | (string & {}) | null;
918
+ name?: "DELISTED" | "SUSPENDED" | "NO_LONGER_TRADABLE" | "MAX_POSITION_SIZE_REACHED" | "APPROACHING_MAX_POSITION_SIZE" | "COMPLEX_INSTRUMENT_APP_TEST_REQUIRED" | "PRICE_TOO_LOW" | "IPO_INSTRUMENT_NOT_AVAILABLE" | "ETN_RECONFIRMATION_REQUIRED" | "ETN_FINAL_RISK_CONFIRMATION_REQUIRED" | (string & {}) | null;
919
919
  severity?: "IRREVERSIBLE" | "REVERSIBLE" | "INFORMATIVE" | (string & {}) | null;
920
920
  }
921
921
  interface InvestmentResult {
@@ -915,7 +915,7 @@ interface Instrument$1 {
915
915
  ticker?: string | null;
916
916
  }
917
917
  interface InstrumentIssue {
918
- name?: "DELISTED" | "SUSPENDED" | "NO_LONGER_TRADABLE" | "MAX_POSITION_SIZE_REACHED" | "APPROACHING_MAX_POSITION_SIZE" | "COMPLEX_INSTRUMENT_APP_TEST_REQUIRED" | "PRICE_TOO_LOW" | (string & {}) | null;
918
+ name?: "DELISTED" | "SUSPENDED" | "NO_LONGER_TRADABLE" | "MAX_POSITION_SIZE_REACHED" | "APPROACHING_MAX_POSITION_SIZE" | "COMPLEX_INSTRUMENT_APP_TEST_REQUIRED" | "PRICE_TOO_LOW" | "IPO_INSTRUMENT_NOT_AVAILABLE" | "ETN_RECONFIRMATION_REQUIRED" | "ETN_FINAL_RISK_CONFIRMATION_REQUIRED" | (string & {}) | null;
919
919
  severity?: "IRREVERSIBLE" | "REVERSIBLE" | "INFORMATIVE" | (string & {}) | null;
920
920
  }
921
921
  interface InvestmentResult {
package/dist/index.cjs CHANGED
@@ -1,154 +1,154 @@
1
1
  'use strict';
2
2
 
3
- var chunkK766TWIM_cjs = require('./chunk-K766TWIM.cjs');
3
+ var chunk5FW6NZDM_cjs = require('./chunk-5FW6NZDM.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "AuthenticationError", {
8
8
  enumerable: true,
9
- get: function () { return chunkK766TWIM_cjs.AuthenticationError; }
9
+ get: function () { return chunk5FW6NZDM_cjs.AuthenticationError; }
10
10
  });
11
11
  Object.defineProperty(exports, "BASE_URLS", {
12
12
  enumerable: true,
13
- get: function () { return chunkK766TWIM_cjs.BASE_URLS; }
13
+ get: function () { return chunk5FW6NZDM_cjs.BASE_URLS; }
14
14
  });
15
15
  Object.defineProperty(exports, "ConfigurationError", {
16
16
  enumerable: true,
17
- get: function () { return chunkK766TWIM_cjs.ConfigurationError; }
17
+ get: function () { return chunk5FW6NZDM_cjs.ConfigurationError; }
18
18
  });
19
19
  Object.defineProperty(exports, "ENDPOINTS", {
20
20
  enumerable: true,
21
- get: function () { return chunkK766TWIM_cjs.ENDPOINTS; }
21
+ get: function () { return chunk5FW6NZDM_cjs.ENDPOINTS; }
22
22
  });
23
23
  Object.defineProperty(exports, "FINAL_ORDER_STATUSES", {
24
24
  enumerable: true,
25
- get: function () { return chunkK766TWIM_cjs.FINAL_ORDER_STATUSES; }
25
+ get: function () { return chunk5FW6NZDM_cjs.FINAL_ORDER_STATUSES; }
26
26
  });
27
27
  Object.defineProperty(exports, "HttpError", {
28
28
  enumerable: true,
29
- get: function () { return chunkK766TWIM_cjs.HttpError; }
29
+ get: function () { return chunk5FW6NZDM_cjs.HttpError; }
30
30
  });
31
31
  Object.defineProperty(exports, "InstrumentNotFoundError", {
32
32
  enumerable: true,
33
- get: function () { return chunkK766TWIM_cjs.InstrumentNotFoundError; }
33
+ get: function () { return chunk5FW6NZDM_cjs.InstrumentNotFoundError; }
34
34
  });
35
35
  Object.defineProperty(exports, "MemoryCache", {
36
36
  enumerable: true,
37
- get: function () { return chunkK766TWIM_cjs.MemoryCache; }
37
+ get: function () { return chunk5FW6NZDM_cjs.MemoryCache; }
38
38
  });
39
39
  Object.defineProperty(exports, "MissingScopeError", {
40
40
  enumerable: true,
41
- get: function () { return chunkK766TWIM_cjs.MissingScopeError; }
41
+ get: function () { return chunk5FW6NZDM_cjs.MissingScopeError; }
42
42
  });
43
43
  Object.defineProperty(exports, "NetworkError", {
44
44
  enumerable: true,
45
- get: function () { return chunkK766TWIM_cjs.NetworkError; }
45
+ get: function () { return chunk5FW6NZDM_cjs.NetworkError; }
46
46
  });
47
47
  Object.defineProperty(exports, "NotAvailableInDemoError", {
48
48
  enumerable: true,
49
- get: function () { return chunkK766TWIM_cjs.NotAvailableInDemoError; }
49
+ get: function () { return chunk5FW6NZDM_cjs.NotAvailableInDemoError; }
50
50
  });
51
51
  Object.defineProperty(exports, "NotFoundError", {
52
52
  enumerable: true,
53
- get: function () { return chunkK766TWIM_cjs.NotFoundError; }
53
+ get: function () { return chunk5FW6NZDM_cjs.NotFoundError; }
54
54
  });
55
55
  Object.defineProperty(exports, "OrderOutcomeUnknownError", {
56
56
  enumerable: true,
57
- get: function () { return chunkK766TWIM_cjs.OrderOutcomeUnknownError; }
57
+ get: function () { return chunk5FW6NZDM_cjs.OrderOutcomeUnknownError; }
58
58
  });
59
59
  Object.defineProperty(exports, "OrderRejectedError", {
60
60
  enumerable: true,
61
- get: function () { return chunkK766TWIM_cjs.OrderRejectedError; }
61
+ get: function () { return chunk5FW6NZDM_cjs.OrderRejectedError; }
62
62
  });
63
63
  Object.defineProperty(exports, "PermissionError", {
64
64
  enumerable: true,
65
- get: function () { return chunkK766TWIM_cjs.PermissionError; }
65
+ get: function () { return chunk5FW6NZDM_cjs.PermissionError; }
66
66
  });
67
67
  Object.defineProperty(exports, "QUANTITY_DECIMALS", {
68
68
  enumerable: true,
69
- get: function () { return chunkK766TWIM_cjs.QUANTITY_DECIMALS; }
69
+ get: function () { return chunk5FW6NZDM_cjs.QUANTITY_DECIMALS; }
70
70
  });
71
71
  Object.defineProperty(exports, "RateLimitError", {
72
72
  enumerable: true,
73
- get: function () { return chunkK766TWIM_cjs.RateLimitError; }
73
+ get: function () { return chunk5FW6NZDM_cjs.RateLimitError; }
74
74
  });
75
75
  Object.defineProperty(exports, "SPEC_VERSION", {
76
76
  enumerable: true,
77
- get: function () { return chunkK766TWIM_cjs.SPEC_VERSION; }
77
+ get: function () { return chunk5FW6NZDM_cjs.SPEC_VERSION; }
78
78
  });
79
79
  Object.defineProperty(exports, "ServerError", {
80
80
  enumerable: true,
81
- get: function () { return chunkK766TWIM_cjs.ServerError; }
81
+ get: function () { return chunk5FW6NZDM_cjs.ServerError; }
82
82
  });
83
83
  Object.defineProperty(exports, "TIME_VALIDITIES", {
84
84
  enumerable: true,
85
- get: function () { return chunkK766TWIM_cjs.TIME_VALIDITIES; }
85
+ get: function () { return chunk5FW6NZDM_cjs.TIME_VALIDITIES; }
86
86
  });
87
87
  Object.defineProperty(exports, "TimeoutError", {
88
88
  enumerable: true,
89
- get: function () { return chunkK766TWIM_cjs.TimeoutError; }
89
+ get: function () { return chunk5FW6NZDM_cjs.TimeoutError; }
90
90
  });
91
91
  Object.defineProperty(exports, "Trading212", {
92
92
  enumerable: true,
93
- get: function () { return chunkK766TWIM_cjs.Trading212; }
93
+ get: function () { return chunk5FW6NZDM_cjs.Trading212; }
94
94
  });
95
95
  Object.defineProperty(exports, "Trading212Error", {
96
96
  enumerable: true,
97
- get: function () { return chunkK766TWIM_cjs.Trading212Error; }
97
+ get: function () { return chunk5FW6NZDM_cjs.Trading212Error; }
98
98
  });
99
99
  Object.defineProperty(exports, "TradingDisabledError", {
100
100
  enumerable: true,
101
- get: function () { return chunkK766TWIM_cjs.TradingDisabledError; }
101
+ get: function () { return chunk5FW6NZDM_cjs.TradingDisabledError; }
102
102
  });
103
103
  Object.defineProperty(exports, "UnexpectedResponseError", {
104
104
  enumerable: true,
105
- get: function () { return chunkK766TWIM_cjs.UnexpectedResponseError; }
105
+ get: function () { return chunk5FW6NZDM_cjs.UnexpectedResponseError; }
106
106
  });
107
107
  Object.defineProperty(exports, "VERSION", {
108
108
  enumerable: true,
109
- get: function () { return chunkK766TWIM_cjs.VERSION; }
109
+ get: function () { return chunk5FW6NZDM_cjs.VERSION; }
110
110
  });
111
111
  Object.defineProperty(exports, "ValidationError", {
112
112
  enumerable: true,
113
- get: function () { return chunkK766TWIM_cjs.ValidationError; }
113
+ get: function () { return chunk5FW6NZDM_cjs.ValidationError; }
114
114
  });
115
115
  Object.defineProperty(exports, "buildPortfolioSnapshot", {
116
116
  enumerable: true,
117
- get: function () { return chunkK766TWIM_cjs.buildPortfolioSnapshot; }
117
+ get: function () { return chunk5FW6NZDM_cjs.buildPortfolioSnapshot; }
118
118
  });
119
119
  Object.defineProperty(exports, "consoleLogger", {
120
120
  enumerable: true,
121
- get: function () { return chunkK766TWIM_cjs.consoleLogger; }
121
+ get: function () { return chunk5FW6NZDM_cjs.consoleLogger; }
122
122
  });
123
123
  Object.defineProperty(exports, "decimalPlaces", {
124
124
  enumerable: true,
125
- get: function () { return chunkK766TWIM_cjs.decimalPlaces; }
125
+ get: function () { return chunk5FW6NZDM_cjs.decimalPlaces; }
126
126
  });
127
127
  Object.defineProperty(exports, "fieldsFirst", {
128
128
  enumerable: true,
129
- get: function () { return chunkK766TWIM_cjs.fieldsFirst; }
129
+ get: function () { return chunk5FW6NZDM_cjs.fieldsFirst; }
130
130
  });
131
131
  Object.defineProperty(exports, "isTrading212Error", {
132
132
  enumerable: true,
133
- get: function () { return chunkK766TWIM_cjs.isTrading212Error; }
133
+ get: function () { return chunk5FW6NZDM_cjs.isTrading212Error; }
134
134
  });
135
135
  Object.defineProperty(exports, "isValidQuantity", {
136
136
  enumerable: true,
137
- get: function () { return chunkK766TWIM_cjs.isValidQuantity; }
137
+ get: function () { return chunk5FW6NZDM_cjs.isValidQuantity; }
138
138
  });
139
139
  Object.defineProperty(exports, "parseErrorBody", {
140
140
  enumerable: true,
141
- get: function () { return chunkK766TWIM_cjs.parseErrorBody; }
141
+ get: function () { return chunk5FW6NZDM_cjs.parseErrorBody; }
142
142
  });
143
143
  Object.defineProperty(exports, "sessionAt", {
144
144
  enumerable: true,
145
- get: function () { return chunkK766TWIM_cjs.sessionAt; }
145
+ get: function () { return chunk5FW6NZDM_cjs.sessionAt; }
146
146
  });
147
147
  Object.defineProperty(exports, "silentLogger", {
148
148
  enumerable: true,
149
- get: function () { return chunkK766TWIM_cjs.silentLogger; }
149
+ get: function () { return chunk5FW6NZDM_cjs.silentLogger; }
150
150
  });
151
151
  Object.defineProperty(exports, "truncateQuantity", {
152
152
  enumerable: true,
153
- get: function () { return chunkK766TWIM_cjs.truncateQuantity; }
153
+ get: function () { return chunk5FW6NZDM_cjs.truncateQuantity; }
154
154
  });
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AccountBucketDetailedResponse, a as AccountBucketInstrumentResult, b as AccountBucketInstrumentsDetailedResponse, c as AccountBucketResultResponse, d as AccountResource, e as AccountSummary, f as AuthenticationError, B as BASE_URLS, C as CacheStore, g as CallOptions, h as Cash, i as ConfigurationError, j as ConsoleLike, D as Dividend, k as DividendDetails, l as DryRunResult, m as DuplicateBucketRequest, E as ENDPOINTS, n as EndpointBudget, o as EndpointDefinition, p as EndpointId, q as EndpointKind, r as EndpointRateLimit, s as EnqueuedReportResponse, t as EnvSource, u as Environment, v as ErrorCode, w as ErrorDetails, x as Exchange, y as ExchangesResource, z as ExportResult, F as FINAL_ORDER_STATUSES, G as FetchLike, H as FieldsFirstMethod, I as Fill, J as FillWalletImpact, K as HistoricalOrder, L as HistoryDividendItem, M as HistoryResource, N as HistoryTransactionItem, O as HoldingSnapshot, P as Hooks, Q as HttpError, R as HttpMethod, S as Instrument, T as InstrumentIssue, U as InstrumentNotFoundError, V as InstrumentSuggestion, W as InstrumentsResource, X as InvestmentResult, Y as Investments, Z as IterateOptions, _ as LimitOrderRequest, $ as LimitRequest, a0 as ListOptions, a1 as LogFields, a2 as LogLevel, a3 as Logger, a4 as MarketOrderRequest, a5 as MarketRequest, a6 as MarketSession, a7 as MarketStatus, a8 as MemoryCache, a9 as MissingScopeError, aa as NetworkError, ab as NotAvailableInDemoError, ac as NotFoundError, ad as Order, ae as OrderInput, af as OrderOutcomeUnknownError, ag as OrderRejectedError, ah as OrderRejectionReason, ai as OrderTimeValidity, aj as OrderType, ak as OrdersResource, al as Page, am as PageOptions, an as PagedList, ao as PaginatedResponseHistoricalOrder, ap as PaginatedResponseHistoryDividendItem, aq as PaginatedResponseHistoryTransactionItem, ar as PermissionError, as as Pie, at as PieDetails, au as PieInput, av as PieRequest, aw as PiesResource, ax as PlaceOptions, ay as Placed, az as PortfolioResource, aA as PortfolioSnapshot, aB as Position, aC as PositionWalletImpact, aD as PositionsResource, aE as PublicReportRequest, aF as RateLimitError, aG as RateLimitInfo, aH as RateLimitMode, aI as RateLimitWaitEvent, aJ as Report, aK as ReportDataIncluded, aL as ReportRequest, aM as ReportResponse, aN as ReportWaitOptions, aO as ReportsResource, aP as RequestDescription, aQ as RequestEvent, aR as ResolveOptions, aS as ResponseEvent, aT as RetryEvent, aU as RetryOptions, aV as SPEC_VERSION, aW as SearchOptions, aX as SellAllOptions, aY as ServerError, aZ as StopLimitOrderRequest, a_ as StopLimitRequest, a$ as StopOrderRequest, b0 as StopRequest, b1 as TIME_VALIDITIES, b2 as Tax, b3 as TimeEvent, b4 as TimeValidity, b5 as TimeoutError, b6 as TradableInstrument, b7 as Trading212, b8 as Trading212Error, b9 as Trading212Options, ba as TradingDisabledError, bb as Transaction, bc as UnexpectedResponseError, bd as ValidationError, be as ValidationIssue, bf as VerifyResult, bg as WaitOptions, bh as WorkingSchedule, bi as buildPortfolioSnapshot, bj as consoleLogger, bk as fieldsFirst, bl as isTrading212Error, bm as sessionAt, bn as silentLogger } from './client-BSQXqdxj.cjs';
1
+ export { A as AccountBucketDetailedResponse, a as AccountBucketInstrumentResult, b as AccountBucketInstrumentsDetailedResponse, c as AccountBucketResultResponse, d as AccountResource, e as AccountSummary, f as AuthenticationError, B as BASE_URLS, C as CacheStore, g as CallOptions, h as Cash, i as ConfigurationError, j as ConsoleLike, D as Dividend, k as DividendDetails, l as DryRunResult, m as DuplicateBucketRequest, E as ENDPOINTS, n as EndpointBudget, o as EndpointDefinition, p as EndpointId, q as EndpointKind, r as EndpointRateLimit, s as EnqueuedReportResponse, t as EnvSource, u as Environment, v as ErrorCode, w as ErrorDetails, x as Exchange, y as ExchangesResource, z as ExportResult, F as FINAL_ORDER_STATUSES, G as FetchLike, H as FieldsFirstMethod, I as Fill, J as FillWalletImpact, K as HistoricalOrder, L as HistoryDividendItem, M as HistoryResource, N as HistoryTransactionItem, O as HoldingSnapshot, P as Hooks, Q as HttpError, R as HttpMethod, S as Instrument, T as InstrumentIssue, U as InstrumentNotFoundError, V as InstrumentSuggestion, W as InstrumentsResource, X as InvestmentResult, Y as Investments, Z as IterateOptions, _ as LimitOrderRequest, $ as LimitRequest, a0 as ListOptions, a1 as LogFields, a2 as LogLevel, a3 as Logger, a4 as MarketOrderRequest, a5 as MarketRequest, a6 as MarketSession, a7 as MarketStatus, a8 as MemoryCache, a9 as MissingScopeError, aa as NetworkError, ab as NotAvailableInDemoError, ac as NotFoundError, ad as Order, ae as OrderInput, af as OrderOutcomeUnknownError, ag as OrderRejectedError, ah as OrderRejectionReason, ai as OrderTimeValidity, aj as OrderType, ak as OrdersResource, al as Page, am as PageOptions, an as PagedList, ao as PaginatedResponseHistoricalOrder, ap as PaginatedResponseHistoryDividendItem, aq as PaginatedResponseHistoryTransactionItem, ar as PermissionError, as as Pie, at as PieDetails, au as PieInput, av as PieRequest, aw as PiesResource, ax as PlaceOptions, ay as Placed, az as PortfolioResource, aA as PortfolioSnapshot, aB as Position, aC as PositionWalletImpact, aD as PositionsResource, aE as PublicReportRequest, aF as RateLimitError, aG as RateLimitInfo, aH as RateLimitMode, aI as RateLimitWaitEvent, aJ as Report, aK as ReportDataIncluded, aL as ReportRequest, aM as ReportResponse, aN as ReportWaitOptions, aO as ReportsResource, aP as RequestDescription, aQ as RequestEvent, aR as ResolveOptions, aS as ResponseEvent, aT as RetryEvent, aU as RetryOptions, aV as SPEC_VERSION, aW as SearchOptions, aX as SellAllOptions, aY as ServerError, aZ as StopLimitOrderRequest, a_ as StopLimitRequest, a$ as StopOrderRequest, b0 as StopRequest, b1 as TIME_VALIDITIES, b2 as Tax, b3 as TimeEvent, b4 as TimeValidity, b5 as TimeoutError, b6 as TradableInstrument, b7 as Trading212, b8 as Trading212Error, b9 as Trading212Options, ba as TradingDisabledError, bb as Transaction, bc as UnexpectedResponseError, bd as ValidationError, be as ValidationIssue, bf as VerifyResult, bg as WaitOptions, bh as WorkingSchedule, bi as buildPortfolioSnapshot, bj as consoleLogger, bk as fieldsFirst, bl as isTrading212Error, bm as sessionAt, bn as silentLogger } from './client-D4eKsdG_.cjs';
2
2
 
3
3
  interface ParsedErrorBody {
4
4
  /** Trading 212's own code, from `code`, or the last part of a problem-details `type`. */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AccountBucketDetailedResponse, a as AccountBucketInstrumentResult, b as AccountBucketInstrumentsDetailedResponse, c as AccountBucketResultResponse, d as AccountResource, e as AccountSummary, f as AuthenticationError, B as BASE_URLS, C as CacheStore, g as CallOptions, h as Cash, i as ConfigurationError, j as ConsoleLike, D as Dividend, k as DividendDetails, l as DryRunResult, m as DuplicateBucketRequest, E as ENDPOINTS, n as EndpointBudget, o as EndpointDefinition, p as EndpointId, q as EndpointKind, r as EndpointRateLimit, s as EnqueuedReportResponse, t as EnvSource, u as Environment, v as ErrorCode, w as ErrorDetails, x as Exchange, y as ExchangesResource, z as ExportResult, F as FINAL_ORDER_STATUSES, G as FetchLike, H as FieldsFirstMethod, I as Fill, J as FillWalletImpact, K as HistoricalOrder, L as HistoryDividendItem, M as HistoryResource, N as HistoryTransactionItem, O as HoldingSnapshot, P as Hooks, Q as HttpError, R as HttpMethod, S as Instrument, T as InstrumentIssue, U as InstrumentNotFoundError, V as InstrumentSuggestion, W as InstrumentsResource, X as InvestmentResult, Y as Investments, Z as IterateOptions, _ as LimitOrderRequest, $ as LimitRequest, a0 as ListOptions, a1 as LogFields, a2 as LogLevel, a3 as Logger, a4 as MarketOrderRequest, a5 as MarketRequest, a6 as MarketSession, a7 as MarketStatus, a8 as MemoryCache, a9 as MissingScopeError, aa as NetworkError, ab as NotAvailableInDemoError, ac as NotFoundError, ad as Order, ae as OrderInput, af as OrderOutcomeUnknownError, ag as OrderRejectedError, ah as OrderRejectionReason, ai as OrderTimeValidity, aj as OrderType, ak as OrdersResource, al as Page, am as PageOptions, an as PagedList, ao as PaginatedResponseHistoricalOrder, ap as PaginatedResponseHistoryDividendItem, aq as PaginatedResponseHistoryTransactionItem, ar as PermissionError, as as Pie, at as PieDetails, au as PieInput, av as PieRequest, aw as PiesResource, ax as PlaceOptions, ay as Placed, az as PortfolioResource, aA as PortfolioSnapshot, aB as Position, aC as PositionWalletImpact, aD as PositionsResource, aE as PublicReportRequest, aF as RateLimitError, aG as RateLimitInfo, aH as RateLimitMode, aI as RateLimitWaitEvent, aJ as Report, aK as ReportDataIncluded, aL as ReportRequest, aM as ReportResponse, aN as ReportWaitOptions, aO as ReportsResource, aP as RequestDescription, aQ as RequestEvent, aR as ResolveOptions, aS as ResponseEvent, aT as RetryEvent, aU as RetryOptions, aV as SPEC_VERSION, aW as SearchOptions, aX as SellAllOptions, aY as ServerError, aZ as StopLimitOrderRequest, a_ as StopLimitRequest, a$ as StopOrderRequest, b0 as StopRequest, b1 as TIME_VALIDITIES, b2 as Tax, b3 as TimeEvent, b4 as TimeValidity, b5 as TimeoutError, b6 as TradableInstrument, b7 as Trading212, b8 as Trading212Error, b9 as Trading212Options, ba as TradingDisabledError, bb as Transaction, bc as UnexpectedResponseError, bd as ValidationError, be as ValidationIssue, bf as VerifyResult, bg as WaitOptions, bh as WorkingSchedule, bi as buildPortfolioSnapshot, bj as consoleLogger, bk as fieldsFirst, bl as isTrading212Error, bm as sessionAt, bn as silentLogger } from './client-BSQXqdxj.js';
1
+ export { A as AccountBucketDetailedResponse, a as AccountBucketInstrumentResult, b as AccountBucketInstrumentsDetailedResponse, c as AccountBucketResultResponse, d as AccountResource, e as AccountSummary, f as AuthenticationError, B as BASE_URLS, C as CacheStore, g as CallOptions, h as Cash, i as ConfigurationError, j as ConsoleLike, D as Dividend, k as DividendDetails, l as DryRunResult, m as DuplicateBucketRequest, E as ENDPOINTS, n as EndpointBudget, o as EndpointDefinition, p as EndpointId, q as EndpointKind, r as EndpointRateLimit, s as EnqueuedReportResponse, t as EnvSource, u as Environment, v as ErrorCode, w as ErrorDetails, x as Exchange, y as ExchangesResource, z as ExportResult, F as FINAL_ORDER_STATUSES, G as FetchLike, H as FieldsFirstMethod, I as Fill, J as FillWalletImpact, K as HistoricalOrder, L as HistoryDividendItem, M as HistoryResource, N as HistoryTransactionItem, O as HoldingSnapshot, P as Hooks, Q as HttpError, R as HttpMethod, S as Instrument, T as InstrumentIssue, U as InstrumentNotFoundError, V as InstrumentSuggestion, W as InstrumentsResource, X as InvestmentResult, Y as Investments, Z as IterateOptions, _ as LimitOrderRequest, $ as LimitRequest, a0 as ListOptions, a1 as LogFields, a2 as LogLevel, a3 as Logger, a4 as MarketOrderRequest, a5 as MarketRequest, a6 as MarketSession, a7 as MarketStatus, a8 as MemoryCache, a9 as MissingScopeError, aa as NetworkError, ab as NotAvailableInDemoError, ac as NotFoundError, ad as Order, ae as OrderInput, af as OrderOutcomeUnknownError, ag as OrderRejectedError, ah as OrderRejectionReason, ai as OrderTimeValidity, aj as OrderType, ak as OrdersResource, al as Page, am as PageOptions, an as PagedList, ao as PaginatedResponseHistoricalOrder, ap as PaginatedResponseHistoryDividendItem, aq as PaginatedResponseHistoryTransactionItem, ar as PermissionError, as as Pie, at as PieDetails, au as PieInput, av as PieRequest, aw as PiesResource, ax as PlaceOptions, ay as Placed, az as PortfolioResource, aA as PortfolioSnapshot, aB as Position, aC as PositionWalletImpact, aD as PositionsResource, aE as PublicReportRequest, aF as RateLimitError, aG as RateLimitInfo, aH as RateLimitMode, aI as RateLimitWaitEvent, aJ as Report, aK as ReportDataIncluded, aL as ReportRequest, aM as ReportResponse, aN as ReportWaitOptions, aO as ReportsResource, aP as RequestDescription, aQ as RequestEvent, aR as ResolveOptions, aS as ResponseEvent, aT as RetryEvent, aU as RetryOptions, aV as SPEC_VERSION, aW as SearchOptions, aX as SellAllOptions, aY as ServerError, aZ as StopLimitOrderRequest, a_ as StopLimitRequest, a$ as StopOrderRequest, b0 as StopRequest, b1 as TIME_VALIDITIES, b2 as Tax, b3 as TimeEvent, b4 as TimeValidity, b5 as TimeoutError, b6 as TradableInstrument, b7 as Trading212, b8 as Trading212Error, b9 as Trading212Options, ba as TradingDisabledError, bb as Transaction, bc as UnexpectedResponseError, bd as ValidationError, be as ValidationIssue, bf as VerifyResult, bg as WaitOptions, bh as WorkingSchedule, bi as buildPortfolioSnapshot, bj as consoleLogger, bk as fieldsFirst, bl as isTrading212Error, bm as sessionAt, bn as silentLogger } from './client-D4eKsdG_.js';
2
2
 
3
3
  interface ParsedErrorBody {
4
4
  /** Trading 212's own code, from `code`, or the last part of a problem-details `type`. */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { AuthenticationError, BASE_URLS, ConfigurationError, ENDPOINTS, FINAL_ORDER_STATUSES, HttpError, InstrumentNotFoundError, MemoryCache, MissingScopeError, NetworkError, NotAvailableInDemoError, NotFoundError, OrderOutcomeUnknownError, OrderRejectedError, PermissionError, QUANTITY_DECIMALS, RateLimitError, SPEC_VERSION, ServerError, TIME_VALIDITIES, TimeoutError, Trading212, Trading212Error, TradingDisabledError, UnexpectedResponseError, VERSION, ValidationError, buildPortfolioSnapshot, consoleLogger, decimalPlaces, fieldsFirst, isTrading212Error, isValidQuantity, parseErrorBody, sessionAt, silentLogger, truncateQuantity } from './chunk-AVOYEH6N.js';
1
+ export { AuthenticationError, BASE_URLS, ConfigurationError, ENDPOINTS, FINAL_ORDER_STATUSES, HttpError, InstrumentNotFoundError, MemoryCache, MissingScopeError, NetworkError, NotAvailableInDemoError, NotFoundError, OrderOutcomeUnknownError, OrderRejectedError, PermissionError, QUANTITY_DECIMALS, RateLimitError, SPEC_VERSION, ServerError, TIME_VALIDITIES, TimeoutError, Trading212, Trading212Error, TradingDisabledError, UnexpectedResponseError, VERSION, ValidationError, buildPortfolioSnapshot, consoleLogger, decimalPlaces, fieldsFirst, isTrading212Error, isValidQuantity, parseErrorBody, sessionAt, silentLogger, truncateQuantity } from './chunk-OATOHP5N.js';
package/dist/testing.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkK766TWIM_cjs = require('./chunk-K766TWIM.cjs');
3
+ var chunk5FW6NZDM_cjs = require('./chunk-5FW6NZDM.cjs');
4
4
 
5
5
  // src/testing/scriptedFetch.ts
6
6
  var STATUS_TEXT = {
@@ -23,7 +23,7 @@ async function recordRequest(input, init) {
23
23
  new Headers(init.headers).forEach((value, key) => {
24
24
  if (key === "authorization") {
25
25
  authorized = value.length > 0;
26
- headers[key] = chunkK766TWIM_cjs.REDACTED;
26
+ headers[key] = chunk5FW6NZDM_cjs.REDACTED;
27
27
  } else headers[key] = value;
28
28
  });
29
29
  let body = void 0;
@@ -201,7 +201,7 @@ var FakeTrading212Server = class {
201
201
  #traces = 0;
202
202
  constructor(state = {}, environment = "demo") {
203
203
  this.environment = environment;
204
- this.#origin = chunkK766TWIM_cjs.BASE_URLS[environment];
204
+ this.#origin = chunk5FW6NZDM_cjs.BASE_URLS[environment];
205
205
  this.cash = state.cash ?? 1e4;
206
206
  this.currency = state.currency ?? "GBP";
207
207
  this.accountId = state.accountId ?? 12345678;
@@ -280,7 +280,7 @@ var FakeTrading212Server = class {
280
280
  return authorization === FAKE_AUTHORIZATION ? void 0 : { status: 401, headers: { "content-type": "text/plain; charset=utf-8" }, body: "\n" };
281
281
  }
282
282
  #match(method, path) {
283
- for (const definition of Object.values(chunkK766TWIM_cjs.ENDPOINTS)) {
283
+ for (const definition of Object.values(chunk5FW6NZDM_cjs.ENDPOINTS)) {
284
284
  if (definition.method !== method) continue;
285
285
  const pattern = new RegExp(`^${definition.path.replace("{id}", "(\\d+)")}$`);
286
286
  const match = pattern.exec(path);
@@ -444,7 +444,7 @@ var FakeTrading212Server = class {
444
444
  if (!this.#instrument(ticker)) return apiError(400, "instrument-not-found", REFUSED, `No instrument ${ticker}`);
445
445
  if (!Number.isFinite(quantity) || quantity === 0)
446
446
  return apiError(400, "invalid-request", INVALID, "Invalid payload");
447
- if (chunkK766TWIM_cjs.decimalPlaces(quantity) > 4)
447
+ if (chunk5FW6NZDM_cjs.decimalPlaces(quantity) > 4)
448
448
  return apiError(400, "quantity-precision-mismatch", REFUSED, "invalid quantity precision 4");
449
449
  if (id !== "placeMarketOrder" && "extendedHours" in body)
450
450
  return apiError(400, "invalid-request", INVALID, "Invalid payload");
@@ -629,7 +629,7 @@ var FakeTrading212Server = class {
629
629
  function createFakeTrading212(options = {}) {
630
630
  const environment = options.environment ?? "demo";
631
631
  const server = new FakeTrading212Server(options.state, environment);
632
- const client = new chunkK766TWIM_cjs.Trading212({
632
+ const client = new chunk5FW6NZDM_cjs.Trading212({
633
633
  rateLimit: "off",
634
634
  trading: "enabled",
635
635
  ...options.client,
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BASE_URLS, ENDPOINTS, decimalPlaces, Trading212, REDACTED } from './chunk-AVOYEH6N.js';
1
+ import { BASE_URLS, ENDPOINTS, decimalPlaces, Trading212, REDACTED } from './chunk-OATOHP5N.js';
2
2
 
3
3
  // src/testing/scriptedFetch.ts
4
4
  var STATUS_TEXT = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kkkermit/trading212.js",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Unofficial, zero-dependency TypeScript client for the Trading 212 Public API: typed, rate-limit aware, safe around live money, with errors that tell you how to fix them.",
5
5
  "keywords": [
6
6
  "trading212",