@nadohq/shared 0.1.0-alpha.50 → 0.1.0-alpha.52

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.
@@ -1,16 +1,16 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
  import { HealthType } from './healthTypes.cjs';
3
3
  import { ProductEngineType, SpotProduct, PerpProduct } from './productTypes.cjs';
4
4
 
5
5
  type BalanceSide = 'long' | 'short';
6
- type BalanceHealthContributions = Record<HealthType, BigDecimal>;
6
+ type BalanceHealthContributions = Record<HealthType, BigDecimal__default>;
7
7
  /**
8
8
  * Shared properties of a product balance
9
9
  */
10
10
  interface BaseBalance {
11
11
  type: ProductEngineType;
12
12
  productId: number;
13
- amount: BigDecimal;
13
+ amount: BigDecimal__default;
14
14
  healthContributions: BalanceHealthContributions;
15
15
  }
16
16
  /**
@@ -22,7 +22,7 @@ interface PerpBalance extends BaseBalance {
22
22
  * As there is no "quote" product for the perp engine, this is a representation of the net quote balance
23
23
  * associated with the position. The entry cost and funding is rolled into this.
24
24
  */
25
- vQuoteBalance: BigDecimal;
25
+ vQuoteBalance: BigDecimal__default;
26
26
  }
27
27
  type PerpBalanceWithProduct = PerpBalance & PerpProduct;
28
28
  /**
@@ -1,16 +1,16 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
  import { HealthType } from './healthTypes.js';
3
3
  import { ProductEngineType, SpotProduct, PerpProduct } from './productTypes.js';
4
4
 
5
5
  type BalanceSide = 'long' | 'short';
6
- type BalanceHealthContributions = Record<HealthType, BigDecimal>;
6
+ type BalanceHealthContributions = Record<HealthType, BigDecimal__default>;
7
7
  /**
8
8
  * Shared properties of a product balance
9
9
  */
10
10
  interface BaseBalance {
11
11
  type: ProductEngineType;
12
12
  productId: number;
13
- amount: BigDecimal;
13
+ amount: BigDecimal__default;
14
14
  healthContributions: BalanceHealthContributions;
15
15
  }
16
16
  /**
@@ -22,7 +22,7 @@ interface PerpBalance extends BaseBalance {
22
22
  * As there is no "quote" product for the perp engine, this is a representation of the net quote balance
23
23
  * associated with the position. The entry cost and funding is rolled into this.
24
24
  */
25
- vQuoteBalance: BigDecimal;
25
+ vQuoteBalance: BigDecimal__default;
26
26
  }
27
27
  type PerpBalanceWithProduct = PerpBalance & PerpProduct;
28
28
  /**
@@ -1,10 +1,10 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  type HealthType = 'maintenance' | 'initial' | 'unweighted';
4
4
  interface HealthStatus {
5
- health: BigDecimal;
6
- assets: BigDecimal;
7
- liabilities: BigDecimal;
5
+ health: BigDecimal__default;
6
+ assets: BigDecimal__default;
7
+ liabilities: BigDecimal__default;
8
8
  }
9
9
  type HealthStatusByType = Record<HealthType, HealthStatus>;
10
10
  interface HealthGroup {
@@ -1,10 +1,10 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  type HealthType = 'maintenance' | 'initial' | 'unweighted';
4
4
  interface HealthStatus {
5
- health: BigDecimal;
6
- assets: BigDecimal;
7
- liabilities: BigDecimal;
5
+ health: BigDecimal__default;
6
+ assets: BigDecimal__default;
7
+ liabilities: BigDecimal__default;
8
8
  }
9
9
  type HealthStatusByType = Record<HealthType, HealthStatus>;
10
10
  interface HealthGroup {
@@ -1,4 +1,4 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
  import { ProductEngineType, Product, PerpProduct, SpotProduct } from './productTypes.cjs';
3
3
 
4
4
  /**
@@ -8,9 +8,9 @@ interface Market {
8
8
  productId: number;
9
9
  type: ProductEngineType;
10
10
  product: Product;
11
- minSize: BigDecimal;
12
- priceIncrement: BigDecimal;
13
- sizeIncrement: BigDecimal;
11
+ minSize: BigDecimal__default;
12
+ priceIncrement: BigDecimal__default;
13
+ sizeIncrement: BigDecimal__default;
14
14
  }
15
15
  /**
16
16
  * Perp market with perp product info
@@ -1,4 +1,4 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
  import { ProductEngineType, Product, PerpProduct, SpotProduct } from './productTypes.js';
3
3
 
4
4
  /**
@@ -8,9 +8,9 @@ interface Market {
8
8
  productId: number;
9
9
  type: ProductEngineType;
10
10
  product: Product;
11
- minSize: BigDecimal;
12
- priceIncrement: BigDecimal;
13
- sizeIncrement: BigDecimal;
11
+ minSize: BigDecimal__default;
12
+ priceIncrement: BigDecimal__default;
13
+ sizeIncrement: BigDecimal__default;
14
14
  }
15
15
  /**
16
16
  * Perp market with perp product info
@@ -1,4 +1,4 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  /**
4
4
  * Representation of the ProductEngineType enum used within the contract
@@ -19,20 +19,20 @@ declare function toProductEngineType(val: number): ProductEngineType;
19
19
  interface BaseProduct {
20
20
  type: ProductEngineType;
21
21
  productId: number;
22
- oraclePrice: BigDecimal;
23
- longWeightInitial: BigDecimal;
24
- shortWeightInitial: BigDecimal;
25
- longWeightMaintenance: BigDecimal;
26
- shortWeightMaintenance: BigDecimal;
22
+ oraclePrice: BigDecimal__default;
23
+ longWeightInitial: BigDecimal__default;
24
+ shortWeightInitial: BigDecimal__default;
25
+ longWeightMaintenance: BigDecimal__default;
26
+ shortWeightMaintenance: BigDecimal__default;
27
27
  }
28
28
  /**
29
29
  * Represents a product stored in PerpEngine
30
30
  */
31
31
  interface PerpProduct extends BaseProduct {
32
32
  type: ProductEngineType.PERP;
33
- openInterest: BigDecimal;
34
- cumulativeFundingLong: BigDecimal;
35
- cumulativeFundingShort: BigDecimal;
33
+ openInterest: BigDecimal__default;
34
+ cumulativeFundingLong: BigDecimal__default;
35
+ cumulativeFundingShort: BigDecimal__default;
36
36
  }
37
37
  /**
38
38
  * Represents a product stored in SpotEngine.
@@ -42,13 +42,13 @@ interface PerpProduct extends BaseProduct {
42
42
  interface SpotProduct extends BaseProduct {
43
43
  type: ProductEngineType.SPOT;
44
44
  tokenAddr: string;
45
- interestFloor: BigDecimal;
46
- interestInflectionUtil: BigDecimal;
47
- interestSmallCap: BigDecimal;
48
- interestLargeCap: BigDecimal;
49
- minDepositRate: BigDecimal;
50
- totalDeposited: BigDecimal;
51
- totalBorrowed: BigDecimal;
45
+ interestFloor: BigDecimal__default;
46
+ interestInflectionUtil: BigDecimal__default;
47
+ interestSmallCap: BigDecimal__default;
48
+ interestLargeCap: BigDecimal__default;
49
+ minDepositRate: BigDecimal__default;
50
+ totalDeposited: BigDecimal__default;
51
+ totalBorrowed: BigDecimal__default;
52
52
  }
53
53
  type Product = PerpProduct | SpotProduct;
54
54
 
@@ -1,4 +1,4 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  /**
4
4
  * Representation of the ProductEngineType enum used within the contract
@@ -19,20 +19,20 @@ declare function toProductEngineType(val: number): ProductEngineType;
19
19
  interface BaseProduct {
20
20
  type: ProductEngineType;
21
21
  productId: number;
22
- oraclePrice: BigDecimal;
23
- longWeightInitial: BigDecimal;
24
- shortWeightInitial: BigDecimal;
25
- longWeightMaintenance: BigDecimal;
26
- shortWeightMaintenance: BigDecimal;
22
+ oraclePrice: BigDecimal__default;
23
+ longWeightInitial: BigDecimal__default;
24
+ shortWeightInitial: BigDecimal__default;
25
+ longWeightMaintenance: BigDecimal__default;
26
+ shortWeightMaintenance: BigDecimal__default;
27
27
  }
28
28
  /**
29
29
  * Represents a product stored in PerpEngine
30
30
  */
31
31
  interface PerpProduct extends BaseProduct {
32
32
  type: ProductEngineType.PERP;
33
- openInterest: BigDecimal;
34
- cumulativeFundingLong: BigDecimal;
35
- cumulativeFundingShort: BigDecimal;
33
+ openInterest: BigDecimal__default;
34
+ cumulativeFundingLong: BigDecimal__default;
35
+ cumulativeFundingShort: BigDecimal__default;
36
36
  }
37
37
  /**
38
38
  * Represents a product stored in SpotEngine.
@@ -42,13 +42,13 @@ interface PerpProduct extends BaseProduct {
42
42
  interface SpotProduct extends BaseProduct {
43
43
  type: ProductEngineType.SPOT;
44
44
  tokenAddr: string;
45
- interestFloor: BigDecimal;
46
- interestInflectionUtil: BigDecimal;
47
- interestSmallCap: BigDecimal;
48
- interestLargeCap: BigDecimal;
49
- minDepositRate: BigDecimal;
50
- totalDeposited: BigDecimal;
51
- totalBorrowed: BigDecimal;
45
+ interestFloor: BigDecimal__default;
46
+ interestInflectionUtil: BigDecimal__default;
47
+ interestSmallCap: BigDecimal__default;
48
+ interestLargeCap: BigDecimal__default;
49
+ minDepositRate: BigDecimal__default;
50
+ totalDeposited: BigDecimal__default;
51
+ totalBorrowed: BigDecimal__default;
52
52
  }
53
53
  type Product = PerpProduct | SpotProduct;
54
54
 
@@ -1,5 +1,5 @@
1
1
  import { PerpBalanceWithProduct, SpotBalanceWithProduct } from '../types/balanceTypes.cjs';
2
- import BigDecimal from 'bignumber.js';
2
+ import BigDecimal__default from 'bignumber.js';
3
3
  import '../types/healthTypes.cjs';
4
4
  import '../types/productTypes.cjs';
5
5
 
@@ -8,18 +8,18 @@ import '../types/productTypes.cjs';
8
8
  *
9
9
  * @param balanceWithProduct
10
10
  */
11
- declare function calcSpotBalanceValue(balanceWithProduct: SpotBalanceWithProduct): BigDecimal;
11
+ declare function calcSpotBalanceValue(balanceWithProduct: SpotBalanceWithProduct): BigDecimal__default;
12
12
  /**
13
13
  * Calculates the notional value of a perp balance, in terms of quote units
14
14
  *
15
15
  * @param balanceWithProduct
16
16
  */
17
- declare function calcPerpBalanceNotionalValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal;
17
+ declare function calcPerpBalanceNotionalValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal__default;
18
18
  /**
19
19
  * Calculates the true quote value of a perp balance, which is the same as its unrealized pnl / unsettled quote, in terms of quote units
20
20
  *
21
21
  * @param balanceWithProduct
22
22
  */
23
- declare function calcPerpBalanceValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal;
23
+ declare function calcPerpBalanceValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal__default;
24
24
 
25
25
  export { calcPerpBalanceNotionalValue, calcPerpBalanceValue, calcSpotBalanceValue };
@@ -1,5 +1,5 @@
1
1
  import { PerpBalanceWithProduct, SpotBalanceWithProduct } from '../types/balanceTypes.js';
2
- import BigDecimal from 'bignumber.js';
2
+ import BigDecimal__default from 'bignumber.js';
3
3
  import '../types/healthTypes.js';
4
4
  import '../types/productTypes.js';
5
5
 
@@ -8,18 +8,18 @@ import '../types/productTypes.js';
8
8
  *
9
9
  * @param balanceWithProduct
10
10
  */
11
- declare function calcSpotBalanceValue(balanceWithProduct: SpotBalanceWithProduct): BigDecimal;
11
+ declare function calcSpotBalanceValue(balanceWithProduct: SpotBalanceWithProduct): BigDecimal__default;
12
12
  /**
13
13
  * Calculates the notional value of a perp balance, in terms of quote units
14
14
  *
15
15
  * @param balanceWithProduct
16
16
  */
17
- declare function calcPerpBalanceNotionalValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal;
17
+ declare function calcPerpBalanceNotionalValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal__default;
18
18
  /**
19
19
  * Calculates the true quote value of a perp balance, which is the same as its unrealized pnl / unsettled quote, in terms of quote units
20
20
  *
21
21
  * @param balanceWithProduct
22
22
  */
23
- declare function calcPerpBalanceValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal;
23
+ declare function calcPerpBalanceValue(balanceWithProduct: PerpBalanceWithProduct): BigDecimal__default;
24
24
 
25
25
  export { calcPerpBalanceNotionalValue, calcPerpBalanceValue, calcSpotBalanceValue };
@@ -1,21 +1,21 @@
1
1
  import { SpotProduct } from '../types/productTypes.cjs';
2
2
  import { BigDecimalish } from './math/bigDecimal.cjs';
3
- import BigDecimal from 'bignumber.js';
3
+ import BigDecimal__default from 'bignumber.js';
4
4
 
5
5
  /**
6
6
  * Calculate amount total borrowed for a product
7
7
  */
8
- declare function calcTotalBorrowed(totalBorrowsNormalized: BigDecimalish, cumulativeBorrowsMultiplierX18: BigDecimalish): BigDecimal;
8
+ declare function calcTotalBorrowed(totalBorrowsNormalized: BigDecimalish, cumulativeBorrowsMultiplierX18: BigDecimalish): BigDecimal__default;
9
9
  /**
10
10
  * Calculate amount total deposited for a product.
11
11
  */
12
- declare function calcTotalDeposited(totalDepositsNormalized: BigDecimalish, cumulativeDepositsMultiplierX18: BigDecimalish): BigDecimal;
12
+ declare function calcTotalDeposited(totalDepositsNormalized: BigDecimalish, cumulativeDepositsMultiplierX18: BigDecimalish): BigDecimal__default;
13
13
  /**
14
14
  * Calculates utilization ratio = abs(total borrowed / total deposited)
15
15
  *
16
16
  * @param product Spot product
17
17
  */
18
- declare function calcUtilizationRatio(product: SpotProduct): BigDecimal;
18
+ declare function calcUtilizationRatio(product: SpotProduct): BigDecimal__default;
19
19
  /**
20
20
  * Calculates per-second borrow interest rate for a product. For example, a returned rate of 0.1 indicates 10% borrower
21
21
  * interest. The calculation for interest rate is as follows:
@@ -30,14 +30,14 @@ declare function calcUtilizationRatio(product: SpotProduct): BigDecimal;
30
30
  *
31
31
  * @param product Spot product
32
32
  */
33
- declare function calcBorrowRatePerSecond(product: SpotProduct): BigDecimal;
33
+ declare function calcBorrowRatePerSecond(product: SpotProduct): BigDecimal__default;
34
34
  /**
35
35
  * Calculates borrower interest rate compounded for a period of time.
36
36
  *
37
37
  * @param product Spot product
38
38
  * @param seconds Number of seconds for the time period
39
39
  */
40
- declare function calcBorrowRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal;
40
+ declare function calcBorrowRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal__default;
41
41
  /**
42
42
  * Calculate depositor interest rate compounded for a period of time.
43
43
  *
@@ -45,6 +45,6 @@ declare function calcBorrowRateForTimeRange(product: SpotProduct, seconds: BigDe
45
45
  * @param seconds Number of seconds for the time period
46
46
  * @param interestFeeFrac Fraction of paid borrower interest that is paid as a fee (0.2 = 20% fee)
47
47
  */
48
- declare function calcRealizedDepositRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, interestFeeFrac: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal;
48
+ declare function calcRealizedDepositRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, interestFeeFrac: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal__default;
49
49
 
50
50
  export { calcBorrowRateForTimeRange, calcBorrowRatePerSecond, calcRealizedDepositRateForTimeRange, calcTotalBorrowed, calcTotalDeposited, calcUtilizationRatio };
@@ -1,21 +1,21 @@
1
1
  import { SpotProduct } from '../types/productTypes.js';
2
2
  import { BigDecimalish } from './math/bigDecimal.js';
3
- import BigDecimal from 'bignumber.js';
3
+ import BigDecimal__default from 'bignumber.js';
4
4
 
5
5
  /**
6
6
  * Calculate amount total borrowed for a product
7
7
  */
8
- declare function calcTotalBorrowed(totalBorrowsNormalized: BigDecimalish, cumulativeBorrowsMultiplierX18: BigDecimalish): BigDecimal;
8
+ declare function calcTotalBorrowed(totalBorrowsNormalized: BigDecimalish, cumulativeBorrowsMultiplierX18: BigDecimalish): BigDecimal__default;
9
9
  /**
10
10
  * Calculate amount total deposited for a product.
11
11
  */
12
- declare function calcTotalDeposited(totalDepositsNormalized: BigDecimalish, cumulativeDepositsMultiplierX18: BigDecimalish): BigDecimal;
12
+ declare function calcTotalDeposited(totalDepositsNormalized: BigDecimalish, cumulativeDepositsMultiplierX18: BigDecimalish): BigDecimal__default;
13
13
  /**
14
14
  * Calculates utilization ratio = abs(total borrowed / total deposited)
15
15
  *
16
16
  * @param product Spot product
17
17
  */
18
- declare function calcUtilizationRatio(product: SpotProduct): BigDecimal;
18
+ declare function calcUtilizationRatio(product: SpotProduct): BigDecimal__default;
19
19
  /**
20
20
  * Calculates per-second borrow interest rate for a product. For example, a returned rate of 0.1 indicates 10% borrower
21
21
  * interest. The calculation for interest rate is as follows:
@@ -30,14 +30,14 @@ declare function calcUtilizationRatio(product: SpotProduct): BigDecimal;
30
30
  *
31
31
  * @param product Spot product
32
32
  */
33
- declare function calcBorrowRatePerSecond(product: SpotProduct): BigDecimal;
33
+ declare function calcBorrowRatePerSecond(product: SpotProduct): BigDecimal__default;
34
34
  /**
35
35
  * Calculates borrower interest rate compounded for a period of time.
36
36
  *
37
37
  * @param product Spot product
38
38
  * @param seconds Number of seconds for the time period
39
39
  */
40
- declare function calcBorrowRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal;
40
+ declare function calcBorrowRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal__default;
41
41
  /**
42
42
  * Calculate depositor interest rate compounded for a period of time.
43
43
  *
@@ -45,6 +45,6 @@ declare function calcBorrowRateForTimeRange(product: SpotProduct, seconds: BigDe
45
45
  * @param seconds Number of seconds for the time period
46
46
  * @param interestFeeFrac Fraction of paid borrower interest that is paid as a fee (0.2 = 20% fee)
47
47
  */
48
- declare function calcRealizedDepositRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, interestFeeFrac: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal;
48
+ declare function calcRealizedDepositRateForTimeRange(product: SpotProduct, seconds: BigDecimalish, interestFeeFrac: BigDecimalish, minDepositRate: BigDecimalish): BigDecimal__default;
49
49
 
50
50
  export { calcBorrowRateForTimeRange, calcBorrowRatePerSecond, calcRealizedDepositRateForTimeRange, calcTotalBorrowed, calcTotalDeposited, calcUtilizationRatio };
@@ -1,8 +1,10 @@
1
+ import * as BigDecimal from 'bignumber.js';
2
+
1
3
  declare const BigDecimals: Readonly<{
2
- ZERO: BigNumber;
3
- ONE: BigNumber;
4
- INF: BigNumber;
5
- MAX_I128: BigNumber;
4
+ ZERO: BigDecimal.BigNumber;
5
+ ONE: BigDecimal.BigNumber;
6
+ INF: BigDecimal.BigNumber;
7
+ MAX_I128: BigDecimal.BigNumber;
6
8
  }>;
7
9
 
8
10
  export { BigDecimals };
@@ -1,8 +1,10 @@
1
+ import * as BigDecimal from 'bignumber.js';
2
+
1
3
  declare const BigDecimals: Readonly<{
2
- ZERO: BigNumber;
3
- ONE: BigNumber;
4
- INF: BigNumber;
5
- MAX_I128: BigNumber;
4
+ ZERO: BigDecimal.BigNumber;
5
+ ONE: BigDecimal.BigNumber;
6
+ INF: BigDecimal.BigNumber;
7
+ MAX_I128: BigDecimal.BigNumber;
6
8
  }>;
7
9
 
8
10
  export { BigDecimals };
@@ -1,4 +1,4 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
  export { default as BigDecimal } from 'bignumber.js';
3
3
 
4
4
  /**
@@ -7,12 +7,12 @@ export { default as BigDecimal } from 'bignumber.js';
7
7
  *
8
8
  * @see https://mikemcl.github.io/bignumber.js/
9
9
  */
10
- type BigDecimalish = BigDecimal | BigDecimal.Value | bigint;
10
+ type BigDecimalish = BigDecimal__default | BigDecimal__default.Value | bigint;
11
11
  /**
12
12
  * Converts a value to an instance of BigDecimal
13
13
  *
14
14
  * @param val
15
15
  */
16
- declare function toBigDecimal(val: BigDecimalish): BigDecimal;
16
+ declare function toBigDecimal(val: BigDecimalish): BigDecimal__default;
17
17
 
18
18
  export { type BigDecimalish, toBigDecimal };
@@ -1,4 +1,4 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
  export { default as BigDecimal } from 'bignumber.js';
3
3
 
4
4
  /**
@@ -7,12 +7,12 @@ export { default as BigDecimal } from 'bignumber.js';
7
7
  *
8
8
  * @see https://mikemcl.github.io/bignumber.js/
9
9
  */
10
- type BigDecimalish = BigDecimal | BigDecimal.Value | bigint;
10
+ type BigDecimalish = BigDecimal__default | BigDecimal__default.Value | bigint;
11
11
  /**
12
12
  * Converts a value to an instance of BigDecimal
13
13
  *
14
14
  * @param val
15
15
  */
16
- declare function toBigDecimal(val: BigDecimalish): BigDecimal;
16
+ declare function toBigDecimal(val: BigDecimalish): BigDecimal__default;
17
17
 
18
18
  export { type BigDecimalish, toBigDecimal };
@@ -1,8 +1,8 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  interface ClampOptions {
4
- min?: BigDecimal;
5
- max?: BigDecimal;
4
+ min?: BigDecimal__default;
5
+ max?: BigDecimal__default;
6
6
  }
7
7
  /**
8
8
  * Clamps a value between optional minimum and maximum values.
@@ -10,6 +10,6 @@ interface ClampOptions {
10
10
  * @param val
11
11
  * @param opts Clamp options
12
12
  */
13
- declare function clampBigDecimal(val: BigDecimal, opts: ClampOptions): BigDecimal;
13
+ declare function clampBigDecimal(val: BigDecimal__default, opts: ClampOptions): BigDecimal__default;
14
14
 
15
15
  export { clampBigDecimal };
@@ -1,8 +1,8 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  interface ClampOptions {
4
- min?: BigDecimal;
5
- max?: BigDecimal;
4
+ min?: BigDecimal__default;
5
+ max?: BigDecimal__default;
6
6
  }
7
7
  /**
8
8
  * Clamps a value between optional minimum and maximum values.
@@ -10,6 +10,6 @@ interface ClampOptions {
10
10
  * @param val
11
11
  * @param opts Clamp options
12
12
  */
13
- declare function clampBigDecimal(val: BigDecimal, opts: ClampOptions): BigDecimal;
13
+ declare function clampBigDecimal(val: BigDecimal__default, opts: ClampOptions): BigDecimal__default;
14
14
 
15
15
  export { clampBigDecimal };
@@ -1,5 +1,5 @@
1
1
  import { BigDecimalish } from './bigDecimal.cjs';
2
- import BigDecimal from 'bignumber.js';
2
+ import BigDecimal__default from 'bignumber.js';
3
3
 
4
4
  /**
5
5
  * All Nado balances have 18 decimals. Ex. 1e18 = 1.0
@@ -12,7 +12,7 @@ declare const NADO_PRODUCT_DECIMALS = 18;
12
12
  * - If `T` is a `number`, the result is a `number`.
13
13
  * - Otherwise, the result is a `BigDecimal`.
14
14
  */
15
- type AdjustDecimalsResult<T extends BigDecimalish | undefined> = T extends undefined ? undefined : T extends number ? number : BigDecimal;
15
+ type AdjustDecimalsResult<T extends BigDecimalish | undefined> = T extends undefined ? undefined : T extends number ? number : BigDecimal__default;
16
16
  /**
17
17
  * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.
18
18
  *
@@ -1,5 +1,5 @@
1
1
  import { BigDecimalish } from './bigDecimal.js';
2
- import BigDecimal from 'bignumber.js';
2
+ import BigDecimal__default from 'bignumber.js';
3
3
 
4
4
  /**
5
5
  * All Nado balances have 18 decimals. Ex. 1e18 = 1.0
@@ -12,7 +12,7 @@ declare const NADO_PRODUCT_DECIMALS = 18;
12
12
  * - If `T` is a `number`, the result is a `number`.
13
13
  * - Otherwise, the result is a `BigDecimal`.
14
14
  */
15
- type AdjustDecimalsResult<T extends BigDecimalish | undefined> = T extends undefined ? undefined : T extends number ? number : BigDecimal;
15
+ type AdjustDecimalsResult<T extends BigDecimalish | undefined> = T extends undefined ? undefined : T extends number ? number : BigDecimal__default;
16
16
  /**
17
17
  * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.
18
18
  *
@@ -1,10 +1,10 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  /**
4
4
  * Util function to sum BigDecimal values, inspired by Lodash
5
5
  * @param collection
6
6
  * @param iteratee
7
7
  */
8
- declare function sumBigDecimalBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigDecimal.Value): BigDecimal;
8
+ declare function sumBigDecimalBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigDecimal__default.Value): BigDecimal__default;
9
9
 
10
10
  export { sumBigDecimalBy };
@@ -1,10 +1,10 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  /**
4
4
  * Util function to sum BigDecimal values, inspired by Lodash
5
5
  * @param collection
6
6
  * @param iteratee
7
7
  */
8
- declare function sumBigDecimalBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigDecimal.Value): BigDecimal;
8
+ declare function sumBigDecimalBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigDecimal__default.Value): BigDecimal__default;
9
9
 
10
10
  export { sumBigDecimalBy };
@@ -1,11 +1,11 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  /**
4
4
  * Util for converting any BigDecimal types into a string so that it can be logged nicely.
5
5
  * Handles cyclic references by returning '[Circular]' for already-visited objects.
6
6
  */
7
7
  declare function toPrintableObject(obj: null | undefined, seen?: WeakSet<object>): null;
8
- declare function toPrintableObject(obj: BigDecimal | bigint, seen?: WeakSet<object>): string;
8
+ declare function toPrintableObject(obj: BigDecimal__default | bigint, seen?: WeakSet<object>): string;
9
9
  declare function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;
10
10
 
11
11
  export { toPrintableObject };
@@ -1,11 +1,11 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigDecimal__default from 'bignumber.js';
2
2
 
3
3
  /**
4
4
  * Util for converting any BigDecimal types into a string so that it can be logged nicely.
5
5
  * Handles cyclic references by returning '[Circular]' for already-visited objects.
6
6
  */
7
7
  declare function toPrintableObject(obj: null | undefined, seen?: WeakSet<object>): null;
8
- declare function toPrintableObject(obj: BigDecimal | bigint, seen?: WeakSet<object>): string;
8
+ declare function toPrintableObject(obj: BigDecimal__default | bigint, seen?: WeakSet<object>): string;
9
9
  declare function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;
10
10
 
11
11
  export { toPrintableObject };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadohq/shared",
3
- "version": "0.1.0-alpha.50",
3
+ "version": "0.1.0-alpha.52",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Shared utilities, types, and contract helpers for Nado SDK",
@@ -41,7 +41,7 @@
41
41
  "module": "./dist/index.js",
42
42
  "types": "./dist/index.d.ts",
43
43
  "peerDependencies": {
44
- "bignumber.js": "^9.3.0",
44
+ "bignumber.js": "^10.0.2",
45
45
  "viem": "*"
46
46
  },
47
47
  "dependencies": {
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@jest/globals": "*",
52
- "bignumber.js": "^9.3.0",
52
+ "bignumber.js": "^10.0.2",
53
53
  "viem": "workspace:*"
54
54
  },
55
- "gitHead": "f9a83705f16561c58f3b1cad75c0b69d60913fa8"
55
+ "gitHead": "41f74df94ad4408c93f5b0e577513b535106d30d"
56
56
  }