Skip to content

Commit

Permalink
Merge pull request #53 from mars-protocol/v1.7.5
Browse files Browse the repository at this point in the history
v1.7.5
  • Loading branch information
linkielink authored Feb 27, 2024
2 parents 51b70d4 + e4867e5 commit fb1b7ed
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OSMOSIS-1 #
NEXT_PUBLIC_OSMOSIS_RPC=https://rpc-osmosis.blockapsis.com
NEXT_PUBLIC_OSMOSIS_REST=https://lcd-osmosis.blockapsis.com
NEXT_PUBLIC_OSMOSIS_GQL=https://osmosis.rpc.p2p.world/4dqst8e8Cgd2HMb2HDNkimP7NIkcbjuk/hive/graphql
NEXT_PUBLIC_OSMOSIS_GQL=https://mainnet-osmosis-gql.marsprotocol.io/graphql

# PION-1 #
NEXT_PUBLIC_NEUTRON_TEST_RPC=https://rpc-palvus.pion-1.ntrn.tech/
Expand All @@ -11,4 +11,4 @@ NEXT_PUBLIC_NEUTRON_TEST_GQL=https://testnet-neutron-gql.marsprotocol.io/graphql
# NEUTRON-1 #
NEXT_PUBLIC_NEUTRON_RPC=https://rpc-kralum.neutron-1.neutron.org
NEXT_PUBLIC_NEUTRON_REST=https://rest-kralum.neutron-1.neutron.org
NEXT_PUBLIC_NEUTRON_GQL=https://neutron.rpc.p2p.world/qgrnU6PsQZA8F9S5Fb8Fn3tV3kXmMBl2M9bcc9jWLjQy8p/hive/graphql
NEXT_PUBLIC_NEUTRON_GQL=https://mainnet-neutron-gql.marsprotocol.io/graphql
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
tags: marsprotocol/interface:latest, marsprotocol/interface:${{ github.run_number }}
tags: marsprotocol/interface:${{ github.run_number }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mars",
"homepage": "./",
"version": "1.7.4",
"version": "1.7.5",
"private": false,
"license": "SEE LICENSE IN LICENSE FILE",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/NumberInput/NumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useState } from 'react'

import styles from './NumberInput.module.scss'

BigNumber.config({ EXPONENTIAL_AT: [-24, 20] })
BigNumber.config({ EXPONENTIAL_AT: 1e9 })

interface Props {
value: number
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Wallet/WalletConnectedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const WalletConnectedButton = () => {
2,
true,
false,
` ${baseCurrency.symbol}`,
` ${networkConfig.assets.base.symbol}`,
)}`
) : (
<CircularProgress className={styles.circularProgress} size={12} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useStore from 'store'

import styles from './TokenInput.module.scss'

BigNumber.config({ EXPONENTIAL_AT: [-24, 20] })
BigNumber.config({ EXPONENTIAL_AT: 1e9 })

interface Props {
tokens: string[]
Expand Down
8 changes: 8 additions & 0 deletions src/components/redbank/RedbankColumns.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
&.tia {
background-image: $colorGradientTIA;
}

&.wsteth {
background-image: $colorGradientWstETH;
}

&.stkatom {
background-image: $colorGradientStkATOM;
}
}

.logo {
Expand Down
58 changes: 57 additions & 1 deletion src/configs/neutron-1.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import atom from 'images/atom.svg'
import axlusdc from 'images/axlusdc.svg'
import axlweth from 'images/axlweth.svg'
import dydx from 'images/dydx.svg'
import mars from 'images/mars.svg'
import ntrn from 'images/ntrn.svg'
import osmo from 'images/osmo.svg'
import statom from 'images/statom.svg'
import stkatom from 'images/stkatom.svg'
import wsteth from 'images/wsteth.svg'
import colors from 'styles/_assets.module.scss'
import { ChainInfoID } from 'types/enums/wallet'

Expand Down Expand Up @@ -47,6 +51,45 @@ export const ASSETS: NetworkAssets = {
logo: statom,
decimals: 6,
},
stkatom: {
symbol: 'stkATOM',
id: 'stkATOM',
name: 'Persistence Staked Atom',
denom: 'ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445',
logo: stkatom,
color: colors.stkatom,
decimals: 6,
},
axlweth: {
symbol: 'WETH.axl',
id: 'axlWETH',
name: 'Axelar Wrapped Ethereum',
denom: 'ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D',
color: colors.weth,
logo: axlweth,
decimals: 18,
priceFeedId: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
},
wsteth: {
symbol: 'wstETH',
id: 'wstETH',
name: 'Lido Wrapped Staked Ethereum',
denom: 'factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH',
color: colors.wsteth,
logo: wsteth,
decimals: 18,
priceFeedId: '6df640f3b8963d8f8358f791f352b8364513f6ab1cca5ed3f1f7b5448980e784',
},
dydx: {
symbol: 'DYDX',
id: 'DYDX',
name: 'DyDx',
denom: 'ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130',
logo: dydx,
color: colors.dydx,
decimals: 18,
priceFeedId: '6489800bb8974169adfe35937bf6736507097d13c190d760c557108c7e93a81b',
},
}

const OTHER_ASSETS: { [denom: string]: OtherAsset } = {
Expand Down Expand Up @@ -98,14 +141,27 @@ export const NETWORK_CONFIG: NetworkConfig = {
},
assets: {
base: ASSETS.ntrn,
whitelist: [ASSETS.axlusdc, ASSETS.ntrn, ASSETS.atom, ASSETS.statom],
whitelist: [
ASSETS.axlusdc,
ASSETS.ntrn,
ASSETS.atom,
ASSETS.statom,
ASSETS.stkatom,
ASSETS.axlweth,
ASSETS.wsteth,
ASSETS.dydx,
],
other: [OTHER_ASSETS.usd, OTHER_ASSETS.mars, OTHER_ASSETS.osmo],
currencies: [
OTHER_ASSETS.usd,
ASSETS.axlusdc,
ASSETS.ntrn,
ASSETS.atom,
ASSETS.statom,
ASSETS.stkatom,
ASSETS.axlweth,
ASSETS.wsteth,
ASSETS.dydx,
OTHER_ASSETS.mars,
],
},
Expand Down
3 changes: 2 additions & 1 deletion src/functions/messages/getRedbankBorrowMsgOptions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BigNumber from 'bignumber.js'
import { FEE_EST_AMOUNT } from 'constants/appConstants'

export const getRedbankBorrowMsgOptions = (
Expand All @@ -8,7 +9,7 @@ export const getRedbankBorrowMsgOptions = (
msg: {
borrow: {
denom,
amount: amount === 0 ? FEE_EST_AMOUNT : amount.toFixed(0),
amount: amount === 0 ? FEE_EST_AMOUNT : new BigNumber(amount).toFixed(0),
},
},
}
Expand Down
4 changes: 3 additions & 1 deletion src/functions/messages/getRedbankDepositMsgOptions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import BigNumber from 'bignumber.js'

export const getRedbankDepositMsgOptions = (
amount: number,
denom: string,
): RedbankDepositMsgOptions => {
return {
msg: { deposit: {} },
funds: [{ denom, amount: amount.toFixed(0) }],
funds: [{ denom, amount: new BigNumber(amount).toFixed(0) }],
}
}
3 changes: 2 additions & 1 deletion src/functions/messages/getRedbankRepayMsgOptions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BigNumber from 'bignumber.js'
import { FEE_EST_AMOUNT } from 'constants/appConstants'

export const getRedbankRepayMsgOptions = (
Expand Down Expand Up @@ -27,7 +28,7 @@ export const getRedbankRepayMsgOptions = (
funds: [
{
denom,
amount: adjustedAmount === 0 ? FEE_EST_AMOUNT : adjustedAmount.toFixed(0),
amount: adjustedAmount === 0 ? FEE_EST_AMOUNT : new BigNumber(adjustedAmount).toFixed(0),
},
],
}
Expand Down
3 changes: 2 additions & 1 deletion src/functions/messages/getRedbankWithdrawMsgOptions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BigNumber from 'bignumber.js'
import { FEE_EST_AMOUNT } from 'constants/appConstants'

export const getRedbankWithdrawMsgOptions = (
Expand All @@ -12,7 +13,7 @@ export const getRedbankWithdrawMsgOptions = (

// If we want to withdraw all our amount, the SC accepts sending no amount and will default to withdrawing all available.
if (amount && amount > 0) {
msg.withdraw.amount = amount === 0 ? FEE_EST_AMOUNT : amount.toFixed(0)
msg.withdraw.amount = amount === 0 ? FEE_EST_AMOUNT : new BigNumber(amount).toFixed(0)
}

return { msg }
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/queries/useDepositAndDebt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export interface DepositAndDebtData {
TIADebt: string
stOSMODeposits: string
stOSMODebt: string
wstETHDeposits: string
wstETHDebt: string
stkATOMDeposits: string
stkATOMDebt: string
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/queries/useEditPosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const useEditPosition = (props: Props) => {
})
}

BigNumber.config({ EXPONENTIAL_AT: [-7, 30] })
BigNumber.config({ EXPONENTIAL_AT: 1e9 })
const minimumReceive = new BigNumber(isV2 || !minLpToReceive ? 0 : minLpToReceive)
.times(1 - slippage)
.integerValue(BigNumber.ROUND_CEIL)
Expand Down
42 changes: 42 additions & 0 deletions src/images/stkatom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/images/wsteth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/libs/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { ViewType } from 'types/enums'

import { countDecimals } from './math'

BigNumber.config({ EXPONENTIAL_AT: [-24, 20] })

BigNumber.config({ EXPONENTIAL_AT: 1e9 })
type Formatter = (amount: string, symbol: string, decimals: number) => string

const rm = BigNumber.ROUND_HALF_CEIL
Expand Down
2 changes: 1 addition & 1 deletion src/store/slices/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const vaultsSlice = (set: NamedSet<Store>, get: GetState<Store>): VaultsS

const promises = lpTokens.map(async (lpToken) => {
// Needed as lpTokenValues are very large from vaults
BigNumber.config({ EXPONENTIAL_AT: [-7, 30] })
BigNumber.config({ EXPONENTIAL_AT: 1e9 })

const amount = new BigNumber(lpToken.locked)
.plus(lpToken.unlocked || 0)
Expand Down
2 changes: 2 additions & 0 deletions src/styles/_assets.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
ntrn: $colorTokenNTRN;
tia: $colorTokenTIA;
stosmo: $colorTokenStOSMO;
wsteth: $colorTokenWstETH;
stkatom: $colorTokenStkATOM;

/* COLORS */
success: $colorInfoProfit;
Expand Down
4 changes: 4 additions & 0 deletions src/styles/_master.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ $colorTokenNTRN: #284fe0;
$colorTokenASTRO: #2233e2;
$colorTokenStOSMO: #e50571;
$colorTokenTIA: #8623ff;
$colorTokenWstETH: #00a3ff;
$colorTokenStkATOM: #c73238;

$colorGradientOSMO: linear-gradient(to bottom, #3a02e2, #e700ca);
$colorGradientATOM: linear-gradient(to bottom, #2e3148, #6f7390);
Expand All @@ -60,6 +62,8 @@ $colorGradientNTRN: linear-gradient(to bottom, #284fe0, #31d99c);
$colorGradientStOSMO: linear-gradient(to bottom, #e50571, #fb5da9);
$colorGradientTIA: linear-gradient(to bottom, #8623ff, #cfa7ff);
$colorGradientUSDT: linear-gradient(to bottom, #50af95, #b9dfd5);
$colorGradientWstETH: linear-gradient(to bottom, #00a3ff, #99daff);
$colorGradientStkATOM: linear-gradient(to bottom, #2e3148, #c73238);

/* Alpha Colors */
$alphaWhite10: rgba(255, 255, 255, 0.1);
Expand Down
4 changes: 4 additions & 0 deletions src/types/interfaces/asset.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ interface Asset {
| 'WETH.axl'
| 'TIA'
| 'stOSMO'
| 'wstETH'
| 'stkATOM'
id:
| 'OSMO'
| 'NTRN'
Expand All @@ -36,6 +38,8 @@ interface Asset {
| 'stATOM'
| 'TIA'
| 'stOSMO'
| 'wstETH'
| 'stkATOM'
prefix?: string
contract_addr?: string
logo: string
Expand Down
4 changes: 4 additions & 0 deletions src/types/interfaces/redbank.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ interface RedBankData {
TIAMarketIncentive: MarketIncentive | MultiAssetMarketIncentive[]
stOSMOMarket: Market
stOSMOMarketIncentive: MarketIncentive | MultiAssetMarketIncentive[]
wstETHMarket: Market
wstETHMarketIncentive: MarketIncentive | MultiAssetMarketIncentive[]
stkATOMMarket: Market
stkATOMMarketIncentive: MarketIncentive | MultiAssetMarketIncentive[]
collateral: UserCollateral[]
unclaimedRewards: string | Coin[]
}
Expand Down

0 comments on commit fb1b7ed

Please sign in to comment.