@n1xyz/nord-ts 0.0.22 → 0.1.1

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/src/types.ts CHANGED
@@ -310,8 +310,8 @@ export class QuoteSize {
310
310
  constructor(quotePrice: Decimal.Value, quoteSize: Decimal.Value) {
311
311
  const p = new Decimal(quotePrice);
312
312
  const s = new Decimal(quoteSize);
313
- if (p.isZero() || s.isZero()) {
314
- throw new Error("quotePrice and quoteSize must be non-zero");
313
+ if (!p.isPositive() || !s.isPositive()) {
314
+ throw new Error("quotePrice and quoteSize must be positive");
315
315
  }
316
316
  this.price = p;
317
317
  this.size = s;
package/src/utils.ts CHANGED
@@ -17,6 +17,7 @@ export const SESSION_TTL: bigint = 60n * 60n * 24n * 30n;
17
17
  export const ZERO_DECIMAL = new Decimal(0);
18
18
  export const MAX_BUFFER_LEN = 10_000;
19
19
 
20
+ // Max size of data returned from Nord endpoints
20
21
  const MAX_PAYLOAD_SIZE = 100 * 1024; // 100 kB
21
22
 
22
23
  /** Any type convertible to bigint */