Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to ethers 5 and use BigNumber instead of BN #545

Draft
wants to merge 2 commits into
base: master-2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/classes/arc.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ ___

* **lastBalance**? : *undefined | string*

* **observable**? : *Observable‹BN›*
* **observable**? : *Observable‹BigNumber›*

* **observer**? : *Observer‹BN›*
* **observer**? : *Observer‹BigNumber›*

* **subscriptionsCount**: *number*

Expand Down Expand Up @@ -242,7 +242,7 @@ ___

### allowance

▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹BN›*
▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹BigNumber›*

*Defined in [src/arc.ts:402](https://github.com/daostack/arc.js/blob/6c661ff/src/arc.ts#L402)*

Expand All @@ -255,13 +255,13 @@ Name | Type | Description |
`owner` | [Address](../globals.md#address) | Address of the owner of the tokens |
`spender` | [Address](../globals.md#address) | Address of the spender |

**Returns:** *Observable‹BN›*
**Returns:** *Observable‹BigNumber›*

___

### approveForStaking

▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*
▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: BigNumber): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

*Defined in [src/arc.ts:392](https://github.com/daostack/arc.js/blob/6c661ff/src/arc.ts#L392)*

Expand All @@ -270,7 +270,7 @@ ___
Name | Type |
------ | ------ |
`spender` | [Address](../globals.md#address) |
`amount` | BN |
`amount` | BigNumber |

**Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

Expand Down Expand Up @@ -317,7 +317,7 @@ ___

### ethBalance

▸ **ethBalance**(`owner`: [Address](../globals.md#address)): *Observable‹BN›*
▸ **ethBalance**(`owner`: [Address](../globals.md#address)): *Observable‹BigNumber›*

*Defined in [src/arc.ts:202](https://github.com/daostack/arc.js/blob/6c661ff/src/arc.ts#L202)*

Expand All @@ -327,7 +327,7 @@ Name | Type |
------ | ------ |
`owner` | [Address](../globals.md#address) |

**Returns:** *Observable‹BN›*
**Returns:** *Observable‹BigNumber›*

___

Expand Down
6 changes: 3 additions & 3 deletions docs/classes/competitionscheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ ___

### ethBalance

▸ **ethBalance**(): *Promise‹Observable‹BN››*
▸ **ethBalance**(): *Promise‹Observable‹BigNumber››*

*Defined in [src/schemes/competition.ts:323](https://github.com/daostack/arc.js/blob/6c661ff/src/schemes/competition.ts#L323)*

get (an observable of) the Ether balance of the Competition from the web3Provider

**Returns:** *Promise‹Observable‹BN››*
**Returns:** *Promise‹Observable‹BigNumber››*

an observable stream of BN number instances
an observable stream of BigNumber number instances

___

Expand Down
6 changes: 3 additions & 3 deletions docs/classes/dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ ___

### ethBalance

▸ **ethBalance**(): *Promise‹Observable‹BN››*
▸ **ethBalance**(): *Promise‹Observable‹BigNumber››*

*Defined in [src/dao.ts:336](https://github.com/daostack/arc.js/blob/6c661ff/src/dao.ts#L336)*

get (an observable of) the Ether balance of the DAO from the web3Provider

**Returns:** *Promise‹Observable‹BN››*
**Returns:** *Promise‹Observable‹BigNumber››*

an observable stream of BN number instances
an observable stream of BigNumber number instances

___

Expand Down
4 changes: 2 additions & 2 deletions docs/classes/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ ___

### stake

▸ **stake**(`outcome`: [IProposalOutcome](../enums/iproposaloutcome.md), `amount`: BN): *[Operation](../globals.md#operation)‹[Stake](stake.md)›*
▸ **stake**(`outcome`: [IProposalOutcome](../enums/iproposaloutcome.md), `amount`: BigNumber): *[Operation](../globals.md#operation)‹[Stake](stake.md)›*

*Defined in [src/proposal.ts:715](https://github.com/daostack/arc.js/blob/6c661ff/src/proposal.ts#L715)*

Expand All @@ -224,7 +224,7 @@ Stake on this proposal
Name | Type | Description |
------ | ------ | ------ |
`outcome` | [IProposalOutcome](../enums/iproposaloutcome.md) | the outcome that is staked on, of type IProposalOutcome |
`amount` | BN | the amount, in GEN, to stake |
`amount` | BigNumber | the amount, in GEN, to stake |

**Returns:** *[Operation](../globals.md#operation)‹[Stake](stake.md)›*

Expand Down
8 changes: 4 additions & 4 deletions docs/classes/reputation.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ___

### mint

▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: BN): *[Operation](../globals.md#operation)‹undefined›*
▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: BigNumber): *[Operation](../globals.md#operation)‹undefined›*

*Defined in [src/reputation.ts:130](https://github.com/daostack/arc.js/blob/6c661ff/src/reputation.ts#L130)*

Expand All @@ -111,15 +111,15 @@ ___
Name | Type |
------ | ------ |
`beneficiary` | [Address](../globals.md#address) |
`amount` | BN |
`amount` | BigNumber |

**Returns:** *[Operation](../globals.md#operation)‹undefined›*

___

### reputationOf

▸ **reputationOf**(`address`: [Address](../globals.md#address)): *Observable‹BN›*
▸ **reputationOf**(`address`: [Address](../globals.md#address)): *Observable‹BigNumber›*

*Defined in [src/reputation.ts:102](https://github.com/daostack/arc.js/blob/6c661ff/src/reputation.ts#L102)*

Expand All @@ -129,7 +129,7 @@ Name | Type |
------ | ------ |
`address` | [Address](../globals.md#address) |

**Returns:** *Observable‹BN›*
**Returns:** *Observable‹BigNumber›*

___

Expand Down
20 changes: 10 additions & 10 deletions docs/classes/token.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ ___

### allowance

▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹BN›*
▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹BigNumber›*

*Defined in [src/token.ts:195](https://github.com/daostack/arc.js/blob/6c661ff/src/token.ts#L195)*

Expand All @@ -90,13 +90,13 @@ Name | Type |
`owner` | [Address](../globals.md#address) |
`spender` | [Address](../globals.md#address) |

**Returns:** *Observable‹BN›*
**Returns:** *Observable‹BigNumber›*

___

### approveForStaking

▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*
▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: BigNumber): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

*Defined in [src/token.ts:238](https://github.com/daostack/arc.js/blob/6c661ff/src/token.ts#L238)*

Expand All @@ -105,15 +105,15 @@ ___
Name | Type |
------ | ------ |
`spender` | [Address](../globals.md#address) |
`amount` | BN |
`amount` | BigNumber |

**Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

___

### balanceOf

▸ **balanceOf**(`owner`: string): *Observable‹BN›*
▸ **balanceOf**(`owner`: string): *Observable‹BigNumber›*

*Defined in [src/token.ts:140](https://github.com/daostack/arc.js/blob/6c661ff/src/token.ts#L140)*

Expand All @@ -123,7 +123,7 @@ Name | Type |
------ | ------ |
`owner` | string |

**Returns:** *Observable‹BN›*
**Returns:** *Observable‹BigNumber›*

___

Expand Down Expand Up @@ -155,7 +155,7 @@ ___

### mint

▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*
▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: BigNumber): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

*Defined in [src/token.ts:222](https://github.com/daostack/arc.js/blob/6c661ff/src/token.ts#L222)*

Expand All @@ -164,7 +164,7 @@ ___
Name | Type |
------ | ------ |
`beneficiary` | [Address](../globals.md#address) |
`amount` | BN |
`amount` | BigNumber |

**Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

Expand All @@ -188,7 +188,7 @@ ___

### transfer

▸ **transfer**(`beneficiary`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*
▸ **transfer**(`beneficiary`: [Address](../globals.md#address), `amount`: BigNumber): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

*Defined in [src/token.ts:230](https://github.com/daostack/arc.js/blob/6c661ff/src/token.ts#L230)*

Expand All @@ -197,7 +197,7 @@ ___
Name | Type |
------ | ------ |
`beneficiary` | [Address](../globals.md#address) |
`amount` | BN |
`amount` | BigNumber |

**Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹undefined››*

Expand Down
20 changes: 10 additions & 10 deletions docs/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,15 @@ ___

### fromWei

▸ **fromWei**(`amount`: BN): *string*
▸ **fromWei**(`amount`: BigNumber): *string*

*Defined in [src/utils.ts:28](https://github.com/daostack/arc.js/blob/6c661ff/src/utils.ts#L28)*

**Parameters:**

Name | Type |
------ | ------ |
`amount` | BN |
`amount` | BigNumber |

**Returns:** *string*

Expand Down Expand Up @@ -716,27 +716,27 @@ Name | Type |

* **limitExponentValue**: *number* = Number(params.limitExponentValue)

* **minimumDaoBounty**: *BN‹›* = new BN(params.minimumDaoBounty)
* **minimumDaoBounty**: *BigNumber‹›* = BigNumber.from(params.minimumDaoBounty)

* **preBoostedVotePeriodLimit**: *number* = Number(params.preBoostedVotePeriodLimit)

* **proposingRepReward**: *BN‹›* = new BN(params.proposingRepReward)
* **proposingRepReward**: *BigNumber‹›* = BigNumber.from(params.proposingRepReward)

* **queuedVotePeriodLimit**: *number* = Number(params.queuedVotePeriodLimit)

* **queuedVoteRequiredPercentage**: *number* = Number(params.queuedVoteRequiredPercentage)

* **quietEndingPeriod**: *number* = Number(params.quietEndingPeriod)

* **thresholdConst**: *number* = realMathToNumber(new BN(params.thresholdConst))
* **thresholdConst**: *number* = realMathToNumber(BigNumber.from(params.thresholdConst))

* **votersReputationLossRatio**: *number* = Number(params.votersReputationLossRatio)

___

### realMathToNumber

▸ **realMathToNumber**(`t`: BN): *number*
▸ **realMathToNumber**(`t`: BigNumber): *number*

*Defined in [src/utils.ts:126](https://github.com/daostack/arc.js/blob/6c661ff/src/utils.ts#L126)*

Expand All @@ -746,11 +746,11 @@ convert the number representation of RealMath.sol representations to real real n

Name | Type | Description |
------ | ------ | ------ |
`t` | BN | a BN instance of a real number in the RealMath representation |
`t` | BigNumber | a BigNumber instance of a real number in the RealMath representation |

**Returns:** *number*

a BN
a BigNumber

___

Expand Down Expand Up @@ -852,7 +852,7 @@ ___

### toWei

▸ **toWei**(`amount`: string | number): *BN*
▸ **toWei**(`amount`: string | number): *BigNumber*

*Defined in [src/utils.ts:33](https://github.com/daostack/arc.js/blob/6c661ff/src/utils.ts#L33)*

Expand All @@ -862,7 +862,7 @@ Name | Type |
------ | ------ |
`amount` | string | number |

**Returns:** *BN*
**Returns:** *BigNumber*

___

Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/iallowance.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

### amount

• **amount**: *BN*
• **amount**: *BigNumber*

*Defined in [src/token.ts:42](https://github.com/daostack/arc.js/blob/6c661ff/src/token.ts#L42)*

Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/iapproval.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ ___

### value

• **value**: *BN*
• **value**: *BigNumber*

*Defined in [src/token.ts:35](https://github.com/daostack/arc.js/blob/6c661ff/src/token.ts#L35)*
2 changes: 1 addition & 1 deletion docs/interfaces/icompetitionsuggestionstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ ___

### totalVotes

• **totalVotes**: *BN*
• **totalVotes**: *BigNumber*

*Defined in [src/schemes/competition.ts:84](https://github.com/daostack/arc.js/blob/6c661ff/src/schemes/competition.ts#L84)*

Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/icompetitionvotestate.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ___

### reputation

• **reputation**: *BN*
• **reputation**: *BigNumber*

*Defined in [src/schemes/competition.ts:98](https://github.com/daostack/arc.js/blob/6c661ff/src/schemes/competition.ts#L98)*

Expand Down
Loading