Skip to content

Commit

Permalink
7.2.0 (#114)
Browse files Browse the repository at this point in the history
* Suggest network UI

* Settings for custom chains

* Cleanup test env

* cleanup

* fix scrolling

* fix card scrolling

* add custom sign mode on sign and post

* St 347 kado multichain fiat integration (#111)

* feat: extension kado fiat ramp

---------

Co-authored-by: Joshua Brigati <[email protected]>
Co-authored-by: Alessandro Candeago <[email protected]>
Co-authored-by: Mike <[email protected]>
  • Loading branch information
4 people authored Apr 11, 2023
1 parent e82091b commit 4ef44f1
Show file tree
Hide file tree
Showing 15 changed files with 140 additions and 66 deletions.
5 changes: 5 additions & 0 deletions src/components/feedback/Modal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
padding: 48px 20px;
width: calc(100% - 40px);
}

&.minimal {
width: fit-content !important;
padding: 0 !important;
}
}

.close {
Expand Down
5 changes: 4 additions & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ export const SETUP = "https://setup-station.terra.money/"
export const MARS_TEST_EXPLORER = "https://testnet-explorer.marsprotocol.io"
export const MARS_EXPLORER = "https://explorer.marsprotocol.io"

/* website: fiat ramp */
export const FIAT_RAMP = "https://app.kado.money/"
export const KADO_API_KEY = "c22391a1-594f-4354-a742-187adb1b91bf"

/* website: stake */
export const TERRA_VALIDATORS =
"https://github.com/terra-money/validator-profiles/tree/master/validators/"

export const STAKE_ID = "https://stake.id/#/validator/"

/* ledger */
Expand Down
2 changes: 2 additions & 0 deletions src/extension/RequestContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ const RequestContainer = ({ children }: PropsWithChildren<{}>) => {
...parseDefault(postRequest),
tx: parseTx(postRequest),
requestType: "post",
signMode: postRequest.signMode,
})
} else if (signRequest) {
setTx({
...parseDefault(signRequest),
tx: parseTx(signRequest),
requestType: "sign",
signMode: signRequest.signMode,
})
} else if (bytesRequest) {
setTx({
Expand Down
1 change: 0 additions & 1 deletion src/extension/modules/ConfirmNewChain.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
.chain__card {
margin-top: 1rem;
margin-bottom: 2.4rem;

.header {
@include flex(space-between);
padding: var(--card-padding);
Expand Down
4 changes: 2 additions & 2 deletions src/extension/modules/ConfirmTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const ConfirmTx = (props: TxRequest | SignBytesRequest) => {
setSubmitting(true)

if ("tx" in props) {
const { requestType, tx } = props
const { requestType, tx, signMode } = props
const txOptions = tx

try {
Expand All @@ -80,7 +80,7 @@ const ConfirmTx = (props: TxRequest | SignBytesRequest) => {
if (openURL) openURL()
else navigate({ pathname, search })
} else {
const result = await auth[requestType](txOptions, password)
const result = await auth[requestType](txOptions, password, signMode)
const response = { result, success: true }
actions.tx(requestType, props, response, nextPassword)
}
Expand Down
1 change: 0 additions & 1 deletion src/extension/modules/Front.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const Front = () => {
if (chain) {
return <ConfirmNewChain {...chain} />
}

if (tx) {
return <ConfirmTx {...tx} />
}
Expand Down
10 changes: 9 additions & 1 deletion src/extension/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { useCallback } from "react"
import { CreateTxOptions, Fee, Msg, Tx } from "@terra-money/feather.js"
import {
CreateTxOptions,
Fee,
Msg,
SignatureV2,
Tx,
} from "@terra-money/feather.js"
import { useChainID, useNetwork } from "data/wallet"
import { isNil } from "ramda"
import extension from "extensionizer"
Expand Down Expand Up @@ -48,6 +54,7 @@ export interface PrimitiveTxRequest
chainID?: string
fee?: string
memo?: string
signMode?: SignatureV2.SignMode
}

export interface PrimitiveSignBytesRequest
Expand Down Expand Up @@ -78,6 +85,7 @@ export type RequestType = "sign" | "post" | "signBytes"
export interface TxRequest extends DefaultRequest {
tx: CreateTxOptions
requestType: "sign" | "post"
signMode?: SignatureV2.SignMode
}

export interface SignBytesRequest extends DefaultRequest {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/Asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Asset = (props: Props) => {
className={styles.asset}
key={token}
onClick={() =>
setRoute({ path: Path.coin, denom: token, previusPage: route })
setRoute({ path: Path.coin, denom: token, previousPage: route })
}
>
<section className={styles.details}>
Expand Down
12 changes: 2 additions & 10 deletions src/pages/wallet/AssetList.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.assetlist {
background-color: var(--card-bg-muted);
padding-top: 1.6rem;
padding-inline: 10px;
grid-area: list;

display: grid;
grid-template-areas: "title" "list";
grid-template-rows: min-content auto;
Expand All @@ -14,7 +14,7 @@
.assetlist__title {
@include flex(space-between);
padding-inline: 10px;
margin-bottom: 10px;
margin: 10px;
grid-area: title;
}

Expand All @@ -23,11 +23,3 @@
grid-area: list;
padding-bottom: 1.6rem;
}

.assetlist__add {
padding: 0.6rem 0.4rem;
width: 100%;
button {
width: 100%;
}
}
12 changes: 3 additions & 9 deletions src/pages/wallet/AssetList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormError } from "components/form"
import { Button } from "components/general"
import { InternalButton } from "components/general"
import { useBankBalance, useIsWalletEmpty } from "data/queries/bank"
import { useExchangeRates } from "data/queries/coingecko"
import { useNativeDenoms } from "data/token"
Expand All @@ -8,7 +8,6 @@ import { useTranslation } from "react-i18next"
import ManageTokens from "./ManageTokens"
import Asset from "./Asset"
import styles from "./AssetList.module.scss"
import AddIcon from "@mui/icons-material/Add"
import { useTokenFilters } from "utils/localStorage"
import { toInput } from "txs/utils"
import {
Expand Down Expand Up @@ -113,18 +112,13 @@ const AssetList = () => {
<article className={styles.assetlist}>
<div className={styles.assetlist__title}>
<h3>Assets</h3>
</div>
<div className={styles.assetlist__list}>{render()}</div>
<div className={styles.assetlist__add}>
<ManageTokens>
{(open) => (
<Button onClick={open}>
<AddIcon />
{t("Manage tokens")}
</Button>
<InternalButton onClick={open}>{t("Manage tokens")}</InternalButton>
)}
</ManageTokens>
</div>
<div className={styles.assetlist__list}>{render()}</div>
</article>
)
}
Expand Down
7 changes: 4 additions & 3 deletions src/pages/wallet/AssetPage.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
.details {
@include flex(center);
flex-direction: column;
width: 100%;

padding: 1.8rem 1rem;
padding-top: 2.6rem;
padding: 1.6rem;
height: fit-content;
background-color: var(--card-bg);
grid-area: details;
Expand Down Expand Up @@ -48,8 +48,9 @@
.actions {
@include flex(space-between);
background-color: var(--card-bg);
padding: 1rem;
padding-top: 0.6rem;
gap: 0.6rem;
width: 100%;

button {
min-width: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/wallet/AssetPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const AssetPage = () => {
setRoute({
path: Path.send,
denom,
previusPage: route,
previousPage: route,
})
}
>
Expand All @@ -85,7 +85,7 @@ const AssetPage = () => {
onClick={() =>
setRoute({
path: Path.receive,
previusPage: route,
previousPage: route,
})
}
>
Expand Down
43 changes: 33 additions & 10 deletions src/pages/wallet/NetWorth.module.scss
Original file line number Diff line number Diff line change
@@ -1,32 +1,55 @@
@import "mixins";

.networth {
@include flex-column;
padding: 1.6rem;
border-bottom: var(--border-width) solid var(--card-border);

p {
color: var(--text-muted);
font-size: 14px;
line-height: 140%;
}

h1 {
font-weight: 600;
font-size: 22pt;
font-size: 32px;
line-height: 150%;
margin-top: 4px;
}

grid-area: details;
height: fit-content;
background-color: var(--card-bg);
}

.networth__buttons {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 20px;
gap: 48px;
justify-content: center;
margin-top: 28px;
width: 100%;

.button__wrapper {
@include flex-column;
gap: 8px;
}

button {
min-width: 0;
width: 100%;
padding-block: 20px;
height: fit-content;
border-radius: 50%;
width: 60px;
height: 60px;
padding: 16px;
@include flex;
}
}

.icon {
font-size: 24px;

&.send {
transform: rotate(-90deg);
}
&.receive {
transform: rotate(90deg);
}
}
Loading

0 comments on commit 4ef44f1

Please sign in to comment.