Skip to content

Commit

Permalink
Merge branch 'sync-8.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
mwmerz committed Mar 19, 2024
2 parents 6c75cbe + dbb1367 commit 7da2c83
Show file tree
Hide file tree
Showing 56 changed files with 457 additions and 2,783 deletions.
612 changes: 347 additions & 265 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"@mui/icons-material": "^5.8.0",
"@mui/material": "^5.9.1",
"@sentry/react": "^7.53.1",
"@terra-money/feather.js": "1.0.11",
"@terra-money/feather.js": "^2.0.4",
"@terra-money/ledger-station-js": "^1.3.7",
"@terra-money/log-finder-ruleset": "^3.0.3",
"@terra-money/msg-reader": "^3.0.1",
"@terra-money/station-connector": "^1.0.17-beta.6",
"@terra-money/station-ui": "^1.0.6",
"@terra-money/station-connector": "^1.1.0",
"@terra-money/station-ui": "^1.0.12",
"@terra-money/terra-utils": "^1.2.0-beta.8",
"@terra-money/terra.js": "^3.1.9",
"@terra-money/terra.proto": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_version": 3,
"name": "Station Wallet",
"version": "8.0.7.1",
"version_name": "8.0.7.1",
"version": "8.0.8",
"version_name": "8.0.8",
"background": {
"service_worker": "background.js"
},
Expand Down
5 changes: 3 additions & 2 deletions scripts/contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,9 @@ function setupEvents() {
const createEvent = (changes, namespace) => {
if (namespace === "local") {
if (
changes.wallet &&
(changes.wallet.oldValue.address !== changes.wallet.newValue.address ||
changes.wallet && changes.wallet.oldValue && changes.wallet.newValue &&
(changes.wallet.oldValue.address !==
changes.wallet.newValue.address ||
changes.wallet.oldValue.name !== changes.wallet.newValue.name ||
Object.values(changes.wallet.oldValue.pubkey || {}).join(",") !==
Object.values(changes.wallet.newValue.pubkey || {}).join(","))
Expand Down
4 changes: 4 additions & 0 deletions src/app/InitNetworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { InterchainNetworks } from "types/network"
export const [useNetworks, NetworksProvider] = createContext<{
networks: InterchainNetworks
networksLoading: boolean
validationResultLength: number
validNetworksLength: number
filterEnabledNetworks: <T>(network: Record<string, T>) => Record<string, T>
filterDisabledNetworks: <T>(network: Record<string, T>) => Record<string, T>
}>("useNetworks")
Expand Down Expand Up @@ -82,6 +84,8 @@ const InitNetworks = ({ children }: PropsWithChildren<{}>) => {
value={{
networks,
networksLoading: validationState.isLoading,
validationResultLength: validationResult.length,
validNetworksLength: validNetworks.length,
filterEnabledNetworks: (networks) =>
Object.fromEntries(
Object.entries(networks ?? {}).filter(
Expand Down
2 changes: 1 addition & 1 deletion src/auth/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ const useAuth = () => {
Buffer.from(pk[networks[txOptions?.chainID].coinType] ?? "", "hex")
)
const w = lcd.wallet(key)
return await w.createAndSignTx(txOptions)
return await w.createAndSignTx({ ...txOptions, signMode })
}
}
}
Expand Down
197 changes: 0 additions & 197 deletions src/data/queries/gov.ts

This file was deleted.

9 changes: 8 additions & 1 deletion src/extension/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ const App = () => {
return <Welcome />
}
// main page
const hidePaths = ["/auth/", "/manage-wallet/", "/preferences"]
const hidePaths = [
"/auth/",
"/manage-wallet/",
"/preferences",
"/send",
"/swap",
"/receive",
]
const hideHeader = hidePaths.some((p) => location.pathname.startsWith(p))

return (
Expand Down
15 changes: 10 additions & 5 deletions src/extension/RequestContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { SignBytesRequest, TxResponse } from "./utils"
import { isBytes, isSign } from "./utils"
import { parseBytes, parseDefault, useParseTx, toData } from "./utils"
import { useChainID, useNetwork } from "data/wallet"
import { Fee } from "@terra-money/feather.js"

interface RequestContext {
requests: {
Expand All @@ -27,7 +28,7 @@ interface RequestContext {
tx: (
requestType: RequestType,
request: PrimitiveDefaultRequest,
response: TxResponse
response: TxResponse & { fee?: Fee }
) => void
multisigTx: (request: PrimitiveDefaultRequest) => void
pubkey: () => void
Expand Down Expand Up @@ -198,10 +199,14 @@ const RequestContainer = ({ children }: PropsWithChildren<{}>) => {
({ id, origin }) => id === request.id && origin === request.origin
)

const result = toData(
response.result,
networks[defaultChainID]?.isClassic
)
const fee = response.fee?.toAmino()

const result = {
fee,
...toData(response.result, networks[defaultChainID]?.isClassic),
}

// @ts-expect-error
const next = update(index, { ...list[index], ...response, result }, list)
browser.storage?.local.set({ [type]: next }).then(() => setTx(undefined))
})
Expand Down
10 changes: 7 additions & 3 deletions src/extension/modules/ConfirmTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const ConfirmTx = (props: TxRequest | SignBytesRequest) => {
const [feeDenom, setFeeDenom] = useState<string | undefined>(
"tx" in props
? props.tx.fee?.amount?.toData()?.[0]?.denom ??
(baseAsset in gasPrices ? baseAsset : Object.keys(gasPrices ?? {})[0])
(gasPrices &&
(baseAsset in gasPrices ? baseAsset : Object.keys(gasPrices)[0]))
: undefined
)

Expand Down Expand Up @@ -143,7 +144,10 @@ const ConfirmTx = (props: TxRequest | SignBytesRequest) => {
gas = tx.fee?.gas_limit || Math.ceil((estimatedGas ?? 0) * gasAdjustment)

fee = isClassic
? tx.fee
? tx.fee ??
new Fee(gas, {
[feeDenom as string]: Math.ceil(gasPrices[feeDenom as string] * gas),
})
: new Fee(gas, {
[feeDenom as string]: Math.ceil(gasPrices[feeDenom as string] * gas),
})
Expand Down Expand Up @@ -178,7 +182,7 @@ const ConfirmTx = (props: TxRequest | SignBytesRequest) => {
else navigate({ pathname, search })
} else {
const result = await auth[requestType](txOptions, password, signMode)
const response = { result, success: true }
const response = { result, success: true, fee }
actions.tx(requestType, props, response)
}
} catch (error) {
Expand Down
5 changes: 5 additions & 0 deletions src/pages/activity/ActivityList.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
width: 100%;
}

.chain__loader__container {
padding: 10px 10px 0px;
margin-bottom: 12px;
}

.loader {
color: var(--token-dark-900);
display: flex;
Expand Down
Loading

0 comments on commit 7da2c83

Please sign in to comment.