Skip to content

Commit

Permalink
Merge pull request #55 from hexaonelabs/fix/aave-address
Browse files Browse the repository at this point in the history
fix: upd address
  • Loading branch information
FazioNico authored Nov 26, 2024
2 parents 80bbb54 + 4726453 commit a60448d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
26 changes: 15 additions & 11 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
},
"dependencies": {
"@0xsquid/widget": "^1.6.23",
"@aave/contract-helpers": "^1.21.1",
"@aave/math-utils": "^1.21.1",
"@aave/contract-helpers": "1.30.2",
"@aave/math-utils": "1.30.2",
"@avalabs/avalanchejs": "^3.17.0",
"@bgd-labs/aave-address-book": "^2.19.0",
"@bgd-labs/aave-address-book": "3.7.0",
"@bitcoinerlab/secp256k1": "^1.1.1",
"@capacitor-community/barcode-scanner": "^4.0.1",
"@capacitor/android": "^5.0.0",
Expand Down
26 changes: 12 additions & 14 deletions src/servcies/aave.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
UiIncentiveDataProvider,
UiPoolDataProvider,
WalletBalanceProvider,
ChainId
} from "@aave/contract-helpers";
import { Signer, Wallet, ethers, providers } from "ethers";
import * as MARKETS from "@bgd-labs/aave-address-book";
Expand All @@ -15,7 +16,6 @@ import {
formatUserSummary,
formatUserSummaryAndIncentives,
} from "@aave/math-utils";
import { ChainId } from "@aave/contract-helpers";
import { CHAIN_AVAILABLES } from "../constants/chains";
import { IUserSummary } from "../interfaces/reserve.interface";
import { IAavePool } from "@/pool/Aave.pool";
Expand Down Expand Up @@ -328,14 +328,10 @@ export const getMarkets = (chainId: number) => {
/**
* HERE TESTNETS
*/
case chainId === MARKETS.AaveV3ArbitrumGoerli.CHAIN_ID:
return MARKETS.AaveV3ArbitrumGoerli;
case chainId === MARKETS.AaveV3Sepolia.CHAIN_ID:
return MARKETS.AaveV3Sepolia;
case chainId === MARKETS.AaveV3Mumbai.CHAIN_ID:
return MARKETS.AaveV3Mumbai;
case chainId === MARKETS.AaveV3Fuji.CHAIN_ID:
return MARKETS.AaveV3Fuji;
// case chainId === MARKETS.AaveV3Fuji.CHAIN_ID:
// return MARKETS.AaveV3Fuji;
default:
throw new Error(`ChainId ${chainId} not supported`);
}
Expand All @@ -350,16 +346,20 @@ export const getPools = async (ops: {
const provider = new ethers.providers.JsonRpcProvider(
CHAIN_AVAILABLES.find((c) => c.id === chainId)?.rpcUrl||''
);
console.log('>>>> setup provider AAVE: ', chainId, provider )
// View contract used to fetch all reserves data (including market base currency data), and user reserves
const poolDataProviderContract = new UiPoolDataProvider({
uiPoolDataProviderAddress: market.UI_POOL_DATA_PROVIDER,
provider,
chainId,
});
console.log('>>>xxx >', poolDataProviderContract)
const { reservesData: reserves, baseCurrencyData } =
await poolDataProviderContract.getReservesHumanized({
lendingPoolAddressProvider: market.POOL_ADDRESSES_PROVIDER,
});
await poolDataProviderContract.getReservesHumanized({
lendingPoolAddressProvider: market.POOL_ADDRESSES_PROVIDER,
});

console.log('>>>> yyy', reserves)
const {
marketReferenceCurrencyDecimals,
marketReferenceCurrencyPriceInUsd: marketReferencePriceInUsd,
Expand Down Expand Up @@ -554,7 +554,7 @@ const getWalletBalance = async (ops: {
});
console.log(
"[INFO] {{AAVEService}} formattedPoolReserves: ",
formattedPoolReserves
{formattedPoolReserves, walletbalancesByPools}
);
// const userData = await formatUserSummaryAndIncentives({
// currentTimestamp,
Expand Down Expand Up @@ -616,7 +616,6 @@ export type MARKETTYPE =
| typeof MARKETS.AaveV3Polygon
| typeof MARKETS.AaveV3Avalanche
| typeof MARKETS.AaveV3Arbitrum
| typeof MARKETS.AaveV3ArbitrumGoerli
| typeof MARKETS.AaveV3Optimism
| typeof MARKETS.AaveV3BNB
| typeof MARKETS.AaveV3PolygonZkEvm
Expand All @@ -625,8 +624,7 @@ export type MARKETTYPE =
/**
* HERE TESTNETS
*/
| typeof MARKETS.AaveV3Mumbai
| typeof MARKETS.AaveV3Fuji
// | typeof MARKETS.AaveV3Fuji
| typeof MARKETS.AaveV3Sepolia;

export const permitByChainAndToken: {
Expand Down

0 comments on commit a60448d

Please sign in to comment.