Skip to content

Commit

Permalink
Meld @liquity/decimal into @liquity/lib-base
Browse files Browse the repository at this point in the history
It'll make the release process simpler. It's doubtful that anyone
would want to use Decimal outside of the Liquity SDK anyway.
  • Loading branch information
danielattilasimon committed Feb 11, 2021
1 parent 8459cdf commit dbf1afd
Show file tree
Hide file tree
Showing 210 changed files with 462 additions and 559 deletions.
55 changes: 0 additions & 55 deletions docs/sdk/decimal.decimal.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/sdk/decimal.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/sdk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

| Package | Description |
| --- | --- |
| [@liquity/decimal](./decimal.md) | |
| [@liquity/lib-base](./lib-base.md) | |
| [@liquity/lib-ethers](./lib-ethers.md) | |

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [add](./decimal.decimal.add.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [add](./lib-base.decimal.add.md)

## Decimal.add() method

Expand All @@ -14,9 +14,9 @@ add(addend: Decimalish): Decimal;

| Parameter | Type | Description |
| --- | --- | --- |
| addend | [Decimalish](./decimal.decimalish.md) | |
| addend | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

[Decimal](./decimal.decimal.md)
[Decimal](./lib-base.decimal.md)

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [div](./decimal.decimal.div.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [div](./lib-base.decimal.div.md)

## Decimal.div() method

Expand All @@ -14,9 +14,9 @@ div(divider: Decimalish): Decimal;

| Parameter | Type | Description |
| --- | --- | --- |
| divider | [Decimalish](./decimal.decimalish.md) | |
| divider | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

[Decimal](./decimal.decimal.md)
[Decimal](./lib-base.decimal.md)

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [eq](./decimal.decimal.eq.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [eq](./lib-base.decimal.eq.md)

## Decimal.eq() method

Expand All @@ -14,7 +14,7 @@ eq(that: Decimalish): boolean;

| Parameter | Type | Description |
| --- | --- | --- |
| that | [Decimalish](./decimal.decimalish.md) | |
| that | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [finite](./decimal.decimal.finite.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [finite](./lib-base.decimal.finite.md)

## Decimal.finite property

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [from](./decimal.decimal.from.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [from](./lib-base.decimal.from.md)

## Decimal.from() method

Expand All @@ -14,9 +14,9 @@ static from(decimalish: Decimalish): Decimal;

| Parameter | Type | Description |
| --- | --- | --- |
| decimalish | [Decimalish](./decimal.decimalish.md) | |
| decimalish | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

[Decimal](./decimal.decimal.md)
[Decimal](./lib-base.decimal.md)

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [fromBigNumberString](./decimal.decimal.frombignumberstring.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [fromBigNumberString](./lib-base.decimal.frombignumberstring.md)

## Decimal.fromBigNumberString() method

Expand All @@ -18,5 +18,5 @@ static fromBigNumberString(bigNumberString: string): Decimal;

<b>Returns:</b>

[Decimal](./decimal.decimal.md)
[Decimal](./lib-base.decimal.md)

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [gt](./decimal.decimal.gt.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [gt](./lib-base.decimal.gt.md)

## Decimal.gt() method

Expand All @@ -14,7 +14,7 @@ gt(that: Decimalish): boolean;

| Parameter | Type | Description |
| --- | --- | --- |
| that | [Decimalish](./decimal.decimalish.md) | |
| that | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [gte](./decimal.decimal.gte.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [gte](./lib-base.decimal.gte.md)

## Decimal.gte() method

Expand All @@ -14,7 +14,7 @@ gte(that: Decimalish): boolean;

| Parameter | Type | Description |
| --- | --- | --- |
| that | [Decimalish](./decimal.decimalish.md) | |
| that | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [HALF](./decimal.decimal.half.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [HALF](./lib-base.decimal.half.md)

## Decimal.HALF property

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [infinite](./decimal.decimal.infinite.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [infinite](./lib-base.decimal.infinite.md)

## Decimal.infinite property

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [INFINITY](./decimal.decimal.infinity.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [INFINITY](./lib-base.decimal.infinity.md)

## Decimal.INFINITY property

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [isZero](./decimal.decimal.iszero.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [isZero](./lib-base.decimal.iszero.md)

## Decimal.isZero property

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [lt](./decimal.decimal.lt.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [lt](./lib-base.decimal.lt.md)

## Decimal.lt() method

Expand All @@ -14,7 +14,7 @@ lt(that: Decimalish): boolean;

| Parameter | Type | Description |
| --- | --- | --- |
| that | [Decimalish](./decimal.decimalish.md) | |
| that | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [lte](./decimal.decimal.lte.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [lte](./lib-base.decimal.lte.md)

## Decimal.lte() method

Expand All @@ -14,7 +14,7 @@ lte(that: Decimalish): boolean;

| Parameter | Type | Description |
| --- | --- | --- |
| that | [Decimalish](./decimal.decimalish.md) | |
| that | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [max](./decimal.decimal.max.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [max](./lib-base.decimal.max.md)

## Decimal.max() method

Expand All @@ -14,10 +14,10 @@ static max(a: Decimalish, b: Decimalish): Decimal;

| Parameter | Type | Description |
| --- | --- | --- |
| a | [Decimalish](./decimal.decimalish.md) | |
| b | [Decimalish](./decimal.decimalish.md) | |
| a | [Decimalish](./lib-base.decimalish.md) | |
| b | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

[Decimal](./decimal.decimal.md)
[Decimal](./lib-base.decimal.md)

55 changes: 55 additions & 0 deletions docs/sdk/lib-base.decimal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md)

## Decimal class

Fixed-point decimal bignumber with 18 digits of precision.

<b>Signature:</b>

```typescript
export declare class Decimal
```

## Remarks

Used by Liquity libraries to precisely represent native currency (e.g. Ether), LUSD and LQTY amounts, as well as derived metrics like collateral ratios.

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [finite](./lib-base.decimal.finite.md) | | this \| undefined | |
| [HALF](./lib-base.decimal.half.md) | <code>static</code> | [Decimal](./lib-base.decimal.md) | |
| [infinite](./lib-base.decimal.infinite.md) | | this \| undefined | |
| [INFINITY](./lib-base.decimal.infinity.md) | <code>static</code> | [Decimal](./lib-base.decimal.md) | |
| [isZero](./lib-base.decimal.iszero.md) | | boolean | |
| [nonZero](./lib-base.decimal.nonzero.md) | | this \| undefined | |
| [ONE](./lib-base.decimal.one.md) | <code>static</code> | [Decimal](./lib-base.decimal.md) | |
| [zero](./lib-base.decimal.zero.md) | | this \| undefined | |
| [ZERO](./lib-base.decimal.zero.md) | <code>static</code> | [Decimal](./lib-base.decimal.md) | |

## Methods

| Method | Modifiers | Description |
| --- | --- | --- |
| [add(addend)](./lib-base.decimal.add.md) | | |
| [div(divider)](./lib-base.decimal.div.md) | | |
| [eq(that)](./lib-base.decimal.eq.md) | | |
| [from(decimalish)](./lib-base.decimal.from.md) | <code>static</code> | |
| [fromBigNumberString(bigNumberString)](./lib-base.decimal.frombignumberstring.md) | <code>static</code> | |
| [gt(that)](./lib-base.decimal.gt.md) | | |
| [gte(that)](./lib-base.decimal.gte.md) | | |
| [lt(that)](./lib-base.decimal.lt.md) | | |
| [lte(that)](./lib-base.decimal.lte.md) | | |
| [max(a, b)](./lib-base.decimal.max.md) | <code>static</code> | |
| [min(a, b)](./lib-base.decimal.min.md) | <code>static</code> | |
| [mul(multiplier)](./lib-base.decimal.mul.md) | | |
| [mulDiv(multiplier, divider)](./lib-base.decimal.muldiv.md) | | |
| [pow(exponent)](./lib-base.decimal.pow.md) | | |
| [prettify(precision)](./lib-base.decimal.prettify.md) | | |
| [shorten()](./lib-base.decimal.shorten.md) | | |
| [sub(subtrahend)](./lib-base.decimal.sub.md) | | |
| [toString(precision)](./lib-base.decimal.tostring.md) | | |

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [min](./decimal.decimal.min.md)
[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [Decimal](./lib-base.decimal.md) &gt; [min](./lib-base.decimal.min.md)

## Decimal.min() method

Expand All @@ -14,10 +14,10 @@ static min(a: Decimalish, b: Decimalish): Decimal;

| Parameter | Type | Description |
| --- | --- | --- |
| a | [Decimalish](./decimal.decimalish.md) | |
| b | [Decimalish](./decimal.decimalish.md) | |
| a | [Decimalish](./lib-base.decimalish.md) | |
| b | [Decimalish](./lib-base.decimalish.md) | |

<b>Returns:</b>

[Decimal](./decimal.decimal.md)
[Decimal](./lib-base.decimal.md)

Loading

0 comments on commit dbf1afd

Please sign in to comment.