Skip to content

Commit

Permalink
Hotfix 1.12.2 (#645)
Browse files Browse the repository at this point in the history
* Fix historical price fetching

* Fix conditional allowance contracts

* 1.12.2
  • Loading branch information
garethfuller authored Aug 9, 2021
1 parent edae0f3 commit 5193ad3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@balancer-labs/frontend-v2",
"version": "1.12.1",
"version": "1.12.2",
"engines": {
"node": "14.x",
"npm": ">=7"
Expand Down
10 changes: 8 additions & 2 deletions src/providers/tokens.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ export default {
},
allowanceContracts: [
networkConfig.addresses.vault,
networkConfig.addresses.exchangeProxy,
GP_ALLOWANCE_MANAGER_CONTRACT_ADDRESS
...(networkConfig.addresses.exchangeProxy
? [networkConfig.addresses.exchangeProxy]
: []),
...(GP_ALLOWANCE_MANAGER_CONTRACT_ADDRESS
? [GP_ALLOWANCE_MANAGER_CONTRACT_ADDRESS]
: [])
]
});

Expand Down Expand Up @@ -281,6 +285,8 @@ export default {
contractAddress: string = networkConfig.addresses.vault
): string[] {
return tokenAddresses.filter((address, index) => {
if (!contractAddress) return false;

const amount = Number(amounts[index]);
const allowance = bnum(allowances.value[contractAddress][address]);

Expand Down
6 changes: 5 additions & 1 deletion src/services/coingecko/api/price.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export class PriceService {
const requests: Promise<HistoricalPriceResponse>[] = [];

addresses.forEach(address => {
const endpoint = `/coins/${this.platformId}/contract/${address}/market_chart/range?vs_currency=${this.fiatParam}&from=${start}&to=${end}`;
const endpoint = `/coins/${
this.platformId
}/contract/${address.toLowerCase()}/market_chart/range?vs_currency=${
this.fiatParam
}&from=${start}&to=${end}`;
const request = retryPromiseWithDelay(
this.client.get<HistoricalPriceResponse>(endpoint),
3, // retryCount
Expand Down

3 comments on commit 5193ad3

@vercel
Copy link

@vercel vercel bot commented on 5193ad3 Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5193ad3 Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5193ad3 Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app – ./

app-balancer.vercel.app
app-git-master-balancer.vercel.app
pm2.vercel.app
app.balancer.fi

Please sign in to comment.