Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into rococo
Browse files Browse the repository at this point in the history
  • Loading branch information
mrq1911 committed Jan 18, 2024
2 parents b0738ba + 1d36cf2 commit 5cfe3b8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@galacticcouncil/math-lbp": "^0.1.3",
"@galacticcouncil/math-liquidity-mining": "^0.1.3",
"@galacticcouncil/math-xyk": "^0.1.3",
"@galacticcouncil/sdk": "^0.3.0",
"@galacticcouncil/sdk": "0.3.1",
"@galacticcouncil/ui": "^1.2.12",
"@lit-labs/react": "^1.1.0",
"@polkadot/api": "10.9.1",
Expand Down
10 changes: 0 additions & 10 deletions patches/@galacticcouncil+sdk+0.3.0.patch

This file was deleted.

12 changes: 7 additions & 5 deletions src/api/accountBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ const getTokenAccountBalancesList =
const [, assetId] = pairs[idx]

if (assetId.toString() === NATIVE_ASSET_ID) {
let {data} = natives[nativeIdx]
const frozen = data.feeFrozen ? data.feeFrozen.add(
data.miscFrozen,
) : data.frozen
values.push({
free: natives[nativeIdx].data.free,
reserved: natives[nativeIdx].data.reserved,
frozen: natives[nativeIdx].data.feeFrozen.add(
natives[nativeIdx].data.miscFrozen,
),
free: data.free,
reserved: data.reserved,
frozen,
})

nativeIdx += 1
Expand Down
4 changes: 2 additions & 2 deletions src/api/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const getTokenBalance =
if (id.toString() === NATIVE_ASSET_ID) {
const res = await api.query.system.account(account)
const freeBalance = new BigNumber(res.data.free.toHex())
const miscFrozenBalance = new BigNumber(res.data.miscFrozen.toHex())
const feeFrozenBalance = new BigNumber(res.data.feeFrozen.toHex())
const miscFrozenBalance = new BigNumber(res.data.miscFrozen ? res.data.miscFrozen.toHex() : res.data.frozen.toHex())
const feeFrozenBalance = new BigNumber(res.data.feeFrozen ? res.data.feeFrozen.toHex() : res.data.frozen.toHex())
const reservedBalance = new BigNumber(res.data.reserved.toHex())

const balance = new BigNumber(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ const getNativeBalances = (
const dp = BN_10.pow(decimals)
const free = balance.free.toBigNumber()
const reservedBN = balance.reserved.toBigNumber()
const feeFrozen = balance.feeFrozen.toBigNumber()
const miscFrozen = balance.miscFrozen.toBigNumber()
const feeFrozen = balance.feeFrozen ? balance.feeFrozen.toBigNumber() : balance.frozen.toBigNumber()
const miscFrozen = balance.miscFrozen ? balance.miscFrozen.toBigNumber() : balance.frozen.toBigNumber()

const total = free.plus(reservedBN).div(dp)
const totalUSD = total.times(spotPrice)
Expand Down
42 changes: 27 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1984,19 +1984,19 @@
integrity sha512-PybIwxqrPHJm96z5GWQPxIZgq8pGcNpM9tTyorxeHGbn2rF54QTN01TQNitn/jIQoByjZggo8szqdO1AktZH9A==

"@galacticcouncil/math-omnipool@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@galacticcouncil/math-omnipool/-/math-omnipool-0.1.3.tgz#45ccb95c8196768e8a96577f56f7f90d48dcb44b"
integrity sha512-uA0O+9KA+BlFeLyU7vhKKhJEiiKUwu5ozD14fhJ3vCm11XbGQPwEboChiICXAKysc8BMDejAqpKBmKOEjiRBaw==
version "0.1.4"
resolved "https://registry.yarnpkg.com/@galacticcouncil/math-omnipool/-/math-omnipool-0.1.4.tgz#4c7b29108e5e34cad35debc2a052e536ad9061eb"
integrity sha512-Hvkf+hGbzDvtRCTpp/x0aqaITy7ONLgajrVaSkV3bOeq1+q7gKRz+Lb0gxpwVwxp1DuzNqURi9C7uOfAwd2LTA==

"@galacticcouncil/math-xyk@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@galacticcouncil/math-xyk/-/math-xyk-0.1.3.tgz#d729a50ae19a29413718c41e1991bdaac1a040ec"
integrity sha512-tIXNOyBJO3eP4SDVuX4qtCk264cjba0dPi4aVGjinY5I6LtRYpOPt6zRypTaGiwHhfqOT6xWHiEHAa8jYhVU3A==

"@galacticcouncil/sdk@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@galacticcouncil/sdk/-/sdk-0.3.0.tgz#53c127096d834ef303248141170e7b7943bee722"
integrity sha512-besDXf9gLKooJh+Gdu2szka2WD12dguz2NzSo6GPw2Xa88larVDSt/E2xWq14QIU2/3XexLPRigaOsWgfxorGg==
"@galacticcouncil/[email protected].1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@galacticcouncil/sdk/-/sdk-0.3.1.tgz#e87ab5e948f64b0b5edd3056b1f0664f83add7da"
integrity sha512-ed/mMJWD9iYFcG3hg5jGOHsL/KibjJJLrr15nBHR4lC61SiiktuQbCkfDQGmHDTJpiC5bJt4TYGIWnkqLGsYEw==
dependencies:
"@galacticcouncil/math-lbp" "^0.1.3"
"@galacticcouncil/math-omnipool" "^0.1.3"
Expand Down Expand Up @@ -6097,11 +6097,16 @@ ci-info@^2.0.0:
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==

ci-info@^3.2.0, ci-info@^3.7.0:
ci-info@^3.2.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91"
integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==

ci-info@^3.7.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4"
integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==

classnames@^2.2.5:
version "2.3.2"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924"
Expand Down Expand Up @@ -10029,9 +10034,9 @@ patch-package@^6.5.0:
yaml "^1.10.2"

patch-package@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-7.0.0.tgz#5c646b6b4b4bf37e5184a6950777b21dea6bb66e"
integrity sha512-eYunHbnnB2ghjTNc5iL1Uo7TsGMuXk0vibX3RFcE/CdVdXzmdbMsG/4K4IgoSuIkLTI5oHrMQk4+NkFqSed0BQ==
version "7.0.2"
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-7.0.2.tgz#c01589bb6964854b5210506a5845d47900641f5a"
integrity sha512-PMYfL8LXxGIRmxXLqlEaBxzKPu7/SdP13ld6GSfAUJUZRmBDPp8chZs0dpzaAFn9TSPnFiMwkC6PJt6pBiAl8Q==
dependencies:
"@yarnpkg/lockfile" "^1.1.0"
chalk "^4.1.2"
Expand All @@ -10043,7 +10048,7 @@ patch-package@^7.0.0:
minimist "^1.2.6"
open "^7.4.2"
rimraf "^2.6.3"
semver "^5.6.0"
semver "^7.5.3"
slash "^2.0.0"
tmp "^0.0.33"
yaml "^2.2.2"
Expand Down Expand Up @@ -11075,6 +11080,13 @@ semver@^7.3.7:
dependencies:
lru-cache "^6.0.0"

semver@^7.5.3:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

semver@~7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
Expand Down Expand Up @@ -12487,9 +12499,9 @@ yaml@^1.10.0, yaml@^1.10.2:
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==

yaml@^2.2.2:
version "2.3.1"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
version "2.3.4"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2"
integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==

yargs-parser@^13.1.2:
version "13.1.2"
Expand Down

0 comments on commit 5cfe3b8

Please sign in to comment.