-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump to contracts 1.1.4 * add estimateClaim * fix * Bump decimal.js from 10.3.1 to 10.4.0 (#1598) Bumps [decimal.js](https://github.com/MikeMcl/decimal.js) from 10.3.1 to 10.4.0. - [Release notes](https://github.com/MikeMcl/decimal.js/releases) - [Changelog](https://github.com/MikeMcl/decimal.js/blob/master/CHANGELOG.md) - [Commits](MikeMcl/decimal.js@v10.3.1...v10.4.0) --- updated-dependencies: - dependency-name: decimal.js dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @typescript-eslint/eslint-plugin from 5.33.1 to 5.36.2 (#1601) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.33.1 to 5.36.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.36.2/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint from 8.19.0 to 8.23.0 (#1602) Bumps [eslint](https://github.com/eslint/eslint) from 8.19.0 to 8.23.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.19.0...v8.23.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add graphql type (#1607) * add graphql type * Updating CodeExamples.md Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: GitHub Actions Bot <>
- Loading branch information
1 parent
ed0d04f
commit ad0e724
Showing
11 changed files
with
235 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { AbiItem } from 'web3-utils' | ||
import veFeeEstimate from '@oceanprotocol/contracts/artifacts/contracts/ve/veFeeEstimate.vy/veFeeEstimate.json' | ||
import { SmartContractWithAddress } from '../SmartContractWithAddress' | ||
import { VeOcean } from './VeOcean' | ||
/** | ||
* Provides an interface for veOcean contract | ||
*/ | ||
export class VeFeeEstimate extends SmartContractWithAddress { | ||
getDefaultAbi(): AbiItem | AbiItem[] { | ||
return veFeeEstimate.abi as AbiItem[] | ||
} | ||
|
||
/** | ||
* estimateClaim | ||
* @param {String} userAddress user address | ||
* @return {Promise<string>} | ||
*/ | ||
public async estimateClaim(userAddress: string): Promise<string> { | ||
const amount = await this.contract.methods.estimateClaim(userAddress).call() | ||
const veOcean = new VeOcean( | ||
await this.contract.methods.voting_escrow().call(), | ||
this.web3 | ||
) | ||
const amountFormated = await this.unitsToAmount(await veOcean.getToken(), amount) | ||
return amountFormated | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.