Skip to content

Commit

Permalink
Merge branch 'main' into koltenb-copy-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cvalkan authored Feb 10, 2021
2 parents 8ecd318 + 584b501 commit e16ecd3
Show file tree
Hide file tree
Showing 94 changed files with 1,578 additions and 1,309 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ Gas cost will be worst case `O(n)`, where n is the size of the `SortedTroves` li

Gas cost of steps 2-4 will be free, and step 5 will be `O(1)`.

Hints allow cheaper Trove operations for the user, at the expense of a slightly longer time to completion, due to the need to await the result of the two read calls in steps 1 and 2 - which may be sent as JSON-RPC requests to Infura, unless the front end operator is running a full Ethereum node.
Hints allow cheaper Trove operations for the user, at the expense of a slightly longer time to completion, due to the need to await the result of the two read calls in steps 1 and 2 - which may be sent as JSON-RPC requests to Infura, unless the Frontend Operator is running a full Ethereum node.

Each BorrowerOperations function that reinserts a Trove takes a single hint, as does `StabilityPool::withdrawFromSPtoTrove(...)`.

Expand Down
20 changes: 0 additions & 20 deletions docs/sdk/decimal.decimal._constructor_.md

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<!-- 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; [bigNumberFrom](./decimal.decimal.bignumberfrom.md)
[Home](./index.md) &gt; [@liquity/decimal](./decimal.md) &gt; [Decimal](./decimal.decimal.md) &gt; [fromBigNumberString](./decimal.decimal.frombignumberstring.md)

## Decimal.bigNumberFrom() method
## Decimal.fromBigNumberString() method

<b>Signature:</b>

```typescript
static bigNumberFrom(decimalish: Decimalish): BigNumber;
static fromBigNumberString(bigNumberString: string): Decimal;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| decimalish | [Decimalish](./decimal.decimalish.md) | |
| bigNumberString | string | |

<b>Returns:</b>

BigNumber
[Decimal](./decimal.decimal.md)

15 changes: 4 additions & 11 deletions docs/sdk/decimal.decimal.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,29 @@

## Decimal class

Fixed-point decimal bignumber with 18 digits of precision.

<b>Signature:</b>

```typescript
export declare class Decimal
```

## Constructors
## Remarks

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(bigNumber)](./decimal.decimal._constructor_.md) | | Constructs a new instance of the <code>Decimal</code> class |
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 |
| --- | --- | --- | --- |
| [absoluteValue](./decimal.decimal.absolutevalue.md) | | this | |
| [bigNumber](./decimal.decimal.bignumber.md) | | BigNumber | |
| [DIGITS](./decimal.decimal.digits.md) | <code>static</code> | BigNumber | |
| [finite](./decimal.decimal.finite.md) | | this \| undefined | |
| [HALF](./decimal.decimal.half.md) | <code>static</code> | [Decimal](./decimal.decimal.md) | |
| [infinite](./decimal.decimal.infinite.md) | | this \| undefined | |
| [INFINITY](./decimal.decimal.infinity.md) | <code>static</code> | [Decimal](./decimal.decimal.md) | |
| [isZero](./decimal.decimal.iszero.md) | | boolean | |
| [nonZero](./decimal.decimal.nonzero.md) | | this \| undefined | |
| [ONE](./decimal.decimal.one.md) | <code>static</code> | [Decimal](./decimal.decimal.md) | |
| [PRECISION](./decimal.decimal.precision.md) | <code>static</code> | (not declared) | |
| [zero](./decimal.decimal.zero.md) | | this \| undefined | |
| [ZERO](./decimal.decimal.zero.md) | <code>static</code> | [Decimal](./decimal.decimal.md) | |

Expand All @@ -40,10 +35,10 @@ export declare class Decimal
| Method | Modifiers | Description |
| --- | --- | --- |
| [add(addend)](./decimal.decimal.add.md) | | |
| [bigNumberFrom(decimalish)](./decimal.decimal.bignumberfrom.md) | <code>static</code> | |
| [div(divider)](./decimal.decimal.div.md) | | |
| [eq(that)](./decimal.decimal.eq.md) | | |
| [from(decimalish)](./decimal.decimal.from.md) | <code>static</code> | |
| [fromBigNumberString(bigNumberString)](./decimal.decimal.frombignumberstring.md) | <code>static</code> | |
| [gt(that)](./decimal.decimal.gt.md) | | |
| [gte(that)](./decimal.decimal.gte.md) | | |
| [lt(that)](./decimal.decimal.lt.md) | | |
Expand All @@ -54,9 +49,7 @@ export declare class Decimal
| [mulDiv(multiplier, divider)](./decimal.decimal.muldiv.md) | | |
| [pow(exponent)](./decimal.decimal.pow.md) | | |
| [prettify(precision)](./decimal.decimal.prettify.md) | | |
| [prettify(bigNumberish)](./decimal.decimal.prettify.md) | <code>static</code> | |
| [shorten()](./decimal.decimal.shorten.md) | | |
| [shorten(bigNumber)](./decimal.decimal.shorten.md) | <code>static</code> | |
| [sub(subtrahend)](./decimal.decimal.sub.md) | | |
| [toString(precision)](./decimal.decimal.tostring.md) | | |

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

This file was deleted.

4 changes: 2 additions & 2 deletions docs/sdk/decimal.decimal.prettify.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<b>Signature:</b>

```typescript
static prettify(bigNumberish: BigNumberish): string;
prettify(precision?: number): string;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| bigNumberish | BigNumberish | |
| precision | number | |

<b>Returns:</b>

Expand Down
9 changes: 1 addition & 8 deletions docs/sdk/decimal.decimal.shorten.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@
<b>Signature:</b>

```typescript
static shorten(bigNumber: BigNumber): string;
shorten(): string;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| bigNumber | BigNumber | |

<b>Returns:</b>

string
Expand Down
1 change: 1 addition & 0 deletions docs/sdk/decimal.decimalish.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## Decimalish type

Types that can be converted into a Decimal.

<b>Signature:</b>

Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/decimal.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

| Class | Description |
| --- | --- |
| [Decimal](./decimal.decimal.md) | |
| [Decimal](./decimal.decimal.md) | Fixed-point decimal bignumber with 18 digits of precision. |

## Type Aliases

| Type Alias | Description |
| --- | --- |
| [Decimalish](./decimal.decimalish.md) | |
| [Decimalish](./decimal.decimalish.md) | Types that can be converted into a Decimal. |

1 change: 1 addition & 0 deletions docs/sdk/lib-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
| [TroveAdjustmentDetails](./lib-base.troveadjustmentdetails.md) | Details of an [adjustTrove()](./lib-base.transactableliquity.adjusttrove.md) transaction. |
| [TroveClosureDetails](./lib-base.troveclosuredetails.md) | Details of a [closeTrove()](./lib-base.transactableliquity.closetrove.md) transaction. |
| [TroveCreationDetails](./lib-base.trovecreationdetails.md) | Details of an [openTrove()](./lib-base.transactableliquity.opentrove.md) transaction. |
| [TroveListingParams](./lib-base.trovelistingparams.md) | Parameters of the [getTroves()](./lib-base.readableliquity.gettroves_1.md) function. |

## Variables

Expand Down
31 changes: 0 additions & 31 deletions docs/sdk/lib-base.readableliquity.getfirsttroves.md

This file was deleted.

40 changes: 0 additions & 40 deletions docs/sdk/lib-base.readableliquity.getlasttroves.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/sdk/lib-base.readableliquity.gettotalredistributed.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ Promise&lt;[Trove](./lib-base.trove.md)<!-- -->&gt;

Needed when dealing with instances of [TroveWithPendingRedistribution](./lib-base.trovewithpendingredistribution.md)<!-- -->.

## Example

See [getLastTroves()](./lib-base.readableliquity.getlasttroves.md) for an example of how it's used.

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

[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [ReadableLiquity](./lib-base.readableliquity.md) &gt; [getTroves](./lib-base.readableliquity.gettroves_1.md)

## ReadableLiquity.getTroves() method

Get a slice from the list of Troves.

<b>Signature:</b>

```typescript
getTroves(params: TroveListingParams): Promise<[address: string, trove: Trove][]>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| params | [TroveListingParams](./lib-base.trovelistingparams.md) | Controls how the list is sorted, and where the slice begins and ends. |

<b>Returns:</b>

Promise&lt;\[address: string, trove: [Trove](./lib-base.trove.md)<!-- -->\]\[\]&gt;

Pairs of owner addresses and their Troves.

3 changes: 1 addition & 2 deletions docs/sdk/lib-base.readableliquity.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ Implemented by [EthersLiquity](./lib-ethers.ethersliquity.md)<!-- -->.
| --- | --- |
| [getCollateralSurplusBalance(address)](./lib-base.readableliquity.getcollateralsurplusbalance.md) | Get the amount of leftover collateral available for withdrawal by an address. |
| [getFees()](./lib-base.readableliquity.getfees.md) | Get a calculator for current fees. |
| [getFirstTroves(startIdx, numberOfTroves)](./lib-base.readableliquity.getfirsttroves.md) | Get a slice from the list of Troves sorted by collateral ratio in descending order. |
| [getFrontendStatus(address)](./lib-base.readableliquity.getfrontendstatus.md) | Check whether an address is registered as a Liquity frontend, and what its kickback rate is. |
| [getLastTroves(startIdx, numberOfTroves)](./lib-base.readableliquity.getlasttroves.md) | Get a slice from the list of Troves sorted by collateral ratio in ascending order. |
| [getLQTYBalance(address)](./lib-base.readableliquity.getlqtybalance.md) | Get the amount of LQTY held by an address. |
| [getLQTYStake(address)](./lib-base.readableliquity.getlqtystake.md) | Get the current state of an LQTY Stake. |
| [getLUSDBalance(address)](./lib-base.readableliquity.getlusdbalance.md) | Get the amount of LUSD held by an address. |
Expand All @@ -37,4 +35,5 @@ Implemented by [EthersLiquity](./lib-ethers.ethersliquity.md)<!-- -->.
| [getTotalStakedLQTY()](./lib-base.readableliquity.gettotalstakedlqty.md) | Get the total amount of LQTY currently staked. |
| [getTrove(address)](./lib-base.readableliquity.gettrove.md) | Get the current state of a Trove. |
| [getTroveBeforeRedistribution(address)](./lib-base.readableliquity.gettrovebeforeredistribution.md) | Get a Trove in its state after the last direct modification. |
| [getTroves(params)](./lib-base.readableliquity.gettroves_1.md) | Get a slice from the list of Troves. |

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

[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [TroveListingParams](./lib-base.trovelistingparams.md) &gt; [beforeRedistribution](./lib-base.trovelistingparams.beforeredistribution.md)

## TroveListingParams.beforeRedistribution property

When set to `true`<!-- -->, the retrieved Troves won't include the liquidation shares received since the last time they were directly modified.

<b>Signature:</b>

```typescript
readonly beforeRedistribution?: boolean;
```

## Remarks

Changes the type of returned Troves to [TroveWithPendingRedistribution](./lib-base.trovewithpendingredistribution.md)<!-- -->.

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

[Home](./index.md) &gt; [@liquity/lib-base](./lib-base.md) &gt; [TroveListingParams](./lib-base.trovelistingparams.md) &gt; [first](./lib-base.trovelistingparams.first.md)

## TroveListingParams.first property

Number of Troves to retrieve.

<b>Signature:</b>

```typescript
readonly first: number;
```
Loading

0 comments on commit e16ecd3

Please sign in to comment.