Skip to content

Commit

Permalink
Merge pull request #161 from 00labs/v2-merge
Browse files Browse the repository at this point in the history
Resolve V2 merge conflicts
  • Loading branch information
mliu authored Mar 14, 2024
2 parents 5ff3b81 + 62996f6 commit a615382
Show file tree
Hide file tree
Showing 19 changed files with 308 additions and 202 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.0.47"
"version": "0.0.50"
}
4 changes: 2 additions & 2 deletions packages/huma-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@huma-finance/sdk",
"version": "0.0.47",
"version": "0.0.50",
"types": "./dist/index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/index.js",
Expand Down Expand Up @@ -28,7 +28,7 @@
"@ethersproject/constants": "^5.7.0",
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.6.0",
"@huma-finance/shared": "^0.0.47",
"@huma-finance/shared": "^0.0.50",
"axios": "^1.4.0",
"bignumber.js": "^9.1.1",
"ethers": "^5.7.2",
Expand Down
19 changes: 10 additions & 9 deletions packages/huma-sdk/src/services/SubgraphService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ function getRWReceivableInfo(

type PoolStats = {
id: string
totalPoolAssets: number
amountCreditOriginated: number
amountCreditRepaid: number
amountCreditDefaulted: number
Expand All @@ -227,15 +228,15 @@ function getPoolStats(
}

const PoolStatsQuery = `
query {
poolStat(id:"${pool?.toLowerCase()}") {
id
amountCreditOriginated
amountCreditRepaid
amountCreditDefaulted
}
}
`
query {
poolStat(id:"${pool?.toLowerCase()}") {
id
amountCreditOriginated
amountCreditRepaid
amountCreditDefaulted
totalPoolAssets
}
}`

return requestPost<{
errors?: unknown
Expand Down
4 changes: 2 additions & 2 deletions packages/huma-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@huma-finance/shared",
"version": "0.0.47",
"version": "0.0.50",
"types": "./dist/index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/index.js",
Expand Down Expand Up @@ -39,7 +39,7 @@
"@mui/system": "^5.0.6",
"@mui/x-date-pickers": "^5.0.7",
"@reduxjs/toolkit": "^1.8.6",
"@requestnetwork/multi-format": "^0.15.10",
"@requestnetwork/multi-format": "0.15.10",
"@types/utf8": "^3.0.1",
"@walletconnect/ethereum-provider": "1.8.0",
"@walletconnect/jsonrpc-http-connection": "^1.0.3",
Expand Down
6 changes: 4 additions & 2 deletions packages/huma-shared/src/utils/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ export const downScale = <T = string>(
}

export const upScale = <T = string>(
num: string | number,
num: string | number | BigNumber,
decimals?: number,
): T => {
if (isEmpty(num) || isEmpty(decimals)) {
return num as T
}
const result = Number(num) * 10 ** decimals!
const result = BigNumber.isBigNumber(num)
? num.mul(BigNumber.from(10).pow(decimals!))
: Number(num) * 10 ** decimals!
if (typeof num === 'string') {
return String(result) as T
}
Expand Down
Loading

0 comments on commit a615382

Please sign in to comment.